summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ANSI_C_Programming/chapter1.ipynb200
-rw-r--r--ANSI_C_Programming/chapter10.ipynb768
-rw-r--r--ANSI_C_Programming/chapter11.ipynb533
-rw-r--r--ANSI_C_Programming/chapter12.ipynb1455
-rw-r--r--ANSI_C_Programming/chapter13.ipynb712
-rw-r--r--ANSI_C_Programming/chapter14.ipynb407
-rw-r--r--ANSI_C_Programming/chapter15.ipynb691
-rw-r--r--ANSI_C_Programming/chapter2.ipynb782
-rw-r--r--ANSI_C_Programming/chapter3.ipynb1590
-rw-r--r--ANSI_C_Programming/chapter4.ipynb389
-rw-r--r--ANSI_C_Programming/chapter5.ipynb971
-rw-r--r--ANSI_C_Programming/chapter6.ipynb1731
-rw-r--r--ANSI_C_Programming/chapter7.ipynb767
-rw-r--r--ANSI_C_Programming/chapter8.ipynb1400
-rw-r--r--ANSI_C_Programming/chapter9.ipynb958
-rw-r--r--ANSI_C_Programming/screenshots/code1.pngbin0 -> 102009 bytes
-rw-r--r--ANSI_C_Programming/screenshots/code2.pngbin0 -> 92400 bytes
-rw-r--r--ANSI_C_Programming/screenshots/code3.pngbin0 -> 93166 bytes
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter1.ipynb503
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter2.ipynb342
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter3.ipynb606
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter4.ipynb1115
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter5.ipynb1043
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/README.txt10
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k1.pngbin0 -> 16503 bytes
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k2.pngbin0 -> 18858 bytes
-rw-r--r--A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k3.pngbin0 -> 14827 bytes
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/README.txt10
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb378
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch2.ipynb710
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch3.ipynb724
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch4.ipynb960
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch5.ipynb1393
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch6.ipynb787
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch7.ipynb888
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch8.ipynb1489
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch9.ipynb1102
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-1.pngbin0 -> 26170 bytes
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-2.pngbin0 -> 20908 bytes
-rw-r--r--A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-3.pngbin0 -> 25062 bytes
-rw-r--r--Basic_Mechanical_Engineering/README.txt10
-rw-r--r--Basic_Mechanical_Engineering/bme1.ipynb1510
-rw-r--r--Basic_Mechanical_Engineering/bme2.ipynb1447
-rw-r--r--Basic_Mechanical_Engineering/bme6.ipynb942
-rw-r--r--Basic_Mechanical_Engineering/screenshots/ravi1.pngbin0 -> 65309 bytes
-rw-r--r--Basic_Mechanical_Engineering/screenshots/ravi2.pngbin0 -> 45601 bytes
-rw-r--r--Basic_Mechanical_Engineering/screenshots/ravi3.pngbin0 -> 40175 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/README.txt10
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch1.ipynb305
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch10.ipynb793
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch11.ipynb498
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch12.ipynb368
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch13.ipynb426
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch14.ipynb190
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch15.ipynb75
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch16.ipynb190
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch17.ipynb326
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch18.ipynb281
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch19.ipynb314
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch2.ipynb941
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch20.ipynb166
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch21.ipynb246
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch22.ipynb292
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch23.ipynb538
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch24.ipynb557
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch25.ipynb610
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch26.ipynb328
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch27.ipynb339
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch28.ipynb223
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch29.ipynb290
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch3.ipynb334
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch4.ipynb117
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch5.ipynb239
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch6.ipynb170
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch7.ipynb152
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch8.ipynb449
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb514
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms.pngbin0 -> 12889 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_1.pngbin0 -> 12889 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_2.pngbin0 -> 12889 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_3.pngbin0 -> 12889 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/bb.pngbin0 -> 75537 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/cc.pngbin0 -> 53395 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart.pngbin0 -> 15153 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_1.pngbin0 -> 15153 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_2.pngbin0 -> 15153 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_3.pngbin0 -> 15153 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater.pngbin0 -> 5133 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_1.pngbin0 -> 5133 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_2.pngbin0 -> 5133 bytes
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_3.pngbin0 -> 5133 bytes
-rw-r--r--Beginning_C_By_Ivon_Horton/README.txt10
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter1.ipynb260
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter10.ipynb846
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter11.ipynb2119
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter12.ipynb738
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter13.ipynb330
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter14.ipynb342
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter2.ipynb823
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter3.ipynb706
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter4.ipynb954
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter5.ipynb1080
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter6.ipynb573
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter7.ipynb902
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter8.ipynb359
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter9.ipynb826
-rw-r--r--Beginning_C_By_Ivon_Horton/screenshots/vaibbhav_vajani-3.pngbin0 -> 6864 bytes
-rw-r--r--Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-1.pngbin0 -> 23151 bytes
-rw-r--r--Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-2.pngbin0 -> 23100 bytes
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/README.txt10
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter1.ipynb53
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter10.ipynb1295
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter11.ipynb1120
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter12.ipynb610
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb429
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter14.ipynb779
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter2.ipynb63
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter3.ipynb614
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter4.ipynb605
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb519
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter6.ipynb325
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter7.ipynb979
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter8.ipynb603
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb1036
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-1.pngbin0 -> 32912 bytes
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-2.pngbin0 -> 14353 bytes
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-3.pngbin0 -> 23176 bytes
-rw-r--r--C++_from_the_Ground/Chapter_10(1).ipynb207
-rw-r--r--C++_from_the_Ground/Chapter_11(1).ipynb347
-rw-r--r--C++_from_the_Ground/Chapter_12(1).ipynb367
-rw-r--r--C++_from_the_Ground/Chapter_13(1).ipynb267
-rw-r--r--C++_from_the_Ground/Chapter_14(1).ipynb320
-rw-r--r--C++_from_the_Ground/Chapter_15(1).ipynb147
-rw-r--r--C++_from_the_Ground/Chapter_16(1).ipynb267
-rw-r--r--C++_from_the_Ground/Chapter_17(1).ipynb307
-rw-r--r--C++_from_the_Ground/Chapter_18(1).ipynb413
-rw-r--r--C++_from_the_Ground/Chapter_19(1).ipynb247
-rw-r--r--C++_from_the_Ground/Chapter_2(1).ipynb267
-rw-r--r--C++_from_the_Ground/Chapter_20(2).ipynb959
-rw-r--r--C++_from_the_Ground/Chapter_21(1).ipynb427
-rw-r--r--C++_from_the_Ground/Chapter_22(1).ipynb207
-rw-r--r--C++_from_the_Ground/Chapter_3(1).ipynb207
-rw-r--r--C++_from_the_Ground/Chapter_4(1).ipynb399
-rw-r--r--C++_from_the_Ground/Chapter_5(1).ipynb668
-rw-r--r--C++_from_the_Ground/Chapter_6(1).ipynb287
-rw-r--r--C++_from_the_Ground/Chapter_7(1).ipynb472
-rw-r--r--C++_from_the_Ground/Chapter_8(1).ipynb327
-rw-r--r--C++_from_the_Ground/Chapter_9(1).ipynb387
-rw-r--r--C++_from_the_Ground/README.txt10
-rw-r--r--C++_from_the_Ground/screenshots/c++preproce.pngbin0 -> 35527 bytes
-rw-r--r--C++_from_the_Ground/screenshots/datatypes.pngbin0 -> 29796 bytes
-rw-r--r--C++_from_the_Ground/screenshots/inheritence.pngbin0 -> 55815 bytes
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/README.txt10
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb197
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb249
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb48
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb185
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb210
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb363
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb165
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb86
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch4.ipynb117
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb244
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb151
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb440
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb115
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch9.ipynb163
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/error-handling.pngbin0 -> 51813 bytes
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/include-guard.pngbin0 -> 29351 bytes
-rw-r--r--C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/inline-member.pngbin0 -> 31604 bytes
-rw-r--r--Chemical_Engineering_Thermodynamics/README.txt10
-rw-r--r--Chemical_Engineering_Thermodynamics/ch10_1.ipynb2564
-rw-r--r--Chemical_Engineering_Thermodynamics/ch11_1.ipynb335
-rw-r--r--Chemical_Engineering_Thermodynamics/ch12_1.ipynb508
-rw-r--r--Chemical_Engineering_Thermodynamics/ch13_1.ipynb313
-rw-r--r--Chemical_Engineering_Thermodynamics/ch14_1.ipynb733
-rw-r--r--Chemical_Engineering_Thermodynamics/ch15_1.ipynb2103
-rw-r--r--Chemical_Engineering_Thermodynamics/ch16_1.ipynb764
-rw-r--r--Chemical_Engineering_Thermodynamics/ch17_1.ipynb2092
-rw-r--r--Chemical_Engineering_Thermodynamics/ch18_1.ipynb599
-rw-r--r--Chemical_Engineering_Thermodynamics/ch1_2.ipynb784
-rw-r--r--Chemical_Engineering_Thermodynamics/ch2_2.ipynb1310
-rw-r--r--Chemical_Engineering_Thermodynamics/ch3_2.ipynb1577
-rw-r--r--Chemical_Engineering_Thermodynamics/ch4_2.ipynb1540
-rw-r--r--Chemical_Engineering_Thermodynamics/ch5_2.ipynb761
-rw-r--r--Chemical_Engineering_Thermodynamics/ch6_2.ipynb870
-rw-r--r--Chemical_Engineering_Thermodynamics/ch7_2.ipynb1575
-rw-r--r--Chemical_Engineering_Thermodynamics/ch8_2.ipynb768
-rw-r--r--Chemical_Engineering_Thermodynamics/screenshots/1.pngbin0 -> 144195 bytes
-rw-r--r--Chemical_Engineering_Thermodynamics/screenshots/2.pngbin0 -> 144507 bytes
-rw-r--r--Chemical_Engineering_Thermodynamics/screenshots/3.pngbin0 -> 167523 bytes
-rw-r--r--Chemical_Engineering_Thermodynamics/screenshots/pic111.pngbin0 -> 134032 bytes
-rw-r--r--Chemical_Engineering_Thermodynamics/screenshots/pic222.pngbin0 -> 140462 bytes
-rw-r--r--Chemical_Engineering_Thermodynamics/screenshots/pic333.pngbin0 -> 149247 bytes
-rw-r--r--Data_Structures_and_Algorithms_in_Java/README.txt10
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch1.ipynb86
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch10.ipynb43
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch11.ipynb96
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch12.ipynb158
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch13.ipynb112
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch14.ipynb63
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch2.ipynb133
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch3.ipynb336
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch4.ipynb284
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch5.ipynb338
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch6.ipynb240
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch7.ipynb133
-rw-r--r--Data_Structures_and_Algorithms_in_Java/ch8.ipynb42
-rw-r--r--Data_Structures_and_Algorithms_in_Java/screenshots/hashtableslinear.pngbin0 -> 55887 bytes
-rw-r--r--Data_Structures_and_Algorithms_in_Java/screenshots/shellsorting.pngbin0 -> 57803 bytes
-rw-r--r--Data_Structures_and_Algorithms_in_Java/screenshots/shortestpath.pngbin0 -> 53534 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_10_2.ipynb185
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_12_2.ipynb274
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_13_2.ipynb824
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_14_2.ipynb253
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_15_2.ipynb330
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_2_2.ipynb125
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_3_2.ipynb101
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_4_2.ipynb1022
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_5_2.ipynb676
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_6_2.ipynb234
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_7_2.ipynb489
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_8_2.ipynb447
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_9_2.ipynb211
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/README.txt10
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1.pngbin0 -> 31619 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_1.pngbin0 -> 31619 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_2.pngbin0 -> 34488 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2.pngbin0 -> 31462 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_1.pngbin0 -> 31462 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_2.pngbin0 -> 31619 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3.pngbin0 -> 34488 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_1.pngbin0 -> 34488 bytes
-rw-r--r--Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_2.pngbin0 -> 31462 bytes
-rw-r--r--Electronic_Devices_/Chapter1.ipynb158
-rw-r--r--Electronic_Devices_/Chapter10.ipynb719
-rw-r--r--Electronic_Devices_/Chapter11.ipynb177
-rw-r--r--Electronic_Devices_/Chapter12.ipynb470
-rw-r--r--Electronic_Devices_/Chapter13.ipynb589
-rw-r--r--Electronic_Devices_/Chapter14.ipynb355
-rw-r--r--Electronic_Devices_/Chapter15.ipynb333
-rw-r--r--Electronic_Devices_/Chapter16.ipynb305
-rw-r--r--Electronic_Devices_/Chapter17.ipynb322
-rw-r--r--Electronic_Devices_/Chapter18.ipynb57
-rw-r--r--Electronic_Devices_/Chapter2.ipynb608
-rw-r--r--Electronic_Devices_/Chapter3.ipynb377
-rw-r--r--Electronic_Devices_/Chapter4.ipynb455
-rw-r--r--Electronic_Devices_/Chapter5.ipynb427
-rw-r--r--Electronic_Devices_/Chapter6.ipynb603
-rw-r--r--Electronic_Devices_/Chapter7.ipynb727
-rw-r--r--Electronic_Devices_/Chapter8.ipynb432
-rw-r--r--Electronic_Devices_/Chapter9.ipynb379
-rw-r--r--Electronic_Devices_/README.txt10
-rw-r--r--Electronic_Devices_/screenshots/ipwaveform.pngbin0 -> 14612 bytes
-rw-r--r--Electronic_Devices_/screenshots/modulatedopvoltage.pngbin0 -> 24301 bytes
-rw-r--r--Electronic_Devices_/screenshots/transfercharectercurve.pngbin0 -> 12968 bytes
-rw-r--r--Electronic_Principles_/Chapter_10_New.ipynb485
-rw-r--r--Electronic_Principles_/Chapter_11_New.ipynb579
-rw-r--r--Electronic_Principles_/Chapter_12_New.ipynb661
-rw-r--r--Electronic_Principles_/Chapter_13_New.ipynb888
-rw-r--r--Electronic_Principles_/Chapter_14_New.ipynb730
-rw-r--r--Electronic_Principles_/Chapter_15_New.ipynb436
-rw-r--r--Electronic_Principles_/Chapter_16_New.ipynb1046
-rw-r--r--Electronic_Principles_/Chapter_17_New.ipynb689
-rw-r--r--Electronic_Principles_/Chapter_18_New.ipynb641
-rw-r--r--Electronic_Principles_/Chapter_19_New.ipynb573
-rw-r--r--Electronic_Principles_/Chapter_1_New.ipynb287
-rw-r--r--Electronic_Principles_/Chapter_20_New.ipynb479
-rw-r--r--Electronic_Principles_/Chapter_21_New.ipynb686
-rw-r--r--Electronic_Principles_/Chapter_22_New.ipynb421
-rw-r--r--Electronic_Principles_/Chapter_23_New.ipynb697
-rw-r--r--Electronic_Principles_/Chapter_24_New.ipynb795
-rw-r--r--Electronic_Principles_/Chapter_2_New.ipynb177
-rw-r--r--Electronic_Principles_/Chapter_3_New.ipynb370
-rw-r--r--Electronic_Principles_/Chapter_4_New.ipynb566
-rw-r--r--Electronic_Principles_/Chapter_5_New.ipynb508
-rw-r--r--Electronic_Principles_/Chapter_6_New.ipynb596
-rw-r--r--Electronic_Principles_/Chapter_7_New.ipynb480
-rw-r--r--Electronic_Principles_/Chapter_8_New.ipynb331
-rw-r--r--Electronic_Principles_/Chapter_9_New.ipynb298
-rw-r--r--Electronic_Principles_/README.txt10
-rw-r--r--Electronic_Principles_/screenshots/nitya-1.pngbin0 -> 50704 bytes
-rw-r--r--Electronic_Principles_/screenshots/nitya-2.pngbin0 -> 68798 bytes
-rw-r--r--Electronic_Principles_/screenshots/nitya-3.pngbin0 -> 51270 bytes
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/README.txt10
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/ch2.ipynb1682
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/ch3.ipynb616
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/ch5.ipynb998
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/ch6.ipynb1312
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/ch7.ipynb738
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/screenshots/dry-time.pngbin0 -> 45352 bytes
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/screenshots/enthalpy.pngbin0 -> 34749 bytes
-rw-r--r--Elements_Of_Mass_Transfer_Part_1/screenshots/tower.pngbin0 -> 20201 bytes
-rw-r--r--Elements_of_Electromagnetics/README.txt10
-rw-r--r--Elements_of_Electromagnetics/chapter_1.ipynb420
-rw-r--r--Elements_of_Electromagnetics/chapter_10.ipynb566
-rw-r--r--Elements_of_Electromagnetics/chapter_11.ipynb673
-rw-r--r--Elements_of_Electromagnetics/chapter_12.ipynb452
-rw-r--r--Elements_of_Electromagnetics/chapter_13.ipynb428
-rw-r--r--Elements_of_Electromagnetics/chapter_14.ipynb172
-rw-r--r--Elements_of_Electromagnetics/chapter_2.ipynb318
-rw-r--r--Elements_of_Electromagnetics/chapter_3.ipynb389
-rw-r--r--Elements_of_Electromagnetics/chapter_4.ipynb699
-rw-r--r--Elements_of_Electromagnetics/chapter_5.ipynb523
-rw-r--r--Elements_of_Electromagnetics/chapter_6.ipynb80
-rw-r--r--Elements_of_Electromagnetics/chapter_7.ipynb224
-rw-r--r--Elements_of_Electromagnetics/chapter_8.ipynb454
-rw-r--r--Elements_of_Electromagnetics/chapter_9.ipynb200
-rw-r--r--Elements_of_Electromagnetics/screenshots/I(0,t)I(l,t).pngbin0 -> 7376 bytes
-rw-r--r--Elements_of_Electromagnetics/screenshots/cospropogatingwave.pngbin0 -> 21804 bytes
-rw-r--r--Elements_of_Electromagnetics/screenshots/vectors.pngbin0 -> 51938 bytes
-rw-r--r--Engineering_Heat_Transfer/CHAPTER1.ipynb482
-rw-r--r--Engineering_Heat_Transfer/CHAPTER10.ipynb239
-rw-r--r--Engineering_Heat_Transfer/CHAPTER11.ipynb332
-rw-r--r--Engineering_Heat_Transfer/CHAPTER12.ipynb342
-rw-r--r--Engineering_Heat_Transfer/CHAPTER2.ipynb713
-rw-r--r--Engineering_Heat_Transfer/CHAPTER4.ipynb607
-rw-r--r--Engineering_Heat_Transfer/CHAPTER5.ipynb126
-rw-r--r--Engineering_Heat_Transfer/CHAPTER6.ipynb545
-rw-r--r--Engineering_Heat_Transfer/CHAPTER7.ipynb709
-rw-r--r--Engineering_Heat_Transfer/CHAPTER8.ipynb527
-rw-r--r--Engineering_Heat_Transfer/CHAPTER9.ipynb571
-rw-r--r--Engineering_Heat_Transfer/CHAPTER_3.ipynb339
-rw-r--r--Engineering_Heat_Transfer/README.txt10
-rw-r--r--Engineering_Heat_Transfer/screenshots/heat_transferred.pngbin0 -> 9126 bytes
-rw-r--r--Engineering_Heat_Transfer/screenshots/length_required.pngbin0 -> 13684 bytes
-rw-r--r--Engineering_Heat_Transfer/screenshots/wall_tempratures.pngbin0 -> 10804 bytes
-rw-r--r--Engineering_Physics/Chapter10_1.ipynb154
-rw-r--r--Engineering_Physics/Chapter11_1.ipynb154
-rw-r--r--Engineering_Physics/Chapter12_1.ipynb118
-rw-r--r--Engineering_Physics/Chapter13_1.ipynb175
-rw-r--r--Engineering_Physics/Chapter14_1.ipynb175
-rw-r--r--Engineering_Physics/Chapter15_1.ipynb154
-rw-r--r--Engineering_Physics/Chapter17_1.ipynb49
-rw-r--r--Engineering_Physics/Chapter18_1.ipynb154
-rw-r--r--Engineering_Physics/Chapter1_1.ipynb217
-rw-r--r--Engineering_Physics/Chapter2_1.ipynb118
-rw-r--r--Engineering_Physics/Chapter3_1.ipynb238
-rw-r--r--Engineering_Physics/Chapter4_1.ipynb217
-rw-r--r--Engineering_Physics/Chapter5_1.ipynb155
-rw-r--r--Engineering_Physics/Chapter6_1.ipynb307
-rw-r--r--Engineering_Physics/Chapter7_1.ipynb154
-rw-r--r--Engineering_Physics/Chapter8_1.ipynb313
-rw-r--r--Engineering_Physics/Chapter9_1.ipynb202
-rw-r--r--Engineering_Physics/Chapter_1.ipynb133
-rw-r--r--Engineering_Physics/Chapter_10.ipynb154
-rw-r--r--Engineering_Physics/Chapter_11.ipynb175
-rw-r--r--Engineering_Physics/Chapter_12.ipynb154
-rw-r--r--Engineering_Physics/Chapter_2.ipynb238
-rw-r--r--Engineering_Physics/Chapter_3.ipynb154
-rw-r--r--Engineering_Physics/Chapter_4.ipynb343
-rw-r--r--Engineering_Physics/Chapter_6.ipynb400
-rw-r--r--Engineering_Physics/Chapter_7.ipynb91
-rw-r--r--Engineering_Physics/Chapter_8.ipynb259
-rw-r--r--Engineering_Physics/Chapter_9.ipynb259
-rw-r--r--Engineering_Physics/README.txt10
-rw-r--r--Engineering_Physics/chapter1_2.ipynb568
-rw-r--r--Engineering_Physics/chapter2_2.ipynb388
-rw-r--r--Engineering_Physics/chapter4_2.ipynb364
-rw-r--r--Engineering_Physics/chapter5_2.ipynb322
-rw-r--r--Engineering_Physics/chapter6_2.ipynb238
-rw-r--r--Engineering_Physics/chapter7_2.ipynb658
-rw-r--r--Engineering_Physics/chapter8_2.ipynb133
-rw-r--r--Engineering_Physics/screenshots/Capture1.pngbin0 -> 18748 bytes
-rw-r--r--Engineering_Physics/screenshots/Capture2.pngbin0 -> 32269 bytes
-rw-r--r--Engineering_Physics/screenshots/Untitled.pngbin0 -> 25698 bytes
-rw-r--r--Engineering_Physics/screenshots/Untitled1.pngbin0 -> 23371 bytes
-rw-r--r--Engineering_Physics/screenshots/Untitled3.pngbin0 -> 40962 bytes
-rw-r--r--Engineering_Physics/screenshots/Untitled_1.pngbin0 -> 87075 bytes
-rw-r--r--Engineering_Physics/screenshots/Untitled_2.pngbin0 -> 87075 bytes
-rw-r--r--Engineering_Physics/screenshots/capture.pngbin0 -> 19889 bytes
-rw-r--r--Engineering_Physics/screenshots/screenshot1.PNGbin0 -> 33329 bytes
-rw-r--r--Engineering_Physics/screenshots/screenshot1.pngbin0 -> 18000054 bytes
-rw-r--r--Engineering_Physics/screenshots/screenshot2.PNGbin0 -> 31796 bytes
-rw-r--r--Engineering_Physics/screenshots/screenshot2.pngbin0 -> 18000054 bytes
-rw-r--r--Engineering_Physics/screenshots/screenshot3.PNGbin0 -> 19782 bytes
-rw-r--r--Engineering_Physics/screenshots/screenshot3.pngbin0 -> 18000054 bytes
-rw-r--r--Engineering_Physics/screenshots/shot1.PNGbin0 -> 43717 bytes
-rw-r--r--Engineering_Physics/screenshots/shot2.PNGbin0 -> 41477 bytes
-rw-r--r--Engineering_Physics/screenshots/shot3.PNGbin0 -> 35802 bytes
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/README.txt10
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch1.ipynb250
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch10.ipynb286
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch11.ipynb211
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch12.ipynb228
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch13.ipynb136
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch14.ipynb172
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch15.ipynb1677
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch16.ipynb1047
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch2.ipynb310
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch3.ipynb606
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch4.ipynb839
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch5.ipynb694
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch6.ipynb648
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch7.ipynb329
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch8.ipynb492
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch9.ipynb232
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu1.pngbin0 -> 25189 bytes
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu2.pngbin0 -> 22660 bytes
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu3.pngbin0 -> 21075 bytes
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-1_1.pngbin0 -> 25189 bytes
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-2_1.pngbin0 -> 22660 bytes
-rw-r--r--Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-3_1.pngbin0 -> 21075 bytes
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_1_1.ipynb322
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_2_1.ipynb175
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_3_1.ipynb280
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_4_1.ipynb49
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_5_1.ipynb469
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_6_1.ipynb196
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_7_1.ipynb235
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_8_1.ipynb301
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_9_1.ipynb184
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/README.txt10
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depth-flowrate.pngbin0 -> 20093 bytes
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depthvsflow.pngbin0 -> 16606 bytes
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/flowrate.pngbin0 -> 22119 bytes
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/rateofflowandvlo.pngbin0 -> 14911 bytes
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump.pngbin0 -> 30741 bytes
-rw-r--r--Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump_1.pngbin0 -> 19178 bytes
-rw-r--r--Fluid_Mechanics_/Chapter1.ipynb611
-rw-r--r--Fluid_Mechanics_/Chapter10.ipynb450
-rw-r--r--Fluid_Mechanics_/Chapter11.ipynb328
-rw-r--r--Fluid_Mechanics_/Chapter12.ipynb360
-rw-r--r--Fluid_Mechanics_/Chapter2.ipynb976
-rw-r--r--Fluid_Mechanics_/Chapter3.ipynb536
-rw-r--r--Fluid_Mechanics_/Chapter4.ipynb557
-rw-r--r--Fluid_Mechanics_/Chapter5.ipynb576
-rw-r--r--Fluid_Mechanics_/Chapter6.ipynb136
-rw-r--r--Fluid_Mechanics_/Chapter7.ipynb392
-rw-r--r--Fluid_Mechanics_/Chapter8.ipynb391
-rw-r--r--Fluid_Mechanics_/Chapter9.ipynb849
-rw-r--r--Fluid_Mechanics_/README.txt10
-rw-r--r--Fluid_Mechanics_/screenshots/Screenshot_from_2014-04-24_10_11_42.pngbin0 -> 38369 bytes
-rw-r--r--Fluid_Mechanics_/screenshots/plot1.pngbin0 -> 27945 bytes
-rw-r--r--Fluid_Mechanics_/screenshots/plot2.pngbin0 -> 14805 bytes
-rw-r--r--Fluidization_Engineering/README.txt10
-rw-r--r--Fluidization_Engineering/ch10.ipynb306
-rw-r--r--Fluidization_Engineering/ch11.ipynb359
-rw-r--r--Fluidization_Engineering/ch12.ipynb397
-rw-r--r--Fluidization_Engineering/ch13.ipynb313
-rw-r--r--Fluidization_Engineering/ch14.ipynb419
-rw-r--r--Fluidization_Engineering/ch15.ipynb296
-rw-r--r--Fluidization_Engineering/ch16.ipynb431
-rw-r--r--Fluidization_Engineering/ch17.ipynb451
-rw-r--r--Fluidization_Engineering/ch18.ipynb573
-rw-r--r--Fluidization_Engineering/ch3.ipynb272
-rw-r--r--Fluidization_Engineering/ch4.ipynb309
-rw-r--r--Fluidization_Engineering/ch5.ipynb138
-rw-r--r--Fluidization_Engineering/ch6.ipynb504
-rw-r--r--Fluidization_Engineering/ch7.ipynb405
-rw-r--r--Fluidization_Engineering/ch8.ipynb218
-rw-r--r--Fluidization_Engineering/ch9.ipynb268
-rw-r--r--Fluidization_Engineering/screenshots/plotkbckbedb.pngbin0 -> 14155 bytes
-rw-r--r--Fluidization_Engineering/screenshots/relationnubedrep.pngbin0 -> 8780 bytes
-rw-r--r--Fluidization_Engineering/screenshots/relationshebdrep.pngbin0 -> 9690 bytes
-rw-r--r--Fundamental_of_Electronics_Devices/Ch1.ipynb375
-rw-r--r--Fundamental_of_Electronics_Devices/Ch2.ipynb1542
-rw-r--r--Fundamental_of_Electronics_Devices/Ch3.ipynb337
-rw-r--r--Fundamental_of_Electronics_Devices/Ch4.ipynb1079
-rw-r--r--Fundamental_of_Electronics_Devices/Ch5.ipynb169
-rw-r--r--Fundamental_of_Electronics_Devices/Ch6.ipynb763
-rw-r--r--Fundamental_of_Electronics_Devices/Ch7.ipynb476
-rw-r--r--Fundamental_of_Electronics_Devices/Ch8.ipynb228
-rw-r--r--Fundamental_of_Electronics_Devices/README.txt10
-rw-r--r--Fundamental_of_Electronics_Devices/screenshots/energybands.pngbin0 -> 54573 bytes
-rw-r--r--Fundamental_of_Electronics_Devices/screenshots/steadystatephoto.pngbin0 -> 47996 bytes
-rw-r--r--Fundamental_of_Electronics_Devices/screenshots/transfercharateristics.pngbin0 -> 8684 bytes
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_2.ipynb591
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_4.ipynb58
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_5.ipynb1164
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_6.ipynb299
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_7.ipynb286
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_8.ipynb1058
-rw-r--r--Fundamentals_of_Fluid_Mechanics/Ch_9.ipynb555
-rw-r--r--Fundamentals_of_Fluid_Mechanics/README.txt10
-rw-r--r--Fundamentals_of_Fluid_Mechanics/ch_1.ipynb414
-rw-r--r--Fundamentals_of_Fluid_Mechanics/ch_10.ipynb395
-rw-r--r--Fundamentals_of_Fluid_Mechanics/ch_11.ipynb1038
-rw-r--r--Fundamentals_of_Fluid_Mechanics/ch_12.ipynb328
-rw-r--r--Fundamentals_of_Fluid_Mechanics/ch_3.ipynb482
-rw-r--r--Fundamentals_of_Fluid_Mechanics/screenshots/seconds.pngbin0 -> 25660 bytes
-rw-r--r--Fundamentals_of_Fluid_Mechanics/screenshots/surface-elevation.pngbin0 -> 12594 bytes
-rw-r--r--Fundamentals_of_Fluid_Mechanics/screenshots/the-drag.pngbin0 -> 26466 bytes
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_1.ipynb391
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_10.ipynb295
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_11.ipynb537
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_12.ipynb767
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_13.ipynb398
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_14.ipynb428
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_2.ipynb184
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_3.ipynb804
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_4.ipynb277
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_5.ipynb710
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_6.ipynb342
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_7.ipynb506
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_8.ipynb532
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/Chapter_9.ipynb311
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/README.txt10
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-1.pngbin0 -> 14936 bytes
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-2.pngbin0 -> 28772 bytes
-rw-r--r--Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-3.pngbin0 -> 19748 bytes
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_03.ipynb230
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_04.ipynb272
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_05.ipynb251
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_06.ipynb188
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_07.ipynb188
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_08.ipynb41
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_09.ipynb293
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_10.ipynb251
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_11.ipynb335
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_12.ipynb230
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_13.ipynb230
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_14.ipynb335
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_15.ipynb356
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_16.ipynb230
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_17.ipynb335
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_18.ipynb272
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_19.ipynb335
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_21.ipynb83
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_22.ipynb209
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_23.ipynb62
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_24.ipynb188
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_26.ipynb83
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_27.ipynb188
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_28.ipynb41
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/README.txt10
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/economics.pngbin0 -> 64537 bytes
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/forced_convention.pngbin0 -> 71086 bytes
-rw-r--r--Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/shell_heat.pngbin0 -> 79427 bytes
-rw-r--r--Hydraulics/Chapter_1.ipynb964
-rw-r--r--Hydraulics/Chapter_2.ipynb400
-rw-r--r--Hydraulics/Chapter_3.ipynb718
-rw-r--r--Hydraulics/Chapter_4.ipynb778
-rw-r--r--Hydraulics/Chapter_5.ipynb1214
-rw-r--r--Hydraulics/Chapter_6.ipynb935
-rw-r--r--Hydraulics/README.txt10
-rw-r--r--Hydraulics/screenshots/pic11.pngbin0 -> 112429 bytes
-rw-r--r--Hydraulics/screenshots/pic22.pngbin0 -> 130446 bytes
-rw-r--r--Hydraulics/screenshots/pic33.pngbin0 -> 119096 bytes
-rw-r--r--Industrial_Instrumentation/Chapter_1.ipynb412
-rw-r--r--Industrial_Instrumentation/Chapter_2.ipynb603
-rw-r--r--Industrial_Instrumentation/Chapter_3.ipynb391
-rw-r--r--Industrial_Instrumentation/Chapter_4.ipynb554
-rw-r--r--Industrial_Instrumentation/Chapter_5.ipynb874
-rw-r--r--Industrial_Instrumentation/Chapter_6.ipynb534
-rw-r--r--Industrial_Instrumentation/Chapter_7.ipynb567
-rw-r--r--Industrial_Instrumentation/Chapter_8.ipynb485
-rw-r--r--Industrial_Instrumentation/README.txt10
-rw-r--r--Industrial_Instrumentation/ch2.ipynb997
-rw-r--r--Industrial_Instrumentation/ch3.ipynb1515
-rw-r--r--Industrial_Instrumentation/ch4.ipynb3551
-rw-r--r--Industrial_Instrumentation/ch5.ipynb2760
-rw-r--r--Industrial_Instrumentation/ch6.ipynb1286
-rw-r--r--Industrial_Instrumentation/ch7.ipynb210
-rw-r--r--Industrial_Instrumentation/ch8.ipynb966
-rw-r--r--Industrial_Instrumentation/ch9.ipynb1647
-rw-r--r--Industrial_Instrumentation/screenshots/chapter8.pngbin0 -> 37484 bytes
-rw-r--r--Industrial_Instrumentation/screenshots/coldair-stardotto.pngbin0 -> 24596 bytes
-rw-r--r--Industrial_Instrumentation/screenshots/decreaseentropy.pngbin0 -> 25885 bytes
-rw-r--r--Industrial_Instrumentation/screenshots/mechanicsesmicinst.pngbin0 -> 38036 bytes
-rw-r--r--Industrial_Instrumentation/screenshots/pvdiagram.pngbin0 -> 30463 bytes
-rw-r--r--Industrial_Instrumentation/screenshots/rangeflowratameter.pngbin0 -> 71638 bytes
-rw-r--r--Introduction_To_Chemical_Engineering/README.txt10
-rw-r--r--Introduction_To_Chemical_Engineering/ch1.ipynb900
-rw-r--r--Introduction_To_Chemical_Engineering/ch2.ipynb1550
-rw-r--r--Introduction_To_Chemical_Engineering/ch3.ipynb1587
-rw-r--r--Introduction_To_Chemical_Engineering/ch4.ipynb916
-rw-r--r--Introduction_To_Chemical_Engineering/ch5.ipynb842
-rw-r--r--Introduction_To_Chemical_Engineering/ch6.ipynb866
-rw-r--r--Introduction_To_Chemical_Engineering/ch7.ipynb417
-rw-r--r--Introduction_To_Chemical_Engineering/ch8.ipynb472
-rw-r--r--Introduction_To_Chemical_Engineering/ch9.ipynb219
-rw-r--r--Introduction_To_Chemical_Engineering/screenshots/pic11.pngbin0 -> 123848 bytes
-rw-r--r--Introduction_To_Chemical_Engineering/screenshots/pic22.pngbin0 -> 133387 bytes
-rw-r--r--Introduction_To_Chemical_Engineering/screenshots/pic33.pngbin0 -> 133230 bytes
-rw-r--r--Let_us_C/README.txt10
-rw-r--r--Let_us_C/chapter-1.ipynb221
-rw-r--r--Let_us_C/chapter-10.ipynb499
-rw-r--r--Let_us_C/chapter-11.ipynb383
-rw-r--r--Let_us_C/chapter-12.ipynb2351
-rw-r--r--Let_us_C/chapter-13.ipynb83
-rw-r--r--Let_us_C/chapter-14.ipynb853
-rw-r--r--Let_us_C/chapter-15.ipynb621
-rw-r--r--Let_us_C/chapter-16.ipynb66
-rw-r--r--Let_us_C/chapter-17.ipynb115
-rw-r--r--Let_us_C/chapter-18.ipynb261
-rw-r--r--Let_us_C/chapter-2.ipynb571
-rw-r--r--Let_us_C/chapter-20.ipynb181
-rw-r--r--Let_us_C/chapter-21.ipynb226
-rw-r--r--Let_us_C/chapter-3.ipynb616
-rw-r--r--Let_us_C/chapter-4.ipynb361
-rw-r--r--Let_us_C/chapter-5.ipynb804
-rw-r--r--Let_us_C/chapter-6.ipynb683
-rw-r--r--Let_us_C/chapter-7.ipynb210
-rw-r--r--Let_us_C/chapter-8.ipynb936
-rw-r--r--Let_us_C/chapter-9.ipynb616
-rw-r--r--Let_us_C/screenshots/binary.pngbin0 -> 30718 bytes
-rw-r--r--Let_us_C/screenshots/hellowindows.pngbin0 -> 67812 bytes
-rw-r--r--Let_us_C/screenshots/macro.pngbin0 -> 32392 bytes
-rw-r--r--Linear_Integrated_Circuits/Chapter_1.ipynb92
-rw-r--r--Linear_Integrated_Circuits/Chapter_10.ipynb376
-rw-r--r--Linear_Integrated_Circuits/Chapter_11.ipynb552
-rw-r--r--Linear_Integrated_Circuits/Chapter_2.ipynb482
-rw-r--r--Linear_Integrated_Circuits/Chapter_3.ipynb1284
-rw-r--r--Linear_Integrated_Circuits/Chapter_4.ipynb748
-rw-r--r--Linear_Integrated_Circuits/Chapter_5.ipynb212
-rw-r--r--Linear_Integrated_Circuits/Chapter_6.ipynb763
-rw-r--r--Linear_Integrated_Circuits/Chapter_7.ipynb459
-rw-r--r--Linear_Integrated_Circuits/Chapter_8.ipynb470
-rw-r--r--Linear_Integrated_Circuits/Chapter_9.ipynb77
-rw-r--r--Linear_Integrated_Circuits/README.txt10
-rw-r--r--Linear_Integrated_Circuits/screenshots/frequency_response.JPGbin0 -> 20522 bytes
-rw-r--r--Linear_Integrated_Circuits/screenshots/input_output_differentiator.JPGbin0 -> 29835 bytes
-rw-r--r--Linear_Integrated_Circuits/screenshots/ip_and_op_integrator.JPGbin0 -> 32114 bytes
-rw-r--r--Materials_science_and_engineering_an_introduction/CH10.ipynb124
-rw-r--r--Materials_science_and_engineering_an_introduction/CH12.ipynb202
-rw-r--r--Materials_science_and_engineering_an_introduction/CH14.ipynb228
-rw-r--r--Materials_science_and_engineering_an_introduction/CH16.ipynb174
-rw-r--r--Materials_science_and_engineering_an_introduction/CH17.ipynb132
-rw-r--r--Materials_science_and_engineering_an_introduction/CH18.ipynb308
-rw-r--r--Materials_science_and_engineering_an_introduction/CH19.ipynb61
-rw-r--r--Materials_science_and_engineering_an_introduction/CH20.ipynb157
-rw-r--r--Materials_science_and_engineering_an_introduction/CH21.ipynb64
-rw-r--r--Materials_science_and_engineering_an_introduction/CH3.ipynb376
-rw-r--r--Materials_science_and_engineering_an_introduction/CH4.ipynb161
-rw-r--r--Materials_science_and_engineering_an_introduction/CH5.ipynb302
-rw-r--r--Materials_science_and_engineering_an_introduction/CH6.ipynb342
-rw-r--r--Materials_science_and_engineering_an_introduction/CH7.ipynb177
-rw-r--r--Materials_science_and_engineering_an_introduction/CH8.ipynb111
-rw-r--r--Materials_science_and_engineering_an_introduction/CH9.ipynb148
-rw-r--r--Materials_science_and_engineering_an_introduction/README.txt10
-rw-r--r--Materials_science_and_engineering_an_introduction/screenshots/10_2.pngbin0 -> 12360 bytes
-rw-r--r--Materials_science_and_engineering_an_introduction/screenshots/8_1.pngbin0 -> 16879 bytes
-rw-r--r--Materials_science_and_engineering_an_introduction/screenshots/9_3.pngbin0 -> 27656 bytes
-rw-r--r--Mechanics_of_Materials/README.txt10
-rw-r--r--Mechanics_of_Materials/chapter1.ipynb423
-rw-r--r--Mechanics_of_Materials/chapter11.ipynb515
-rw-r--r--Mechanics_of_Materials/chapter12.ipynb172
-rw-r--r--Mechanics_of_Materials/chapter2.ipynb501
-rw-r--r--Mechanics_of_Materials/chapter3.ipynb561
-rw-r--r--Mechanics_of_Materials/chapter4.ipynb116
-rw-r--r--Mechanics_of_Materials/chapter5.ipynb800
-rw-r--r--Mechanics_of_Materials/chapter6.ipynb444
-rw-r--r--Mechanics_of_Materials/chapter7.ipynb465
-rw-r--r--Mechanics_of_Materials/chapter8.ipynb516
-rw-r--r--Mechanics_of_Materials/chapter9.ipynb127
-rw-r--r--Mechanics_of_Materials/screenshots/screen1.pngbin0 -> 64967 bytes
-rw-r--r--Mechanics_of_Materials/screenshots/screen2.pngbin0 -> 18650 bytes
-rw-r--r--Mechanics_of_Materials/screenshots/screen3.pngbin0 -> 95229 bytes
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_10.ipynb581
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_11.ipynb308
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_3.ipynb548
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_4.ipynb1238
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_5.ipynb200
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_6.ipynb546
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_7.ipynb189
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_8.ipynb1025
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_9.ipynb635
-rw-r--r--Microwave_and_Radar_Engineering/README.txt10
-rw-r--r--Microwave_and_Radar_Engineering/screenshots/sachin1.pngbin0 -> 56781 bytes
-rw-r--r--Microwave_and_Radar_Engineering/screenshots/sachin2.pngbin0 -> 14611 bytes
-rw-r--r--Microwave_and_Radar_Engineering/screenshots/sachin3.pngbin0 -> 13515 bytes
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/README.txt10
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch1.ipynb154
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb405
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch11.ipynb962
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch12.ipynb916
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch13.ipynb862
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch14.ipynb645
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb319
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch2.ipynb222
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch3.ipynb539
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch4.ipynb223
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb358
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch6.ipynb499
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch7.ipynb474
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch8.ipynb1230
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch9.ipynb691
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic111.pngbin0 -> 166886 bytes
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic222.pngbin0 -> 154279 bytes
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic333.pngbin0 -> 143158 bytes
-rw-r--r--Practical_C_Programming/Chapter_10_1.ipynb230
-rw-r--r--Practical_C_Programming/Chapter_11_1.ipynb83
-rw-r--r--Practical_C_Programming/Chapter_12_1.ipynb41
-rw-r--r--Practical_C_Programming/Chapter_13_1.ipynb244
-rw-r--r--Practical_C_Programming/Chapter_14_1.ipynb101
-rw-r--r--Practical_C_Programming/Chapter_15_1.ipynb181
-rw-r--r--Practical_C_Programming/Chapter_16_1.ipynb41
-rw-r--r--Practical_C_Programming/Chapter_17_1.ipynb97
-rw-r--r--Practical_C_Programming/Chapter_18_1.ipynb63
-rw-r--r--Practical_C_Programming/Chapter_19_1.ipynb125
-rw-r--r--Practical_C_Programming/Chapter_21_1.ipynb41
-rw-r--r--Practical_C_Programming/Chapter_23_1.ipynb41
-rw-r--r--Practical_C_Programming/Chapter_2_3.ipynb1156
-rw-r--r--Practical_C_Programming/Chapter_3_4.ipynb41
-rw-r--r--Practical_C_Programming/Chapter_4_4.ipynb167
-rw-r--r--Practical_C_Programming/Chapter_5_4.ipynb230
-rw-r--r--Practical_C_Programming/Chapter_6_4.ipynb104
-rw-r--r--Practical_C_Programming/Chapter_7_4.ipynb76
-rw-r--r--Practical_C_Programming/Chapter_8_4.ipynb133
-rw-r--r--Practical_C_Programming/Chapter_9_4.ipynb104
-rw-r--r--Practical_C_Programming/README.txt10
-rw-r--r--Practical_C_Programming/screenshots/ancientcompilers.pngbin0 -> 38427 bytes
-rw-r--r--Practical_C_Programming/screenshots/bitoperations.pngbin0 -> 44165 bytes
-rw-r--r--Practical_C_Programming/screenshots/mahesh-1.pngbin0 -> 30367 bytes
-rw-r--r--Practical_C_Programming/screenshots/mahesh-2.pngbin0 -> 20249 bytes
-rw-r--r--Practical_C_Programming/screenshots/mahesh-3.pngbin0 -> 33358 bytes
-rw-r--r--Practical_C_Programming/screenshots/programmingprocess.pngbin0 -> 41674 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter1.ipynb158
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter2.ipynb608
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter3.ipynb377
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter4.ipynb455
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter5.ipynb427
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter6.ipynb603
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter7.ipynb727
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter8.ipynb432
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter9.ipynb379
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/README.txt10
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1.pngbin0 -> 18073 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_1.pngbin0 -> 18073 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_2.pngbin0 -> 18073 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2.pngbin0 -> 41767 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_1.pngbin0 -> 41767 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_2.pngbin0 -> 41767 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3.pngbin0 -> 23603 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_1.pngbin0 -> 23603 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_2.pngbin0 -> 23603 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/programmingprocess.pngbin0 -> 41674 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter.pngbin0 -> 35988 bytes
-rw-r--r--Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter_1.pngbin0 -> 35988 bytes
-rw-r--r--Problems_In_Fluid_Flow/README.txt10
-rw-r--r--Problems_In_Fluid_Flow/ch1.ipynb635
-rw-r--r--Problems_In_Fluid_Flow/ch10.ipynb558
-rw-r--r--Problems_In_Fluid_Flow/ch11.ipynb479
-rw-r--r--Problems_In_Fluid_Flow/ch12.ipynb331
-rw-r--r--Problems_In_Fluid_Flow/ch13.ipynb375
-rw-r--r--Problems_In_Fluid_Flow/ch2.ipynb481
-rw-r--r--Problems_In_Fluid_Flow/ch3.ipynb325
-rw-r--r--Problems_In_Fluid_Flow/ch4.ipynb459
-rw-r--r--Problems_In_Fluid_Flow/ch5.ipynb757
-rw-r--r--Problems_In_Fluid_Flow/ch6.ipynb501
-rw-r--r--Problems_In_Fluid_Flow/ch7.ipynb203
-rw-r--r--Problems_In_Fluid_Flow/ch8.ipynb467
-rw-r--r--Problems_In_Fluid_Flow/ch9.ipynb370
-rw-r--r--Problems_In_Fluid_Flow/screenshots/pic1.pngbin0 -> 126788 bytes
-rw-r--r--Problems_In_Fluid_Flow/screenshots/pic2.pngbin0 -> 163897 bytes
-rw-r--r--Problems_In_Fluid_Flow/screenshots/pic3.pngbin0 -> 129162 bytes
-rw-r--r--Programming_in_C/Chapter_03.ipynb146
-rw-r--r--Programming_in_C/Chapter_04.ipynb262
-rw-r--r--Programming_in_C/Chapter_05.ipynb421
-rw-r--r--Programming_in_C/Chapter_06.ipynb496
-rw-r--r--Programming_in_C/Chapter_07.ipynb489
-rw-r--r--Programming_in_C/Chapter_08.ipynb1061
-rw-r--r--Programming_in_C/Chapter_09.ipynb594
-rw-r--r--Programming_in_C/Chapter_10.ipynb768
-rw-r--r--Programming_in_C/Chapter_11.ipynb842
-rw-r--r--Programming_in_C/Chapter_12.ipynb258
-rw-r--r--Programming_in_C/Chapter_13.ipynb201
-rw-r--r--Programming_in_C/Chapter_14.ipynb92
-rw-r--r--Programming_in_C/Chapter_16.ipynb304
-rw-r--r--Programming_in_C/Chapter_17.ipynb110
-rw-r--r--Programming_in_C/Chapter_18.ipynb472
-rw-r--r--Programming_in_C/Chapter_19.ipynb70
-rw-r--r--Programming_in_C/README.txt10
-rw-r--r--Programming_in_C/screenshots/nalin-1.pngbin0 -> 37400 bytes
-rw-r--r--Programming_in_C/screenshots/nalin-2.pngbin0 -> 40842 bytes
-rw-r--r--Programming_in_C/screenshots/nalin-3.pngbin0 -> 52280 bytes
-rw-r--r--Satellite_Communication/README.txt10
-rw-r--r--Satellite_Communication/chapter_2.ipynb838
-rw-r--r--Satellite_Communication/chapter_3.ipynb761
-rw-r--r--Satellite_Communication/chapter_4.ipynb642
-rw-r--r--Satellite_Communication/chapter_5.ipynb618
-rw-r--r--Satellite_Communication/chapter_6.ipynb359
-rw-r--r--Satellite_Communication/chapter_7.ipynb761
-rw-r--r--Satellite_Communication/screenshots/a.pngbin0 -> 170436 bytes
-rw-r--r--Satellite_Communication/screenshots/b.pngbin0 -> 241075 bytes
-rw-r--r--Satellite_Communication/screenshots/c.pngbin0 -> 220776 bytes
-rw-r--r--Solid_state_physics/Chapter_1.ipynb0
-rw-r--r--Solid_state_physics/Chapter_10.ipynb0
-rw-r--r--Solid_state_physics/Chapter_11.ipynb0
-rw-r--r--Solid_state_physics/Chapter_12.ipynb0
-rw-r--r--Solid_state_physics/Chapter_2.ipynb0
-rw-r--r--Solid_state_physics/Chapter_3.ipynb0
-rw-r--r--Solid_state_physics/Chapter_4.ipynb0
-rw-r--r--Solid_state_physics/Chapter_5.ipynb0
-rw-r--r--Solid_state_physics/Chapter_6.ipynb0
-rw-r--r--Solid_state_physics/Chapter_7.ipynb0
-rw-r--r--Solid_state_physics/Chapter_8.ipynb0
-rw-r--r--Solid_state_physics/Chapter_9.ipynb0
-rw-r--r--Solid_state_physics/README.txt10
-rw-r--r--Solid_state_physics/screenshots/muktesh_1.pngbin0 -> 64674 bytes
-rw-r--r--Solid_state_physics/screenshots/muktesh_2.pngbin0 -> 34065 bytes
-rw-r--r--Solid_state_physics/screenshots/muktesh_3.pngbin0 -> 36700 bytes
-rw-r--r--Surveying_Volume_3/Chapter_1_.ipynb1477
-rw-r--r--Surveying_Volume_3/Chapter_2.ipynb448
-rw-r--r--Surveying_Volume_3/screenshots/solved_example.png.PNGbin0 -> 54057 bytes
-rw-r--r--Surveying_Volume_3/screenshots/solved_example_2.png.PNGbin0 -> 24587 bytes
-rw-r--r--Surveying_Volume_3/screenshots/solved_example_3.png.PNGbin0 -> 31657 bytes
-rw-r--r--Thermodynamics:_A_Core_Course/CH2.ipynb105
-rw-r--r--Thermodynamics:_A_Core_Course/CH3.ipynb941
-rw-r--r--Thermodynamics:_A_Core_Course/CH4.ipynb146
-rw-r--r--Thermodynamics:_A_Core_Course/CH5.ipynb1763
-rw-r--r--Thermodynamics:_A_Core_Course/CH6.ipynb702
-rw-r--r--Thermodynamics:_A_Core_Course/CH7.ipynb603
-rw-r--r--Thermodynamics:_A_Core_Course/README.txt10
-rw-r--r--Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.pngbin0 -> 64676 bytes
-rw-r--r--Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.pngbin0 -> 81768 bytes
-rw-r--r--Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.pngbin0 -> 77102 bytes
-rw-r--r--Transport_Phenomena/README.txt10
-rw-r--r--Transport_Phenomena/ch1.ipynb120
-rw-r--r--Transport_Phenomena/ch10.ipynb1031
-rw-r--r--Transport_Phenomena/ch11.ipynb614
-rw-r--r--Transport_Phenomena/ch12.ipynb713
-rw-r--r--Transport_Phenomena/ch13.ipynb314
-rw-r--r--Transport_Phenomena/ch14.ipynb620
-rw-r--r--Transport_Phenomena/ch15.ipynb263
-rw-r--r--Transport_Phenomena/ch2.ipynb548
-rw-r--r--Transport_Phenomena/ch3.ipynb236
-rw-r--r--Transport_Phenomena/ch4.ipynb348
-rw-r--r--Transport_Phenomena/ch5.ipynb381
-rw-r--r--Transport_Phenomena/ch6.ipynb472
-rw-r--r--Transport_Phenomena/ch7.ipynb1040
-rw-r--r--Transport_Phenomena/ch9.ipynb209
-rw-r--r--Transport_Phenomena/screenshots/pic1.pngbin0 -> 139232 bytes
-rw-r--r--Transport_Phenomena/screenshots/pic2.pngbin0 -> 123486 bytes
-rw-r--r--Transport_Phenomena/screenshots/pic3.pngbin0 -> 113769 bytes
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_10.ipynb66
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_11.ipynb145
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_12.ipynb281
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_13.ipynb30
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_14.ipynb287
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_15.ipynb229
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_16.ipynb290
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_2.ipynb429
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_3.ipynb449
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_4.ipynb158
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_5.ipynb349
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_6.ipynb130
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_7.ipynb227
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_8.ipynb283
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_9.ipynb271
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_no_1.ipynb57
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/README.txt10
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter2.pngbin0 -> 182077 bytes
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter4.pngbin0 -> 177616 bytes
-rw-r--r--_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/chapter3.pngbin0 -> 178108 bytes
-rw-r--r--_Programming_With_C/README.txt10
-rw-r--r--_Programming_With_C/chapter1.ipynb61
-rw-r--r--_Programming_With_C/chapter10.ipynb268
-rw-r--r--_Programming_With_C/chapter11.ipynb328
-rw-r--r--_Programming_With_C/chapter12.ipynb568
-rw-r--r--_Programming_With_C/chapter13.ipynb183
-rw-r--r--_Programming_With_C/chapter14.ipynb235
-rw-r--r--_Programming_With_C/chapter2.ipynb119
-rw-r--r--_Programming_With_C/chapter3.ipynb135
-rw-r--r--_Programming_With_C/chapter4.ipynb578
-rw-r--r--_Programming_With_C/chapter5.ipynb98
-rw-r--r--_Programming_With_C/chapter6.ipynb1320
-rw-r--r--_Programming_With_C/chapter7.ipynb721
-rw-r--r--_Programming_With_C/chapter8.ipynb564
-rw-r--r--_Programming_With_C/chapter9.ipynb563
-rw-r--r--_Programming_With_C/screenshots/Untitled1.pngbin0 -> 19174 bytes
-rw-r--r--_Programming_With_C/screenshots/Untitled2.pngbin0 -> 20364 bytes
-rw-r--r--_Programming_With_C/screenshots/Untitled3.pngbin0 -> 23339 bytes
864 files changed, 301824 insertions, 0 deletions
diff --git a/ANSI_C_Programming/chapter1.ipynb b/ANSI_C_Programming/chapter1.ipynb
new file mode 100644
index 00000000..d5485e0e
--- /dev/null
+++ b/ANSI_C_Programming/chapter1.ipynb
@@ -0,0 +1,200 @@
+{
+ "metadata": {
+ "name": "chapter1.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 1: GETTING STARTED"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of simple interest\n",
+ "#Author gekay Date:25/08/2009\n",
+ "p=1000\n",
+ "n=3\n",
+ "r=8.5\n",
+ "si=p*n*r/100 #formula for simple interest\n",
+ "print \"%f\\n\" % (si)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "255.000000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of simple interest\n",
+ "#Author gekay Date 25/07/2008\n",
+ "print \"Enter values of p,n,r\"\n",
+ "p=eval(raw_input())\n",
+ "n=eval(raw_input())\n",
+ "r=eval(raw_input())\n",
+ "si=p*n*r/100\n",
+ "print \"%f\\n\" % (si)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values of p,n,r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "255.000000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example on page:18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Just for fun. Author.Bozo\n",
+ "print \"Enter a number\"\n",
+ "num=eval(raw_input()) #to take user input\n",
+ "print \"Now I am letting you on a secret...\\n\"\n",
+ "print \"You have just entered the number %d\\n\" % (num)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Now I am letting you on a secret...\n",
+ "\n",
+ "You have just entered the number 30\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find exponentiation of numbers\n",
+ "a=pow(3,2) #(3**2) will also do the same operation\n",
+ "print \"%d\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter10.ipynb b/ANSI_C_Programming/chapter10.ipynb
new file mode 100644
index 00000000..51080026
--- /dev/null
+++ b/ANSI_C_Programming/chapter10.ipynb
@@ -0,0 +1,768 @@
+{
+ "metadata": {
+ "name": "chapter10.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 10: STRUCTURES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:342-343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#storing & printing names,prices & pages of books\n",
+ "name=[]\n",
+ "price=[]\n",
+ "pages=[]\n",
+ "for i in range(3):\n",
+ " name.append(\"\\0\")\n",
+ " price.append(0)\n",
+ " pages.append(0)\n",
+ "print \"Enter names,prices and no. of pages of 3 books\\n\"\n",
+ "for i in range(0,3,1):\n",
+ " name[i]=raw_input()\n",
+ " price[i]=eval(raw_input())\n",
+ " pages[i]=eval(raw_input())\n",
+ "print \"\\nAnd this is what you entered\\n\"\n",
+ "for i in range(0,3,1):\n",
+ " print \"%c %f %d\\n\" % (name[i],price[i],pages[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter names,prices and no. of pages of 3 books\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100.00\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "354\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "256.50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "682\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "233.70\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "512\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "And this is what you entered\n",
+ "\n",
+ "A 100.000000 354\n",
+ "\n",
+ "C 256.500000 682\n",
+ "\n",
+ "F 233.700000 512\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:343-344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#storing & printing names,prices & pages of books using structure\n",
+ "class book: #YOU CAN ALSO USE CTYPES FOR IMPLEMENTING STRUCTURES\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "b1=book()\n",
+ "b2=book()\n",
+ "b3=book()\n",
+ "print \"Enter names,prices & no. of pages of 3 books\\n\"\n",
+ "b1.name=raw_input()\n",
+ "b1.price=eval(raw_input())\n",
+ "b1.pages=eval(raw_input())\n",
+ "b2.name=raw_input()\n",
+ "b2.price=eval(raw_input())\n",
+ "b2.pages=eval(raw_input())\n",
+ "b3.name=raw_input()\n",
+ "b3.price=eval(raw_input())\n",
+ "b3.pages=eval(raw_input())\n",
+ "print \"And this is what you entered\\n\"\n",
+ "print \"%c %f %d\\n\" % (b1.name,b1.price,b1.pages)\n",
+ "print \"%c %f %d\\n\" % (b2.name,b2.price,b2.pages)\n",
+ "print \"%c %f %d\\n\" % (b3.name,b3.price,b3.pages)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter names,prices & no. of pages of 3 books\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100.00\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "354\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "256.50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "682\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "233.70\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "512\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "And this is what you entered\n",
+ "\n",
+ "A 100.000000 354\n",
+ "\n",
+ "C 256.500000 682\n",
+ "\n",
+ "F 233.700000 512\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Memory map of structure elements\n",
+ "class book():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "b1=book(name='B',price=130.00,pages=550)\n",
+ "print \"Address of name=%u\\n\" % (id(b1.name))\n",
+ "print \"Address of price=%u\\n\" % (id(b1.price))\n",
+ "print \"Address of pages=%u\\n\" % (id(b1.pages))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of name=20788864\n",
+ "\n",
+ "Address of price=88371144\n",
+ "\n",
+ "Address of pages=88859008\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:348-349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Usage of an array of stuctures\n",
+ "def linkfloat():\n",
+ " a=0\n",
+ " b=id(a) #cause emulator to be linked\n",
+ "class book():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "b=[]\n",
+ "for i in range(3):\n",
+ " b.append(0) #setting initial value as zero\n",
+ "for i in range(0,3,1):\n",
+ " b[i]=book()\n",
+ "for i in range(0,3,1):\n",
+ " print \"Enter name price and pages\"\n",
+ " b[i].name=raw_input()\n",
+ " b[i].price=eval(raw_input())\n",
+ " b[i].pages=eval(raw_input())\n",
+ "for i in range(0,3,1):\n",
+ " print \"%c %f %d\\n\" % (b[i].name,b[i].price,b[i].pages)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name price and pages\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100.00\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "354\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name price and pages\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "256.50\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "682\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name price and pages\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "233.70\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "512\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A 100.000000 354\n",
+ "\n",
+ "C 256.500000 682\n",
+ "\n",
+ "F 233.700000 512\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:350-351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copying elements of an structure into another structure\n",
+ "class employee():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e1=employee(name=\"Sanjay\",age=30,salary=5500.50)\n",
+ "e2=employee()\n",
+ "e3=employee()\n",
+ "#piece-meal copying\n",
+ "import copy\n",
+ "e2.name=copy.copy(e1.name)\n",
+ "e2.age=e1.age\n",
+ "e2.salary=e1.salary\n",
+ "#copying all elements at one go\n",
+ "e3=e2\n",
+ "print \"%s %d %f\\n\" % (e1.name,e1.age,e1.salary)\n",
+ "print \"%s %d %f\\n\" % (e2.name,e2.age,e2.salary)\n",
+ "print \"%s %d %f\\n\" % (e3.name,e3.age,e3.salary)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sanjay 30 5500.500000\n",
+ "\n",
+ "Sanjay 30 5500.500000\n",
+ "\n",
+ "Sanjay 30 5500.500000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:351-352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#declaring a structure inside another structure\n",
+ "class address():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "class emp():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "a = address(phone=\"531046\", city=\"nagpur\", pin=10)\n",
+ "e = emp(name=\"jeru\", address=a)\n",
+ "print \"name=%s phone=%s\\n\" % (e.name,e.address.phone)\n",
+ "print \"city=%s pin=%d\\n\" % (e.address.city,e.address.pin)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name=jeru phone=531046\n",
+ "\n",
+ "city=nagpur pin=10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#passing individual structure elements to a function\n",
+ "class book():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "def display(s,t,n):\n",
+ " print \"%s %s %d\\n\" % (s,t,n)\n",
+ "b1=book(name=\"Let us C\",author=\"YPK\",callno=101)\n",
+ "display(b1.name,b1.author,b1.callno)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:353-354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#passing whole structure to a function\n",
+ "class book():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "def display(b):\n",
+ " print \"%s %s %d\\n\" % (b.name,b.author,b.callno)\n",
+ "b1=book(name=\"Let us C\",author=\"YPK\",callno=101)\n",
+ "display(b1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:354-355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing structure elements to a function\n",
+ "class book():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "b1=book(name=\"Let us C\",author=\"YPK\",callno=101)\n",
+ "ptr=book()\n",
+ "ptr=b1\n",
+ "print \"%s %s %d\\n\" % (b1.name,b1.author,b1.callno)\n",
+ "print \"%s %s %d\\n\" % (ptr.name,ptr.author,ptr.callno)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n",
+ "\n",
+ "Let us C YPK 101\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:355-356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#passing address of a structure variable\n",
+ "class book():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "def display(b):\n",
+ " print \"%s %s %d\\n\" % (b.name,b.author,b.callno)\n",
+ "b1=book(name=\"Let us C\",author=\"YPK\",callno=101)\n",
+ "display(b1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing address of elements of structure\n",
+ "class emp():\n",
+ " def __init__(self, **kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp(a=0,ch='\\0',s=0.0)\n",
+ "print \"%u %u %u\\n\" % (id(e.a),id(e.ch),id(e.s))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20623060 20204312 88374024\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:357-358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Implementation of structure\n",
+ "#pragma directive is not present in python\n",
+ "class emp():\n",
+ " def __init__(self,a,ch,s): #Structure without using dictionary\n",
+ " self.a=a\n",
+ " self.ch=ch\n",
+ " self.s=s\n",
+ "e=emp(a=0,ch='\\0',s=0.0)\n",
+ "print \"%u %u %u\\n\" % (id(e.a),id(e.ch),id(e.s))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20360916 19942168 88177544\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter11.ipynb b/ANSI_C_Programming/chapter11.ipynb
new file mode 100644
index 00000000..4d9a0fc1
--- /dev/null
+++ b/ANSI_C_Programming/chapter11.ipynb
@@ -0,0 +1,533 @@
+{
+ "metadata": {
+ "name": "chapter11.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 11: CONSOLE INPUT/OUTPUT"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program explaining the interpretation of contents of format string\n",
+ "avg=346\n",
+ "per=69.2\n",
+ "print \"Average=%d\\nPercentage=%f\\n\" % (avg,per)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average=346\n",
+ "Percentage=69.200000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program explaining field-width of format specifiers\n",
+ "weight=63\n",
+ "print \"weight is %d kg\\n\" % (weight)\n",
+ "print \"weight is %2d kg\\n\" % (weight)\n",
+ "print \"weight is %4d kg\\n\" % (weight)\n",
+ "print \"weight is %6d kg\\n\" % (weight)\n",
+ "print \"weight is %-6d kg\\n\" % (weight)\n",
+ "print \"weight is %1d kg\\n\" % (weight)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "weight is 63 kg\n",
+ "\n",
+ "weight is 63 kg\n",
+ "\n",
+ "weight is 63 kg\n",
+ "\n",
+ "weight is 63 kg\n",
+ "\n",
+ "weight is 63 kg\n",
+ "\n",
+ "weight is 63 kg\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:374-375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program without using field-width\n",
+ "print \"%f%f%f\\n\" % (5.0,13.5,133.9)\n",
+ "print \"%f%f%f\\n\" % (305.0,1200.9,3005.3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5.00000013.500000133.900000\n",
+ "\n",
+ "305.0000001200.9000003005.300000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program using field-width to line-up properly\n",
+ "print \"%10.1f%10.1f%10.1f\\n\" % (5.0,13.5,133.9)\n",
+ "print \"%10.1f%10.1f%10.1f\\n\" % (305.0,1200.9,3005.3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 5.0 13.5 133.9\n",
+ "\n",
+ " 305.0 1200.9 3005.3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Formatting strings with printf()\n",
+ "firstname1=\"Sandy\"\n",
+ "surname1=\"Malya\"\n",
+ "firstname2=\"AjayKumar\"\n",
+ "surname2=\"Gurubaxani\"\n",
+ "print \"%20s%20s\\n\" % (firstname1,surname1)\n",
+ "print \"%20s%20s\\n\" % (firstname2,surname2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sandy Malya\n",
+ "\n",
+ " AjayKumar Gurubaxani\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of escape sequences like tab and newlines\n",
+ "print \"You\\tmust\\tbe\\tcrazy\\nto\\thate\\tthis\\tbook\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You\tmust\tbe\tcrazy\n",
+ "to\thate\tthis\tbook\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:377-378"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using different format specifiers in print function\n",
+ "ch='z'\n",
+ "i=125\n",
+ "a=12.55\n",
+ "s=\"hello there!\"\n",
+ "print \"%c %d %f\\n\" % (ch,ord(ch),ord(ch))\n",
+ "print \"%s\\n\" % (s) #here conversation not possible\n",
+ "print \"%c %d %f\\n\" % (i,i,i)\n",
+ "print \"%f %d\\n\" % (a,a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z 122 122.000000\n",
+ "\n",
+ "hello there!\n",
+ "\n",
+ "} 125 125.000000\n",
+ "\n",
+ "12.550000 12\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#assigning elements to an array\n",
+ "i=10\n",
+ "ch='A'\n",
+ "a=3.14\n",
+ "print \"%d %c %f\\n\" % (i,ch,a)\n",
+ "str=[i,ch,a]\n",
+ "print \"%s\\n\" % (str)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10 A 3.140000\n",
+ "\n",
+ "[10, 'A', 3.14]\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#use of input function\n",
+ "print \"Press any key to continue\"\n",
+ "raw_input() #will echo the character\n",
+ "print \"\\nType any character\"\n",
+ "ch=raw_input() #will echo the character typed\n",
+ "print \"\\nType any character\"\n",
+ "raw_input() #will echo character\n",
+ "print \"\\nContinue Y/N\"\n",
+ "raw_input() #will echo character"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press any key to continue\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Type any character\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Type any character\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Continue Y/N\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 11,
+ "text": [
+ "'Y'"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of print function\n",
+ "ch='A'\n",
+ "print ch,\n",
+ "print(ch),\n",
+ "print ch,\n",
+ "print 'Z',\n",
+ "print('Z'),\n",
+ "print'Z',"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A A A Z Z Z\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to input a string of characters\n",
+ "print \"Enter name\"\n",
+ "name=raw_input()\n",
+ "print \"%s\\n\" % (name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jonty Rhodes\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jonty Rhodes\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to input a string of characters\n",
+ "print \"Enter name\"\n",
+ "footballer=raw_input() #sends base address of array\n",
+ "print \"Happy footballing!\"\n",
+ "print footballer"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jonty Rhodes\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Happy footballing!\n",
+ "Jonty Rhodes\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter12.ipynb b/ANSI_C_Programming/chapter12.ipynb
new file mode 100644
index 00000000..1c8b157f
--- /dev/null
+++ b/ANSI_C_Programming/chapter12.ipynb
@@ -0,0 +1,1455 @@
+{
+ "metadata": {
+ "name": "chapter12.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 12:FILE INPUT/OUTPUT"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reads strings from the file and displays them on screen\n",
+ "fp=open('PR1.txt','r') #open the file for reading\n",
+ "ch=fp.readlines() #ch will store all content of file\n",
+ "print \"%s\" % (' '.join(ch)) #prints content of file\n",
+ "print \"\\n\"\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "site:http://www.bzu.edu.pk/\n",
+ " user:siteuser@localhost\n",
+ " version:5.5.32-0ubuntu0.12.04.1\n",
+ " db: bzu\n",
+ " tables:\n",
+ " username:web,webadmin,webadministrator23\n",
+ " pass:71dc9f7af599450b23a3b5d54bc665c7,\t49fa1a081c8d5c8dcfa05d730803251a,\t*E8665C4049F515D836A3C8704D0543C6DA0FE96D\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:394"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Showing error in opening a file\n",
+ "try:\n",
+ " fp=open('yoyo.txt','r')\n",
+ " for line in fin:\n",
+ " print line\n",
+ " fp.close()\n",
+ "except:\n",
+ " print 'cannot open file'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cannot open file\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Count chars, spaces, tabs and newlines in a file\n",
+ "nol=0\n",
+ "nom=0\n",
+ "nob=0\n",
+ "noc=0\n",
+ "fp=open('H4CK3R.txt','r')\n",
+ "while True:\n",
+ " ch=fp.read(1)\n",
+ " if not ch:\n",
+ " break\n",
+ " noc+=1\n",
+ " if ch==' ':\n",
+ " nob+=1\n",
+ " if ch=='\\n':\n",
+ " nol+=1\n",
+ " if ch=='\\t':\n",
+ " nom+=1\n",
+ "fp.close()\n",
+ "print \"\\n\"\n",
+ "fp.close()\n",
+ "print \"Number of characters=%d\\n\" % (noc)\n",
+ "print \"Number of blanks=%d\\n\" % (nob)\n",
+ "print \"Number of tabs=%d\\n\" % (nom)\n",
+ "print \"Number of lines=%d\\n\" % (nol)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "Number of characters=162\n",
+ "\n",
+ "Number of blanks=21\n",
+ "\n",
+ "Number of tabs=3\n",
+ "\n",
+ "Number of lines=4\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:396-397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program that copies the content of one file into another\n",
+ "import sys\n",
+ "try:\n",
+ " fs=open('H4CK3R.txt','r')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ " sys.exit(1)\n",
+ "try:\n",
+ " ft=open('python.txt','w')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ " fs.close()\n",
+ " sys.exit(2)\n",
+ "ch=fs.readlines()\n",
+ "ft.writelines(ch)\n",
+ "fs.close()\n",
+ "ft.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Receives strings from keyboard and writes them to file\n",
+ "try:\n",
+ " fp=open('POEM.txt','w')\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "print \"\\nEnter a few lines of text:\\n\"\n",
+ "s=' '\n",
+ "while (len(s)>0):\n",
+ " s=raw_input()\n",
+ " fp.writelines(s)\n",
+ " fp.writelines(\"\\n\")\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter a few lines of text:\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shining and bright,they are forever,\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "so true about diamonds,\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "more so of memories,\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "especially yours!\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reads strings from the file and displays them on screen\n",
+ "try:\n",
+ " fp=open('POEM.txt','r')\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "s=fp.read(99)\n",
+ "print \"%s\" % (s)\n",
+ "print \"\\n\"\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shining and bright,they are forever,\n",
+ "so true about diamonds,\n",
+ "more so of memories,\n",
+ "especially yours!\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:401-402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Writes records to a file using structure\n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "another='Y'\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMPLOYEE.txt','w')\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "while another=='Y':\n",
+ " print \"\\nEnter name,age and basic salary:\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " ch=\"%s %d %f\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(ch)\n",
+ " fp.writelines(\"\\n\")\n",
+ " print \"Add another record(Y/N)\"\n",
+ " another=raw_input()\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sunil\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1250.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sameer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "21\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1300.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rahul\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1400.55\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:403-404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read records from a file using structure\n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMPLOYEE.txt','r') # open the file for reading\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "for line in fp: # iterate over each line\n",
+ " e.name, e.age, e.bs = line.split() # split it by whitespace\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs) # convert bs from string to float\n",
+ " print \"%s %d %f\\n\" %(e.name, e.age, e.bs)\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sunil 34 1250.500000\n",
+ "\n",
+ "Sameer 21 1300.500000\n",
+ "\n",
+ "Rahul 34 1400.550000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:404-405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to copy text as well as binary files\n",
+ "import sys #for exit()\n",
+ "try:\n",
+ " fs=open('H4CK3R.txt','rb') # open the file for reading\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ " sys.exit(1)\n",
+ "try:\n",
+ " ft=open('python.txt','wb') # open the file for writing\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ " fs.close()\n",
+ " sys.exit(2)\n",
+ "ch=fs.readlines()\n",
+ "ft.writelines(ch)\n",
+ "fs.close()\n",
+ "ft.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:407-408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Receives records from keyboard and writes them to a file in binary mode\n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "another='Y'\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMP.txt','wb') # open the file for reading\n",
+ "except:\n",
+ " print 'cannot open file' \n",
+ "while another=='Y':\n",
+ " print \"\\nEnter name,age and basic salary:\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " ch=\"%s %d %f\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(ch)\n",
+ " print \"Add another record (Y/N)\"\n",
+ " another=raw_input()\n",
+ " if another=='Y':\n",
+ " fp.writelines(\"\\n\")\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1250.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record (Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ranjan\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "21\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1300.60\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record (Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Harish\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "28\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1400.70\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record (Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Read records from binary file and displays them on VDU\n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMP.txt','rb')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ "for line in fp:\n",
+ " e.name, e.age, e.bs = line.split() # split it by whitespace\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs) # convert bs from string to float\n",
+ " print \"%s %d %f\\n\" %(e.name, e.age, e.bs)\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\n",
+ "\n",
+ "Ranjan 21 1300.600000\n",
+ "\n",
+ "Harish 28 1400.700000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:411-414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#A menu-driven program for elementary database management\n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMP.txt','rb+') # open the file for reading\n",
+ "except:\n",
+ " try:\n",
+ " fp=open('EMP.txt','wb+') # open the file for writing\n",
+ " except:\n",
+ " print 'cannot open file'\n",
+ "while 1:\n",
+ " print \"1.Add Records\"\n",
+ " print \"2.List Records\"\n",
+ " print \"3.Modify Records\"\n",
+ " print \"4.Delete Records\"\n",
+ " print \"0.Exit\"\n",
+ " print \"Your choice\"\n",
+ " choice=eval(raw_input())\n",
+ " def add():\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_END)\n",
+ " another='Y'\n",
+ " while another=='Y':\n",
+ " print \"\\nEnter name,age and basic salary:\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " ch=\"%s %d %f\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(\"\\n\")\n",
+ " fp.writelines(ch)\n",
+ " print \"Add another record(Y/N)\"\n",
+ " another=raw_input()\n",
+ " def list():\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_SET)\n",
+ " for line in fp: # iterate over each line\n",
+ " if len(line)>10:\n",
+ " e.name, e.age, e.bs = line.split() # split it by whitespace\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs) # convert bs from string to float\n",
+ " print \"%s %d %f\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" %(e.name, e.age, e.bs)\n",
+ " def modify():\n",
+ " another='Y'\n",
+ " while another=='Y':\n",
+ " print \"\\nEnter name of employee to modify\"\n",
+ " empname=raw_input()\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_SET)\n",
+ " for line in iter(fp.readline, ''):\n",
+ " if len(line)>10:\n",
+ " e.name, e.age, e.bs=line.split()\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs)\n",
+ " if(cmp(e.name,empname)==0):\n",
+ " c=len(line)\n",
+ " print \"\\nEnter new name,age & bs\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " import os\n",
+ " fp.seek(-c,os.SEEK_CUR)\n",
+ " ch=\"%s %d %f\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(\"\\n\")\n",
+ " fp.writelines(ch)\n",
+ " fp.writelines(\"\\n\")\n",
+ " break\n",
+ " print \"\\nModify another Record(Y/N)\"\n",
+ " another=raw_input()\n",
+ " def delete():\n",
+ " another='Y'\n",
+ " global fp\n",
+ " while another=='Y':\n",
+ " print \"\\nEnter name of employee to delete\"\n",
+ " empname=raw_input()\n",
+ " ft=open('TEMP.txt','wb')\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_SET)\n",
+ " for line in fp:\n",
+ " if len(line)>10:\n",
+ " e.name, e.age, e.bs=line.split()\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs)\n",
+ " if(cmp(e.name,empname)!=0):\n",
+ " ch=\"%s %d %f\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" % (e.name,e.age,e.bs)\n",
+ " ft.writelines(ch)\n",
+ " ft.writelines(\"\\n\")\n",
+ " fp.close()\n",
+ " ft.close()\n",
+ " import os\n",
+ " os.remove(\"EMP.txt\") # Delete file EMP.txt\n",
+ " os.rename( \"TEMP.txt\", \"D:/EMP.txt\" ) # Rename a file from TEMP.txt to EMP.txt\n",
+ " fp=open('EMP.txt','rb+')\n",
+ " print \"Delete another record(Y/N)\"\n",
+ " another=raw_input()\n",
+ " def exit():\n",
+ " import sys\n",
+ " fp.close()\n",
+ " sys.exit(0)\n",
+ " def switch(c):\n",
+ " return {1: add,\n",
+ " 2: list,\n",
+ " 3: modify,\n",
+ " 4: delete,\n",
+ " 0: exit,\n",
+ " }[c]()\n",
+ " switch(choice)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ram\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GOPAL\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "19\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6755.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ram 20 5000.000000\t\t\t\t\t\t\t\t\t\t\n",
+ "GOPAL 19 6755.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name of employee to modify\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ram\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter new name,age & bs\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radhey\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4687.66\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Modify another Record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "Radhey 15 4687.660000\t\t\t\t\t\t\t\t\t\t\n",
+ "GOPAL 19 6755.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name of employee to delete\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radhey\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delete another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "GOPAL 19 6755.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name of employee to delete\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GOPAL\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delete another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "0",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\u001b[1;31m:\u001b[0m 0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:416-417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#File-copy program which copies text,.com and .exe files\n",
+ "from StringIO import StringIO\n",
+ "buffer = StringIO()\n",
+ "print \"\\nEnter source file name\"\n",
+ "source=raw_input()\n",
+ "try:\n",
+ " inhandle=open(source,'rb')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ "print \"Enter target file name\"\n",
+ "target=raw_input()\n",
+ "try:\n",
+ " outhandle=open(target,'wb')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ " inhandle.close()\n",
+ "bytes=inhandle.readlines()\n",
+ "buffer.write(bytes)\n",
+ "outhandle.writelines(buffer.getvalue())\n",
+ "buffer.close()\n",
+ "inhandle.close()\n",
+ "outhandle.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter source file name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H4CK3R.txt\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter target file name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "python.txt\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter13.ipynb b/ANSI_C_Programming/chapter13.ipynb
new file mode 100644
index 00000000..a481e2c4
--- /dev/null
+++ b/ANSI_C_Programming/chapter13.ipynb
@@ -0,0 +1,712 @@
+{
+ "metadata": {
+ "name": "chapter13.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 13: MORE ISSUES IN INPUT/OUTPUT"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:434-435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using argc & argv to copy one file into another\n",
+ "import sys\n",
+ "if(len(sys.argv)!=3):\n",
+ " print \"Improper number of arguments\\n\"\n",
+ " sys.exit(0)\n",
+ "try:\n",
+ " fs=open(sys.argv[1], \"r\")\n",
+ "except:\n",
+ " sys.exit(\"Cannot open source file\\n\")\n",
+ "try:\n",
+ " ft=open(sys.argv[2], \"w\")\n",
+ "except:\n",
+ " fs.close()\n",
+ " sys.exit(\"Cannot open source file\\n\")\n",
+ "ch=fs.readlines()\n",
+ "ft.writelines(ch)\n",
+ "fs.close()\n",
+ "ft.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:437-438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Detecting errors in reading/writing\n",
+ "try:\n",
+ " fp=open('python.txt','w')\n",
+ " while True:\n",
+ " ch=fp.read(1)\n",
+ " if not ch:\n",
+ " break;\n",
+ " print \"%c\" % (ch)\n",
+ "except:\n",
+ " print \"Error in reading file\\n\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error in reading file\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Prints file contents on printer\n",
+ "#there is no standard way to print using Python on all platforms\n",
+ "#It will work on windows platform\n",
+ "import tempfile\n",
+ "import win32api\n",
+ "import win32print\n",
+ "import sys\n",
+ "\n",
+ "try:\n",
+ " fp=open('poem.txt','r') #No need to open it\n",
+ "except:\n",
+ " sys.exit(\"Cannot open file\\n\")\n",
+ "win32api.ShellExecute (\n",
+ " 0,\n",
+ " \"print\",\n",
+ " \"poem.txt\",\n",
+ " '/d:\"%s\"' % win32print.GetDefaultPrinter (),\n",
+ " \".\",\n",
+ " 0\n",
+ ")\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 3,
+ "text": [
+ "42"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:440-441"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#redirecting the output from the screen to a file\n",
+ "import sys\n",
+ "ch = sys.stdin.read(1)\n",
+ "while (len(ch)>0):\n",
+ " sys.stdout.write(ch)\n",
+ " ch = sys.stdin.read(1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:442"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program for generating the ASCII table on screen\n",
+ "for ch in range(0,256,1):\n",
+ " print \"%d %c\\n\" % (ch,ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 \u0000\n",
+ "\n",
+ "1 \u0001\n",
+ "\n",
+ "2 \u0002\n",
+ "\n",
+ "3 \u0003\n",
+ "\n",
+ "4 \u0004\n",
+ "\n",
+ "5 \u0005\n",
+ "\n",
+ "6 \u0006\n",
+ "\n",
+ "7 \u0007\n",
+ "\n",
+ "8 \b\n",
+ "\n",
+ "9 \t\n",
+ "\n",
+ "10 \n",
+ "\n",
+ "\n",
+ "11 \u000b",
+ "\n",
+ "\n",
+ "12 \f",
+ "\n",
+ "\n",
+ "13 \r\n",
+ "\n",
+ "14 \u000e\n",
+ "\n",
+ "15 \u000f\n",
+ "\n",
+ "16 \u0010\n",
+ "\n",
+ "17 \u0011\n",
+ "\n",
+ "18 \u0012\n",
+ "\n",
+ "19 \u0013\n",
+ "\n",
+ "20 \u0014\n",
+ "\n",
+ "21 \u0015\n",
+ "\n",
+ "22 \u0016\n",
+ "\n",
+ "23 \u0017\n",
+ "\n",
+ "24 \u0018\n",
+ "\n",
+ "25 \u0019\n",
+ "\n",
+ "26 \u001a\n",
+ "\n",
+ "27 \u001b\n",
+ "\n",
+ "28 \u001c",
+ "\n",
+ "\n",
+ "29 \u001d",
+ "\n",
+ "\n",
+ "30 \u001e",
+ "\n",
+ "\n",
+ "31 \u001f\n",
+ "\n",
+ "32 \n",
+ "\n",
+ "33 !\n",
+ "\n",
+ "34 \"\n",
+ "\n",
+ "35 #\n",
+ "\n",
+ "36 $\n",
+ "\n",
+ "37 %\n",
+ "\n",
+ "38 &\n",
+ "\n",
+ "39 '\n",
+ "\n",
+ "40 (\n",
+ "\n",
+ "41 )\n",
+ "\n",
+ "42 *\n",
+ "\n",
+ "43 +\n",
+ "\n",
+ "44 ,\n",
+ "\n",
+ "45 -\n",
+ "\n",
+ "46 .\n",
+ "\n",
+ "47 /\n",
+ "\n",
+ "48 0\n",
+ "\n",
+ "49 1\n",
+ "\n",
+ "50 2\n",
+ "\n",
+ "51 3\n",
+ "\n",
+ "52 4\n",
+ "\n",
+ "53 5\n",
+ "\n",
+ "54 6\n",
+ "\n",
+ "55 7\n",
+ "\n",
+ "56 8\n",
+ "\n",
+ "57 9\n",
+ "\n",
+ "58 :\n",
+ "\n",
+ "59 ;\n",
+ "\n",
+ "60 <\n",
+ "\n",
+ "61 =\n",
+ "\n",
+ "62 >\n",
+ "\n",
+ "63 ?\n",
+ "\n",
+ "64 @\n",
+ "\n",
+ "65 A\n",
+ "\n",
+ "66 B\n",
+ "\n",
+ "67 C\n",
+ "\n",
+ "68 D\n",
+ "\n",
+ "69 E\n",
+ "\n",
+ "70 F\n",
+ "\n",
+ "71 G\n",
+ "\n",
+ "72 H\n",
+ "\n",
+ "73 I\n",
+ "\n",
+ "74 J\n",
+ "\n",
+ "75 K\n",
+ "\n",
+ "76 L\n",
+ "\n",
+ "77 M\n",
+ "\n",
+ "78 N\n",
+ "\n",
+ "79 O\n",
+ "\n",
+ "80 P\n",
+ "\n",
+ "81 Q\n",
+ "\n",
+ "82 R\n",
+ "\n",
+ "83 S\n",
+ "\n",
+ "84 T\n",
+ "\n",
+ "85 U\n",
+ "\n",
+ "86 V\n",
+ "\n",
+ "87 W\n",
+ "\n",
+ "88 X\n",
+ "\n",
+ "89 Y\n",
+ "\n",
+ "90 Z\n",
+ "\n",
+ "91 [\n",
+ "\n",
+ "92 \\\n",
+ "\n",
+ "93 ]\n",
+ "\n",
+ "94 ^\n",
+ "\n",
+ "95 _\n",
+ "\n",
+ "96 `\n",
+ "\n",
+ "97 a\n",
+ "\n",
+ "98 b\n",
+ "\n",
+ "99 c\n",
+ "\n",
+ "100 d\n",
+ "\n",
+ "101 e\n",
+ "\n",
+ "102 f\n",
+ "\n",
+ "103 g\n",
+ "\n",
+ "104 h\n",
+ "\n",
+ "105 i\n",
+ "\n",
+ "106 j\n",
+ "\n",
+ "107 k\n",
+ "\n",
+ "108 l\n",
+ "\n",
+ "109 m\n",
+ "\n",
+ "110 n\n",
+ "\n",
+ "111 o\n",
+ "\n",
+ "112 p\n",
+ "\n",
+ "113 q\n",
+ "\n",
+ "114 r\n",
+ "\n",
+ "115 s\n",
+ "\n",
+ "116 t\n",
+ "\n",
+ "117 u\n",
+ "\n",
+ "118 v\n",
+ "\n",
+ "119 w\n",
+ "\n",
+ "120 x\n",
+ "\n",
+ "121 y\n",
+ "\n",
+ "122 z\n",
+ "\n",
+ "123 {\n",
+ "\n",
+ "124 |\n",
+ "\n",
+ "125 }\n",
+ "\n",
+ "126 ~\n",
+ "\n",
+ "127 \u007f\n",
+ "\n",
+ "128 \ufffd\n",
+ "\n",
+ "129 \ufffd\n",
+ "\n",
+ "130 \ufffd\n",
+ "\n",
+ "131 \ufffd\n",
+ "\n",
+ "132 \ufffd\n",
+ "\n",
+ "133 \ufffd\n",
+ "\n",
+ "134 \ufffd\n",
+ "\n",
+ "135 \ufffd\n",
+ "\n",
+ "136 \ufffd\n",
+ "\n",
+ "137 \ufffd\n",
+ "\n",
+ "138 \ufffd\n",
+ "\n",
+ "139 \ufffd\n",
+ "\n",
+ "140 \ufffd\n",
+ "\n",
+ "141 \ufffd\n",
+ "\n",
+ "142 \ufffd\n",
+ "\n",
+ "143 \ufffd\n",
+ "\n",
+ "144 \ufffd\n",
+ "\n",
+ "145 \ufffd\n",
+ "\n",
+ "146 \ufffd\n",
+ "\n",
+ "147 \ufffd\n",
+ "\n",
+ "148 \ufffd\n",
+ "\n",
+ "149 \ufffd\n",
+ "\n",
+ "150 \ufffd\n",
+ "\n",
+ "151 \ufffd\n",
+ "\n",
+ "152 \ufffd\n",
+ "\n",
+ "153 \ufffd\n",
+ "\n",
+ "154 \ufffd\n",
+ "\n",
+ "155 \ufffd\n",
+ "\n",
+ "156 \ufffd\n",
+ "\n",
+ "157 \ufffd\n",
+ "\n",
+ "158 \ufffd\n",
+ "\n",
+ "159 \ufffd\n",
+ "\n",
+ "160 \ufffd\n",
+ "\n",
+ "161 \ufffd\n",
+ "\n",
+ "162 \ufffd\n",
+ "\n",
+ "163 \ufffd\n",
+ "\n",
+ "164 \ufffd\n",
+ "\n",
+ "165 \ufffd\n",
+ "\n",
+ "166 \ufffd\n",
+ "\n",
+ "167 \ufffd\n",
+ "\n",
+ "168 \ufffd\n",
+ "\n",
+ "169 \ufffd\n",
+ "\n",
+ "170 \ufffd\n",
+ "\n",
+ "171 \ufffd\n",
+ "\n",
+ "172 \ufffd\n",
+ "\n",
+ "173 \ufffd\n",
+ "\n",
+ "174 \ufffd\n",
+ "\n",
+ "175 \ufffd\n",
+ "\n",
+ "176 \ufffd\n",
+ "\n",
+ "177 \ufffd\n",
+ "\n",
+ "178 \ufffd\n",
+ "\n",
+ "179 \ufffd\n",
+ "\n",
+ "180 \ufffd\n",
+ "\n",
+ "181 \ufffd\n",
+ "\n",
+ "182 \ufffd\n",
+ "\n",
+ "183 \ufffd\n",
+ "\n",
+ "184 \ufffd\n",
+ "\n",
+ "185 \ufffd\n",
+ "\n",
+ "186 \ufffd\n",
+ "\n",
+ "187 \ufffd\n",
+ "\n",
+ "188 \ufffd\n",
+ "\n",
+ "189 \ufffd\n",
+ "\n",
+ "190 \ufffd\n",
+ "\n",
+ "191 \ufffd\n",
+ "\n",
+ "192 \ufffd\n",
+ "\n",
+ "193 \ufffd\n",
+ "\n",
+ "194 \ufffd\n",
+ "\n",
+ "195 \ufffd\n",
+ "\n",
+ "196 \ufffd\n",
+ "\n",
+ "197 \ufffd\n",
+ "\n",
+ "198 \ufffd\n",
+ "\n",
+ "199 \ufffd\n",
+ "\n",
+ "200 \ufffd\n",
+ "\n",
+ "201 \ufffd\n",
+ "\n",
+ "202 \ufffd\n",
+ "\n",
+ "203 \ufffd\n",
+ "\n",
+ "204 \ufffd\n",
+ "\n",
+ "205 \ufffd\n",
+ "\n",
+ "206 \ufffd\n",
+ "\n",
+ "207 \ufffd\n",
+ "\n",
+ "208 \ufffd\n",
+ "\n",
+ "209 \ufffd\n",
+ "\n",
+ "210 \ufffd\n",
+ "\n",
+ "211 \ufffd\n",
+ "\n",
+ "212 \ufffd\n",
+ "\n",
+ "213 \ufffd\n",
+ "\n",
+ "214 \ufffd\n",
+ "\n",
+ "215 \ufffd\n",
+ "\n",
+ "216 \ufffd\n",
+ "\n",
+ "217 \ufffd\n",
+ "\n",
+ "218 \ufffd\n",
+ "\n",
+ "219 \ufffd\n",
+ "\n",
+ "220 \ufffd\n",
+ "\n",
+ "221 \ufffd\n",
+ "\n",
+ "222 \ufffd\n",
+ "\n",
+ "223 \ufffd\n",
+ "\n",
+ "224 \ufffd\n",
+ "\n",
+ "225 \ufffd\n",
+ "\n",
+ "226 \ufffd\n",
+ "\n",
+ "227 \ufffd\n",
+ "\n",
+ "228 \ufffd\n",
+ "\n",
+ "229 \ufffd\n",
+ "\n",
+ "230 \ufffd\n",
+ "\n",
+ "231 \ufffd\n",
+ "\n",
+ "232 \ufffd\n",
+ "\n",
+ "233 \ufffd\n",
+ "\n",
+ "234 \ufffd\n",
+ "\n",
+ "235 \ufffd\n",
+ "\n",
+ "236 \ufffd\n",
+ "\n",
+ "237 \ufffd\n",
+ "\n",
+ "238 \ufffd\n",
+ "\n",
+ "239 \ufffd\n",
+ "\n",
+ "240 \ufffd\n",
+ "\n",
+ "241 \ufffd\n",
+ "\n",
+ "242 \ufffd\n",
+ "\n",
+ "243 \ufffd\n",
+ "\n",
+ "244 \ufffd\n",
+ "\n",
+ "245 \ufffd\n",
+ "\n",
+ "246 \ufffd\n",
+ "\n",
+ "247 \ufffd\n",
+ "\n",
+ "248 \ufffd\n",
+ "\n",
+ "249 \ufffd\n",
+ "\n",
+ "250 \ufffd\n",
+ "\n",
+ "251 \ufffd\n",
+ "\n",
+ "252 \ufffd\n",
+ "\n",
+ "253 \ufffd\n",
+ "\n",
+ "254 \ufffd\n",
+ "\n",
+ "255 \ufffd\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter14.ipynb b/ANSI_C_Programming/chapter14.ipynb
new file mode 100644
index 00000000..c29af0ac
--- /dev/null
+++ b/ANSI_C_Programming/chapter14.ipynb
@@ -0,0 +1,407 @@
+{
+ "metadata": {
+ "name": "chapter14.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 14: OPERATIONS ON BITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:449"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Print binary equivalent of integers using showbits() function()\n",
+ "def showbits(x):\n",
+ " return bin(x)[2:].zfill(16)\n",
+ "for j in range(0,6,1):\n",
+ " print \"Decimal %d is same as binary\" % (j)\n",
+ " print showbits(j)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 0 is same as binary\n",
+ "0000000000000000\n",
+ "Decimal 1 is same as binary\n",
+ "0000000000000001\n",
+ "Decimal 2 is same as binary\n",
+ "0000000000000010\n",
+ "Decimal 3 is same as binary\n",
+ "0000000000000011\n",
+ "Decimal 4 is same as binary\n",
+ "0000000000000100\n",
+ "Decimal 5 is same as binary\n",
+ "0000000000000101\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of One's complement operator\n",
+ "def showbits(x):\n",
+ " return bin(x)[2:].zfill(16)\n",
+ "for j in range(0,4,1):\n",
+ " print \"Decimal %d is same as binary\" % (j)\n",
+ " print showbits(j)\n",
+ " k=j^65535 #using xor for making one's complement\n",
+ " print \"One's complement of %d is\" % (j)\n",
+ " print showbits(k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 0 is same as binary\n",
+ "0000000000000000\n",
+ "One's complement of 0 is\n",
+ "1111111111111111\n",
+ "Decimal 1 is same as binary\n",
+ "0000000000000001\n",
+ "One's complement of 1 is\n",
+ "1111111111111110\n",
+ "Decimal 2 is same as binary\n",
+ "0000000000000010\n",
+ "One's complement of 2 is\n",
+ "1111111111111101\n",
+ "Decimal 3 is same as binary\n",
+ "0000000000000011\n",
+ "One's complement of 3 is\n",
+ "1111111111111100\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#file encryption utility\n",
+ "import sys\n",
+ "def encrypt():\n",
+ " try:\n",
+ " fs=open('SOURCE.txt','r') #normal file\n",
+ " ft=open('TARGET.txt','w') #encrypted file\n",
+ " except:\n",
+ " print \"File opening error!\"\n",
+ " sys.exit(1)\n",
+ " while True:\n",
+ " ch=fs.read(1)\n",
+ " if not ch:\n",
+ " break\n",
+ " ft.write(bytearray([ord(ch)^0xff]))\n",
+ " fs.close()\n",
+ " ft.close()\n",
+ "encrypt()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:452"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of Right shift operator\n",
+ "def showbits(x):\n",
+ " return bin(x)[2:].zfill(16)\n",
+ "i=5225\n",
+ "print \"Decimal %d is same as binary\" % (i)\n",
+ "print showbits(i)\n",
+ "for j in range(0,6,1):\n",
+ " k=i>>j #right shift operator\n",
+ " print \"%d right shift %d gives\" % (i,j)\n",
+ " print showbits(k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 5225 is same as binary\n",
+ "0001010001101001\n",
+ "5225 right shift 0 gives\n",
+ "0001010001101001\n",
+ "5225 right shift 1 gives\n",
+ "0000101000110100\n",
+ "5225 right shift 2 gives\n",
+ "0000010100011010\n",
+ "5225 right shift 3 gives\n",
+ "0000001010001101\n",
+ "5225 right shift 4 gives\n",
+ "0000000101000110\n",
+ "5225 right shift 5 gives\n",
+ "0000000010100011\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:453-454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of left shift operator\n",
+ "def showbits(x):\n",
+ " return bin(x)[2:].zfill(16)\n",
+ "i=5225\n",
+ "print \"Decimal %d is same as binary\" % (i)\n",
+ "print showbits(i)\n",
+ "for j in range(0,5,1):\n",
+ " mask = 2 ** 16 - 1\n",
+ " k = (i << j) & mask #left shift operator\n",
+ " print \"%d right shift %d gives\" % (i,j)\n",
+ " print showbits(k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 5225 is same as binary\n",
+ "0001010001101001\n",
+ "5225 right shift 0 gives\n",
+ "0001010001101001\n",
+ "5225 right shift 1 gives\n",
+ "0010100011010010\n",
+ "5225 right shift 2 gives\n",
+ "0101000110100100\n",
+ "5225 right shift 3 gives\n",
+ "1010001101001000\n",
+ "5225 right shift 4 gives\n",
+ "0100011010010000\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:457-458"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Decoding date field in directory entry using bitwise operators\n",
+ "#Note:Answer in the book is wrong\n",
+ "d=9\n",
+ "m=3\n",
+ "y=1990\n",
+ "date=(y-1980)*512+m*32+d\n",
+ "print \"Date=%u\\n\" % (date)\n",
+ "year=1980+(date>>9)\n",
+ "month=((date<<7)>>12)\n",
+ "day=((date<<11)>>11)\n",
+ "print \"Year=%u\" % (year)\n",
+ "print \"Month=%u\" % (month)\n",
+ "print \"Day=%u\" % (day)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Date=5225\n",
+ "\n",
+ "Year=1990\n",
+ "Month=163\n",
+ "Day=5225\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#To test whether a bit in a number is ON or OFF\n",
+ "i=65\n",
+ "print \"Value of i=%d\\n\" % (i)\n",
+ "j=i&32\n",
+ "if j==0:\n",
+ " print \"and its fifth bit is off\\n\"\n",
+ "else:\n",
+ " print \"and its fifth bit is on\\n\"\n",
+ "j=i&64\n",
+ "if j==0:\n",
+ " print \"whereas its sixth bit is off\\n\"\n",
+ "else:\n",
+ " print \"whereas its sixth bit is on\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of i=65\n",
+ "\n",
+ "and its fifth bit is off\n",
+ "\n",
+ "whereas its sixth bit is on\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of XOR operator\n",
+ "b=50\n",
+ "b=b^12 #XOR operator\n",
+ "print \"%d\\n\" % (b) #this will print 62\n",
+ "b=b^12\n",
+ "print \"%d\\n\" % (b) #this will print 50"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "62\n",
+ "\n",
+ "50\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:463-464"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#function for 16 bit binary representation of a number\n",
+ "def showbit(n):\n",
+ " for i in range(15,-1,-1):\n",
+ " andmask=1<<i\n",
+ " k=n&andmask\n",
+ " if k==0:\n",
+ " print 0, \n",
+ " else:\n",
+ " print 1, \n",
+ " print \"\\n\"\n",
+ "showbit(32)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter15.ipynb b/ANSI_C_Programming/chapter15.ipynb
new file mode 100644
index 00000000..9a67d04b
--- /dev/null
+++ b/ANSI_C_Programming/chapter15.ipynb
@@ -0,0 +1,691 @@
+{
+ "metadata": {
+ "name": "chapter15.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 15: MISCELLANEOUS FEATURES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:473-474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of enumerated data type for an employee department\n",
+ "def emp_dept(*sequential, **named): #definition of enumeration\n",
+ " enums = dict(zip(sequential, range(len(sequential))), **named)\n",
+ " return type('Enum', (), enums)\n",
+ "class employee(): #structure\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "department=emp_dept('assembly','manufacturing','accounts','stores') #defining a variable of type enum emp_dept\n",
+ "e=employee(name=\"Lothar Mattheus\",age=28,bs=5575.50,department=department.manufacturing)\n",
+ "print \"Name=%s\\n\" % (e.name)\n",
+ "print \"Age=%d\\n\" % (e.age)\n",
+ "print \"Basic salary=%f\\n\" % (e.bs)\n",
+ "print \"Dept=%d\\n\" % (e.department)\n",
+ "if e.department==department.accounts:\n",
+ " print \"%s is an accountant\\n\" % (e.name)\n",
+ "else:\n",
+ " print \"%s is not an accountant\\n\" % (e.name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name=Lothar Mattheus\n",
+ "\n",
+ "Age=28\n",
+ "\n",
+ "Basic salary=5575.500000\n",
+ "\n",
+ "Dept=1\n",
+ "\n",
+ "Lothar Mattheus is not an accountant\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Above program using macros\n",
+ "def ASSEMBLY():\n",
+ " return 0\n",
+ "def MANUFACTURING():\n",
+ " return 1\n",
+ "def ACCOUNTS():\n",
+ " return 2\n",
+ "def STORES():\n",
+ " return 3\n",
+ "class employee():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=employee()\n",
+ "e.name=\"Lothar Mattheus\"\n",
+ "e.age=28\n",
+ "e.bs=5575.50\n",
+ "e.department=MANUFACTURING()\n",
+ "print \"Name=%s\\n\" % (e.name)\n",
+ "print \"Age=%d\\n\" % (e.age)\n",
+ "print \"Basic salary=%f\\n\" % (e.bs)\n",
+ "print \"Dept=%d\\n\" % (e.department)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name=Lothar Mattheus\n",
+ "\n",
+ "Age=28\n",
+ "\n",
+ "Basic salary=5575.500000\n",
+ "\n",
+ "Dept=1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:477-478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program showing need for typecasting\n",
+ "x=6\n",
+ "y=4\n",
+ "a=x/y #int\n",
+ "print \"Value of a=%f\\n\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a=1.000000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program using typecasting to convert an expression into particular data type\n",
+ "x=6\n",
+ "y=4\n",
+ "a=float(x)/y #float\n",
+ "print \"Value of a=%f\\n\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a=1.500000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:478-479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Another example of typecasting\n",
+ "a=6.35\n",
+ "print \"Value of a on type casting=%d\\n\" % (int(a)) #converts float to int\n",
+ "print \"Value of a=%f\\n\" % (a) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a on type casting=6\n",
+ "\n",
+ "Value of a=6.350000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:480"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using bit fields for stroring variables\n",
+ "from ctypes import *\n",
+ "def MALE():\n",
+ " return 0\n",
+ "def FEMALE():\n",
+ " return 1\n",
+ "def SINGLE():\n",
+ " return 0\n",
+ "def MARRIED():\n",
+ " return 1\n",
+ "def DIVORCED():\n",
+ " return 2\n",
+ "def WIDOWED():\n",
+ " return 3\n",
+ "class employee(Structure):\n",
+ " _fields_= [(\"gender\",c_short, 1), #1 bit size for storage\n",
+ " (\"mar_stat\", c_short, 2), #2 bit size for storage\n",
+ " (\"hobby\",c_short, 3), #3 bit size for storage\n",
+ " (\"scheme\",c_short, 4)] #4 bit size for storage\n",
+ "e=employee()\n",
+ "e.gender=MALE()\n",
+ "e.mar_status=DIVORCED()\n",
+ "e.hobby=5\n",
+ "e.scheme=9\n",
+ "print \"Gender=%d\\n\" % (e.gender)\n",
+ "print \"Marital status=%d\\n\" % (e.mar_status)\n",
+ "import ctypes\n",
+ "print \"Bytes occupied by e=%d\\n\" % (ctypes.sizeof(e))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gender=0\n",
+ "\n",
+ "Marital status=2\n",
+ "\n",
+ "Bytes occupied by e=2\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing address of function\n",
+ "def display():\n",
+ " print \"Long live viruses!!\\n\"\n",
+ "print \"Address of function display is %s\\n\" % (display)\n",
+ "display()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of function display is <function display at 0x02D93DF0>\n",
+ "\n",
+ "Long live viruses!!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:481-482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing address of function\n",
+ "def display():\n",
+ " print \"\\nLong live viruses!!\"\n",
+ "func_ptr=display\n",
+ "print \"Address of function display is %s\\n\" % (display)\n",
+ "func_ptr()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of function display is <function display at 0x05696730>\n",
+ "\n",
+ "\n",
+ "Long live viruses!!\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:483"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#function returning address\n",
+ "def fun():\n",
+ " i=20\n",
+ " return (id(i))\n",
+ "p=fun\n",
+ "p()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 9,
+ "text": [
+ "20688356"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:483-484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to copy one string into another\n",
+ "def copy(t,s):\n",
+ " t=\"\\0\"\n",
+ " for item in s:\n",
+ " t=t+item\n",
+ " return t\n",
+ "source=\"Jaded\"\n",
+ "target=[]\n",
+ "str1=copy(target,source)\n",
+ "print \"%s\\n\" % (str1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\u0000Jaded\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:485"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#function with variable number of arguments\n",
+ "def findmax(tot_num,*num): #tuples\n",
+ " max=0\n",
+ " for count in range(0,len(num),1):\n",
+ " if num[count]>max:\n",
+ " max=num[count]\n",
+ " return max\n",
+ "max=findmax(5,23,15,1,92,50)\n",
+ "print \"maximum=%d\\n\" % (max)\n",
+ "max=findmax(3,100,300,29)\n",
+ "print \"maximum=%d\\n\" % (max)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum=92\n",
+ "\n",
+ "maximum=300\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:486-487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#function for printing any number of arguments of any type\n",
+ "def display(type,num,*t):\n",
+ " def integer():\n",
+ " for j in range(0,num,1):\n",
+ " print \"%d\" % (t[j])\n",
+ " def char():\n",
+ " for j in range(0,num,1):\n",
+ " print \"%c\" % (t[j])\n",
+ " def floating():\n",
+ " for j in range(0,num,1):\n",
+ " print \"%f\" % (t[j])\n",
+ " def switch(ch):\n",
+ " return {1: integer,\n",
+ " 2: char,\n",
+ " 3: floating,\n",
+ " }[ch]()\n",
+ " switch(type)\n",
+ "display(1,2,5,6)\n",
+ "display(2,4,'A','a','b','c')\n",
+ "display(3,3,2.5,299.3,-1.0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n",
+ "6\n",
+ "A\n",
+ "a\n",
+ "b\n",
+ "c\n",
+ "2.500000\n",
+ "299.300000\n",
+ "-1.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Demo of union at work\n",
+ "from ctypes import *\n",
+ "class a(Union): #definition of union\n",
+ " _fields_= [(\"i\", c_short),\n",
+ " (\"ch\",c_byte*2)]\n",
+ "key=a()\n",
+ "key.i=512\n",
+ "print key.i\n",
+ "print key.ch[0]\n",
+ "print key.ch[1]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "512\n",
+ "0\n",
+ "2\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:491"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program explaining operation of union\n",
+ "from ctypes import *\n",
+ "class a(Union):\n",
+ " _fields_= [(\"i\", c_short),\n",
+ " (\"ch\",c_byte*2)]\n",
+ "key=a()\n",
+ "key.i=512\n",
+ "print key.i\n",
+ "print key.ch[0]\n",
+ "print key.ch[1]\n",
+ "key.ch[0]=50\n",
+ "print key.i\n",
+ "print key.ch[0]\n",
+ "print key.ch[1]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "512\n",
+ "0\n",
+ "2\n",
+ "562\n",
+ "50\n",
+ "2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:492-493"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program for union of structures\n",
+ "from ctypes import *\n",
+ "class a(Structure):\n",
+ " _fields_ = [(\"i\", c_short),\n",
+ " (\"c\", c_byte*2)]\n",
+ "\n",
+ "class b(Structure):\n",
+ " _fields_ = [(\"j\", c_short),\n",
+ " (\"d\", c_byte*2)]\n",
+ "\n",
+ "class z(Union):\n",
+ " _fields_ = [(\"key\", a),\n",
+ " (\"data\", b)]\n",
+ "strange = z()\n",
+ "strange.key.i=512\n",
+ "strange.data.d[0]=0\n",
+ "strange.data.d[1]=32\n",
+ "print strange.key.i\n",
+ "print strange.data.j\n",
+ "print strange.key.c[0]\n",
+ "print strange.data.d[0]\n",
+ "print strange.key.c[1]\n",
+ "print strange.data.d[1]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "512\n",
+ "512\n",
+ "0\n",
+ "0\n",
+ "32\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:494-495"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Utility of Unions\n",
+ "from ctypes import *\n",
+ "class info1(Structure):\n",
+ " _fields_ = [(\"hobby\", c_byte*10),\n",
+ " (\"crcardno\", c_short)]\n",
+ "\n",
+ "class info2(Structure):\n",
+ " _fields_ = [(\"vehno\", c_byte*10),\n",
+ " (\"dist\", c_short)]\n",
+ "\n",
+ "class info(Union):\n",
+ " _fields_ = [(\"a\", info1),\n",
+ " (\"b\", info2)]\n",
+ "class emp(Structure):\n",
+ " _fields_ = [(\"n\", c_byte*20),\n",
+ " (\"grade\", c_byte*4),\n",
+ " (\"age\", c_short),\n",
+ " (\"f\", info)]\n",
+ "e=emp()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter2.ipynb b/ANSI_C_Programming/chapter2.ipynb
new file mode 100644
index 00000000..255326b2
--- /dev/null
+++ b/ANSI_C_Programming/chapter2.ipynb
@@ -0,0 +1,782 @@
+{
+ "metadata": {
+ "name": "chapter2.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 2: THE DECISION CONTROL STRUCTURE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE-45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Demonstration of if statement\n",
+ "print \"Enter a number less than 10\"\n",
+ "num=eval(raw_input()) #Inputs float variables #you can also input float variables using input()\n",
+ "if num<10:\n",
+ " print \"What an obedient servant you are !\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number less than 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "What an obedient servant you are !\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1: Page-47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of total expenses\n",
+ "print \"Enter quantity and rate\"\n",
+ "qty=eval(raw_input()) #Inputs float variables\n",
+ "rate=eval(raw_input())\n",
+ "dis=0\n",
+ "if qty>1000:\n",
+ " dis=10\n",
+ "tot=(qty*rate)-(qty*rate*dis/100)\n",
+ "print \"Total expenses=Rs.\" ,tot"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter quantity and rate\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1200\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total expenses=Rs. 16740.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2: Page-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of bonus\n",
+ "print \"Enter current year and year of joining\"\n",
+ "cy=eval(raw_input())\n",
+ "yoj=eval(raw_input())\n",
+ "yos=cy-yoj\n",
+ "if yos>3:\n",
+ " bonus=2500\n",
+ " print \"Bonus=Rs.\" ,bonus"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter current year and year of joining\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2014\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2009\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bonus=Rs. 2500\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3: Page-51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of gross salary\n",
+ "print \"Enter basic salary\"\n",
+ "bs=eval(raw_input())\n",
+ "if bs<1500:\n",
+ " hra=bs*10/100\n",
+ " da=bs*90/100\n",
+ "else:\n",
+ " hra=500\n",
+ " da=bs*98/100\n",
+ "gs=bs+hra+da\n",
+ "print \"gross salary=Rs.\" ,gs"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter basic salary\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gross salary=Rs. 2000\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON Page-53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#A quick demo of nested if-else\n",
+ "print \"Enter either 1 or 2\"\n",
+ "i=eval(raw_input())\n",
+ "if i==1:\n",
+ " print \"You would go to heaven !\\n\"\n",
+ "else:\n",
+ " if i==2:\n",
+ " print \"Hell was created with you in mind\\n\"\n",
+ " else:\n",
+ " print \"How about mother earth !\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter either 1 or 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How about mother earth !\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4: Page-55-56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Method-I: program using nested if-else to find division of student\n",
+ "print \"Enter marks in five subjects\"\n",
+ "m1=eval(raw_input())\n",
+ "m2=eval(raw_input())\n",
+ "m3=eval(raw_input())\n",
+ "m4=eval(raw_input())\n",
+ "m5=eval(raw_input())\n",
+ "per=(m1+m2+m3+m4+m5)*100/500\n",
+ "if per>=60:\n",
+ " print \"First division\\n\"\n",
+ "else:\n",
+ " if per>=50:\n",
+ " print \"Second division\\n\"\n",
+ " else:\n",
+ " if per>=40:\n",
+ " print \"Third division\\n\"\n",
+ " else:\n",
+ " print \"Fail\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks in five subjects\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "70\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "87\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "98\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First division\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON Page-56-57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Method-II: program using if statement to find division of student\n",
+ "print \"Enter marks in five subjects\"\n",
+ "m1=eval(raw_input())\n",
+ "m2=eval(raw_input())\n",
+ "m3=eval(raw_input())\n",
+ "m4=eval(raw_input())\n",
+ "m5=eval(raw_input())\n",
+ "per=(m1+m2+m3+m4+m5)*100/500\n",
+ "if per>=60:\n",
+ " print \"First division\\n\"\n",
+ "if per>=50 and per<60:\n",
+ " print \"Second division\\n\"\n",
+ "if per>=40 and per<50:\n",
+ " print \"Third division\\n\"\n",
+ "if per<40:\n",
+ " print \"Fail\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks in five subjects\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "70\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "87\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "98\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First division\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON Page-58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#else if ladder demo\n",
+ "print \"Enter marks in five subjects\"\n",
+ "m1=eval(raw_input())\n",
+ "m2=eval(raw_input())\n",
+ "m3=eval(raw_input())\n",
+ "m4=eval(raw_input())\n",
+ "m5=eval(raw_input())\n",
+ "per=(m1+m2+m3+m4+m5)*100/500\n",
+ "if per>=60:\n",
+ " print \"First division\\n\"\n",
+ "elif per>=50:\n",
+ " print \"Second division\\n\"\n",
+ "elif per>=40:\n",
+ " print \"Third division\\n\"\n",
+ "else:\n",
+ " print \"fail\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks in five subjects\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "70\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "87\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "98\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First division\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5: Page-59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Insurance of driver-without using logical operators\n",
+ "print \"Enter age,sex,marital status\"\n",
+ "age=eval(raw_input())\n",
+ "sex=raw_input() #Inputs string variables i,e; we can't use these variables in calculations\n",
+ "ms=raw_input() #Inputs string variables\n",
+ "if ms=='M':\n",
+ " print \"Driver is insured\\n\"\n",
+ "else:\n",
+ " if sex=='M':\n",
+ " if age>30:\n",
+ " print \"Driver is insured\\n\"\n",
+ " else:\n",
+ " print \"Driver is not insured\\n\"\n",
+ " else:\n",
+ " if age>25:\n",
+ " print \"Driver is insured\\n\"\n",
+ " else:\n",
+ " print \"Driver is not insured\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter age,sex,marital status\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "U\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Driver is not insured\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON Page-60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Insurance of driver-using logical operators\n",
+ "print \"Enter age,sex,marital status\"\n",
+ "age=eval(raw_input())\n",
+ "sex=raw_input()\n",
+ "ms=raw_input()\n",
+ "if (ms=='M') or (ms=='U' and sex=='M' and age>30) or (ms=='U' and sex=='F' and age>25):\n",
+ " print \"Driver is insured\\n\"\n",
+ "else:\n",
+ " print \"Driver is not insured\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter age,sex,marital status\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "U\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Driver is not insured\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6: Page-61-62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the salary\n",
+ "print \"Enter Gender,Years of Service and Qualifications(0=G,1=PG):\"\n",
+ "g=raw_input()\n",
+ "yos=eval(raw_input())\n",
+ "qual=eval(raw_input())\n",
+ "sal=0\n",
+ "if g=='m' and yos>=10 and qual==1:\n",
+ " sal=15000\n",
+ "elif (g=='m' and yos>=10 and qual==0) or (g=='m' and yos<10 and qual==1):\n",
+ " sal=10000\n",
+ "elif g=='m' and yos<10 and qual==0:\n",
+ " sal=7000\n",
+ "elif g=='f' and yos>=10 and qual==1:\n",
+ " sal=12000\n",
+ "elif g=='f' and yos>=10 and qual==0:\n",
+ " sal=9000\n",
+ "elif g=='f' and yos<10 and qual==1:\n",
+ " sal=10000\n",
+ "elif g=='f' and yos<10 and qual==0:\n",
+ " sal=6000\n",
+ "print \"\\nSalary of Employee=\" ,sal"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Gender,Years of Service and Qualifications(0=G,1=PG):\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Salary of Employee= 7000\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter3.ipynb b/ANSI_C_Programming/chapter3.ipynb
new file mode 100644
index 00000000..18b9c2f4
--- /dev/null
+++ b/ANSI_C_Programming/chapter3.ipynb
@@ -0,0 +1,1590 @@
+{
+ "metadata": {
+ "name": "chapter3.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 3: THE LOOP CONTROL STRUCTURE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:89-90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of simple interest for 3 sets of p,n and r\n",
+ "count=1\n",
+ "while count<=3: #while loop codition check\n",
+ " print \"Enter values of p,n and r\"\n",
+ " p=eval(raw_input())\n",
+ " n=eval(raw_input())\n",
+ " r=eval(raw_input())\n",
+ " si=p*n*r/100\n",
+ " print \"Simple interest=Rs.%f\" % (si)\n",
+ " count=count+1 #increment"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values of p,n and r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple interest=Rs.675.000000\n",
+ "Enter values of p,n and r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple interest=Rs.1350.000000\n",
+ "Enter values of p,n and r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3500\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple interest=Rs.612.500000\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#a program for indefinite loop\n",
+ "i=1\n",
+ "while i<=10:\n",
+ " print \"%d\\n\" % (i) #there is no increment/decrement thats why indefinite loop"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing numbers from 1 to 10\n",
+ "i=1\n",
+ "while i<=10:\n",
+ " print \"\\n\" ,i\n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing a message repeatedly\n",
+ "i=5\n",
+ "while i>=1:\n",
+ " print \"Make the computer literate!\\n\"\n",
+ " i=i-1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Make the computer literate!\n",
+ "\n",
+ "Make the computer literate!\n",
+ "\n",
+ "Make the computer literate!\n",
+ "\n",
+ "Make the computer literate!\n",
+ "\n",
+ "Make the computer literate!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing a message repeatedly by taking float loop counter\n",
+ "a=10.0\n",
+ "while a<=10.5:\n",
+ " print \"Raindrops on roses...\"\n",
+ " print \"...and whiskers on kittens\\n\"\n",
+ " a=a+0.1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Raindrops on roses...\n",
+ "...and whiskers on kittens\n",
+ "\n",
+ "Raindrops on roses...\n",
+ "...and whiskers on kittens\n",
+ "\n",
+ "Raindrops on roses...\n",
+ "...and whiskers on kittens\n",
+ "\n",
+ "Raindrops on roses...\n",
+ "...and whiskers on kittens\n",
+ "\n",
+ "Raindrops on roses...\n",
+ "...and whiskers on kittens\n",
+ "\n",
+ "Raindrops on roses...\n",
+ "...and whiskers on kittens\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#This is not indefinite loop in python because range of int in python is larger than 32767\n",
+ "i=1\n",
+ "while i<=32767: #print numbers from 1 to 32767\n",
+ " print \"%d\\n\" ,i \n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Method 1:print numbers from 1 to 10\n",
+ "i=1 \n",
+ "while i<=10:\n",
+ " print i\n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Method 2:print numbers from 1 to 10\n",
+ "i=1\n",
+ "while i<=10:\n",
+ " print \"\\n\" ,i\n",
+ " i+=1 #increment short hand operator"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of simple interest for 3 sets of p,n and r using \"for loop\"\n",
+ "for count in range(1,4,1): #for loop\n",
+ " print \"Enter values of p,n and r\"\n",
+ " p=eval(raw_input())\n",
+ " n=eval(raw_input())\n",
+ " r=eval(raw_input())\n",
+ " si=p*n*r/100\n",
+ " print \"Simple Interest=Rs.%f\" % (si)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values of p,n and r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple Interest=Rs.675.000000\n",
+ "Enter values of p,n and r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple Interest=Rs.1350.000000\n",
+ "Enter values of p,n and r\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3500\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple Interest=Rs.612.500000\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print numbers from 1 to 10 using for loop\n",
+ "for i in range(1,11,1):\n",
+ " print \"%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print numbers from 1 to 10 with incrementation in the body\n",
+ "for i in range(1,11):\n",
+ " print \"\\n\" ,i\n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print numbers from 1 to 10 with initialisation above for loop\n",
+ "i=1\n",
+ "for i in range(i,11,1):\n",
+ " print \"%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print 1 to 10 with initialisation above for loop and incrementation in the body\n",
+ "i=1\n",
+ "for i in range(i,11):\n",
+ " print \"%d\\n\" % (i)\n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Demonstration of nested loops\n",
+ "for r in range(1,4,1): #outer loop\n",
+ " for c in range(1,3,1): #inner loop \n",
+ " sum=r+c\n",
+ " print \"r=%d c=%d sum=%d\\n\" % (r,c,sum)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r=1 c=1 sum=2\n",
+ "\n",
+ "r=1 c=2 sum=3\n",
+ "\n",
+ "r=2 c=1 sum=3\n",
+ "\n",
+ "r=2 c=2 sum=4\n",
+ "\n",
+ "r=3 c=1 sum=4\n",
+ "\n",
+ "r=3 c=2 sum=5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:104-105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Execution of a loop an unknown number of times\n",
+ "#Implementing do-while loop using while loop\n",
+ "while(1): #do-while loop is not present in python\n",
+ " print \"Enter a number\"\n",
+ " num=eval(raw_input())\n",
+ " print \"square of %d is %d\\n\" % (num,num*num)\n",
+ " print \"Want to enter another number y/n\"\n",
+ " another=raw_input()\n",
+ " if(another!='y'):\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 5 is 25\n",
+ "\n",
+ "Want to enter another number y/n\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 7 is 49\n",
+ "\n",
+ "Want to enter another number y/n\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#odd loop using a for loop\n",
+ "another='y'\n",
+ "for i in range(1,1000): #check if another is in word\n",
+ " if another=='y':\n",
+ " print \"Enter a number\"\n",
+ " num=eval(raw_input())\n",
+ " print \"square of %d is %d\\n\" % (num,num*num)\n",
+ " print \"Want to enter another number y/n\"\n",
+ " another=raw_input()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 5 is 25\n",
+ "\n",
+ "Want to enter another number y/n\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 7 is 49\n",
+ "\n",
+ "Want to enter another number y/n\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:105-106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#odd loop using a while loop\n",
+ "another='y'\n",
+ "while(another=='y'):\n",
+ " print \"Enter a number\"\n",
+ " num=eval(raw_input())\n",
+ " print \"square of %d is %d\\n\" % (num,num*num)\n",
+ " print \"Want to enter another number y/n\"\n",
+ " another=raw_input()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 5 is 25\n",
+ "\n",
+ "Want to enter another number y/n\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 7 is 49\n",
+ "\n",
+ "Want to enter another number y/n\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to check prime number using break in while loop\n",
+ "print \"Enter a number\"\n",
+ "num=eval(raw_input())\n",
+ "i=2\n",
+ "while i<=num-1:\n",
+ " if num%i==0:\n",
+ " print \"Not a prime number\\n\"\n",
+ " break #exit the loop\n",
+ " i+=1\n",
+ "if i==num:\n",
+ " print \"Prime number\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "11\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Prime number\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program using break statement\n",
+ "i=1\n",
+ "j=1\n",
+ "while (i<=100):\n",
+ " i+=1\n",
+ " while (j<=200):\n",
+ " j+=1\n",
+ " if (j==150):\n",
+ " break #it will terminate the inner loop only\n",
+ " else:\n",
+ " print \"%d %d\\n\" % (i,j)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 2\n",
+ "\n",
+ "2 3\n",
+ "\n",
+ "2 4\n",
+ "\n",
+ "2 5\n",
+ "\n",
+ "2 6\n",
+ "\n",
+ "2 7\n",
+ "\n",
+ "2 8\n",
+ "\n",
+ "2 9\n",
+ "\n",
+ "2 10\n",
+ "\n",
+ "2 11\n",
+ "\n",
+ "2 12\n",
+ "\n",
+ "2 13\n",
+ "\n",
+ "2 14\n",
+ "\n",
+ "2 15\n",
+ "\n",
+ "2 16\n",
+ "\n",
+ "2 17\n",
+ "\n",
+ "2 18\n",
+ "\n",
+ "2 19\n",
+ "\n",
+ "2 20\n",
+ "\n",
+ "2 21\n",
+ "\n",
+ "2 22\n",
+ "\n",
+ "2 23\n",
+ "\n",
+ "2 24\n",
+ "\n",
+ "2 25\n",
+ "\n",
+ "2 26\n",
+ "\n",
+ "2 27\n",
+ "\n",
+ "2 28\n",
+ "\n",
+ "2 29\n",
+ "\n",
+ "2 30\n",
+ "\n",
+ "2 31\n",
+ "\n",
+ "2 32\n",
+ "\n",
+ "2 33\n",
+ "\n",
+ "2 34\n",
+ "\n",
+ "2 35\n",
+ "\n",
+ "2 36\n",
+ "\n",
+ "2 37\n",
+ "\n",
+ "2 38\n",
+ "\n",
+ "2 39\n",
+ "\n",
+ "2 40\n",
+ "\n",
+ "2 41\n",
+ "\n",
+ "2 42\n",
+ "\n",
+ "2 43\n",
+ "\n",
+ "2 44\n",
+ "\n",
+ "2 45\n",
+ "\n",
+ "2 46\n",
+ "\n",
+ "2 47\n",
+ "\n",
+ "2 48\n",
+ "\n",
+ "2 49\n",
+ "\n",
+ "2 50\n",
+ "\n",
+ "2 51\n",
+ "\n",
+ "2 52\n",
+ "\n",
+ "2 53\n",
+ "\n",
+ "2 54\n",
+ "\n",
+ "2 55\n",
+ "\n",
+ "2 56\n",
+ "\n",
+ "2 57\n",
+ "\n",
+ "2 58\n",
+ "\n",
+ "2 59\n",
+ "\n",
+ "2 60\n",
+ "\n",
+ "2 61\n",
+ "\n",
+ "2 62\n",
+ "\n",
+ "2 63\n",
+ "\n",
+ "2 64\n",
+ "\n",
+ "2 65\n",
+ "\n",
+ "2 66\n",
+ "\n",
+ "2 67\n",
+ "\n",
+ "2 68\n",
+ "\n",
+ "2 69\n",
+ "\n",
+ "2 70\n",
+ "\n",
+ "2 71\n",
+ "\n",
+ "2 72\n",
+ "\n",
+ "2 73\n",
+ "\n",
+ "2 74\n",
+ "\n",
+ "2 75\n",
+ "\n",
+ "2 76\n",
+ "\n",
+ "2 77\n",
+ "\n",
+ "2 78\n",
+ "\n",
+ "2 79\n",
+ "\n",
+ "2 80\n",
+ "\n",
+ "2 81\n",
+ "\n",
+ "2 82\n",
+ "\n",
+ "2 83\n",
+ "\n",
+ "2 84\n",
+ "\n",
+ "2 85\n",
+ "\n",
+ "2 86\n",
+ "\n",
+ "2 87\n",
+ "\n",
+ "2 88\n",
+ "\n",
+ "2 89\n",
+ "\n",
+ "2 90\n",
+ "\n",
+ "2 91\n",
+ "\n",
+ "2 92\n",
+ "\n",
+ "2 93\n",
+ "\n",
+ "2 94\n",
+ "\n",
+ "2 95\n",
+ "\n",
+ "2 96\n",
+ "\n",
+ "2 97\n",
+ "\n",
+ "2 98\n",
+ "\n",
+ "2 99\n",
+ "\n",
+ "2 100\n",
+ "\n",
+ "2 101\n",
+ "\n",
+ "2 102\n",
+ "\n",
+ "2 103\n",
+ "\n",
+ "2 104\n",
+ "\n",
+ "2 105\n",
+ "\n",
+ "2 106\n",
+ "\n",
+ "2 107\n",
+ "\n",
+ "2 108\n",
+ "\n",
+ "2 109\n",
+ "\n",
+ "2 110\n",
+ "\n",
+ "2 111\n",
+ "\n",
+ "2 112\n",
+ "\n",
+ "2 113\n",
+ "\n",
+ "2 114\n",
+ "\n",
+ "2 115\n",
+ "\n",
+ "2 116\n",
+ "\n",
+ "2 117\n",
+ "\n",
+ "2 118\n",
+ "\n",
+ "2 119\n",
+ "\n",
+ "2 120\n",
+ "\n",
+ "2 121\n",
+ "\n",
+ "2 122\n",
+ "\n",
+ "2 123\n",
+ "\n",
+ "2 124\n",
+ "\n",
+ "2 125\n",
+ "\n",
+ "2 126\n",
+ "\n",
+ "2 127\n",
+ "\n",
+ "2 128\n",
+ "\n",
+ "2 129\n",
+ "\n",
+ "2 130\n",
+ "\n",
+ "2 131\n",
+ "\n",
+ "2 132\n",
+ "\n",
+ "2 133\n",
+ "\n",
+ "2 134\n",
+ "\n",
+ "2 135\n",
+ "\n",
+ "2 136\n",
+ "\n",
+ "2 137\n",
+ "\n",
+ "2 138\n",
+ "\n",
+ "2 139\n",
+ "\n",
+ "2 140\n",
+ "\n",
+ "2 141\n",
+ "\n",
+ "2 142\n",
+ "\n",
+ "2 143\n",
+ "\n",
+ "2 144\n",
+ "\n",
+ "2 145\n",
+ "\n",
+ "2 146\n",
+ "\n",
+ "2 147\n",
+ "\n",
+ "2 148\n",
+ "\n",
+ "2 149\n",
+ "\n",
+ "3 151\n",
+ "\n",
+ "3 152\n",
+ "\n",
+ "3 153\n",
+ "\n",
+ "3 154\n",
+ "\n",
+ "3 155\n",
+ "\n",
+ "3 156\n",
+ "\n",
+ "3 157\n",
+ "\n",
+ "3 158\n",
+ "\n",
+ "3 159\n",
+ "\n",
+ "3 160\n",
+ "\n",
+ "3 161\n",
+ "\n",
+ "3 162\n",
+ "\n",
+ "3 163\n",
+ "\n",
+ "3 164\n",
+ "\n",
+ "3 165\n",
+ "\n",
+ "3 166\n",
+ "\n",
+ "3 167\n",
+ "\n",
+ "3 168\n",
+ "\n",
+ "3 169\n",
+ "\n",
+ "3 170\n",
+ "\n",
+ "3 171\n",
+ "\n",
+ "3 172\n",
+ "\n",
+ "3 173\n",
+ "\n",
+ "3 174\n",
+ "\n",
+ "3 175\n",
+ "\n",
+ "3 176\n",
+ "\n",
+ "3 177\n",
+ "\n",
+ "3 178\n",
+ "\n",
+ "3 179\n",
+ "\n",
+ "3 180\n",
+ "\n",
+ "3 181\n",
+ "\n",
+ "3 182\n",
+ "\n",
+ "3 183\n",
+ "\n",
+ "3 184\n",
+ "\n",
+ "3 185\n",
+ "\n",
+ "3 186\n",
+ "\n",
+ "3 187\n",
+ "\n",
+ "3 188\n",
+ "\n",
+ "3 189\n",
+ "\n",
+ "3 190\n",
+ "\n",
+ "3 191\n",
+ "\n",
+ "3 192\n",
+ "\n",
+ "3 193\n",
+ "\n",
+ "3 194\n",
+ "\n",
+ "3 195\n",
+ "\n",
+ "3 196\n",
+ "\n",
+ "3 197\n",
+ "\n",
+ "3 198\n",
+ "\n",
+ "3 199\n",
+ "\n",
+ "3 200\n",
+ "\n",
+ "3 201\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program using continue statement\n",
+ "for i in range(1,3,1):\n",
+ " for j in range(1,3,1):\n",
+ " if i==j:\n",
+ " continue #it will again send back to loop without executing succeeding statements\n",
+ " print \"%d %d\\n\" % (i,j)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2\n",
+ "\n",
+ "2 1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter4.ipynb b/ANSI_C_Programming/chapter4.ipynb
new file mode 100644
index 00000000..a3d738f1
--- /dev/null
+++ b/ANSI_C_Programming/chapter4.ipynb
@@ -0,0 +1,389 @@
+{
+ "metadata": {
+ "name": "chapter4.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 4: THE CASE CONTROL STRUCTURE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Switch case statement using dictionary\n",
+ "i=2\n",
+ "def switch(i):\n",
+ " return {True: 'I am in default\\n', #default case\n",
+ " i==1: 'I am in case1\\n',\n",
+ " i==2: 'I am in case2\\n',\n",
+ " i==3: 'I am in case3\\n',\n",
+ " }[True]\n",
+ "print switch(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case2\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Switch case using scrambled case order\n",
+ "i=22\n",
+ "def switch(i):\n",
+ " return{True: 'I am in default\\n',\n",
+ " i==121: 'I am in case 121\\n',\n",
+ " i==7: 'I am in case 7\\n',\n",
+ " i==22: 'I am in case 22\\n',\n",
+ " }[True]\n",
+ "print switch(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case 22\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:128-129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Switch case using char values in case\n",
+ "c='x'\n",
+ "def switch(c):\n",
+ " return {True: 'I am in default\\n',\n",
+ " c=='v': 'I am in case v\\n',\n",
+ " c=='a': 'I am in case a\\n',\n",
+ " c=='x': 'I am in case x\\n',\n",
+ " }[True]\n",
+ "print switch(c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case x\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:129-130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Executing common set of statements for multiple cases\n",
+ "print \"Enter any one of the alphabets a,b,or c\"\n",
+ "ch=raw_input()\n",
+ "def casea():\n",
+ " print \"\"\n",
+ "def caseb():\n",
+ " print \"\"\n",
+ "def casec():\n",
+ " print \"\"\n",
+ "def switch(ch):\n",
+ " return {True: 'wish you knew what are alphabets\\n',\n",
+ " ch=='a' or ch=='A': 'a as in ashar\\n',\n",
+ " ch=='b' or ch=='B': 'b as in brain\\n',\n",
+ " ch=='c' or ch=='C': 'c as in cookie\\n',\n",
+ " }[True]\n",
+ "print switch(ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any one of the alphabets a,b,or c\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b as in brain\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Iniatialisation according to cases\n",
+ "print \"Enter value of i\"\n",
+ "i=eval(raw_input())\n",
+ "def switch(i):\n",
+ " print \"Hello\\n\" #It's python,not C :)\n",
+ " try:\n",
+ " return {1: a,\n",
+ " 2: b,\n",
+ " }[i]()\n",
+ " except:\n",
+ " print \"wrong choice\" #print message in default case\n",
+ "def a():\n",
+ " j=10\n",
+ " print j #print j as 10 if i=1\n",
+ "def b():\n",
+ " j=20 \n",
+ " print j #print j as 20 if i=2\n",
+ "switch(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value of i\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello\n",
+ "\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Conditional printing of messages\n",
+ "import sys\n",
+ "print \"Enter the number of goals scored against india\"\n",
+ "goals=eval(raw_input())\n",
+ "if goals<=5:\n",
+ " print \"To err is human!\\n\"\n",
+ "else:\n",
+ " print \"About time soccer players learnt C\\n\"\n",
+ " print \"and said goodbye! adieu! to soccer\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of goals scored against india\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "About time soccer players learnt C\n",
+ "\n",
+ "and said goodbye! adieu! to soccer\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:134-135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to conditional print of numbers\n",
+ "for i in range(1,4,1):\n",
+ " for j in range(1,4,1):\n",
+ " for k in range(1,4,1):\n",
+ " if (i==3 and j==3 and k==3):\n",
+ " print \"Out of the loop at last!\\n\"\n",
+ " else:\n",
+ " print \"%d %d %d\\n\" % (i,j,k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 1 1\n",
+ "\n",
+ "1 1 2\n",
+ "\n",
+ "1 1 3\n",
+ "\n",
+ "1 2 1\n",
+ "\n",
+ "1 2 2\n",
+ "\n",
+ "1 2 3\n",
+ "\n",
+ "1 3 1\n",
+ "\n",
+ "1 3 2\n",
+ "\n",
+ "1 3 3\n",
+ "\n",
+ "2 1 1\n",
+ "\n",
+ "2 1 2\n",
+ "\n",
+ "2 1 3\n",
+ "\n",
+ "2 2 1\n",
+ "\n",
+ "2 2 2\n",
+ "\n",
+ "2 2 3\n",
+ "\n",
+ "2 3 1\n",
+ "\n",
+ "2 3 2\n",
+ "\n",
+ "2 3 3\n",
+ "\n",
+ "3 1 1\n",
+ "\n",
+ "3 1 2\n",
+ "\n",
+ "3 1 3\n",
+ "\n",
+ "3 2 1\n",
+ "\n",
+ "3 2 2\n",
+ "\n",
+ "3 2 3\n",
+ "\n",
+ "3 3 1\n",
+ "\n",
+ "3 3 2\n",
+ "\n",
+ "Out of the loop at last!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter5.ipynb b/ANSI_C_Programming/chapter5.ipynb
new file mode 100644
index 00000000..aadabff0
--- /dev/null
+++ b/ANSI_C_Programming/chapter5.ipynb
@@ -0,0 +1,971 @@
+{
+ "metadata": {
+ "name": "chapter5.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 5: FUNCTIONS AND POINTERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Defining & calling a function\n",
+ "def message(): #function definition\n",
+ " print \"Smile,and the world smiles with you...\\n\"\n",
+ "message() #function call\n",
+ "print \"Cry, and you stop the monotony!\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smile,and the world smiles with you...\n",
+ "\n",
+ "Cry, and you stop the monotony!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calling of multiple functions\n",
+ "def italy():\n",
+ " print \"I am in italy\\n\"\n",
+ "def brazil():\n",
+ " print \"I am in brazil\\n\"\n",
+ "def argentina():\n",
+ " print \"I am in argentina\\n\"\n",
+ "print \"I am in main\\n\"\n",
+ "italy(); #italy() will be called\n",
+ "brazil(); #brazil() will be called\n",
+ "argentina(); #argentina() will be called"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in main\n",
+ "\n",
+ "I am in italy\n",
+ "\n",
+ "I am in brazil\n",
+ "\n",
+ "I am in argentina\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calling of function inside another function\n",
+ "def italy():\n",
+ " print \"I am in italy\\n\"\n",
+ " brazil(); #it will call brazil()\n",
+ " print \"I am back in italy\\n\"\n",
+ "def brazil():\n",
+ " print \"I am in brazil\\n\"\n",
+ " argentina(); #it will call argentina()\n",
+ "def argentina():\n",
+ " print \"I am in argentina\\n\"\n",
+ "print \"I am in main\\n\"\n",
+ "italy(); #italy() is called\n",
+ "print \"I am finally back in main\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in main\n",
+ "\n",
+ "I am in italy\n",
+ "\n",
+ "I am in brazil\n",
+ "\n",
+ "I am in argentina\n",
+ "\n",
+ "I am back in italy\n",
+ "\n",
+ "I am finally back in main\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calling of main from another function\n",
+ "def message():\n",
+ " print \"Can't imagine life without C\\n\"\n",
+ " main() #it will call back main()\n",
+ "def main():\n",
+ " message()\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calling a function multiple number of times\n",
+ "def message():\n",
+ " print \"Jewel Thief!!\\n\"\n",
+ "message() #1st call\n",
+ "message() #2nd call"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jewel Thief!!\n",
+ "\n",
+ "Jewel Thief!!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Function calls doesn't depend on the order of functions definition\n",
+ "def message2():\n",
+ " print \"But the butter was bitter\\n\"\n",
+ "def message1():\n",
+ " print \"Mary bought some butter\\n\"\n",
+ "message1()\n",
+ "message2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mary bought some butter\n",
+ "\n",
+ "But the butter was bitter\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:151-152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sending and receiving values between functions\n",
+ "def calsum(x,y,z): #parameterized function\n",
+ " d=x+y+z\n",
+ " return d\n",
+ "print \"Enter any three numbers\"\n",
+ "a=eval(raw_input())\n",
+ "b=eval(raw_input())\n",
+ "c=eval(raw_input())\n",
+ "sum=calsum(a,b,c) #passing values as arguments\n",
+ "print \"Sum=%d\\n\" % (sum)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any three numbers\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sum=60\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#A function can have multiple return statements\n",
+ "def fun():\n",
+ " print \"Enter any number\"\n",
+ " n=eval(raw_input())\n",
+ " if (n>=10 and n<=90):\n",
+ " return n\n",
+ " else:\n",
+ " return n+32\n",
+ "fun()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 7,
+ "text": [
+ "132"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Changing formal argument in function doesn't affect the actual argument\n",
+ "def fun(b):\n",
+ " b=60\n",
+ " print \"%d\\n\" % (b) #prints 60\n",
+ "a=30\n",
+ "fun(a) #prints 30\n",
+ "print \"%d\\n\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60\n",
+ "\n",
+ "30\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program explaining scope of a variable\n",
+ "def display(j):\n",
+ " k=35\n",
+ " print \"%d\\n\" % (j) #we can't print i directly here because scope of variable is local by default\n",
+ " print \"%d\\n\" % (k)\n",
+ "i=20\n",
+ "display(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n",
+ "\n",
+ "35\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:158-159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Square of a floating point number using a function\n",
+ "def square(x):\n",
+ " y=x*x\n",
+ " return y\n",
+ "print \"Enter any number\"\n",
+ "a=eval(raw_input())\n",
+ "b=square(a)\n",
+ "print \"Square of %f is %f\\n\" % (a,b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Square of 2.500000 is 6.250000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Printing address location of a variable\n",
+ "#Note:There is no concept of pointer in python thats why i am only writing it to get the similar output\n",
+ "i=3\n",
+ "print \"Address of i=%u\\n\" % (id(i)) #id() will return the loaction of a variable\n",
+ "print \"Value of i=%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i=20688560\n",
+ "\n",
+ "Value of i=3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to print address & value\n",
+ "i=3\n",
+ "print \"Address of i=%u\\n\" % (id(i))\n",
+ "print \"Value of i=%d\\n\" % (i)\n",
+ "print \"Value of i=%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i=20688560\n",
+ "\n",
+ "Value of i=3\n",
+ "\n",
+ "Value of i=3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Assigning address to other variable and printing them\n",
+ "i=3\n",
+ "j=id(i)\n",
+ "print \"Address of i=%u\\n\" % (id(i)) #print address of i\n",
+ "print \"Address of i=%u\\n\" % (j) #print address of i\n",
+ "print \"Address of j=%u\\n\" % (id(j)) #print address of j\n",
+ "print \"Value of j=%u\\n\" % (j) #print value of j\n",
+ "print \"Value of i=%d\\n\" % (i)\n",
+ "print \"Value of i=%d\\n\" % (i)\n",
+ "print \"Value of i=%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i=20688560\n",
+ "\n",
+ "Address of i=20688560\n",
+ "\n",
+ "Address of j=88986780\n",
+ "\n",
+ "Value of j=20688560\n",
+ "\n",
+ "Value of i=3\n",
+ "\n",
+ "Value of i=3\n",
+ "\n",
+ "Value of i=3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable containg address of another variable\n",
+ "i=3\n",
+ "j=id(i)\n",
+ "k=id(j)\n",
+ "print \"Address of i=%u\\n\" % (id(i)) #print address of i\n",
+ "print \"Address of i=%u\\n\" % (j) #print address of i\n",
+ "print \"Address of i=%u\\n\" % (j) #print address of i\n",
+ "print \"Address of j=%u\\n\" % (id(j)) #print address of i\n",
+ "print \"Address of j=%u\\n\" % (k) #print address of j\n",
+ "print \"Address of k=%u\\n\" % (id(k)) #print address of k\n",
+ "print \"Value of j=%u\\n\" % (j) #print value of j\n",
+ "print \"Value of k=%u\\n\" % (k) #print value of k\n",
+ "print \"Value of i=%u\\n\" % (i) #print value of i\n",
+ "print \"Value of i=%u\\n\" % (i)\n",
+ "print \"Value of i=%u\\n\" % (i)\n",
+ "print \"Value of i=%u\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i=20688560\n",
+ "\n",
+ "Address of i=20688560\n",
+ "\n",
+ "Address of i=20688560\n",
+ "\n",
+ "Address of j=88986672\n",
+ "\n",
+ "Address of j=88986672\n",
+ "\n",
+ "Address of k=88986708\n",
+ "\n",
+ "Value of j=20688560\n",
+ "\n",
+ "Value of k=88986672\n",
+ "\n",
+ "Value of i=3\n",
+ "\n",
+ "Value of i=3\n",
+ "\n",
+ "Value of i=3\n",
+ "\n",
+ "Value of i=3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Swapping of two variables\n",
+ "def swapv(x,y):\n",
+ " x,y=y,x\n",
+ " print \"x=%d y=%d\\n\" % (x,y)\n",
+ "a=10\n",
+ "b=20\n",
+ "swapv(a,b)\n",
+ "print \"a=%d b=%d\\n\" % (a,b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x=20 y=10\n",
+ "\n",
+ "a=10 b=20\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE-167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to swap 2 variables\n",
+ "#Note:There is no concept of pointer in python that's why i used global variables to get the same output\n",
+ "def swapr():\n",
+ " global a,b #global declaration\n",
+ " a,b=b,a\n",
+ "a=10\n",
+ "b=20\n",
+ "swapr()\n",
+ "print \"a=%d b=%d\\n\" % (a,b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a=20 b=10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:167-168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to print area & perimeter of circle\n",
+ "def areaperi(r,a,p):\n",
+ " a=3.14*r*r #formula of area\n",
+ " p=2*3.14*r #formula of perimeter\n",
+ " print \"Area=%f\\n\" % (a)\n",
+ " print \"Perimeter=%f\\n\" % (p)\n",
+ "area=0\n",
+ "perimeter=0\n",
+ "print \"Enter radius of a circle\"\n",
+ "radius=eval(raw_input())\n",
+ "areaperi(radius,area,perimeter)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter radius of a circle\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area=78.500000\n",
+ "\n",
+ "Perimeter=31.400000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding factorial of a number without recursion\n",
+ "def factorial(x):\n",
+ " f=1\n",
+ " for i in range(x,1,-1):\n",
+ " f=f*i\n",
+ " return f\n",
+ "print \"Enter any number\"\n",
+ "a=eval(raw_input())\n",
+ "fact=factorial(a)\n",
+ "print \"Factorial value=%d\\n\" % (fact)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Factorial value=6\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding factorial of a number with recursion\n",
+ "def rec(x):\n",
+ " if x==1:\n",
+ " return 1\n",
+ " else:\n",
+ " f=x*rec(x-1) \n",
+ " return f #will call back the rec() function\n",
+ "print \"Enter any number\"\n",
+ "a=eval(raw_input())\n",
+ "fact=rec(a)\n",
+ "print \"Factorial value=%d\\n\" % (fact)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Factorial value=120\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sum of two variables using function\n",
+ "def add(i,j):\n",
+ " sum=i+j\n",
+ " return sum\n",
+ "a=5\n",
+ "b=2\n",
+ "c=add(a,b) #Transfers control to add()\n",
+ "print \"sum=%d\\n\" % (c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sum=7\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:175-176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "def factorial(num):\n",
+ " f=1\n",
+ " for i in range(1,num+1,1):\n",
+ " f=f*i;\n",
+ " return f\n",
+ "f=factorial(5)\n",
+ "print \"%d\\n\" % f"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "120\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter6.ipynb b/ANSI_C_Programming/chapter6.ipynb
new file mode 100644
index 00000000..1cdd6dae
--- /dev/null
+++ b/ANSI_C_Programming/chapter6.ipynb
@@ -0,0 +1,1731 @@
+{
+ "metadata": {
+ "name": "chapter6.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 6: DATA TYPES REVISITED"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing character corresponding to integer value\n",
+ "ch=291\n",
+ "if ch>255:\n",
+ " ch=ch-256\n",
+ "print \"\\n%d %c\\n\" % (ch,ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "35 #\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print ascii values and their corresponding characters\n",
+ "for ch in range(0,256,1):\n",
+ " print \"%d %c\\n\" % (ch,ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 \u0000\n",
+ "\n",
+ "1 \u0001\n",
+ "\n",
+ "2 \u0002\n",
+ "\n",
+ "3 \u0003\n",
+ "\n",
+ "4 \u0004\n",
+ "\n",
+ "5 \u0005\n",
+ "\n",
+ "6 \u0006\n",
+ "\n",
+ "7 \u0007\n",
+ "\n",
+ "8 \b\n",
+ "\n",
+ "9 \t\n",
+ "\n",
+ "10 \n",
+ "\n",
+ "\n",
+ "11 \u000b",
+ "\n",
+ "\n",
+ "12 \f",
+ "\n",
+ "\n",
+ "13 \r\n",
+ "\n",
+ "14 \u000e\n",
+ "\n",
+ "15 \u000f\n",
+ "\n",
+ "16 \u0010\n",
+ "\n",
+ "17 \u0011\n",
+ "\n",
+ "18 \u0012\n",
+ "\n",
+ "19 \u0013\n",
+ "\n",
+ "20 \u0014\n",
+ "\n",
+ "21 \u0015\n",
+ "\n",
+ "22 \u0016\n",
+ "\n",
+ "23 \u0017\n",
+ "\n",
+ "24 \u0018\n",
+ "\n",
+ "25 \u0019\n",
+ "\n",
+ "26 \u001a\n",
+ "\n",
+ "27 \u001b\n",
+ "\n",
+ "28 \u001c",
+ "\n",
+ "\n",
+ "29 \u001d",
+ "\n",
+ "\n",
+ "30 \u001e",
+ "\n",
+ "\n",
+ "31 \u001f\n",
+ "\n",
+ "32 \n",
+ "\n",
+ "33 !\n",
+ "\n",
+ "34 \"\n",
+ "\n",
+ "35 #\n",
+ "\n",
+ "36 $\n",
+ "\n",
+ "37 %\n",
+ "\n",
+ "38 &\n",
+ "\n",
+ "39 '\n",
+ "\n",
+ "40 (\n",
+ "\n",
+ "41 )\n",
+ "\n",
+ "42 *\n",
+ "\n",
+ "43 +\n",
+ "\n",
+ "44 ,\n",
+ "\n",
+ "45 -\n",
+ "\n",
+ "46 .\n",
+ "\n",
+ "47 /\n",
+ "\n",
+ "48 0\n",
+ "\n",
+ "49 1\n",
+ "\n",
+ "50 2\n",
+ "\n",
+ "51 3\n",
+ "\n",
+ "52 4\n",
+ "\n",
+ "53 5\n",
+ "\n",
+ "54 6\n",
+ "\n",
+ "55 7\n",
+ "\n",
+ "56 8\n",
+ "\n",
+ "57 9\n",
+ "\n",
+ "58 :\n",
+ "\n",
+ "59 ;\n",
+ "\n",
+ "60 <\n",
+ "\n",
+ "61 =\n",
+ "\n",
+ "62 >\n",
+ "\n",
+ "63 ?\n",
+ "\n",
+ "64 @\n",
+ "\n",
+ "65 A\n",
+ "\n",
+ "66 B\n",
+ "\n",
+ "67 C\n",
+ "\n",
+ "68 D\n",
+ "\n",
+ "69 E\n",
+ "\n",
+ "70 F\n",
+ "\n",
+ "71 G\n",
+ "\n",
+ "72 H\n",
+ "\n",
+ "73 I\n",
+ "\n",
+ "74 J\n",
+ "\n",
+ "75 K\n",
+ "\n",
+ "76 L\n",
+ "\n",
+ "77 M\n",
+ "\n",
+ "78 N\n",
+ "\n",
+ "79 O\n",
+ "\n",
+ "80 P\n",
+ "\n",
+ "81 Q\n",
+ "\n",
+ "82 R\n",
+ "\n",
+ "83 S\n",
+ "\n",
+ "84 T\n",
+ "\n",
+ "85 U\n",
+ "\n",
+ "86 V\n",
+ "\n",
+ "87 W\n",
+ "\n",
+ "88 X\n",
+ "\n",
+ "89 Y\n",
+ "\n",
+ "90 Z\n",
+ "\n",
+ "91 [\n",
+ "\n",
+ "92 \\\n",
+ "\n",
+ "93 ]\n",
+ "\n",
+ "94 ^\n",
+ "\n",
+ "95 _\n",
+ "\n",
+ "96 `\n",
+ "\n",
+ "97 a\n",
+ "\n",
+ "98 b\n",
+ "\n",
+ "99 c\n",
+ "\n",
+ "100 d\n",
+ "\n",
+ "101 e\n",
+ "\n",
+ "102 f\n",
+ "\n",
+ "103 g\n",
+ "\n",
+ "104 h\n",
+ "\n",
+ "105 i\n",
+ "\n",
+ "106 j\n",
+ "\n",
+ "107 k\n",
+ "\n",
+ "108 l\n",
+ "\n",
+ "109 m\n",
+ "\n",
+ "110 n\n",
+ "\n",
+ "111 o\n",
+ "\n",
+ "112 p\n",
+ "\n",
+ "113 q\n",
+ "\n",
+ "114 r\n",
+ "\n",
+ "115 s\n",
+ "\n",
+ "116 t\n",
+ "\n",
+ "117 u\n",
+ "\n",
+ "118 v\n",
+ "\n",
+ "119 w\n",
+ "\n",
+ "120 x\n",
+ "\n",
+ "121 y\n",
+ "\n",
+ "122 z\n",
+ "\n",
+ "123 {\n",
+ "\n",
+ "124 |\n",
+ "\n",
+ "125 }\n",
+ "\n",
+ "126 ~\n",
+ "\n",
+ "127 \u007f\n",
+ "\n",
+ "128 \ufffd\n",
+ "\n",
+ "129 \ufffd\n",
+ "\n",
+ "130 \ufffd\n",
+ "\n",
+ "131 \ufffd\n",
+ "\n",
+ "132 \ufffd\n",
+ "\n",
+ "133 \ufffd\n",
+ "\n",
+ "134 \ufffd\n",
+ "\n",
+ "135 \ufffd\n",
+ "\n",
+ "136 \ufffd\n",
+ "\n",
+ "137 \ufffd\n",
+ "\n",
+ "138 \ufffd\n",
+ "\n",
+ "139 \ufffd\n",
+ "\n",
+ "140 \ufffd\n",
+ "\n",
+ "141 \ufffd\n",
+ "\n",
+ "142 \ufffd\n",
+ "\n",
+ "143 \ufffd\n",
+ "\n",
+ "144 \ufffd\n",
+ "\n",
+ "145 \ufffd\n",
+ "\n",
+ "146 \ufffd\n",
+ "\n",
+ "147 \ufffd\n",
+ "\n",
+ "148 \ufffd\n",
+ "\n",
+ "149 \ufffd\n",
+ "\n",
+ "150 \ufffd\n",
+ "\n",
+ "151 \ufffd\n",
+ "\n",
+ "152 \ufffd\n",
+ "\n",
+ "153 \ufffd\n",
+ "\n",
+ "154 \ufffd\n",
+ "\n",
+ "155 \ufffd\n",
+ "\n",
+ "156 \ufffd\n",
+ "\n",
+ "157 \ufffd\n",
+ "\n",
+ "158 \ufffd\n",
+ "\n",
+ "159 \ufffd\n",
+ "\n",
+ "160 \ufffd\n",
+ "\n",
+ "161 \ufffd\n",
+ "\n",
+ "162 \ufffd\n",
+ "\n",
+ "163 \ufffd\n",
+ "\n",
+ "164 \ufffd\n",
+ "\n",
+ "165 \ufffd\n",
+ "\n",
+ "166 \ufffd\n",
+ "\n",
+ "167 \ufffd\n",
+ "\n",
+ "168 \ufffd\n",
+ "\n",
+ "169 \ufffd\n",
+ "\n",
+ "170 \ufffd\n",
+ "\n",
+ "171 \ufffd\n",
+ "\n",
+ "172 \ufffd\n",
+ "\n",
+ "173 \ufffd\n",
+ "\n",
+ "174 \ufffd\n",
+ "\n",
+ "175 \ufffd\n",
+ "\n",
+ "176 \ufffd\n",
+ "\n",
+ "177 \ufffd\n",
+ "\n",
+ "178 \ufffd\n",
+ "\n",
+ "179 \ufffd\n",
+ "\n",
+ "180 \ufffd\n",
+ "\n",
+ "181 \ufffd\n",
+ "\n",
+ "182 \ufffd\n",
+ "\n",
+ "183 \ufffd\n",
+ "\n",
+ "184 \ufffd\n",
+ "\n",
+ "185 \ufffd\n",
+ "\n",
+ "186 \ufffd\n",
+ "\n",
+ "187 \ufffd\n",
+ "\n",
+ "188 \ufffd\n",
+ "\n",
+ "189 \ufffd\n",
+ "\n",
+ "190 \ufffd\n",
+ "\n",
+ "191 \ufffd\n",
+ "\n",
+ "192 \ufffd\n",
+ "\n",
+ "193 \ufffd\n",
+ "\n",
+ "194 \ufffd\n",
+ "\n",
+ "195 \ufffd\n",
+ "\n",
+ "196 \ufffd\n",
+ "\n",
+ "197 \ufffd\n",
+ "\n",
+ "198 \ufffd\n",
+ "\n",
+ "199 \ufffd\n",
+ "\n",
+ "200 \ufffd\n",
+ "\n",
+ "201 \ufffd\n",
+ "\n",
+ "202 \ufffd\n",
+ "\n",
+ "203 \ufffd\n",
+ "\n",
+ "204 \ufffd\n",
+ "\n",
+ "205 \ufffd\n",
+ "\n",
+ "206 \ufffd\n",
+ "\n",
+ "207 \ufffd\n",
+ "\n",
+ "208 \ufffd\n",
+ "\n",
+ "209 \ufffd\n",
+ "\n",
+ "210 \ufffd\n",
+ "\n",
+ "211 \ufffd\n",
+ "\n",
+ "212 \ufffd\n",
+ "\n",
+ "213 \ufffd\n",
+ "\n",
+ "214 \ufffd\n",
+ "\n",
+ "215 \ufffd\n",
+ "\n",
+ "216 \ufffd\n",
+ "\n",
+ "217 \ufffd\n",
+ "\n",
+ "218 \ufffd\n",
+ "\n",
+ "219 \ufffd\n",
+ "\n",
+ "220 \ufffd\n",
+ "\n",
+ "221 \ufffd\n",
+ "\n",
+ "222 \ufffd\n",
+ "\n",
+ "223 \ufffd\n",
+ "\n",
+ "224 \ufffd\n",
+ "\n",
+ "225 \ufffd\n",
+ "\n",
+ "226 \ufffd\n",
+ "\n",
+ "227 \ufffd\n",
+ "\n",
+ "228 \ufffd\n",
+ "\n",
+ "229 \ufffd\n",
+ "\n",
+ "230 \ufffd\n",
+ "\n",
+ "231 \ufffd\n",
+ "\n",
+ "232 \ufffd\n",
+ "\n",
+ "233 \ufffd\n",
+ "\n",
+ "234 \ufffd\n",
+ "\n",
+ "235 \ufffd\n",
+ "\n",
+ "236 \ufffd\n",
+ "\n",
+ "237 \ufffd\n",
+ "\n",
+ "238 \ufffd\n",
+ "\n",
+ "239 \ufffd\n",
+ "\n",
+ "240 \ufffd\n",
+ "\n",
+ "241 \ufffd\n",
+ "\n",
+ "242 \ufffd\n",
+ "\n",
+ "243 \ufffd\n",
+ "\n",
+ "244 \ufffd\n",
+ "\n",
+ "245 \ufffd\n",
+ "\n",
+ "246 \ufffd\n",
+ "\n",
+ "247 \ufffd\n",
+ "\n",
+ "248 \ufffd\n",
+ "\n",
+ "249 \ufffd\n",
+ "\n",
+ "250 \ufffd\n",
+ "\n",
+ "251 \ufffd\n",
+ "\n",
+ "252 \ufffd\n",
+ "\n",
+ "253 \ufffd\n",
+ "\n",
+ "254 \ufffd\n",
+ "\n",
+ "255 \ufffd\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print ascii values and their corresponding characters\n",
+ "for ch in range(0,255,1):\n",
+ " print \"%d %c\\n\" % (ch,ch)\n",
+ "print \"%d %c\\n\" % (ch,ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 \u0000\n",
+ "\n",
+ "1 \u0001\n",
+ "\n",
+ "2 \u0002\n",
+ "\n",
+ "3 \u0003\n",
+ "\n",
+ "4 \u0004\n",
+ "\n",
+ "5 \u0005\n",
+ "\n",
+ "6 \u0006\n",
+ "\n",
+ "7 \u0007\n",
+ "\n",
+ "8 \b\n",
+ "\n",
+ "9 \t\n",
+ "\n",
+ "10 \n",
+ "\n",
+ "\n",
+ "11 \u000b",
+ "\n",
+ "\n",
+ "12 \f",
+ "\n",
+ "\n",
+ "13 \r\n",
+ "\n",
+ "14 \u000e\n",
+ "\n",
+ "15 \u000f\n",
+ "\n",
+ "16 \u0010\n",
+ "\n",
+ "17 \u0011\n",
+ "\n",
+ "18 \u0012\n",
+ "\n",
+ "19 \u0013\n",
+ "\n",
+ "20 \u0014\n",
+ "\n",
+ "21 \u0015\n",
+ "\n",
+ "22 \u0016\n",
+ "\n",
+ "23 \u0017\n",
+ "\n",
+ "24 \u0018\n",
+ "\n",
+ "25 \u0019\n",
+ "\n",
+ "26 \u001a\n",
+ "\n",
+ "27 \u001b\n",
+ "\n",
+ "28 \u001c",
+ "\n",
+ "\n",
+ "29 \u001d",
+ "\n",
+ "\n",
+ "30 \u001e",
+ "\n",
+ "\n",
+ "31 \u001f\n",
+ "\n",
+ "32 \n",
+ "\n",
+ "33 !\n",
+ "\n",
+ "34 \"\n",
+ "\n",
+ "35 #\n",
+ "\n",
+ "36 $\n",
+ "\n",
+ "37 %\n",
+ "\n",
+ "38 &\n",
+ "\n",
+ "39 '\n",
+ "\n",
+ "40 (\n",
+ "\n",
+ "41 )\n",
+ "\n",
+ "42 *\n",
+ "\n",
+ "43 +\n",
+ "\n",
+ "44 ,\n",
+ "\n",
+ "45 -\n",
+ "\n",
+ "46 .\n",
+ "\n",
+ "47 /\n",
+ "\n",
+ "48 0\n",
+ "\n",
+ "49 1\n",
+ "\n",
+ "50 2\n",
+ "\n",
+ "51 3\n",
+ "\n",
+ "52 4\n",
+ "\n",
+ "53 5\n",
+ "\n",
+ "54 6\n",
+ "\n",
+ "55 7\n",
+ "\n",
+ "56 8\n",
+ "\n",
+ "57 9\n",
+ "\n",
+ "58 :\n",
+ "\n",
+ "59 ;\n",
+ "\n",
+ "60 <\n",
+ "\n",
+ "61 =\n",
+ "\n",
+ "62 >\n",
+ "\n",
+ "63 ?\n",
+ "\n",
+ "64 @\n",
+ "\n",
+ "65 A\n",
+ "\n",
+ "66 B\n",
+ "\n",
+ "67 C\n",
+ "\n",
+ "68 D\n",
+ "\n",
+ "69 E\n",
+ "\n",
+ "70 F\n",
+ "\n",
+ "71 G\n",
+ "\n",
+ "72 H\n",
+ "\n",
+ "73 I\n",
+ "\n",
+ "74 J\n",
+ "\n",
+ "75 K\n",
+ "\n",
+ "76 L\n",
+ "\n",
+ "77 M\n",
+ "\n",
+ "78 N\n",
+ "\n",
+ "79 O\n",
+ "\n",
+ "80 P\n",
+ "\n",
+ "81 Q\n",
+ "\n",
+ "82 R\n",
+ "\n",
+ "83 S\n",
+ "\n",
+ "84 T\n",
+ "\n",
+ "85 U\n",
+ "\n",
+ "86 V\n",
+ "\n",
+ "87 W\n",
+ "\n",
+ "88 X\n",
+ "\n",
+ "89 Y\n",
+ "\n",
+ "90 Z\n",
+ "\n",
+ "91 [\n",
+ "\n",
+ "92 \\\n",
+ "\n",
+ "93 ]\n",
+ "\n",
+ "94 ^\n",
+ "\n",
+ "95 _\n",
+ "\n",
+ "96 `\n",
+ "\n",
+ "97 a\n",
+ "\n",
+ "98 b\n",
+ "\n",
+ "99 c\n",
+ "\n",
+ "100 d\n",
+ "\n",
+ "101 e\n",
+ "\n",
+ "102 f\n",
+ "\n",
+ "103 g\n",
+ "\n",
+ "104 h\n",
+ "\n",
+ "105 i\n",
+ "\n",
+ "106 j\n",
+ "\n",
+ "107 k\n",
+ "\n",
+ "108 l\n",
+ "\n",
+ "109 m\n",
+ "\n",
+ "110 n\n",
+ "\n",
+ "111 o\n",
+ "\n",
+ "112 p\n",
+ "\n",
+ "113 q\n",
+ "\n",
+ "114 r\n",
+ "\n",
+ "115 s\n",
+ "\n",
+ "116 t\n",
+ "\n",
+ "117 u\n",
+ "\n",
+ "118 v\n",
+ "\n",
+ "119 w\n",
+ "\n",
+ "120 x\n",
+ "\n",
+ "121 y\n",
+ "\n",
+ "122 z\n",
+ "\n",
+ "123 {\n",
+ "\n",
+ "124 |\n",
+ "\n",
+ "125 }\n",
+ "\n",
+ "126 ~\n",
+ "\n",
+ "127 \u007f\n",
+ "\n",
+ "128 \ufffd\n",
+ "\n",
+ "129 \ufffd\n",
+ "\n",
+ "130 \ufffd\n",
+ "\n",
+ "131 \ufffd\n",
+ "\n",
+ "132 \ufffd\n",
+ "\n",
+ "133 \ufffd\n",
+ "\n",
+ "134 \ufffd\n",
+ "\n",
+ "135 \ufffd\n",
+ "\n",
+ "136 \ufffd\n",
+ "\n",
+ "137 \ufffd\n",
+ "\n",
+ "138 \ufffd\n",
+ "\n",
+ "139 \ufffd\n",
+ "\n",
+ "140 \ufffd\n",
+ "\n",
+ "141 \ufffd\n",
+ "\n",
+ "142 \ufffd\n",
+ "\n",
+ "143 \ufffd\n",
+ "\n",
+ "144 \ufffd\n",
+ "\n",
+ "145 \ufffd\n",
+ "\n",
+ "146 \ufffd\n",
+ "\n",
+ "147 \ufffd\n",
+ "\n",
+ "148 \ufffd\n",
+ "\n",
+ "149 \ufffd\n",
+ "\n",
+ "150 \ufffd\n",
+ "\n",
+ "151 \ufffd\n",
+ "\n",
+ "152 \ufffd\n",
+ "\n",
+ "153 \ufffd\n",
+ "\n",
+ "154 \ufffd\n",
+ "\n",
+ "155 \ufffd\n",
+ "\n",
+ "156 \ufffd\n",
+ "\n",
+ "157 \ufffd\n",
+ "\n",
+ "158 \ufffd\n",
+ "\n",
+ "159 \ufffd\n",
+ "\n",
+ "160 \ufffd\n",
+ "\n",
+ "161 \ufffd\n",
+ "\n",
+ "162 \ufffd\n",
+ "\n",
+ "163 \ufffd\n",
+ "\n",
+ "164 \ufffd\n",
+ "\n",
+ "165 \ufffd\n",
+ "\n",
+ "166 \ufffd\n",
+ "\n",
+ "167 \ufffd\n",
+ "\n",
+ "168 \ufffd\n",
+ "\n",
+ "169 \ufffd\n",
+ "\n",
+ "170 \ufffd\n",
+ "\n",
+ "171 \ufffd\n",
+ "\n",
+ "172 \ufffd\n",
+ "\n",
+ "173 \ufffd\n",
+ "\n",
+ "174 \ufffd\n",
+ "\n",
+ "175 \ufffd\n",
+ "\n",
+ "176 \ufffd\n",
+ "\n",
+ "177 \ufffd\n",
+ "\n",
+ "178 \ufffd\n",
+ "\n",
+ "179 \ufffd\n",
+ "\n",
+ "180 \ufffd\n",
+ "\n",
+ "181 \ufffd\n",
+ "\n",
+ "182 \ufffd\n",
+ "\n",
+ "183 \ufffd\n",
+ "\n",
+ "184 \ufffd\n",
+ "\n",
+ "185 \ufffd\n",
+ "\n",
+ "186 \ufffd\n",
+ "\n",
+ "187 \ufffd\n",
+ "\n",
+ "188 \ufffd\n",
+ "\n",
+ "189 \ufffd\n",
+ "\n",
+ "190 \ufffd\n",
+ "\n",
+ "191 \ufffd\n",
+ "\n",
+ "192 \ufffd\n",
+ "\n",
+ "193 \ufffd\n",
+ "\n",
+ "194 \ufffd\n",
+ "\n",
+ "195 \ufffd\n",
+ "\n",
+ "196 \ufffd\n",
+ "\n",
+ "197 \ufffd\n",
+ "\n",
+ "198 \ufffd\n",
+ "\n",
+ "199 \ufffd\n",
+ "\n",
+ "200 \ufffd\n",
+ "\n",
+ "201 \ufffd\n",
+ "\n",
+ "202 \ufffd\n",
+ "\n",
+ "203 \ufffd\n",
+ "\n",
+ "204 \ufffd\n",
+ "\n",
+ "205 \ufffd\n",
+ "\n",
+ "206 \ufffd\n",
+ "\n",
+ "207 \ufffd\n",
+ "\n",
+ "208 \ufffd\n",
+ "\n",
+ "209 \ufffd\n",
+ "\n",
+ "210 \ufffd\n",
+ "\n",
+ "211 \ufffd\n",
+ "\n",
+ "212 \ufffd\n",
+ "\n",
+ "213 \ufffd\n",
+ "\n",
+ "214 \ufffd\n",
+ "\n",
+ "215 \ufffd\n",
+ "\n",
+ "216 \ufffd\n",
+ "\n",
+ "217 \ufffd\n",
+ "\n",
+ "218 \ufffd\n",
+ "\n",
+ "219 \ufffd\n",
+ "\n",
+ "220 \ufffd\n",
+ "\n",
+ "221 \ufffd\n",
+ "\n",
+ "222 \ufffd\n",
+ "\n",
+ "223 \ufffd\n",
+ "\n",
+ "224 \ufffd\n",
+ "\n",
+ "225 \ufffd\n",
+ "\n",
+ "226 \ufffd\n",
+ "\n",
+ "227 \ufffd\n",
+ "\n",
+ "228 \ufffd\n",
+ "\n",
+ "229 \ufffd\n",
+ "\n",
+ "230 \ufffd\n",
+ "\n",
+ "231 \ufffd\n",
+ "\n",
+ "232 \ufffd\n",
+ "\n",
+ "233 \ufffd\n",
+ "\n",
+ "234 \ufffd\n",
+ "\n",
+ "235 \ufffd\n",
+ "\n",
+ "236 \ufffd\n",
+ "\n",
+ "237 \ufffd\n",
+ "\n",
+ "238 \ufffd\n",
+ "\n",
+ "239 \ufffd\n",
+ "\n",
+ "240 \ufffd\n",
+ "\n",
+ "241 \ufffd\n",
+ "\n",
+ "242 \ufffd\n",
+ "\n",
+ "243 \ufffd\n",
+ "\n",
+ "244 \ufffd\n",
+ "\n",
+ "245 \ufffd\n",
+ "\n",
+ "246 \ufffd\n",
+ "\n",
+ "247 \ufffd\n",
+ "\n",
+ "248 \ufffd\n",
+ "\n",
+ "249 \ufffd\n",
+ "\n",
+ "250 \ufffd\n",
+ "\n",
+ "251 \ufffd\n",
+ "\n",
+ "252 \ufffd\n",
+ "\n",
+ "253 \ufffd\n",
+ "\n",
+ "254 \ufffd\n",
+ "\n",
+ "254 \ufffd\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:200-201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of format specifiers to output variables\n",
+ "#char\n",
+ "c=raw_input()\n",
+ "d=raw_input()\n",
+ "print \"%c %c\\n\" % (c,d)\n",
+ "#int\n",
+ "i=eval(raw_input())\n",
+ "j=eval(raw_input())\n",
+ "print \"%d %u\\n\" % (i,j)\n",
+ "#short int\n",
+ "k=eval(raw_input())\n",
+ "l=eval(raw_input())\n",
+ "print \"%d %u\\n\" % (k,l)\n",
+ "#long int\n",
+ "m=eval(raw_input())\n",
+ "n=eval(raw_input())\n",
+ "print \"%ld %lu\\n\" % (m,n)\n",
+ "#float,double,long double\n",
+ "x=eval(raw_input())\n",
+ "y=eval(raw_input())\n",
+ "z=eval(raw_input())\n",
+ "print \"%f %lf %Lf\\n\" % (x,y,z)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "b\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a b\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7389\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10000 7389\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "585\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34 585\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34676\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "500000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34676 500000\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "445.55\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "57846.44\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55666885.6655\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "445.550000 57846.440000 55666885.665500\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program explaining concept of scope of variables\n",
+ "#no concept of auto storage class\n",
+ "def main():\n",
+ " i=1\n",
+ " def main2():\n",
+ " def main3():\n",
+ " print \"%d\" % (i) #prints 1\n",
+ " main3()\n",
+ " print \"%d\" % (i) #prints 1\n",
+ " main2()\n",
+ " print \"%d\\n\" % (i) #prints 1\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "1\n",
+ "1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program explaing concept of local variables\n",
+ "def main():\n",
+ " i=1\n",
+ " def main2():\n",
+ " i=2\n",
+ " def main3():\n",
+ " i=3\n",
+ " print \"%d\" % (i) #prints 3\n",
+ " main3()\n",
+ " print \"%d\" % (i) #prints 2\n",
+ " main2()\n",
+ " print \"%d\\n\" % (i) #prints 1\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n",
+ "2\n",
+ "1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#prints numbers from 1 to 10\n",
+ "for i in range(1,11,1):\n",
+ " print \"%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to explain use of variable\n",
+ "def increment():\n",
+ " i=1\n",
+ " print \"%d\\n\" % (i) #prints 1 every time\n",
+ " i=i+1\n",
+ "increment()\n",
+ "increment()\n",
+ "increment()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "1\n",
+ "\n",
+ "1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program using static variables\n",
+ "def static_var(varname, value): #function to make it static\n",
+ " def decorate(func):\n",
+ " setattr(func, varname, value)\n",
+ " return func\n",
+ " return decorate\n",
+ "@static_var(\"i\", 1) #i is static variable\n",
+ "def increment():\n",
+ " print \"%d\\n\" % increment.i\n",
+ " increment.i += 1\n",
+ "increment()\n",
+ "increment()\n",
+ "increment()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Returning address from function\n",
+ "def fun():\n",
+ " k=35\n",
+ " return id(k) #returns address of k\n",
+ "j=fun() #stores address of k\n",
+ "print \"%d\\n\" % (j) #prints address of k"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "19639600\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program using global variables\n",
+ "def increment():\n",
+ " global i #gloabal declaration\n",
+ " i=i+1\n",
+ " print \"on incrementing i=%d\\n\" % (i)\n",
+ "def decrement():\n",
+ " global i #global declaration\n",
+ " i=i-1\n",
+ " print \"on decrementing i=%d\\n\" % (i)\n",
+ "i=0\n",
+ "print \"\\ni=%d\" % (i)\n",
+ "increment()\n",
+ "increment()\n",
+ "decrement()\n",
+ "decrement()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "i=0\n",
+ "on incrementing i=1\n",
+ "\n",
+ "on incrementing i=2\n",
+ "\n",
+ "on decrementing i=1\n",
+ "\n",
+ "on decrementing i=0\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing of global variables\n",
+ "x=21\n",
+ "def main():\n",
+ " global x,y\n",
+ " print \"%d %d\\n\" % (x,y)\n",
+ "y=31\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "21 31\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Global and local variable\n",
+ "def display():\n",
+ " global x #global variable\n",
+ " print \"%d\\n\" % (x) #prints 10\n",
+ "x=10\n",
+ "def main():\n",
+ " x=20 #local variable for main\n",
+ " print \"%d\\n\" % (x) #prints 20\n",
+ " display()\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n",
+ "\n",
+ "10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:212-213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#GLOBAL VARIABLES CONTINUES\n",
+ "def fun1():\n",
+ " global i\n",
+ " i+=1\n",
+ " print \"%d\\n\" % (i)\n",
+ "def fun2():\n",
+ " global i\n",
+ " i-=1\n",
+ " print \"%d\\n\" % (i)\n",
+ "i=35\n",
+ "print \"%d\\n\" % (i)\n",
+ "fun1()\n",
+ "fun2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "35\n",
+ "\n",
+ "36\n",
+ "\n",
+ "35\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter7.ipynb b/ANSI_C_Programming/chapter7.ipynb
new file mode 100644
index 00000000..e79f1d7e
--- /dev/null
+++ b/ANSI_C_Programming/chapter7.ipynb
@@ -0,0 +1,767 @@
+{
+ "metadata": {
+ "name": "chapter7.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 7:THE C PREPROCESSOR"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using macros in for loop\n",
+ "#Note:Implementing the concept of macros using function\n",
+ "def UPPER(): #set UPPER() as 25\n",
+ " return 25\n",
+ "for i in range(1,UPPER()+1,1):\n",
+ " print \"%d\\n\" % (i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n",
+ "6\n",
+ "\n",
+ "7\n",
+ "\n",
+ "8\n",
+ "\n",
+ "9\n",
+ "\n",
+ "10\n",
+ "\n",
+ "11\n",
+ "\n",
+ "12\n",
+ "\n",
+ "13\n",
+ "\n",
+ "14\n",
+ "\n",
+ "15\n",
+ "\n",
+ "16\n",
+ "\n",
+ "17\n",
+ "\n",
+ "18\n",
+ "\n",
+ "19\n",
+ "\n",
+ "20\n",
+ "\n",
+ "21\n",
+ "\n",
+ "22\n",
+ "\n",
+ "23\n",
+ "\n",
+ "24\n",
+ "\n",
+ "25\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Defing PI as 3.14 using macros(here functions)\n",
+ "def PI(): #set PI() as 3.14\n",
+ " return 3.14\n",
+ "r=6.25\n",
+ "area=PI()*r*r\n",
+ "print \"Area of circle=%f\\n\" % (area)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of circle=122.656250\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Defining AND & OR operations using macros\n",
+ "def AND(x,y): #set AND(x,y) for \"and\" operation\n",
+ " return (x and y)\n",
+ "def OR(a,b): #set OR(a,b) for \"or\" operation\n",
+ " return (a or b)\n",
+ "f=1\n",
+ "x=4\n",
+ "y=90\n",
+ "if (AND(f<5,OR(x<=20,y<=45))):\n",
+ " print \"Your PC will always work fine...\\n\"\n",
+ "else:\n",
+ " print \"In front of the maintenance man\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your PC will always work fine...\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Using macros inside another macros\n",
+ "def AND(x,y): #set AND(x,y) for \"and\" operation\n",
+ " return (x and y)\n",
+ "def ARANGE():\n",
+ " return (AND(a>25,a<50)) #check for a>25 and a<50\n",
+ "a=30\n",
+ "if (ARANGE()):\n",
+ " print \"within range\\n\"\n",
+ "else:\n",
+ " print \"out of range\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "within range\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using macros to replace whole statement\n",
+ "def FOUND():\n",
+ " print \"The Yankee Doodle Virus\\n\"\n",
+ "signature='Y'\n",
+ "if (signature=='Y'):\n",
+ " FOUND()\n",
+ "else:\n",
+ " print \"Safe... as yet!\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Yankee Doodle Virus\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#macros with arguments to find area of circle\n",
+ "def AREA(x):\n",
+ " return (3.14*x*x)\n",
+ "r1=6.25\n",
+ "r2=2.5\n",
+ "a=AREA(r1)\n",
+ "print \"Area of circle=%f\\n\" % (a)\n",
+ "a=AREA(r2)\n",
+ "print \"Area of circle=%f\\n\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of circle=122.656250\n",
+ "\n",
+ "Area of circle=19.625000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#compiler interpretation of above program\n",
+ "r1=6.25\n",
+ "r2=2.5\n",
+ "a=3.14*r1*r1\n",
+ "print \"Area of circle=%f\\n\" % (a)\n",
+ "a=3.14*r2*r2\n",
+ "print \"Area of circle=%f\\n\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of circle=122.656250\n",
+ "\n",
+ "Area of circle=19.625000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#macros with argument to check if user-input is digit or not\n",
+ "def ISDIGIT(y):\n",
+ " return (y>=48 and y<=57)\n",
+ "print \"Enter any digit\"\n",
+ "ch=raw_input()\n",
+ "if (ISDIGIT(ord(ch))):\n",
+ " print \"You entered a digit\\n\"\n",
+ "else:\n",
+ " print \"Illegal input\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any digit\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You entered a digit\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#evaluating an expression\n",
+ "def SQUARE(n):\n",
+ " return (n*n)\n",
+ "j=64/SQUARE(4) #it's function not macros ,so j=4\n",
+ "print \"j=%d\\n\" % (j)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "j=4\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#gotoxy is not present in python,On Linux and other UNIX-like systems you can use curses library.\n",
+ "#We can use setsyx func. of curses in place of gotoxy but it will be limited to unix only.\n",
+ "def HLINE():\n",
+ " for i in range(0,79,1):\n",
+ " print \"%c\" % 45, #characters are bytes and therefore encoding-dependent(non utf-8)\n",
+ " print \"\\n\"\n",
+ "def VLINE(X,Y):\n",
+ " print \"%c\" % 124 #If you want to write 179 in place of 124 then use utf-8 encoding\n",
+ "HLINE()\n",
+ "for y in range(1,25,1):\n",
+ " VLINE(39,y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n",
+ "\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:236-237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using ifdef macros for conditional compilation\n",
+ "OKAY=False\n",
+ "if OKAY:\n",
+ " import logging\n",
+ " print \"statement 1\"\n",
+ " print \"statement 2\" #detects virus\n",
+ " print \"statement 3\" \n",
+ " print \"statement 4\" #specific to stone virus\n",
+ "print \"statement 5\"\n",
+ "print \"statement 6\"\n",
+ "print \"statement 7\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "statement 5\n",
+ "statement 6\n",
+ "statement 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using ifdef else macros for conditional compilation\n",
+ "INTEL=False\n",
+ "if INTEL:\n",
+ " print \"code suitable for an Intel PC\"\n",
+ "else:\n",
+ " print \"code suitable for a Motorola PC\"\n",
+ "print \"code common to both the computers\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "code suitable for a Motorola PC\n",
+ "code common to both the computers\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using ifdef else macros for conditional compilation\n",
+ "INTEL=True\n",
+ "if INTEL:\n",
+ " print \"code suitable for a Intel PC\"\n",
+ "else:\n",
+ " print \"code suitable for a motorola PC\"\n",
+ "print \"code common to both the computers\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "code suitable for a Intel PC\n",
+ "code common to both the computers\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using #if directive for conditional compilation\n",
+ "TEST=6\n",
+ "if TEST<=5:\n",
+ " print \"statement 1\"\n",
+ " print \"statement 2\"\n",
+ " print \"statement 3\"\n",
+ "else:\n",
+ " print \"statement 4\"\n",
+ " print \"statement 5\"\n",
+ " print \"statement 6\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "statement 4\n",
+ "statement 5\n",
+ "statement 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using nested if else directives for conditional compilation\n",
+ "ADAPTER='SVGA'\n",
+ "if ADAPTER=='VGA':\n",
+ " print \"code for video graphics array\"\n",
+ "else:\n",
+ " if ADAPTER=='SVGA':\n",
+ " print \"code for super video graphics array\"\n",
+ " else:\n",
+ " print \"code for extended graphics array\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "code for super video graphics array\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:239-240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#using #elif directives for conditional compilation\n",
+ "ADAPTER='SVGA'\n",
+ "if ADAPTER=='VGA':\n",
+ " print \"code for video graphics array\"\n",
+ "elif ADAPTER=='SVGA':\n",
+ " print \"code for super video graphics array\"\n",
+ "else:\n",
+ " print \"code for extented graphics adapter\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "code for super video graphics array\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Controlled execution of functions\n",
+ "def fun1():\n",
+ " print \"Inside fun1\\n\"\n",
+ "def fun2():\n",
+ " print \"Inside fun 2\\n\"\n",
+ "def main():\n",
+ " print \"Inside main\\n\"\n",
+ "fun1()\n",
+ "main()\n",
+ "fun2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inside fun1\n",
+ "\n",
+ "Inside main\n",
+ "\n",
+ "Inside fun 2\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Statements causing warnings & error\n",
+ "def f1():\n",
+ " a=5\n",
+ "def f2(x):\n",
+ " print \"Inside f2\" #passed parameter is not being used\n",
+ "def f3():\n",
+ " x=6\n",
+ " return x\n",
+ " x+=1 #control can never reach this statement\n",
+ "f1()\n",
+ "f2(7)\n",
+ "f3()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inside f2\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 20,
+ "text": [
+ "6"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter8.ipynb b/ANSI_C_Programming/chapter8.ipynb
new file mode 100644
index 00000000..9dbb6099
--- /dev/null
+++ b/ANSI_C_Programming/chapter8.ipynb
@@ -0,0 +1,1400 @@
+{
+ "metadata": {
+ "name": "chapter8.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 8: ARRAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#reassigning value to a variable\n",
+ "x=5\n",
+ "x=10\n",
+ "print \"x=%d\\n\" % (x) #prints 10"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x=10\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:257-258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program to find average marks obtained by a class of 30 students\n",
+ "sum=0\n",
+ "marks=[] #array declaration\n",
+ "for i in range(30):\n",
+ " marks.append(0)\n",
+ "for i in range(0,30,1):\n",
+ " print \"Enter marks\"\n",
+ " marks[i]=eval(raw_input()) #store data in array\n",
+ "for i in range(0,30,1):\n",
+ " sum=sum+marks[i]\n",
+ "avg=sum/30\n",
+ "print \"Average marks=%d\\n\" % (avg)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "98\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "97\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "96\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "87\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "89\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "80\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "86\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "95\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "99\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "90\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "99\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "94\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "85\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "84\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "92\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "91\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "87\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "76\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "75\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "96\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "83\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "80\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "93\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "79\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "70\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "85\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "86\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average marks=87\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#storing elements into an array\n",
+ "num=[]\n",
+ "for i in range(40):\n",
+ " num.append(0)\n",
+ "for i in range(0,40,1): #be carefull about the size of the array\n",
+ " num[i]=i"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:261-262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Demonstration of call by value\n",
+ "def display(m):\n",
+ " print \"%d\" % (m)\n",
+ "marks=[55,65,75,56,78,78,90]\n",
+ "for i in range(0,7,1):\n",
+ " display(marks[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55\n",
+ "65\n",
+ "75\n",
+ "56\n",
+ "78\n",
+ "78\n",
+ "90\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calling of function inside function to print an array\n",
+ "def show(n):\n",
+ " print \"%d\" % (n)\n",
+ "def disp(n):\n",
+ " show(n) #calls show()\n",
+ "marks=[55,65,75,56,78,78,90]\n",
+ "for i in range(0,7,1):\n",
+ " disp(marks[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55\n",
+ "65\n",
+ "75\n",
+ "56\n",
+ "78\n",
+ "78\n",
+ "90\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:263-264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing address and values of variables\n",
+ "i=3\n",
+ "j=1.5\n",
+ "k='c'\n",
+ "print \"Value of i=%d\\n\" % (i)\n",
+ "print \"Value of j=%f\\n\" % (j)\n",
+ "print \"Value of k=%c\\n\" % (k)\n",
+ "x=id(i)\n",
+ "y=id(j)\n",
+ "z=id(k)\n",
+ "print \"Original address in x=%u\\n\" % (x)\n",
+ "print \"Original address in y=%u\\n\" % (y)\n",
+ "print \"Original address in z=%u\\n\" % (z)\n",
+ "x+=1\n",
+ "y+=1\n",
+ "z+=1\n",
+ "print \"New address in x=%u\\n\" % (x)\n",
+ "print \"New address in y=%u\\n\" % (y)\n",
+ "print \"New address in z=%u\\n\" % (z)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of i=3\n",
+ "\n",
+ "Value of j=1.500000\n",
+ "\n",
+ "Value of k=c\n",
+ "\n",
+ "Original address in x=21147312\n",
+ "\n",
+ "Original address in y=88181272\n",
+ "\n",
+ "Original address in z=21311640\n",
+ "\n",
+ "New address in x=21147313\n",
+ "\n",
+ "New address in y=88181273\n",
+ "\n",
+ "New address in z=21311641\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing subtraction of addresses & values of 2 elements of array\n",
+ "arr=[10,20,30,45,67,56,74]\n",
+ "i=id(arr[1])\n",
+ "j=id(arr[5])\n",
+ "print \"%d %d\\n\" % (j-i,arr[5]-arr[1])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-432 36\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Comparison of addresses of elements of same array\n",
+ "arr=[10,20,36,72,45,36]\n",
+ "j=id(arr[4])\n",
+ "k=id(arr[0+4]) #didn't get any other way\n",
+ "if j==k:\n",
+ " print \"The two pointers point to the same location\\n\"\n",
+ "else:\n",
+ " print \"The two pointers do not point to the same location\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The two pointers point to the same location\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##printing memory location of elements of array\n",
+ "num=[24,34,12,44,56,17]\n",
+ "for i in range(0,6,1):\n",
+ " print \"element no.%d\" % (i)\n",
+ " print \"address=%u\\n\" % (id(num[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "element no.0\n",
+ "address=21147060\n",
+ "\n",
+ "element no.1\n",
+ "address=21146940\n",
+ "\n",
+ "element no.2\n",
+ "address=21147204\n",
+ "\n",
+ "element no.3\n",
+ "address=21146820\n",
+ "\n",
+ "element no.4\n",
+ "address=21146676\n",
+ "\n",
+ "element no.5\n",
+ "address=21147144\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print addresses & elements of array\n",
+ "num=[24,34,12,44,56,17]\n",
+ "for i in range(0,6,1):\n",
+ " print \"address=%u\" % (id(num[i]))\n",
+ " print \"element=%d\\n\" % (num[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address=21147060\n",
+ "element=24\n",
+ "\n",
+ "address=21146940\n",
+ "element=34\n",
+ "\n",
+ "address=21147204\n",
+ "element=12\n",
+ "\n",
+ "address=21146820\n",
+ "element=44\n",
+ "\n",
+ "address=21146676\n",
+ "element=56\n",
+ "\n",
+ "address=21147144\n",
+ "element=17\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#program for accessing the elements of array\n",
+ "num=[24,34,12,44,56,17]\n",
+ "j=id(num[0]) #assign address of zeroth element\n",
+ "for i in range(0,6,1):\n",
+ " print \"address=%u\" % (id(num[i]))\n",
+ " print \"element=%d\\n\" % (num[i]) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address=21147060\n",
+ "element=24\n",
+ "\n",
+ "address=21146940\n",
+ "element=34\n",
+ "\n",
+ "address=21147204\n",
+ "element=12\n",
+ "\n",
+ "address=21146820\n",
+ "element=44\n",
+ "\n",
+ "address=21146676\n",
+ "element=56\n",
+ "\n",
+ "address=21147144\n",
+ "element=17\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Demonstration of passing an entire array to a function\n",
+ "def display(j,n):\n",
+ " for item in j:\n",
+ " print \"element=%d\\n\" % (item)\n",
+ "num=[24,34,12,44,56,17]\n",
+ "display(num,6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "element=24\n",
+ "\n",
+ "element=34\n",
+ "\n",
+ "element=12\n",
+ "\n",
+ "element=44\n",
+ "\n",
+ "element=56\n",
+ "\n",
+ "element=17\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Another way of accessing the elements of array\n",
+ "num=[24,34,12,44,56,17]\n",
+ "for i in range(0,6,1):\n",
+ " print \"address=%u\" % (id(num[i]))\n",
+ " print \"element=%d %d\" % (num[i],num[i]) #no other way\n",
+ " print \"%d %d\\n\" % (num[i],num[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address=21147060\n",
+ "element=24 24\n",
+ "24 24\n",
+ "\n",
+ "address=21146940\n",
+ "element=34 34\n",
+ "34 34\n",
+ "\n",
+ "address=21147204\n",
+ "element=12 12\n",
+ "12 12\n",
+ "\n",
+ "address=21146820\n",
+ "element=44 44\n",
+ "44 44\n",
+ "\n",
+ "address=21146676\n",
+ "element=56 56\n",
+ "56 56\n",
+ "\n",
+ "address=21147144\n",
+ "element=17 17\n",
+ "17 17\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Storing roll no. & marks of 2 students using 2-D array\n",
+ "stud=[[0,0],[0,0],[0,0],[0,0]]\n",
+ "for i in range(0,4,1):\n",
+ " print \"Enter roll no. and marks\"\n",
+ " stud[i][0]=eval(raw_input())\n",
+ " stud[i][1]=eval(raw_input())\n",
+ "for i in range(0,4,1):\n",
+ " print \"%d %d\\n\" % (stud[i][0],stud[i][1])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter roll no. and marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1206030\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter roll no. and marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1206007\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "95\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter roll no. and marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1206034\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "97\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter roll no. and marks\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1206026\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1206030 100\n",
+ "\n",
+ "1206007 95\n",
+ "\n",
+ "1206034 97\n",
+ "\n",
+ "1206026 88\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Demo:2-D array is an array of arrays\n",
+ "s=[[1234,56],[1212,33],[1434,80],[1312,78]]\n",
+ "for i in range(0,4,1):\n",
+ " print \"Address of %dth 1-D array=%u\\n\" % (i,id(s[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of 0th 1-D array=88430392\n",
+ "\n",
+ "Address of 1th 1-D array=89514192\n",
+ "\n",
+ "Address of 2th 1-D array=88430712\n",
+ "\n",
+ "Address of 3th 1-D array=88430312\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Accessing elements of 2-D array\n",
+ "s=[[1234,56],[1212,33],[1434,80],[1312,78]]\n",
+ "for i in range(0,4,1):\n",
+ " for j in range(0,2,1):\n",
+ " print \"%d\" % (s[i][j])\n",
+ " print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n",
+ "56\n",
+ "\n",
+ "\n",
+ "1212\n",
+ "33\n",
+ "\n",
+ "\n",
+ "1434\n",
+ "80\n",
+ "\n",
+ "\n",
+ "1312\n",
+ "78\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:277-278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Usage of pointer to an array\n",
+ "s=[[1234,56],[1212,33],[1434,80],[1312,78]]\n",
+ "p=[]\n",
+ "for i in range(2):\n",
+ " p.append(0)\n",
+ "for i in range(0,4,1):\n",
+ " p=s\n",
+ " pint=p\n",
+ " print \"\\n\"\n",
+ " for j in range(0,2,1):\n",
+ " print \"%d\" % (pint[i][j])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "1234\n",
+ "56\n",
+ "\n",
+ "\n",
+ "1212\n",
+ "33\n",
+ "\n",
+ "\n",
+ "1434\n",
+ "80\n",
+ "\n",
+ "\n",
+ "1312\n",
+ "78\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:279-280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Passing 2-D array to a function\n",
+ "#can only implement only one way due to absence of pointers in python\n",
+ "def display(q,row,col):\n",
+ " for item in q:\n",
+ " print item\n",
+ " print \"\\n\"\n",
+ "a=[[1,2,3,4],[5,6,7,8],[9,0,1,6]]\n",
+ "display(a,3,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[1, 2, 3, 4]\n",
+ "[5, 6, 7, 8]\n",
+ "[9, 0, 1, 6]\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:281-282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Assigning values to the elements of an array seperately\n",
+ "arr=[]\n",
+ "for i in range(4):\n",
+ " arr.append(0)\n",
+ "i=31\n",
+ "j=5\n",
+ "k=19\n",
+ "l=71\n",
+ "arr[0]=i\n",
+ "arr[1]=j\n",
+ "arr[2]=k\n",
+ "arr[3]=l\n",
+ "for m in range(0,4,1):\n",
+ " print \"%d\\n\" % (arr[m])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "31\n",
+ "\n",
+ "5\n",
+ "\n",
+ "19\n",
+ "\n",
+ "71\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing address of an element of array\n",
+ "a=[0,1,2,3,4]\n",
+ "print \"%u %u %d\\n\" % (id(id(a[0])),id(a[0]),a[0])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88518416 21147348 0\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter9.ipynb b/ANSI_C_Programming/chapter9.ipynb
new file mode 100644
index 00000000..43e1d355
--- /dev/null
+++ b/ANSI_C_Programming/chapter9.ipynb
@@ -0,0 +1,958 @@
+{
+ "metadata": {
+ "name": "chapter9.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 9: PUPPETTING ON STRINGS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to demonstrate printing of a string\n",
+ "name=\"Klinsman\"\n",
+ "i=0\n",
+ "while i<=7:\n",
+ " print \"%c\" % (name[i]), #method of printing without line feed\n",
+ " i+=1\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K l i n s m a n \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:311-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing a string stored in 1-D array\n",
+ "name=\"Klinsman \"\n",
+ "i=0\n",
+ "while name[i]!=' ':\n",
+ " print \"%c\" % (name[i]), \n",
+ " i+=1\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " K l i n s m a n \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Program to demonstrate printing of a string\n",
+ "name=\"Klinsman \"\n",
+ "ptr=[]\n",
+ "ptr=name #store base address of string\n",
+ "i=0\n",
+ "while name[i]!=' ':\n",
+ " print \"%c\" % (ptr[i]), \n",
+ " i+=1\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K l i n s m a n \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#printing a string\n",
+ "name=\"Klinsman\"\n",
+ "print \"%s\" % (name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Klinsman\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#storing & printing a string\n",
+ "print \"Enter your name\"\n",
+ "name=raw_input()\n",
+ "print \"Hello %s!\\n\" % (name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Debashish\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello Debashish!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#storing & printing a string\n",
+ "print \"Enter your full name:\"\n",
+ "name=raw_input()\n",
+ "print \"Hello!\"\n",
+ "print name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your full name:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Debashish Roy\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello!\n",
+ "Debashish Roy\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Dynamic variables in python\n",
+ "str1=\"Hello\"\n",
+ "s=\"Good Morning\"\n",
+ "str2=str1 #No error in Python since all variables are by default pointers\n",
+ "q=s"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Dynamic allocation in python\n",
+ "str1=\"Hello\"\n",
+ "p=\"Hello\"\n",
+ "str1=\"Bye\" #No error in python\n",
+ "p=\"Bye\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to count number of characters in an array\n",
+ "arr=\"Bamboozled\"\n",
+ "len1=len(arr) #return length of string\n",
+ "len2=len(\"Humpty Dumpty\")\n",
+ "print \"string=%s length=%d\\n\" % (arr,len1)\n",
+ "print \"string=%s length=%d\\n\" % (\"Humpty Dumpty\",len2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "string=Bamboozled length=10\n",
+ "\n",
+ "string=Humpty Dumpty length=13\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:317-318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#A look-alike of the function strlen()\n",
+ "def xstrlen(s):\n",
+ " length=0\n",
+ " for item in s:\n",
+ " if s!=\"\\0\":\n",
+ " length+=1\n",
+ " return length\n",
+ "arr=\"Bamboozled\"\n",
+ "len1=xstrlen(arr) \n",
+ "len2=xstrlen(\"Humpty Dumpty\")\n",
+ "print \"string=%s length=%d\\n\" % (arr,len1)\n",
+ "print \"string=%s length=%d\\n\" % (\"Humpty dumpty\",len2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "string=Bamboozled length=10\n",
+ "\n",
+ "string=Humpty dumpty length=13\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Copying one string into another\n",
+ "import copy\n",
+ "source=\"Sayonara\"\n",
+ "target=copy.copy(source) #copy string\n",
+ "print \"source string=%s\\n\" % (source)\n",
+ "print \"target string=%s\\n\" % (target)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "source string=Sayonara\n",
+ "\n",
+ "target string=Sayonara\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:319-320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#A look-alike of the function strcpy()\n",
+ "def xstrcpy(t,s):\n",
+ " t=\"\\0\"\n",
+ " for item in s:\n",
+ " t=t+str(item)\n",
+ " return t\n",
+ "source=\"Sayonara\"\n",
+ "target=[]\n",
+ "target=xstrcpy(target,source)\n",
+ "print \"source string=%s\\n\" % (source)\n",
+ "print \"target string=%s\\n\" % (target)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "source string=Sayonara\n",
+ "\n",
+ "target string=\u0000Sayonara\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#print area of circle\n",
+ "pi=3.14\n",
+ "print \"Enter radius of circle\"\n",
+ "r=eval(raw_input())\n",
+ "a=pi*r*r\n",
+ "print \"Area of circle=%f\\n\" % (a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter radius of circle\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of circle=28.260000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Concatenating two strings\n",
+ "source=\"Folks!\"\n",
+ "target=\"Hello\"\n",
+ "target=target+source\n",
+ "print \"source string=%s\\n\" % (source)\n",
+ "print \"target string=%s\\n\" % (target)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "source string=Folks!\n",
+ "\n",
+ "target string=HelloFolks!\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:322-323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Comparing two strings\n",
+ "string1=\"Jerry\"\n",
+ "string2=\"Ferry\"\n",
+ "i=cmp(string1,\"Jerry\")\n",
+ "j=cmp(string1,string2)\n",
+ "k=cmp(string1,\"Jerry boy\")\n",
+ "print \"%d %d %d\\n\" % (i,j,k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 1 -1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:323-324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Application of 2-D araay of characters\n",
+ "def FOUND():\n",
+ " return 1\n",
+ "def NOTFOUND():\n",
+ " return 0\n",
+ "masterlist=[\"akshay\",\"parag\",\"raman\",\"srinivas\",\"gopal\",\"rajesh\"]\n",
+ "print \"Enter your name\"\n",
+ "yourname=raw_input()\n",
+ "flag=NOTFOUND()\n",
+ "for i in range(0,6,1):\n",
+ " a=cmp(masterlist[i],yourname)\n",
+ " if a==0:\n",
+ " print \"Welcome,you can enter the palace\\n\"\n",
+ " flag=FOUND()\n",
+ " break\n",
+ "if flag==NOTFOUND():\n",
+ " print \"Sorry,you are a trespasser\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gopal\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome,you can enter the palace\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exchange names using 2-D array of characters\n",
+ "names=[\"akshay\",\"parag\",\"raman\",\"srinivas\",\"gopal\",\"rajesh\"]\n",
+ "names = map(bytearray, names)\n",
+ "print \"Original:%s %s\\n\" % (names[2],names[3])\n",
+ "s = sorted((names[2], names[3]), key=len)\n",
+ "for i in range(len(s[1])):\n",
+ " try:\n",
+ " t=s[0][i]\n",
+ " s[0][i]=s[1][i]\n",
+ " s[1][i]=t\n",
+ " except IndexError:\n",
+ " for _ in range(i, len(s[1])):\n",
+ " #remove the items from the longer string to and append them to the shorter one.\n",
+ " s[0].append(s[1].pop(i)) \n",
+ "print \"New:%s %s\\n\" % (names[2],names[3])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original:raman srinivas\n",
+ "\n",
+ "New:srinivas raman\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE-328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exchange names using 2-D array of characters\n",
+ "names=[\"akshay\",\"parag\",\"raman\",\"srinivas\",\"gopal\",\"rajesh\"]\n",
+ "print \"Original:%s %s\\n\" % (names[2],names[3])\n",
+ "t=names[2]\n",
+ "names[2]=names[3]\n",
+ "names[3]=t\n",
+ "print \"New:%s %s\\n\" % (names[2],names[3])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original:raman srinivas\n",
+ "\n",
+ "New:srinivas raman\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Storing elements in an array\n",
+ "names=[]\n",
+ "for i in range(6):\n",
+ " names.append(\"\\0\") \n",
+ "for i in range(0,6,1):\n",
+ " print \"Enter name\"\n",
+ " names[i]=raw_input()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RAM\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GOPAL\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PANDEY\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GOPU\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CHOTU\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RADHEY\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:329-330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Dynamic memory allocation of variables\n",
+ "#No need of malloc func. in python as by default it's dynamic\n",
+ "names=[]\n",
+ "for i in range(0,6):\n",
+ " names.append('\\0')\n",
+ "for i in range(0,6,1):\n",
+ " print \"Enter name\"\n",
+ " n=raw_input()\n",
+ " length=len(n)\n",
+ " import copy\n",
+ " p=copy.copy(n)\n",
+ " names[i]=p\n",
+ "for i in range(0,6,1):\n",
+ " print \"%s\\n\" % (names[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MUKUT\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BIHARI\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PANDEY\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MADHUBALA\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PANDEY\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SUNITA\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MUKUT\n",
+ "\n",
+ "BIHARI\n",
+ "\n",
+ "PANDEY\n",
+ "\n",
+ "MADHUBALA\n",
+ "\n",
+ "PANDEY\n",
+ "\n",
+ "SUNITA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/screenshots/code1.png b/ANSI_C_Programming/screenshots/code1.png
new file mode 100644
index 00000000..0af5c5b5
--- /dev/null
+++ b/ANSI_C_Programming/screenshots/code1.png
Binary files differ
diff --git a/ANSI_C_Programming/screenshots/code2.png b/ANSI_C_Programming/screenshots/code2.png
new file mode 100644
index 00000000..939e13d3
--- /dev/null
+++ b/ANSI_C_Programming/screenshots/code2.png
Binary files differ
diff --git a/ANSI_C_Programming/screenshots/code3.png b/ANSI_C_Programming/screenshots/code3.png
new file mode 100644
index 00000000..0a94f7ba
--- /dev/null
+++ b/ANSI_C_Programming/screenshots/code3.png
Binary files differ
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter1.ipynb b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter1.ipynb
new file mode 100644
index 00000000..a1a29ec8
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter1.ipynb
@@ -0,0 +1,503 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "UNIT-1:Waves & Vibrations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.1,Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Velocity of sound \n",
+ "\n",
+ "#Variable declaration\n",
+ "n=512 #frequency in Hz\n",
+ "l=67 #wavelength in cm\n",
+ "\n",
+ "#Calculation\n",
+ "v=n*l #calculating velocity\n",
+ "\n",
+ "#Result\n",
+ "print\"Velocity = \",v,\" cm/sec\" \n",
+ "print\"NOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity = 34304 cm/sec\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.2,Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Frequency of tuning fork \n",
+ "\n",
+ "#Variable declaration\n",
+ "v=340 #velocity in m/sec\n",
+ "l=0.68 #wavelength in m\n",
+ "\n",
+ "#Calculation\n",
+ "n=v/l #calculating frequency\n",
+ "\n",
+ "#Result\n",
+ "print\"Frequency\",n,\"Hz\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency 500.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.3,Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Wavelength of wave \n",
+ "\n",
+ "#Variable declaration\n",
+ "v=3*10**8 #velocity in m/sec\n",
+ "n=500*10**3 #frequency in Hz\n",
+ "\n",
+ "#Calculation\n",
+ "l=v/n #calculating wavelength\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength=\",l,\"m\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength= 600 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.4,Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Distance by sound in air \n",
+ "\n",
+ "#Variable declaration\n",
+ "v=330 #velocity in m/sec\n",
+ "n=560.0 #frequency in Hz\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=v/n #calculating wavelength\n",
+ "\n",
+ "#Result\n",
+ "print\"lambda=\",round(lamda,3),\"m\"\n",
+ "print\"Distance travelled in 30 vibrations in m = \",round(lamda*30,2),\"m\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lambda= 0.589 m\n",
+ "Distance travelled in 30 vibrations in m = 17.68 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.5,Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Sound,when stone dropped from height\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "s=90.0 #distance in m\n",
+ "u=0 #initial velocity in m/sec\n",
+ "\n",
+ "#Calculation\n",
+ "t=math.sqrt(90/4.9) #calculating time using kinematical equation\n",
+ "later=4.56 #Time after which sound is heard\n",
+ "t1=later-t #calculating time taken by sound to travel\n",
+ "t1=round(t1,2)\n",
+ "v=s/t1 #calculating velocity\n",
+ "\n",
+ "#Result\n",
+ "print\"Velocity in m/sec = \",round(v,2),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in m/sec = 333.33 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.6,Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Velocity in different medium \n",
+ "\n",
+ "#Variable declaration\n",
+ "l1=1.5 #wavelength in m\n",
+ "l2=2 #wavelength in m\n",
+ "v1=120 #velocity in m/sec\n",
+ "\n",
+ "#Calculation\n",
+ "n=v1/l1 #calculating frequency\n",
+ "v2=n*l2 #calculating velocity\n",
+ "\n",
+ "#Result\n",
+ "print\"Velocity in m/sec = \",v2,\"m/sec\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in m/sec = 160.0 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.7,Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Frequency of green light \n",
+ "\n",
+ "#Variable declaration\n",
+ "l=5641*10**-10 #wavelength in m\n",
+ "c=3*10**8 #velocity in m/sec\n",
+ "u=1.58 #refractive index of glass\n",
+ "\n",
+ "#Calculation\n",
+ "n=c/l #calculating frequency\n",
+ "cg=c/u #calculating velocity of light in glass\n",
+ "l1=cg/n #calculating wavelegth in glass\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength in glass in Angstrom =\",l1*10**10,\"Angstrom\" \n",
+ "print\"\\n\\nNOTE:Calculation ambiguity in book,value of cg is taken as 1.9*10**8 ,Therefore final answer is changed\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength in glass in Angstrom = 3570.25316456 Angstrom\n",
+ "\n",
+ "\n",
+ "NOTE:Calculation ambiguity in book,value of cg is taken as 1.9*10**8 ,Therefore final answer is changed\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.8,Page no:15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Wavelength of raio station \n",
+ "\n",
+ "#Variable declaration\n",
+ "n=12*10**6 #frequency in Hz\n",
+ "v=3*10**8 #velocity in m/sec\n",
+ "\n",
+ "#Calculation\n",
+ "l=v/n #calculating wavelength\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength in m = \",l,\"m\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength in m = 25 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.9,Page no:15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Wavelength of sound \n",
+ "\n",
+ "#Variable declaration\n",
+ "n=400 #frequency in Hz\n",
+ "v=300.0 #velocity in m/sec\n",
+ "\n",
+ "#Calculation\n",
+ "l=v/n #calculating wavelength\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength=\",l,\"m\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength= 0.75 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.10,Page no:22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Equation of SHM\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "a=20 #amplitude in cm\n",
+ "n=6 #frequency per second\n",
+ "\n",
+ "#Calculation\n",
+ "w=2*(math.pi)*n #omega in radians/sec\n",
+ "\n",
+ "#Result\n",
+ "print\"Omega in radians/sec = \",round(w,1),\"rad/sec\" \n",
+ "print\"y=\",a,\"sin\",round(w,1),\"t\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Omega in radians/sec = 37.7 rad/sec\n",
+ "y= 20 sin 37.7 t\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.11,Page no:23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#SHM by a body \n",
+ "\n",
+ "#Variable declaration\n",
+ "a=6 #amplitude in cm\n",
+ "n=9 #frequency in Hz.\n",
+ "\n",
+ "#Calculation\n",
+ "vmax=2*(math.pi)*n*6 #calculating velocity in cm/sec\n",
+ "acc=-((18*(math.pi))**2)*6 #calculating acc. in m/sec square\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum velocity in cm/sec = \",round(vmax,2),\"cm/sec\" \n",
+ "print\"Velocity at extreme position = 0\" \n",
+ "print\"Accelaration at mean position = 0\" \n",
+ "print\"Accelaration at extreme position = \",round(acc,1),\"m/sec^2\" \n",
+ "print\"\\n\\nNOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum velocity in cm/sec = 339.29 cm/sec\n",
+ "Velocity at extreme position = 0\n",
+ "Accelaration at mean position = 0\n",
+ "Accelaration at extreme position = -19186.5 m/sec^2\n",
+ "\n",
+ "\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:1.12,Page no:26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Weight of body suspended fro spring \n",
+ "\n",
+ "#Variable declaration\n",
+ "g=9.8 #gravitational constant\n",
+ "m=50 #mass in kg\n",
+ "l=0.2 #length in m\n",
+ "T=0.6 #time period\n",
+ "\n",
+ "#Calculation\n",
+ "k=(m*g)/l #calculating constant\n",
+ "m=2450*((T/(2*(math.pi)))**2) #calcualting mass using given time period\n",
+ "\n",
+ "#Result\n",
+ "print\"Mass of body= \",round(m,2),\"kg\" \n",
+ "print\"Weight of suspended body=\",round(m,2)*g,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of body= 22.34 kg\n",
+ "Weight of suspended body= 218.932 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter2.ipynb b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter2.ipynb
new file mode 100644
index 00000000..7c9499cb
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter2.ipynb
@@ -0,0 +1,342 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "UNIT-2:Application of Sound Waves"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.1,Page no:41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reverberation time\n",
+ "\n",
+ "#Variable declaration\n",
+ "v=3000 #volume in metre cube.\n",
+ "theta=0.2 #theta in owu(open window unit).\n",
+ "s=1850 #area in metre cube.\n",
+ "\n",
+ "#Calculation\n",
+ "a=theta*s #calculating total absorbtion of surface.\n",
+ "T=(0.165*v)/a #calculating T using Sabine formula\n",
+ "\n",
+ "#Result\n",
+ "print\"Reverberation time of Room = \",round(T,2) ,\"sec\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverberation time of Room = 1.34 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.2,Page no:41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate average absorbing power\n",
+ "\n",
+ "#Variable declaration\n",
+ "v=120000 #volume in metre cube.\n",
+ "t=1.5 #time in second.\n",
+ "s=25000 #area in metre cube.\n",
+ "\n",
+ "#Calculation\n",
+ "a=(0.16*v)/(t*s) #using Sabine formula for calculating a\n",
+ "\n",
+ "#Variable declaration\n",
+ "print\"Average Absorbing Power of Surface = \",a,\"o w u\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Absorbing Power of Surface = 0.512 o w u\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.3,Page no:42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reverberation time of cinema hall\n",
+ "\n",
+ "#Variable declaration\n",
+ "v=6000.0 #Volume in metre cube.\n",
+ "a=20.0 #surface absorbtion in owu(open window unit).\n",
+ "\n",
+ "#Calculation\n",
+ "T=(0.165*v)/(a) #calculating T using Sabine Formula.\n",
+ "\n",
+ "#Result\n",
+ "print\"Reverberation Time = \",T,\"sec\"\n",
+ "print\"\\nNOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverberation Time = 49.5 sec\n",
+ "\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.4,Page no:42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reverberation time with persons\n",
+ "\n",
+ "#Variable declaration\n",
+ "v=3500 #volume in metre cube.\n",
+ "n1=370-300 #no. of audience on wooden seats.\n",
+ "n2=300-70 #no. of empty wooden seats.\n",
+ "\n",
+ "#Calculation\n",
+ "a1s1=0.04*60 #absorption due to wooden doors.\n",
+ "a2s2=0.03*700 #absorption due to plastered walls.\n",
+ "a3s3=0.06*50 #absorption due to glass work.\n",
+ "a4s4=4.2*370 #absorption due to audience on spungy and wooden \n",
+ "#seats.\n",
+ "a5s5=2*230 #absorption due to empty seats.\n",
+ "sum=a1s1+a2s2+a3s3+a4s4+a5s5 #total absorption of cinema hall.\n",
+ "T=(0.165*v)/sum #calculating T using Sabine Formula.\n",
+ "\n",
+ "#Result\n",
+ "print\"Reverberation Time = \",round(T,2),\"sec\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverberation Time = 0.28 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.5,Page no:49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Frequency of ultrasonics\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "l=10 #length in centimetres.\n",
+ "Y=20*10**11 #Young's Modulus in dyne/cm square.\n",
+ "R=8 #Density in gram/cc\n",
+ "\n",
+ "#Calculation\n",
+ "n=(1.0/(2*l))*math.sqrt(Y/R) #calculating frequency of vibration using \n",
+ "#young's modulus.\n",
+ "\n",
+ "#Result\n",
+ "print\"Frequency of vibration=\",n,\"Hz\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of vibration= 25000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.6,Page no:50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Fundamental frequency of vibration\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "t=0.1 #thickness in centimetre.\n",
+ "Y=8.75*10**11 #Young's Modulus in dyne/cm square.\n",
+ "R=2.654 #Density in gram/cm square.\n",
+ "\n",
+ "#Calculation\n",
+ "n=(1/(2*t))*math.sqrt(Y/R) #calculating frequency using Young's modulus.\n",
+ "\n",
+ "#Result\n",
+ "print\"Frequency of Vibration=\",round(n),\"Hz\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of Vibration= 2870936.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.7,Page no:50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Speed of sound wave in water\n",
+ "\n",
+ "#Variable declaration\n",
+ "K=2.026*10**9 #Bulk Modulus in N/m square.\n",
+ "R=10**3 #Density in Kg/m cube.\n",
+ "\n",
+ "#Calculation\n",
+ "V=math.sqrt(K/R) #Calculating speed using Bulk Modulus.\n",
+ "\n",
+ "#Result\n",
+ "print\"Velocity of sound waves in water = \",round(V,2),\"m/sec\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of sound waves in water = 1423.38 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:2.8,Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Speed of ultrasonic wave in air\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Y=1.41 #Young's Modulus.\n",
+ "R=1.293*10**-3 #Density of air in g/centimetre cube.\n",
+ "P=76*13.6*980 #atmospheric pressure in dyne/cm square.\n",
+ "\n",
+ "#Calculation\n",
+ "V=math.sqrt((Y*P)/R) #calculating speed using young's modulus.\n",
+ "\n",
+ "#Result\n",
+ "print\"Speed of ultrasonic wave in air at n.t.p=\",round(V*10**-2,1),\"m/sec\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Speed of ultrasonic wave in air at n.t.p= 332.4 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter3.ipynb b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter3.ipynb
new file mode 100644
index 00000000..e8c1b701
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter3.ipynb
@@ -0,0 +1,606 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "UNIT-3:Principle of Optics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.1,Page no:69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Distance of object from lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "f=15.0 #focal length in cm\n",
+ "v=10.0 #image distance in cm\n",
+ "\n",
+ "#Calculation\n",
+ "u=1/((1/v)-(1/f)) #calculating u using (1/f)=(1/v)-(1/u)\n",
+ "\n",
+ "#Result\n",
+ "print\"Object Distance ,u= \",u,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Object Distance ,u= 30.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.2,Page no:70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Power of lens\n",
+ "\n",
+ "#Variable declaration\n",
+ "f=80.0 #focal length in cm\n",
+ "f1=20.0 #focallength of first lens in cm\n",
+ "\n",
+ "#Calculation\n",
+ "f2=1/((1/f)-(1/f1)) #using (1/F)=(1/f1)+(1/f2)\n",
+ "P=(100.0/f) #power in D\n",
+ "P1=100.0/20 #power of first lens\n",
+ "P2=P1-P #power in D\n",
+ "\n",
+ "#Variable declaration\n",
+ "print\"Power= \",P2,\"D\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power= 3.75 D\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.3,Page no:71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Focal length and nature of lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "P=2.5 #Power in D\n",
+ "\n",
+ "#Calculation\n",
+ "f=-(1/P) #calculating f in m\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length =\",f,\"m\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length = -0.4 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.4,Page no:72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find object and image distance\n",
+ "\n",
+ "#Variable declaration \n",
+ "m=4 #magnigication\n",
+ "f=20 #focal length in cm\n",
+ "\n",
+ "#Calculation\n",
+ "u=(20*3)/(4) #on simplifying (1/f)=(1/v)-(1/u)\n",
+ "v=(4*u) #calculating v in cm\n",
+ "\n",
+ "#Result\n",
+ "print\"Object distance,u= \",u,\"cm\" \n",
+ "print\"Image distance,v= \",v,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Object distance,u= 15 cm\n",
+ "Image distance,v= 60 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.5,Page no:72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Describe image produced by lens\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "#Variable declaration\n",
+ "u=14.0 #object distance in cm\n",
+ "f=-21.0 #focal distance in cm\n",
+ "\n",
+ "#Calculation\n",
+ "v=1/((1/f)-(1/u))\n",
+ "I=(3.0*v)/(-u) #using m=(1/0)=(v/u) \n",
+ "\n",
+ "#Result\n",
+ "print\"Image distance= \",v,\"cm\" \n",
+ "print\"I= \",I,\"cm\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Image distance= -8.4 cm\n",
+ "I= 1.8 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.6,Page no:79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate magnifying power of glass\n",
+ "\n",
+ "#Variable declaration \n",
+ "fe=5 #focal length in cm\n",
+ "D=25 #distance od distinct vision in cm\n",
+ "\n",
+ "#Calculation\n",
+ "m=1+(D/fe) #calculating magnifying power\n",
+ "\n",
+ "#Result\n",
+ "print\"magnifying Power = \",m "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "magnifying Power = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.7,Page no:80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate magnification produced by objectives\n",
+ "\n",
+ "#Variable declaration \n",
+ "fe=5 #focal length in cm\n",
+ "D=25 #distance od distinct vision in cm\n",
+ "\n",
+ "#Calculation\n",
+ "mo=30/(1+(D/fe)) #calculating magnification of objective lens\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnification produced by objective lens = \",mo "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnification produced by objective lens = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.8,Page no:80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Magnifying power of microscope\n",
+ "\n",
+ "#Variable declaration \n",
+ "u=-6.0 #object distance in cm\n",
+ "fo=4.0 #focal distance in cm\n",
+ "fe=6.0 #focal length in cm\n",
+ "D=25.0 #distance of distinct vision in cm\n",
+ "\n",
+ "#Calculation\n",
+ "v=1/((1/u)+(1/fo)) #using (1/f)=(1/v)-(1/u)\n",
+ "m=(v/u)*(1+(D/fe)) #calculating m\n",
+ "\n",
+ "#Result\n",
+ "print\"Image distance in cm = \",v,\"cm\" \n",
+ "print\"Magnifying Power = \",round(-m,2) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Image distance in cm = 12.0 cm\n",
+ "Magnifying Power = 10.33\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.9,Page no:81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Magnification of lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "D=25.0 #distance of distinct vision\n",
+ "u=-9.0 #object distance in cm\n",
+ "fe=10.0 #focal length in cm\n",
+ "\n",
+ "#Calculation\n",
+ "v=1/((1/fe)+(1/u)) #using (1/f)=(1/v)-(1/u)\n",
+ "m=(v/u) #calculating m\n",
+ "M=D/u #calculating Magnifying power of lens\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnification of lens = \",m \n",
+ "print\"Magnifying Power = \",round(-M,1) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnification of lens = 10.0\n",
+ "Magnifying Power = 2.8\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.10,Page no:82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate focal length of eye lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "fo=0.5 #focal length of eye lens\n",
+ "D=25 #distance of distinct vision\n",
+ "L=15 #length in cm\n",
+ "m=375 #magnification\n",
+ "\n",
+ "#Calculation\n",
+ "fe=(-L*D)/(fo*((L/fo)-m)) #calculating fe\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of eye lens= \",round(fe,1),\"cm\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of eye lens= 2.2 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.11,Page no:86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Focal length of astronomical lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "m=5 #magnifying power\n",
+ "L=24 #length in cm\n",
+ "fe=4 #focal length in cm\n",
+ "\n",
+ "#Calculation\n",
+ "fo=5*fe #calculating fo\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of lens = \",fo,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of lens = 20 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.12,Page no:87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate magnifying power of telescope\n",
+ "\n",
+ "#Variable declaration \n",
+ "D=25.0 #distance of distinct vision in cm\n",
+ "fo=140.0 #focal length of eye lens\n",
+ "fe=5.0 #focal length in cm\n",
+ "\n",
+ "#Calculation\n",
+ "m=-(fo/fe) #calculating magnifying power\n",
+ "m1=-(fo/fe)*(1+(fe/D)) #calculating magnifying power\n",
+ "\n",
+ "#Result\n",
+ "print\"(a):Magnifying power at normal adjustment = \",m\n",
+ "print\"(b):Magnifying power atleast distance of distinct vision = \",m1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a):Magnifying power at normal adjustment = -28.0\n",
+ "(b):Magnifying power atleast distance of distinct vision = -33.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.13,Page no:88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find focal length of eye lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "M=5 #Magnifying power\n",
+ "fo=10 #focal length of eye lens\n",
+ "\n",
+ "#Calculation\n",
+ "fe=fo/M #calculating fe\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of eye lens= \",fe,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of eye lens= 2 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.14,Page no:88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find magnifying power of telescope\n",
+ "\n",
+ "#Variable declaration \n",
+ "fo=75.0 #focal length of eye lens\n",
+ "D=25.0 #distance of distinct vision\n",
+ "fe=5.0 #focal of eye lens in cm\n",
+ "\n",
+ "#Calculation\n",
+ "M=-(fo/fe)*(1+(fe/D)) #calculating M\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnifying power = \",M"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnifying power = -18.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:3.15,Page no:88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Focal length of two thin lens\n",
+ "\n",
+ "#Variable declaration \n",
+ "M=7 #magnifying power\n",
+ "L=40 #length\n",
+ "\n",
+ "#Calculation\n",
+ "fe=(L/(M+1)) #focal length of eye lens in cm\n",
+ "fo=(M*fe) #calculating focal length\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal Length of lens=\",fo,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal Length of lens= 35 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter4.ipynb b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter4.ipynb
new file mode 100644
index 00000000..a7b1202f
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter4.ipynb
@@ -0,0 +1,1115 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "UNIT-4:Electrostatics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.1,Page no:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Coulomb or charge of an electron\n",
+ "\n",
+ "#Variable declaration \n",
+ "q=1.0 #no of coulomb\n",
+ "e=1.6*10**-19 #charge on an electron\n",
+ "\n",
+ "#Calculation\n",
+ "n=(q/e) #calculating no of electrons\n",
+ "\n",
+ "#Result\n",
+ "print\"No of electrons =\",n\n",
+ "print\"NOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No of electrons = 6.25e+18\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.2,Page no:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calcuate charge in equal sized spheres\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "g=9.8\n",
+ "m=4.5 #Massin [kg]\n",
+ "r=0.03 #radius in [m]\n",
+ "\n",
+ "#Calculation\n",
+ "F=m*g #in Newton\n",
+ "q=math.sqrt(((r**2)*m*g)/(9*10**9)) #calculating q using F=(1/4*3.14*eo)*((q1*q2)/(r**2))\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge = \",q,\"C\"\n",
+ "print\"\\nNOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge = 2.1e-06 C\n",
+ "\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.3,Page no:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calcuate force between small spheres\n",
+ "\n",
+ "#Variable declaration \n",
+ "q1=2*10**-7 #charge in C\n",
+ "q2=3*10**-7 #charge in C\n",
+ "r=30*10**-2 #r in m\n",
+ "\n",
+ "#Calculation\n",
+ "F=(9*10**9)*((q1*q2)/r**2) #calculating F\n",
+ "\n",
+ "#Result\n",
+ "print\"Force = %.e\"%F,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force = 6e-03 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 70
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.4,Page no:104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate force between two charges in vacuum\n",
+ "\n",
+ "#Variable declaration \n",
+ "q1=1 #charge in C\n",
+ "q2=1 #charge in C\n",
+ "r=1 #r in m\n",
+ "\n",
+ "#Calculation\n",
+ "F=(9*10**9)*((q1*q2)/r**2) #calculating F\n",
+ "\n",
+ "#Result\n",
+ "print\"Force = %.e\"%F,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force = 9e+09 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.5,Page no:104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#No of electrons trasnferred when polythene is rubbed\n",
+ "\n",
+ "#Variable declaration \n",
+ "m=9*10**-31 #mass of electron in kg\n",
+ "q=-3.2*10**-7 #charge in C\n",
+ "e=-1.6*10**-19 #charge on electron in C\n",
+ "\n",
+ "#Calculation\n",
+ "n=(q/e) #calculating n\n",
+ "M=n*m #calculating mass transfered\n",
+ "\n",
+ "#Result\n",
+ "print\"(a):No. of electrons = \",n\n",
+ "print\"(b):Mass transfered to polythene= \",M,\"kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a):No. of electrons = 2e+12\n",
+ "(b):Mass transfered to polythene= 1.8e-18 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.6,Page no:105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare force between electron and proton\n",
+ "\n",
+ "#Variable declaration \n",
+ "q1=1.6*10**-19 #charge in C\n",
+ "q2=-1.6*10**-19 #charge in C\n",
+ "r=10**-9 #r in m\n",
+ "\n",
+ "#Calculation\n",
+ "F=(9*10**9)*((q1*q2)/r**2) #calculating F\n",
+ "\n",
+ "#Result\n",
+ "print\"Force=\",F,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force= -2.304e-10 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.7,Page no:110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of voltage\n",
+ "\n",
+ "#Variable declaration \n",
+ "Va=-10 #voltage in volts\n",
+ "W=100 #work in Joule\n",
+ "q=2 #charge in Coulomb\n",
+ "\n",
+ "#Calculation\n",
+ "v=(Va)+(W/q) #calculating v\n",
+ "\n",
+ "#Result\n",
+ "print\"Voltage = \",v,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage = 40 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.8,Page no:111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate magnitude of point charge for fixed electric field\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "eo=(8.854*10**-12) #constant\n",
+ "E=2 #magnitude of electric field in N/C\n",
+ "r=0.5 #r in m\n",
+ "\n",
+ "#Calculation\n",
+ "q=E*4*(math.pi)*(eo)*(r**2) #calculating charge\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge= %.2e\"%q,\"C\"\n",
+ "print\"\\nNOTE:Calcualtion mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge= 5.56e-11 C\n",
+ "\n",
+ "NOTE:Calcualtion mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.9,Page no:111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate work done to move electron in capacitor\n",
+ "\n",
+ "#Variable declaration \n",
+ "e=-1.6*10**-19 #charge on electron in Coulomb\n",
+ "q=20*10**-6 #charge in Coulomb\n",
+ "r1=0.1 #r1 in m\n",
+ "r2=0.05 #r2 in m\n",
+ "\n",
+ "#Calculation\n",
+ "Va=9*10**9*(q/r1) #calculating voltage at A\n",
+ "Vb=9*10**9*(q/r2) #calculating voltage at B\n",
+ "V=Va-Vb #potential difference\n",
+ "W=V*e #calculating work done in joule\n",
+ "\n",
+ "#Result\n",
+ "print\"Work done to take the electron from A to B = \",W,\"Joule\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done to take the electron from A to B = 2.88e-13 Joule\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.10,Page no:112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Potential at the centre of the square\n",
+ "\n",
+ "#Variable declaration \n",
+ "q1=(2.0*10**-8) #charge in coulomb\n",
+ "q2=(-2.0*10**-8) #charge in coulomb\n",
+ "q3=(3.0*10**-8) #charge in coulomb\n",
+ "q4=(6.0*10**-8) #charge in coulomb\n",
+ "s=1.0 #side in m\n",
+ "\n",
+ "#Calculation\n",
+ "V=(9.0*10**9)*(1.0/s)*(q1+q2+q3+q4) #calculating voltage\n",
+ "\n",
+ "#Result\n",
+ "print\"Voltage in Volts = \",V,\"Volts\"\n",
+ "print\"\\nNOTE:Calculation mistake in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage in Volts = 810.0 Volts\n",
+ "\n",
+ "NOTE:Calculation mistake in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.11,Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Electrical flux through gaussian surface\n",
+ "\n",
+ "#Variable declaration \n",
+ "eo=8.85*10**-12 #constant\n",
+ "q=2*10**-6 #charge in coulomb\n",
+ "l=9 #length in cm\n",
+ "\n",
+ "#Calculation\n",
+ "fi=(q/eo) #calcualting flux in (N m square)/c\n",
+ "\n",
+ "#Result\n",
+ "print\"Flux through the surface=%2e\"%fi,\"N m^2/c\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux through the surface=2.259887e+05 N m^2/c\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.12,Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate charge on spherical capacitor\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "eo=8.85*10**-12 #constant\n",
+ "r=1.2 #r in m\n",
+ "t=80*10**-6 #surface sharge density in c/m square\n",
+ "\n",
+ "#Calculation\n",
+ "q=t*4*(math.pi)*(r**2) #calculating charge\n",
+ "fi=q/eo #calculating flux\n",
+ "\n",
+ "#Result\n",
+ "print\"Flux=%g\"%fi,\"N c^-1 m^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux=1.63576e+08 N c^-1 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.13,Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate linear charge density\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "eo=8.85*10**-12 #constant\n",
+ "E=9*10**4 #Electric field in N/C\n",
+ "r=2*10**-2 #r in m\n",
+ "\n",
+ "#Calculation\n",
+ "L=2*(math.pi)*E*eo*r #calculating linear charge density\n",
+ "\n",
+ "#Result\n",
+ "print\"Linear charge density = \",round(L,7),\"cm^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Linear charge density = 1e-07 cm^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.14,Page no:125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Electrical intensity of plates\n",
+ "\n",
+ "#Variable declaration \n",
+ "o=17*10**-22 #surface charge density in cm**-2\n",
+ "eo=8.85*10**-12 #constant\n",
+ "\n",
+ "#Calculation\n",
+ "E=o/eo #calculating electric intensity in region III\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric Intensity in regions I and II = 0\" \n",
+ "print\"Electric Intensity in region III = \",round(E,12),\"N/C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric Intensity in regions I and II = 0\n",
+ "Electric Intensity in region III = 1.92e-10 N/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.15,Page no:125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Intensity of electric field of point charge\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "r=0.05 # in m\n",
+ "eo=8.85*10**-12 #constant\n",
+ "q=10.0**-9 #charge at point P in Coulomb\n",
+ "\n",
+ "#Calculation\n",
+ "E=q/(4*(math.pi)*eo*(r**2)) #calculating electric field\n",
+ "r1=0.2 #in m\n",
+ "V1=q/(4*(math.pi)*eo*r1) #calculating potential difference\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric field= \",round(E),\"v/m\"\n",
+ "print\"\\nNOTE:Approximate answer is calculated in book\\n\\n\"\n",
+ "print\"Potential difference between two points = \",round(V1),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric field= 3597.0 v/m\n",
+ "\n",
+ "NOTE:Approximate answer is calculated in book\n",
+ "\n",
+ "\n",
+ "Potential difference between two points = 45.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.16,Page no:126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Charge on the sphere and electric flux\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "eo=8.85*10**-12 #constant\n",
+ "o=80.0*10**-6 #surface charge density in c/ square\n",
+ "r=1.2 #in m\n",
+ "\n",
+ "#Calculation\n",
+ "q=o*(math.pi)*(r**2) #calculating charge in Coulomb\n",
+ "fi=q/eo #calculating electric flux\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge= \",q,\"C\"\n",
+ "print\"Electric flux = \",fi,\"N m^2/c\"\n",
+ "print\"\\nNOTE:Wrong answers in book\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge= 0.000361911473694 C\n",
+ "Electric flux = 40893951.8298 N m^2/c\n",
+ "\n",
+ "NOTE:Wrong answers in book\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.17,Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Charge on plates of capacitor\n",
+ "\n",
+ "#Variable declaration \n",
+ "V=250 #potential difference in Volt\n",
+ "C=10**-11 #capacitance in farad\n",
+ "\n",
+ "#Calculation\n",
+ "q=C*V #calculating charge\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge = \",q,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge = 2.5e-09 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.18,Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate capacitance of earth\n",
+ "\n",
+ "#Variable declaration \n",
+ "r=6.4*10**6 #in m\n",
+ "\n",
+ "#Calculation\n",
+ "C=r/(9*10**9) #calculating charge\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance = \",round(C*10**6),\"mu F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance = 711.0 mu F\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.19,Page no:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Area of capacitor plate\n",
+ "\n",
+ "#Variable declaration \n",
+ "C=2 #capacitance in Farad\n",
+ "d=0.5*10**-2 #distance in m\n",
+ "eo=8.85*10**-12 #constant\n",
+ "\n",
+ "#Calculation\n",
+ "A=(C*d)/(eo) #calculating area\n",
+ "\n",
+ "#Result\n",
+ "print\"Area=%.2e\"%A,\"m^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area=1.13e+09 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.20,Page no:139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Spherical and plate capacitor\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "A=0.02 #area in m square\n",
+ "r=0.5 #r in m\n",
+ "\n",
+ "#Calculation\n",
+ "d=(A/(4*(math.pi)*r)) #calculating distance\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance between the plates = \",round(d*1000,2),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance between the plates = 3.18 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.21,Page no:139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Capacitance of parallel plate capacitor\n",
+ "\n",
+ "#Variable declaration \n",
+ "eo=8.85*10**-12 #constant\n",
+ "A=1 #area in m square\n",
+ "d=2*10**-3 #r in m\n",
+ "K=4 #constant\n",
+ "\n",
+ "#Calculation\n",
+ "C=(K*eo*A)/d #calculating capacitance\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance = \",C,\"Farad\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance = 1.77e-08 Farad\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.22,Page no:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Capacity with air between plates\n",
+ "\n",
+ "#Variable declaration \n",
+ "cm=10*10**-6 #capacitance in Farad\n",
+ "K=2 #constant\n",
+ "\n",
+ "#Calculation\n",
+ "co=cm/K #calculating co\n",
+ "\n",
+ "#Result\n",
+ "print\"capacity of capacitor with air between the plates= \",co*10**6,\"muF\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "capacity of capacitor with air between the plates= 5.0 muF\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.23,Page no:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Capacitance of combination of capacitors\n",
+ "\n",
+ "#Variable declaration \n",
+ "v=100.0 #v in volt\n",
+ "c1=8.0*10**-6 #capacitance in Farad\n",
+ "c2=12.0*10.0**-6 #capacitance in Farad\n",
+ "c3=24.0*10.0**-6 #capacitance in Farad\n",
+ "cs=4.0/(10.0**6) #calculating series capacitance\n",
+ "\n",
+ "#Calculation\n",
+ "cp=(c1+c2+c3) #calculating parallel capacitance\n",
+ "qs=cs*v #calculating charge\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent Series capacitance,C= \",cs*10**6,\"muF\"\n",
+ "print\"Equivalent parallel capacitance,Cp= \",cp*10**6,\"muF\" \n",
+ "print\"charge on plate=%.e\"%qs,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent Series capacitance,C= 4.0 muF\n",
+ "Equivalent parallel capacitance,Cp= 44.0 muF\n",
+ "charge on plate=4e-04 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.24,Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Electrical energy stored by capacitor\n",
+ "\n",
+ "#Variable declaration \n",
+ "C=9*10**-10 #capacitance in farad\n",
+ "V=100.0 #in volt\n",
+ "\n",
+ "#Calculation\n",
+ "U=(1/2.0)*(C*(V**2)) #calculating energy stored\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy stored = \",U,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy stored = 4.5e-06 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.25,Page no:141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate electrical energy stored by the capacitor\n",
+ "\n",
+ "#Variable declaration \n",
+ "eo=8.85*10**-12 #constant\n",
+ "A=90.0*10**-4 #area in m square\n",
+ "d=2.5*10**-3 #distance in m\n",
+ "V=400.0 #in volt\n",
+ "\n",
+ "#Calculation\n",
+ "C=(eo*A)/d #calculating capacitance\n",
+ "W=(1/2.0)*(C*(V**2)) #calculating electrical energy stored\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance = \",C,\"Farad\"\n",
+ "print\"Electrical Energy stored in capacitor =%.2e\"%W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance = 3.186e-11 Farad\n",
+ "Electrical Energy stored in capacitor =2.55e-06 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.26,Page no:142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Time the capacity after parallel\n",
+ "#Variable declaration \n",
+ "v=100 #v in volt\n",
+ "c1=1*10**-6 #capacitance in Farad\n",
+ "c2=2*10**-6 #capacitance in Farad\n",
+ "c3=3*10**-6 #capacitance in Farad\n",
+ "cs=6/11.0 #calculating series capacitance\n",
+ "\n",
+ "#Calculation\n",
+ "cp=(c1+c2+c3) #calculating parallel capacitance\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent Series capacitance = \",cs,\"muF\"\n",
+ "print\"Equivalent parallel capacitance= \",cp*10**6,\"muF\"\n",
+ "print\"Therefore Cp=(11*Cs)\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent Series capacitance = 0.545454545455 muF\n",
+ "Equivalent parallel capacitance= 6.0 muF\n",
+ "Therefore Cp=(11*Cs)\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:4.27,Page no:143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate work done by battery\n",
+ "#Variable declaration \n",
+ "eo=8.85*10**-12 #constant\n",
+ "V=6 #v in volt\n",
+ "A=25*10**-4 #area in m square\n",
+ "d=10**-3 #distance in m\n",
+ "\n",
+ "#Calculation\n",
+ "q=(eo*A*V)/d #calculating charge\n",
+ "W=q*V #calculating work done\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge through battery =%.3g\"%q,\"C\"\n",
+ "print\"Work done by Battery=%.e\"%W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge through battery =1.33e-10 C\n",
+ "Work done by Battery=8e-10 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 63
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter5.ipynb b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter5.ipynb
new file mode 100644
index 00000000..53a08905
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/Chapter5.ipynb
@@ -0,0 +1,1043 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "UNIT-5 Electricity"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.1,Page no:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate current flowing through a conductor\n",
+ "\n",
+ "#Variable declaration \n",
+ "n=10**6 #no. of electrons\n",
+ "e=1.6*10**-19 #charge on an electron in C\n",
+ "\n",
+ "#Calculation\n",
+ "q=n*e #calculating total charge\n",
+ "t=10**-3 #time in second\n",
+ "I=q/t #calculating current\n",
+ "\n",
+ "#Result\n",
+ "print\"Current flowing = \",I,\"Ampere\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing = 1.6e-10 Ampere\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.2,Page no:152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#No of electrons passing through a lamp\n",
+ "\n",
+ "#Variable declaration \n",
+ "I=300*10**-3 #current n Ampere\n",
+ "t=60 #time in second\n",
+ "e=1.6*10**-19 #chatge on electron in C\n",
+ "\n",
+ "#Calculation\n",
+ "q=I*t #calculating charge\n",
+ "n=q/e #calculating no of electrons\n",
+ "\n",
+ "#Result\n",
+ "print\"No. of electrons = \",n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. of electrons = 1.125e+20\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.3,Page no:154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Frequency of electrons across a conductor\n",
+ "\n",
+ "#Variable declaration \n",
+ "V=200 #voltage in volt\n",
+ "R=100 #resistance in Ohm\n",
+ "e=1.6*10**-19 #charge on an electron in C\n",
+ "\n",
+ "#Calculation\n",
+ "I=V/R #Ohm's law\n",
+ "t=1 #time in second\n",
+ "q=I*t #calculating charge\n",
+ "n=q/e #calculating no of electrons\n",
+ "\n",
+ "#Result\n",
+ "print\"No. of electrons = \",n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. of electrons = 1.25e+19\n"
+ ]
+ }
+ ],
+ "prompt_number": 72
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.4,Page no:156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Resistivity of small wire\n",
+ "\n",
+ "#Variable declaration \n",
+ "l=15 #length in m\n",
+ "A=6*10**-7 #area in m square\n",
+ "R=5 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "p=(A*R)/l #calculating resistivity\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistivity= \",p,\"Ohm metre\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistivity= 2e-07 Ohm metre\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.5,Page no:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Resistivity of a normal wire\n",
+ "\n",
+ "#Variable declaration \n",
+ "l=0.1 #length in m\n",
+ "A=10**-4 #area in m square\n",
+ "R=0.01 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "p=(A*R)/l #calculating resistivity\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistivity = \",p,\"Ohm metre\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistivity = 1e-05 Ohm metre\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.6,Page no:157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Resistivity of a long wire\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "L=1 #length in m\n",
+ "r=0.2*10**-3 #radius in m\n",
+ "R=2 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "A=math.pi*(r)**2 #calculating area\n",
+ "P=(R*A)/L #calculating resistivity\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistivity =%.2g\"%P,\"Ohm.metre\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistivity =2.5e-07 Ohm.metre\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.7,Page no:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#New resistance of a wire after drawn out\n",
+ "\n",
+ "#Variable declaration \n",
+ "R1=5 #resisitance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "#A2=A/3\n",
+ "#R2/5=3l*3/A*A/l\n",
+ "#R2=9*5\n",
+ "\n",
+ "R2=9*R1 #calculating using R2/A1=(l2/A2)*(A1/l1)\n",
+ "print\"Resisitance = \",R2,\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resisitance = 45 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.8,Page no:159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Change in resistance of a wire\n",
+ "\n",
+ "#Variable declaration \n",
+ "R1=5 #resisitance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "#A2=A/2\n",
+ "#R1=rho*l1/A1*R2\n",
+ "#R2=rho*l2/A2\n",
+ "#R2/R1=A1/l1\n",
+ "R2=4*R1 #calculating using R2/A1=(l2/A2)*(A1/l1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Resisitance= \",R2,\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resisitance= 20 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 70
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.9,Page no:162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Total resistance in parallel\n",
+ "\n",
+ "#Variable declaration \n",
+ "R1=2 #resisitance in Ohm\n",
+ "R2=4 #resistance in Ohm\n",
+ "R3=5 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "R=(R1**-1)+(R2**-1)+(R3**-1) #calculating parallel resistance\n",
+ "Rp=(1/R) \n",
+ "\n",
+ "#Result\n",
+ "print\"Resisitance = \",Rp,\"Ohm\"\n",
+ "print\"\\nNOTE:Incorrect answer in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resisitance = 1.05263157895 Ohm\n",
+ "\n",
+ "NOTE:Incorrect answer in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.10,Page no:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Series parallel combination resistance\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "#Variable declaration\n",
+ "Rs=40 #resisitance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "#R1+R2=40\n",
+ "#R1*R2=256\n",
+ "#R1=256/R2\n",
+ "#Putting this value in eq 1:\n",
+ "#(256/R2)+R2=40\n",
+ "from sympy import solve, symbols, pprint\n",
+ "R2= symbols('R2')\n",
+ "a=1\n",
+ "b=-40\n",
+ "c=256\n",
+ "f = a*R2**2 + b*R2 + c\n",
+ "solution = solve(f, R2)\n",
+ "\n",
+ "#Result\n",
+ "print\"When R2=\",solution[0],\"Ohm R1=\",solution[1],\"Ohm\"\n",
+ "print\"When R2=\",solution[1],\"Ohm R1=\",solution[0],\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When R2= 8 Ohm R1= 32 Ohm\n",
+ "When R2= 32 Ohm R1= 8 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.11,Page no:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the valueof current in fig\n",
+ "\n",
+ "#Variable declaration \n",
+ "V=2.0 #in volts\n",
+ "R1=30.0 #resisitance in Ohm\n",
+ "R2=60.0 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=(R1*R2)/(R1+R2) #calculating parallel resistance\n",
+ "I=V/Rp #Ohm's law\n",
+ "\n",
+ "#Result\n",
+ "print\"Resisitance = \",Rp,\"Ohm\"\n",
+ "print\"Current = \",I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resisitance = 20.0 Ohm\n",
+ "Current = 0.1 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.12,Page no:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Combine resistance to get an equivalent resistance\n",
+ "\n",
+ "#Variable declaration \n",
+ "R1=2.0 #resisitance in Ohm\n",
+ "R2=3.0 #resistance in Ohm\n",
+ "R3=1.0 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=(R1*R2)/(R1+R2) #calculating parallel resistance\n",
+ "R=Rp+1.0 #1 Ohm in series\n",
+ "Rs=(R1+R2+R3) #series resistances\n",
+ "Rp=(1.0/R1)+(1.0/R2)+(1.0/R3) #calculating parallel resistance\n",
+ "\n",
+ "#Result\n",
+ "print\"(1)Equivalent Resisitance= \",R,\"Ohm\" \n",
+ "print\"(2)All resistances in series = \",Rs,\"Ohm\"\n",
+ "print\"(3)All in Parallel = \",(1/Rp),\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(1)Equivalent Resisitance= 2.2 Ohm\n",
+ "(2)All resistances in series = 6.0 Ohm\n",
+ "(3)All in Parallel = 0.545454545455 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.13,Page no:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Total resistor of combination\n",
+ "\n",
+ "#Variable declaration \n",
+ "V=20 #voltage in Volts\n",
+ "R1=2.0 #resisitance in Ohm\n",
+ "R2=4.0 #resistance in Ohm\n",
+ "R3=5.0 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=(1/R1)+(1/R2)+(1/R3) #calculating parallel resistance\n",
+ "R=1/Rp #Parallel\n",
+ "I1=V/R1 #calculating current through R1\n",
+ "I2=V/R2 #calculating current through R2\n",
+ "I3=V/R3 #calculating current through R3\n",
+ "I=V/R #calculating total current\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Equivalent Resisitance = \",R,\"Ohm\"\n",
+ "print\"Current through R1 = \",I1,\"Ampere\"\n",
+ "print\"Current through R2 = \",I2,\"Ampere\" \n",
+ "print\"Total current = \",I,\"Ampere\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Equivalent Resisitance = 1.05263157895 Ohm\n",
+ "Current through R1 = 10.0 Ampere\n",
+ "Current through R2 = 5.0 Ampere\n",
+ "Total current = 19.0 Ampere\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.14,Page no:166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate no of resistors form total resistor\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=7 #Total resistanc of combination\n",
+ "\n",
+ "#Calculation\n",
+ "def f(n):\n",
+ " Rp = 6*(1/n) #resistance in parallel\n",
+ " return(R-Rp-5)\n",
+ "n=fsolve(f,1)\n",
+ "\n",
+ "#Result\n",
+ "print\"n=\",n[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n= 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.15,Page no:173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Voltage and current in figure\n",
+ "\n",
+ "#Variable declaration \n",
+ "R1=2 #resistance in Ohm\n",
+ "R2=6 #resistance in Ohm\n",
+ "R3=3 #resistance in Ohm\n",
+ "V=24 #voltage in volts\n",
+ "R=8 #resistance in Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "I=V/R #Ohm's Law\n",
+ "V1=I*R1 #Ohm's Law\n",
+ "V2=I*R2 #Ohm's Law\n",
+ "V3=I*R3 #Ohm's Law\n",
+ "\n",
+ "#Result\n",
+ "print\"Current = \",I,\"Ampere\" \n",
+ "print\"Voltage drop across R1 = \",V1,\"Volts\"\n",
+ "print\"Voltage drop across R2 = \",V2,\"Volts\" \n",
+ "print\"Voltage drop across R3 = \",V3,\"Volts\"\n",
+ "print\"\\nNOTE:Wrong answer of R3 in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current = 3 Ampere\n",
+ "Voltage drop across R1 = 6 Volts\n",
+ "Voltage drop across R2 = 18 Volts\n",
+ "Voltage drop across R3 = 9 Volts\n",
+ "\n",
+ "NOTE:Wrong answer of R3 in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.16,Page no:173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Current through branches of circuit\n",
+ "\n",
+ "#Variable declaration \n",
+ "R=15 #resistance in Ohm\n",
+ "print\"KVL: 16I1+15I2=6 (1)\" #KVL equation\n",
+ "I1=-1.66 #from(1)\n",
+ "I2=2.17 #from (1)\n",
+ "#Calculation\n",
+ "V=(I1+I2)*R #calculating potential difference\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential difference= \",V,\"Volt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "KVL: 16I1+15I2=6 (1)\n",
+ "Potential difference= 7.65 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.17,Page no:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine current in wheatstone bridge\n",
+ "\n",
+ "print\"3I1-I2-1=0 (1)\" #KVL equation\n",
+ "print\"3I1-I2+2I=2 (2)\" #KVL equation\n",
+ "print\"3I1-I1+2I=2 (3)\" #KVL equation\n",
+ "\n",
+ "#Variable declaration\n",
+ "I1=4/17.0 #from (1)(2)(3)through AB \n",
+ "I2=-2/17.0 #from (1)(2)(3)through BD\n",
+ "I=3*I1+I2 #from (1)(2)(3)through main circuit\n",
+ "\n",
+ "#Calculation\n",
+ "Ibc=I1-I2 #calculating current in BC\n",
+ "Iad=I-I1 #calculating current in AD\n",
+ "Idc=I-I1+I2 #calculating current in DC\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in branch BC = \",Ibc,\"Ampere\"\n",
+ "print\"NOTE:Calculation mistake in book while calculating for BC\"\n",
+ "print\"Current in branch AD = \",Iad,\"Ampere\"\n",
+ "print\"Current in branch DC = \",Idc,\"Ampere\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3I1-I2-1=0 (1)\n",
+ "3I1-I2+2I=2 (2)\n",
+ "3I1-I1+2I=2 (3)\n",
+ "Current in branch BC = 0.352941176471 Ampere\n",
+ "NOTE:Calculation mistake in book while calculating for BC\n",
+ "Current in branch AD = 0.352941176471 Ampere\n",
+ "Current in branch DC = 0.235294117647 Ampere\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.18,Page no:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Current through a galvanometer in wheatstone bridge\n",
+ "\n",
+ "#Variable declaration \n",
+ "P=10 #Ohm\n",
+ "Q=3 #Ohm\n",
+ "R=12 #Ohm\n",
+ "S=6 #Ohm\n",
+ "G=20 #Ohm\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "print\"-12I+22I1+IgG=0 (1)\" #KVL\n",
+ "print\"6I-9I1+29Ig=0 (2)\" #KVL\n",
+ "print\"13I1-3Ig=2 (3)\" #KVL\n",
+ "#From above equations\n",
+ "import numpy as np\n",
+ "a = np.array([[-12,22,20],[6,-9,29],[0,13,-3]]) \n",
+ "b = np.array([[0],[0],[2]])\n",
+ "np.linalg.solve(a,b)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print\"Current through Galvanometer = \",round(Ig*1000,2),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-12I+22I1+IgG=0 (1)\n",
+ "6I-9I1+29Ig=0 (2)\n",
+ "13I1-3Ig=2 (3)\n",
+ "Current through Galvanometer = 7.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.19,Page no:179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#% drop in heat in bulb\n",
+ "\n",
+ "#Variable declaration \n",
+ "P=500 #power in Watts\n",
+ "V=200 #voltage in Volts\n",
+ "V1=160 #voltage in Volts\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V**2)/P #using P=V**2*R\n",
+ "P1=(V1**2)/R #calculating power\n",
+ "Dp=500-P1 #drop in heat\n",
+ "D=(Dp*100)/500 #percentage drop\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance= \",R,\"Ohm\"\n",
+ "print\"% Drop in heat production = \",D,\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance= 80 Ohm\n",
+ "% Drop in heat production = 36 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.20,Page no:180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Bulbs connected in parallel\n",
+ "\n",
+ "#Variable declaration\n",
+ "P1=100 #power in Watts\n",
+ "P2=500 #power in Watts\n",
+ "\n",
+ "#Calculation\n",
+ "P=P2/P1 #ratio\n",
+ "\n",
+ "#Result\n",
+ "print \"P=\",P\n",
+ "print\"P>0,I2=5I Therefore I2>I1\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P= 5\n",
+ "P>0,I2=5I Therefore I2>I1\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.21,Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat and light energy produced by bulb on voltage drop\n",
+ "\n",
+ "#Variable declaration \n",
+ "t=1200 #time in second\n",
+ "P=100 #power in Watts\n",
+ "V=230 #voltage in Volts\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V**2)/P #calculating resistance\n",
+ "V1=115 #supply voltage in Volts\n",
+ "E=((V1**2)*t)/R #calculating energy\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy dissipated by bulb = \",E,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy dissipated by bulb = 30000 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 81
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.22,Page no:181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate effeciency of transmission\n",
+ "\n",
+ "#Variable declaration\n",
+ "P=10**4 #power in Watts\n",
+ "V=250 #voltage in Volts\n",
+ "R=0.2 #resistance in ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Pl=((P/V)*(P/V))*R #calculating power loss\n",
+ "print P1\n",
+ "E=P/(Pl+P) #calculating efficiency\n",
+ "\n",
+ "#Result\n",
+ "print\"Percent Efficiency = \",round(E*100),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100\n",
+ "Percent Efficiency = 97.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.23,Page no:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Resistance and current capacity of a lamp\n",
+ "\n",
+ "#Variable declaration \n",
+ "P=100.0 #power in Watts\n",
+ "V=220.0 #voltage in Volts\n",
+ "\n",
+ "#Calculation\n",
+ "I=P/V #Current in Ampere\n",
+ "R=V/I #resistance\n",
+ "\n",
+ "#Result\n",
+ "print\"Current = \",round(I,3),\"A\" \n",
+ "print\"Resistance=\",R,\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current = 0.455 A\n",
+ "Resistance= 484.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example no:5.24,Page no:182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Resistance of windings of electric motor\n",
+ "\n",
+ "#Variable declaration \n",
+ "V=50 #voltage in Volts\n",
+ "I=12 #Current in Ampere\n",
+ "\n",
+ "#Calculation\n",
+ "P=V*I #power\n",
+ "Pd=P*0.7 #power dissipated\n",
+ "R=(Pd/(I)**2) \n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance = \",round(R,2),\"Ohm\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance = 2.92 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/README.txt b/A_Comprehensive_Textbook_Of_Applied_Physics_/README.txt
new file mode 100644
index 00000000..121834de
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Deepak Shakya
+Course: btech
+College/Institute/Organization: DCRUST
+Department/Designation: Chemical Engg
+Book Title: A Comprehensive Textbook Of Applied Physics
+Author: M. Kumar
+Publisher: Abhishek Publications,Chandigarh
+Year of publication: 2009
+Isbn: 978-81-8247-226-6
+Edition: 1 \ No newline at end of file
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k1.png b/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k1.png
new file mode 100644
index 00000000..995e3ebf
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k1.png
Binary files differ
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k2.png b/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k2.png
new file mode 100644
index 00000000..f0b1ec67
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k2.png
Binary files differ
diff --git a/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k3.png b/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k3.png
new file mode 100644
index 00000000..90f96617
--- /dev/null
+++ b/A_Comprehensive_Textbook_Of_Applied_Physics_/screenshots/k3.png
Binary files differ
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/README.txt b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/README.txt
new file mode 100644
index 00000000..38541c7e
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Giriraj Dodiya
+Course: mca
+College/Institute/Organization: Freelancer
+Department/Designation: Freelancer
+Book Title: A Textbook Of Chemical Engineering Thermodynamics
+Author: K. V. Narayanan
+Publisher: Prentice Hall Of India, New Delhi
+Year of publication: 2011
+Isbn: 978-81-203-1732-1
+Edition: 15th \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb
new file mode 100644
index 00000000..e56a9323
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch1.ipynb
@@ -0,0 +1,378 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction and Basic Concepts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page no:5 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#To find mans mass and weight on earth\n",
+ "\n",
+ "# Variables\n",
+ "F = 300; \t\t\t #[N]\n",
+ "g_local = 4.5; \t\t\t#local gravitational acceleration[m/s**2]\n",
+ "g_earth = 9.81; \t\t#earth's gravitational acceleration[m/s**2]\n",
+ "\n",
+ "# Calculations\n",
+ "#To find man's mass and weight on earth\n",
+ "m = F/g_local;\t\t\t#mass of man[kg]\n",
+ "w = m*g_earth; \t\t\t# weight of man on earth[N]\n",
+ "\n",
+ "# Results\n",
+ "print 'Mass of man is %f kg'%m\n",
+ "print '\\nWeight of man on earth is %f N'%w\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of man is 66.666667 kg\n",
+ "\n",
+ "Weight of man on earth is 654.000000 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page no:6 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find height of manometer fluid\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1.15*10**5; \t\t\t#measured pressure[N/m**2]\n",
+ "p2 = 1.01325*10**5; \t\t#atmospheric pressure[N/m**2]\n",
+ "rho = 2.95*10**3; \t\t\t#specific gravity of fluid\n",
+ "g = 9.8067\n",
+ "\n",
+ "# Calculations\n",
+ "#To find height of manometer fluid\n",
+ "p = p1-p2; \t \t\t#difference in pressure\n",
+ "h = p/(rho*g); \t\t\t#height of manometer fluid[m]\n",
+ "\n",
+ "# Results\n",
+ "print 'Height of manometer fluid is %f m'%h\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of manometer fluid is 0.472697 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page no:8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find height from ground and Kinetic Energy\n",
+ "\n",
+ "# Variables\n",
+ "PE = 1.5*10**3; \t#potential energy[J]\n",
+ "m = 10; \t\t\t#mass in kg\n",
+ "u = 50; \t\t\t# velocity in m/s\n",
+ "g = 9.8067\n",
+ "\n",
+ "# Calculations\n",
+ "h = PE/(m*g);\t\t\t# height from ground in m\n",
+ "#Using equation 1.9 (Page no. 8)\n",
+ "KE = 0.5*m*(u**2);\t\t\t# Kinetic energy in J\n",
+ "\n",
+ "# Results\n",
+ "print 'Height from ground is %f m'%h\n",
+ "print '\\nKinetic Energy of body is %3.2e J'%KE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height from ground is 15.295665 m\n",
+ "\n",
+ "Kinetic Energy of body is 1.25e+04 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4, Page no:9 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the power developed in man\n",
+ "\n",
+ "# Variables\n",
+ "#Given\n",
+ "F = 600.; \t\t\t#weight in N\n",
+ "t = 120.; \t\t\t#time in sec\n",
+ "h = 0.18; \t\t\t#height of stairs in m\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the power developed in man\n",
+ "S = 20*h; \t\t\t#total vertical displacement in m\n",
+ "W = F*S; \t\t\t#work done in J\n",
+ "P = W/t; \t\t\t#power developed\n",
+ "\n",
+ "# Results\n",
+ "print 'Power developed is %i W'%P\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power developed is 18 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5, Page no:9 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the force exerted pressure work done and change in potential energy\n",
+ "\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "A = (math.pi/4)*(0.1**2); \t\t\t#area in m**2\n",
+ "P = 1.01325*10**5; \t\t\t#pressure in N/m**2\n",
+ "m = 50; \t\t\t#mass of piston and weight in kg\n",
+ "g = 9.81; \t\t\t#acceleration due to gravity (N/m**2)\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine the force exerted pressure work done and change in potential energy\n",
+ "#(a)\n",
+ "Fa = P*A; \t\t\t#force exerted by atmosphere in N\n",
+ "Fp = m*g; \t\t\t#force exerted by piston and weight in N\n",
+ "F = Fp+Fa; \t\t\t#total force exerted in N\n",
+ "print 'Total force exerted by the atmosphere, the piston and the weight is %f N'%F\n",
+ "\n",
+ "#(b)\n",
+ "Pg = F/A; \t\t\t#pressure of gas in N/m**2\n",
+ "print 'Pressure of gas is %5.4e N/m^2'%Pg\n",
+ "\n",
+ "#(c)\n",
+ "S = 0.4; \t\t\t#displacement of gas in m\n",
+ "W = F*S; \t\t\t#work done by gas in J\n",
+ "print 'Work done by gas is %f J'%W\n",
+ "\n",
+ "#(d)\n",
+ "PE = m*g*S; \t\t\t#change in potential energy in J\n",
+ "print 'Change in potential energy is %f J'%PE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total force exerted by the atmosphere, the piston and the weight is 1286.304689 N\n",
+ "Pressure of gas is 1.6378e+05 N/m^2\n",
+ "Work done by gas is 514.521876 J\n",
+ "Change in potential energy is 196.200000 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6, Page no:10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine work done by gas\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "#P =(2*10**5)*D\n",
+ "Df = 2.5; \t\t\t#final diameter (m)\n",
+ "Di = 0.5; \t\t\t#initial diameter(m)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine work done by gas\n",
+ "W = (math.pi/4)*10**5*((Df**4)-Di**4);\n",
+ "\n",
+ "# Results\n",
+ "print 'Work done by gas is %6.4e J'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done by gas is 3.0631e+06 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7, Page no:19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the work done on surrounding\n",
+ "\n",
+ "# Variables\n",
+ "T = 300.; \t\t\t #temperature in K\n",
+ "P = 6.5*10**5; \t\t\t#pressure in N/m**2\n",
+ "Pa = 1.01325*10**5; \t#atmospheric pressure in N/m**2\n",
+ "R = 8.314; \t\t\t #ideal gas constant\n",
+ "m = 2.; \t\t\t #mass of gas (kg)\n",
+ "M = 44.; \t\t\t #molecular weihgt of gas\n",
+ "\n",
+ "# Calculations\n",
+ "#To find the work done on surrounding\n",
+ "n = m/M; \t\t\t # n is number of kmoles\n",
+ "Vi = (n*R*10**3*T)/P; \t\t\t# initial volume in m**3\n",
+ "Vf = 2*Vi; \t\t \t#final volume in m**3\n",
+ "V = Vf-Vi; \t\t\t #change in volume\n",
+ "Ps = Pa+(5000*9.8067); \t\t\t#pressure on surroundings\n",
+ "W = Ps*V; \t\t\t #work done on the surroundings\n",
+ "\n",
+ "# Results\n",
+ "print 'Work done on surroundings is %5.2e J'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done on surroundings is 2.62e+04 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from scipy import integrate\n",
+ "\n",
+ "#Taking 3rd and 2nd order derivative respectively, we get the following expression \n",
+ "#x = ((2*10**5*math.pi)/2)*\n",
+ "D = lambda x: x**3\n",
+ "integ,err = integrate.quad(D,0.5,2.5)\n",
+ "print integ\n",
+ "#integ,err = integrate.quad(D**3,0.5,2.5)\n",
+ "#print integ"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch2.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch2.ipynb
new file mode 100644
index 00000000..d5f58800
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch2.ipynb
@@ -0,0 +1,710 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : First Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1, Page no:26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find change in internal energy\n",
+ "\n",
+ "# Variables\n",
+ "#Given\n",
+ "W = -2.25*745.7; \t\t\t#work done on system in J/s\n",
+ "Q = -3400.*(10.**3)/3600; \t\t\t#heat transferred to the surrounding in J/s\n",
+ "\n",
+ "# Calculations\n",
+ "#To find the change in internal energy\n",
+ "#Using equation 2.4 (Page no. 26)\n",
+ "U = Q-W; \t\t\t#change in internal energy in J/s\n",
+ "\n",
+ "# Results\n",
+ "print 'Internal energy of system increases by %f J/s'%U\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Internal energy of system increases by 733.380556 J/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2, Page no:26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find heat liberated work done and change in internal energy\n",
+ "\n",
+ "#Given\n",
+ "T = 298.; \t\t\t#temperature in K\n",
+ "P = 101.; \t \t\t#pressure in kPa\n",
+ "n_iron = 2.; \t\t\t#moles of iron reacted\n",
+ "Q = -831.08; \t\t\t#heat liberated in kJ\n",
+ "R = 8.314; \t\t \t#ideal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To find heat liberated work done and change in internal energy\n",
+ "print 'Heat liberated during the reaction is %f kJ'%Q\n",
+ "n_oxygen = 1.5; \t\t\t#moles of oxygen reacted\n",
+ "\n",
+ "#Using ideal gas equation P(Vf-Vi)=nRT and W=P(Vf-Vi)\n",
+ "W = -1.5*R*T; \t\t \t#work done by system in J\n",
+ "\n",
+ "#Using equation 2.4 (Page no. 26)\n",
+ "U = (Q*10**3)-W; \t\t\t#change in internal energy in J\n",
+ "print 'Work done by gas is %f J'%W\n",
+ "print 'Change in internal energy is %6.3e J'%U\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat liberated during the reaction is -831.080000 kJ\n",
+ "Work done by gas is -3716.358000 J\n",
+ "Change in internal energy is -8.274e+05 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3, Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the heat energy dissipated by brakes\n",
+ "\n",
+ "# Variables\n",
+ "#Given\n",
+ "u = 20.; \t\t\t#speed of car in m/s\n",
+ "z = 30.; \t\t\t#height vertically above the bottom of hill in m\n",
+ "m = 1400.; \t\t\t#mass of car in kg\n",
+ "g = 9.81; #acceleration due to gravity \n",
+ "\n",
+ "# Calculations\n",
+ "#To find the heat energy dissipated by brakes\n",
+ "#Using equation 2.3 (Page no. 26)\n",
+ "KE = -0.5*m*(u**2); \t\t\t#change in kinetic energy in J\n",
+ "PE = -m*g*z; \t \t\t#change in potential energy in J\n",
+ "Q = -(KE+PE); \t\t\t#heat dissipated by brakes in J\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat dissipated by brakes is %3.2e J'%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat dissipated by brakes is 6.92e+05 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4, Page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find internal energy change during each step and work done during adiabatic process\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "#For step 1\n",
+ "W1 = -50.; \t\t\t#work received in J\n",
+ "Q1 = -25.; \t\t\t#heat gven out in J\n",
+ "\n",
+ "# Calculations and Results\n",
+ "U1 = Q1-W1; \t\t\t#internal energy change in J\n",
+ "print 'Change in internal energy for constant pressure process is %i J'%U1\n",
+ "\n",
+ "#For step 2\n",
+ "W2 = 0.; \t\t\t#work done for constant volume process is zero\n",
+ "Q2 = 75.; \t\t\t#heat received in J\n",
+ "U2 = Q2; \t\t\t#internal energy change in J\n",
+ "print 'Change in internal energy for constant volume process is %i J'%U2\n",
+ "\n",
+ "#For step 3\n",
+ "Q3 = 0.; \t\t\t#no heat exchange in adiabatic process\n",
+ "#Since the process is cyclic\n",
+ "#U3+U2+U1 = 0;\n",
+ "U3 = -(U1+U2);\n",
+ "W3 = -U3; \t\t\t#work done in J\n",
+ "print 'Work done during adiabatic process is %i J'%W3\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in internal energy for constant pressure process is 25 J\n",
+ "Change in internal energy for constant volume process is 75 J\n",
+ "Work done during adiabatic process is 100 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5, Page no:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find change in internal energy and enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "n_water = 10.**3; \t\t\t#moles of water\n",
+ "T = 373.; \t\t\t #tempearture(K)\n",
+ "P = 101.3; \t\t\t #pressure(kPa)\n",
+ "sv_liquid = 0.00104; \t\t#specific volume of liquid(m**3/kmol)\n",
+ "sv_vapour = 1.675; \t\t\t#specific volume of vapour(m**3/kmol)\n",
+ "Q = 1.03*10**3; \t\t\t#heat added in kJ\n",
+ " \n",
+ "#To find change in internal energy and enthalpy\n",
+ "W = P*n_water*(sv_vapour-sv_liquid)*10**-3; \t\t\t#expansion work done in kJ\n",
+ "U = Q-W; \t\t\t #change in internal energy in kJ\n",
+ "#For constant pressure process\n",
+ "H = Q; \t\t\t #enthalpy change in kJ\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in internal energy is %f kJ'%U\n",
+ "print 'Change in enthalpy is %3.2e J'%H\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in internal energy is 860.427852 kJ\n",
+ "Change in enthalpy is 1.03e+03 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6, Page no:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find internal energy of saturated liquid and internal energy and enthalpy of saturated vapour\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 233.; \t\t\t #temperature in K\n",
+ "VP = 1.005*10**3; \t\t\t #vapour pressure of CO2 in kPa\n",
+ "sv_liquid = 0.9*10**-3; \t\t\t#specific volume of liquid CO2 in m**3/kg\n",
+ "sv_vapour = 38.2*10**-3; \t\t\t#specicific volume of CO2 vapour in m**3/kg\n",
+ "L = 320.5; \t\t\t #latent heat of vaporisation of CO2 in kJ/kg\n",
+ "#Assuming at these conditions CO2 is saturated liquid so\n",
+ "H1 = 0; \t\t\t #enthalpy in liquid state\n",
+ "\n",
+ "# Calculations\n",
+ "#To find internal energy of saturated liquid and internal energy and enthalpy of saturated vapour\n",
+ "#For saturated liquid\n",
+ "U1 = H1-(VP*sv_liquid); \t\t\t# internal energy in liquid state in kJ/kg\n",
+ "#For saturated vapour\n",
+ "Hv = H1+L; \t\t\t #enthalpy of saturated vapour in kJ/kg\n",
+ "Uv = Hv-(VP*sv_vapour); \t\t\t#internal energy in vapour state in kJ/kg\n",
+ "\n",
+ "# Results\n",
+ "print 'Internal Energy of saturated liquid is %f kJ/kg'%U1\n",
+ "print 'Enthalpy of vapour state is %f kJ/kg'%Hv\n",
+ "print 'Internal Energy of vapour state is %f kJ/kg'%Uv\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Internal Energy of saturated liquid is -0.904500 kJ/kg\n",
+ "Enthalpy of vapour state is 320.500000 kJ/kg\n",
+ "Internal Energy of vapour state is 282.109000 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7, Page no:30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate molar internal energy change and molar enthalpy change\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "I = 0.5; \t\t\t#current in Amperes\n",
+ "V = 12.; \t\t\t#voltage in volts\n",
+ "t = 5*60.; \t\t\t#time in sec\n",
+ "m = 0.798; \t\t\t#mass of water vaporised in g\n",
+ "M = 18.; \t\t\t#molecular mass of water in g\n",
+ "R = 8.314*10**-3 #ideal gas constant\n",
+ "T = 373 #temperature\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate molar internal energy change and molar enthalpy change\n",
+ "Q = (I*V*t/1000.); \t\t\t#electric energy supplied in kJ\n",
+ "#Referring equation 2.10 (Page no. 29)\n",
+ "H = (Q*M)/m; \t\t\t#molar enthalpy change in kJ/mole\n",
+ "\n",
+ "#BY ideal gas equation PV=RT\n",
+ "#Referring equation 2.9 for constant pressure process (Page no. 29)\n",
+ "U = H-(R*T); \t\t\t#molar internal energy change in kJ/mole\n",
+ "\n",
+ "# Results\n",
+ "print 'Molar Enthalpy change during the process is %i kJ/mole'%H\n",
+ "print 'Molar Interanl Energy change during the process is %f kJ/mole'%U\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar Enthalpy change during the process is 40 kJ/mole\n",
+ "Molar Interanl Energy change during the process is 37.500382 kJ/mole\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8, Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the theoretical horsepower developed\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m = 1650.; \t\t\t#mass of steam used in kg/hr\n",
+ "H1 = 3200.; \t\t\t#enthalpy at 1368 kPa and 645 K in kJ/kg\n",
+ "H2 = 2690.; \t\t\t#enthalpy at 137 kPa and 645 K in kJ/kg\n",
+ "\n",
+ "#To determine the theoretical horsepower developed\n",
+ "#Using equation 2.13 (Page no.32)\n",
+ "Q = 0; \t\t\t#since the process is adiabatic\n",
+ "z = 0; \t\t\t#assuming that inlet and discharge of turbine are at same level\n",
+ "u = 0; \t\t\t#feed and discharge velocities being equal\n",
+ "\n",
+ "# Calculations\n",
+ "Ws = -(H2-H1);\n",
+ "Wj = Ws*10**3*m/3600.; \t\t\t#work done by turbine in J\n",
+ "W = Wj/745.7; \t\t\t#work done by turbine in hp\n",
+ "\n",
+ "# Results\n",
+ "print 'Work done by turbine is %f hp'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done by turbine is 313.463859 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9, Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find temperature of water delivered to second storage tank\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m = 25.*10**3; \t\t#mass flow rate of water in kg/h\n",
+ "P = 2.; \t\t\t#power supplied by motor in hp\n",
+ "q = 42000.; \t\t#heat given in kJ/min\n",
+ "z = 20.; \t\t\t#elevation in m\n",
+ "T = 368.; \t\t\t#temperature in K\n",
+ "To = 273.; \t\t\t#standard temperature in K\n",
+ "Cp = 4.2; \t\t\t#specific heat of water in kJ/kg K\n",
+ "g = 9.81 #acceleration due to gravity(m/s^2)\n",
+ "\n",
+ "# Calculations\n",
+ "#To find temperature of water delivered to second storage tank\n",
+ "W = (P*745.7*10**-3*3600)/m; \t\t\t#work done per kg of water pumped in kJ/kg\n",
+ "Q = q*60./m; \t\t\t #heat given out per kg of fluid\n",
+ "PE = g*z*10**-3; \t\t\t #change in potential energy in kJ/kg\n",
+ "\n",
+ "#Using equation 2.13 (Page no. 32)\n",
+ "H = -Q+W-PE;\n",
+ "#H = H2-H1\n",
+ "H1 = Cp*(T-To);\n",
+ "H2 = H1+H;\n",
+ "#Let T1 be the temperature at second storage tank\n",
+ "T1 = To+(H2/Cp);\n",
+ "\n",
+ "# Results\n",
+ "print 'Temperature of water at second storage tank is %i K'%T1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of water at second storage tank is 344 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10, Page no:33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find change in enthalpy and maximum enthalpy change\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "D1 = 25.; \t\t\t#internal diameter of pipe in mm\n",
+ "u1 = 10.; \t\t\t#upstream velocity in m/s\n",
+ "D2 = 50.; \t\t\t#downstream diameter of pipe in mm\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)\n",
+ "#Let A1 nad A2 be upstream and downstream crosssectional areas of pipe\n",
+ "u2 = ((D1/D2)**2)*u1; \t\t\t#downstream velocity in m/s\n",
+ "H = 0.5*(u1**2-u2**2); \t\t\t#change in enthalpy in J/kg\n",
+ "print 'Change in enthalpy is %f J/kg'%H\n",
+ "\n",
+ "#(b)\n",
+ "#For maximum enthalpy change \n",
+ "u2 = 0;\n",
+ "Hmax = 0.5*u1**2; \t\t\t#(J/kg)\n",
+ "print 'Maximum enthalpy chnage for a sudden enlargement in pipe is %f J/kg'%Hmax\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in enthalpy is 46.875000 J/kg\n",
+ "Maximum enthalpy chnage for a sudden enlargement in pipe is 50.000000 J/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11, Page no:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine heat transfer rates\n",
+ "\n",
+ "# Variables\n",
+ "#At inlet:\n",
+ "T1 = 293.; \t\t\t#Temperature(K)\n",
+ "P1 = 300+136.8; \t\t\t#Pressure(kPa)\n",
+ "#At exit:\n",
+ "T2 = 453.; \t\t\t#Temperature(K)\n",
+ "P2 = 136.8; \t\t\t#Pressure(kPa)\n",
+ "Cp = 29.4; \t \t\t#specific heat capacity at constant pressure in kJ/kmol\n",
+ "m = 1000.; \t\t \t#mass of hydrogen in kg\n",
+ "M = 2.02; \t\t\t #molecular mass of hydrogen\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine heat transfer rates\n",
+ "#Neglecting the kinetic nd potential energy changes\n",
+ "#Assuming the process to be occuring through a number of steps\n",
+ "#Step 1 be isothermal and step 2 be isobaric\n",
+ "H1 = 0; \t\t\t#change in enthalpy for step 1\n",
+ "H2 = (m/M)*Cp*(T2-T1)/1000; \t\t\t#change in enthalpy for step 2 in kJ\n",
+ "H = H2+H1;\n",
+ "Q = H; \t\t\t#heat transferred in coils in kJ\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat transferred in coils is %f kJ'%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transferred in coils is 2328.712871 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12, Page no:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find change in internal energy enthalpy heat supplied and work done\n",
+ "\n",
+ "#Given:\n",
+ "m = 10.; \t\t\t#mass of air in kg\n",
+ "P1 = 100.; \t\t\t#initial pressure(kPa)\n",
+ "T1 = 300.; \t\t\t#initial temperature(K)\n",
+ "T2 = 600.; \t\t\t#final temperature(K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant(kJ/kmol K)\n",
+ "Cp = 29.099;\t\t#specific heat capacity at constant pressure (kJ/kmol K)\n",
+ "Cv = 20.785;\t\t#specific heat capacity at constsant volume (kJ/kmol K)\n",
+ "M = 29.; \t\t\t#molecular weight of air\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine change in internal energy enthalpy heat supplied and work done\n",
+ "n = m/M; \t \t\t#number of moles of gas(kmol)\n",
+ "V1 = (n*R*T1)/P1; \t\t\t#initial volume of air (m**3)\n",
+ "\n",
+ "#(a)\n",
+ "#Constant volume process\n",
+ "V2 = V1 \t\t\t#final volume\n",
+ "#Change in internal energy U = n*intg(CvdT)...so\n",
+ "U = n*Cv*(T2-T1); \t\t\t#change in internal energy(kJ)\n",
+ "Q = U; \t\t\t #heat supplied(kJ)\n",
+ "W = 0; \t\t\t #work done\n",
+ "H = U+(n*R*(T2-T1)); \t\t#change in enthalpy(kJ)\n",
+ "print 'For constant volume process'\n",
+ "print 'Change in internal energy is %i kJ'%U\n",
+ "print 'Heat supplied is %i kJ'%Q\n",
+ "print 'Work done is %i kJ'%W\n",
+ "print 'Change in enthalpy is %i kJ'%H\n",
+ "\n",
+ "# (b)\n",
+ "# Constant pressure process\n",
+ "# Change in enthalpy H = n*intg(CpdT)...so \n",
+ "H = n*Cp*(T2-T1); \t\t\t#change in enthalpy(kJ)\n",
+ "Q = H;\t\t\t#heat supplied(kJ)\n",
+ "U = H-(n*R*(T2-T1));\t\t\t#change in internal energy(kJ)\n",
+ "W = Q-U; \t\t\t#work done(kJ)\n",
+ "print 'For constant pressure process'\n",
+ "print 'Change in internal energy is %i kJ'%U\n",
+ "print 'Heat supplied is %i kJ'%Q\n",
+ "print 'Work done is %i kJ'%W\n",
+ "print 'Change in enthalpy is %i kJ'%H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For constant volume process\n",
+ "Change in internal energy is 2150 kJ\n",
+ "Heat supplied is 2150 kJ\n",
+ "Work done is 0 kJ\n",
+ "Change in enthalpy is 3010 kJ\n",
+ "For constant pressure process\n",
+ "Change in internal energy is 2150 kJ\n",
+ "Heat supplied is 3010 kJ\n",
+ "Work done is 860 kJ\n",
+ "Change in enthalpy is 3010 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13, Page no:36\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine change in internal energy and change in enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "R = 8.314; \t\t\t#ideal gas constant(kJ/kmol K)\n",
+ "Cv = 20.8; \t\t\t#specific heat capacity at constant volume(kJ/kmol K)\n",
+ "Cp = 29.1; \t\t\t#specific heat capacity at constant pressure(kJ/kmol K)\n",
+ "P1 = 10.; \t\t\t#initial pressure(bar)\n",
+ "T1 = 280.; \t\t\t#initial temperature in K\n",
+ "P2 = 1.; \t\t\t#final pressure(bar)\n",
+ "T2 = 340.; \t\t\t#final temperature(K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the change in internal energy and change in enthalpy\n",
+ "#Solution\n",
+ "n = 1 \t\t\t#basis: 1 kmol of ideal gas\n",
+ "V1 = (n*R*T1)/(P1*100); \t\t\t#initial volume in m**3\n",
+ "V2 = (n*R*T2)/(P2*100); \t\t\t#final volume in m**3\n",
+ "\n",
+ "Po = P2; \n",
+ "Vo = V1;\n",
+ "To = (Po*100*Vo)/(n*R);\n",
+ "U1 = Cv*(To-T1);\n",
+ "H1 = U1+(V1*100*(P2-P1));\n",
+ "W1 = 0;\n",
+ "Q1 = U1;\n",
+ "\n",
+ "H2 = Cp*(T2-To);\n",
+ "U2 = H2-100*(V2-V1);\n",
+ "Q2 = H2;\n",
+ "W2 = Q2-U2;\n",
+ "#For actual process\n",
+ "U = U1+U2; \t\t\t#change in internal energy(kJ)\n",
+ "H = H1+H2; \t\t\t#change in enthalpy(kJ)\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in internal energy is %f kJ'%U\n",
+ "print 'Change in enthalpy is %f kJ'%H\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in internal energy is 1243.632000 kJ\n",
+ "Change in enthalpy is 1742.472000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch3.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch3.ipynb
new file mode 100644
index 00000000..4e689d3d
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch3.ipynb
@@ -0,0 +1,724 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : PVT Behaviour And Heat Effects"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1, , Page no:45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the molar volume of air\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 350.; \t\t\t#temperature in K\n",
+ "P = 10.**5; \t\t\t#pressure in N/m**2\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To find the molar volume of air\n",
+ "V = (R*T)/P; \t\t\t#molar volume in m**3\n",
+ "\n",
+ "# Results\n",
+ "print 'Molar volume of air is %3.2e cubic m/mol'%V\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar volume of air is 2.91e-02 cubic m/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page no:50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine heat and work effects for each step\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "Cp = 29.3; \t\t\t#specific heat at constant pressure(kJ/kmol K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine heat and work effects for each step\n",
+ "#Step 1: Gas is heated at constant volume\n",
+ "T1 = 300.; \t\t \t#temperature in K\n",
+ "P1 = 1.; \t \t\t #initial pressure in bar\n",
+ "P2 = 2.; \t\t \t #final pressure in bar\n",
+ "T2 = (P2/P1)*T1; \t\t\t#final temperature in K\n",
+ "Cv = Cp-R; \t \t \t#specific heat at constant volume\n",
+ "W1 = 0; \t\t \t #work done is zero as volume remains constant\n",
+ "Q1 = Cv*(T2-T1); \t\t\t#heat supplied in kJ/kmol\n",
+ "print 'For step 1'\n",
+ "print 'Work done in step 1 is %i'%W1\n",
+ "print 'Heat supplied in step 1 is %f kJ/kmol'%Q1\n",
+ "\n",
+ "#Step 2: The process is adiabatic\n",
+ "Q2 = 0.; \t\t\t#the process is adiabatic\n",
+ "P3 = 1.; \t\t\t#pressure after step 2 in bar\n",
+ "gama = (Cp/Cv);\n",
+ "T3 = ((P3/P2)**((gama-1)/gama))*T2; \t\t\t#temperature after step 2\n",
+ "W2 = (Cv*(T2-T3)); \t\t\t#work done by system\n",
+ "print 'For step 2'\n",
+ "print 'Heat supplied in step 2 is %i'%Q2\n",
+ "print 'Work done by system in step 2 is %f kJ/kmol'%W2\n",
+ "\n",
+ "#Step 3: The process is isobaric\n",
+ "T4 = 300.; \t\t\t#temperature after step 3 (K)\n",
+ "Q3 = Cp*(T4-T3); \t\t\t#heat supplied during step 3(kJ/kmol)\n",
+ "U = (Cv*(T4-T3)); \t\t\t#change in internal energy during step 3(kJ/kmol)\n",
+ "W3 = Q3-U; \t\t\t#Using first law of thermodynamics\n",
+ "print 'For step 3'\n",
+ "print 'Heat given out by the system in step 3 is %f kJ/kmol'%Q3\n",
+ "print 'Work done on the system in step 3 is %f kJ/kmol'%W3\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For step 1\n",
+ "Work done in step 1 is 0\n",
+ "Heat supplied in step 1 is 6295.800000 kJ/kmol\n",
+ "For step 2\n",
+ "Heat supplied in step 2 is 0\n",
+ "Work done by system in step 2 is 2248.222546 kJ/kmol\n",
+ "For step 3\n",
+ "Heat given out by the system in step 3 is -5651.101658 kJ/kmol\n",
+ "Work done on the system in step 3 is -1603.524204 kJ/kmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate change in internal energy change in enthalpy work done and heat supplied\n",
+ "\n",
+ "#Given:\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "Cp = 30.; \t\t\t#specific heat at constant pressure(J/mol K)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate change in internal energy change in enthalpy work done and heat supplied\n",
+ "import math\n",
+ "#(a): Gas is expanded isothermally\n",
+ "T = 600.; \t\t\t#temperature in K\n",
+ "P1 = 5.; \t\t\t#initial pressure in bar\n",
+ "P2 = 4.; \t\t\t#final pressure in bar\n",
+ "U1 = 0; \t\t\t#since the process is isothermal\n",
+ "H1 = 0; \t\t\t#since the process is isothermal\n",
+ "W1 = (R*T*math.log(P1/P2)); \t\t\t#work done during the process\n",
+ "Q1 = W1; \t\t\t#heat supplied during the process\n",
+ "print 'When gas is expanded isothermally'\n",
+ "print 'Change in internal energy in isothermal process is %i'%U1\n",
+ "print 'Change in enthalpy in isothermal process is %i'%H1\n",
+ "print \"Work done during the process is %f kJ/kmol\"%W1\n",
+ "print 'Heat supplied during the process is %f kJ/kmol'%Q1\n",
+ "\n",
+ "#(b): Gas is heated at constant volume\n",
+ "V = 0.1; \t\t\t#volume (m**3)\n",
+ "P1 = 1.; \t\t\t#initial pressure(bar)\n",
+ "T1 = 298.; \t\t\t#initial temperature(K)\n",
+ "T2 = 400.; \t\t\t#final temperature(K)\n",
+ "n = ((P1*V*10**5)/(R*T1)); \t\t\t#number of moles of gas\n",
+ "Cv = Cp-R; \t\t\t#specific heat at constant volume(J/mol K)\n",
+ "ans = round(Cv*(T2-T1))\n",
+ "n = round(n,2)\n",
+ "U2 = n*ans #Cv*round(T2-T1); \t\t\t#change in internal energy(J)\n",
+ "H2 = n*Cp*(T2-T1); \t\t\t#change in enthalpy(J)\n",
+ "W2 = 0; \t\t\t#isochoric process\n",
+ "Q2 = U2+W2; \t\t\t#heat supplied(J)\n",
+ "print '\\nWhen gas is heated at constant volume'\n",
+ "print 'Change in internal energy is %.0f J'%U2\n",
+ "print 'Change in enthalpy is %f J'%H2\n",
+ "print 'Work done during the process is %i '% W2\n",
+ "print 'Heat supplied during the process is %.0f J'%Q2\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When gas is expanded isothermally\n",
+ "Change in internal energy in isothermal process is 0\n",
+ "Change in enthalpy in isothermal process is 0\n",
+ "Work done during the process is 1113.129291 kJ/kmol\n",
+ "Heat supplied during the process is 1113.129291 kJ/kmol\n",
+ "\n",
+ "When gas is heated at constant volume\n",
+ "Change in internal energy is 8936 J\n",
+ "Change in enthalpy is 12362.400000 J\n",
+ "Work done during the process is 0 \n",
+ "Heat supplied during the process is 8936 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5, Page no:52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine work done and amount of heat transferred\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "\n",
+ "def Cv(T):\n",
+ " y = 27.4528+(6.1839*(10**-3)*T)-(8.9932*(10**-7)*(T**2))-R;\n",
+ " return y\n",
+ "\n",
+ "# Variables\n",
+ "m = 20.; \t\t\t#mass of air(kg)\n",
+ "n = 1.25; \t\t\t#polytropic constant\n",
+ "P1 = 1.; \t\t\t#initial pressure(bar)\n",
+ "P2 = 5.; \t\t\t#final pressure(bar)\n",
+ "T1 = 300.; \t\t\t#temperature(K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "M = 29.; \t\t\t#molecular wt of air\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine work done and amount of heat transferred\n",
+ "#(a): Work done by the compressor per cycle\n",
+ "n_mole = m/M; \t\t\t#moles of air(kmol)\n",
+ "V1 = ((n_mole*10**3*R*T1)/(P1*10**5)); \t\t\t#initial volume(m**3)\n",
+ "V2 = (V1*((P1/P2)**(1/n))); \t\t\t #final volume(m**3)\n",
+ "\n",
+ "#Since the process is polytropic P(V**n)=c(say constant)\n",
+ "c = P1*10**5*(V1**n); \n",
+ "\t\t\t#function[z] = f(V);\n",
+ "\t\t\t# z = c/(V**1.25);\n",
+ "\t\t\t#W1 = intg(V1,V2,f); so\n",
+ "W = (c/(1-n))*((V2**(-n+1))-(V1**(-n+1)))/1000;\n",
+ "print 'Work done by compressor is %4.3e J'%(W*1000);\n",
+ "\n",
+ "#(b): Amount of heat transferred to surrounding\n",
+ "T2 = ((T1*V2*P2)/(V1*P1)); \t\t\t#final temp in K\n",
+ "U1 = quad(Cv,T1,T2)[0];\n",
+ "U = U1*n_mole; \t\t\t #change in internal energy(kJ)\n",
+ "Q = U+W; \t\t\t #heat supplied\n",
+ "\n",
+ "# Results\n",
+ "print 'Chnage in internal energy is %f kJ'%U\n",
+ "print 'Heat supplied is %f kJ'%Q\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done by compressor is -2.613e+06 J\n",
+ "Chnage in internal energy is 1667.979893 kJ\n",
+ "Heat supplied is -944.769684 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6, Page no:55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To compare the pressures\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "V = 0.3821*10**-3 \t\t\t#molar volume(m**3/mol)\n",
+ "T = 313.; \t\t\t#temperature (K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "a = 0.365; b = 4.28*10**-5; \t\t\t#Vander Waals constant\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To compare the pressures\n",
+ "#(a): Ideal gas equation\n",
+ "P = ((R*T)/(V*10**5)); \t\t\t#pressure in bar\n",
+ "print 'Pressure obtained by ideal gas equation is %f bar'%P\n",
+ "\n",
+ "#(b): Van der Waals equation\n",
+ "P = ((((R*T)/(V-b))-(a/(V**2)))/(10**5));\n",
+ "print 'Pressure obtained by Van der Waals equation is %f bar'%P\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure obtained by ideal gas equation is 68.104737 bar\n",
+ "Pressure obtained by Van der Waals equation is 51.695679 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page no:56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the volume\n",
+ "\n",
+ "#To find Approx Value\n",
+ "def approx(V,n):\n",
+ " A=round(V*10**n)/10**n;\t\t\t#V-Value n-To what place\n",
+ " return A\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 300.; \t\t\t#temperature(K)\n",
+ "P = 100.; \t\t\t#pressure(bar)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "a = 0.1378\n",
+ "b = 3.18*10**-5; \t\t\t#Van der waals constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a): Ideal gas equation\n",
+ "V_ideal = approx(((R*T)/(P*10**5)),6);\n",
+ "print 'Volume calculated by ideal gas equation is %4.2e cubic m'%V_ideal\n",
+ "\n",
+ "#(b): Van der Waals equation\n",
+ "def f(V):\n",
+ " y=((P*10**5)+(a/(V**2)))*(V-b)-(R*T); \t\t\t#function to calculate difference between calculated and assumed volume\n",
+ " return y\n",
+ " \n",
+ "V_real = 0;\n",
+ "i = 0.20\n",
+ "while i<=.30: \t\t\t#Van der waals volume should be nearly equal to Ideal gas valoume\n",
+ " res = approx(f(i*10**-3),0);\n",
+ " for j in range(-5,6):\n",
+ " if(j==res): \t\t\t#for very small difference i may be taken as exact volume\n",
+ " V_real = i*10**-3;\n",
+ " i += 0.01\n",
+ "\n",
+ "print 'Volume calculated by Van der Waals equation is %3.2e cubic m'%V_real\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume calculated by ideal gas equation is 2.49e-04 cubic m\n",
+ "Volume calculated by Van der Waals equation is 2.30e-04 cubic m\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9, Page no:59 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate compressibility factor and molar volume\n",
+ "\n",
+ "#To find Approx Value\n",
+ "def approx(V,n):\n",
+ " A=round(V*10**n)/10**n;\t\t\t#V-Value n-To what place\n",
+ " return A\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 500.; \t\t\t#temperature (K)\n",
+ "P = 10.; \t\t\t#pressure(bar)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "B = -2.19*10**-4; C=-1.73*10**-8; \t\t\t#Virial coeffecients\n",
+ "Tc = 512.6; \t\t\t#critical temperature\n",
+ "Pc = 81.; \t\t\t#critical pressure\n",
+ "\n",
+ "#To calculate compressibility factor and molar volume\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a): Truncated form of virial equation\n",
+ "V_ideal = approx(((R*T)/(P*10**5)),7); \t\t\t#ideal gas volume\n",
+ "def f1(V):\n",
+ " z = (((R*T)/(P*10**5))*(1+(B/V)+(C/(V**2)))); \t\t\t#function for obtaining volume by virial equation\n",
+ " return z\n",
+ "\n",
+ "#loop for hit and trial method\n",
+ "flag = 1;\n",
+ "while(flag==1):\n",
+ " V_virial = approx(f1(V_ideal),7);\n",
+ " if(approx(V_ideal,5)==approx(V_virial,5)):\n",
+ " flag = 0;\n",
+ " break;\n",
+ " else:\n",
+ " V_ideal = V_virial;\n",
+ "\n",
+ "\n",
+ "Z = approx(((P*10**5*V_virial)/(T*R)),3); \t\t\t#compressibility factor\n",
+ "print 'Compressibilty factor for virial equation is %f '%Z\n",
+ "\n",
+ "#(b): Redlich Kwong Equation\n",
+ "#Constants in Redlich Kwong equation\n",
+ "a = approx(((0.4278*(R**2)*(Tc**2.5))/(Pc*10**5)),4);\n",
+ "b = approx(((0.0867*R*Tc)/(Pc*10**5)),9);\n",
+ "\n",
+ "V_ideal = approx(((R*T)/(P*10**5)),7); \t\t\t#ideal gas volume\n",
+ "\n",
+ "#Function to find volume by Redlich Kwong equation \n",
+ "def f2(V):\n",
+ " x = ((R*T)/(P*10**5))+b-((a*(V-b))/((T**0.5)*(P*10**5)*V*(V+b)));\n",
+ " return x\n",
+ "\n",
+ "#loop for hit and trial method\n",
+ "flag = 1;\n",
+ "while(flag==1):\n",
+ " V_redlich = approx(f2(V_ideal),7);\n",
+ " if(approx(V_ideal,5)==approx(V_redlich,5)):\n",
+ " flag = 0;\n",
+ " break;\n",
+ " else:\n",
+ "\t V_ideal = V_redlich;\n",
+ "\n",
+ "print 'Volume obtained by Redlich Kwong Equation is %4.3e cubic m/mol'%V_redlich\n",
+ "Z = approx(((P*10**5*V_redlich)/(T*R)),3); \t\t\t#compressibility factor\n",
+ "print 'Compressbility factor by Redlich Kwong equation is %f'%Z\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Compressibilty factor for virial equation is 0.943000 \n",
+ "Volume obtained by Redlich Kwong Equation is 3.963e-03 cubic m/mol\n",
+ "Compressbility factor by Redlich Kwong equation is 0.953000\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.10, Page no:64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate heat of formation of methane gas\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "Ha = -890.94; \t\t\t#standard heat for reaction a (kJ)\n",
+ "Hb = -393.78; \t\t\t#standard heat for reaction b (kJ)\n",
+ "Hc = -286.03; \t\t\t#standard heat for reaction c (kJ)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate heat of formation of methane gas\n",
+ "#c*2 + b - a gives the formation of methane from elements\n",
+ "Hf = (2*Hc)+Hb-Ha;\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of formation of methane is %f kJ/mol'%Hf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of formation of methane is -74.900000 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11, Page no:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate heat of formation of chloroform\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "Ha = -509.93; \t\t\t#heat of combustion of reaction a (kJ) \n",
+ "Hb = -296.03; \t\t\t#heat of combustion of reaction b (kJ)\n",
+ "Hc = -393.78; \t\t\t#heat of combustion of reaction c (kJ)\n",
+ "Hd = -167.57; \t\t\t#heat of combustion of reaction d (kJ)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate heat of formation of chloroform\n",
+ "#c + (3*d) -a -b gives chloroform from its elements\n",
+ "Hf = Hc+(3*Hd)-Ha-Hb;\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of formation of chloroform is %f kJ/mol'%Hf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of formation of chloroform is -90.530000 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.12, Page no:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate standard heat of reaction at 773 K\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "Ho = -164987.; \t\t\t#standard heat of reaction at 298 K in J\n",
+ "T1 = 298.;\n",
+ "T2 = 773.; \t\t\t#temperature(K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate standard heat of reaction at 773 K\n",
+ "alpha = (2*29.16)+13.41-26.75-(4*26.88);\n",
+ "betta = ((2*14.49)+77.03-42.26-(4*4.35))*10**-3;\n",
+ "gama = ((2*-2.02)-18.74+14.25+(4*0.33))*10**-6;\n",
+ "#Using equation 3.54 (Page no. 67)\n",
+ "H1 = Ho-(alpha*T1)-(betta*(T1**2)/2)-(gama*(T1**3)/3);\n",
+ "#At 773 K\n",
+ "Hr = H1+(alpha*T2)+(betta*(T2**2)/2)+(gama*(T2**3)/3);\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of reaction at 773 K is %f kJ'%(Hr/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of reaction at 773 K is -183.950273 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.13, Page no:68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine heat added or removed\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "To = 298.; \t\t\t#standard temperature(K)\n",
+ "T1 = 400.; \t\t\t#temperature of reactants(K)\n",
+ "T2 = 600.; \t\t\t#temperature of products (K)\n",
+ "Ho = -283.028; \t\t\t#standard heat of reaction(kJ/mol)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine heat added or removed\n",
+ "#Basis:\n",
+ "n_CO = 1.; \t\t\t#moles of CO reacted\n",
+ "n_O2 = 1.;\t\t\t#moles of oxygen supplied\n",
+ "n_N2 = 1.*79./21; \t\t\t#moles of nitrogen\n",
+ "n1_O2 = 0.5; \t\t\t#moles of oxygen required\n",
+ "n_CO2 = 1.; \t\t\t#moles of carbon di oxide formed\n",
+ "\n",
+ "H1 = ((n_O2*29.70)+(n_N2*29.10)+(n_CO*29.10))*(To-T1)/1000; \t\t\t#enthalpy of cooling of reactants\n",
+ "H2 = ((n1_O2*29.70)+(n_N2*29.10)+(n_CO2*41.45))*(T2-To)/1000; \t\t\t#enthalpy of heating the products\n",
+ "Hr = H1+Ho+H2;\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat supplied is %f kJ'%Hr\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat supplied is -250.128714 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.14, Page no:69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate theoretical flame temperature\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "To = 298.; \t\t\t#standard temperature (K)\n",
+ "T1 = 373.; \t\t\t#temperature of reactants (K)\n",
+ "Ho = 283178.; \t\t\t#standard heat of combustion(J/mol)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate theoretical flame temperature\n",
+ "#Basis:\n",
+ "n_CO = 1.; \t\t\t#moles of CO\n",
+ "n_O2 = 1.; \t\t\t#moles of oxygen supplied\n",
+ "n1_O2 = 0.5; \t\t\t#moles of oxygen reacted\n",
+ "n_CO2 = 1.; \t\t\t#moles of carbon di oxide formed\n",
+ "n_N2 = 79./21; \t\t\t#moles of nitrogen\n",
+ "\n",
+ "H1 = ((n_O2*34.83)+(n_N2*33.03)+(n_CO*29.23))*(To-T1); \t\t\t#enthalpy of cooling of reactants\n",
+ "#Using equation 3.55 (Page no. 69)\n",
+ "H2 = Ho-H1;\n",
+ "Tf = H2/((n1_O2*34.83)+(n_N2*33.03)+(n_CO2*53.59))+298; \t\t\t#flame temperature\n",
+ "\n",
+ "# Results\n",
+ "print 'Theoretical flame temperature is %f K'%Tf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical flame temperature is 1820.588298 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch4.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch4.ipynb
new file mode 100644
index 00000000..75c3c01e
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch4.ipynb
@@ -0,0 +1,960 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Second Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page no:90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the maximum efficiency\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T1 = 700.; \t\t\t#temperature of heat source(K)\n",
+ "T2 = 300.; \t\t\t#temperature of heat sink(K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate the maximum efficiency\n",
+ "eff=((T1-T2)/T1); \t\t\t#efficiency of a heat engine\n",
+ "\n",
+ "# Results\n",
+ "print 'Maximum efficiency of heat engine is %f'%eff\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum efficiency of heat engine is 0.571429\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page no:90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine minimum amount of work done and heat given to surrounding\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m = 1.; \t\t\t#mass of water(kg)\n",
+ "T1 = 300.; \t\t\t#temperature of surrounding(K)\n",
+ "T2 = 273.; \t\t\t#temperature of water(K)\n",
+ "Hf = 334.11; \t\t\t#latent heat of fusion of ice(kJ/kg)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine minimum amount of work and heat given upto surrounding\n",
+ "#(a)\n",
+ "Q2 = m*Hf; \t\t\t#heat absobed at temperature T2\n",
+ "W = ((Q2*(T1-T2))/T2); \t\t\t#minimumm amount of work required\n",
+ "print 'Minimum amount of work required is %f kJ'%W\n",
+ " \n",
+ "#(b)\n",
+ "#Q1 is the heat given up the surrounding\n",
+ "Q1 = W+Q2;\n",
+ "print 'Heat given upto surrounding is %f kJ'%Q1\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum amount of work required is 33.043846 kJ\n",
+ "Heat given upto surrounding is 367.153846 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page no:90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine efficiency of proposed engine\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "P_out = 4.5; \t\t\t#output power(hp)\n",
+ "P_in = 6.25; \t\t\t#input power(kW)\n",
+ "T1 = 1000.; \t\t\t#source temperature(K)\n",
+ "T2 = 500.; \t\t\t#sink temperature(K)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine efficiency of proposed engine \n",
+ "ep = ((P_out*745.7)/(P_in*1000)); \t\t\t#proposed efficiency\n",
+ "print 'Efficiency of proposed engine is %f'%ep\n",
+ "\n",
+ "em = ((T1-T2)/T1); \t\t\t#maximum efficiency\n",
+ "print 'The maximum efficieny is %f'%em\n",
+ "print 'Hence the claim of the proposed engine is impossible'\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of proposed engine is 0.536904\n",
+ "The maximum efficieny is 0.500000\n",
+ "Hence the claim of the proposed engine is impossible\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4, Page no:93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate entropy of evaporation\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "P = 500.; \t\t\t#pressure of dry saturated steam(kPa)\n",
+ "\n",
+ "#From steam tables\n",
+ "Hv = 2106.; \t\t\t#latent heat of vaporisation(kJ/kg)\n",
+ "T = 425.; \t\t\t#saturation temperature(K)\n",
+ " \n",
+ "# Calculations \n",
+ "#To calculate the entropy of evaporation\n",
+ "#By equation 4.25 (Page no. 93)\n",
+ "Sv = (Hv/T); \t\t\t#entropy change accompanying vaporisation\n",
+ "\n",
+ "# Results\n",
+ "print 'Entropy of evaporation is %f kJ/kg K'%Sv\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy of evaporation is 4.955294 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5, Page no:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine change in entropy\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m = 2.; \t\t\t#mass of gas(kg)\n",
+ "T1 = 277.; \t\t\t#initial temperature(K)\n",
+ "T2 = 368.; \t\t\t#final temperature(K)\n",
+ "Cv = 1.42; \t\t\t#specific geat at constant volume(kJ/kg K)\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "#Using equation 4.31 (Page no. 94)\n",
+ "S = (m*Cv*math.log(T2/T1)); \t\t\t#change in entropy(kJ/K)\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in entropy is %f kJ/K'%S\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy is 0.806746 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6, Page no:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the entropy change\n",
+ "\n",
+ "#Given:\n",
+ "T = 300.; \t\t\t#temperature in K\n",
+ "P1 = 10.; \t\t\t#initial pressure(bar)\n",
+ "P2 = 1.; \t\t\t#final pressure(bar)\n",
+ "R = 8.314; \t\t\t#ieal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "#To calculate the entropy change\n",
+ "#Using equation 4.33(Page no. 94)\n",
+ "S = (R*math.log(P1/P2)); \t\t\t#(kJ/kmol K)\n",
+ "\n",
+ "# Results\n",
+ "print 'Entopy change is %f kJ/kmol K'%S\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entopy change is 19.143692 kJ/kmol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7, Page no:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine change in entropy\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T1 = 335.; \t\t\t#initial temperature in K\n",
+ "T2 = 300.; \t\t\t#final temperature in K\n",
+ "P1 = 10.; \t\t\t#initial pressure(bar)\n",
+ "P2 = 1.; \t\t\t#final pressure(bar)\n",
+ "Cp = 29.3; \t\t\t#specific heat constant at constant pressure(kJ/kmol K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "#To determine change in entropy\n",
+ "#Using equation 4.30 (Page no. 94)\n",
+ "S = ((Cp*math.log(T2/T1))-(R*math.log(P2/P1))); \t\t\t#entropy change(kJ/kmol K)\n",
+ "\n",
+ "# Results\n",
+ "print 'Entropy change in the process is %f kJ/kmol K'%S\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy change in the process is 15.910494 kJ/kmol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8, Page no:95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the change in entropy\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m1 = 10.; \t\t\t#mass of water at 375 K (kg)\n",
+ "m2 = 30.; \t\t\t#mass of water at 275 K (kg)\n",
+ "c = 4.2; \t\t\t#specific heat of water (kJ.kg K)\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "#To determine the change in entropy\n",
+ "#Let T be the final temperature(K)\n",
+ "T = ((m1*375)+(m2*275))/(m1+m2);\n",
+ "#S1 be change in entropy for hot water\n",
+ "S1 = (m1*c*math.log(T/375)); \t\t\t#[kJ/K]\n",
+ "#S2 be the change in entropy for cold water\n",
+ "S2 = (m2*c*math.log(T/275)); \t\t\t#[kJ/K]\n",
+ "#S be the total entropy change\n",
+ "S = S1+S2; \n",
+ "\n",
+ "# Results\n",
+ "print 'The total entropy change is %f kJ/K'%S\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change is 1.591404 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9, Page no:95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the total entropy change\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m1 = 35.; \t\t\t#mass of steel in kg\n",
+ "m2 = 150.; \t\t\t#mass of oil in kg\n",
+ "T1 = 725.; \t\t\t#temperature of steel(K)\n",
+ "T2 = 275.; \t\t\t#temperature of oil(K)\n",
+ "c1 = 0.88; \t\t\t#specific heat of steel (kJ/kg K)\n",
+ "c2 = 2.5; \t\t\t#specific heat of oil(kJ/kg K)\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "#To calculate the total entropy change\n",
+ "#Let T be the final temperature\n",
+ "T = (((m1*c1*T1)+(m2*c2*T2))/((m1*c1)+(m2*c2)));\n",
+ "#S1 be the in entropy for steel\n",
+ "S1 = (m1*c1*math.log(T/T1)); \t\t\t#[kJ/K]\n",
+ "#S2 be the change in entropy for oil\n",
+ "S2 = (m2*c2*math.log(T/T2)); \t\t\t#[kJ/K]\n",
+ "#S be the total entropy change\n",
+ "S = S1+S2;\n",
+ "\n",
+ "# Results\n",
+ "print 'The total entropy change is %f kJ/K'%S\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change is 17.649827 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate entropy of 1 kmole of air\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "n1 = 0.21; \t\t\t#volume % of oxygen in air\n",
+ "n2 = 0.79; \t\t\t#volume % of nitrogen in air\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "#To calculate entropy of 1 kmol of air\n",
+ "#Using equation 4.35 (Page no. 96)\n",
+ "S = (-R*(n1*math.log(n1)+n2*math.log(n2))); \t\t\t#[kJ/kmol K]\n",
+ "\n",
+ "# Results\n",
+ "print 'The total entropy change is %f kJ/kmol K'%S\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change is 4.273036 kJ/kmol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine change in entropy for the reaction\n",
+ "\n",
+ "# Variables\n",
+ "H = -2.8318*10**5; \t\t\t#heat of reaction (J/mol)\n",
+ "T = 298.; \t\t\t#temperature of reaction in K\n",
+ "#Absolute entropies for CO, O2, CO2 are (in J/mol K)\n",
+ "S_CO = 198.;\n",
+ "S_O2 = 205.2;\n",
+ "S_CO2 = 213.8;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# To determine the change in entropy for the reaction\n",
+ "# Referring equation 4.36 (Page no. 96)\n",
+ "S_reactant = S_CO + 0.5*S_O2; \t\t\t#entropy change for reactants\n",
+ "S_product = S_CO2; \t\t\t#entropy change for products\n",
+ "S = S_product-S_reactant; \t\t\t#total entropy change\n",
+ "print 'The total entropy change for the reaction is %f J/mol'%S\n",
+ "print 'Since the reaction is highly irreversible, entropy change cannot be calculated as the ratio of heat of reaction to the temperature'\n",
+ "\n",
+ "#The energy available for useful work is the difference between heat of reaction and entropy energy due to ireversible nature of the process\n",
+ "W_useful = -H+(T*S); \t\t\t#energy available for useful work (J)\n",
+ "print 'Energy available for useful work is %3.2e J'%W_useful\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change for the reaction is -86.800000 J/mol\n",
+ "Since the reaction is highly irreversible, entropy change cannot be calculated as the ratio of heat of reaction to the temperature\n",
+ "Energy available for useful work is 2.57e+05 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate change in entropy and check whether the process is reversible\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "H_steam = 2923.5; \t\t\t#enthalpy of superheated steam (kJ/kg)\n",
+ "S_steam = 6.71; \t\t\t#entropy of superheated steam (kJ/kg K)\n",
+ "H_liquid = 845.; \t\t\t#enthalpy of saturated liquid (kJ/kg)\n",
+ "S_liquid = 2.32; \t\t\t#entropy of saturated liquid (kJ/kg K)\n",
+ "T = 300.; \t\t\t#temperature of system (K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate change in entropy and check whether the process is reversible\n",
+ "S_system = S_liquid-S_steam; \t\t\t#change in entropy of steam\n",
+ "\n",
+ "#Let Q be the heat given out during condensation\n",
+ "Q = -(H_liquid-H_steam);\n",
+ "S_surrounding = Q/T; \t\t\t#change in entropy of the surrounding\n",
+ "S_total = S_system+S_surrounding; \t\t\t#total entropy change\n",
+ "\n",
+ "# Results\n",
+ "print 'The total entropy change is %f kJ/kg'%S_total\n",
+ "print 'Since total entropy change is positive,the process is irreversible'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change is 2.538333 kJ/kg\n",
+ "Since total entropy change is positive,the process is irreversible\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the change in entropy of system\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "V = 1.; \t\t\t#volume of each compartment in cubic meters\n",
+ "P_sat = 683.6; \t\t#pressure of saturated steam (kPa)\n",
+ "P_steam = 101.3; \t#pressure of supereated steam (kPa)\n",
+ "T_sat = 437.2; \t\t#temperature of system (K)\n",
+ "\n",
+ "#Referring steam tables\n",
+ "#For saturated steam at pressure 683.6 kPa and temp 437.2 K\n",
+ "H_sat = 2761.; \t\t\t #enthalpy of saturated steam (kJ/kg)\n",
+ "S_sat = 6.7133; \t\t\t#entropy of saturated steam (kJ/kg K)\n",
+ "spvol_sat = 278.9*10**-3; \t#specific volume of saturated steam (cubic m/kg)\n",
+ "U_sat = 2570.4; \t\t\t#specific internal energy of saturated steam (kJ/kg)\n",
+ "\n",
+ "#For superheated steam at 101.3 kPa and 437.2 K\n",
+ "H_steam = 2804.; \t\t\t #enthalpy of superheated steam (kJ/kg)\n",
+ "S_steam = 7.6712; \t\t\t #entropy of superheated steam (kJ/kg K)\n",
+ "spvol_steam = 1976.2*10**-3; \t#specific volume of superheated steam (cubic m /kg)\n",
+ "U_steam = 2603.3; \t\t\t #specific internal energy of superheated steam (kJ/kg)\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the change in entropy of system\n",
+ "m_sat = V/spvol_sat; \t\t\t#mass of satureated steam(kg)\n",
+ "m_steam = V/spvol_steam; \t\t#mass of superheated steam (kg)\n",
+ "m_sys = m_sat+m_steam; \t\t\t#mass of system (kg)\n",
+ "spvol_sys = (2.*V)/m_sys; \t\t#specific volume of system (cubic m/kg)\n",
+ "\t\t\t#Since no heat exchange and work interaction occurs so internal energy after mixing remains the same\n",
+ "U1_sat = m_sat*U_sat; \t\t\t #internal energy of saturated steam (kJ)\n",
+ "U1_steam = m_steam*U_steam; \t #internal enegy of superheated steam (kJ)\n",
+ "U_sys = (U1_sat+U1_steam)/m_sys; \t#specific internal energy of system (kJ/kg)\n",
+ "\n",
+ "#Referring steam tables\n",
+ "#At calculated U_sys and spvol_sys\n",
+ "S_sys = 6.9992; \t\t\t #specific entropy of system (kJ/kg K)\n",
+ "Si = ((m_sat*S_sat)+(m_steam*S_steam)); #initial entropy of system (kJ/K)\n",
+ "Sf = (m_sys*S_sys); \t\t\t #final entropy of system (kJ/K)\n",
+ "S = Sf-Si; \t\t\t #change in entropy\n",
+ "\n",
+ "# Results\n",
+ "print 'The change in entropy of the system is %f kJ/K'%S\n",
+ "print 'Since entropy change is positive, the process is irrevresible'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy of the system is 0.685052 kJ/K\n",
+ "Since entropy change is positive, the process is irrevresible\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate entropy change\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "V = 1.; \t\t\t#volume of each compartment in cubic m\n",
+ "T = 300.; \t\t\t#temperature of ideal gas in 1st compartment (K)\n",
+ "P = 200.; \t\t\t#pressure of ideal gas in 1st compartment (kPa)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate entropy change\n",
+ "#Let n be the number of moles of gas\n",
+ "n = ((P*V)/(R*T));\n",
+ "#Since gas in vessel exchanges no heat and work with surrounding so internal energy remains same\n",
+ "#This implies temperature after mixing is same as that before mixing\n",
+ "\n",
+ "#Final conditions:\n",
+ "Tf = 300.; \t\t\t#final temperature (K)\n",
+ "Vf = 2.; \t\t\t#final volume (cubic m)\n",
+ "Pf = 100.; \t\t\t#final pressure (kPa)\n",
+ "\n",
+ "#Initial conditions:\n",
+ "Ti = 300.; \t\t\t#initial temperature (K)\n",
+ "Vi = 1.; \t\t\t#initial volume (cubic m)\n",
+ "Pi = 200.; \t\t\t#initial pressure (kPa)\n",
+ "import math\n",
+ "#Using equation 4.33 (Page num 94)\n",
+ "S = n*R*math.log(Vf/Vi); \t\t\t#entropy change of system (kJ/K)\n",
+ "#Since entropy of surrounding does not change\n",
+ "S_total = S; \t\t\t#total entropy change\n",
+ "\n",
+ "# Results\n",
+ "print 'The change in total entropy is %f kJ/K'%S_total\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in total entropy is 0.462098 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate entropy change in the process\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m_oil = 5000.; \t\t\t#mass flow rate of oil (kg/h)\n",
+ "Tin_oil = 500.; \t\t\t#inlet temperature of oil (K)\n",
+ "Tin_water = 295.; \t\t\t#inlet temperature of water (K)\n",
+ "c_oil = 3.2; \t\t\t#specific heat of oil (kJ/kg K)\n",
+ "c_water = 4.2; \t\t\t#specific heat of water (kJ/kg K)\n",
+ "import math\n",
+ "#To calculate entropy change in the process\n",
+ "#Assuming oil is cooled to minimum permissible temperature\n",
+ "Tout_oil = 305.; \t\t\t#exit temperature of oil (K)\n",
+ "Tout_water = 490.; \t\t\t#exit temperature of water (K)\n",
+ "\n",
+ "# Calculations\n",
+ "#Let m_water be the mass flow rate of water\n",
+ "#By enthalpy balance\n",
+ "m_water = ((m_oil*c_oil*(Tin_oil-Tout_oil))/(c_water*(Tout_water-Tin_water))); \t\t\t#(kg/h)\n",
+ "S_oil = m_oil*c_oil*math.log(Tout_oil/Tin_oil); \t\t\t#entropy change of oil (kJ/K)\n",
+ "S_water = m_water*c_water*math.log(Tout_water/Tin_water); \t\t\t#entropy change of water (kJ/K)\n",
+ "S_tot = S_oil+S_water; \t\t\t#total entropy change\n",
+ "\n",
+ "# Results\n",
+ "print 'The total entropy change in the process is %f kJ/K'%S_tot\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change in the process is 210.139407 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate loss in capacity of doing work\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "To = 275.; \t\t\t#temperature of quenching oil (K)\n",
+ "\n",
+ "# Calculations\n",
+ "S_steel = -26.25; \t\t\t#change in entropy os casting (kJ/K)\n",
+ "S_oil = 43.90; \t\t\t#change in entropy of oil (kJ/K)\n",
+ "S_tot = S_steel+S_oil; \t\t\t#total entropy change\n",
+ "#Let W be loss in capacity for doing work\n",
+ "W = To*S_tot; \t\t\t#(kJ)\n",
+ "\n",
+ "# Results\n",
+ "print 'The loss in capacity for doing work is %f kJ'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loss in capacity for doing work is 4853.750000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate total change in entropy and available work\n",
+ "\n",
+ "import math\n",
+ "#Given:\n",
+ "m_oil = 5000.; \t\t\t #mass flow rate of hydrocarbon oil (kg/h)\n",
+ "Tin_oil = 425.; \t\t\t#inlet temperature of oil (K)\n",
+ "Tout_oil = 340.; \t\t\t#exit temperature of oil (K)\n",
+ "m_water = 10000.; \t\t\t#mass flow rate of water (kg/h)\n",
+ "Tin_water = 295.; \t\t\t#inlet temperature of water (K)\n",
+ "c_oil = 2.5; \t\t\t #mean specific heat of oil (kJ/kg K)\n",
+ "c_water = 4.2; \t\t\t #mean specific heat of water (kJ/kg K)\n",
+ "\n",
+ "#To determine total change in entropy and available work\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)\n",
+ "#By energy balance\n",
+ "Tout_water = ((m_oil*c_oil*(Tin_oil-Tout_oil))/(m_water*c_water))+295; \t\t\t#exit temperature of water (K)\n",
+ "S_oil = m_oil*c_oil*math.log(Tout_oil/Tin_oil); \t\t\t#change in entropy of oil (kJ/K)\n",
+ "S_water = m_water*c_water*math.log(Tout_water/Tin_water); \t\t\t#change in entropy of water (kJ/K)\n",
+ "S_tot = S_oil+S_water; \t\t\t#total entropy change\n",
+ "print 'The total entropy change is %f kJ/K'%S_tot\n",
+ "\n",
+ "\n",
+ "#(b)\n",
+ "To = 295.; \t\t\t#temperature at which heat is rejected to surrounding (K)\n",
+ "#Let Q be heat given out by the oil on cooling\n",
+ "Q = m_oil*c_oil*(Tin_oil-Tout_oil);\n",
+ "#Heat rejected to the surrounding at To by the Carnot Engine is given by\n",
+ "#Q2 = To(Q/T) = -To*S_oil\n",
+ "Q2 = -To*S_oil; \t\t\t#(kJ)\n",
+ "#Let W be the work output of engine\n",
+ "W = Q-Q2;\n",
+ "print 'The work output of the engine would be %4.3e kJ'%W\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total entropy change is 666.266812 kJ/K\n",
+ "The work output of the engine would be 2.397e+05 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the molar entropy of metal\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 10.; \t\t\t#temperature of metal (K)\n",
+ "Cp = 0.45; \t\t\t#molar heat capacity at 10 K (J/mol K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the molar entropy of metal\n",
+ "#Entropy of solid at 10 K is calculated using first integral in equation 4.55 (Page no. 108)\n",
+ "S = Cp/3;\n",
+ "\n",
+ "# Results\n",
+ "print 'Molar entropy of meatl at 10 K is %f J/mol K'%S\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar entropy of meatl at 10 K is 0.150000 J/mol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the absolute entropy of water vapour\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 473.; \t\t\t#temperature at entropy is to be determined (K)\n",
+ "Tf = 273.; \t\t\t#base temperature (K)\n",
+ "Tb = 373.; \t\t\t#boiling temperature (K)\n",
+ "Cpl = 4.2; \t\t\t#avearge heat capacity of water (kJ/kg K)\n",
+ "Cpg = 1.9; \t\t\t#avearge heat capacity of water vapour between 373 K and 473 K\n",
+ "Hv = 2257.; \t\t\t#latent heat of vaporisation at 373 K (kJ/kg)\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "S = (Cpl*math.log(Tb/Tf))+(Hv/Tb)+(Cpg*math.log(T/Tb));\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print 'Absolute entropy of water vapour at 473 K and 101.3 kPa is %f kJ/kg K'%S\n",
+ "print 'It compares favourably with the value reported in steam tables'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute entropy of water vapour at 473 K and 101.3 kPa is 7.813068 kJ/kg K\n",
+ "It compares favourably with the value reported in steam tables\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch5.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch5.ipynb
new file mode 100644
index 00000000..aa03f112
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch5.ipynb
@@ -0,0 +1,1393 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Some Applications of the Laws of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the pressure at exit\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "u1 = 1; \t\t\t #entering velocity of water (m/s)\n",
+ "d_ent = 0.2; \t\t\t#entrance diameter of reducer (m)\n",
+ "d_exit = 0.1; \t\t\t#exit diameter of reducer (m)\n",
+ "P_ent = 105; \t\t\t#pressure at entrance (kPa)\n",
+ "z = 5; \t\t\t #distance between entrance and exit (m)\n",
+ "g = 9.81; \t\t\t #acceleration due to gravity \n",
+ "den = 1000; \t\t\t#density of water (kg/m**3)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate the pressure at exit\n",
+ "A1 = (math.pi/4)*d_ent**2; \t\t\t #cross section area of entrance (m**2)\n",
+ "A2 = (math.pi/4)*d_exit**2; \t\t\t#cross section area of exit (m**2)\n",
+ "\n",
+ "#By the equation of continuity and since density of water remains constant\n",
+ "u2 = (A1*u1)/A2;\n",
+ "\n",
+ "#By Bernoulli's equation between section 1 and 2 (Eq 5.20 Page no. 118)\n",
+ "P_exit = (-((u2**2-u1**2)/2)-(g*z)+(P_ent*10**3/den))*(den/10**3)\n",
+ "\n",
+ "# Results\n",
+ "print 'The pressure at exit is %f kPa'%P_exit\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure at exit is 48.450000 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine quality of steam flowing through the pipe\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "P = 1000.; \t\t\t#pressure of saturated steam (kPa)\n",
+ "T = 398.; \t\t\t#temperature of escaping steam (K)\n",
+ "\n",
+ "#Referring steam tables\n",
+ "H_vap = 2778.; \t\t\t#enthalpy of saturated vapour at 1000 kPa (kJ/kg)\n",
+ "H_liq = 763.; \t\t\t#enthalpy of saturated liquid at 1000 kPa (kJ/kg)\n",
+ "H_steam = 2726.; \t\t#enthalpy of superheated steam at 398 K (kJ/kg)\n",
+ "H2 = 2726; \t\t\t #[kJ/kg]\n",
+ "\n",
+ "# Calculations\n",
+ "#No work is done and no heat is exchanged between section 1 and 2\n",
+ "#S0% H1 = H2\n",
+ "x = (H2-H_vap)/(H_liq-H_vap)\n",
+ "\n",
+ "# Results\n",
+ "print 'The steam contains %f percent liquid'%(x*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The steam contains 2.580645 percent liquid\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page no:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the discharge velocity\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m = 10.; \t\t\t#mass flow rate of steam (kg/s)\n",
+ "H1 = 3062.; \t\t\t#enthalpy of entering steam (kJ/kg)\n",
+ "H2 = 2875.; \t\t\t#enthalpy of discharged steam (kJ/kg)\n",
+ "Q = -100./m; \t\t\t#heat loss to the surrounding (kJ/kg)\n",
+ "u1 = 0.; \t\t\t#entering velocity of steam\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "H = H2-H1;\n",
+ "u2 = math.sqrt((Q-H)*1000*2)\n",
+ "\n",
+ "# Results\n",
+ "print 'The discharge velocity is %i m/s'%u2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The discharge velocity is 594 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4, Page no:125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine thermodynamic properties at throat and critical pressure\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "To = 600.; \t\t\t#temperature of air (K)\n",
+ "Po = 2000.; \t\t\t#pressure of air (kPa)\n",
+ "gama = 1.4;\n",
+ "M = 0.8; \t\t\t#Mach number at throat\n",
+ "m = 29.; \t\t\t#molecular mass of air\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "#To determine thermodynamical properties at throat and critical pressure\n",
+ "import math\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)\n",
+ "#Using equation 5.40 (Page no 123).. u**2 = (M**2)*gama*P*V\n",
+ "#Substituting this in eq. 5.39 (Page no. 123) and on rearranging we get\n",
+ "P = Po/((1+(((gama-1)/2)*M**2))**(gama/(gama-1)))\n",
+ "#Using eq. 5.39 and the relation PoVo = RTo/m\n",
+ "u = math.sqrt((2*gama*R*To*1000)/(m*(gama-1))*(1-(P/Po)**((gama-1)/gama)))\n",
+ "#Using eq. 3.23 (Page no. 49)\n",
+ "T = To*(P/Po)**((gama-1)/gama)\n",
+ "#Let d be the density\n",
+ "d_o = (Po*m)/(R*To)\n",
+ "#Since P*(V**gama) = P/(den**gama) = constant...so\n",
+ "d = d_o*((P/Po)**(1/gama))\n",
+ "print '(a). At throat'\n",
+ "print 'Pressure = %i kPa'%P\n",
+ "print 'Temperature = %i K'%T\n",
+ "print 'Velocity = %f m/s'%u\n",
+ "print 'Density = %f kg/cubic m'%d\n",
+ "\n",
+ "#(b)\n",
+ "#Using eq. 5.42 (Page no.124)\n",
+ "Pc = Po*((2/(gama+1))**(gama/(gama-1))) \t\t\t#critical pressure\n",
+ "print '(b).'\n",
+ "print 'The critical pressure is %f kPa'%Pc\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). At throat\n",
+ "Pressure = 1312 kPa\n",
+ "Temperature = 531 K\n",
+ "Velocity = 369.641813 m/s\n",
+ "Density = 8.603873 kg/cubic m\n",
+ "(b).\n",
+ "The critical pressure is 1056.563575 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate work required and temperature after compression\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1.; \t\t\t#initial pressure (bar)\n",
+ "T1 = 300.; \t\t\t#initial temperature (K)\n",
+ "P2 = 10.; \t\t\t#final pressure (bar)\n",
+ "gama = 1.3; \t\t\t#gama for CO2\n",
+ "V_rate = 100.; \t\t\t#volumetric flow rate (m**3/h)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate work required and temperature after compression\n",
+ "Ws = (gama/(gama-1))*P1*10**5*(V_rate/3600)*(1-(P2/P1)**((gama-1)/gama))\n",
+ "print 'The work required is %f kW'%(-Ws/1000)\n",
+ "\n",
+ "#Using equation 3.23 (Page no.49)\n",
+ "T2 = T1*((P2/P1)**((gama-1)/gama))\n",
+ "print 'Temperature of gas after compression is %f K'%T2\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work required is 8.441024 kW\n",
+ "Temperature of gas after compression is 510.376284 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate work required and temperature\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 100.; \t\t\t#initial pressure of saturated steam (kPa)\n",
+ "P2 = 500.; \t\t\t#final pressure (kPa)\n",
+ "eff = 0.8; \t\t\t#compression efficiency\n",
+ "\n",
+ "#Referring steam tables\n",
+ "#Properties of steam entering the compressor\n",
+ "H1 = 2675.5; \t\t\t#enthalpy (kJ/kg)\n",
+ "S1 = 7.3594; \t\t\t#entropy (kJ/kg K)\n",
+ "\n",
+ "#Properties of compressed steam\n",
+ "H2 = 3008.; \t\t\t#enthalpy (kJ/kg)\n",
+ "S2 = S1; \t\t\t#isentropic compression\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate work required and temperature\n",
+ "\n",
+ "Hs = H2-H1;\n",
+ "#Using eq. 5.44 (Page no. 128)\n",
+ "W_isentropic = -Hs;\n",
+ "W_act = W_isentropic/eff;\n",
+ "print 'The work required for compression is %f kJ/kg'%-W_act\n",
+ "\n",
+ "H = Hs/eff; \t\t\t#actual change in enthalpy\n",
+ "H_act = H1+H; \t\t\t#actual enthalpy of steam leaving the compressor\n",
+ "#From steam tables for superheated steam at 500 kPa and enthalpy of H_act\n",
+ "T = 586; \t\t\t#temperature (K)\n",
+ "print 'Temperature of exhaust steam is %i K'%T\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work required for compression is 415.625000 kJ/kg\n",
+ "Temperature of exhaust steam is 586 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the least amount of power\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T1 = 288.; \t\t\t#temperature of surrounding (K)\n",
+ "T2 = 261.; \t\t\t#temperature of solution (K)\n",
+ "Q2 = 1000.; \t\t\t#heat removed (kJ/min)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the least amount of power\n",
+ "#Using eq. 5.57 (Page no. 137)\n",
+ "W = Q2*((T1-T2)/T2 )\t\t\t#power in kJ/min\n",
+ "P = (W*1000)/(746.*60) \t\t\t#power in hp\n",
+ "\n",
+ "# Results\n",
+ "print 'Least amount of power necessary is %f hp'%P"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Least amount of power necessary is 2.311177 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine COP heat rejected and lowest temperature\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T = 290.; \t\t\t#operating temperature (K)\n",
+ "W = 1000.; \t\t\t#work (J)\n",
+ "tof = 3516.67; \t\t\t#ton of refrigeration (W)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine COP, heat rejected and lowest temperature\n",
+ "#(a)\n",
+ "Q2 = tof;\n",
+ "COP = Q2/W; \t\t\t#coeffecient of performance\n",
+ "print '(a). COP is %f'%COP\n",
+ "\n",
+ "#(b)\n",
+ "Q1 = Q2+W; \t\t\t#heat rejected\n",
+ "print ' (b). Heat rejected is %f kW'%(Q1/1000.)\n",
+ "\n",
+ "#(c)\n",
+ "#Let T2 be the lowest temperature\n",
+ "T2 = T*(Q2/Q1);\n",
+ "print ' (c). Lowest possible temperature in refrigerator is %f K'%T2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). COP is 3.516670\n",
+ " (b). Heat rejected is 4.516670 kW\n",
+ " (c). Lowest possible temperature in refrigerator is 225.793405 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine COP at given conditions\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T2 = 266.;\n",
+ "T1 = 300.; \t\t\t#operating temperatures of vapour compression refrigeration cycle(K)\n",
+ "\n",
+ "#To determine COP at given conditions\n",
+ "#(a)\n",
+ "Ha = 656.; \t\t\t#(kJ/kg)\n",
+ "Hb = 724.; \t\t\t#(kJ/kg)\n",
+ "Hd = 144.; \t\t\t#(kJ/kg)\n",
+ "Hc = Hd;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Using eq. 5.61 (Page no. 139)\n",
+ "COP = (Ha-Hd)/(Hb-Ha);\n",
+ "print '(a). COP = %f'%COP\n",
+ "\n",
+ "#(b)\n",
+ "Ha = 652.; \t\t\t#(kJ/kg)\n",
+ "Hb = 758.; \t\t\t#(kJ/kg)\n",
+ "Hd = 159.; \t\t\t#(kJ/kg)\n",
+ "Hc = Hd;\n",
+ "eff = 0.75; \t\t\t#efficiency of compressor\n",
+ "COP = (Ha-Hd)/((Hb-Ha)*(1./eff));\n",
+ "print ' (b). COP = %f'%COP\n",
+ "\n",
+ "#(c). Ideal Carnot refrigerator\n",
+ "COP = T2/(T1-T2);\n",
+ "print ' (c). COP = %f'%COP\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). COP = 7.529412\n",
+ " (b). COP = 3.488208\n",
+ " (c). COP = 7.823529\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine power requirement and refrigeration capacity in tonnes\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "Tin_cool = 288.; \t\t\t#entering temperature of cooling water (K)\n",
+ "Tout_cool = 300.; \t\t\t#discharge temperature of cooling water (K)\n",
+ "m_c = 0.25; \t\t\t#mass flow rate of coling water (kg/s)\n",
+ "m = 0.5; \t\t\t#mass flow rate of ammonia (kg/min)\n",
+ "Ha = 1426.; \t\t\t#enthalpy of saturated ammonia vapour at 258 K (kJ/kg)\n",
+ "Hd = 281.5; \t\t\t#enthalpy of liquid ammonia at 294 K (kJ/kg)\n",
+ "eff = 0.9; \t\t\t#compressor efficiency\n",
+ "Cp = 4.2; \t\t\t#specific heat of water (kJ/kg K)\n",
+ "tof = 12660.; \t\t\t#ton of refrigeration (kJ/h)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine the power requirement and refrigeration capacity in tons\n",
+ "Q1 = m_c*Cp*(Tout_cool-Tin_cool); \t\t\t#heat rejected by compressor at constant pressure (kJ/s)\n",
+ "Q2 = (m/60.)*(Ha-Hd); \t\t\t#heat absorbed (kJ/s)\n",
+ "W = Q1-Q2; \t\t\t#work required (kJ/s)\n",
+ "P = (W*1000)/(eff*746); \t\t\t#power requirement of compressor (hp)\n",
+ "print 'Power requirement of the compressor is %f hp'%P\n",
+ "\n",
+ "rc = Q2*3600/tof; \t\t\t#refrigeration capacity (ton)\n",
+ "print ' Refrigeration capacity is %f ton'%rc\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power requirement of the compressor is 4.561364 hp\n",
+ " Refrigeration capacity is 2.712085 ton\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the COP and refrigeration circulation rate\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m1 = 10.; \t\t\t#machine rating (ton)\n",
+ "#Since 5 K approach is necessary\n",
+ "T1 = 293.+5; \t\t\t#temperature of cooling water (K)\n",
+ "T2 = 261.-5; \t\t\t#temperature of cold storage (K)\n",
+ "Ha = 181.; \t\t\t#enthalpy of saturated vapour at 256 K (kJ/kg)\n",
+ "Sa = 0.714; \t\t\t#entropy of saturated vapour at 256K (kJ/kg K)\n",
+ "Hc = 62.; \t\t\t#enthalpy of saturated liquid at 298 K (kJ/kg)\n",
+ "Sc = 0.231; \t\t\t#entropy of saturated liquid at 298 K (kJ/kg K)\n",
+ "Hb = 206.; \t\t\t#enthalpy of superheated vapour (kJ/kg)\n",
+ "Sb = 0.714; \t\t\t#entropy of superheated vapour (kJ/kg)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Combining the three relations, we get\n",
+ "Sd = Sc; \t\t\t#isentropic process\n",
+ "Hd = Ha-(T2*(Sa-Sd));\n",
+ "\n",
+ "#Using eq. 5.64 (Page no. 141)\n",
+ "COP = (Ha-Hd)/((Hb-Hc)-(Ha-Hd));\n",
+ "print 'COP = %f'%COP\n",
+ "\n",
+ "#Using equation 5.63 (Page no. 140)\n",
+ "m = (12660*m1)/(Ha-Hd); \t\t\t#refrigerant circulation rate (kg/h)\n",
+ "print ' Refrigerant circulation rate is %f kg/h'%m\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "COP = 6.075472\n",
+ " Refrigerant circulation rate is 1023.874224 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the COP and air circulation rate\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "m1 = 10.; \t\t\t#machine rating (ton)\n",
+ "#Assuming 5 K approach in refrigerator and cooler\n",
+ "Ta = 261.-5; \t\t\t#temperature of air leaving the refrigerator (K)\n",
+ "Tc = 293.+5; \t\t\t#temperature of air leaving the cooler (K)\n",
+ "gama = 1.4;\n",
+ "Cp = 1.008; \t\t\t#sp. heat of air (kJ/kg K)\n",
+ "P1 = 4.052;\n",
+ "P2 = 1.013; \t\t\t#operating pressures in bar\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine the COP and air circulation rate\n",
+ "#Using eq. 5.66 (Page no. 145)\n",
+ "Tb = Ta*(P1/P2)**((gama-1)/gama)\n",
+ "Td = (Tc*Ta)/Tb;\n",
+ "\n",
+ "#Using equation 5.68 (PAge no. 146)\n",
+ "COP = Ta/(Tb-Ta)\n",
+ "print 'COP = %f'%COP\n",
+ "\n",
+ "#Considering energy balance in refrigerator [m*Cp*(Ta-Td) = m1*12660]\n",
+ "m = (m1*12660)/(Cp*(Ta-Td)) \t\t\t#air circulation rate (kg/h)\n",
+ "print ' Air circulation rate is %i kg/h'%m\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "COP = 2.057637\n",
+ " Air circulation rate is 2264 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To verify that given heat pump is equivalent to 30 kW pump\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T1 = 300.; \t\t\t#indoor temperatur (K)\n",
+ "T2 = 290.; \t\t\t#outside temperature (K)\n",
+ "W_input = 1.; \t\t\t#1 kW heat pump\n",
+ "W_output = 30.; \t\t\t#given output (kW)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To verify that given heat pump is equivalent to 30 kW heater\n",
+ "Q2 = (T2/(T1-T2))*W_input; \t\t\t#heat absorbed\n",
+ "Q1 = Q2 + W_input; \t\t\t#heat rejected\n",
+ "\n",
+ "if(Q1==W_output):\n",
+ " print '1 kW pump if operated reversibly% is equivalent to a 30 kW heater'\n",
+ "else:\n",
+ " print 'The given heat pump is not equivalent to a 30 kW heater'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 kW pump if operated reversibly% is equivalent to a 30 kW heater\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the amount of fuel burned\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T1 = 295.; \t\t\t#temperature inside building (K)\n",
+ "T2 = 275.; \t\t\t#temperature of outside air (K)\n",
+ "eff = 0.25; \t\t\t#overall efficiency of unit\n",
+ "Hc = 890.9; \t\t\t#heat of combustion of fuel (kJ/mol)\n",
+ "conv = 0.33; \t\t\t#efficiency of conversion of heat of combustion to electricity\n",
+ "Q1 = 10**6; \t\t\t#amount of heat to be delivered\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the amount of fuel burned\n",
+ "COP = T1/(T1-T2)\n",
+ "W = Q1/COP; \t\t\t#work required to deliver Q1 kJ of heat\n",
+ "W_act = W/eff; \t\t\t#actual amount of electrical energy to be supplied\n",
+ "W_heat = W_act/conv; \t\t\t#heat energy required as heat of combustion\n",
+ "n = W_heat/Hc; \t\t\t#number of moles of fuel burned\n",
+ "\n",
+ "# Results\n",
+ "print 'The amount of fuel burned is %f kmol'%(n/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of fuel burned is 0.922412 kmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate fraction of liquid in inlet stream and temperature\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "#Referring steam tables at 2.54 bar\n",
+ "H1 = 2717.; \t\t\t#enthalpy of saturated vapour (kJ/kg)\n",
+ "H2 = 538.; \t\t\t#enthalpy of saturated liquid (kJ/kg)\n",
+ "S1 = 7.05; \t\t\t#entropy of saturated vapour (kJ/kg K)\n",
+ "S2 = 1.61; \t\t\t#entropy of saturated liquid (kJ/kg K)\n",
+ "\n",
+ "H = 2700.; \t\t\t#enthalpy of superheated steam at 1 bar and 385 K (kJ/kg)\n",
+ "S = 7.42; \t\t\t#entropy of superheated steam at 1 bar and 385 K (kJ/kg K)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x = (H-H1)/(H2-H1)\n",
+ "#From steam tables\n",
+ "T = 401.; \t\t\t#temperature of steam (K)\n",
+ "print '(a). For isenthalpic math.expansion'\n",
+ "print ' The fraction of liquid in inlet stream is %f'%x\n",
+ "print ' The temperature of stream is %i K'%T\n",
+ "\n",
+ "#(b)..The math.expansion is isentropic\n",
+ "#Since entropy of saturated vapour at inlet pressure (S1) is less than entropy of steam leaving the turbine (S)\n",
+ "#So% the inlet stream is superheated% therefore\n",
+ "x = 0;\n",
+ "#From steam tales\n",
+ "T = 478.; \t\t\t#temperature of superheated steam having entropy of 7.42 kJ/kg K\n",
+ "print '(b). For isentropic math.expansion'\n",
+ "print ' The fraction of liquid in inlet stream is %i'%x\n",
+ "print ' The temperature of stream is %i K'%T\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). For isenthalpic math.expansion\n",
+ " The fraction of liquid in inlet stream is 0.007802\n",
+ " The temperature of stream is 401 K\n",
+ "(b). For isentropic math.expansion\n",
+ " The fraction of liquid in inlet stream is 0\n",
+ " The temperature of stream is 478 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine fraction of air liquified and temperature of air\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "#Referring Fig. 5.15 (Page no. 151)\n",
+ "Hc = 516.; \t\t\t#enthalpy of high pressure gas at 120 bar and 306 K (kJ/kg)\n",
+ "Ha = 526.; \t\t\t#enthalpy of low pressure gas at 2 bar and 292 K (kJ/kg)\n",
+ "Hf = 121.; \t\t\t#entalpy of saturated liquid at 2 bar (kJ/kg)\n",
+ "Hg = 314.; \t\t\t#enthalpy of saturated vapour at 2 bar (kJ/kg)\n",
+ "\n",
+ "#To determine the fraction of air liquified and temperature of air\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)..\n",
+ "#Using equation 5.73 (Page no. 152)\n",
+ "x = (Hc-Ha)/(Hf-Ha) \t\t\t#fraction of air liquified\n",
+ "print '(a). The fraction of liquified air is %f'%x\n",
+ "\n",
+ "#(b)..\n",
+ "#Taking enthalpy balance around heat exchanger\n",
+ "Hd = Hc - (1-x)*(Ha-Hg)\n",
+ "#At enthalpy of Hd kJ/kg% from T-S diagram for air\n",
+ "T = 167.; \t\t\t#temperature in K\n",
+ "print ' (b). Temperature of air on high pressure side of throttle valve is %i K'%T\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). The fraction of liquified air is 0.024691\n",
+ " (b). Temperature of air on high pressure side of throttle valve is 167 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine ideal Rankine cycle efficiency thermal efficiency and rate of steam production\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "P2 = 2800.; \t\t\t#pressure of superheated steam (kPa)\n",
+ "P1 = 5.; \t\t\t#pressure after math.expansion (kPa)\n",
+ "e_turbine = 0.85; \t\t\t#isentropic turbine efficiency\n",
+ "e_pump = 0.8; \t\t\t#isentropic pump efficiency\n",
+ "V = 1.005*10**-3; \t\t\t#specific volume of saturated liquid at 5 kPaHl = \n",
+ "\n",
+ "#From steam tables:\n",
+ "Hl = 138.; \t\t\t#enthalpy of saturated liquid at 5 kPa (kJ/kg)\n",
+ "Hv = 2562.; \t\t\t#enthalpy of saturated vapour at 5 kPa (kJ/kg)\n",
+ "H3 = 3063.; \t\t\t#enthalpy of superheated steam at 2800 kPa and 598 K (kJ/kg)\n",
+ "Sl = 0.4764; \t\t\t#entropy of saturated liquid at 5 kPa (kJ/kg K)\n",
+ "Sv = 8.3951; \t\t\t#entropy of saturated vapour at 5 kPa (kJ/kg K)\n",
+ "S3 = 6.6875; \t\t\t#entropy of superheated steam at 2800 kPa and 598 K (kJ/kg K)\n",
+ " \n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine the ideal Rankine cycle efficiency% thermal efficiency and rate of steam production\n",
+ "\n",
+ "#(a)..The ideal Rankine cycle efficiency for the stated conditions\n",
+ "#Referring fig 5.19(b) (Page no. 155) and considering feed water pump\n",
+ "Ws = V*(P2-P1) \t\t\t#work done by pump (kJ/kg)\n",
+ "H2 = Hl+Ws;\n",
+ "#Considering isentropic math.expansion in turbine\n",
+ "S4 = S3;\n",
+ "x = (S4-Sl)/(Sv-Sl) \t\t\t#fraction of steam that is vapour\n",
+ "H4 = Hl + x*(Hv-Hl)\n",
+ "\t\t\t#Using eq. 5.80 (Page no. 155)\n",
+ "e_r = ((H3-H2)-(H4-Hl))/(H3-H2)\n",
+ "print '(a). The ideal Rankine cycle efficiency for the stated conditions is %i percent'%(e_r*100)\n",
+ "\n",
+ "#(b)..The thermal efficiency of plant\n",
+ "W_act = Ws/e_pump; \t\t\t#actual work requirement in pump\n",
+ "H_2 = Hl + W_act; \t\t\t#enthalpy of water leaving the feed water pump\n",
+ "W_out = e_turbine*(H3-H4) \t\t\t#actual work output\n",
+ "H_4 = H3-W_out; \t\t\t#actual enthalpy of steam leaving the turbine\n",
+ "e_act = ((H3-H_2)-(H_4-Hl))/(H3-H_2)\n",
+ "print ' (b). The actual efficiency is %f percent'%(e_act*100)\n",
+ "\n",
+ "#(c)..The rate of steam production\n",
+ "W_net = e_act*(H3-H_2) \t\t\t#net work output (kJ/kg)\n",
+ "rate = (3.6*10**6)/W_net; \t\t\t#steam produced in boiler (kg/h)\n",
+ "print ' (c). The rate of steam production is %f kg/h'%(rate)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). The ideal Rankine cycle efficiency for the stated conditions is 34 percent\n",
+ " (b). The actual efficiency is 29.664548 percent\n",
+ " (c). The rate of steam production is 4153.943111 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the work output thermal efficiency and rate of steam circulation\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "P2 = 7600.; \t\t\t#pressure of superheated steam (kPa)\n",
+ "P1 = 5.; \t\t\t#pressure after math.expansion (kPa)\n",
+ "V = 1.005*10**-3; \t\t\t#specific volume of saturated liquid (m**3/kg)\n",
+ "\n",
+ "#From steam tables:\n",
+ "H_l1 = 138.; \t\t\t#enthalpy of saturated liquid at 5 kPa (kJ/kg)\n",
+ "S_l1 = 0.4764; \t\t\t#entropy of saturated liquid at 5 kPa (kJ/kg K)\n",
+ "H_v1 = 2562.; \t\t\t#enthalpy of saturated vapour at 5 kPa (kJ/kg)\n",
+ "S_v1 = 8.3951; \t\t\t#entropy of saturated vapour at 5 kPa (kJ/kg K)\n",
+ "H_l2 = 830.; \t\t\t#enthalpy of saturated liquid at 1400 kPa(kJ/kg)\n",
+ "S_l2 = 2.2842; \t\t\t#entropy of saturated liquid at 1400 kPa (kJ/kg K)\n",
+ "H_v2 = 2790.; \t\t\t#enthalpy of saturated vapour at 1400 kPa (kJ/kg)\n",
+ "S_v2 = 6.4693; \t\t\t#entropy of saturated vapour at 1400 kPa (kJ/kg K)\n",
+ "H5 = 3226.; \t\t\t#enthalpy of superheated steam at 1400 kPa and 658 K\n",
+ "S5 = 7.2558; \t\t\t#entropy of superheated steam at 1400 kPa and 658 K\n",
+ "H3 = 3150.; \t\t\t#enthalpy of superheated steam at 7600 kPa and 673 K\n",
+ "S3 = 6.4022; \t\t\t#entropy of superheated steam at 1400 kPa and 673 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Let the fraction of steam in vapour state be x\n",
+ "S4 = S3; \t\t\t#as the math.expansion process is isentropic\n",
+ "x = (S4-S_l2)/(S_v2-S_l2)\n",
+ "H4 = H_l2 + x*(H_v2-H_l2)\n",
+ "W_high = H3-H4;\n",
+ "\n",
+ "#For low pressure turbine\n",
+ "S6 = S5; \t\t\t#isentropic math.expansion\n",
+ "x = (S6-S_l1)/(S_v1-S_l1)\n",
+ "H6 = H_l1 + x*(H_v1-H_l1)\n",
+ "W_low = H5-H6;\n",
+ "\n",
+ "print '(a)'\n",
+ "print ' The work output of high pressure turbine is %i kJ/kg'%W_high\n",
+ "print ' The work output of low pressure turbine is %i kJ/kg'%W_low\n",
+ "\n",
+ "#(b)\n",
+ "#Work output of feed pump is [-Ws = intg(VdP)]\n",
+ "Ws = V*(P2-P1)\n",
+ "H2 = H_l1+Ws;\n",
+ "#Using eq. 5.82 (Page no. 159)\n",
+ "eff = ((H3-H2)+(H5-H4)-(H6-H_l1))/((H3-H2)+(H5-H4))\n",
+ "print ' (b)'\n",
+ "print ' Thermal efficiency is %f percent'%(eff*100)\n",
+ "\n",
+ "#(c)\n",
+ "#The numerator of eq. 5.82 gives net work output\n",
+ "W_net = (H3-H2)+(H5-H4)-(H6-H_l1)\n",
+ "#For 1000 kW of net work output\n",
+ "rate = 3.6*10**6/W_net;\n",
+ "print ' (c)'\n",
+ "print ' The rate of steam circulation is %f kg/h'%rate\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " The work output of high pressure turbine is 391 kJ/kg\n",
+ " The work output of low pressure turbine is 1012 kJ/kg\n",
+ " (b)\n",
+ " Thermal efficiency is 40.225451 percent\n",
+ " (c)\n",
+ " The rate of steam circulation is 2577.792156 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine fraction of steam withdrawn and thermal efficiency of cycle\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "P2 = 2800.; \t\t\t#pressure of superheated steam (kPa)\n",
+ "P1 = 275.; \t\t\t#pressure of withdrawn steam (kPa)\n",
+ "V = 1.070*10**-3; \t\t\t#specific volume of saturated liquid at 275 kPa\n",
+ "\n",
+ "#From steam tables:\n",
+ "H6 = 138.; \t\t \t#enthalpy of saturated liquid at 5 kPa\n",
+ "S6 = 0.4764; \t\t\t#entropy of saturated liquid at 5 kPa\n",
+ "H_v1 = 2562.; \t\t\t#enthalpy of saturated vapour at 5 kPa\n",
+ "S_v1 = 8.3951; \t\t\t#entropy of saturated vapour at 5 kPa\n",
+ "H1 = 549.; \t\t\t #enthalpy of saturated liquid at 275 kPa\n",
+ "S1 = 1.6408; \t\t\t#entropy of saturated liquid at 275 kPa\n",
+ "H_v2 = 2721.; \t\t\t#enthalpy of saturated vapour at 275 kPa\n",
+ "S_v2 = 7.0209; \t\t\t#entropy of saturated vapour at 275 kPa\n",
+ "H3 = 3063.; \t\t\t#enthalpy of superheated steam at 2800 kPa and 598 K\n",
+ "S3 = 6.6875; \t\t\t#entropy of superheated steam at 2800 kPa and 598 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine the fraction of steam withdrawn and thermal efficiency of cycle\n",
+ "#Referring fig. 5.23 (Page no.161)\n",
+ "S4 = S3; \t\t\t#isentropic math.expansion\n",
+ "x = (S4-S1)/(S_v2-S1) \t\t\t#quality of steam\n",
+ "H4 = H1 + x*(H_v2-H1)\n",
+ "H7 = H6; \t\t\t #as the power input to the condensate pump is neglegible\n",
+ "\n",
+ "#Applying energy balance around feed water heater\n",
+ "m = (H1-H7)/(H4-H7 )\t\t\t#fraction of steam extracted\n",
+ "print 'Fraction of steam withdrawn is %f'%m\n",
+ "\n",
+ "W_in = V*(P2-P1) \t\t\t#work input to the feed water pump\n",
+ "H2 = H1+W_in;\n",
+ "#Considering isentropic math.expansion in turbine\n",
+ "S5 = S3;\n",
+ "x = (S5-S6)/(S_v1-S6)\n",
+ "H5 = H6 + x*(H_v1-H6)\n",
+ "#Using eq. 5.85 (Page no.162)\n",
+ "eff = ((H3-H2)-(1-m)*(H5-H6))/(H3-H2)\n",
+ "print ' Thermal efficiency is %f percent'%(eff*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fraction of steam withdrawn is 0.167865\n",
+ " Thermal efficiency is 36.999645 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine mean effective pressure\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "r = 8.; \t\t\t#compression ratio\n",
+ "T1 = 290.; \t\t\t#temperature at beginning (K)\n",
+ "P1 = 100.; \t\t\t#pressure at the beginning (kPa)\n",
+ "Q1 = 450.; \t\t\t#heat transferred per cycle (kJ/kg K)\n",
+ "Cp = 1.005; \t\t\t#specific heat of air (kJ/kg K)\n",
+ "Cv = 0.718; \t\t\t#specific heat of air (kJ/kg K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "M = 29.; \t\t\t#molecular wt of air\n",
+ "\n",
+ "#To determine mean effective pressure\n",
+ "#Basis:\n",
+ "m = 1.; \t\t\t#mass of air (kg)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)\n",
+ "#Referring fig. 5.24 (Page no. 164)\n",
+ "V1 = (m*R*1000*T1)/(M*P1*10**3)\n",
+ "\n",
+ "#Conditions at state 2\n",
+ "V2 = V1/r;\n",
+ "gama = Cp/Cv;\n",
+ "T2 = T1*(r**(gama-1))\n",
+ "P2 = P1*(r**gama )\n",
+ "print '(a)'\n",
+ "print ' At the end of first process'\n",
+ "print ' Temperature = %f K'%T2\n",
+ "print ' Pressure = %f kPa'%P2\n",
+ "\n",
+ "#Conditions at state 3\n",
+ "#Constant volume process\n",
+ "V3 = V2;\n",
+ "T3 = Q1/Cv + T2;\n",
+ "P3 = (T3/T2)*P2;\n",
+ "print ' At the end of second process'\n",
+ "print ' Temperature = %f K'%T3\n",
+ "print ' Pressure = %f kPa'%P3\n",
+ "\n",
+ "#Conditions at state 4\n",
+ "T4 = T3/(r**(gama-1))\n",
+ "P4 = P3/(r**gama)\n",
+ "print ' At the end of third process'\n",
+ "print ' Temperature = %f K'%T4\n",
+ "print ' Pressure = %f kPa'%P4\n",
+ "Q2 = Cv*(T4-T1) \t\t\t#heat rejected during the constant volume process\n",
+ "\n",
+ "#(b)\n",
+ "#Using eq. 5.88 (Page no. 165)\n",
+ "eff = 1 - ((1./r)**(gama-1))\n",
+ "print ' (b)'\n",
+ "print ' Thermal efficiency is %f'%eff\n",
+ "\n",
+ "#(c)\n",
+ "W = Q1-Q2; \t\t\t#work done\n",
+ "print ' (c)'\n",
+ "print ' Work done is %f kJ/kg'%W\n",
+ "\n",
+ "#(d)\n",
+ "Pm = W/(V1-V2)\n",
+ "print ' (d)'\n",
+ "print ' Mean effective pressure is %f kPa'%Pm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " At the end of first process\n",
+ " Temperature = 665.859247 K\n",
+ " Pressure = 1836.853096 kPa\n",
+ " At the end of second process\n",
+ " Temperature = 1292.600195 K\n",
+ " Pressure = 3565.793640 kPa\n",
+ " At the end of third process\n",
+ " Temperature = 562.962905 K\n",
+ " Pressure = 194.125140 kPa\n",
+ " (b)\n",
+ " Thermal efficiency is 0.564473\n",
+ " (c)\n",
+ " Work done is 254.012634 kJ/kg\n",
+ " (d)\n",
+ " Mean effective pressure is 349.170259 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine work done thermal effeciency and mean effective pressure\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "r = 15.; \t\t\t#compression ratio\n",
+ "P1 = 100.; \t\t\t#pressure in the beginning (kPa)\n",
+ "T1 = 300.; \t\t\t#temperature in thebeginning (K)\n",
+ "Q1 = 500.; \t\t\t#heat transfer rate (kJ/kg)\n",
+ "M = 29.; \t\t\t#molecular wt of air\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "gama = 1.3997214\n",
+ "#Specific heats of air (kJ/kg K)\n",
+ "Cp = 1.005;\n",
+ "Cv = 0.718;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine work done thermal efficiency and mean effective pressure\n",
+ "#(a)\n",
+ "#Isentropic compression 1-2\n",
+ "V1 = (R*1000*T1)/(M*P1*10**3)\n",
+ "T2 = T1*r**(gama-1)\n",
+ "P2 = P1*r**gama;\n",
+ "V2 = V1/r;\n",
+ "print '(a)'\n",
+ "print ' At the end of first process'\n",
+ "print ' Temperature = %f K'%T2\n",
+ "print ' Pressure = %f kPa'%P2\n",
+ "\n",
+ "#Consatnt pressure heat addition 2-3\n",
+ "T3 = Q1/Cp + T2;\n",
+ "V3 = (T3/T2)*V2;\n",
+ "P3 = P2;\n",
+ "print ' At the end of second process'\n",
+ "print ' Temperature = %f k'%T3\n",
+ "print ' Pressure = %f kPa'%P3\n",
+ "\n",
+ "#Isentropic math.expansion 3-4\n",
+ "V4 = V1;\n",
+ "T4 = T3/((V4/V3)**(gama-1))\n",
+ "P4 = P3*((V3/V4)**gama)\n",
+ "print ' At the end of third process'\n",
+ "print ' Temperature = %f K'%T4\n",
+ "print ' Pressure = %f kPa'%P4\n",
+ "Q2 = Cv*(T4-T1) \t\t\t#heat rejected 4-1\n",
+ "\n",
+ "#(b)\n",
+ "Wnet = Q1-Q2;\n",
+ "print ' (b)'\n",
+ "print ' Net work done per cycle per kg air is %f kJ/kg'%Wnet\n",
+ "\n",
+ "#(c)\n",
+ "eff = Wnet/Q1; \t\t\t#thermal efficiency\n",
+ "print ' (c)'\n",
+ "print ' Thermal efficiency is %f'%eff\n",
+ "\n",
+ "#(d)\n",
+ "Pm = Wnet/(V1-V2) \t\t\t#mean effective pressure\n",
+ "print ' (d)'\n",
+ "print ' Mean effective pressure is %f kPa'%Pm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " At the end of first process\n",
+ " Temperature = 885.584689 K\n",
+ " Pressure = 4427.923445 kPa\n",
+ " At the end of second process\n",
+ " Temperature = 1383.097127 k\n",
+ " Pressure = 4427.923445 kPa\n",
+ " At the end of third process\n",
+ " Temperature = 559.936687 K\n",
+ " Pressure = 186.645562 kPa\n",
+ " (b)\n",
+ " Net work done per cycle per kg air is 313.365459 kJ/kg\n",
+ " (c)\n",
+ " Thermal efficiency is 0.626731\n",
+ " (d)\n",
+ " Mean effective pressure is 390.374167 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine temperature pressure work and thermal effeciency\n",
+ "\n",
+ "# Variables\n",
+ "#Given:\n",
+ "T1 = 300.; \t\t\t#initial temperature (K)\n",
+ "P1 = 100.; \t\t\t#initial pressure (kPa)\n",
+ "T3 = 1200.; \t\t\t#max temperature (K)\n",
+ "P3 = 500.; \t\t\t#max pressure (kPa)\n",
+ "Cp = 1.005; \t\t\t#(kJ/kg K)\n",
+ "Cv = 0.718; \t\t\t#(kJ/kg K)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To determine pressure and temperature work and thermal efficiency\n",
+ "gama = Cp/Cv;\n",
+ "\n",
+ "#(a)\n",
+ "P4 = P1;\n",
+ "P2 = P3;\n",
+ "#Isentropic compression 1-2\n",
+ "T2 = T1*((P2/P1)**((gama-1)/gama))\n",
+ "print '(a)'\n",
+ "print ' At the end of first process'\n",
+ "print ' Temperature = %f K'%T2\n",
+ "print ' Pressure = %f kPa'%P2\n",
+ "\n",
+ "#Process 2-3\n",
+ "print ' At the end of second process'\n",
+ "print ' Temperature = %f K'%T3\n",
+ "print ' Pressure = %f kPa'%P3\n",
+ "\n",
+ "#Isentropic math.expansion 3-4\n",
+ "T4 = T3/((P3/P4)**((gama-1)/gama))\n",
+ "print ' At the end of third process'\n",
+ "print ' Temperature = %f K'%T4\n",
+ "print ' Pressure = %f kPa'%P4\n",
+ "\n",
+ "#(b)\n",
+ "W_comp = Cp*(T2-T1) \t\t\t#work required by compressor\n",
+ "print ' (b)'\n",
+ "print ' Work required by compressor is %f kJ/kg'%W_comp\n",
+ "\n",
+ "#(c)\n",
+ "W_turb = Cp*(T3-T4 )\t\t\t#work done by turbine\n",
+ "print ' (c)'\n",
+ "print ' Work done by turbine is %f kJ/kg'%W_turb\n",
+ "\n",
+ "#(d)\n",
+ "eff = 1-(P1/P2)**((gama-1)/gama)\n",
+ "print ' (d)'\n",
+ "print ' Thermal efficiency is %f'%eff\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " At the end of first process\n",
+ " Temperature = 475.037193 K\n",
+ " Pressure = 500.000000 kPa\n",
+ " At the end of second process\n",
+ " Temperature = 1200.000000 K\n",
+ " Pressure = 500.000000 kPa\n",
+ " At the end of third process\n",
+ " Temperature = 757.835397 K\n",
+ " Pressure = 100.000000 kPa\n",
+ " (b)\n",
+ " Work required by compressor is 175.912379 kJ/kg\n",
+ " (c)\n",
+ " Work done by turbine is 444.375426 kJ/kg\n",
+ " (d)\n",
+ " Thermal efficiency is 0.368471\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch6.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch6.ipynb
new file mode 100644
index 00000000..056e7127
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch6.ipynb
@@ -0,0 +1,787 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Thermodynamic Properties of Pure Fluids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine change in entropy of system\n",
+ "\n",
+ "#Given:\n",
+ "betta = 1.25*10**-3; \t\t\t#coeffecient of math.expansion (K**-1)\n",
+ "V = 0.1; \t\t\t#molar volume of organic liquid (m**3/kmol)\n",
+ "P2 = 20.; \t\t\t#final pressure (bar)\n",
+ "P1 = 1.; \t\t\t#initial pressure (bar)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the change in entropy of system\n",
+ "#betta = (1/V)*(del V/del T)p\n",
+ "#Let k = (del V/del T)p\n",
+ "k = betta*V;\n",
+ "\n",
+ "#Considering Maxwell's relation Eq. 6.24 (Page no. 193)\n",
+ "#dS = -k*(dP)\n",
+ "S = -k*(P2-P1)*10**5; \t\t\t#entropy change (J/kmol K)\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in entropy is %f J/kmol K'%S\n",
+ "print ' It is assumed that (del V/del T)p is constant in the pressure range 1 to 20 bar'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy is -237.500000 J/kmol K\n",
+ " It is assumed that (del V/del T)p is constant in the pressure range 1 to 20 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate vapour pressure of water at 363 K\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 363.; \t\t\t#temperature (K)\n",
+ "T2 = 373.; \t\t\t#temperature (K)\n",
+ "P2 = 101.3; \t\t\t#vapour pressure at 373 K (kPa)\n",
+ "H = 2275.*18; \t\t\t#mean heat of vaporisation (kJ/kmol)\n",
+ "R =8.314; \t\t\t#ideal gas constant (kJ/kmol K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate vapour pressure of water at 363 K\n",
+ "#Using eq. 6.28 (Page no. 196)\n",
+ "P1 = P2/(math.e**((H/R)*((1./T1)-(1./T2))))\n",
+ "\n",
+ "# Results\n",
+ "print ' Vapour pressure of water at 363 K is %f kPa'%P1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Vapour pressure of water at 363 K is 70.408579 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the melting point of mercury at 10 bar\n",
+ "\n",
+ "# Variables\n",
+ "d_l = 13.69*10**3; \t\t\t#density of mercury in liquid state (kg/m**3)\n",
+ "d_s = 14.193*10**3; \t\t\t#density of mercury in solid state (kg/m**3)\n",
+ "T1 = 234.33; \t\t\t#temperature in K\n",
+ "P1 = 1.; \t\t\t#initial pressure in bar\n",
+ "P2 = 10.; \t\t\t#final pressure in bar\n",
+ "Hf = 9.7876; \t\t\t#heat of fusion of mercury (kJ/kg)\n",
+ "\n",
+ "# Calculations\n",
+ "#Assuming del_V/del_H remains constant% math.log(T2/T1) = (del_V/del_H)*(P2-P1)\n",
+ "del_V = (1./d_l)-(1./d_s)\n",
+ "T2 = T1*(math.e**((del_V/Hf)*(P2-P1)))\n",
+ "\n",
+ "# Results\n",
+ "print 'The melting point of mercury at 10 bar is %f K'%T2\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The melting point of mercury at 10 bar is 234.330558 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4, page no:198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate increase in entropy of solid magnesium\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 300.; \t\t\t#initial temperature (K)\n",
+ "T2 = 800.; \t\t\t#final temperature (K)\n",
+ "\n",
+ "# Calculations\n",
+ "#Heat capacity (J/mol K)\n",
+ "#Cp = 26.04+(5.586*10**-3*T)+(28.476*10**4*T**-2)\n",
+ "import math\n",
+ "S = 26.04*math.log(T2/T1)+5.586*10**-3*(T2-T1)+28.476*10**4/(-2)*(T2**-2-T1**-2)\n",
+ "\n",
+ "# Results\n",
+ "print 'The increase in entropy of solid magnesium is %f J/mol K'%S\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The increase in entropy of solid magnesium is 29.693325 J/mol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate internal energy enthalpy entropy and freenergy for 1 mole of nitrogen\n",
+ "\n",
+ "# Variables\n",
+ "T = 773.; \t\t\t#temperature (K)\n",
+ "P = 100.; \t\t\t#pressure (bar)\n",
+ "Ho = 0; \t\t\t#enthalpy of nitrogen at 273 K and 1 bar\n",
+ "So = 192.4; \t\t\t#entropy of nitrogen at 298 K and 1 bar\n",
+ "To = 273.; \t\t\t#(K)\n",
+ "Po = 1.; \t\t\t#(bar)\n",
+ "R = 8.314; \t\t\t#ideal gas constant (kJ/kmol K)\n",
+ "\n",
+ "# Calculations\n",
+ "#Cp = 27.3+(4.2*10**-3*T) molal heat capacity at 1 bar\n",
+ "#To calculate internal energy enthalpy entropy and free energyfor one mole of nitrogen\n",
+ "#Step 1:\n",
+ "#Assuming that nitrogen is initially at 273 K and 1 bar\n",
+ "#del_H1 = intg(CpdT)\n",
+ "del_H1 = 27.3*(T-To)+4.2*10**-3*(T**2-To**2)/2;\n",
+ "#Assuming that nitrogen is initially at 298 K and 1 bar\n",
+ "#del_S1 = intg(Cp*(dT/T))\n",
+ "del_S1 = 27.3*math.log(T/To)+4.2*10**-3*(T-To)\n",
+ "H1 = Ho + del_H1;\n",
+ "S1 = So + del_S1;\n",
+ "\n",
+ "#Step 2:\n",
+ "#del_H2 = [V - T*(del_V/del_T)p]dP\n",
+ "#Since nitrogen behaves as ideal gas\n",
+ "#(del_V/del_T)p = R/P% V-(R*T)/P = 0\n",
+ "del_H2 = 0.;\n",
+ "del_S2 = -R*math.log(P/Po)\n",
+ "H = H1 + del_H2;\n",
+ "S = S1 + del_S2;\n",
+ "\n",
+ "#Internal energy: U = H-PV = H-RT (J/mol)\n",
+ "U = H - (R*T)\n",
+ "\n",
+ "#Gibbs free energy (J/mol)\n",
+ "G = H-(T*S)\n",
+ "\n",
+ "# Results\n",
+ "print 'Enthalpy is %5.3e J/mol'%H\n",
+ "print ' Entropy is %f J/mol K'%S\n",
+ "print ' Internal energy is %4.3e J/mol'%U\n",
+ "print ' Gibbs free energy is %4.3e J/mol'%G\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enthalpy is 1.475e+04 J/mol\n",
+ " Entropy is 184.626653 J/mol K\n",
+ " Internal energy is 8.322e+03 J/mol\n",
+ " Gibbs free energy is -1.280e+05 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate entropy change and mean heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "#Equation of state: P(V-B) = RT + (A*P**2)/T\n",
+ "Cp = 33.6; \t\t\t#mean specific heat at atmosheric pressure (J/mol K)\n",
+ "A = 1*10**-3; \t\t\t#m**3 K/(bar)mol\n",
+ "B = 8.0*10**-5; \t\t\t#m**3/mol\n",
+ "R = 8.314*10**-5; \t\t\t#ideal gas constant (m**3 (bar)/mol K)\n",
+ "\n",
+ "import math\n",
+ "#For step 1:\n",
+ "Po = 4.; \t\t\t#pressure at A (bar)\n",
+ "P1 = 1.; \t\t\t#pressure at C (bar)\n",
+ "T = 300.; \t\t\t#temperature (K)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#del_S1 = intg[(del_V/del_T)pdP]\n",
+ "del_S1 = (R*math.log(Po/P1) - (A/T**2)*(Po**2-P1**2)/2)*10**5; \t\t\t#(J/mol K)\n",
+ "\n",
+ "#For step 2:\n",
+ "T1 = 300.; \t\t\t#temperature at C (K)\n",
+ "T2 = 400.; \t\t\t#temperature at D (K)\n",
+ "del_S2 = Cp*math.log(T2/T1) \t\t\t#(J/mol K)\n",
+ "\n",
+ "#For step 3:\n",
+ "P2 = 1.; \t\t\t#pressure at D (bar)\n",
+ "P3 = 12.; \t\t\t#pressure at B (bar)\n",
+ "T = 400.; \t\t\t#temperature (K)\n",
+ "del_S3 = (R*math.log(P2/P3) - (A/T**2)*(P2**2-P3**2)/2)*10**5; \t\t\t#(J/mol K)\n",
+ "S = del_S1+del_S2+del_S3; \t\t\t#total entropy change\n",
+ "print '(a). Total entropy change is %f J/mol K'%S\n",
+ "\n",
+ "#(b). The mean heat capacity at 12 bar\n",
+ "P1 = 4.; \t\t\t#pressure at A (bar)\n",
+ "P2 = 12.; \t\t\t#pressure at Co (bar)\n",
+ "T = 300.; \t\t\t#temperature (K)\n",
+ "del_S1 = R*math.log(P1/P2) - (A/T**2)*(P1**2-P2**2)/2;\n",
+ "\n",
+ "#For CoB\n",
+ "T2 = 400.; \t\t\t#temperature at B (K)\n",
+ "T1 = 300.; \t\t\t#temperature at Co (K)\n",
+ "del_S2 = S-del_S1;\n",
+ "Cpm = del_S2/(math.log(T2/T1))\n",
+ "print ' (b). The mean heat capacity at 12 bar is %f J/mol K'%Cpm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). Total entropy change is 0.568609 J/mol K\n",
+ " (b). The mean heat capacity at 12 bar is 1.976835 J/mol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate Cv for mercury\n",
+ "\n",
+ "# Variables\n",
+ "betta = 1.8*10**-4; \t\t\t#coeffecient of volume math.expansion (K**-1)\n",
+ "k = 3.9*10**-6; \t\t\t#coeffecient of compressibility (bar**-1)\n",
+ "T = 273.; \t\t\t#temperature in K\n",
+ "d = 13.596*10**3; \t\t\t#density (kg/m**3)\n",
+ "Cp = 0.14*10**3; \t\t\t#(J/kg K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate Cv for mercury\n",
+ "#Using equation 6.55 (Page no. 208)\n",
+ "Cv = Cp - (betta**2*T*10**5)/(k*d)\n",
+ "\n",
+ "# Results\n",
+ "print 'Cv for mercury is %f J/kg K'%Cv\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cv for mercury is 123.318623 J/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To estimate the fugacity of ammonia\n",
+ "\n",
+ "# Variables\n",
+ "#Eqution of state: P(V-b) = RT\n",
+ "P = 10.; \t\t\t#pressure (bar)\n",
+ "T = 298.; \t\t\t#temperature (K)\n",
+ "b = 3.707*10**-5; \t\t\t#Vander Waal's constant (m**3/mol)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To estimate the fugacity of ammonia\n",
+ "#Since PV = RT + Pb% Z = 1 + (Pb/RT)\n",
+ "#Using equation 6.127 (Page no. 228)\n",
+ "f = P*(math.e**((b*P*10**5)/(R*T)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Fugacity f = %f bar'%f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity f = 10.150747 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the fugacity of gas\n",
+ "\n",
+ "# Variables\n",
+ "#intg(alphadP) = -556.61 J/mol\n",
+ "P = 50.; \t\t\t#pressure in bar\n",
+ "T = 300.; \t\t\t#temperature in K\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the fugacity of gas\n",
+ "#Using equation 6.130 (Page no. 230)\n",
+ "f = P*math.e**(-556.61/(R*T))\n",
+ "\n",
+ "# Results\n",
+ "print 'Fugacity of gas at 50 bar and 300 K is %i bar'%f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity of gas at 50 bar and 300 K is 39 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the fugacity coeffeceint at given pressure\n",
+ "\n",
+ "# Variables\n",
+ "#Equation of state: PV = RT(1-0.00513P)\n",
+ "P = [1, 5, 10]; \t\t\t#pressures in bar\n",
+ "phi = [0,0,0]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(3):\n",
+ " phi[i] = math.e**(-0.00513*P[i])\n",
+ " print ' Fugacity coeffecient at %i bar is %f'%(P[i],phi[i])\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Fugacity coeffecient at 1 bar is 0.994883\n",
+ " Fugacity coeffecient at 5 bar is 0.974676\n",
+ " Fugacity coeffecient at 10 bar is 0.949994\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the fugacity of pure ethylene\n",
+ "\n",
+ "# Variables\n",
+ "P = 100.; \t\t\t#pressure in bar\n",
+ "T = 373.; \t\t\t#temperature in K\n",
+ "a = 0.453; \t\t\t#Vander Waal's constant (J m**3/mol**2)\n",
+ "b = 0.571*10**-4; \t\t\t#Vander Waal's constant (m**3/mol)\n",
+ "V = 2.072*10**-4; \t\t\t#molar volume (m**3/mol)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the fugacity of pure ethylene\n",
+ "#Using eq. 6.139 (Page no. 233)\n",
+ "ln_f = (b/(V-b)) - ((2*a)/(R*T*V)) + math.log((R*T*10**-5)/(V-b) )\n",
+ "f = math.e**ln_f;\n",
+ "\n",
+ "# Results\n",
+ "print 'Fugacity is %f bar'%f\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity is 73.789328 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine fugacity and fugacity coeffecient of steam\n",
+ "\n",
+ "# Variables\n",
+ "T = 623.; \t\t\t#temperature in K\n",
+ "\n",
+ "#Data from steam tables:\n",
+ "H = 3159.; \t\t\t#enthalpy at 1000 kPa and 623 K (kJ/kg)\n",
+ "S = 7.3; \t\t\t#entropy at 1000 kPa and 623 K (kJ/kg K)\n",
+ "Ho = 3176.; \t\t\t#enthalpy at 101.3 kPa and 623 K (kJ/kg)\n",
+ "So = 8.38; \t\t\t#entropy at 101.3 kPa and 623 K (kJ/kg K)\n",
+ "fo = 101.3; \t\t\t#fugacity at 101.3 kPa (kPa)\n",
+ "R = 8.314/18; \t\t\t#ideal gas consatnt (kJ/kg K)\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine fugacity and fugacity coeffecient of steam\n",
+ "ln_phi = (1/(R*T))*((H-Ho)-T*(S-So))\n",
+ "f = fo*math.e**ln_phi;\n",
+ "phi = f/fo;\n",
+ "\n",
+ "# Results\n",
+ "print 'Fugacity of steam is %f bar'%(f/100)\n",
+ "print ' Fugacity coeffecient is %f'%phi\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity of steam is 9.895333 bar\n",
+ " Fugacity coeffecient is 9.768345\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To estimate fugacity of ammonia\n",
+ "\n",
+ "# Variables\n",
+ "T = 473.; \t\t\t#temperature in K\n",
+ "P = 50.*10**5; \t\t\t#pressure in Pa\n",
+ "d = 24.3; \t\t\t#density of ammonia (kg/m**3)\n",
+ "m = 17.; \t\t\t#molecular wt of ammonia\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To estimate the fugacity of ammonia\n",
+ "V = m/(d*1000) \t\t\t#molar volume of ammonia (m**3/kmol)\n",
+ "#Using eq. 6.142 (Page no. 234)\n",
+ "f = (V*(P**2))/(R*T)\n",
+ "\n",
+ "# Results\n",
+ "print 'The fugacity of ammonia is %f bar'%(f/10**5)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fugacity of ammonia is 44.474543 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the fugacity of liquid water\n",
+ "\n",
+ "# Variables\n",
+ "T = 303.; \t\t\t#temperature in K\n",
+ "P = 10.; \t\t\t#pressure in bar\n",
+ "Ps = 4.241/100; \t\t\t#saturation pressure (bar)\n",
+ "sp_vol = 1.004 *10**-3; \t\t\t#specific volume at 303 K (m**3/kg)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate the fugacity of liquid water\n",
+ "V = sp_vol*10**-3*18; \t\t\t#molar volume (m**3/mol)\n",
+ "#Assuming vapour behaves as an ideal gas\n",
+ "f_sat = Ps;\n",
+ "#Using Eq. 6.144 (Page no. 235)\n",
+ "ln_phi = (V/(R*T))*(P-Ps)*10**5;\n",
+ "f = f_sat*math.e**ln_phi;\n",
+ "\n",
+ "# Results\n",
+ "print 'Fugacity of liquid water at given conditions is %f bar'%f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity of liquid water at given conditions is 0.042714 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the fugacity of n butane in liquid state at given conditions\n",
+ "\n",
+ "# Variables\n",
+ "T = 350.; \t\t\t#temperature in K\n",
+ "P = 60.; \t\t\t#pressure in bar\n",
+ "Ps = 9.35; \t\t\t#vapour pressure at 350 K (bar)\n",
+ "V = 0.1072*10**-3; \t\t\t#molar volume (m**3/mol\n",
+ "phi = 0.834; \t\t\t#fugacity coeffecient\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "import math\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine fugaity of n butane in liquid state at given conditions\n",
+ "f_sat = phi*Ps;\n",
+ "#Using eq. 6.144 (Page no. 235)\n",
+ "ln_phi = (V/(R*T))*(P-Ps)*10**5;\n",
+ "f = f_sat*math.e**ln_phi;\n",
+ "\n",
+ "# Results\n",
+ "print 'Fugacity of n-butane in liquid state at given conditions is %f bar'%f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity of n-butane in liquid state at given conditions is 9.397539 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the activity of solid magnesium\n",
+ "\n",
+ "# Variables\n",
+ "M = 24.32; \t\t\t#molecular wt of solid magnesium\n",
+ "T = 300.; \t\t\t#temperature in K\n",
+ "P = 10.; \t\t\t#pressure in bar\n",
+ "Po = 1.; \t\t\t#reference state pressure (bar)\n",
+ "R = 8.314\n",
+ "d = 1.745*10**3; \t\t\t#density of Mg at 300 K in kg/m**3\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the ativity of solid magnesiun\n",
+ "#Using eq. 6.149 (Page no. 237)\n",
+ "ln_a = (M/(d*10**3*R*T))*(P-Po)*10**5;\n",
+ "a = (math.e)**ln_a;\n",
+ "\n",
+ "# Results\n",
+ "print 'Acivity of solid magnesium at 300 K and 10 bar is %f'%a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Acivity of solid magnesium at 300 K and 10 bar is 1.005042\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch7.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch7.ipynb
new file mode 100644
index 00000000..b0e53020
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch7.ipynb
@@ -0,0 +1,888 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Properties of Solutions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the volume of mixture\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.1; \t\t\t#volume of mixture required (m**3)\n",
+ "Ve = 0.03; \t\t\t#volume of alcohol\n",
+ "Vw = 0.07; \t\t\t#volume of water\n",
+ "de = 789.; \t\t\t#density of ethanol (kg/m**3)\n",
+ "dw = 997.; \t\t\t#density of water (kg/m**3)\n",
+ "pe = 53.6*10**-6; \t\t\t#partial molar volume of ethanol (m**3/mol)\n",
+ "pw = 18.*10**-6; \t\t\t#partial molar volume of water (m**3/mol)\n",
+ "Me = 46.; \t\t\t#molecular wt of ethanol\n",
+ "Mw = 18.; \t\t\t#molecular wt of water\n",
+ "\n",
+ "# Calculations\n",
+ "#To find the volume of mixture\n",
+ "ne = (Ve*de*10**3)/Me; \t\t\t#number of moles of ethanol\n",
+ "nw = (Vw*dw*10**3)/Mw; \t\t\t#number of moles of water\n",
+ "xe = ne/(ne+nw) \t\t\t#mole fraction of ethanol\n",
+ "xw = 1-ne; \t\t\t#mole fraction of water\n",
+ "act_V = (ne*pe)+(nw*pw)\n",
+ "\n",
+ "# Results\n",
+ "if (V==act_V) :\n",
+ " print 'It is possible to prepare the required solution'\n",
+ "else:\n",
+ " Ve_act = (Ve/act_V)*V;\n",
+ " Vw_act = (Vw/act_V)*V;\n",
+ " print ' For the given volumes of ethanol and water, it is not possible to prepare 0.1 cubic m of mixture'\n",
+ " print ' Required volume of ethanol is %f cubic m'%Ve_act\n",
+ " print ' Required volume of water is %f cubic m'%Vw_act\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " For the given volumes of ethanol and water, it is not possible to prepare 0.1 cubic m of mixture\n",
+ " Required volume of ethanol is 0.030810 cubic m\n",
+ " Required volume of water is 0.071890 cubic m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the required volume of methanol and water\n",
+ "\n",
+ "# Variables\n",
+ "V = 2.; \t\t\t#volume of desired solution (m**3)\n",
+ "x1 = 0.3; \t\t\t#moles fraction of methanol\n",
+ "x2 = 0.7; \t\t\t#moles fraction of water\n",
+ "V1 = 38.632*10**-6; \t\t\t#partial molar volume of methanol (m**3/mol)\n",
+ "V2 = 17.765*10**-6; \t\t\t#partial molar volume of water (m**3/mol)\n",
+ "mol_V1 = 40.727*10**-6; \t\t#molar volume of ethanol (m**3/mol)\n",
+ "mol_V2 = 18.068*10**-6; \t\t#molar volume of water (m**3/mol)\n",
+ "\n",
+ "# Calculations\n",
+ "#To find the required volume of methanol and water\n",
+ "V_mol = (x1*V1)+(x2*V2); \t\t\t#molar volume of desired solution\n",
+ "n = V/V_mol; \t\t\t #no. of moles in the desired solution\n",
+ "n1 = x1*n; \t\t\t#moles of methanol\n",
+ "n2 = x2*n; \t\t\t#moles of water\n",
+ "V_m = n1*mol_V1;\n",
+ "V_w = n2*mol_V2;\n",
+ "\n",
+ "# Results\n",
+ "print 'Volume of methanol to be taken is %f cubic m'%V_m\n",
+ "print ' Volume of water to be taken is %f cubic m'%V_w\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume of methanol to be taken is 1.017111 cubic m\n",
+ " Volume of water to be taken is 1.052866 cubic m\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the volume of water to be added and volume of dilute alcohol solution\n",
+ "\n",
+ "# Variables\n",
+ "V1_w = 0.816*10**-3; \t\t\t#partial molar volume of water in 96% alcohol solution\n",
+ "V1_e = 1.273*10**-3; \t\t\t#partial molar volume of ethanol in 96% alcohol solution\n",
+ "V2_w = 0.953*10**-3; \t\t\t#partial molar volume of water in 56% alcohol solution\n",
+ "V2_e = 1.243*10**-3; \t\t\t#partial molar volume of ethanol in 56% alcohol solution\n",
+ "d = 0.997*10**3; \t\t\t #density of water (kg/m**3)\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate the volume of water to be added and volume of dilute alcohol solution\n",
+ "#Basis: \n",
+ "V = 2*10**-3; \t\t\t #volume of alcohol solution (m**3)\n",
+ "V_sp = (0.96*V1_e)+(0.04*V1_w); \t\t\t#volume of 1 kg of laboratory alcohol\n",
+ "m_e = V/V_sp; \t\t\t #mass of 2*10**-3 m**3 alcohol \n",
+ "\n",
+ "#(a).\n",
+ "#Let mass of water added be m kg\n",
+ "#Taking an alcohol balance\n",
+ "m = (m_e*0.96)/0.56 - m_e;\n",
+ "v = m/d;\n",
+ "\n",
+ "# Results\n",
+ "print ' (a).'\n",
+ "print ' Mass of water added is %f kg'%m\n",
+ "print ' Volume of water added is %4.3e cubic m'%v\n",
+ "\n",
+ "#(b)\n",
+ "m_sol = m_e + m; \t\t\t #mass of alcohol solution obtained\n",
+ "sp_vol = (0.56*V2_e)+(0.44*V2_w); \t\t\t#specific volume of 56% alcohol\n",
+ "V_dil = sp_vol*m_sol; \t\t\t #volume of dilute alcohol solution\n",
+ "print ' (b)'\n",
+ "print ' Volume of dilute alcohol solution is %5.4e cubic m'%V_dil\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a).\n",
+ " Mass of water added is 1.138558 kg\n",
+ " Volume of water added is 1.142e-03 cubic m\n",
+ " (b)\n",
+ " Volume of dilute alcohol solution is 3.0479e-03 cubic m\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine enthalpies of pure components and at infinite dilution\n",
+ "\n",
+ "# Variables\n",
+ "x1= .3\n",
+ "x2 = .7\n",
+ "\n",
+ "# Calculations and Results\n",
+ "H = 400.*x1 + 600*x2 + x1*x2*(40*x1+20*x2)\n",
+ "H1 = 420.-60+40;\n",
+ "#Using eq. 7.28 (Page no. 264)\n",
+ "#H = H2_bar as x2 = 1\n",
+ "H2 = 600.;\n",
+ "print ' (b).'\n",
+ "print ' Pure state enthalpies are:'\n",
+ "print ' H1 = %i J/mol'%H1\n",
+ "print ' H2 = %i J/mol'%H2\n",
+ "\n",
+ "\t\t\t#(c).\n",
+ "\t\t\t#H1_inf = H1_bar as x1 = 0, so from eq. 7.27\n",
+ "H1_inf = 420.;\n",
+ "\t\t\t#H2_inf = H2_bar as x2 = 0. so from eq 7.28\n",
+ "H2_inf = 640.;\n",
+ "print ' (c).'\n",
+ "print ' At infinite dilution:'\n",
+ "print ' H1 = %i J/mol'%H1_inf\n",
+ "print ' H2 = %i J/mol'%H2_inf\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (b).\n",
+ " Pure state enthalpies are:\n",
+ " H1 = 400 J/mol\n",
+ " H2 = 600 J/mol\n",
+ " (c).\n",
+ " At infinite dilution:\n",
+ " H1 = 420 J/mol\n",
+ " H2 = 640 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the partial molar volume of the components\n",
+ "\n",
+ "def V(m):\n",
+ " y = 1.003*10**-3 + 0.1662*10**-4*m + 0.177*10**-5*m**1.5 + 0.12*10**-6*m**2\n",
+ " return y\n",
+ "\n",
+ "# Variables\n",
+ "m = 0.1; \t\t\t#molality of solution (mol/kg)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate the partial molar volume of the components\n",
+ "#Differentiating Eq. 7.29 with reference to m, we get\n",
+ "V1_bar = 0.1662*10**-4 + 0.177*1.5*10**-5*m**0.5 + 0.12*2*10**-6*m;\n",
+ "V_sol = V(m) \t\t\t#volume of aqueous soluttion\n",
+ "n1 = m;\n",
+ "n2 = 1000./18;\n",
+ "V2_bar = (V_sol - n1*V1_bar)/n2;\n",
+ "\n",
+ "# Results\n",
+ "print 'Partial molar volume of water = %4.3e cubic m/mol'%V2_bar\n",
+ "print ' Partial molar volume of NaCl = %4.3e cubic m/mol'%V1_bar\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Partial molar volume of water = 1.805e-05 cubic m/mol\n",
+ " Partial molar volume of NaCl = 1.748e-05 cubic m/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To estimate the solubility of oxygen in water at 298K\n",
+ "\n",
+ "# Variables\n",
+ "K = 4.4*10**4; \t\t\t#Henry's law constant (bar)\n",
+ "pp = 0.25; \t\t\t #partial pressure of oxygen in bar\n",
+ "M_O2 = 32.; \t\t\t#molecular wt of oxygen\n",
+ "M_water = 18.; \t\t\t#molecular wt of water\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To estimate the solubility of oxygen in water at 298 K\n",
+ "#Using eq. 7.72 (Page no. 275)\n",
+ "x_O2 = pp/K; \t\t\t#mole fraction of O2\n",
+ "print 'Solubility of oxygen is %5.4e moles per mole of water'%x_O2\n",
+ "\n",
+ "#In mass units\n",
+ "sol_O2 = (x_O2*M_O2)/M_water;\n",
+ "print ' Solubility of oxygen in mass units is %4.3e kg oxygen per kg water'%sol_O2\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Solubility of oxygen is 5.6818e-06 moles per mole of water\n",
+ " Solubility of oxygen in mass units is 1.010e-05 kg oxygen per kg water\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To confirm that mixture conforms to Raoults Law and to determine Henrys Law constant?\n",
+ "\n",
+ "%pylab inline\t\t\t\n",
+ " \n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "import numpy\n",
+ "\n",
+ "# Variables\n",
+ "xb = array([0, 0.2, 0.4, 0.6, 0.8, 1.0])\n",
+ "pa_bar = [0.457 ,0.355, 0.243, 0.134, 0.049, 0];\n",
+ "pb_bar = [0,0.046, 0.108, 0.187, 0.288, 0.386];\n",
+ "\n",
+ "\n",
+ "#To confirm mixture conforms to Raoult's Law and to determine Henry's law constant\n",
+ "xa = 1 - xb\n",
+ "plot(xa,pa_bar)\n",
+ "plot(xa,pb_bar)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#For Henry's law plotting\n",
+ "x = [0,0.2, 0.4 ,0.6 ,0.8 ,1.0];\n",
+ "#Form the partial presures plot of component A and B\n",
+ "yh1 = [0,0,0,0,0,0]\n",
+ "yh1[0] = 0; \n",
+ "yh1[1] = 0.049; \t\t\t#For component A\n",
+ "for i in range(2,6):\n",
+ " yh1[i] = yh1[i-1]+(x[i]-x[i-1])*((yh1[1]-yh1[0])/(x[1]-x[0]))\n",
+ "\n",
+ "yh_2 = [0,0,0,0,0,0]\n",
+ "yh_2[5] = 0; \n",
+ "yh_2[4] = 0.046; \t\t\t#For component B\n",
+ "i = 3;\n",
+ "while (i>=0):\n",
+ " yh_2[i] = yh_2[i+1] + (x[i]-x[i+1])*((yh_2[5]-yh_2[4])/(x[5]-x[4]))\n",
+ " i = i-1;\n",
+ "\n",
+ "plot(x,yh1)\n",
+ "plot(x,yh_2)\n",
+ "\t\t\t#legend(\"Partial pressure \",\" \",\"Raoults law\",\" \",\"Henrys Law\"\n",
+ "show()\n",
+ "#(a)\n",
+ "print 'From the graph it can be inferred that, in the region where Raoults law is obeyed by A, the Henrys law is obeyed by B, and vice versa'\n",
+ "\n",
+ "#(b)\n",
+ "#Slope of Henry's law\n",
+ "print ' For component A, Ka = %f bar'%yh1[5]\n",
+ "print ' For component B, Kb = %f bar'%yh_2[0]\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEACAYAAACnJV25AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlclPX6//EXiIqKsooLGO6aCIqiqbngkrtgglnnHLM8\nFsEvW06raaUdsyzLry0qmaZHSyswwY0slRQ1FzCJTM0lA3eGTZBlmLl/f9wKmoqAM3MPw/V8PHx8\n5TjOXN36ffPxuj/39bFTFEVBCCGEzbDXugAhhBCmJcEuhBA2RoJdCCFsjAS7EELYGAl2IYSwMRLs\nQghhY+4Y7PHx8fj5+dGpUyfmzp17068nJCTg7OxMQEAAAQEBzJ492yyFCiGEqBiH8n6xqKiIiIgI\nEhMTadKkCb1792bo0KEEBATc8LoBAwYQFxdn1kKFEEJUTLkr9r179+Lr64uXlxcODg5MmDCBjRs3\n3vQ6ecZJCCGsR7nBn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ScilyLOXPm0LVrVxISEjhx4gQP\nPPAAhw4dKv1Xbk1Tmdw06Yrd29ubtLS00q/T0tJu+C5zq9fcbvxAdVeRawGQkpLClClTiIuLK/ef\nYtVVRa5DUlISDz/8MK1atSImJobIyEji4uIsXarZVeRa3HPPPQwdOpR69erh7u7OgAEDSElJsXSp\nZleRa5GYmMj48eMBaNOmDa1ateL333+3aJ3WotK5acobAAUFBYqPj4+Snp6uFBcXK4GBgUpSUtJN\nNwHGjh2rKIqiJCUlKf7+/qYswWpU5FqcPn1aadOmjbJnzx6NqjS/ilyH6z322GNKTEyMBSu0nIpc\ni+TkZGXw4MFKSUmJkp+fr3Tq1Ek5ePCgRhWbT0WuRWRkpDJz5kxFURTl/PnzStOmTUtvKtuiU6dO\nlXvztDK5adJWjDzQVKYi1+Ktt94iKyurtLdcu3Zt9u3bp2XZJleR61BTVORaBAQEMHz4cPz9/dHr\n9UyZMoWuXbtqXLnpVeRavPHGG/zrX/+iU6dOGAwGZs+eXXpT2dY88sgj/PTTT2RkZNCiRQtmzZqF\nXq8Hqpab8oCSEELYGNsceC6EEDWYBLsQQtgYCXYhhLAxEuxCCGFjJNiFEMLGSLALIYSNkWAXQggb\nI8EuhBA25v8DAAQCZcrB/UMAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2769cd0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From the graph it can be inferred that, in the region where Raoults law is obeyed by A, the Henrys law is obeyed by B, and vice versa\n",
+ " For component A, Ka = 0.245000 bar\n",
+ " For component B, Kb = 0.230000 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate activity and activity coeffecient of chloroform\n",
+ "\n",
+ "from numpy import array\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "xa = array([0, 0.2, 0.4, 0.6, 0.8, 1.0]);\n",
+ "Pa_bar = [0 ,0.049, 0.134, 0.243, 0.355, 0.457];\n",
+ "Pb_bar = [0.386 ,0.288, 0.187, 0.108, 0.046, 0];\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate activity and activity coeffecient of chloroform\n",
+ "xb = 1-xa;\n",
+ "Pbo = 0.386; \t\t\t#vapour pressure of pure chloroform\n",
+ "#(a). Based on standard state as per Lewis-Randall rule\n",
+ "\n",
+ "print 'Based on Lewis Randall Rule'\n",
+ "print ' Activity Activity coeffecient'\n",
+ "a = [0,0,0,0,0,0]\n",
+ "ac = [0,0,0,0,0,0]\n",
+ "for i in range(6):\n",
+ " a[i] = Pb_bar[i]/Pbo;\n",
+ " print ' %f'%a[i],\n",
+ " if(xb[i]==0):\n",
+ " print ' Not defined',\n",
+ " else:\n",
+ " ac[i] = a[i]/xb[i];\n",
+ " print ' %f'%ac[i]\n",
+ "\n",
+ "#(b). Based on Henry's Law \n",
+ "Kb = 0.217; \t\t\t#bar (From Example 7.11 Page no. 276)\n",
+ "\n",
+ "print '\\n\\n Based on Henrys Law'\n",
+ "print ' Activity Activity coeffecient'\n",
+ "for i in range(6):\n",
+ " a[i] = Pb_bar[i]/Kb;\n",
+ " print ' %f'%a[i],\n",
+ " if(xb[i]==0):\n",
+ " print ' Not defined',\n",
+ " else:\n",
+ " ac[i] = a[i]/xb[i];\n",
+ " print ' %f'%ac[i]\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Based on Lewis Randall Rule\n",
+ " Activity Activity coeffecient\n",
+ " 1.000000 1.000000\n",
+ " 0.746114 0.932642\n",
+ " 0.484456 0.807427\n",
+ " 0.279793 0.699482\n",
+ " 0.119171 0.595855\n",
+ " 0.000000 Not defined \n",
+ "\n",
+ " Based on Henrys Law\n",
+ " Activity Activity coeffecient\n",
+ " 1.778802 1.778802\n",
+ " 1.327189 1.658986\n",
+ " 0.861751 1.436252\n",
+ " 0.497696 1.244240\n",
+ " 0.211982 1.059908\n",
+ " 0.000000 Not defined\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine fugacity fugacity coeffecient Henrys Law constant and activity coeffecient\n",
+ "\n",
+ "# Variables\n",
+ "P = 20.; \t\t\t#pressure in bar\n",
+ "\n",
+ "# Calculations and Results\n",
+ "def f1(x1):\n",
+ " y = (50*x1)-(80*x1**2)+(40*x1**3)\n",
+ " return y\n",
+ "\n",
+ "#To determine fugacity fugacity coeffecient Henry's Law constant and activity coeffecient\n",
+ "\n",
+ "#(a)\n",
+ "#Fugacity of component in solution becomes fugacity of pure component when mole fraction approaches 1 i.e. \n",
+ "x1 = 1.;\n",
+ "f1_pure = f1(x1);\n",
+ "print '(a). Fugacity f1 of pure component 1 is %i bar'%f1_pure\n",
+ "\n",
+ "#(b)\n",
+ "phi = f1_pure/P;\n",
+ "print ' (b). Fugacity coeffecient is %f'%phi\n",
+ "\n",
+ "#(c)\n",
+ "#Henry's Law constant is lim (f1/x1)and x1 tends to 0 \n",
+ "x1 = 0;\n",
+ "K1 = 50 - (80*x1) + (40*x1**2);\n",
+ "print ' (c). Henrys Law constant is %i bar'%K1\n",
+ "\n",
+ "#(d)\n",
+ "print ' (d). This subpart is theoretical and does not involve any numerical computation'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). Fugacity f1 of pure component 1 is 10 bar\n",
+ " (b). Fugacity coeffecient is 0.500000\n",
+ " (c). Henrys Law constant is 50 bar\n",
+ " (d). This subpart is theoretical and does not involve any numerical computation\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine enthalpies at infinite dilution\n",
+ "\n",
+ "# Variables\n",
+ "H1_pure = 400.; \t\t\t#enthalpy of pure liquid 1 at 298 K and 1 bar (J/mol)\n",
+ "H2_pure = 600.; \t\t\t#enthalpy of pure liquid 2 (J/mol)\n",
+ "x1 = 0.;\n",
+ "\n",
+ "# Calculations\n",
+ "delH1_inf = 20*((1-x1)**2)*(2*x1+1);\n",
+ "H1_inf = H1_pure + delH1_inf; \t\t\t#(J/mol)\n",
+ "\n",
+ "#For infinite dilution of 2, x1 = 1 and delH2_inf = H2_bar\n",
+ "x1 = 1.;\n",
+ "delH2_inf = 40.*x1**3;\n",
+ "H2_inf = delH2_inf + H2_pure; \t\t\t#(J/mol)\n",
+ "\n",
+ "# Results\n",
+ "print 'Enthalpy at infinite dilution for component 1 is %i J/mol'%H1_inf\n",
+ "print ' Enthalpy at infinite dilution for component 2 is %i J/mol'%H2_inf\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enthalpy at infinite dilution for component 1 is 420 J/mol\n",
+ " Enthalpy at infinite dilution for component 2 is 640 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.19 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine change in entropy for the contents of the vessel\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "n1 = 100.; \t\t\t#moles of nitrogen\n",
+ "n2 = 100.; \t\t\t#moles of oxygen\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the change in entropy of the contents of the vessel\n",
+ "x1 = n1/(n1+n2);\n",
+ "x2 = n2/(n1+n2);\n",
+ "import math\n",
+ "\n",
+ "#Using eq. 7.122 (Page no. 292)\n",
+ "S = -R*(x1*math.log (x1) + x2*math.log (x2));\n",
+ "S_tot = S*(n1+n2);\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in entropy of components are %f J/K'%S_tot\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy of components are 1152.565132 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine heat of formation of LiCl in 12 moles of water\n",
+ "\n",
+ "# Variables\n",
+ "Hf = -408.610; \t\t\t#heat of formation (kJ)\n",
+ "#For reaction 2\n",
+ "#LiCl + 12H2O --> LiCl(12H2O)\n",
+ "H_sol = -33.614; \t\t\t#heat of solution (kJ)\n",
+ "\n",
+ "#To determine heat of formation of LiCl in 12 moles of water\n",
+ "#Adding reaction 1 and 2% we get\n",
+ "\n",
+ "# Calculations\n",
+ "#Li + 1/2Cl2 + 12H2O --> LiCl(12H2O)\n",
+ "H_form = Hf+H_sol;\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of formation of LiCl in 12 moles of water is %f kJ'%H_form\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of formation of LiCl in 12 moles of water is -442.224000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the free energy of mixing\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "n1 = 3.; \t\t\t#moles of hydrogen\n",
+ "n2 = 1.; \t\t\t#moles of nitrogen\n",
+ "T = 298.; \t\t\t#temperature in K\n",
+ "P1 = 1.; \t\t\t#pressure of hydrogen in bar\n",
+ "P2 = 3.; \t\t\t#pressure of nitrogen in bar\n",
+ "import math\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate the free energy of mixing\n",
+ "V1 = (n1*R*T)/(P1*10**5); \t\t\t#volume occupied by hydrogen\n",
+ "V2 = (n2*R*T)/(P2*10**5); \t\t\t#volume occupied by nitrogen\n",
+ "V = V1+V2; \t\t\t#total volume occupied\n",
+ "P = ((n1+n2)*R*T)/(V*10**5); \t\t\t#final pressure attained by mixture (bar)\n",
+ "G1 = R*T*(n1*math.log(P/P1) + n2*math.log(P/P2));\n",
+ "\n",
+ "#For step 2, using eq. 7.121 (Page no. 292)\n",
+ "x1 = n1/(n1+n2);\n",
+ "x2 = n2/(n1+n2);\n",
+ "G2 = (n1+n2)*R*T*(x1*math.log (x1) + x2*math.log (x2));\n",
+ "G = G1+G2; \t\t\t#free energy in J\n",
+ "\n",
+ "# Results\n",
+ "print 'The free energy of mixing when partition is removed is %f kJ'%(G/1000)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The free energy of mixing when partition is removed is -6.487935 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the mean heat capacity of 20 mol percent solution\n",
+ "\n",
+ "# Variables\n",
+ "C_water = 4.18*10**3; \t\t\t#heat capacity of water (J/kg K)\n",
+ "C_ethanol = 2.58*10**3; \t\t#heat capacity of ethanol (J/kg K)\n",
+ "G1 = -758.; \t\t\t#heat of mixing 20 mol percent ethanol water at 298 K(J/mol)\n",
+ "G2 = -415.; \t\t\t#heat of mixing 20 mol percent ethanol water at 323 K (J/mol)\n",
+ "n_wat = 0.8; \t\t\t#moles of water\n",
+ "n_eth = 0.2; \t\t\t#moles of ethanol\n",
+ "T1 = 323.; \t\t\t#initial temperature in K\n",
+ "T2 = 298.; \t\t\t#final temperature in K\n",
+ "\n",
+ "# Calculations\n",
+ "#Step 1: Water is cooled from 323 K t0 298 K\n",
+ "H1 = n_wat*18*C_water*(T2-T1)/1000; \t\t\t#(J)\n",
+ "\n",
+ "#Step 2: Ethanol is cooled from 323 to 298 K\n",
+ "H2 = n_eth*46*C_ethanol*(T2-T1)/1000; \t\t\t#(J)\n",
+ "\n",
+ "#Step 3: 0.8 mol water and 0.2 mol ethanol are mixed at 298 K\n",
+ "H3 = G1; \t\t\t#(J)\n",
+ "\n",
+ "#Step 4: \n",
+ "H = G2;\n",
+ "Cpm = (H-H1-H2-H3)/(T1-T2);\n",
+ "\n",
+ "# Results\n",
+ "print 'Mean heat capacity of solution is %f J/mol K'%Cpm\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean heat capacity of solution is 97.648000 J/mol K\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the final temperature attained\n",
+ "\n",
+ "# Variables\n",
+ "To = 298.; \t\t\t#initial temperature (K)\n",
+ "Cpm = 97.65; \t\t\t#Mean heat capacity of solution (J/mol K)\n",
+ "Hs = -758.; \t\t\t#heat of mixing (J/mol)\n",
+ "H = 0.;\n",
+ "\n",
+ "# Calculations\n",
+ "T = (H-Hs)/Cpm + To;\n",
+ "\n",
+ "# Results\n",
+ "print 'The final temperature attained by the mixing is %f K'%T\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final temperature attained by the mixing is 305.762417 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch8.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch8.ipynb
new file mode 100644
index 00000000..405872e3
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch8.ipynb
@@ -0,0 +1,1489 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Phase equilibria"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine composition of vapour and liquid in equilibrium\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 106.; \t\t\t#vapour pressure of n-heptane (kPa)\n",
+ "P2 = 74.; \t\t\t#vapour pressure of toluene (kPa)\n",
+ "P = 101.3; \t\t\t#total pressure (kPa)\n",
+ "\n",
+ "# Calculations\n",
+ "x = (P-P2)/(P1-P2)\n",
+ "y = x*(P1/P)\n",
+ "\n",
+ "# Results\n",
+ "print 'Composition of liquid heptane is %f mol percent'%(x*100)\n",
+ "print ' Composition of heptane in vapour form is %f mol percent'%(y*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Composition of liquid heptane is 85.312500 mol percent\n",
+ " Composition of heptane in vapour form is 89.270731 mol percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine pressure at the beginning and at the end of the process\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 135.4; \t\t\t#vapour pressure of benzene (kPa)\n",
+ "P2 = 54.; \t\t\t#vapour pressure of toluene (kPa)\n",
+ "x = 0.5; \t\t\t#liquid phase composition\n",
+ "\n",
+ "# Calculations\n",
+ "#Using eq. 8.51 (Page no. 332)\n",
+ "P_beg = P2 + (P1-P2)*x;\n",
+ "\n",
+ "#At the end\n",
+ "y = 0.5; \t\t\t#vapour phase composition\n",
+ "#Using eq. 8.54 (Page no. 333) and rearranging\n",
+ "P_end = (P1*P2)/(P1-y*(P1-P2))\n",
+ "\n",
+ "# Results\n",
+ "print 'Pressure at the beginning of the process is %f kPa'%(P_beg)\n",
+ "print ' Pressure at the end of the process is %f kPa'%(P_end)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure at the beginning of the process is 94.700000 kPa\n",
+ " Pressure at the end of the process is 77.208025 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine temperature pressure and compositions\n",
+ "\n",
+ "import math\n",
+ "def P1(T):\n",
+ " y1 = math.e**(14.5463 - 2940.46/(T-35.93)) \t\t\t#vapour pressure of acetone\n",
+ " return y1\n",
+ "\n",
+ "def P2(T):\n",
+ " y2 = math.e**(14.2724 - 2945.47/(T-49.15)) \t\t\t#vapour pressure of acetonitrile\n",
+ " return y2\n",
+ "\n",
+ "# Variables\n",
+ "T = 327.; \t\t\t#temperature in K\n",
+ "P = 65.; \t\t\t#pressure in kPa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "P1_s = P1(T)\n",
+ "P2_s = P2(T)\n",
+ "\t\t\t#Using eq. 8.51 (Page no. 332)\n",
+ "x1 = (P-P2_s)/(P1_s-P2_s)\n",
+ "\t\t\t#Using eq. 8.54 (Page no. 333)\n",
+ "y1 = x1*(P1_s/P)\n",
+ "print '(a)'\n",
+ "print ' x1 = %f'%x1\n",
+ "print ' y1 = %f'%y1\n",
+ "\n",
+ "\t\t\t#(b). To calculate T and y1\n",
+ "P = 65.; \t\t\t#pressure in kPa\n",
+ "x1 = 0.4;\n",
+ "\n",
+ "flag = 1.;\n",
+ "T2 = 340.; \t\t\t#temperatue (assumed)\n",
+ "while(flag==1):\n",
+ " P1_s = P1(T2)\n",
+ " P2_s = P2(T2)\n",
+ " P_calc = P2_s + x1*(P1_s-P2_s)\n",
+ " if((P_calc-P)<=1):\n",
+ " flag = 0;\n",
+ " else:\n",
+ " T2 = T2-0.8;\n",
+ "\n",
+ "y1 = x1*(P1_s/P)\n",
+ "print ' (b)'\n",
+ "print ' Temperature is %f K'%T2\n",
+ "print ' y1 = %f'%y1\n",
+ "\n",
+ "\t\t\t#(c). To calculate P and y1\n",
+ "T3 = 327.; \t\t\t#temperature in K\n",
+ "x1 = 0.4;\n",
+ "\n",
+ "P1_s = P1(T3)\n",
+ "P2_s = P2(T3)\n",
+ "P = P2_s + x1*(P1_s-P2_s)\n",
+ "y1 = x1*(P1_s/P)\n",
+ "print ' (c)'\n",
+ "print ' Pressure is %f kPa'%P\n",
+ "print ' y1 = %f'%y1\n",
+ "\n",
+ "\t\t\t#(d). To calculate T and x1\n",
+ "P = 65.; \t\t\t#pressure in kPa\n",
+ "y1 = 0.4;\n",
+ "\n",
+ "flag = 1.;\n",
+ "T = 340.; \t\t\t#assumed temperature (K)\n",
+ "while(flag==1):\n",
+ " P1_s = P1(T)\n",
+ " P2_s = P2(T)\n",
+ " y1_calc = (P1_s*(P-P2_s))/(P*(P1_s-P2_s))\n",
+ " if((y1_calc-y1)>=0.001):\n",
+ " flag = 0;\n",
+ " else:\n",
+ " T = T-2;\n",
+ "\n",
+ "x1 = y1*(P/P1_s)\n",
+ "print ' (d)'\n",
+ "print ' Temperature = %f K'%T\n",
+ "print ' x1 = %f'%x1\n",
+ "\n",
+ "#(e). To calculate P and x1\n",
+ "T = 327.; \t\t\t#temperature (K)\n",
+ "y1 = 0.4;\n",
+ "\n",
+ "P1_s = P1(T)\n",
+ "P2_s = P2(T)\n",
+ "#Using eq. 8.54 and 8.51\n",
+ "x1 = (y1*P2_s)/(P1_s-y1*(P1_s-P2_s))\n",
+ "P = x1*(P1_s/y1)\n",
+ "print ' (e)'\n",
+ "print ' Pressure = %f kPa'%P\n",
+ "print ' x1 = %f'%x1\n",
+ "\n",
+ "#(f). To calculate fraction of the system is liquid and vapour in equilibrium\n",
+ "T = 327.; \t\t\t#temperature (K)\n",
+ "P = 65.; \t\t\t#pressure (kPa)\n",
+ "y1 = 0.7344;\n",
+ "\n",
+ "P1_s = P1(T)\n",
+ "P2_s = P2(T)\n",
+ "x1 = (P-P2_s)/(P1_s-P2_s)\n",
+ "#Let f be the fraction of the mixture that is liquid\n",
+ "#Applying acetone balance\n",
+ "f = (0.7-y1)/(x1-y1)\n",
+ "print ' (f)'\n",
+ "print ' Fraction of mixture that is liquid is %f percent'%(f*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " x1 = 0.560806\n",
+ " y1 = 0.734393\n",
+ " (b)\n",
+ " Temperature is 330.400000 K\n",
+ " y1 = 0.588617\n",
+ " (c)\n",
+ " Pressure is 57.633467 kPa\n",
+ " y1 = 0.590765\n",
+ " (d)\n",
+ " Temperature = 334.000000 K\n",
+ " x1 = 0.240940\n",
+ " (e)\n",
+ " Pressure = 50.093199 kPa\n",
+ " x1 = 0.235402\n",
+ " (f)\n",
+ " Fraction of mixture that is liquid is 19.816333 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To construct boiling point and equilibrium point diagram\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "# Variables\n",
+ "P = 101.3; \t\t\t#total pressure over the system (kPa)\n",
+ "T = [371.4, 378, 383, 388, 393, 398.6];\n",
+ "Pa = [101.3 ,125.3, 140.0, 160.0 ,179.9, 205.3];\n",
+ "Pb = [44.4 ,55.6 ,64.5, 74.8, 86.6 ,101.3];\n",
+ "xa = [0,0,0,0,0,0]\n",
+ "ya = [0,0,0,0,0,0]\n",
+ "\n",
+ "# Calculations\n",
+ "#To construct boiling point and equilibrium point diagram\n",
+ "for i in range(6):\n",
+ " xa[i] = (P-Pb[i])/(Pa[i]-Pb[i]) \t\t\t#Using eq. 8.51\n",
+ " ya[i] = xa[i]*(Pa[i]/P )\t\t\t#Using eq. 8.54\n",
+ "\n",
+ "from matplotlib.pyplot import *\n",
+ "\t\t\t#(a).\n",
+ "\t\t\t#To construct boiling point diagram\n",
+ "plot(xa,T)\n",
+ "plot(ya,T)\n",
+ "\t\t\t#title(\"Boiling Point diagram xa and ya Temperature\"\n",
+ "\t\t\t#(b).\n",
+ "\t\t\t#To construct the equilibrium diagram\n",
+ "plot(ya,xa)\n",
+ "\t\t\t#title(\"Equilibrium Diagram\",\"xa\",\"ya\"\n",
+ "show()\n",
+ "#(c).\n",
+ "\n",
+ "# Results\n",
+ "print '(c). The given subpart is theoretical and does not involve any numerical computation'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHYVJREFUeJzt3X9sG/X9x/Gn7dhp2qYp5Fe3OCsoEj/ixjQtRDBS6gp1\ngYQJKkANLEEbMLWAVrVs0jYm0YRNZGOboDC0byTo/liEaGmrjS1tVb5aXQajpEthodtUASr7xunS\nOA35bcdxct8/Qt3mV20ndtIer4d08vn88d3Hn8LrfXc+5yyGYRiIiIhpWee7AyIiklwKehERk1PQ\ni4iYnIJeRMTkFPQiIianoBcRMbmYgn5kZITi4mK++c1vAtDV1cX69etxu92UlZXR3d0daVtXV0dh\nYSFFRUUcOnQoOb0WEZGYxRT0O3bsoLCwEIvFAsD27dupqKigpaWFO++8k+3btwPQ3NzMvn37+Oij\njzh48CCbNm0iFAolr/ciIhJV1KD3+Xzs37+fRx99lHO/rdq/fz/V1dUAVFVV0djYCEBjYyOVlZXY\nbDby8vJwuVw0NTUlsfsiIhJN1KDftm0bv/zlL7Fazzf1+/1kZmYCkJWVRUdHBwBtbW04nc5IO6fT\nic/nS3SfRUQkDhcN+j//+c/k5ORQXFyM/lKCiMjlKeViL/7tb3/jzTffZP/+/QSDQXp7e6muriY7\nO5vOzk6ysrLw+/3k5OQAY3vwra2tkff7fD7y8/Mnrdey1AY9own+KCIi5lZQUMAnn3wS9/sssf5R\nsyNHjvCrX/2KP/3pT3zve9+joKCArVu38vzzz3Pq1ClefPFFmpub2bx5M++99x7t7e2Ulpby8ccf\nY7fbx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fpUbbriBHTt2zHU3Lwkzyc2EX3VzTqz/cxoTvgs24//U8Xwmr9fLzp07effdd5PY\no/kTy1hs3bqVn//851gsFgzDmPTfiFnEMhYjIyOcOHGCv/zlLwwODnLzzTdzyy234HK55qCHcyeW\nsXj22WdZuXIlXq+XTz/9lPXr1/OPf/wjciT8ZRJvbiZtjz6WH05NbOPz+XA6ncnq0ryJZSwAWlpa\nePTRR3nzzTcveuh2OYtlLJqbm6msrOTqq69m7969PP7447z55ptz3dWki2Usvva1r/GNb3yDtLQ0\nMjMzWbt2LS0tLXPd1aSLZSzeeecd7r//fmDsh0NXX301//73v+e0n5eCGeVmwr5BmCAQCBjLly83\nfD6fEQqFjBtvvNFobm4e12bPnj3GPffcYxiGYTQ3NxtutztZ3ZlXsYzFf/7zH6OgoMB477335qmX\ncyOWsbjQt7/9bWPv3r1z2MO5E8tYHD9+3Lj99tuNcDhsDAwMGIWFhcYHH3wwTz1OnljG4vHHHzdq\namoMwzCM9vZ2Y9myZZEvqc3m1KlTF/0yNt7cTNqpm+l+OHXukqhNmzZx7733cvjwYVwuF6mpqfzu\nd79LVnfmVSxj8cwzz/D5559Hzkvb7Xaamprms9tJEctYfFnEMhbFxcXccccduN1uhoeHefTRR1m5\ncuU89zzxYhmLp59+mqqqKgoLCxkZGeFnP/tZ5EtqM3nggQc4cuQInZ2d5OfnU1tby/DwMDDz3NQP\npkRETE63EhQRMTkFvYiIySnoRURMTkEvImJyCnoREZNT0IuImJyCXkTE5BT0IiIm9/8XDjZRk2RO\nAwAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x226ec50>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(c). The given subpart is theoretical and does not involve any numerical computation\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate van Laar constants\n",
+ "\n",
+ "# Variables\n",
+ "x1 = 46.1/100; \t\t\t#mole percent of A\n",
+ "P = 101.3; \t\t\t#total pressure of system (kPa)\n",
+ "P1_s = 84.8; \t\t\t#vapour pressure of component A (kPa)\n",
+ "P2_s = 78.2; \t\t\t#vapour pressure of component B (kPa) \n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate van Laar constants\n",
+ "gama1 = P/P1_s;\n",
+ "gama2 = P/P2_s;\n",
+ "x2 = 1-x1;\n",
+ "import math\n",
+ "#van Laar constants:\n",
+ "#Using eq. 8.69 (Page no. 348)\n",
+ "A = math.log (gama1)*(1 + (x2*math.log(gama2))/(x1*math.log(gama1)))**2;\n",
+ "B = math.log (gama2)*(1 + (x1*math.log(gama1))/(x2*math.log(gama2)))**2;\n",
+ "\n",
+ "# Results\n",
+ "print 'van Laar constants are:'\n",
+ "print ' A = %f'%A\n",
+ "print ' B = %f'%B\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "van Laar constants are:\n",
+ " A = 1.298059\n",
+ " B = 0.652282\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate activity coeffecients in a solution containing 10 percent alcohol\n",
+ "\n",
+ "# Variables\n",
+ "x2 = 0.448; \t\t\t#mole fraction of ethanol\n",
+ "P = 101.3; \t\t\t#total pressure (kPa)\n",
+ "P1_s = 68.9; \t\t\t#Vapour pressure of benzene (kPa)\n",
+ "P2_s = 67.4; \t\t\t#vapour pressure of ethanol (kPa)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate activity coeffecients in a solution containing 10% alcohol\n",
+ "x1 = 1-x2;\n",
+ "gama1 = P/P1_s;\n",
+ "gama2 = P/P2_s;\n",
+ "import math\n",
+ "#Using eq. 8.69 (Page no. 348)\n",
+ "#van Laar constants:\n",
+ "A = math.log(gama1)*(1 + (x2*math.log(gama2))/(x1*math.log(gama1)))**2;\n",
+ "B = math.log(gama2)*(1 + (x1*math.log(gama1))/(x2*math.log(gama2)))**2;\n",
+ "\n",
+ "#For solution containing 10% alcohol\n",
+ "x2 = 0.1;\n",
+ "x1 = 1-x2;\n",
+ "ln_g1 = (A*x2**2)/(((A/B)*x1+x2)**2)\n",
+ "ln_g2 = (B*x1**2)/((x1+(B/A)*x2)**2)\n",
+ "gama1 = math.e**ln_g1;\n",
+ "gama2 = math.e**ln_g2;\n",
+ "\n",
+ "# Results\n",
+ "print 'Activity coeffecients:'\n",
+ "print ' For component 1: %f'%gama1\n",
+ "print ' For component 2: %f'%gama2\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Activity coeffecients:\n",
+ " For component 1: 1.025516\n",
+ " For component 2: 4.141567\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate equilibrium vapour composition for solution containing 20 mole percent hydrazine\n",
+ "\n",
+ "# Variables\n",
+ "x2 = 0.585; \t\t\t#mol fraction of hydrazine\n",
+ "P = 101.3; \t\t\t#total pressure of system (kPa)\n",
+ "P2_s = 124.76; \t\t\t#vapour pressure of hydrazine (kPa)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate equilibrium vapour composition for solution containing 20% (mol) hydrazine\n",
+ "x1 = 1-x2;\n",
+ "P1_s = 1.6*P2_s; \t\t\t#vapour pressure of water (kPa)\n",
+ "gama1 = P/P1_s;\n",
+ "gama2 = P/P2_s;\n",
+ "\n",
+ "import math\n",
+ "#Using eq. 8.69 (Page no. 348)\n",
+ "#van Laar constants:\n",
+ "A = math.log(gama1)*(1 + (x2*math.log(gama2))/(x1*math.log(gama1)))**2;\n",
+ "B = math.log(gama2)*(1 + (x1*math.log(gama1))/(x2*math.log(gama2)))**2;\n",
+ "\n",
+ "#For solution containing 20% hydrazine\n",
+ "x2 = 0.2;\n",
+ "x1 = 1-x2;\n",
+ "ln_g1 = (A*x2**2)/(((A/B)*x1+x2)**2)\n",
+ "ln_g2 = (B*x1**2)/((x1+(B/A)*x2)**2)\n",
+ "gama1 = math.e**ln_g1;\n",
+ "gama2 = math.e**ln_g2;\n",
+ "\n",
+ "#Using eq. 8.47 (Page no. 325) for components 1 and 2 and rearranging\n",
+ "alpha = 1.6; \t\t\t#alpha = P1_s/P2_s\n",
+ "y1 = 1./(1 + (gama2*x2)/(gama1*x1*alpha))\n",
+ "y2 = 1-y1;\n",
+ "\n",
+ "# Results\n",
+ "print 'Equilibrium vapour composition for solution containing 20 mol percent hydrazine'\n",
+ "print ' Hydrazine is %f percent'%(y2*100)\n",
+ "print ' Water is %f percent'%(y1*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium vapour composition for solution containing 20 mol percent hydrazine\n",
+ " Hydrazine is 5.279270 percent\n",
+ " Water is 94.720730 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the total pressure\n",
+ "\n",
+ "#Given:\n",
+ "x1 = 0.047; \t\t\t#mol fraction of isopropanol\n",
+ "P1 = 91.11; \t\t\t#vapour pessure of pure propanol (kPa)\n",
+ "P = 91.2; \t\t\t#toatl pressure of system (kPa)\n",
+ "P2 = 47.36; \t\t\t#vapour pressure of water (kPa)\n",
+ "\n",
+ "#van Laar consatnts:\n",
+ "A = 2.470;\n",
+ "B = 1.094;\n",
+ "\n",
+ "#To determine the total pressure:\n",
+ "x2 = 1-x1;\n",
+ "#Using eq. 8.68 (Page no. 348)\n",
+ "ln_g1 = (A*x2**2)/(((A/B)*x1 + x2)**2);\n",
+ "ln_g2 = (B*x1**2)/((x1 + (B/A)*x2)**2);\n",
+ "gama1 = math.e**ln_g1;\n",
+ "gama2 = math.e**ln_g2;\n",
+ "#Total pressure:\n",
+ "P_tot = (gama1*x1*P1) + (gama2*x2*P2);\n",
+ "\n",
+ "# Results\n",
+ "if(P==P_tot):\n",
+ " print 'This is equal to total pressure'\n",
+ "else:\n",
+ " print 'This is less than the total pressure. This error must have been caused by air leak'\n",
+ "\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is less than the total pressure. This error must have been caused by air leak\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To construct the Pxy diagram\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 24.62; \t\t\t#vapour pressure of cyclohexane (kPa)\n",
+ "P2 = 24.41; \t\t\t#vapour pressure of benzene (kPa)\n",
+ "from numpy import array\n",
+ "import math\n",
+ "x1 = array([0, 0.2, 0.4, 0.6, 0.8, 1.0])\n",
+ "x2 = 1-x1;\n",
+ "g1 = [0,0,0,0,0,0]\n",
+ "g2 = [0,0,0,0,0,0]\n",
+ "P = [0,0,0,0,0,0]\n",
+ "y1 = [0,0,0,0,0,0]\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(6):\n",
+ " g1[i] = math.e**(0.458*x2[i]**2) \t\t\t#activity coeffecient for component 1\n",
+ " g2[i] = math.e**(0.458*x1[i]**2 )\t\t\t#activity coeffecient for component 2\n",
+ " P[i] = (g1[i]*x1[i]*P1) + (g2[i]*x2[i]*P2) \t\t\t#total pressure (kPa)\n",
+ " y1[i] = (g1[i]*x1[i]*P1)/P[i];\n",
+ "\n",
+ "\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Results\n",
+ "#To construct P-x-y diagram\n",
+ "plot(x1,P)\n",
+ "plot(y1,P)\n",
+ "\t\t\t#title(\"P-x-y Diagram\",\"x1 and y1\",\"Pressure\"\n",
+ "show()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdcU1cbB/BfAEEBcQJVUFFqERICcWMRsIqouKoianFU\n3ForVl9rrQVHUXmrlqoobutedTIUBw5cCOKqo2pRhig4CTOQ8/5xW5Q3EBIgCZDn+/nko7n3nOTh\nKk9Ozj2DxxhjIIQQohV0NB0AIYQQ9aGkTwghWoSSPiGEaBFK+oQQokUo6RNCiBahpE8IIVpET97J\npKQkfPXVV3jz5g3y8/Ph6+uL//znP/D29sbDhw8BAG/fvkX9+vVx48YNmfpWVlYwMTGBrq4uatWq\nhWvXrqnmpyCEEKIQuUlfX18fISEhEAgEEIvFaNu2LTw8PLB3796iMrNmzUL9+vVLrM/j8RAdHY2G\nDRtWbtSEEELKRW73jrm5OQQCAQDA2NgYQqEQqampRecZY9i3bx+GDx9e6mvQ3C9CCKk6FO7TT0xM\nRGxsLJydnYuOXbhwAebm5rC2ti6xDo/Hg7u7O4RCIVavXl3xaAkhhFSI3O6df4nFYnh5eSE4OBh1\n69YtOr57926MGDGi1HpXrlyBmZkZ0tPT0atXL7Rp0wY9evSoeNSEEELK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sOopciylTprCAgADGGGNp\naWnsk08+kVkVoKb4+++/5d7IVTZvqqV75+OJWlKpFCNHjkTbtm2LhllNnDgRgwcPxtmzZ8Hn82Fg\nYIAtW7aoIzS1U+RaLFy4EG/evCnqx65VqxauXbumybBVQpFroS0UuRYikQi9evWCUCiERCLBuHHj\n4OjoqOHIK58i1+Knn36Cj48P7OzsUFhYiMWLFxfd4K5Jhg8fjnPnziEjIwPNmjXDggULIJFIAJQ/\nb6JgRoMAAAA/SURBVNLkLEII0SK0XSIhhGgRSvqEEKJFKOkTQogWoaRPCCFahJI+IYRoEUr6hBCi\nRSjpE0KIFqGkTwghWuR/4t39YqZswywAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2f10390>"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the composition and total pressure of azeotrope\n",
+ "\n",
+ "# Variables\n",
+ "P = 40.25; \t\t\t#total pressure (kPa)\n",
+ "y1 = 0.566; \t\t\t#mol fraction of benzene in vapour phase\n",
+ "x1 = 0.384; \t\t\t#mol fraction of benzene in liquid state\n",
+ "P1 = 29.6; \t\t\t#vapour pressure of benzene (kPa)\n",
+ "P2 = 22.9; \t\t\t#vapour pressure of ethanol (kPa)\n",
+ "\n",
+ "#To determine the composition and total pressure of azeotrope\n",
+ "x2 = 1-x1;\n",
+ "y2 = 1-y1;\n",
+ "\n",
+ "# Calculations\n",
+ "#Using eq. 8.47 (Page no. 325)\n",
+ "#Activity coeffecients:\n",
+ "g1 = (y1*P)/(x1*P1)\n",
+ "g2 = (y2*P)/(x2*P2)\n",
+ "\n",
+ "import math\n",
+ "\t\t\t#Using eq. 8.69 (Page no. 348)\n",
+ "\t\t\t#van Laar constants:\n",
+ "A = math.log(g1)*((1 + (x2*math.log(g2))/(x1*math.log(g1)))**2)\n",
+ "B = math.log(g2)*((1 + (x1*math.log(g1))/(x2*math.log(g2)))**2)\n",
+ "\n",
+ "\t\t\t#Assuming azeotropic comp. (for hit and trial method)\n",
+ "x1 = 0.4;\n",
+ "flag = 1.;\n",
+ "while(flag==1):\n",
+ " x2 =1-x1;\n",
+ " ln_g1 = (A*x2**2)/(((A/B)*x1 + x2)**2)\n",
+ " ln_g2 = (B*x1**2)/((x1 + (B/A)*x2)**2)\n",
+ " g1 = math.e**ln_g1;\n",
+ " g2 = math.e**ln_g2;\n",
+ " P_1 = g1*P1;\n",
+ " P_2 = g2*P2;\n",
+ " if((P_1-P_2)<=1) and ((P_1-P_2)>=-1):\n",
+ " flag = 0;\n",
+ " else:\n",
+ " x1 = x1+0.1;\n",
+ "\n",
+ "# Results\n",
+ "print 'Azeotropic compositon of benzene is %i percent'%(x1*100)\n",
+ "print ' Total pressure of azeotrope is %f kPa'%((P_1+P_2)/2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Azeotropic compositon of benzene is 60 percent\n",
+ " Total pressure of azeotrope is 40.858067 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate equilibrium pressure and composition\n",
+ "\n",
+ "# Variables\n",
+ "a12 = 1225.31; \t\t\t#(J/mol)\n",
+ "a21 = 6051.01; \t\t\t#(J/mol)\n",
+ "V1 = 74.05*10**-6; \t\t\t#(m**3/mol)\n",
+ "V2 = 18.07*10**-6; \t\t\t#(m**3/mol)\n",
+ "\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "T = 349; \t\t\t#temperature in K\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "#Antoine Equation:\n",
+ "#Vapour pressure of 1st element\n",
+ "def P1(T):\n",
+ " y1 = math.e**(14.39155-(2795.817/(T-43.198)))\n",
+ " return y1\n",
+ "\n",
+ "\t\t\t#Vapour pressure of 2nd element\n",
+ "def P2(T):\n",
+ " y2 = math.e**(16.26205-(3799.887/(T-46.854)))\n",
+ " return y2\n",
+ "\n",
+ "\t\t\t#To calculate equilibrium pressure and composition\n",
+ "\t\t\t#Using eq. 8.73 (Page no. 350)\n",
+ "\t\t\t#Wilson Parameters:\n",
+ "W12 = (V2/V1)*math.e**(-a12/(R*T));\n",
+ "W21 = (V1/V2)*math.e**(-a21/(R*T));\n",
+ "import math\n",
+ "\t\t\t#Using Antoine equation\n",
+ "P1_s = P1(T);\n",
+ "P2_s = P2(T);\n",
+ "\n",
+ "\t\t\t#(a). Composition of vapour in equilibrium\n",
+ "x1 = 0.43;\n",
+ "x2 = 1-x1;\n",
+ "\n",
+ "\t\t\t#Using eq. 8.72 (Page no. 350)\n",
+ "\t\t\t#Wilson equations:\n",
+ "\t\t\t#Activity coeffecient of 1st component\n",
+ "def g_1(n1,n2): \t\t\t#n1 is mol fraction of 1 and n2 is for 2\n",
+ " y3 = math.e**(-math.log(n1 + W12*n2) + n2*((W12/(n1+W12*n2))-(W21/(W21*n1+n2))));\n",
+ " return y3\n",
+ "\n",
+ "\t\t\t#Activity coeffecint of 2nd component\n",
+ "def g_2(n1,n2):\n",
+ " y4 = math.e**(-math.log(n2 + W21*n1) - n1*((W12/(n1+W12*n2))-(W21/(W21*n1+n2))));\n",
+ " return y4\n",
+ " \n",
+ "\t\t\t#Activity coeffecients:\n",
+ "g1 = g_1(x1,x2);\n",
+ "g2 = g_2(x1,x2);\n",
+ "\n",
+ "P = (g1*x1*P1_s) + (g2*x2*P2_s);\n",
+ "y1 = (g1*x1*P1_s)/P;\n",
+ "\n",
+ "# Results\n",
+ "print '(a).'\n",
+ "print ' Equilibrium pressure is %f kPa'%P\n",
+ "print ' Composition of acetone vapour in equilibrium is %f'%y1\n",
+ "\n",
+ "\n",
+ "#(b). Composition of liquid in equilibrium\n",
+ "y1 = 0.8;\n",
+ "y2 = 1-y1;\n",
+ "g1 = 1; g2 = 1; \t\t\t#assumed activity coeffecients\n",
+ "P_as = 1/((y1/(g1*P1_s)) + (y2/(g2*P2_s)));\n",
+ "\n",
+ "\t\t\t#Hit and trial method:\n",
+ "flag = 1;\n",
+ "while(flag==1):\n",
+ " x1 = (y1*P_as)/(g1*P1_s);\n",
+ " x2 = 1-x1;\n",
+ " g1 = g_1(x1,x2);\n",
+ " g2 = g_2(x1,x2);\n",
+ " P_calc = 1/((y1/(g1*P1_s)) + (y2/(g2*P2_s)));\n",
+ " if((P_calc-P_as)<=1) and ((P_calc-P_as)>=-1):\n",
+ " flag = 0;\n",
+ " else:\n",
+ " P_as = P_calc;\n",
+ "\n",
+ "print ' (b).'\n",
+ "print ' Equilibrium Pressure is %f kPa'%P_calc\n",
+ "print ' Composition of acetone in liquid in equilibrium is %f'%x1\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).\n",
+ " Equilibrium pressure is 162.828251 kPa\n",
+ " Composition of acetone vapour in equilibrium is 0.795360\n",
+ " (b).\n",
+ " Equilibrium Pressure is 164.488565 kPa\n",
+ " Composition of acetone in liquid in equilibrium is 0.456817\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine parameters in Wilsons equation\n",
+ "\n",
+ "# Variables\n",
+ "P = 101.3; \t\t\t#total pressure of system (kPa)\n",
+ "T = 337.5; \t\t\t#temperature in K\n",
+ "x1 = 0.842;\n",
+ "\n",
+ "#Antoine constants\n",
+ "#For methanol(1)\n",
+ "A1 = 16.12609;\n",
+ "B1 = 3394.286;\n",
+ "C1 = 43.2;\n",
+ "\n",
+ "#For methyl ethyl ketone (2)\n",
+ "A2 = 14.04357;\n",
+ "B2 = 2785.225;\n",
+ "C2 = 57.2;\n",
+ "import math\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine parameters in Wilson's equation\n",
+ "P1_s = math.e**(A1-(B1/(T-C1)))\n",
+ "P2_s = math.e**(A2-(B2/(T-C2)))\n",
+ "x2 = 1-x1;\n",
+ "g1 = P/P1_s;\n",
+ "g2 = P/P2_s;\n",
+ "\n",
+ "#Using eq. 8.72 and rearranging:\n",
+ "def Wils(n): \t\t\t#n is the Wilson's parameter W12\n",
+ " y1 = (((g1*x2)/(1-(n*x1/(x1+n*x2))+(x1/x2)*math.log(g1*(x1+n*x2))))**(x2/x1))*(g1*(x1+n*x2))\n",
+ " return y1\n",
+ "\n",
+ "flag = 1;\n",
+ "W12 = 0.5; \t\t\t#assumed value\n",
+ "while(flag==1):\n",
+ " res = Wils(W12)\n",
+ " if ((res-1)>=-0.09):\n",
+ " flag = 0;\n",
+ " else:\n",
+ " W12 = W12+0.087;\n",
+ "\n",
+ "\t\t\t#For 2nd Wilson parameter:\n",
+ "\t\t\t#Using eq. 8.72 and rearranging:\n",
+ "k = math.log(g1*(x1+W12*x2))/x2 - (W12/(x1+W12*x2))\n",
+ "W21 = (-k*x2)/(1+k*x1)\n",
+ "\n",
+ "# Results\n",
+ "print \"wilson parameters are: %f, %f\"%(W12,W21)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wilson parameters are: 0.935000, 0.470758\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "P = 101.3; \t\t\t#total pressure in kPa\n",
+ "T = [333, 343, 353, 363]; \t\t\t#temperatures(K)\n",
+ "Pa = [81.97 ,133.29 ,186.61, 266.58]; \t\t\t#Partial pressure of component A (kPa)\n",
+ "Pb = [49.32 ,73.31, 106.63, 166.61]; \t\t\t#Partial pressure of component B (kPa)\n",
+ "Pc = [39.32 ,62.65, 93.30, 133.29]; \t\t\t#Partial pressure of component C (kPa)\n",
+ "xa = 0.45; \t\t\t#mole fraction of methanol\n",
+ "xb = 0.3; \t\t\t#mole fraction of ethanol\n",
+ "\n",
+ "# Calculations and Results\n",
+ "xc = 1-xa-xb; \t\t\t#mole fraction of propanol\n",
+ "\n",
+ "#To calculate bubble and dew point and the composition \n",
+ "#(a). To calculate bubble point and vapour composition\n",
+ "from matplotlib.pyplot import *\n",
+ "plot(T,Pa);\n",
+ "plot(T,Pb);\n",
+ "plot(T,Pc);\n",
+ "\t\t\t#title(\" \",\"Temperature\",\"Vapour pressures\");\n",
+ "\t\t\t#legend(\"Pa\",\"Pb\",\"Pc\");\n",
+ "\n",
+ "\t\t\t#Using eq. 8.84 (Page no. 362)\n",
+ "\t\t\t#At bubble temperature, sum(yi) = sum((xi*Pi)/P) = 1\n",
+ "sum_y = [0,0,0,0]\n",
+ "for i in range(4):\n",
+ " sum_y[i] = (xa*Pa[i])/P + (xb*Pb[i])/P + (xc*Pc[i])/P;\n",
+ "\n",
+ "Tb = interp(1,sum_y,T); \t\t\t#obtaining temperature at which sum (yi) = 1\n",
+ "\n",
+ "\t\t\t#Obtaining vapour pressures at bubble temperature\n",
+ "Pb1 = interp(Tb,T,Pa);\n",
+ "Pb2 = interp(Tb,T,Pb);\n",
+ "Pb3 = interp(Tb,T,Pc);\n",
+ "\n",
+ "\t\t\t#Calculating equilibrium vapour composition\n",
+ "ya = (xa*Pb1*100)/P;\n",
+ "yb = (xb*Pb2*100)/P;\n",
+ "yc = (xc*Pb3*100)/P;\n",
+ "\n",
+ "print '(a).'\n",
+ "print ' The bubble temperature is %f K'%Tb\n",
+ "print ' The equilibrium vapour contains %f methanol, %f ethanol and %f propanol'%(ya,yb,yc)\n",
+ "\n",
+ "#(b). The dew point and liquid composition\n",
+ "#Vapour phase compositions at dew point\n",
+ "ya = 0.45; \t\t\t#methanol\n",
+ "yb = 0.30; \t\t\t#ethanol\n",
+ "yc = 0.25; \t\t\t#propanol\n",
+ "\n",
+ "sum_x = zeros(4)\n",
+ "#At dew point, sum(xi) = sum ((yi*P)/Pi) = 1\n",
+ "for i in range(4):\n",
+ " sum_x[i] = (ya*P)/Pa[i] + (yb*P)/Pb[i] + (yc*P)/Pc[i];\n",
+ "\n",
+ "Td = interp(1,sum_x,T); \t\t\t#obtaining temperature at which sum (xi) = 1\n",
+ "\n",
+ "#Obtaining vapour pressures at dew temperature\n",
+ "Pd1 = interp(Td,T,Pa);\n",
+ "Pd2 = interp(Td,T,Pb);\n",
+ "Pd3 = interp(Td,T,Pc);\n",
+ "\n",
+ "#Calculating liquid composition\n",
+ "xa = (ya*P*100)/Pd1;\n",
+ "xb = (yb*P*100)/Pd2;\n",
+ "xc = (yc*P*100)/Pd3;\n",
+ "\n",
+ "print ' (c).'\n",
+ "print ' The dew point is %f K'%Td\n",
+ "print ' At dew point liquid contains %f methanol, %f ethanol and %f propanol'%(xa,xb,xc)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).\n",
+ " The bubble temperature is 343.879659 K\n",
+ " The equilibrium vapour contains 61.294328 methanol, 22.578783 ethanol and 16.126889 propanol\n",
+ " (c).\n",
+ " The dew point is 363.000000 K\n",
+ " At dew point liquid contains 17.099932 methanol, 18.240202 ethanol and 18.999925 propanol\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEACAYAAABS29YJAAAABHNCSVQICAgIfAhkiAAAAAlwSFl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9G0+fobdYvjvn37Ijw8HCkpKXqfnzt3Lo4dOwZA/Guam5ur\n+9qd2y3I6V7qt7e3R58+fQAA/v7+8PHxwfnz501ea3O09Z88eRLZ2dnw8/ODh4cHVCoVxo4di4KC\nAou4/i3VX1hYaLbXv/F7x8nJCTY2NrCxscHixYuRlpYGwHLe+y3Vb67XHtCv383NDU888QQAYPz4\n8bC3t7eY935r9bf1+hs87IuLi1FWVgYAqKysxMGDB6FUKpGTk6P7nj179kCpVAIAwsLCsHPnTtTV\n1UGlUiEzMxMBAQGGLuuetbX+kpISaDQaAOJXqszMTAwbNszkdWs1V7+/vz8KCgqQnZ2N7OxsKBQK\nnDx5Eq6urhZx/Vuq38XFxayuf0vvHbVarfuer7/+Gt7e3gAs573fUv3mdO2BlusPDw/XDXFcuHAB\nFRUVFvPeb6n+9rz3DX5T1bVr17Bw4UJIkoSqqirMnTsX4eHheOKJJ3Dp0iXU1tbCw8MD27dvBwCM\nHTsWM2fOhK+vL2xtbREbG4uuXbsauiyj1Z+YmIi//OUvsLW1hSRJ2LRpE5ycnMyu/sYa719kKde/\nscb1m9P1b6n2BQsWICMjAzU1NRgyZAh27NgBwHKufUv1m9O1b63+hx56CM8++yx8fHwAAB999BFs\nbW0t5vq3VH9brz9vqiIisgI8lpCIyAow7ImIrADDnojICjDsiYisAMOeiMgKMOyJiKwAw56IyAow\n7ImIrMD/A7UqI330WejFAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2f23e50>"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given:\n",
+ "#All Ki values are obtained from Fig. 13.6 0f Chemical Engineer's Handbook, 5th ed.\n",
+ "P = 1447.14; \t\t\t#pressure of the system (kPa)\n",
+ "x = [0.25 ,0.4, 0.35]; \t\t\t#composition of the components\n",
+ "T = [355.4 ,366.5]; \t\t\t#assumed temperatures (K)\n",
+ "K1 = [2.00, 0.78 ,0.33]; \t\t\t#value of Ki at 355.4 K \n",
+ "K2 = [2.30, 0.90 ,0.40]; \t\t\t#value of Ki at 366.5 K\n",
+ "\n",
+ "\n",
+ "# Calculation and Result\n",
+ "#To calculate bubble and dew point temperatures\n",
+ "#(a). The bubble point temperature and composition of the vapour\n",
+ "\n",
+ "#At bubble point temperature, sum(K*x) = 1\n",
+ "Kx = [0, 0];\n",
+ "for i in range(3):\n",
+ " Kx[0] = Kx[0]+K1[i]*x[i];\n",
+ " Kx[1] = Kx[1]+K2[i]*x[i];\n",
+ "\n",
+ "Tb = interp(1,Kx,T);\n",
+ "\n",
+ "#At Tb K, from Fig. 13.6 of Chemical Engineer's Handbook\n",
+ "Kb = [2.12 ,0.85 ,0.37]\n",
+ "\n",
+ "#Calculation of vapour composition\n",
+ "y1 = Kb[0]*x[0]*100;\n",
+ "y2 = Kb[1]*x[1]*100;\n",
+ "y3 = Kb[2]*x[2]*100;\n",
+ "\n",
+ "print '(a).'\n",
+ "print ' The bubble point temperature is %f K'%Tb\n",
+ "print ' At bubble point vapour contains %f percent propane, %f percent butane and %f percent pentane'%(y1,y2,y3)\n",
+ "\n",
+ "#(b). The dew point temperature and composition of the liquid\n",
+ "T = [377.6 ,388.8]; \t\t\t#assumed temperatures (K)\n",
+ "y = [0.25, 0.40, 0.35]; \t\t\t#vapour composition at dew point\n",
+ "K1 = [2.6, 1.1, 0.5]; \t\t\t#at 377.6 K\n",
+ "K2 = [2.9, 1.3, 0.61]; \t\t\t#at 388.8 K\n",
+ "\n",
+ "#At dew point, sum(yi/Ki) = 1\n",
+ "Ky = [0, 0];\n",
+ "for i in range(3):\n",
+ " Ky[0] = Ky[0] + y[i]/K1[i];\n",
+ " Ky[1] = Ky[1] + y[i]/K2[i];\n",
+ "\n",
+ "Td = interp(1,Ky,T);\n",
+ "\n",
+ "#At Td K,\n",
+ "Kd = [2.85, 1.25, 0.59];\n",
+ "\n",
+ "#Calculation of liquid composition\n",
+ "x1 = y[0]*100/Kd[0];\n",
+ "x2 = y[1]*100/Kd[1];\n",
+ "x3 = y[2]*100/Kd[2];\n",
+ "\n",
+ "print ' (b).'\n",
+ "print ' The dew point temperature is %f K'%Td\n",
+ "print ' Liquid at dew point contains %f percent propane, %f percent butane and %f percent pentane'%(x1,x2,x3)\n",
+ "\n",
+ "#(c). Temperature and composition when 45% of initial mixture is vaporised\n",
+ "#Basis: \n",
+ "F = 100; \n",
+ "V = 45; \n",
+ "L = 55;\n",
+ "\n",
+ "#For the given condition eq. 8.91 (Page no. 364) is to be satisfied\n",
+ "#sum(zi/(1+ L/(VKi))) = 0.45\n",
+ "\n",
+ "z = [0.25, 0.4, 0.35];\n",
+ "T = [366.5 ,377.6]; \t\t\t#assumed temperatures\n",
+ "K1 = [2.3 ,0.9 ,0.4]; \t\t\t#at 366.5 K\n",
+ "K2 = [2.6 ,1.1 ,0.5]; \t\t\t#at 377.6 K\n",
+ "\n",
+ "Kz = [0 ,0];\n",
+ "for i in range(3):\n",
+ " Kz[0] = Kz[0] + z[i]/(1 + L/(V*K1[i]));\n",
+ " Kz[1] = Kz[1] + z[i]/(1 + L/(V*K2[i]));\n",
+ "\n",
+ "#The required temperature is T3\n",
+ "T3 = interp(.45,Kz,T);\n",
+ "\n",
+ "#At T3 K\n",
+ "K3 = [2.5, 1.08, 0.48];\n",
+ "\n",
+ "#Calculating liquid and vapour compositions\n",
+ "for i in range(3):\n",
+ " y[i] = (z[i]/(1 + L/(V*K3[i])))/0.45;\n",
+ " x[i] = ((F*z[i]) - (V*y[i]))/L;\n",
+ " print (x[i]);\n",
+ "\n",
+ "\n",
+ "print ' (c).'\n",
+ "print ' The equilibrium temperature is %f K'%T3\n",
+ "print ' Liquid composition in equilibrium is %f percent propane, %f percent butane \\\n",
+ "and %f percent pentane'%(x[0]*100,x[1]*100,x[2]*100)\n",
+ "print ' Vapour composition in equilibrium is %f percent propane, %f percent butane \\\n",
+ "and %f percent pentane'%(y[0]*100,y[1]*100,y[2]*100);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).\n",
+ " The bubble point temperature is 360.855932 K\n",
+ " At bubble point vapour contains 53.000000 percent propane, 34.000000 percent butane and 12.950000 percent pentane\n",
+ " (b).\n",
+ " The dew point temperature is 388.800000 K\n",
+ " Liquid at dew point contains 8.771930 percent propane, 32.000000 percent butane and 59.322034 percent pentane\n",
+ "0.149253731343\n",
+ "0.3861003861\n",
+ "0.456919060052\n",
+ " (c).\n",
+ " The equilibrium temperature is 374.651845 K\n",
+ " Liquid composition in equilibrium is 14.925373 percent propane, 38.610039 percent butane and 45.691906 percent pentane\n",
+ " Vapour composition in equilibrium is 37.313433 percent propane, 41.698842 percent butane and 21.932115 percent pentane\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To test whetherthe given data are thermodynamically consistent or not\n",
+ "\n",
+ "from numpy import array\n",
+ "\n",
+ "# Variables\n",
+ "P = 101.3; \t\t\t#total pressure (kPa)\n",
+ "x1 = array([0.003, 0.449, 0.700, 0.900])\n",
+ "y1 = array([0.432, 0.449, 0.520, 0.719])\n",
+ "P1 = [65.31 ,63.98, 66.64, 81.31]; \t\t\t#(kPa)\n",
+ "P2 = [68.64 ,68.64, 69.31, 72.24]; \t\t\t#(kPa)\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Calculations\n",
+ "#To test whether the given data are thermodynamically consistent or not\n",
+ "x2 = 1-x1;\n",
+ "y2 = 1-y1;\n",
+ "g1= [0,0,0,0]\n",
+ "g2 = [0,0,0,0]\n",
+ "c=[0,0,0,0]\n",
+ "import math\n",
+ "for i in range(4):\n",
+ " g1[i] = (y1[i]*P)/(x1[i]*P1[i])\n",
+ " g2[i] = (y2[i]*P)/(x2[i]*P2[i])\n",
+ " c[i] = math.log(g1[i]/g2[i]) \t\t\t#k = ln (g1/g2)\n",
+ "from matplotlib.pyplot import *\n",
+ "plot(x1,c)\n",
+ "\t\t\t#a = get(\"current_axes\"\n",
+ "\t\t\t#set(a,\"x_location\",\"origin\"\n",
+ "\n",
+ "# Results\n",
+ "show()\n",
+ "\t\t\t#As seen from the graph net area is not zero\n",
+ "print 'The given math.experimental data do not satisfy the Redlich-Kistern criterion'\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH7RJREFUeJzt3XtUlOW+B/DvIKikIqKAKWjFNrnfxAsmMGy8A0qhqcfT\ntovuVpfV0Vpt29vacbJtkbbdVqelpmWZnnapZXihzBwuHneRWmaltUszVARRRARU4Dl/PA0DWTrM\nvDPPzDvfz1qzFtT0vt/VOX579/M+7+81CCEEiIhIF7xUByAiIu2w1ImIdISlTkSkIyx1IiIdYakT\nEekIS52ISEfsLvWamhpMnToVcXFxiIiIwJ49e7TIRURENjDYu0996tSpuO222zBjxgy0tLSgrq4O\nfn5+WuUjIqIOsKvUq6urMWLECHz33XdaZiIiIhvZtfzy3XffITAwELfffjuio6Pxhz/8AXV1dVpl\nIyKiDrKr1FtaWlBWVoZHH30UBw8eREBAABYuXKhVNiIi6ihhh2PHjomBAwe2/l5SUiLGjh3b7jth\nYWECAD/88MMPPx34hIWF2dTLdl2ph4aGok+fPvj2228BAB999BEiIiLafef777+HEMKlPk8++aTy\nDO6QyVVzMRMzeUKu77//3qZe9ran1AFg9erVmDlzJurr6zFw4ECsW7fO3kMSEZGN7C71uLg4lJWV\naZ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N27t913NmzYIHJycoQQQuzdu1fE\nxsZqcWq7Mpk9+eSTTrlRak2mH3/8UYSFhYk9e/Y4PI+1mY4cOdL68969e0VISIhoaWlRmqmtO++8\nU2zcuNFheTqSq6qqqvXnzz77TPTv3180NzcrzbRv3z6RkZEhmpqaxIULF0RkZKTYv3+/0kxCCFFT\nUyMCAgJEfX29w7J0JNP9998v8vLyhBBCVFRUiL59+7beXFaV6dy5c+Ly5ctCCCHWrl0rpkyZcs3j\nalLqQgixbds2ERUVJSIiIsSiRYuEEEIsX75cLF++vPU7DzzwgIiMjBQJCQlX/UPqrEwnT54UISEh\nws/PT/j7+4vQ0FBx/vx5pZnuueceERAQIOLj40V8fLwYOnSoQ/NYk+mZZ54R0dHRIjo6WgwdOlSU\nlpYqz9SWs0rdmlwvvPBC67+rxMREUVRUpDyTEEIsXrxYREZGikGDBon8/HyXyLRmzRoxY8YMh2ex\nNlNFRYUYPXq0iIiIEDfffLNYtWqV8ky7d+8WN998s4iNjRW5ubmipqbmmsfkw0dERDrC19kREekI\nS52ISEdY6kREOsJSJyLSEZY6EZGOsNSJiHSEpU5EpCMsdSIiHfl/2hihodD/xAQAAAAASUVORK5C\nYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x227f050>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The given math.experimental data do not satisfy the Redlich-Kistern criterion\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To estimate the constants in Margules equation\n",
+ "\n",
+ "# Variables\n",
+ "x1 = [0.0331, 0.9652]; \t\t\t#composition of chloroform\n",
+ "P = [40.84 ,84.88]; \t\t\t#total pressure for system (kPa)\n",
+ "P1 = 82.35; \t\t\t#vapour pressure of chloroform at 328 K (kPa)\n",
+ "P2 = 37.30; \t\t\t#vapour pressure of acetone at 328 K (kPa) \n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "#To estimate the constants in Margules equation\n",
+ "#Using eq. 8.103 and 8.104 (Page no. 375)\n",
+ "g1_inf = (P[0]-(1-x1[0])*P2)/(x1[0]*P1)\n",
+ "g2_inf = (P[1]-(x1[1]*P1))/((1-x1[1])*P2)\n",
+ "\n",
+ "import math\n",
+ "A = math.log(g1_inf)\n",
+ "B = math.log(g2_inf)\n",
+ "\n",
+ "# Results\n",
+ "print 'Margules constants are:'\n",
+ "print ' A = %f'%A\n",
+ "print ' B = %f'%B\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Margules constants are:\n",
+ " A = 0.560560\n",
+ " B = 1.424762\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the partial pressure of water in vapour phase\n",
+ "\n",
+ "# Variables\n",
+ "x1 = [0., 0.033, 0.117, 0.318, 0.554, 0.736, 1.000]; \t\t\t#liquid composition of acetone\n",
+ "pp1 = [0.,25.33, 59.05, 78.37, 89.58,94.77, 114.63]; \t\t\t#partial pressure of acetone (kPa)\n",
+ "Pw = 19.91; \t\t\t#vapour pressure of water at 333 K (kPa)\n",
+ "k = [0,0,0,0,0,0,0]\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(1,6):\n",
+ " k[i] = x1[i]/((1.-x1[i])*pp1[i])\n",
+ "\n",
+ "k[6] = 0.1; \t\t\t#k(7) should tend to infinity\n",
+ "from matplotlib.pyplot import *\n",
+ "plot(pp1,k)\n",
+ "show()\n",
+ "\t\t\t#From graph% area gives the integration and hence partiaal pressure of water is calculated\n",
+ "pp2 = [19.91, 19.31, 18.27, 16.99, 15.42, 13.90, 0];\n",
+ "\n",
+ "# Results\n",
+ "print \"The results are:\"\n",
+ "print ' Acetone composition Partial pressure of water'\n",
+ "for i in range(7):\n",
+ " print ' %f %f'%(x1[i],pp2[i])\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH5pJREFUeJzt3X9UlPWeB/A3vwK7WvkLyhn8Eagww2AzCxqu604/DPHH\n5gpK6h07ZC3XW+vJ3La7f+xR15Mt/jjKpnHxptxbUEZ5K28Qx2M6lZZEC6TYdVUUncEof6aE0MB8\n948n5oLCzMDM8MzM836dMwdm5vvMfL51ztsPz/N9nidECCFARESKESp3AURENLAY/ERECsPgJyJS\nGAY/EZHCMPiJiBSGwU9EpDBuBX9FRQV0Oh00Gg3y8vJue//EiRNIS0tDVFQUNm/e7HjdYrFg+vTp\n0Ol0mDhxIjZs2OC9yomIqF9CXK3jb2trQ0JCAg4dOoSYmBikpaVhx44d0Ov1jjEXL17EuXPn8MEH\nH2Do0KFYtWoVAOD777/HxYsXkZSUhObmZhgMBrz77ruYNGmSb2dFRES9ctnxV1ZWQqvVQqVSITw8\nHNnZ2SgrK+s2ZuTIkUhJSUFERES312NiYpCUlAQAGDx4MJKTk3HhwgUvlk9ERH3lMvitVitiY2Md\nz9VqNaxWa5+/qKGhAVVVVZg2bVqftyUiIu9xGfwhISEef0lzczMWLFiA/Px8DBkyxOPPIyKi/gt3\nNUCtVsNisTieWyyWbn8BuGKz2ZCZmYnFixdj3rx5t70fHx+P+vp6tz+PiIiAuLg4nD59ul/buuz4\nU1NTUVdXh8bGRthsNpSWliIjI6PHsbceJxZCYNmyZdBoNFi5cmWP29TX10MIEbSP1atXy14D58f5\nKXF+wTw3IYRHDbPLjj8qK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obS0FBkZGXKV4zEhBJYtWwaNRoOVK1c6Xu88wQ0AiouLMWvWLLlK9Mj6\n9ethsVhw9uxZ7N69Gw8//DDefPPNoJlfbGwsRowYgZMnTwIA9u/fj8TERGRkZATF/OLj43HkyBHc\nvHkTQgjs378fcXFxQfP/r1Nv85k1axbeeecdx0Uk6+rqMHnyZDlL7bOKigps2LABe/fuRVRUlOP1\nfs3NS8ch+qW8vFxotVqRmJgo1q9fL2cpHvv8889FSEiImDRpknjggQfEAw88ID7++GNx+fJl8eij\njwqdTidmzJghrl69KnepHjObzY5VPcE0v9raWpGSkiI0Go3IyMgQV65cCar5rV69WsTHx4sJEyaI\n7OxscfPmzYCe3xNPPCHuu+8+ERERIdRqtdi1a5fT+bz88ssiMTFRaLVaUVFRIWPlrt06t507d4r4\n+HgxevRoR74sX77cMb6vc+MJXEREChNkV08nIiJXGPxERArD4CciUhgGPxGRwjD4iYgUhsFPRKQw\nDH4iIoVh8BMRKcz/Axc5FnWtf/T6AAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x30fad10>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The results are:\n",
+ " Acetone composition Partial pressure of water\n",
+ " 0.000000 19.910000\n",
+ " 0.033000 19.310000\n",
+ " 0.117000 18.270000\n",
+ " 0.318000 16.990000\n",
+ " 0.554000 15.420000\n",
+ " 0.736000 13.900000\n",
+ " 1.000000 0.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.27 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# to calculate under three phase equilibrium\n",
+ "\n",
+ "# Variables\n",
+ "P = 93.30; \t\t\t#total pressure in kPa\n",
+ "T1 = 353.; \t\t\t#(K)\n",
+ "T2 = 373.; \t\t\t#(K)\n",
+ "Pa1 = 47.98; \t\t\t#Vapour pressure of water at 353 K (kPa)\n",
+ "Pb1 = 2.67; \t\t\t#Vapour pressure of liquid at 353 K (kPa)\n",
+ "Pa2 = 101.3; \t\t\t#Vapour pressure of water at 373 K (kPa)\n",
+ "Pb2 = 5.33; \t\t\t#Vapour pressure of liquid at 373 K (kPa)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate under three phase equilibrium:\n",
+ "#(a). The equilibrium temperature\n",
+ "P1 = Pa1+Pb1; \t\t\t#sum of vapour pressures at 353 K\n",
+ "P2 = Pa2+Pb2; \t\t\t#at 373 K\n",
+ "\n",
+ "#Since vapour pressure vary linearly with temperature% so T at which P = 93.30 kPa\n",
+ "T = T1 + ((T2-T1)/(P2-P1))*(P-P1)\n",
+ "print '(a). The equilibrium temperature is %f K'%T\n",
+ "\n",
+ "#(b). The composition of resulting vapour\n",
+ "#At equilibrium temp:\n",
+ "Pa = 88.5; \t\t\t#vapour pressure of water (kPa)\n",
+ "Pb = 4.80; \t\t\t#vapour pressure of liquid (kPa)\n",
+ "\n",
+ "#At 3-phase equilibrium% ratio of mol fractions of components is same as the ratio of vapour pressures\n",
+ "P = Pa+Pb; \t\t\t#sum of vapour pressures\n",
+ "y = Pa/P; \t\t\t#mole fraction of water\n",
+ "print ' The vapour contains %f mol percent water vapour'%(y*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). The equilibrium temperature is 368.237585 K\n",
+ " The vapour contains 94.855305 mol percent water vapour\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To prepare temperature composition diagram\n",
+ "\n",
+ "# Variables\n",
+ "T = [323 ,333, 343, 348, 353, 363, 373]; \t\t\t#temperatures (K)\n",
+ "P2 = [12.40 ,19.86, 31.06, 37.99, 47.32, 70.11, 101.3]; \t\t\t#vapour pressure for benzene (kPa)\n",
+ "P1 = [35.85 ,51.85, 72.91, 85.31, 100.50, 135.42, 179.14]; \t\t\t#vapour pressure for water (kPa)\n",
+ "Tb = 353.1; \t\t\t#boiling temperature (K)\n",
+ "Pb = 101.3; \t\t\t#boiling pressure (kPa)\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To prepare temperature composition diagram\n",
+ "#To find three phase temperature\n",
+ "P = [0,0,0,0,0,0,0]\n",
+ "for i in range(7):\n",
+ " P[i] = P1[i] + P2[i];\n",
+ "from matplotlib.pyplot import *\n",
+ "plot(P,T)\n",
+ "\t\t\t#From graph, at P = 101.3 kPa..\n",
+ "T_ = 340.; \t\t\t#three phase temperature\n",
+ "\n",
+ "\t\t\t#At three phase temperature\n",
+ "P1_ = 71.18; \t\t\t#(kPa)\n",
+ "P2_ = 30.12; \t\t\t#(kPa)\n",
+ "xb_ = P1_/Pb; \t\t\t#mol fraction of benzene at triple point\n",
+ "\n",
+ "\t\t\t#For the dew point curve\n",
+ "\t\t\t#For curve BE in temp range from 342 to 373 K\n",
+ "y1 = [0,0,0,0,0,0,0]\n",
+ "for i in range(2,7):\n",
+ " y1[i] = 1-(P2[i]/Pb )\n",
+ "\n",
+ "\t\t\t#xset('window',1\n",
+ "T1 = [0,0,0,0,0,0,0]\n",
+ "y1_ = [0,0,0,0,0,0,0]\n",
+ "T1[0] = 342\n",
+ "y1_[0] = 0.7;\n",
+ "for i in range(1,6):\n",
+ " T1[i] = T[i+1];\n",
+ " y1_[i] = y1[i+1];\n",
+ "\n",
+ "plot(y1_,T1)\n",
+ "y2 = [0,0,0,0,0,0,0]\n",
+ "\t\t\t#For the curve Ae in the temp range of 342 K to 353.1 K\n",
+ "for i in range(2,5):\n",
+ " y2[i] = P1[i]/Pb;\n",
+ "\n",
+ "T2 = [0,0,0,0,0,0,0]\n",
+ "y2_ = [0,0,0,0,0,0,0]\n",
+ "T2[0] = 342.;\n",
+ "y2_[0] = 0.7;\n",
+ "for i in range(1,4):\n",
+ " T2[i] = T[i+1]\n",
+ " y2_[i] = y2[i+1]\n",
+ "\n",
+ "plot(y2_,T2)\n",
+ "\t\t\t#axhspan(0.25,0.75,facecolor='0.5'\n",
+ "\t\t\t#title(\"Temperature Composition diagram\",\"xa,ya\",\"Temperature\"\n",
+ "show()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD9CAYAAABdoNd6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG+JJREFUeJzt3X9wVPW9//Hnwey0UqjQK1norvculyQNCyFZS5NMp06X\nhmC9Xtd4caKx0r0K9w+Y3hkL7S38oSZ1JLEt1wFqZrw2fr+x3DFh2oFkOpKJ07JK6dT12mTsddWk\nmmiy+VEhggSkC9nz/WO/LAY2P0g2G7Ln9ZjZYTl79nw+nznwyjvvnJw1TNM0ERGRtDZvticgIiIz\nT2EvImIBCnsREQtQ2IuIWIDCXkTEAhT2IiIWMKmwHxkZwePxcNdddwEwNDREaWkpOTk5bNiwgVOn\nTsX3ra6uJjs7m9zcXFpbW2dm1iIick0mFfZ79+7F7XZjGAYANTU1lJaW0tHRQUlJCTU1NQCEQiEa\nGxsJhUK0tLSwbds2otHozM1eREQmZcKw7+3t5aWXXmLLli1c+v2r5uZm/H4/AH6/n8OHDwPQ1NRE\nRUUFNpsNl8tFVlYWwWBwBqcvIiKTMWHYf//73+enP/0p8+Zd3nVwcBC73Q6A3W5ncHAQgL6+PpxO\nZ3w/p9NJOBxO9pxFROQaZYz34m9+8xsyMzPxeDwEAoGE+xiGEW/vjPX6ZLaJiMjEpnqHm3Er+z/8\n4Q80NzezfPlyKioq+N3vfsemTZuw2+0MDAwA0N/fT2ZmJgAOh4Oenp74+3t7e3E4HGNO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l/N34sSJeAvq\n008/5eWXX8bj8STv3M3oj5YTeOmll8ycnBxzxYoV5u7du1M9fFK9//77Zn5+vpmfn2+uWrUqvp6T\nJ0+aJSUlZnZ2tllaWmp+/PHHszzTybv//vvNZcuWmTabzXQ6nebzzz8/7nqefPJJc8WKFeZXvvIV\ns6WlZRZnPjlXrq+urs7ctGmTmZeXZ65Zs8a8++67zYGBgfj+c219x44dMw3DMPPz882CggKzoKDA\nPHLkSFqcw0Rre+mll9Lm/L355pumx+Mx8/Pzzby8PPMnP/mJaZrj58m1rC/p98YREZHrjz6pSkTE\nAhT2IiIWoLAXEbEAhb2IiAUo7EVELEBhLyJiAf8PLH4K5zRwZxUAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2cc5c50>"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch9.ipynb b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch9.ipynb
new file mode 100644
index 00000000..a4ef1c21
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/ch9.ipynb
@@ -0,0 +1,1102 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Chemical Reaction Equilibria"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate equilibrium constant\n",
+ "\n",
+ "import math\n",
+ "#Given:\n",
+ "Go_reac = 97540.; \t\t\t#standard free energy of formation of reactant (J/mol)\n",
+ "Go_pdt = 51310.; \t\t\t#standard free energy of formation of product (J/mol)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "T = 298.; \t\t\t#temperature (K)\n",
+ "#Reaction: N2O4(g) --> 2NO2(g)\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate equilibrium constant\n",
+ "#Using eq. 9.50 (Page no.413)\n",
+ "Go = 2*Go_pdt - Go_reac;\n",
+ "#Using eq. 9.31 (Page no. 406)\n",
+ "K = math.e**(-Go/(R*T))\n",
+ "\n",
+ "# Results\n",
+ "print 'The equilbrium constant %f'%K\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilbrium constant 0.128684\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate equilibrium constant at 500 K\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 298.; \t\t\t#temperature in K\n",
+ "Hf = -46100.; \t\t\t#standard heat of formation (J/mol)\n",
+ "Go = -16500.; \t\t\t#standard free energy change (J/mol)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "T = 500.; \n",
+ "#Reaction: N2(g) + 3H2(g) --> 2NH3(g)\n",
+ "#To calculate the equilibrium constant at 500 K\n",
+ "#Using eq. 9.50 (Page no. 413)\n",
+ "\n",
+ "# Calculations\n",
+ "del_Go = 2*Go;\n",
+ "import math\n",
+ "#Using eq. 9.31 (Page no. 406)\n",
+ "K1 = math.e**(-del_Go/(R*T1)) \t\t\t#equilibrium const at 298 K\n",
+ "Ho = 2*Hf; \t\t\t#standard heat of reaction\n",
+ "\n",
+ "#Using eq. 9.37 (Page no. 411)\n",
+ "K = K1*(math.e**((-Ho/R)*(1/T - 1/T1)))\n",
+ "\n",
+ "# Results\n",
+ "print 'The equilibrium constant at 500 K is %f'%K\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium constant at 500 K is 0.179981\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To alculate standard free energy change and heat of formation\n",
+ "\n",
+ "# Variablesa\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "T2 = 317.; \t\t\t#temperature in K\n",
+ "T1 = 391.; \t\t\t#(K)\n",
+ "x2 = 0.31; \t\t\t#mol fraction of n-butane at 317 K\n",
+ "x1 = 0.43; \t\t\t#mol fraction of iso-butane at 391 K\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate standard free energy change and heat of reaction\n",
+ "#At 317 K\n",
+ "K2 = (1-x2)/x2; \t\t\t#equilibrium constant at 317 K\n",
+ "K1 = (1-x1)/x1; \t\t\t#equilibrium constant at 391 K\n",
+ "import math\n",
+ "#Using eq. 9.31 (Page no. 406)\n",
+ "#Standard free energy change\n",
+ "G2 = -R*T2*math.log(K2 )\t\t\t#at 317 K (J/mol)\n",
+ "G1 = -R*T1*math.log(K1 )\t\t\t#at 391 K (J/mol)\n",
+ "\n",
+ "#Using eq. 9.37 (Page no. 411)\n",
+ "Ho = -math.log(K2/K1)*R/(1/T2 - 1/T1)\n",
+ "\n",
+ "# Calculations\n",
+ "print 'Standard free energy change of the reaction'\n",
+ "print ' At 317 K is %f J/mol'%G2\n",
+ "print ' At 391 K is %f J/mol'%G1\n",
+ "print ' Average value of heat of reaction is %f J/mol'%Ho\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard free energy change of the reaction\n",
+ " At 317 K is -2108.744820 J/mol\n",
+ " At 391 K is -916.234397 J/mol\n",
+ " Average value of heat of reaction is -7217.201631 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To estimate free energy change and equilibrium constant at 700 K\n",
+ "\n",
+ "# Variables\n",
+ "To = 298.; \t\t\t#temperature in K\n",
+ "T = 700.; \t\t\t#(K)\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "Hf = -46100.; \t\t\t#standard heat of formation (J/mol)\n",
+ "Gf = -16500.; \t\t\t#standard free energy of formtion of ammonia (J/mol)\n",
+ "\n",
+ "# Calculations\n",
+ "Ho = 2*Hf;\n",
+ "Go = 2*Gf;\n",
+ "alpha = 2*29.75 - 27.27 - 3*27.01;\n",
+ "betta = (2*25.11 - 4.93 - 3*3.51)*10**-3;\n",
+ "import math\n",
+ "#Using eq. 9.46 (Page no. 412)\n",
+ "del_H = Ho - alpha*To - (betta/2)*To**2;\n",
+ "#Using eq. 9.48 (Page no. 413)\n",
+ "A = -(Go - del_H + alpha*To*math.log(To) + (betta/2)*To**2)/(R*To)\n",
+ "\n",
+ "#Using eq. 9.47 and 9.48 (Page no. 412)\n",
+ "K = math.e**((-del_H/(R*T)) + (alpha/R)*math.log(T) + (betta/(2*R))*T + A)\n",
+ "G = del_H - alpha*T*math.log(T) -(betta/2)*T**2 - A*R*T;\n",
+ "\n",
+ "# Results\n",
+ "print 'At 700 K'\n",
+ "print ' Equilibrium constant is %3.2e'%K\n",
+ "print ' Standard free energy change is %f J/mol'%G\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At 700 K\n",
+ " Equilibrium constant is 9.99e-05\n",
+ " Standard free energy change is 53606.315911 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# to calculate equilibrium constant at 600 K\n",
+ "\n",
+ "# Variables\n",
+ "T = 600.; \t\t\t#temperature in K\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "#Gibbs free energy at 600 K (J/mol K)\n",
+ "Gc = -203.81; \t\t\t#for CO\n",
+ "Gh = -136.39; \t\t\t#for hydrogen\n",
+ "Gm = -249.83; \t\t\t#for methanol\n",
+ "\n",
+ "#Heats of formation at 298 K (J/mol)\n",
+ "Hc = -110500.; \t\t\t#for CO\n",
+ "Hm = -200700.; \t\t\t#for methanol\n",
+ "import math\n",
+ "\n",
+ "# Calculations\n",
+ "#To calculate equilibrium constant at 600 K\n",
+ "Go = T*((Gm-Gc-(2*Gh)) + (1/T)*(Hm-Hc))\n",
+ "\t\t\t#Using eq. 9.31 (Page no. 406)\n",
+ "K = math.e**(-Go/(R*T))\n",
+ "\n",
+ "# Results\n",
+ "print 'Equilibrium constant is %4.3e'%K\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium constant is 1.018e-04\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate equilibrium constant at 500K\n",
+ "\n",
+ "# Variables\n",
+ "T = 500.; \t\t\t#temperature in K\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "\n",
+ "#Free energy at 500 K (J/mol K)\n",
+ "Fn = -177.5; \t\t\t#for nitrogen\n",
+ "Fh = -116.9; \t\t\t#for hydrogen\n",
+ "Fa = -176.9; \t\t\t#for ammonia\n",
+ "\n",
+ "#The function (Ho at 298 K - Ho at 0 K) [J/mol]\n",
+ "Hn = 8669.; \t\t\t#for nitrogen\n",
+ "Hh = 8468.; \t\t\t#for hydrogen\n",
+ "Ha = 9920.; \t\t\t#for methanol\n",
+ "\n",
+ "#Free energy of formation at 298 K (J/mol)\n",
+ "Hf = -46100.;\n",
+ "import math\n",
+ "#To calculate equilibrium constant at 500 K\n",
+ "\n",
+ "# Calculations\n",
+ "#Using eq. 9.53 (Page no. 414)\n",
+ "sum_F = (2*Fa - Fn - 3*Fh) - (2*Ha - Hn - 3*Hh)/T; \t\t\t#(J/mol K)\n",
+ "#Using eq. 9.57 (Page no.415)\n",
+ "Go = T*(sum_F + 2*Hf/T)\n",
+ "K = math.e**(-Go/(R*T))\n",
+ "\n",
+ "# Results\n",
+ "print 'Equilibrium constant is %f'%K\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium constant is 0.108493\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To find the value of n\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1.; \t\t\t#pressure (bar)\n",
+ "P2 = 2.; \t\t\t#(bar)\n",
+ "x1 = 0.15; \t\t\t#mol fraction of polymer at 1 bar\n",
+ "x2 = 0.367; \t\t\t#mol fraction of polymer at 2 bar\n",
+ "\n",
+ "# Calculations\n",
+ "import math\n",
+ "n = round((math.log(x2/x1)+math.log(2))/(math.log(2)-math.log((1-x1)/(1-x2))))\n",
+ "\n",
+ "# Results\n",
+ "print 'The value of n is %i'%n\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of n is 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the percent conversion\n",
+ "\n",
+ "from scipy.optimize import root\n",
+ "\n",
+ "# Variables\n",
+ "#Reaction: N2 + 3H2 --> 2NH3\n",
+ "K = 2*10**-4; \t\t\t#equilibrium constant of reaction\n",
+ "P = 20; \t\t\t#(bar)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#e(4-2e)/(1-e)**2 = 0.73485\n",
+ "#e = poly(0,'e')\n",
+ "def f(e):\n",
+ " return 2.73845*e**2 - 5.4697*e + 0.73485;\n",
+ "x = root(f,0)\n",
+ "\n",
+ "print '(a) Percentage conversion is %f percent'%(x.x[0]*100)\n",
+ "\n",
+ "#(b)\n",
+ "P = 200; \t\t\t#(bar)\n",
+ "\n",
+ "#e(4-2e)/(1-e)**2 = 7.3485\n",
+ "\n",
+ "def f2(e):\n",
+ " return 9.3485*e**2 - 18.697*e + 7.3485;\n",
+ "x = root(f2,0)\n",
+ "print ' (b) Percentage conversion is %f percent'%(x.x[0]*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Percentage conversion is 14.485445 percent\n",
+ " (b) Percentage conversion is 53.746561 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate fractional dissociation of steam\n",
+ "\n",
+ "# Variables\n",
+ "K = 1; \t\t\t#equilibrium constant for reaction\n",
+ "\n",
+ "# Calculations and Results\n",
+ "e = 1./2;\n",
+ "print '(a) Fractional dissociation of steam is %i percent'%(e*100)\n",
+ "\n",
+ "#(b). If reactant stream is diluted with 2 mol nitrogen\n",
+ "#Mole fraction of components\n",
+ "#CO: (1-e)/4\n",
+ "#H20: (1-e)/4\n",
+ "#CO2: e/4\n",
+ "#H2: e/4\n",
+ "\n",
+ "#so% K = (e/4)(e/4)/[(1-e)/4][(1-e)/4]\n",
+ "#On solving we get\n",
+ "e = 1./2;\n",
+ "print ' (b) After dilution fractional distillation of steam is %i percent'%(e*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Fractional dissociation of steam is 50 percent\n",
+ " (b) After dilution fractional distillation of steam is 50 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine conversion of nitrogen affected by argon\n",
+ "\n",
+ "from scipy.optimize import root\n",
+ "\n",
+ "# Variables\n",
+ "K = 2.*10**-4; \t\t\t#equilibrium constant of reaction\n",
+ "P = 20.; \t\t\t#pressure in bar\n",
+ "\n",
+ "#To determine conversion of nitrogen affected by argon\n",
+ "\n",
+ "#Mole fraction of components\n",
+ "#Nitrogen: (1-e)/(6-2e)\n",
+ "#Hydrogen: 3(1-e)/(6-2e)\n",
+ "#Ammonia: 2e/(6-2e)\n",
+ "\n",
+ "#[2e/(6-2e)]**2/[(1-e)/(6-2e)][3(1-e)/(6-2e)]**3 = K*P**2\n",
+ "#e(3-e)/(1-e)**2 = 0.3674\n",
+ "\n",
+ "# Calculations\n",
+ "def f(e):\n",
+ " return 1.3674*e**2 - 3.7348*e + 0.3674;\n",
+ "x = root(f,0)\n",
+ "\n",
+ "# Results\n",
+ "print 'Percentage coversion in presence of argon is %f percent'%(x.x[0]*100)\n",
+ "print ' while in absence of argon is 14.48 percent' \t\t\t#From example 9.13\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage coversion in presence of argon is 10.219587 percent\n",
+ " while in absence of argon is 14.48 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the fractional dissociation of steam\n",
+ "\n",
+ "# Variables\n",
+ "P = 1.; \t\t\t#pressure in bar\n",
+ "K = 1.; \t\t\t#equilibrium constant of reaction\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate the fractional dissociation of steam\n",
+ "#Basis: 1 mole water vapour present in reactant stream\n",
+ "#Let e be the extent of reaction\n",
+ "\n",
+ "#(a). CO supplied is 100% in excess of the stoichiometric requirement\n",
+ "#Mole fraction of components:\n",
+ "#CO: (2-e)/3\n",
+ "#H20: (1-e)/3\n",
+ "#CO2: e/3\n",
+ "#H2: e/3\n",
+ "\n",
+ "#e**2/{(1-e)(2-e)] = K = 1% so\n",
+ "#3e-2 = 0;\n",
+ "e = 2./3;\n",
+ "print '(a). The conversion of steam is %f percent'%(e*100)\n",
+ "\n",
+ "#(b). CO supplied is only 50% of the theoretical requirement\n",
+ "#Mole fraction of components\n",
+ "#CO: (0.5-e)/1.5\n",
+ "#H20: (1-e)/1.5\n",
+ "#CO2: e/1.5\n",
+ "#H2: e/1.5\n",
+ "\n",
+ "#e**2/[(0.5-e)(1-e)] = K = 1\n",
+ "#1.5e-0.5 = 1\n",
+ "e = 0.5/1.5;\n",
+ "print ' (b). Percentage conversion of steam is %f percent'%(e*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a). The conversion of steam is 66.666667 percent\n",
+ " (b). Percentage conversion of steam is 33.333333 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the fractional distillation of steam\n",
+ "\n",
+ "# Variables\n",
+ "K = 1.; \t\t\t#equilibrium constant of reaction\n",
+ "\n",
+ "# Calculations\n",
+ "e = 1./3;\n",
+ "\n",
+ "# Results\n",
+ "print 'Percentage conversion of steam is %f percent'%(e*100)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage conversion of steam is 33.333333 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To evaluate the percent conversion of CO\n",
+ "\n",
+ "# Variables\n",
+ "#Reaction: CO(g) + 2H2(g) --> CH3OH(g)\n",
+ "Kf = 4.9*10**-5;\n",
+ "Kfi = 0.35;\n",
+ "P = 300.; \t\t\t#pressure in bar\n",
+ "n_CO = 25.;\n",
+ "n_H2 = 55.;\n",
+ "n_inert = 20.;\n",
+ "v = -1-2+1; \t\t\t#change in number of moles in reaction\n",
+ "\n",
+ "# Calculations\n",
+ "#Mole fractions in the equilibrium mixture\n",
+ "#CO = (25-e)/(100-2e)\n",
+ "#H2 = (55-2e)/(100-2e)\n",
+ "#CH3OH = e/(100-2e)\n",
+ "\n",
+ "Ky = (Kf/Kfi)*P**(-v)\n",
+ "\t\t\t#[e/(100-2e)]/[(25-e)/(100-2e)][(55-2e)/(100-2e)]**2 = Ky% so\n",
+ "\n",
+ "def f(e):\n",
+ " return (4+4*Ky)*e**3 - (400+320*Ky)*e**2 + (10000+8525*Ky)*e - 75625*Ky\n",
+ "\n",
+ "x = root(f,0)\n",
+ "conv = x.x[0]/n_CO; \t\t\t#first two roots are complex\n",
+ "\n",
+ "# Results\n",
+ "print 'Percentage conversion of CO is %f percent'%(conv*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage conversion of CO is 61.015734 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the composition of gases leaving the reactor\n",
+ "\n",
+ "# Variables\n",
+ "#Reaction: 1/2N2 + 3/2H2 --> NH3\n",
+ "Kp = 1.25*10**-2 ;\t\t\t#equilibrium constant\n",
+ "P = 50; \t\t\t#pressure in bar\n",
+ "v = 1-(3./2)-(1./2) \t\t\t#change in number of moles in reaction\n",
+ "\n",
+ "#Initial composition of gas mixture\n",
+ "n_h = 60.;\n",
+ "n_n = 20.;\n",
+ "n_inert = 100-n_h-n_n;\n",
+ "\n",
+ "# Calculations\n",
+ "#To determine the composition of gases leaving the reactor\n",
+ "#Mole fractions in the equilibrium mixture\n",
+ "#N2: [20-(e/2)]/(100-e)\n",
+ "#H2: [60-(3e/2)]/(100-e)\n",
+ "#NH3: e/(100-e)\n",
+ "Ky = Kp*(P**-v)\n",
+ "#e/(100-e)/[(20-(e/2)]**1/2[{60-(3e/2)}/(100-e)]**3/2 = Ky\n",
+ "#e = poly(0%'e'\n",
+ "\n",
+ "def f(e):\n",
+ " return (1.6875*Ky**2-1)*e**4 - (270*Ky**2+200)*e**3 + (16200*Ky**2-10000)*e**2 - (334800*Ky**2)*e + 4320000*Ky**2;\n",
+ "x = root(f,0)\n",
+ "e = x.x[0]\n",
+ "\n",
+ "#x(4) being the only positive root is the percentage conversion\n",
+ "#Mole fractions in equilibrium mixture\n",
+ "x_n = (20-(e/2))/(100-e)\n",
+ "x_h = (60-3*(e/2))/(100-e)\n",
+ "x_a = e/(100-e)\n",
+ "x_inert = 1 - x_n - x_h - x_a;\n",
+ "\n",
+ "# Results\n",
+ "print 'Composition of gas leaving the reactor is'\n",
+ "print ' Nitrogen : %f percent'%(x_n*100)\n",
+ "print ' Hydrogen : %f percent'%(x_h*100)\n",
+ "print ' Ammonia : %f percent'%(x_a*100)\n",
+ "print ' Inert gas : %f percent'%(x_inert*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Composition of gas leaving the reactor is\n",
+ " Nitrogen : 17.048802 percent\n",
+ " Hydrogen : 51.146406 percent\n",
+ " Ammonia : 9.837327 percent\n",
+ " Inert gas : 21.967465 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To evaluate the equilibrium constant\n",
+ "\n",
+ "# Variables\n",
+ "P = 85.; \t\t\t#pressure in bar\n",
+ "n_e = 0.015; \t\t\t#mol percent of ethanol\n",
+ "n_w = 0.95; \t\t\t#mole percent of water\n",
+ "n_a = 0.48; \t\t\t#mol percent of ethylene in vapour phase\n",
+ "M = 18.; \t\t\t#molecular mass of water\n",
+ "fc = 0.9; \t\t\t#fugacity coeffecient for ethylene\n",
+ "\n",
+ "#To evaluate the equilibrium constant\n",
+ "#K = a_c/(a_a*a_b)\n",
+ "# Calculations\n",
+ "m_e = n_e/(n_w*M*10**-3) \t\t\t#mol/kg water\n",
+ "a_c = m_e;\n",
+ "fa = fc*n_a*P; \t\t\t#bar\n",
+ "a_a = fa;\n",
+ "\n",
+ "#Since mol fraction of water is close to unity% so fugacity coeffecient of water is assumed to be 1\n",
+ "a_b = n_w;\n",
+ "K = a_c/(a_a*a_b)\n",
+ "\n",
+ "# Results\n",
+ "print 'The equilibrium constant is %5.4e (mol C2H4)/(kg water bar)'%K\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium constant is 2.5146e-02 (mol C2H4)/(kg water bar)\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the decomposition pressure and temperature at 1 bar\n",
+ "\n",
+ "# Variables\n",
+ "T = 1000.; \t\t\t#temperature of reaction in K\n",
+ "P = 1.; \t\t\t#pressure in bar\n",
+ "R = 8.314; \t\t\t#ideal gas constant\n",
+ "import math\n",
+ "\n",
+ "#Function for standard free energy of the reaction\n",
+ "def G(T):\n",
+ " y = 1.8856*10**5 - 243.42*T + 11.8478*T*math.log(T) - 3.1045*10**-3*T**2 + 1.7271*10**-6*T**3 - (4.1784*10**5)/T\n",
+ " return y\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#To calculate the decomposition pressure and temperaure at 1 bar\n",
+ "Go = G(T)\n",
+ "K = math.e**(-Go/(R*T))\n",
+ "#Using eq. 9.75 (Page no. 432)\n",
+ "p_CO2 = K; \t\t\t#decomposition pressure\n",
+ "print 'Decomposition pressure of limestone at 1000 K s %f bar'%p_CO2\n",
+ "\n",
+ "#At pressure = 1 bar\n",
+ "K = 1.;\n",
+ "Go = 0.; \t\t\t#since K = 1\n",
+ "\n",
+ "T = 1160.; \t\t\t#assumed temperature (K)\n",
+ "flag = 1.;\n",
+ "while(flag==1):\n",
+ " res = round(G(T))\n",
+ " if(res<=0):\n",
+ " flag = 0;\n",
+ " else:\n",
+ " T = T+1;\n",
+ "\n",
+ "print 'Decomposition temperature at 1 bar is %i K'%T\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decomposition pressure of limestone at 1000 K s 0.048344 bar\n",
+ "Decomposition temperature at 1 bar is 1169 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To evaluate wt of iron produced per 100 cubic m of gas admitted\n",
+ "\n",
+ "# Variables\n",
+ "K = 0.403; \t\t\t#equilibrium constant of reaction\n",
+ "T = 1200.; \t\t\t#temperature of reaction (K)\n",
+ "To = 273.; \t\t\t#standard temperature (K)\n",
+ "Vo = 22.4*10**-3; \t\t\t#molar volume at STP \n",
+ "M = 55.8; \t\t\t#molecular mass of iron\n",
+ "n = 100.; \t\t\t#moles of gas entering\n",
+ "n_C = 20.; \t\t\t#moles of carbon mono oxide\n",
+ "n_N = 80.; \t\t\t#moles of nitrogen\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "#Let e be the extent of reaction\n",
+ "#Mole fractions in equilibrium mixture\n",
+ "#CO = (20-e)/100\n",
+ "#CO2 = e/100\n",
+ "#e/(20-e) = K\n",
+ "e = (20*K)/(1+K)\n",
+ "n_CO2 = e; \t\t\t#moles of CO2 at equilibrium\n",
+ "n_Fe = n_CO2; \t\t\t#by stoichiometry\n",
+ "V = (n*Vo*T)/To; \t\t\t#volume of 100 mol of gas at 1200 K and 1 bar\n",
+ "\n",
+ "#Let m be iron produced per 100 m**3 gas\n",
+ "m = (n_Fe*100*M)/V;\n",
+ "\n",
+ "# Results\n",
+ "print 'Iron produced per 100 cubic m of gas is %f kg'%(m/1000)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iron produced per 100 cubic m of gas is 3.255704 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To calculate the composition at equilibrium assuming ideal behaviour\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "# Variables\n",
+ "P = 1.; \t\t\t#pressure in bar\n",
+ "K1 = 0.574; \t\t\t#equilibrium constant for eq. 9.88 (Page no. 437)\n",
+ "K2 = 2.21; \t\t\t#equilibrium constant for eq. 9.89 (Page no. 437)\n",
+ "\n",
+ "v1 = 1+3-1-1;\n",
+ "v2 = 1+1-1-1;\n",
+ "Ky1 = K1*P**-v1;\n",
+ "Ky2 = K2*P**-v2;\n",
+ "\n",
+ "# Calculations\n",
+ "#mole fractions in equilibrium mixture are:\n",
+ "#CH4: (1-e1)/(6+2e1)\n",
+ "#H2O: (5-e1-e2)/(6+2e1)\n",
+ "#CO: (e1-e2)/(6+2e1)\n",
+ "#H2: (3e1+e2)/(6+2e1)\n",
+ "#CO2: e2/(6+2e1)\n",
+ "\n",
+ "#For 1st reaction:\n",
+ "#Ky1 = [(e1-e2)(3e1+e2)**3]/[(1-e1)(5-e1-e2)(6+2e1)**2]\n",
+ "#For 2nd reaction:\n",
+ "#Ky2 = [e2(3e1+e2)]/[(e1-e2)(5-e1-e2)]\n",
+ "#on solving% we get:\n",
+ "\n",
+ "def f2(e):\n",
+ " f_1 = ((e[0]-e[1])*(3*e[0]+e[1])**3)/((1-e[0])*(5-e[0]-e[1])*(6+2*e[0])**2)-Ky1\n",
+ " f_2 = (e[1]*(3*e[0]+e[1]))/((e[0]-e[1])*(5-e[0]-e[1]))-Ky2\n",
+ " y = [f_1,f_2]\n",
+ " return y\n",
+ "eo = [0.9,0.6]; \t\t\t#initial guesses\n",
+ "e = fsolve(f2,eo)\n",
+ "\n",
+ "\t\t\t#Mole fraction of components:\n",
+ "n_m = (1-e[0])/(6+2*e[0])\n",
+ "n_w = (5-e[0]-e[1])/(6+2*e[0])\n",
+ "n_CO = (e[0]-e[1])/(6+2*e[0])\n",
+ "n_h = (3*e[0]+e[1])/(6+2*e[0])\n",
+ "n_c = e[1]/(6+2*e[0])\n",
+ "\n",
+ "# Results\n",
+ "print 'Mole fraction of the components are:'\n",
+ "print ' Methane = %f'%n_m\n",
+ "print ' Water = %f'%n_w\n",
+ "print ' Carbon monoxide = %f'% n_CO\n",
+ "print ' Hydrogen = %f'%n_h\n",
+ "print ' Carbon dioxide = %f'%n_c\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mole fraction of the components are:\n",
+ " Methane = 0.011240\n",
+ " Water = 0.441597\n",
+ " Carbon monoxide = 0.035687\n",
+ " Hydrogen = 0.430593\n",
+ " Carbon dioxide = 0.080883\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To determine the number of degrees of freedom\n",
+ "\n",
+ "# Variables\n",
+ "#A system consisting of CO% CO2% H2% H2O% CH4\n",
+ "\n",
+ "#To determine the number of degrees of freedom\n",
+ "\n",
+ "#Formation reactions for each of compounds is written\n",
+ "#a. C + 1/2O2 --> CO\n",
+ "#b. C + O2 --> CO2\n",
+ "#c. H2 + 1/2O2 --> H2O\n",
+ "#d. C + 2H2 --> CH4\n",
+ "\n",
+ "#Elements C and O2 are not present% so they are to be eliminated\n",
+ "#Combining a and b\n",
+ "#e. CO2 --> CO + 1/2O2\n",
+ "\n",
+ "#Combining a and d\n",
+ "#f. CH4 + 1/2O2 --> CO + 2H2\n",
+ "\n",
+ "#Combining c and e\n",
+ "#g. CO2 + H2 --> CO + H2O\n",
+ "\n",
+ "#Combining c and f\n",
+ "#h. 3H2 + CO --> CH4 + H2O\n",
+ "\n",
+ "#Equations g and h represent independent chemical reactions% so\n",
+ "r = 2.;\n",
+ "C = 5.; \t\t\t#no. of components\n",
+ "pi = 1.; \t\t\t#no. of phases\n",
+ "\n",
+ "# Calculations\n",
+ "#From eq. 9.90 (Page no. 438)\n",
+ "F = C-pi-r+2;\n",
+ "\n",
+ "# Results\n",
+ "print 'The number of degrees of freedom are %i'%F\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of degrees of freedom are 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-1.png b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-1.png
new file mode 100644
index 00000000..5dd7c85d
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-1.png
Binary files differ
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-2.png b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-2.png
new file mode 100644
index 00000000..9bdfe953
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-2.png
Binary files differ
diff --git a/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-3.png b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-3.png
new file mode 100644
index 00000000..d85833ae
--- /dev/null
+++ b/A_Textbook_Of_Chemical_Engineering_Thermodynamics/screenshots/giri-3.png
Binary files differ
diff --git a/Basic_Mechanical_Engineering/README.txt b/Basic_Mechanical_Engineering/README.txt
new file mode 100644
index 00000000..9d51031d
--- /dev/null
+++ b/Basic_Mechanical_Engineering/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ravi Garg
+Course: btech
+College/Institute/Organization: Gurgaon College of Engineering , MDU Rohtak
+Department/Designation: ECE
+Book Title: Basic Mechanical Engineering
+Author: G K Pathak and D K Chavan
+Publisher: Rajsons Publications, New Delhi
+Year of publication: 2009
+Isbn: 9788189401313
+Edition: 1 \ No newline at end of file
diff --git a/Basic_Mechanical_Engineering/bme1.ipynb b/Basic_Mechanical_Engineering/bme1.ipynb
new file mode 100644
index 00000000..fa3c24cb
--- /dev/null
+++ b/Basic_Mechanical_Engineering/bme1.ipynb
@@ -0,0 +1,1510 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Fundamental Concepts and Definitions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page No. 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the work done\n",
+ "\n",
+ "#Input data\n",
+ "p=700\t\t #pressure of fluid in kN/m**2\n",
+ "v1=0.28\t\t#Initial volume of fluid in m**3\n",
+ "v2=1.68\t\t#Final volume of fluid in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "W=p*(v2-v1)\t#Work done in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'The Work done is',round(W,1),'KJ or',round(W/1000,3),'MJ'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Work done is 980.0 KJ or 0.98 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page No.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the new volume of gas\n",
+ "\n",
+ "#Input data\n",
+ "p1=138.0\t\t#Initial pressure of gas in kN/m**2\n",
+ "p2=690.0\t\t#Final pressure of gas in kN/m**2\n",
+ "v1=0.112\t\t#Initial volume in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "P=p1/p2\t\t#Pressure ratio\n",
+ "v2=v1*(P**(1/1.4))\t#Final volume of gas in m**3\n",
+ "\n",
+ "#Output\n",
+ "print'The new volume of the gas is',round(v2,3),\"m**3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The new volume of the gas is 0.035 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page No. 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find (a)Final volume of gas . \n",
+ "#(b)Work done by the gas during the expansion \n",
+ "\n",
+ "#Input data\n",
+ "p1=2070\t\t#Initial pressure of gas in kN/m**2\n",
+ "p2=207\t\t#Final pressure of gas in kN/m**2\n",
+ "v1=0.014\t\t#Initial volume of gas in m**3\n",
+ "n=1.35\t\t#constant\n",
+ "\n",
+ "#Calculations\n",
+ "P=p1/p2\t\t#Pressure ratio\n",
+ "v2=v1*(P**(1/1.35))\t#Final volume of gas in m**3\n",
+ "W=(p1*v1-p2*v2)/(n-1)\t#Work done in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Final volume of gas ',round(v2,3),\"m**3 \"\n",
+ "print'(b)Work done by the gas during the expansion is',round(W,2),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Final volume of gas 0.077 m**3 \n",
+ "(b)Work done by the gas during the expansion is 37.22 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page No.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find(a)Final pressure and the work done on gas\n",
+ "\n",
+ "#Input data\n",
+ "v1=0.056\t\t#Initial volume of gas in m**3\n",
+ "v2=0.007\t\t#Final volume of gas in m**3\n",
+ "p1=100\t\t#Initial perssure compressed Isothermally in kN/m**2\n",
+ "\n",
+ "#Calculations\n",
+ "p2=(p1*v1)/v2\t#Final pressure in kN/m**2\n",
+ "W=p1*v1*(math.log(v2/v1))\t#Work done in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Final pressure is',round(p2,0),\"kN/m**2 \"\n",
+ "print'(b)The work done on gas is',round(-W,2), \"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Final pressure is 800.0 kN/m**2 \n",
+ "(b)The work done on gas is 11.64 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 1.5 Page No. 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the work done\n",
+ "\n",
+ "#Input data\n",
+ "v1=1.0\t\t#Initial volume in m**3\n",
+ "v2=3.0\t\t#Final volume in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "W=10**5*(((v2**3-v1**3)/3)+8*(math.log(v2/v1)))\t#Work done in J\n",
+ "\n",
+ "#Output\n",
+ "print'The work done is',round(W,0),\"Nm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work done is 1745556.0 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page No. 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The work done by the gas .\n",
+ "\n",
+ "#Input data\n",
+ "v1=0.2\t#Initial volume in m**3\n",
+ "v2=0.5\t#Final volume in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "W=1500*(((v2**2-v1**2)/200)+(v2-v1))/1000\t#Work done in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'The work done by the gas is',round(W,4),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work done by the gas is 0.4516 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The work done by the gas \n",
+ "\n",
+ "#Input data\n",
+ "v1=1.5\t\t#Initial volume in m**3\n",
+ "v2=2\t\t#Final volume in m**3\n",
+ "w1=2\t\t#Work receiving in Nm\n",
+ "p=6\t\t#constsnt pressure of gas in N/m**2\n",
+ "\n",
+ "#Calculations\n",
+ "w2=p*(v2-v1)\t#Work done in Nm\n",
+ "W=w2-w1\t\t#Net work done by the system in Nm\n",
+ "\n",
+ "#Output\n",
+ "print'Net work done by the system is',round(W,2),\"Nm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net work done by the system is 1.0 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.9 Page No. 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find(a)Pressure of 80cm and 40 cm of Hg \n",
+ "#(c)Pressure due to 1.5m of water coloumn \n",
+ "#(d)Pressure in kPa for 5.2bar \n",
+ "\n",
+ "#Input data\n",
+ "d=13596\t\t#Density of Hg in kg/m**3\n",
+ "g=9.806\t\t#gravity in m/sec**2\n",
+ "z=760.0\t\t#Barometer pressure in mm of Hg\n",
+ "Pv=40.0\t\t#Vaccum pressure in cm\n",
+ "dw=1000.0\t\t#Density of water in kg/m**3\n",
+ "Zw=1.5\t\t#Level of water in m\n",
+ "\n",
+ "#Calculations\n",
+ "p=(d*g*z)/10**6\t#Pressure in kPa\n",
+ "p1=(80/76.0)*p\t#Pressure in kPa\n",
+ "Pa=p-Pv\t\t#Absolute pressure in kPa\n",
+ "p2=(36/76.0)*p\t#Pressure in kPa\n",
+ "p3=(dw*g*Zw)/1000.0\t\t#pressure in kPa\n",
+ "p4=(5.2*10**5)/1000.0\t#pressure in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Pressure of 80cm of Hg is',round(p1,2),\"kPa\" \n",
+ "print'(b)Pressure of 40cm of Hg vaccum is',round(p2,2), \"kPa \"\n",
+ "print'(c)Pressure due to 1.5m of water coloumn is',round(p3*1000,4),\"N/m**2or Pa\" \n",
+ "print'(d)Pressure in kPa for 5.2bar is',round(p4,2),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Pressure of 80cm of Hg is 106.66 kPa\n",
+ "(b)Pressure of 40cm of Hg vaccum is 48.0 kPa \n",
+ "(c)Pressure due to 1.5m of water coloumn is 14709.0 N/m**2or Pa\n",
+ "(d)Pressure in kPa for 5.2bar is 520.0 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.10 Page No.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the pressure at different conditions.\n",
+ "\n",
+ "\n",
+ "#Input data \n",
+ "z=750\t\t#Barometric pressure in mm of Hg\n",
+ "g=9.81\t\t#Gravity in m/sec**2\n",
+ "Pa=101.325\t#one atm pressure in kN/m**2\n",
+ "Pg=3.3\t\t#Pressure in atm\n",
+ "Pf=3.2\t\t#Pressure in m of water\n",
+ "d=13596\t\t#Density of Hg in kg/m**3\n",
+ "\n",
+ "#calculations\n",
+ "Pp=(d*g*z)/10**6\t\t #Pressure in kPa\n",
+ "p1=(d*g*0.55)/1000.0\t\t #Pressure in kPa\n",
+ "p2=Pp+(Pg*101.325)\t #Pressure in kPa\n",
+ "p3=Pp+(Pf*g*100)/1000.0\t#Pressure in kPa\n",
+ "p4=4.6*100\t\t #Pressure in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Pressure of 55cm of Hg (Abs)',round(p1,1),\"KPa\"\n",
+ "print'(b)Pressure at 3.3 atm (Gauge)',round(p2,1),\"kPa\" \n",
+ "print'(c)Pressure of 3.2m of water (Gauge)',round(p3,1),\"kPa\" \n",
+ "print'NOTE: In the book there is mistake in calculation p3 '\n",
+ "print'(d)Pressure of 4.6bar (Abs)',round(p4,1),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Pressure of 55cm of Hg (Abs) 73.4 KPa\n",
+ "(b)Pressure at 3.3 atm (Gauge) 434.4 kPa\n",
+ "(c)Pressure of 3.2m of water (Gauge) 103.2 kPa\n",
+ "NOTE: In the book there is mistake in calculation p3 \n",
+ "(d)Pressure of 4.6bar (Abs) 460.0 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.11 Page No. 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the absolute pressure\n",
+ "\n",
+ "#Input data\n",
+ "Zw=50\t\t#Manometer reading of water in cm\n",
+ "Zo=763\t\t#Atmospheric pressure in mm of Hg\n",
+ "d=13.6*10**3\t#Density of Hg in kg/m**3\n",
+ "dw=1000\t\t#Density of water in kg/m**3\n",
+ "g=9.81\t\t#Gravity in m/sec**2\n",
+ "\n",
+ "#Calculations\n",
+ "Pa=(d*g*Zo)/10**6\t\t#Atmospheric pressure in kPa\n",
+ "Pg=(dw*g*Zw)/10**5\t#Gauge pressure in kPa\n",
+ "Pab=Pa+Pg\t\t#Absolute pressure in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'Absolute pressure is',round(Pab,2),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure is 106.7 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.12 Page No. 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the absolute pressure\n",
+ "\n",
+ "#Input data\n",
+ "Z=70\t\t\t#Vaccum gauge reading in cm of Hg\n",
+ "Pa=101.325\t\t#Atmospheric pressure in kPa\n",
+ "d=13.6*10**3\t\t#Density of Hg in kg/m**3\n",
+ "g=9.81\t\t\t#Gravity in m/sec**2\n",
+ "\n",
+ "#Calculations\n",
+ "Pv=(d*g*Z)/10**5\t\t#Vaccum pressure in kPa\n",
+ "Pab=Pa-Pv\t\t#Absolute pressure in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'Absolute pressure is',round(Pab,2),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure is 7.93 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.13 Page No. 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the absolute pressure\n",
+ "\n",
+ "#Input data\n",
+ "Pv=30\t\t#Vaccum pressure in kPa\n",
+ "Z=755\t\t#Barometer reading in mm of Hg\n",
+ "d=13590\t\t#Density of Hg in kg/m**3\n",
+ "g=9.81\t\t#Gravity in m/sec**2\n",
+ "\n",
+ "#calculations \n",
+ "Pa=(d*g*Z)/10**6\t#Atmospheric perssure in kPa\n",
+ "Pab=Pa-Pv\t#Absolute pressure in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'Asolute pressure in the tank is',round(Pab,2),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Asolute pressure in the tank is 70.66 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.14 Page No. 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Find the gas pressure\n",
+ "\n",
+ "#Input data\n",
+ "Z=0.562\t\t#Level of open limb in m\n",
+ "Z1=0.761\t\t#Barometer reading in m of Hg\n",
+ "g=9.79\t\t#Gravity in m/sec**2\n",
+ "d=13640\t\t#Density of Hg in kg/m**2\n",
+ "\n",
+ "#Calculations\n",
+ "Pa=(d*g*Z1)/1000.0\t#Atmospheric pressure in kPa\n",
+ "Ph=(d*g*Z)/1000.0\t#Pressure exercterd due to height in kPa\n",
+ "Pab=Pa+Ph\t#Absolute pressure in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'The gas pressure is',round(Pab,3),\"kN/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gas pressure is 176.668 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.15 Page No. 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is Absolute pressure of the gas\n",
+ "\n",
+ "#Input data \n",
+ "d=13.596*10**3\t#Density of Hg in kg/m**3\n",
+ "dl=800\t\t#Density of liquid in kg/m**3\n",
+ "Z=30\t\t#Level of the liquid in the arm in cm\n",
+ "Z1=0.75\t\t#Barometric pressure in m\n",
+ "g=9.81\t\t#Gravity in m/sec**2\n",
+ "\n",
+ "#Calculatins\n",
+ "Pg=(dl*g*Z)/10**7\t#Gauge pressure in bar\n",
+ "Pa=(d*g*Z1)/10**5\t#Atmospheric pressure in bar\n",
+ "Pab=Pa+Pg #Absolute pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print'Absolute pressure of the gas is',round(Pab,2),\"bar\"\n",
+ "print'NOTE:In the book there is calculation mistake in last step'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure of the gas is 1.02 bar\n",
+ "NOTE:In the book there is calculation mistake in last step\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.16 Page No. 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Absolute pressure of the gas\n",
+ "\n",
+ "#Input data\n",
+ "Z1=0.17\t\t#Level of liquid in m\n",
+ "Z=0.76\t\t#Barometer readings in m\n",
+ "d=13596\t\t#Density of Hg in kg/m**3\n",
+ "g=9.806\t\t#Gravity in m/sec**2\n",
+ "s=0.8\t\t#Specific gravity \n",
+ "d1=1000\t\t#Density of water in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "dl=s*d1\t\t#Density of given liquid in kg/m**3\n",
+ "Pa=d*g*Z\t\t#Atmospheric pressure in N/m**2\n",
+ "p=dl*g*Z1\t#Pressure in N/m**2\n",
+ "Pab=(Pa-p)/10**5\t#Absolute pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print'Absolute pressure of the gas is',round(Pab),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure of the gas is 1.0 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.17 Page No. 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Absolute pressure of the steam\n",
+ "\n",
+ "#Input data\n",
+ "g=9.806\t\t#Gravity in m/sec**2\n",
+ "d=13596\t\t#Density of Hg in kg/m**3\n",
+ "Z=9.75\t\t#Level of Hg in cm\n",
+ "dw=1000\t\t#Density of water in kg/m**3\n",
+ "Zw=0.034\t\t#Coloumn of condensate in m\n",
+ "Zo=0.76\t\t#Atmospheric pressure in m of Hg\n",
+ "\n",
+ "#Calculations\n",
+ "P=dw*g*Zw\t #Pressure in N/m**2\n",
+ "Pa=d*g*Zo\t #Atmospheric pressure in N/m**2\n",
+ "Pg=(d*g*Z)/100.0\t#Gauge pressure in N/m**2\n",
+ "Pab=(Pa+Pg-P)/10**5\t#Absolute pressure in bar\n",
+ "\n",
+ "#Output\n",
+ "print'Pressure due to height is',round(P,3),'N/m**2'\n",
+ "print'Atmospheric Pressure is ',round(Pa,0),'N/m**2'\n",
+ "print'Absolute pressure of steam is',round(Pab,4),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure due to height is 333.404 N/m**2\n",
+ "Atmospheric Pressure is 101325.0 N/m**2\n",
+ "Absolute pressure of steam is 1.1399 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.18 Page No. 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Absolute pressure of the steam\n",
+ "\n",
+ "#Input data\n",
+ "g=9.7\t\t #Gravity in m/sec**2\n",
+ "d=13.69*10**3\t#Density of Hg in kg/m**3\n",
+ "dw=1000\t\t #Density of water in kg/m**3\n",
+ "Pa=98\t \t#Atmospheric pressure in kPa\n",
+ "Z=0.6\t \t#Manometer level difference in m of Hg\n",
+ "Zw=0.04\t\t #Water coloumn level in m\n",
+ "\n",
+ "#Calculations \n",
+ "Pw=(dw*g*Zw)/1000.0\t#Pressure due to water in kPa\n",
+ "Pg=(d*g*Z)/1000.0\t\t#Pressure in kPa\n",
+ "Pab1=Pa+Pg-Pw\t\t#Absolute pressure in kPa\n",
+ "Pab=Pab1/100.0\t\t #Absolute pressure in bar\n",
+ "\n",
+ "#Output \n",
+ "print'The absolute pressure of steam is',round(Pab,2),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absolute pressure of steam is 1.77 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.19 Page No. 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find Absolute pressure of the steam\n",
+ "\n",
+ "#Input data\n",
+ "Z=0.76\t\t#Actual height of mercury coloumn in m\n",
+ "g=9.806\t\t#Gravity in m/sec**2\n",
+ "d=13596\t\t#Density of Hg in kg/m**3\n",
+ "dw=1000\t\t#Density of water in kg/m**3\n",
+ "Zw=0.035\t\t#Height of condensate coloumn in m\n",
+ "Zh=0.10\t\t#Height of mercury coloumn in m\n",
+ "\n",
+ "#Calculations\n",
+ "Pa=d*g*Z\t\t#Atmospheric pressure in N/m**2\n",
+ "Pw=dw*g*Zw\t#Pressure due to water in N/m**2\n",
+ "Ph=d*g*Zh\t#Pressure due to Hg in N/m**2\n",
+ "Pab=(Pa+Ph-Pw)/10**5\t#Absolute pressure in bar\n",
+ "\n",
+ "#Output \n",
+ "print'Absolute pressure of steam in the pipe is',round(Pab,2),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure of steam in the pipe is 1.14 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.20Page No. 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is Absolute pressure of the gas\n",
+ "\n",
+ "#Input data\n",
+ "dk=800\t\t#Density of kerosene in kg/m**3\n",
+ "g=9.81\t\t#gravity in m/sec**2\n",
+ "Zk=0.051\t\t#Kerosene vapour on Hg coloumn in m\n",
+ "d=13600\t\t#Density of Hg in kg/m**3\n",
+ "Zh=0.1\t\t#Hg level in m\n",
+ "Z=0.755\t\t#Atmospheric pressure in m of Hg\n",
+ "\n",
+ "#Calculations\n",
+ "Pk=dk*g*Zk\t\t #Pressure of kerosene in N/m**2\n",
+ "Pa=d*g*Z\t\t #Atmospheric pressure in N/m**2\n",
+ "Ph=d*g*Zh \t#Pressure due to Hg in N/m**2\n",
+ "Pab=(Pa+Ph-Pk)/1000.0\t#Absolute pressure in kPa\n",
+ "\n",
+ "#Output \n",
+ "print'Absolute pressure of vapour is ',round(Pab,2),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure of vapour is 113.67 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.21 Page No. 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find (a)The Absolute pressure of the gas in pipe line and \n",
+ "#(b)If the fluid used is Hg then the difference of height of Hg coloumn in the 2 arms .\n",
+ "\n",
+ "#Input data\n",
+ "d=13596\t\t#Density of Hg in kg/m**3\n",
+ "g=9.806\t\t#Gravity in m/sec**2\n",
+ "df=0.8*1000\t#Density of fluid in kg/m**3\n",
+ "Z=0.76\t\t#Atmospheric pressure in m of Hg\n",
+ "Zf=0.3\t\t#Height of fluid coloumn in m\n",
+ "\n",
+ "#Calculations\n",
+ "Pa=d*g*Z\t\t#Atmospheric perssure in N/m**2\n",
+ "P=df*g*Zf\t#Pressure due to fluid in N/m**2\n",
+ "Pab=(Pa+P)/10**5\t#Absolute pressure in bar\n",
+ "Zh=((Pab*10**5-Pa)/(d*g))*100\t#Difference between the height of Hg coloumn in 2 arms in m\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The Absolute pressure of the gas in pipe line Pab',round(Pab,2),\" bar\" \n",
+ "print'(b)If the fluid used is Hg then the difference of height of Hg coloumn in the 2 arms is',round(Zh,2),\"cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a)The Absolute pressure of the gas in pipe line Pab 1.04 bar\n",
+ "(b)If the fluid used is Hg then the difference of height of Hg coloumn in the 2 arms is 1.77 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.22 Page No. 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the pressure at the bottom and inner surface of oil and water\n",
+ "\n",
+ "#Input data\n",
+ "Pa=1\t\t#Atmospheric pressure in bar\n",
+ "g=9.81\t\t#Gravity in m/sec**2\n",
+ "do=0.8*1000\t#Density of oil in kg/m**3\n",
+ "Zo=0.8\t\t#Level of oil in m\n",
+ "dw=1000\t\t#Density of water in kg/m**3\n",
+ "Zw=0.65\t\t#Level of water in m\n",
+ "d=13.6*10**3\t#Density of Hg in kg/m**3\n",
+ "Z=0.45\t\t#Level of Hg in m\n",
+ "\n",
+ "#Calculations\n",
+ "Po=(do*g*Zo)/10**5\t#Pressure of oil in bar\n",
+ "Pw=(dw*g*Zw)/10**5\t#Pressure of water in bar\n",
+ "P=(d*g*Z)/10**5\t\t#Pressure of Hg in bar\n",
+ "Pab=Pa+Po+Pw+P\t\t#Pressure at the bottom of the coloumn in bar\n",
+ "Pow=Pa+Po\t\t#Pressure at the interface of oil and water in bar\n",
+ "Poh=Pa+Po+Pw\t\t#Pressure at the interface of water and Hg\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Pressure at the bottom of the coloumn is',round(Pab,2),\"bar\" \n",
+ "print'(b)Pressure at the inter surface of oil and water ia',round(Pow,3),\"bar \" \n",
+ "print'(c)Pressure at the inter surface of water and Hg ',round(Poh,3),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Pressure at the bottom of the coloumn is 1.73 bar\n",
+ "(b)Pressure at the inter surface of oil and water ia 1.063 bar \n",
+ "(c)Pressure at the inter surface of water and Hg 1.127 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.23 Page No. 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the height of fluid for oil , water and Hg manometer\n",
+ "\n",
+ "#Input data\n",
+ "Z=0.76\t\t#Barometer reading in m\n",
+ "g=9.81\t\t#Gravity in m/sec**2\n",
+ "d=13.6*10**3\t#Density of Hg in kg/m**3\n",
+ "Pab=1.2*10**5\t#Absolute pressure in N/m**2\n",
+ "do=0.8*1000\t#Density of oil in kg/m**3\n",
+ "dw=1000\t\t#Density of water in kg/m**3\n",
+ "dh=13.6*10**3\t#Density of Hg in kg/m**3\n",
+ "\n",
+ "#calculations\n",
+ "Pa=dh*g*Z\t#Atmospheric pressure in N/m**2\n",
+ "Pg=Pab-Pa\t#Gauge pressure in N/m**2\n",
+ "Zo=Pg/(do*g)\t#Height of oil in manometer in m\n",
+ "Pw=Pab-Pa\t#Pressure exercted by water in N/m**2\n",
+ "Zw=Pw/(dw*g)\t#Height of water in manometer in m\n",
+ "P=Pab-Pa\t\t#Pressure of Hg in N/m**2\n",
+ "Zh=P/(d*g)\t#Height of Hg in manometer in m\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The height of fluid for oil Manometer',round(Zo,2),\"m \"\n",
+ "print'(b)The height of fluid for water Manometer ia',round(Zw,2),\"m\" \n",
+ "print'(c)The height of fluid for Hg Manometer is',round(Zh,3),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The height of fluid for oil Manometer 2.37 m \n",
+ "(b)The height of fluid for water Manometer ia 1.9 m\n",
+ "(c)The height of fluid for Hg Manometer is 0.139 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.24 Page No. 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The altitude of the plane from ground level \n",
+ "\n",
+ "#Input data\n",
+ "Zg=0.753\t\t#Barometer reading at ground level in m\n",
+ "Zp=0.690\t\t#Pilots barometer reading in the plane in m\n",
+ "d=13600\t\t#Density of Hg in kg/m**3\n",
+ "g=9.81\t\t #Gravity in m/sec**2\n",
+ "da=1.25\t\t#Density of air in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "Pg=d*g*Zg\t#Pressure at ground level in N/m**2\n",
+ "Pp=d*g*Zp\t#Pressure at plane level in N/m**2\n",
+ "P=Pg-Pp\t\t#Change of pressure at ground level and that of plane level in N/m**2\n",
+ "Za=P/(da*g)\t#Altitude of plane from ground in m\n",
+ "\n",
+ "#Output \n",
+ "print'The altitude of the plane from ground level is',round(Za,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The altitude of the plane from ground level is 685.4 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.25 Page No. 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Pressure exercted \n",
+ "\n",
+ "#Input data\n",
+ "dw=1000\t\t#Density of water in kg/m**3\n",
+ "dh=13590\t\t#Density of Hg in kg/m**3\n",
+ "Pa=400\t\t#Pressure at A in kPa\n",
+ "g=9.81\t\t#Gravity in N/m**2\n",
+ "Zw1=2.5\t\t#First level of water in m\n",
+ "Zw2=0.4\t\t#Second level of water in m\n",
+ "Zh=0.6\t\t#Level of Hg in m\n",
+ "\n",
+ "#Calculations \n",
+ "Pw1=dw*g*Zw1\t#First level of water pressure in N/m**2\n",
+ "Pw2=dw*g*Zw2\t#Second level of water pressure in n/m**2\n",
+ "Ph=dh*g*Zh\t#Pressure of Hg in N/m**2\n",
+ "Pb=((Pa*1000)+Pw1+Pw2-Ph)/1000\t#Pressure exercted at B in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'Pressure exercted at B is',round(Pb,2),\"KPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure exercted at B is 348.46 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.26 Page No. 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The total weight of piston and slab \n",
+ "\n",
+ "#Input data\n",
+ "do=0.902*10**3\t#Density of oil in kg/m**3\n",
+ "Pg=2*10**5\t #Gauge pressure in N/m**2\n",
+ "g=9.81\t\t #Gravity in m/sec**2\n",
+ "ho=2\t\t #Level of oil in m\n",
+ "d=2\t\t #Diameter of cylinder in m\n",
+ "pi=3.141595\t#Constant value of pi\n",
+ "\n",
+ "#Calculations\n",
+ "A=(pi/4.0)*d**2 #Area of cylinder \n",
+ "Po=do*g*ho\t # Pressure due to oil in N/m**2\n",
+ "W=(Pg+Po)*A\t #Weight of the piston in N\n",
+ "\n",
+ "#Output\n",
+ "print'The total weight of piston and slab is',round(W,2),\"N\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total weight of piston and slab is 683916.56 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.27 Page No. 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The pressure in the gas \n",
+ "\n",
+ "#Input data\n",
+ "m=21\t\t#Mass of piston in kg\n",
+ "P1=600\t\t#Pressure in the pipe 1 in kPa\n",
+ "P2=170\t\t#Pressure in the pipe 2 in kPa\n",
+ "d1=0.10\t\t#Diameter of the piston 1 in m\n",
+ "d2=0.20\t\t#Diameter of the piston 2 in m\n",
+ "pi=3.14155\t#Constant value of pi\n",
+ "\n",
+ "#Calculations\n",
+ "F=(m*9.81)/1000\t\t#Force due to mass in kN\n",
+ "F1=(pi/4)*d1**2*P1\t\t#Force 1 acting on 10 cm diameter piston in kN\n",
+ "F2=(pi/4)*(d2**2-d1**2)*P2\t#Force 2 acting on 20 cm diameter piston in kN\n",
+ "F3=F+F1+F2\t\t#Total downward force in kN\n",
+ "P3=F3/((pi/4)*d2**2)\t#Pressure 3 in the gas in kPa\n",
+ "\n",
+ "#Output\n",
+ "print'The pressure in the gas is ',round(P3,2),\"KPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure in the gas is 284.06 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.28 Page No. 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The height of the building\n",
+ "\n",
+ "#Input data\n",
+ "P1=0.755\t\t#Barometric reading at the bottom of the building in m\n",
+ "P2=0.73\t\t#Barometric reading at the top of the building in m\n",
+ "da=1.18\t\t#Density of air in kg/m**3\n",
+ "g=9.81\t\t#Gravitalional constant in m/sec**2\n",
+ "d=13600\t\t#Density of Hg in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "h=((P1-P2)*d*g)/(da*g) #The height of the building in m\n",
+ "\n",
+ "#Output\n",
+ "print'The height of the building ',round(h,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The height of the building 288.1 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.29 Page No. 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The absolute pressure in the container A and B\n",
+ "\n",
+ "#Given\n",
+ "PA=200\t\t#Gauge pressure reading for A in kPa\n",
+ "PB=120\t\t#Gauge pressure reading for B in kPa\n",
+ "hb=750\t\t#Barometer reading in mm of Hg\n",
+ "g=9.806\t\t#Gravitational constant in m/sec**2\n",
+ "d=13597\t\t#Density of Hg in barometer in kg/m**3\n",
+ "\n",
+ "#Calculations\n",
+ "Pa=d*g*hb/10**6\t#Atmospheric pressure in kPa\n",
+ "Pab1=PA+Pa\t#Absolute pressure in container A in kPa\n",
+ "Pab2=PB+Pab1\t#Absolute pressure in container B in kPa\n",
+ "\n",
+ "#Output \n",
+ "print'(a)The absolute pressure in the container A is',round(Pab1,1),\"kPa\" \n",
+ "print'(b)The absolute pressure in the container B is ',round(Pab2,2),\"kPa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The absolute pressure in the container A is 300.0 kPa\n",
+ "(b)The absolute pressure in the container B is 420.0 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.30 Page No. 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the temprature in fahreneheit\n",
+ "\n",
+ "#Input data\n",
+ "C1=40\t\t #Temperature 1 in degree centigrade\n",
+ "C2=-20\t\t#Temperature 2 in degree centigrade \n",
+ "\n",
+ "#calculations\n",
+ "F1=((C1/100.0)*180)+32\t#Temperature 1 in Fahrenheit\n",
+ "F2=((C2/100.0)*180)+32\t#Temperature 2 in Fahrenheit\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Temperature after converting 40 degree C is',round(F1,2),\"F\"\n",
+ "print'(b)Temperature after convertibg -20 degree C is ',round(F2,2),\"F\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Temperature after converting 40 degree C is 104.0 F\n",
+ "(b)Temperature after convertibg -20 degree C is -4.0 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.31 Page No. 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The temperature which has the same value on both the centrigrade and fahrenheit scales\n",
+ "\n",
+ "#Given that the temperature has the same value on both the centrigrade and fahrenheit scales\n",
+ "#(C/100)=((F-32)/180)\n",
+ "\n",
+ "#Putting C=F\n",
+ "C=(-32/180.0)/((1/100.0)-(1/180.0))\t#Centrigade temperature in degree C\n",
+ "F=C\t\t\t#Fahrenheit temperature in degree Fahrenheit\n",
+ "\n",
+ "print'The temperature which has the same value on both the centrigrade and fahrenheit scales is',C\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature which has the same value on both the centrigrade and fahrenheit scales is -40.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.32 Page No. 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the temprature\n",
+ "\n",
+ "#Input data\n",
+ "P1=1.5\t\t#Thermometric properties at ice point\n",
+ "P2=7.5\t\t#Thermometric properties at steam point\n",
+ "P3=3.5\t\t#Thermometric property\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "M = array([[math.log(P2), 1], [math.log(P1), 1]])\n",
+ "N=([100,0])\n",
+ "X=inv(M)*N #Inverse matrix\n",
+ "a=X[0,0]\n",
+ "b=X[1,0]\n",
+ "t=(a*math.log(P3)+b)\t#Required temperature in degree C\n",
+ "\n",
+ "#Output\n",
+ "print'The required temperature is ',round(t,2),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required temperature is 52.65 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.33 Page No. 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is Temperature corresponding to the thermometric property\n",
+ "\n",
+ "#Input data\n",
+ "T1=100\n",
+ "T2=300 #Temperature of ice and steam point in the scale\n",
+ "P1=1.86\t\t #Values of thermometric properties at ice point nad steam point respectively\n",
+ "P2=6.8\n",
+ "P=2.5\t\t\t #Thermometric property\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "#aln(P2)+b=300 #Costants in the temprature scale reading, a and b\n",
+ "#aln(P1)+b=100\n",
+ "#Solving above two equations\n",
+ "a=(T2-T1)/(math.log(P2/P1)) \n",
+ "b=T2-a*math.log(P2)\n",
+ "t=(a*math.log(P)+b)\t#Required temperature in degree C\n",
+ "\n",
+ "#Output\n",
+ "print'Temperature corresponding to the thermometric property is ',round(t,1),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature corresponding to the thermometric property is 145.6 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.34 Page No. 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the required temprature\n",
+ "\n",
+ "#Input data\n",
+ "p1=32.0\t\t #Pressure in mm of Hg at triple point of water\n",
+ "p2=76.0\t\t #Pressure in mm of Hg above atmospheric pressure\n",
+ "p3=752.0\t\t#Barometric pressure in mm of Hg\n",
+ "T=273.16\t\t#Triple point of water in K\n",
+ "\n",
+ "#Calculations\n",
+ "P1=p3+p1\t#Total pressure in mm of Hg\n",
+ "P2=p2+p3\t#Total pressure in mm of Hg\n",
+ "T2=((T*P2)/P1)-273.16\t#Temperture in degree C\n",
+ "\n",
+ "#Output\n",
+ "print'Temperature is ',round(T2,2),\"C\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature is 15.33 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.35 Page No.61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Temperature corresponding to the thermometric property \n",
+ "\n",
+ "#Input data\n",
+ "T1=32\t\t#Temperatures of ice point and steam point respectively\n",
+ "T2=212\n",
+ "P1=1.86\t\t #P values at ice point and steam point respectively\n",
+ "P2=6.81\n",
+ "P=2.5\t\t\t#Reading on the thermometer\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "#aln(P1)+b=32 #Costants in the given temprature scale reading, a and b\n",
+ "#aln(P2)+b=212\n",
+ "#Solving above two equations\n",
+ "a=(T2-T1)/(math.log(P2/P1)) \n",
+ "b=T2-a*math.log(P2)\n",
+ "t=(a*math.log(P)+b)\t#Required temperature in degree C\n",
+ "\n",
+ "#Output\n",
+ "print'Temperature corresponding to the thermometric property is ',round(t,0),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature corresponding to the thermometric property is 73.0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Mechanical_Engineering/bme2.ipynb b/Basic_Mechanical_Engineering/bme2.ipynb
new file mode 100644
index 00000000..71e898ae
--- /dev/null
+++ b/Basic_Mechanical_Engineering/bme2.ipynb
@@ -0,0 +1,1447 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:First Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page No.90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is net work transfer in a cycle\n",
+ "\n",
+ "#Input data\n",
+ "h1=60\t\t#The heat transfer in the process in kJ\n",
+ "h2=-8\t\t#The heat transfer in the process in kJ\n",
+ "h3=-34\t\t#The heat transfer in the process in kJ\n",
+ "h4=6\t\t#The heat transfer in the process in kJ\n",
+ "\n",
+ "#Calculations\n",
+ "Q=h1+h2+h3+h4\t\t#Net work transfer in a cycle in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'Net work transfer in a cycle is',round(Q,2),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net work transfer in a cycle is 24.0 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page No. 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#FinThe work done on the system\n",
+ "\n",
+ "#Input data\n",
+ "Q=-300\t\t#Heat transfer in the system consisting of the gas in kJ\n",
+ "u=0\t\t#Internal energy is constant\n",
+ "\n",
+ "#Calculations\n",
+ "W=Q-u\t\t#Work done of the system in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'The work done of the system W = %3.0f kJ ',round(W,1),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work done of the system W = %3.0f kJ -300.0 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page No. 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "v1=1.5\t\t#Initial volume of the process in m**3\n",
+ "v2=4.5\t\t#Final volume of the process in m**3\n",
+ "Q=2000\t\t#Amount of heat added in kJ\n",
+ "\n",
+ "#Calculations\n",
+ "W=100*((3.5*math.log(v2/v1))+(3*(v2-v1)))\t#Amount of work done in kJ\n",
+ "U=Q-W\t\t\t\t\t#The change in internal energy in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'The change in internal energy is',round(U,2),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in internal energy is 715.49 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page No.91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is the heat transfer per kg of steam\n",
+ "\n",
+ "#Input data\n",
+ "h1=35\t\t#Enthalpy of water entering the boiler in kJ/kg\n",
+ "h2=705\t\t#Enthalpy of steam leaving the boiler in kJ/kg\n",
+ "C=0\t\t#Change in kinetic energy is neglected\n",
+ "Z=0\t\t#Change in potential energy is neglected\n",
+ "\n",
+ "#Calculations\n",
+ "q=h2-h1\t\t#The heat transfer per kg of steam in kJ/kg\n",
+ "\n",
+ "#Output\n",
+ "print'The heat transfer per kg of steam is',round(q,1),\"kJ/kg\"\t\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer per kg of steam is 670.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page No. 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine (a)Change in energy in a-b,b-c,c-d,d-a process \n",
+ "#Heat developed in the process d-a \n",
+ "#Work done in the d-a process \n",
+ "#Net rate of work output\n",
+ "\n",
+ "#Input data\n",
+ "Q=-170\t\t#Sum of all heat transfers per cycle in kJ\n",
+ "N=100\t\t#Total number of cycles per min in cycles/min\n",
+ "Q1=0\t\t#Heat developed in a-b process in kJ/min\n",
+ "Q2=21000\t\t#Heat developed in b-c process in kJ/min\n",
+ "Q3=-2100\t\t#Heat developed in c-d process in kJ/min\n",
+ "W1=2170\t\t#Work done in the process a-b in kJ/min\n",
+ "W2=0\t\t#Work done in the b-c process in kJ/min\n",
+ "E3=-36600\t#Change in energy in the process in kJ/min\n",
+ "\n",
+ "#Calculations\n",
+ "E1=Q1-W1\t\t#Change in energy in process a-b in kJ/min\n",
+ "E2=Q2-W2\t\t#Change in energy in b-c process in kJ/min\n",
+ "W3=Q3-E3\t\t#Work done in the c-d process in kJ/min\n",
+ "Qt=Q*N\t\t\t#Total heat transfer per min in kJ/min \n",
+ "Q4=Qt-Q1-Q2-Q3\t\t#Heat developed in the process d-a in kJ/min\n",
+ "Et=0\t\t\t#Total change in energy of the cycle\n",
+ "E4=Et-E1-E2-E3\t\t#Energy in the process d-a in kJ/min\n",
+ "W4=Q4-E4\t\t#Work done in the d-a process in kJ/min \n",
+ "Wn=Qt/60.0\t\t#Net rate of work output in kW\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Change in energy in a-b process is',round(E1,2),\"kJ/min\"\n",
+ "print'(b)Change in energy in b-c process is',round(E2,2),\"kJ/min\"\n",
+ "print'(c)Work done in the c-d process is',round(W3,2),\"kJ/min\"\n",
+ "print'(d)Heat developed in the process d-a is',round(Q4,2),\"kJ/min\"\n",
+ "print'(e)Energy in the process d-a is',round(E4,2),\"kJ/min\"\n",
+ "print'(f)Work done in the d-a process is',round(W4,2),\"kJ/min\"\n",
+ "print'(g)Net rate of work output is',round(Wn,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Change in energy in a-b process is -2170.0 kJ/min\n",
+ "(b)Change in energy in b-c process is 21000.0 kJ/min\n",
+ "(c)Work done in the c-d process is 34500.0 kJ/min\n",
+ "(d)Heat developed in the process d-a is -35900.0 kJ/min\n",
+ "(e)Energy in the process d-a is 17770.0 kJ/min\n",
+ "(f)Work done in the d-a process is -53670.0 kJ/min\n",
+ "(g)Net rate of work output is -283.33 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page No. 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine (a)Change in work done in 1-2,2-3,3-1 process \n",
+ "#change in energy in the process 2-3 \n",
+ "#mass flow rate and rate of power and heat developed\n",
+ "\n",
+ "#Input data\n",
+ "Q1=50\t\t#Heat developed in the 1-2 process in kJ/kg\n",
+ "U1=20\t\t#Change in energy in the 1-2 process in kJ/kg\n",
+ "Q2=-30\t\t#Heat developed in the 2-3 process in kJ/kg\n",
+ "W2=-40\t\t#Work done in the 2-3 process in kj/kg\n",
+ "U3=-30\t\t#Change in energy in the 3-1 process in kJ/kg\n",
+ "Wt=30\t\t#Net work done per kg of fluid in kJ/kg\n",
+ "m=0.1\t\t#Mass of fluid in the cycle in kg\n",
+ "N=10\t\t#Number of cycles per sec in cycles/sec\n",
+ "\n",
+ "#Calculations\n",
+ "W1=Q1-U1\t#Work done in the 1-2 process in kJ/kg\n",
+ "U2=Q2-W2\t#Change in energy in the 2-3 process in kJ/kg\n",
+ "W3=Wt-W1-W2\t#Work done in the 3-1 process in kJ/kg\n",
+ "Q3=W3+U3\t#Heat developed in the process in kJ/kg\n",
+ "m1=m*N\t\t#mass flow rate per sec in kg/sec\n",
+ "P=Wt*m1\t\t#Rate of power in kW\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Work done in the 1-2 process is',round(W1,1),\"kJ/kg\"\n",
+ "print'(b)Change in energy in the 2-3 process is',round(U2,1),\"kJ/kg\"\n",
+ "print'(c)Work done in the 3-1 process is',round(W3,1),\"kJ/kg\"\n",
+ "print'(d)Heat developed in the processis',round(Q3,1),\"kJ/kg\"\n",
+ "print'(e)mass flow rate per sec ',round(m1,1), \"kg/sec \"\n",
+ "print'(f)Rate of power is',round(P,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Work done in the 1-2 process is 30.0 kJ/kg\n",
+ "(b)Change in energy in the 2-3 process is 10.0 kJ/kg\n",
+ "(c)Work done in the 3-1 process is 40.0 kJ/kg\n",
+ "(d)Heat developed in the processis 10.0 kJ/kg\n",
+ "(e)mass flow rate per sec 1.0 kg/sec \n",
+ "(f)Rate of power is 30.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page No. 94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine (a)Change in work done in 1-2 process \n",
+ "#total change in energy \n",
+ "#work done and heat developed\n",
+ "\n",
+ "#Input data\n",
+ "m=3.0\t\t#Mass of substance in the system in kg\n",
+ "P1=500.0\t\t#Initial pressure of the system in kPa\n",
+ "P2=100.0\t\t#Final pressure of the system in kPa\n",
+ "V1=0.22\t\t#Initial volume of the system in m**3\n",
+ "n=1.2\t\t#Polytropic index \n",
+ "Q1=30.0\t\t#Heat transfer for the another process\n",
+ "\n",
+ "#Calculations\n",
+ "V2=V1*(P1/P2)**(1/1.2)\t#Final volume of the system in m**3\n",
+ "U=3.56*(P2*V2-P1*V1)\t#Total change in internal energy in kJ\n",
+ "W1=(P2*V2-P1*V1)/(1-n)\t#Work done for the 1-2 process in kJ\n",
+ "Q=U+W1\t\t\t#Heat developed in the process in kJ\n",
+ "W2=Q1-U\t\t#Work done for the another process in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Total change in internal energy is',round(U,0), \"kJ\" \n",
+ "print'(b)Work done for the 1-2 process is',round(W1,2), \"kJ\" \n",
+ "print'(c)Heat developed in the process is',round(Q,0), \"kJ\" \n",
+ "print'(d)Work done for the another process is',round(W2,0), \"kJ\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Total change in internal energy is -92.0 kJ\n",
+ "(b)Work done for the 1-2 process is 129.4 kJ\n",
+ "(c)Heat developed in the process is 37.0 kJ\n",
+ "(d)Work done for the another process is 122.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page No. 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find heat transfer and total change in internal energy\n",
+ "\n",
+ "#Input data\n",
+ "m=5\t\t#Mass of the substance in the system in kg\n",
+ "P1=500\t\t#Initial pressure of the system in kPa\n",
+ "P2=100\t\t#Final pressure of the system in kPa\n",
+ "V1=0.22\t\t#Initial volume of the system in m**3\n",
+ "n=1.2\t\t#Polytropic index\n",
+ "\n",
+ "#Calculations \n",
+ "V2=V1*(P1/P2)**(1/1.2)\t#Final volume of the system in m**3\n",
+ "U=3.5*(P2*V2-P1*V1)\t#Change in the internal energy of the system in kJ\n",
+ "W=(P1*V1-P2*V2)/(n-1)\t#Work developed in the process in kJ\n",
+ "Q=U+W\t\t\t#Heat transfer in the process in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'Total change in Internal Energy is',round(U,0),\"KJ\" \n",
+ "print'Non flow work in the process is',round(W,2),\"KJ\" \n",
+ "print'Heat transfer of the process is',round(Q,0),\"KJ\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total change in Internal Energy is -91.0 KJ\n",
+ "Non flow work in the process is 129.4 KJ\n",
+ "Heat transfer of the process is 39.0 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page No. 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the direction and magnitude of work and heat transfer\n",
+ "\n",
+ "#Input data\n",
+ "p1=170\t\t#Initial pressure of the fluid in kPa\n",
+ "p2=400\t\t#Final pressure of the fluid in kPa\n",
+ "v1=0.03\t\t#Initial volume in m**3\n",
+ "v2=0.06\t\t#Final volume in m**3\n",
+ "\n",
+ "#Calculations\n",
+ "dU=3.15*((p2*v2)-(p1*v1))\t#The change in internal energy of the fluid in kJ\n",
+ "#P=a+b*V #Given relation \n",
+ "A = array([[1,v1], \n",
+ " [1,v2]])\n",
+ "b = array([p1,p2])\n",
+ "X = solve(A, b)\n",
+ "W=(X[0]*(v2-v1))+(X[1]*((v2**2-v1**2)/2.0))\t#The work done during the process in kJ\n",
+ "Q=U+W\t\t#The heat transfer in kJ\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The direction and magnitude of work is',round(W,2),\"KJ\"\n",
+ "print'(b)The direction and magnitude of heat transfer is',round(Q,2),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The direction and magnitude of work is 8.55 KJ\n",
+ "(b)The direction and magnitude of heat transfer is 68.08 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11 Page No. 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is power capacity of the system\n",
+ "\n",
+ "#Input data\n",
+ "E1=4000\t\t#Enthalpy at entrance in kJ/Kg\n",
+ "E2=4100\t\t#Enthalpy at exit in kJ/kg\n",
+ "V1=50\t\t#Velocity at entrance in m/s\n",
+ "V2=20\t\t#Velocity at exit in m/s\n",
+ "h1=50\t\t#Height at the entrance \n",
+ "h2=10\t\t#Height at the exit\n",
+ "m=1\t\t#mass flow rate to the system in kJ/s\n",
+ "Q=200\t\t#Heat transfer rate to the system in kJ/s\n",
+ "g=9.8\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "P=m*(((V1**2-V2**2)/(2000.0))+(g*(h2-h1)/1000.0)+(E1-E2))+Q\n",
+ "print'Power capacity of the system ',round(P,0),\"KW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power capacity of the system 101.0 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 Page No. 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is specific internal energy\n",
+ "\n",
+ "#Input data\n",
+ "W=135\t\t#Work done by the system in kJ/kg\n",
+ "V1=0.37\t\t#Specific volume of fluid at inlet in m**3/kg\n",
+ "V2=0.62\t\t#Specific volume of fluid at outlet in m**3/kg\n",
+ "P1=600\t\t#Pressure at the inlet in kPa\n",
+ "P2=100\t\t#Pressure at the outlet in kPa\n",
+ "C1=16\t\t#Velocity at the inlet in m/s\n",
+ "C2=270\t\t#Velocity at the outlet in m/s\n",
+ "Z1=32\t\t#Inlet height from floor level in m\n",
+ "Z2=0\t\t#Outlet height from floor level in m\n",
+ "q=-9\t\t#Heat loss between inlet and discharge in kJ/kg\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "U=((C2**2-C1**2)/2000.0)+(g*(Z2-Z1))/1000.0+(P2*V2-P1*V1)+W-q\n",
+ "\n",
+ "#Output\n",
+ "print'Specific Internal Energy decreases by ',round(U,2),\"kJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific Internal Energy decreases by 20.01 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13 Page No. 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is Total work done in the system and Power capacity of the system\n",
+ "\n",
+ "#Input data\n",
+ "m=5\t\t#Rate of fluid flow in the system in kg/s\n",
+ "P1=620\t\t#Pressure at the entrance in kPa\n",
+ "P2=130\t\t#Pressure at the exit in kPa\n",
+ "C1=300\t\t#Velocity at the entrance in m/s\n",
+ "C2=150\t\t#Velocity at the exit in m/s\n",
+ "U1=2100\t\t#Internal energy at the entrance in kJ/kg\n",
+ "U2=1500\t\t#Internal energy at the exit in kJ/kg\n",
+ "V1=0.37\t\t#Specific volume at entrance in m**3/kg\n",
+ "V2=1.2\t\t#Specific volume at exit in m**3/kg\n",
+ "Q=-30\t\t#Heat loss in the system during flow in kJ/kg\n",
+ "Z=0\t\t#Change in potential energy is neglected in m\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "W=((C1**2-C2**2)/(2*1000))+(g*Z)+(U1-U2)+(P1*V1-P2*V2)+Q\n",
+ "P=W*m#Power capacity of the system in kW\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Total work done in the system ',round(W,1),\"kJ/kg\"\n",
+ "print'(b)Power capacity of the system',round(P,1),\"KW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a)Total work done in the system 676.4 kJ/kg\n",
+ "(b)Power capacity of the system 3382.0 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 Page No. 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The power required to drive the compressor\n",
+ "\n",
+ "#Input Data\n",
+ "P1=100\t\t#Pressure at Inlet in kPa\n",
+ "P2=500\t\t#Pressure at Exit in kPa\n",
+ "V1=0.6\t\t#Specific volume at Inlet in m**3/kg\n",
+ "V2=0.15\t\t#Specific volume at Exit in m**3/kg\n",
+ "U1=50\t\t#Specific internal energy at inlet in kJ/kg\n",
+ "U2=125\t\t#Specific internal energy at Exit in kJ/kg\n",
+ "C1=8\t\t#Velocity of air at Inlet in m/s\n",
+ "C2=4\t\t#Velocity of air at Exit in m/s\n",
+ "m=5\t\t#Mass flow rate of air in kg/s\n",
+ "Q=-45\t\t#Heat rejected to cooling water in kW\n",
+ "Z=0\t\t#Change in potential energy is neglected in m\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "P=m*(((C1**2-C2**2)/(2*1000.0))+(g*Z)+(U1-U2)+(P1*V1-P2*V2))+Q\n",
+ "P1=-P\n",
+ "\n",
+ "#Output\n",
+ "print'The power required to drive the compressor',round(-P1,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power required to drive the compressor -494.88 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 Page No. 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "m1=5000\t\t#Steam flow rate in kg/hr\n",
+ "Q1=-250\t\t#Heat loss from the turbine insulation to surroundings in kj/min\n",
+ "C1=40\t \t#Velocity of steam at entrance in m/s\n",
+ "h1=2500\t\t#Enthalpy of the steam at entrance in kJ/kg\n",
+ "C2=90\t\t #Velocity of the steam at the Exit in m/s\n",
+ "h2=2030\t\t#Enthalpy of the steam at exit in kj/kg\n",
+ "Z=0\t\t #Change in potential energy is neglected in m\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "m=m1/3600.0\t #Steam flow rate in kg/s\n",
+ "Q=Q1/60.0\t\t#Heat loss from the turbine to the surroundings\n",
+ "P=m*(((C1**2-C2**2)/(2*1000))+(g*Z)+(h1-h2))+Q\n",
+ "\n",
+ "#Output\n",
+ "print'The power developed by the turbine is',round(P,1),\"KW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power developed by the turbine is 643.1 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.16 Page No. 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The work output from the turbine \n",
+ "\n",
+ "#Input data \n",
+ "c1=16\t\t#Velocity of steam at entrance in m/s\n",
+ "c2=37\t\t#Velocity of steam at exit in m/s\n",
+ "h1=2990\t\t#Specific enthalpy of steam at entrance in kJ/kg\n",
+ "h2=2530\t\t#Specific enthalpy of steam at exit in kJ/kg\n",
+ "Q=-25\t\t#Heat lost to the surroundings in kJ/kg\n",
+ "m1=360000\t#The steam flow rate in kg/hr\n",
+ "\n",
+ "#Calculations\n",
+ "m=m1/3600.0 #The steam flow rate in kg/s\n",
+ "W=(c1**2-c2**2)/2000.0+(h1-h2)+Q\t#Total work done in the system in kJ/kg\n",
+ "P=m*W\t\t\t\t\t #Power developed by the turbine in kW\n",
+ "\n",
+ "#Output\n",
+ "print'The work output from the turbine is',round(P,1),\"kW \"\n",
+ "print'NOTE: In the book there is Calculation mistake'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work output from the turbine is 43444.3 kW \n",
+ "NOTE: In the book there is Calculation mistake\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.17 Page No.106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The external work output of the turbine\n",
+ "\n",
+ "#Input data\n",
+ "p1=720\t\t#Pressure at the entrance in kPa\n",
+ "t1=850\t\t#Temperature at the entrance in degree centigrade \n",
+ "c1=160\t\t#Velocity of the gas at entrance in m/s\n",
+ "Q=0\t\t#Insulation (adiabatic turbine)\n",
+ "P2=115\t\t#Pressure at the exit in kPa\n",
+ "t2=450\t\t#Temperature at the exit in degree centigrade\n",
+ "c2=250\t\t#Velocity of the gas at exit in m/s\n",
+ "cp=1.04\t\t#Specific heat of gas at constant pressure in kJ/kg-K\n",
+ "\n",
+ "#Calculations\n",
+ "H=cp*(t1-t2)\t\t\t#Change in Enthalpy of the gas at entrance and exit in kJ/kg\n",
+ "W=((c1**2-c2**2)/(2*1000))+(H)\t#External work output of the turbine in kJ/kg\n",
+ "\n",
+ "#Output\n",
+ "print'The external work output of the turbine is',round(W,0),\"kJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The external work output of the turbine is 397.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.18 Page No. 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The work done per unit mass of the steam and mass flow rate\n",
+ "\n",
+ "#Input data\n",
+ "p=5000\t\t#Power output of an adiabatic steam turbine in kW\n",
+ "p1=2000\t\t#Pressure at the inlet in kPa\n",
+ "p2=0.15\t\t#Pressure at the exit in bar\n",
+ "t1=400\t\t#temperature at the inlet in degree centigrade\n",
+ "x=0.9\t\t#Dryness at the exit\n",
+ "c1=50\t\t#Velocity at the inlet in m/s\n",
+ "c2=180\t\t#Velocity at the exit in m/s\n",
+ "z1=10\t\t#Elevation at inlet in m\n",
+ "z2=6\t\t#Elevation at exit in m\n",
+ "h1=3248.7\t\t#Enthalpy at the inlet from the steam table corresponding to and 20 bar in kJ/kg\n",
+ "hf=226\t\t#Enthalpy at exit at 0.15 bar from steam tables in kJ/kg\n",
+ "hfg=2373.2\t#Enthalpy at exit at 0.15 bar from steam tables in kJ/kg\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "h2=hf+(x*hfg) #Enthalpy at the exit in kJ/kg\n",
+ "W=(h1-h2)+((c1**2-c2**2)/(2*1000))+((g*(z1-z2))/1000.0)\n",
+ "m=p/W\t\t\t\t\t\t \n",
+ "\n",
+ "#Output\n",
+ "print'(a)The work done per unit mass of the steam flowing through turbine is',round(W,1),\"kJ/kg\"\n",
+ "print'(b)The mass flow rate of the steam is',round(m,1),\"kg/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The work done per unit mass of the steam flowing through turbine is 871.9 kJ/kg\n",
+ "(b)The mass flow rate of the steam is 5.7 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.19 Page No. 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Temperature of air at exit and power output\n",
+ "\n",
+ "#Input Data\n",
+ "p1=1000.0\t\t#Pressure at the inlet in kPa\n",
+ "t1=750.0\t\t#Temperature at the inlet in K\n",
+ "c1=200.0\t\t#Velocity at the inlet in m/s\n",
+ "p2=125.0\t\t#Pressure at the exit in kPa\n",
+ "c2=40.0\t\t #Velocity at the exit in m/s\n",
+ "m1=1000.0\t\t#Mass flow rate of air in kg/hr\n",
+ "cp=1.053\t\t#Specific heat at constant pressure in kJ/kgK\n",
+ "k=1.375\t\t #Adiabatic index\n",
+ "Q=0\t\t #The turbine is adiabatic\n",
+ "\n",
+ "#Calculations\n",
+ "m=m1/3600.0\t#The mass flow rate of air in kg/s\n",
+ "P=p2/p1\t\t#Ratio of the pressure\n",
+ "t2=t1*((p2/p1)**((k-1)/k))\t#Temperature of air at exit in K\n",
+ "h=cp*(t2-t1)\t\t#Change in enthalpy of the system in kJ\n",
+ "p=m*(((c2**2-c1**2)/(2*1000))+h)\t#Power output of the turbine in kW\n",
+ "p1=-p\t\t\t#Power output of the turbine in kW\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Temperature of air at exit is',round(t2,2),\" K \"\n",
+ "print'(b)The power output of the turbine is',round(p1,1),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Temperature of air at exit is 425.37 K \n",
+ "(b)The power output of the turbine is 100.3 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.20 Page No. 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The rate of work input to the air and\n",
+ "#The ratio of inlet pipe diameter to the outlet pipe diameter\n",
+ "\n",
+ "#Input data\n",
+ "c1=7\t\t #Velocity of air at entrance in m/s\n",
+ "c2=5\t\t #Velocity of air at exit in m/s\n",
+ "p1=100\t\t #Pressure at the entrance in kPa\n",
+ "p2=700\t\t #Pressure at the exit in kPa\n",
+ "v1=0.95\t\t#Specific volume at entrance in m**3/kg\n",
+ "v2=0.19\t\t#Specific volume at exit in m**3/kg\n",
+ "u=90\t\t # Change in internal energy of the air entering and leaving in kJ/kg\n",
+ "z=0\t\t #Potential energy is neglected \n",
+ "Q=-58\t\t #Heat rejected to the surroundings in kW\n",
+ "m=0.5\t\t #The rate at which air flow in kg/s\n",
+ "g=9.81\t\t #Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "P=m*(((c1**2-c2**2)/(2000.0))+(p1*v1-p2*v2)-u)+(Q)\n",
+ "A=(v1*c2)/(v2*c1)\t#From continuity equation the ratio of areas\n",
+ "D=A**(1/2.0)\t #The ratio of inlet pipe diameter to the outlet pipe diameter\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The rate of work input to the air is ',round(P,2),\"kW\"\n",
+ "print'(b)The ratio of inlet pipe diameter to the outlet pipe diameter is ',round(D,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The rate of work input to the air is -121.99 kW\n",
+ "(b)The ratio of inlet pipe diameter to the outlet pipe diameter is 1.89\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.21 Page No. 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The velocity at exit, mass flow rate area at exit\n",
+ "\n",
+ "#Input data\n",
+ "h1=3000\t\t#Enthalpy of the fluid passing at inlet in kJ/kg\n",
+ "h2=2757\t\t#Enthalpy of the fluid at the discharge in kJ/kg\n",
+ "c1=60\t\t#Velocity of the fluid at inlet in m/s\n",
+ "A1=0.1\t\t#Inlet area of the nozzle in m**2\n",
+ "v1=0.187\t\t#Specific volume at inlet in m**3/kg\n",
+ "v2=0.498\t\t#Specific volume at the outlet in m**3/kg\n",
+ "q=0\t\t#Heat loss during the flow is negligable\n",
+ "z=0\t\t#The nozzle is horizontal so change in PE is constant\n",
+ "w=0\t\t#The work done is also negligable\n",
+ "\n",
+ "#Calculations\n",
+ "c2=(2*1000*((h1-h2)+(c1**2/2000.0)))**(1/2.0)\t#Velocity at the exit in m/s\n",
+ "m=(A1*c1)/v1\t\t\t\t#The mass flow rate in kg/s\n",
+ "A2=(m*v2)/c2\t\t\t\t#Area at the exit of the nozzle in m**3\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The velocity at the exit is',round(c2,1),\"m/s\"\n",
+ "print'(b)The mass flow rateis',round(m,1),\"kg/s\" \n",
+ "print'(c)Area at the exit is',round(A2,3),\"m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The velocity at the exit is 699.7 m/s\n",
+ "(b)The mass flow rateis 32.1 kg/s\n",
+ "(c)Area at the exit is 0.023 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.22 Page No. 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Velocity of the steam at the outlet, mass flow rate and area at nozzle exit\n",
+ "\n",
+ "#Input data\n",
+ "h1=3000\t\t#Specific enthalpy of steam at inlet in kJ/kg\n",
+ "h2=2762\t\t#Specific enthalpy of steam at the outlet in kJ/kg\n",
+ "v1=0.187\t\t#Specific volume of steam at inlet in m**3/kg\n",
+ "v2=0.498\t\t#Specific volume of steam at the outlet in m**3/kg\n",
+ "A1=0.1\t\t#Area at the inlet in m**2\n",
+ "q=0\t\t#There is no heat loss\n",
+ "z=0\t\t#The nozzle is horizontal ,so no change in PE\n",
+ "c1=60\t\t#Velocity of the steam at the inlet in m/s\n",
+ "\n",
+ "#Calculations\n",
+ "c2=((2*1000)*((h1-h2)+(c1**2/2000.0)))**(1/2.0)\t#Velocity of the steam at the outlet in m/s\n",
+ "m=(A1*c1)/v1\t\t\t\t#Mass flow rate of steam in kg/s\n",
+ "A2=(m*v2)/c2\t\t\t\t#Area at the nozzle exit in m**2\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Velocity of the steam at the outlet is ',round(c2,2), \"m/s \"\n",
+ "print'(b)Mass flow rate of steam is ',round(m,2),\"kg/s \"\n",
+ "print'(c)Area at the nozzle exit is',round(A2,3),\"m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Velocity of the steam at the outlet is 692.53 m/s \n",
+ "(b)Mass flow rate of steam is 32.09 kg/s \n",
+ "(c)Area at the nozzle exit is 0.023 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.23 Page No. 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the exit velocity\n",
+ "#Input data\n",
+ "c1=40\t\t#Velocity of air at the inlet of nozzle in m/s\n",
+ "h=180\t\t#The decrease in enthalpy in the nozzle in kJ/kg\n",
+ "w=0\t\t#Since adiabatic\n",
+ "q=0\t\t#Since adiabatic\n",
+ "z=0\t\t#Since adiabatic\n",
+ "\n",
+ "#Calculations\n",
+ "c2=((2*1000)*((h)+(c1**2/(2*1000))))**(1/2.0)\t#The exit velocity of air in m/s\n",
+ "\n",
+ "#Output\n",
+ "print'The exit velocity of the air is',round(c2,1),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The exit velocity of the air is 600.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.24 Page No. 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "p1=100\t\t#Pressure at the inlet of the compressor in kPa\n",
+ "p2=500\t\t#Pressure at the outlet of the compressor in kPa\n",
+ "v1=3\t\t#Volume of the air at the inlet of the compressor in m**3/kg\n",
+ "v2=0.8\t\t#Volume of the air at the outlet of the compressor in m**3/kg\n",
+ "c1=25\t\t#The velocity of air at the inlet of the compressor in m/s\n",
+ "c2=130\t\t#The velocity of air at the outlet of the compressor in m/s\n",
+ "z=12\t\t#The height of delivery connection above the inlet in m\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "n=1.3\t\t#Polytropic index\n",
+ "\n",
+ "#Calculations\n",
+ "W=((n)*(p1*v1-p2*v2))/(n-1)\t#Workdone for open system polytropic process in kJ/kg\n",
+ "K=((c2**2-c1**2)/2000.0)\t#Change in kinetic energy of the system in kJ/kg\n",
+ "P=g*(z)/1000.0 \t\t#Change in potential energy of the system in kJ/kg\n",
+ "w=W-K-P\t\t\t #The shaft work of the compressor in kJ/kg\n",
+ "\n",
+ "#Output\n",
+ "print'The Shaft work of the compressor ',round(w,1),\"kj/kgIt is the power absorbing system\"\n",
+ "if w<0:\n",
+ " print'It is the power absorbing system'\n",
+ "else:\n",
+ " print'It is not power absorbing system'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Shaft work of the compressor -441.6 kj/kgIt is the power absorbing system\n",
+ "It is the power absorbing system\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.25 Page No. 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the power required\n",
+ "\n",
+ "#Input data\n",
+ "m=10\t\t#The rate of fluid compressed adiabatically in kg/s\n",
+ "p1=500\t\t#Initial pressure of the process in kPa\n",
+ "p2=5000\t\t#Final pressure of the process in kPa\n",
+ "v=0.001\t\t#The specific volume of the fluid in m**3/kg\n",
+ "\n",
+ "#Calculations\n",
+ "P=m*v*(p2-p1)\t#The power required in kW\n",
+ "\n",
+ "#Output\n",
+ "print'The power required is',round(P,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power required is 45.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.26 Page No. 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the exit temprature\n",
+ "\n",
+ "#Input data\n",
+ "m=2.0\t\t#Mass flow rate of air in kg/s\n",
+ "t1=20\t\t#Initial temperature of the air in degree centigrade\n",
+ "P=-30\t\t#The amount of power consumed in kW\n",
+ "c1=100\t\t#The inlet velocity of air in m/s\n",
+ "c2=150\t\t#The outlet velocity of air in m/s\n",
+ "R=0.287\t\t#The gas constant for air in kJ/kg-K\n",
+ "g=1.4\t\t#It is the adiabatic index\n",
+ "cp=1.005\t\t#Specific heat at constant pressure in kJ/kg-K\n",
+ "q=0\t\t#Heat developed as it is adiabatic condition\n",
+ "z=0\t\t#The change in potential energy is neglected\n",
+ "\n",
+ "#Calculations\n",
+ "h=(P/m)+((c2**2-c1**2)/(2*1000))\t\t#The change in enthalpy of the system in kJ/kg\n",
+ "t=h/cp\t\t#The change in temperature of the system in degree centigrade\n",
+ "t2=t1-t\t\t#The exit air temperature in degree centigrade\n",
+ "\n",
+ "#Output\n",
+ "print'The exit air temperature is is',round(t2,2),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The exit air temperature is is 28.96 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.27 Page No. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The exit air temperature\n",
+ "\n",
+ "#Input data\n",
+ "m=0.6\t\t#Mass flow rate of air in kg/s\n",
+ "W=40\t\t#Power required to run the compressor in kW\n",
+ "p1=100\t\t#Initial pressure at the inlet of the compressor in kPa\n",
+ "t1=30\t\t#Initial temperature at the inlet of the compressor in degree centigrade\n",
+ "z=0\t\t#Change in potential energy is neglected\n",
+ "c=0\t\t#Change in kinetic energy is neglected\n",
+ "q=0.4\t\t#Heat lost to the cooling water ,bearings and frictional effects is 40% of input\n",
+ "cp=1.005\t\t#Specific heat at constant pressure in kJ/kg-K\n",
+ "\n",
+ "#Calculations\n",
+ "Q=q*W\t\t#Net heat losses from the system in kW\n",
+ "H=W-Q\t\t#Change in total enthalpy of the system in kW\n",
+ "t2=(H/(m*cp))+t1\t#The exit air temperature in degree centigrade\n",
+ "\n",
+ "#Output\n",
+ "print'The exit air temperature is',round(t2,0),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The exit air temperature is 70.0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.28 Page No. 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The rate at which the heat is to be removed by cooler X\n",
+ "\n",
+ "#Input data\n",
+ "m1=100\t\t#Air flow rate in kg/hr\n",
+ "q1=600\t\t#The heat generated by each person in kJ/hr\n",
+ "h1=85\t\t#The enthalpy of air entering the room in kJ/kg\n",
+ "h2=60\t\t#The enthalpy of air leaving the room in kJ/kg\n",
+ "Q1=0.2\t\t#The heat added by each lamp in the room in kW\n",
+ "P1=0.2\t\t#The power consumed by each fan in kW\n",
+ "\n",
+ "#Calculations\n",
+ "q=(5*q1)/3600.0\t#The heat generated by 5 persons in the room in kW\n",
+ "Q=3*Q1\t\t #The heat added by three lamps in the room in kW\n",
+ "P=2*P1\t\t #The power consumed by two fans in the room in kW\n",
+ "m=m1/3600.0\t\t #Mass flow rate of air in kg/s\n",
+ "H=(q+Q+P)+(m*(h1-h2))\t#Heat to be removed by the cooler in kW\n",
+ "\n",
+ "#Output\n",
+ "print'The rate at which the heat is to be removed by cooler X is',round(H,1),\"kJ/sec\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate at which the heat is to be removed by cooler X is 2.5 kJ/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.29 Page No. 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The Heat loss by the system\n",
+ "\n",
+ "#Input data\n",
+ "p1=1000\t\t#Pressure at the inlet of the system in kPa\n",
+ "p2=15\t\t#Pressure at the outlet of the system in kPa\n",
+ "v1=0.206\t\t#Specific volume at the inlet of the system in m**3/kg\n",
+ "v2=8.93\t\t#Specific volume at the outlet of the system in m**3/kg\n",
+ "h1=2827\t\t#Specific enthalpy at the inlet of the system in kJ/kg\n",
+ "h2=2341\t\t#Specific enthalpy at the outlet of the system in kJ/kg\n",
+ "c1=20\t\t#Velocity at the inlet of the system in m/s\n",
+ "c2=120\t\t#Velocity at the outlet of the system in m/s\n",
+ "z1=3.2\t\t#Elevation at the inlet of the system in m\n",
+ "z2=0.5\t\t#Elevation at the outlet of the system in m\n",
+ "m=2.1\t\t#The fluid flow rate in kg/s\n",
+ "W=750\t\t#The work output of the device in kW\n",
+ "g=9.81\t\t#Gravitational constant in m/s**2\n",
+ "\n",
+ "#Calculations\n",
+ "Q=m*(((c2**2-c1**2)/(2*1000))+((g*(z2-z1)/(1000.0)))+(h2-h1))+W #The heat loss/gain by the system in kW\n",
+ "\n",
+ "#Output\n",
+ "print'The Heat loss by the system is',round(Q,1),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Heat loss by the system is -256.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.30 Page No. 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Rate of heat transfer to the air \n",
+ "\n",
+ "#Input data\n",
+ "t1=15\t\t#The inlet temperature of the air passing through the heat exchanger in degree centigrade\n",
+ "c1=30\t\t#The inlet velocity of air in m/s\n",
+ "t2=800\t\t#The outlet temperature of the air from heat exchanger in degree centigrade \n",
+ "c2=30\t\t#The inlet velocity of air to the turbine in m/s\n",
+ "t3=650\t\t#The outlet temperature of the air from the turbine in degree centigrade\n",
+ "c3=60\t\t#The outlet velocity of the air from turbine in m/s\n",
+ "t4=500\t\t#The temperature at the outlet of the nozzle in degree centigrade\n",
+ "m=2\t\t #Air flow rate in kg/s\n",
+ "cp=1.005\t\t#Specific heat at constant pressure in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "Qh=m*cp*(t2-t1)\t#Rate of heat transfer to the air in the heat exchanger in kJ/s\n",
+ "P=m*((cp*(t2-t3))+((c2**2-c3**2)/2000.0))\t\t#Power output from the turbine in kW\n",
+ "c4=((2*1000)*(cp*(t3-t4))+c3**2)**(1/2.0)\t\t#Velocity of air at exit from nozzle in m/s\n",
+ "\n",
+ "#Output \n",
+ "print'(a)Rate of heat transfer to the air in the heat exchanger is',round(Qh,1),\"kJ/s\"\n",
+ "print'(b)Power output from the turbine is',round(P,1),\"kW\"\n",
+ "print'(c)Velocity of air at exit from nozzle is',round(c4),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Rate of heat transfer to the air in the heat exchanger is 1577.8 kJ/s\n",
+ "(b)Power output from the turbine is 298.8 kW\n",
+ "(c)Velocity of air at exit from nozzle is 552.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.31 Page No. 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "p1=400.0\t\t#Initial pressure of the gas in a turbine in kPa\n",
+ "t1=573.0\t\t#Initial temperature of the gas in a turbine in K\n",
+ "p2=100.0\t\t#Final pressure of the gas in a turbine in kPa\n",
+ "V=2.5\t\t #It is the ratio of final volume to the inlet volume \n",
+ "c2=50.0\t\t#Velocity of the gas at exit in m/s\n",
+ "P=1000.0\t\t#Power developed by the turbine in kW\n",
+ "cp=5.193\t\t#Specific heat of the helium at constant pressure in kJ/kg K\n",
+ "G=8.314\t\t#Gas constant in kNm/kgK\n",
+ "M=4.0\t\t #Molecular weight of the helium\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "R=G/M\t\t #Characteristic gas constant in kNm/kgK\n",
+ "v1=(R*t1)/p1\t#Specific volume at the inlet in m**3/kg\n",
+ "v2=V*v1\t \t#Specific volume at the outlet in m**3/kg\n",
+ "n=math.log(p2/p1)/math.log(v1/v2)\t#Polytropic index \n",
+ "t2=((t1)*((p2/p1)**((n-1)/n)))\t\t#Final temperature of the gas in a turbine in K\n",
+ "w=(n/(n-1))*(R*(t1))*(1-((p2*v2)/(p1*v1)))\t#Specific work in kJ/kg\n",
+ "K=c2**2/(2*1000)\t\t\t#Change in kinetic energy in kJ/kg\n",
+ "Ws=w-K\t\t\t#Work done by the shaft in kJ/kg\n",
+ "q=Ws+(cp*(t2-t1))+K\t#The heat transfer during the process in kJ/kg\n",
+ "m=P/Ws\t\t\t#Mass flow rate of gas required in kg/s\n",
+ "A2=(m*v2)/c2\t\t#Exit area of the turbine in m**2\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The mass flow rate of the gas required is',round(m,3),\"kg/s\" \n",
+ "print'(b)The heat transfer during the process is',round(q,1), \"kJ/kg\" \n",
+ "print'(c)Exit area of the turbine is ',round(A2,3),\"m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The mass flow rate of the gas required is 0.76 kg/s\n",
+ "(b)The heat transfer during the process is 201.5 kJ/kg\n",
+ "(c)Exit area of the turbine is 0.113 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Mechanical_Engineering/bme6.ipynb b/Basic_Mechanical_Engineering/bme6.ipynb
new file mode 100644
index 00000000..7f3d569b
--- /dev/null
+++ b/Basic_Mechanical_Engineering/bme6.ipynb
@@ -0,0 +1,942 @@
+{
+ "metadata": {
+ "name": "C6ankit"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6:Introduction to Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page no:221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The minimum value of heat transfer coefficient at the outer surface\n",
+ "\n",
+ "#Input data\n",
+ "t1=270\t\t#Temperature inside surface of the furnace wall in degree centigrade\n",
+ "t3=20\t\t#Temperature outside surface is dissipating heat by convection into air in degree centigrade\n",
+ "L=0.04\t\t#Thickness of the wall in m\n",
+ "K=1.2\t\t#Thermal conductivity of wall in W/m-K\n",
+ "t2=70\t\t#Temperature of outside surface should not exceed in degree centigrade\n",
+ "A=1\t\t #Assuming area in m**2\n",
+ "\n",
+ "#Calculations\n",
+ "Q1=(K*A*(t1-t2))/(L)\t#Heat transfer through the furnace wall in W\n",
+ "hc=(Q1)/(A*(t2-t3))\t\t#Heat transfer coefficient in W/m**2K\n",
+ "\n",
+ "#Output\n",
+ "print\"The minimum value of heat transfer coefficient at the outer surface is\",hc,\"W/m**2K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum value of heat transfer coefficient at the outer surface is 120.0 W/m**2K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2 page no:222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The change in its emissive power.\n",
+ "\n",
+ "#Input data\n",
+ "t1=30\t\t #Normal temperature of black body in degree centigrade\n",
+ "t2=100\t\t#Heated temperature of black body in degree centigrade\n",
+ "s=20.52*10**-8\t#Stefan Boltzmann constant in kJ/hrK**4\n",
+ "A=1\t\t #Assume area in m**2\n",
+ "\n",
+ "#Calculations\n",
+ "T1=273+t1\t#Black body temperatures in kelvin K\n",
+ "T2=273+t2\t#Heated temperature of black body in kelvin K\n",
+ "E=s*(T2**4-T1**4)\t#Increase of emissive power in kJ/hr\n",
+ "\n",
+ "#Output\n",
+ "print'The change in its emissive power',round(E,4),\"kJ/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in its emissive power 2242.4228 kJ/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3 page no:222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The rate of heat loss \n",
+ "#(b) Overall heat transfer coefficient \n",
+ "#(c) Temperature of the outside surface of tank \n",
+ "#(d)The surface area of the coil\n",
+ "\n",
+ "#Input data\n",
+ "L=0.012 \t#Wall thickness of a mild steel tank in m\n",
+ "t1=100.0\t\t#Temperature of water in tank in degree centigrade\n",
+ "t4=20.0\t \t#Atmospheric temperature of air in degree centigrade\n",
+ "K=50.0\t\t #Thermal conductivity of mild steel in W/m-K\n",
+ "hi=2850.0\t\t#Convection heat transfer coefficient on water side in W/m**2-K\n",
+ "ho=10.0\t\t#Convection heat transfer coefficient on air side in W/m**2-K\n",
+ "Q1=60.0 \t#Heat trasfer from the incandicent lamp in W\n",
+ "s=5.67*10**-8\t#Stefan boltzmann constant in W/m**2/K**4\n",
+ "T1=2500.0\t #Lamp surface temperature in K\n",
+ "T2=300.0\t\t#Room temperature in K\n",
+ "A=1.0\t\t #Assuming area in m**2\n",
+ "\n",
+ "#Calculations\n",
+ "T=t1-t4\t\t#Temperature difference in degree centigrade\n",
+ "Q=(T)/((1/hi)+(L/K)+(1/ho))\t#Rate of heat loss per m**2 area of surface of tank in W\n",
+ "t3=(Q/(ho*A))+(t4)\t\t#Temperature of the outside surface in degree centigrade\n",
+ "U=(Q)/(A*T)\t\t#Overall Heat transfer coefficient in W/m**2/K\n",
+ "a=(Q1)/(s*(T1**4-T2**4))\t#surface area of the coil in m**2\n",
+ "a1=a*10**6#Surface area of the coil in mm**2\n",
+ "\n",
+ "#Output\n",
+ "print'(a) The rate of heat loss per sq m area of the tank is',round(Q,2),\" W \"\n",
+ "print '(b) Overall heat transfer coefficient is ',round(U,2),\" W/m**2/K\" \n",
+ "print '(c) Temperature of the outside surface of tank is ',round(t3,2),\"C\" \n",
+ "print '(d)The surface area of the coil is ',round(a1,3),\"mm**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The rate of heat loss per sq m area of the tank is 795.3 W \n",
+ "(b) Overall heat transfer coefficient is 9.94 W/m**2/K\n",
+ "(c) Temperature of the outside surface of tank is 99.53 C\n",
+ "(d)The surface area of the coil is 27.096 mm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4 page no:225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine (a)Rate of heat loss . \n",
+ "#(b)Rate of heat loss per hour \n",
+ "\n",
+ "#Input data\n",
+ "A1=3.5\t\t#Area of the boiler plate in m**2\n",
+ "X2=0.02\t\t#Thickness of the plate in m\n",
+ "K2=50.0\t\t#Thermal conductivity of plate in W/m-K\n",
+ "X1=0.002\t #Thickness of layer inside boiler in m\n",
+ "K1=1.0\t\t #Thermal conductivity of layer in W/m-K\n",
+ "t1=250.0\t\t#The hot gas temperature of the plate in degree centigrade\n",
+ "t3=200.0\t\t#Temperature of cold air in degree centigrade\n",
+ "\n",
+ "#Calculations \n",
+ "T=t1-t3\t\t#Temperature difference in degree centigrade\n",
+ "Q=(T*A1)/((X1/K1)+(X2/K2))\t#Rate of heat loss in W\n",
+ "Q1=Q/1000\t\t#Rate of heat loss in kJ/s\n",
+ "Q2=Q1*3600\t\t#Rate of heat loss in kJ/hr\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Rate of heat loss is',round(Q1,2),\" kJ/s \"\n",
+ "print'(b)Rate of heat loss per hour is',round(Q2,2),\"kJ/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Rate of heat loss is 72.92 kJ/s \n",
+ "(b)Rate of heat loss per hour is 262500.0 kJ/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5 page no:226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find (a)The rate of heat loss per sq m of the wall \n",
+ "#(b)The temperature at the inner surface \n",
+ "#(c)The temperature at the outer surface\n",
+ "\n",
+ "#Input data \n",
+ "L1=0.225\t\t#Thickness of the brick in m\n",
+ "K1=4.984\t\t#Thermal conductivity of brick in kJ/hr m C/m\n",
+ "L2=0.125\t\t#Thickness of insulating brick in m\n",
+ "K2=0.623\t\t#Thermal conductivity of insulating brick in kJ/hr m C /m\n",
+ "Ti=1650.0\t\t#Temperature inside the furnace in degree centigrade\n",
+ "hl=245.28\t\t#Conductance at inside wall in kJ/hr m**2 C\n",
+ "ho=40.88\t\t#Conductance at outside wall in kJ/hr m**2 C\n",
+ "To=27.0\t\t#Temperature of surrounding atmosphere in degree centigrade \n",
+ "\n",
+ "#Calculations \n",
+ "R=((1.0/hl)+(L1/K1)+(L2/K2)+(1.0/ho))\t#Total resistance of the wall in C hr/kJ\n",
+ "q=(Ti-To)/R\t\t\t#Rate of heat loss per m**2 of the wall in kJ/hr m**2\n",
+ "T1=Ti-(q*(1.0/hl))\t\t\t#Inner surface temperature in degree centigrade\n",
+ "T3=Ti-(q*((1.0/hl)+(L1/K1)+(L2/K2)))\t#Outer surface temperature in degree centigrade\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The rate of heat loss per sq m of the wall is',round(q,1), \"kJ/hr m**2\"\n",
+ "print'(b)The temperature at the inner surface is',round(T1,2),\"C\" \n",
+ "print'(c)The temperature at the outer surface is',round(T3,2),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The rate of heat loss per sq m of the wall is 5916.3 kJ/hr m**2\n",
+ "(b)The temperature at the inner surface is 1625.88 C\n",
+ "(c)The temperature at the outer surface is 171.72 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 85
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6 page no:227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find(a)The heat transfer by conduction through the wall \n",
+ "#(b)Resistance of the wall \n",
+ "#Conductance of the wall .\n",
+ "\n",
+ "#Input data\n",
+ "x=0.3\t\t#Thickness of the wall in degree centigrade\n",
+ "t1=24.0\t\t#Inside surface temperature of the wall in degree centigrade\n",
+ "t2=-6\t\t#Outside temperature of wall in degree centigrade\n",
+ "h=2.75\t\t#Height of the wall in m\n",
+ "L=6.1\t\t#Length of the wall in m\n",
+ "K=2.6\t\t#Coefficient of conductivity of brick in kJ/hr m C\n",
+ "\n",
+ "#Calculations \n",
+ "A=h*L\t\t#Area of the wall in m**2\n",
+ "A=round(A,1)\n",
+ "T=t2-t1\t\t#Temperature difference in degree centigrade\n",
+ "q=(K*A*(-T))/(x)\t#Heat transfer by conduction in kJ/hr\n",
+ "R=(t1-t2)/q\t#Resistance of the wall in C hr/kJ\n",
+ "C=1.0/R\t\t#Conductance of the wall in kJ/m C\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The heat transfer by conduction through the wall is',q, \"kJ/hr\"\n",
+ "print'(b)Resistance of the wall is',round(R,5),\"C hr/kJ\"\n",
+ "print'(C)Conductance of the wall is',round(C,1),\"kJ/m C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The heat transfer by conduction through the wall is 4368.0 kJ/hr\n",
+ "(b)Resistance of the wall is 0.00687 C hr/kJ\n",
+ "(C)Conductance of the wall is 145.6 kJ/m C\n"
+ ]
+ }
+ ],
+ "prompt_number": 86
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.8 page no:230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Heat received by the unit area of earths surface.\n",
+ "\n",
+ "#Input data \n",
+ "T=300\t\t#Temperature of the earth as a black body in K\n",
+ "s=20.52*10**-8\t#Stefan Boltzmann constant in kJ/hr m**2 T**4\n",
+ "\n",
+ "#Calculations \n",
+ "Q=s*T**4\t#Heat received by unit area on the earths surface perpendicular to solar rays in kJ/hr\n",
+ "\n",
+ "#Output\n",
+ "print'Heat received by the unit area of earths surface',round(Q,2),\"kJ/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat received by the unit area of earths surface 1662.12 kJ/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.9 page no:230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The loss of heat by radiation from steel tube\n",
+ "\n",
+ "#Input data\n",
+ "D=0.07\t\t # Diameter of the steel tube in m\n",
+ "L=3.0\t\t #Length of the steel tube\n",
+ "t1=227.0\t\t#Temperature of the steel tube in m\n",
+ "t2=27.0\t \t#Temperature of the room in degree centigrade\n",
+ "s=20.52*10**-8\t#Stefan Boltzmann constant in kJ/hr m**2 T**4\n",
+ "pi=3.1428\t\t#Constant value of pi\n",
+ "\n",
+ "#Calculations \n",
+ "A=2*pi*D*L\t #Surface area of the tube in m**2\n",
+ "Q=(A)*(s)*((t1+273)**4-(t2+273)**4)\t#Loss of heat by radiation in kJ/hr\n",
+ "Q1=Q/3600.0\t #Loss of heat by radiation in kW\n",
+ "\n",
+ "#Output\n",
+ "print'The loss of heat by radiation from steel tube is',round(Q1,3),\"KW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loss of heat by radiation from steel tube is 4.093 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.10 page no:231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The rate of heat removed from the refrigirator\n",
+ "\n",
+ "#Input data\n",
+ "T1=7.0\t\t #Inside temperature of refrigerator in degree centigrade \n",
+ "T0=28.0\t\t#Temperature in the kitchen in degree centigrade\n",
+ "K1=40.0\t\t#Thermal conductivity of mild steel in W/mC\n",
+ "x1=0.03\t\t#Thickness of mild sheets in m\n",
+ "K3=40.0\t\t#Thermal conductivity of the mild steel in W/mC\n",
+ "x3=0.03\t\t#Thickness of another side mild sheet in m\n",
+ "x2=0.05\t\t#Thickness of glass wool insulated in m\n",
+ "hi=10.0\t\t#Heat transfer coefficient in the inner surface of refrigerator in W/m**2 C\n",
+ "ho=12.5\t\t#Heat transfer coefficient in the outer surface of refrigerator in W/m**2 C\n",
+ "K2=0.04\t\t#Thermal conductivity of glass in W/mC\n",
+ "\n",
+ "#Calculations\n",
+ "Q=(T1-T0)/((1/hi)+(x1/K1)+(x2/K2)+(x3/K3)+(1/ho))\t#Heat transfer per unit area in W/m**2\n",
+ "\n",
+ "#Output\n",
+ "print'The rate of heat removed from the refrigirator ',round(Q,3),\"W/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of heat removed from the refrigirator -14.67 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 89
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.11 page no:232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find (a)Heat loss per m**2 area of the furnace wall \n",
+ "#(b)Maximum temperature to which common brick is subjected \n",
+ "\n",
+ "#Input data\n",
+ "x1=0.2\t \t#Thickness of the fire brick\n",
+ "x2=0.2\t \t#Thickness of the common brick\n",
+ "Ti=1400.0 \t#Temperature of hot gases in the inner surface of the brick in degree centigrade\n",
+ "To=50.0\t\t#Temperature of gases in the outer surface of the brick in degree centigrade\n",
+ "h1=16.5\t\t#Convection heat transfer coefficient on gas side in W/mC\n",
+ "h2=17.5\t\t#radiation heat transfer coefficient on gas side in W/mC\n",
+ "h3=12.5\t\t#Convection heat transfer coefficient on outer side in W/mC\n",
+ "h4=6.5 \t\t#Radiation heat transfer coeeficient on outer side in W/mC\n",
+ "K1=4.0 \t\t#Thermal conductivity of fire brick in W/mC\n",
+ "K2=0.65\t\t#Thermal conductivity of common brick in W/mC\n",
+ "\n",
+ "#Calculations \n",
+ "hi=h1+h2\t\t#Total heat transfer coefficient in inner \n",
+ "ho=h3+h4\t\t#Total heat transfer coefficient in outer \n",
+ "Q=(Ti-To)/((1/hi)+(x1/K1)+(x2/K2)+(1/ho))\t#Heat flow through the furnace composite wall per unit area in W/m**2\n",
+ "Q1=Q/1000\n",
+ "T1=Ti-(Q/hi)\t#Temperature at the inside of the fire brick \n",
+ "T2=T1-(Q*(x1/K1))#Maximum temperature to which common brick is subjected in degree centigrade\n",
+ "\n",
+ "#Output\n",
+ "print'(a)Heat loss per m**2 area of the furnace wall is',round(Q)/1000,\"kW/m**2\" \n",
+ "print'(b)Maximum temperature to which common brick is subjec',round(T1,3),\"C\" \n",
+ "print'(c)similarly on other side is',round(T2,3),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Heat loss per m**2 area of the furnace wall is 3.07 kW/m**2\n",
+ "(b)Maximum temperature to which common brick is subjec 1309.705 C\n",
+ "(c)similarly on other side is 1156.204 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.12 page no:234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The thickness of the red brick layer \n",
+ "\n",
+ "#Input data\n",
+ "K1=0.93\t\t#Thermal conductivity of fire clay in W/mC\n",
+ "K2=0.13\t\t#Thermal conductivity of diatomite brick in W/mC\n",
+ "K3=0.7\t\t#Thermal conductivity of red brick in W/mC\n",
+ "x1=0.12\t\t#Thickness of fire clay in m\n",
+ "x2=0.05\t\t#Thickness of diatomite in m\n",
+ "x3=0.25\t\t#Thickness of brick in m\n",
+ "T=1\t\t#Assume the difference between temperature in degree centigrade\n",
+ "\n",
+ "#Calculations\n",
+ "Q=(T)/((x1/K1)+(x2/K2)+(x3/K3))\t#The heat flow per unit area in W/m**2\n",
+ "X3=K3*((T/Q)-(x1/K1))\t\t#Thickness of the red brick layer in m\n",
+ "X=X3*100\t\t\t#Thickness of the red brick layer in cm\n",
+ "\n",
+ "#Output\n",
+ "print'The thickness of the red brick layer is',round(X,3),\"cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thickness of the red brick layer is 51.923 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.13 page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the rate of heat loss\n",
+ "\n",
+ "#Input data\n",
+ "R1=0.06\t\t#Thickness of material layer in m\n",
+ "R2=0.12\t\t#Thickness of the two insulating materials in m\n",
+ "R3=0.16\t\t#Thickness of material layers with pipe in m\n",
+ "K1=0.24\t\t#Thermal conductivity of one layer in W/mC\n",
+ "K2=0.4\t\t #Thermal conductivity of another layer in W/mC\n",
+ "L=60.0\t\t #Length of the pipe in m\n",
+ "hi=60.0\t\t#Heat transfer coefficient inside in W/m**2C\n",
+ "ho=12.0\t\t#Heat transfer coefficient outside in W/m**2C\n",
+ "ti=65.0\t\t#Temperature of hot air flowing in pipe in degree centigrade\n",
+ "to=20.0\t\t#Atmospheric temperature in degree centigrade\n",
+ "pi=3.1428\t #Constant value of pi\n",
+ "\n",
+ "#Calculations\n",
+ "Q=(ti-to)*(2*pi*L)/((1/(hi*R1))+(math.log(R2/R1)/(K1))+(math.log(R3/R2)/(K2))+(1/(ho*R3)))\t#Rate of heat loss in W\n",
+ "Q1=Q/1000\t#Rate of heat loss in kW\n",
+ "\n",
+ "#Output\n",
+ "print'The rate of heat loss is',round(Q1,4),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of heat loss is 3.8519 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 92
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.14 page no:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find (a)The quantity of heat lost per meter length of steam pipe \n",
+ "#(b)The quantity of steam coming out of one meter length pipe.\n",
+ "\n",
+ "#Input data\n",
+ "R1=8.0\t\t #Inner radius of the pipe in cm\n",
+ "R2=8.5\t\t #Outter radius of the pipe in cm\n",
+ "x1=3.0\t\t #Thickness of first layer in cm\n",
+ "x2=5.0\t\t #Thickness of second layer in cm\n",
+ "T1=300.0\t\t#Inner surface temperature of the steam pipe in degree centigrade\n",
+ "pi=3.1428\t #Constant value of pi \n",
+ "T4=50.0\t\t #Temperature at outer surface of insulation in degree centigrade\n",
+ "L=1.0\t\t #Length of the pipe in m\n",
+ "K1=50.0\t \t#Thermal conductivity of pipe in W/mC\n",
+ "K2=0.15\t \t#Thermal conductivity of first layer in W/mC\n",
+ "K3=0.08\t \t#Thermal conductivity of second layer in W/mC\n",
+ "h=2751.0\t\t#Enthalpy of dry and saturated steam at 300 degree centigrade in kJ/kg\n",
+ "q=40.0\t \t#Quantity of steam flow in gm/hr\n",
+ "hf=1345.0\t\t#Enthalpy of fluid at 300 degree centigrade in kJ/kg\n",
+ "hfg=1406.0\t\t#enthalpy at 300 degree centigrade in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "R3=R2+x1\t#Radius of pipe with first layer\n",
+ "R4=R3+x2\t#Radius of pipe with two layers\n",
+ "Q=(2*pi*L*(T1-T4))/((math.log(R2/R1)/(K1))+(math.log(R3/R2)/(K2))+(math.log(R4/R3)/(K3)))\n",
+ "Q1=Q/1000\t#Quantity of heat loss per meter length of pipe in kW\n",
+ "Q2=Q1*3600\t#Quantity of heat loss per meter length of pipe in kJ/hr\n",
+ "hg=((h)-(Q2/q))\t#Enthalpy of steam in kJ/kg\n",
+ "x=(hg-hf)/(hfg)\t#Dryness fraction of steam\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The quantity of heat lost per meter length of steam pipe is',round(Q,2),\"W/m or\",round(Q*3600/1000),\"kJ/hr\"\n",
+ "print'(b)The quantity of steam coming out of one meter length pipe is',round(x,4),\"gm/h\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The quantity of heat lost per meter length of steam pipe is 240.68 W/m or 866.0 kJ/hr\n",
+ "(b)The quantity of steam coming out of one meter length pipe is 0.9846 gm/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 93
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.15 page no:238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find(a)The heat transfer by conduction through the wall \n",
+ "#(b)Resistance of the wall \n",
+ "#Conductance of the wall .\n",
+ "\n",
+ "#Input data\n",
+ "x=0.3\t\t#Thickness of brick wall in m\n",
+ "ti=24.0\t\t#Inside surface temperature of wall in degree centigrade\n",
+ "to=-6.0\t\t#Outside surface temperature of wall in degree centigrade\n",
+ "h=2.75\t\t#Height of the wall in m\n",
+ "L=6.1\t\t#Length of the wall in m\n",
+ "K=2.6\t\t#Thermal conductivity of brick material in kJ/m hr C\n",
+ "\n",
+ "#Calculations\n",
+ "T=ti-to\t\t#Temperature difference across the wall in degree centigrade\n",
+ "A=h*L\t\t#Area of the wall in m**2\n",
+ "Q=(K*A*T)/(x)\t#Heat transfer through conduction by the wall per hour in kJ/hr\n",
+ "R=T/Q\t\t#Resistance of the wall in hr C/kJ\n",
+ "C=1.0/R\t\t#Conductance of the wall in kJ/hr C\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The heat transfer by conduction through the wall is',round(Q),\"kJ/hr \"\n",
+ "print'(b)The resistance of the wall is ',round(R,5),\"Chr/Kj \" \n",
+ "print' The conductance of the wall is',round(C,1), \"kJ/hr C \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The heat transfer by conduction through the wall is 4362.0 kJ/hr \n",
+ "(b)The resistance of the wall is 0.00688 Chr/Kj \n",
+ " The conductance of the wall is 145.4 kJ/hr C \n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.16 page no:240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#What is The reduction in heat loss through the wall\n",
+ "\n",
+ "#Input data\n",
+ "x1=0.3 \t#Thickness of refractory bricks in m\n",
+ "K1=5.66\t\t#Thermal conductivity of refractory bricks in kJ/hr mC\n",
+ "t1=1650.0\t\t#Inner surface temperature of the wall in degree centigrade\n",
+ "t2=320.0\t \t#Outside surface temperature of the wall in degree centigrade\n",
+ "x2=0.3\t \t#Thickness of insulating brick in m\n",
+ "K2=1.26\t\t#Thermal conductivity of insulating brick in kJ/hr mC\n",
+ "A=1.0\t \t#unit surface area in m**2\n",
+ "t3=27.0\t\t#Outside surface temperature of the brick in degree centigrade\n",
+ "\n",
+ "#Calculations \n",
+ "T1=t1-t2\t\t#Temperature difference in degree centigrade\n",
+ "Q1=(K1*A*T1)/(x1)\t#Heat loss without insulation in kJ/hr/m**2\n",
+ "R1=(K1*A)/(x1)\t#Heat loss for the change in temperature for refractory brick wall material in kJ/hrC\n",
+ "R2=(K2*A)/(x2)\t#Heat loss for the change in temperature for insulated brick wall material kJ/hrC\n",
+ "Q2=(t1-t3)/((1.0/R1)+(1.0/R2))\t#Heat loss with insulation in kJ/hr/m**2\n",
+ "Q3=Q1-Q2\t\t#Reduction in heat loss through the wall in kJ/hr/m**2\n",
+ "\n",
+ "#Output\n",
+ "print'The reduction in heat loss through the wall is ',round(Q3,1),\"kJ/hr/m**2\"\n",
+ "print\"\\nNOTE:Answer wrongly written in book as 1951.4\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reduction in heat loss through the wall is 19517.2 kJ/hr/m**2\n",
+ "\n",
+ "NOTE:Answer wrongly written in book as 1951.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 95
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.17 page no:241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find (a)The leakage through the wall per 24 hours \n",
+ "#(b)Temperature at the interface \n",
+ "#Temperature at interface \n",
+ "\n",
+ "#Input data\n",
+ "L=4.6\t \t #Length of the wall in m\n",
+ "b=2.3\t \t#Breadth of the wall in m\n",
+ "x1=0.025\t\t#Thickness of the wood in m\n",
+ "x2=0.075\t\t#Thickness of the cork slabbing in m\n",
+ "x3=0.115\t\t#Thickness of the brick in m\n",
+ "t1=18.0\t\t #Exterior temperature of the wall in degree centigrade\n",
+ "t4=-20.0\t\t#Interior temperature of the wall in degree centigrade\n",
+ "K1=7.5 \t\t #Thermal conductivity of the wood in kJ/hr mC\n",
+ "K2=1.9 \t\t #Thermal conductivity of the wood in kJ/hr.mC\n",
+ "K3=41.0\t\t #Thermal conductivity of the brick in kJ/hr mC\n",
+ "\n",
+ "#Calculations\n",
+ "A=L*b\t\t#Area of the wall in m**2\n",
+ "R1=(K1*A)/(x1)\t#Heat loss for the change in temperature for insulated wood material in kJ/hrC\n",
+ "R2=(K2*A)/(x2)\t#Heat loss for the change in temperature for cork material in kJ/hrC\n",
+ "R3=(K3*A)/(x3)\t#Heat loss for the change in temperature for brick in kJ/hrC\n",
+ "Q=(t1-t4)/((1.0/R1)+(1.0/R2)+(1.0/R3))\t#Heat loss with insulation in kJ/hr\n",
+ "Q1=Q*24.0\t\t#Heat loss with insulation in kJ/24hr\n",
+ "t2=t1-(Q/R1)\t#Interface temperature t2 in degree centigrade \n",
+ "t3=t2-(Q/R2)\t#Interface temperature t3 in degree centigrade\n",
+ "\n",
+ "#Output \n",
+ "print'(a)The leakage through the wall per 24 hours is',round(Q,2),\"kJ/hr=\",round(Q,2)*24 \n",
+ "print'(b)Temperature at the interface is',round(t2,3),\"C\" \n",
+ "print'(c)Temperature at interface ',round(t3,3),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The leakage through the wall per 24 hours is 8814.37 kJ/hr= 211544.88\n",
+ "(b)Temperature at the interface is 15.223 C\n",
+ "(c)Temperature at interface -17.663 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 96
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.18 page no:243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find The heat loss per sq metre of surface area for a furnace wall \n",
+ "\n",
+ "#Input data\n",
+ "L=0.3\t\t#Thickness of the wall in m\n",
+ "ti=320\t\t#Inner surface temperature in degree centigrade\n",
+ "to=38\t\t#Outer surface temperature in degree centigrade\n",
+ "A=1\t\t#Assume unit area in m**2\n",
+ "\n",
+ "#Calculations\n",
+ "Q=(A/L)*((0.01256/2)*(ti**2-to**2)-(4.2/3)*10**-6*(ti**3-to**3)) #Heat loss per sq metre of surface area\n",
+ "\n",
+ "#Output\n",
+ "print'The heat loss per sq metre of surface area for a furnace wall is',round(Q,2),\"kJ/hr/m**2 \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat loss per sq metre of surface area for a furnace wall is 1960.68 kJ/hr/m**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 97
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.19 page no:245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Input data\n",
+ "d=11.5\t\t#Outer diameter of steam pipe line in cm\n",
+ "t1=5.0\t\t#Thickness of first layer in cm\n",
+ "K1=0.222\t\t#Thermal conductivity of first layer in kJ/hr mC\n",
+ "t2=3.0\t\t#Thickness of second layer in cm\n",
+ "pi=3.1428\t\t#Constant value of pi\n",
+ "K2=3.14\t\t#Thermal conductivity of second layer in kJ/hr mC\n",
+ "T1=235\t\t#Outside surface temperature of steam pipe in degree centigrade\n",
+ "T3=38\t\t#Outer surface of lagging in degree centigrade\n",
+ "L=1.0\t\t#Length of the pipe in m\n",
+ "\n",
+ "#Calculations\n",
+ "I=math.log((d+(2*t1))/d)\t\t\t#For inner layer calculation\n",
+ "O=math.log((d+(2*t1)+(2*t2))/(d+(2*t1)))\t\t#For outer layer calculations\n",
+ "R1=(2.0*pi*L*K1)/I\t\t#Heat loss for change in temperature for first insulated material in kJ/hC\n",
+ "R2=(2.0*pi*L*K2)/O\t\t#Heat loss for the change in temperature for second insulated material in kJ/hC\n",
+ "Q=(T1-T3)/(1.0/R1+1.0/R2)\t#Heat loss per metre length of pipe per hr in kJ/hr\n",
+ "T2=T1-(Q/R1)#Temperature between the two layers of insulation in degree centigrade\n",
+ "\n",
+ "#Output\n",
+ "print'(a)The heat loss per metre length of pipe per hr is',round(Q,2),\" kJ/hr\" \n",
+ "print'(b)Temperature between the two layers of insulation is',round(T2,2),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The heat loss per metre length of pipe per hr is 427.45 kJ/hr\n",
+ "(b)Temperature between the two layers of insulation is 43.33 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 98
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.20 page no:247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the rate of heat flow\n",
+ "\n",
+ "#Input data\n",
+ "t1=24.0 \t#Temperature at the outside surface in degree centigrade \n",
+ "t4=-15.0 \t#Temperature at the inner surface in degree centigrade\n",
+ "A=1.0 \t\t#Assuming unit area in m**2\n",
+ "K1=23.2\t\t#Thermal conductivity of steel in W/mC\n",
+ "K2=0.014\t\t#Thermal conductivity of glasswood in W/mC\n",
+ "K3=0.052\t\t#Thermal conductivity of plywood in W/mC\n",
+ "x1=0.0015\t\t#Thickness of steel sheet at outer surface in m\n",
+ "x2=0.02\t\t#Thickness of glasswood in between in m\n",
+ "x3=0.01\t\t#Thickness of plywood at a inner surface in m\n",
+ "\n",
+ "#Calculations\n",
+ "R1=(K1*A)/x1\t#Heat loss for the change in temperature for first insulated material\n",
+ "R2=(K2*A)/x2\t#Heat loss for the change in temperature for second insulated material\n",
+ "R3=(K3*A)/x3\t#Heat loss for the change in temperature for third insulated material\n",
+ "Q=(t1-t4)/(1/R1+1/R2+1/R3)\t#The rate of heat flow in W/m**2\n",
+ "\n",
+ "#Output\n",
+ "print'The rate of heat flow is',round(Q,2),\"W/m**2 \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of heat flow is 24.06 W/m**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Mechanical_Engineering/screenshots/ravi1.png b/Basic_Mechanical_Engineering/screenshots/ravi1.png
new file mode 100644
index 00000000..e08f066d
--- /dev/null
+++ b/Basic_Mechanical_Engineering/screenshots/ravi1.png
Binary files differ
diff --git a/Basic_Mechanical_Engineering/screenshots/ravi2.png b/Basic_Mechanical_Engineering/screenshots/ravi2.png
new file mode 100644
index 00000000..8807457b
--- /dev/null
+++ b/Basic_Mechanical_Engineering/screenshots/ravi2.png
Binary files differ
diff --git a/Basic_Mechanical_Engineering/screenshots/ravi3.png b/Basic_Mechanical_Engineering/screenshots/ravi3.png
new file mode 100644
index 00000000..be16b4e6
--- /dev/null
+++ b/Basic_Mechanical_Engineering/screenshots/ravi3.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/README.txt b/Basic_Principles_And_Calculations_In_Chemical_Engineering/README.txt
new file mode 100644
index 00000000..def5a27e
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Vaibhav Shah
+Course: others
+College/Institute/Organization: Indian Institute of Engineering Bombay
+Department/Designation: System Administrator
+Book Title: Basic Principles And Calculations In Chemical Engineering
+Author: D. M. Himmelblau & J. B. Riggs
+Publisher: PHI Learning Private Limited, New Delhi
+Year of publication: 2004
+Isbn: 9788120338395
+Edition: 7th \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch1.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch1.ipynb
new file mode 100644
index 00000000..947cfb01
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch1.ipynb
@@ -0,0 +1,305 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 page no : 6\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Finding the density'''\n",
+ "\n",
+ "#let the total mass of mud be 100lbm\n",
+ "#variables\n",
+ "m_total=100.0; #lbm\n",
+ "#70% by wt of mud is sand(SiO2)and remaining is water\n",
+ "m_sand=0.7*m_total; #lbm\n",
+ "m_water=0.3*m_total; #lbm\n",
+ "rho_sand=165.0; #lbm/ft^3\n",
+ "rho_water=62.3; #lbm/ft^3\n",
+ "\n",
+ "#calculation\n",
+ "#rho=mass/volume\n",
+ "rho_mud=m_total/((m_sand/rho_sand)+(m_water/rho_water));\n",
+ "\n",
+ "#result\n",
+ "print \"The density of mud=\" ,rho_mud, \"lbm/ft^3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The density of mud= 110.401675438 lbm/ft^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 page no : 8\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the shear stress at the surface of the inner cylinder\n",
+ "'''\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "D1=25.15 #mm\n",
+ "D2=27.62 #mm\n",
+ "dr=0.5*(D2-D1) #mm\n",
+ "f=10. #rpm\n",
+ "\n",
+ "# calculations\n",
+ "Vo=math.pi*D1*f/60. #mm/s\n",
+ "#Let D denote d/dr\n",
+ "DV=Vo/dr #s^-1\n",
+ "tow=0.005 #Nm\n",
+ "L=92.37 #mm\n",
+ "s=2*tow/D1**2/(math.pi)/L*(10**6) #N/m^2\n",
+ "\n",
+ "# result\n",
+ "print \"The stress at the surface of the inner cylinder is %f N/m^2\"%s "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The stress at the surface of the inner cylinder is 0.054481 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 page no : 15\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#problem on surface tension\n",
+ "# variablees\n",
+ "l=0.10; #m (length of sliding part)\n",
+ "f=0.00589; #N (pull due to 0.6 gm of mass)\n",
+ "\n",
+ "#calculation\n",
+ "f_onefilm=f/2; #N\n",
+ "#surface tension=(force for one film)/(length)\n",
+ "sigma=f_onefilm/l;\n",
+ "\n",
+ "# result\n",
+ "print \"The surface tension of fluid is\",sigma,\"N/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The surface tension of fluid is 0.02945 N/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4 page no : 20\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert 327 miles/hr into ft/s\n",
+ "\n",
+ "# variables\n",
+ "V=327. #miles/hr\n",
+ "#1 mile = 5280 ft\n",
+ "#1 hour = 3600 sec\n",
+ "\n",
+ "# calculation\n",
+ "V1=V*5280/3600.0#ft/s\n",
+ "\n",
+ "# result\n",
+ "print \"327 miles/hr = %f ft/s\"%V1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "327 miles/hr = 479.600000 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5 page no : 21\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert 2.6 hours into seconds\n",
+ "\n",
+ "# variables\n",
+ "t=2.6 #hr\n",
+ "#1 hr = 3600 s\n",
+ "\n",
+ "# calculations\n",
+ "t1=2.6*3600 #s\n",
+ "\n",
+ "# result\n",
+ "print \"2.6 hours = %f seconds\"%t1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.6 hours = 9360.000000 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6 page no : 24\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the acceleration in ft/min^2\n",
+ "\n",
+ "# variables\n",
+ "m=10. #lbm\n",
+ "F=3.5 #lbf\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "#1 min = 60 sec\n",
+ "\n",
+ "# calculations\n",
+ "a=F*32.2*60**2/m #ft/min^2\n",
+ "\n",
+ "# result\n",
+ "print \"The acceleration provided is %f ft/min^2\" % a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The acceleration provided is 40572.000000 ft/min^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7 page no : 24\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the wt of metallic aluminium deposited in an electrolytic cell\n",
+ "\n",
+ "# variables\n",
+ "I=50000. #Ampere or Coulumbs/sec\n",
+ "#1 hr = 3600 sec\n",
+ "I1=50000*3600. #C/hr\n",
+ "\n",
+ "#calculation\n",
+ "#96500 C = 1 gm.eq\n",
+ "#1 mole of aluminium = 3 gm.eq\n",
+ "#1 mole of aluminium = 27 gm\n",
+ "m=I1*(1.0/96500)*(27/3.0)/1000.0 #Kg/hr\n",
+ "\n",
+ "#result\n",
+ "print \"the wt of metallic aluminium deposited in an electrolytic cell is %f Kg/hr\"%m"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the wt of metallic aluminium deposited in an electrolytic cell is 16.787565 Kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch10.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch10.ipynb
new file mode 100644
index 00000000..621beb27
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch10.ipynb
@@ -0,0 +1,793 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Material Balances for Processes Involving Reaction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.1 Page no. 264\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Reaction in which Fraction Conversion is specified\n",
+ "\n",
+ "# Variables \n",
+ "F = 100 # feed to the reactor-[g mol]\n",
+ "CH4 = 0.4*F # [g mol]\n",
+ "Cl2 = 0.5*F ; # [g mol]\n",
+ "N2= 0.1*F ; #[g mol]\n",
+ "\n",
+ "nio_CH4 = CH4 #[g mol CH4]\n",
+ "vi_CH4 = -1 # coefficint of CH4\n",
+ "\n",
+ "\n",
+ "# Calculation and Result\n",
+ "ex_CH4 = -(nio_CH4)/vi_CH4 # Max. extent of reaction based on CH4\n",
+ "\n",
+ "nio_Cl2 = Cl2 ; #[g mol Cl2]\n",
+ "vi_Cl2 = -1 ; # coefficint of Cl2\n",
+ "ex_Cl2 = -(nio_Cl2)/vi_Cl2 ; # Max. extent of reaction based on Cl2\n",
+ "\n",
+ "if (ex_Cl2 > ex_CH4 ):\n",
+ " print ' CH4 is limiting reactant '\n",
+ "else:\n",
+ " print ' (b) Cl2 is limiting reactant '\n",
+ "\n",
+ "cn_CH4 = 67/100.0 ; # percentage conversion of CH4\n",
+ "ex_r = (-cn_CH4)*CH4/vi_CH4 ; # extent of reaction\n",
+ "\n",
+ "print ' extent of reaction is %.1f g moles reacting '%ex_r\n",
+ "\n",
+ "n_un = 11 ; # Number of unknowns in the given problem\n",
+ "n_ie = 11 ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie ; # Number of degree of freedom\n",
+ "print ' Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "vi_CH3Cl = 1;\n",
+ "vi_HCl = 1;\n",
+ "vi_N2 = 0;\n",
+ "p_CH4 = CH4+(vi_CH4*ex_r); # [g mol]\n",
+ "p_Cl2 = Cl2+(vi_Cl2*ex_r); # [g mol]\n",
+ "p_CH3Cl = 0+(vi_CH3Cl*ex_r); # [g mol]\n",
+ "p_HCl = 0+(vi_HCl*ex_r); # [g mol]\n",
+ "p_N2 = N2+(vi_N2*ex_r); # [g mol]\n",
+ "\n",
+ "print 'Composition of product stream in %% g mol of products'\n",
+ "print 'Product Percentage g mol'\n",
+ "print 'CH4 %.1f%% g mol'%p_CH4\n",
+ "print 'Cl2 %.1f%% g mol'%p_Cl2\n",
+ "print 'CH3Cl %.1f%% g mol'%p_CH3Cl\n",
+ "print 'HCl %.1f%% g mol'%p_HCl\n",
+ "print 'N2 %.1f%% g mol'%p_N2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " CH4 is limiting reactant \n",
+ " extent of reaction is 26.8 g moles reacting \n",
+ " Number of degree of freedom for the given system is 0 \n",
+ "Composition of product stream in %% g mol of products\n",
+ "Product Percentage g mol\n",
+ "CH4 13.2% g mol\n",
+ "Cl2 23.2% g mol\n",
+ "CH3Cl 26.8% g mol\n",
+ "HCl 26.8% g mol\n",
+ "N2 10.0% g mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.2 Page no. 266\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# A reaction in which Fraction Conversion is to beCalculated\n",
+ "\n",
+ "# Variables \n",
+ "S = 5000. ; # Sulphur [lb]\n",
+ "CH4 = 80. ; # [%]\n",
+ "H2S = 20.; # [%]\n",
+ "\n",
+ "n_un = 11. ;\n",
+ "n_ie = 11. ;\n",
+ "\n",
+ "# Calculation and Result\n",
+ "d_o_f = n_un-n_ie ;\n",
+ "print 'Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "m_S = 32.0 #molecular wt. of S -[lb]\n",
+ "mol_S = S/32.0;\n",
+ "nio_S = 0 #[g mol S]\n",
+ "ni_S = mol_S ; #[g mol S]\n",
+ "vi_S = 3. # coefficint of S -from given reaction\n",
+ "ex_r = (ni_S-nio_S)/vi_S ; # Extent of reaction based on S\n",
+ "print ' Extent of reaction is %.1f g moles reacting '%ex_r\n",
+ "\n",
+ "vi_H2O = 2. ; # coefficint of H2O\n",
+ "vi_H2S = -2. ; # coefficint of H2S\n",
+ "vi_SO2 = -1. ; #coefficint of SO2\n",
+ "vi_CH4 = 0 ; #coefficint of CH4\n",
+ "P_H2O = 0+(vi_H2O*ex_r); # [lb mol]\n",
+ "P_H2S = P_H2O/10 ; #[lb mol]\n",
+ "P_SO2 = 3.*P_H2S ; #[lb mol]\n",
+ "\n",
+ "F = (P_H2S-vi_H2S*ex_r)/(H2S/100) ; # total feed-[lb mol]\n",
+ "F_SO2 = P_SO2-(vi_SO2*ex_r); # feed rate of SO2- [lb mol]\n",
+ "F_CH4 = (CH4/100.)*F+vi_CH4*ex_r ; #feed rate of CH4- [lb mol]\n",
+ "F_H2S = ((H2S/100.)*F) ; # feed rate of H2S-[lb mol]\n",
+ "\n",
+ "f_cn = -(vi_H2S*ex_r)/((H2S/100.)*F) # Fractional conversion of limiting reagent\n",
+ "\n",
+ "print '(1)Feed rate of H2S- %.1f lb mol'%F_H2S\n",
+ "print '(2)Feed rate of SO2- %.1f lb mol'%F_SO2\n",
+ "print '(3)Fractional conversion of limiting reagent- %.2f '%f_cn"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 \n",
+ " Extent of reaction is 52.1 g moles reacting \n",
+ "(1)Feed rate of H2S- 114.6 lb mol\n",
+ "(2)Feed rate of SO2- 83.3 lb mol\n",
+ "(3)Fractional conversion of limiting reagent- 0.91 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.3 Page no. 270\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Material Balances for Process in which two Simultaneous Reactions Occur\n",
+ "\n",
+ "# Variables \n",
+ "F = 1 #CH3OH -[gmol]\n",
+ "f_cn = 90. #[%]\n",
+ "vi_CH3OH = -1. #coefficint of CH3OH\n",
+ "\n",
+ "# Calculation and Result\n",
+ "ex_r1 = (-90./100)/vi_CH3OH # Extent of reaction based on CH3OH \n",
+ "print ' Extent of reaction 1 is %.2f g moles reacting '%ex_r1\n",
+ "\n",
+ "yld = 75. #[%]\n",
+ "ex_r2 = ex_r1-(F*(yld/100.0));\n",
+ "print ' Extent of reaction 2 is %.2f g moles reacting '%ex_r2\n",
+ "\n",
+ "f_O2 = 0.21 # mol. fraction of O2\n",
+ "f_N2 = 0.79 # mol. fraction of N2\n",
+ "n_O2 = 2*((1/2.0)*F) # entering oxygen -[g mol]\n",
+ "air = n_O2/f_O2 # Amount of air entering\n",
+ "n_N2 = air-n_O2 # entering nitrogen -[g mol]\n",
+ "\n",
+ "n_un = 11. # Number of unknowns in the given problem\n",
+ "n_ie = 11. # Number of independent equations\n",
+ "d_o_f = n_un-n_ie # Number of degree of freedom\n",
+ "print ' Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "v1_CH3OH = -1 #coefficint of CH3OH\n",
+ "v1_O2 = -1./2 #coefficint of O2\n",
+ "v1_CH2O = 1 ; #coefficint of CH2O\n",
+ "v1_H2O = 1 ; #coefficint of H2O\n",
+ "v1_CO = 0 ; #coefficient of CO\n",
+ "\n",
+ "#Reaction 2\n",
+ "v2_O2 = -1./2 #coefficint of O2\n",
+ "v2_CH2O = -1 #coefficint of CH2O\n",
+ "v2_H2O = 1 ; #coefficint of H2O\n",
+ "v2_CO = 1 ; #coefficient of CO\n",
+ "P = F+air +(v1_CH3OH+v1_O2+v1_CH2O+v1_H2O)*ex_r1 +(v2_O2+v2_CH2O+v2_H2O+v2_CO)*ex_r2 ;# Product -[g mol]\n",
+ "\n",
+ "no_CH3OH = F+(v1_CH3OH*ex_r1)+0 ; # [g mol]\n",
+ "no_O2 = n_O2+(v1_O2*ex_r1)+v2_O2*ex_r2 ; # [g mol]\n",
+ "no_CH2O = 0 + v1_CH2O*ex_r1 +v2_CH2O*ex_r2 ; #[g mol]\n",
+ "no_CO = 0+v1_CO*ex_r1 +v2_CO*ex_r2 ; #[g mol]\n",
+ "no_H2O = 0+v1_H2O*ex_r1+v2_H2O*ex_r2 ; # [g mol]\n",
+ "no_N2 = n_N2-0-0 ; # [g mol]\n",
+ "\n",
+ "\n",
+ "y_CH3OH = (no_CH3OH/P )*100 ; # mole %\n",
+ "y_O2 = (no_O2/P)*100 ; # mole %\n",
+ "y_CH2O = (no_CH2O/P)*100 ; # mole %\n",
+ "y_CO = (no_CO/P)*100 ; # mole %\n",
+ "y_H2O = (no_H2O/P)*100 ; # mole % \n",
+ "y_N2 = (no_N2/P )*100; # mole %\n",
+ "\n",
+ "print 'Composition of product'\n",
+ "print 'Component mole percent'\n",
+ "print ' CH3OH %.1f %%'%y_CH3OH\n",
+ "print ' O2 %.1f %%'%y_O2\n",
+ "print ' CH2O %.1f %%'%y_CH2O\n",
+ "print ' CO %.1f %%'%y_CO\n",
+ "print ' H2O %.1f %%'%y_H2O\n",
+ "print ' N2 %.1f %%'%y_N2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Extent of reaction 1 is 0.90 g moles reacting \n",
+ " Extent of reaction 2 is 0.15 g moles reacting \n",
+ " Number of degree of freedom for the given system is 0 \n",
+ "Composition of product\n",
+ "Component mole percent\n",
+ " CH3OH 1.6 %\n",
+ " O2 7.6 %\n",
+ " CH2O 11.9 %\n",
+ " CO 2.4 %\n",
+ " H2O 16.7 %\n",
+ " N2 59.8 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.4 Page no. 273\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Analysis of Bioreactor\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables \n",
+ "F = 4000. ; #[kg]\n",
+ "m_H2O = 18.02 ; # molecular masss of water\n",
+ "m_C6H12O6 = 180.1 ; # molecular mass of glucose\n",
+ "m_CO2 = 44. ; #molecular mass of CO2\n",
+ "m_C2H3CO2H = 72.03 ; # molecular mass of C2H3CO2H\n",
+ "m_C2H5OH = 46.05 ; # molecular mass of ethanol\n",
+ "\n",
+ "p_H2O = 88. ; # [%]\n",
+ "p_C6H12O6 = 12.; # [%] \n",
+ "\n",
+ "# Calculation & Result\n",
+ "ni_H2O = (F*p_H2O/100.)/m_H2O ; # initial moles of water\n",
+ "ni_C6H12O6 = (F*(p_C6H12O6/100.))/m_C6H12O6 ; # initial moles of glucose\n",
+ "\n",
+ "n_un = 9. \n",
+ "n_ie = 9. \n",
+ "d_o_f = n_un-n_ie\n",
+ "print 'Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "ur_C6H12O6 = 90. ; #[kg]\n",
+ "pr_CO2 = 120. ; #[kg]\n",
+ "nf_C6H12O6 = ur_C6H12O6/m_C6H12O6 ; # [kmoles]\n",
+ "nf_CO2 = pr_CO2/m_CO2 ; # [kmoles]\n",
+ "\n",
+ "\n",
+ "a = matrix([[-1,-1],[2,0]]); # matrix formed by coefficients of unknowns \n",
+ "b = matrix([[(nf_C6H12O6-ni_C6H12O6)],[nf_CO2]]); #matrix formed by constant\n",
+ "x = a**(-1)*b; #matrix formed by solution\n",
+ " \n",
+ "print ' Extent of reaction 1 is %.3f kg moles reacting '%x[0]\n",
+ "print ' Extent of reaction 2 is %.3f kg moles reacting '%x[1]\n",
+ "\n",
+ "nf_H2O = ni_H2O+0*x[0] +2*x[1]; \n",
+ "nf_C2H5OH = 0+2*x[0]+0*x[1];\n",
+ "nf_C2H3CO2H = 0+0*x[0]+2*x[1]\n",
+ "total_wt = m_H2O*nf_H2O + m_C6H12O6*nf_C6H12O6 + m_CO2*nf_CO2 + \\\n",
+ "m_C2H3CO2H*nf_C2H3CO2H + m_C2H5OH*nf_C2H5OH;\n",
+ "mp_C2H5OH = (m_C2H5OH*nf_C2H5OH*100)/total_wt \n",
+ "mp_C2H3CO2H = (m_C2H3CO2H*nf_C2H3CO2H*100)/total_wt\n",
+ "\n",
+ "print ' Mass percent of ethanol in broth at end of fermentation process is %.1f %%'%mp_C2H5OH\n",
+ "print ' Mass percent of propenoic acid in broth at end of fermentation process is %.1f %%'%mp_C2H3CO2H"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 \n",
+ " Extent of reaction 1 is 1.364 kg moles reacting \n",
+ " Extent of reaction 2 is 0.802 kg moles reacting \n",
+ " Mass percent of ethanol in broth at end of fermentation process is 3.1 %\n",
+ " Mass percent of propenoic acid in broth at end of fermentation process is 2.9 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.5 Page no. 279\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Solution using Elemental Balances\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables \n",
+ "\n",
+ "print '(a)Solution of Example 10.1 using element balance'\n",
+ "F = 100 # feed to the reactor-[g mol]\n",
+ "\n",
+ "CH4 = 0.4*F ; # [g mol]\n",
+ "Cl2 = 0.5*F ; # [g mol]\n",
+ "N2 = 0.1*F #[g mol]\n",
+ "\n",
+ "n_un = 10 # Number of unknowns in the given problem(excluding extent of reaction)\n",
+ "n_ie = 10 ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie # Number of degree of freedom\n",
+ "print ' Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "nio_CH4 = CH4 ; #[g mol CH4]\n",
+ "vi_CH4 = -1; # coefficint of CH4\n",
+ "\n",
+ "# Calculation and Result\n",
+ "ex_CH4 = -(nio_CH4)/vi_CH4 ; # Max. extent of reaction based on CH4\n",
+ "\n",
+ "\n",
+ "nio_Cl2 = Cl2 #[g mol Cl2]\n",
+ "vi_Cl2 = -1 # coefficint of Cl2\n",
+ "ex_Cl2 = -(nio_Cl2)/vi_Cl2 # Max. extent of reaction based on Cl2\n",
+ "\n",
+ "if (ex_Cl2 > ex_CH4 ): \n",
+ " print ' CH4 is limiting reactant '\n",
+ "else:\n",
+ " print ' (b) Cl2 is limiting reactant '\n",
+ "\n",
+ "cn_CH4 = 67.0/100 # percentage conversion of CH4(limiting reagent)\n",
+ "no_CH4 = CH4-(cn_CH4*CH4) ; #CH4 in product -[g mol]\n",
+ "\n",
+ "no_N2 = N2 #N2 in product -[g mol]\n",
+ "\n",
+ "C = CH4 ; #moles of CH4 = moles of C (by molecular formula)\n",
+ "H = 4*CH4 ; # moles of H = 4*moles of CH4 (by molecular formula)\n",
+ "Cl = 2*Cl2 ; # moles of Cl = 2* moles of Cl2 (by molecular formula)\n",
+ "\n",
+ "a = matrix([[0,0,1],[0,1,3],[2,1,1]]) # matrix formed by coefficients of unknowns \n",
+ "b = matrix([[C-no_CH4*1],[H-4*no_CH4],[Cl]]) ; #matrix formed by constant\n",
+ "x = a**(-1)*b ; # matrix of solution\n",
+ "\n",
+ "print 'Composition of product stream in %% g mol of products'\n",
+ "print 'Product Percentage g mol'\n",
+ "print 'CH4 %.1f%% g mol'%no_CH4\n",
+ "print 'Cl2 %.1f%% g mol'%x[0]\n",
+ "print 'CH3Cl %.1f%% g mol'%x[2]\n",
+ "print 'HCl %.1f%% g mol'%x[1]\n",
+ "print 'N2 %.1f%% g mol'%no_N2\n",
+ "\n",
+ "#(b)Solution of Example 10.3 using element balance\n",
+ "print '______________________________________________________________________________'\n",
+ "print '(b)Solution of Example 10.3 using element balance'\n",
+ "\n",
+ "F = 1 #CH3OH -[gmol]\n",
+ "yld = 75 #[%]\n",
+ "cnv = 90 ; #conversion of methanol-[%]\n",
+ "\n",
+ "f_O2 = 0.21 ; # mol. fraction of O2\n",
+ "f_N2 = 0.79 ; # mol. fraction of N2\n",
+ "n_O2 = 2*((1/2.0)*F) # entering oxygen -[g mol]\n",
+ "air = n_O2/f_O2 ; # Amount of air entering\n",
+ "n_N2 = air-n_O2 # entering nitrogen -[g mol]\n",
+ "\n",
+ "n_un = 9 # Number of unknowns in the given problem(excluding extent of reactions)\n",
+ "n_ie = 9 ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie # Number of degree of freedom\n",
+ "\n",
+ "print ' Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "no_N2 = n_N2 # inert ,terefore input = output\n",
+ "C = 1*F #moles of C = moles of CH3OH (by molecular formula)\n",
+ "H = 4*F ; #moles of H = 4*moles of CH3OH (by molecular formula)\n",
+ "O = 1*F +2*n_O2; # moles of O = 1*moles of CH3OH + O in air\n",
+ "no_CH2O = yld/100.0 #[g mol]\n",
+ "no_CH3OH = F-((cnv/100.0)*F) # [g mol]\n",
+ "\n",
+ "a = matrix([[0,0,1],[0,2,0],[2,1,1]]) # matrix formed by coefficients of unknowns \n",
+ "b = matrix([[(C-(no_CH3OH*1+no_CH2O*1))],[(H-(4*no_CH3OH+2*no_CH2O))],[(O-(no_CH3OH*1+no_CH2O*1))]]);\n",
+ "a = a.I\n",
+ "x = a * b ; # matrix of solution\n",
+ "\n",
+ "P = no_CH2O+no_CH3OH+no_N2+x[0]+x[1]+x[2];\n",
+ "\n",
+ "# Composition of product\n",
+ "y_CH3OH = (no_CH3OH/P )*100; # mole %\n",
+ "y_O2 = ((x[0])/P)*100; # mole %\n",
+ "y_CH2O = (no_CH2O/P)*100 ; # mole %\n",
+ "y_CO = (x[2]/P)*100 ; # mole %\n",
+ "y_H2O = (x[1]/P)*100 ; # mole % \n",
+ "y_N2 = (no_N2/P )*100; # mole %\n",
+ "\n",
+ "\n",
+ "print 'Composition of product'\n",
+ "print 'Component mole percent'\n",
+ "print ' CH3OH %.1f %%'%y_CH3OH\n",
+ "print ' O2 %.1f %%'%y_O2\n",
+ "print ' CH2O %.1f %%'%y_CH2O\n",
+ "print ' CO %.1f %%'%y_CO\n",
+ "print ' H2O %.1f %%'%y_H2O\n",
+ "print ' N2 %.1f %%'%y_N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Solution of Example 10.1 using element balance\n",
+ " Number of degree of freedom for the given system is 0 \n",
+ " CH4 is limiting reactant \n",
+ "Composition of product stream in %% g mol of products\n",
+ "Product Percentage g mol\n",
+ "CH4 13.2% g mol\n",
+ "Cl2 23.2% g mol\n",
+ "CH3Cl 26.8% g mol\n",
+ "HCl 26.8% g mol\n",
+ "N2 10.0% g mol\n",
+ "______________________________________________________________________________\n",
+ "(b)Solution of Example 10.3 using element balance\n",
+ " Number of degree of freedom for the given system is 0 \n",
+ "Composition of product\n",
+ "Component mole percent\n",
+ " CH3OH 1.6 %\n",
+ " O2 7.6 %\n",
+ " CH2O 11.9 %\n",
+ " CO 2.4 %\n",
+ " H2O 16.7 %\n",
+ " N2 59.8 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.6 Page no. 281\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Use of Elemental Balance to Solve a Hydrocracking Problem\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables \n",
+ "P=100. ; #Product from the reactor-[g mol]\n",
+ "C3H8 = 0.195*P ; # [g mol]\n",
+ "C4H10 = 0.594*P ; # [g mol]\n",
+ "C5H12 = 0.211*P; # [g mol]\n",
+ "\n",
+ "n_un = 3 ; # Number of unknowns in the given problem(excluding extent of reaction)\n",
+ "n_ie = 3 ; # Number of independent equations\n",
+ "\n",
+ "# Calculation and Result\n",
+ "d_o_f = n_un-n_ie ; # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "C = C3H8*3+C4H10*4+C5H12*5 # moles of C on product side\n",
+ "H = C3H8*8+C4H10*10+C5H12*12 ; # moles of H on product side\n",
+ "\n",
+ "a = matrix([[8,0],[18,2]]) # matrix formed by coefficients of unknowns \n",
+ "b = matrix([[C],[H]]) ; #matrix formed by constant\n",
+ "a = a.I\n",
+ "x = a*b ; # matrix of solution\n",
+ "\n",
+ "R = x[1]/x[0] ; # Ratio of H2 consumed to C8H18 reacted = G/F\n",
+ "print ' Molar ratio of H2 consumed to C8H18 reacted is %.3f '%R"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 \n",
+ " Molar ratio of H2 consumed to C8H18 reacted is 0.992 \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.7 Page no. 286\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Excesss Air\n",
+ "\n",
+ "# Variables \n",
+ "C3H8 = 20 #C3H8 burned in a test-[kg]\n",
+ "m_C3H8 = 44.09 # mol. wt . of 1 kmol C3H8\n",
+ "cf_O2 = 5 # coefficient of O2 in given reaction\n",
+ "air = 400 # Air given -[kg]\n",
+ "m_air = 29.0 # molecular wt. of 1kmol air-[kg]\n",
+ "O2p = 21 # percentage of O2 in air-[%]\n",
+ "p_CO2 = 44 # CO2 produced -[kg]\n",
+ "p_CO = 12 # CO produced -[kg]\n",
+ "\n",
+ "# Calculation \n",
+ "O2 = (air*O2p/100.0)/(m_air) # amount of entering O2-[k mol]\n",
+ "rqO2 = (C3H8*cf_O2)/(m_C3H8) # Required O2 for given reaction\n",
+ "ex_air = ((O2-rqO2)*100.0)/rqO2 ; # Excess air percent-[%]\n",
+ "\n",
+ "# Result\n",
+ "print 'Excess air percent is %.0f %%.'%ex_air"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Excess air percent is 28 %.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.8 Page no. 287\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# A Fuel Cell to generate Electricity from Methane\n",
+ "\n",
+ "# Variables\n",
+ "F = 16. # feed of CH4 -[kg]\n",
+ "CH4p = 100. #[%]\n",
+ "m_CH4 = 16. ; # mass of kmol of CH4-[kg]\n",
+ "mol_CH4 = (F*CH4p/100)/m_CH4 #k moles of CH4 in feed-[kmol]\n",
+ "air = 300. ; # Air given -[kg]\n",
+ "m_air = 29. # molecular wt. of 1kmol air-[kg]\n",
+ "mol_air = air/m_air ; # kmoles of air-[kmol]\n",
+ "O2p = 21. # percentage of O2 in air-[%]\n",
+ "O2 = (mol_air*O2p/100) # amount of entering O2-[k mol]\n",
+ "N2 = mol_air-O2 ; # amount of entering N2-[k mol]\n",
+ "\n",
+ "n_un = 8. # Number of unknowns in the given problem(excluding extent of reactions)\n",
+ "n_ie = 8. # Number of independent equations\n",
+ "d_o_f = n_un-n_ie # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "# Product composition analysis using element balance of C,H,O and N\n",
+ "p_N2 = N2 # inert \n",
+ "C_in = 1*mol_CH4 ; # kmoles of carbon in input-[kmol]\n",
+ "H_in = 4*mol_CH4 # kmoles of hydrogen in input-[kmol]\n",
+ "O_in = 2*O2 ; # kmoles of oxygen in input-[kmol]\n",
+ "p_CO2 = C_in/1 ; #kmoles of CO2 in product obtained by carbon balance-[kmol]\n",
+ "p_H2O = H_in/2 ; #kmoles of H2O in product obtained by hydrogen balance-[kmol]\n",
+ "p_O2 = (O_in-(2*p_CO2+p_H2O))/2 #kmoles of O2 in product obtained by oxygen balance-[kmol]\n",
+ "p_CH4 = 0 # Complete reaction occurs\n",
+ "P = p_CH4 + p_N2+ p_CO2 + p_H2O + p_O2;\n",
+ "\n",
+ "y_N2 = p_N2*100/P ; #[mol %]\n",
+ "y_CO2 = p_CO2*100/P ; #[mol %]\n",
+ "y_H2O = p_H2O*100/P ; #[mol %]\n",
+ "y_O2 = p_O2*100/P ; #[mol %]\n",
+ "y_CH4 = p_CH4*100/P ; #[mol %]\n",
+ "\n",
+ "# Results\n",
+ "print 'Composition of product'\n",
+ "print 'Component mole percent'\n",
+ "print ' CH4 %.1f %%'%y_CH4\n",
+ "print ' O2 %.1f %%'%y_O2\n",
+ "print ' CO2 %.1f %%'%y_CO2\n",
+ "print ' H2O %.1f %%'%y_H2O\n",
+ "print ' N2 %.1f %%'%y_N2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 \n",
+ "Composition of product\n",
+ "Component mole percent\n",
+ " CH4 0.0 %\n",
+ " O2 1.5 %\n",
+ " CO2 8.8 %\n",
+ " H2O 17.6 %\n",
+ " N2 72.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.9 Page no. 290\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Combustion of Coal\n",
+ "\n",
+ "# Variables\n",
+ "F = 100. # feed of coal -[lb]\n",
+ "C = 83.05 #[%]\n",
+ "H = 4.45 #[%]\n",
+ "O = 3.36 ; # [%]\n",
+ "N = 1.08 # [%]\n",
+ "S = 0.70 #[%]\n",
+ "ash = 7.36 #[%]\n",
+ "H2O = 3.9 ; #[%]\n",
+ "w_C = 12. ; # mol. wt. of C\n",
+ "w_H = 1.008; #mol. wt. of H\n",
+ "w_O = 16. ; # mol. wt. of O\n",
+ "w_N = 14. ; # mol. wt. of N\n",
+ "w_S = 32. ; #mol. wt. of S\n",
+ "\n",
+ "CO2 = 15.4 #[%]\n",
+ "CO = 0.0 #[%]\n",
+ "O2 = 4.0 ; # [%]\n",
+ "N2 = 80.6 #[%]\n",
+ "ash_R = 86 #[%]\n",
+ "odr = 14 #[%]\n",
+ "\n",
+ "H2O_air = .0048 # [lb H2O/lb dry air]\n",
+ "m_air = 29. # mol. wt. of air\n",
+ "mf_O2 = 0.21 # mole fraction of O2 in air\n",
+ "mf_N2 = 0.79 #mole fraction of N2 in air\n",
+ "m_H2O = 18. # mol. wt. of H2O\n",
+ "\n",
+ "#Calculations\n",
+ "H_cl = (H2O*2)/m_H2O ; # lb mol of H in coal moisture\n",
+ "O_cl = H_cl/2. ; # lb mol of O in coal moisture\n",
+ "\n",
+ "H_air = (H2O_air*m_air )/m_H2O # lb mol of H per lb mol air\n",
+ "O_air = H_air/2. # lb mol of O per lb mol air \n",
+ "\n",
+ "# Ash balance to get refuse(R)\n",
+ "R = ash/(ash_R/100.) # Refuse-[lb]\n",
+ "\n",
+ "pub_cl = 14. # percentage of unburned coal in refuse-[%]\n",
+ "ub_cl = (14/100.)*R # amount of unburned coal in refuse\n",
+ "C_p = (C/(100-ash))*ub_cl # C in unburned coal-[lb]\n",
+ "H_p = (H/(100-ash))*ub_cl ; # H in unburned coal-[lb]\n",
+ "O_p = (O/(100-ash))*ub_cl ; # O in unburned coal-[lb]\n",
+ "N_p = (N/(100-ash))*ub_cl ; # N in unburned coal-[lb]\n",
+ "S_p = (S/(100-ash))*ub_cl ; # S in unburned coal-[lb]\n",
+ "mol_C = C_p/w_C; # lb mol of C\n",
+ "mol_H = H_p/w_H ; # lb mol of H\n",
+ "mol_N = N_p/w_N ; # lb mol of N\n",
+ "mol_O = O_p/w_O ; # lb mol of O\n",
+ "mol_S = S_p/w_S ; # lb mol of S \n",
+ "\n",
+ "\n",
+ "n_un = 4. # Number of unknowns in the given problem(excluding extent of reactions)\n",
+ "n_ie = 4. # Number of independent equations\n",
+ "d_o_f = n_un-n_ie # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i '%d_o_f\n",
+ "\n",
+ "#Using element balance of C+S, N& H\n",
+ "P = (C/w_C + S/w_S - (mol_C+mol_S ))/.154 # mol of stack gas-[lb mol]\n",
+ "A = (2*P*.806 +2*mol_N-N/w_N)/(2*mf_N2) # mol of air -[lb mol]\n",
+ "W = (H/w_H +H_cl+H_air*A-mol_H)/2 # moles of exit water-[lb mol]\n",
+ "print ' Moles of stack gas(P) - %.1f lb mol'%P\n",
+ "print ' Moles of air (A) - %.1f lb mol '%A\n",
+ "print ' Moles of exit water(W) - %.1f lb mol '%W\n",
+ "\n",
+ "C_req = (C/w_C)/1\n",
+ "H_req = (H/w_H)/4 \n",
+ "N_req = 0 # inert\n",
+ "O_req = (O/w_O)/2 \n",
+ "S_req = (S/w_S)/1 \n",
+ "total_O2_req = C_req+H_req+N_req+O_req +S_req \n",
+ "O2_in = A*mf_O2 # O2 entering in air\n",
+ "ex_air = 100*((O2_in-total_O2_req)/total_O2_req)\n",
+ "\n",
+ "# Results\n",
+ "print ' Excess air is %.1f %%.'%ex_air"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 \n",
+ " Moles of stack gas(P) - 44.5 lb mol\n",
+ " Moles of air (A) - 45.4 lb mol \n",
+ " Moles of exit water(W) - 2.6 lb mol \n",
+ " Excess air is 16.8 %.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch11.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch11.ipynb
new file mode 100644
index 00000000..9592fff3
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch11.ipynb
@@ -0,0 +1,498 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : Material Balance Problems involving Multiple Units"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.1 Page no. 311\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the Number of Independent Material Balance in a process with Multiple Units\n",
+ "\n",
+ "# Variables \n",
+ "\n",
+ "w_A1 = 1 #concentration of A in 1\n",
+ "w_B2 = 1 # concentration of B in 2\n",
+ "w_A3 = 0.8 # concentration of A in 3\n",
+ "w_B3 = 0.2 # concentration of B in 3\n",
+ "w_C4 = 1 # concentration of C in 4\n",
+ "w_A5 = 0.571 #concentration of A in 5\n",
+ "w_B5 = 0.143 #concentration of B in 5\n",
+ "w_C5 = 0.286 #concentration of C in 5\n",
+ "w_D6 = 1 # concentration of D in 6\n",
+ "w_A7 = 0.714 # concentration of A in 7\n",
+ "w_B7 = 0.286 # concentration of B in 7\n",
+ "w_B8 = 0.333 #concentration of B in 8\n",
+ "w_C8 = .667 #concentration of C in 8\n",
+ "\n",
+ "us1 = 2 # Species involved in unit 1\n",
+ "us2 = 3 ; # Species involved in unit 2\n",
+ "us3 = 4 ; # Species involved in unit 3\n",
+ "\n",
+ "# Caculations \n",
+ "total_sp = us1+us2+us3 # Total species in system\n",
+ "\n",
+ "# Results\n",
+ "print 'Number of possible equations are 9, they are as follows- '\n",
+ "print ' Subsystem 1'\n",
+ "print ' A: F1*w_A1+F2*0 = F3*w_A3 (a)'\n",
+ "print ' B:F1*0 + F2*w_B2 = F3*w_B3 (b)'\n",
+ "print ' Subsystem 2'\n",
+ "print ' A: F3*w_A3+F4*0 = F5*w_A5 (c)'\n",
+ "print ' B:F3*w_B3 + F4*0 = F5*w_B5 (d)'\n",
+ "print ' C: F3*0+F4*w_C4 = F5*w_C5 (e)'\n",
+ "print ' Subsystem 3'\n",
+ "print ' A: F5*w_A5+F6*0 = F7*w_A7+F8*0 (f)'\n",
+ "print ' B:F5*w_B5 + F6*0 = F7*0+F8*w_B8 (g)'\n",
+ "print ' C: F5*w_C5+F6*0 = F7*0+F8*w_C8 (h)'\n",
+ "print ' D:F5*w_C5+F6*0 = F7*0+F8*w_C8 (i)'\n",
+ "print ' The above equations do not form a unique set'\n",
+ "\n",
+ "# By inspection we can see that only 7 equations are independent \n",
+ "#Independent Equations are: \n",
+ "# Subsystem 1\n",
+ "#A: F1*w_A1+F2*0 = F3*w_A3 (a)\n",
+ "#B:F1*0 + F2*w_B2 = F3*w_B3 (b)\n",
+ "#Subsystem 2\n",
+ "#A: F3*w_A3+F4*0 = F5*w_A5 (c)\n",
+ "# C: F3*0+F4*w_C4 = F5*w_C5 (e)\n",
+ "# Subsystem 3\n",
+ "#A: F5*w_A5+F6*0 = F7*w_A7+F8*0 (f)\n",
+ "#B:F5*w_B5 + F6*0 = F7*0+F8*w_B8 (g)\n",
+ "#D:F5*w_C5+F6*0 = F7*0+F8*w_C8 (i)\n",
+ "\n",
+ "print ' Number of independent equations are 7 '"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of possible equations are 9, they are as follows- \n",
+ " Subsystem 1\n",
+ " A: F1*w_A1+F2*0 = F3*w_A3 (a)\n",
+ " B:F1*0 + F2*w_B2 = F3*w_B3 (b)\n",
+ " Subsystem 2\n",
+ " A: F3*w_A3+F4*0 = F5*w_A5 (c)\n",
+ " B:F3*w_B3 + F4*0 = F5*w_B5 (d)\n",
+ " C: F3*0+F4*w_C4 = F5*w_C5 (e)\n",
+ " Subsystem 3\n",
+ " A: F5*w_A5+F6*0 = F7*w_A7+F8*0 (f)\n",
+ " B:F5*w_B5 + F6*0 = F7*0+F8*w_B8 (g)\n",
+ " C: F5*w_C5+F6*0 = F7*0+F8*w_C8 (h)\n",
+ " D:F5*w_C5+F6*0 = F7*0+F8*w_C8 (i)\n",
+ " The above equations do not form a unique set\n",
+ " Number of independent equations are 7 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.2 Page no.315\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Material Balances for Multiple Units in which no Reaction occurs\n",
+ "\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables \n",
+ "\n",
+ "G = 1400 #[kg]\n",
+ "n_un = 16 # Number of unknowns in the given problem(excluding extent of reactions)\n",
+ "n_ie = 16 ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie # Number of degree of freedom\n",
+ "\n",
+ "print 'For unit 1 number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "o1_air = 0.995 ; # Mass fraction of air at out of unit 1 in A\n",
+ "i1_air = 0.95 ; # Mass fraction air at in of unit 1 in G\n",
+ "i1_wtr = 0.02; # Mass fraction water at in of unit 1 in G\n",
+ "F1_wtr = 0.81 ; # Mass fraction of water at out of unit 1 in F\n",
+ "o1_wtr = 0.005 ; # Mass fraction of water at out of unit 1 in A\n",
+ "o2_wtr = 0.96 ; # Mass fraction of water at out of unit 2 in B\n",
+ "o3_wtr = 0.01; # Mass fraction of water at out of unit 3 in D\n",
+ "i1_act = 0.03 ; # Mass fraction of acetone at in of unit 1 in G\n",
+ "F1_act = 0.19 ; # Mass fraction of acetone at out of unit 1 in F\n",
+ "o3_act = 0.99 ; # Mass fraction of acetone at out of unit 3 in D\n",
+ "o2_act = 0.04 ; # Mass fraction of acetone at out of unit 2 in B\n",
+ "\n",
+ "# Calculations \n",
+ "A = G*i1_air/o1_air ; #air-[kg]\n",
+ "F = G*i1_act/F1_act ; #[kg]\n",
+ "W = (F*F1_wtr+A*o1_wtr-G*i1_wtr)/1 #Pure water in -[kg]\n",
+ "\n",
+ "n_un = 9 ; # Number of unknowns in the given problem(excluding extent of reactions)\n",
+ "n_ie = 9 ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie \n",
+ "\n",
+ "print ' For unit 2 and 3 number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "a = matrix([[o3_act, o2_act],[o3_wtr, o2_wtr]]);\n",
+ "b = matrix([[F*F1_act],[F*F1_wtr]])\n",
+ "a = a.I\n",
+ "x = a*b \n",
+ "\n",
+ "# Results\n",
+ "print ' W-Pure water in to unit 1 - %.2f kg/hr'%W\n",
+ "print ' A-Air out of unit 1 - %.2f kg/hr'%A\n",
+ "print ' F-out of unit 1 - %.2f kg/hr'%F\n",
+ "print ' B-out of unit 2 - %.2f kg/hr'%x[1]\n",
+ "print ' D-out of unit 3 - %.2f kg/hr'%x[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For unit 1 number of degree of freedom for the given system is 0 .\n",
+ " For unit 2 and 3 number of degree of freedom for the given system is 0 .\n",
+ " W-Pure water in to unit 1 - 157.74 kg/hr\n",
+ " A-Air out of unit 1 - 1336.68 kg/hr\n",
+ " F-out of unit 1 - 221.05 kg/hr\n",
+ " B-out of unit 2 - 186.15 kg/hr\n",
+ " D-out of unit 3 - 34.90 kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.3 Page no. 318\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Material Balance for problems Involving Multiple units and Reactions\n",
+ "\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables \n",
+ "P = 6205. #[lb mol/hr]\n",
+ "amt_F = 560. ; #[bbl]\n",
+ "C_F = 0.50 ; # [mol fraction]\n",
+ "H2_F = 0.47 ; #[mol fraction]\n",
+ "S_F = 0.03 ; #[mol fraction]\n",
+ "\n",
+ "CH4_G = 0.96 ; #[mol fraction]\n",
+ "C2H2_G = 0.02 ; #[mol fraction]\n",
+ "CO2_G = 0.02 ; #[mol fraction]\n",
+ "\n",
+ "O2_A = 0.21 ; #[mol fraction]\n",
+ "N2_A = 0.79 ; #[mol fraction]\n",
+ "\n",
+ "# Analysis of air into Oil furnace(A1)\n",
+ "O2_A1 = 0.20 ; #[mol fraction]\n",
+ "N2_A1 = 0.76 ; #[mol fraction]\n",
+ "CO2_A1 = 0.04 ; #[mol fraction]\n",
+ "\n",
+ "#Stack gas(P) analysis\n",
+ "N2_P = .8493 ; #[mol fraction]\n",
+ "O2_P = .0413 ; #[mol fraction]\n",
+ "SO2_P = .0010 ; # [mol fraction]\n",
+ "CO2_P = .1084 ; #[mol fraction]\n",
+ "\n",
+ "# Degree of freedom analysis \n",
+ "n_un = 5; \n",
+ "n_ie = 5 ;\n",
+ "d_o_f = n_un-n_ie; # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "\n",
+ "# Calculations & Results\n",
+ "F = P* SO2_P/S_F ; # [lb mol/hr]\n",
+ "a = matrix([[2*CH4_G+C2H2_G, -1, 0, 0],[0, 0, N2_A, N2_A1],[CO2_G ,-.5, O2_A, O2_A1+CO2_A1], \n",
+ " [CH4_G+2*C2H2_G+CO2_G,0,0,CO2_A1]]);# matrix of coefficients\n",
+ "b = matrix([[-F*H2_F],[P*N2_P],[P*(O2_P+CO2_P+SO2_P)],[(P*CO2_P-F*C_F)]]); # matrix of constants\n",
+ "a = a.I\n",
+ "x = a*b \n",
+ "G = x[0]\n",
+ "m_F = 7.91\n",
+ "Fc = (F*m_F)/(7.578*42) # Fuel gas consumed -[bbl/hr]\n",
+ "time = amt_F/Fc ; # Time for which available fuel gas lasts-[hr]\n",
+ "\n",
+ " \n",
+ "print '(1) Fuel gas consumed(F) is %.2f bbl/hr .'%Fc\n",
+ "print '(2) Time for which available fuel gas lasts is %.0f hr .'%time\n",
+ "\n",
+ "# For increase in arsenic and mercury level\n",
+ "F_oil = Fc*42; #[gal/hr]\n",
+ "Em_ars2 = (3.96 *10**(-4))/1000.0 ; # [lb/gal]\n",
+ "Em_Hg2 = (5.92 *10**(-4))/1000.0 ; # [lb/gal]\n",
+ "ars_F = F_oil*Em_ars2 \n",
+ "Hg_F = F_oil*Em_Hg2 \n",
+ "G_gas = G*359 #[ft**3/hr]\n",
+ "Em_ars1 = (2.30 *10**(-4))/10**6 ; # [lb/ft**3]\n",
+ "Em_Hg1 = (1.34 *10**(-4))/10**6 ; # [lb/ft**3]\n",
+ "ars_G = G_gas*Em_ars1;\n",
+ "Hg_G = G_gas*Em_Hg1 ;\n",
+ "in_ars = ((ars_F-ars_G)/ars_G)*100 #[% increase in Arsenic emission]\n",
+ "in_Hg = ((Hg_F-Hg_G)/Hg_G)*100 #[% increase in Mercury emission]\n",
+ "\n",
+ "print '(3) Increase in Arsenic emission is %.1f %% .'%in_ars\n",
+ "print '(4) Increase in Mercury emission is %.1f %% .'%in_Hg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 .\n",
+ "(1) Fuel gas consumed(F) is 5.14 bbl/hr .\n",
+ "(2) Time for which available fuel gas lasts is 109 hr .\n",
+ "(3) Increase in Arsenic emission is 107.4 % .\n",
+ "(4) Increase in Mercury emission is 432.3 % .\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.4 Page no. 322\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Analysis of Sugar Recovery Process involving Multiple Serial Units\n",
+ "# Solution fig E11.4\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables \n",
+ "M = 1000. ; #[lb]\n",
+ "F_s = 16/100. # Fraction of sugar in F\n",
+ "F_w = 25/100. # Fraction of water in F\n",
+ "F_p = 59/100. # Fraction of pulp in F\n",
+ "D_p = 80/100. # Fraction of pulp in D\n",
+ "E_s = 13/100. # Fraction of sugar in E\n",
+ "E_p = 14/100. # Fraction of pulp in E\n",
+ "G_p = 95/100. # Fraction of pulp in G\n",
+ "H_s = 15/100. # Fraction of sugar in H\n",
+ "K_s = 40/100. # Fraction of sugar in K\n",
+ "\n",
+ "# Calculations \n",
+ "K_w = 1 - K_s\n",
+ "K = M/K_s;\n",
+ "L = K_w*K;\n",
+ "\n",
+ "# For evaporator equations are \n",
+ "H_w = 1- H_s\n",
+ "H = K_s*K/H_s\n",
+ "J = H - K; \n",
+ "\n",
+ "# For screen equations are \n",
+ "E_w = 1 - (E_p + E_s) \n",
+ "\n",
+ "a1 = matrix([[1,-1],[E_p,-G_p]])\n",
+ "b1 = matrix([[H,],[0,]]) \n",
+ "a1 = a1.I\n",
+ "x1 = a1*b1\n",
+ "E = x1[0] \n",
+ "G = x1[1] \n",
+ "G_s = (E_s*E - H_s *H )/G\n",
+ "G_w = 1 -(G_s + G_p) \n",
+ "\n",
+ "a2 = matrix([[1,-1],[F_p,-D_p]]) # Matrix of coefficients of unknown\n",
+ "\n",
+ "F = 7818.93 \n",
+ "D = 1152.2634 \n",
+ "\n",
+ "D_s = (F_s*F - E_s*E )/D # By sugar balance\n",
+ "D_w = 1 -(D_s + D_p) # summation of wt. fraction is 1\n",
+ "\n",
+ "S_rec = M/(F*F_s) ; # Fraction of sugar recovered \n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print 'Flow streams and their respective compositions.'\n",
+ "print ' M = %.0f lb '%M\n",
+ "print ' Sugar: %.2f '%1\n",
+ "\n",
+ "print ' L = %.0f lb '%L\n",
+ "print ' Water: %.2f'%1\n",
+ "\n",
+ "print ' K = %.0f lb '%K\n",
+ "print ' Sugar: %.2f'%K_s\n",
+ "print ' Water: %.2f'%K_w\n",
+ "\n",
+ "print ' J = %.0f lb '%J\n",
+ "print ' Water: %.2f '%1\n",
+ "\n",
+ "print ' H = %.0f lb '%H\n",
+ "print ' Sugar: %.2f'%H_s\n",
+ "print ' Water: %.2f'%H_w\n",
+ "\n",
+ "print ' G = %.0f lb '%G\n",
+ "print ' Sugar: %.3f'%G_s\n",
+ "print ' Water: %.3f'%G_w\n",
+ "print ' Pulp : %.2f'%G_p\n",
+ "\n",
+ "print ' E = %.0f lb '%E\n",
+ "print ' Sugar: %.2f'%E_s\n",
+ "print ' Water: %.2f'%E_w\n",
+ "print ' Pulp : %.2f'%E_p\n",
+ "\n",
+ "print ' D = %.0f lb '%D\n",
+ "print ' Sugar: %.3f'%D_s\n",
+ "print ' Water: %.3f'%D_w\n",
+ "print ' Pulp : %.2f'%D_p\n",
+ "\n",
+ "print ' F = %.0f lb '%F\n",
+ "print ' Sugar: %.2f'%F_s\n",
+ "print ' Water: %.2f'%F_w\n",
+ "print ' Pulp : %.2f'%F_p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flow streams and their respective compositions.\n",
+ " M = 1000 lb \n",
+ " Sugar: 1.00 \n",
+ " L = 1500 lb \n",
+ " Water: 1.00\n",
+ " K = 2500 lb \n",
+ " Sugar: 0.40\n",
+ " Water: 0.60\n",
+ " J = 4167 lb \n",
+ " Water: 1.00 \n",
+ " H = 6667 lb \n",
+ " Sugar: 0.15\n",
+ " Water: 0.85\n",
+ " G = 1152 lb \n",
+ " Sugar: 0.014\n",
+ " Water: 0.036\n",
+ " Pulp : 0.95\n",
+ " E = 7819 lb \n",
+ " Sugar: 0.13\n",
+ " Water: 0.73\n",
+ " Pulp : 0.14\n",
+ " D = 1152 lb \n",
+ " Sugar: 0.204\n",
+ " Water: -0.004\n",
+ " Pulp : 0.80\n",
+ " F = 7819 lb \n",
+ " Sugar: 0.16\n",
+ " Water: 0.25\n",
+ " Pulp : 0.59\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.5 Page no.324\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Production of a Hormone in connected Reactor\n",
+ "\n",
+ "# Variables \n",
+ "F = 15. #[L/hr]\n",
+ "cs_in = 10. #Nutrient conc. input vessel - [g nutrient/L substrate]\n",
+ "V1 = 100. ; # [L]\n",
+ "V2 = 50. ; #[L]\n",
+ "Yxs = 0.2 ; # [cells/g]\n",
+ "umax = 0.4 ; #[hr** - 1]\n",
+ "Ks = 2. ; #[g/L] - Monod constant\n",
+ "\n",
+ "# Calculations\n",
+ "u1 = F/V1 #[hr** - 1] #[hr** - 1]\n",
+ "cs_out = (Ks * u1/umax)/(1 - (u1/umax)) \n",
+ "\n",
+ "x_out = Yxs * (cs_in - cs_out) #[g cells / L substrate]\n",
+ "\n",
+ "u2 = F/V2;\n",
+ "cs_out1 = (Ks * u2/umax)/(1 - (u2/umax)) #Nutrient conc. output vessel - [g nutrient/L substrate]\n",
+ "x_out1 = Yxs * (cs_in - cs_out1) #[g cells / L substrate]\n",
+ "\n",
+ "x_out2 = 1.73 # From eqn. (e),(f) and (g) - [g cells / L substrate]\n",
+ "\n",
+ "# Results\n",
+ "print 'g cells/L from option 1 is %.2f.'%x_out\n",
+ "print 'g cells/L from option 2 is %.2f.'%x_out2\n",
+ "print 'By comparing option 1 and option 2 the respective answers are essentially the same.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "g cells/L from option 1 is 1.76.\n",
+ "g cells/L from option 2 is 1.73.\n",
+ "By comparing option 1 and option 2 the respective answers are essentially the same.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch12.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch12.ipynb
new file mode 100644
index 00000000..1d00a5b6
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch12.ipynb
@@ -0,0 +1,368 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : Recycle Bypass Purge and the Industrial Application of Material Balance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.1 Page No.349\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import matrix\n",
+ "\t\t\t\n",
+ "# Variables \n",
+ "F = 10000. ;\t\t\t#[lb/hr]\n",
+ "\t\t\t\n",
+ "NaOH_F = 40./100 ;\t \t\t#[wt. fraction]\n",
+ "NaOH_P1 = 95./100 ;\t \t\t#[wt. fraction of NaOH filter cake]\n",
+ "NaOH_P2 = (0.05 * 45)/100 ;\t\t\t#[wt. fraction of NaOH in NaOH soln.]\n",
+ "H2O_P2 = (0.05 * 55)/100 ;\t\t\t#[wt. fraction of H2O in NaOH soln.]\n",
+ "NaOH_R = 45./100;\t\t\t#[wt. fraction]\n",
+ "NaOH_G = 50./100;\t\t\t#[wt. fraction]\n",
+ "\t\t\t\n",
+ "P = (NaOH_F * F)/(NaOH_P1 + NaOH_P2) ;\t\t\t#[lb/hr]\n",
+ "\t\t\t\n",
+ "W = F-P ;\t\t\t# [lb/hr]\n",
+ "\n",
+ "# Calculations & Results\t\n",
+ "a = matrix([[NaOH_G,-NaOH_R],[1,-1]]) \t\t\t# matrix formed of coefficients of unknown\n",
+ "b = matrix([[F*NaOH_F],[P]]);\t\t\t# matrix formed by constant\n",
+ "a = a.I\n",
+ "x = a*b ;\t\t\t# matrix of solutions . x(1) = G, x(2) = R\n",
+ "G = x[0] ;\t\t\t# [lb/hr]\n",
+ "R = x[1] ;\t\t\t# [lb/hr]\n",
+ " \n",
+ "print '(a) Flow rate of water removed by evaporator is %.1f lb/hr'%W\n",
+ "print 'The recycle rate of the process is %.1f lb/hr'%R\n",
+ "\n",
+ "\t\t\t\n",
+ "NaOH_H = 45./100 ;\t\t\t#[wt fraction]\n",
+ "H2O_H = 55./100 ;\t\t\t#[wt fraction]\n",
+ "\n",
+ "a1 = matrix([[NaOH_G,-NaOH_H],[NaOH_G,-H2O_H]]) ;\t\t\t# matrix formed of coefficients of unknown\n",
+ "b1 = matrix([[((NaOH_P1+NaOH_P2)* P)],[(H2O_P2) * P]]);\t\t\t# matrix formed by constant\n",
+ "x1 = a1**-1\n",
+ "x1 = x1*b1 ;\t\t\t# matrix of solutions nw_G = x1(1);H = x1(2)\n",
+ "nw_G1 = x1[0] ;\t\t\t# [lb/hr]\n",
+ "H = x1[1];\t\t\t# [lb/hr]\n",
+ "\n",
+ "nw_F = (NaOH_H * H + (NaOH_P1 + NaOH_P2) * P)/NaOH_F ;\t\t\t#[lb/hr]\n",
+ "print ' (b) Total feed rate when filterate is not recycled is %.1f lb/hr'%nw_F\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Flow rate of water removed by evaporator is 5886.9 lb/hr\n",
+ "The recycle rate of the process is 38868.9 lb/hr\n",
+ " (b) Total feed rate when filterate is not recycled is 53727.5 lb/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.2 Page No.357\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F_Bz = 100. ;\t\t\t# Fresh benzene feed / basis - [mol]\n",
+ "con_Bz = .95 ;\t\t\t# Fraction of conversion of benzene\n",
+ "sp_con = .20 ;\t\t\t# Fraction of single pass conversion\n",
+ "ex_H2 = .20 ;\t\t\t# Fraction of exces H2 used in fresh feed\n",
+ "R_Bz = 22.74 ;\t\t\t# Benzene in Recycle stream - [mol %]\n",
+ "R_H2 = 78.26 ;\t\t\t# H2 in Recycle stream - [mol %]\n",
+ "TLV_Bz = 0.5 ;\t\t\t# TLV value of benzene -[ppm]\n",
+ "TLV_C6H12 = 300. ;\t\t\t# TLV value of cyclohexane -[ppm]\n",
+ "TLV_H2 = 1000. ;\t\t\t# TLV value of H2 -[ppm]\n",
+ "\n",
+ "# Calculations\n",
+ "F_H2 = F_Bz*3*(1+ex_H2) ;\t\t\t# H2 in Feed - [mol]\n",
+ "F = F_Bz + F_H2 ;\t\t\t# Total feed - [mol] \n",
+ "\n",
+ "ex_r = con_Bz*F_Bz/(-(-1)) ;\t\t\t# Extent of reaction\n",
+ "\n",
+ "P_Bz = F_Bz -1*(ex_r) ;\t\t\t# Benzene in P ,by benzene balance - [mol]\n",
+ "P_H2 = F_H2 + -3*(ex_r) ;\t\t\t# H2 in P ,by H2 balance - [mol]\n",
+ "P_C6H12 = 0 + 1*(ex_r) ;\t\t\t# Cyclohexane in P ,by cyclohexane balance - [mol]\n",
+ "P = P_Bz + P_H2 + P_C6H12 ;\t\t\t# Total Product - [ mol]\n",
+ "\n",
+ "R = ((-(-ex_r))/(sp_con) - F_Bz)/(R_Bz/100.) ;\t\t\t# Recycle stream - [mol]\n",
+ "R_by_F = R/F ;\t\t\t# Ratio of R to F \n",
+ "\n",
+ "TLV = (P_Bz/P)*(1/TLV_Bz) + (P_H2/P)*(1./TLV_H2) + (P_C6H12/P)*(1/TLV_C6H12) ;\t\t\t# TLV (environmental index) \n",
+ "\n",
+ "# Results\n",
+ "print 'Ratio of R to F is %.2f .'%R_by_F\n",
+ "print ' TLV (environmental index) is %.3f .'%TLV\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of R to F is 3.58 .\n",
+ " TLV (environmental index) is 0.059 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.3 Page No.359\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "RR = 8.33 ;\t\t\t# Recycle ratio\n",
+ "F = 100. ;\t\t\t# Overall feed/basis - [lb]\n",
+ "F_g = 0.40 ;\t\t\t# Fraction of glucose in overall feed \n",
+ "F_w = 0.60 ;\t\t\t# Fraction of water in overall feed \n",
+ "F_dash_f = 0.04 ; \t\t\t# Fraction of fructose in feed to reactor\n",
+ "P = F \t\t\t# By overall balance -[lb]\n",
+ "R = P/RR ;\t\t\t# Recycle stream - [lb]\n",
+ "P_w = (F_w * F)/ P ;\t\t\t# Fraction of water in product(P), by overall water balance\n",
+ "R_w = P_w ;\t\t\t#Fraction of water in recycle (R), since both R and P has same composition\n",
+ "\n",
+ "# Calculations\t\t\n",
+ "F_dash = F +R ;\t\t\t# Feed to reactor ,by total balance -[lb]\n",
+ "R_f = (F_dash*F_dash_f)/R ;\t\t\t# Fraction of fructose in recycle stream \n",
+ "R_g = 1 - (R_f + R_w) ;\t\t\t# Fraction of glucose in recycle stream\n",
+ "F_dash_g = (F*F_g + R*R_g)/F_dash ;\t\t\t# Fraction of glucose i feed to reactor\n",
+ "\n",
+ "f_con = ((F_dash*F_dash_g) - (R + P)*R_g)/(F_dash*F_dash_g) ;\t\t\t# Fraction of conversion of glucose in reactor\n",
+ "\n",
+ "# Results\n",
+ "print 'Fraction of conversion of glucose in reactor is %.2f .'%f_con\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fraction of conversion of glucose in reactor is 0.93 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.4 Page No.362\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F = 100. ;\t\t\t# Overall feed/basis - [kg]\n",
+ "F_com = 0.10 ;\t\t\t# Mass fraction of component in fresh feed \n",
+ "F_w = 0.90 ;\t\t\t# Mass fraction of water in fresh feed \n",
+ "P_w = 0.10 ;\t\t\t# Mass fraction of water in product\n",
+ "P_com = 0.90 ;\t\t\t#Mass fraction of component in product\n",
+ "F_dash_com = 0.03 ;\t\t\t#Mass fraction of component in feed to reactor\n",
+ "W_w = 1. ;\t\t\t# Mass fraction of water in W(waste)\n",
+ "C_con = .40 ;\t\t\t# Fraction of conversion of component in reactor\n",
+ "\n",
+ "# Calculations\n",
+ "P = F_com*F/P_com ;\t\t\t#By component balance- Product - [kg]\n",
+ "W = F - P ;\t\t\t# By overall balance - waste(W)- [kg]\n",
+ "\n",
+ "Rw = (F*F_com - F*F_com*C_con)/C_con ;\t\t\t# Mass of component in recycle(R) - [kg]\n",
+ "F_dash = ( F*F_com + Rw )/F_dash_com ;\t\t\t# By component balance - feed to reactor(F') -[kg]\n",
+ "R = F_dash - F ;\t\t\t # Recycle(R) - By total balance -[kg]\n",
+ "w = Rw/R ;\t\t\t # Mass fraction of component in recycle(R) \n",
+ "\n",
+ "# Results\n",
+ "print 'Recycle(R) stream- %.0f kg '%R\n",
+ "print ' Mass fraction of component in recycle(R)- %.4f .'%w\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Recycle(R) stream- 733 kg \n",
+ " Mass fraction of component in recycle(R)- 0.0205 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.5 Page No.367\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F = 100. \t\t\t# Overall feed/basis - [kg]\n",
+ "F_n_C5H12 = 0.80 ;\t\t\t# Fraction of n_C5H12 in overall feed \n",
+ "F_i_C5H12 = 0.20 ;\t\t\t# Fraction of i_C5H12in overall feed \n",
+ "S_i_C5H12 = 1. ;\t\t\t# Fraction of i_C5H12 in isopentane stream\n",
+ "P_n_C5H12 = .90 ;\t\t\t# Fraction of n_C5H12 in overall product\n",
+ "P_i_C5H12 = .10 ;\t\t\t# Fraction of i_C5H12 in overall product\n",
+ "\n",
+ "# Calculations\n",
+ "P = (F*F_n_C5H12)/P_n_C5H12 ;\t\t\t#Product Material Balance of n_C5H12 -[kg]\n",
+ "S = F - P ;\t\t\t# Isopentane stream (S) from overall material balance - [kg]\n",
+ "\n",
+ "from numpy import matrix\n",
+ "a = matrix([[1,-1],[F_n_C5H12,-1]]) ;\t\t\t# Matrix of coefficients of unknown \n",
+ "b = matrix([[S],[0]]) ;\t\t\t# Matrix of constants\n",
+ "a = a.I\n",
+ "x = a*b \t\t\t# Matrix of solutions, x(1) = x , x(2) = y\n",
+ "\n",
+ "xf = x[0]/F ;\t \t\t# Fraction of butane-free gas going to isopentane tower \n",
+ "\n",
+ "# Results\n",
+ "print 'Fraction of butane-free gas going to isopentane tower is %.3f .'%xf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fraction of butane-free gas going to isopentane tower is 0.556 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.6 Page No.369\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F = 100. ;\t\t\t# Overall feed/basis - [mole]\n",
+ "F_H2 = 0.673 ;\t\t\t# Mole fraction of H2 in overall feed \n",
+ "F_CO = 0.325 ;\t\t\t# Mole fraction of i_C5H12in overall feed \n",
+ "F_CH4 = .002 ;\t\t\t# Mole fraction of CH4 in overall feed \n",
+ "E_CH3OH = 1. ;\t\t\t# Mole fraction of CH3OH in Exit(E)\n",
+ "\t\n",
+ "z = .032 ;\n",
+ "CO_con = .18 ;\t\t\t# Fraction of conversion of CO in reactor\n",
+ "\n",
+ "# Calculations\n",
+ "#By using eqn.(c) and (d)\n",
+ "P = F_CH4*F/z ;\t\t\t# Purge stream - [mole]\n",
+ "\n",
+ "# Using eqn.(a) , (b) and (c)\n",
+ "x_plus_y = 1 - z ;\t\t\t# x + y \n",
+ "E = (F_H2*F + F_CO*F + 3*F_CH4*F - P*(x_plus_y + 3*z ))/3 ;\t\t\t# Exit stream - [mole]\n",
+ "\n",
+ "# By using eqn. (d)\n",
+ "y = ( F_CO*F - E )/P ;\t\t\t# Mole fraction of CO \n",
+ "\n",
+ "# By using eqn. (a)\n",
+ "x = 1 - z - y ;\t\t\t# Mole fraction of H2 \n",
+ "\n",
+ "# Lastly by using eqn.(e)\n",
+ "R = ( F_CO*F - P*y - F_CO*F*CO_con )/(y*CO_con) ;\t\t\t# Recycle steam - [mole]\n",
+ "\n",
+ "# Results\n",
+ "print 'Moles of recycle(R) per mole of feed(F) - %.4f '%(R/F)\n",
+ "print ' Moles of CH3OH(E) per mole of feed(F) - %.4f '%(E/F)\n",
+ "print ' Moles of Purge(P) per mole of feed(F) - %.4f '%(P/F);\n",
+ "print ' Composition of Purge '\n",
+ "print ' Component Mole fraction '\n",
+ "print ' H2 %.3f '%x\n",
+ "print ' CO %.3f '%y\n",
+ "print ' CH4 %.3f '%z\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Moles of recycle(R) per mole of feed(F) - 7.0556 \n",
+ " Moles of CH3OH(E) per mole of feed(F) - 0.3125 \n",
+ " Moles of Purge(P) per mole of feed(F) - 0.0625 \n",
+ " Composition of Purge \n",
+ " Component Mole fraction \n",
+ " H2 0.768 \n",
+ " CO 0.200 \n",
+ " CH4 0.032 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch13.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch13.ipynb
new file mode 100644
index 00000000..b72b411d
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch13.ipynb
@@ -0,0 +1,426 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Ideal Gases"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.1 Page No. 404\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "m_CO2 = 40. ;\t\t\t# Mass of CO2-[kg]\n",
+ "mol_wt_CO2 = 44. ;\t\t\t# Molecular mass of 1kmol CO2 -[kg]\n",
+ "mol_V = 22.42 ;\t\t\t# Molar of ideal gas at standard condition-[cubic metre/kg mol]\n",
+ "\n",
+ "# Calculations\n",
+ "V_CO2 = (m_CO2 * mol_V)/(mol_wt_CO2);\t\t\t# volume of CO2-[cubic metre]\n",
+ "\n",
+ "# Results\n",
+ "print 'Volume occupied by 40 kg CO2 at standard condition is %.1f cubic metre.'%V_CO2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume occupied by 40 kg CO2 at standard condition is 20.4 cubic metre.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.2 Page No. 405\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "p =1. ;\t\t\t# Pressure -[atm]\n",
+ "V = 22415. ;\t\t\t# Molar valume -[cubic centimetre/g mol]\n",
+ "T = 273.15 ;\t\t\t# Temperature-[K]\n",
+ "\n",
+ "# Calculations\n",
+ "R = (p*V/T);\t\t\t# Universal gas constant-[(cubic centimetre.atm)/(K.g mol)]\n",
+ "\n",
+ "# Results\n",
+ "print 'Universal gas constant is %.2f (cubic centimetre*atm)/(K*g mol). '%R\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Universal gas constant is 82.06 (cubic centimetre*atm)/(K*g mol). \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.3 Page No.406\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "m_CO2 = 88. ;\t\t\t# Mass of CO2-[lb]\n",
+ "mol_wt_CO2 = 44. ;\t\t# Molecular mass of 1 lb mol CO2 -[lb]\n",
+ "mol_V = 359. ; \t\t\t# Molar volume-[cubic feet]\n",
+ "\n",
+ "# State 1-standard condition\n",
+ "P1 = 33.91 ; \t\t\t# Pressure -[ft of water]\n",
+ "T1 = 273. ;\t\t\t# Temperature-[K]\n",
+ "\n",
+ "# State 2\n",
+ "P2 = 32.2 ;\t\t\t# Pressure -[ft of water]\n",
+ "Tc = 15. ;\t\t\t # Temperature-[degree C]\n",
+ "T2 = Tc+273 ;\t\t\t# Temperature-[K]\n",
+ "\n",
+ "# Calculations\n",
+ "V1 = (m_CO2 * mol_V) / (mol_wt_CO2);\n",
+ "V2 = (V1 * T2 * P1) / (T1 * P2);\n",
+ "\n",
+ "# Results\n",
+ "print 'The volume occupied 88 lb of CO2 at given condition is %.0f cubic feet.'%V2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volume occupied 88 lb of CO2 at given condition is 798 cubic feet.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.4 Page No. 408\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "mol_wt_N2 = 28. ;\t# Molecular mass of 1 kg mol N2 -[kg]\n",
+ "mol_V = 22.42 ;\t\t# Molar of ideal gas at standard condition-[cubic metre/kg mol]\n",
+ "Tc = 27. ;\t\t\t# Temperature-[degree C]\n",
+ "T = Tc + 273. ;\t\t#Temperature-[K]\n",
+ "P = 100. ;\t\t\t#Pressure-[kPa]\n",
+ "\t\t\t\n",
+ "Ps = 101.3 ;\t\t# Pressure -[kPa]\n",
+ "Ts = 273. ;\t\t\t#Temperature-[K]\n",
+ "\n",
+ "# Calculations\n",
+ "V = (T * Ps * mol_V)/(Ts * P) ;\t\t\t# Volume occupied by N2-[cubic metre]\n",
+ "D_N2 = mol_wt_N2/V ;\t\t\t # Density of N2 at given condition-[kg/cubic metre]\n",
+ "\n",
+ "# Results\n",
+ "print ' Density of N2 at given condition is %.3f kg/cubic metre.'%D_N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Density of N2 at given condition is 1.122 kg/cubic metre.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.5 Page No. 409 \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "mol_wt_N2 = 28. ;\t\t\t# Molecular mass of 1 lb mol N2 -[lb]\n",
+ "mol_wt_air = 29. ;\t\t\t# Molecular mass of 1 lb mol air -[lb]\n",
+ "mol_V = 359. ;\t\t\t # Molar volume of ideal gas-[cubic feet]\n",
+ "\t\n",
+ "Tf = 80. ;\t\t\t# Temperature-[degree F]\n",
+ "T = Tf + 460. ;\t\t#Temperature-[degree Rankine]\n",
+ "P = 745. ;\t\t\t#Pressure-[mm of Hg]\n",
+ "\n",
+ "Ps = 760. ;\t\t\t# Pressure -[mm of Hg]\n",
+ "Ts = 492. ;\t\t\t#Temperature-[degree Rankine]\n",
+ "\n",
+ "# Calculations\n",
+ "D_air = (Ts * P * mol_wt_air)/(T * Ps * mol_V) ;\t\t# Density of air at given condition-[lb/cubic feet]\n",
+ "D_N2 = (Ts * P * mol_wt_N2)/(T * Ps * mol_V) ;\t\t\t# Density of N2 at given condition-[lb/cubic feet]\n",
+ "sg_N2 = D_N2/D_air ;\t\t\t # Specific gravity of N2 compared to air at given condition \n",
+ "\n",
+ "# Results\n",
+ "print ' Specific gravity of N2 compared to air at given condition is %.3f .'%sg_N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Specific gravity of N2 compared to air at given condition is 0.966 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.6 Page No. 414\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F_gas = 1. ;\t\t\t # Flue gas [kg mol]\n",
+ "mf_CO2 = 14./100 ;\t\t\t# [mol fraction]\n",
+ "mf_O2 = 6./100 ;\t\t\t# [mol fraction]\n",
+ "mf_N2 = 80./100 ;\t\t\t# [mol fraction]\n",
+ "P = 765. ;\t\t\t #Pressure-[mm of Hg]\n",
+ "T = 400. ;\t\t\t # Temperature-[degree F]\n",
+ "\n",
+ "# Calculations\n",
+ "p_CO2 = P * mf_CO2 ;\t\t# Partial pressure of CO2-[mm of Hg]\n",
+ "p_O2 = P * mf_O2 ;\t\t\t# Partial pressure of O2-[mm of Hg]\n",
+ "p_N2 = P * mf_N2 ;\t\t\t# Partial pressure of N2-[mm of Hg]\n",
+ "\n",
+ "# Results\n",
+ "print ' Component pi(Partial pressure-[mm of Hg]) '\n",
+ "print ' CO2 %.1f mm of Hg '%p_CO2\n",
+ "print ' O2 %.1f mm of Hg '%p_O2\n",
+ "print ' N2 %.1f mm of Hg '%p_N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Component pi(Partial pressure-[mm of Hg]) \n",
+ " CO2 107.1 mm of Hg \n",
+ " O2 45.9 mm of Hg \n",
+ " N2 612.0 mm of Hg \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.7 Page no. 416\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t# Example 13.7 Page no. 416\n",
+ "\t\t\t# Solution fig E13.7\n",
+ "\n",
+ "# Variables\n",
+ "G = 100. ;\t\t\t# Basis: Pyrolysis Gas-[lb mol] \n",
+ "ub_CO = 10./100 ;\t# fraction of CO left unburnt\n",
+ "ex_air = 40./100 ;\t# fraction of excess air\n",
+ "m_vol = 359. ;\t\t# molar volume of gas at std. cond.-[cubic feet]\n",
+ "Ts = 492. ;\t\t\t# Standard temperature -[degree Rankine]\n",
+ "Ps = 29.92 ;\t\t#Standard pressure -[in. Hg]\n",
+ "\n",
+ "# Calculations\n",
+ "# Analysis of entering gas of entering gas\n",
+ "Tf1 = 90. ;\t\t\t# Temperature of gas-[degree F]\n",
+ "T_gas = Tf1 + 460. ;\t#Temperature of gas-[degree Rankine]\n",
+ "P_gas = 35. ;\t\t\t#Pressure-[in. Hg]\n",
+ "CO2 = 6.4/100 ;\t\t\t# mol fraction of CO2\n",
+ "O2 = 0.1/100 ;\t\t\t# mol fraction of O2\n",
+ "CO = 39./100 ;\t\t\t# mol fraction of CO\n",
+ "H2 = 51.8/100 ;\t\t\t# mol fraction of H2\n",
+ "CH4 = 0.6/100 ;\t\t\t# mol fraction of CH4\n",
+ "N2 = 2.1/100 ;\t\t\t# mol fraction of N2\n",
+ "\n",
+ "# Analysis of entering air\n",
+ "Tf2 = 70. ;\t\t\t # Temperature of air -[degree F]\n",
+ "T_air = Tf2 + 460. ;\t#Temperature of air-[degree Rankine]\n",
+ "P_air = 29.4 ;\t\t\t#Pressure of air [in. Hg]\n",
+ "f_N2 = 79./100 ;\t\t\t# mol fraction of N2\n",
+ "f_O2 = 21./100 ;\t\t\t# mol fraction of O2\n",
+ "\n",
+ "\n",
+ "O2r_O2 = O2 * G ;\t\t\t# O2 required by O2-[lb mol]\n",
+ "O2r_CO = CO * G/2 ;\t\t\t# O2 required by CO-[lb mol]\n",
+ "O2r_H2 = H2 * G/2 ;\t\t\t# O2 required by H2-[lb mol]\n",
+ "O2r_CH4 = G * CH4 * 2 ;\t\t\t# O2 required by CH4-[lb mol]\n",
+ "O2r_total = O2r_O2 + O2r_CO + O2r_H2 + O2r_CH4 ;\t\t\t# Total O2 required-[lb mol]\n",
+ "ex_O2 = ex_air * O2r_total ;\t\t\t# Excess O2-[lb mol]\n",
+ "total_O2 = ex_O2 + O2r_total ;\t\t\t# Total amt of O2 in air-[lb mol]\n",
+ "total_N2 = total_O2 * (f_N2/f_O2);\t\t\t# Total amt of in air-[lb mol]\n",
+ "air = total_O2 + total_N2 ;\t\t\t# Total air entering -[lb mol]\n",
+ "\n",
+ "# Product analysis\n",
+ "P_CO = ub_CO * CO * G ;\t\t\t#Unburnt CO in P-[lb mol]\n",
+ "P_N2 = N2 * G + total_N2 ;\t\t\t# N2 in P-[lb mol]\n",
+ "P_CO2 = (CO2 + CO + CH4) * G - 1 * P_CO;\t\t\t#CO2 in P-[lb mol]\n",
+ "P_H2O = (H2 + 2 * CH4) * G ;\t\t\t# H2 in P-[lb mol]\n",
+ "P_O2 = (CO2 + O2 + 0.5 * CO) * G + total_O2 -P_CO2-0.5 * (P_H2O + P_CO);\t\t\t# O2 in P-[lb mol]\n",
+ "P = P_CO + P_N2 + P_CO2 + P_H2O + P_O2 ;\t\t\t# Product-[lb mol]\n",
+ "Tf3 = 400 ;\t\t\t# Temperature of product-[degree F]\n",
+ "T_prod = Tf3 + 460 ;\t\t\t#Temperature of product-[degree Rankine]\n",
+ "P_prod = 35 ;\t\t\t# Pressure of product -[in.Hg]\n",
+ "V_gas = (G * m_vol * T_gas * Ps)/(Ts * P_gas);\n",
+ "V_air = (air * m_vol * T_air * Ps)/(Ts * P_air);\n",
+ "V_prod = (P * m_vol * T_prod * Ps)/(Ts * P_prod);\n",
+ "air_ft3 = V_air/V_gas ;\t\t\t#Air supplied per ft**3 of gas entered-[cubic feet]\n",
+ "P_ft3 = V_prod/V_gas ;\t\t\t#Product gas produced per ft**3 of gas entered-[cubic feet]\n",
+ "\n",
+ "# Results\n",
+ "print ' Air supplied per ft**3 of gas entered %.2f cubic feet. '%air_ft3\n",
+ "print ' Product gas produced per ft**3 of gas entered %.2f cubic feet.'%P_ft3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Air supplied per ft**3 of gas entered 3.57 cubic feet. \n",
+ " Product gas produced per ft**3 of gas entered 5.75 cubic feet.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.8 Page No. 419\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "T1c = 15. ;\t\t\t # Temperature of F & P -[degree C] \n",
+ "T1 = 273. + T1c ;S\t# Temperature of F & P -[K] \n",
+ "P1 = 105. ;\t\t\t# Pressure of F & P -[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "# F analysis\n",
+ "F_CO2 = 1.2/100 ;\t\t\t# Volume fraction \n",
+ "F_odr = 98.8/100 ;\t\t\t# Volume fraction \n",
+ "\n",
+ "# P analysis\n",
+ "P_CO2 = 3.4/100 ;\t\t\t# Volume fraction \n",
+ "P_odr = 96.6/100 ;\t\t\t# Volume fraction \n",
+ " \n",
+ "Tc_CO2 = 7. ;\t\t\t#Temperature CO2 -[degree C] \n",
+ "T_CO2 = 273. + Tc_CO2 ;\t\t\t# Temperature CO2 -[K]\n",
+ "P_CO2 = 131. ;\t\t\t# Pressure of CO2 -[kPa]\n",
+ "CO2 = 0.0917 ;\t\t\t# Volume flow rate of CO2-[cubic metre/min]\n",
+ "# Convert given volume flow rate of CO2 at temperature of F & P\n",
+ "nw_CO2 = (CO2 * T1 * P_CO2)/(T_CO2 * P1) ;\t\t\t# volume flow rate of CO2 at temperature of F & P-[cubic metre]\n",
+ "\n",
+ "from numpy import matrix\n",
+ "a = matrix([[F_odr,-P_odr],[1, -1]]);\t\t\t# Matrix formed by coefficients of unknown\n",
+ "b = matrix([[0],[-nw_CO2]]) ;\t\t\t# Matrix formed by constants\n",
+ "a = a.I\n",
+ "x = a*b ;\t\t\t# matrix of solution, x(1) = F;x(2) = P\n",
+ "F = x[0] ;\t\t\t#Volume flow rate of entering gas-[cubic metre/min]\n",
+ "P = x[1] ;\t\t\t#Volume flow rate of product [cubic metre/min]\n",
+ "\n",
+ "# Results\n",
+ "print 'Volume flow rate of entering gas is %.2f cubic metre/min'%F\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume flow rate of entering gas is 5.17 cubic metre/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch14.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch14.ipynb
new file mode 100644
index 00000000..dbfb8f2a
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch14.ipynb
@@ -0,0 +1,190 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 : Real Gases Compressiblity"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.1 Page No. 442\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "T1f = 125. ;\t\t\t# Temperature of NH3 -[degree F] \n",
+ "T1 = 460. +T1f ;\t\t\t# Temperature NH3 -[degree Rankine] \n",
+ "Pg = 292. ;\t\t\t# Pressure of NH3 -[psig]\n",
+ "Pa = Pg+14.7 ;\t\t\t#Pressure of NH3 -[psia]\n",
+ "R = 10.73 ;\t\t\t#Universal gas constant-[(psia*cubic feet)/(lb mol*R)]\n",
+ "mw_NH3 = 17. ;\t\t# Molecular wt. 1 lb mol NH3-[lb]\n",
+ "n = 1/17. ;\t\t\t#[mol]\n",
+ "V_tank = 120. ;\t\t# Volume of tank-[cubic feet]\n",
+ "\n",
+ "# Calculations\n",
+ "V_id = (n*R*T1)/Pa ;\t# Specific volume of NH3 treating it ideal gas-[cubic feet/lb]\n",
+ "Tc = 729.9 ;\t\t\t#[degree R]\n",
+ "Pc = 1636. ;\t\t\t#[psia]\n",
+ "Tr = T1/Tc;\n",
+ "Pr = Pa/Pc;\n",
+ "\n",
+ "z_real = 0.855;\n",
+ "z_ideal = 1.;\n",
+ "V_real = V_id*z_real/z_ideal;\t\t\t# Specific volume of NH3 treating it real gas-[cubic feet/lb]\n",
+ "NH3 = V_tank/V_real ;\t\t\t # Actual amt. of NH3 in tank-[lb]\n",
+ "\n",
+ "# Results\n",
+ "print 'Actual amt. of NH3 in tank is %.0f lb. Therefore , boss is wrong.'%NH3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual amt. of NH3 in tank is 117 lb. Therefore , boss is wrong.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.2 Page No. 444\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "Tc = 154.4 ;\t\t\t#[K]\n",
+ "Pc1 = 49.7 ;\t\t\t# [atm]\n",
+ "Pc = 101.3 * Pc1;\t\t#[kPa]\n",
+ "\n",
+ "T_O21 = -25 ;\t\t\t# Temperature-[degree C]\n",
+ "T_O2 = 273+T_O21;\t\t#Temperature -[K]\n",
+ "R = 8.134 ;\t\t\t # gas constant-[(cubic metre * kPa)/(kg mol * K)]\n",
+ "V_tank = 0.0284 ;\t\t# Volume of tank-[cubic metre]\n",
+ "mol_O2 = 32 ;\t\t\t# Kmol. wt. of O2-[kg]\n",
+ "m_O2 = 3.5 ;\t\t\t# Mass of liquid O2-[kg]\n",
+ "\n",
+ "# Calculations\n",
+ "V_sp = V_tank * mol_O2/m_O2 ;\t\t\t# Specific molar volume-[m**3/kg]\n",
+ "Vc = R * Tc/Pc ;\t\t\t # [cubic metre/kg mol]\n",
+ "Vr = V_sp/Vc;\n",
+ "Tr = T_O2/Tc;\n",
+ "\n",
+ "Pr = 1.43 ;\t\t\t# [kPa]\n",
+ "P_O2 = Pr * Pc ;\t# The pressure in the tank -[kPa]\n",
+ "\n",
+ "# Results\n",
+ "print 'The pressure in the tank is %.2f kPa.'%P_O2\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure in the tank is 7199.49 kPa.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.3 Page No. 448\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "Tc = 100. ;\t\t\t# Temperature -[degree C] \n",
+ "T = 273 +Tc ;\t# Temperature -[K] \n",
+ "P = 90. ;\t\t# Pressure [atm]\n",
+ "R = 82.06 ;\t\t\t# gas constant-[(cubic centimetre * atm)/(g mol * K)]\n",
+ "Y_CH4 = 20./100 ;\t\t\t# [mole fraction]\n",
+ "Y_C2H4 = 30./100 ;\t\t\t# [mole fraction]\n",
+ "Y_N2 = 50./100 ;\t\t\t#[mole fraction]\n",
+ "\n",
+ "#Additional information from appendix D\n",
+ "Tc_CH4 = 191. ;\t\t\t#[K]\n",
+ "Pc_CH4 = 45.8 ;\t\t\t# [atm]\n",
+ "Tc_C2H4 = 283. ;\t\t#[K]\n",
+ "Pc_C2H4 = 50.5 ;\t\t# [atm]\n",
+ "Tc_N2 = 126. ;\t\t\t#[K]\n",
+ "Pc_N2 = 33.5 ;\t\t\t# [atm]\n",
+ "\n",
+ "# Calculations & Results\n",
+ "#(a)-Ideal gas law\n",
+ "V_sp1 = R * T/P ;\t\t\t# Molar volume-[cubic centimetre/g mol]\n",
+ " \n",
+ "print '(a) The volume per mole of mixture by ideal gas law is %.1f cubic centimetre/g mol.'%V_sp1\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "Pc_mix = Pc_CH4 * Y_CH4+Pc_C2H4 * Y_C2H4+Pc_N2 * Y_N2;\t\t\t# [atm]\n",
+ "Tc_mix = Tc_CH4 * Y_CH4+Tc_C2H4 * Y_C2H4+Tc_N2 * Y_N2 ;\t\t\t# [K]\n",
+ "Pr_mix = P/Pc_mix;\n",
+ "Tr_mix = T/Tc_mix;\n",
+ "\t\t\t# With 2 parameters(Pr_mix and Tr_mix) , you can find from figure 14.4b that z * Tr_mix = 1.91\n",
+ "z = 1.91/Tr_mix;\n",
+ "V_sp2 = z * R * T/P ;\t\t\t# Molar volume-[cubic centimetre/g mol]\n",
+ "print '(b) The volume per mole of mixture by treating it to be real gas is %.1f cubic centimetre/g mol.'%V_sp2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The volume per mole of mixture by ideal gas law is 340.1 cubic centimetre/g mol.\n",
+ "(b) The volume per mole of mixture by treating it to be real gas is 324.1 cubic centimetre/g mol.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch15.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch15.ipynb
new file mode 100644
index 00000000..c6c7dffb
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch15.ipynb
@@ -0,0 +1,75 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Real Gases Equations of State"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.1 Page No. 464\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of Van der Walls Equation to Calculate a Temperature\n",
+ "\n",
+ "# variables\n",
+ "R = 82.06 # gas constant-[(cm**3 *atm)/(g mol *K)]\n",
+ "a = 9.24 *10**(6) ; #(atm) *(cm**3/g mol)**2\n",
+ "b = 90.7 ; # (cm**3)/(g mol)\n",
+ "m_C3H8 = 22.7 # Mass of propane-[kg]\n",
+ "mw_C3H8 = 44. ; # Mol. wt. of 1kmol propane-[kg]\n",
+ "V = 0.15 *10**(6) ; # Volume of cylinder -[cm**3]\n",
+ "pg = 4790. # Gauge pressure -[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "P = (pg +101.3)/101.3 # Pressure absolute-[atm abs]\n",
+ "n = (m_C3H8/mw_C3H8) *10**3 ; # Moles of propane\n",
+ "# Get T using Van der Waal's eqn. \n",
+ "T = ((P +((n**(2) *a/(V**(2))))) *(V-n *b))/(R *n) ;# Temperature of propane-[K]\n",
+ "\n",
+ "# Result\n",
+ "print 'Temperature of propane is %.0f K.'%T"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of propane is 384 K.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch16.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch16.ipynb
new file mode 100644
index 00000000..37a79df4
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch16.ipynb
@@ -0,0 +1,190 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 : Single Component Two Phase Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.1 Page no. 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "Tc = 972. ;\t\t\t#[degree C]\n",
+ "T = 273.+Tc ;\t\t\t#[K]\n",
+ "A = 8.799;\n",
+ "B = 1.615 * 10**4;\n",
+ "C = 0.;\n",
+ "mw = 26.98;\n",
+ "\n",
+ "# Calculations\n",
+ "# Use Antoine eqn. to get vapour pressure at 972 degree C\n",
+ "vP = math.exp(A-(B/(C+T))) ;\t\t\t# vapour pressure at 972 degree C-[mm Hg]\n",
+ "P = vP * 101.325/760 ;\t\t\t#[kPa]\n",
+ "# Use rate of vapourization(m) by given formula\n",
+ "m = 0.437 * (P * (mw**.5)/(T**0.5)) ;\t\t\t# Vapourization rate at 972 degree C-[g/(square centimetre * s)]\n",
+ "\n",
+ "# Results\n",
+ "print ' Vapourization rate at 972 degree C is %.1e g/(square centimetre)(s).'%m\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Vapourization rate at 972 degree C is 1.3e-04 g/(square centimetre)(s).\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 16.3 Page no. 494\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "T1 = 110. ;\t\t\t# Temperature of chlorobenzene - [degree C] \n",
+ "T1F = (9*T1)/(5) + 32 ;\t\t\t# Temperature of chlorobenzene - [degree F] \n",
+ "P1 = 400. ;\t\t\t#Pressure of chlorobenzene - [mm of Hg]\n",
+ "P1_psia = P1*14.7/760 ;\t\t\t#Pressure of chlorobenzene - [psia]\n",
+ "T2 = 205. ;\t\t\t# Temperature of chlorobenzene - [degree C] \n",
+ "T2F = (9.*T2)/(5) + 32 ;\t\t\t# Temperature of chlorobenzene - [degree F] \n",
+ "P2 = 5. ;\t\t\t#Pressure of chlorobenzene - [atm]\n",
+ "\n",
+ "# Calculations\n",
+ "P2_psia = P2*14.7 ;\t\t\t#Pressure of chlorobenzene - [psia]\n",
+ "\n",
+ "# Data from steam table\n",
+ "x1 = [.9487,3.72,11.525,29.8,67,247,680,1543,3094];\n",
+ "y1 = [100,150,200,250,300,400,500,600,700];\n",
+ "\n",
+ "x2 = [P1_psia,P2_psia];\n",
+ "y2 = [T1F,T2F];\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "# Results\n",
+ "plt.plot(x1,y1);\n",
+ "plt.plot(x2,y2);\n",
+ "plt.plot(x1,y1);\n",
+ "plt.plot(x2,y2);\n",
+ "plt.show()\n",
+ "vp1 = 150. ;\t\t\t# vapour pressure of chlorobenzene from cox chart prepared at 245 degree C\n",
+ "vp2 = 700. ;\t\t\t# vapour pressure of chlorobenzene from cox chart prepared at 359 degree C\n",
+ "\n",
+ "print 'Temperature Estimated vapour pressure of chlorobenzene from cox chart'\n",
+ "print ' 245 degree C %i psia'%vp1\n",
+ "print ' 359 degree C %i psia'%vp2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD9CAYAAABUS3cAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1clfXh//HXQUBFFC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ioiMLCQpKSklod\npspt4dKgfue1I7m/XUF9YAgJ900+r/VFRHxJm27y+mYKZ968eaSmppKZmUlkZCTLly8HwGazkZqa\nis1mw9/fnyVLlpxzSuh0RwkkJviitkQCTj66IXjJQmrueURX9oiItILF+OYSns78UIuFs31sj7Vv\n8fFliYwfGNmm7X2y+H36PXgXw2q/oMcFnDMQEfFmzXXn+fCaO3xdTY24/fsSHzK4zese//1TFP/o\nIRW/iEgrec2zffKPlGNpqiUooGeb1it86zOGV24jZPE/OiiZiEj34zUj/8+PVNCz6Vib13M+9DRf\nTLuPXv17dUAqEZHuyWtG/oVHDxFM227wKv1oP7aid/Bb91wHpRIR6Z68ZuS/99gRBvi17TlAhfc+\nx87LZ9P/kgEdlEpEpHvympF/yfF6QgNaf8L28J4qEvJepmHzzg5MJSLSPXnNyN95opHwwNaf7P3k\n7j/zWdT3GTw+ogNTiYh0T14z8q9qshDZyrt766vqsf17MTU5/+7gVCIi3ZPXlP9RAojp27q7e7fc\nm0XPQUlMuNHWwalERLonryn/Br8+jOxnbXG5JlcTw994hiOLXu74UCIi3ZRXlH+ju4km/36M7j+k\nxWVz5/2TPr2tjJl7ZSckExHpnrzihO/uGieWpnr6BfY+53KG2yDkrwupv/fhTkomItI9ecXI//Pq\ncgKbaltcbscf19Ov8Rhxj9/YCalERLov7xj5H60kmIYWl2tKX0jZbb/Gz98rYouIdFleMfLfW1dD\n/xbu7t29bAfhhz/jokUrOymViEj35RVD6JKGOga1MJqvfOQpdl93Pz37te2pnyIiciavGPk7XSeI\nDQpq9v3i94sYuf9derz/505MJSLSfXnFyL+yCYb3bv6L2/fe+wd2Jv2UkGEhnZhKRKT78oqR/1EC\niA4++5M5D+2uZMxnr+La/nknpxIR6b68ovzr/foQ3y/srO99evcL+MXezNVj2/71jiIicnaml7/b\n7abJvx9jLgo/471jB44Rv+EFjq7aaEIyEZHuy/Ty33P0IBa3i/6BZ57w3fqLl+gZdiUTrxthQjIR\nke7L9PL/7Eg5gY01Z7ze2N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c5/m63m7Fjx2K1WpkyZQrx8fFd6vifLT90/PHv1PLvKid/N23a\nRF5eHqtXr+aFF15g48aNp7xvsVjOuS/etp8t5fVG99xzD0VFRezYsYPBgwfz4IMPmh3pnGpra7n5\n5ptZtGgRffv2PeW9rnD8a2trueWWW1i0aBHBwcFd6vj7+fmxY8cOSkpKeP/991m/fv0p73v78T89\nv8Ph6JTj36nlf/p9AMXFxaf8tvIWgwcPBmDQoEHcdNNN5Obmeu5tAM7r3obO1pa8ERERhIeHU1JS\ncsrrZu5HaGio5z/au+66yzOV5o35T5w4wc0338ysWbM8lz13peP/Tf477rjDk78rHf9vhISEcMMN\nN7Bt27YudfxPz79169ZOOf6dWv7jxo2jsLCQffv24XK5WLZsGSkpKZ0ZoUV1dXUcPXoUgGPHjrF2\n7VpGjx7d5e5taGvesLAw+vXrx+bNmzEMg6VLl3rWMUN5ebnnz2+99ZbnqbLelt8wDObMmYPNZuP+\n++/3vN5Vjn9z+bvK8a+srPRMidTX1/Pee++RmJjYZY5/c/m/+cUFHXj82+FkdZusWrXKiI2NNaKi\noownn3yysz++RXv37jUSEhKMhIQEIz4+3pPx0KFDxtSpU8966dgTTzxhREVFGSNGjDDWrFnT6Zlv\nvfVWY/DgwUZAQIARERFh/O1vfzuvvN9cKhYVFWX88pe/NC1/ZmamMWvWLGP06NHGmDFjjO9///tG\nRUWFV+bfuHGjYbFYjISEBM9leatXr+4yx/9s+VetWtVljv/OnTuNxMREIyEhwRg9erTx1FNPGYZx\nfv+9elP+zjj+FsPQsxZERHyNvslLRMQHqfxFRHyQyl9ExAep/EVEfJDKX0TEB6n8RUR80P8HG2z4\nU34WbyUAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2d83e10>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature Estimated vapour pressure of chlorobenzene from cox chart\n",
+ " 245 degree C 150 psia\n",
+ " 359 degree C 700 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 16.4 Page no. 495\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "OP_Et = 400. ;\t\t\t#OSHA PEL of ethyl acetate -[ppm by volume]\n",
+ "OP_Mek = 200. ;\t\t\t#OSHA PEL of Methyl ethyl ketone [ppm by volume]\n",
+ "OP_Nba = 1.3 ;\t\t\t#OSHA PEL of n-butyl acetate [ppm by volume]\n",
+ "vp_Et = 96.9 ;\t\t\t# Vapour pressure of ethyl acetate obtained from CD-[mm of Hg]\n",
+ "vp_Mek = 94.8 ;\t\t\t# Vapour pressure of Methyl ethyl ketone obtained from CD-[mm of Hg]\n",
+ "vp_Nba = 20. ;\t\t\t# Vapour pressure of n-butyl acetate obtained from Perry-[mm of Hg]\n",
+ "\n",
+ "# Calculations\n",
+ "Chz_Et = vp_Et/OP_Et ;\t\t\t# Combined hazard criterion of ethyl acetate\n",
+ "Chz_Mek = vp_Mek/OP_Mek ;\t\t\t# Combined hazard criterion of Methyl ethyl ketone \n",
+ "Chz_Nba = vp_Nba/OP_Nba ;\t\t\t# Combined hazard criterion of n-butyl acetate\n",
+ "\n",
+ "# Results\n",
+ "print 'Combined hazard criterion of solvents in increasing order are :'\n",
+ "print 'Ethyl acetate : %.2f'%Chz_Et\n",
+ "print 'Methyl ethyl ketone : %.2f'%Chz_Mek\n",
+ "print 'n-butyl acetate : %.2f'%Chz_Nba\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Combined hazard criterion of solvents in increasing order are :\n",
+ "Ethyl acetate : 0.24\n",
+ "Methyl ethyl ketone : 0.47\n",
+ "n-butyl acetate : 15.38\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch17.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch17.ipynb
new file mode 100644
index 00000000..0c482647
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch17.ipynb
@@ -0,0 +1,326 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 : Two Phase Gas Liquid Systems Saturation Condensation and Vaporization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 17.1 Page no. 511\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F = 1. ;\t\t\t#H2C2O4- [mol]\n",
+ "ex_O2 = 248. ;\t\t#Excess air- [%]\n",
+ "f_C = 65/100. ;\t\t# Fraction of Carbon which convert to CO2\n",
+ "P = 101.3 ;\t\t\t# Atmospheric pressure-[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "O2_req = F*0.5 ;\t\t\t# O2 required by the above reaction-[mol]\n",
+ "O2_in = (1. + ex_O2*F/100)*0.5 ;\t\t\t# Mol. of O2 entering\n",
+ "\n",
+ "# Use Elemental balance moles of species in output \n",
+ "n_CO2 = f_C*2 ;\t\t\t# [mol]\n",
+ "n_H2O = (2*F)/2. ;\t\t# From 2H balance-[mol]\n",
+ "n_N2 = ((O2_in*0.79)/(0.21)) ;\t\t\t# From 2N balance-[mol]\n",
+ "n_CO = 2-n_CO2 ;\t\t\t # From C balance-[mol]\n",
+ "n_O2 = ((4 + O2_in*2)-(n_H2O + n_CO + 2*n_CO2))/2 ;\t\t\t# From O2 balance-[mol]\n",
+ "total_mol = n_CO2 + n_H2O + n_N2 + n_CO + n_O2 ;\t\t\t# Total moles in output stream-[mol]\n",
+ "y_H2O = n_H2O/total_mol ;\t# Mole fraction of H2O\n",
+ "pp_H2O = y_H2O*P ;\t\t\t# Partial pressure of H2O-[kPa]\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print 'Partial pressure of H2O %.2f kPa.'%pp_H2O\n",
+ "print 'Use partial pressure of H2O to get dew point temperature T from steam table: T = 316.5 K'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Partial pressure of H2O 9.10 kPa.\n",
+ "Use partial pressure of H2O to get dew point temperature T from steam table: T = 316.5 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 17.2 Page no. 517\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "gas = 1. ;\t\t\t# Entering gas-[g mol]\n",
+ "T = 26. ;\t\t\t# Temperature (for isothermal process)-[degree C]\n",
+ "vp = 99.7 ;\t\t\t# vapour pressure of benzene at 26 C-[mm of Hg]\n",
+ "\n",
+ "# Analysis of entering gas \n",
+ "f_C6H6 = 0.018 ;\t\t\t# Mol fraction of benzene\n",
+ "f_air = 0.982 ;\t\t\t# Mol fraction of air\n",
+ "mol_C6H6 = 0.018*gas ;\t\t# Moles of benzene-[g mol]\n",
+ "mol_air = 0.982*gas ;\t\t# Moles of air-[g mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Analysis of exit gas\n",
+ "C6H6_rec = 95./100 ;\t\t\t# Fraction of benzene recovered\n",
+ "C6H6_out = 1-C6H6_rec ;\t\t#Fraction of benzene in exit stream\n",
+ "C6H6_out = mol_C6H6*C6H6_out ;\t#Moles of benzene in exit stream-[g mol]\n",
+ "air_out = mol_air ;\t\t\t #Moles of air in exit stream-[g mol]\n",
+ "total_mol = C6H6_out+air_out ;\t# Total moles in exit stream\n",
+ "y_C6H6_out = C6H6_out/total_mol ;\t\t\t# Mole fraction of benzene in exit\n",
+ "P = vp/y_C6H6_out ;\t\t\t # Pressure total of exit\n",
+ "\n",
+ "# Results\n",
+ "print ' Pressure total at exit of compressor %.2e mm of Hg.'%P\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure total at exit of compressor 1.09e+05 mm of Hg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 17.3 Page no. 519\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "ex_air = .4 ;\t\t\t# Fraction of excess air required\n",
+ "w_C = 12. ;\t\t\t # Mol. wt. of C-[g]\n",
+ "mol_C = 71./w_C ;\t\t#[kg mol]\n",
+ "w_H2 = 2.016 ;\t\t\t# Mol. wt. of H2 - [g] \n",
+ "mol_H2 = 5.6/w_H2;\n",
+ "air_O2 = 0.21;\t\t\t# Fraction of O2 in air\n",
+ "air_N2 = 0.79;\t\t\t# Fraction of N2 in air\n",
+ "\n",
+ "# Calculations\n",
+ "CO2_1 = 1. ;\t\t\t# By Eqn. (a) CO2 produced -[kg mol]\n",
+ "H2O_1 = 2. ;\t\t\t# By Eqn. (a) H2O produced -[kg mol]\n",
+ "Req_O2_1 = 2. ;\t\t\t# By Eqn. (a) -[kg mol]\n",
+ "ex_O2_1 = Req_O2_1*ex_air ;\t\t\t# Excess O2 required -[kg mol]\n",
+ "O2_1 = Req_O2_1 + ex_O2_1 ;\t\t\t # Total O2 required - [kg mol]\n",
+ "N2_1 = O2_1*(air_N2/air_O2) ;\t\t\t#Total N2 required - [kg mol]\n",
+ "Total_1 = CO2_1 + H2O_1 + N2_1 + ex_O2_1 ;\t\t\t# Total gas produced- [kg mol]\n",
+ "\n",
+ "CO2_2 = 1 ;\t\t\t# By Eqn. (a) CO2 produced -[kg mol]\n",
+ "H2O_2 = mol_H2/mol_C ;\t\t\t# By Eqn. (a) H2O produced -[kg mol]\n",
+ "Req_O2_2 = 1 + (mol_H2/mol_C)*(1./2) ;\t\t\t# By Eqn. (b) and (c) -[kg mol]\n",
+ "ex_O2_2 = Req_O2_2*ex_air ;\t\t\t# Excess O2 required -[kg mol]\n",
+ "O2_2 = Req_O2_2 + ex_O2_2; \t\t\t# Total O2 required - [kg mol]\n",
+ "N2_2 = O2_2*(air_N2/air_O2); \t\t\t#Total N2 required - [kg mol]\n",
+ "Total_2 = CO2_2 + H2O_2 + N2_2 + ex_O2_2 ;\t\t\t# Total gas produced- [kg mol]\n",
+ "\n",
+ "P = 100. ;\t\t\t# Total pressure -[kPa]\n",
+ "p1 = P*(H2O_1/Total_1) ;\t\t\t# Partial pressure of water vapour in natural gas - [kPa]\n",
+ "Eq_T1 = 52.5 ;\t\t\t# Equivalent temperature -[degree C]\n",
+ "p2 = P*(H2O_2/Total_2) ;\t\t\t# Partial pressure of water vapour in coal - [kPa]\n",
+ "Eq_T2 = 35 ;\t\t\t# Equivalent temperature -[degree C]\n",
+ "\n",
+ "# Results\n",
+ "print ' Natural gas Coal'\n",
+ "print ' ---------------------- --------------------'\n",
+ "print 'Partial pressure: %.1f kPa %.1f kPa'%(p1,p2 )\n",
+ "print 'Equivalent temperature: %.1f C %.1f C'%(Eq_T1,Eq_T2 );\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Natural gas Coal\n",
+ " ---------------------- --------------------\n",
+ "Partial pressure: 14.0 kPa 5.5 kPa\n",
+ "Equivalent temperature: 52.5 C 35.0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 17.4 Page no. 522\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F = 30. ;\t\t\t# Volume of initial gas-[m**3]\n",
+ "P_F = 98.6 ;\t\t\t# Pressure of gas-[kPa]\n",
+ "T_F = 273.+100 ;\t\t\t# Temperature of gas-[K]\n",
+ "P_p = 109. ;\t\t\t#[kPa]\n",
+ "T_p = 14.+273 ;\t\t\t# Temperature of gas-[K]\n",
+ "R = 8.314 ;\t\t\t# [(kPa*m**3)/(k mol*K)] \n",
+ "# Additional condition\n",
+ "vpW_30 = 4.24 ;\t\t\t#Vapour pressure-[kPa]\n",
+ "vpW_14 = 1.60 ;\t\t\t#Vapour pressure-[kPa]\n",
+ "n_F = (P_F*F)/(R*T_F) ;\t\t\t# Number of moles in F\n",
+ "\n",
+ "# Calculations\n",
+ "# Material balance to calculate P & W\n",
+ "P = (n_F*((P_F-vpW_30)/P_F))/((P_p-vpW_14)/P_p) ;\t\t\t# P from mat. bal. of air -[kg mol]\n",
+ "W = (n_F*(vpW_30/P_F))- P*(vpW_14/P_p); \t\t\t# W from mat. bal. of water -[kg mol]\n",
+ "iW = n_F*(vpW_30/P_F) ;\t\t\t# Initial amount of water -[kg mol]\n",
+ "fr_con = W/iW ;\t\t\t#Fraction of water condenseed \n",
+ "\n",
+ "# Results\n",
+ "print ' Fraction of water condenseed %.3f.'%fr_con\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Fraction of water condenseed 0.668.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 17.5 Page no. 527\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "P = 100. ;\t\t\t# Pressure of air-[kPa]\n",
+ "T = 20. + 273 ;\t\t\t# Temperature of air-[K]\n",
+ "R = 8.314 ;\t\t\t# [(kPa*m**3)/(k mol*K)] \n",
+ "EOH = 6 ;\t\t\t# Amount of ethyl alcohol to evaporate-[kg]\n",
+ "mw_EOH = 46.07 ;\t\t\t# Mol.wt. of 1 k mol ethyl alcohol-[kg]\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "# Additional data needed\n",
+ "vp_EOH = 5.93 ;\t\t\t# Partial pressure of alcohol at 20 C-[kPa]\n",
+ "vp_air = P-vp_EOH ;\t\t\t# Partial pressure of air at 20 C-[kPa]\n",
+ "n_EOH = EOH/mw_EOH ;\t\t\t#Moles of ethyl alcohol -[kg mol]\n",
+ "n_air = (n_EOH*vp_air)/vp_EOH ;\t\t\t# Moles of air -[kg mol]\n",
+ "V_air = n_air*R*T/P ;\t\t\t# Volume of air required\n",
+ "\n",
+ "# Results\n",
+ "print ' Volume of air required to evaporate 6 kg of ethyl alcohol is %.1f cubic metre . '%V_air\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Volume of air required to evaporate 6 kg of ethyl alcohol is 50.3 cubic metre . \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 17.6 Page no. 529\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "P = 760. ;\t\t\t# Pressure -[ mm of Hg]\n",
+ "vp = 40. ;\t\t\t# vapour pressure of n-heptane-[mm of Hg]\n",
+ "\n",
+ "# Calculations\n",
+ "K = 10**((math.log10(vp/P)-0.16)/1.25) ;\n",
+ "x = 0.5 ;\t\t\t# mole fraction after t_half\n",
+ "x0 = 1. ;\t\t\t# initial mole fraction \n",
+ "t_half = (math.log(x/x0))/(-K);\t\t\t# Time required to reduce the concentration to one-half-[min]\n",
+ "\n",
+ "# Results\n",
+ "print 'Time required to reduce the concentration to one-half is %.1f min. '%t_half\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required to reduce the concentration to one-half is 9.8 min. \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch18.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch18.ipynb
new file mode 100644
index 00000000..7e472aab
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch18.ipynb
@@ -0,0 +1,281 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : Two Phase Gas Liquid Systems Partial Saturation and Humidity"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 18.1 Page no.539\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "V = 1. ;\t\t\t# Volume of water vapour-[cubic metre]\n",
+ "rel_h = 43. ;\t\t\t# relative humidity -[%]\n",
+ "vp_H2O = 1.61 ;\t\t\t# vapour pressure of water at 94 F-[in. of Hg]\n",
+ "P_H2O = vp_H2O*(rel_h/100) ;\t\t\t# Pressure of water vapour in air-[in. of Hg]\n",
+ "P = 29.92 ;\t\t\t# [in of Hg]\n",
+ "T = 94+460. ;\t\t\t# Temperature -[Rankine]\n",
+ "Ts = 492. ;\t\t\t#Temperature std. -[Rankine]\n",
+ "mw_H2O = 18. ;\t\t\t# molecular mass of water -[lb]\n",
+ "\n",
+ "# Calculations\n",
+ "H2O = (5280**3*Ts*P_H2O*mw_H2O)/(T*P*359) ;\t\t\t#mass of H2O-[lb]\n",
+ "# The dew point is temperature at which water vapour in air first condense ,i.e at realative humidity 100 %, therefore\n",
+ "psat_H2O = P_H2O ;\t\t\t# Saturation pressure of H2O -[in. of Hg]\n",
+ "\n",
+ "# Results\n",
+ "print 'Saturation pressure of H2O %.3f in. of Hg'%psat_H2O\n",
+ "print 'Use saturation pressure of H2O to get dew point temperature T from steam table: T is about 68-69 F.'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation pressure of H2O 0.692 in. of Hg\n",
+ "Use saturation pressure of H2O to get dew point temperature T from steam table: T is about 68-69 F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 18.2 Page no. 541\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "# Data from steam table\n",
+ "psat_H2O = 31.8 ;\t\t\t# Saturation pressure -[mm of Hg]\n",
+ "\n",
+ "#(c)\n",
+ "H = .0055 ;\t\t\t# Humidity\n",
+ "mw_H2O = 18. ;\t\t\t# Molecular wt. of water-[lb]\n",
+ "mw_air = 29. ;\t\t\t# Molecular wt. of air -[lb]\n",
+ "P = 750. ;\t\t\t# Pressure total -[mm of Hg]\n",
+ "\n",
+ "# Calculations\n",
+ "p_H2O = ((H*mw_air*P)/mw_H2O)/(1+(H*mw_air/mw_H2O)) ;\t\t\t# Partial pressure of water vapour in air-[mm of Hg]\n",
+ "#(a)\n",
+ "rel_H = (p_H2O/psat_H2O)*100 ;\t\t\t# relative humidity -[%]\n",
+ "#(b)\n",
+ "mol_H = (p_H2O)/(P-p_H2O) ;\t\t\t# Molal humidity\n",
+ "\n",
+ "# Results\n",
+ "print '(a)Relative humidity is %.0f%% .'%rel_H\n",
+ "print '(b)Molal humidity is %.1e '%mol_H\n",
+ "print '(c)Partial pressure of water vapour in air is %.1f mm of Hg.'%p_H2O\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Relative humidity is 21% .\n",
+ "(b)Molal humidity is 8.9e-03 \n",
+ "(c)Partial pressure of water vapour in air is 6.6 mm of Hg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 18.3 Page No. 544\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "V_BDA = 1000. ;\t\t\t# Volume of bone dry air(BDA) at 20 C & 108.0 kPa\n",
+ "mol_V = 22.4 ;\t\t\t# Molar volume of gas at standard condition-[m**3]\n",
+ "T = 20+273. ;\t\t\t# Temperature of BDA-[K]\n",
+ "P = 108.0 ;\t\t\t#Pressure of BDA-[kPa]\n",
+ "Ts = 273. ;\t\t\t# Standard temperature-[K]\n",
+ "Ps = 101.3 ;\t\t\t#Standard pressure-[kPa]\n",
+ "W = 0.93 ;\t\t\t# [kg]\n",
+ "mw_W = 18. ;\t\t\t# mol. wt. of 1kmol water -[kg]\n",
+ "\n",
+ "# Calculations\n",
+ "mol_W = W/mw_W ;\t\t\t# amount of water vapour(W)-[kg mol]\n",
+ "mol_BDA = (V_BDA*Ts*P)/(T*Ps*mol_V) ;\t\t\t# amount of BDA-[kg mol]\n",
+ "p_H2O = (mol_W/(mol_W+mol_BDA))*P ;\t\t\t# Partial pressure of H2O-[kPa]\n",
+ "\n",
+ "# Get vapour pressure for water at 15 C , namely 1.70 kPa\n",
+ "psat_H2O = 1.70 ;\t\t\t#vapour pressure for water at 15 C-[kPa]\n",
+ "rel_H = (p_H2O/psat_H2O) ;\t\t\t#Fractional relative humidity-[]\n",
+ "\n",
+ "# Results\n",
+ "print '(a)Fractional relative humidity of original air was %.3f .'%rel_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Fractional relative humidity of original air was 0.074 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 18.4 Page no.545\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "F = 1000. ;\t\t\t# Volume of entering moist air at 22 C & 101.0 kPa\n",
+ "mol_V = 22.4 ;\t\t\t# Molar volume of gas at standard condition-[m**3]\n",
+ "T_in = 22.+273 ;\t\t\t# Temperature of entering moist air-[K]\n",
+ "P_in = 101.0 ;\t\t\t#Pressure of entering moist air -[kPa]\n",
+ "dp_in = 11.+273 ;\t\t\t# Dew point of entering air-[K]\n",
+ "Ts = 273. ;\t\t\t# Standard temperature-[K]\n",
+ "Ps = 101.3 ;\t\t\t#Standard pressure-[kPa]\n",
+ "T_out = 58.+273 ;\t\t\t# Temperature of exiting moist air-[K]\n",
+ "P_out = 98. ;\t\t\t#Pressure of exiting moist air -[kPa]\n",
+ "\n",
+ "# Additional vapour pressure data\n",
+ "psat_in = 1.31 ;\t\t\t#Vapour pressure of entering moist air -[kPa]\n",
+ "psat_out = 18.14 ;\t\t\t# Vapour pressure of exiting moist air -[kPa]\n",
+ "pBDA_in = P_in-psat_in ;\t\t\t# Pressure of entering dry air - [kPa]\n",
+ "pBDA_out = P_out - psat_out ;\t\t\t# Pressure of exiting dry air - [kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "mol_F = (F*P_in*Ts)/(Ps*T_in*mol_V) ;\t\t\t# Moles of moist air entering-[kg mol]\n",
+ "mol_P = (mol_F*(pBDA_in/P_in))/(pBDA_out/P_out); \t\t\t#BDA balance- [kg mol]\n",
+ "mol_W = mol_P-mol_F ;\t\t\t# Total balance -[kg mol]\n",
+ "mw_BDA = 29. ;\t\t\t# Mol. wt. of dry air\n",
+ "mw_H2O = 18. ;\t\t\t# Mol. wt. of water vapour\n",
+ "m_BDA = (mol_F*pBDA_in/P_in)*mw_BDA ;\t\t\t# Mass of dry air entering-[kg]\n",
+ "m_H2O = (mol_F*psat_in/P_in)*mw_H2O ;\t\t\t# Mass of water vapour entering-[kg]\n",
+ "wa_in = m_BDA+m_H2O ;\t\t\t#Total wet air entering -[kg]\n",
+ "H2O_ad = mol_W*mw_H2O/wa_in ;\t\t\t#Water added to each kg of wet air entering the process-[kg]\n",
+ "\n",
+ "# Results\n",
+ "print 'Water added to each kg of wet air entering the process is %.3f kg.'%H2O_ad\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Water added to each kg of wet air entering the process is 0.132 kg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 18.5 Page No.547\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Variables\n",
+ "# Given data\n",
+ "#Basis: F = 29.76 lb mol\n",
+ "F = 29.76 ;\t\t\t# amount of entering moist air -[lb mol]\n",
+ "F_rh = 90/100. ;\t\t\t# Relative humidity\n",
+ "T_in = 100 + 460. ;\t\t\t# Temperature of entering moist air-[Rankine]\n",
+ "P_in = 29.76 ;\t\t\t#Pressure of entering moist air -[in. of Hg]\n",
+ "psat_in = 1.93 ;\t\t\t# Saturation pressure from steam table-[in. of Hg]\n",
+ "T_out = 120 + 460. ;\t\t\t# Temperature of exiting dry air-[Rankine]\n",
+ "P_out = 131.7 ;\t\t\t#Pressure of exiting dry air -[in. of Hg]\n",
+ "psat_out = 3.45 ;\t\t\t# Saturation pressure from steam table-[in. of Hg]\n",
+ "mol_V = 22.4 ;\t\t\t# Molar volume of gas at standard condition-[m**3]\n",
+ "mw_H2O = 18.02 ;\t\t\t# Mol. wt. of water -[lb]\n",
+ "mw_air = 29. ;\t\t\t# Mol. wt. of air -[lb]\n",
+ "p_H2O_in = F_rh*psat_in ;\t\t\t# Partial pressure of water vapour at inlet--[in. of Hg]\n",
+ "p_air_in = P_in-p_H2O_in ;\t\t\t# Partial pressure of air at inlet--[in. of Hg]\n",
+ "\n",
+ "# Calculations\n",
+ "# Assume condensation takes place , therefore output gas P is saturated,\n",
+ "P_rh = 1;\t\t\t# Relative humidity of output gas\n",
+ "p_H2O_out = P_rh*psat_out ;\t\t\t# Partial pressure of water vapour at outlet--[in. of Hg]\n",
+ "p_air_out = P_out-p_H2O_out ;\t\t\t# Partial pressure of air at outlet--[in. of Hg]\n",
+ "\n",
+ "# Get W and P from balance of air and water\n",
+ "P = (p_air_in*F/P_in)/(p_air_out/P_out) ;\t\t\t# From air balance-[ lb mol]\n",
+ "W = (p_H2O_in*F/P_in)-(P*p_H2O_out/P_out);\t\t\t# From water balance -[lb mol]\n",
+ "W_ton = (W*mw_H2O*2000)/(p_air_in*mw_air) ;\t\t\t# Moles of water condenses per ton dry air-[lb mol]\n",
+ "W_m = mw_H2O*W_ton ;\t\t\t# Mass of water condenses per ton dry air-[lb]\n",
+ "\n",
+ "# Results\n",
+ "# Since W is positive our assumption(condensation takes place ) is right .\n",
+ "print '(a) Yes water condense out during compression ,since W(%.3f lb mol) is positive our assumption(condensation takes place ) \\nis right .'%W\n",
+ "print '(b) Amount of water condenses per ton dry air is %.1f lb mol i.e %.0f lb water.'%(W_ton,W_m)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Yes water condense out during compression ,since W(0.983 lb mol) is positive our assumption(condensation takes place ) \n",
+ "is right .\n",
+ "(b) Amount of water condenses per ton dry air is 43.6 lb mol i.e 786 lb water.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch19.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch19.ipynb
new file mode 100644
index 00000000..dc3cb7a9
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch19.ipynb
@@ -0,0 +1,314 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 19 : The Phase Rule and Vapor Liquid Equilibria"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 19.1 Page No. 563\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculating the number of degrees to freedom'''\n",
+ "\n",
+ "# Use phase rule to get degree of freedom(F) = 2-P+C \n",
+ "# (a)\n",
+ "N1 = 1.;\n",
+ "P1 = 1. ;\t\t\t# Number of phases present\n",
+ "C1 = 1. ;\t\t\t#Number of components present\n",
+ "F1 = 2.-P1+C1 ;\t\t\t#Number of degree of freedom\n",
+ "print ' (a) Number of degree of freedom of pure benzene is %i.\\n Therefore %i additional \\\n",
+ "intensive variables must be specified to fix to fix the system.'%(F1,F1)\n",
+ "\n",
+ "\t\t\t# (b)\n",
+ "N2 = 1.;\n",
+ "P2 = 2. ;\t\t\t# Number of phases present\n",
+ "C2 = 1. ;\t\t\t#Number of components present\n",
+ "F2 = 2.-P2+C2 ;\t\t\t#Number of degree of freedom\n",
+ "print '(b) Number of degree of freedom of a mixture of ice and water only is %i.\\\n",
+ " \\nTherefore %i additional intensive variables must be specified to fix the system. '%(F2,F2)\n",
+ "\n",
+ "\t\t\t# (c)\n",
+ "N3 = 2.;\n",
+ "P3 = 2. ;\t\t\t# Number of phases present\n",
+ "C3 = 2. ;\t\t\t#Number of components present\n",
+ "F3 = 2.-P3+C3 ;\t\t\t#Number of degree of freedom\n",
+ "print '(c) Number of degree of freedom of a mixture of liquid benzene,benzene vapour and\\\n",
+ " helium gas is %i. \\nTherefore %i additional intensive variables must be specified to fix the system. '%(F3,F3)\n",
+ "\n",
+ "\t\t\t# (d)\n",
+ "N4 = 2.;\n",
+ "P4 = 2. ;\t\t\t# Number of phases present\n",
+ "C4 = 2. ;\t\t\t#Number of components present\n",
+ "F4 = 2.-P4+C4 ;\t\t\t#Number of degree of freedom\n",
+ "print '(d) Number of degree of freedom of a mixture of salt and water designed to achieve\\\n",
+ " a specific vapour pressure is %i. \\nTherefore %i additional intensive variables must be\\\n",
+ " specified to fix the system. '%(F4,F4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) Number of degree of freedom of pure benzene is 2.\n",
+ " Therefore 2 additional intensive variables must be specified to fix to fix the system.\n",
+ "(b) Number of degree of freedom of a mixture of ice and water only is 1. \n",
+ "Therefore 1 additional intensive variables must be specified to fix the system. \n",
+ "(c) Number of degree of freedom of a mixture of liquid benzene,benzene vapour and helium gas is 2. \n",
+ "Therefore 2 additional intensive variables must be specified to fix the system. \n",
+ "(d) Number of degree of freedom of a mixture of salt and water designed to achieve a specific vapour pressure is 2. \n",
+ "Therefore 2 additional intensive variables must be specified to fix the system. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 19.2 Page No.564\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculating the number of degrees to freedom'''\n",
+ "\n",
+ "# Use phase rule to get degree of freedom(F) = 2-P+C \n",
+ "# (a)\n",
+ "N1 = 5.;\n",
+ "P1 = 1.; \t\t\t# Number of phases present,here 1 gas \n",
+ "C1 = 3. ;\t\t\t#Number of independent components present,here 3 because 3 elements(C,O and H)\n",
+ "F1 = 2-P1+C1 ;\t\t\t#Number of degree of freedom\n",
+ "print ' (a) Number of degree of gas composed of CO,CO2,H2,H2O and CH4 is %i. \\n \\\n",
+ "Therefore %i additional intensive variables must be specified to fix the system. '%(F1,F1)\n",
+ "\n",
+ "# (b)\n",
+ "N2 = 4.;\n",
+ "P2 = 4. ;\t\t\t# Number of phases present,here 3 different solid phases and 1 gas phase\n",
+ "C2 = 3. ;\t\t\t#Number of components present, here 3 because 3 elements(Zn,O and C) ,you can also use method explained \n",
+ " #in Appendix L1\n",
+ "F2 = 2.-P2+C2 ;\t\t#Number of degree of freedom\n",
+ "print '(b) Number of degree of freedom of a mixture of ZnO(s), C(s) ,CO(g) and Zn(s) is %i. \\n \\\n",
+ "Therefore %i additional intensive variables must be specified to fix the system. '%(F2,F2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) Number of degree of gas composed of CO,CO2,H2,H2O and CH4 is 4. \n",
+ " Therefore 4 additional intensive variables must be specified to fix the system. \n",
+ "(b) Number of degree of freedom of a mixture of ZnO(s), C(s) ,CO(g) and Zn(s) is 1. \n",
+ " Therefore 1 additional intensive variables must be specified to fix the system. \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.3 Page No :576"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bubble point calculation'''\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "P_atm = 1. ;\t\t\t#[atm]\n",
+ "P = 760. ;\t\t\t#[mm of Hg]\n",
+ "x_1 = 4./100 ;\t\t\t# Mole fraction of hexane in liquid phase\n",
+ "# Constant A,B and C for Antoine eqn. of n_hexane \n",
+ "A1 = 15.8366;\n",
+ "B1 = 2697.55 ;\n",
+ "C1 = -48.784;\n",
+ "# Constant A,B and C for Antoine eqn. of n_octane\n",
+ "A2 = 15.9798;\n",
+ "B2 = 3127.60 ;\n",
+ "C2 = -63.633;\n",
+ "\n",
+ "# Calculations\n",
+ "# Solve for bubble point temperature by eqn. obtained by using Antoine equation\n",
+ "def f(T):\n",
+ " return math.exp(A1-(B1/(C1+T)))*x_1 + math.exp(A2-(B2/(C2+T)))*(1-x_1) - P\n",
+ "T = fsolve(f,390)[0] ;\t\t\t# Bubble point temperature \n",
+ "\n",
+ "print 'Bubble point temperature is %.1f K'%T\n",
+ "\n",
+ "# Composition of first vapour\n",
+ "# Get vapour pressure of hexane and octane from Perry, it is\n",
+ "vp_1 = 3114. ;\t\t\t# vapour pressure of hexane-[mm of Hg]\n",
+ "vp_2 = 661. ;\t\t\t# vapour pressure of octane-[mm of Hg]\n",
+ "y_1 = vp_1*x_1/P ;\t\t\t# Mole fraction of hexane in vapour phase\n",
+ "y_2 = 1- y_1 ;\t\t\t#Mole fraction of octane in vapour phase\n",
+ "\n",
+ "# Results\n",
+ "print ' Composition of first vapour. '\n",
+ "print 'Component Mole fraction. '\n",
+ "print 'n_hexane %.3f'%y_1\n",
+ "print ' n_octane %.3f'%y_2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bubble point temperature is 393.6 K\n",
+ " Composition of first vapour. \n",
+ "Component Mole fraction. \n",
+ "n_hexane 0.164\n",
+ " n_octane 0.836\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.4 Page no. 577"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculating the fraction of liquid that will remain in equilibrium'''\n",
+ "\n",
+ "# Variables\n",
+ "# Basis : 100 g solution\n",
+ "F = 100. ;\t\t\t# Amount of solution-[g]\n",
+ "P_atm = 1. ;\t\t\t#[atm]\n",
+ "P = 760. ;\t\t\t# Total pressure -[mm of Hg]\n",
+ "wf_hex = 68.6/100 ;\t\t\t#Weight fraction of hexane in mixture\n",
+ "wf_tol = 31.4/100 ;\t\t\t#Weight fraction of toluene in mixture\n",
+ "mw_hex = 86.17 ;\t\t\t# Mol.wt. of hexane-[g]\n",
+ "mw_tol = 92.13 ;\t\t\t# Mol.wt. of toluene-[g]\n",
+ "\n",
+ "# Calculations\n",
+ "mol_hex = wf_hex *F/mw_hex ;\t\t\t# moles of hexane-[g mol]\n",
+ "mol_tol = wf_tol*F/mw_tol ;\t\t\t # moles of toluene-[g mol]\n",
+ "mol_total = mol_hex + mol_tol ;\t\t\t# Total moles in mixture-[g mol]\n",
+ "molf_hex = mol_hex/mol_total ;\t\t\t# Mole fraction of hexane \n",
+ "molf_tol = mol_tol/mol_total ;\t\t\t# Mole fraction of toluene \n",
+ "# Get vapour pressure of hexane and toluene at 80 deg. C from Perry, it is\n",
+ "vp_hex = 1020. ;\t\t\t# vapour pressure of hexane-[mm of Hg]\n",
+ "vp_tol = 290. ;\t\t\t# vapour pressure of toluene-[mm of Hg]\n",
+ "K_hex = vp_hex/P ;\t\t\t# K-value of hexane\n",
+ "K_tol = vp_tol/P ;\t\t\t# K-value of toluene\n",
+ "rec_K_hex = 1/K_hex ;\t\t\t# Reciprocal of K-value of hexane\n",
+ "rec_K_tol = 1/K_tol ;\t\t\t# Reciprocal of K-value of toluene\n",
+ "\n",
+ "# Let L/F = x, then use eqn. 19.11 to find x(L/F) \n",
+ "def g(x):\n",
+ " return (molf_hex)/(1-x*(1-rec_K_hex)) + (molf_tol)/(1-x*(1-rec_K_tol))-1\n",
+ "\n",
+ "x = fsolve(g,1)[0] ;\t\t\t# L/F value\n",
+ "\n",
+ "# Results\n",
+ "print ' Fraction of liquid(L/F) that will remain at equilibrium after vaporization is %.3f. '%x\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Fraction of liquid(L/F) that will remain at equilibrium after vaporization is 0.744. \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 19.5 Page no. 578\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Seperation of virus from a culture'''\n",
+ "\n",
+ "# Variables\n",
+ "Vo = 3.0 ;\t\t\t# Initial volume of the solution containing the culture and virus-[L]\n",
+ "Vp = 0.1 ;\t\t\t# Volume of the polymer solution added to the vessel -[L]\n",
+ "Kpc = 100. ;\t\t\t# Partition coefficient for virus(cp/cc) between two phases\n",
+ "\n",
+ "# Calculations\n",
+ "Vc = Vo ;\t\t\t# At equilibrium -[L]\n",
+ "cp_by_co = Vo/(Vp+(Vo/Kpc)) ;\t\t\t\n",
+ "Fr_rec = cp_by_co*(Vp/Vo) ;\t\t\n",
+ "\n",
+ "# Results\n",
+ "print ' Fraction of the initial virus in the culture phase that is recovered in the polymer phase is %.2f . '%Fr_rec\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Fraction of the initial virus in the culture phase that is recovered in the polymer phase is 0.77 . \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch2.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch2.ipynb
new file mode 100644
index 00000000..d803af44
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch2.ipynb
@@ -0,0 +1,941 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Fluid statics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.1 page no : 40\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate specific weight of water\n",
+ "\n",
+ "# variables\n",
+ "g=32.2; #ft/s^2\n",
+ "rho_water=62.3; #lbm/ft^3\n",
+ "\n",
+ "# calculation\n",
+ "#specific weoight=(density)*(acceleration due to gravity)\n",
+ "specific_wt=rho_water*g; #lbm.ft/ft^3.s^2\n",
+ "\n",
+ "#1 lbf=32.2 lbm.ft/s^2\n",
+ "specific_wt=specific_wt/32.2; #lbf/ft^3\n",
+ "\n",
+ "# result\n",
+ "print \"Specific weight of water is\" ,specific_wt , \"lbf/ft^3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific weight of water is 62.3 lbf/ft^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.2 page no : 40\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc pressure at depth of 304.9m\n",
+ "\n",
+ "# variables\n",
+ "d=304.9; #m\n",
+ "rho_water=1024.; #Kg/m^3\n",
+ "g=9.81; #m/s^2\n",
+ "p_atm=101.3; #KPa\n",
+ "\n",
+ "# calculation\n",
+ "#gauge pressure=(desity)*(acc. due to gravity)*(depth)\n",
+ "p_depth=p_atm+rho_water*g*d/1000.0; #KPa\n",
+ "\n",
+ "# result\n",
+ "print \"pressure at the depth is\" , (p_depth) , \"KPa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure at the depth is 3164.154656 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.3 page no : 41\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#gauge pressure=(density)*(acc. due to gravity)*(depth)\n",
+ "\n",
+ "# variables\n",
+ "rho_oil=55.; #lbm/ft^3\n",
+ "g=32.2; #ft/s^2\n",
+ "d=60.; #ft (depth of oil cylinder)\n",
+ "\n",
+ "# calculation and result\n",
+ "gauge_pressure=rho_oil*g*d/32.2; #lbf/ft^2\n",
+ "print \"Gauge pressure is\",\n",
+ "print gauge_pressure,\n",
+ "print \"lbf/ft^2\"\n",
+ "\n",
+ "#1 ft=12 in\n",
+ "gauge_pressure=gauge_pressure/144.0; #lbf/in^2\n",
+ "print \"Gauge pressure is\",\n",
+ "print gauge_pressure,\n",
+ "print \"lbf/in^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gauge pressure is 3300.0 lbf/ft^2\n",
+ "Gauge pressure is 22.9166666667 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.4 page no : 42\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the pressures\n",
+ "import math\n",
+ "\n",
+ "# varirbles\n",
+ "#calc of density of air at a certain height\n",
+ "p_atm=14.7; #psia\n",
+ "T=289.; #K\n",
+ "\n",
+ "#P2=P1*exp^(-(acc. due to gravity)*(mass of air)*(height)/(universal gas const.)/(temp.))\n",
+ "g=9.81; #m/s^2\n",
+ "R=8314; #N.m^2/Kmol/K\n",
+ "\n",
+ "#for height of 1000 ft=304.8m\n",
+ "h=304.8; #m\n",
+ "p_1000=14.7*math.exp(-g*29*h/R/289);\n",
+ "print \"pressure at 1000ft is\",\n",
+ "print p_1000,\n",
+ "print \"psia\"\n",
+ "\n",
+ "#for height of 10000 ft=3048m\n",
+ "h=3048.; #m\n",
+ "p_10000=p_atm*math.exp(-g*29.*h/R/289.);\n",
+ "print \"pressure at 10000ft is\",\n",
+ "print p_10000,\n",
+ "print \"psia\"\n",
+ "\n",
+ "#for height of 100000 ft=30480m\n",
+ "h=30480.; #m\n",
+ "p_100000=14.7*math.exp(-g*29.*h/R/289.);\n",
+ "print \"pressure at 100000ft is\",\n",
+ "print p_100000,\n",
+ "print \"psia\","
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure at 1000ft is 14.1789512072 psia\n",
+ "pressure at 10000ft is 10.2467246829 psia\n",
+ "pressure at 100000ft is 0.398102276652 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.5 page no : 42\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc pressuer at different heights considering on density change in air\n",
+ "\n",
+ "# variables\n",
+ "p_atm=14.7; #psia\n",
+ "g=9.81; #m/s^2\n",
+ "\n",
+ "#P2=P1*[1-(acc. due to gravity)*(mass of air)*(height)/(univ. gas const.)/(temp.)]\n",
+ "T=289.; #K\n",
+ "R=8314. #N.m^2/Kmol/K\n",
+ "\n",
+ "\n",
+ "# calculation and result\n",
+ "#for height of 1000ft=304.8m\n",
+ "h=304.8 #m\n",
+ "p_1000=p_atm*(1-g*29*h/R/T)\n",
+ "print \"pressure at 1000ft is\",\n",
+ "print p_1000,\n",
+ "print \"psia\"\n",
+ "\n",
+ "#for height of 10000ft=3048m\n",
+ "h=3048. #m\n",
+ "p_10000=p_atm*(1-g*29*h/R/T)\n",
+ "print \"pressure at 10000ft is\",\n",
+ "print p_10000,\n",
+ "print \"psia\"\n",
+ "\n",
+ "#for height of 100000ft=30480m\n",
+ "h=30480. #m\n",
+ "p_100000=p_atm*(1-g*29*h/R/T)\n",
+ "print \"pressure at 100000ft is\",\n",
+ "print p_100000,\n",
+ "print \"psia\"\n",
+ "\n",
+ "#NOTE that the pressure comes out to be negative at 100000ft justifying that density of air changes with altitude"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure at 1000ft is 14.1694926079 psia\n",
+ "pressure at 10000ft is 9.39492607874 psia\n",
+ "pressure at 100000ft is -38.3507392126 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.6 page no : 45\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate the atmosphere\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "#calc atm pressure on a storage tank roof\n",
+ "p_atm=14.7; #psia\n",
+ "\n",
+ "#diameter of roof is 120ft\n",
+ "d_roof=120.; #ft\n",
+ "\n",
+ "# calculation\n",
+ "#force=(pressure)*(area)\n",
+ "f_roof=p_atm*(math.pi)*d_roof**2/4.*144; #lbf ;144 because 1ft=12inch\n",
+ "\n",
+ "# result\n",
+ "print \"Force exerted by atmosphere on the roof is\",\n",
+ "print f_roof,\n",
+ "print \"lbf\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force exerted by atmosphere on the roof is 23940443.9848 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.7 page no : 45\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate net pressure.\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "#calc atm pressure on a storage tank roof\n",
+ "p_atm=14.7; #psia\n",
+ "\n",
+ "#diameter of roof is 120ft\n",
+ "d_roof=120.; #ft\n",
+ "#force=(atm. pressure + gauge pressure)*(area)\n",
+ "#gauge pressure=(desity)*(acc. due to gravity)*(depth)\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "g=32.2; #ft/s^2\n",
+ "\n",
+ "# calculation\n",
+ "#depth of water on roof=8 inch=o.667 ft\n",
+ "h=0.667; #ft\n",
+ "gauge_pressure=rho_water*g*h/32.2*(math.pi)*d_roof**2/4.; #lbf\n",
+ "\n",
+ "# result\n",
+ "print gauge_pressure"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "469965.799032\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.8 page no : 46\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc the total force on a lock gate\n",
+ "\n",
+ "# variables\n",
+ "#lock gate has water on one side and air on the other at atm. pressure\n",
+ "w=20.; #m (width of the lock gate)\n",
+ "h=10.; #m (height of the lock gate)\n",
+ "p_atm=1.; #atm\n",
+ "rho_water=1000.; #Kg/m^3\n",
+ "g=9.81 #m/s^2\n",
+ "\n",
+ "# calculation\n",
+ "#for a small strip of dx height at the depth of x on the lock gate\n",
+ "#net pressure on strip = (p_atm+(rho_water)*g*x) - p_atm\n",
+ "#thus, net pressure on strip = (rho_water)*g*x\n",
+ "#force on strip = (rho_water*g*x)*w.dx = (rho_water)*g*w*(x.dx)\n",
+ "#force on lock gate = integration of force on strip fromm h=0 to h=10\n",
+ "#integration(x.dx) = x^2/2\n",
+ "#for h=0 to h=10; integration (x.dx) = h^2/2\n",
+ "force_lockgate=(rho_water)*g*w*h**2/2;\n",
+ "\n",
+ "# result\n",
+ "print \"The net force on the lock gate is\",force_lockgate/10**6,\"MN\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net force on the lock gate is 9.81 MN\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.9 page no : 49\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc thickness of an oil storage\n",
+ "sigma_tensile=20000. #lbf/in^2 (tensile stress is normally 1/4 rupture stress)\n",
+ "\n",
+ "#max pressure is observed at the bottom of the storage\n",
+ "p_max=22.9; #lbf/in^2\n",
+ "\n",
+ "#diameter of storaeg tank = 120ft =1440in\n",
+ "d=1440.; #in\n",
+ "\n",
+ "# calculation\n",
+ "t=(p_max)*d/sigma_tensile/2; #in\n",
+ "\n",
+ "# result\n",
+ "print \"Thichness of the storage tank is\",\n",
+ "print t,\n",
+ "print \"in\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thichness of the storage tank is 0.8244 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.10 page no : 50\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc thickness of a storage tank\n",
+ "\n",
+ "# variables\n",
+ "p_working=250.0; #lbf/in^2\n",
+ "\n",
+ "#diameter of the cylinder = 10ft = 120in\n",
+ "d=120.0; #in\n",
+ "sigma_tensile=20000.; #lbf/in^2\n",
+ "\n",
+ "# calculation\n",
+ "t=p_working*d/sigma_tensile/2; #in\n",
+ "\n",
+ "# result\n",
+ "print \"Thichness of the storage tank is\",\n",
+ "print t,\n",
+ "print \"in\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thichness of the storage tank is 0.75 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.11 page no : 53\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc payload of a helium balloon\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "p_atm=1.; #atm\n",
+ "T=293.; #K\n",
+ "d=3.; #m (diameter of the balloon)\n",
+ "\n",
+ "# calculation\n",
+ "#buoyant force=(density of air)*g*(volume of balloon)\n",
+ "#weight of balloon = (density of helium)*g*(volume of balloon)\n",
+ "#density for gases = PM/RT\n",
+ "#payload of balloon = buoyant force - weight\n",
+ "V_balloon=(math.pi)*d**3/6.; #m^3\n",
+ "R=8.2*10**(-2); #m^3.atm/mol/K\n",
+ "M_air=29.; #Kg/Kmol\n",
+ "M_he=4.; #Kg/Kmol\n",
+ "g=9.81; #m/s^2\n",
+ "payload=(V_balloon)*g*p_atm*(M_air-M_he)/R/T; #N\n",
+ "\n",
+ "# result\n",
+ "print \"Payload of the balloon is\",\n",
+ "print payload,\n",
+ "print \"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Payload of the balloon is 144.307841185 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.12 page no : 54\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#wooden block floating in two phase mix of water and gasoline\n",
+ "\n",
+ "# variables\n",
+ "#calc fraction of block in water\n",
+ "SG_wood=0.96; #Specific gravity\n",
+ "SG_gasoline=0.72;\n",
+ "\n",
+ "# calculation\n",
+ "#Let r be the ratio - V_water/V_wood\n",
+ "r=(SG_wood-SG_gasoline)/(1-SG_gasoline);\n",
+ "\n",
+ "# result\n",
+ "print \"Fraction of wood in water\",\n",
+ "print r"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fraction of wood in water 0.857142857143\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.13 page no : 54\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc gauge pressure of cylinder in a manometer\n",
+ "\n",
+ "# variables\n",
+ "#height of water above pt.C = 2.5ft\n",
+ "rho_water=62.3; #lbm/ft^3;\n",
+ "h1=2.5; #ft\n",
+ "rho_gas=0.1; #lbm/ft^3\n",
+ "h2=0.5; #ft (height of gas)\n",
+ "g=32.2; #ft/s^2\n",
+ "\n",
+ "# calculation\n",
+ "gauge_pressure=((rho_water)*g*h1+(rho_gas)*g*h2)/144/32.2 #lbf/in^2\n",
+ "\n",
+ "# result\n",
+ "print \"Gauge pressure is\",\n",
+ "print gauge_pressure,\n",
+ "print \"lbf/in^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gauge pressure is 1.08194444444 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.14 page no : 56\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc pressure diff between two tanks in a two liquid manometer\n",
+ "rho_water=62.3; #lbm/ft^3\n",
+ "SG_oil=1.1;\n",
+ "rho_oil=SG_oil*(rho_water);\n",
+ "g=32.2; #ft/s^2\n",
+ "h1_1=1.; #ft\n",
+ "h1_2=2.; #ft\n",
+ "h2_1=2.; #ft\n",
+ "h2_2=1.; #ft\n",
+ "\n",
+ "# calculation\n",
+ "p_diff=((rho_water)*g*(h1_1-h1_2)+(rho_oil)*g*(h2_1-h2_2))/32.2/144.0; #lbf/in^2\n",
+ "\n",
+ "# result\n",
+ "print \"The pressure difference is\",\n",
+ "print p_diff,\n",
+ "print \"lbf/in^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference is 0.0432638888889 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.15 page no : 57\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc pressure of gauge through a spring piston system\n",
+ "\n",
+ "# variables\n",
+ "k=10000.; #N/m (spring constant)\n",
+ "x=0.025; #m (displacement in spring)\n",
+ "A=0.01; #m^2 (area of piston)\n",
+ "\n",
+ "# calculation\n",
+ "gauge_pressure=k*x/A/1000.; #KPa\n",
+ "\n",
+ "# result\n",
+ "print \"The gauge pressure is\",\n",
+ "print gauge_pressure,\n",
+ "print \"KPa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gauge pressure is 25.0 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.16 page no : 60\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc pressure diff at the mouth of the fire place\n",
+ "\n",
+ "# variables\n",
+ "g=32.2; #ft/s^2\n",
+ "h=20.; #ft (height of fireplace)\n",
+ "rho_air=0.075; #lbm/ft^3\n",
+ "T_air=293.0; #K (surrounding temperature)\n",
+ "T_fluegas=422.0; #K\n",
+ "\n",
+ "# calculation\n",
+ "p_diff=g*h*(rho_air)*(1-(T_air/T_fluegas))/32.2/144; #lbf/in^2\n",
+ "\n",
+ "# result\n",
+ "print \"The pressure difference is\",\n",
+ "print p_diff,\n",
+ "print \"lbf/in^2\","
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference is 0.00318424170616 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.17 page no : 64\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate the gauge pressure at the bottom of the tank.\n",
+ "\n",
+ "# variables\n",
+ "rho_water=1000. #Kg/m^3\n",
+ "g=9.81; #m/s^2\n",
+ "h=5.; #m (depth of water)\n",
+ "\n",
+ "# calculation and result\n",
+ "#for elevator not accelerated\n",
+ "p_gauge=(rho_water)*g*h/1000.0; #KPa\n",
+ "print \"THe gauge pressure is\",\n",
+ "print p_gauge,\n",
+ "print \"KPa\"\n",
+ "\n",
+ "#for elevator accelerated at 5m/s^2 in upward direction\n",
+ "a=5.; #m/s^2\n",
+ "p_gauge=(rho_water)*(g+a)*h/1000.0; #KPa\n",
+ "print \"THe gauge pressure is\",\n",
+ "print p_gauge,\n",
+ "print \"KPa\"\n",
+ "\n",
+ "#for elevator accelerated at 5m/s^2 in downward direction\n",
+ "a=5.; #m/s^2\n",
+ "p_gauge=(rho_water)*(g-a)*h/1000.0; #KPa\n",
+ "print \"THe gauge pressure is\",\n",
+ "print p_gauge,\n",
+ "print \"KPa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "THe gauge pressure is 49.05 KPa\n",
+ "THe gauge pressure is 74.05 KPa\n",
+ "THe gauge pressure is 24.05 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.18 page no : 65\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate angle\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "#angle free surface makes with the horizontal in an accelerated body\n",
+ "a=1.; #ft/s^2\n",
+ "g=32.2; #ft/s^2\n",
+ "\n",
+ "# calculation\n",
+ "theta=math.atan(a/g); #radians\n",
+ "theta=theta*180./math.pi; #degrees\n",
+ "\n",
+ "# result\n",
+ "print \"The angle made by free surface with the horizontal is\",\n",
+ "print theta,\n",
+ "print \"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The angle made by free surface with the horizontal is 1.77880031567 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.19 page no : 66\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc the height to which liq in a cylinder rises when rotated\n",
+ "\n",
+ "import math\n",
+ "# variables\n",
+ "f=78/60.0; #rps\n",
+ "r=0.15; #m\n",
+ "g=9.81; #m/s^2\n",
+ "\n",
+ "# calculation\n",
+ "#omega=2*(%pi)*f\n",
+ "z=((2*(math.pi)*f)**2)*r**2/2/g; #m\n",
+ "\n",
+ "# result\n",
+ "print \"The liquid in the cylinder rises to a height of\",\n",
+ "print z,\n",
+ "print \"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The liquid in the cylinder rises to a height of 0.0765120708158 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " example 2.20 page no : 67\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calc thickness of liquid strip at the bottom of the industrial centrifuge\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "#Let difference between heights at bottom and top be d\n",
+ "d=20.; #in\n",
+ "r_a=14.; #in\n",
+ "f=1000/60.; #rps\n",
+ "g=32.2; #ft/s^2\n",
+ "\n",
+ "# calculation\n",
+ "r_b=((r_a)**2-2*(d)*g*12/(2*(math.pi)*f)**2)**0.5; #in\n",
+ "\n",
+ "# result\n",
+ "print \"The thickness of water strip at bottom of industrial centrifuge\",\n",
+ "print r_b,\n",
+ "print \"in\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thickness of water strip at bottom of industrial centrifuge 13.9495728181 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch20.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch20.ipynb
new file mode 100644
index 00000000..9286e99b
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch20.ipynb
@@ -0,0 +1,166 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 20 : Liquid and Gases in Equilibrium with Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 20.1 Page no. 594\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Fitting Adsorption Isotherms to Experimental Data\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "# Variables\n",
+ "p_CO2 = [0,25,50,100,200,400,760] ;\t\t\t# Values of partial pressure of CO2 - [mm Hg]\n",
+ "y = [0,6.69*10**-2,9.24*10**-2,0.108,0.114,0.127,0.137] ;\t\t\t# adsorption of CO2 -[g adorbed / g seives]\n",
+ "\n",
+ "# Results\n",
+ "plt.plot(p_CO2,y);\n",
+ "plt.title('Figure E20.1 The Freundlich and Langmuir iotherms coincide for the adsorption of CO2 on 5A molecular seives');\n",
+ "plt.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAqcAAAEICAYAAABiR12iAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlclPX+Pv5rFAxlR5BtQFRQlhQ1XNBStMU0RZMyqEyL\nU2ZZadavbBNaNCsry05H+5RmFnrOyaNkSGZGWoqcFPUkmmiiLGKKIqDAMMPr98d8uWXYsdGZe7ye\njwcPnbm319xz3++55l7eoxERARERERGRFehg6QKIiIiIiOownBIRERGR1WA4JSIiIiKrwXBKRERE\nRFaD4ZSIiIiIrAbDKRERERFZjcsOp87OzsjLyzNjKdeWDh064I8//rB0GVfM9OnT8fLLLwMAMjIy\nEBAQoAy7/vrrsW3btlbnYal1lJeXhw4dOqC2tvaqL/tqOHHiBJydndGeXuTa+p41JSkpCVOnTr2s\nadXAHG3hwoUL8fDDDzc7PCgoCD/88MNlzfvjjz+Gt7c3XFxccO7cucstsVmW3F+sZdu6nH3KHE6d\nOoURI0bAxcUFzz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cFRYWYvPmzZdV38yZM3Ho0CGkpqbiuuuuMxl255134rfffsO6detQVVWF\n5ORk9O/fH717925yXgaDAVVVVdDr9TAYDKiurjbb3cP1Q8yjjz6KBQsWICcnB4DxaG79C4sv16OP\nPooXXnhBCV+nT59GamoqAKB3796oqqpCWloaampq8Prrr6O6urpN842OjoadnR0++OAD1NTUYN26\ndfjvf//bpmn/9re/4eWXX8aRI0cgIti/fz/Onj3b5LgthbyKigo4OzujS5cuOHToED7++OMWl1t/\nfU+ZMgUffPABCgsLce7cObz55put1q3T6VBVVaX86fV6VFRUoHPnznB1dcXZs2dNLlhv7TXExcXh\nm2++wc6dO6HT6ZCUlPSXjtD3798fa9asgV6vx6+//oqvv/66xYarPctKSEjA66+/jjNnzuDMmTN4\n9dVXlQvmvb29UVJSYvJlsqV5Dx48GM7OznjrrbdQWVkJg8GA3377Tbnrtrlp6z/f0vx//fVX7Nq1\nCzU1NejSpQscHBya/GD19fXF2LFj8dhjj6G0tBQ1NTVKv64JCQlYsWIF9u3bh+rqarzwwgsYOnRo\nk0fYW6rljjvuwMmTJ7FkyRJUV1ejvLwcWVlZjcaLi4vDxo0b8csvv0Cn0+GVV14x+RBqaT9uzbhx\n43D48GGkpKRAr9dj7dq1OHToEMaPH9+m1wAY3+OW2vCG2lNvS/tQ9+7dERUVhfnz56OmpgY///yz\n8gEKGG/q/N///geDwQBnZ2fY29ujY8eO0Gq1GDZsGObNm4fq6mrs378fn332Ge6///4W6969ezf+\n85//QK/X4/3334eDg4MS1lpaBwEBAZe1vKa09n619l699dZbWLlyJd555x0lsO3btw8JCQkAjEeb\ntVot7r77bhw/fhw1NTX47rvv8NRTTyE5OVk5i9jS52hDCQkJeO+995CXl4eKigq88MILiI+PR4cO\nzceN5l5H3VlbEUFWVhY++OADTJw4EYDxZq7Q0FAcPnwY+/btU25m1mq1ypG9v+Luu+/Gt99+i61b\nt6KmpgaLFy+Gg4MDhg0b1mjclrbx++67D1u2bMG//vUv6PV6lJSUKAfF+vf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0nIiIH\nDv1jr2cAAAUVSURBVByQyMhI0el0cuzYMenVq5cYDIYrXuPJkyclOztbRETKy8uld+/ekpOTY3V1\niohcuHBBRERqampkyJAhsn37dqusU0Rk8eLFcu+998qECRNExPredxGRoKAgKSkpMXnOGut84IEH\n5NNPPxUR43tfWlpqlXWKiBgMBvHx8ZETJ05YXY3Hjh2THj16SFVVlYiITJkyRVauXGl1dRK1FcMp\nqcKOHTtkzJgxyuOFCxfKwoULLViR8QOhfjjt06ePFBcXi4gxGPbp00dEjEco6h/pHTNmjOzcufPq\nFisiEydOlO+//96q67xw4YJERUXJb7/9ZpV15ufny8033yxbt25VjpxaY51BQUFy5swZk+esrc7S\n0lLp0aNHo+etrc463333ndx4441WWWNJSYn07t1bzp49KzU1NTJ+/HjZvHmz1dVJ1Fa8IYpUoS19\nqFraqVOn4O3tDQDw9vbGqVOnAABFRUUmPQ9Yova8vDxkZ2djyJAhVllnbW0t+vfvD29vb4waNQoR\nERFWWeecOXPw9ttvo0OHS02nNdap0Whwyy23ICoqCp988olV1nns2DF4eXnhwQcfxMCBA/Hwww/j\nwoULVldnnTVr1iAhIQGA9a1LDw8PzJ07F4GBgfDz84ObmxtuvfVWq6uTqK0YTkkV1NK3aR2NRtNi\nzVfz9VRUVCAuLg5LliyBs7Nzozqsoc4OHTpg7969KCgowLZt2/Djjz82qsPSdW7cuBHdunXDgAED\nmu3SzBrqBIBffvkF2dnZ2LRpEz766CNs3769UR2WrlOv12PPnj147LHHsGfPHjg6OuLNN99sVIel\n6wQAnU6Hb775BnfffXeTNVi6xqNHj+L9999HXl4eioqKUFFRgdWrVzeqw9J1ErUVwympQlv6ULU0\nb29vFBcXAwBOnjyJbt26AWi6b1d/f/+rUlNNTQ3i4uIwdepUTJo0yWrrrOPq6oo77rgDu3fvtro6\nd+zYgdTUVPTo0QMJCQnYunUrpk6danV1AoCvry8AwMvLC3feeSeysrKsrk6tVgutVotBgwYBAO66\n6y7s2bMHPj4+VlUnAGzatAk33HADvLy8AFjfPvTrr79i2LBh6Nq1K+zs7DB58mTs3LnTKtclUVsw\nnJIqqKEf1NjYWHz++ecAgM8//1wJg7GxsVizZg10Oh2OHTuG3NxcDB48+IrXIyJITExEeHg4Zs+e\nbbV1njlzBqWlpQCAyspKfP/99xgwYIDV1blgwQLk5+fj2LFjWLNmDUaPHo0vvvjC6uq8ePEiysvL\nAQAXLlzA5s2b0bdvX6ur08fHBwEBATh8+DAAYMuWLYiIiMCECROsqk4ASElJUU7p19ViTTWGhoYi\nMzMTlZWVEBFs2bIF4eHhVrkuidrEwte8ErVZWlqa9O7dW3r16iULFiywaC3x8fHi6+sr9vb2otVq\n5bPPPpOSkhK5+eabm+y25Y033pBevXpJnz59JD09/arUuH37dtFoNBIZGal0hbNp0yarq3P//v0y\nYMAAiYyMlL59+8pbb70lImJ1ddaXkZGh3K1vbXX+8ccfEhkZKZGRkRIREaHsK9ZWp4jI3r17JSoq\nSvr16yd33nmnlJaWWl2dFRUV0rVrVykrK1Oes7YaRUQWLVqkdCX1wAMPiE6ns8o6idpCI8LfgyQi\nIiIi68DT+kRERERkNRhOiYiIiMhqMJwSERERkdVgOCUiIiIiq8FwSkRERERWg+GUiIiIiKzG/w8p\nc1U4iFUHtQAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x1c0f410>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 20.2 page no. 596\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Seperation of Biochemicals by Solvent Extraction\n",
+ "\n",
+ "# Variables\n",
+ "G = 1000.0 ;\t\t\t# Volume of solution - [L]\n",
+ "S_ad = 1.56 ;\t\t\t# amount of Steptomycin adsorbed per gram resin-[g strep./g resin]\n",
+ "cn_S = 6. ;\t\t\t# Concentration of streptomycin solution-[g/L]\n",
+ "\n",
+ "# Calculations\n",
+ "# Assume equilibrium occurs so that total(max) amount of streptomycin is adsorbed \n",
+ "max_S = cn_S*G ;\t\t\t# Maximum streptomycin adsorbed-[g]\n",
+ "#Use streptomycin balance to get amount of resin required \n",
+ "R = max_S/S_ad ;\t\t\t#Amount of resin required to adsorb required amount of streptomycin\n",
+ "\n",
+ "# Results\n",
+ "print 'Amount of resin required to adsorb required amount of streptomycin is %.0f g . '%R\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of resin required to adsorb required amount of streptomycin is 3846 g . \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 20.3 page no. 596\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Combination of an Adsorption Isotherm with a Meterial Balance\n",
+ "\n",
+ "# Variables\n",
+ "G = 1000. ;\t\t\t# Volume of solution - [L]\n",
+ "x = [19.2,17.2,12.6,8.6,3.4,1.4] ;\t\t\t# concentration of solute- [g/L] \n",
+ "ac = [0,0.01,0.04,0.08,0.20,0.40] ;\t\t\t# Activated charcoal added-[g/1000g sol] \n",
+ "# Assume all concentration can be treated as g solute/1000 g sol.\n",
+ "\n",
+ "# Calculations\n",
+ "y2 = (x[0]-x[1])/ac[1] ;\t\t\t# -[ g solute/g carbon]\n",
+ "y3 = (x[0]-x[2])/ac[2] ;\t\t\t# -[ g solute/g carbon]\n",
+ "y4 = (x[0]-x[3])/ac[3] ;\t\t\t# -[ g solute/g carbon]\n",
+ "y5 = (x[0]-x[4])/ac[4] ;\t\t\t# -[ g solute/g carbon]\n",
+ "y6 = (x[0]-x[5])/ac[5] ;\t\t\t# -[ g solute/g carbon]\n",
+ "\n",
+ "# Use polymath to get Freundlich isotherm to bo y= 37.919*x**(0.583)\n",
+ "y = 37.919*x[5]**(0.583) ;\t\t\t#From Freundlich isotherm\n",
+ "A_by_G = (x[0]-x[5])/y ;\t\t\t#Minimum mss of activated carbon required- [g carbon/1000 g sol.]\n",
+ "\n",
+ "# Results\n",
+ "print 'Minimum mass of activated carbon required is %.2f g carbon/1000 g sol. '%A_by_G\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum mass of activated carbon required is 0.39 g carbon/1000 g sol. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch21.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch21.ipynb
new file mode 100644
index 00000000..741dcc7d
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch21.ipynb
@@ -0,0 +1,246 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 21 : Energy Terminology Concepts and Units"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 21.1 Page no : 616"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Mechanical work by a gas on a piston showing how the path affects the value of the work\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.1 ;\t\t\t# Volume of gas initially -[cubic metres]\n",
+ "V2 = 0.2 ;\t\t\t# Volume of gas finally -[cubic metres]\n",
+ "T1 = 300 ;\t\t\t# Temperature of gas initially -[K]\n",
+ "P1 = 200 ;\t\t\t# Pressure of gas finally -[kPa]\n",
+ "R = 8.314 ;\t\t\t# Universal gas constant \n",
+ "n = (P1*V1)/(T1*R) ;\t\t\t# Moles of gas taken-[kg mol]\n",
+ "#You are asked to calculate work by eqn. 21.1 , but you do not know the F(force) exerted by gas , so write F = P.A, multiply divide A and eqn 21.1 reduces to W= integate(P.dv)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# Isobaric process see fig E21.1b to see the path followed\n",
+ "def f(V):\n",
+ " return -(P1)\n",
+ "W= quad(f,V1,V2)[0] ;\t\t\t# Work done by gas on piston -[kJ]\n",
+ "print ' (a)Work done by gas on piston for isobaric process is %.0f kJ . ',W\n",
+ "\n",
+ "def f1(V):\n",
+ " return -(T1*R*n/V)\n",
+ "W= quad(f1,V1,V2)[0] ;\t\t\t# Work done by gas on piston -[kJ]\n",
+ "print '(b)Work done by gas on piston for isothermal process is %.2f kJ . ',W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a)Work done by gas on piston for isobaric process is %.0f kJ . -20.0\n",
+ "(b)Work done by gas on piston for isothermal process is %.2f kJ . -13.8629436112\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 21.2 page no. 624\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Specific Kinetic energy for a Flowing fluid\n",
+ "\n",
+ "# Variables\n",
+ "id_ = 3. ;\t\t\t# Internal diameter of tube-[cm]\n",
+ "Vf = 0.001 ;\t\t\t# Volume flow rate of water in tube-[cubic meter/s]\n",
+ "rho = 1000. ;\t\t\t# Assumed density of water-[kg/cubic meter] \n",
+ "\n",
+ "# Calculations\n",
+ "rad = id_/2. ;\t\t\t# Radius of tube -[ cm]\n",
+ "a = 3.14*rad**2 ;\t\t\t# Area of flow of tube -[squqre centimeter]\n",
+ "v = Vf*(100)**2/a ;\t\t\t# Velocity of water in tube - [m/s]\n",
+ "KE = v**2/2. ;\t\t\t# Specific(mass=1kg) kinetic energy of water in tube -[J/kg]\n",
+ "\n",
+ "# Results\n",
+ "print 'Specific kinetic energy of water in tube is %.2f J/kg . '%KE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific kinetic energy of water in tube is 1.00 J/kg . \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 21.3 page no. 626\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of potential Energy change of water\n",
+ "\n",
+ "# Variables\n",
+ "# Let water level in first reservoir be the reference plane\n",
+ "h = 40. ;\t\t\t# Difference of water-[ft]\n",
+ "g = 32.2 ;\t\t\t# acceleration due to gravity-[ft/square second]\n",
+ "\n",
+ "# Calculations\n",
+ "PE=g*h/(32.2*778.2) ;\t\t\t#\t\t\t# Specific(mass=1kg) potential energy of water -[Btu/lbm]\n",
+ "\n",
+ "# Results\n",
+ "print 'Specific potential energy of water is %.4f Btu/lbm . '%PE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific potential energy of water is 0.0514 Btu/lbm . \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 21.4 page no : 629"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "# Calculation of an internal energy change using the heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "#Constant volume process \n",
+ "mol_air = 10. ;\t\t\t# Moles of air-[kg mol]\n",
+ "T1 = 60.+273 ;\t\t\t# Initial temperature of air-[K]\n",
+ "T2 = 30.+273 ;\t\t\t# final temperature of air-[K]\n",
+ "# Additional data needed\n",
+ "Cv = 2.1*10.**4 ; \t\t\t# Specific heat capacity of air at constant volume-[J/(kg mol*C)]\n",
+ "\n",
+ "# Calculations\n",
+ "def f(T):\n",
+ " return mol_air*Cv\n",
+ "del_U = quad(f,T1,T2)[0] ;\t\t\t#Change in internal energy-[J]\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in internal energy is %.1e J . '%del_U\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in internal energy is -6.3e+06 J . \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 21.7 page no : 633"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Enthalpy change\n",
+ "\n",
+ "# Variables\n",
+ "#Constant pressure process \n",
+ "mol_air = 10. ;\t\t\t# Moles of air-[kg mol]\n",
+ "T1 = 60+273 ;\t\t\t# Initial temperature of air-[K]\n",
+ "T2 = 30+273 ;\t\t\t# final temperature of air-[K]\n",
+ "\n",
+ "# Calculations\n",
+ "# Additional data needed\n",
+ "Cp = 2.9*10**4 ;\t\t\t# Specific heat capacity of air at constant pressure-[J/(kg mol*C)]\n",
+ "# Use eqn. 21.11 for del_H\n",
+ "def f(T):\n",
+ " return mol_air*Cp\n",
+ "\n",
+ "del_H = quad(f,T1,T2)[0] ;\t\t\t#Change in enthalpy-[J]\n",
+ "print 'Change in enthalpy is %.1e J . '%del_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in enthalpy is -8.7e+06 J . \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch22.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch22.ipynb
new file mode 100644
index 00000000..01acfa93
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch22.ipynb
@@ -0,0 +1,292 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 22 : Introduction to Energy Balances for Process without Reaction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 22.1 page no. 651\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of the energy balance to a closed system\n",
+ "\n",
+ "# Variables\n",
+ "#Assume that properties of water can be used to substitute properties of solution\n",
+ "# Given\n",
+ "V = 1.673 ;\t\t\t# Volume of closed vessel-[cubic metre]\n",
+ "m = 1. ;\t\t\t# mass of saturated liquid vaporized-[kg]\n",
+ "Pi = 1. ;\t\t\t# Initial pressure -[atm]\n",
+ "Ti = 10. ;\t\t\t# Initial temperature -[degree C]\n",
+ "Pf = 1. ;\t\t\t# final pressure -[atm]\n",
+ "Tf = 100. ;\t\t\t# final temperature -[degree C]\n",
+ "\n",
+ "# Use steam table to obtain additional information at given condition\n",
+ "Ui = 35. ;\t\t\t# Initial enthalpy-[kJ/kg]\n",
+ "Uf = 2506.0 ;\t\t\t# Final enthalpy -[kJ/kg]\n",
+ "\n",
+ "# Calculations\n",
+ "# Use eqn. 22.2 after modifiying it using given conditions(W = 0,del_KE = 0 and del_PE = 0 )\n",
+ "Q = m*(Uf - Ui) ;\t\t\t# Heat transferred to the vessel - [kJ]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat transferred to the vessel is %.1f kJ . '%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transferred to the vessel is 2471.0 kJ . \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 22.2 page no. 652\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of U using American engineering units\n",
+ "\n",
+ "# Variables\n",
+ "# Given\n",
+ "T1 = 80. ;\t\t\t# Initial temperature -[degree F]\n",
+ "T1 = 40. ;\t\t\t# final temperature -[degree F]\n",
+ "\n",
+ "# Additional data obtained from steam table at given temperatures and corresponding vapour pressures\n",
+ "p1 = 0.5067 ;\t\t\t# Initial saturation pressure-[psia]\n",
+ "p2 = 0.1217 ;\t\t\t# Final saturation pressure-[psia]\n",
+ "V1 = 0.01607 ;\t\t\t# Initial specific volume - [cubic feet/lb]\n",
+ "V2 = 0.01602 ;\t\t\t# Final specific volume - [cubic feet/lb]\n",
+ "H1 = 48.02 ;\t\t\t#Initial specific enthalpy -[Btu/lb]\n",
+ "H2 = 8.05 ;\t\t\t# Final specific enthalpy -[Btu/lb]\n",
+ "\n",
+ "# Calculations\n",
+ "del_P = p2 - p1 ;\t\t\t# Change in pressure -[psia]\n",
+ "del_V = V2 - V1 ;\t\t\t# Change in specific volume -[cubic feet/lb]\n",
+ "del_H = H2 - H1 ;\t\t\t# Change in specific enthalpy -[Btu/lb]\n",
+ "del_pV = p2*144*V2/778. - p1*144*V1/778. ;\t\t\t# Change in pv-[Btu]\n",
+ "del_U = del_H - del_pV ;\t\t\t# Change in specific internal energy - [Btu/lb]\n",
+ "del_E = del_U ;\t\t\t# Change in specific total energy(since KE=0,PE=0 and W=0) -[Btu/lb]\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in pressure is %.3f psia . '%del_P\n",
+ "print 'Change in specific volume is %.5f cubic feet/lb (negligible value) . '%del_V\n",
+ "print 'Change in specific enthalpy is %.2f Btu/lb . '%del_H\n",
+ "print 'Change in specific internal energy is %.2f Btu/lb . '%del_U\n",
+ "print 'Change in specific total energy is %.2f Btu/lb . '%del_E\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in pressure is -0.385 psia . \n",
+ "Change in specific volume is -0.00005 cubic feet/lb (negligible value) . \n",
+ "Change in specific enthalpy is -39.97 Btu/lb . \n",
+ "Change in specific internal energy is -39.97 Btu/lb . \n",
+ "Change in specific total energy is -39.97 Btu/lb . \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 22.3 page no. 662\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# use of the general energy balance to analyze an open , unsteady-state system\n",
+ "\n",
+ "# Variables\n",
+ "#Lets take tank to be system\n",
+ "# Given\n",
+ "T = 600. ; \t\t\t# Temperature of steam -[K]\n",
+ "P = 1000. ;\t\t\t# Pressure of steam -[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "# Additional data for steam obtained from CD database at T and P\n",
+ "U = 2837.73 ;\t\t\t# Specific internal energy-[kJ/kg]\n",
+ "H = 3109.44 ;\t\t\t# Specific enthalpy -[kJ/kg]\n",
+ "V = 0.271 ;\t\t\t# Specific volume -[cubic metre/kg]\n",
+ "# By the reduced equation \n",
+ "Ut2 = H ;\t\t\t# Internal energy at final temperature-[kJ/kg]\n",
+ "\n",
+ "# Results\n",
+ "print 'The specific internal energy at final temperature is %.2f kJ/kg. Now use two properties\\\n",
+ "of the steam (P = %i kPa and Ut2 = %.2f kJ/kg) to find final temperature (T) from steam table. \\\n",
+ "From steam table we get T = 764 K.'%(Ut2,P,Ut2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The specific internal energy at final temperature is 3109.44 kJ/kg. Now use two propertiesof the steam (P = 1000 kPa and Ut2 = 3109.44 kJ/kg) to find final temperature (T) from steam table. From steam table we get T = 764 K.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 22.4 page no. 669\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# application of the energy balance to a open, steady-state system, a heat exchanger\n",
+ "\n",
+ "# Variables\n",
+ "# Take milk plus water in tank to be system\n",
+ "# Given\n",
+ "T1_water = 70. ;\t\t\t# Temperature of entering water -[degree C]\n",
+ "T2_water = 35. ;\t\t\t# Temperature of exiting water -[degree C]\n",
+ "T1_milk = 15. ;\t\t\t#Temperature of entering milk -[degree C]\n",
+ "T2_milk = 25. ;\t\t\t#Temperature of exiting milk -[degree C]\n",
+ "\n",
+ "# Get additional data from steam table for water and milk,assuming milk to have same properties as that of water.\n",
+ "H_15 = 62.01 ;\t\t\t#Change in specific internal energy-[kJ/kg]\n",
+ "H_25 = 103.86 ;\t\t\t#Change in specific internal energy-[kJ/kg]\n",
+ "H_35 = 146.69 ;\t\t\t#Change in specific internal energy-[kJ/kg]\n",
+ "H_70 = 293.10 ;\t\t\t#Change in specific internal energy-[kJ/kg]\n",
+ "\n",
+ "# Assumptions to simplify Equation 22.8 are:\n",
+ "print 'Assumptions to simplify Equation 22.8 are:'\n",
+ "print '1. Change in KE and PE of system = 0.'\n",
+ "print '2. Q = 0 ,because of way we picked the system,it is is well insulated.'\n",
+ "print '3. W = 0,work done by or on the system.'\n",
+ "\n",
+ "# Calculations\n",
+ "#Basis m_milk = 1 kg/min , to directly get the answer .\n",
+ "m_milk = 1 ;\t\t\t# Mass flow rate of milk-[kg/min]\n",
+ "# By applying above assumtions eqn. 22.8 reduces to del_H = 0 .Using it get m_water-\n",
+ "m_water = (m_milk*(H_15 - H_25))/(H_35 - H_70) ; \t\t\t# Mass flow rate of water-[kg/min]\n",
+ "m_ratio = m_water/m_milk ;\t\t\t# Mass flow rate of water per kg/min of milk-[kg/min]\n",
+ "\n",
+ "# Results\n",
+ "print 'Mass flow rate of water per kg/min of milk is %.2f (kg water/min )/(kg milk/min).'%m_ratio\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumptions to simplify Equation 22.8 are:\n",
+ "1. Change in KE and PE of system = 0.\n",
+ "2. Q = 0 ,because of way we picked the system,it is is well insulated.\n",
+ "3. W = 0,work done by or on the system.\n",
+ "Mass flow rate of water per kg/min of milk is 0.29 (kg water/min )/(kg milk/min).\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 22.5 page no. 670\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of power needed to pump water in an open, steady state system\n",
+ "\n",
+ "# Variables\n",
+ "# Take pipe between initial and final level of water\n",
+ "# Given\n",
+ "h_in = -20. ;\t\t\t# Depth of water below ground-[ft]\n",
+ "h_out = 5. ;\t\t\t# Height of water level above ground-[ft]\n",
+ "h = h_out - h_in ;\t\t\t# Total height to which water is pumped-[ft]\n",
+ "V = 0.50 ;\t\t\t# Volume flow rate of water - [cubic feet/s]\n",
+ "ef = 100.; \t\t\t# Efficiency of pump - [%] \n",
+ "g = 32.2; \t\t\t# Acceleration due to gravity -[ft/square second] \n",
+ "gc = 32.2 ;\t\t\t#[(ft*lbm)/(second square*lbf)]\n",
+ "\n",
+ "M = V * 62.4 ;\t\t\t# mass flow rate - [lbm/s]\n",
+ "PE_in = 0 ;\t\t\t# Treating initial water level to be reference level\n",
+ "\n",
+ "# Calculations\n",
+ "PE_out = (M*g*h*1.055)/(gc*778.2) ;\t\t\t# PE of discharged water -[lbm*(square feet/square second)]\n",
+ "W = PE_out - PE_in ;\t\t\t#Work done on system = power delivered by pump, (since we are using mass flow rate and pump efficiency is 100 % , so W = Power) -[kW]\n",
+ "\n",
+ "# Results\n",
+ "print 'The electric power required by the pump is %.2f kW. '%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electric power required by the pump is 1.06 kW. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch23.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch23.ipynb
new file mode 100644
index 00000000..6773ceb9
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch23.ipynb
@@ -0,0 +1,538 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Chapter 23 : Calculation of Enthalpy Changes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 23.1 Page no. 686\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Graph that showing the heat of vaporization of water\n",
+ "\n",
+ "%pylab inline\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Variables\n",
+ "# Given\n",
+ "x_Tl = [90,92,97,100] ;\t\t\t# Temperature of saturated liquid- [degree C]\n",
+ "x_Tg = [100,102,107,110] ;\t\t\t# Temperature of saturated vapour- [degree C]\n",
+ "y_Hl = [376.9,385.3,406.3,418.6] ;\t\t\t# Enthalpy change of saturated liquid -[kJ/kg]\n",
+ "y_Hg = [2256.44,2251.2,2237.9,2229.86] ;\t\t\t# Enthalpy change of saturated vapour -[kJ/kg]\n",
+ "\n",
+ "# Results\n",
+ "plot(x_Tl,y_Hl,x_Tg,y_Hg);\n",
+ "show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAD9CAYAAABazssqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFTxJREFUeJzt3V9MW+fBx/HfCbjKXiVRclFMZkdyF0yJgwN0lZOLZXOV\nQBOkMapMqGRrSEOmCTQtVaOp20U7mLRCL7aJpkPqBZ1QJhUytUA0rRYXk9O10mCjRJrqrHE0omJj\n2DKGRFZekZDzXkTxG8J/7GDI8/1IEeb4nOPHJyfnax+Og2Xbti0AgJE2ZXoAAIDMIQIAYDAiAAAG\nIwIAYDAiAAAGIwIAYLBFIzA8PKxnnnlGe/fuVWFhod58801JUkNDg9xut0pKSlRSUqIPPvgguUxT\nU5O8Xq8KCgrU29ubnD4wMCC/3y+v16szZ848pKcDAFgJa7HPCYyOjmp0dFTFxcW6efOmvvrVr6q7\nu1sXLlzQ1q1b9fLLL8+aPxKJ6Pjx4/rLX/6ieDyuw4cPKxqNyrIsBQIBvfXWWwoEAiovL9cPf/hD\nHTly5KE/QQDAwhZ9J5Cbm6vi4mJJ0pYtW7Rnzx7F43FJ0nzt6OnpUXV1tRwOhzwej/Ly8tTX16dE\nIqHJyUkFAgFJ0okTJ9Td3Z3u5wIAWKFl/0zg+vXrGhwc1IEDByRJ586dU1FRkWprazUxMSFJGhkZ\nkdvtTi7jdrsVj8fnTHe5XMmYAAAyJ3s5M928eVPf/va31dLSoi1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L9h+v9/et2+f\n/a1vfcseHR3N8CjXr+eff97euXOn7XA4bLfbbb/zzjuL7os///nP7d27d9tPPvmkHQqFMjjy9Wkl\n2/O9996z9+7daxcXF9tPPfWU/fvf/z7Do19fHtyWbW1tdldXl+12u+3NmzfbTqfTPnLkSHL+le6b\nlm1z+QgAmIrfLAYABiMCAGAwIgAABiMCAGAwIgAABiMCAGCw/wMDiUOF/Sr3yAAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x33aa350>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 23.2 page no. 687\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# comparison of various sources to estimate the heat of vaporization\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "# Basis : 1 g mol\n",
+ "R = 8.314 * 10**-3 ;\t\t\t# Ideal gas constant -[kJ/(g mol * K)]\n",
+ "Hv = 30.20 ;\t\t\t# Experimental value of heat of vaporization of acetone -[kJ/g] \n",
+ "\n",
+ "# additional needed data for acetone from Appendix D\n",
+ "T = 329.2 ;\t\t\t# Normal boiling point of acetone - [K]\n",
+ "Tc = 508.0 ;\t\t\t# Critical temperature of acetone - [K]\n",
+ "Pc = 47.0 ;\t\t\t# Critical presure of acetone -[atm]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Tbc = T/Tc ;\t\t\t# variable required in etimation equations\n",
+ "lnPc = math.log(Pc) ;\t\t\t# variable required in etimation equations\n",
+ "\n",
+ "B = 2940.46 ;\n",
+ "C = -35.93 ;\n",
+ "\n",
+ "del_Hv1 = (R*B*T**2)/((C+T)**2) ;\t\t\t#Heat of vapourization -[kJ/g]\n",
+ "d1 = (abs(Hv - del_Hv1)*100)/Hv ;\t\t\t# differece of experimental and calculated value -[%]\n",
+ "print '(a) Heat of vapourization of acetone is %.2f kJ/g mol. And differece of experimental and calculated value is %.1f %% . '%(del_Hv1,d1);\n",
+ "\n",
+ "del_Hv2 = R*T*((3.978*Tbc - 3.938 +1.555*lnPc)/(1.07 - Tbc)) ;\t\t\t#Heat of vapourization -[kJ/g]\n",
+ "d2 = (abs(Hv - del_Hv2)*100)/Hv ;\t\t\t# differece of experimental and calculated value -[%]\n",
+ "print ' (b) Heat of vapourization of acetone is %.2f kJ/g mol. And differece of experimental and calculated value is %.1f %% . '%(del_Hv2,d2);\n",
+ "\n",
+ "\n",
+ "del_Hv3 = 1.093*R*Tc*((Tbc*(lnPc-1))/(0.93-Tbc)) ;\t\t\t#Heat of vapourization -[kJ/g]\n",
+ "d3 = (abs(Hv - del_Hv3)*100)/Hv ;\t\t\t# differece of experimental and calculated value -[%]\n",
+ "print ' (c) Heat of vapourization of acetone is %.2f kJ/g mol. And differece of experimental and calculated value is %.1f %% . '%(del_Hv3,d3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Heat of vapourization of acetone is 30.80 kJ/g mol. And differece of experimental and calculated value is 2.0 % . \n",
+ " (b) Heat of vapourization of acetone is 30.01 kJ/g mol. And differece of experimental and calculated value is 0.6 % . \n",
+ " (c) Heat of vapourization of acetone is 30.24 kJ/g mol. And differece of experimental and calculated value is 0.1 % . \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 23.3 Page no. 693\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Conversion of units in a heat capacity equation\n",
+ "\n",
+ "# Variables\n",
+ "c = 2.675*10**4 #*.4536)/(1055*1.8) ;\n",
+ "d = 42.27#*.4536)/(1055*1.8) ;\n",
+ "e = 1.425*10**-2#*.4536)/(1055*1.8) ;\n",
+ "# Calculations\n",
+ "#Now convert Tk (Temperature in K) to TF (temperature in F) to get answer of form x + yT - zT**2,where\n",
+ "x = c + d*460/1.8 - e*((460/1.8)**2) ;\n",
+ "y = d/1.8;\n",
+ "z = e/(1.8*1.8) ;\n",
+ "\n",
+ "# Results\n",
+ "print 'The required answer is %.2e + (%.2e)T - (%.3e) T**2 Btu/(lb mol*F) , where T is in degree F . '%(x,y,z)\n",
+ "\n",
+ "print \"Note answer in textbook seems wrong by order of 10^-3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required answer is 3.66e+04 + (2.35e+01)T - (4.398e-03) T**2 Btu/(lb mol*F) , where T is in degree F . \n",
+ "Note answer in textbook seems wrong by order of 10^-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 23.4 page no. 694\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Fitting Heat Capacity Equation to Heat Capacity Data\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# Take all 18 experimenta data in an array Cp\n",
+ "Cpi = [39.87,39.85,39.90,45.16,45.23,45.17,50.72,51.03,50.90,56.85,56.80,57.02,63.01,63.09,63.14,69.52,69.68,69.63] ;\t\t\t# Array of Cpi(Heat capacity) values\n",
+ "# Take corresponding temperatures in array T\n",
+ "Ti = [300,300,300,400,400,400,500,500,500,600,600,600,700,700,700,800,800,800] ;\t\t\t# array of Ti\n",
+ "Ti_sqr = [300**2,300**2,300**2,400**2,400**2,400**2,500**2,500**2,500**2,600**2,600**2,600**2,700**2,700**2,700**2,800**2,800**2,800**2] ;\t\t\t# array of Ti**2\n",
+ "Ti_cub = [300**3,300**3,300**3,400**3,400**3,400**3,500**3,500**3,500**3,600**3,600**3,600**3,700**3,700**3,700**3,800**3,800**3,800**3];\t\t\t# array of Ti**3\n",
+ "Ti_qd = [300**4,300**4,300**4,400**4,400**4,400**4,500**4,500**4,500**4,600**4,600**4,600**4,700**4,700**4,700**4,800**4,800**4,800**4];\t\t\t# array of Ti**4\n",
+ "Cpi_Ti = [39.87*300,39.85*300,39.90*300,45.16*400,45.23*400,45.17*400,50.72*500,51.03*500,50.90*500,56.85*600,56.80*600,57.02*600,63.01*700,63.09*700,63.14*700,69.52*800,69.68*800,69.63*800] ;\t\t\t# Array of Cpi(Heat capacity)*Ti values\n",
+ "Cpi_Ti_sqr = [39.87*300**2,39.85*300**2,39.90*300**2,45.16*400**2,45.23*400**2,45.17*400**2,50.72*500**2,51.03*500**2,50.90*500**2,56.85*600**2,56.80*600**2,57.02*600**2,63.01*700**2,63.09*700**2,63.14*700**2,69.52*800**2,69.68*800**2,69.63*800**2] ;\t\t\t# Array of Cpi(Heat capacity)*Ti**2 values\n",
+ "\n",
+ "n = 18. ;\t\t\t# Number of data\n",
+ "# Calculations\n",
+ "\n",
+ "from numpy import matrix\n",
+ "# Solve equations (a),(b) & (c) simultaneously using matrix\n",
+ "a = matrix([[n,sum(Ti),sum(Ti_sqr)],[sum(Ti),sum(Ti_sqr),sum(Ti_cub)],[sum(Ti_sqr),sum(Ti_cub),sum(Ti_qd)]]) ;\t\t\t# Matrix of coefficients of unknown\n",
+ "b = matrix([[sum(Cpi)],[sum(Cpi_Ti)],[sum(Cpi_Ti_sqr)]]) ;\t\t\t# Matrix of constants\n",
+ "x = (a)**-1 * b ;\t\t\t# Matrix of solutions a = x(1), b = x(2) , c = x(3) \n",
+ "\n",
+ "# Results\n",
+ "print 'The solution is Cp = %.2f + %.3e T + %.2e T**2 .Therefore coefficients are as follows :'%(x[0],x[1],x[2])\n",
+ "print ' a = %.2f. b = %.3e . c = %.2e .'%(x[0],x[1],x[2])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The solution is Cp = 25.44 + 4.371e-02 T + 1.44e-05 T**2 .Therefore coefficients are as follows :\n",
+ " a = 25.44. b = 4.371e-02 . c = 1.44e-05 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 23.5 page no : 695"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of H for a gas mixture using heat capacity equation for each component\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "# Variables\n",
+ "# Basis : 1 g mol of gas\n",
+ "#Given\n",
+ "T1 = 550. ;\t\t\t# Initial temperature - [degree F]\n",
+ "T2 = 200. ;\t\t\t# Final temperature - [degree F]\n",
+ "CO2 = 9.2/100 ;\t\t\t# Mole fraction \n",
+ "CO = 1.5/100 ;\t\t\t# Mole fraction \n",
+ "O2 = 7.3/100 ;\t\t\t# Mole fraction \n",
+ "N2 = 82.0/100 ;\t\t\t#Mole fraction \n",
+ "\n",
+ "# Calculations\n",
+ "# Additional data needed :\n",
+ "a_N2 = 6.895;\t\t\t# constant\n",
+ "b_N2 = 0.7624*10**-3;\t\t\t# coefficient of T\n",
+ "c_N2 = -0.7009*10**-7;\t\t\t# coefficient of square T\n",
+ "a_O2 = 7.104 ;\t\t\t# constant\n",
+ "b_O2 = (0.7851*10**-3);\t\t\t# coefficient of T\n",
+ "c_O2 = (-0.5528*10**-7); \t\t\t# coefficient of square T\n",
+ "a_CO2 = 8.448;\t\t\t# constant\n",
+ "b_CO2 = 5.757*10**-3;\t\t\t# coefficient of T\n",
+ "c_CO2 = -21.59*10**-7;\t\t\t# coefficient of square T\n",
+ "d_CO2 = 3.059*10**-10;\t\t\t# coefficient of cubic T\n",
+ "a_CO = 6.865 ;\t\t\t# constant\n",
+ "b_CO = 0.8024*10**-3;\t\t\t# coefficient of T\n",
+ "c_CO = -0.7367*10**-7; \t\t\t# coefficient of square T\n",
+ "\n",
+ "# New coefficients after multiplying mole fraction of each component\n",
+ "a1_N2 = 6.895*N2 ;\t\t\t# constant\n",
+ "b1_N2 = N2*0.7624*10**-3; \t\t\t# coefficient of T\n",
+ "c1_N2 = (-0.7009*10**-7)*N2; \t\t\t# coefficient of square T \n",
+ "a1_O2 = 7.104*O2 ;\t\t\t# constant\n",
+ "b1_O2 = (0.7851*10**-3)*O2;\t\t\t# coefficient of T\n",
+ "c1_O2 = (-0.5528*10**-7)*O2; \t\t\t# coefficient of square T\n",
+ "a1_CO2 = 8.448*CO2;\t\t\t# constant\n",
+ "b1_CO2 = (5.757*10**-3)*CO2;\t\t\t# coefficient of T\n",
+ "c1_CO2 = (-21.59*10**-7)*CO2; \t\t\t# coefficient of square T\n",
+ "d1_CO2 = (3.059*10**-10)*CO2; \t\t\t# coefficient of cubic T\n",
+ "a1_CO = 6.865*CO;\t\t\t# constant\n",
+ "b1_CO = (0.8024*10**-3)*CO;\t\t\t# coefficient of T\n",
+ "c1_CO = (-0.7367*10**-7)*CO; \t\t\t# coefficient of square T\n",
+ "\n",
+ "# Get net coefficients of T , square T and cubic T by adding them\n",
+ "a_net = a1_N2+a1_CO2+a1_CO+a1_O2; \t\t\t#Net constant\n",
+ "b_net = b1_N2+b1_CO2+b1_CO+b1_O2; \t\t\t#Net coefficient of T\n",
+ "c_net = c1_N2+c1_CO2+c1_CO+c1_O2 ;\t\t\t#Net coefficient of square T\n",
+ "d_net = d1_CO2;\t\t\t#Net coefficient of cubic T\n",
+ "\n",
+ "def f(T):\n",
+ " return (a_net )+( b_net*T) + (c_net*(T**2)) + (d_net*(T**3))\n",
+ " \n",
+ "del_H = quad(f,T1,T2)[0] \t\t\t# Change in enthalpy of gas over given range-[Btu/lb mol gas]\n",
+ "\n",
+ "# Results\n",
+ "print ' Change in enthalpy of gas over given range is %.0f Btu/lb mol gas . '%del_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Change in enthalpy of gas over given range is -2616 Btu/lb mol gas . \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 23.6 page no. 700 \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the Change in Enthalpy for a Gas using Tabulated Enthalpy Values\n",
+ "\n",
+ "\n",
+ "# Solution \n",
+ "#Given\n",
+ "N2 = 1. ;\t\t\t# Moles of N2 - [kg mol]\n",
+ "P = 100. ;\t\t\t# Pressure of gas - [kPa] \n",
+ "T1 = 18. ;\t\t\t# Initial temperature - [degree C]\n",
+ "T2 = 1100. ;\t\t\t# Final temperature - [degree C]\n",
+ "\n",
+ "# Calculations\n",
+ "# In the book it is mentioned to use tables in Appendix D6 to calculate enthalpy change, we get \n",
+ "H_T1 = 0.524;\t\t\t# Initial enthalpy -[kJ/kg mol]\n",
+ "H_T2 = 34.715 ;\t\t\t# Final enthalpy - [kJ/kg mol]\n",
+ "del_H = H_T2 - H_T1 ;\t\t\t# Change in enthalpy - [kJ/kg]\n",
+ "\n",
+ "# Results\n",
+ "print ' Change in enthalpy of N2 over given range is %.3f kJ/kg mol N2 . '%del_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Change in enthalpy of N2 over given range is 34.191 kJ/kg mol N2 . \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 23.7 page no. 701\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Use of Steam Tables to Calculate Change in Enthalpy\n",
+ "\n",
+ "# Solution Fig.E23.7\n",
+ "\n",
+ "# Variables\n",
+ "#Given\n",
+ "T1 = 640. ;\t\t\t# Initial temperature -[degree F]\n",
+ "T2 = 480. ;\t\t\t# Final temperature -[degree F]\n",
+ "P1 = 92. ;\t\t\t# Initial pressure -[psia]\n",
+ "P2 = 52. ;\t\t\t# Final pressure - [psia]\n",
+ "\n",
+ "\n",
+ "#From steam table\n",
+ "#At 90 psia\n",
+ "H1_600 = 1328.7 ;\t\t\t#H at 90 psia and 600 F-[Btu/lb]\n",
+ "H1_700 = 1378.1 ;\t\t\t#H at 90 psia and 700 F-[Btu/lb]\n",
+ "H2_600 = 1328.4 ;\t\t\t#H at 95 psia and 600 F-[Btu/lb]\n",
+ "H2_700 = 1377.8 ;\t\t\t#H at 95 psia and 700 F-[Btu/lb]\n",
+ "\n",
+ "# Calculations\n",
+ "H3_600 = H1_600+ ((H2_600-H1_600)/(95.-90))*(92-90);\t\t\t#H at 92 psia and 600 F-[Btu/lb]\n",
+ "H3_700 = H1_700+ ((H2_700-H1_700)/(95.-90))*(92-90);\t\t\t#H at 92 psia and 700 F-[Btu/lb]\n",
+ "H3_640 = H3_600+((H3_700-H3_600)/(700.-600))*(640-600);\t\t\t#H at 92 psia and 640 F-[Btu/lb]\n",
+ "\n",
+ "H1_450 = 1258.7 ;\t\t\t#H at 50 psia and 450 F-[Btu/lb]\n",
+ "H1_500 = 1282.6 ;\t\t\t#H at 50 psia and 500 F-[Btu/lb]\n",
+ "H2_450 = 1258.2 ;\t\t\t#H at 55 psia and 450 F-[Btu/lb]\n",
+ "H2_500 = 1282.2 ;\t\t\t#H at 55 psia and 500 F-[Btu/lb]\n",
+ "H3_450 = H1_450+ ((H2_450-H1_450)/(55.-50))*(52-50) ;\t\t\t#H at 52 psia and 450 F-[Btu/lb]\n",
+ "H3_500 = H1_500+ ((H2_500-H1_500)/(55.-50))*(52-50);\t\t\t#H at 52 psia and 500 F-[Btu/lb]\n",
+ "H3_480 = H3_450+((H3_500-H3_450)/(500.-450))*(480-450);\t\t\t# H at 52 psia and 480 F-[Btu/lb]\n",
+ "del_H = H3_480 - H3_640;\t\t\t# Change in enthalpy - [Btu/lb]\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in enthalpy is %.1f Btu/lb .'%del_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in enthalpy is -75.5 Btu/lb .\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 23.8 page no. 702\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Use of Steam Table when a Phase Change is involved to Calculate the final State of Water\n",
+ "\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "W = 4. ;\t\t\t# Mass of water -[kg]\n",
+ "Ti= 27.+273 ;\t\t\t# Initial temperature -[K]\n",
+ "Pi = 200. ;\t\t\t# Initial pressure -[kPa]\n",
+ "Pf = Pi ;\t\t\t# Final pressure -[kPa]\n",
+ "V1 = 0.001004 ;\t\t\t# Specific volume at Ti -[cubic metre/kg]\n",
+ "V2 = 1000. * V1 ;\t\t\t#Specific volume at final temperature(Tf) from given condition in problem - [cubic metre/kg]\n",
+ "va = 0.9024 ;\t\t\t# Specific volume -[cubic metre/kg]\n",
+ "Ta = 400. ;\t\t\t# [K]\n",
+ "vb = 1.025 ;\t\t\t# Specific volume -[cubic metre/kg]\n",
+ "Tb = 450. ;\t\t\t#[K]\n",
+ "vf = V2 ;\t\t\t# Final specific volume -[cubic metre/kg]\n",
+ " \n",
+ "# Calculations\n",
+ "m=(Tb - Ta)/(vb - va);\t\t\t# slope \n",
+ "Tf=Ta + m*(vf - va) ;\t\t\t# Final temperature - [K]\n",
+ "\n",
+ "# Results\n",
+ "print ' Final temperature is %.0f K.'%Tf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Final temperature is 441 K.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 23.9 page no. 704\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate Enthalpy Difference betwee two States by Pressure Enthalpy Chart for Butane\n",
+ "\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "mv = 1. ;\t\t\t# Mass of saturated vapour - [lb]\n",
+ "P1 = 2. ;\t\t\t# Initial pressure -[atm]\n",
+ "P2 = 20. ;\t\t\t# Final pressure -[atm]\n",
+ "H_2 = 179. ;\t\t\t# Specific enthalpy at 2 atm - [Btu/lb]\n",
+ "H_20 = 233. ;\t\t\t# Specific enthalpy at 20 atm - [Btu/lb]\n",
+ "V_2 = 3.00 ;\t\t\t# Specific volume at 2 atm - [cubic feet/lb]\n",
+ "V_20 = 0.30 ;\t\t\t# Specific volume at 20 atm - [cubic feet/lb]\n",
+ "T_2 = 72. ;\t\t\t# Temperature at 2 atm -[degree F]\n",
+ "T_20 = 239. ;\t\t\t# Temperature at 20 atm -[degree F]\n",
+ "\n",
+ "# Calculations\n",
+ "del_H = H_20 - H_2 ;\t\t\t# Change in specific enthalpy -[Btu/lb] \n",
+ "del_V = V_20 - V_2 ;\t\t\t# Change in specific volume -[cubic feet/lb] \n",
+ "del_T = T_20 - T_2 ;\t\t\t# Change in temperature -[degree F]\n",
+ "\n",
+ "# Results\n",
+ "print '(a) Change in specific enthalpy is %.0f Btu/lb.'%del_H\n",
+ "print ' (b) Change in specific volume is %.2f cubic feet/lb.'%del_V\n",
+ "print ' (c) Change in temperature is %.1f degree F.'%del_T\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Change in specific enthalpy is 54 Btu/lb.\n",
+ " (b) Change in specific volume is -2.70 cubic feet/lb.\n",
+ " (c) Change in temperature is 167.0 degree F.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch24.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch24.ipynb
new file mode 100644
index 00000000..00a323af
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch24.ipynb
@@ -0,0 +1,557 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 24 : Applications of Energy Balances in the Absence of Chemical Reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 24.1 page no. 720\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# simplification of the general energy balance\n",
+ "\n",
+ "# Solution Fig. E24.1\n",
+ "\n",
+ "# Assumptions to be made in eqn. 24.1 in following segment \n",
+ "print 'Assumptions to be made in eqn. 24.1 in following segments are:'\n",
+ "#(a)- 1 to 5\n",
+ "print '(a)- 1 to 5.'\n",
+ "print ' 1. Change in potential energy(del_PE) = 0(no change in level) .'\n",
+ "print ' 2. Probably change in kinetic energy(del_KE)=0 .'\n",
+ "print ' 3. Change in energy = 0 (process appears to be steady).'\n",
+ "print ' Result : Q + W = del_H.'\n",
+ "\n",
+ "#(b) 4 to 5\n",
+ "print '(b) 4 to 5.'\n",
+ "print ' 1. Q = W = 0 '\n",
+ "print ' 2. Probably change in kinetic energy(del_KE)=0.'\n",
+ "print ' 3. Change in energy = 0 (process appears to be steady).'\n",
+ "print ' Result : del_H = -del_PE . '\n",
+ "\n",
+ "#(c) 3 to 4\n",
+ "print '(c) 3 to 4.'\n",
+ "print ' 1. Q = W = 0 '\n",
+ "print ' 2. Probably change in kinetic energy(del_KE)=0.'\n",
+ "print ' 3. Change in energy = 0 (process appears to be steady).'\n",
+ "print ' Result : del_H = -del_PE . '\n",
+ "\n",
+ "#(d) 3 to 5\n",
+ "print '(d) 3 to 5.'\n",
+ "print ' 1. Q = W = 0 '\n",
+ "print ' 2. Probably change in kinetic energy(del_KE)=0.'\n",
+ "print ' 3. Change in energy = 0 (process appears to be steady).'\n",
+ "print ' 4. Change in potential energy(del_PE) = 0(no change in level) .'\n",
+ "print ' Result : del_H = 0 . '\n",
+ "\n",
+ "#(e)- 1 to 3\n",
+ "print '(e) 1 to 3.'\n",
+ "print ' 1. Change in potential energy(del_PE) = 0(no change in level) .'\n",
+ "print ' 2. Probably change in kinetic energy(del_KE)=0 .'\n",
+ "print ' 3. Change in energy = 0 (process appears to be steady).'\n",
+ "print ' Result : Q + W = del_H.'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumptions to be made in eqn. 24.1 in following segments are:\n",
+ "(a)- 1 to 5.\n",
+ " 1. Change in potential energy(del_PE) = 0(no change in level) .\n",
+ " 2. Probably change in kinetic energy(del_KE)=0 .\n",
+ " 3. Change in energy = 0 (process appears to be steady).\n",
+ " Result : Q + W = del_H.\n",
+ "(b) 4 to 5.\n",
+ " 1. Q = W = 0 \n",
+ " 2. Probably change in kinetic energy(del_KE)=0.\n",
+ " 3. Change in energy = 0 (process appears to be steady).\n",
+ " Result : del_H = -del_PE . \n",
+ "(c) 3 to 4.\n",
+ " 1. Q = W = 0 \n",
+ " 2. Probably change in kinetic energy(del_KE)=0.\n",
+ " 3. Change in energy = 0 (process appears to be steady).\n",
+ " Result : del_H = -del_PE . \n",
+ "(d) 3 to 5.\n",
+ " 1. Q = W = 0 \n",
+ " 2. Probably change in kinetic energy(del_KE)=0.\n",
+ " 3. Change in energy = 0 (process appears to be steady).\n",
+ " 4. Change in potential energy(del_PE) = 0(no change in level) .\n",
+ " Result : del_H = 0 . \n",
+ "(e) 1 to 3.\n",
+ " 1. Change in potential energy(del_PE) = 0(no change in level) .\n",
+ " 2. Probably change in kinetic energy(del_KE)=0 .\n",
+ " 3. Change in energy = 0 (process appears to be steady).\n",
+ " Result : Q + W = del_H.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 24.3 page no. 728\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of the energy balance.\n",
+ "\n",
+ "# Variables\n",
+ "# Given\n",
+ "m_CO2 = 10. ;\t\t\t# mass of CO2 - [lb]\n",
+ "Ti_CO2 = 80. ;\t\t\t# Initial temperature of CO2 - [degree F]\n",
+ "Vi = 4.0 ;\t\t\t# Initial volume of CO2-[cubic feet]\n",
+ "f_CO2 = 40./100 ;\t\t\t# Fraction of CO2 that convert to liquid finally \n",
+ "s_Vi = Vi /m_CO2 ;\t\t\t# Initial specific volume of CO2 - [cubic feet/lb]\n",
+ "s_Vf = s_Vi ;\t\t\t# Constant volume -[cubic feet/lb]\n",
+ "Pi = 300. ;\t\t\t# Intial pressure - [psia]\n",
+ "del_Hi = 160. ;\t\t\t# Intial change in specific enthalpy - [Btu/lb]\n",
+ "# Now again use chart to get fnal condition fixed by constant volume line and quality 0.6 , according to book it is \n",
+ "del_Hf = 81. ;\t\t\t# Final change in specific enthalpy - [Btu/lb]\n",
+ "Pf = 140. ;\t\t\t#Final pressure - [psia]\n",
+ "\n",
+ "# Calculations\n",
+ "Q = ((del_Hf - del_Hi) - (Pf * s_Vf * 144/778.2 - Pi * s_Vi * 144/778.2))*m_CO2 ;\t\t\t# Heat removed from the extinguisher -[Btu]\n",
+ "\n",
+ "# Results\n",
+ "print ' Heat removed from the extinguisher is %i Btu .'%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Heat removed from the extinguisher is -671 Btu .\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 24.4 page no. 730"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of the energy balance to plasma etching.\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "# Pick the system as gas plus heater \n",
+ "# Given\n",
+ "Pi = 1.5 ;\t\t\t# Intial pressure - [Pa]\n",
+ "Vi = 2*10**-3 ;\t\t\t# Initial volume of gas - [cubic metre]\n",
+ "Ti = 300 ;\t\t\t# Initial temperature - [K]\n",
+ "W = 480 ;\t\t\t# Work done by heater on system\n",
+ "t = 5 ;\t\t\t# Time for which current is supplied -[ min]\n",
+ "m_ht = 12 ;\t\t\t# Mass of the heater - [g]\n",
+ "C_ht = 0.35 ;\t\t\t# Heat capacity of heater - [ J/gK]\n",
+ "R = 8.314 ;\t\t\t# Ideal gas constant - [(Pa*cubic metre)/(g mol* K)]\n",
+ "\n",
+ "# It is assumed that heat transfer across system boundary for this short time is negligible , therefore Q = 0\n",
+ "# Using the above assumption the equation reduces to del_U = W, therefore \n",
+ "del_U = W ;\t\t\t# Change in nternal energy - [J]\n",
+ "\n",
+ "# Calculations\n",
+ "# Gas is assumed to be ideal, therefore get n by using pv = nRT\n",
+ "n = (Pi*Vi)/(R*Ti) ;\t\t\t# Number of moles of argon gas -[g mol]\n",
+ "Cp = (5./2)* R ;\t\t\t# Specific heat capacity of argon gas at constant pressure - [ J/gK]\n",
+ "Cv = Cp - R ;\t\t\t# Specific heat capacity of argon gas at constant volume - [ J/gK]\n",
+ "\n",
+ "def f(Tf):\n",
+ " return m_ht*C_ht*(Tf - Ti) + n*Cv*(Tf - Ti) - del_U\n",
+ " \n",
+ "Tf=fsolve(f,400) ;\t\t\t# Final temperature -[K] \n",
+ "\n",
+ "# Results\n",
+ "print ' Final temperature of gas is %.0f K .'%Tf\n",
+ " \n",
+ "Pf = (Tf/Ti)*Pi ;\t\t\t# Final pressure - [Pa]\n",
+ "print ' Final pressure in chamber is %.2f Pa .'%Pf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Final temperature of gas is 414 K .\n",
+ " Final pressure in chamber is 2.07 Pa .\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 24.5 page no. 732\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Energy balance applied to a batch process\n",
+ "\n",
+ "# Variables\n",
+ "# Pick the system as shown in above figure of book\n",
+ "# Given\n",
+ "m_water = 10. ;\t\t\t# Mass of water - [lb]\n",
+ "T_water = 35. ;\t\t\t# Temperature of water - [degree F]\n",
+ "m_ice = 4. ;\t\t\t# Mass of ice - [lb]\n",
+ "T_ice = 32. ;\t\t\t# Temperature of ice - [degree F]\n",
+ "m_stm = 6. ;\t\t\t# Initial mass of steam -[lb]\n",
+ "T_stm = 250. ;\t\t\t# Temperature of stm - [degree F]\n",
+ "p = 20. ;\t\t\t# Pressure of system -[psia]\n",
+ "\n",
+ "m_total = m_water + m_ice + m_stm ;\t\t\t# Mass of H2O in three phases initially -[lb]\n",
+ "\n",
+ "U_ice = -143.6 ;\t\t\t# Specific internal energy of ice -[Btu/lb]\n",
+ "U_water = 3.025 ;\t\t\t# Specific internal energy of water -[Btu/lb]\n",
+ "U_stm = 1092.25 ;\t\t\t# Specific internal energy of steam -[Btu/lb]\n",
+ "V_water = 0.0162 ;\t\t\t# Specific volume of water -[cubic feet/lb]\n",
+ "V_stm = 20.80 ;\t\t\t# Specific volume of steam -[cubic feet/lb]\n",
+ "V_total = m_stm*V_stm ;\t\t\t#Total volume of container ignoring volume of water and ice as they are neglgible\n",
+ "\n",
+ "# Calculations\n",
+ "V_sys = V_total/m_total ;\t\t\t# Specific volume of system -[cubic feet/lb]\n",
+ "U_sys =(m_water*U_water + m_ice*U_ice + m_stm*U_stm)/m_total ;\t\t\t# Final specific internal energy of system -[Btu/lb]\n",
+ "\n",
+ "T1 = 190 ;\t\t\t# assumed temperature\n",
+ "U1 = [157.17,1071.83] ;\t\t\t#specific internal energy of liquid and vapour respetively -[Btu/lb]\n",
+ "V1 = [0.0165,41.01] ;\t\t\t# Specific volume of liquid and vapour respetively -[cubic feet/lb]\n",
+ "x1 = V_sys/V1[1] ;\t\t\t# Quality of vapour\n",
+ "U1_sys = (1-x1)*U1[0] + x1*U1[1] \t\t\t# Specific internal energy of system at T1-[Btu/lb] \n",
+ "\n",
+ "T2 = 200. ;\t\t\t# assumed temperature\n",
+ "U2 = [168.11, 1073.96];\t\t\t# specific internal energy of liquid and vapour respetively -[Btu/lb]\n",
+ "V2 = [0.017, 33.601] ;\t\t\t# Specific volume of liquid and vapour respetively -[cubic feet/lb]\n",
+ "x2 = V_sys/V2[1] ; \t\t\t# Quality of vapour\n",
+ "U2_sys = (1-x2)*U2[0] + x2*U2[1] ;\t\t\t# Specific internal energy of system at T2-[Btu/lb] \n",
+ "\n",
+ "# Results\n",
+ "# Check whether assumption is right\n",
+ "if (U_sys > U1_sys ):\n",
+ " if ( U_sys <U2_sys):\n",
+ " print 'Assumption is right, now find exact temperature by interpolation between 2 assumed temperatures.'\n",
+ " else:\n",
+ " print 'Assumption is wrong, assume different T2.'\n",
+ "else:\n",
+ " print 'Assumption is wrong,assume different T1.'\n",
+ "\n",
+ "# Interpolation, to get final temperature corresponding to U_sys\n",
+ "T_sys = T1 + ((T2 - T1)*(U_sys - U1_sys))/(U2_sys - U1_sys)\n",
+ "\n",
+ "print ' The final temperature obtained by interpolation between 2 assumed temperatures is %.2f degree F.'%T_sys\n",
+ " \n",
+ "# Now obtain specific volume of vapour data at final temperature from steam table and use it to calculate x(quality) , according to book it is\n",
+ "V_vap = 39.35 ;\t\t\t#specific volume of vapour data at final temperature -[cubic feet/lb]\n",
+ "x = V_sys /V_vap ;\t\t\t# Quality of gas at final temperature\n",
+ " \n",
+ " \t\t\t#Final state\n",
+ "Vap = m_total*x ;\t\t\t# Mass of vapour at final state - [lb]\n",
+ "stm_con = m_stm - Vap ;\t\t\t# Mass of steam condenses - [lb]\n",
+ "\n",
+ "print 'Therefore, mass of steam condenses is %.2f lb.'%stm_con\n",
+ "\n",
+ "print \"Answer is wrong in book.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assumption is right, now find exact temperature by interpolation between 2 assumed temperatures.\n",
+ " The final temperature obtained by interpolation between 2 assumed temperatures is 191.03 degree F.\n",
+ "Therefore, mass of steam condenses is 2.83 lb.\n",
+ "Answer is wrong in book.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 24.6 page no : 736"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# application of the energy balance to pumping water\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "# Variables\n",
+ "# Pick the system as shown in above figure of book\n",
+ "# Given\n",
+ "h1 = -15 ;\t\t\t# Initial level of water from ground level -[ft]\n",
+ "h2 = 165 ;\t\t\t#Final level of water from ground level -[ft]\n",
+ "V_rate = 200 ;\t\t\t# Volume flow rate of water - [gal/hr]\n",
+ "Q1 = 30000 ;\t\t\t# Heat input by heater - [Btu/hr]\n",
+ "Q2 = 25000 ;\t\t\t# Heat lost by system -[Btu/hr]\n",
+ "T1 = 35 ;\t\t\t# Initial temperature of water - [degree F]\n",
+ "g = 32.2 ;\t\t\t# Acceleration due to gravity - [ft/ square second]\n",
+ "p_pump = 2 ;\t\t\t# Power of pump -[hp]\n",
+ "f_w = 55./100 ;\t\t\t# Fraction of rated horsepower that i used in pumping water \n",
+ "Cp = 1 ;\t\t\t# Specific heat capacity of water - [Btu/lb*F]\n",
+ "\n",
+ "# Calculations\n",
+ "m = V_rate * 8.33 ;\t\t\t# Total mass of water pumped -[lb]\n",
+ "del_PE = (m* g *(h2 - h1))/(32.2*778) ;\t\t\t# Change in PE - [Btu/hr]\n",
+ "Q = Q1 - Q2 ;\t\t\t# Net heat exchange -[Btu/hr]\n",
+ "W = 2* f_w * 60 * 33000/778 ;\t\t\t# Work on system - [Btu/hr]\n",
+ "del_H = Q + W - del_PE ;\t\t\t# By using reduced energy balance - [Btu/hr]\n",
+ "\t\t\t# Also del_H = m* Cp * (T2 - T1), all is known except T2 , solve for T2\n",
+ "def f(T2):\n",
+ " return m*Cp*(T2-T1) - del_H\n",
+ " \n",
+ "T2 = fsolve(f,40)[0] ;\t\t\t# Boiling point temperature \n",
+ "\n",
+ "# Results\n",
+ "print ' Final temperature of water that enters storage tank is %.1f degree F .'%T2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Final temperature of water that enters storage tank is 39.5 degree F .\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 24.7 page no. 738\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# application of the energy balance, to heat a biomass.\n",
+ "\n",
+ "# Variables\n",
+ "# Pick the system as shown in above figure of book\n",
+ "# Given\n",
+ "T_stm = 250 + 273 ;\t\t\t# Temperature of entering steam - [K ]\n",
+ "Q_loss = -1.5 ;\t\t\t# Rate of heat loss from system - [kJ/s ]\n",
+ "T_mi = 20 + 273 ;\t\t\t#Temperature of entering material -[K ]\n",
+ "T_mf = 100 + 273 ;\t\t\t# Temperature of material after heating - [K]\n",
+ "m_m = 150 ;\t\t\t# Mass of charged material - [kg]\n",
+ "Cp_m = 3.26 ;\t\t\t# Average heat capacity of material - [ J/(g*K)]\n",
+ "\n",
+ "# Calculations\n",
+ "del_U = m_m*Cp_m*(T_mf - T_mi) ;\t\t\t# Change in enthalpy of system , because del_(pV) = 0 for liquid and solid charge -[kJ]\n",
+ "Q_loss_total = Q_loss * 3600; \t\t\t# Total heat loss by system n 1 hour - [kJ]\n",
+ "# We need the value of specific change in enthalpy value of saturated steam(del_H_steam), according to book we can obtain this value from steam table, it's value is -1701 kJ/kg\n",
+ "del_H_steam = -1701 ;\t\t\t# Specific change in enthalpy value of saturated steam -[kJ/kg]\n",
+ "# Get mass of steam per kg charge from reduced energy balance(eqn. (b))\n",
+ "m_stm_total = (del_U - Q_loss_total)/(-del_H_steam) ;\t\t\t# Total mass of stea used - [kg]\n",
+ "m_stm = m_stm_total/m_m ;\t\t\t# Mass of steam used per kg of charge - [kg]\n",
+ "\n",
+ "# Results\n",
+ "print ' Mass of steam used per kg of charge is %.3f kg .'%m_stm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mass of steam used per kg of charge is 0.174 kg .\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 24.8 page no. 741\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Sterilization of a Fermentation Medium\n",
+ "\n",
+ "# Pick the system of whole process as shown in above figure of book\n",
+ "# Given\n",
+ "Q = 1.63 ;\t\t\t# Heat loss from the process - [ kW ]\n",
+ "m_bm = 150 ;\t\t\t# Mass flow rate of biological media into the sterlizer -[kg/min]\n",
+ "T_bm = 50 +273 ;\t\t\t# Temperature of biological media into the sterlizer - [K]\n",
+ "T_sm = 75 + 273 ;\t\t\t# Temperature of sterlize media out of the sterlizer - [K]\n",
+ "P_ss = 300 ;\t\t\t# Pressure of satureted steam entering the steam heater - [kPa]\n",
+ "P_sc = 300 ;\t\t\t# Pressure of satureted condensate exiting the steam heater - [kPa]\n",
+ "\n",
+ "H_w1 = 207.5 ;\t\t\t# Change in specific enthalpy of water at 50 degree C - [kJ/kg]\n",
+ "H_w2 = 310.3 ;\t\t\t# Change in specific enthalpy of water at 75 degree C - [kJ/kg]\n",
+ "H_ss = 2724.9 ;\t\t\t#Change in specific enthalpy of satureted steam entering the steam heater at 300 kPa - [kJ/kg]\n",
+ "H_sc = 561.2 ;\t\t\t#Change in specific enthalpy of satureted condensate exiting the steam heater at 300 kPa - [kJ/kg]\n",
+ "\n",
+ "# Calculations\n",
+ "m_sm = m_bm ;\t\t\t# By material balance -[kg/min]\n",
+ "m_stm = (Q*60 - m_sm*H_w2 + m_bm * H_w1 )/(H_sc - H_ss ) ;\t\t\t# Mass flow rate of steam entering the steam heater - [kg/min]\n",
+ "\n",
+ "# Results\n",
+ "print ' Mass flow rate of steam entering the steam heater is %.2f kg steam/min .'%m_stm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mass flow rate of steam entering the steam heater is 7.08 kg steam/min .\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 24.9 page no. 742\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Use of combined meterial and energy balances to solve a distillation problem.\n",
+ "\n",
+ "# Variables\n",
+ "F = 20000 ;\t\t\t# Feed rate of saturated liquid - [kg/h]\n",
+ "F_Bz = 0.5 ;\t\t\t# Fraction of benzene in feed\n",
+ "F_Tol = 0.5 ;\t\t\t# Fraction of toluene in feed\n",
+ "D_Bz = 0.98 ;\t\t\t# Fraction of benzene in distillate\n",
+ "D_Tol = 0.02 ;\t\t\t# Fraction of toluene in distillate\n",
+ "B_Bz = 0.04 ;\t\t\t# Fraction of benzene in bottoms\n",
+ "B_Tol = 0.96 ;\t\t\t# Fraction of toluene in bottoms\n",
+ "R_by_D = 4.0 ;\t\t\t# Recycle ratio \n",
+ "\n",
+ "# Calculations\n",
+ "from numpy import matrix\n",
+ "a = matrix([[1,1],[B_Bz,D_Bz]]) ;\t\t\t# Matrix formed by coefficients of unknown\n",
+ "b = matrix([[F],[F_Bz*F]]) ;\t\t\t# Matrix formed by contants\n",
+ "a = a.I\n",
+ "x = a*b ;\t\t\t# Matrix of solutions \n",
+ "B = x[0] ;\t\t\t# Bottoms - [kg/h]\n",
+ "D = x[1] ;\t\t\t#Distillate - [kg/h]\n",
+ "R = D * R_by_D ;\t\t\t# Recycle - [kg/h]\n",
+ "V = R + D ;\t\t\t# Overhead vapour - [kg/h]\n",
+ "\n",
+ "# For energy balance\n",
+ "# According to book additional data obtained from the fig.E24.9b are\n",
+ "H_F = 165 ;\t\t\t# Change in enthalpy of F - [kJ/kg]\n",
+ "H_B = 205 ;\t\t\t# Change in enthalpy of B - [kJ/kg]\n",
+ "H_D = 100 ;\t\t\t# Change in enthalpy of D - [kJ/kg]\n",
+ "H_R = 100 ;\t\t\t# Change in enthalpy of R - [kJ/kg]\n",
+ "H_V = 540 ;\t\t\t# Change in enthalpy of V - [kJ/kg]\n",
+ "\n",
+ "Qc = R*H_R + D*H_D - V*H_V ;\t\t\t# The heat duty in the condenser - [kJ]\n",
+ "Qr = D*H_D + B*H_B - F*H_F - Qc;\t\t\t# The heat duty to the reboiler - [kJ]\n",
+ "\n",
+ "# Results\n",
+ "print ' Ditillate (D) %.2e kg/h.'%D\n",
+ "print ' Bottoms (B) %.2e kg/h.'%B\n",
+ "print ' The heat duty in the condenser (Qc) %.2e kJ/h.'%Qc\n",
+ "print ' The heat duty to the reboiler (Qr) %.2e kJ/h.'%Qr\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Ditillate (D) 9.79e+03 kg/h.\n",
+ " Bottoms (B) 1.02e+04 kg/h.\n",
+ " The heat duty in the condenser (Qc) -2.15e+07 kJ/h.\n",
+ " The heat duty to the reboiler (Qr) 2.13e+07 kJ/h.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch25.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch25.ipynb
new file mode 100644
index 00000000..66cbaa91
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch25.ipynb
@@ -0,0 +1,610 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 25 : Energy Balances How to Account for Chemical Reaction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.1 page no. 766\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of a heat of formation from heat transfer measurements\n",
+ "\n",
+ "# Variables\n",
+ "Qa = -393.51 ;\t\t\t# Heat of reaction of reaction (a) - [kJ/g mol C] \n",
+ "Qb = -282.99 ;\t\t\t# Heat of reaction of reaction (b) - [kJ/g mol CO] \n",
+ "del_Ha = Qa ;\t\t\t# Change in enthalpy of reaction A - [kJ/g mol C]\n",
+ "del_Hb = Qb ;\t\t\t# Change in enthalpy of reaction B - [kJ/g mol CO]\n",
+ "\n",
+ "# Calculations\t\n",
+ "del_Hfc = del_Ha - del_Hb ;\t\t\t# Standard heat of formation of CO - [kJ/g mol C]\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard heat of formation of CO is %.2f kJ/g mol C.'%del_Hfc\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard heat of formation of CO is -110.52 kJ/g mol C.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 25.2 page no. 767\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Retrival of heats of formation from reference data.\n",
+ "\n",
+ "# Variables\n",
+ "H_H2 = 0 ;\t\t\t# Standard heat of formation of H2 -[kJ/ g mol H2]\n",
+ "H_Cl2 = 0 ;\t\t\t# Standard heat of formation of Cl2 -[kJ/ g mol Cl2]\n",
+ "H_HCl = -92.311 ;\t\t\t# Standard heat of formation of HCl -[kJ/ g mol HCl]\n",
+ "\n",
+ "# Calculations\n",
+ "H_f = 1*H_HCl - (1./2)*(H_H2 + H_Cl2) ; \t\t\t# Standard heat of formation of HCl by reaction - [kJ/ g mol HCl]\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard heat of formation of HCl(g) is %.3f kJ/g mol HCl.'%H_f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard heat of formation of HCl(g) is -92.311 kJ/g mol HCl.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 25.3 page no. 771\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the standard heat of reaction from the standard heats of formation.\n",
+ "\n",
+ "# Variables\n",
+ "H_fNH3 = -46.191 ;\t\t\t# Standard heat of formation of NH3 -[kJ/ g mol]\n",
+ "H_fO2 = 0 ;\t\t\t#Standard heat of formation of O2 -[kJ/ g mol]\n",
+ "H_fNO = 90.374 ;\t\t\t# Standard heat of formation of NO -[kJ/ g mol]\n",
+ "H_fH2O = -241.826 ;\t\t\t# Standard heat of formation of H2O -[kJ/ g mol]\n",
+ "\n",
+ "# Calculations\n",
+ "H_rxn = ((4*H_fNO + 6*H_fH2O) - (4*H_fNH3 + 5*H_fO2))/4. ;\t\t\t# Heat of above reaction-[kJ/ g mol NH3]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of above reaction is %.3f kJ/g mol NH3.'%H_rxn\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of above reaction is -226.174 kJ/g mol NH3.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 25.4 page no. 773\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculation of the heat of reaction at a temparature different from the standard conditions.\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1. ;\t\t\t# Initial pressure - [atm]\n",
+ "P2 = 1. ;\t\t\t# Final pressure - [atm]\n",
+ "T1 = 500. ;\t\t\t# Initial temperature -[degree C]\n",
+ "T2 = 500. ;\t\t\t# Final temperature -[degree C]\n",
+ "\n",
+ "m_CO2 = 1. ;\t\t\t# Moles of CO2 - [ g mol]\n",
+ "m_H2 = 4. ;\t\t\t# Moles of H2 - [ g mol]\n",
+ "m_H2O = 2. ;\t\t\t# Moles of H2O - [ g mol]\n",
+ "m_CH4 = 1. ;\t\t\t# Moles of CH4 - [ g mol]\n",
+ "\n",
+ "H_fCO2 = -393.250 ;\t\t\t# Heat of formation of CO2 - [kJ/g mol] \n",
+ "H_fH2 = 0. ;\t\t\t# Heat of formation of H2 - [kJ/g mol] \n",
+ "H_fH2O = -241.835 ;\t\t\t# Heat of formation of H2O - [kJ/g mol] \n",
+ "H_fCH4 = -74.848 ;\t\t\t# Heat of formation of CH4 - [kJ/g mol] \n",
+ "\n",
+ "H_CO2 = 21.425 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of CO2 - [kJ/g mol] \n",
+ "H_H2 = 13.834 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of H2 - [kJ/g mol] \n",
+ "H_H2O = 17.010 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of H2O - [kJ/g mol] \n",
+ "H_CH4 = 23.126 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of CH4 - [kJ/g mol] \n",
+ "\n",
+ "# Calculations\n",
+ "H_rxn_25 = (m_CH4*H_fCH4 + m_H2O*H_fH2O) - (m_CO2*H_fCO2 + m_H2*H_fH2) ;\t\t\t# Heat of reaction at 25 C\n",
+ "sum_H_rct = m_CO2*H_CO2 + m_H2*H_H2 ;\t\t\t# sum of heat of formation of reactant - [kJ]\n",
+ "sum_H_pdt = m_CH4*H_CH4 + m_H2O*H_H2O ;\t\t\t#sum of heat of formation of product - [kJ]\n",
+ "# Heat of above reaction is calculated by eqn. 25.4\n",
+ "H_rxn_500 = sum_H_pdt - sum_H_rct + H_rxn_25 ;\t\t\t# Heat of reaction at 500 C\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of above reaction at 500 degree C and 1 atm is %.1f kJ.'%H_rxn_500\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of above reaction at 500 degree C and 1 atm is -184.9 kJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.5 page no. 775\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the Heat Transfer using Heat of Reaction in a Process in\n",
+ "\n",
+ "# Variables\n",
+ "m_CO2 = 1. ;\t\t\t# Moles of CO2 - [ g mol]\n",
+ "m_H2 = 4. ;\t\t\t# Moles of H2 - [ g mol]\n",
+ "m_H2O = 2. ;\t\t\t# Moles of H2O - [ g mol]\n",
+ "m_CH4 = 1. ;\t\t\t# Moles of CH4 - [ g mol]\n",
+ "P1 = 1. ;\t\t\t# Initial pressure - [atm]\n",
+ "P2 = 1. ;\t\t\t# Final pressure - [atm] \n",
+ "\n",
+ "T1_CO2 = 800. ;\t\t\t# Initial temperature of entering CO2 -[K]\n",
+ "T1_H2 = 298. ;\t\t\t# Initial temperature of entering H2 -[K]\n",
+ "T2 = 1000. ;\t\t\t# Temperature of exiting product - [K]\n",
+ "\n",
+ "m1_CO2 = 1. ;\t\t\t# Moles of entering CO2 - [ g mol]\n",
+ "m1_H2 = 4. ;\t\t\t# Moles of entering H2 - [ g mol]\n",
+ "f_con = 70./100 ;\t\t\t# Fractional conversion of CO2 \n",
+ "m2_H2O = 2*f_con ;\t\t\t# Moles of H2O in product - [ g mol]\n",
+ "m2_CH4 = 1*f_con ;\t\t\t# Moles of CH4 in product - [ g mol]\n",
+ "m2_CO2 = m1_CO2*(1-f_con) ;\t\t\t# Moles of CO2 in product - [ g mol]\n",
+ "m2_H2 = m1_H2*(1-f_con) ;\t\t\t# Moles of CO2 in product - [ g mol]\n",
+ "\n",
+ "H_fCO2 = -393.250 ;\t\t\t# Heat of formation of CO2 - [kJ/g mol] \n",
+ "H_fH2 = 0 ;\t\t\t# Heat of formation of H2 - [kJ/g mol] \n",
+ "H_fH2O = -241.835 ;\t\t\t# Heat of formation of H2O - [kJ/g mol] \n",
+ "H_fCH4 = -74.848 ;\t\t\t# Heat of formation of CH4 - [kJ/g mol] \n",
+ "\n",
+ "H1_CO2 = 22.798 ;\t\t\t# Change in enthalpy during temperature change from 298K to 800 K of CO2 - [kJ/g mol] \n",
+ "H1_H2 = 0 ;\t\t\t# Change in enthalpy during temperature change from 298K to 298 K of H2 - [kJ/g mol] \n",
+ "H2_H2O = 25.986 ;\t\t\t# Change in enthalpy during temperature change from 298K to 1000 K of H2O - [kJ/g mol] \n",
+ "H2_CH4 = 38.325 ;\t\t\t# Change in enthalpy during temperature change from 298K to 1000 K of CH4 - [kJ/g mol] \n",
+ "H2_CO2 = 33.396; \t\t\t# Change in enthalpy during temperature change from 298K to 1000 K of CO2 - [kJ/g mol] \n",
+ "H2_H2 = 20.620; \t\t\t# Change in enthalpy during temperature change from 298K to 1000 K of H2 - [kJ/g mol] \n",
+ "\n",
+ "# Calculations\n",
+ "H_rxn_25 = (m_CH4*H_fCH4 + m_H2O*H_fH2O) - (m_CO2*H_fCO2 + m_H2*H_fH2) ;\t\t\t# Standard heat of reaction at 25 C-[kJ]\n",
+ "H_rxn_ac = f_con*H_rxn_25 ;\t\t\t# Heat of reaction actual - [kJ]\n",
+ "sum_H_rct = m1_CO2*H1_CO2 + m1_H2*H1_H2 ;\t\t\t# sum of heat of formation of reactant - [kJ]\n",
+ "sum_H_pdt = m2_CH4*H2_CH4 + m2_H2O*H2_H2O + m2_CO2*H2_CO2 + m2_H2*H2_H2 ;\t\t\t#sum of heat of formation of product - [kJ]\n",
+ "H_rxn = sum_H_pdt - sum_H_rct + H_rxn_ac ;\t\t\t# Heat of reaction -[kJ/ g mol CO2]\n",
+ "\n",
+ "Q = H_rxn ;\t\t\t# Heat transfer to/from the reactor - [kJ]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat transfer to/from the reactor is %.3f kJ.Since Q is negative , the reactor losses heat.'%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer to/from the reactor is -40.515 kJ.Since Q is negative , the reactor losses heat.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.6 page no. 776\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the enthalpy change in anerobic culture.\n",
+ "\n",
+ "# Variables\n",
+ "H_EtOH =-1330.51 ;\t\t\t# Change in enthalpy of ethanol -[kJ/g mol]\n",
+ "H_Ac = -887.01 ;\t\t\t# Change in enthalpy of acetate -[kJ/g mol]\n",
+ "H_Fr = -221.75 ;\t\t\t# Change in enthalpy of formate -[kJ/g mol]\n",
+ "H_Lc = -1330.51 ;\t\t\t# Change in enthalpy of lactate -[kJ/g mol]\n",
+ "H_Mn = -2882.78 ;\t\t\t# Change in enthalpy of mannitol -[kJ/g mol]\n",
+ "mol_EtOH =1.29 ;\t\t\t#ethanol produced / g mol mannitol -[g mol]\n",
+ "mol_Ac = 0.22 ; \t\t\t#acetate produced / g mol mannitol -[g mol]\n",
+ "mol_Fr = 1.6 ; \t\t\t#formate produced / g mol mannitol-[g mol]\n",
+ "mol_Lc = 0.4 ;\t\t\t#lactate produced / g mol mannitol-[g mol]\n",
+ "mol_Mn = 1.0 ;\t\t\t#mannitol produced / g mol mannitol-[g mol]\n",
+ "B_growth = 40.5 ;\t\t\t# Biomass growth -[g cells/g mol mannitol]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "del_H1 = H_EtOH*mol_EtOH +H_Ac*mol_Ac + H_Fr*mol_Fr + H_Lc*mol_Lc - H_Mn*mol_Mn ;\t\t\t# Net enthalpy change for several products (metabolites) per g mol mannitol consumed -[kJ]\n",
+ "printnt ' (a) Net enthalpy change for several products (metabolites) per g mol mannitol consumed is %.2f kJ.'%del_H1\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "del_H2 = del_H1 / B_growth ;\t\t\t#Net enthalpy change for several products (metabolites) per g cells produced-[kJ]\n",
+ "print ' (b) Net enthalpy change for several products (metabolites) per g cells produced is %.2f kJ.'%del_H2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) Net enthalpy change for several products (metabolites) per g mol mannitol consumed is 84.28 kJ.\n",
+ " (b) Net enthalpy change for several products (metabolites) per g cells produced is 2.08 kJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.7 page no. 777\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Green Chemistry Examining Alternate Processes\n",
+ "\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "H_Cb = -26. ;\t\t\t#Standard heat of formation of carbaryl(C12H11O2N) -[kJ/ g mol]\n",
+ "H_HCl = -92.311 ;\t\t\t#Standard heat of formation of HCl -[kJ/ g mol]\n",
+ "H_Ma = -20.0 ;\t\t\t#Standard heat of formation of methyl amine(CH3NH2) -[kJ/ g mol]\n",
+ "H_Mi = -9*10**4 ;\t\t\t#Standard heat of formation of methyl isocynate(C2H3NO) -[kJ/ g mol]\n",
+ "H_Nc = -17.9 ;\t\t\t#Standard heat of formation of 1-Napthalenyl chloroformate(C11H7O2Cl) -[kJ/ g mol]\n",
+ "H_N = 30.9 ;\t\t\t#Standard heat of formation of napthol(C10H8O) -[kJ/ g mol]\n",
+ "H_P = -221.85 ;\t\t\t#Standard heat of formation of phosgene(COCl2) -[kJ/ g mol]\n",
+ "\n",
+ "# Calculations\n",
+ "H_rxn_a = (2*H_HCl + 1*H_Mi) - (1*(H_Ma) + 1*H_P ) ;\t\t\t# Heat of reaction (A)-[kJ]\n",
+ "H_rxn_b = (1*H_Cb ) - (1*(H_Mi) + 1*H_N ) ;\t\t\t# Heat of reaction (B)-[kJ]\n",
+ "H_rxn_c = (1*H_Nc) - (1*(H_N) + 1*H_P ) ;\t\t\t# Heat of reaction (C)-[kJ]\n",
+ "H_rxn_d = (1*H_Cb + 1*H_HCl) - (1*(H_Nc) + 1*H_Ma ) ;\t\t\t# Heat of reaction (D)-[kJ]\n",
+ "\n",
+ "# Results\n",
+ "#Bhopal Process\n",
+ "print ' Bhopal process .'\n",
+ "print ' (a) Heat of reaction (A) is %.1e kJ.'%H_rxn_a\n",
+ "print ' (b) Heat of reaction (B) is %.1e kJ.'%H_rxn_b\n",
+ "\n",
+ "#Alternate process\n",
+ "print ' Alternate process .'\n",
+ "print ' (c) Heat of reaction (C) is %.2f kJ.'%H_rxn_c\n",
+ "print ' (d) Heat of reaction (D) is %.2f kJ.'%H_rxn_d\n",
+ "print ' The above data show that capital cost of Bhopal process could be higher than alternate process.'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Bhopal process .\n",
+ " (a) Heat of reaction (A) is -9.0e+04 kJ.\n",
+ " (b) Heat of reaction (B) is 9.0e+04 kJ.\n",
+ " Alternate process .\n",
+ " (c) Heat of reaction (C) is 173.05 kJ.\n",
+ " (d) Heat of reaction (D) is -80.41 kJ.\n",
+ " The above data show that capital cost of Bhopal process could be higher than alternate process.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.8 page no. 782\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the Heat of Reaction at a Tempera-\n",
+ "\n",
+ "#ture different from the Standard Conditions with Heat of Formation Merged\n",
+ "#with Sensible Heat\n",
+ "# Variables\n",
+ "P1 = 1. ;\t\t\t# Initial pressure - [atm]\n",
+ "P2 = 1. ;\t\t\t# Final pressure - [atm]\n",
+ "T1 = 500. ;\t\t\t# Initial temperature -[degree C]\n",
+ "T2 = 500. ;\t\t\t# Final temperature -[degree C]\n",
+ "\n",
+ "m_CO2 = 1. ;\t\t\t# Moles of CO2 - [ g mol]\n",
+ "m_H2 = 4. ;\t\t\t# Moles of H2 - [ g mol]\n",
+ "m_H2O = 2. ;\t\t\t# Moles of H2O - [ g mol]\n",
+ "m_CH4 = 1. ;\t\t\t# Moles of CH4 - [ g mol]\n",
+ "\n",
+ "H_fCO2 = -393.250; \t\t\t# Heat of formation of CO2 - [kJ/g mol] \n",
+ "H_fH2 = 0 ;\t\t\t# Heat of formation of H2 - [kJ/g mol] \n",
+ "H_fH2O = -241.835 ;\t\t\t# Heat of formation of H2O - [kJ/g mol] \n",
+ "H_fCH4 = -74.848 ;\t\t\t# Heat of formation of CH4 - [kJ/g mol] \n",
+ "\n",
+ "H_CO2 = 21.425 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of CO2 - [kJ/g mol] \n",
+ "H_H2 = 13.834 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of H2 - [kJ/g mol] \n",
+ "H_H2O = 17.010 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of H2O - [kJ/g mol] \n",
+ "H_CH4 = 23.126 ;\t\t\t# Change in enthalpy during temperature change from 25 to 500 degree C of CH4 - [kJ/g mol] \n",
+ "\n",
+ "# Calculations\n",
+ "H_in = (H_fCO2 + H_CO2)*m_CO2 + (H_fH2 + H_H2)*m_H2 ;\t\t\t# Enthalpy change for inputs -[kJ]\n",
+ "H_out = (H_fH2O + H_H2O)*m_H2O + (H_fCH4 + H_CH4)*m_CH4 ; \t\t\t# Enthalpy change for outputs -[kJ]\n",
+ "del_H = H_out - H_in ;\t\t\t# Net enthalpy change of process -[kJ]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of above reaction at 500 degree C and 1 atm is %.1f kJ.'%del_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of above reaction at 500 degree C and 1 atm is -184.9 kJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.9 page no. 783\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the Heat Transfer when Reactants enter and Products leave at Different Temperatures\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "m_CO = 1. ;\t\t\t# Moles of CO input- [g mol]\n",
+ "m1_O2 = 1.5 ;\t\t\t# Moles of O2 input - [g mol]\n",
+ "m_CO2 = 1. ;\t\t\t# Moles of CO2 output - [g mol]\n",
+ "m2_O2 = 1. ;\t\t\t# Moles of O2 output - [g mol]\n",
+ "T_in_CO = 298. ;\t\t\t# Temperature of entering CO -[K]\n",
+ "T_in_O2 = 400. ;\t\t\t#Temperature of entering O2 -[K]\n",
+ "T_out_CO2 = 300. ;\t\t\t# Temperature of exiting CO2 -[K]\n",
+ "T_out_O2 = 300. ;\t\t\t# Temperature of exiting O2 -[K]\n",
+ "\n",
+ "H_fCO = -110.520 ;\t\t\t# Heat of formation of CO - [kJ/g mol] \n",
+ "H_fO2 = 0 ;\t\t\t# Heat of formation of O2 - [kJ/g mol] \n",
+ "H_fCO2 = -393.250 ;\t\t\t# Heat of formation of CO2 - [kJ/g mol] \n",
+ "\n",
+ "H_CO = 0 ;\t\t\t# Change in enthalpy during temperature change from 298K to 298 K of CO - [kJ/g mol] \n",
+ "H1_O2 = 11.619 ;\t\t\t# Change in enthalpy during temperature change from 298K to 400 K of input O2 - [kJ/g mol] \n",
+ "H_CO2 = 11.644 ;\t\t\t# Change in enthalpy during temperature change from 298K to 300 K of CO2 - [kJ/g mol] \n",
+ "H2_O2 = 8.389 ;\t\t\t# Change in enthalpy during temperature change from 298K to 300 K of output O2 - [kJ/g mol] \n",
+ "\n",
+ "# Calculations\n",
+ "H_in = (H_fCO + H_CO)*m_CO + (H_fO2 + H1_O2)*m1_O2 ;\t\t\t# Enthalpy change for inputs -[kJ]\n",
+ "H_out = (H_fCO2 + H_CO2)*m_CO2 + (H_fO2 + H2_O2)*m2_O2 ;\t\t\t# Enthalpy change for inputs -[kJ]\n",
+ "del_H = H_out - H_in ;\t\t\t# Net enthalpy change of process -[kJ]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of above reaction is %.1f kJ.'%del_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of above reaction is -280.1 kJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.10 page no. 788\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Heating Value of Coal\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Given \n",
+ "Ex_hv = 29770.0 ;\t\t\t# Experimental heating value of given coal - [kJ/kg]\n",
+ "\n",
+ "C = 71.0/100 ;\t\t\t#Fraction of C in coal \n",
+ "H2 = 5.6/100 ;\t\t\t# Fraction of H2 in coal \n",
+ "N2 = 1.6/100 ;\t\t\t# Fraction of N2 in coal \n",
+ "S = 2.7/100 ;\t\t\t# Fraction of S in coal \n",
+ "ash = 6.1/100 ;\t\t\t# Fraction of ash in coal \n",
+ "O2 = 13.0/100 ;\t\t\t#Fraction of O2 in coal \n",
+ "\n",
+ "# Calculations\n",
+ "HHV = 14544*C + 62028*(H2 - O2/8) + 4050*S ;\t\t\t# Higher heating value (HHV) by Dulong formula -[Btu/lb]\n",
+ "HHV_SI = HHV *1.055/0.454 ;\t\t\t# HHV in SI unt - [kJ/kg]\n",
+ "\n",
+ "# Results\n",
+ "print 'The experimental heating value - %.0f kJ.'%Ex_hv\n",
+ "print ' Higher heating value (HHV) by Dulong formula - %.0f kJ.'%HHV_SI\n",
+ "print ' The two values are quite close.' \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The experimental heating value - 29770 kJ.\n",
+ " Higher heating value (HHV) by Dulong formula - 29980 kJ.\n",
+ " The two values are quite close.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 25.11 page no. 789\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Selecting a Fuel to reduce SO2 emissions\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "H_req = 10**6 ;\t\t\t# Heat requirement - [Btu]\n",
+ "\n",
+ "d_N6 = 60.2 ;\t\t\t# Density of fuel no. 6-[lb/ft**3]\n",
+ "d_N2 = 58.7 ;\t\t\t# Density of fuel no. 2-[lb/ft**3]\n",
+ "S_N6 = 0.72/100 ;\t\t\t# Sulphur content in fuel no. 6\n",
+ "S_N2 = 0.62/100; \t\t\t#Sulphur content in fuel no. 2\n",
+ "lhv_N6 = 155000 ;\t\t\t#Lower heating value of No.6 -[Btu/gal]\n",
+ "lhv_N2 = 120000 ;\t\t\t#Lower heating value of No.2 -[Btu/gal]\n",
+ "\n",
+ "# Calculations\n",
+ "S1 = H_req*d_N6*S_N6/lhv_N6 ;\t\t\t# Sulphur emmited when we use fuel NO. 6-[lb]\n",
+ "S2 = H_req*d_N2*S_N2/lhv_N2 ;\t\t\t# Sulphur emmited when we use fuel NO. 2-[lb]\n",
+ "\n",
+ "# Results\n",
+ "print ' Sulphur emmited when we use fuel NO. 6 is %.2f lb.'%S1 \n",
+ "print ' Sulphur emmited when we use fuel NO. 2 is %.2f lb.'%S2 \n",
+ "print 'Clearly fuel no. 6 should be selected because of its low SO2 emmission.'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sulphur emmited when we use fuel NO. 6 is 2.80 lb.\n",
+ " Sulphur emmited when we use fuel NO. 2 is 3.03 lb.\n",
+ "Clearly fuel no. 6 should be selected because of its low SO2 emmission.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch26.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch26.ipynb
new file mode 100644
index 00000000..5268900c
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch26.ipynb
@@ -0,0 +1,328 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 26 : Energy Balances that include the Effects of Chemical Reaction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 26.2 page no. 808\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of an adiabetic reaction temperature.\n",
+ "\n",
+ "# Variables\n",
+ "m1_CO = 1.; \t\t\t# Moles of CO input- [g mol]\n",
+ "m1_O2 = 1. ;\t\t\t# Moles of O2 input - [g mol]\n",
+ "m1_N2 = 3.76 ;\t\t\t# Moles of N2 input - [g mol]\n",
+ "#Output compounds\n",
+ "m2_CO2 = 1. ;\t\t\t# Moles of CO2 output - [g mol]\n",
+ "m2_O2 = .50 ;\t\t\t# Moles of O2 output - [g mol]\n",
+ "m2_N2 = 3.76 ;\t\t\t# Moles of N2 output - [g mol]\n",
+ "\n",
+ "H1_fCO = -110520 ;\t\t\t# Heat of formation of CO - [J/g mol] \n",
+ "H1_fO2 = 0 ;\t\t\t# Heat of formation of O2 - [J/g mol] \n",
+ "H1_fN2 = 0 ;\t\t\t# Heat of formation of N2 - [J/g mol] \n",
+ "H1_CO = 2917. - 728 ;\t\t\t# Change in enthalpy during temperature change from 298K to 373 K of CO - [J/g mol] \n",
+ "H1_O2 = 2953. - 732 ;\t\t\t# Change in enthalpy during temperature change from 298K to 373 K of input O2 - [J/g mol]\n",
+ "H1_N2 = 2914. - 728 ;\t\t\t# Change in enthalpy during temperature change from 298K to 373 K of input N2 - [J/g mol]\n",
+ "\n",
+ "# Calculations\n",
+ "H_in = (H1_fCO + H1_CO)*m1_CO + (H1_fO2 + H1_O2)*m1_O2 + (H1_fN2 + H1_N2)*m1_N2;\t\t\t# Enthalpy change for inputs -[J]\n",
+ "\n",
+ "H2_fCO2 = -393510 ;\t\t\t# Heat of formation of CO2 - [J/g mol] \n",
+ "H2_fO2 = 0 ;\t\t\t# Heat of formation of O2 - [J/g mol] \n",
+ "H2_fN2 = 0 ;\t\t\t# Heat of formation of N2 - [J/g mol] \n",
+ "H2_CO2 = 92466. - 912 ;\t\t\t# Change in enthalpy during temperature change from 298K to 2000 K of CO2 - [J/g mol] \n",
+ "H2_O2 = 59914.-732 ;\t\t\t# Change in enthalpy during temperature change from 298K to 2000 K of output O2 - [J/g mol] \n",
+ "H2_N2 = 56902. - 728 ;\t\t\t# Change in enthalpy during temperature change from 298K to 2000 K of output O2 - [J/g mol] \n",
+ "\n",
+ "H1_out = (H2_fCO2 + H2_CO2)*m2_CO2 + (H2_fO2 + H2_O2)*m2_O2 + (H2_fN2 + H2_N2)*m2_N2 ;\t\t\t# Enthalpy change for outputs at 2000 K -[J]\n",
+ "\n",
+ "del_H1 = H1_out - H_in ;\t\t\t# Net enthalpy change of process -[J]\n",
+ "\n",
+ "H2_fCO2 = -393510. ;\t\t\t# Heat of formation of CO2 - [J/g mol] \n",
+ "H3_CO2 = 77455. - 912 ;\t\t\t# Change in enthalpy during temperature change from 298K to 1750 K of CO2 - [J/g mol] \n",
+ "H3_O2 = 50555. -732 ;\t\t\t# Change in enthalpy during temperature change from 298K to 1750 K of output O2 - [J/g mol] \n",
+ "H3_N2 = 47940. - 728 ;\t\t\t# Change in enthalpy during temperature change from 298K to 1750 K of output O2 - [J/g mol] \n",
+ "\n",
+ "H2_out = (H2_fCO2 + H3_CO2)*m2_CO2 + (H2_fO2 + H3_O2)*m2_O2 + (H2_fN2 + H3_N2)*m2_N2 ;\t\t\t# Enthalpy change for outputs at 1750 K -[J]\n",
+ "\n",
+ "del_H2 = H2_out - H_in ;\t\t\t# Net enthalpy change of process -[J]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of above reaction when output is assumed to be at 2000 K is %.0f J.'%del_H1\n",
+ "print ' Heat of above reaction when output is assumed to be at 1750 K is %.0f J.'%del_H2\n",
+ "\t\t\t# Energy balance here reduce to del_H = 0 \n",
+ "print ' So we can see that our desired result del_H = 0 is bracketed between 2000 K and 1750 K , hence we will use interpolation to get the theoretical flame temperature.'\n",
+ "\t\t\t# Use interpolation to get the theoretical flame temperature\n",
+ "del_H = 0. ;\t\t\t# Requred condition\n",
+ "Ft = 1750 + ((del_H - del_H2)/(del_H1 - del_H2))*(2000 - 1750) ;\t\t\t# Interpolation to get Flame temperature(Ft)-[K]\n",
+ "print ' Theoretical flame temperature by interpolation is %.0f K.'%Ft\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of above reaction when output is assumed to be at 2000 K is 36740 J.\n",
+ " Heat of above reaction when output is assumed to be at 1750 K is -16648 J.\n",
+ " So we can see that our desired result del_H = 0 is bracketed between 2000 K and 1750 K , hence we will use interpolation to get the theoretical flame temperature.\n",
+ " Theoretical flame temperature by interpolation is 1828 K.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 26.3 page no. 811\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of general Energy Balance in a Process in which More than one Reaction Occurs\n",
+ "\n",
+ "# Solution Fig E26.3b\n",
+ "\n",
+ "# Variables\n",
+ "v_CH4 = 1000. ;\t\t\t# Volume of CH4 taken - [ cubic feet]\n",
+ "CH4 = 1. ;\t\t\t# assumed for convenience- [ g mol] \n",
+ "ex_air = .5 ;\t\t\t# Fraction of excess O2 required \n",
+ "hp_CaCO3 = 0.130 ;\t\t\t# Heat capacity of CaCO3 -[kJ/g mol]\n",
+ "hp_CaO = 0.062 ;\t\t\t# Heat capacity of CaO -[kJ/g mol]\n",
+ "w_CaCO3 = 100.09 ;\t\t\t# Mol. wt. of CaCO3 -[g]\n",
+ "w_CaO = 56.08 ;\t\t\t# Mol. wt. ofCaO - [g]\n",
+ "\n",
+ "# Calculations\n",
+ "req_O2 = 2. ;\t\t\t# By eqn. (b), O2 required by CH4 - [g mol]\n",
+ "ex_O2 = ex_air*req_O2 ;\t\t\t# Excess O2 required - [ g mol]\n",
+ "O2 = req_O2 + ex_O2 ;\t\t\t# Total O2 entering - [ g mol]\n",
+ "N2 = O2 *(.79/.21) ;\t\t\t# Total N2 entering - [ g mol]\n",
+ "\n",
+ "nG_N2 = N2 ;\t\t\t# N2 balance - [ g mol]\n",
+ "nG_H2O = 4*CH4/2. ;\t\t\t# H2O balance - [ g mol]\n",
+ "nG_O2 = ex_O2 ;\t\t\t# [g mol]\n",
+ "\n",
+ "del_Hi_out = [ -393.250,0,0,-241.835,-635.6] ;\t\t\t# \t\t\t# Heat of formation - [kJ/g mol] \n",
+ "del_Hf_out = [21.425,15.043,14.241,17.010,54.25] ;\t\t\t#Change in enthalpy during temperature change -[kJ/g mol]\n",
+ "del_H_out =del_Hi_out + del_Hf_out ;\t\t\t# Change in enthalpy final - [kJ/g mol]\n",
+ "\n",
+ "del_Hi_in = [ -49.963,-1206.9,0,0] ;\t\t\t# \t\t\t# Heat of formation - [kJ/g mol] \n",
+ "del_Hf_in = [0,0,0,0] ;\t\t\t#Change in enthalpy during temperature change -[kJ/g mol]\n",
+ "del_H_in = del_Hi_in + del_Hf_in ;\t\t\t# Change in enthalpy final - [kJ/g mol]\n",
+ "\n",
+ "from numpy import matrix\n",
+ "a = matrix([[1,-1],[(del_H_in[1]-del_H_out[4]),-del_H_out[0]]]) ;\t\t\t# Matrix of coefficients\n",
+ "b = matrix([[-1],[(del_H_out[1]*nG_O2 + del_H_out[2]*nG_N2 +del_H_out[3]*nG_H2O-del_H_in[0]*CH4)]]) ;\t\t\t# Matrix of constants\n",
+ "a = a.I\n",
+ "x = a*b ;\t\t\t# Matrix of solutions, L = x(1), nG_CO2 = x(2)\n",
+ "g_CaCO3 = x[0]*w_CaCO3 ;\t\t\t#CaCO3 processed for each g mol of CH4 - [g]\n",
+ "\n",
+ "# Results\n",
+ "print ' CaCO3 processed for each g mol of CH4 is %.0f g.'%g_CaCO3\n",
+ "m_CaCO3 = (v_CH4*g_CaCO3)/359.05 ;\n",
+ "print ' Therefore, CaCO3 processed per 1000 ft**3 of CH4 is %.0f lb.'%m_CaCO3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " CaCO3 processed for each g mol of CH4 is 465 g.\n",
+ " Therefore, CaCO3 processed per 1000 ft**3 of CH4 is 1295 lb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 26.4 page no. 815\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of general Energy Balance in a Process Composed of Multiple Units\n",
+ "\n",
+ "# Solution Fig E26.4b\n",
+ "\n",
+ "# Variables\n",
+ "SO2_in = 2200. ;\t\t\t# Amount of SO2 entering reactor 2-[lb mol/hr]\n",
+ "\n",
+ "R1_CO_in = 1. ;\t\t\t#CO entering reactor 1-[lb mol]\n",
+ "air = .80 ;\t\t\t# Fraction of air used in burning \n",
+ "\n",
+ "R2_fSO2_in = 0.667 ;\t\t\t# Fraction of SO2 entering reactor 2\n",
+ "R2_fO2_in = 0.333 ;\t\t\t# Fraction of O2 entering reactor 2\n",
+ "R2_fSO3_out = 0.586 ;\t\t\t# Fraction of SO3 exiting reactor 2\n",
+ "R2_fSO2_out = 0.276 ;\t\t\t# Fraction of SO2 exiting reactor 2\n",
+ "R2_fO2_out = 0.138 ;\t\t\t# Fraction of O2 exiting reactor 2\n",
+ "# Main Reaction: CO , (1/2)*O2 ---> CO2 \n",
+ "R1_O2_in = (1.0/2)*air ;\t\t\t# O2 entering reactor 1-[g mol]\n",
+ "R1_N2_in = R1_O2_in*(79./21) ;\t\t\t# N2 entering reactor 1-[g mol]\n",
+ "\n",
+ "# Calculations\n",
+ "#Output of reactor 1\n",
+ "R1_CO_out = R1_CO_in*(1 - air) ;\t\t\t# [g mol]\n",
+ "R1_CO2_out = 1*( air) ;\t\t\t# [g mol]\n",
+ "R1_N2_out = R1_N2_in ;\t\t\t#[g mol]\n",
+ "\n",
+ "del_Hi_out = [ -109.054,-393.250,0.,-296.855,-395.263,0.] ; \t\t\t# Heat of formation - [kJ/g mol] \n",
+ "del_Hf_out = [35.332,35.178,22.540,20.845,34.302,16.313] ;\t\t\t#Change in enthalpy during temperature change -[kJ/g mol]\n",
+ "del_H_out =del_Hi_out + del_Hf_out ;\t\t\t#[-371.825,15.043,160.781,-449.650,-581.35]\t\t\t# Change in enthalpy final - [kJ/g mol]\n",
+ "\n",
+ "del_Hi_in = [ -109.054,-393.250,0.,-296.855,0.] ;\t\t\t# \t\t\t# Heat of formation - [kJ/g mol] \n",
+ "del_Hf_in = [17.177,17.753,11.981,0.,0.] ;\t\t\t#Change in enthalpy during temperature change -[kJ/g mol]\n",
+ "del_H_in = del_Hi_in+ del_Hf_in ;\t\t\t# Change in enthalpy final - [kJ/g mol]\n",
+ "\n",
+ "from numpy import matrix\n",
+ "# Solve eqn. (a), (b) and (c) to get F ,P , ex \n",
+ "a = matrix([[(R2_fSO3_out),0,-1],\n",
+ " [(R2_fSO2_out),-(R2_fSO2_in),1],\n",
+ " [- 285.50, -(del_H_in[3]*R2_fSO2_in), 0]]) ;\t\t\t# Matrix of coefficients\n",
+ "\n",
+ "b = matrix([[0],[0],[- 33.459781 ]]) ;\t\t\t# Matrix of constants\n",
+ "#a = a.I\n",
+ "#x = a*b ;\t\t\t# Matrix of solutions, P = x(1), F = x(2) ,ex = x(3)\n",
+ "\n",
+ "from numpy import *\n",
+ "x = linalg.solve(a,b)\n",
+ "\n",
+ "F = x[1] ;\t\t\t#exit stream of reactor 2 - [lb mol]\n",
+ "R2_SO2_in = R2_fSO2_in*F ;\t\t\t# Moles of SO2 required per lb mol of CO - [lb mol]\n",
+ "\n",
+ "CO = (R1_CO_in*SO2_in)/R2_SO2_in ;\t\t\t#Mole of CO burned in reactor 1 - [lb mol] \n",
+ "\n",
+ "# Results\n",
+ "print 'Mole of CO burned in reactor 1 is %.0f lb mol.'%CO\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mole of CO burned in reactor 1 is 2259 lb mol.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 26.5 page no. 819\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Production of Citric Acid by Fungus\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "CA = 10000. ;\t\t\t# Produced citric acid - [kg]\n",
+ "f_glucose = .30 ;\t\t\t# Fraction of glucose in solution \n",
+ "con_glucose = .60 ;\t\t\t# Fraction of glucose consumed\n",
+ "w_glucose = 180.16 ;\t\t\t# Mol. wt. of d,alpha glucose -[g]\n",
+ "H_glucose = -1266 ;\t\t\t# Specific enthalpy change of glucose - [kJ/g mol]\n",
+ "w_CA = 192.12; \t\t\t# Mol. wt. of citric acid -[g]\n",
+ "H_CA = -1544.8 ;\t\t\t# Specific enthalpy change of citric acid - [kJ/g mol]\n",
+ "w_BM = 28.6 ;\t\t\t# Mol. wt. of biomass -[g]\n",
+ "H_BM = -91.4 ;\t\t\t# Specific enthalpy change of biomass - [kJ/g mol]\n",
+ "H_CO2 = -393.51 ;\t\t\t# Specific enthalpy change of CO2 - [kJ/g mol]\n",
+ "\n",
+ "# Calculations\n",
+ "mol_CA = CA/w_CA ;\t\t\t# Mole of citric acid produced - [kg mol]\n",
+ "g_soln = (mol_CA*(3/2.22)*w_glucose*1)/(con_glucose*f_glucose) ;\t\t\t#Mass of 30 % glucose solution introduced -[kg]\n",
+ "i_glucose = g_soln* f_glucose / w_glucose ;\t\t\t# Initial moles of glucose - [kg mol]\n",
+ "f_glucose = (1 - con_glucose)*i_glucose ;\t\t\t# Final moles of glucose - [kg mol]\n",
+ "f_CA = mol_CA ;\t\t\t# Final moles of citric acid - [kg mol]\n",
+ "f_BM = f_CA*(5.35/2.22) ;\t\t\t# Using the reaction (a)- Final moles of biomass - [kg mol]\n",
+ "i_O2 = i_glucose*(7.8/3) ;\t\t\t# Using the reaction (a)- Initial moles of O2 - [kg mol]\n",
+ "f_CO2 = i_glucose*(4.5/3)*con_glucose ;\t\t\t# Using the reaction (a) - Final moles of CO2 - [kg mol]\n",
+ "\n",
+ "power = 100 ;\t\t\t# Power of aerator -[hp]\n",
+ "time = 220 ;\t\t\t# Time taken for reaction - [ hr ]\n",
+ "W = (power*745.7*time*3600)/1000 ;\t\t\t# Work done by aerator - [kJ]\n",
+ "\n",
+ "Hi_glucose = i_glucose*H_glucose*1000 ;\t\t\t# Enthalpy change of glucose input - [kJ]\n",
+ "Hi_O2 = i_O2*0*1000 ;\t\t\t# Enthalpy change of O2 input - [kJ]\n",
+ "H_in = Hi_glucose + Hi_O2 ;\t\t\t# Enthalpy change of input - [kJ]\n",
+ "\n",
+ "Hf_glucose = f_glucose*H_glucose*1000 ;\t\t\t# Enthalpy change of glucose output - [kJ]\n",
+ "Hf_BM = f_BM * H_BM*1000 ;\t\t\t#Enthalpy change of biomass output - [kJ]\n",
+ "Hf_CA = f_CA *H_CA*1000 ;\t\t\t#Enthalpy change of citric acid output - [kJ]\n",
+ "Hf_CO2 = f_CO2 *H_CO2*1000 ;\t\t\t#Enthalpy change of CO2 output - [kJ]\n",
+ "H_out = Hf_glucose + Hf_BM +Hf_CA + Hf_CO2 ;\t\t\t# Enthalpy change of output - [kJ]\n",
+ "del_H = H_out - H_in ;\t\t\t# Total enthalpy change in process - [kJ]\n",
+ "Q = del_H - W ;\t\t\t# Heat removed - [kJ]\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat exchange from the fermentor during production of 10,000 kg citric acid is %.2e kJ(minus sign indicates heat is removed).'%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat exchange from the fermentor during production of 10,000 kg citric acid is -1.03e+08 kJ(minus sign indicates heat is removed).\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch27.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch27.ipynb
new file mode 100644
index 00000000..0515e5c2
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch27.ipynb
@@ -0,0 +1,339 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 27 : Ideal Processes Efficiency and the Mechanical Energy Balance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 27.1 page no. 838\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the Work done during Evaporation of a Liquid\n",
+ "# Solution E27.1\n",
+ "\n",
+ "# Variables\n",
+ "V_w = 1. ;\t\t\t# Volume of given water -[L]\n",
+ "P_atm = 100. ;\t\t\t# Atmospheric pressure - [kPa]\n",
+ "\n",
+ "#W = -p*del_V\n",
+ "V_H2O = 0.001043 ;\t\t\t# Specific volume of water from steam table according to book- [cubic metre] \n",
+ "V_vap = 1.694 ;\t\t\t# Specific volume of vapour from steam table according to book- [cubic metre] \n",
+ "V1 = 0 ;\t\t\t# Initial volume of H2O in bag-[cubic metre]\n",
+ "\n",
+ "# Calculations\n",
+ "V2 = (V_w*V_vap)/(1000*V_H2O) ;\t\t\t# Final volume of water vapour -[cubic metre] \n",
+ "W = -P_atm*(V2 -V1)* 1000 ;\t\t\t# Work done by saturated liquid water -[J]\n",
+ " \n",
+ "# Results \n",
+ "print ' Work done by saturated liquid water is %.3e J.'%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Work done by saturated liquid water is -1.624e+05 J.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 27.2 page no. 840\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Work in a Batch Process\n",
+ "# Solution E27.2\n",
+ "\n",
+ "# Variables\n",
+ "m_N2 = 1. ;\t\t\t# Moles of N2 taken -[kg mol]\n",
+ "p = 1000.;\t\t\t# Pressure of cylinder-[kPa]\n",
+ "T = 20. + 273. ;\t\t\t# Temperature of cylinder -[K]\n",
+ "a_pis = 6. ;\t\t\t# Area of piston - [square centimetre]\n",
+ "m_pis = 2. ;\t\t\t# Mass of pston - [kg]\n",
+ "R = 8.31 ;\t\t\t# Ideal gas constant - [(kPa*cubic metre)/(K * kgmol)]\n",
+ "\n",
+ "# Calculations\n",
+ "V = (R*T)/p ;\t\t\t# Specific volue of gas at initial stage -[cubic metre/kg mol]\n",
+ "V1 = V * m_N2 ;\t\t\t# Initial volume of gas - [cubic metre]\n",
+ "V2 = 2.*V1 ;\t\t\t# Final volume of gas according to given condition -[cubic metre]\n",
+ "\n",
+ "# Assumed surrounding pressure constant = 1 atm\n",
+ "p_atm = 101.3 ;\t\t\t# Atmospheric pressure-[kPa]\n",
+ "del_Vsys = V2 -V1 ;\t\t\t# Change in volume of system -[cubic metre]\n",
+ "del_Vsurr = - del_Vsys ;\t\t\t# Change in volume of surrounding -[cubic metre]\n",
+ "W_surr = -p_atm*del_Vsurr ;\t\t\t# Work done by surrounding - [kJ]\n",
+ "W_sys = -W_surr ;\t\t\t# Work done by system - [kJ]\n",
+ "\n",
+ "# Results\n",
+ "print ' Work done by gas(actually gas + piston system) is %.0f kJ.'%W_sys\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Work done by gas(actually gas + piston system) is -247 kJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 27.3 page no. 845\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Efficiency of Power Generation by a Hydroelectric Plant\n",
+ "# Solution \n",
+ "\n",
+ "# Variables\n",
+ "p_plant = 20. ;\t\t\t# Power generated by plant-[MW]\n",
+ "h = 25. ;\t\t\t# Height of water level - [m]\n",
+ "V = 100. ;\t\t\t# Flow rate of water -[cubic metre/s]\n",
+ "d_water = 1000. ;\t\t\t# Density of water - [ 1000 kg / cubic metre]\n",
+ "g = 9.807 ;\t\t\t# Acceleration due to gravity-[m/square second]\n",
+ "\n",
+ "# Calculations\n",
+ "M_flow = V*d_water ;\t\t\t# Mass flow rate of water -[kg/s]\n",
+ "del_PE = M_flow*g*h ;\t\t\t# Potential energy change of water per second -[W]\n",
+ "eff = (p_plant*10**6) /(del_PE) ;\t\t\t# Efficiency of plant \n",
+ "\n",
+ "# Results\n",
+ "print ' Efficiency of plant is %.2f .'%eff\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Efficiency of plant is 0.82 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 27.4 page no. 845\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Plant Efficiency\n",
+ "# Solution Fig.E27.4\n",
+ "\n",
+ "# Variables\n",
+ "LHV = 36654. ;\t\t\t# LHV value of fuel - [kJ/ cubic metre]\n",
+ "Q1 = 16. ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q2 = 0 ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q3 = 2432. ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q4 = 32114. ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q41 = 6988. ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q8 = 1948. ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q9 = 2643. ;\t\t\t#- [kJ/ cubic metre]\n",
+ "Q81 = 2352. - Q8 ;\t\t\t# - [kJ/ cubic metre]\n",
+ "Q567 = 9092. ;\t\t\t# Sum of Q5, Q6 and Q7- [kJ/ cubic metre]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)\n",
+ "G_ef = (LHV+ Q1 +Q2 + Q3 - Q9)/(LHV) ;\t\t\t# Gross efficiency\n",
+ "print '(a) Gross efficiency is %.3f .'%G_ef\n",
+ "\n",
+ "#(b)\n",
+ "T_ef = (Q567+Q8)/(LHV+ Q1 +Q2 + Q3) ;\t\t\t#Thermal efficiency \n",
+ "print ' (b) Thermal efficiency is %.3f .'%T_ef\n",
+ "\n",
+ "#(c)\n",
+ "C_ef = Q4/(Q4 + Q41) ;\t\t\t# Combustion efficiency\n",
+ "print ' (c) Combustion efficiency is %.3f .'%C_ef\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Gross efficiency is 0.995 .\n",
+ " (b) Thermal efficiency is 0.282 .\n",
+ " (c) Combustion efficiency is 0.821 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 27.5 page no. 850"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "# Comparison of the reversible work for a batch process with that of a flow process operating under the same conditions.\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 5. ;\t\t\t# Volume of gas initially - [cubic feet]\n",
+ "P1 = 1. ;\t\t\t# Initial pressure - [atm]\n",
+ "P2 = 10. ;\t\t\t# Final pressure - [atm]\n",
+ "T1 = 100. + 460 ;\t\t\t# initial temperature - [degree Rankine]\n",
+ "R = 0.7302 ;\t\t\t# Ideal gas constant -[(cubic feet*atm)/(lb mol)*(R)]\n",
+ "\t\t\t#Equation of state pV**1.4 = constant\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "V2 = V1*(P1/P2)**(1/1.4) ;\t\t\t# Final volume - [cubic feet] \n",
+ "\n",
+ "def f(V):\n",
+ " return -(P1)*(V1/V)**(1.4)\n",
+ " \n",
+ "W1_rev = quad(f,V1,V2)[0] ;\t\t\t# Reversible work done in compresion in a horizontal cylinder with piston -[cubic feet *atm]\n",
+ "W1 = W1_rev *1.987/.7302 ;\t\t\t# Conversion to Btu -[Btu]\n",
+ "print '(a)Reversible work done in compression in a horizontal cylinder with piston is %.1f Btu . '%W1\n",
+ "\n",
+ "#(b)\n",
+ "n1 = (P1*V1)/(R*T1) ;\t\t\t# Number of moles of gas\n",
+ "\n",
+ "def f1(P):\n",
+ " return (V1)*(P1/P)**(1/1.4)\n",
+ "W2_rev = quad(f1,P1,P2)[0]\t\t# Reversible work done in compresion in a rotary compressor -[cubic feet *atm]\n",
+ "W2 = W2_rev *1.987/.7302 ;\t\t\t# Conversion to Btu -[Btu]\n",
+ "\n",
+ "print '(b)Reversible work done in a rotary compressor is %.1f Btu . '%W2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Reversible work done in compression in a horizontal cylinder with piston is 31.7 Btu . \n",
+ "(b)Reversible work done in a rotary compressor is 44.3 Btu . \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 27.6 page no. 853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of the mechanical energy balance to the pumping water\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "# Variables\n",
+ "m_water = 1. ;\t\t\t# Mass flow rate of water -[lb/min]\n",
+ "P1 = 100. ;\t\t\t# Initial pressure - [psia]\n",
+ "P2 = 1000. ;\t\t\t# Final pressure - [psia]\n",
+ "T1 = 80. + 460 ;\t\t\t# initial temperature - [degree Rankine]\n",
+ "T2 = 100. + 460 ;\t\t\t# final temperature - [degree Rankine]\n",
+ "h = 10. ;\t\t\t# Difference in water level between entry and exit of stream-[ft]\n",
+ "g = 32.2 ;\t\t\t# Accleration due to gravity - [ft/ square second]\n",
+ "gc = 32.2 ;\t\t\t#[(ft*lbm)/(lbf*square second)]\n",
+ "\n",
+ "v1 = .01607 ;\t\t\t# specific volume of liquid water at 80 degree F -[cubic feet/lbm]\n",
+ "v2 = .01613 ;\t\t\t# specific volume of liquid water at 100 degree F -[cubic feet/lbm] \n",
+ "v= 0.0161 ;\t\t\t# -[cubic feet/lbm]\n",
+ "\n",
+ "# Calculations\n",
+ "del_PE = (h*g)/(gc*778) ;\t\t\t# Change in potential energy - [Btu/lbm]\n",
+ "\n",
+ "def f(P):\n",
+ " return (v)*(12**2/778.)\n",
+ " \n",
+ "PV_work = quad(f,P1,P2)[0]\t\t\t# PV work done -[Btu/lbm]\n",
+ "#From eqn. (A)\n",
+ "W = PV_work + del_PE ;\t\t\t# Work per minute required to pump 1 lb water per minute - [Btu/lbm]\n",
+ "\n",
+ "# Results\n",
+ "print ' Work per minute required to pump 1 lb water per minute is %.2f Btu/lbm . '%W\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Work per minute required to pump 1 lb water per minute is 2.69 Btu/lbm . \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch28.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch28.ipynb
new file mode 100644
index 00000000..6a34dc72
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch28.ipynb
@@ -0,0 +1,223 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 28 : Heats of Solution and Mixing"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 28.1 page no. 869\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of Heats of Solution data\n",
+ "\n",
+ "# Solution \n",
+ "# Variables\n",
+ "Ref_T = 77. ;\t\t\t#Reference temperature-[degree F]\n",
+ "\n",
+ "#(a)\n",
+ "mol_NH3 = 1. ;\t\t\t# Moles of NH3 - [lb mol]\n",
+ "mw_NH3 = 17. ;\t\t\t#Molecular t. of NH3 -[lb]\n",
+ "mw_H2O = 18. ;\t\t\t#Molecular t. of H2O -[lb]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "f1_NH3 = 3./100 ;\t\t\t# Fraction of NH3 in solution \n",
+ "m_H2O = (mw_NH3/f1_NH3) - mw_NH3 ;\t\t\t# Mass of water in solution -[lb]\n",
+ "mol_H2O = m_H2O/mw_H2O ;\t\t\t# Moles of H2O in solution -[lb mol]\n",
+ "\n",
+ "print '(a) Moles of H2O in solution is %.1f lb mol . '%mol_H2O\n",
+ "print ' As we can see that moles of water is 30 lb mol(approx), hence we will see H_soln from table corresponding to 30 lb mol water . '\n",
+ "H_soln = -14800. ;\t\t\t# From table given in question in book -[Btu/lb mol NH3]\n",
+ "print ' The amount of cooling needed is, %.0f Btu heat removed. '%(abs(H_soln))\n",
+ "\n",
+ "#(b)\n",
+ "V = 100. ;\t\t\t# Volume of solution produced -[gal]\n",
+ "f2_NH3 = 32./100 ;\t\t\t# Fraction of NH3 in solution \n",
+ "sg_NH3 = .889 ;\t\t\t# Specific gravity of NH3 \n",
+ "sg_H2O = 1.003 ;\t\t\t# Specific gravity of H2O\n",
+ "d_soln = sg_NH3*62.4*sg_H2O*100/7.48 ;\t\t\t# Density of solution - [lb / 100 gal]\n",
+ "NH3 = d_soln*f2_NH3/mw_NH3 ;\t\t\t# Mass of NH3 - [ lb mol/ 100 gal]\n",
+ "m1_H2O = (mw_NH3/f2_NH3) - mw_NH3 ;\t\t\t# Mass of water in solution -[lb]\n",
+ "mol1_H2O = m1_H2O/mw_H2O ;\t\t\t# Moles of H2O in solution -[lb mol]\n",
+ "\n",
+ "print ' (b) Moles of H2O in solution is %.1f lb mol . '%mol1_H2O\n",
+ "print ' As we can see that moles of water is 2 lb mol , hence we will see H_soln from table corresponding to 2 lb mol water . '\n",
+ "H_soln = -13700 ;\t\t\t# From table given in question in book -[Btu/lb mol NH3]\n",
+ "total_H = abs(NH3*H_soln) ;\t\t\t# Total heat removed from solution -[Btu]\n",
+ "print ' The amount of cooling needed is, %.0f Btu heat removed. '%total_H\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Moles of H2O in solution is 30.5 lb mol . \n",
+ " As we can see that moles of water is 30 lb mol(approx), hence we will see H_soln from table corresponding to 30 lb mol water . \n",
+ " The amount of cooling needed is, 14800 Btu heat removed. \n",
+ " (b) Moles of H2O in solution is 2.0 lb mol . \n",
+ " As we can see that moles of water is 2 lb mol , hence we will see H_soln from table corresponding to 2 lb mol water . \n",
+ " The amount of cooling needed is, 191826 Btu heat removed. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 28.2 page no. 872"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of the heat of solution data\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "# Variables\n",
+ "p = 100. ;\t\t\t# Mass of product - [kg]\n",
+ "f_HCl = 25./100 ;\t\t\t#Fraction of HCl in product \n",
+ "HCl = f_HCl*p ;\t\t\t# Mass of HCl in product - [kg]\n",
+ "H2O = (1.-f_HCl)*p ;\t\t\t# Mass of H2O in product -[kg]\n",
+ "mw_HCl = 36.37 ;\t\t\t# Molecular weight of HCl -[kg]\n",
+ "mw_H2O = 18.02 ;\t\t\t# Molecular weight of H2O -[kg]\n",
+ "\n",
+ "# Calculations\n",
+ "mol_HCl = HCl /mw_HCl ;\t\t\t# Moles of HCl - [kg mol]\n",
+ "mol_H2O = H2O /mw_H2O; \t\t\t# Moles of H2O - [kg mol]\n",
+ "total_mol = mol_HCl + mol_H2O ;\t\t\t# Total no. of moles -[kg mol]\n",
+ "mf_HCl = mol_HCl / total_mol ;\t\t\t# mole fraction of HCl \n",
+ "mf_H2O = mol_H2O / total_mol ; \t\t\t# mole fraction of H2O\n",
+ "mr = mol_H2O/mol_HCl ;\t\t\t# Mole ratio of H2O to HCl \n",
+ "MW = mf_HCl*mw_HCl + mf_H2O*mw_H2O ;\t\t\t# Molecular t. of solution-[kg]\n",
+ "Ref_T = 25. ;\t\t\t#Reference temperature-[degree C]\n",
+ "\n",
+ "mol1_HCl = total_mol ;\t\t\t# Moles of HCl \t\t\t# Moles of HCl output -[g mol]\n",
+ "Hf1_HCl = -157753. ;\t\t\t# Heat of formation of HCl output-[J/ g mol HCl ]\n",
+ "Hf_HCl = -92311. ;\t\t\t# Heat of formation of HCl input-[J/ g mol HCl ]\n",
+ "Hf_H2O = 0 ;\t\t\t# Heat of formation of H2O input-[J/ g mol HCl ]\n",
+ "H1_HCl = 556. ;\t\t\t# Change in enthalpy during temperature change from 25 C to 35 C of HCl - [J/g mol] \n",
+ "\n",
+ "def f(T):\n",
+ " return (29.13 - 0.134*.01*T)\n",
+ "\n",
+ "H_HCl = quad(f,298,393)[0]\t# Change in enthalpy during temperature change from 25 C to 120 C of HCl - [J/g mol] \n",
+ "\n",
+ "H_H2O = 0 ;\t\t\t# Change in enthalpy during temperature change from 25 C to 25 C of H2O - [J/g mol] \n",
+ "\n",
+ "H_in = (Hf_HCl + H_HCl)*mol_HCl + (Hf_H2O + H_H2O)*mol_H2O ;\t\t\t# Enthalpy change of input -[J]\n",
+ "H_out = Hf1_HCl*mol_HCl +H1_HCl*mol1_HCl ;\t\t\t# Enthalpy change of output -[J]\n",
+ "\n",
+ "del_H = H_out - H_in ;\t\t\t# Net enthalpy change n process - [J]\n",
+ "Q = del_H; \t\t\t# By energy balance - [J]\n",
+ "\n",
+ "# Results\n",
+ "print 'The amount of heat removed from the absorber by cooling water is, %.0f J. '%Q\n",
+ "print 'It Seems answer is wrong in book'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of heat removed from the absorber by cooling water is, -44159 J. \n",
+ "It Seems answer is wrong in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 28.3 page no. 875\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of an Enthalpy Concentration Chart\n",
+ "\n",
+ "# Solution fig. 28.3\n",
+ "\n",
+ "# Variables\n",
+ "soln1 = 600. ; \t\t\t# Mass flow rate of entering solution 1 -[lb/hr]\n",
+ "c1_NaOH = 10./100 ;\t\t\t# Fraction of NaOH in entering solution 1\n",
+ "T1 = 200. ;\t\t\t# Temperature at entry \n",
+ "soln2 = 400. ;\t\t\t# Mass flow rate of another solution 2 entering -[lb/hr]\n",
+ "c2_NaOH = 50./100 ;\t\t\t# Fraction of NaOH in another entering solution 2\n",
+ "\n",
+ "# Calculations\n",
+ "F = soln1 + soln2; \t\t\t# Mass flow rate of final solution - [lb/hr]\n",
+ "F_NaOH = c1_NaOH * soln1 + c2_NaOH * soln2 ;\t\t\t# Mass of NaOH in final solution-[lb]\n",
+ "F_H2O = F - F_NaOH ;\t\t\t# Mass of H2O in final solution-[lb]\n",
+ "H_soln1 = 152. ;\t\t\t# Specific enthalpy change for solution 1-[Btu/lb]\n",
+ "H_soln2 = 290. ;\t\t\t# Specific enthalpy change for solution 2-[Btu/lb]\n",
+ "H_F = (soln1*H_soln1 + soln2*H_soln2)/F ;\t\t\t# Specific enthalpy change for final solution -[Btu/lb]\n",
+ "\n",
+ "# Results\n",
+ "print ' (a) The final temperature of the exit solution from figure E28.3 using the obtained condition of final solution is 232 degree F '\n",
+ "\n",
+ "cF = F_NaOH*100/F; \t\t\t# Concentration of final solution -[wt % NaOH ]\n",
+ "print ' (b) The concentration of final solution is %.0f wt.%% NaOH . '%cF\n",
+ "\n",
+ "x = (F*H_F - F*175)/(1158.0 - 175) ;\t\t\t# H2O evaporated per hour -[lb]\n",
+ "print ' (c) H2O evaporated per hour is %.1f lb . '%x\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) The final temperature of the exit solution from figure E28.3 using the obtained condition of final solution is 232 degree F \n",
+ " (b) The concentration of final solution is 26 wt.% NaOH . \n",
+ " (c) H2O evaporated per hour is 32.8 lb . \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch29.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch29.ipynb
new file mode 100644
index 00000000..db601ca5
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch29.ipynb
@@ -0,0 +1,290 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 29 : Humidity Charts and their Uses"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 29.1 page no. 895\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determining properties of moist air from the humidity chart\n",
+ "\n",
+ "# Variables\n",
+ "DBT = 90. ;\t\t\t# Dry bulb temperature - [degree F]\n",
+ "WBT = 70. ;\t\t\t# Wet bulb temperature - [degree F]\n",
+ "\n",
+ "#Get point A using DBT & WBT. Following information is obtained from humidity chart, fig. E29.1\n",
+ "# Results\n",
+ "print '(a) The Dew point is located at point B or about 60 degree F, using constant humidity line.'\n",
+ "print ' (b) By interpolation between 40%% and 30%% RH , you can find point A is at 37%% relative humidity .'\n",
+ "print ' (c) You can read humidity from the righthand ordinate as 0.0112 lb H2O/lb dry air .'\n",
+ "print ' (d) By interpolation again between 14.0 cubic feet/lb and 14.5 cubic feet/lb lines , you can find humid volume to be 14.1 cubic feet/lb dry air.'\n",
+ "print ' (e) The enthalpy value of saturated air with WBT 70 degree F is 34.1 Btu/lb dry air .'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The Dew point is located at point B or about 60 degree F, using constant humidity line.\n",
+ " (b) By interpolation between 40%% and 30%% RH , you can find point A is at 37%% relative humidity .\n",
+ " (c) You can read humidity from the righthand ordinate as 0.0112 lb H2O/lb dry air .\n",
+ " (d) By interpolation again between 14.0 cubic feet/lb and 14.5 cubic feet/lb lines , you can find humid volume to be 14.1 cubic feet/lb dry air.\n",
+ " (e) The enthalpy value of saturated air with WBT 70 degree F is 34.1 Btu/lb dry air .\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 29.2 page no. 897\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Heating at constant Humidity\n",
+ "\n",
+ "# Solution fig. E29.2\n",
+ "\n",
+ "# Variables\n",
+ "DBT1 = 38 ;\t\t\t# Initial dry bulb temperature - [degree C]\n",
+ "DBT2 = 86 ;\t\t\t# Final dry bulb temperature - [degree C]\n",
+ "RH1 = 49 ;\t\t\t# Relative humidity - [%]\n",
+ "\n",
+ "#A is initial and B is final point , see fig. E29.2 . Dew point is obtained graphically and it is 24.8 degree C,therefore\n",
+ "print 'The Dew point is unchanged in the process because humidity is unchanged, and it is located at 24.8 degree C.'\n",
+ "\n",
+ "# Calculations\n",
+ "# Additional data is obtained from humidity chart , according to book data is as follows\n",
+ "A_Hsat = 90.0 ;\t\t\t# Enthalpy of saturation at point A- [kJ/kg]\n",
+ "A_dH = -0.5 ;\t\t\t#Enthalpy deviation-[kJ/kg]\n",
+ "A_Hact = A_Hsat + A_dH ;\t\t\t# Actual enthalpy at point A -[kJ/kg]\n",
+ "B_Hsat = 143.3 ;\t\t\t# Enthalpy of saturation at point B- [kJ/kg]\n",
+ "B_dH = -3.3 ;\t\t\t#Enthalpy deviation -[kJ/kg]\n",
+ "B_Hact = B_Hsat + B_dH ;\t\t\t# Actual enthalpy at point B -[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Energy balance reduces to Q = del_H \n",
+ "del_H = B_Hact - A_Hact ;\t\t\t# Total change in enthalpy - [kJ/kg]\n",
+ "v = 0.91 ;\t\t\t# Specific volume of moist air at point A -[cubic metre / kg]\n",
+ "Q = del_H/v ;\t\t\t# Heat added per cubic metre of inital moist air -[kJ]\n",
+ "\n",
+ "# Results\n",
+ "print ' Heat added per cubic metre of inital moist air is %.1f kJ.'%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Dew point is unchanged in the process because humidity is unchanged, and it is located at 24.8 degree C.\n",
+ " Heat added per cubic metre of inital moist air is 55.5 kJ.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 29.3 page no. 898\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Cooling and Humidification using a Water Spray\n",
+ "\n",
+ "# Solution fig. E29.3b\n",
+ "\n",
+ "# Variables\n",
+ "DBT1 = 40 ;\t\t\t# Initial dry bulb temperature - [degree C]\n",
+ "DBT2 = 27 ;\t\t\t# Final dry bulb temperature - [degree C]\n",
+ "\n",
+ "# Process is assumed to be adiabatic, therefore wet bulb temperature is constant\n",
+ "WBT1 = 22 ;\t\t\t# Initial wet bulb temperature - [degree C]\n",
+ "WBT2 = WBT1 ;\t\t\t# Final wet bulb temperature - [degree C]\n",
+ "\n",
+ "# Calculations\n",
+ "#A is initial and B is final point , see fig. E29.3b . Humidity is obtained from humidity chart, according to book the respective humidities are as follows\n",
+ "H_B = 0.0145 ;\t\t\t# Humidity at point B -[kg H2O/kg dry air]\n",
+ "H_A = 0.0093 ;\t\t\t# Humidity at point A -[kg H2O/kg dry air]\n",
+ "Diff = H_B - H_A ;\t\t\t# Moisture added in kg per kilogram of dry air going through humidifier -[kg H2O/kg dry air] \n",
+ "\n",
+ "# Results\n",
+ "print 'Moisture added per kilogram of dry air going through humidifier is %.4f kg H2O.'%Diff\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Moisture added per kilogram of dry air going through humidifier is 0.0052 kg H2O.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 29.4 page no. 900\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Combined Material and Energy Balance for a Cooling Tower\n",
+ "\n",
+ "# Solution fig. E29.4\n",
+ "\n",
+ "# Variables\n",
+ "c_bl = 8.30 * 10**6 ;\t\t\t# Capacity of blower - [cubic feet/hr]\n",
+ "DBT_A = 80 ;\t\t\t# Initial dry bulb temperature of moist air - [degree F]\n",
+ "DBT_B = 95 ;\t\t\t# Final dry bulb temperature of exit air - [degree F]\n",
+ "WBT_A = 65 ;\t\t\t# Initial wet bulb temperature of moist air - [degree F]\n",
+ "WBT_B = 90 ;\t\t\t# Final wet bulb temperature of exit air - [degree F]\n",
+ "T1_H2O = 120 ;\t\t\t# Initial temperature of water - [degree F]\n",
+ "T2_H2O = 90 ;\t\t\t# Final temperature of water - [degree F]\n",
+ "\n",
+ "#A is initial and B is final point , see fig. E29.4 . Humidity is obtained from humidity chart, according to book the respective humidities are as follows\n",
+ "H_A = 0.0098; \t\t\t# Humidity of air at A - [lb H2O / lb dry air]\n",
+ "H1_A = 69 ;\t\t\t# Humidity of air at A - [grains H2O / lb dry air]\n",
+ "\n",
+ "# Calculations\n",
+ "delH_A = 30.05 - 0.12; \t\t\t# Enthalpy of entering air -[Btu/lb dry air]\n",
+ "v_A = 13.82 ;\t\t\t# Specific volume of entering air -[cubic feet/lb dry air]\n",
+ "H_B = 0.0297;\t\t\t# Humidity of air at B - [lb H2O / lb dry air]\n",
+ "H1_B = 208 ;\t\t\t# Humidity of air at B - [grains H2O / lb dry air]\n",
+ "delH_B = 55.93 - 0.10 ;\t\t\t# Enthalpy of exit air -[Btu/lb dry air]\n",
+ "v_B = 14.65 ;\t\t\t# Specific volume of exit air -[cubic feet/lb dry air]\n",
+ "Eq_A = c_bl /v_A ;\t\t\t# Entering dry air equivalent of capacity of blower -[lb dry air]\n",
+ "\n",
+ "# Reference temperature for water stream is 32 degree F \n",
+ "del_H1_H2O = 1*(T1_H2O - 32) ;\t\t\t#Enthalpy of entering water -[Btu/lb H2O]\n",
+ "del_H2_H2O = 1*(T2_H2O - 32) ;\t\t\t#Enthalpy of exit water -[Btu/lb H2O]\n",
+ "tr_H2O = H_B - H_A ;\t\t\t# Transfer of water to air -[lb H2O / lb dry air] \n",
+ "\n",
+ "# Energy balance around the entire process yields W -\n",
+ "W = (delH_B - del_H2_H2O*tr_H2O - delH_A)/(del_H1_H2O - del_H2_H2O) ;\t\t\t# Water entering tower - [lb H2O/lb dry air]\n",
+ "W1 = W - tr_H2O ;\t\t\t# Water leaving tower -[lb H2O/lb dry air]\n",
+ "Total_W1 = W1* Eq_A ;\t\t\t# Total water leaving tower -[lb/hr]\n",
+ "\n",
+ "# Results\n",
+ "print 'Amount of water cooled per hour is %.2e lb/hr .'%Total_W1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of water cooled per hour is 4.83e+05 lb/hr .\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 29.5 page no. 902\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Drying of Chlorella\n",
+ "\n",
+ "# Solution fig. E29.5\n",
+ "\n",
+ "# Variables\n",
+ "W = 100 ;\t\t\t# Amount of entering water -[lb/hr]\n",
+ "H1 = .020 ;\t\t\t# Humidity of entering air -[lb H2O / lb dry air]\n",
+ "T1 = 155 ;\t\t\t#Temperature of entering air -[degree F]\n",
+ "DTB = 110 ;\t\t\t# Dry bulb temperature of exit air -[degree F]\n",
+ "WTB = 100 ;\t\t\t# Wet bulb temperature of exit air -[degree F]\n",
+ "\n",
+ "# Additional data is obtained from humidity chart, it is as follows\n",
+ "H2 = .0405 ;\t\t\t#Humidity of exit air -[lb H2O / lb dry air]\n",
+ "\n",
+ "# Calculations\n",
+ "del_H = H2 - H1 ;\t\t\t# Change in humidity betwween two states -[lb H2O / lb dry air]\n",
+ "air_in = (W*1.02)/(del_H * 1) ;\t\t\t# Amount of wet air entering -[lb]\n",
+ "\n",
+ "mol_air = 29. ;\t\t\t# Molecular wt. of air -[lb]\n",
+ "Ref_T = 32 + 460. ;\t\t\t# Reference temperature - [ degree R]\n",
+ "gi_T = 90 + 460.; \t\t\t# Given temperature on which calculation is based - [degree R] \n",
+ "air = (air_in *359*gi_T)/( mol_air*Ref_T) ;\t\t\t# Air consumption of dryer at 90 degree F and 1 atm -[cubic feet]\n",
+ "\n",
+ "# Results\n",
+ "print 'Air consumption of dryer at 90 degree F and 1 atm is %.2e cubic feet .'%air\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air consumption of dryer at 90 degree F and 1 atm is 6.89e+04 cubic feet .\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch3.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch3.ipynb
new file mode 100644
index 00000000..af8703d1
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch3.ipynb
@@ -0,0 +1,334 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : The balance equation and mass balance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 3.4 page no : 88\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate vol. flow rate, mass flow rate and average vel of gasoline through pipe\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "V=15.; #gal volume of gasoline\n",
+ "t=2.; #min\n",
+ "rho_water=62.3; #lbm/ft^3\n",
+ "sg=0.72; #specific gravity\n",
+ "\n",
+ "# calculation and Result\n",
+ "q=(15/2.0)*(0.1336/60) #ft^3/s vol. flow rate\n",
+ "print \"volumetric flow rate is %f ft^3/s\"%q\n",
+ "m=q*sg*rho_water #lbm/s\n",
+ "print \"Mass flow rate is %f lbm/s\"%m\n",
+ "d=1.; #in diameter of pipe\n",
+ "a=((math.pi)*d**2/4.0)/144.0; #ft^2 area of pipe\n",
+ "v_avg=q/a #ft/s\n",
+ "print \"The average velocity is %f ft/s\"%v_avg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate is 0.016700 ft^3/s\n",
+ "Mass flow rate is 0.749095 lbm/s\n",
+ "The average velocity is 3.061886 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 page no : 90\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate velocity and mass flow rate of natural in a pipe\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "d1=2.; #ft diameter of pipe at position 1\n",
+ "a1=(math.pi)/4*d1**2; #ft^2\n",
+ "v1=50.; #ft/s vel of gas at position 1\n",
+ "rho1=2.58; #lbm/ft^3 density of gas at position 1\n",
+ "d2=3.; #ft diameter of pipe at position 2\n",
+ "\n",
+ "# calculation\n",
+ "a2=(math.pi)/4*d2**2;\n",
+ "rho2=1.54; #lbm/ft^3 density at position 2\n",
+ "v2=(rho1/rho2)*(a1/a2)*v1 #ft/s\n",
+ "\n",
+ "# result\n",
+ "print \"Velocity is %f ft/s\"%v2\n",
+ "m=rho1*v1*a1 #lbm/s mass flow rate\n",
+ "print \"The mass flow rate is %f lbm/s\"%m"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity is 37.229437 ft/s\n",
+ "The mass flow rate is 405.265452 lbm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 page no : 91\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the mass flow rate, volumetric flow rate and velocity of waterin a pipe\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "d1=0.25; #m diameter of pipe at position 1\n",
+ "v1=2.; #m/s velocity\n",
+ "rho=998.2; #kg/m^3 density of water\n",
+ "a1=(math.pi)/4*d1**2; #m^2\n",
+ "d2=0.125 #m diameter of pipe at position 2\n",
+ "\n",
+ "# calculation\n",
+ "a2=(math.pi)/4*d2**2; #m^2\n",
+ "m=rho*a1*v1 #kg/s mass flow rate\n",
+ "\n",
+ "# result\n",
+ "print \"Mass flow rate is %f kg/s\"%m\n",
+ "q=m/rho #m^3/s volumetric flow rate\n",
+ "print \"The volumetric flow rate is %f m^3/s\"%q\n",
+ "v2=(a1/a2)*v1 #m/s velocity\n",
+ "print \"Velocity of water is %f m/s\"%v2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flow rate is 97.998056 kg/s\n",
+ "The volumetric flow rate is 0.098175 m^3/s\n",
+ "Velocity of water is 8.000000 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7 page no : 92\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calulate the time required\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "p_initial=1.; #atm pressure initially\n",
+ "p_final=0.0001; #atm pressure finally\n",
+ "V=10.; #ft^3 volume of system\n",
+ "q=1.; #ft^3/min vol. flow rate\n",
+ "\n",
+ "# calculation\n",
+ "t=(V/q)*math.log(p_initial/p_final) #min\n",
+ "\n",
+ "# result\n",
+ "print \"The time required is %f min\"%t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time required is 92.103404 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 page no : 93\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the final or steady state pressure in tank\n",
+ "\n",
+ "# variables\n",
+ "m_in=0.0001; #lbm/min\n",
+ "q_out=1.; #ft^3/min\n",
+ "rho_sys=m_in/q_out #lbm/ft^3\n",
+ "rho_air=0.075; #lbm/ft^3\n",
+ "p_initial=1.; #atm\n",
+ "\n",
+ "# calculation\n",
+ "p_steady=p_initial*(rho_sys/rho_air) #atm\n",
+ "\n",
+ "# result\n",
+ "print \"The steady state pressure is %f atm\"%p_steady"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The steady state pressure is 0.001333 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9 page no : 94\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate how fast the level of water is rising or falling in a cylindrical tank\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "d=3.; #m diameter of tank\n",
+ "a=(math.pi)*d**2/4; #m^2\n",
+ "d_in=0.1; #m inner diameter of inflow pipe\n",
+ "d_out=0.2; #m\n",
+ "v_in=2.0; #m/s\n",
+ "v_out=1.0; #m/s\n",
+ "\n",
+ "# calculation\n",
+ "q_in=((math.pi)*d_in**2/4.0)*v_in; #m^3/s\n",
+ "q_out=((math.pi)*d_out**2/4.0)*v_out; #m^3/s\n",
+ "\n",
+ "#let D represent d/dt\n",
+ "DV=q_in-q_out; #m^3/s\n",
+ "\n",
+ "# result\n",
+ "if DV>1:\n",
+ " print \"The water level in tank is rising\"\n",
+ "elif DV<1:\n",
+ " print \"The water level in tank is falling\"\n",
+ "else:\n",
+ " print \"No accumulation\"\n",
+ "#let h be the height of water in tank\n",
+ "Dh=DV/a #m/s \n",
+ "print \"The rate of level of water is rising or falling in a cylindrical tank is %f m/s\"%Dh"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The water level in tank is falling\n",
+ "The rate of level of water is rising or falling in a cylindrical tank is -0.002222 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11 page no : 97\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate flow rate of ventilation air supply\n",
+ "\n",
+ "# variables\n",
+ "q=5/8.0; #kg/hr mass evaporation rate of benzene\n",
+ "c=1.3*10**(-6); #kg/m^3 concentration of benzene\n",
+ "\n",
+ "# calculation\n",
+ "Q=q/c/3600.0 #m^3/s\n",
+ "\n",
+ "# result\n",
+ "print \"The flow rate of ventilation air supply is %f m^3/s\"%Q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow rate of ventilation air supply is 133.547009 m^3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch4.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch4.ipynb
new file mode 100644
index 00000000..392607c8
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch4.ipynb
@@ -0,0 +1,117 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Temperature"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 4.1 Page no. 92\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Temperature Conversion\n",
+ "# Solution\n",
+ "\n",
+ "# Variable\n",
+ "#(a)\n",
+ "Temp_c=100. ; #[degree Celsius]\n",
+ "\n",
+ "# Calculation and Result\n",
+ "Temp_k=Temp_c+273 ; #[K]\n",
+ "print '(a) Temperature in kelvin is %.2f K'%Temp_k\n",
+ "\n",
+ "#(b)\n",
+ "Temp_f=(100*(1.8/1)) +32 ; #[degree Fahrenheit]\n",
+ "print ' (b) Temperature in degree Fahrenheit is %.2f '%Temp_f\n",
+ "\n",
+ "#(c)\n",
+ "Temp_r= Temp_f + 460 ; #[degree Rankine ]\n",
+ "print ' (c) Temperature in degree Rankine is %.2f '%Temp_r"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Temperature in kelvin is 373.00 K\n",
+ " (b) Temperature in degree Fahrenheit is 212.00 \n",
+ " (c) Temperature in degree Rankine is 672.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page no. 93\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Temperature Conversion\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "c = 139.1 + (1.56*10**-1)*(-460-32)/1.8 ;\n",
+ "d = (1.56*10**-1)/1.8;\n",
+ "\n",
+ "# Calculation\n",
+ "#Now convert c +dTR to (Btu/lb mol*degree R) to get answer of form a + bTR,where\n",
+ "a = c*(454/(1055*1.8)) ;\n",
+ "b = d*(454/(1055*1.8)) ;\n",
+ "\n",
+ "# Result\n",
+ "print 'The required answer is %.2f + (%.2e)T Btu/(lb mol*degree R) , where T is in degree R . '%(a,b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required answer is 23.06 + (2.07e-02)T Btu/(lb mol*degree R) , where T is in degree R . "
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch5.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch5.ipynb
new file mode 100644
index 00000000..5023ef53
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch5.ipynb
@@ -0,0 +1,239 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Pressure"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page no.109\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure Conversion\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "P = 60 ; #[Gpa]\n",
+ "\n",
+ "# Calculation and Results\n",
+ "#(a)\n",
+ "p_atm = (P*(10**6))/101.3 ; #[atm]\n",
+ "print '(a) Pressure in atmospheres is %.2e atm'%p_atm\n",
+ "\n",
+ "#(b)\n",
+ "p_s = (P*(10**6)*14.696)/101.3 ; #[psia]\n",
+ "print ' (b) Pressure in psia is %.2e psia'%p_s\n",
+ "\n",
+ "# (c)\n",
+ "p_in = (P*(10**6)*29.92)/101.3 ; #[inches of Hg]\n",
+ "print ' (c) Pressure in inches of Hg is %.2e in. Hg'%p_in\n",
+ "\n",
+ "# (d)\n",
+ "p_mm = (P*(10**6)*760)/101.3 ; #[mm of Hg]\n",
+ "print ' (d) Pressure in mm of Hg is %.2e mm Hg'%p_mm"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Pressure in atmospheres is 5.92e+05 atm\n",
+ " (b) Pressure in psia is 8.70e+06 psia\n",
+ " (c) Pressure in inches of Hg is 1.77e+07 in. Hg\n",
+ " (d) Pressure in mm of Hg is 4.50e+08 mm Hg"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.2 Page no. 110\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure Conversion\n",
+ "# Solution\n",
+ "\n",
+ "# Variable\n",
+ "b_rd = 28.0 ; #[in. Hg]\n",
+ "p_rd = 51.0 ; #[psia]\n",
+ "\n",
+ "# calculation\n",
+ "p_atm = b_rd*14.7/29.92 ; # [psia]\n",
+ "p_tnk = p_atm+p_rd ; #[psia]\n",
+ "\n",
+ "# Result\n",
+ "print ' Pressure in tank in psia is %.1f psia'%p_tnk"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure in tank in psia is 64.8 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.3 Page no. 111\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Vacuum Pressure Reading\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "b_rd = 100.0 ; #[kPa]\n",
+ "gp = 64.5*101.3/76.0 ; #[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "p_tnk = b_rd-gp ; #[kPa]\n",
+ "\n",
+ "# Results\n",
+ "print ' Absolute Pressure in tank in is %.1f kPa'%p_tnk\n",
+ "print ' Since absolute pressure in tank(%.1f kPa) is less than 20 kPa , the \\\n",
+ " mice probably will not survive. '%p_tnk"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Absolute Pressure in tank in is 14.0 kPa\n",
+ " Since absolute pressure in tank(14.0 kPa) is less than 20 kPa , the mice probably will not survive. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.4 Page no. 115\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Pressure Difference\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "df = 1.10*10**3 ; #[kg/m**3]\n",
+ "d = 1.0*10**3 ; #[kg/m**3]\n",
+ "g = 9.8 ; #[m/s**2]\n",
+ "h = 22.0 ; #[mm]\n",
+ "\n",
+ "# Calculation\n",
+ "dP = (df-d)*g*(h*10**(-3)) ; #[Pa]\n",
+ "\n",
+ "# Result\n",
+ "print 'Pressure difference across the orifice plate is %.1f Pa.'%dP"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure difference across the orifice plate is 21.6 Pa.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.5 Page no. 117\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure Conversion\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "p_atm=730.0*29.92/760.0 ; #[in. Hg]\n",
+ "gp= (4.0*29.92)/(2.54*12*33.91) ; #[in. Hg]\n",
+ "\n",
+ "# Calculation\n",
+ "p_air=p_atm-gp ; #[in. Hg]\n",
+ "\n",
+ "# Result\n",
+ "print ' Pressure of the air is %.1f in. Hg.'%p_air"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure of the air is 28.6 in. Hg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch6.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch6.ipynb
new file mode 100644
index 00000000..5ffa4f19
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch6.ipynb
@@ -0,0 +1,170 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Introduction to Material Balances"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page no. 142\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# A Material Balance for the blending of Gasoline\n",
+ "# Solution\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables\n",
+ "# Given\n",
+ "P_O = 89 ; # Premium octane -[octane/gal]\n",
+ "S_O = 93 ; # Supereme octane - [octane/gal]\n",
+ "R_O = 87 ; # Regular octane - [octane/gal]\n",
+ "CP = 1.269 ; # Cost of premium octane -[$/gal]\n",
+ "SP = 1.349 ; # Cost of supereme octane -[$/gal]\n",
+ "RP = 1.149 ; # Cost of regular octane -[$/gal]\n",
+ "\n",
+ "# Let x and y fraction of regular octane and supreme octane is blended respectively,therefore: x + y = 1 ...(a)\n",
+ "# and 89 = 87x + 93y ...(b)\n",
+ "# Solve equations (a) and (b) simultaneously\n",
+ "# Calculation\n",
+ "a = matrix([[1,1],[87,93]]) ; # Matrix of coefficients of unknown\n",
+ "b = matrix([[1.0],[89.0]]) ; # Matrix of constant\n",
+ "a = a.I\n",
+ "c = a * b\n",
+ "cost = c[0]*RP + c[1]*SP ; # Cost after blending - [$/gal]\n",
+ "sv = CP - cost ; # Save on blending - [$/gal]\n",
+ "\n",
+ "# Result\n",
+ "# Check whether there is loss or save\n",
+ "if (sv<0):\n",
+ " print 'We will not save money by blending.'\n",
+ "else:\n",
+ " print 'We will save money by blending, and save is %.3f $/gal.'%sv"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "We will save money by blending, and save is 0.053 $/gal.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.2 Page no. 147\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Concentration of cells using a Centrifuge\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "fd= 1000.0 ; #feed rate-[L/hr]\n",
+ "cfd= 500.0; #Weight of cells per litre- [mg/L]\n",
+ "dn= 1.0 ; #Density of feed-[g/cm**3]\n",
+ "wp= 50.0 ; # Weight percent of cells in product stream\n",
+ "\n",
+ "# Calculation and Result\n",
+ "Pg=(fd*cfd*dn)/(1000*wp*.01) ; # Mass balance for cells \n",
+ "print ' Product flow(P) per hour is %.1f g'%Pg\n",
+ "Dg= (fd*dn*1000) - Pg*(wp*.01) ; # Mass balance for the fluid\n",
+ "print ' Discharge flow per hour is %.3e g'%Dg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Product flow(P) per hour is 1000.0 g\n",
+ " Discharge flow per hour is 9.995e+05 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page no. 154\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge of Tank Residuals to the Environment\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "dn = 0.80 ; #Density of motor oil-[g/cm**3]\n",
+ "\n",
+ "# Calculation and Result\n",
+ "in_ms = (10000*(0.1337)*62.4*dn) ; # Initial mass of motor oil in the tank -[lb]\n",
+ "print ' Initial mass of motor oil in the tank is %.1f lb'%in_ms\n",
+ "\n",
+ "m_fr = .0015 ; #Mass fractional loss\n",
+ "print ' Mass fractional loss is %.4f '%m_fr\n",
+ "\n",
+ "Dsg = m_fr*in_ms ; # Mass balance for the fluid\n",
+ "print ' Discharge of motor oil on flushing flow for 10000 gal motor oil is %.1f lb'%Dsg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Initial mass of motor oil in the tank is 66743.0 lb\n",
+ " Mass fractional loss is 0.0015 \n",
+ " Discharge of motor oil on flushing flow for 10000 gal motor oil is 100.1 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch7.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch7.ipynb
new file mode 100644
index 00000000..759dde83
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch7.ipynb
@@ -0,0 +1,152 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : A General Strategy for Solving Material Balance Problems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.1 Page no.169\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Understanding the Problem\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "v_ts = 105.0 ; # velocity of train wrt station-[cm/s]\n",
+ "v_mt = 30.0 ; # velocity of man wrt train-[cm/s]\n",
+ "v_hm = 2.0 ; # velocity of hot dough wrt man-[cm/s]\n",
+ "v_am = 1.0 ; # velocity of ant wrt man- [cm/s]\n",
+ "# By careful reading of problem you can see that ant is moving away from man's mouth at 1 cm/s , so ant's velocity wrt station \n",
+ "#is say v_as\n",
+ "\n",
+ "# Calculation\n",
+ "v_as = v_ts + v_mt + v_am;\n",
+ "\n",
+ "# Results\n",
+ "print ' The ant is moving towards station at the rate of %.1f cm/s.'%v_as"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The ant is moving towards station at the rate of 136.0 cm/s.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.4 Page no. 180\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Drawing a Sketch of a Mixing Process\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "n_un= 7 ; # Number of unknowns in the given problem- 3 values of xi and 4 values Fi\n",
+ "n_ie = 5 ; # Number of independent equations\n",
+ "\n",
+ "# Calculations\n",
+ "d_o_f = n_un-n_ie ; # No. of degree of freedom\n",
+ "\n",
+ "# Results\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 2 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.5 Page no. 182\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Placing the unknown Information on the Diagram\n",
+ "# Solution\n",
+ "\n",
+ "# variables\n",
+ "n_un=8 ; # Number of unknowns in the given problem- 8 values of mole fractions\n",
+ "n_ie =6 ; # Number of independent equations- six elemental balances \n",
+ "\n",
+ "# Calculation\n",
+ "d_o_f= n_un-n_ie ;# Number of degree of freedom\n",
+ "\n",
+ "# Results\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "#Note: Experiments show that the change in CH1.8O.5N.16S.0045P.0055 and the change in C(alpha)H(beta)O(gamma) prove to be \n",
+ "#related by amount of biomass present and the maintenance coefficient(the moles of substrate per mole of biomass per second) \n",
+ "#so the respective quantities cannot be chosen independently.Consequently with this extra constraint,only one degree of freedom \n",
+ "#remains to be specified, the basis"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 2 .\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch8.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch8.ipynb
new file mode 100644
index 00000000..4d600c4f
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch8.ipynb
@@ -0,0 +1,449 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Solving Material Balance Problems for Single Units without Reaction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.1 Page no. 197\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Extraction of Streptomycin from a Fermentation Broth\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "# Basis : 1 min\n",
+ "d_w = 1.0 ; # Density of aqueous solution-[g/cubic metre]\n",
+ "d_sol = 0.6 ; # Density of organic solvent-[g/cubic metre]\n",
+ "n_un = 8 ; # Number of unknowns in the given problem\n",
+ "n_ie = 8 ; # Number of independent equations\n",
+ "\n",
+ "# Calculation and Results\n",
+ "d_o_f = n_un-n_ie ; # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "# Material balance of Strep.\n",
+ "x = (200*10+10*0-200*0.2)/10; #[g]\n",
+ "print 'Strep per litre of solvent is %.1f g .'%x\n",
+ "\n",
+ "cnc = x/(1000*d_sol) ; #[g Strep/g of S]\n",
+ "print 'Strep per gram of solvent is %.4f g Strep/g of S .'%cnc\n",
+ "\n",
+ "m_fr = cnc/(1+cnc) ; #Mass fraction\n",
+ "print 'Mass fraction of Strep is %.3f g .'%m_fr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 .\n",
+ "Strep per litre of solvent is 196.0 g .\n",
+ "Strep per gram of solvent is 0.3267 g Strep/g of S .\n",
+ "Mass fraction of Strep is 0.246 g .\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.2 Page no. 199\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Separation of gases Using a Membrane\n",
+ "# Solution Fig. E8.2b\n",
+ "\n",
+ "# Variables\n",
+ "F_O2 = 0.21 ; # fraction of O2 in feed(F) \n",
+ "F_N2 = 0.79 ; # fraction of N2 in feed(F) \n",
+ "P_O2 = 0.25 ; # fraction of O2 in product(P)\n",
+ "P_N2 = 0.75 ; # fraction of N2 in product(P)\n",
+ "F = 100 ; # Feed - [g mol]\n",
+ "w = 0.80 ; # Fraction of waste\n",
+ "W = w*F ; # Waste -[g mol]\n",
+ "\n",
+ "# Calculation\n",
+ "# By analysis for degree of freedom , DOF comes to be zero \n",
+ "P = F - W ; # By overall balance - [g mol]\n",
+ "W_O2 = (F_O2*F - P*P_O2)/100 # Fraction of O2 in waste stream by O2 balance \n",
+ "W_N2 = (W - W_O2*100)/100 ; #Fraction of N2 in waste stream\n",
+ " \n",
+ "# Results \n",
+ "print 'Composition of Waste Stream' \n",
+ "print ' Component Fraction in waste stream' \n",
+ "print ' O2 %.2f'%W_O2 \n",
+ "print ' N2 %.2f'%W_N2 "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Composition of Waste Stream\n",
+ " Component Fraction in waste stream\n",
+ " O2 0.16\n",
+ " N2 0.64\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.3 Page no. 202\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Overall analysis for a continuous Distillation Column\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "# Basis : 1 hr so F = 1000 kg\n",
+ "F = 1000 ; # feed rate-[kg/hr]\n",
+ "P = F/10.0 ; # product mass flow rate -[kg/hr]\n",
+ "\n",
+ "n_un = 9 ; # Number of unknowns in the given problem\n",
+ "n_ie = 9 ; # Number of independent equations\n",
+ "\n",
+ "# Calculation and Result\n",
+ "d_o_f = n_un-n_ie ; # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "# Overall mass balance: F = P+B\n",
+ "B = F-P ; # bottom mass flow rate -[kg/hr]\n",
+ "print ' Bottom mass flow rate - %.1f kg '%B\n",
+ "\n",
+ "# Composition of bottoms by material balances\n",
+ "m_EtOH = 0.1*F-0.6*P ; # By EtOH balance-[kg]\n",
+ "m_H2O = 0.9*F - 0.4*P ; # By H2O balance-[kg]\n",
+ "total = m_EtOH+m_H2O ; #[kg]\n",
+ "f_EtOH = m_EtOH/total ; # Mass fraction of EtOH\n",
+ "f_H2O = m_H2O/total ; # Mass fraction of H2O\n",
+ "\n",
+ "print ' Mass of EtOH in bottom - %.1f kg '%m_EtOH\n",
+ "print ' Mass of H2O in bottom - %.1f kg '%m_H2O\n",
+ "print ' Mass fraction of EtOH in bottom - %.3f '%f_EtOH\n",
+ "print ' Mass fraction of H2O in bottom - %.3f '%f_H2O"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 .\n",
+ " Bottom mass flow rate - 900.0 kg \n",
+ " Mass of EtOH in bottom - 40.0 kg \n",
+ " Mass of H2O in bottom - 860.0 kg \n",
+ " Mass fraction of EtOH in bottom - 0.044 \n",
+ " Mass fraction of H2O in bottom - 0.956 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.4 Page no. 205\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Mixing of Battery Acid\n",
+ "# Solution Fig E8.4\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables\n",
+ "# Given\n",
+ "A = 200 ; # Mass of added solution [kg] \n",
+ "P_H2SO4 = .1863 ; #Fraction of H2SO4 in P(Final solution)\n",
+ "P_H2O = .8137 ; #Fraction of H2O in P(Final solution)\n",
+ "A_H2SO4 = .777 ; #Fraction of H2SO4 in A(Added solution)\n",
+ "A_H2O = .223 ; #Fraction of H2O in A(Added solution)\n",
+ "F_H2SO4 = .1243 ; #Fraction of H2SO4 in F(Original solution)\n",
+ "F_H2O = .8757 ; #Fraction of H2O in F(Original solution)\n",
+ "\n",
+ "# Calculations\n",
+ "# P - F = A - By overall balance\n",
+ "a = matrix([[P_H2O,-F_H2O],[1,-1]]) ; # Matrix of coefficient\n",
+ "b = matrix([[A*A_H2O],[A]]) ; # Matrix of contants\n",
+ "a = a.I\n",
+ "x = a*b ; # Matrix of solutions- P = x(1) and F = x(2)\n",
+ "\n",
+ "#Results\n",
+ "print ' Original solution taken- %.0i kg'%x[1]\n",
+ "print ' Final solution or kilograms of battery acid formed- %.0i kg'%x[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Original solution taken- 1905 kg\n",
+ " Final solution or kilograms of battery acid formed- 2105 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.5 Page no. 207\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Drying\n",
+ "# Solution Fig E8.5\n",
+ "from numpy import matrix\n",
+ "\n",
+ "# Variables\n",
+ "# Given\n",
+ "W = 100.0 ; # Water removed - [kg]\n",
+ "A_H2O = 0.80 ; # Fraction of water in A(intial fish cake)\n",
+ "A_BDC = 0.20 ; # Fraction of BDC(bone dry cake) in B(final dry fish cake)\n",
+ "B_H2O = 0.40 ; # Fraction of water in A(intial fish cake)\n",
+ "B_BDC = 0.60 ; # Fraction of BDC(bone dry cake) in B(final dry fish cake)\n",
+ "\n",
+ "# Calculations\n",
+ "a = matrix([[A_H2O, -B_H2O],[1, -1]]) ; # Matrix of coefficient\n",
+ "b = matrix([[W],[W]]) ; # Matrix of contants\n",
+ "a = a.I\n",
+ "x = a * b; # Matrix of solutions- A = x(1) and B = x(2)\n",
+ "\n",
+ "# Results\n",
+ "print 'Weight of the fish cake originally put into dryer -%.0i kg'%x[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Weight of the fish cake originally put into dryer -150 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.6 Page no. 209\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Crystallizaton\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "# Composition of initial solution at 30 degree C\n",
+ "s_30 = 38.8 ; # solublity of Na2CO3 at 30 degree C, by using the table for solublity of Na2CO3-[g Na2CO3/100 g H2O]\n",
+ "If_Na2CO3 = s_30/(s_30+100) ; # Initial mass fraction of Na2CO3\n",
+ "If_H2O = 1-If_Na2CO3 ; # Initial mass fraction of H2O\n",
+ "\n",
+ "# Composition of crystals\n",
+ "# Basis : 1g mol Na2CO3.10H2O\n",
+ "n_mol_Na2CO3 = 1 ; # Number of moles of Na2CO3\n",
+ "n_mol_H2O = 10. ; # Number of moles of H2O\n",
+ "mwt_Na2CO3 = 106. ; # mol. wt of Na2CO3\n",
+ "mwt_H2O = 18. ; # mol. wt of H2O\n",
+ "\n",
+ "# Calculation and Results\n",
+ "m_Na2CO3 = mwt_Na2CO3*n_mol_Na2CO3 ; # Mass of Na2CO3\n",
+ "m_H2O = mwt_H2O*n_mol_H2O ; # Mass of H2O\n",
+ "Cf_Na2CO3 = m_Na2CO3/(m_Na2CO3+m_H2O) ; # mass fraction of Na2CO3 \n",
+ "Cf_H2O = 1-Cf_Na2CO3 ; # mass fraction of H2O\n",
+ "\n",
+ "n_un = 9. ; # Number of unknowns in the given problem\n",
+ "n_ie = 9. ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie ; # Number of degree of freedom\n",
+ "\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "# Final composition of tank\n",
+ "#Basis :I = 10000 kg\n",
+ "# Material balance reduces to Accumulation = final -initial = in-out(but in = 0)\n",
+ "I = 10000. ; #initial amount of saturated solution-[kg]\n",
+ "amt_C = 3000. ; # Amount of crystals formed-[kg]\n",
+ "Fm_Na2CO3 = I*If_Na2CO3-amt_C*Cf_Na2CO3 ; # Mass balance of Na2CO3\n",
+ "Fm_H2O = I*If_H2O-amt_C*Cf_H2O ; # Mass balance of H2O\n",
+ "\n",
+ "#To find temperature,T\n",
+ "s_T = (Fm_Na2CO3/Fm_H2O)*100 ; # Solublity of Na2CO3 at temperature T\n",
+ "s_20 = 21.5 ; #Solublity of Na2CO3 at temperature 20 degree C ,from given table-[g Na2CO3/100 g H2O]\n",
+ "\n",
+ "# Find T by interpolation\n",
+ "T = 30-((s_30-s_T)/(s_30-s_20))*(30-20) ; # Temperature -[degree C]\n",
+ "print ' Temperature to which solution has to be cooled to get 3000 kg crystals is %.0f degree C .'%T"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 .\n",
+ " Temperature to which solution has to be cooled to get 3000 kg crystals is 26 degree C .\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.7 Page no. 213\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Hemodialysis\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "# Write given data\n",
+ "B_in = 1.1 ; # Flow rate in of blood -[L/min]\n",
+ "B_out = 1.2; # Flow rate out of blood -[L/min]\n",
+ "S_in = 1.7; # Flow rate in of solution -[L/min]\n",
+ "\n",
+ "# Composition of input blood\n",
+ "B_in_CR = 2.72 ; #[g/L]\n",
+ "B_in_UR = 1.16 ; #[g/L]\n",
+ "B_in_U = 18 ; #[g/L]\n",
+ "B_in_P = 0.77 ; #[g/L]\n",
+ "B_in_K = 5.77 ; #[g/L]\n",
+ "B_in_Na = 13.0 ; #[g/L]\n",
+ "B_in_water = 1100 ; #[mL/min]\n",
+ "\n",
+ "# Composition of output blood\n",
+ "B_out_CR = 0.120 ; #[g/L]\n",
+ "B_out_UR = 0.060; #[g/L]\n",
+ "B_out_U = 1.51 ; #[g/L]\n",
+ "B_out_P = 0.040 ; #[g/L]\n",
+ "B_out_K = 0.120 ; #[g/L]\n",
+ "B_out_Na = 3.21 ; #[g/L]\n",
+ "B_out_water = 1200. ; #[mL/min]\n",
+ "\n",
+ "# Calculation and Result\n",
+ "n_un = 7. ; # Number of unknowns in the given problem\n",
+ "n_ie = 7. ; # Number of independent equations\n",
+ "d_o_f = n_un-n_ie ; # Number of degree of freedom\n",
+ "print 'Number of degree of freedom for the given system is %i .'%d_o_f\n",
+ "\n",
+ "# Water balance in grams, assuming 1 ml is equivalent to 1 g\n",
+ "S_in_water = 1700. ; #[ml/min]\n",
+ "S_out_water = B_in_water+ S_in_water - B_out_water;\n",
+ "S_out = S_out_water/1000. ; #[L/min]\n",
+ "print ' Flow rate of water in output solution is %.2f L/min.'%S_out\n",
+ "\n",
+ "# The component balance in grams for CR,UR,U,P,K and Na are\n",
+ "S_out_CR = (B_in*B_in_CR - B_out*B_out_CR)/S_out;\n",
+ "S_out_UR = (B_in*B_in_UR - B_out*B_out_UR)/S_out;\n",
+ "S_out_U = (B_in*B_in_U - B_out*B_out_U)/S_out;\n",
+ "S_out_P = (B_in*B_in_P - B_out*B_out_P)/S_out;\n",
+ "S_out_K = (B_in*B_in_K - B_out*B_out_K)/S_out;\n",
+ "S_out_Na = (B_in*B_in_Na - B_out*B_out_Na)/S_out;\n",
+ "print ' Component Concentration(g/L) in output Dialysis solution '\n",
+ "print ' UR %.2f '%S_out_UR\n",
+ "print ' CR %.2f '%S_out_CR\n",
+ "print ' U %.2f '%S_out_U\n",
+ "print ' P %.2f '%S_out_P\n",
+ "print ' K %.2f '%S_out_K\n",
+ "print ' Na %.2f '%S_out_Na"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of degree of freedom for the given system is 0 .\n",
+ " Flow rate of water in output solution is 1.60 L/min.\n",
+ " Component Concentration(g/L) in output Dialysis solution \n",
+ " UR 0.75 \n",
+ " CR 1.78 \n",
+ " U 11.24 \n",
+ " P 0.50 \n",
+ " K 3.88 \n",
+ " Na 6.53 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb
new file mode 100644
index 00000000..4b127966
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb
@@ -0,0 +1,514 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : The Chemical Reaction Equation and Stoichiometry"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no. 228\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Balancing a reaction for a Biological Reaction\n",
+ "# Solution\n",
+ "\n",
+ "# variables\n",
+ "# Given \n",
+ "#Main eqn. C6H12O6 + aO2 ---> bCO2 + cH2O\n",
+ "# By carbon balance\n",
+ "b = 6 ;\n",
+ "\n",
+ "#By hydrogen balance\n",
+ "c = 6;\n",
+ "\n",
+ "# calculation\n",
+ "#Balancing oxygen in reaction\n",
+ "a = (c*1+b*2-6)/2.0;\n",
+ "\n",
+ "#result\n",
+ "print 'Value of a is %i'%a\n",
+ "print 'Value of b is %i'%b\n",
+ "print 'Value of c is %i'%c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a is 6\n",
+ "Value of b is 6\n",
+ "Value of c is 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.2 Page no. 229\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Use of Chemical Reaction to Calculate the Mass of Reactants given the Mass of Products\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "m_CO2 = 44.0 ; #molecular wt-[g]\n",
+ "m_C7H16 = 100.1 ; #molecular wt-[g]\n",
+ "p_con = 50. ; # percentage conversion of CO2 to dry ice\n",
+ "amt_di = 500. ; # amount of dry ice to be produce per hour-[kg]\n",
+ "\n",
+ "# Calculation\n",
+ "# By using the given equation \n",
+ "amt_C7H16 = (amt_di*m_C7H16)/((p_con/100.)*m_CO2*7) ;# [kg]\n",
+ "\n",
+ "# Result\n",
+ "print 'Amount of heptane required per hour to produce 500kg dry ice per hour is %.1f kg.'%amt_C7H16"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of heptane required per hour to produce 500kg dry ice per hour is 325.0 kg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.3 Page no. 230\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of Stoichiometry when more than one Reaction occurs\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "m_CaCO3 = 100.1 ; #molecular wt-[g]\n",
+ "m_MgCO3 = 84.32 ; #molecular wt-[g]\n",
+ "m_CaO = 56.08 ; #molecular wt-[g]\n",
+ "m_MgO = 40.32 ; #molecular wt-[g]\n",
+ "m_CO2 = 44.0 ; #molecular wt-[g]\n",
+ "\n",
+ "# Limestone analysis\n",
+ "p_CaCO3 = 92.89 ; # percentage of CaCO3\n",
+ "p_MgCO3 = 5.41 ; # percentage of MgCO3 \n",
+ "inrt = 1.7 ; #percentage of inert\n",
+ "\n",
+ "# Calculation and Results\n",
+ "#(a)\n",
+ "amt_CaO = (((p_CaCO3/100)*m_CaO)/m_CaCO3)*2000 ; #Pounds of CaO produced from 1 ton(2000lb) of limestone\n",
+ "print ' Amount of CaO produced from 1 ton(2000lb) of limestone is %.0f lb.'%amt_CaO\n",
+ "\n",
+ "#(b)\n",
+ "mol_CaCO3 = (p_CaCO3/100)/m_CaCO3 ; # lb mol of CaCO3\n",
+ "mol_MgCO3 = (p_MgCO3/100)/m_MgCO3 ; # lb mol of MgCO3\n",
+ "total_mol = mol_CaCO3+mol_MgCO3;\n",
+ "amt_CO2 = total_mol*m_CO2 ; # Amount of CO2 recovered per pound of limestone-[lb]\n",
+ "print ' Amount of CO2 recovered per pound of limestone is %.3f lb.'%amt_CO2\n",
+ "\n",
+ "#(c)\n",
+ "amt_CaO = m_CaO*mol_CaCO3 ; # since lb mol of CaO = CaCO3\n",
+ "amt_MgO = m_MgO*mol_MgCO3 ; # since lb mol of MgO = MgCO3\n",
+ "total_lime = amt_CaO+amt_MgO+(inrt)/100 ; # total amount of lime per pound limestone\n",
+ "amt_lmst = 2000/total_lime ; # Amount of limestone required to make 1 ton(2000lb) of lime \n",
+ "print ' Amount of limestone required to make 1 ton(2000lb) of lime %.1f lb.'%amt_lmst"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Amount of CaO produced from 1 ton(2000lb) of limestone is 1041 lb.\n",
+ " Amount of CO2 recovered per pound of limestone is 0.437 lb.\n",
+ " Amount of limestone required to make 1 ton(2000lb) of lime 3550.7 lb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.4 Page no. 235\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of extent of Reaction\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "f_NH3 = 5. ; # NH3 in feed-[g]\n",
+ "f_N2 = 100. ; # N2 in feed-[g]\n",
+ "f_H2 = 50. ; # H2 in feed-[g]\n",
+ "p_NH3 = 90. # NH3 in product-[g]\n",
+ "m_NH3 = 17. ; # Molecular wt. of NH3-[g]\n",
+ "m_N2 = 28. ; # Molecular wt. of N2-[g]\n",
+ "m_H2 = 2. ; # Molecular wt. of H2-[g]\n",
+ "\n",
+ "# Calculations \n",
+ "# Extent of reaction can be calculated by using eqn. 9.3 \n",
+ "# For NH3\n",
+ "ni = p_NH3/m_NH3 ; #[g mol NH3]\n",
+ "nio = f_NH3/m_NH3 ; #[g mol NH3]\n",
+ "vi = 2 ; # coefficint of NH3\n",
+ "ex_r = (ni-nio)/vi # Extent of reaction - moles reacting\n",
+ "\n",
+ "#Determine H2 and N2 in product of reaction by Eqn. 9.4\n",
+ "# For N2\n",
+ "nio_N2 = f_N2/m_N2 ; #[g mol N2]\n",
+ "vi_N2 = -1 ; # coefficint of N2\n",
+ "ni_N2 = nio_N2 + vi_N2*ex_r ; #N2 in product of reaction-[g moles ]\n",
+ "m_N2 = ni_N2*m_N2 ; # mass of N2 in product of reaction-[g]\n",
+ "\n",
+ "# Results\n",
+ "print ' N2 in product of reaction is %.2f g moles '%ni_N2\n",
+ "print ' Mass of N2 in product of reaction is %.2f g '%m_N2\n",
+ "# For H2\n",
+ "nio_H2 = f_H2/m_H2 ; #[g mol H2]\n",
+ "vi_H2 = -3 ; # coefficint of H2\n",
+ "ni_H2 = nio_H2 + vi_H2*ex_r ; #H2 in product of reaction-[g moles ]\n",
+ "m_H2 = ni_H2*m_H2 ; # mass of H2 in product of reaction-[g]\n",
+ "print ' H2 in product of reaction is %.2f g moles '%ni_H2\n",
+ "print ' Mass of H2 in product of reaction is %.2f g '%m_H2\n",
+ "\n",
+ "# ARP\n",
+ "m_SO2 = 64. ; # Molecular wt.of SO2-[g]\n",
+ "mol_SO2 = 2. ; # moles of SO2\n",
+ "ARP = (1./m_NH3)/(mol_SO2/m_SO2);\n",
+ "print ' ARP is %.2f '%ARP"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " N2 in product of reaction is 1.07 g moles \n",
+ " Mass of N2 in product of reaction is 30.00 g \n",
+ " H2 in product of reaction is 17.50 g moles \n",
+ " Mass of H2 in product of reaction is 35.00 g \n",
+ " ARP is 1.88 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.5 Page no. 238\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Limiting and Excess Reactants\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "f_N2 = 10. ; # N2 in feed-[g]\n",
+ "f_H2 = 10. ; # H2 in feed-[g]\n",
+ "m_NH3 = 17.02 # Molecular wt. of NH3-[g]\n",
+ "m_N2 = 28. ; # Molecular wt. of N2-[g]\n",
+ "m_H2 = 2. ; # Molecular wt. of H2-[g]\n",
+ "\n",
+ "# Calculations\n",
+ "# Extent of reaction can be calculated by using eqn. 9.3 \n",
+ "# Based on N2\n",
+ "nio_N2 = f_N2/m_N2 #[g mol N2]\n",
+ "vi_N2 = -1 ; # coefficint of N2\n",
+ "ex_N2 = -(nio_N2)/vi_N2 ; # Max. extent of reaction based on N2\n",
+ "\n",
+ "# Based on H2\n",
+ "nio_H2 = f_H2/m_H2 ; #[g mol H2]\n",
+ "vi_H2 = -3 ; # coefficint of H2\n",
+ "ex_H2 = -(nio_H2)/vi_H2 # Max. extent of reaction based on H2\n",
+ "\n",
+ "#(a)\n",
+ "vi_NH3 = 2 ; # coefficint of NH3\n",
+ "mx_NH3 = ex_N2*vi_NH3*m_NH3 ; # Max. amount of NH3 that can be produced\n",
+ "\n",
+ "# Results\n",
+ "print ' (a) Max. amount of NH3 that can be produced is %.1f g'%mx_NH3\n",
+ "\n",
+ "#(b) and (c)\n",
+ "if (ex_H2 > ex_N2 ):\n",
+ " print ' (b) N2 is limiting reactant '\n",
+ " print ' (c) H2 is excess reactant '\n",
+ " ex_r = ex_N2\n",
+ "else:\n",
+ " print ' (b) H2 is limiting reactant '\n",
+ " print ' (c) N2 is excess reactant '\n",
+ " ex_r = ex_H2 ;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) Max. amount of NH3 that can be produced is 12.2 g\n",
+ " (b) N2 is limiting reactant \n",
+ " (c) H2 is excess reactant \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.6 Page no. 242\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Yeilds in the Reaction of Glucose to produce Ethanol\n",
+ "# Solution\n",
+ "\n",
+ "# variables\n",
+ "#(a)\n",
+ "mol_bms = 0.59 ; # Biomass produced per g mol of glucose-[g mol biomass/ g mol glucose]\n",
+ "mw_bms = 23.74 ; # molecular wt. of biomass -[g]\n",
+ "mw_gls = 180.0 ; # molecular wt. of glucose -[g]\n",
+ "\n",
+ "# calculations and Results\n",
+ "ms_bms = (mol_bms*mw_bms)/mw_gls ; # Biomass produced per gram of glucose-[g biomass/ g glucose]\n",
+ "print '(a) Biomass produced per gram of glucose is %.4f g biomass/ g glucose.'%ms_bms\n",
+ "\n",
+ "#(b)\n",
+ "mol_etol = 1.3 ; #Ethanol produced per g mol of glucose-[g mol ethanol/ g mol glucose]\n",
+ "mw_etol = 46.0 ; # molecular wt. of ethanol -[g]\n",
+ "ms_etol = (mol_etol*mw_etol)/mw_gls ; # Ethanol produced per gram of glucose-[g ethanol/ g glucose]\n",
+ "print ' (b) Ethanol produced per gram of glucose is %.3f g ethanol/ g glucose.'%ms_etol"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Biomass produced per gram of glucose is 0.0778 g biomass/ g glucose.\n",
+ " (b) Ethanol produced per gram of glucose is 0.332 g ethanol/ g glucose.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.7 Page no. 243\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Selectivity in the Production of Nanotubes\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "# By using reaction (a)\n",
+ "H2_a = 3-0.50 # H2 produced in reaction (a)\n",
+ "\n",
+ "# Calculations\n",
+ "C_a = (2./3)*H2_a ; # Nanotubes(the C) produced by reaction (a)\n",
+ "sel = C_a/0.50 ; # Selectivity of C reletive to C2H4-[g mol C/ g mol C2H4]\n",
+ "\n",
+ "# Results\n",
+ "print 'Selectivity of C reletive to C2H4 is %.2f g mol C/ g mol C2H4.'%sel"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Selectivity of C reletive to C2H4 is 3.33 g mol C/ g mol C2H4.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.8 Page no. 244\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of various terms Pertaning to Reaction\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "m_C3H6 = 42.08 # molecular wt. of propene-[g]\n",
+ "m_C3H5Cl = 76.53 ; # molecular wt. of C3H5Cl-[g]\n",
+ "m_C3H6Cl2 = 112.99 ; # molecular wt. of C3H6Cl2-[g]\n",
+ "\n",
+ "# Product analysis\n",
+ "pml_Cl2 = 141.0 ; # [g mol]\n",
+ "pml_C3H6 = 651.0 ; #[g mol]\n",
+ "pml_C3H5Cl = 4.6 ; # [g mol]\n",
+ "pml_C3H6Cl2 = 24.5 ; # [g mol]\n",
+ "pml_HCL = 4.6 ; #[g mol]\n",
+ "\n",
+ "# Calculation & Results\n",
+ "#(a)\n",
+ "a_Cl = pml_C3H5Cl; # Chlorine reacted by eqn.(a)\n",
+ "b_Cl = pml_C3H6Cl2 ; # Chlorine reacted by eqn.(b)\n",
+ "fed_Cl = pml_Cl2+a_Cl+b_Cl ; # Total chlorine fed to reactor-[g mol]\n",
+ "\n",
+ "#by analysing reaction (a) and (b)\n",
+ "a_C3H6 = a_Cl+b_Cl ; # C3H6 reacted by reaction (a)\n",
+ "fed_C3H6 = pml_C3H6+a_C3H6 ; #Total C3H6 fed to reactor-[g mol]\n",
+ "\n",
+ "\n",
+ "print '(a) Total chlorine fed to reactor is %.2f g mol '%fed_Cl\n",
+ "print ' Total C3H6 fed to reactor is %.2f g mol '%fed_C3H6\n",
+ "\n",
+ "#(b) and (c)\n",
+ "# Extent of reaction can be calculated by using eqn. 9.3 \n",
+ "# Based on C3H6\n",
+ "nio_C3H6 = fed_C3H6 ; #[g mol C3H6]\n",
+ "vi_C3H6 = -1 ; # coefficint of C3H6\n",
+ "ex_C3H6 = -(nio_C3H6)/vi_C3H6 ; # Max. extent of reaction based on C3H6\n",
+ "\n",
+ "# Based on Cl2\n",
+ "nio_Cl2 = fed_Cl; #[g mol Cl2]\n",
+ "vi_Cl2 = -1 ; # coefficint of Cl2\n",
+ "ex_Cl2 = -(nio_Cl2)/vi_Cl2 ;# Max. extent of reaction based on Cl2\n",
+ "\n",
+ "if (ex_Cl2 > ex_C3H6 ):\n",
+ " print ' (b) C3H6 is limiting reactant '\n",
+ " print ' (c)Cl2 is excess reactant '\n",
+ " ex_r = ex_C3H6;\n",
+ "else:\n",
+ " print ' (b) Cl2 is limiting reactant '\n",
+ " print ' (c) C3H6 is excess reactant '\n",
+ " ex_r = ex_Cl2;\n",
+ "\n",
+ "#(d)\n",
+ "fr_cn = pml_C3H5Cl/fed_C3H6 ; #Fractional conversion of C3H6 to C3H5Cl\n",
+ "print ' (d) Fractional conversion of C3H6 to C3H5Cl is %.2e '%fr_cn\n",
+ "\n",
+ "#(e)\n",
+ "sel = pml_C3H5Cl/pml_C3H6Cl2 ; # Selectivity of C3H5Cl relative to C3H6Cl2\n",
+ "print ' (e) Selectivity of C3H5Cl relative to C3H6Cl2 is %.2f g mol C3H5Cl/g mol C3H6Cl2 '%sel\n",
+ "\n",
+ "#(f)\n",
+ "yld = (m_C3H5Cl*pml_C3H5Cl)/(m_C3H6*fed_C3H6) # Yield of C3H5Cl per g C3H6 fed to reactor\n",
+ "print ' (f) Yield of C3H5Cl per g C3H6 fed to reactor is %.3f g C3H5Cl/g C3H6 '%yld\n",
+ "\n",
+ "#(g)\n",
+ "vi_C3H5Cl = 1 ; # coefficint of C3H5Cl\n",
+ "vi_C3H6Cl2 = 1 ; # coefficint of C3H6Cl2\n",
+ "ex_a = (pml_C3H5Cl-0)/vi_C3H5Cl ; # Extent of reaction a as C3H5Cl is produced only in reaction a\n",
+ "ex_b = (pml_C3H6Cl2-0)/vi_C3H6Cl2 ; # Extent of reaction b as C3H6Cl2 is produced only in reaction b\n",
+ "print ' (g) Extent of reaction a as C3H5Cl is produced only in reaction a is %.1f '%ex_a\n",
+ "print ' Extent of reaction b as C3H6Cl2 is produced only in reaction b %.1f '%ex_b\n",
+ "\n",
+ "#(h)\n",
+ "in_Cl = fed_Cl*2 ; #Entering Cl -[g mol]\n",
+ "out_Cl = pml_HCL ; # Exiting Cl in HCl-[g mol]\n",
+ "ef_w = out_Cl/in_Cl ; # Mole efficiency of waste\n",
+ "ef_pr = 1-ef_w ; # Mole efficiency of product\n",
+ "print ' (h) Mole efficiency of product is %.3f '%ef_pr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total chlorine fed to reactor is 170.10 g mol \n",
+ " Total C3H6 fed to reactor is 680.10 g mol \n",
+ " (b) Cl2 is limiting reactant \n",
+ " (c) C3H6 is excess reactant \n",
+ " (d) Fractional conversion of C3H6 to C3H5Cl is 6.76e-03 \n",
+ " (e) Selectivity of C3H5Cl relative to C3H6Cl2 is 0.19 g mol C3H5Cl/g mol C3H6Cl2 \n",
+ " (f) Yield of C3H5Cl per g C3H6 fed to reactor is 0.012 g C3H5Cl/g C3H6 \n",
+ " (g) Extent of reaction a as C3H5Cl is produced only in reaction a is 4.6 \n",
+ " Extent of reaction b as C3H6Cl2 is produced only in reaction b 24.5 \n",
+ " (h) Mole efficiency of product is 0.986 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms.png
new file mode 100644
index 00000000..a1bab145
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_1.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_1.png
new file mode 100644
index 00000000..a1bab145
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_1.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_2.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_2.png
new file mode 100644
index 00000000..a1bab145
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_2.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_3.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_3.png
new file mode 100644
index 00000000..a1bab145
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/Adsorptionisotherms_3.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/bb.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/bb.png
new file mode 100644
index 00000000..81ceba34
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/bb.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/cc.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/cc.png
new file mode 100644
index 00000000..017d45cd
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/cc.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart.png
new file mode 100644
index 00000000..6e061e73
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_1.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_1.png
new file mode 100644
index 00000000..6e061e73
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_1.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_2.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_2.png
new file mode 100644
index 00000000..6e061e73
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_2.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_3.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_3.png
new file mode 100644
index 00000000..6e061e73
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/coxchart_3.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater.png
new file mode 100644
index 00000000..852e9c76
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_1.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_1.png
new file mode 100644
index 00000000..852e9c76
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_1.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_2.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_2.png
new file mode 100644
index 00000000..852e9c76
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_2.png
Binary files differ
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_3.png b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_3.png
new file mode 100644
index 00000000..852e9c76
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/screenshots/heatvaporizationwater_3.png
Binary files differ
diff --git a/Beginning_C_By_Ivon_Horton/README.txt b/Beginning_C_By_Ivon_Horton/README.txt
new file mode 100644
index 00000000..da9aaad9
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Vaibhav Vajani
+Course: others
+College/Institute/Organization: brahmanand institute of management & science
+Department/Designation: Assistant Professor
+Book Title: Beginning C By Ivon Horton
+Author: Ivor Horton
+Publisher: Apress publication
+Year of publication: 2013
+Isbn: 978-1-4302-4881-1
+Edition: 5th \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter1.ipynb b/Beginning_C_By_Ivon_Horton/chapter1.ipynb
new file mode 100644
index 00000000..c989b607
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter1.ipynb
@@ -0,0 +1,260 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Programming in C"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 1.1, page no. 6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Very First C Program - Displaying Hello World */\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Hello world!\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 1.2, page no. 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Second C Program\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"\\\"If at first you don't succeed, try, try, try again!\\\"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\"If at first you don't succeed, try, try, try again!\"\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 1.3, page no. 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Another Simple C Program - Displaying a Quotation\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Beware the Ides of March!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beware the Ides of March!\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "program 1.4, page no. 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Displaying Quotation \n",
+ "\"\"\"\n",
+ "\n",
+ "print \"My formula for success?\\nRise early, work late, strike oil.\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "My formula for success?\n",
+ "Rise early, work late, strike oil.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Program 1.5, page no. 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Another Simple C Program - Displaying Great Quotations\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"\\\"It is a wise father that knows his own child.\\\"\\nShakespeare\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\"It is a wise father that knows his own child.\"\n",
+ "Shakespeare\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 1.6, page no. 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Another Simple C Program - Displaying Great Quotations\n",
+ "note: \\a does not work in python\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Be careful!!\\n \\a\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Be careful!!\n",
+ " \u0007\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 1.7, page no. 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A longer program\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Hi there!\\nThis program is a bit longer than the others.\"\n",
+ "print \"But really it's only more text.\\n\\a\\a\"\n",
+ "print \"Hey, wait a minute!! What was that???\\n\"\n",
+ "print \"\\t1.\\tA bird?\"\n",
+ "print \"\\t2.\\tA plane?\"\n",
+ "print \"\\t3.\\tA control character?\"\n",
+ "print \"\\t\\t\\b\\bAnd how will this look when it print's out?\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hi there!\n",
+ "This program is a bit longer than the others.\n",
+ "But really it's only more text.\n",
+ "\u0007\u0007\n",
+ "Hey, wait a minute!! What was that???\n",
+ "\n",
+ "\t1.\tA bird?\n",
+ "\t2.\tA plane?\n",
+ "\t3.\tA control character?\n",
+ "\t\t\b\bAnd how will this look when it print's out?\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter10.ipynb b/Beginning_C_By_Ivon_Horton/chapter10.ipynb
new file mode 100644
index 00000000..fd052668
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter10.ipynb
@@ -0,0 +1,846 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10: Essential Input and Output"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.1, page no. 400 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Exercising formatted input\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "def try_input(prompt, format):\n",
+ " value_count = 5\n",
+ " print prompt\n",
+ " fp1 = float(raw_input(\"fp1: \"))\n",
+ " i = int(raw_input(\"i: \"))\n",
+ " j = int(raw_input(\"j: \"))\n",
+ " word1 = raw_input()\n",
+ " size_word1 = sys.getsizeof(word1)\n",
+ " word2 = raw_input()\n",
+ " size_word2 = sys.getsizeof(word2)\n",
+ " print \"The input format string for scanf_s() is: \\\"%s\\\"\" %format\n",
+ " print \"Count of bytes read = \", (size_word1 + size_word2)\n",
+ " print \"Count of values read = %d\" % value_count\n",
+ " print \"fp1 = %f i = %d j = %d\" %(fp1, i, j)\n",
+ " print \"word1 = %s word2 = %s\" %(word1, word2)\n",
+ " \n",
+ "try_input(\"Enter as input: -2.35 15 25 ready2go \", \"%f %d %d %[abcdefghijklmnopqrstuvwxyz] %*1d %s%n\" )\n",
+ "try_input(\"Enter the same input again: \", \"%4f %4d %d %*d %[abcdefghijklmnopqrstuvwxyz] %*1d %[^o]%n\")\n",
+ "try_input(\"Enter as input: -2.3 15 25 ready2go\\n\",\"%4f %4d %d %*d %[abcdefghijklmnopqrstuvwxyz] %*1d %[^o]%n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter as input: -2.35 15 25 ready2go \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp1: -2.35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i: 15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "j: 25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ready2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "go\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input format string for scanf_s() is: \"%f %d %d %[abcdefghijklmnopqrstuvwxyz] %*1d %s%n\"\n",
+ "Count of bytes read = 82\n",
+ "Count of values read = 5\n",
+ "fp1 = -2.350000 i = 15 j = 25\n",
+ "word1 = ready2 word2 = go\n",
+ "Enter the same input again: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp1: -2.35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i: 15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "j: 25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ready 2go\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2go\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input format string for scanf_s() is: \"%4f %4d %d %*d %[abcdefghijklmnopqrstuvwxyz] %*1d %[^o]%n\"\n",
+ "Count of bytes read = 86\n",
+ "Count of values read = 5\n",
+ "fp1 = -2.350000 i = 15 j = 25\n",
+ "word1 = ready 2go word2 = 2go\n",
+ "Enter as input: -2.3 15 25 ready2go\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp1: -2.35\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i: 15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "j: 225\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ready2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "go\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input format string for scanf_s() is: \"%4f %4d %d %*d %[abcdefghijklmnopqrstuvwxyz] %*1d %[^o]%n\"\n",
+ "Count of bytes read = 82\n",
+ "Count of values read = 5\n",
+ "fp1 = -2.350000 i = 15 j = 225\n",
+ "word1 = ready2 word2 = go\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.2, page no. 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Characters in the format control string\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "value_count = 2\n",
+ "print \"Enter: fp1 = 3.14159 i = 7 j = 8\"\n",
+ "print \"Input: \"\n",
+ "fp1 = float(raw_input(\"fp1: \"))\n",
+ "i = int(raw_input(\"i: \"))\n",
+ "j = int(raw_input(\"j: \"))\n",
+ "\n",
+ "print \"Output:\"\n",
+ "print \"Count of values read = \", value_count\n",
+ "print \"fp1 = %f\\ti = %d\\tj = %d \" %(fp1, i, j)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter: fp1 = 3.14159 i = 7 j = 8\n",
+ "Input: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp1: 3.13159\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i: 7\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "j: 8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output:\n",
+ "Count of values read = 2\n",
+ "fp1 = 3.131590\ti = 7\tj = 8 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.3, page no. 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Floating-Point Input\n",
+ "note: the way it is given in textbook is not possible in python. Just showing a\n",
+ "sample float input.\n",
+ "\"\"\"\n",
+ "\n",
+ "value_count = 3\n",
+ "print \"Enter: 3.14 3.14 3.14\"\n",
+ " \n",
+ "print \"Input: \"\n",
+ "\n",
+ "fp1 = float(raw_input(\"fp1: \"))\n",
+ "fp2 = float(raw_input(\"fp2: \"))\n",
+ "fp3 = float(raw_input(\"fp3: \"))\n",
+ "\n",
+ "print \"Output: \"\n",
+ "print \"Number of values read = \", value_count\n",
+ "print \"fp1 = %f fp2 = %f fp3 = %f\" %(fp1, fp2, fp3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter: 3.14 3.14 3.14\n",
+ "Input: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp1: 3.14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp2: 3.14\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fp3: 3.14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output: \n",
+ "Number of values read = 3\n",
+ "fp1 = 3.140000 fp2 = 3.140000 fp3 = 3.140000\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.4, page no. 406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Reading hexadecimal and octal values\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter three integer values: \"\n",
+ "n = 3\n",
+ "i = int(raw_input())\n",
+ "j = int(raw_input(), 16)\n",
+ "k = int(raw_input(), 8)\n",
+ " \n",
+ "print \"Output:\"\n",
+ "print \"%d values read.\" % n\n",
+ "print \"i = %d j = %d k = %d \" %(i, j, k )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter three integer values: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output:\n",
+ "3 values read.\n",
+ "i = 5 j = 8 k = 6 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.5, page no. 408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Reading characters with scanf_s()\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your first initial: \",\n",
+ "initial = raw_input()\n",
+ "print \"Enter your first name: \",\n",
+ "name = raw_input()\n",
+ "\n",
+ "if(initial != name[0]):\n",
+ " print \"%s, you got your initial wrong. \" % name\n",
+ "else:\n",
+ " print \"Hi, %s. Your initial is correct. Well done! \" %name \n",
+ " print \"Enter your full name and your age separated by a comma: \", \n",
+ " name_age = raw_input()\n",
+ " print \"Your name is %s and you are %s years old.\" %(name_age.split(',')[0], name_age.split(',')[1])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your first initial: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your first name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Michael\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Hi, Michael. Your initial is correct. Well done! \n",
+ "Enter your full name and your age separated by a comma: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Michael, 35\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is Michael and you are 35 years old.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Program 10.6, page no. 410"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Reading a string with gets_s()\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your first initial: \",\n",
+ "initial = raw_input()\n",
+ "print \"Enter your first name: \",\n",
+ "name = raw_input()\n",
+ "\n",
+ "if(initial != name[0]):\n",
+ " print \"%s, you got your initial wrong. \" % name\n",
+ "else:\n",
+ " print \"Hi, %s. Your initial is correct. Well done! \" %name \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your first initial: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your first name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nichael\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Nichael, you got your initial wrong. \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.7, page no. 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Reading and unreading characters\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a sequence of integers and alphabetic names in a single line(separated by spaces): \",\n",
+ "text = raw_input()\n",
+ "split_text = text.split(' ')\n",
+ "for element in split_text:\n",
+ " if element.isdigit():\n",
+ " print \"Integer Value: \", element\n",
+ " elif element.isalpha():\n",
+ " print \"Name: \", element\n",
+ " else:\n",
+ " pass "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a sequence of integers and alphabetic names in a single line(separated by spaces): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fred 22 34 Mary Jack 89 Jane\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Name: Fred\n",
+ "Integer Value: 22\n",
+ "Integer Value: 34\n",
+ "Name: Mary\n",
+ "Name: Jack\n",
+ "Integer Value: 89\n",
+ "Name: Jane\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.8, page no. 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Ineger output variations\n",
+ "\"\"\"\n",
+ "\n",
+ "i = 15\n",
+ "j = 345\n",
+ "k = 4567\n",
+ "li = 56789\n",
+ "lj = 67891234567\n",
+ "lk = 23456789\n",
+ "\n",
+ "print \"i = %d j = %d k = %d li = %6.3d lj = %6.3d lk = %6.3d\" %(i ,j, k, i, j, k)\n",
+ "print \"i = %-d j = %+d k = %-d i = %-6.3d j = %-6.3d k = %-6.3d \" %(i ,j, k, i, j, k)\n",
+ "print \"li = %d lj = %d lk = %d \" %(li, lj, lk)\n",
+ "print \"li = %d lj = %d lk = %d \" %(li, lj, lk)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i = 15 j = 345 k = 4567 li = 015 lj = 345 lk = 4567\n",
+ "i = 15 j = +345 k = 4567 i = 015 j = 345 k = 4567 \n",
+ "li = 56789 lj = 67891234567 lk = 23456789 \n",
+ "li = 56789 lj = 67891234567 lk = 23456789 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.9, page no. 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Variations on a single integer\n",
+ "\"\"\"\n",
+ "\n",
+ "k = \"678\"\n",
+ "hex_k = int(k, 16)\n",
+ "oct_k = int(oct(int(k)))\n",
+ "k = 678\n",
+ "print \"%%d %%o %%x %%X \"\n",
+ "print \"%d %d %d %d \" %(k, oct_k, hex_k, hex_k)\n",
+ "print \"|%%8d \\t|%%-8d \\t|%%+8d \\t|%%08d \\t|%%-+8d\"\n",
+ "print \"|%8d |%-8d |%+8d |%08d |%-+8d |\" %(k, k, k, k, k)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "%%d %%o %%x %%X \n",
+ "678 1246 1656 1656 \n",
+ "|%%8d \t|%%-8d \t|%%+8d \t|%%08d \t|%%-+8d\n",
+ "| 678 |678 | +678 |00000678 |+678 |\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.10, page no. 422"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Outputting floating-point values\n",
+ "\"\"\"\n",
+ "\n",
+ "fp1 = 345.678\n",
+ "fp2 = 1.234E6\n",
+ "fp3 = 234567898.0\n",
+ "fp4 = 11.22334455e-6\n",
+ " \n",
+ "print \"%f %+f %-10.4f %6.4f\" %(fp1, fp2, fp1, fp2)\n",
+ "print \"%e %+E\\n\" %(fp1, fp2)\n",
+ "print \"%f %g %#+f %8.4f %10.4g \" %(fp3,fp3, fp3, fp3, fp4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "345.678000 +1234000.000000 345.6780 1234000.0000\n",
+ "3.456780e+02 +1.234000E+06\n",
+ "\n",
+ "234567898.000000 2.34568e+08 +234567898.000000 234567898.0000 1.122e-05 \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 10.11, page no. 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "print printable characters\n",
+ "\"\"\"\n",
+ "\n",
+ "import string\n",
+ "\n",
+ "count = 0\n",
+ "print \"The printable characters are the following: \"\n",
+ "printable = string.printable\n",
+ "for char in printable:\n",
+ " if count % 32 == 0:\n",
+ " print \"\"\n",
+ " print char,\n",
+ " count += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The printable characters are the following: \n",
+ "\n",
+ "0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v \n",
+ "w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ! \" \n",
+ "# $ % & ' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~ \t\n",
+ "\n",
+ "\r",
+ "\u000b",
+ "\f"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter11.ipynb b/Beginning_C_By_Ivon_Horton/chapter11.ipynb
new file mode 100644
index 00000000..b85dcda1
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter11.ipynb
@@ -0,0 +1,2119 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: Structuring Data"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.1, page no. 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Exercising the horse\n",
+ "\"\"\"\n",
+ "\n",
+ "class Horse:\n",
+ " age = 0\n",
+ " height = 0\n",
+ " name = \"\"\n",
+ " father = \"\"\n",
+ " mother = \"\"\n",
+ "\n",
+ "my_horse = Horse()\n",
+ "print \"Enter the name of the horse: \",\n",
+ "my_horse.name = raw_input()\n",
+ " \n",
+ "print \"How old is %s? \" % my_horse.name,\n",
+ "my_horse.age = int(raw_input())\n",
+ " \n",
+ "print \"How high is %s ( in hands )? \" %my_horse.name,\n",
+ "my_horse.height = int(raw_input())\n",
+ " \n",
+ "print \"Who is %s's father? \" %my_horse.name,\n",
+ "my_horse.father = raw_input()\n",
+ " \n",
+ "print \"Who is %s's mother? \" %my_horse.name,\n",
+ "my_horse.mother = raw_input()\n",
+ " \n",
+ "print \"%s is %d years old, %d hands high, \" %(my_horse.name, my_horse.age, my_horse.height),\n",
+ "print \"and has %s and %s as parents. \" %(my_horse.father, my_horse.mother)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neddy\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is Neddy? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is Neddy ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bertie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nellie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Neddy is 12 years old, 14 hands high, and has Bertie and Nellie as parents. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.2, page no. 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Exercising the horses\n",
+ "\"\"\"\n",
+ "\n",
+ "class Horse:\n",
+ " age = 0\n",
+ " height = 0\n",
+ " name = \"\"\n",
+ " father = \"\"\n",
+ " mother = \"\"\n",
+ " \n",
+ "my_horses = []\n",
+ "test = ''\n",
+ "hcount = 0\n",
+ "\n",
+ "while(True):\n",
+ " print \"Do you want to enter details of a horse (Y or N)? \"\n",
+ " choice = raw_input()\n",
+ " if(choice.lower() == 'n'):\n",
+ " break\n",
+ " my_horse = Horse()\n",
+ " print \"Enter the name of the horse: \",\n",
+ " my_horse.name = raw_input()\n",
+ " print \"How old is %s? \" % my_horse.name,\n",
+ " my_horse.age = int(raw_input())\n",
+ " print \"How high is %s ( in hands )? \" %my_horse.name,\n",
+ " my_horse.height = int(raw_input())\n",
+ " print \"Who is %s's father? \" %my_horse.name,\n",
+ " my_horse.father = raw_input()\n",
+ " print \"Who is %s's mother? \" %my_horse.name,\n",
+ " my_horse.mother = raw_input()\n",
+ " my_horses.append(my_horse)\n",
+ " hcount += 1\n",
+ "\n",
+ "for i in range(hcount):\n",
+ " print \"%s is %d years old, %d hands high, \" %(my_horses[i].name, my_horses[i].age, my_horses[i].height),\n",
+ " print \"and has %s and %s as parents. \" %(my_horses[i].father, my_horses[i].mother)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do you want to enter details of a horse (Y or N)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neddy\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is Neddy? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is Neddy ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bertie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nellie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a horse (Y or N)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stallion\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is Stallion? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is Stallion ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Stallion's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Father Stallion\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Stallion's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mother Stallion\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a horse (Y or N)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neddy is 12 years old, 14 hands high, and has Bertie and Nellie as parents. \n",
+ "Stallion is 10 years old, 15 hands high, and has Father Stallion and Mother Stallion as parents. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.3, page no. 440"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Pointing out the horses\n",
+ "\"\"\"\n",
+ "\n",
+ "class Horse:\n",
+ " age = 0\n",
+ " height = 0\n",
+ " name = \"\"\n",
+ " father = \"\"\n",
+ " mother = \"\"\n",
+ " \n",
+ "my_horses = []\n",
+ "test = ''\n",
+ "hcount = 0\n",
+ "\n",
+ "while(True):\n",
+ " print \"Do you want to enter details of a horse (Y or N)? \"\n",
+ " choice = raw_input()\n",
+ " if(choice.lower() == 'n'):\n",
+ " break\n",
+ " my_horse = Horse()\n",
+ " print \"Enter the name of the horse: \",\n",
+ " my_horse.name = raw_input()\n",
+ " print \"How old is %s? \" % my_horse.name,\n",
+ " my_horse.age = int(raw_input())\n",
+ " print \"How high is %s ( in hands )? \" %my_horse.name,\n",
+ " my_horse.height = int(raw_input())\n",
+ " print \"Who is %s's father? \" %my_horse.name,\n",
+ " my_horse.father = raw_input()\n",
+ " print \"Who is %s's mother? \" %my_horse.name,\n",
+ " my_horse.mother = raw_input()\n",
+ " my_horses.append(my_horse)\n",
+ " hcount += 1\n",
+ "\n",
+ "ptr_my_horses = my_horses\n",
+ "\n",
+ "for i in range(hcount):\n",
+ " print \"%s is %d years old, %d hands high, \" %(ptr_my_horses[i].name, ptr_my_horses[i].age, ptr_my_horses[i].height),\n",
+ " print \"and has %s and %s as parents. \" %(ptr_my_horses[i].father, ptr_my_horses[i].mother)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do you want to enter details of a horse (Y or N)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neddy\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is Neddy? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is Neddy ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bertie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nellie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a horse (Y or N)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neddy is 12 years old, 14 hands high, and has Bertie and Nellie as parents. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.4, page no. 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Daisy chaining the horses\n",
+ "\"\"\"\n",
+ "\n",
+ "class Horse:\n",
+ " age = 0\n",
+ " height = 0\n",
+ " name = \"\"\n",
+ " father = \"\"\n",
+ " mother = \"\"\n",
+ " next = None\n",
+ " prev = None\n",
+ "\n",
+ "first = None\n",
+ "previous = None\n",
+ "\n",
+ "while(True):\n",
+ " print \"Do you want to enter details of a horse (Y or N)? \",\n",
+ " choice = raw_input()\n",
+ " if(choice.lower() == 'n'):\n",
+ " break\n",
+ " current = Horse()\n",
+ " if(first == None):\n",
+ " first = current\n",
+ " if(previous != None):\n",
+ " previous.next = current\n",
+ " print \"Enter the name of the horse: \",\n",
+ " current.name = raw_input()\n",
+ " print \"How old is %s? \" %current.name,\n",
+ " current.age = int(raw_input())\n",
+ " print \"How high is %s ( in hands )? \" %(current.name),\n",
+ " current.height = int(raw_input())\n",
+ " print \"Who is %s's father? \" %current.name,\n",
+ " current.father = raw_input()\n",
+ " print \"Who is %s's mother? \" %current.name,\n",
+ " current.mother = raw_input()\n",
+ " current.next = None\n",
+ " previous = current\n",
+ "\n",
+ "current = first\n",
+ "while (current != None):\n",
+ " print \"%s is %d years old, %d hands high,\" %(current.name, current.age, current.height),\n",
+ " print \"and has %s and %s as parents.\" %(current.father, current.mother)\n",
+ " previous = current\n",
+ " current = current.next\n",
+ " previous = None\n",
+ " first = None"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do you want to enter details of a horse (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neddy\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is Neddy? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is Neddy ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Brtie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Neddy's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nellie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a horse (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Neddy is 12 years old, 14 hands high, and has Brtie and Nellie as parents.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.5, page no. 450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Daisy chaining the horses both ways\n",
+ "\"\"\"\n",
+ "\n",
+ "first = None\n",
+ "current = None\n",
+ "last = None\n",
+ "\n",
+ "class Horse:\n",
+ " age = 0\n",
+ " height = 0\n",
+ " name = \"\"\n",
+ " father = \"\"\n",
+ " mother = \"\"\n",
+ " next = None\n",
+ " prev = None\n",
+ "\n",
+ "\n",
+ "while(True):\n",
+ " print \"Do you want to enter details of a horse (Y or N)? \",\n",
+ " choice = raw_input()\n",
+ " if(choice.lower() == 'n'):\n",
+ " break \n",
+ "\n",
+ " current = Horse()\n",
+ " if(first == None):\n",
+ " first = current\n",
+ " last = current\n",
+ " else:\n",
+ " last.next = current\n",
+ " current.previous = last\n",
+ " last = current\n",
+ " print \"Enter the name of the horse: \",\n",
+ " current.name = raw_input()\n",
+ " print \"How old is %s? \" %current.name,\n",
+ " current.age = int(raw_input())\n",
+ " print \"How high is %s ( in hands )? \" %(current.name),\n",
+ " current.height = int(raw_input())\n",
+ " print \"Who is %s's father? \" %current.name,\n",
+ " current.father = raw_input()\n",
+ " print \"Who is %s's mother? \" %current.name,\n",
+ " current.mother = raw_input()\n",
+ "\n",
+ "current = first\n",
+ "while(current):\n",
+ " print \"%s is %d years old, %d hands h1igh,\" %(current.name, current.age, current.height),\n",
+ " print \"and has %s and %s as parents.\" %(current.father, current.mother)\n",
+ " current = current.next"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do you want to enter details of a horse (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "neddy\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is neddy? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is neddy ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is neddy's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bertie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is neddy's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "nellie\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a horse (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the name of the horse: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "stallion\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is stallion? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How high is stallion ( in hands )? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "18\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is stallion's father? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "father stallio\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is stallion's mother? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mother stallion\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a horse (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " neddy is 13 years old, 14 hands h1igh, and has bertie and nellie as parents.\n",
+ "stallion is 14 years old, 18 hands h1igh, and has father stallio and mother stallion as parents.\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.6, page no. 456"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 11.6, page no. 456\n",
+ "\n",
+ "\"\"\"\n",
+ "Basics of a family tree\n",
+ "\"\"\"\n",
+ "\n",
+ "class Date:\n",
+ " day = 0\n",
+ " month = 0\n",
+ " year = 0\n",
+ " \n",
+ "class Family:\n",
+ " dob = Date()\n",
+ " name = \"\"\n",
+ " father = \"\"\n",
+ " mother = \"\"\n",
+ " next = None\n",
+ " previous = None\n",
+ " \n",
+ "def get_person():\n",
+ " temp = Family()\n",
+ " print \"Enter the name of the person: \",\n",
+ " temp.name = raw_input()\n",
+ " print \"Enter %s's date of birth (day month year) \" %temp.name,\n",
+ " temp.dob.day = int(raw_input(\"Day: \"))\n",
+ " temp.dob.month = int(raw_input(\"Month: \"))\n",
+ " temp.dob.year = int(raw_input(\"Year: \"))\n",
+ " print \"Who is %s's father? \" %temp.name\n",
+ " temp.father = raw_input()\n",
+ " print \"Who is %s's mother? \" %temp.name\n",
+ " temp.mother = raw_input()\n",
+ " temp.next = None\n",
+ " temp.previous = None\n",
+ " return temp\n",
+ " \n",
+ "def show_people(pfirst):\n",
+ " current = pfirst\n",
+ " while(current):\n",
+ " print \"%s was born %d/%d/%d and has %s and %s as parents. \" %(current.name, current.dob.day, current.dob.month, current.dob.year, current.father, current.mother)\n",
+ " current = current.next\n",
+ "\n",
+ "first = None\n",
+ "current = None\n",
+ "last = None\n",
+ " \n",
+ "while(True):\n",
+ " print \"Do you want to enter details of a person (Y or N)? \",\n",
+ " choice = raw_input()\n",
+ " if(choice.lower() == 'n'):\n",
+ " break\n",
+ " current = get_person()\n",
+ " if(first == None):\n",
+ " first = current\n",
+ " current.previous = None\n",
+ " last = current\n",
+ " else:\n",
+ " last.next = current\n",
+ " current.previous = last\n",
+ " last = current\n",
+ "show_people(first)\n",
+ "first = None\n",
+ "last = None"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter details of a person (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the name of the person: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ricky\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Ricky's date of birth (day month year) "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Day: 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Month: 6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Year: 1970\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Ricky's father? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Michael\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Who is Ricky's mother? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rachel\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do you want to enter details of a person (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the name of the person: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mitchel\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Mitchel's date of birth (day month year) "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Day: 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Month: 9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Year: 1967\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Who is Mitchel's father? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Martin\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Who is Mitchel's mother? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hingies\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Do you want to enter details of a person (Y or N)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Ricky was born 5/9/1967 and has Michael and Rachel as parents. \n",
+ "Mitchel was born 5/9/1967 and has Martin and Hingies as parents. \n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.7, page no. 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 11.7, page no. 466\n",
+ "\n",
+ "\"\"\"\n",
+ "binary tree to sort integers\n",
+ "\"\"\"\n",
+ "class Node:\n",
+ " item = 0.0\n",
+ " count = 0\n",
+ " pLeft = None\n",
+ " pRight = None\n",
+ " \n",
+ "def create_node(value):\n",
+ " pNode = Node()\n",
+ " pNode.item = value\n",
+ " pNode.count = 1\n",
+ " return pNode\n",
+ "\n",
+ "def add_node(value, pNode):\n",
+ " if(pNode is None):\n",
+ " return create_node(value)\n",
+ " if(value == pNode.item):\n",
+ " pNode.count += 1\n",
+ " return pNode\n",
+ " if(value < pNode.item):\n",
+ " if(pNode.pLeft is None):\n",
+ " pNode.pLeft = create_node(value);\n",
+ " return pNode.pLeft\n",
+ " else:\n",
+ " return add_node(value, pNode.pLeft)\n",
+ " else:\n",
+ " if(pNode.pRight is None):\n",
+ " pNode. pRight = create_node(value)\n",
+ " return pNode.pRight\n",
+ " else:\n",
+ " return add_node(value, pNode.pRight)\n",
+ "\n",
+ "\n",
+ "def list_nodes(pNode):\n",
+ " if(pNode.pLeft):\n",
+ " list_nodes(pNode.pLeft)\n",
+ " print \"%10d x %10ld\" %(pNode.count, pNode.item)\n",
+ " if(pNode.pRight):\n",
+ " list_nodes(pNode.pRight)\n",
+ "\n",
+ "\n",
+ "pRoot = None\n",
+ "answer = 'n'\n",
+ "while(True):\n",
+ " print \"Enter the node value: \",\n",
+ " newvalue = float(raw_input())\n",
+ " if(pRoot is None):\n",
+ " pRoot = create_node(newvalue)\n",
+ " else:\n",
+ " add_node(newvalue, pRoot)\n",
+ " print \"Do you want to enter another (y or n)? \",\n",
+ " answer = raw_input()\n",
+ " if answer == \"n\":\n",
+ " break\n",
+ "print \"The values in ascending sequence are: \"\n",
+ "list_nodes(pRoot)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "56\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "33\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "77\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "200\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the node value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another (y or n)? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The values in ascending sequence are: \n",
+ " 2 x -10\n",
+ " 1 x -5\n",
+ " 1 x 33\n",
+ " 1 x 56\n",
+ " 1 x 77\n",
+ " 1 x 200\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.8, page no. 470"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The operation of a union\n",
+ "\"\"\"\n",
+ "\n",
+ "def print_date(date):\n",
+ " if date.format == 0:\n",
+ " print \"The date is %d/%d/%d.\" %(date.date.nDate.day, date.date.nDate.month, date.date.nDate.year)\n",
+ " elif date.format == 1:\n",
+ " print \"The date is %s. \" %date.date.date_str\n",
+ " elif date.format == 2:\n",
+ " print \"The date is %s %s %d. \" %(date.date.day_date.day, date.date.day_date.date, date.date.day_date.year)\n",
+ " else:\n",
+ " print \"Invalid date format.\"\n",
+ "\n",
+ "class Date_Format:\n",
+ " numeric = 0\n",
+ " text = 1\n",
+ " mixed = 2\n",
+ "\n",
+ "class MixedDate:\n",
+ " def __init__(self, d=\"\", dt=\"\", yr=0):\n",
+ " self.day = d\n",
+ " self.date = dt\n",
+ " self.year = yr\n",
+ "\n",
+ "class NumericDate:\n",
+ " def __init__(self, d=0, mnt=0, yr=0):\n",
+ " self.day = d\n",
+ " self.month = mnt\n",
+ " self.year = yr\n",
+ "\n",
+ "class UDate:\n",
+ " date_str = \"\"\n",
+ " day_date = MixedDate()\n",
+ " nDate = NumericDate()\n",
+ "\n",
+ "class Date:\n",
+ " format = Date_Format()\n",
+ " date = UDate()\n",
+ "\n",
+ "form = Date_Format()\n",
+ "yesterday = NumericDate(11, 11, 2012)\n",
+ "today = MixedDate(\"Monday\", \"12th November\", 2012)\n",
+ "tomorrow = UDate()\n",
+ "tomorrow.date_str = \"Tues 13th Nov 2012\"\n",
+ "\n",
+ "udate = tomorrow\n",
+ "the_date = Date()\n",
+ "the_date.date = udate\n",
+ "the_date.format = form.text\n",
+ "print_date(the_date)\n",
+ "\n",
+ "the_date.date.nDate = yesterday\n",
+ "the_date.format = form.numeric\n",
+ "print_date(the_date)\n",
+ " \n",
+ "the_date.date.day_date = today\n",
+ "the_date.format = form.mixed\n",
+ "print_date(the_date)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The date is Tues 13th Nov 2012. \n",
+ "The date is 11/11/2012.\n",
+ "The date is Monday 12th November 2012. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 11.9, page no. 482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 11.9, page no. 482\n",
+ "\n",
+ "\"\"\"\n",
+ "Generating a Bar chart\n",
+ "\"\"\"\n",
+ "\n",
+ "import numpy\n",
+ "import sys\n",
+ "\n",
+ "\n",
+ "PAGE_HEIGHT = 41\n",
+ "PAGE_WIDTH = 75\n",
+ " \n",
+ "class Bar:\n",
+ " value = 0\n",
+ " pNext = None\n",
+ " \n",
+ "def create_bar_list():\n",
+ " pFirst = None\n",
+ " pBar = None\n",
+ " pCurrent = None\n",
+ " pBar = new_bar()\n",
+ " while(pBar != None):\n",
+ " if(pCurrent):\n",
+ " pCurrent.pNext = pBar\n",
+ " pCurrent = pBar\n",
+ " else:\n",
+ " pFirst = pCurrent = pBar\n",
+ " #pCurrent = pBar\n",
+ " pBar = new_bar()\n",
+ " return pFirst\n",
+ " \n",
+ "def new_bar():\n",
+ " print \"Enter the value of the Bar, or Enter quit to end: \",\n",
+ " value = raw_input()\n",
+ " if(value == \"quit\"):\n",
+ " return None\n",
+ " pBar = Bar()\n",
+ " if(pBar is None):\n",
+ " print \"Oops! Couldn't allocate memory for a bar.\"\n",
+ " sys.exit()\n",
+ " pBar.value = float(value)\n",
+ " pBar.pNext = None\n",
+ " return pBar\n",
+ "\n",
+ "def bar_chart(pFirst, page_width, page_height, title):\n",
+ " pLast = pFirst;\n",
+ " max = pFirst.value\n",
+ " min = pFirst.value\n",
+ " vert_step = 0.0\n",
+ " bar_count = 1\n",
+ " bar_width = 0\n",
+ " space = 2\n",
+ " column = None\n",
+ " blank = None\n",
+ " position = 0.0\n",
+ " axis = False\n",
+ " while(pLast.pNext):\n",
+ " bar_count += 1\n",
+ " max = pLast.value if (max < pLast.value) else max\n",
+ " min = pLast.value if (min > pLast.value) else min\n",
+ " pLast = pLast.pNext\n",
+ " if(max < 0.0):\n",
+ " max = 0.0\n",
+ " if(min > 0.0):\n",
+ " min = 0.0\n",
+ " vert_step = (max - min)/page_height\n",
+ " bar_width = page_width/bar_count - space\n",
+ " if(bar_width < 1):\n",
+ " print \"Page width too narrow. \"\n",
+ " sys.exit()\n",
+ " column = chart_string(space, bar_width, '#')\n",
+ " if(not (column)):\n",
+ " print \"Failed to allocate memory in bar_chart() - terminating program.\"\n",
+ " sys.exit()\n",
+ " blank = chart_string(space, bar_width, ' ')\n",
+ " if(not (blank)):\n",
+ " print \"Failed to allocate memory in bar_chart() - terminating program.\"\n",
+ " sys.exit(1)\n",
+ " print \"\\n^ %s \" %title\n",
+ " position = max\n",
+ " for i in range(page_height):\n",
+ " if(position <= 0.0 and not(axis)):\n",
+ " draw_x_axis(bar_count*(bar_width + space))\n",
+ " axis = True\n",
+ " print \"|\",\n",
+ " pLast = pFirst\n",
+ " for bars in range(1, bar_count+1):\n",
+ " print \"%s\" %(column if((position <= pLast.value and position > 0.0) or (position >= pLast.value and position <= 0.0)) else blank),\n",
+ " pLast = pLast.pNext\n",
+ " print \"\"\n",
+ " position -= vert_step\n",
+ " if(not axis):\n",
+ " draw_x_axis(bar_count*(bar_width + space))\n",
+ " else:\n",
+ " print \"v\\n\",\n",
+ "\n",
+ "\n",
+ "def chart_string(space, bar_width, ch):\n",
+ " mystr = []\n",
+ " for i in range(space+bar_width):\n",
+ " mystr.append(\"\")\n",
+ " for i in range(space):\n",
+ " mystr[i] =' '\n",
+ " for j in range(space,space+bar_width):\n",
+ " mystr[j] = ch\n",
+ " return ''.join(mystr)\n",
+ "\n",
+ "def draw_x_axis(length):\n",
+ " print \"+\",\n",
+ " for x in range(length):\n",
+ " print \"-\",\n",
+ " print \">\"\n",
+ "\n",
+ "pFirst = None\n",
+ "print \"Enter the chart title: \",\n",
+ "title = raw_input()\n",
+ "pFirst = create_bar_list()\n",
+ "p = pFirst\n",
+ "while (p):\n",
+ " print p.value\n",
+ " p = p.pNext\n",
+ "bar_chart(pFirst, PAGE_WIDTH, PAGE_HEIGHT, title)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the chart title: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Temperatures\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-12\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-15\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "26\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "23\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the value of the Bar, or Enter quit to end: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "quit\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " -12.0\n",
+ "-15.0\n",
+ "2.0\n",
+ "5.0\n",
+ "13.0\n",
+ "20.0\n",
+ "26.0\n",
+ "32.0\n",
+ "23.0\n",
+ "17.0\n",
+ "-1.0\n",
+ "-4.0\n",
+ "\n",
+ "^ Average Temperatures \n",
+ "| #### \n",
+ "| #### \n",
+ "| #### \n",
+ "| #### \n",
+ "| #### \n",
+ "| #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### #### #### \n",
+ "| #### #### #### \n",
+ "| #### #### #### \n",
+ "| #### #### #### #### \n",
+ "| #### #### #### #### \n",
+ "| #### #### #### #### \n",
+ "| #### #### #### #### #### \n",
+ "| #### #### #### #### #### \n",
+ "| #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### #### \n",
+ "| #### #### #### #### #### #### #### #### \n",
+ "+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >\n",
+ "| #### #### #### #### \n",
+ "| #### #### #### \n",
+ "| #### #### #### \n",
+ "| #### #### #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### #### \n",
+ "| #### \n",
+ "| #### \n",
+ "v\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter12.ipynb b/Beginning_C_By_Ivon_Horton/chapter12.ipynb
new file mode 100644
index 00000000..71ea1f1a
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter12.ipynb
@@ -0,0 +1,738 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: Working with Files"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.1, page no. 498"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Writing a file a character at a time\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "\n",
+ "mystr = []\n",
+ "\n",
+ "print \"Enter an interesting string of up to 80 characters: \",\n",
+ "mystr = raw_input()\n",
+ "\n",
+ "try:\n",
+ " fp = open(\"myfile.txt\", \"w\")\n",
+ "except:\n",
+ " print \"error opening the file...\"\n",
+ " sys.exit()\n",
+ "\n",
+ "for i in range(len(mystr)-1, -1, -1):\n",
+ " fp.write(mystr[i])\n",
+ "\n",
+ "fp.close()\n",
+ "\n",
+ "try:\n",
+ " fp = open(\"myfile.txt\", \"r\")\n",
+ "except:\n",
+ " print \"error opening the file...\"\n",
+ "\n",
+ "print \"the data read from the file is: \"\n",
+ "while(True):\n",
+ " c = fp.read(1)\n",
+ " if not c:\n",
+ " break\n",
+ " print c,\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an interesting string of up to 80 characters: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Too many cooks spoil the broth.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the data read from the file is: \n",
+ ". h t o r b e h t l i o p s s k o o c y n a m o o T\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.2, page no. 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "As the saying goes. . .it comes back!\n",
+ "\"\"\"\n",
+ "\n",
+ "proverbs = [\"Many a mickle makes a muckle.\\n\",\n",
+ " \"Too many cooks spoil the broth.\\n\",\n",
+ " \"He who laughs last didn't get the joke in the first place.\\n\"]\n",
+ " \n",
+ "more = []\n",
+ "\n",
+ "try:\n",
+ " fp = open(\"myfile.txt\", \"w\") \n",
+ "except:\n",
+ " print \"error opening the file...\"\n",
+ "for proverb in proverbs:\n",
+ " fp.write(proverb)\n",
+ "fp.close()\n",
+ " \n",
+ "fp = open(\"myfile.txt\", \"a\")\n",
+ " \n",
+ "print \"Enter proverbs of up to 80 characters (separated by '.') or press Enter to end:\\n\",\n",
+ "string = raw_input().split('.')\n",
+ "\n",
+ "\n",
+ "for str in string:\n",
+ " fp.write(str+\"\\n\")\n",
+ "fp.close()\n",
+ "\n",
+ "fp = open(\"myfile.txt\", \"r\")\n",
+ "print \"The proverbs in the file are: \\n\"\n",
+ "while(True):\n",
+ " line = fp.readline()\n",
+ " if not line:\n",
+ " break\n",
+ " print line\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter proverbs of up to 80 characters (separated by '.') or press Enter to end:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Every dog has his day. Least said, soonest mended. A stitch in time saves nine. Waste not, want not.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The proverbs in the file are: \n",
+ "\n",
+ "Many a mickle makes a muckle.\n",
+ "\n",
+ "Too many cooks spoil the broth.\n",
+ "\n",
+ "He who laughs last didn't get the joke in the first place.\n",
+ "\n",
+ "Every dog has his day\n",
+ "\n",
+ " Least said, soonest mended\n",
+ "\n",
+ " A stitch in time saves nine\n",
+ "\n",
+ " Waste not, want not\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.3, page no. 507"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Messing about with formatted file I/O\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "num1 = 234567\n",
+ "num2 = 345123\n",
+ "num3 = 789234\n",
+ "\n",
+ "ival = []\n",
+ "\n",
+ "try:\n",
+ " fp = open(\"myfile.txt\", \"w\")\n",
+ "except:\n",
+ " print \"Error opening file for writing. Program terminated.\\n\"\n",
+ " sys.exit()\n",
+ "\n",
+ "fp.write(\"%6d %6d %6d\" %(num1, num2, num3))\n",
+ "fp.close()\n",
+ "print \"%6ld %6ld %6ld\" %(num1, num2, num3)\n",
+ "\n",
+ "try: \n",
+ " fp = open(\"myfile.txt\", \"r\")\n",
+ "except:\n",
+ " print \"Error opening file for reading. Program terminated.\\n\"\n",
+ " sys.exit()\n",
+ "\n",
+ "line = fp.readline()\n",
+ "line_split = line.split(\" \")\n",
+ "num4 = int(line_split[0])\n",
+ "num5 = int(line_split[1])\n",
+ "num6 = int(line_split[2])\n",
+ "print \"%6ld %6ld %6ld \" %(num4, num5, num6)\n",
+ "fp.close\n",
+ "\n",
+ "fp = open(\"myfile.txt\", \"r\")\n",
+ "line = fp.readline()\n",
+ "line_join = \"\".join(line_split)\n",
+ "ival.append(int(line_join[0:2]))\n",
+ "ival.append(int(line_join[2:5]))\n",
+ "ival.append(int(line_join[5:8]))\n",
+ "ival.append(int(line_join[8:11]))\n",
+ "ival.append(int(line_join[11:13]))\n",
+ "ival.append(int(line_join[13:15]))\n",
+ "fnum = (float(line_join[15:]))\n",
+ "\n",
+ "for i in range(len(ival)):\n",
+ " print \"%sival[%d] = %d\" %((\"\\n\\t\" if i == 4 else \"\\t\"), i, ival[i]),\n",
+ "print \"\\nfnum = %f \" %fnum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "234567 345123 789234\n",
+ "234567 345123 789234 \n",
+ "\tival[0] = 23 \tival[1] = 456 \tival[2] = 734 \tival[3] = 512 \n",
+ "\tival[4] = 37 \tival[5] = 89 \n",
+ "fnum = 234.000000 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.4, page no. 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 12.4, page no. 514\n",
+ "\n",
+ "\"\"\"\n",
+ "A prime example using binary files\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "import sys\n",
+ "\n",
+ "MEM_PRIMES = 10\n",
+ "PER_LINE = 8\n",
+ "filename = \"myfile.bin\"\n",
+ "fp = None\n",
+ "primes = [2, 3, 5]\n",
+ "count = 3\n",
+ "\n",
+ "def check(buff, count, n):\n",
+ " root_N = (1.0 + math.sqrt(n))\n",
+ " for i in range(0, count):\n",
+ " if(n % buff[i] == 0):\n",
+ " return 0\n",
+ " if(buff[i] > root_N):\n",
+ " return 1\n",
+ " return -1\n",
+ "\n",
+ "def list_array():\n",
+ " global primes\n",
+ " global count\n",
+ " for j in range(count):\n",
+ " print \"%10lu\" %primes[j]\n",
+ " if(((j + 1) % PER_LINE) == 0):\n",
+ " print \"\\n\"\n",
+ " \n",
+ "def list_primes():\n",
+ " global fp\n",
+ " global filename\n",
+ " global count\n",
+ " global primes\n",
+ " if(fp):\n",
+ " try:\n",
+ " fp = open(filename, \"rb\")\n",
+ " except:\n",
+ " print \"Unable to open %s to read primes for output \" %filename\n",
+ " sys,exit()\n",
+ " while(True):\n",
+ " line = fp.readline()\n",
+ " if line:\n",
+ " list_array()\n",
+ " print \"\\n\"\n",
+ " fp.close()\n",
+ " else:\n",
+ " list_array()\n",
+ "\n",
+ "def write_file():\n",
+ " global fp\n",
+ " global filename\n",
+ " global count\n",
+ " global primes\n",
+ " try:\n",
+ " fp = open(filename, \"ab\")\n",
+ " except:\n",
+ " print \"Unable to open %s to append\\n\" %filename\n",
+ " sys.exit()\n",
+ " for prime in primes:\n",
+ " fp.write(prime+\" \")\n",
+ " fp.close\n",
+ " count = 0\n",
+ "\n",
+ "def is_prime(n):\n",
+ " global filename\n",
+ " global fp\n",
+ " global primes\n",
+ " global count \n",
+ " buff = []\n",
+ " count = 0\n",
+ " k = 0\n",
+ " if(fp):\n",
+ " try:\n",
+ " fp = open(filename, \"rb\")\n",
+ " except:\n",
+ " print \"Unable to open %s to read. \" %g.filename\n",
+ " sys.exit()\n",
+ " while(True):\n",
+ " line = fp.readline()\n",
+ " if line:\n",
+ " nums = line.split(\" \")\n",
+ " for num in nums:\n",
+ " buff.append(int(num))\n",
+ " k = check(buff, count, n)\n",
+ " if(k == 1):\n",
+ " fp.close()\n",
+ " return True\n",
+ " else: \n",
+ " break\n",
+ " fp.close()\n",
+ " return 1 == check(primes, count, n)\n",
+ "\n",
+ "trial = primes[count - 1]\n",
+ "num_primes = 3\n",
+ "\n",
+ "print \"How many primes would you like? \",\n",
+ "total = int(raw_input())\n",
+ "total = 4 if total < 4 else total\n",
+ "print total\n",
+ "while(num_primes < total):\n",
+ " trial += 2\n",
+ " if(is_prime(trial)):\n",
+ " primes.append(trial)\n",
+ " count += 1\n",
+ " num_primes += 1\n",
+ " if(count == MEM_PRIMES):\n",
+ " write_file()\n",
+ "\n",
+ "if(fp and count > 0):\n",
+ " write_file()\n",
+ "list_primes()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.5, page no. 523"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 12.5, page no. 523\n",
+ "\n",
+ "\"\"\"\n",
+ "Investigating the family.\n",
+ "\"\"\"\n",
+ "\n",
+ "class Date:\n",
+ " day = 0\n",
+ " month = 0\n",
+ " year = 0\n",
+ " \n",
+ "class Family:\n",
+ " dob = Date()\n",
+ " name = \"\"\n",
+ " pa_name = \"\"\n",
+ " ma_name = \"\"\n",
+ "\n",
+ "members = []\n",
+ "\n",
+ "def get_person():\n",
+ " while(True):\n",
+ " temp = Family()\n",
+ " print \"Enter the name of the person: \",\n",
+ " temp.name = raw_input()\n",
+ " print \"Enter %s's date of birth (day month year): \" %temp.name\n",
+ " temp.dob.day = int(raw_input(\"Day: \"))\n",
+ " temp.dob.month = int(raw_input(\"Month: \"))\n",
+ " temp.dob.year = int(raw_input(\"Year: \"))\n",
+ " print \"Who is %s's father? \" %temp.name,\n",
+ " temp.pa_name = raw_input()\n",
+ " print \"Who is %s's mother? \" %temp.name,\n",
+ " temp.ma_name = raw_input()\n",
+ " print \"\\nDo you want to enter details of a person (Y or N)? \",\n",
+ " more = raw_input()\n",
+ " members.append(temp)\n",
+ " if(more.lower() == 'n'):\n",
+ " return\n",
+ "\n",
+ "def show_person_data():\n",
+ " fp = open(\"myfile.bin\", \"rb\")\n",
+ " count = 0\n",
+ " while(True):\n",
+ " line = fp.readline()\n",
+ " if line:\n",
+ " member_data = line.split(\",\")\n",
+ " print \"%s's father is %s, and mother is %s.\" %(member_data[0],member_data[4], member_data[5])\n",
+ " found_relative, relative_info = get_parent_dob(members[count])\n",
+ " if found_relative:\n",
+ " print relative_info\n",
+ " else:\n",
+ " print \"No info on parents available\"\n",
+ " else:\n",
+ " break\n",
+ " fp.close()\n",
+ "\n",
+ "def get_parent_dob(member):\n",
+ " parent_info = \"\"\n",
+ " found_relative = False\n",
+ " for parent in members:\n",
+ " if parent.name == member.pa_name:\n",
+ " parent_info = parent_info+\"Pa was born on %d %d %d\" %(parent.dob.day, parent.dob.month, parent.dob.year)\n",
+ " found_relative = True\n",
+ " elif parent.name == member.ma_name:\n",
+ " parent_info = parent_info+\" Ma was born on %d %d %d\" %(parent.dob.day, parent.dob.month, parent.dob.year)\n",
+ " found_relative = True\n",
+ " return found_relative, parent_info\n",
+ "\n",
+ "\n",
+ "print \"Do you want to add details of a person ? (Y/N): \",\n",
+ "more = raw_input()\n",
+ "if more.lower() == 'n':\n",
+ " import sys\n",
+ " sys.exit()\n",
+ "\n",
+ "get_person()\n",
+ "fp = open(\"myfile.bin\", \"wb\")\n",
+ "for member in members:\n",
+ " line = member.name+\",\"+str(member.dob.day)+\",\"+str(member.dob.month)+\",\"+str(member.dob.year) +\",\"+member.pa_name+\",\"+member.ma_name\n",
+ " fp.write(line)\n",
+ " fp.write(\",\\n\")\n",
+ "fp.close()\n",
+ "show_person_data()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.6, page no. 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 12.6, page no. 531\n",
+ "\n",
+ "\"\"\"\n",
+ "Writing a binary file with an update mode\n",
+ "\"\"\"\n",
+ "\n",
+ "MAXLEN = 50\n",
+ "\n",
+ "def listfile():\n",
+ " fp = open(\"mypeople.bin\", \"rb\")\n",
+ " print \"The folks recorded in the mypeople.bin file are: \"\n",
+ " while(True):\n",
+ " line = fp.readline()\n",
+ " if line:\n",
+ " print line.split(\",\")[0], \"\\t\\t\\t\\t\\t\", line.split(\",\")[1]\n",
+ " else:\n",
+ " break\n",
+ " fp.close()\n",
+ "\n",
+ "answer = 'y'\n",
+ "fp = open(\"mypeople.bin\", \"wb\")\n",
+ "while(answer.lower() == 'y'):\n",
+ " print \"Enter a name less than %d characters: \" %MAXLEN,\n",
+ " name = raw_input()\n",
+ " print \"Enter the age of %s: \" %name,\n",
+ " age = int(raw_input())\n",
+ " length = len(name)\n",
+ " line = name+\",\"+str(age)\n",
+ " fp.write(line)\n",
+ " fp.write(\" \\n\")\n",
+ " print \"Do you want to enter another(y or n)? \",\n",
+ " answer = raw_input()\n",
+ "fp.close()\n",
+ "listfile()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.7, page no. 545"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Program 12.7, page no. 545\n",
+ "\n",
+ "\"\"\"\n",
+ "Writing, reading and updating a binary file\n",
+ "\"\"\"\n",
+ "\n",
+ "class Record:\n",
+ " name = \"\"\n",
+ " age = 0\n",
+ "\n",
+ "records = []\n",
+ "\n",
+ "def write_file(mode):\n",
+ " global filename\n",
+ " fp = open(filename, mode)\n",
+ " more = 'y'\n",
+ " while(more == 'y'):\n",
+ " print \"Enter name less than 30 characters: \",\n",
+ " name = raw_input()\n",
+ " name = \"%30s\" %name\n",
+ " print \"Enter age of \", name\n",
+ " age = raw_input()\n",
+ " age = \"%3s\" %age\n",
+ " line = name+\",\"+age\n",
+ " fp.write(line)\n",
+ " fp.write(\" \\n\")\n",
+ " print \"Do you want to enter another (y/n)? \",\n",
+ " more = raw_input()\n",
+ " fp.close()\n",
+ " return\n",
+ "\n",
+ "def list_file():\n",
+ " global filename\n",
+ " fp = open(filename, \"rb\")\n",
+ " print \"The folks recorded in the mypeople.bin file are: \"\n",
+ " while(True):\n",
+ " line = fp.readline()\n",
+ " if line:\n",
+ " line_split = line.split(\",\")\n",
+ " print line_split[0].strip(), \"\\t\\t\\t\\t\\t\", line_split[1]\n",
+ " else:\n",
+ " break\n",
+ " fp.close()\n",
+ "\n",
+ "def remove(fname):\n",
+ " import os\n",
+ " os.remove(fname)\n",
+ "\n",
+ "def update_file():\n",
+ " global filename\n",
+ " new_record = Record()\n",
+ " fp = open(filename, \"rb+\")\n",
+ " print \"Enter name to be updated: \",\n",
+ " update_name = raw_input()\n",
+ " update_name = \"%30s\"%update_name\n",
+ " while(True):\n",
+ " old_pos = fp.tell()\n",
+ " old_line = fp.readline()\n",
+ " if old_line:\n",
+ " if old_line.split(\",\")[0] == update_name:\n",
+ " print \"You can now enter new name and age for \", update_name\n",
+ " print \"Enter name less than 30 charactesrs: \",\n",
+ " new_name = raw_input()\n",
+ " new_name = \"%30s\"%new_name\n",
+ " print \"Enter age for \", new_name\n",
+ " new_age = raw_input()\n",
+ " new_age = \"%3s\"%new_age\n",
+ " pos = fp.tell()\n",
+ " fp.seek(old_pos)\n",
+ " new_line = new_name+\",\"+new_age+\" \\n\"\n",
+ " new_line = old_line.replace(old_line, new_line)\n",
+ " fp.write(new_line)\n",
+ " else:\n",
+ " break\n",
+ " fp.close()\n",
+ " \n",
+ "filename = \"my-people.bin\"\n",
+ "answer = 'q'\n",
+ "while(True):\n",
+ " print \"Choose from the following options: \"\n",
+ " print \"To list the file contents enter L\"\n",
+ " print \"To create a new file enter C \"\n",
+ " print \"To add new records enter A\"\n",
+ " print \"To update existing records enter U\"\n",
+ " print \"To delete the file enter D\"\n",
+ " print \"To end the program enter Q: \",\n",
+ " answer = raw_input()\n",
+ " if answer.upper() == 'L':\n",
+ " list_file()\n",
+ " elif answer.upper() == 'C':\n",
+ " write_file(\"wb+\")\n",
+ " print \"File creation complete.\"\n",
+ " elif answer.upper() == 'A':\n",
+ " write_file(\"ab+\");\n",
+ " print \"File append complete.\"\n",
+ " elif answer.upper() == 'U':\n",
+ " update_file()\n",
+ " elif answer.upper() == 'D':\n",
+ " print \"Are you sure you want to delete %s (y or n)? \",\n",
+ " confirm_delete = raw_input()\n",
+ " if(confirm_delete.lower() == 'y'):\n",
+ " remove(filename)\n",
+ " elif answer.upper() == 'Q':\n",
+ " print \"Ending the program. \"\n",
+ " import sys\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Invalid selection. Try again.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 12.8, page no. 551"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import binascii\n",
+ "\n",
+ "print \"Enter filename: \",\n",
+ "filename = raw_input()\n",
+ "\n",
+ "f = open(filename, \"r\")\n",
+ "\n",
+ "for line in f.readlines():\n",
+ " print (binascii.hexlify(line)),\n",
+ " print \" | \", line\n",
+ "\n",
+ "f.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter filename: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "myfile.txt\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 2e68746f726220656874206c696f707320736b6f6f6320796e616d206f6f54 | .htorb eht liops skooc ynam ooT\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter13.ipynb b/Beginning_C_By_Ivon_Horton/chapter13.ipynb
new file mode 100644
index 00000000..8a2ffbe5
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter13.ipynb
@@ -0,0 +1,330 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: The Preprocessor and Debugging"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 13.2, page no. 576"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Demonstrating assertions\n",
+ "\"\"\"\n",
+ "\n",
+ "y = 5\n",
+ "for x in range(20):\n",
+ " print \"x = %d y = %d\" %(x, y)\n",
+ " assert(x < y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "AssertionError",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mAssertionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-1-3bb87684a82b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m20\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"x = %d y = %d\"\u001b[0m \u001b[1;33m%\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[1;32massert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m \u001b[1;33m<\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[1;31mAssertionError\u001b[0m: "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 0 y = 5\n",
+ "x = 1 y = 5\n",
+ "x = 2 y = 5\n",
+ "x = 3 y = 5\n",
+ "x = 4 y = 5\n",
+ "x = 5 y = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 13.3, page no. 578"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Test our timer function\n",
+ "\"\"\"\n",
+ "\n",
+ "import time\n",
+ "import datetime\n",
+ "import math\n",
+ "\n",
+ "calendar_start = datetime.datetime.now()\n",
+ "cpu_start = time.time()\n",
+ "count = 0\n",
+ "iterations = 1000000\n",
+ "answer = 'y'\n",
+ "x = 0.0\n",
+ "print \"Initial clock time = \", cpu_start, \" Initial calendar time = \", calendar_start\n",
+ "while(answer.lower() == 'y'):\n",
+ " for i in range(iterations):\n",
+ " x = math.sqrt(3.14159265)\n",
+ " count += 1\n",
+ " print \"%d square roots completed.\\n\" %(iterations*count)\n",
+ " print \"Do you want to run some more(y or n)? \"\n",
+ " answer = raw_input()\n",
+ "\n",
+ "cpu_end = time.time()\n",
+ "calendar_end = datetime.datetime.now()\n",
+ "\n",
+ "\n",
+ "print \"Final clock time = \", cpu_end, \" Final calendar time = \", calendar_end\n",
+ "print \"CPU time for %d iterations is %.2f seconds\" %(count*iterations, (float(cpu_end-cpu_start)/time.clock()))\n",
+ "print \"Elapsed calendar time to execute the program is\", calendar_end-calendar_start, \" seconds\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial clock time = 1387828819.12 Initial calendar time = 2013-12-24 01:30:19.115309\n",
+ "1000000 square roots completed.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Do you want to run some more(y or n)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2000000 square roots completed.\n",
+ "\n",
+ "Do you want to run some more(y or n)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final clock time = 1387828824.23 Final calendar time = 2013-12-24 01:30:24.232139\n",
+ "CPU time for 2000000 iterations is 4.49 seconds\n",
+ "Elapsed calendar time to execute the program is 0:00:05.116830 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 13.4, page no. 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Getting date data with ease\n",
+ "\"\"\"\n",
+ "\n",
+ "from datetime import *\n",
+ "import time\n",
+ "\n",
+ "day = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"]\n",
+ "month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\",\n",
+ " \"September\", \"October\", \"November\", \"December\"]\n",
+ " \n",
+ "now = datetime.now()\n",
+ "suffix = \"\"\n",
+ "\n",
+ "today = day[datetime.today().weekday()]\n",
+ "curr_month = month[now.month-1]\n",
+ "\n",
+ "if now.day == 1 or now.day == 21 or now.day == 31:\n",
+ " suffix= \"st\"\n",
+ "elif now.day == 2 or now.day == 22:\n",
+ " suffix= \"nd\"\n",
+ "elif now.day == 3 or now.day == 23:\n",
+ " suffix = \"rd\"\n",
+ "else:\n",
+ " suffix= \"th\"\n",
+ " \n",
+ "print \"Today is \", today, \" the \",str(now.day)+suffix, curr_month, str(now.year)+\".\", \"The time is \", time.strftime(\"%H:%M:%S\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Today is Tuesday the 24th December 2013. The time is 01:30:43\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 13.5, page no. 586"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Getting the day for a given date\n",
+ "\"\"\"\n",
+ "\n",
+ "from datetime import *\n",
+ "import time\n",
+ "\n",
+ "day = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"]\n",
+ "month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\",\n",
+ " \"September\", \"October\", \"November\", \"December\"]\n",
+ " \n",
+ "now = datetime.now()\n",
+ "suffix = \"\"\n",
+ "\n",
+ "curr_month = month[now.month-1]\n",
+ "\n",
+ "print \"Enter a name: \",\n",
+ "name = raw_input()\n",
+ "print \"Enter a DOB for \", name\n",
+ "dob_day = int(raw_input(\"Day: \"))\n",
+ "dob_month = int(raw_input(\"Month: \"))\n",
+ "dob_year = int(raw_input(\"Year: \"))\n",
+ "dob_date = date(dob_year, dob_month, dob_day)\n",
+ "\n",
+ "if dob_day == 1 or dob_day == 21 or dob_day == 31:\n",
+ " suffix= \"st\"\n",
+ "elif dob_day == 2 or dob_day == 22:\n",
+ " suffix= \"nd\"\n",
+ "elif dob_day == 3 or dob_day == 23:\n",
+ " suffix = \"rd\"\n",
+ "else:\n",
+ " suffix= \"th\"\n",
+ "\n",
+ "dob_month = month[dob_month-1]\n",
+ "print name, \"Was born on \", str(dob_day)+suffix, dob_month, dob_year, \"which was a \", day[date.weekday(dob_date)]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ricky\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a DOB for Ricky\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Day: 5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Month: 8\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Year: 1970\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ricky Was born on 5th August 1970 which was a Wednesday\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter14.ipynb b/Beginning_C_By_Ivon_Horton/chapter14.ipynb
new file mode 100644
index 00000000..42a4f7a7
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter14.ipynb
@@ -0,0 +1,342 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14: Advanced and Specialized Topics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 14.1, page no. 592"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Classifying wide characters\n",
+ "\"\"\"\n",
+ "\n",
+ "import string\n",
+ "import sys\n",
+ "\n",
+ "print \"Enter a character: \",\n",
+ "ch = raw_input()\n",
+ "\n",
+ "if ch.isalnum():\n",
+ " if ch.isdigit():\n",
+ " print \"You entered the digit \", ch\n",
+ " elif ch.islower():\n",
+ " print \"You entered a lower case \", ch.upper()\n",
+ " elif ch.isupper():\n",
+ " print \"You entered a upper case \", ch.lower()\n",
+ " elif ch in string.punctuation:\n",
+ " print \"You entered a punctuation character \", ch\n",
+ " else:\n",
+ " print \"You entered \", ch, \"but I don't know what it is!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a character: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "g\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You entered a lower case G\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 14.2, page no. 596"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Finding occurrences of one wide character string in another\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a string of less than 100 characters: \",\n",
+ "text = raw_input()\n",
+ "\n",
+ "print \"Enter the string sought: \",\n",
+ "sought = raw_input()\n",
+ "sought = sought.lower()\n",
+ "count = 0\n",
+ "\n",
+ "sought_len = len(sought)\n",
+ "\n",
+ "for i in range(len(text)):\n",
+ " substr = text[i:sought_len+i]\n",
+ " if substr == sought:\n",
+ " count += 1\n",
+ "\n",
+ "print \"First string entered: \", text\n",
+ "print \"Second string entered: \", sought\n",
+ "print \"The second string was found in first %d times\" %count\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string of less than 100 characters: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smith, where Jones had had, \"had\", had had \"had had\". Enter the string sought (less than 40 characters): Had\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the string sought: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "had\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " First string entered: Smith, where Jones had had, \"had\", had had \"had had\". Enter the string sought (less than 40 characters): Had\n",
+ "Second string entered: had\n",
+ "The second string was found in first 7 times\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 14.3, page no. 606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Working with complex numbers\n",
+ "\"\"\"\n",
+ "\n",
+ "cx = 1.0 + 3.0j\n",
+ "cy = 1.0 - 4.0j\n",
+ "\n",
+ "sum = cx + cy\n",
+ "diff = cx - cy\n",
+ "product = cx * cy\n",
+ "quotient = cy/cy\n",
+ "conjugate = cx.conjugate()\n",
+ "\n",
+ "print \"Complex numbers are supported\"\n",
+ "print \"Working with complex numbers: \"\n",
+ "print \"Starting values: cx = %.2f%+.2fi cy = %.2f%+.2fi\" %(cx.real, cx.imag, cy.real, cy.imag)\n",
+ "print \"The sum cx + cy = %.2f%+.2fi\" %(sum.real, sum.imag)\n",
+ "print \"The difference cx - cy = %.2f%+.2fi\" %(diff.real, diff.imag)\n",
+ "print \"The product cx * cy = %.2f%+.2fi\" %(product.real, product.imag)\n",
+ "print \"The quotient cx / cy = %.2f%+.2fi\" %(quotient.real, quotient.imag)\n",
+ "print \"The conjugate of cx = %.2f%+.2fi\" %(conjugate.real, conjugate.imag)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Complex numbers are supported\n",
+ "Working with complex numbers: \n",
+ "Starting values: cx = 1.00+3.00i cy = 1.00-4.00i\n",
+ "The sum cx + cy = 2.00-1.00i\n",
+ "The difference cx - cy = 0.00+7.00i\n",
+ "The product cx * cy = 13.00-1.00i\n",
+ "The quotient cx / cy = 1.00-0.00i\n",
+ "The conjugate of cx = 1.00-3.00i\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 14.4, page no. 610"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Joining threads\n",
+ "\"\"\"\n",
+ "\n",
+ "from threading import Thread\n",
+ "\n",
+ "def get_data(pdata):\n",
+ " pd = pdata\n",
+ " print \"The get_data thread received: data.a=%d and data.b=%d\" %(pd[0], pd[1])\n",
+ " pd[0] *= 3\n",
+ " print \"The get_data thread makes it: data.a=%d and data.b=%d \" %(pd[0], pd[1])\n",
+ " \n",
+ "def process_data(pdata):\n",
+ " pd = pdata\n",
+ " print \"The process_data thread received: data.a=%d and data.b=%d \"%(pd[0], pd[1])\n",
+ " \n",
+ "mydata = [123, 345]\n",
+ "print \"Before starting the get_data thread: mydata.a=%d and mydata. b=%d\" %(mydata[0], mydata[1])\n",
+ "print \"get_data thread started.\"\n",
+ "t1 = Thread(target=get_data, args=(mydata,))\n",
+ "t1.start()\n",
+ "Thread.join(t1)\n",
+ "print \"process_data thread started.\"\n",
+ "t2 = Thread(target=process_data, args=(mydata,))\n",
+ "t2.start()\n",
+ "Thread.join(t2)\n",
+ "print \"After both threads finish executing: mydata.a=%d and mydata. b=%d\" %(mydata[0], mydata[1])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before starting the get_data thread: mydata.a=123 and mydata. b=345\n",
+ "get_data thread started.\n",
+ "The get_data thread received: data.a=123 and data.b=345\n",
+ "The get_data thread makes it: data.a=369 and data.b=345 \n",
+ "process_data thread started.\n",
+ "The process_data thread received: data.a=369 and data.b=345 \n",
+ "After both threads finish executing: mydata.a=369 and mydata. b=345\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 14.5, page no. 616"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Thread operations\n",
+ "\"\"\"\n",
+ "\n",
+ "from threading import Thread\n",
+ "import math\n",
+ "import time\n",
+ "\n",
+ "thread_count = 5\n",
+ "\n",
+ "thread_id = []\n",
+ "task = 0\n",
+ "\n",
+ "def execute_task():\n",
+ " global task\n",
+ " task += 1\n",
+ " print \"Task %d started.\" %task\n",
+ " time.sleep(1)\n",
+ " for i in range(1000000):\n",
+ " x = math.sqrt(3.1415926)\n",
+ " print \"Task %d finished\" %task\n",
+ " \n",
+ "\n",
+ "for i in range(thread_count):\n",
+ " thread_id.append(Thread(target=execute_task))\n",
+ " thread_id[i].start()\n",
+ " \n",
+ "for j in range(thread_count):\n",
+ " Thread.join(thread_id[j])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Task 1 started.\n",
+ "Task 2 started.\n",
+ "Task 3 started.\n",
+ "Task 4 started.\n",
+ "Task 5 started.\n",
+ "Task 5 finished\n",
+ "Task 5 finished\n",
+ "Task 5 finished\n",
+ "Task 5 finished\n",
+ "Task 5 finished\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter2.ipynb b/Beginning_C_By_Ivon_Horton/chapter2.ipynb
new file mode 100644
index 00000000..7e4b1bf3
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter2.ipynb
@@ -0,0 +1,823 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2: First Steps in Programming"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.1, page no. 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "What is a Variable?\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"My salary is $10000\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "My salary is $10000\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.2, page no. 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using a variable\n",
+ "\"\"\"\n",
+ " \n",
+ "salary = 10000; #Declare and store 10000 in variable called salary\n",
+ "print \"My salary is %d.\" %salary"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "My salary is 10000.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.3, page no. 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using more variables\n",
+ "\"\"\"\n",
+ "\n",
+ "brothers = 7 #declaring variable & storing value\n",
+ "brides = 7 #declaring variable & storing value\n",
+ " \n",
+ "print \"%d brides for %d brothers\" %(brides, brothers)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7 brides for 7 brothers\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.4, page no. 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Program 2.4 Simple calculations\n",
+ "\"\"\"\n",
+ "\n",
+ "cats = 2\n",
+ "dogs = 1\n",
+ "ponies = 1\n",
+ "others = 46\n",
+ " \n",
+ "total_pets = cats + dogs + ponies + others;\n",
+ " \n",
+ "print \"We have %d pets in total\\n\" %total_pets"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "We have 50 pets in total\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.5, page no. 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculations with cookies\n",
+ "\"\"\"\n",
+ "\n",
+ "cookies = 5\n",
+ "cookie_calories = 125\n",
+ "total_eaten = 0\n",
+ "eaten = 2\n",
+ "cookies = cookies - eaten\n",
+ "total_eaten = total_eaten + eaten\n",
+ "print \"I have eaten %d cookies. There are %d cookies left\" %(eaten, cookies)\n",
+ " \n",
+ "eaten = 3\n",
+ "cookies = cookies - eaten\n",
+ "total_eaten = total_eaten + eaten\n",
+ "print \"I have eaten %d more. Now there are %d cookies left\\n\" %(eaten, cookies)\n",
+ "print \"Total energy consumed is %d calories.\\n\" %(total_eaten*cookie_calories)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I have eaten 2 cookies. There are 3 cookies left\n",
+ "I have eaten 3 more. Now there are 0 cookies left\n",
+ "\n",
+ "Total energy consumed is 625 calories.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.6, page no. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Cookies and kids\n",
+ "\"\"\"\n",
+ "\n",
+ "cookies = 45\n",
+ "children = 7\n",
+ "cookies_per_child = 0\n",
+ "cookies_left_over = 0\n",
+ " \n",
+ "cookies_per_child = cookies/children\n",
+ "print \"You have %d children and %d cookies\" %(children, cookies)\n",
+ "print \"Give each child %d cookies.\\n\" %cookies_per_child\n",
+ "cookies_left_over = cookies%children\n",
+ "print \"There are %d cookies left over.\\n\" %cookies_left_over"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You have 7 children and 45 cookies\n",
+ "Give each child 6 cookies.\n",
+ "\n",
+ "There are 3 cookies left over.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.7, page no. 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Division with float values\n",
+ "\"\"\"\n",
+ "\n",
+ "plank_length = 10.0\n",
+ "piece_count = 4.0\n",
+ "piece_length = 0.0\n",
+ " \n",
+ "piece_length = plank_length/piece_count;\n",
+ "print \"A plank %f feet long can be cut into %f pieces %f feet long.\\n\" %(plank_length, piece_count, piece_length)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A plank 10.000000 feet long can be cut into 4.000000 pieces 2.500000 feet long.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.8, page no. 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculations on a table\n",
+ "\"\"\"\n",
+ "\n",
+ "radius = 0.0\n",
+ "diameter = 0.0\n",
+ "circumference = 0.0\n",
+ "area = 0.0\n",
+ "Pi = 3.14159265\n",
+ " \n",
+ "print \"Input the diameter of the table:\",\n",
+ "diameter = float(raw_input()) \n",
+ "radius = diameter/2.0\n",
+ "circumference = 2.0*Pi*radius\n",
+ "area = Pi*radius*radius\n",
+ " \n",
+ "print \"\\nThe circumference is %0.2f\" %circumference\n",
+ "print \"\\nThe area is %0.2f\\n\" %area"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input the diameter of the table:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "The circumference is 18.85\n",
+ "\n",
+ "The area is 28.27\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.9, page no. 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "More round tables\n",
+ "\"\"\"\n",
+ "\n",
+ "PI = 3.14159\n",
+ " \n",
+ "radius = 0.0\n",
+ "diameter = 0.0\n",
+ "circumference = 0.0\n",
+ "area = 0.0\n",
+ " \n",
+ "print \"Input the diameter of a table:\", \n",
+ "diameter = float(raw_input())\n",
+ " \n",
+ "radius = diameter/2.0\n",
+ "circumference = 2.0*PI*radius\n",
+ "area = PI*radius*radius;\n",
+ " \n",
+ "print \"\\nThe circumference is %.2f. \" %circumference\n",
+ "print \"\\nThe area is %.2f.\\n\" %area"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input the diameter of a table:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "The circumference is 18.85. \n",
+ "\n",
+ "The area is 28.27.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.10, page no. 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Round tables again but shorter\n",
+ "\"\"\"\n",
+ "\n",
+ "diameter = 0.0\n",
+ "radius = 0.0\n",
+ "Pi = 3.14159\n",
+ " \n",
+ "print \"Input the diameter of the table:\",\n",
+ "diameter = float(raw_input())\n",
+ "radius = diameter/2.0\n",
+ " \n",
+ "print \"\\nThe circumference is %.2f.\" %(2.0*Pi*radius)\n",
+ "print \"\\nThe area is %.2f.\\n\" %(Pi*radius*radius)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input the diameter of the table:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "The circumference is 18.85.\n",
+ "\n",
+ "The area is 28.27.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.12, page no. 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Data Types\n",
+ "Note: there is no long double, or float double or double range or short.\n",
+ "Also, the size of data types my defer compared to c & there is no limit so we\n",
+ "have skipped example 2.11 of this chapter\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys \n",
+ "\n",
+ "print \"Size of Integer is: \" + str(sys.getsizeof(int()))\n",
+ "print \"Size of Float is: \" + str(sys.getsizeof(float()))\n",
+ "print \"Size of Long is: \" + str(sys.getsizeof(long()))\n",
+ "print \"Size of String is: \" + str(sys.getsizeof(str()))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Size of Integer is: 24\n",
+ "Size of Float is: 24\n",
+ "Size of Long is: 24\n",
+ "Size of String is: 37\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.13, page no. 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Choosing the correct type for the job\n",
+ "note: there won't be any error as said in the book, hence, skipping 2.14\n",
+ "\"\"\"\n",
+ "\n",
+ "Revenue_Per_150 = 4.5\n",
+ "JanSold = 23500\n",
+ "FebSold = 19300\n",
+ "MarSold = 21600\n",
+ "RevQuarter = 0.0\n",
+ " \n",
+ "QuarterSold = JanSold + FebSold + MarSold\n",
+ " \n",
+ "print \"Stock sold in\\n Jan: %d\\n Feb: %d\\n Mar: %d\\n\" %(JanSold, FebSold, MarSold)\n",
+ "print \"Total stock sold in first quarter: %d\\n\" %QuarterSold\n",
+ " \n",
+ "RevQuarter = QuarterSold/150*Revenue_Per_150\n",
+ "print \"Sales revenue this quarter is:$%.2f\\n\" %RevQuarter"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stock sold in\n",
+ " Jan: 23500\n",
+ " Feb: 19300\n",
+ " Mar: 21600\n",
+ "\n",
+ "Total stock sold in first quarter: 64400\n",
+ "\n",
+ "Sales revenue this quarter is:$1930.50\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.15, page no. 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Characters and numbers\n",
+ "\"\"\"\n",
+ "\n",
+ "first = 'T'\n",
+ "second = 63\n",
+ " \n",
+ "print \"The first example as a letter looks like this - \", first\n",
+ "print \"The first example as a number looks like this - \", ord(first)\n",
+ "print \"The second example as a letter looks like this - \", chr(second)\n",
+ "print \"The second example as a number looks like this - %d\\n\" %second"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The first example as a letter looks like this - T\n",
+ "The first example as a number looks like this - 84\n",
+ "The second example as a letter looks like this - ?\n",
+ "The second example as a number looks like this - 63\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.16, page no. 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using type char\n",
+ "\"\"\"\n",
+ "\n",
+ "first = 'A'\n",
+ "second = 'B'\n",
+ "last = 'Z'\n",
+ "number = 40\n",
+ "ex1 = ord(first) + 2\n",
+ "ex2 = ord(second) - 1\n",
+ "ex3 = ord(last) + 2\n",
+ " \n",
+ "print \"Character values \\t %-5c%-5c%-5c\\n\" %(chr(ex1), chr(ex2), chr(ex3))\n",
+ "print \"Numerical equivalents\\t %-5d%-5d%-5d\\n\" %(ex1, ex2, ex3)\n",
+ "print \"The number %d is the code for the character %c\" %(number, chr(number))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Character values \t C A \\ \n",
+ "\n",
+ "Numerical equivalents\t 67 65 92 \n",
+ "\n",
+ "The number 40 is the code for the character (\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 2.17 (combines 2.18 also), page no. 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculating the height of a tree\n",
+ "\"\"\"\n",
+ "\n",
+ "shorty = 0.0\n",
+ "lofty = 0.0\n",
+ "feet = 0.0\n",
+ "inches = 0.0\n",
+ "shorty_to_lofty = 0.0\n",
+ "lofty_to_tree = 0.0\n",
+ "inches_per_foot = 12.0\n",
+ " \n",
+ "print \"Enter Lofty's height to the top of his/her head, in whole feet: \",\n",
+ "feet = float(raw_input())\n",
+ "print \"...and then inches: \",\n",
+ "inches = float(raw_input())\n",
+ "lofty = feet*inches_per_foot + inches\n",
+ "\n",
+ "print \"Enter Shorty's height up to his/her eyes, in whole feet: \",\n",
+ "feet = float(raw_input())\n",
+ "print \"... and then inches: \",\n",
+ "inches = float(raw_input())\n",
+ "shorty = feet*inches_per_foot + inches\n",
+ " \n",
+ "print \"Enter the distance between Shorty and Lofty, in whole feet: \",\n",
+ "feet = float(raw_input())\n",
+ "print \"... and then inches: \",\n",
+ "inches = float(raw_input())\n",
+ "shorty_to_lofty = feet*inches_per_foot + inches\n",
+ " \n",
+ "print \"Finally enter the distance from Lofty to the tree to the nearest foot: \",\n",
+ "feet = float(raw_input())\n",
+ "lofty_to_tree = feet*inches_per_foot\n",
+ "\n",
+ "\n",
+ "tree_height = shorty + (shorty_to_lofty + lofty_to_tree)*(lofty-shorty)/shorty_to_lofty\n",
+ " \n",
+ "print \"The height of the tree is %ld feet and %ld inches.\\n\" %(tree_height/inches_per_foot, tree_height% inches_per_foot)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Lofty's height to the top of his/her head, in whole feet: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " ...and then inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Shorty's height up to his/her eyes, in whole feet: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " ... and then inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the distance between Shorty and Lofty, in whole feet: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " ... and then inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Finally enter the distance from Lofty to the tree to the nearest foot: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The height of the tree is 12 feet and 10 inches.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter3.ipynb b/Beginning_C_By_Ivon_Horton/chapter3.ipynb
new file mode 100644
index 00000000..49245eb1
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter3.ipynb
@@ -0,0 +1,706 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Making Decisions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.1, page no. 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A simple example of the if statement\n",
+ "\"\"\"\n",
+ "\n",
+ "number = 0;\n",
+ "print \"\\nEnter an integer between 1 and 10: \",\n",
+ "number = int(raw_input())\n",
+ " \n",
+ "if(number > 5):\n",
+ " print \"You entered %d which is greater than 5\\n\" % number\n",
+ "if(number < 6):\n",
+ " print \"You entered %d which is less than 6\\n\" % number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter an integer between 1 and 10: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You entered 6 which is greater than 5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.2, page no. 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using if statements to decide on a discount\n",
+ "\"\"\"\n",
+ "\n",
+ "unit_price = 3.50\n",
+ "print \"Enter the number that you want to buy: \", \n",
+ "quantity = int(raw_input())\n",
+ "if(quantity > 10):\n",
+ " total = quantity*unit_price*0.95 # 5% discount\n",
+ " print \"The price for %d is $%.2f\\n\" % (quantity, total)\n",
+ "else:\n",
+ " total = quantity*unit_price #no discount\n",
+ " print \"The price for %d is $%.2f\\n\" % (quantity, total)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number that you want to buy: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The price for 20 is $66.50\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.3, page no. 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using nested ifs to analyze numbers\n",
+ "note: no need of LONG_MAX as there is no limit in python for an integer value\n",
+ "\"\"\"\n",
+ "\n",
+ "test = 0.0\n",
+ "print \"Enter an integer: \",\n",
+ "test = int(raw_input())\n",
+ " \n",
+ "if(test % 2 == 0):\n",
+ " print \"The number %ld is even\" %test\n",
+ "if((test/2) % 2 == 0):\n",
+ " print \"Half of %d is also even\" %test\n",
+ " print \"That's interesting isn't it?\"\n",
+ "else:\n",
+ " print \"The number %d is odd\\n\" %test"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an integer: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number 20 is even\n",
+ "Half of 20 is also even\n",
+ "That's interesting isn't it?\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.4, page no. 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Converting uppercase to lowercase\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter an uppercase letter:\",\n",
+ "letter = raw_input()\n",
+ "if(ord(letter) >= ord('A')):\n",
+ " if(ord(letter) <= ord('Z')):\n",
+ " letter = chr( ord(letter) - ord('A') + ord('a'))\n",
+ " print \"You entered an uppercase %c\" %letter\n",
+ " else:\n",
+ " print \"Try using the shift key! I want a capital letter.\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an uppercase letter:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "G\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You entered an uppercase g\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.5, page no. 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Testing letters an easier way\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter an uppercase letter:\",\n",
+ "letter = raw_input()\n",
+ "if( (ord(letter) >= ord('A')) and (ord(letter) <= ord('Z')) ):\n",
+ " letter = chr( ord(letter) - ord('A') + ord('a'))\n",
+ " print \"You entered an uppercase %c\" %letter\n",
+ "else:\n",
+ " print \"You did not enter an uppercase letter.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an uppercase letter:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "j\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You did not enter an uppercase letter.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.6, page no. 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Multiple Discount Levels\n",
+ "\"\"\"\n",
+ "\n",
+ "unit_price = 3.50\n",
+ "discount1 = 0.05\n",
+ "discount2 = 0.1\n",
+ "discount3 = 0.15\n",
+ "total_price = 0.0\n",
+ " \n",
+ "print \"Enter the number that you want to buy:\",\n",
+ "quantity = int(raw_input())\n",
+ " \n",
+ "if(quantity >50):\n",
+ " total_price = quantity*unit_price*(1.0-discount3)\n",
+ "elif(quantity > 20):\n",
+ " total_price = quantity*unit_price*(1.0-discount2)\n",
+ "elif(quantity > 10):\n",
+ " total_price = quantity*unit_price*(1.0-discount1)\n",
+ "else:\n",
+ " total_price = quantity*unit_price*(1.0-0.0)\n",
+ "print \"The price for %d is $%.2f\\n\" %(quantity, total_price)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number that you want to buy:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The price for 60 is $178.50\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.7, page no. 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A confused recruiting policy \n",
+ "\"\"\"\n",
+ "\n",
+ "age = 0\n",
+ "college = 0\n",
+ "subject = 0\n",
+ "interview = False # true for accept, false for reject\n",
+ "\n",
+ "print \"What college? 1 for Harvard, 2 for Yale, 3 for other: \",\n",
+ "college = int(raw_input())\n",
+ "print \"What subject? 1 for Chemistry, 2 for economics, 3 for other: \",\n",
+ "subject = int(raw_input())\n",
+ "print \"How old is the applicant? \",\n",
+ "age = int(raw_input())\n",
+ " \n",
+ "if( (age>25 and subject==1) and (college==3 or college == 1) ):\n",
+ " interview = True\n",
+ "if(college == 2 and subject == 1):\n",
+ " interview = True\n",
+ "if(college == 1 and subject == 2 and not(age > 28)):\n",
+ " interview = True\n",
+ "if(college == 2 and (subject == 2 or subject == 3) and age > 25):\n",
+ " interview = True\n",
+ " \n",
+ "if(interview):\n",
+ " print \"Give 'em an interview\"\n",
+ "else:\n",
+ " print \"Reject 'em\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "What college? 1 for Harvard, 2 for Yale, 3 for other: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " What subject? 1 for Chemistry, 2 for economics, 3 for other: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How old is the applicant? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Give 'em an interview\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.8, page no. 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Lucky Lotteries\n",
+ "note: there is no switch statement in Python\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Pick a number between 1 and 10 and you may win a prize! \",\n",
+ "choice = int(raw_input())\n",
+ "if((choice > 10) or (choice < 1)):\n",
+ " choice = 11\n",
+ "if choice == 7:\n",
+ " print \"Congratulations!\"\n",
+ " print \"You win the collected works of Amos Gruntfuttock.\"\n",
+ "elif choice == 2:\n",
+ " print \"You win the folding thermometer-pen-watch-umbrella.\"\n",
+ "elif choice == 8:\n",
+ " print \"You win the lifetime supply of aspirin tablets.\"\n",
+ "elif choice == 11:\n",
+ " print \"Try between 1 and 10. You wasted your guess.\",\n",
+ "else:\n",
+ " print \"Sorry, you lose.\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pick a number between 1 and 10 and you may win a prize! "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Congratulations!\n",
+ "You win the collected works of Amos Gruntfuttock.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.9, page no. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Testing cases\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter Y or N: \",\n",
+ "answer = raw_input()\n",
+ "\n",
+ "if answer =='y' or answer == 'Y':\n",
+ " print \"You responded in the affirmative.\"\n",
+ "elif answer == 'n' or answer == 'N':\n",
+ " print \"You responded in the negative.\"\n",
+ "else:\n",
+ " print \"You did not respond correctly. . .\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Y or N: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You responded in the affirmative.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 3.10, page no. 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Excercising bitwise operator\n",
+ "\"\"\"\n",
+ "\n",
+ "original = 0xABC\n",
+ "result = 0\n",
+ "mask = 0xF\n",
+ "\n",
+ "print \"original = %X\" % original\n",
+ "result |= original & mask\n",
+ " \n",
+ "original = original >> 4\n",
+ "result = result << 4\n",
+ "result |= original&mask\n",
+ " \n",
+ "original = original >> 4\n",
+ "result = result << 4\n",
+ "result |= original & mask\n",
+ "print \"result = %X\" % result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "original = ABC\n",
+ "result = CBA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Program 3.11, page no. 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A calculator\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter the calculation\\n\",\n",
+ "number1 = float(raw_input(\"Enter first number: \"))\n",
+ "number2 = float(raw_input(\"Enter second number: \"))\n",
+ "operation = raw_input(\"Enter operation '+' or '-' or '/' or '%' or '*': \")\n",
+ " \n",
+ "if operation == '+':\n",
+ " print \"= %f\" %(number1 + number2)\n",
+ "elif operation == '-':\n",
+ " print \"= %f\" %(number1 - number2)\n",
+ "elif operation == '*':\n",
+ " print \"= %f\" %(number1 * number2);\n",
+ "elif operation == '/':\n",
+ " if(number2 == 0):\n",
+ " print \"Division by zero error!\"\n",
+ " else:\n",
+ " print \"= %f\\n\" %(number1 / number2)\n",
+ "elif operation == '%':\n",
+ " if(number2 == 0):\n",
+ " print \"Division by zero error!\"\n",
+ " else:\n",
+ " print \"= %f\\n\" %(number1 % number2)\n",
+ "else:\n",
+ " print \"Illegal operation!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the calculation\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first number: 25\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter second number: 24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter operation '+' or '-' or '/' or '%' or '*': *\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 600.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter4.ipynb b/Beginning_C_By_Ivon_Horton/chapter4.ipynb
new file mode 100644
index 00000000..1dd29164
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter4.ipynb
@@ -0,0 +1,954 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Loops"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.1, page no. 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "List ten integers\n",
+ "\"\"\"\n",
+ "\n",
+ "for count in range (1, 11):\n",
+ " print count,\n",
+ "print \"\\nAfter the loop count has the value %d.\" %count"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 3 4 5 6 7 8 9 10 \n",
+ "After the loop count has the value 10.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.2, page no. 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Drawing a box\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"**************\"\n",
+ "for count in range(1, 9):\n",
+ " print \"* *\"\n",
+ "print \"**************\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "**************\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "**************\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.3, page no. 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Sum the integers from 1 to a user-specified number\n",
+ "\"\"\"\n",
+ "\n",
+ "sum = 0\n",
+ "\n",
+ "print \"Enter the number of integers you want to sum: \",\n",
+ "count = int(raw_input())\n",
+ " \n",
+ "for i in range(1, count+1):\n",
+ " sum = sum + i\n",
+ " \n",
+ "print \"Total of the first %d numbers is %d\" %(count, sum)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of integers you want to sum: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total of the first 10 numbers is 55\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.4, page no. 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Sum the integers from 1 to a user-specified number (compact version)\n",
+ "note: the way specified in book is not possible in Python, it will be same as\n",
+ "previous progam\n",
+ "\"\"\"\n",
+ "\n",
+ "sum = 0\n",
+ "\n",
+ "print \"Enter the number of integers you want to sum: \",\n",
+ "count = int(raw_input())\n",
+ " \n",
+ "for i in range(1, count+1):\n",
+ " sum = sum + i\n",
+ " \n",
+ "print \"Total of the first %d numbers is %d\" %(count, sum)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of integers you want to sum: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total of the first 10 numbers is 55\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.5, page no. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "summing the integers backward\n",
+ "\"\"\"\n",
+ "\n",
+ "sum = 0\n",
+ "\n",
+ "print \"Enter the number of integers you want to sum: \",\n",
+ "count = int(raw_input())\n",
+ "for i in range(count, 0, -1):\n",
+ " sum = sum + i\n",
+ "print \"Total of the first %d numbers is %d\" %(count, sum)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of integers you want to sum: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total of the first 10 numbers is 55\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.6, page no. 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The almost indefinite loop - computing an average\n",
+ "note: there cannot be infinit for loop in python, we will use while loop\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"This program calculates the average of any number of values.\"\n",
+ "total = 0\n",
+ "count = 0\n",
+ "while True: # infinite loop\n",
+ " print \"\\nEnter a value: \",\n",
+ " value = float(raw_input())\n",
+ " total += value\n",
+ " count += 1\n",
+ " \n",
+ " print \"Do you want to enter another value? (Y or N): \", \n",
+ " answer = raw_input()\n",
+ " if(answer.lower() == 'n'):\n",
+ " break\n",
+ "\n",
+ "print \"The average is %.2f\" %(total/count)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This program calculates the average of any number of values.\n",
+ "\n",
+ "Enter a value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another value? (Y or N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "Enter a value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another value? (Y or N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "Enter a value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Do you want to enter another value? (Y or N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The average is 8.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.7, page no. 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A Guessing Game\n",
+ "\"\"\"\n",
+ "import sys\n",
+ "\n",
+ "chosen = 15\n",
+ "guess = 0\n",
+ "count = 3\n",
+ " \n",
+ "print \"This is a guessing game.\"\n",
+ "print \"I have chosen a number between 1 and 20 which you must guess.\"\n",
+ "\n",
+ "for i in range(count, 0, -1):\n",
+ " print \"You have %d tr%s left.\" %(i, (\"y\" if i == 1 else \"ies\"));\n",
+ " print \"\\nEnter a guess: \",\n",
+ " guess = int(raw_input())\n",
+ " if(guess == chosen):\n",
+ " print \"Congratulations. You guessed it!\"\n",
+ " sys.exit()\n",
+ " elif(guess < 1 or guess > 20):\n",
+ " print \"I said the number is between 1 and 20.\"\n",
+ " else:\n",
+ " print \"Sorry, %d is wrong. My number is %s than that.\\n\" %(guess, (\"greater\" if chosen > guess else \"less\"))\n",
+ "print \"You have had three tries and failed. The number was %d\" % chosen"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is a guessing game.\n",
+ "I have chosen a number between 1 and 20 which you must guess.\n",
+ "You have 3 tries left.\n",
+ "\n",
+ "Enter a guess: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sorry, 5 is wrong. My number is greater than that.\n",
+ "\n",
+ "You have 2 tries left.\n",
+ "\n",
+ "Enter a guess: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sorry, 9 is wrong. My number is greater than that.\n",
+ "\n",
+ "You have 1 try left.\n",
+ "\n",
+ "Enter a guess: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sorry, 14 is wrong. My number is greater than that.\n",
+ "\n",
+ "You have had three tries and failed. The number was 15\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.7A, page no. 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A More Interesting Guessing Game\n",
+ "\"\"\"\n",
+ "\n",
+ "from random import *\n",
+ "\n",
+ "guess = 0\n",
+ "count = 3\n",
+ "limit = 20\n",
+ "\n",
+ "chosen = 1 + randint(1, limit) #Random int 1 to limit\n",
+ " \n",
+ "print \"This is a guessing game.\"\n",
+ "print \"I have chosen a number between 1 and 20 which you must guess.\"\n",
+ "\n",
+ "for i in range(count, 0, -1):\n",
+ " print \"You have %d tr%s left.\" %(i, (\"y\" if i == 1 else \"ies\"));\n",
+ " print \"Enter a guess: \",\n",
+ " guess = int(raw_input())\n",
+ " if(guess == chosen):\n",
+ " print \"Congratulations. You guessed it!\"\n",
+ " sys.exit()\n",
+ " elif(guess < 1 or guess > 20):\n",
+ " print \"I said the number is between 1 and 20.\"\n",
+ " else:\n",
+ " print \"Sorry, %d is wrong. My number is %s than that.\\n\" %(guess, (\"greater\" if chosen > guess else \"less\"))\n",
+ "print \"You have had three tries and failed. The number was %d\" % chosen"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is a guessing game.\n",
+ "I have chosen a number between 1 and 20 which you must guess.\n",
+ "You have 3 tries left.\n",
+ "Enter a guess: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sorry, 6 is wrong. My number is greater than that.\n",
+ "\n",
+ "You have 2 tries left.\n",
+ "Enter a guess: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "14\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sorry, 14 is wrong. My number is greater than that.\n",
+ "\n",
+ "You have 1 try left.\n",
+ "Enter a guess: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sorry, 16 is wrong. My number is greater than that.\n",
+ "\n",
+ "You have had three tries and failed. The number was 20\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.8, page no. 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "While programming and summing integers\n",
+ "\"\"\"\n",
+ "\n",
+ "sum = 0\n",
+ "i = 1\n",
+ "\n",
+ "print \"Enter the number of integers you want to sum: \",\n",
+ "count = int(raw_input())\n",
+ " \n",
+ "while(i <= count):\n",
+ " sum += i\n",
+ " i += 1\n",
+ " \n",
+ "print \"Total of the first %d numbers is %d\" %(count, sum)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of integers you want to sum: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total of the first 10 numbers is 55\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.9, page no. 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Output a box with given width and height\n",
+ "\"\"\"\n",
+ "\n",
+ "MIN_SIZE = 3;\n",
+ " \n",
+ "print \"Enter values for the width and height (minimum of %d): \" % MIN_SIZE\n",
+ "width = int(raw_input(\"Width: \"))\n",
+ "height = int(raw_input(\"Height: \"))\n",
+ " \n",
+ "if(width < MIN_SIZE):\n",
+ " print \"Width value of %d is too small. Setting it to %d.\" %(width, MIN_SIZE)\n",
+ " width = MIN_SIZE\n",
+ "if(height < MIN_SIZE):\n",
+ " print \"Height value of %d is too small. Setting it to %d.\" %(height, MIN_SIZE)\n",
+ " height = MIN_SIZE\n",
+ "\n",
+ "\n",
+ "for i in range(0, width):\n",
+ " print \"*\",\n",
+ "print \"\\n\"\n",
+ "for j in range(0, height-2):\n",
+ " print \"*\",\n",
+ " for i in range(0, width-2):\n",
+ " print \" \",\n",
+ " print \"*\"\n",
+ "\n",
+ "print \"\\n\"\n",
+ "for i in range(0, width):\n",
+ " print \"*\","
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter values for the width and height (minimum of 3): \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width: 24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height: 7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "* * * * * * * * * * * * * * * * * * * * * * * * \n",
+ "\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "* *\n",
+ "\n",
+ "\n",
+ "* * * * * * * * * * * * * * * * * * * * * * * *\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.10, page no. 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Sums of successive integer sequences\n",
+ "\"\"\"\n",
+ "\n",
+ "sum = 0\n",
+ "count = 0\n",
+ "\n",
+ "print \"Enter the number of integers you want to sum: \",\n",
+ "count = int(raw_input())\n",
+ " \n",
+ "for i in range(1, count+1):\n",
+ " sum = 0\n",
+ " for j in range(1, i+1):\n",
+ " sum += j\n",
+ " print \"%d\\t%5d\" %(i, sum)\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of integers you want to sum: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1\t 1\n",
+ "2\t 3\n",
+ "3\t 6\n",
+ "4\t 10\n",
+ "5\t 15\n",
+ "6\t 21\n",
+ "7\t 28\n",
+ "8\t 36\n",
+ "9\t 45\n",
+ "10\t 55\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.11, page no. 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Sums of integers with a while loop nested in a for loop\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter the number of integers you want to sum: \",\n",
+ "count = int(raw_input())\n",
+ "\n",
+ "for i in range(1, count+1):\n",
+ " sum = 1\n",
+ " j = 1\n",
+ " print \"1\",\n",
+ " while(j < i):\n",
+ " j += 1\n",
+ " sum += j\n",
+ " print \"+ %d\" % j,\n",
+ " print \"= %d\" % sum\n",
+ "print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of integers you want to sum: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1 = 1\n",
+ "1 + 2 = 3\n",
+ "1 + 2 + 3 = 6\n",
+ "1 + 2 + 3 + 4 = 10\n",
+ "1 + 2 + 3 + 4 + 5 = 15\n",
+ "1 + 2 + 3 + 4 + 5 + 6 = 21\n",
+ "1 + 2 + 3 + 4 + 5 + 6 + 7 = 28\n",
+ "1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36\n",
+ "1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45\n",
+ "1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 4.12, page no. 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Reversing the digits\n",
+ "\"\"\"\n",
+ "rebmun = 0\n",
+ "print \"\\nEnter a positive integer: \",\n",
+ "number = int(raw_input())\n",
+ "temp = number\n",
+ "while(temp):\n",
+ " rebmun = 10*rebmun + temp % 10\n",
+ " temp = temp/10\n",
+ "\n",
+ "print \"The number %d reversed is %d rebmun ehT\" %(number, rebmun)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter a positive integer: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number 7 reversed is 7 rebmun ehT\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter5.ipynb b/Beginning_C_By_Ivon_Horton/chapter5.ipynb
new file mode 100644
index 00000000..3b34352d
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter5.ipynb
@@ -0,0 +1,1080 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Arrays"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.1, page no. 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Averaging ten grades without storing them\n",
+ "\"\"\"\n",
+ "\n",
+ "count = 10\n",
+ "sum = 0\n",
+ "average = 0.0\n",
+ "for i in range(0, count):\n",
+ " print \"Enter a grade: \",\n",
+ " grade = int(raw_input())\n",
+ " sum += grade\n",
+ " \n",
+ "average = sum/count\n",
+ "print \"Average of the ten grades entered is: \", average"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "58\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "68\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "79\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "89\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "90\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "68\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter a grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "47\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Average of the ten grades entered is: 63\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.2, page no. 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Averaging ten grades - storing values the hard way\n",
+ "\"\"\"\n",
+ "\n",
+ "sum = 0\n",
+ "average = 0.0\n",
+ "print \"Enter the first five grades: \"\n",
+ "grade0 = int(raw_input(\"grade0: \"))\n",
+ "grade1 = int(raw_input(\"grade1: \"))\n",
+ "grade2 = int(raw_input(\"grade2: \"))\n",
+ "grade3 = int(raw_input(\"grade3: \"))\n",
+ "grade4 = int(raw_input(\"grade4: \"))\n",
+ "\n",
+ "print \"Enter the last five numbers in the same manner \"\n",
+ "grade5 = int(raw_input(\"grade5: \"))\n",
+ "grade6 = int(raw_input(\"grade6: \"))\n",
+ "grade7 = int(raw_input(\"grade7: \"))\n",
+ "grade8 = int(raw_input(\"grade8: \"))\n",
+ "grade9 = int(raw_input(\"grade9: \"))\n",
+ "\n",
+ "sum = grade0 + grade1 + grade2 + grade3 + grade4 + grade5 + grade6 + grade7 + grade8 + grade9\n",
+ "average = sum/10\n",
+ " \n",
+ "print \"Average of the ten grades entered is: \", average"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the first five grades: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade0: 58\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade1: 69\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade2: 48\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade3: 473\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade4: 37\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the last five numbers in the same manner \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade5: 27\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade6: 95\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade7: 75\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade8: 74\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "grade9: 64\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average of the ten grades entered is: 102\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.3, page no. 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Averaging ten grades - storing the values the easy way\n",
+ "\"\"\"\n",
+ "\n",
+ "grades = []\n",
+ "count = 10\n",
+ "sum = 0\n",
+ "average = 0.0\n",
+ "\n",
+ "print \"Enter the 10 grades: \"\n",
+ "for i in range(0, count):\n",
+ " print \"%2d> \" %(i + 1),\n",
+ " grades.append(int(raw_input()))\n",
+ " sum += grades[i]\n",
+ "average = sum/count;\n",
+ "print \"Average of the ten grades entered is: \", average"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.4, page no. 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Reusing the numbers stored\n",
+ "\"\"\"\n",
+ "\n",
+ "grades = []\n",
+ "count = 10\n",
+ "sum = 0\n",
+ "average = 0.0\n",
+ "\n",
+ "print \"Enter the 10 grades: \"\n",
+ "for i in range(0, count):\n",
+ " print \"%2d> \" %(i + 1),\n",
+ " grades.append(int(raw_input()))\n",
+ " sum += grades[i]\n",
+ "average = sum/count;\n",
+ "for i in range(0, count):\n",
+ " print \"Grade Number %2d is %3d\" %(i + 1, grades[i])\n",
+ "print \"Average of the ten grades entered is: \", average"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 10 grades: \n",
+ " 1> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "67\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 2> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "87\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 3> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "89\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 4> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "90\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 5> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 6> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "54\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 7> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 8> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "45\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 9> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "67\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 10> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "89\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Grade Number 1 is 67\n",
+ "Grade Number 2 is 87\n",
+ "Grade Number 3 is 89\n",
+ "Grade Number 4 is 90\n",
+ "Grade Number 5 is 65\n",
+ "Grade Number 6 is 54\n",
+ "Grade Number 7 is 43\n",
+ "Grade Number 8 is 45\n",
+ "Grade Number 9 is 67\n",
+ "Grade Number 10 is 89\n",
+ "Average of the ten grades entered is: 69\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.5, page no. 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using the & operator\n",
+ "\"\"\"\n",
+ "import sys\n",
+ "\n",
+ "a = 1\n",
+ "b = 2\n",
+ "c = 3\n",
+ "\n",
+ "d = 4.0\n",
+ "e = 5.0\n",
+ "f = 6.0\n",
+ "print \"A variable of type integer occupies %d bytes.\" %sys.getsizeof(int)\n",
+ "print \"Here are the addresses of some variables of type integer:\"\n",
+ "print \"The address of a is: %d The address of b is: %d\" %(id(a), id(b))\n",
+ "print \"The address of c is: %d\" % id(c)\n",
+ "print \"A variable of type float occupies %d bytes.\" %sys.getsizeof(float)\n",
+ "print \"Here are the addresses of some variables of type float: \"\n",
+ "print \"The address of d is: %d The address of e is: %d\" %(id(d), id(e))\n",
+ "print \"The address of f is: \", id(f)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A variable of type integer occupies 872 bytes.\n",
+ "Here are the addresses of some variables of type integer:\n",
+ "The address of a is: 21367976 The address of b is: 21367952\n",
+ "The address of c is: 21367928\n",
+ "A variable of type float occupies 872 bytes.\n",
+ "Here are the addresses of some variables of type float: \n",
+ "The address of d is: 32514136 The address of e is: 38248560\n",
+ "The address of f is: 38248512\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.6, page no. 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Know your hat size - if you dare...\n",
+ "\"\"\"\n",
+ "\n",
+ "size = [['6', '6', '6', '6', '7', '7', '7', '7', '7', '7', '7', '7'],\n",
+ " ['1', '5', '3', '7', ' ', '1', '1', '3', '1', '5', '3', '7'],\n",
+ " ['2', '8', '4', '8', ' ', '8', '4', '8', '2', '8', '4', '8']]\n",
+ "headsize = [164, 166, 169, 172, 175, 178, 181, 184, 188, 191, 194, 197]\n",
+ "hat_found = False\n",
+ "print \"Enter the circumference of your head above your eyebrows in inches as a decimal value: \",\n",
+ "cranium = float(raw_input())\n",
+ "your_head = int(8.0*cranium)\n",
+ "i = 0\n",
+ "if(your_head == headsize[i]):\n",
+ " hat_found = True\n",
+ "else:\n",
+ " for i in range(1, len(headsize)):\n",
+ " if(your_head > headsize[i - 1] and your_head <= headsize[i]):\n",
+ " hat_found = True\n",
+ " break\n",
+ "if(hat_found):\n",
+ " print \"Your hat size is %c %c%c%c\" %(size[0][i], size[1][i], ' ' if (size[1][i]==' ') else '/', size[2][i])\n",
+ "else:\n",
+ " if(your_head < headsize[0]):\n",
+ " print \"You are the proverbial pinhead. No hat for you I'm afraid.\"\n",
+ " else:\n",
+ " print \"You, in technical parlance, are a fathead, No hat for you, I'm afraid.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the circumference of your head above your eyebrows in inches as a decimal value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "22.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your hat size is 7 1/4\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.7, page no. 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Averaging a variable number of grades\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter the number of grades: \",\n",
+ "nGrades = int(raw_input())\n",
+ "grades = []\n",
+ "sum = 0\n",
+ " \n",
+ "print \"Enter the %d grades: \" % nGrades\n",
+ "\n",
+ "for i in range(0, nGrades):\n",
+ " print \"%d> \" %(i + 1),\n",
+ " grades.append(int(raw_input()))\n",
+ " sum += grades[i]\n",
+ " \n",
+ "print \"The grades you entered are: \"\n",
+ "for i in range(0, nGrades):\n",
+ " print \"Grade[%d] = %d \" %((i + 1), grades[i]),\n",
+ " if((i+1) % 5 == 0):\n",
+ " print \"\\n\"\n",
+ " \n",
+ "average = sum/nGrades\n",
+ "print \"Average of the %d grades entered is: %.2f\" %(nGrades, average)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of grades: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the 5 grades: \n",
+ "1> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "56\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 2> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 3> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "98\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 4> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 5> "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "43\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The grades you entered are: \n",
+ "Grade[1] = 56 Grade[2] = 78 Grade[3] = 98 Grade[4] = 65 Grade[5] = 43 \n",
+ "\n",
+ "Average of the 5 grades entered is: 68.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 5.8, page no. 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Tic-Tac-Toe\n",
+ "\"\"\"\n",
+ "\n",
+ "player = 0\n",
+ "winner = 0\n",
+ "choice = 0\n",
+ "row = 0\n",
+ "column = 0\n",
+ "board = [['1','2','3'],\n",
+ " ['4','5','6'],\n",
+ " ['7','8','9']]\n",
+ "\n",
+ "i = 0\n",
+ "while(i < 9 and winner == 0):\n",
+ " print \"\\n\"\n",
+ " print \" %c | %c | %c\" %(board[0][0], board[0][1], board[0][2])\n",
+ " print \"---+---+---\"\n",
+ " print \" %c | %c | %c\" %(board[1][0], board[1][1], board[1][2])\n",
+ " print \"---+---+---\"\n",
+ " print \" %c | %c | %c\" %(board[2][0], board[2][1], board[2][2])\n",
+ " player = i % 2 + 1\n",
+ " while(choice < 0 or choice > 8 or board[row][column] > '9'):\n",
+ " print \"Player %d, please enter a valid square number for where you want to place your %c: \" %(player,'X' if (player == 1) else 'O')\n",
+ " choice = int(raw_input())\n",
+ " choice = choice - 1\n",
+ " row = choice/3\n",
+ " column = choice % 3\n",
+ " board[row][column] = 'X' if (player == 1) else 'O'\n",
+ "\n",
+ " if((board[0][0]==board[1][1] and board[0][0]==board[2][2]) or (board[0][2]==board[1][1] and board[0][2]==board[2][0])):\n",
+ " winner = player\n",
+ " else:\n",
+ " for line in range(0, 3):\n",
+ " if((board[line][0] == board[line][1] and board[line][0] == board[line][2]) or (board[0][line] == board[1][line] and board[0][line] == board[2][line])):\n",
+ " winner = player\n",
+ " i += 1\n",
+ "\n",
+ "print \"\\n\"\n",
+ "print \" %c | %c | %c\" %(board[0][0], board[0][1], board[0][2])\n",
+ "print \"---+---+---\"\n",
+ "print \" %c | %c | %c\" %(board[1][0], board[1][1], board[1][2])\n",
+ "print \"---+---+---\"\n",
+ "print \" %c | %c | %c\" %(board[2][0], board[2][1], board[2][2])\n",
+ " \n",
+ "if(winner):\n",
+ " print \"Congratulations, player %d, YOU ARE THE WINNER!\" % winner\n",
+ "else:\n",
+ " print \"How boring, it is a draw\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " 1 | 2 | 3\n",
+ "---+---+---\n",
+ " 4 | 5 | 6\n",
+ "---+---+---\n",
+ " 7 | 8 | 9\n",
+ "\n",
+ "\n",
+ " X | 2 | 3\n",
+ "---+---+---\n",
+ " 4 | 5 | 6\n",
+ "---+---+---\n",
+ " 7 | 8 | 9\n",
+ "Player 2, please enter a valid square number for where you want to place your O: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " X | O | 3\n",
+ "---+---+---\n",
+ " 4 | 5 | 6\n",
+ "---+---+---\n",
+ " 7 | 8 | 9\n",
+ "Player 1, please enter a valid square number for where you want to place your X: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " X | O | 3\n",
+ "---+---+---\n",
+ " X | 5 | 6\n",
+ "---+---+---\n",
+ " 7 | 8 | 9\n",
+ "Player 2, please enter a valid square number for where you want to place your O: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " X | O | 3\n",
+ "---+---+---\n",
+ " X | 5 | 6\n",
+ "---+---+---\n",
+ " O | 8 | 9\n",
+ "Player 1, please enter a valid square number for where you want to place your X: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " X | O | 3\n",
+ "---+---+---\n",
+ " X | X | 6\n",
+ "---+---+---\n",
+ " O | 8 | 9\n",
+ "Player 2, please enter a valid square number for where you want to place your O: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " X | O | 3\n",
+ "---+---+---\n",
+ " X | X | 6\n",
+ "---+---+---\n",
+ " O | O | 9\n",
+ "Player 1, please enter a valid square number for where you want to place your X: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " X | O | 3\n",
+ "---+---+---\n",
+ " X | X | 6\n",
+ "---+---+---\n",
+ " O | O | X\n",
+ "Congratulations, player 1, YOU ARE THE WINNER!\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter6.ipynb b/Beginning_C_By_Ivon_Horton/chapter6.ipynb
new file mode 100644
index 00000000..fdf576c5
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter6.ipynb
@@ -0,0 +1,573 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Applications with Strings and Text"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.1, page no. 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Displaying a string\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"The character \\\\0 is used to terminate a string.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The character \\0 is used to terminate a string.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.2, page no. 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Lengths\n",
+ "\"\"\"\n",
+ "\n",
+ "str1 = \"To be or not to be\"\n",
+ "str2 = \",that is a question\"\n",
+ "\n",
+ "print \"Length of the string \\\"\", str1, \"\\\" is \", len(str1), \" characters\"\n",
+ "print \"Length of the string \\\"\", str2, \"\\\" is \", len(str2), \" characters\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of the string \" To be or not to be \" is 18 characters\n",
+ "Length of the string \" ,that is a question \" is 19 characters\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.3, page no. 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Arrays of strings\n",
+ "\"\"\"\n",
+ "\n",
+ "str1 = \"Computers do what you tell them to do, not what you want them to do.\"\n",
+ "str2 = \"When you put something in memory, remember where you put it.\"\n",
+ "str3 = \"Never test for a condition you don't know what to do with.\"\n",
+ "\n",
+ "print \"There are 3 strings.\"\n",
+ "print \"The string: \"\n",
+ "print str1\n",
+ "print \"contains \", len(str1), \" characters\"\n",
+ "print \"The string: \"\n",
+ "print str2\n",
+ "print \"contains \", len(str3), \" characters\"\n",
+ "print \"The string: \"\n",
+ "print str3\n",
+ "print \"contains \", len(str3), \" characters\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "There are 3 strings.\n",
+ "The string: \n",
+ "Computers do what you tell them to do, not what you want them to do.\n",
+ "contains 68 characters\n",
+ "The string: \n",
+ "When you put something in memory, remember where you put it.\n",
+ "contains 58 characters\n",
+ "The string: \n",
+ "Never test for a condition you don't know what to do with.\n",
+ "contains 58 characters\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.4, page no. 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Joining strings\n",
+ "\"\"\"\n",
+ "\n",
+ "preamble = \"The joke is: \"\n",
+ "str1 = \"My dog hasn\\'t got any nose.\\n\"\n",
+ "str2 = \"How does your dog smell then?\\n\"\n",
+ "str3 = \"My dog smells horrible.\\n\"\n",
+ "joke = str1 + str2 + str3\n",
+ "\n",
+ "print preamble\n",
+ "print joke"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The joke is: \n",
+ "My dog hasn't got any nose.\n",
+ "How does your dog smell then?\n",
+ "My dog smells horrible.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.5, page no. 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Comparing strings\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Type in the first word (maximum 20 characters): \",\n",
+ "word1 = raw_input()\n",
+ "print \"Type in the second word (maximum 20 characters): \",\n",
+ "word2 = raw_input()\n",
+ "\n",
+ "if(word1 == word2):\n",
+ " print \"You have entered identical words\"\n",
+ "else:\n",
+ " print \"%s precedes %s\\n\" %((word2 if(word1 > word2) else word1), (word1 if(word1 > word2) else word2)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.6, page no. 240 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A demonstration of seeking and finding\n",
+ "\"\"\"\n",
+ "\n",
+ "str1 = \"This string contains the holy grail.\"\n",
+ "str2 = \"the holy grail\"\n",
+ "str3 = \"the holy grill\"\n",
+ " \n",
+ "if str2 in str1:\n",
+ " print \"\\\"%s\\\" was found in \\\"%s\\\"\\n\" %(str2, str1)\n",
+ "else:\n",
+ " print \"\\n\\\"%s\\\" was not found.\" %str2\n",
+ " \n",
+ "if not(str3 in str1):\n",
+ " print \"\\\"%s\\\" was not found.\\n\" % str3\n",
+ "else:\n",
+ " print \"\\nWe shouldn't get to here!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\"the holy grail\" was found in \"This string contains the holy grail.\"\n",
+ "\n",
+ "\"the holy grill\" was not found.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.7, page no. 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Find all the words\n",
+ "note: program 7A in the book will remain same in Python\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter some prose that is less than 1000 characters (go on typing hit enter to terminate):\"\n",
+ "str1 = raw_input()\n",
+ "\n",
+ "if len(str1) > 1000:\n",
+ " print \"Maximum permitted input length exceeded.\"\n",
+ "\n",
+ "list_str1 = str1.split(\" \")\n",
+ "\n",
+ "print \"The words in the prose that you entered are: \"\n",
+ "\n",
+ "for i in range(0, len(list_str1)):\n",
+ " print list_str1[i], \"\\t\",\n",
+ " if i % 5 == 0:\n",
+ " print \"\\n\"\n",
+ "\n",
+ "print \"Words found \", len(list_str1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter some prose that is less than 1000 characters (go on typing hit enter to terminate):\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y father's family name being Pirrip, and my Christian name Philip, my infant tongue could make of both names nothing longer or more explicit than Pip. So, I called myself Pip, and came to be called Pip.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The words in the prose that you entered are: \n",
+ "y \t\n",
+ "\n",
+ "father's \tfamily \tname \tbeing \tPirrip, \t\n",
+ "\n",
+ "and \tmy \tChristian \tname \tPhilip, \t\n",
+ "\n",
+ "my \tinfant \ttongue \tcould \tmake \t\n",
+ "\n",
+ "of \tboth \tnames \tnothing \tlonger \t\n",
+ "\n",
+ "or \tmore \texplicit \tthan \tPip. \t\n",
+ "\n",
+ "So, \tI \tcalled \tmyself \tPip, \t\n",
+ "\n",
+ "and \tcame \tto \tbe \tcalled \t\n",
+ "\n",
+ "Pip. \tWords found 37\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.8, page no. 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Testing characters in a string\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "nLetters = 0\n",
+ "nDigits = 0\n",
+ "nPunct = 0\n",
+ "print \"Enter an interesting string of less than 100 characters: \"\n",
+ "str1 = raw_input()\n",
+ "\n",
+ "for char in str1:\n",
+ " if char.isalpha():\n",
+ " nLetters += 1\n",
+ " elif char.isdigit():\n",
+ " nDigits += 1\n",
+ " elif char == \" \":\n",
+ " pass\n",
+ " else:\n",
+ " nPunct += 1\n",
+ "\n",
+ "print \"Your string contained %d letters, %d digits and %d punctuation characters. \" %(nLetters, nDigits, nPunct)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an interesting string of less than 100 characters: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I was born on the 3rd of October 1895, which is long ago.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your string contained 38 letters, 5 digits and 2 punctuation characters. \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.9, page no. 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Finding occurrences of one string in another\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter the string to be searched (less than 100 characters): \",\n",
+ "text = raw_input()\n",
+ " \n",
+ "print \"Enter the string sought (less than 40 characters):\",\n",
+ "substring = raw_input()\n",
+ " \n",
+ "print \"First string entered: \", text\n",
+ "print \"Second string entered: \", substring\n",
+ " \n",
+ "text = text.upper()\n",
+ "substring = substring.upper() \n",
+ "print \"The second string %s found in the first. \" %(\"was not\" if not substring in text else \"was\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the string to be searched (less than 100 characters): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cry havoc, and let slip the dogs of war.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the string sought (less than 40 characters):"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Dogs of War\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " First string entered: Cry havoc, and let slip the dogs of war.\n",
+ "Second string entered: The Dogs of War\n",
+ "The second string was found in the first. \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 6.10, page no. 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Analyzing Text\n",
+ "\"\"\"\n",
+ "\n",
+ "import numpy\n",
+ "\n",
+ "print \"Enter text (hit enter to exit): \",\n",
+ "text = raw_input()\n",
+ "\n",
+ "text_split = text.split()\n",
+ "distinct_words = []\n",
+ "\n",
+ "for i in text_split:\n",
+ " if i not in distinct_words:\n",
+ " distinct_words.append(i)\n",
+ "\n",
+ "word_count = numpy.zeros(len(distinct_words))\n",
+ "\n",
+ "for i in range(len(distinct_words)):\n",
+ " for j in range(len(text_split)):\n",
+ " if distinct_words[i] == text_split[j]:\n",
+ " word_count[i] += 1\n",
+ "\n",
+ "for i in range(len(distinct_words)):\n",
+ " print distinct_words[i], int(word_count[i])\n",
+ " if i == 5:\n",
+ " print \"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter text (hit enter to exit): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When I makes tea I makes tea, as old mother Grogan said. And when I makes water I makes water. Begob, ma'am, says Mrs Cahill, God send you don't make them in the same pot.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " When 1\n",
+ "I 4\n",
+ "makes 4\n",
+ "tea 1\n",
+ "tea, 1\n",
+ "as 1\n",
+ "\n",
+ "old 1\n",
+ "mother 1\n",
+ "Grogan 1\n",
+ "said. 1\n",
+ "And 1\n",
+ "when 1\n",
+ "water 1\n",
+ "water. 1\n",
+ "Begob, 1\n",
+ "ma'am, 1\n",
+ "says 1\n",
+ "Mrs 1\n",
+ "Cahill, 1\n",
+ "God 1\n",
+ "send 1\n",
+ "you 1\n",
+ "don't 1\n",
+ "make 1\n",
+ "them 1\n",
+ "in 1\n",
+ "the 1\n",
+ "same 1\n",
+ "pot. 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter7.ipynb b/Beginning_C_By_Ivon_Horton/chapter7.ipynb
new file mode 100644
index 00000000..7a7e0247
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter7.ipynb
@@ -0,0 +1,902 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Pointers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.1, page no. 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A simple program using pointers\n",
+ "note: there are no pointers in Python.\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "number = 10;\n",
+ "print \"number's address: \", id(number)\n",
+ "print \"number's value: \", number\n",
+ " \n",
+ "pnumber = id(number)\n",
+ "print \"pnumber's address: \", id(pnumber)\n",
+ "print \"pnumber's size: %d bytes\" %(sys.getsizeof(pnumber))\n",
+ "print \"pnumber's value: \", pnumber\n",
+ "print \"value pointed to: \", number"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "number's address: 42843088\n",
+ "number's value: 10\n",
+ "pnumber's address: 54575640\n",
+ "pnumber's size: 24 bytes\n",
+ "pnumber's value: 42843088\n",
+ "value pointed to: 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.2, page no. 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "What's the pointer of it all\n",
+ "\"\"\"\n",
+ "\n",
+ "num1 = 0\n",
+ "num2 = 0\n",
+ "pnum = None\n",
+ " \n",
+ "pnum = id(num1)\n",
+ "num1 = 2\n",
+ "num2 += 1\n",
+ "num2 += num1\n",
+ "pnum = id(num2)\n",
+ "num2 += 1\n",
+ "print \"num1 = %d num2 = %d pnum = %d pnum + num2 = %d\" %(num1, num2, pnum, pnum + num2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "num1 = 2 num2 = 4 pnum = 42843256 pnum + num2 = 42843260\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.3, page no. 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using pointer arguments to scanf_s\n",
+ "note: in Python you cannot use pointers to input a value\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Input an integer: \",\n",
+ "value = int(raw_input())\n",
+ "print \"You entered: \", value"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input an integer: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You entered: 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.4, page no. 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Arrays and pointers\n",
+ "\"\"\"\n",
+ "\n",
+ "multiple = ['M', 'y','s','t', 'r', 'i', 'n', 'g']\n",
+ " \n",
+ "p = id(multiple[0])\n",
+ "print \"The address of the first array element : \", p\n",
+ "p = id(multiple)\n",
+ "print \"The address obtained from the array name: \", p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of the first array element : 140170253709440\n",
+ "The address obtained from the array name: 58009432\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.5, page no. 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Incrementing a pointer to an array\n",
+ "\"\"\"\n",
+ "\n",
+ "multiple = \"a string\"\n",
+ "p = multiple\n",
+ " \n",
+ "for i in range(len(multiple)):\n",
+ " print \"multiple[%d] = %c *(p+%d) = %c id(multiple[%d]) = %d p+%d = %d \" %(i, multiple[i], i, p[i], i, id(multiple[i]), i, id(p[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "multiple[0] = a *(p+0) = a id(multiple[0]) = 140170254071168 p+0 = 140170254071168 \n",
+ "multiple[1] = *(p+1) = id(multiple[1]) = 140170254278248 p+1 = 140170254278248 \n",
+ "multiple[2] = s *(p+2) = s id(multiple[2]) = 140170254071048 p+2 = 140170254071048 \n",
+ "multiple[3] = t *(p+3) = t id(multiple[3]) = 140170254070208 p+3 = 140170254070208 \n",
+ "multiple[4] = r *(p+4) = r id(multiple[4]) = 140170254275768 p+4 = 140170254275768 \n",
+ "multiple[5] = i *(p+5) = i id(multiple[5]) = 140170254277248 p+5 = 140170254277248 \n",
+ "multiple[6] = n *(p+6) = n id(multiple[6]) = 140170254276568 p+6 = 140170254276568 \n",
+ "multiple[7] = g *(p+7) = g id(multiple[7]) = 140170254073528 p+7 = 140170254073528 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.6, page no. 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Incrementing a pointer to an array of integers\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "multiple = [15, 25, 35, 45]\n",
+ "p = multiple\n",
+ " \n",
+ "for i in range(sys.getsizeof(multiple)/sys.getsizeof(multiple[0])):\n",
+ " print \"address p+%d (id(multiple[%d])): %d *(p+%d) value: %d\" %( i, i, id(p[i]), i, p[i])\n",
+ " \n",
+ "print \"Type integer occupies: %d bytes\" %sys.getsizeof(int())"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address p+0 (id(multiple[0])): 42842968 *(p+0) value: 15\n",
+ "address p+1 (id(multiple[1])): 42842728 *(p+1) value: 25\n",
+ "address p+2 (id(multiple[2])): 42842488 *(p+2) value: 35\n",
+ "address p+3 (id(multiple[3])): 42844240 *(p+3) value: 45\n",
+ "Type integer occupies: 24 bytes\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.7, page no. 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Two-dimensional arrays and pointers\n",
+ "\"\"\"\n",
+ "\n",
+ "board = [['1','2','3'],\n",
+ " ['4','5','6'],\n",
+ " ['7','8','9']]\n",
+ "print \"address of board : \", id(board)\n",
+ "print \"address of board[0][0] : \", id(board[0][0])\n",
+ "print \"value of board[0]: \", board[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address of board : 58026608\n",
+ "address of board[0][0] : 140170254070808\n",
+ "value of board[0]: ['1', '2', '3']\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.7A, page no. 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Two-dimensional arrays and pointers\n",
+ "\"\"\"\n",
+ "\n",
+ "board = [['1','2','3'],\n",
+ " ['4','5','6'],\n",
+ " ['7','8','9']]\n",
+ " \n",
+ "print \"value of board[0][0] : %c\" % (board[0][0])\n",
+ "print \"value of board[0]: \", board[0][0]\n",
+ "print \"value of **board: \", board[0][0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of board[0][0] : 1\n",
+ "value of board[0]: 1\n",
+ "value of **board: 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.8, page no. 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Getting values in a two-dimensional array\n",
+ "\"\"\"\n",
+ "\n",
+ "board = [['1','2','3'],\n",
+ " ['4','5','6'],\n",
+ " ['7','8','9']]\n",
+ "\n",
+ "for i in range(3):\n",
+ " for j in range(3):\n",
+ " print \" board: \", board[i][j]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " board: 1\n",
+ " board: 2\n",
+ " board: 3\n",
+ " board: 4\n",
+ " board: 5\n",
+ " board: 6\n",
+ " board: 7\n",
+ " board: 8\n",
+ " board: 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Program 7.9, page no. 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Multidimensional arrays and pointers\n",
+ "\"\"\"\n",
+ "\n",
+ "board = [['1','2','3'],\n",
+ " ['4','5','6'],\n",
+ " ['7','8','9']]\n",
+ "\n",
+ "for i in range(3):\n",
+ " for j in range(3):\n",
+ " print \" board: \", board[i][j]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " board: 1\n",
+ " board: 2\n",
+ " board: 3\n",
+ " board: 4\n",
+ " board: 5\n",
+ " board: 6\n",
+ " board: 7\n",
+ " board: 8\n",
+ " board: 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.10, page no. 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Understand pointers to your hat size - if you dare\n",
+ "\"\"\"\n",
+ "\n",
+ "size = [['6', '6', '6', '6', '7', '7', '7', '7', '7', '7', '7', '7'],\n",
+ " ['1', '5', '3', '7', ' ', '1', '1', '3', '1', '5', '3', '7'],\n",
+ " ['2', '8', '4', '8', ' ', '8', '4', '8', '2', '8', '4', '8']]\n",
+ "headsize = [164, 166, 169, 172, 175, 178, 181, 184, 188, 191, 194, 197]\n",
+ "hat_found = False\n",
+ "print \"Enter the circumference of your head above your eyebrows in inches as a decimal value: \",\n",
+ "cranium = float(raw_input())\n",
+ "your_head = int(8.0*cranium)\n",
+ "i = 0\n",
+ "if(your_head == headsize[i]):\n",
+ " hat_found = True\n",
+ "else:\n",
+ " for i in range(1, len(headsize)):\n",
+ " if(your_head > headsize[i - 1] and your_head <= headsize[i]):\n",
+ " hat_found = True\n",
+ " break\n",
+ "if(hat_found):\n",
+ " print \"Your hat size is %c %c%c%c\" %(size[0][i], size[1][i], ' ' if (size[1][i]==' ') else '/', size[2][i])\n",
+ "else:\n",
+ " if(your_head < headsize[0]):\n",
+ " print \"You are the proverbial pinhead. No hat for you I'm afraid.\"\n",
+ " else:\n",
+ " print \"You, in technical parlance, are a fathead, No hat for you, I'm afraid.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the circumference of your head above your eyebrows in inches as a decimal value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "22.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your hat size is 7 1/4\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.11, page no. 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A dynamic prime example\n",
+ "note: program 7.12 will remain same\n",
+ "\"\"\"\n",
+ "\n",
+ "pPrimes = []\n",
+ "found = False\n",
+ " \n",
+ "print \"How many primes would you like - you'll get at least 4? \",\n",
+ "total = int(raw_input())\n",
+ "total = 4 if total < 4 else total\n",
+ " \n",
+ "pPrimes.append(2) # First prime\n",
+ "pPrimes.append(3) # Second prime\n",
+ "pPrimes.append(5) # Third prime\n",
+ "count = 3\n",
+ "trial = 5\n",
+ " \n",
+ "while(count < total):\n",
+ " trial += 2\n",
+ " for i in range(1, count):\n",
+ " if((trial % pPrimes[i]) == 0):\n",
+ " found = False\n",
+ " break\n",
+ " else:\n",
+ " found = True\n",
+ " if(found):\n",
+ " pPrimes.append(trial)\n",
+ " count += 1\n",
+ "\n",
+ "for i in range(total):\n",
+ " print \"\\t\", pPrimes[i],\n",
+ " if(not((i+1) % 5)):\n",
+ " print \"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many primes would you like - you'll get at least 4? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "25\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \t2 \t3 \t5 \t7 \t11 \n",
+ "\t13 \t17 \t19 \t23 \t29 \n",
+ "\t31 \t37 \t41 \t43 \t47 \n",
+ "\t53 \t59 \t61 \t67 \t71 \n",
+ "\t73 \t79 \t83 \t89 \t97 \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.13, page no. 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Extending dynamically allocated memory for strings\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "print \"Enter text on an arbitrary number of lines (go on typing hit enter to terminate): \"\n",
+ "print \"Should be less than 10000 characters: \"\n",
+ "text = raw_input()\n",
+ "\n",
+ "if len(text) > 10000:\n",
+ " print \"Maximum length exceeded, terminating...\"\n",
+ " sys.exit()\n",
+ "\n",
+ "distinct_words = []\n",
+ "word_occurrance = []\n",
+ "list_text = text.split(\" \")\n",
+ "for word in list_text:\n",
+ " if not word in distinct_words:\n",
+ " distinct_words.append(word)\n",
+ " word_occurrance.append(0)\n",
+ " \n",
+ "for i in range(len(list_text)):\n",
+ " if list_text[i] in distinct_words:\n",
+ " index = distinct_words.index(list_text[i])\n",
+ " word_occurrance[index] += 1\n",
+ "\n",
+ "for i in range(len(distinct_words)):\n",
+ " if(i % 5 == 0):\n",
+ " print \"\\n\"\n",
+ " print distinct_words[i], \"\\t \", word_occurrance[i],"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter text on an arbitrary number of lines (go on typing hit enter to terminate): \n",
+ "Should be less than 10000 characters: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peter Piper picked a peck of pickled pepper. A peck of pickled pepper Peter Piper picked. If Peter Piper picked a peck of pickled pepper, Where's the peck of pickled pepper Peter Piper picked?\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "Peter \t 4 Piper \t 4 picked \t 2 a \t 2 peck \t 4 \n",
+ "\n",
+ "of \t 4 pickled \t 4 pepper. \t 1 A \t 1 pepper \t 2 \n",
+ "\n",
+ "picked. \t 1 If \t 1 pepper, \t 1 Where's \t 1 the \t 1 \n",
+ "\n",
+ "picked? \t 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.14, page no. 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Using array notation with pointers to sort strings\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter strings to be sorted, separated by '.' Press Enter to end: \"\n",
+ "text = raw_input()\n",
+ "\n",
+ "dot_separated = text.split('.')\n",
+ "text_sorted = sorted(dot_separated)\n",
+ "\n",
+ "for str in text_sorted:\n",
+ " print str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter strings to be sorted, separated by '.' Press Enter to end: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Many a mickle makes a muckle. A fool and your money are soon partners. Every dog has his day. Do unto others before they do it to you. A nod is as good as a wink to a blind horse. The bigger they are, the harder they hit. Least said, soonest mended.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " A fool and your money are soon partners\n",
+ " A nod is as good as a wink to a blind horse\n",
+ " Do unto others before they do it to you\n",
+ " Every dog has his day\n",
+ " Least said, soonest mended\n",
+ " The bigger they are, the harder they hit\n",
+ "Many a mickle makes a muckle\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 7.15, page no. 316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "An improved calculator\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"To use this calculator, enter any expression with or without spaces.\"\n",
+ "print \"An expression may include the operators\"\n",
+ "print \" +, -, *, /, %, or **(raise to a power).\"\n",
+ "print \"Use = at the beginning of a line to operate on \"\n",
+ "print \"the result of the previous calculation.\"\n",
+ "print \"Enter quit to stop the calculator.\"\n",
+ "\n",
+ "result = 0\n",
+ "while True:\n",
+ " e = raw_input()\n",
+ " if e == 'quit':\n",
+ " break\n",
+ " else:\n",
+ " try:\n",
+ " result = eval(str(result) + e)\n",
+ " print \"= \",result\n",
+ " except ZeroDivisionError:\n",
+ " print \"Division by zero\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To use this calculator, enter any expression with or without spaces.\n",
+ "An expression may include the operators\n",
+ " +, -, *, /, %, or **(raise to a power).\n",
+ "Use = at the beginning of a line to operate on \n",
+ "the result of the previous calculation.\n",
+ "Enter quit to stop the calculator.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7/8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "/0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Division by zero\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "+3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "/2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "**5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "+8\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 9\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "*2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "= 18\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "quit\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter8.ipynb b/Beginning_C_By_Ivon_Horton/chapter8.ipynb
new file mode 100644
index 00000000..548884d6
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter8.ipynb
@@ -0,0 +1,359 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Structuring Your Programs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 8.1, page no. 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Scoping out scope\n",
+ "\"\"\"\n",
+ "\n",
+ "count1 = 1\n",
+ "\n",
+ "while(count1<=5):\n",
+ " count1 += 1\n",
+ " count2 = 0\n",
+ " count2 += 1\n",
+ " print \"count1 = %d count2 = %d \" %(count1, count2)\n",
+ " \n",
+ "print \"count1 = %d\\n\" %count1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "count1 = 2 count2 = 1 \n",
+ "count1 = 3 count2 = 1 \n",
+ "count1 = 4 count2 = 1 \n",
+ "count1 = 5 count2 = 1 \n",
+ "count1 = 6 count2 = 1 \n",
+ "count1 = 6\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 8.2, page no. 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "More scope in this example\n",
+ "note: the way it is given in textbook is not possible in Python\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "count = 0\n",
+ "while(count<=5):\n",
+ " count += 1\n",
+ " print \"count = \", count\n",
+ " \n",
+ "print \"count = \", count"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "count = 1\n",
+ "count = 2\n",
+ "count = 3\n",
+ "count = 4\n",
+ "count = 5\n",
+ "count = 6\n",
+ "count = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 8.3, page no. 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculating an average using functions\n",
+ "\"\"\"\n",
+ "\n",
+ "def Sum(x, n):\n",
+ " sum = 0.0\n",
+ " for i in range(n):\n",
+ " sum += x[i]\n",
+ " return sum\n",
+ " \n",
+ "def Average(x, n):\n",
+ " return Sum(x, n)/n\n",
+ "\n",
+ "def GetData(data, t):\n",
+ " print \"How many values do you want to enter (Maximum 50)? \"\n",
+ " nValues = int(raw_input())\n",
+ " if(nValues > 50):\n",
+ " print \"Maximum count exceeded. 50 items will be read.\"\n",
+ " nValues = 50\n",
+ " for i in range(nValues):\n",
+ " data.append(float(raw_input()))\n",
+ " return nValues\n",
+ " \n",
+ "samples = []\n",
+ "sampleCount = GetData(samples, 50);\n",
+ "average = Average(samples, sampleCount);\n",
+ "print \"The average of the values you entered is: \", average"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many values do you want to enter (Maximum 50)? \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4.0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5.0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average of the values you entered is: 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 8.4, page no. 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The functional approach to string sorting\n",
+ "\"\"\"\n",
+ "\n",
+ "def sort_string(text):\n",
+ " dot_separated = text.split('.')\n",
+ " text_sorted = sorted(dot_separated)\n",
+ " return text_sorted\n",
+ "\n",
+ "\n",
+ "print \"Enter strings to be sorted, separated by '.' Press Enter to end: \"\n",
+ "text = raw_input()\n",
+ "\n",
+ "sorted_text = sort_string(text)\n",
+ "\n",
+ "for str in sorted_text:\n",
+ " print str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter strings to be sorted, separated by '.' Press Enter to end: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sample strings. These are samples. Another Sample\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Another Sample\n",
+ " These are samples\n",
+ "Sample strings\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 8.5, page no. 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A function to increase your pay\n",
+ "\"\"\"\n",
+ "\n",
+ "def IncomePlus(pPay):\n",
+ " pPay += 10000\n",
+ " return pPay\n",
+ "\n",
+ "your_pay = 30000\n",
+ "pold_pay = your_pay\n",
+ "pnew_pay = IncomePlus(pold_pay)\n",
+ "print \"Old pay = $\", pold_pay\n",
+ "print \"New pay = $\", pnew_pay"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Old pay = $ 30000\n",
+ "New pay = $ 40000\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 8.6, page no. 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A function to increase your pay that doesn't\n",
+ "\"\"\"\n",
+ "\n",
+ "def IncomePlus(pPay):\n",
+ " pPay += 10000\n",
+ " return id(pPay)\n",
+ "\n",
+ "your_pay = 30000\n",
+ "pold_pay = your_pay\n",
+ "pnew_pay = IncomePlus(pold_pay)\n",
+ "print \"Old pay = $\", pold_pay\n",
+ "print \"New pay = $\", pnew_pay"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Old pay = $ 30000\n",
+ "New pay = $ 38417016\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/chapter9.ipynb b/Beginning_C_By_Ivon_Horton/chapter9.ipynb
new file mode 100644
index 00000000..d7adce09
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/chapter9.ipynb
@@ -0,0 +1,826 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 9: More on Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.1, page no. 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Pointing to functions\n",
+ "\"\"\"\n",
+ "\n",
+ "def sum(x, y):\n",
+ " return x + y\n",
+ " \n",
+ "def product(x, y):\n",
+ " return x * y\n",
+ " \n",
+ "def difference(x, y):\n",
+ " return x - y\n",
+ "\n",
+ "a = 10\n",
+ "b = 5\n",
+ "pfun = sum # points to sum() \n",
+ "result = pfun(a, b)\n",
+ "print \"pfun = sum result = \", result\n",
+ "pfun = product # points to product()\n",
+ "result = pfun(a, b)\n",
+ "print \"pfun = product result = \", result\n",
+ "pfun = difference # points to difference()\n",
+ "result = pfun(a, b)\n",
+ "print \"pfun = difference result = \", result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pfun = sum result = 15\n",
+ "pfun = product result = 50\n",
+ "pfun = difference result = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.2, page no. 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Arrays of Pointers to functions\n",
+ "\"\"\"\n",
+ "\n",
+ "def sum(x, y):\n",
+ " return x + y\n",
+ " \n",
+ "def product(x, y):\n",
+ " return x * y\n",
+ " \n",
+ "def difference(x, y):\n",
+ " return x - y\n",
+ "\n",
+ "a = 10\n",
+ "b = 5\n",
+ "result = 0\n",
+ "pfun = []\n",
+ "pfun.append(sum)\n",
+ "pfun.append(product)\n",
+ "pfun.append(difference)\n",
+ "\n",
+ "for i in range(3):\n",
+ " result = pfun[i](a, b)\n",
+ " print \"result = \", result\n",
+ "\n",
+ "result = pfun[1](pfun[0](a, b), pfun[2](a, b))\n",
+ "print \"The product of the sum and the difference = \", result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "result = 15\n",
+ "result = 50\n",
+ "result = 5\n",
+ "The product of the sum and the difference = 75\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.3, page no. 356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Passing a Pointer to a function\n",
+ "\"\"\"\n",
+ "\n",
+ "def sum(x, y):\n",
+ " return x + y\n",
+ " \n",
+ "def product(x, y):\n",
+ " return x * y\n",
+ " \n",
+ "def difference(x, y):\n",
+ " return x - y\n",
+ " \n",
+ "def any_function(pfun , x, y):\n",
+ " return pfun(x, y);\n",
+ "\n",
+ "a = 10\n",
+ "b = 5\n",
+ "pf = sum\n",
+ "result = any_function(pf, a, b)\n",
+ "print \"result = \", result\n",
+ "result = any_function(product, a, b)\n",
+ "print \"result = \", result\n",
+ "print \"result = \", any_function(difference, a, b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "result = 15\n",
+ "result = 50\n",
+ "result = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.4, page no. 359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Static versus automatic variables\n",
+ "note: there is no static in python. Output will be different from book.\n",
+ "\"\"\"\n",
+ "\n",
+ "def test1():\n",
+ " count = 0\n",
+ " count += 1\n",
+ " print \"test1 count = \", count\n",
+ "\n",
+ "def test2():\n",
+ " count = 0\n",
+ " count += 1\n",
+ " print \"test2 count = \", count\n",
+ "\n",
+ "for i in range(5):\n",
+ " test1()\n",
+ " test2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "test1 count = 1\n",
+ "test2 count = 1\n",
+ "test1 count = 1\n",
+ "test2 count = 1\n",
+ "test1 count = 1\n",
+ "test2 count = 1\n",
+ "test1 count = 1\n",
+ "test2 count = 1\n",
+ "test1 count = 1\n",
+ "test2 count = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.5, page no. 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Global variables\n",
+ "note: output will vary from textbook because of static variable\n",
+ "\"\"\"\n",
+ "\n",
+ "count = 0\n",
+ "\n",
+ "def test1():\n",
+ " global count\n",
+ " count += 1\n",
+ " print \"test1 count = \", count\n",
+ "\n",
+ "def test2():\n",
+ " count = 0\n",
+ " count += 1\n",
+ " print \"test2 count = \", count\n",
+ "\n",
+ "for i in range(5):\n",
+ " test1()\n",
+ " test2()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "test1 count = 1\n",
+ "test2 count = 1\n",
+ "test1 count = 2\n",
+ "test2 count = 1\n",
+ "test1 count = 3\n",
+ "test2 count = 1\n",
+ "test1 count = 4\n",
+ "test2 count = 1\n",
+ "test1 count = 5\n",
+ "test2 count = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.6, page no. 364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculating factorials using recursion\n",
+ "\"\"\"\n",
+ "\n",
+ "def factorial(n):\n",
+ " if(n < 2):\n",
+ " return n\n",
+ " return n*factorial(n - 1)\n",
+ " \n",
+ "print \"Enter an integer value: \",\n",
+ "number = int(raw_input())\n",
+ "print \"The factorial of %d is %d \"% (number, factorial(number))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an integer value: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The factorial of 5 is 120 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.7, page no. 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculating an average using variable argument lists\n",
+ "note: output will vary from that given in textbook\n",
+ "\"\"\"\n",
+ "\n",
+ "def average(*arg):\n",
+ " sum = arg[0] + arg[1]\n",
+ " count = 2\n",
+ " for i in arg:\n",
+ " count += 1\n",
+ " sum += i\n",
+ " average = sum/count\n",
+ " return average\n",
+ " \n",
+ "v1 = 10.5\n",
+ "v2 = 2.5\n",
+ "num1 = 6\n",
+ "num2 = 5\n",
+ "num3 = 12\n",
+ "num4 = 20\n",
+ "print \"Average = %.2f \" %(average(v1, 3.5, v2, 4.5, 0.0))\n",
+ "print \"Average = %.2f \" %(average(1.0, 2.0, 0.0))\n",
+ "print \"Average = %.2f \" %(average(num2, v2, num1, num4, num3, 0.0))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average = 5.00 \n",
+ "Average = 1.20 \n",
+ "Average = 6.62 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.8, page no. 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A program to list the command line arguments\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "print \"Program name: \", sys.argv[0]\n",
+ "for i in range(1, len(sys.argv)):\n",
+ " print \"Argument %d: %s \"%(i, sys.argv[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Program name: -c\n",
+ "Argument 1: -f \n",
+ "Argument 2: /tmp/tmpL28uUI/profile_default/security/kernel-d2752270-d981-4bb2-b2bc-3d505dfa3dd5.json \n",
+ "Argument 3: --IPKernelApp.parent_appname='ipython-notebook' \n",
+ "Argument 4: --profile-dir \n",
+ "Argument 5: /tmp/tmpL28uUI/profile_default \n",
+ "Argument 6: --parent=1 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Program 9.9, page no. 377"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "REVERSI An Othello type game\n",
+ "\"\"\"\n",
+ "\n",
+ "SIZE = 6\n",
+ "comp_c = '@'\n",
+ "player_c = '0'\n",
+ "board = [[0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0]]\n",
+ "\n",
+ "moves = [[False, False, False, False, False, False],\n",
+ " [False, False, False, False, False, False],\n",
+ " [False, False, False, False, False, False],\n",
+ " [False, False, False, False, False, False],\n",
+ " [False, False, False, False, False, False],\n",
+ " [False, False, False, False, False, False]]\n",
+ "no_of_moves = 0\n",
+ "invalid_moves = 0\n",
+ "again = 0\n",
+ "next_player = True\n",
+ "\n",
+ "def get_score(board, player):\n",
+ " global comp_c\n",
+ " global player_c\n",
+ " return player_counters(board, player) - player_counters(board, (comp_c if player == player_c else player_c)) \n",
+ " \n",
+ "def player_counters(board,player):\n",
+ " count = 0;\n",
+ " for row in range(SIZE):\n",
+ " for col in range(SIZE):\n",
+ " if(board[row][col] == player):\n",
+ " count += 1\n",
+ " return count;\n",
+ "\n",
+ "def computer_move(board,moves, player):\n",
+ " best_row = 0;\n",
+ " best_col = 0;\n",
+ " new_score = 0;\n",
+ " score = SIZE*SIZE;\n",
+ " temp_board = []\n",
+ " temp_moves = []\n",
+ " for i in range(SIZE):\n",
+ " a = []\n",
+ " b = []\n",
+ " for j in range(SIZE):\n",
+ " a.append(0)\n",
+ " b.append(False)\n",
+ " temp_board.append(a)\n",
+ " temp_moves.append(b) \n",
+ " opponent = comp_c if (player == player_c) else player_c\n",
+ " for row in range(SIZE):\n",
+ " for col in range(SIZE):\n",
+ " if(not moves[row][col]):\n",
+ " continue;\n",
+ " temp_board = board\n",
+ " make_move(temp_board, row, col, player);\n",
+ " valid_moves(temp_board, temp_moves, opponent);\n",
+ " new_score = best_move(temp_board, temp_moves, opponent);\n",
+ " if(new_score < score):\n",
+ " score = new_score;\n",
+ " best_row = row;\n",
+ " best_col = col;\n",
+ " make_move(board, best_row, best_col, player);\n",
+ "\n",
+ " \n",
+ "def best_move(board, moves, player):\n",
+ " new_board = []\n",
+ " for i in range(SIZE):\n",
+ " a = []\n",
+ " for j in range(SIZE):\n",
+ " a.append(0)\n",
+ " new_board.append(a)\n",
+ " score = 0;\n",
+ " new_score = 0;\n",
+ "\n",
+ " for row in range(SIZE):\n",
+ " for col in range(SIZE):\n",
+ " if(not moves[row][col]):\n",
+ " continue;\n",
+ " new_board = board\n",
+ " make_move(new_board, row, col, player);\n",
+ " new_score = get_score(new_board, player);\n",
+ " if(score < new_score):\n",
+ " score = new_score;\n",
+ " return score;\n",
+ "\n",
+ "\n",
+ "def make_move(board,row,col,player):\n",
+ " rowdelta = 0;\n",
+ " coldelta = 0;\n",
+ " x = 0;\n",
+ " y = 0;\n",
+ " if player == player_c:\n",
+ " opponent = comp_c\n",
+ " else:\n",
+ " opponent = player_c \n",
+ " \n",
+ " board[row][col] = player\n",
+ " for rowdelta in range(-1,2):\n",
+ " for coldelta in range(-1,2):\n",
+ " if((row == 0 and rowdelta == -1) or row + rowdelta >= SIZE or(col == 0 and coldelta == -1) or col + coldelta >= SIZE or\n",
+ "(rowdelta == 0 and coldelta == 0)):\n",
+ " continue;\n",
+ "\n",
+ " if(board[row + rowdelta][col + coldelta] == opponent):\n",
+ " x = row + rowdelta;\n",
+ " y = col + coldelta;\n",
+ " \n",
+ " while True:\n",
+ " x += rowdelta;\n",
+ " y += coldelta;\n",
+ " if(x >= SIZE or y >= SIZE or board[x][y] == ' '):\n",
+ " break;\n",
+ " if(board[x][y] == player):\n",
+ " x -= rowdelta\n",
+ " y -= coldelta\n",
+ " while(board[x][y] == opponent):\n",
+ " board[x][y] = player;\n",
+ " x -= rowdelta\n",
+ " y -= coldelta\n",
+ " \n",
+ " break;\n",
+ "\n",
+ "def reset_board(board):\n",
+ " global SIZE\n",
+ " global player_c\n",
+ " global comp_c\n",
+ " for row in range(SIZE):\n",
+ " for col in range(SIZE):\n",
+ " board[row][col] = ' '\n",
+ " \n",
+ " mid = SIZE/2\n",
+ " board[mid][mid] = player_c\n",
+ " board[mid-1][mid-1] = board[mid][mid]\n",
+ " board[mid][mid - 1] = comp_c\n",
+ " board[mid-1][mid] = board[mid][mid - 1]\n",
+ "\n",
+ "def display(board):\n",
+ " col_label = 'a'\n",
+ " print \"\"\n",
+ " for col in range(SIZE):\n",
+ " print \"%c\" %((chr(ord(col_label) + col))),\n",
+ " print \"\"\n",
+ " for row in range(SIZE):\n",
+ " print \" +\",\n",
+ " for col in range(SIZE):\n",
+ " print \"---+\",\n",
+ " print \"\\n%2d|\" %(row + 1)\n",
+ " \n",
+ " for col in range(SIZE):\n",
+ " print \" %c |\" %(board[row][col]),\n",
+ " print \"\"\n",
+ " print \" +\"\n",
+ " for col in range(SIZE):\n",
+ " print \"---+\",\n",
+ " print \"\"\n",
+ "\n",
+ "def valid_moves(board, moves, player):\n",
+ " global SIZE\n",
+ " global player_c\n",
+ " global comp_c\n",
+ " rowdelta = 0\n",
+ " coldelta = 0\n",
+ " x = 0\n",
+ " y = 0\n",
+ " global no_of_moves\n",
+ " opponent = comp_c if (player == player_c) else player_c\n",
+ " for row in range(SIZE):\n",
+ " for col in range(SIZE):\n",
+ " moves[row][col] = False\n",
+ " for row in range(SIZE):\n",
+ " for col in range(SIZE):\n",
+ " if(board[row][col] != ' '):\n",
+ " continue\n",
+ " for rowdelta in range(-1, rowdelta+1):\n",
+ " for coldelta in range(-1, coldelta+1):\n",
+ " if((row == 0 and rowdelta == -1) or row + rowdelta >= SIZE or (col == 0 and coldelta == -1) or col + coldelta >= SIZE or (rowdelta == 0 and coldelta == 0)):\n",
+ " continue\n",
+ " if(board[row + rowdelta][col + coldelta] == opponent):\n",
+ " x = row + rowdelta\n",
+ " y = col + coldelta \n",
+ " while(True):\n",
+ " x += rowdelta\n",
+ " y += coldelta\n",
+ " if(x < 0 or x >= SIZE or y < 0 or y >= SIZE or board[x][y] == ' '):\n",
+ " break\n",
+ " if(board[x][y] == player):\n",
+ " moves[row][col] = True\n",
+ " no_of_moves += 1\n",
+ " break\n",
+ " return no_of_moves\n",
+ "\n",
+ " \n",
+ "print \"REVERSI\"\n",
+ "print \"You can go first on the first game, then we will take turns.\"\n",
+ "print \"You will be white - (%c)\\nI will be black - (%c). \" %(player_c, comp_c)\n",
+ "print \"Select a square for your move by typing a digit for the row and a letter for the column with no spaces between.\"\n",
+ "print \"Good luck! Press Enter to start.\"\n",
+ "raw_input()\n",
+ "while(True):\n",
+ " reset_board(board)\n",
+ " next_player = not(next_player)\n",
+ " no_of_moves = 4\n",
+ " while(True):\n",
+ " display(board)\n",
+ " next_player = not next_player\n",
+ " if(True == next_player):\n",
+ " if(valid_moves(board, moves, player_c)):\n",
+ " while(True):\n",
+ " print \"Please enter your move (row column - no space): \",\n",
+ " x = int(raw_input(\"row: \"))\n",
+ " y = raw_input(\"col: \")\n",
+ " y = ord(chr(ord(y.lower()) - ord('a')))\n",
+ " x -= 1\n",
+ " if(y < 0 or y >= SIZE or x >= SIZE or (not moves[x][y])):\n",
+ " print \"Not a valid move, try again.\\n\"\n",
+ " continue\n",
+ " make_move(board, x, y, player_c)\n",
+ " no_of_moves += 1\n",
+ " break\n",
+ " else:\n",
+ " invalid_moves += 1\n",
+ " if(invalid_moves < 2):\n",
+ " print \"You have to pass, press return\",\n",
+ " again = raw_input()\n",
+ " else:\n",
+ " print \"\\nNeither of us can go, so the game is over. \"\n",
+ " else:\n",
+ " if(valid_moves(board, moves, comp_c)):\n",
+ " invalid_moves = 0\n",
+ " computer_move(board, moves, comp_c)\n",
+ " no_of_moves += 1\n",
+ " else:\n",
+ " invalid_moves += 1\n",
+ " if(invalid_moves < 2):\n",
+ " print \"I have to pass, your go \"\n",
+ " else:\n",
+ " print \"Neither of us can go, so the game is over.\",\n",
+ " display(board)\n",
+ " print \"The final score is: \"\n",
+ " print \"Computer %d User %d \" %(player_counters(board, comp_c), player_counters(board, player_c))\n",
+ "\n",
+ " print \"Do you want to play again (y/n): \", \n",
+ " again = raw_input()\n",
+ " if again == 'y':\n",
+ " continue;\n",
+ " else:\n",
+ " break \n",
+ " if (no_of_moves < SIZE*SIZE and invalid_moves < 2):\n",
+ " continue\n",
+ " else:\n",
+ " break\n",
+ " if again == 'n':\n",
+ " break\n",
+ "print \"\\nGoodbye\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "REVERSI\n",
+ "You can go first on the first game, then we will take turns.\n",
+ "You will be white - (0)\n",
+ "I will be black - (@). \n",
+ "Select a square for your move by typing a digit for the row and a letter for the column with no spaces between.\n",
+ "Good luck! Press Enter to start.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "a b c d e f \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 1|\n",
+ " | | | | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 2|\n",
+ " | | | | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 3|\n",
+ " | | 0 | @ | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 4|\n",
+ " | | @ | 0 | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 5|\n",
+ " | | | | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 6|\n",
+ " | | | | | | \n",
+ " +\n",
+ "---+ ---+ ---+ ---+ ---+ ---+ \n",
+ "Please enter your move (row column - no space): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "row: 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "col: e\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "a b c d e f \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 1|\n",
+ " | | | | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 2|\n",
+ " | | | | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 3|\n",
+ " | | 0 | 0 | 0 | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 4|\n",
+ " | | @ | 0 | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 5|\n",
+ " | | | | | | \n",
+ " + ---+ ---+ ---+ ---+ ---+ ---+ \n",
+ " 6|\n",
+ " | | | | | | \n",
+ " +\n",
+ "---+ ---+ ---+ ---+ ---+ ---+ \n",
+ "The final score is: \n",
+ "Computer 1 User 4 \n",
+ "Do you want to play again (y/n): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "Goodbye\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C_By_Ivon_Horton/screenshots/vaibbhav_vajani-3.png b/Beginning_C_By_Ivon_Horton/screenshots/vaibbhav_vajani-3.png
new file mode 100644
index 00000000..159a6249
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/screenshots/vaibbhav_vajani-3.png
Binary files differ
diff --git a/Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-1.png b/Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-1.png
new file mode 100644
index 00000000..feae82e5
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-1.png
Binary files differ
diff --git a/Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-2.png b/Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-2.png
new file mode 100644
index 00000000..47969341
--- /dev/null
+++ b/Beginning_C_By_Ivon_Horton/screenshots/vaibhav_vajani-2.png
Binary files differ
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/README.txt b/C++_Demystified:_A_Self-Teaching_Guide/README.txt
new file mode 100644
index 00000000..c9358953
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Vaibhav Shah
+Course: others
+College/Institute/Organization: Indian Institute of Engineering Bombay
+Department/Designation: System Administrator
+Book Title: C++ Demystified: A Self-Teaching Guide
+Author: Jeff Kent
+Publisher: McGraw-Hill
+Year of publication: 2004
+Isbn: 0-07-225370-3
+Edition: 1st \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter1.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter1.ipynb
new file mode 100644
index 00000000..b19bede4
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter1.ipynb
@@ -0,0 +1,53 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - How a C++ Program Works"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.1, page no. 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Simple Hello World !\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Hello World!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter10.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter10.ipynb
new file mode 100644
index 00000000..dd6f3a0f
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter10.ipynb
@@ -0,0 +1,1295 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 - Arrays"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.1, page no. 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "defining an array\n",
+ "note: no need to specify size of an array in python, it exapands automatically.\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = [] #array defined"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.2, page no. 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "variable as size of array\n",
+ "note: this won't give an error as mentioned in book as it will take numTests as\n",
+ "an element of array instead of size of array, as there is no need of size of \n",
+ "array in python.\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter the number of test scores:\",\n",
+ "numTests = int(raw_input())\n",
+ "testScore = [numTests]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of test scores:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "67\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.3, page no. 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "variable as size of array\n",
+ "note: numTests will be taken as an element of array instead of size.\n",
+ "Also, there in no constant in Python, this program will be same as previous one\n",
+ "\"\"\"\n",
+ "\n",
+ "numTests = 3\n",
+ "print \"Enter the number of test scores:\",\n",
+ "numTests = int(raw_input())\n",
+ "testScore = [numTests]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of test scores:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "67\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.4, page no. 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "variable as size of array\n",
+ "note: numTests will be taken as an element of array instead of size.\n",
+ "Also, there in no constant in Python, this program will be same as previous one\n",
+ "\"\"\"\n",
+ "\n",
+ "numTests = 3\n",
+ "print \"Enter the number of test scores:\",\n",
+ "num = int(raw_input())\n",
+ "numTests = num\n",
+ "testScore = [numTests]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of test scores:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.5, page no. 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "intializing character array\n",
+ "note: '\\0' will have different result in python than in c++ \n",
+ "\"\"\"\n",
+ "\n",
+ "name = ['J', 'e', 'f', 'f', '\\0']\n",
+ "print name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "['J', 'e', 'f', 'f', '\\x00']\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.5, page no. 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "intializing character array\n",
+ "note: output will be different than that in book.\n",
+ "\"\"\"\n",
+ "\n",
+ "name = ['J', 'e', 'f', 'f']\n",
+ "print name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "['J', 'e', 'f', 'f']\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.7, page no. 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "assigning & displaying array values\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = []\n",
+ "print \"Enter test score #1: \",\n",
+ "testScore.append(int(raw_input()))\n",
+ "print \"Enter test score #2: \",\n",
+ "testScore.append(int(raw_input()))\n",
+ "print \"Enter test score #3: \",\n",
+ "testScore.append(int(raw_input()))\n",
+ "print \"Test score #1: \", testScore[0]\n",
+ "print \"Test score #2: \", testScore[1]\n",
+ "print \"Test score #3: \", testScore[2]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score #1: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "78\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score #2: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score #3: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score #1: 78\n",
+ "Test score #2: 88\n",
+ "Test score #3: 65\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.8, page no. 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using 3 separate variables instead of array in previous example\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "print \"Enter test score #1: \",\n",
+ "testScore1 = int(raw_input())\n",
+ "print \"Enter test score #2: \",\n",
+ "testScore2 = int(raw_input())\n",
+ "print \"Enter test score #3: \",\n",
+ "testScore3 = int(raw_input())\n",
+ "print \"Test score #1: \", testScore1\n",
+ "print \"Test score #2: \", testScore2\n",
+ "print \"Test score #3: \", testScore3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score #1: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score #2: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "67\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score #3: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "88\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score #1: 65\n",
+ "Test score #2: 67\n",
+ "Test score #3: 88\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.9, page no. 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "looping for array\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = []\n",
+ "for i in range(3):\n",
+ " print \"Enter testScore #\", i+1, \": \",\n",
+ " testScore.append(int(raw_input()))\n",
+ "\n",
+ "for i in range(3):\n",
+ " print \"Test Score #\", i+1, \": \", testScore[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter testScore # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test Score # 1 : 3\n",
+ "Test Score # 2 : 4\n",
+ "Test Score # 3 : 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.10, page no. 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using constant for range of array\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = []\n",
+ "for i in range(MAX):\n",
+ " print \"Enter testScore #\", i+1, \": \",\n",
+ " testScore.append(int(raw_input()))\n",
+ "\n",
+ "for i in range(MAX):\n",
+ " print \"Test Score #\", i+1, \": \", testScore[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter testScore # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test Score # 1 : 5\n",
+ "Test Score # 2 : 6\n",
+ "Test Score # 3 : 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.11, page no. 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Common programming mistake for array\n",
+ "note: the problem mentioned in the textbook won't occur in python as we are not\n",
+ "specifying size of an array.\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = []\n",
+ "for i in range(MAX+1):\n",
+ " print \"Enter testScore #\", i+1, \": \",\n",
+ " testScore.append(int(raw_input()))\n",
+ "\n",
+ "for i in range(MAX+1):\n",
+ " print \"Test Score #\", i+1, \": \", testScore[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter testScore # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter testScore # 4 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test Score # 1 : 4\n",
+ "Test Score # 2 : 5\n",
+ "Test Score # 3 : 6\n",
+ "Test Score # 4 : 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.12, page no. 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "input element by index in array\n",
+ "note: if the array is not initialized then this method won't work. append() may\n",
+ "be used instead.\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "grades = [0,0,0]\n",
+ "\n",
+ "for i in range(MAX):\n",
+ " print \"Enter Garde #\", i+1, \": \",\n",
+ " grades[i] = int(raw_input())"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Garde # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Garde # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Garde # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.13, page no. 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "character array\n",
+ "\"\"\"\n",
+ "\n",
+ "name = ['J','e','f','f']\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Your name is: \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is: Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.14, page no. 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "cout Object with Numeric Arrays\n",
+ "note: here the list itself will be printed instead of base address(as mentioned\n",
+ "in textbook).\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "testScore = []\n",
+ "\n",
+ "for i in range(MAX):\n",
+ " print \"Enter test score #\", i + 1, \": \",\n",
+ " testScore.append(int(raw_input()))\n",
+ "print \"The test scores are: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The test scores are: [4, 5, 6]\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.15, page no. 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "cin with numeric array\n",
+ "note: there won't be any error in python as it is with the case of c++. It will\n",
+ "just take testScore as a normal variable.\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = []\n",
+ "testScore = raw_input()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "45\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.16, page no. 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "cin with character array\n",
+ "note: it will simply override the array and assign whatever value you enter to\n",
+ "the name variable unlike c++(as mentioned in c++)\n",
+ "\"\"\"\n",
+ "\n",
+ "name = ['J','e','f','f']\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Your name is: \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is: Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.17, page no. 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "name as string\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Your name is: \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is: Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.18, page no. 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "getline()\n",
+ "note: there is no getline() in python.\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Your name is: \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is: Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.19, page no. 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "passing array as function argument\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = []\n",
+ "for i in range(MAX):\n",
+ " print \"Enter test score #\", i + 1, \": \",\n",
+ " testScore.append(int(raw_input()))\n",
+ "\n",
+ "for i in range(MAX):\n",
+ " print \"Test score #\", i + 1, \": \", testScore[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score # 1 : 4\n",
+ "Test score # 2 : 5\n",
+ "Test score # 3 : 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.20, page no. 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "MAX = 3\n",
+ "\n",
+ "def assignValues(tests, num):\n",
+ " for i in range(num):\n",
+ " print \"Enter test score #\", i + 1, \": \",\n",
+ " tests.append(int(raw_input()))\n",
+ "\n",
+ "def displayValues(scores, elems):\n",
+ " for i in range(elems):\n",
+ " print \"Test score #\", i + 1, \": \", scores[i]\n",
+ "\n",
+ "\n",
+ "testScore = []\n",
+ "assignValues(testScore, MAX)\n",
+ "displayValues(testScore, MAX)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score # 1 : 5\n",
+ "Test score # 2 : 6\n",
+ "Test score # 3 : 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter11.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter11.ipynb
new file mode 100644
index 00000000..f1d28b76
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter11.ipynb
@@ -0,0 +1,1120 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 - What\u2019s the Address? Pointers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.1, page no. 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "size of pointers\n",
+ "note: there is no concept of pointers in python\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "iPtr = 0\n",
+ "fPtr = 0.0\n",
+ "cPtr = 'c'\n",
+ "\n",
+ "print sys.getsizeof(iPtr)\n",
+ "print sys.getsizeof(fPtr)\n",
+ "print sys.getsizeof(cPtr)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n",
+ "24\n",
+ "38\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.2, page no. 233 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "attempt to print the value of pointer.\n",
+ "note: there is no pointer in python, we will simply print out an integer value instead\n",
+ "\"\"\"\n",
+ "\n",
+ "iPtr = 0\n",
+ "print \"The value of iPtr is\", iPtr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of iPtr is 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.3, page no. 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Null pointers\n",
+ "\"\"\"\n",
+ "\n",
+ "iPtr = None\n",
+ "print \"The value of iPtr is \", iPtr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of iPtr is None\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.4, page no. 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "address of pointers\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 5\n",
+ "iPtr = id(num)\n",
+ "print \"The address of x using id() is \", id(num)\n",
+ "print \"The address of x using iPtr is \", iPtr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of x using id() is 42658888\n",
+ "The address of x using iPtr is 42658888\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.5, page no. 236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "dereferencing\n",
+ "output will deffer from that given in textbook\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 5\n",
+ "iPtr = id(num)\n",
+ "print \"The value of num is \", num\n",
+ "num = 10\n",
+ "print \"The value of num after num = 10 is \", num\n",
+ "iPtr = 15\n",
+ "print \"The value of num after iPtr = 15 is \", num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of num is 5\n",
+ "The value of num after num = 10 is 10\n",
+ "The value of num after iPtr = 15 is 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.6, page no. 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Pointer as a Variable\n",
+ "note: output may differ from that given in textbook\n",
+ "\"\"\"\n",
+ "\n",
+ "num1 = 5\n",
+ "num2 = 14\n",
+ "iPtr = id(num1)\n",
+ "print \"The value of num1 is \", num1\n",
+ "iPtr = 2\n",
+ "print \"The value of num1 after iPtr = 2 is \", iPtr\n",
+ "iPtr = id(num2)\n",
+ "print \"The value of num2 is \", num2\n",
+ "iPtr /= 2\n",
+ "print \"The value of num after iPtr /= 2 is \", iPtr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of num1 is 5\n",
+ "The value of num1 after iPtr = 2 is 2\n",
+ "The value of num2 is 14\n",
+ "The value of num after iPtr /= 2 is 21329336\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "exmple 11.7, page no. 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "array name as a constant pointer\n",
+ "note: we cannot use * operator to point in python as there are no pointers\n",
+ "python\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = [4, 7, 1]\n",
+ "print \"The address of the array using testScore is \", testScore\n",
+ "print \"The address of the first element of the array using &testScore[0] is \", id(testScore[0])\n",
+ "print \"The value of the first element of the array using *testScore is \", testScore[0]\n",
+ "print \"The value of the first element of the array using testScore[0] is \", testScore[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of the array using testScore is [4, 7, 1]\n",
+ "The address of the first element of the array using &testScore[0] is 42658912\n",
+ "The value of the first element of the array using *testScore is 4\n",
+ "The value of the first element of the array using testScore[0] is 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.8, page no. 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Pointer Arithmetic\n",
+ "the adress values will be different\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = [4, 7, 1]\n",
+ "for i in range(MAX):\n",
+ " print \"The address of index \", i, \" of the array is \", id(testScore[i])\n",
+ " print \"The value at index \", i, \" of the array is \", testScore[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of index 0 of the array is 42658912\n",
+ "The value at index 0 of the array is 4\n",
+ "The address of index 1 of the array is 42658840\n",
+ "The value at index 1 of the array is 7\n",
+ "The address of index 2 of the array is 42658984\n",
+ "The value at index 2 of the array is 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.9, page no. 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "previous program modified with a pointer to point to array\n",
+ "the adress values will be different\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = [4, 7, 1]\n",
+ "iPtr = testScore\n",
+ "for i in range(MAX):\n",
+ " print \"The address of index \", i, \" of the array is \", id(iPtr[i])\n",
+ " print \"The value at index \", i, \" of the array is \", iPtr[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of index 0 of the array is 42658912\n",
+ "The value at index 0 of the array is 4\n",
+ "The address of index 1 of the array is 42658840\n",
+ "The value at index 1 of the array is 7\n",
+ "The address of index 2 of the array is 42658984\n",
+ "The value at index 2 of the array is 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.10, page no. 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Incrementing a Pointer\n",
+ "the method given in textbook is not possible in python.\n",
+ "We will do it in different way\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = [4, 7, 1]\n",
+ "iPtr = testScore\n",
+ "for i in range(MAX):\n",
+ " print \"The address of index \", i, \" of the array is \", id(iPtr[i])\n",
+ " print \"The value at index \", i, \" of the array is \", iPtr[i]\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of index 0 of the array is 42658912\n",
+ "The value at index 0 of the array is 4\n",
+ "The address of index 1 of the array is 42658840\n",
+ "The value at index 1 of the array is 7\n",
+ "The address of index 2 of the array is 42658984\n",
+ "The value at index 2 of the array is 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.11, page no. 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "comparing address\n",
+ "\"\"\"\n",
+ "import sys\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = [4, 7, 1]\n",
+ "iPtr = testScore\n",
+ "i = 0\n",
+ "while (id(iPtr[MAX-1]) <= id(testScore[MAX-1])):\n",
+ " try:\n",
+ " print \"The address of index \", i, \" of the array is \", id(iPtr[i])\n",
+ " print \"The value at index \", i, \" of the array is \", iPtr[i]\n",
+ " i += 1\n",
+ " except IndexError:\n",
+ " print \"\\n\\nEnd of program\"\n",
+ " sys.exit()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of index 0 of the array is 42658912\n",
+ "The value at index 0 of the array is 4\n",
+ "The address of index 1 of the array is 42658840\n",
+ "The value at index 1 of the array is 7\n",
+ "The address of index 2 of the array is 42658984\n",
+ "The value at index 2 of the array is 1\n",
+ "The address of index 3 of the array is \n",
+ "\n",
+ "End of program\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.12, page no. 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "decrementing pointers\n",
+ "Note: not possible in python. Impletement in a different way\n",
+ "\"\"\"\n",
+ "import sys\n",
+ "MAX = 3\n",
+ "\n",
+ "testScore = [4, 7, 1]\n",
+ "iPtr = id(testScore[MAX-1])\n",
+ "i = MAX - 1\n",
+ "while (iPtr >= id(testScore[0])):\n",
+ " print \"The address of index \", i, \" of the array is \", iPtr\n",
+ " print \"The value at index \", i, \" of the array is \", testScore[i]\n",
+ " i -= 1\n",
+ " if i < 0:\n",
+ " break"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of index 2 of the array is 42658984\n",
+ "The value at index 2 of the array is 1\n",
+ "The address of index 1 of the array is 42658984\n",
+ "The value at index 1 of the array is 7\n",
+ "The address of index 0 of the array is 42658984\n",
+ "The value at index 0 of the array is 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.13, page no. 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "pointer as function\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "def assignValues(tests, num):\n",
+ " for i in range(num):\n",
+ " print \"Enter test score #\", i + 1, \": \",\n",
+ " tests.append(int(raw_input()))\n",
+ "\n",
+ "def displayValues(scores, elems):\n",
+ " for i in range(elems):\n",
+ " print \"Test score #\", i + 1, \": \", scores[i]\n",
+ "\n",
+ "testScore = []\n",
+ "assignValues(testScore, MAX)\n",
+ "displayValues(testScore, MAX)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score # 1 : 4\n",
+ "Test score # 2 : 5\n",
+ "Test score # 3 : 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.14, page no. 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "pointer as function\n",
+ "the program remains same in python\n",
+ "\"\"\"\n",
+ "\n",
+ "MAX = 3\n",
+ "\n",
+ "def assignValues(tests, num):\n",
+ " for i in range(num):\n",
+ " print \"Enter test score #\", i + 1, \": \",\n",
+ " tests.append(int(raw_input()))\n",
+ "\n",
+ "def displayValues(scores, elems):\n",
+ " for i in range(elems):\n",
+ " print \"Test score #\", i + 1, \": \", scores[i]\n",
+ "\n",
+ "testScore = []\n",
+ "assignValues(testScore, MAX)\n",
+ "displayValues(testScore, MAX)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter test score # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score # 1 : 3\n",
+ "Test score # 2 : 4\n",
+ "Test score # 3 : 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.15, page no. 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Passing a Single Variable Using Pointer Notation\n",
+ "\"\"\"\n",
+ "\n",
+ "def doubleIt(x):\n",
+ " print \"The number to be doubled is \", x\n",
+ " x *= 2\n",
+ " print \"The number doubled in doubleIt is \", x\n",
+ "\n",
+ "\n",
+ "print \"Enter number: \",\n",
+ "num = int(raw_input())\n",
+ "doubleIt(num)\n",
+ "print \"The number doubled in main is \", num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number to be doubled is 4\n",
+ "The number doubled in doubleIt is 8\n",
+ "The number doubled in main is 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.16, page no. 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "modify previous program so it passes the variable to be doubled by address instead of by\n",
+ "reference\n",
+ "\n",
+ "note: in python it will remain same\n",
+ "\"\"\"\n",
+ "\n",
+ "def doubleIt(x):\n",
+ " print \"The number to be doubled is \", x\n",
+ " x *= 2\n",
+ " print \"The number doubled in doubleIt is \", x\n",
+ "\n",
+ "\n",
+ "print \"Enter number: \",\n",
+ "num = int(raw_input())\n",
+ "doubleIt(num)\n",
+ "print \"The number doubled in main is \", num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number to be doubled is 4\n",
+ "The number doubled in doubleIt is 8\n",
+ "The number doubled in main is 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.17, page no. 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Dynamic Memory Allocation\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter the number of test scores: \",\n",
+ "numTests = int(raw_input())\n",
+ "iPtr = []\n",
+ "for i in range(numTests):\n",
+ " print \"Enter test score #\", i + 1,\": \",\n",
+ " iPtr.append(int(raw_input()))\n",
+ "\n",
+ "for i in range(numTests):\n",
+ " print \"Test score #\", i + 1, \" is \", iPtr[i]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of test scores: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 1 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 2 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter test score # 3 : "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Test score # 1 is 5\n",
+ "Test score # 2 is 6\n",
+ "Test score # 3 is 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.18, page no. 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Returning Pointers from Functions\n",
+ "\"\"\"\n",
+ "\n",
+ "str = \"Jeff Kent\"\n",
+ "print str"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff Kent\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.19, page no. 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Returning a Pointer to a Local Variable\n",
+ "\"\"\"\n",
+ "\n",
+ "def setName():\n",
+ " print \"Enter your name: \",\n",
+ " name = raw_input()\n",
+ " return name\n",
+ "\n",
+ "str = setName()\n",
+ "print str\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.20, page no. 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Returning a Pointer to a Static Local Variable\n",
+ "\"\"\"\n",
+ "\n",
+ "def setName():\n",
+ " print \"Enter your name: \",\n",
+ " name = raw_input()\n",
+ " return name\n",
+ "\n",
+ "str = setName()\n",
+ "print str\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.21, page no. 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Returning a Pointer to a Dynamically Created Variable\n",
+ "\"\"\"\n",
+ "\n",
+ "def setName():\n",
+ " print \"Enter your name: \",\n",
+ " name = raw_input()\n",
+ " return name\n",
+ "\n",
+ "str = setName()\n",
+ "print str\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter12.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter12.ipynb
new file mode 100644
index 00000000..20f1ab81
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter12.ipynb
@@ -0,0 +1,610 @@
+{
+ "metadata": {
+ "name": "chapter12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 - Character, C-String, and C++ String Class\n",
+ "Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.1, page no. 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The \"Press Any Key to Continue\" Problem\n",
+ "\"\"\"\n",
+ "\n",
+ "ch = 'a'\n",
+ "\n",
+ "while(ch != 'Q' and ch != 'q'):\n",
+ " print \"Press Q or q to quit, any other key to continue: \",\n",
+ " ch = raw_input()\n",
+ " if(ch != 'Q' and ch != 'q'):\n",
+ " print \"You want to continue? \"\n",
+ " else:\n",
+ " print \"You quit\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You want to continue? \n",
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You quit\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.2, page no. 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "cin.get function example.\n",
+ "we will use raw_input\n",
+ "\"\"\"\n",
+ "\n",
+ "ch = 'a'\n",
+ "\n",
+ "while(ch != 'Q' and ch != 'q'):\n",
+ " print \"Press Q or q to quit, any other key to continue: \",\n",
+ " ch = raw_input()\n",
+ " if(ch != 'Q' and ch != 'q'):\n",
+ " print \"You want to continue? \"\n",
+ " else:\n",
+ " print \"You quit\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You want to continue? \n",
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You quit\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.3, page no. 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "cin.ignore function.\n",
+ "note: no such function in Python, using normal raw_input\n",
+ "\"\"\"\n",
+ "\n",
+ "ch = 'a'\n",
+ "\n",
+ "while(ch != 'Q' and ch != 'q'):\n",
+ " print \"Press Q or q to quit, any other key to continue: \",\n",
+ " ch = raw_input()\n",
+ " if(ch != 'Q' and ch != 'q'):\n",
+ " print \"You want to continue? \"\n",
+ " else:\n",
+ " print \"You quit\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You quit\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.4, page no. 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "ignoring \\n character\n",
+ "we will do it normally in Python as \\n is alread ignored.\n",
+ "\"\"\"\n",
+ "\n",
+ "ch = 'a'\n",
+ "\n",
+ "while(ch != 'Q' and ch != 'q'):\n",
+ " print \"Press Q or q to quit, any other key to continue: \",\n",
+ " ch = raw_input()\n",
+ " if(ch != 'Q' and ch != 'q'):\n",
+ " print \"You want to continue? \"\n",
+ " else:\n",
+ " print \"You quit\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You want to continue? \n",
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You quit\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.5, page no. 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Combining Use of cin, cin.get, and cin.getline\n",
+ "note: result differ from textbook\n",
+ "\"\"\"\n",
+ "\n",
+ "name = []\n",
+ "print \"Enter course number: \",\n",
+ "courseNum = int(raw_input())\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Course number is: \", courseNum\n",
+ "print \"Your name is: \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter course number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "321\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Course number is: 321\n",
+ "Your name is: Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.6, page no. 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "cin.get, cin.getline contd.\n",
+ "\"\"\"\n",
+ "\n",
+ "name = []\n",
+ "print \"Enter course number: \",\n",
+ "courseNum = int(raw_input())\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Course number is: \", courseNum\n",
+ "print \"Your name is: \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter course number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "222\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Course number is: 222\n",
+ "Your name is: Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.7, page no. 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Useful Character Functions\n",
+ "toupper\n",
+ "\"\"\"\n",
+ "\n",
+ "ch = 'a'\n",
+ "while(ch != 'Q'):\n",
+ " print \"Press Q or q to quit, any other key to continue: \",\n",
+ " ch = raw_input()\n",
+ " ch = ch.upper()\n",
+ " if(ch != 'Q'):\n",
+ " print \"You want to continue? \"\n",
+ " else:\n",
+ " print \"You quit\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press Q or q to quit, any other key to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You quit\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.8, page no. 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "string comparison\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter first string: \",\n",
+ "str1 = raw_input()\n",
+ "print \"Enter second string: \",\n",
+ "str2 = raw_input()\n",
+ "if (str1 == str2):\n",
+ " print \"The two Cstrings are equal\"\n",
+ "elif (str1 > str2):\n",
+ " print \"The first Cstring is larger\"\n",
+ "else:\n",
+ " print \"The second Cstring is larger\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first string: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter second string: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kent\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The second Cstring is larger\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.9, page no. 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "string to int\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "print \"Enter an integer: \",\n",
+ "input = raw_input()\n",
+ "for x in input:\n",
+ " if (x == 0):\n",
+ " if (not(x.isdigit()) and x != '-'):\n",
+ " sys.exit()\n",
+ " else:\n",
+ " if(not(x.isdigit())):\n",
+ " sys.exit()\n",
+ "num = int(input)\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter an integer: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "567\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 567\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb
new file mode 100644
index 00000000..46b00b70
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb
@@ -0,0 +1,429 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: Persistent Data: File Input and Output"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.1, page no. 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "open a file\n",
+ "note: it will give an error\n",
+ "\"\"\"\n",
+ "\n",
+ "try:\n",
+ " if(fp):\n",
+ " print \"infile = \", fp\n",
+ " print \"0\"\n",
+ "except IOError:\n",
+ " print \"1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'fp' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-1-112e202a5944>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mif\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfp\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"infile = \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfp\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"0\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mNameError\u001b[0m: name 'fp' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.2, page no. 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "open file write mode\n",
+ "\"\"\"\n",
+ "\n",
+ "try:\n",
+ " fp = open(\"students.dat\", \"w\")\n",
+ " if(fp):\n",
+ " print \"infile = \", fp\n",
+ " print \"0\"\n",
+ "except IOError:\n",
+ " print \"1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "infile = <open file 'students.dat', mode 'w' at 0x2d80a50>\n",
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.3, page no. 299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "writing to file\n",
+ "\"\"\"\n",
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.4, page no. 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "reading from file\n",
+ "\"\"\"\n",
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()\n",
+ "fp = open(\"students.dat\", \"r\")\n",
+ "print \"Reading from the file\"\n",
+ "print \"=====================\"\n",
+ "lines = fp.readlines()\n",
+ "for line in lines:\n",
+ " print line\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reading from the file\n",
+ "=====================\n",
+ "C++\n",
+ "\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "example 13.5, page no. 303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "reading from file using getline\n",
+ "\"\"\"\n",
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()\n",
+ "fp = open(\"students.dat\", \"r\")\n",
+ "print \"Reading from the file\"\n",
+ "print \"=====================\"\n",
+ "lines = fp.readlines()\n",
+ "for line in lines:\n",
+ " print line\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reading from the file\n",
+ "=====================\n",
+ "C++\n",
+ "\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.6, page no. 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "looping through file\n",
+ "\"\"\"\n",
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()\n",
+ "fp = open(\"students.dat\", \"r\")\n",
+ "print \"Reading from the file\"\n",
+ "print \"=====================\"\n",
+ "while(fp.readline()):\n",
+ " print fp.readline()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reading from the file\n",
+ "=====================\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter14.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter14.ipynb
new file mode 100644
index 00000000..57cde338
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter14.ipynb
@@ -0,0 +1,779 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14: The Road Ahead: Structures and Classes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.1, page no. 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "declaring structure\n",
+ "note: there is no concept of structure in python. We will use class instead\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = 0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.2, page no. 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "declares a three-element Person array, assigns values to the member\n",
+ "variables of each element, and then outputs their values\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = 0\n",
+ "\n",
+ "MAX = 3\n",
+ "p = []\n",
+ "\n",
+ "for x in range(MAX):\n",
+ " per = Person()\n",
+ " print \"Enter person's name: \",\n",
+ " per.name = raw_input()\n",
+ " print \"Enter height in inches: \",\n",
+ " per.height = int(raw_input())\n",
+ " p.append(per)\n",
+ "\n",
+ "print \"Outputting person data\\n\";\n",
+ "print \"======================\\n\";\n",
+ "for x in range(MAX):\n",
+ " print \"Person \", x + 1, \"'s name is \", p[x].name, \" and height is \", p[x].height"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kent\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jefff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Outputting person data\n",
+ "\n",
+ "======================\n",
+ "\n",
+ "Person 1 's name is Jeff and height is 50\n",
+ "Person 2 's name is Kent and height is 50\n",
+ "Person 3 's name is Jefff and height is 40\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.3, page no. 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "constructors & destructors\n",
+ "note: there are no destructors in Python\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = 0\n",
+ "\n",
+ "MAX = 3\n",
+ "p1 = Person()\n",
+ "print \"The person's name is \", p1.name, \" and height is \", p1.height"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The person's name is and height is 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.4, page no. 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "constructors\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " def __init__(self):\n",
+ " self.name = \"no name assigned\"\n",
+ " self.height = -1\n",
+ "\n",
+ "MAX = 3\n",
+ "p1 = Person()\n",
+ "print \"The person's name is \", p1.name, \" and height is \", p1.height"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The person's name is no name assigned and height is -1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.5, page no. 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "constructors with arguments\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " def __init__(self, s=\"no name assigned\", h=-1):\n",
+ " self.name = s\n",
+ " self.height = h\n",
+ "\n",
+ "MAX = 3\n",
+ "print \"Enter a person's name: \",\n",
+ "s = raw_input()\n",
+ "print \"Enter height in inches: \",\n",
+ "h = int(raw_input())\n",
+ "p1 = Person(s, h)\n",
+ "print \"The person's name is \", p1.name, \" and height is \", p1.height"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "39\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The person's name is Jeff and height is 39\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.6, page no. 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Separating the Constructor Prototype and Implementation\n",
+ "note: separation is not possible in Python we will do it the same way as previous\n",
+ "program\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " def __init__(self, s=\"no name assigned\", h=-1):\n",
+ " self.name = s\n",
+ " self.height = h\n",
+ "\n",
+ "MAX = 3\n",
+ "print \"Enter a person's name: \",\n",
+ "s = raw_input()\n",
+ "print \"Enter height in inches: \",\n",
+ "h = int(raw_input())\n",
+ "p1 = Person(s, h)\n",
+ "print \"The person's name is \", p1.name, \" and height is \", p1.height\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The person's name is Jeff and height is 50\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.7, page no. 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Passing Structures as Function Arguments\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = \"\"\n",
+ " def setValues(self, pers):\n",
+ " print \"Enter person's name: \",\n",
+ " pers.name = raw_input()\n",
+ " print \"Enter height in inches: \",\n",
+ " pers.height = int(raw_input())\n",
+ " def getValues(self, pers):\n",
+ " print \"Person's name is \", pers.name, \" height is \", pers.height\n",
+ "\n",
+ "p1 = Person()\n",
+ "p1.setValues(p1)\n",
+ "print \"Outputting person data\"\n",
+ "print \"======================\"\n",
+ "p1.getValues(p1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Outputting person data\n",
+ "======================\n",
+ "Person's name is Jeff height is 60\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.8, page no. 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "nesting structures\n",
+ "\"\"\"\n",
+ "\n",
+ "class Date:\n",
+ " month = 0\n",
+ " day = 0\n",
+ " year = 0\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = 0\n",
+ " bDay = Date()\n",
+ " def setValues(self, pers):\n",
+ " print \"Enter person's name: \",\n",
+ " pers.name = raw_input()\n",
+ " print \"Enter height in inches: \",\n",
+ " pers.height = int(raw_input())\n",
+ " print \"Enter birthdate\"\n",
+ " pers.bDay.month = int(raw_input(\"Month: \"))\n",
+ " pers.bDay.day = int(raw_input(\"Day: \"))\n",
+ " pers.bDay.year = int(raw_input(\"Year: \"))\n",
+ " def getValues(self, pers):\n",
+ " print \"Person's name: \", pers.name\n",
+ " print \"Person's height\", pers.height\n",
+ " print \"Person's birthday in mm/dd/yyyy format is: \", pers.bDay.month, pers.bDay.day, pers.bDay.year\n",
+ "\n",
+ "p1 = Person()\n",
+ "p1.setValues(p1)\n",
+ "print \"Outputting person data\"\n",
+ "print \"======================\"\n",
+ "p1.getValues(p1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "59\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter birthdate\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Month: 20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Day: 05\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Year: 1999\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Outputting person data\n",
+ "======================\n",
+ "Person's name: Jeff\n",
+ "Person's height 59\n",
+ "Person's birthday in mm/dd/yyyy format is: 20 5 1999\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.9, page no. 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "classes\n",
+ "note: there won't be any error unlike the situation mentioned in textbook\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = \"\"\n",
+ " def setValues(self, pers):\n",
+ " print \"Enter person's name: \",\n",
+ " pers.name = raw_input()\n",
+ " print \"Enter height in inches: \",\n",
+ " pers.height = int(raw_input())\n",
+ " def getValues(self, pers):\n",
+ " print \"Person's name is \", pers.name, \" height is \", pers.height\n",
+ "\n",
+ "p1 = Person()\n",
+ "p1.setValues(p1)\n",
+ "print \"Outputting person data\"\n",
+ "print \"======================\"\n",
+ "p1.getValues(p1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "JEff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Outputting person data\n",
+ "======================\n",
+ "Person's name is JEff height is 50\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 14.10, page no. 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "private & public specifiers\n",
+ "note: there are no such specifiers in Python\n",
+ "\"\"\"\n",
+ "\n",
+ "class Person:\n",
+ " name = \"\"\n",
+ " height = \"\"\n",
+ " def setValues(self, pers):\n",
+ " print \"Enter person's name: \",\n",
+ " pers.name = raw_input()\n",
+ " print \"Enter height in inches: \",\n",
+ " pers.height = int(raw_input())\n",
+ " def getValues(self):\n",
+ " print \"Person's name is \", self.getName(), \" height is \", self.getHeight()\n",
+ " def getName(self):\n",
+ " return self.name\n",
+ " def getHeight(self):\n",
+ " return self.height\n",
+ "\n",
+ "p1 = Person()\n",
+ "p1.setValues(p1)\n",
+ "print \"Outputting person data\"\n",
+ "print \"======================\"\n",
+ "p1.getValues()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter person's name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Outputting person data\n",
+ "======================\n",
+ "Person's name is Jeff height is 60\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter2.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter2.ipynb
new file mode 100644
index 00000000..d25f5c31
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter2.ipynb
@@ -0,0 +1,63 @@
+{
+ "metadata": {
+ "name": "chapter2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Memory &amp; Data Types"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.1, page no. 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Data Types\n",
+ "Note: there is no long double, or float double or double range or short.\n",
+ "Also, the size of data types my differ compared to c++\n",
+ "\"\"\"\n",
+ "\n",
+ "import sys \n",
+ "\n",
+ "print \"Size of Integer is: \" + str(sys.getsizeof(int()))\n",
+ "print \"Size of Float is: \" + str(sys.getsizeof(float()))\n",
+ "print \"Size of Long is: \" + str(sys.getsizeof(long()))\n",
+ "print \"Size of String is: \" + str(sys.getsizeof(str()))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Size of Integer is: 24\n",
+ "Size of Float is: 24\n",
+ "Size of Long is: 24\n",
+ "Size of String is: 37\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter3.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter3.ipynb
new file mode 100644
index 00000000..d1b20dbb
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter3.ipynb
@@ -0,0 +1,614 @@
+{
+ "metadata": {
+ "name": "chapter3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 - Variables"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.1, page no. 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Variable Declaration\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = 0 #will declare testScore as an integer"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.2, page no. 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Variable Declaration with error\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 3,
+ "text": [
+ "0"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.3, page no. 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Memory Address of variable\n",
+ "Note: address will be different from that given in the book\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = 0\n",
+ "print id(testScore)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "27819200\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.4, page no. 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Address and size of two variables\n",
+ "Note: the address and size will be diffent than the ones given in book\n",
+ "\"\"\"\n",
+ "import sys\n",
+ "\n",
+ "testScore = 0\n",
+ "myGPA = 0.0\n",
+ "\n",
+ "print \"The address of testScore is: \", id(testScore)\n",
+ "print \"The size of testScore is: \", sys.getsizeof(testScore)\n",
+ "print \"The address of myGPA is: \", id(myGPA)\n",
+ "print \"The size of myGPA is: \", sys.getsizeof(myGPA)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The address of testScore is: 27819200\n",
+ "The size of testScore is: 24\n",
+ "The address of myGPA is: 42871928\n",
+ "The size of myGPA is: 24\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.5, page no. 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "change in the value of a variable\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = 95;\n",
+ "print \"Your test score is: \", testScore\n",
+ "testScore = 75\n",
+ "print \"Your test score now is: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your test score is: 95\n",
+ "Your test score now is: 75\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.6, page no. 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "A floating-point value, 77.83, is being assigned to an integer variable\n",
+ "Note: it will be printed as 77.83 unlike in the book, as Python implicitly\n",
+ "takes the data type according to the value assigned\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = 77.83;\n",
+ "print \"The test score is: \", testScore\n",
+ "print \"The test score is: \", int(testScore) # explicitly converting to integer"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The test score is: 77.83\n",
+ "The test score is: 77\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.7 page no. 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Printing variable of short type but out of range.\n",
+ "Note: it will print 32768 as it is as there is no short data type in python\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = 32768;\n",
+ "print \"Your test score is: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your test score is: 32768\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.8 page no. 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Printing variable of short type but out of range.\n",
+ "Note: it will print -32769 as it is as there is no short data type in python\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = -32769\n",
+ "print \"Your test score is: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your test score is: -32769\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.9, page no. 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Inputting a value (without prompt msg)\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = int(raw_input())\n",
+ "print \"Your test score is: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.10, page no. 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Inputting a value (with prompt msg)\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = int(raw_input(\"Enter your test score: \"))\n",
+ "print \"Your test score is: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your test score: 89\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your test score is: 89\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.11, page no. 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Inputting Values for Multiple Variables\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your name: \",\n",
+ "myName = raw_input()\n",
+ "print \"Enter your weight in pounds: \",\n",
+ "myWeight = raw_input()\n",
+ "print \"Enter your height in inches: \",\n",
+ "myHeight = raw_input()\n",
+ "print \"Your name score is: \", myName\n",
+ "print \"Your weight in pounds is \", myWeight\n",
+ "print \"Your height in inches is \", myHeight"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hardik\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your weight in pounds: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "90\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name score is: Hardik\n",
+ "Your weight in pounds is 90\n",
+ "Your height in inches is 50\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.12, page no. 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Inputting Values for Multiple Variables in one prompt (no possible in python, it\n",
+ "will be same like the previous program\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your name: \",\n",
+ "myName = raw_input()\n",
+ "print \"Enter your weight in pounds: \",\n",
+ "myWeight = raw_input()\n",
+ "print \"Enter your height in inches: \",\n",
+ "myHeight = raw_input()\n",
+ "print \"Your name score is: \", myName\n",
+ "print \"Your weight in pounds is \", myWeight\n",
+ "print \"Your height in inches is \", myHeight"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hardik\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your weight in pounds: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "90\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your height in inches: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name score is: Hardik\n",
+ "Your weight in pounds is 90\n",
+ "Your height in inches is 50\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.13, page no. 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "inputting a string (python will take the whole string and will not omit anything)\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your name: \",\n",
+ "name = raw_input()\n",
+ "print \"Your name is \", name"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hardik\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is Hardik\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.14 page no. 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Printing variable of short type but out of range.\n",
+ "Note: it will print -32769 as it is as there is no short data type in python\n",
+ "\"\"\"\n",
+ "\n",
+ "testScore = 32769\n",
+ "print \"Your test score is: \", testScore"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your test score is: 32769\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter4.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter4.ipynb
new file mode 100644
index 00000000..3293ca3b
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter4.ipynb
@@ -0,0 +1,605 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 - Arithmetic Operators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.1, page no. 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "following program has two integer variables, total and added\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of preregistered students: \",\n",
+ "total = int(raw_input())\n",
+ "print \"Enter number of students adding the course: \",\n",
+ "added = int(raw_input())\n",
+ "total = total + added\n",
+ "print \"Total number of students: \", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of preregistered students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "35\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students adding the course: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total number of students: 38\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.2, page no. 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "addition operator also can be used with string operands\n",
+ "\"\"\"\n",
+ "\n",
+ "firstName = \"Jeff\"\n",
+ "lastName = \"Kent\"\n",
+ "print \"Your name is \", firstName + lastName"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Your name is JeffKent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.3, page no. 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "program then uses the subtraction operator to update total.\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of preregistered students: \",\n",
+ "total = int(raw_input())\n",
+ "print \"Enter number of students adding the course: \",\n",
+ "added = int(raw_input())\n",
+ "total = total + added\n",
+ "print \"How many students dropped? \",\n",
+ "dropped = int(raw_input())\n",
+ "total -= dropped\n",
+ "print \"Total number of students: \", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of preregistered students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students adding the course: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How many students dropped? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total number of students: 28\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "exampe 4.4, page no. 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The Multiplication Operator\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of preregistered students: \",\n",
+ "total = int(raw_input())\n",
+ "print \"Enter number of students adding the course: \",\n",
+ "added = int(raw_input())\n",
+ "total = total + added\n",
+ "print \"How many students dropped? \",\n",
+ "dropped = int(raw_input())\n",
+ "total -= dropped\n",
+ "print \"Total number of students: \", total\n",
+ "print \"Total tuition owed: $\",((total + dropped) * 72)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of preregistered students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students adding the course: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How many students dropped? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total number of students: 28\n",
+ "Total tuition owed: $ 2376\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.5, page no. 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The Division Operator\n",
+ "\"\"\"\n",
+ "\n",
+ "firstOp = 10\n",
+ "secondOp = 4\n",
+ "result = firstOp / secondOp\n",
+ "print firstOp, \" / \", secondOp, \" = \", result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10 / 4 = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.6, page no. 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "The Division Operator with the variables intialized with float values\n",
+ "\"\"\"\n",
+ "\n",
+ "firstOp = 10.0\n",
+ "secondOp = 4.0\n",
+ "result = firstOp / secondOp\n",
+ "print firstOp, \" / \", secondOp, \" = \", result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10.0 / 4.0 = 2.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.7, page no. 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "the first division example changed to make the result of integer division\n",
+ "result into float\n",
+ "\"\"\"\n",
+ "\n",
+ "firstOp = 10\n",
+ "secondOp = 4\n",
+ "result = float(firstOp) / float(secondOp) #converting both the variables to float\n",
+ "print firstOp, \" / \", secondOp, \" = \", result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10 / 4 = 2.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.8, page no. 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using all the operators together\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of preregistered students: \",\n",
+ "total = int(raw_input())\n",
+ "print \"Enter number of students adding the course: \",\n",
+ "added = int(raw_input())\n",
+ "total = total + added\n",
+ "print \"How many students dropped? \",\n",
+ "dropped = int(raw_input())\n",
+ "total -= dropped\n",
+ "print \"Total number of students: \", total\n",
+ "tuition = (total + dropped) * 72\n",
+ "print \"Total tuition owed: $\",tuition\n",
+ "print \"Average tuition per enrolled student: $\", (float(tuition)/float(total))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of preregistered students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students adding the course: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " How many students dropped? "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total number of students: 28\n",
+ "Total tuition owed: $ 2376\n",
+ "Average tuition per enrolled student: $ 84.8571428571\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.9, page no. 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "program calculates the area of a circle based on a radius inputted by the user\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter radius of circle: \",\n",
+ "radius = float(raw_input())\n",
+ "area = 3.14159 * pow(radius, 2);\n",
+ "print \"The area is \", area"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter radius of circle: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The area is 113.09724\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.10, page no. 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "converting pennies to dollars, Dollars: 3, \n",
+ "Quarters, Dimes: 1, Nickels: 0, Pennies: 2\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of pennies to make change for: \",\n",
+ "total = int(raw_input())\n",
+ "dollars = total / 100\n",
+ "leftover = total % 100\n",
+ "quarters = leftover / 25\n",
+ "leftover %= 25\n",
+ "dimes = leftover / 10\n",
+ "leftover %= 10\n",
+ "nickels = leftover / 5\n",
+ "leftover %= 5\n",
+ "print \"Dollars: \", dollars\n",
+ "print \"Quarters: \", quarters\n",
+ "print \"Dimes: \", dimes\n",
+ "print \"Nickels: \", nickels\n",
+ "print \"Pennies: \", leftover"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of pennies to make change for: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "387\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Dollars: 3\n",
+ "Quarters: 3\n",
+ "Dimes: 1\n",
+ "Nickels: 0\n",
+ "Pennies: 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb
new file mode 100644
index 00000000..cd6b98e9
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb
@@ -0,0 +1,519 @@
+{
+ "metadata": {
+ "name": "chapter5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 - Making Decisions: if and switch Statements"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.1, page no. 100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "outputs the results of several variable comparisons.\n",
+ "0 -> False 1 -> True\n",
+ "\"\"\"\n",
+ "\n",
+ "a = 4\n",
+ "b = 5\n",
+ "print a, \" > \", b, \" is \", (a > b)\n",
+ "print a, \" >= \", b, \" is \", (a >= b)\n",
+ "print a, \" == \", b, \" is \", (a == b)\n",
+ "print a, \" <= \", b, \" is \", (a <= b)\n",
+ "print a, \" < \", b, \" is \", (a < b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 > 5 is False\n",
+ "4 >= 5 is False\n",
+ "4 == 5 is False\n",
+ "4 <= 5 is True\n",
+ "4 < 5 is True\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.2, page no. 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Addition operation\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of preregistered students: \",\n",
+ "total = int(raw_input())\n",
+ "print \"Enter number of students adding the course: \",\n",
+ "added = int(raw_input())\n",
+ "total = total + added\n",
+ "print \"Total number of students: \", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of preregistered students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students adding the course: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total number of students: 33\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.3, page no. 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "tests if a whole number entered is even\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a whole number: \",\n",
+ "num = int(raw_input())\n",
+ "if (num % 2 == 0):\n",
+ " print \"The number is even\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a whole number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number is even\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.4, page no. 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "previous program modified to add else part for odd number\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a whole number: \",\n",
+ "num = int(raw_input())\n",
+ "if (num % 2 == 0):\n",
+ " print \"The number is even\"\n",
+ "else:\n",
+ " print \"The number is odd\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a whole number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number is odd\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.4, page no. 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "odd or even using inline condition (similar to conditional operator)\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a whole number: \",\n",
+ "num = int(raw_input())\n",
+ "print \"The number is\", (\"even\" if num %2 == 0 else \"odd\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a whole number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number is even\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.6, page no. 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "determines grades based on test score\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your test score: \",\n",
+ "testScore = int(raw_input())\n",
+ "if (testScore >= 90 ):\n",
+ " print \"Your grade is an A\"\n",
+ "elif (testScore >= 80 ):\n",
+ " print \"Your grade is a B\"\n",
+ "elif (testScore >= 70 ):\n",
+ " print \"Your grade is a C\"\n",
+ "elif (testScore >= 60 ):\n",
+ " print \"Your grade is a D\"\n",
+ "else:\n",
+ " print \"Your grade is an F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your test score: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "70\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your grade is a C\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.7, page no. 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "determines your average based on your grade\n",
+ "note: there is no switch statement in python\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your grade: \",\n",
+ "grade = raw_input()\n",
+ "\n",
+ "if grade == 'A':\n",
+ " print \"Your average must be between 90 - 100\"\n",
+ "elif grade == 'B':\n",
+ " print \"Your average must be between 80 - 89\"\n",
+ "elif grade == 'C':\n",
+ " print \"Your average must be between 70 - 79\"\n",
+ "elif grade == 'D':\n",
+ " print \"Your average must be between 60 - 69\"\n",
+ "else:\n",
+ " print \"Your average must be below 60\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "D\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your average must be between 60 - 69\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.8, page no. 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "determines your average based on your grade with lower case alphabets also\n",
+ "note: there is no switch statement in python\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "print \"Enter your grade: \",\n",
+ "grade = raw_input()\n",
+ "\n",
+ "if grade == 'A' or grade == 'a':\n",
+ " print \"Your average must be between 90 - 100\"\n",
+ "elif grade == 'B' or grade == 'b':\n",
+ " print \"Your average must be between 80 - 89\"\n",
+ "elif grade == 'C' or grade == 'c':\n",
+ " print \"Your average must be between 70 - 79\"\n",
+ "elif grade == 'D' or grade == 'd':\n",
+ " print \"Your average must be between 60 - 69\"\n",
+ "else:\n",
+ " print \"Your average must be below 60\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "d\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your average must be between 60 - 69\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.9, page no. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "more example for switch (if else in python)\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Choose your car\"\n",
+ "print \"S for Standard\"\n",
+ "print \"L for Leather Seats\"\n",
+ "print \"D for Leather Seats + Chrome Wheels\"\n",
+ "choice = raw_input()\n",
+ "print \"Extra features purchased\"\n",
+ "if choice == 'D':\n",
+ " print \"Chrome wheels\\n\"\n",
+ "elif choice == 'L':\n",
+ " print \"Leather seats\"\n",
+ "else:\n",
+ " print \"None selected\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "StdinNotImplementedError",
+ "evalue": "raw_input was called, but this frontend does not support stdin.",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mStdinNotImplementedError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m/home/jovina/TBC/hardik/c++-demystified/<ipython-input-1-44ee42c69511>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"L for Leather Seats\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"D for Leather Seats + Chrome Wheels\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mchoice\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mraw_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 10\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"Extra features purchased\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mchoice\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m'D'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;32m/home/jovina/epd/lib/python2.7/site-packages/IPython/zmq/ipkernel.pyc\u001b[0m in \u001b[0;36m<lambda>\u001b[1;34m(prompt)\u001b[0m\n\u001b[0;32m 251\u001b[0m \u001b[0mraw_input\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mlambda\u001b[0m \u001b[0mprompt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m''\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_raw_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprompt\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mident\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparent\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 252\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 253\u001b[1;33m \u001b[0mraw_input\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mlambda\u001b[0m \u001b[0mprompt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m''\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_no_raw_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 254\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 255\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mpy3compat\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPY3\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;32m/home/jovina/epd/lib/python2.7/site-packages/IPython/zmq/ipkernel.pyc\u001b[0m in \u001b[0;36m_no_raw_input\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 443\u001b[0m \"\"\"Raise StdinNotImplentedError if active frontend doesn't support\n\u001b[0;32m 444\u001b[0m stdin.\"\"\"\n\u001b[1;32m--> 445\u001b[1;33m raise StdinNotImplementedError(\"raw_input was called, but this \"\n\u001b[0m\u001b[0;32m 446\u001b[0m \"frontend does not support stdin.\") \n\u001b[0;32m 447\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mStdinNotImplementedError\u001b[0m: raw_input was called, but this frontend does not support stdin."
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Choose your car\n",
+ "S for Standard\n",
+ "L for Leather Seats\n",
+ "D for Leather Seats + Chrome Wheels\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter6.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter6.ipynb
new file mode 100644
index 00000000..a00118a8
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter6.ipynb
@@ -0,0 +1,325 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 - Nested if Statements and Logical Operators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.1, page no. 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "use of nested if statements\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your age: \",\n",
+ "age = int(raw_input())\n",
+ "print \"Are you a citizen (Y/N): \",\n",
+ "choice = raw_input()\n",
+ "if (choice == 'Y'):\n",
+ " citizen = True\n",
+ "else:\n",
+ " citizen = False\n",
+ "if (age >= 18):\n",
+ " if citizen:\n",
+ " print \"You are eligible to vote\"\n",
+ " else:\n",
+ " print \"You are not eligible to vote\"\n",
+ "else:\n",
+ " print \"You are not eligible to vote\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your age: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Are you a citizen (Y/N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You are eligible to vote\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.2, page no. 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "use of nested if statements\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your age: \",\n",
+ "age = int(raw_input())\n",
+ "if (age > 12):\n",
+ " if (age >= 65):\n",
+ " print \"Admission is free\"\n",
+ " else:\n",
+ " print \"You have to pay\"\n",
+ "else:\n",
+ " print \"Admission is free\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your age: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "11\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Admission is free\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.3, page no. 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "use of the logical And operator\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your age: \",\n",
+ "age = int(raw_input())\n",
+ "print \"Are you a citizen (Y/N): \",\n",
+ "choice = raw_input()\n",
+ "if (choice == 'Y'):\n",
+ " citizen = True\n",
+ "else:\n",
+ " citizen = False\n",
+ "if (age >= 18 and citizen == True):\n",
+ " print \"You are eligible to vote\"\n",
+ "else:\n",
+ " print \"You are not eligible to vote\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter your age: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "22\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Are you a citizen (Y/N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You are not eligible to vote\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.4, page no. 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "use of the logical Or operator\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your age: \",\n",
+ "age = int(raw_input())\n",
+ "if (age <= 12 or age >= 65):\n",
+ " print \"Admission is free\"\n",
+ "else:\n",
+ " print \"You have to pay\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your age: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "22\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You have to pay\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.5, page no. 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "use of the logical Not operator\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter your age: \",\n",
+ "age = int(raw_input())\n",
+ "if not ((age > 12 and age < 65)):\n",
+ " print \"Admission is free\"\n",
+ "else:\n",
+ " print \"You have to pay\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your age: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "22\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You have to pay\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter7.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter7.ipynb
new file mode 100644
index 00000000..6076d617
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter7.ipynb
@@ -0,0 +1,979 @@
+{
+ "metadata": {
+ "name": "chapter7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 - The For Loop"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.1, page no. 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "unary operators\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 2\n",
+ "num += 1\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.2, page no. 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "increment operator\n",
+ "note: there is no increment/decrement operator in python we will use += instead\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 2\n",
+ "num += 1\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.3, page no. 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "increment operator\n",
+ "note: there is no increment/decrement operator in python we will use += instead\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 2\n",
+ "print num\n",
+ "num += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.4, page no. 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "unary operator (decrement)\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 2\n",
+ "num -= 1\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.5, page no. 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "prefix & postfix\n",
+ "note: there is no increment/decrement operator in python we will use -= instead\n",
+ "this program illustrates n--\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "num = 2\n",
+ "num -= 1\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.6, page no. 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "prefix & postfix\n",
+ "note: there is no increment/decrement operator in python we will use -= instead\n",
+ "this program illustrates --n\n",
+ "\"\"\"\n",
+ "\n",
+ "\n",
+ "num = 2\n",
+ "num -= 1\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.7, page no. 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "output the numbers between 1 and 10\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num\n",
+ "num += 1\n",
+ "print num"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.8, page no. 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using a for loop (1 to 10)\n",
+ "\"\"\"\n",
+ "\n",
+ "for num in range(1, 11):\n",
+ " print num\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.9, page no. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using a for loop (1 to 100)\n",
+ "\"\"\"\n",
+ "\n",
+ "for num in range(1, 101):\n",
+ " print num,"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "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\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.10, page no. 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using a for loop\n",
+ "note: the method given in textbook is not possible in python, we will use a while\n",
+ "loop instead\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 1\n",
+ "while num <= 10:\n",
+ " print num,\n",
+ " num += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 3 4 5 6 7 8 9 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.11, page no. 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "infinite loop\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 1\n",
+ "while num <= 10:\n",
+ " print num,"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.12, page no. 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "factorial\n",
+ "\"\"\"\n",
+ "\n",
+ "total = 1;\n",
+ "print \"Enter a number: \",\n",
+ "num = int(raw_input())\n",
+ "print \"The factorial of \", num, \" is \",\n",
+ "for counter in range(1, num+1):\n",
+ " total *= counter\n",
+ "print total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The factorial of 5 is 120\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.13, page no. 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Breaking Out of a Loop\n",
+ "\"\"\"\n",
+ "\n",
+ "secret = 3\n",
+ "print \"Guess a number between 1 and 10\"\n",
+ "print \"You have 3 tries\"\n",
+ "for counter in range(1,4):\n",
+ " print \"Enter the number now: \",\n",
+ " num = int(raw_input())\n",
+ " if (num == secret):\n",
+ " print \"You guessed the secret number!\"\n",
+ " break\n",
+ "print \"Program over\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Guess a number between 1 and 10\n",
+ "You have 3 tries\n",
+ "Enter the number now: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the number now: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter the number now: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Program over\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.14, page no. 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "logical && (And) operator is an alternative to using the break\n",
+ "keyword\n",
+ "\n",
+ "note: and cannot be used in python with for loop, we will use if condition\n",
+ "\"\"\"\n",
+ "\n",
+ "secret = 3\n",
+ "print \"Guess a number between 1 and 10\\n\"\n",
+ "print \"You have 3 tries\\n\"\n",
+ "keepgoing = True\n",
+ "for counter in range(1, 4):\n",
+ " if keepgoing == True:\n",
+ " print \"Enter the number now: \",\n",
+ " num = int(raw_input())\n",
+ " if (num == secret):\n",
+ " print \"You guessed the secret number!\"\n",
+ " keepgoing = False\n",
+ " else:\n",
+ " break\n",
+ "print \"Program over\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Guess a number between 1 and 10\n",
+ "\n",
+ "You have 3 tries\n",
+ "\n",
+ "Enter the number now: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You guessed the secret number!\n",
+ "Program over\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.15, page no. 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "missing condition\n",
+ "Instead, the break keyword inside the if/else structure substitutes for that condition\n",
+ "note: we cannot write an infinte loop in python as given in book, we will use\n",
+ "while loop\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 1\n",
+ "while True:\n",
+ " if (num > 10):\n",
+ " break\n",
+ " else:\n",
+ " print num, \" \",\n",
+ " num += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 3 4 5 6 7 8 9 10 \n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.16, page no 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "continue keyword\n",
+ "\"\"\"\n",
+ "\n",
+ "total = 0\n",
+ "print \"How many items do you want to buy: \",\n",
+ "num = int(raw_input())\n",
+ "for counter in range(1, num+1):\n",
+ " if (counter % 13 == 0):\n",
+ " continue\n",
+ " total += 3\n",
+ "print \"Total for \", num, \" items is $\", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many items do you want to buy: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total for 5 items is $ 15\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.17, page no. 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using logical Not instead of continue keyword\n",
+ "\"\"\"\n",
+ "\n",
+ "total = 0\n",
+ "print \"How many items do you want to buy: \",\n",
+ "num = int(raw_input())\n",
+ "keepgoing = True\n",
+ "for counter in range(1, num+1):\n",
+ " if (not(counter % 13 == 0 )):\n",
+ " total += 3\n",
+ "print \"Total for \", num, \" items is $\", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many items do you want to buy: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total for 6 items is $ 18\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.18, page no. 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Nesting for loop\n",
+ "\"\"\"\n",
+ "\n",
+ "for x in range(1, 6):\n",
+ " for y in range(1, 11):\n",
+ " print \"X\",\n",
+ " print \"\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X X X X X X X X X X \n",
+ "\n",
+ "X X X X X X X X X X \n",
+ "\n",
+ "X X X X X X X X X X \n",
+ "\n",
+ "X X X X X X X X X X \n",
+ "\n",
+ "X X X X X X X X X X \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.19, page no. 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "more nested for loop\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter number of salespersons: \",\n",
+ "persons = int(raw_input())\n",
+ "print \"Enter number of sales per salesperson: \",\n",
+ "numSales = int(raw_input())\n",
+ "for x in range(1, persons+1):\n",
+ " total = 0\n",
+ " for y in range(1, numSales+1):\n",
+ " print \"Enter sale \", y, \" for salesperson \", x, \": \"\n",
+ " sale = int(raw_input())\n",
+ " total += sale\n",
+ " average = float(total/numSales)\n",
+ " print \"Average sales for salesperson #\", x, \" is \", average"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of salespersons: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of sales per salesperson: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter sale 1 for salesperson 1 : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sale 2 for salesperson 1 : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average sales for salesperson # 1 is 1.0\n",
+ "Enter sale 1 for salesperson 2 : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sale 2 for salesperson 2 : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average sales for salesperson # 2 is 3.0\n",
+ "Enter sale 1 for salesperson 3 : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter sale 2 for salesperson 3 : \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average sales for salesperson # 3 is 5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter8.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter8.ipynb
new file mode 100644
index 00000000..c3bc8e16
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter8.ipynb
@@ -0,0 +1,603 @@
+{
+ "metadata": {
+ "name": "chapter8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 - While and Do While Loops"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.1, page no. 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "for loop that was used earlier to show the difference between while loop & for\n",
+ "\"\"\"\n",
+ "\n",
+ "for num in range(1, 11):\n",
+ " print num,"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 3 4 5 6 7 8 9 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.2, page no. 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "using while loop for the same\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 1\n",
+ "while num <=10:\n",
+ " print num,\n",
+ " num += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2 3 4 5 6 7 8 9 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.3, page no. 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "updation in the condition itself.\n",
+ "it is not possible in python, we will use normal while loop\n",
+ "\"\"\"\n",
+ "\n",
+ "num = 0\n",
+ "while (num <= 10):\n",
+ " print num,\n",
+ " num += 1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 1 2 3 4 5 6 7 8 9 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.4, page no. 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "asks the user to enter a positive number,\n",
+ "and in a loop continues that request until the user does so\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a positive number: \",\n",
+ "num = int(raw_input())\n",
+ "while (num <= 0):\n",
+ " print \"Number must be positive; please retry: \",\n",
+ " num = int(raw_input())\n",
+ "print \"The number you entered is \", num, \" \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a positive number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number you entered is 4 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.5, page no. 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "modification of the program uses the break keyword to provide the user with the\n",
+ "option of quitting the data entry\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Enter a positive number: \",\n",
+ "num = int(raw_input())\n",
+ "while (num <= 0):\n",
+ " print \"Number must be positive; try again (Y/N): \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Y'):\n",
+ " print \"Enter number: \",\n",
+ " num = int(raw_input())\n",
+ " else:\n",
+ " break\n",
+ "print \"The number you entered is \", num, \" \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a positive number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Number must be positive; try again (Y/N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number you entered is 7 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.6, page no. 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "flags\n",
+ "note: there is a mistake in the textbook, it should be choice == 'Y' instead of\n",
+ "choice != 'Y'\n",
+ "\"\"\"\n",
+ "\n",
+ "quit = False\n",
+ "print \"Enter a positive number: \",\n",
+ "num = int(raw_input())\n",
+ "while (num <= 0 and quit == False):\n",
+ " print \"Number must be positive; try again (Y/N): \",\n",
+ " choice = raw_input()\n",
+ " if (choice is 'Y'):\n",
+ " print \"Enter number: \",\n",
+ " num = int(raw_input())\n",
+ " else:\n",
+ " quit = True\n",
+ "if (quit == False):\n",
+ " print \"The number you entered is \", num, \" \"\n",
+ "else:\n",
+ " print \"You did not enter a positive number\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a positive number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number you entered is 3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.7, page no. 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "while(true)\n",
+ "\"\"\"\n",
+ "\n",
+ "quit = False\n",
+ "while(True):\n",
+ " print \"Enter a positive number: \",\n",
+ " num = int(raw_input())\n",
+ " if (num > 0):\n",
+ " break\n",
+ " else:\n",
+ " print \"Number must be positive; try again (Y/N): \",\n",
+ " choice = raw_input()\n",
+ " if (choice != 'Y'):\n",
+ " quit = True\n",
+ " break\n",
+ "if (quit == False):\n",
+ " print \"The number you entered is \", num, \" \"\n",
+ "else:\n",
+ " print \"You did not enter a positive number\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a positive number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Number must be positive; try again (Y/N): "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You did not enter a positive number\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.8, page no. 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "continue keyword\n",
+ "\"\"\"\n",
+ "\n",
+ "counter = 0\n",
+ "total = 0\n",
+ "print \"How many items do you want to buy: \",\n",
+ "num = int(raw_input())\n",
+ "while(counter < num):\n",
+ " counter += 1\n",
+ " if (counter % 13 == 0):\n",
+ " continue\n",
+ " total += 3\n",
+ "print \"Total for \", num, \" items is $\", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.9, page no. 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "logical ! (Not)\n",
+ "operator as an alternative to using the continue keyword\n",
+ "\"\"\"\n",
+ "\n",
+ "counter = 0\n",
+ "total = 0\n",
+ "print \"How many items do you want to buy: \",\n",
+ "num = int(raw_input())\n",
+ "keepgoing = True\n",
+ "while(counter < num):\n",
+ " counter += 1\n",
+ " if (not(counter % 13 == 0)):\n",
+ " total += 3;\n",
+ "print \"Total for \", num, \" items is $\", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "How many items do you want to buy: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total for 4 items is $ 12\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.10, page no. 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "program using nested while loops\n",
+ "\"\"\"\n",
+ "\n",
+ "x = 0\n",
+ "while(x < 5):\n",
+ " x += 1\n",
+ " y = 0\n",
+ " while(y < 5):\n",
+ " y += 1\n",
+ " print \"X\",\n",
+ " print '\\n'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X X X X X \n",
+ "\n",
+ "X X X X X \n",
+ "\n",
+ "X X X X X \n",
+ "\n",
+ "X X X X X \n",
+ "\n",
+ "X X X X X \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.11, page no. 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "do while loop\n",
+ "note: there is no do while loop in python, we will use while loop instead\n",
+ "\"\"\"\n",
+ "\n",
+ "quit = False\n",
+ "print \"Enter a positive number: \",\n",
+ "num = int(raw_input())\n",
+ "while (num <= 0 and quit == False):\n",
+ " print \"Number must be positive; try again (Y/N): \",\n",
+ " choice = raw_input()\n",
+ " if (choice is 'Y'):\n",
+ " print \"Enter number: \",\n",
+ " num = int(raw_input())\n",
+ " else:\n",
+ " quit = True\n",
+ "if (quit == False):\n",
+ " print \"The number you entered is \", num, \" \"\n",
+ "else:\n",
+ " print \"You did not enter a positive number\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a positive number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number you entered is 3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb
new file mode 100644
index 00000000..4918a533
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb
@@ -0,0 +1,1036 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 - Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.1, page no. 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "terminology of a function\n",
+ "note: there is no need of main in python, defining here just for sake of understanding\n",
+ "\"\"\"\n",
+ "\n",
+ "def main(): #defining a function \n",
+ " print \"Hello World!\"\n",
+ "\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World!\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.2, page no. 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "defining a function\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage(): # defining function\n",
+ " print \"Hello world!\"\n",
+ "\n",
+ "printMessage() # calling the function"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.3, page no. 181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "prototyping\n",
+ "note: there is no need of prototyping in Python. In fact, you have to define a function before you call it in Python.\n",
+ "\"\"\"\n",
+ "\n",
+ "printMessage();\n",
+ "\n",
+ "def printMessage():\n",
+ " print \"Hello world!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.4, page no. 182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "prototyping\n",
+ "note: the way it is given in textbook is not possible in python. We have to \n",
+ "define a funciton first in order to call it\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage():\n",
+ " print \"Hello world!\"\n",
+ "\n",
+ "printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.5, page no. 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "local variables\n",
+ "note: program will give an error saying local variable time is not defined\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage():\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "times = 0\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "e\n"
+ ]
+ },
+ {
+ "ename": "UnboundLocalError",
+ "evalue": "local variable 'times' referenced before assignment",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mUnboundLocalError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-8-42e131eb489c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 17\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"Input stopped\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 18\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 19\u001b[1;33m \u001b[0mprintMessage\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[1;32m<ipython-input-8-42e131eb489c>\u001b[0m in \u001b[0;36mprintMessage\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mprintMessage\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mtimes\u001b[0m \u001b[1;33m+=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"This function called \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\" times\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mUnboundLocalError\u001b[0m: local variable 'times' referenced before assignment"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.6, page no. 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "local variables\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage():\n",
+ " times = 0\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.7, page no. 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "global variables\n",
+ "\"\"\"\n",
+ "\n",
+ "times = 0\n",
+ "def printMessage():\n",
+ " global times\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 2 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 3 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.8, page no. 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "static local variables\n",
+ "note: there is no static keyword in python so we will use it as global variable\n",
+ "only.\n",
+ "\"\"\"\n",
+ "\n",
+ "times = 0\n",
+ "def printMessage():\n",
+ " global times\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 2 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 3 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.9, page no. 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "sending info. to a function\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage():\n",
+ " print \"You inputted \", str\n",
+ "\n",
+ "print \"Enter a string: \",\n",
+ "str = raw_input()\n",
+ "printMessage()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You inputted Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.10, page no. 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "passing argument by value\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage(s):\n",
+ " print \"You inputted \", s\n",
+ "\n",
+ "print \"Enter a string: \",\n",
+ "str = raw_input()\n",
+ "printMessage(str)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You inputted Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.11, page no. 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "multiple function arguments\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage(firstName, lastName):\n",
+ " print \"Your name is \", firstName, \" \", lastName\n",
+ "\n",
+ "print \"Enter first name:\",\n",
+ "name1 = raw_input()\n",
+ "print \"Enter last name:\",\n",
+ "name2 = raw_input()\n",
+ "printMessage(name1, name2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first name:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter last name:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kent\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is Jeff Kent\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.12, page no. 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "multiple function arguments\n",
+ "note: in Python even if the arguments are reversed, it won't give an error as \n",
+ "we do not have to specipy the data type explicitly. The meaning or the context\n",
+ "of the output may change.\n",
+ "\"\"\"\n",
+ "\n",
+ "def printMessage(thename, theage):\n",
+ " print \"Your name is \", thename, \" and your age is\", theage\n",
+ "\n",
+ "print \"Enter name:\",\n",
+ "name = raw_input()\n",
+ "print \"Enter age:\",\n",
+ "age = int(raw_input())\n",
+ "printMessage(name, age)\n",
+ "printMessage(age, name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter age:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is Jeff and your age is 34\n",
+ "Your name is 34 and your age is Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.13, page no. 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "passing argument by reference\n",
+ "\"\"\"\n",
+ "\n",
+ "def doubleIt(x):\n",
+ " print \"The number to be doubled is \", x\n",
+ " x *= 2\n",
+ " print \"The number doubled in doubleIt is \", x\n",
+ "\n",
+ "print \"Enter number: \",\n",
+ "num = int(raw_input())\n",
+ "doubleIt(num)\n",
+ "print \"The number doubled outside the function is \", num,"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number to be doubled is 34\n",
+ "The number doubled in doubleIt is 68\n",
+ "The number doubled outside the function is 34\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.14, page no. 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "pass by reference (address)\n",
+ "note: & sign is used in c++ to access a varibale by its address. There is no\n",
+ "such way or it is not a good practice to implement it. We will do the same in \n",
+ "some other way(there are multiple ways to achieve the same result)\n",
+ "\"\"\"\n",
+ "\n",
+ "li = [0]\n",
+ "def doubleIt():\n",
+ " print \"The number to be doubled is \", li[0]\n",
+ " li[0] *= 2\n",
+ " print \"The number doubled in doubleIt is \", li[0]\n",
+ " \n",
+ "print \"Enter number: \",\n",
+ "num = int(raw_input())\n",
+ "li[0] = num\n",
+ "doubleIt()\n",
+ "print \"The number doubled outside the function is \", li[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number to be doubled is 5\n",
+ "The number doubled in doubleIt is 10\n",
+ "The number doubled outside the function is 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.15, page no. 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "function to add two numbers\n",
+ "note: we are doing it in a differnt way then the one given in book\n",
+ "\"\"\"\n",
+ "\n",
+ "z = []\n",
+ "def addNumbers (a, b):\n",
+ " z.append(a + b)\n",
+ "\n",
+ "\n",
+ "print \"Enter first number: \",\n",
+ "firstNum = int(raw_input())\n",
+ "print \"Enter second number: \",\n",
+ "secondNum = int(raw_input())\n",
+ "addNumbers(firstNum, secondNum)\n",
+ "print firstNum, \" + \", secondNum, \" = \", z[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter second number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 3 + 4 = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.16, page no. 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "returning value from function\n",
+ "\"\"\"\n",
+ "\n",
+ "def addNumbers(x, y):\n",
+ " return x + y\n",
+ "\n",
+ "print \"Enter first number: \",\n",
+ "firstNum = int(raw_input())\n",
+ "print \"Enter second number: \",\n",
+ "secondNum = int(raw_input())\n",
+ "sum = addNumbers(firstNum, secondNum)\n",
+ "print firstNum, \" + \", secondNum, \" = \", sum\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter second number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 4 + 5 = 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-1.png b/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-1.png
new file mode 100644
index 00000000..683964bf
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-1.png
Binary files differ
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-2.png b/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-2.png
new file mode 100644
index 00000000..58c58b09
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-2.png
Binary files differ
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-3.png b/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-3.png
new file mode 100644
index 00000000..a8ecc8f5
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/screenshots/vaibhav-1-3.png
Binary files differ
diff --git a/C++_from_the_Ground/Chapter_10(1).ipynb b/C++_from_the_Ground/Chapter_10(1).ipynb
new file mode 100644
index 00000000..6196736b
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_10(1).ipynb
@@ -0,0 +1,207 @@
+{
+ "metadata": {
+ "name": "Chapter 10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 10: Structures and Unions<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.1, Page Number: 223<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple inventory prohram that uses an array of structures/ '''\n'''Implementing structures in python'''\n\n\nclass inv_type:\n def __init__(self):\n self.item=None\n self.cost=0\n self.retail=0\n self.on_hand=0\n self.lead_time=0\n\n#Variable declaration\nsize=100 \ninvtry = []*size\ni=5 #User iput for menu selection\n\n#Initialize the array\ndef init_list():\n for t in range(size):\n invtry.append(inv_type())\n \n#get a menu selection\ndef menu():\n global i\n print \"(E)nter\"\n print \"(D)isplay\"\n print \"(U)pdate\"\n print \"(Q)uit\"\n print \"choose one: \"\n i-=1\n return i\n\n#enter items into the list\ndef enter():\n #find the first free structure\n for i in range(size):\n if not(invtry[i].item==None):\n break\n #i will be size if list is full\n if i==size:\n print \"List full.\"\n return\n input(i)\n \n#Input the information\ndef input(i):\n #Enter information; User input\n invtry[i].item=\"Gloves\"\n invtry[i].cost=10\n invtry[i].retail=25\n invtry[i].on_hand=50\n invtry[i].lead_time=10\n \n#Modify an existing item\ndef update():\n name=\"Gloves\" #User input\n for i in range(size):\n if not(name==invtry[i].item):\n break\n if i==size:\n print \"Item not found.\"\n return\n print \"Enter new information.\"\n input(i)\n \n#Display the list\ndef display():\n for t in range(size):\n if not(invtry[t].item==None):\n print invtry[t].item\n print \"Cost: $\",invtry[t].cost\n print \"Retail: $\",invtry[t].retail\n print \"On hand: \",invtry[t].on_hand\n print \"Resupply time: \",invtry[t].lead_time,\" days\"\n \n\ninit_list()\nwhile True:\n choice=menu()\n if choice==4:\n enter()\n elif choice==3:\n display()\n elif choice==2:\n update()\n elif choice==1:\n break",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "(E)nter\n(D)isplay\n(U)pdate\n(Q)uit\nchoose one: \n(E)nter\n(D)isplay\n(U)pdate\n(Q)uit\nchoose one: \nGloves\nCost: $ 10\nRetail: $ 25\nOn hand: 50\nResupply time: 10 days\n(E)nter\n(D)isplay\n(U)pdate\n(Q)uit\nchoose one: \nEnter new information.\n(E)nter\n(D)isplay\n(U)pdate\n(Q)uit\nchoose one: \n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.2, Page Number: 226<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Pass a structure(class) to a function'''\n\n#Define a structure(class) type\nclass sample:\n a=None\n ch=None\n \ndef f1(parm):\n print parm.a,\" \",parm.ch\n\n#declare arg\narg=sample() \n\n#initialize arg\narg.a=1000\narg.ch='X'\n\n#call function\nf1(arg)\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1000 X\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.3, Page Number: 227<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate structure assignments.'''\n\nclass stype:\n a=None\n b=None\n\n#Variable declaration\nsvar1=stype()\nsvar2=stype()\n\nsvar1.a=svar1.b=10\nsvar2.a=svar2.b=20\n\nprint \"Structures before assignment.\"\nprint \"svar1: \",svar1.a,' ',svar1.b\nprint \"svar1: \",svar2.a,' ',svar2.b\n\nsvar2=svar1 #assign structures\n\n#Result\nprint \"\\nStructures before assignment.\"\nprint \"svar1: \",svar1.a,' ',svar1.b\nprint \"svar1: \",svar2.a,' ',svar2.b",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Structures before assignment.\nsvar1: 10 10\nsvar1: 20 20\n\nStructures before assignment.\nsvar1: 10 10\nsvar1: 10 10\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.4, Page Number: 230<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program displays the current system time.'''\n\nimport datetime\n\ndate=datetime.datetime.now()\n\n#Result\nprint date.time()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "17:06:28.236000\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.5, Page Number: 231<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program displays the current system time.'''\n\nimport datetime\n\ndate=datetime.datetime.now()\n\n#Result\nprint date.ctime()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Sat Sep 14 17:07:14 2013\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.6, Page Number: 232<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate a reference to a structure'''\n\nclass mystruct:\n a=None\n b=None\n\n#Recieve and return by reference\ndef f(var):\n var[0].a=var[0].a*var[0].a\n var[0].b=var[0].b/var[0].b\n return var[0]\n \n#Variable declaration\nx=[]\nx.append(mystruct())\ny=mystruct()\n\n#Initializing\nx[0].a=10\nx[0].b=20\n\nprint \"Original x.a and x.b: \",x[0].a,' ',x[0].b\n\ny=f(x) #function call\n\n#Result\nprint \"Modified x.a and x.b: \",x[0].a,' ',x[0].b\nprint \"Modified y.a and y.b: \",y.a,' ',y.b\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original x.a and x.b: 10 20\nModified x.a and x.b: 100 1\nModified y.a and y.b: 100 1\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.7, Page Number: 239<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Use a union to exchange the bytes within a short integer'''\n#Class used in place of union \n\nclass swap_bytes:\n ch=[0,0]\n\n#Exchange of bytes\ndef disp_binary(u):\n t=128\n while not(t==0):\n if u&t:\n print \"1 \",\n else:\n print \"0 \",\n t=t/2\n\n#Variable declaration\nsb=swap_bytes()\n\nsb.ch[0]=15\n\nprint \"Original bytes: \",\ndisp_binary(sb.ch[1])\ndisp_binary(sb.ch[0])\n\n#Exchange bytes\ntemp=sb.ch[0]\nsb.ch[0]=sb.ch[1]\nsb.ch[1]=temp\n\n#Result\nprint \"\\nExchanged bytes: \",\ndisp_binary(sb.ch[1])\ndisp_binary(sb.ch[0])\n\n\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original bytes: 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 \nExchanged bytes: 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 \n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.8, Page Number: 240<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Display the ASCII code in binary for characters'''\n\n#Variable declaration\nch='a'\n\nwhile True:\n print \"\\n\",ch,\n print bin(ord(ch)) #Display the bit pattern for each character\n ch=chr(ord(ch)+1)\n if ch=='r':\n break",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\na 0b1100001\n\nb 0b1100010\n\nc 0b1100011\n\nd 0b1100100\n\ne 0b1100101\n\nf 0b1100110\n\ng 0b1100111\n\nh 0b1101000\n\ni 0b1101001\n\nj 0b1101010\n\nk 0b1101011\n\nl 0b1101100\n\nm 0b1101101\n\nn 0b1101110\n\no 0b1101111\n\np 0b1110000\n\nq 0b1110001\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.9, Page Number: 242<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of an example of union in python'''\n\n#Variable declaration\nch=['X','Y']\nc=\"\"\ndef disp_bits(u):\n t=128\n global c\n while not(t==0):\n if u&t:\n c=c+\"1\"\n else:\n c=c+\"0\"\n t=t/2 \n return c\n\n#Result\nprint \"union as chars: \",ch[0],ch[1]\nprint \"union as integer: \",\nc= disp_bits(ord(ch[1]))\nc= disp_bits(ord(ch[0]))\nprint int(str(c),2)\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "union as chars: X Y\nunion as integer: 22872\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_11(1).ipynb b/C++_from_the_Ground/Chapter_11(1).ipynb
new file mode 100644
index 00000000..b59e52c7
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_11(1).ipynb
@@ -0,0 +1,347 @@
+{
+ "metadata": {
+ "name": "Chapter 11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 11: Introducing the Class<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.1, Page Number: 249<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Illustration of a class in python'''\n\n#This creates the class queue\nclass queue:\n #Initialize the queue \n def __init__(self):\n self.__sloc=0\n self.__rloc=-1\n self.__q=[]\n \n #Put an integer into the queue\n def qput(self,i):\n if self.__sloc==100:\n print \"Queue is full.\"\n return\n self.__sloc+=1\n self.__q.append(i)\n \n #Get an integer from the queue\n def qget(self):\n if self.__rloc==self.__sloc:\n print \"Queue underflow\"\n return\n self.__rloc+=1\n return self.__q[self.__rloc] \n \n\n \n#Create two queue objects\nb=queue()\na=queue()\n\na.qput(10)\nb.qput(19)\n\na.qput(20)\nb.qput(1)\n\n#Result\nprint \"Contents of queue a: \",\nprint a.qget(),' ',a.qget()\n\nprint \"Contents of queue b: \",\nprint b.qget(),' ',b.qget()\n\n\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Contents of queue a: 10 20\nContents of queue b: 19 1\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.2, Page Number: 250<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate class member access'''\n \nclass myclass:\n def __init__(self):\n self.__a=None #private member\n self.b=None #public member\n #public functions\n def setlab(self,i):\n self.__a=i #refer to a\n self.b=i*i #refer to b\n return\n def geta(self):\n return self.__a #refer to a\n def reset(self):\n #call setlab using self\n self.setlab(0) #the object is already known\n \n \nob=myclass()\nob.setlab(5) #set ob.a and ob.b\nprint \"ob after setlab(5): \",ob.geta(),' ',\nprint ob.b #can access b because it is public\n\nob.b=20 #can access b because it is public\nprint \"ob after ob.b=20: \",\nprint ob.geta(),' ',ob.b\n\nob.reset()\nprint \"ob after ob.reset(): \",ob.geta(),' ',ob.b\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "ob after setlab(5): 5 25\nob after ob.b=20: 5 20\nob after ob.reset(): 0 0\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.3, Page Number: 254<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate a constructor and a destructor'''\n#The destructors of python behave a little differently.\n\n#This creates the class queue\nclass queue:\n \n #Constructor\n def __init__(self): \n self.__q=[]\n self.__rloc=-1\n self.__sloc=0\n print \"Queue initialized\"\n \n #Destructor\n def __del__(self):\n print (\"Queue destroyed\")\n \n #Put an integer into the queue\n def qput(self,i):\n if self.__sloc == 100:\n print \"Queue is full\"\n return \n self.__sloc+=1\n self.__q.append(i)\n \n #Get an integer from the queue\n def qget(self):\n if self.__rloc==self.__sloc:\n print \"Queue underflow\"\n return\n self.__rloc+=1\n return self.__q[self.__rloc]\n \n#Create two queue objects\na=queue()\n\n\na.qput(10)\na.qput(20)\nb=queue()\nb.qput(19)\n\nb.qput(1)\n\n#Result\nprint a.qget(),' ',\nprint a.qget(),' ',\nprint b.qget(),' ',\nprint b.qget(),' '\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Queue initialized\nQueue destroyed\nQueue initialized\nQueue destroyed\n10 20 19 1 \n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.4, Page Number: 257<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Parameterized Constructors'''\n\n#This creates the class queue\nclass queue: \n \n #Constructor\n def __init__(self,i): \n self.__q=[]\n self.__rloc=-1\n self.__sloc=0\n self.__who=i\n print \"Queue \",self.__who,\" initialized.\"\n \n #Destructor\n def __del__():\n print \"Queue \",self.__who,\" destroyed\"\n \n #Put an integer into the queue\n def qput(self,i):\n if self.__sloc == 100:\n print \"Queue is full\"\n return \n self.__sloc+=1\n self.__q.append(i)\n \n #Get an integer from the queue\n def qget(self):\n if self.__rloc==self.__sloc:\n print \"Queue underflow\"\n return\n self.__rloc+=1\n return self.__q[self.__rloc]\n \na=queue(1)\nb=queue(2)\n\na.qput(10)\nb.qput(19)\n\na.qput(20)\nb.qput(1)\n\n#Result\nprint a.qget(),' ',\nprint a.qget(),' ',\nprint b.qget(),' ',\nprint b.qget(),' '\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Queue 1 initialized.\nQueue destroyed\nQueue 2 initialized.\nQueue destroyed\n10 20 19 1 \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.5, Page Number: 258<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Passing more than a single arguments'''\nclass widget:\n \n #Pass two arguments to the constructor\n def __init__(self,a,b):\n self.__i=a\n self.__j=b\n \n def put_widget(self):\n print self.__i,\" \",self.__j\n\n#Initializing\nx=widget(10,20)\ny=widget(0,0)\n\nx.put_widget()\ny.put_widget()\n\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20\n0 0\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.6, Page Number: 259<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example of class'''\n\nclass myclass:\n \n #Constructor\n def __init__(self,x):\n self.a=x\n #To get the vale of a\n def get_a(self):\n return self.a\n\n#Initializing\nob=myclass(4)\n\n#Result\nprint ob.get_a()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.7, Page Number: 260<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using structures to create a class'''\n\nfrom ctypes import *\n\nclass c1(Structure):\n _fields_=[(\"__i\", c_int)] #private member\n def get_i(self): #public finctions\n return self.__i\n def put_i(self,j):\n self.__i=j\n\n#Variable declaration\ns=c1()\n\ns.put_i(10)\n\n#Result\nprint s.get_i()\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.8, Page Number: 261<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Now we use class instead'''\n\nclass c1:\n def __init__(self):\n self.__i=None #private member\n def get_i(self): #public finctions\n return self.__i\n def put_i(self,j):\n self.__i=j\n\n#Variable declaration\ns=c1()\n\ns.put_i(10)\n\n#Result\nprint s.get_i()\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.9, Page Number: 263<h3> "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Create a union-based class'''\n\nfrom ctypes import *\n\n#Creates a union\nclass u_type(Union):\n _fields_ = [(\"i\",c_short),\n (\"ch\", c_char*2)]\n #Constructor\n def __init__(self,a):\n self.i=a\n \n #Show the characters that comprise a short int.\n def showchars(self):\n print self.ch[0]\n print self.ch[1]\n \n \nu=u_type(1000)\n\n#Displays char of 1000\nu.showchars()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\ufffd\n\u0003\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.10, Page Number: 264<h3> "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple class program'''\n#There is no inline function in python\n\nclass c1:\n def __init__(self):\n self.__i=None\n def get_i(self):\n return self.i\n def put_i(self,j):\n self.i=j\n\n#Variable declaration\ns=c1()\n\ns.put_i(10)\n\n#Result\nprint s.get_i()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.11, Page Number: 265<h3> "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple class program'''\n#There is no inline functions in python\n\nclass c1:\n def __init__(self):\n self.__i=None\n def get_i(self):\n return self.i\n def put_i(self,j):\n self.i=j\n\n#Variable declaration\ns=c1()\n\ns.put_i(10)\n\n#Result\nprint s.get_i()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.12, Page Number: 267<h3> "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example of arrays of objects'''\n\nclass display:\n def __init__(self):\n width=None\n height=None\n res=None\n def set_dim(self,w,h):\n self.width=w\n self.height=h\n def get_dim(self):\n return self.width,self.height\n def set_res(self,r):\n self.res=r\n def get_res(self):\n return self.res\n \n#Variable decleration\nnames=[\"low\",\"medium\",\"high\"] \n(low,medium,high)=(0,1,2) #For enumeration type\nw=None\nh=None\ndisplay_mode=[]*3\n\nfor i in range(3):\n display_mode.append(display())\n\n#Initialize the array of objects using member functions\ndisplay_mode[0].set_res(low)\ndisplay_mode[0].set_dim(640,480)\n\ndisplay_mode[1].set_res(medium)\ndisplay_mode[1].set_dim(800,600)\n\ndisplay_mode[2].set_res(high)\ndisplay_mode[2].set_dim(1600,1200)\n\n#Result\nprint \"Available display modes: \"\nfor i in range(3):\n print names[display_mode[i].get_res()],\" : \",\n w,h=display_mode[i].get_dim()\n print w,\" by \",h",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Available display modes: \nlow : 640 by 480\nmedium : 800 by 600\nhigh : 1600 by 1200\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.13, Page Number: 268<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Initialize an array of objects'''\n\nclass samp:\n __a=None\n def __init__(self,n):\n self.__a=n\n def get_a(self):\n return self.__a\n\n#Initializing the list\nsampArray=[samp(-1),samp(-2),samp(-3),samp(-4)]\n\n#Display\nfor i in range(4):\n print sampArray[i].get_a(),' ',",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-1 -2 -3 -4 \n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.14, Page Number: 269<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two dimensional array if objects'''\n\nclass samp:\n __a=None\n __b=None\n def __init__(self,n,m):\n self.__a=n\n self.__b=m\n def get_a(self):\n return self.__a\n def get_b(self):\n return self.__b\n \n#Initializing the list\nsampArray=[[samp(1,2),samp(3,4)],\n [samp(5,6),samp(7,8)],\n [samp(9,10),samp(11,12)],\n [samp(13,14),samp(15,16)]]\n\n#Display\nfor i in range(4):\n print sampArray[i][0].get_a(),' ',\n print sampArray[i][0].get_b()\n print sampArray[i][1].get_a(),' ',\n print sampArray[i][1].get_b()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.15, Page Number: 270<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple example using an object pointer'''\n\nfrom ctypes import *\n\nclass P_example(Structure):\n __num=None\n def set_num(self,val):\n self.__num=val\n def show_num(self):\n print self.__num\n\n#Variable declaration\nob=P_example() #Declare an object to the structure\np=POINTER(P_example) #Declare a pointer to the structure\n\nob.set_num(1) #access ob directly\nob.show_num()\n\np=ob #assign p the address of ob\np.show_num() #access ob using pointer\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n1\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.16, Page Number: 271<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Pointer to array of objects'''\n\nclass P_example(Structure):\n __num=None\n def set_num(self,val):\n self.__num=val\n def show_num(self):\n print self.__num\n \n#Variable declaration\nob=[P_example(),P_example()] #Declare an object to the structure\np=POINTER(P_example) #Declare a pointer to the structure\n\nob[0].set_num(10) #access objects directly\nob[1].set_num(20)\n\np=ob #obtain pointer to first element\np[0].show_num() #access ob using pointer\n\np[1].show_num()\n\np[0].show_num()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n20\n10\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_12(1).ipynb b/C++_from_the_Ground/Chapter_12(1).ipynb
new file mode 100644
index 00000000..abad8d81
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_12(1).ipynb
@@ -0,0 +1,367 @@
+{
+ "metadata": {
+ "name": "Chapter 12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 12: A Closer Look at Classes<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.1, Page Number: 274<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of friend functions in python'''\n\nclass myclass:\n __a=None\n __b=None\n def __init__(self,i,j):\n self.__a=i\n self.__b=j\n def sum(self,x): #Friend function\n return sum1(x)\n \ndef sum1(x): \n return x._myclass__a +x._myclass__b #accessing private members\n\n#Variable declaration\nn=myclass(3,4)\n\n#Result\nprint n.sum(n)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.2, Page Number: 275<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Use a friend function'''\n\nclass c1:\n __status=None\n def set_status(self,state):\n self.__status=state\n \nclass c2:\n __status=None\n def set_status(self,state):\n self.status=state\n \n#Friend function \ndef idle(a,b):\n if a._c1__status or b._c2__status :\n return 0\n else:\n return 1\n \n#variable declarations\ndef IDLE(): #Constants\n return 0\ndef INUSE():\n return 1\nx=c1()\ny=c2()\n\nx.set_status(IDLE())\ny.set_status(IDLE())\n\nif idle(x,y):\n print \"Screen Can Be Used.\"\n \nx.set_status(INUSE())\n\nif idle(x,y):\n print \"Screen Can Be Used.\"\nelse:\n print \"Pop-up In Use.\"\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Screen Can Be Used.\nPop-up In Use.\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.3, Page Number: 277<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A function can be member of one class and a friend of another'''\n\n #Constants\ndef IDLE(): \n return 0\ndef INUSE():\n return 1\n\nclass c1:\n __status=None\n def set_status(self,state):\n self.__status=state\n def idle(self,b): #now a member of c1\n if self.__status or b._c2__status :\n return 0\n else:\n return 1\n \nclass c2:\n __status=None #IDLE if off INUSE if on screen\n def set_status(self,state):\n self.status=state\n \n#Variable declarations \nx=c1()\ny=c2()\n\nx.set_status(IDLE())\ny.set_status(IDLE())\n\nif idle(x,y):\n print \"Screen Can Be Used.\"\n \nx.set_status(INUSE())\n\nif idle(x,y):\n print \"Screen Can Be Used.\"\nelse:\n print \"Pop-up In Use.\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Screen Can Be Used.\nPop-up In Use.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.4, Page Number: 278<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Use of overloaded constructors'''\n#Printing the time passed since the functon started instead of ringing the bell.\n\nimport time,string\n\nclass timer:\n __seconds=None\n \n def __init__(self,t1,t2=None):\n if t2==None:\n if isinstance(t1,int): #seconds specified as an integer\n self.__seconds=t1\n else: #seconds specified as a string\n self.__seconds=string.atoi(t1)\n else: #time in minutes and seconds\n self.__seconds=t1*60+t2\n \n def run(self):\n t1=time.clock()\n while (time.clock()-t1)<self.__seconds:\n a=10\n print time.clock()-t1\n \n \na=timer(10)\nb=timer(\"20\")\nc=timer(1,10)\na.run() #count 10 seconds\nb.run() #count 20 seconds\nc.run() #count 1 minute,10 seconds\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10.0000009774\n20.0000009774"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n70.0000004887"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.5, Page Number: 280<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstarate dynamic initialization'''\n#Printing the time passed since the functon started instead of ringing the bell.\n\nimport time,string\n\nclass timer:\n __seconds=None\n \n def __init__(self,t1,t2=None):\n if t2==None:\n if isinstance(t1,int): #seconds specified as an integer\n self.__seconds=t1\n else: #seconds specified as a string\n self.__seconds=string.atoi(t1)\n else: #time in minutes and seconds\n self.__seconds=t1*60+t2\n \n def run(self):\n t1=time.clock()\n while (time.clock()-t1)<self.__seconds:\n a=10\n print time.clock()-t1\n \na=timer(10)\na.run()\n\nprint \"Enter number of seconds: \"\nstr=\"20\"\nb=timer(str) #initialize at the run time\nc.run()\n\nprint \"Enter minutes and seconds: \"\nmin=1\nsec=10\nc=timer(min,sec) #initialize at the run time\nc.run()\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10.0000004887\nEnter number of seconds: \n70.0000009774"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\nEnter minutes and seconds: \n70.0000009774"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.6, Page Number: 282<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate object assignment'''\n\nclass myclass:\n __a=None #private members\n __b=None\n def setab(self,i,j): #publc functons\n self.__a=i\n self.__b=j\n def showab(self):\n print \"a is \",self.__a\n print \"b is \",self.__b\n\n#Variable declaration\nob1 = myclass()\nob2 = myclass()\n\n#Intalizing\nob1.setab(10,20)\nob2.setab(0,0)\n\nprint \"ob1 before assignment: \"\nob1.showab()\nprint \"ob2 before assignment: \"\nob2.showab()\n\nob2 = ob1 #assign ob1 to ob2\n\n#Result\nprint \"ob1 after assignment: \"\nob1.showab()\nprint \"ob2 after assignment: \"\nob2.showab()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "ob1 before assignment: \na is 10\nb is 20\nob2 before assignment: \na is 0\nb is 0\nob1 after assignment: \na is 10\nb is 20\nob2 after assignment: \na is 10\nb is 20\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.7, Page Number: 283<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstration of passing objects to functions'''\n'''Implementing call by value method in python'''\n\nfrom copy import deepcopy\n \nclass OBJ:\n def set_i(self,x):\n self.__i=x\n def out_i(self):\n print self.__i,\n \ndef f(x):\n x=deepcopy(x)\n x.out_i() #outputs 10\n x.set_i(100) #this affects only local copy\n x.out_i() #outputs 100\n \n#Variable declaration\no=OBJ()\no.set_i(10)\nf(o) \no.out_i() #still outputs 10, value of i unchanged\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 100 10\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.8, Page Number: 284<h3> "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Constructors, destructors, and passing objects'''\n\nclass myclass: \n def __init__(self,i):\n self.__val=i\n print \"Constructing\"\n def __del__(self):\n print \"Destructing\"\n def getval(self):\n return self.__val\n \ndef display(ob):\n print ob.getval()\n\n#Varable declaration\na=myclass(10)\n\ndisplay(a)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constructing\nDestructing\n10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.9, Page Number: 286<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Passing objects with a pointer'''\n#The problem shown in C++, will not occur in python because it does not have pointers.\n\nfrom ctypes import *\n\nclass myclass:\n def __init__(self,i):\n print \"Allocating p\"\n self.p=pointer(c_int(i))\n def __del__(self):\n print \"Freeing p\"\n def getval(self):\n return self.p[0]\n \ndef display(ob):\n print ob.getval()\n\n#Variable declaration\na=myclass(10)\n\ndisplay(a)\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Allocating p\n10\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.10, Page Number: 287<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Passing objects by reference'''\n\nfrom ctypes import *\nclass myclass:\n def __init__(self,i):\n print \"Allocating p\"\n self.p=pointer(c_int(i))\n def __del__(self):\n print \"Freeing p\"\n def getval(self):\n return self.p[0]\n \ndef display(ob):\n print ob[0].getval()\n\n#Variable declaration\na=[]\na.append(myclass(10))\n\ndisplay(a)\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Freeing p\nAllocating p\n10\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.11, Page Number: 288<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Returning an object'''\n\nclass sample:\n __s=None\n def show(self):\n print self.__s\n def set(self,str):\n self.__s=str\n\n#Return an object of type sample\ndef input():\n str=sample()\n instr = \"Hello\" #User input\n str.set(instr)\n return str\n\n#Variable declaration\nob=sample()\n\n#assign returned object to ob\nob=input()\n\n#Result\nob.show()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.12, Page Number: 289<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Returning an object'''\n#The error shown in C++ doesnt occur here.\nclass sample:\n __s=None\n def __init__(self):\n self.__s=0\n def __del__(self): \n print \"Freeing p\"\n def show(self):\n print self.__s\n def set(self,str):\n self.__s=str\n \n#This function takes one object parameter\ndef input():\n str=sample()\n instr=\"Hello\" #User input\n str.set(instr)\n return str\n\n#Variable declaration\nob=sample()\n\n#assign returned object to ob\nob=input()\n\n#Result\nob.show()\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Freeing p\nFreeing p\nHello\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.13, Page Number: 292<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing a copy constructor'''\n#Copy construcor doesnt work in this example, it works only when explicitly called\n\nclass myclass:\n __p=None\n def __init__(self,i):\n if isinstance(i,int):\n print \"Allocating p\"\n self.__p=i\n else:\n print \"Copy constructor called\"\n self.__p=i.getval()\n def __del__(self): \n print \"Freeing p\"\n def getval(self):\n return self.__p\n \n#This function takes one object parameter\ndef display(ob):\n print ob.getval()\n\n#Variable declaration\nob=myclass(10)\n\n#Result\ndisplay(ob)\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Allocating p\n10\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.14, Page Number: 294<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing a copy constructor'''\n\n\nclass myclass:\n __p=None\n def __init__(self,i):\n if isinstance(i,int):\n print \"Allocating p\"\n self.__p=i\n else:\n print \"Copy constructor called\"\n self.__p=i.getval()\n def __del__(self): \n print \"Freeing p\"\n def getval(self):\n return self.__p\n \n\n#Variable declaration\na=myclass(10) #calls normal constructor\nb=myclass(a) #calls copy constructor\n\n\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Allocating p\nCopy constructor called\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.15, Page Number: 295<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing a copy constructor'''\n\n\nclass myclass:\n def __init__(self,i=0):\n if isinstance(i,int):\n print \"Normal constructor\"\n else:\n print \"Copy constructor\"\n\n\n#Variable declaration\na=myclass() #calls normal constructor\n\nf=myclass()\na=myclass(f) #Invoke copyconstructor\n\n\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Normal constructor\nNormal constructor\nCopy constructor\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 12.16, Page Number: 297<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of the this pointer'''\n#Here self works as this\n\nclass c1:\n def __init__(self):\n self.__i=None\n def load_i(self,val):\n self.__i=val\n def get_i(self):\n return self.__i\n \n#Variable declaration \no=c1()\n\no.load_i(100)\n\n#Result\nprint o.get_i()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_13(1).ipynb b/C++_from_the_Ground/Chapter_13(1).ipynb
new file mode 100644
index 00000000..c38dca6a
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_13(1).ipynb
@@ -0,0 +1,267 @@
+{
+ "metadata": {
+ "name": "Chapter 13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 13: Operator Overloading<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.1, Page Number: 300<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overloading operators using member functions'''\n\nclass three_d:\n def __init__(self,i=None,j=None,k=None):\n if i==None:\n self.x=self.y=self.z=0\n else:\n self.x=i\n self.y=j\n self.z=k\n #Overload +\n def __add__(self,op2):\n temp=three_d()\n temp.x=self.x + op2.x #These are integer additions\n temp.y=self.y + op2.y #and the + retains its original\n temp.z=self.z + op2.z #meaning relative to them.\n return temp\n #Overload assignment\n def __assign__(self,op2):\n self.x=op2.x #These are integer assignments\n self.y=op2.y #and the = retains its original \n self.z=op2.z #meaning relative to them\n return self\n #Show x,y,z coordinates\n def show(self):\n print self.x,\",\",self.y,\",\",self.z\n \n#Variable declaration\na=three_d(1,2,3)\nb=three_d(10,10,10)\nc=three_d()\n\na.show()\nb.show()\n\n#add a and b together\nc=a+b\nc.show()\n\n#add a,b and c together\nc=a+b+c\nc.show()\n\n#demonstrate multiple assignment\nc=b=a\nc.show()\nb.show()\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 , 2 , 3\n10 , 10 , 10\n11 , 12 , 13\n22 , 24 , 26\n1 , 2 , 3\n1 , 2 , 3\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.2, Page Number: 303<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of ++ operator in python'''\n\nclass three_d:\n def __init__(self,i=None,j=None,k=None):\n if i==None:\n self.x=self.y=self.z=0\n else:\n self.x=i\n self.y=j\n self.z=k\n #Overload +\n def __add__(self,op2):\n temp=three_d()\n temp.x=self.x + op2.x #These are integer additions\n temp.y=self.y + op2.y #and the + retains its original\n temp.z=self.z + op2.z #meaning relative to them.\n return temp\n #Overload assignment\n def __assign__(self,op2):\n self.x=op2.x #These are integer assignments\n self.y=op2.y #and the = retains its original \n self.z=op2.z #meaning relative to them\n return self\n #Overload the increment operator\n def __iadd__(self,op2):\n self.x+=op2\n self.y+=op2\n self.z+=op2\n return self\n #Show x,y,z coordinates\n def show(self):\n print self.x,\",\",self.y,\",\",self.z\n \na=three_d(1,2,3)\nb=three_d(10,10,10)\nc=three_d()\n\na.show()\nb.show()\n\n#add a and b together\nc=a+b\nc.show()\n\n#add a,b and c together\nc=a+b+c\nc.show()\n\n#demonstrate multiple assignment\nc=b=a\nc.show()\nb.show()\n \n#Increment c\nc+=1\nc.show()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 , 2 , 3\n10 , 10 , 10\n11 , 12 , 13\n22 , 24 , 26\n1 , 2 , 3\n1 , 2 , 3\n2 , 3 , 4\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.3, Page Number: 306<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of prefix and postfix ++ operator in python'''\n\nclass three_d:\n def __init__(self,i=None,j=None,k=None):\n if i==None:\n self.x=self.y=self.z=0\n else:\n self.x=i\n self.y=j\n self.z=k\n #Overload +\n def __add__(self,op2):\n temp=three_d()\n temp.x=self.x + op2.x #These are integer additions\n temp.y=self.y + op2.y #and the + retains its original\n temp.z=self.z + op2.z #meaning relative to them.\n return temp\n #Overload assignment\n def __assign__(self,op2):\n self.x=op2.x #These are integer assignments\n self.y=op2.y #and the = retains its original \n self.z=op2.z #meaning relative to them\n return self\n #Overload the increment operator\n def __iadd__(self,op2):\n self.x+=op2\n self.y+=op2\n self.z+=op2\n return self\n #Show x,y,z coordinates\n def show(self):\n print self.x,\",\",self.y,\",\",self.z\n \na=three_d(1,2,3)\nb=three_d(10,10,10)\nc=three_d()\n\na.show()\nb.show()\n\n#add a and b together\nc=a+b\nc.show()\n\n#add a,b and c together\nc=a+b+c\nc.show()\n\n#demonstrate multiple assignment\nc=b=a\nc.show()\nb.show()\n \n#Increment c (prefix)\nc+=1\nc.show()\n\n#Increment c (postfix)\nc+=1\nc.show()\n\n#Implementing prefix\nc+=1\na=c\na.show()\nc.show()\n\n#Implementing postfix\na=c\na.show()\nc+=1\nc.show()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 , 2 , 3\n10 , 10 , 10\n11 , 12 , 13\n22 , 24 , 26\n1 , 2 , 3\n1 , 2 , 3\n2 , 3 , 4\n3 , 4 , 5\n4 , 5 , 6\n4 , 5 , 6\n4 , 5 , 6\n5 , 6 , 7\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.4, Page Number: 310<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overload + using a friend'''\n\nclass three_d:\n def __init__(self,i=None,j=None,k=None):\n if i==None:\n self.x=self.y=self.z=0\n else:\n self.x=i\n self.y=j\n self.z=k\n #Overload +\n def __add__(self,op2):\n return add(self,op2)\n #Overload assignment\n def __assign__(self,op2):\n self.x=op2.x #These are integer assignments\n self.y=op2.y #and the = retains its original \n self.z=op2.z #meaning relative to them\n return self\n #Show x,y,z coordinates\n def show(self):\n print self.x,\",\",self.y,\",\",self.z\n \n#friending the funcion\ndef add(op1,op2):\n temp=three_d()\n temp.x=op1.x + op2.x #These are integer additions\n temp.y=op1.y + op2.y #and the + retains its original\n temp.z=op1.z + op2.z #meaning relative to them.\n return temp\n\na=three_d(1,2,3)\nb=three_d(10,10,10)\nc=three_d()\n\na.show()\nb.show()\n\n#add a and b together\nc=a+b\nc.show()\n\n#add a,b and c together\nc=a+b+c\nc.show()\n\n#demonstrate multiple assignment\nc=b=a\nc.show()\nb.show()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 , 2 , 3\n10 , 10 , 10\n11 , 12 , 13\n22 , 24 , 26\n1 , 2 , 3\n1 , 2 , 3\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.5, Page Number: 311<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Operator overloading when object is on the right side of the operator'''\n\nclass CL:\n def __init__(self):\n self.count=0\n def __assign__(self,obj):\n self.count=obj.count\n return self\n def __add__(self,i): \n return add(self,i)\n def __radd__(self,i):\n return radd(self,i)\n\n#This handles ob + int\ndef add(ob,i):\n temp=CL()\n temp.count=ob.count+i\n return temp\n \n#This handles int + ob \ndef radd(ob,i):\n temp=CL()\n temp.count=i+ob.count\n return temp\n\n#Variable declaration\no=CL()\no.count = 10\n\n#Result\nprint o.count, #outputs 10\no=10+o\nprint o.count, #outputs 20\no=o+12\nprint o.count #outputs 32\n\n\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 32\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.6, Page Number: 314<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of prefix and postfix ++ as a friend function'''\n\nclass three_d:\n def __init__(self,i=None,j=None,k=None):\n if i==None:\n self.x=self.y=self.z=0\n else:\n self.x=i\n self.y=j\n self.z=k\n #Overload +\n def __add__(self,op2):\n return add(self,op2)\n #Overload assignment\n def __assign__(self,op2):\n self.x=op2.x #These are integer assignments\n self.y=op2.y #and the = retains its original \n self.z=op2.z #meaning relative to them\n return self\n #Overload the increment operator\n def __iadd__(self,op2):\n return iadd(self,op2)\n #Show x,y,z coordinates\n def show(self):\n print self.x,\",\",self.y,\",\",self.z\n\n#friending the funcion\ndef add(op1,op2):\n temp=three_d()\n temp.x=op1.x + op2.x #These are integer additions\n temp.y=op1.y + op2.y #and the + retains its original\n temp.z=op1.z + op2.z #meaning relative to them.\n return temp\ndef iadd(op1,op2):\n op1.x+=op2\n op1.y+=op2\n op1.z+=op2\n return op1\n \na=three_d(1,2,3)\nb=three_d(10,10,10)\nc=three_d()\n\na.show()\nb.show()\n\n#add a and b together\nc=a+b\nc.show()\n\n#add a,b and c together\nc=a+b+c\nc.show()\n\n#demonstrate multiple assignment\nc=b=a\nc.show()\nb.show()\n \n#Increment c (prefix)\nc+=1\nc.show()\n\n#Increment c (postfix)\nc+=1\nc.show()\n\n#Implementing prefix\nc+=1\na=c\na.show()\nc.show()\n\n#Implementing postfix\na=c\na.show()\nc+=1\nc.show()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 , 2 , 3\n10 , 10 , 10\n11 , 12 , 13\n22 , 24 , 26\n1 , 2 , 3\n1 , 2 , 3\n2 , 3 , 4\n3 , 4 , 5\n4 , 5 , 6\n4 , 5 , 6\n4 , 5 , 6\n5 , 6 , 7\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.7, Page Number: 318<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n\nclass sample:\n def __init__(self,ob=0):\n if isinstance(ob,int):\n #Normal constructor\n self.__s=\"\"\n return\n else:\n #Copy constructor\n self.__s=obj._sample__s\n return\n def __del__(self):\n print \"Freeing s\"\n def show(self):\n print self.__s\n def set(self,str):\n self.__s=str\n def __assign__(self,ob): #Overload assignment\n self.s=ob._sample__s\n return self\n \ndef input():\n str=sample()\n instr=\"Hello\" #User input\n str.set(instr)\n return str\n\nob=sample()\n\n#assign returned object to ob\nob=input()\n\n#Result\nob.show()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Freeing s\nFreeing s\nHello\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.8, Page Number: 321<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overload []'''\n#There is on implementation of overloading [], hence we use normal functions\n\n\nclass atype:\n def __init__(self):\n self.__a=[]\n for i in range(SIZE):\n self.__a.append(i)\n def a(self,i):\n return self.__a[i]\n \n#Variable declaration\nSIZE=3\nob=atype()\n\n#Result\nprint ob.a(2),\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.9, Page Number: 322<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overload []'''\n\nclass atype:\n def __init__(self):\n self.__a=[]\n for i in range(SIZE):\n self.__a.append(i)\n def a(self,i,j=None):\n if j==None:\n return self.__a[i]\n else:\n self.__a[i]=j\n \n#Variable declaration\nSIZE=3 \nob=atype()\n\nprint ob.a(2), #displays 2\n\nob.a(2,25)\n\nprint ob.a(2) #now displays 25",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2 25\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.10, Page Number: 323<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A safe array example'''\n\nclass atype:\n def __init__(self):\n self.__a=[]\n for i in range(SIZE):\n self.__a.append(i)\n def a(self,i,j=None):\n if (i<0 or i>SIZE-1):\n print \"Index value of\",\n print i,\"is out of bounds.\"\n return\n if j==None:\n return self.__a[i]\n else:\n self.__a[i]=j\n \n#Variable declaration\nSIZE=3 \nob=atype()\n\nprint ob.a(2), #displays 2\n\nob.a(2,25)\n\nprint ob.a(2) #now displays 25\n\nob.a(44,3) #generates runtime error, 3 out of bounds",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2 25\nIndex value of 44 is out of bounds.\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.11, Page Number: 324<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overload ()'''\n\nclass three_d:\n def __init__(self,i=None,j=None,k=None):\n if i==None:\n self.x=self.y=self.z=0 #3-D coordinates\n else:\n self.x=i\n self.y=j\n self.z=k\n #Show X,Y,Z coordinates\n def show(self):\n print self.x,\",\",self.y,\",\",self.z\n #Overload ()\n def a(self,a,b,c):\n temp = three_d()\n temp.x=self.x+a\n temp.y=self.y+b\n temp.z=self.z+c\n return temp\n \n#Variable declaration\nob1=three_d(1,2,3)\n\nob2=ob1.a(10,11,12) #invoke operator ()\n\n#Result\nprint \"ob1: \",\nob1.show()\nprint \"ob2: \",\nob2.show()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "ob1: 1 , 2 , 3\nob2: 11 , 13 , 15\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 13.12, Page Number: 326<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Expanding the string type'''\n\nclass str_type:\n def __init__(self,str=\"\"):\n self.__string=str\n #String concatenation\n def __add__(self,str):\n temp=str_type()\n if isinstance(str,str_type):\n temp.__string=self.__string+str.__string\n else:\n temp.__string=self.__string+str\n return temp\n #String copy\n def __assign__(self,str):\n if isinstance(str,str_type):\n self.__string=str.__string\n else:\n self.__string=str\n return self\n def show_str(self):\n print self.__string\n \na=str_type(\"Hello \")\nb=str_type(\"There\")\nc=a+b\nc.show_str()\n\na=str_type(\"to program in because\")\na.show_str()\n\nb=c=str_type(\"C++ is fun\")\n\nc=c+\" \"+a+\" \"+b\nc.show_str()\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello There\nto program in because\nC++ is fun to program in because C++ is fun\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_14(1).ipynb b/C++_from_the_Ground/Chapter_14(1).ipynb
new file mode 100644
index 00000000..0a3df4c8
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_14(1).ipynb
@@ -0,0 +1,320 @@
+{
+ "metadata": {
+ "name": "Chapter 14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 14: Inheritance<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.1, Page Number: 333<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate inheritance'''\n\n#Define base class for vehicles\nclass road_vehicle:\n def __init__(self):\n self.__wheels=None\n self.__passengers=None\n def set_wheels(self,num):\n self.__wheels=num\n def get_wheels(self):\n return self.__wheels\n def set_pass(self,num):\n self.__passengers=num\n def get_pass(self):\n return self.__passengers\n\n#Define a truck\nclass truck(road_vehicle):\n def __init__(self):\n self.__cargo=None\n def set_cargo(self,size):\n self.__cargo=size\n def get_cargo(self):\n return self.__cargo\n def show(self):\n print \"wheels: \",self.get_wheels()\n print \"passengers: \",self.get_pass()\n print \"cargo capacity in cubic feet: \",self.__cargo\n \n#Define an enum type\n(car,van,wagon)=(1,2,3)\ntype=[\"car\",\"van\",\"wagon\"]\n \n#Define an automobile\nclass automobile(road_vehicle):\n def __init__(self):\n self.car_type=None\n def set_type(self,t):\n self.car_type=t\n def get_type(self):\n return self.car_type\n def show(self):\n print \"wheels: \",self.get_wheels()\n print \"passengers: \",self.get_pass()\n print \"type: \",\n if self.get_type()==1:\n print \"car\"\n elif self.get_type()==2:\n print \"van\"\n elif self.get_type()==3:\n print \"wagon\"\n \n#Variable declaration\nt1=truck()\nt2=truck()\nc=automobile()\n\nt1.set_wheels(18)\nt1.set_pass(2)\nt1.set_cargo(3200)\n\nt2.set_wheels(6)\nt2.set_pass(3)\nt2.set_cargo(1200)\n\nt1.show()\nt2.show()\n\nc.set_wheels(4)\nc.set_pass(6)\nc.set_type(van)\n\nc.show() \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "wheels: 18\npassengers: 2\ncargo capacity in cubic feet: 3200\nwheels: 6\npassengers: 3\ncargo capacity in cubic feet: 1200\nwheels: 4\npassengers: 6\ntype: van\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.2, Page Number: 335<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Base class access control'''\n\nclass base:\n def __init__(self):\n self.__i=self.__j=None\n def set(self,a,b):\n self.__i=a\n self.__j=b\n def show(self):\n print self.__i,self.__j\n \nclass derived(base):\n def __init__(self,x):\n self.__k=x\n def showk(self):\n print self.__k\n \n#Variable declaration\nob = derived(3)\n\nob.set(1,2) #access member of base\nob.show() #access member of base\n\nob.showk() #uses member of derived class\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 2\n3\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.3, Page Number: 337<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing protected members'''\n\nclass base:\n def __init__(self):\n self.__i=self.__j=None #These act as protected members\n def set(self,a,b):\n self.__i=a\n self.__j=b\n def show(self):\n print self.__i,self.__j\n \nclass derived(base):\n def __init__(self):\n self.__k=None\n def setk(self):\n self.__k=self._base__i*self._base__j #accessing private variables in derived class\n def showk(self):\n print self.__k\n \n#Variable declaration\nob = derived()\n\nob.set(2,3) #OK, known to be derived\nob.show() #OK, known to be derived\n\nob.setk()\nob.showk() #uses member of derived class\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2 3\n6\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.4, Page Number: 338<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Hierarchical Inheritance in python'''\n\nclass base:\n def __init__(self):\n self.__i=None\n self.__j=None\n def set(self,a,b):\n self.__i=a\n self.__j=b\n def show(self):\n print self.__i,self.__j\n \nclass derived1(base):\n def __init__(self):\n self.__k=None\n def setk(self):\n self.__k=self._base__i*self._base__j\n def showk(self):\n print self.__k\n\nclass derived2(derived1):\n def __init__(self):\n self.__m=None\n def setm(self):\n self.__m=self._base__i-self._base__j\n def showm(self):\n print self.__m\n \n \n#Variable declaration\nob1 = derived1()\nob2 = derived2()\n\nob1.set(2,3) #access member of base\nob1.show() #access member of base\nob1.setk() #uses member of derived1 class\nob1.showk() #uses member of derived1 class\n\nob2.set(3,4) #access member of base\nob2.show() #access member of base\nob2.setk() #access member of derived1 class\nob2.setm() #access member of derived2 class\nob2.showk() #uses member of derived1 class\nob2.showm() #uses member of derived1 class\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2 3\n6\n3 4\n12\n-1\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.5, Page Number: 341<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate inheriting a protected base class'''\n\nclass base:\n def __init__(self):\n self.__i=None\n self._j=None\n self.k=None\n def seti(self,a):\n self.__i=a\n def geti(self):\n return i\n \nclass derived(base):\n def setj(self,a):\n self._j=a\n def setk(self,a):\n self.k=a\n def getj(self):\n return self._j\n def getk(self):\n return self.k\n \n#Variable declaration \nob=derived()\n\nob.setk(10)\nprint ob.getk(),\nob.setj(12)\nprint ob.getj()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 12\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.6, Page Number: 342<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example of multiple base classes'''\n\nclass base1:\n def __init__(self):\n self.x=None\n def showx(self):\n print self.x\n \nclass base2:\n def __init__(self):\n self.y=None\n def showy(self):\n print self.y\n \nclass derived(base1,base2):\n def set(self,i,j):\n self.x=i\n self.y=j\n \n#Variable declaration\nob = derived()\n\nob.set(10,20) #provided by derived\nob.showx() #from base1\nob.showy() #from base2\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n20\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.7, Page Number: 343<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Constructors, Destructors and Inheritance'''\n\nclass base:\n def __init__(self):\n print \"Constructing base\"\n def __del__(self):\n print \"Destructing base\"\n\nclass derived(base):\n def __init__(self):\n base.__init__(self)\n print \"Constructing derived\"\n def __del__(self):\n print \"Destructing derived\"\n for b in self.__class__.__bases__:\n b.__del__(self)\n\n#Variable declaration\nob=derived()\n\n#Does nothing but construct and destruct ob",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constructing base\nConstructing derived\nDestructing derived\nDestructing base\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.8, Page Number: 344<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Inheritance 344 eg:14.8\n'''Constructors, Destructors and Inheritance'''\n\nclass base:\n def __init__(self):\n print \"Constructing base\"\n def __del__(self):\n print \"Destructing base\"\n\nclass derived1(base):\n def __init__(self):\n base.__init__(self)\n print \"Constructing derived1\"\n def __del__(self):\n print \"Destructing derived1\"\n super(derived1,self).__del__(self)\n\nclass derived2(derived1):\n def __init__(self):\n derived1.__init__(self)\n print \"Constructing derived2\"\n def __del__(self):\n print \"Destructing derived2\"\n super(self.__class__,self).__del__(self)\n \n#Variable declaration\nob=derived2()\n\n#Does nothing but construct and destruct ob",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.9, Page Number: 345<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Constructors and Destructors in Multiple Inheritance'''\n\nclass base1:\n def __init__(self):\n print \"Constructing base1\"\n def __del__(self):\n print \"Destructing base1\"\n \nclass base2:\n def __init__(self):\n print \"Constructing base2\"\n def __del__(self):\n print \"Destructing base2\"\n \nclass derived(base1,base2):\n def __init__(self):\n for b in self.__class__.__bases__:\n b.__init__(self)\n print \"Constructing derived\"\n def __del__(self):\n print \"Destructing derived\"\n for b in self.__class__.__bases__:\n b.__del__(self)\n \n#Variable declaration\nob = derived()\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constructing base1\nConstructing base2\nConstructing derived\nDestructing derived\nDestructing base1\nDestructing base2\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.10, Page Number: 347<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Passing parameters to parent constructors in inheritance'''\n\nclass base:\n def __init__(self,x):\n self._i=x\n print \"Constructing base\"\n def __del__(self):\n print \"Destructing base\"\n\nclass derived(base):\n def __init__(self,x,y):\n base.__init__(self,y)\n self.__j=x\n print \"Constructing derived\"\n def __del__(self):\n print \"Destructing derived\"\n for b in self.__class__.__bases__:\n b.__del__(self)\n def show(self):\n print self._i,self.__j\n\n#Variable declaration\nob=derived(3,4)\n\n#Result\nob.show() #shows 4 3",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constructing base\nConstructing derived\nDestructing derived\nDestructing base\n4 3\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.11, Page Number: 348<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example that uses multiple base classes'''\n\nclass base1:\n def __init__(self,x):\n self._i=x\n print \"Constructing base1\"\n def __del__(self):\n print \"Destructing base1\"\n \nclass base2:\n def __init__(self,x):\n self._k=x\n print \"Constructing base2\"\n def __del__(self):\n print \"Destructing base2\"\n \nclass derived(base1,base2):\n def __init__(self,x,y,z):\n self.__j=x\n i=0\n for b in self.__class__.__bases__:\n if i==0:\n b.__init__(self,y)\n else :\n b.__init__(self,z)\n i+=1\n print \"Constructing derived\"\n def __del__(self):\n print \"Destructing derived\"\n for b in self.__class__.__bases__:\n b.__del__(self)\n def show(self):\n print self._i,self.__j,self._k\n \n#Variable declaration\nob = derived(3,4,5)\n\n#Result\nob.show()\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constructing base1\nConstructing base2\nConstructing derived\nDestructing derived\nDestructing base1\nDestructing base2\n4 3 5\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.12, Page Number: 348<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Another example that uses multiple base classes'''\n\nclass base1:\n def __init__(self,x):\n self._i=x\n print \"Constructing base1\"\n def __del__(self):\n print \"Destructing base1\"\n \nclass base2:\n def __init__(self,x):\n self._k=x\n print \"Constructing base2\"\n def __del__(self):\n print \"Destructing base2\"\n \nclass derived(base1,base2):\n def __init__(self,x,y):\n i=0\n for b in self.__class__.__bases__:\n if i==0:\n b.__init__(self,x)\n else :\n b.__init__(self,y)\n i+=1\n print \"Constructing derived\"\n def __del__(self):\n print \"Destructing derived\"\n for b in self.__class__.__bases__:\n b.__del__(self)\n def show(self):\n print self._i,self._k\n \n#Variable declaration\nob = derived(3,4)\n\n#Result\nob.show()\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constructing base1\nConstructing base2\nConstructing derived\nDestructing derived\nDestructing base1\nDestructing base2\n3 4\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.13, Page Number: 351<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Acessing member variables'''\n\nclass base:\n def __init__(self):\n self.__i=None\n self.j=self.k=None\n def seti(self,x):\n self.__i=x\n def geti(self):\n return self.__i\n\nclass derived(base):\n def __init__(self):\n self.a=None\n\n\n#Variable declaration\nob=derived()\n\nob._base__i=10 #Accessing private members of base class\nob.j=20 #legal because j and k are public variable in base\nob.k=30\n\nob.a=40 #legal because a is public in derived class\nob.seti(10)\n\n#Result\nprint ob.geti(),ob.j,ob.a",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 40\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.14, Page Number: 354<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Virtual base class'''\n#All classes in pyhton are effectively virtual, hence scope resolution is not needed\n\nclass base:\n def __init__(self):\n self.i=None\n\n#derived1 inherits base\nclass derived1(base):\n def __init__(self):\n self.__j=None\n \n#derived2 inherits base\nclass derived2(base):\n def __init__(self):\n self.__k=None\n\n#derived3 inherits from both derived1 and derived2\nclass derived3(derived1,derived2):\n def __init__(self):\n self.__sum=None\n \n#Variable declaration\nob=derived3()\n\nob.i=10\nob.j=20\nob.k=30\n\nob.sum=ob.i+ob.j+ob.k\n\n#Result\nprint ob.i,ob.j,ob.k,ob.sum",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 30 60\n"
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 14.15, Page Number: 355<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Virtual base class'''\n#All classes in pyhton are effectively virtual, hence virtual keyword is not needed\n\nclass base:\n def __init__(self):\n self.i=None\n\n#derived1 inherits base\nclass derived1(base):\n def __init__(self):\n self.__j=None\n \n#derived2 inherits base\nclass derived2(base):\n def __init__(self):\n self.__k=None\n\n#derived3 inherits from both derived1 and derived2\nclass derived3(derived1,derived2):\n def __init__(self):\n self.__sum=None\n \n#Variable declaration\nob=derived3()\n\nob.i=10\nob.j=20\nob.k=30\n\nob.sum=ob.i+ob.j+ob.k\n\n#Result\nprint ob.i,ob.j,ob.k,ob.sum",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 30 60\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_15(1).ipynb b/C++_from_the_Ground/Chapter_15(1).ipynb
new file mode 100644
index 00000000..53e0df9a
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_15(1).ipynb
@@ -0,0 +1,147 @@
+{
+ "metadata": {
+ "name": "Chapter 15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 15: Virtual Functions and Polymorphism<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 15.1, Page Number: 358<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using base pointers on derived class objects'''\n\n\nclass B_class:\n def __init__(self):\n self.author=None\n def put_author(self,s):\n self.author=s\n def show_author(self):\n print self.author\n \nclass D_class(B_class):\n def __init__(self):\n self.title=None\n def put_title(self,num):\n self.title=num\n def show_title(self):\n print \"Title:\",self.title\n \n#Variable declaration\np=[B_class()] #acts as a pointer to B_class type\nB_ob=B_class()\n\ndp=[D_class()] #acts as a pointer to D_class type\nD_ob=D_class()\n\np[0]=B_ob #assigning p to object of base\n\n\n#Access B_class via pointer\np[0].put_author(\"Tom Clancy\")\n\n#Access D_class via base pointer\np[0]=D_ob\np[0].put_author(\"William Shakespeare\")\n\n#Show that each author went into proper object\nB_ob.show_author()\nD_ob.show_author()\nprint \"\\n\"\n\n#Since put_title() and show_title() are not part of the base class, \n#they are not accessible via the base pointer p and must be accessed \n#either directly, or, as shown here, through a pointer to the \n#derived type\ndp[0]=D_ob\ndp[0].put_title(\"The Tempest\")\np[0].show_author()\ndp[0].show_title()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Tom Clancy\nWilliam Shakespeare\n\n\nWilliam Shakespeare\nTitle: The Tempest\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 15.2, Page Number: 361<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A short example that uses virtual functions'''\n#All functions in python are effectively virtual, hence virtual keyword not required\n\n\nclass base:\n def who(self): #virtual function\n print \"Base\"\n\nclass first_d(base):\n def who(self): #redifine who() relative to first_d\n print \"First derivation\"\n \nclass second_d(base):\n def who(self): #redifine who() relative to second_d\n print \"Second derivation\"\n \n \n#Variable declaration\nbase_obj=base()\np=[base()]\nfirst_obj=first_d()\nsecond_obj=second_d()\n\np[0]=base_obj\np[0].who() #access base's who\n\np[0]=first_obj\np[0].who() #access first_d's who\n\np[0]=second_obj\np[0].who() #access second_d's who\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Base\nFirst derivation\nSecond derivation\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 15.3, Page Number: 363<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example that shows virtual functions are inherited'''\n\n\nclass base:\n def who(self): #virtual function\n print \"Base\"\n\nclass first_d(base):\n def who(self): #redifine who() relative to first_d\n print \"First derivation\"\n \nclass second_d(base):\n #who not defined\n pass\n \n \n#Variable declaration\nbase_obj=base()\np=[base()]\nfirst_obj=first_d()\nsecond_obj=second_d()\n\np[0]=base_obj\np[0].who() #access base's who\n\np[0]=first_obj\np[0].who() #access first_d's who\n\np[0]=second_obj\np[0].who() #access base's who because\n #second_d does not redefine it.\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Base\nFirst derivation\nBase\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 15.4, Page Number: 364<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Virtual function in hierarchical inheritance'''\n\n\nclass base:\n def who(self): #virtual function\n print \"Base\"\n\nclass first_d(base):\n def who(self): #redifine who() relative to first_d\n print \"First derivation\"\n \n#second_d now inherited first_d -- not base\nclass second_d(first_d):\n #who not defined\n pass\n \n \n#Variable declaration\nbase_obj=base()\np=[base()]\nfirst_obj=first_d()\nsecond_obj=second_d()\n\np[0]=base_obj\np[0].who() #access base's who\n\np[0]=first_obj\np[0].who() #access first_d's who\n\np[0]=second_obj\np[0].who() #access first_d's who because\n #second_d does not redefine it.\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Base\nFirst derivation\nFirst derivation\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 15.5, Page Number: 366<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple application of virtual functions'''\n\nclass figure:\n def __init__(self):\n self._x=None\n self._y=None\n def set_dim(self,i,j):\n self._x=i\n self._y=j\n def show_area(self):\n print \"No area computation defined\",\n print \"for this class.\"\n \nclass triangle(figure):\n def show_area(self):\n print \"Triangle with height\",\n print self._x,\"and base\",self._y,\n print \"has an area of\",\n print self._x*0.5*self._y,\".\"\n \nclass rectangle(figure):\n def show_area(self):\n print \"Rectangle with dimensions\",\n print self._x,\"x\",self._y,\n print \"has an area of\",\n print self._x*self._y,\".\"\n \n#Variable declaration\np=[figure()] #pointer to base type\nt=triangle() #objects of derived type\nr=rectangle()\n\np[0]=t\np[0].set_dim(10.0,5.0)\np[0].show_area()\n\np[0]=r\np[0].set_dim(10.0,5.0)\np[0].show_area()\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Triangle with height 10.0 and base 5.0 has an area of 25.0 .\nRectangle with dimensions 10.0 x 5.0 has an area of 50.0 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 15.6, Page Number: 368<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An expanded version of previous program'''\n\nclass figure:\n def __init__(self):\n self._x=None\n self._y=None\n def set_dim(self,i,j=0):\n self._x=i\n self._y=j\n def show_area(self):\n print \"No area computation defined\",\n print \"for this class.\"\n \nclass triangle(figure):\n def show_area(self):\n print \"Triangle with height\",\n print self._x,\"and base\",self._y,\n print \"has an area of\",\n print self._x*0.5*self._y,\".\"\n \nclass rectangle(figure):\n def show_area(self):\n print \"Rectangle with dimensions\",\n print self._x,\"x\",self._y,\n print \"has an area of\",\n print self._x*self._y,\".\"\n \nclass circle(figure):\n def show_area(self):\n print \"Circle with radius\",\n print self._x,\n print \"has an area of\",\n print 3.14*self._x*self._x,\".\"\n \n \n#Variable declaration\np=[figure()] #pointer to base type\nt=triangle() #objects of derived type\nr=rectangle()\nc=circle()\n\np[0]=t\np[0].set_dim(10.0,5.0)\np[0].show_area()\n\np[0]=r\np[0].set_dim(10.0,5.0)\np[0].show_area()\n\np[0]=c\np[0].set_dim(9.0)\np[0].show_area()\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Triangle with height 10.0 and base 5.0 has an area of 25.0 .\nRectangle with dimensions 10.0 x 5.0 has an area of 50.0 .\nCircle with radius 9.0 has an area of 254.34 .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_16(1).ipynb b/C++_from_the_Ground/Chapter_16(1).ipynb
new file mode 100644
index 00000000..afb4b4f1
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_16(1).ipynb
@@ -0,0 +1,267 @@
+{
+ "metadata": {
+ "name": "Chapter 16"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 16: Templates<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.1, Page Number: 376<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of templates'''\n\n#The concept of template in in-built in python,hence this is a function template\ndef swapargs(a,b):\n temp=a[0]\n a[0]=b[0]\n b[0]=temp\n\n#Variable declaration\ni=[10]\nj=[20]\nx=[10.1]\ny=[23.3]\na=['x']\nb=['z']\n\nprint \"Original i, j: \",i[0],j[0]\nprint \"Original x,y: \",x[0],y[0]\nprint \"Original a,b: \",a[0],b[0]\n\nswapargs(i,j) #swap integers\nswapargs(x,y) #swap floats\nswapargs(a,b) #swap chars\n\n#Result\nprint \"Swapped i, j: \",i[0],j[0]\nprint \"Swapped x,y: \",x[0],y[0]\nprint \"Swapped a,b: \",a[0],b[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original i, j: 10 20\nOriginal x,y: 10.1 23.3\nOriginal a,b: x z\nSwapped i, j: 20 10\nSwapped x,y: 23.3 10.1\nSwapped a,b: z x\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.2, Page Number: 378<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Template for two generic types'''\n\ndef myfunc(x,y):\n print x,y\n \nmyfunc(10,\"hi\")\nmyfunc(0.23,10L)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 hi\n0.23 10\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.3, Page Number: 379<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overloading generic functions'''\n\ndef swapargs(a,b):\n if isinstance(a[0],int): #integer version\n temp=a[0]\n a[0]=b[0]\n b[0]=temp\n print \"Inside swapargs int specialization.\"\n else: #generic version\n temp=a[0]\n a[0]=b[0]\n b[0]=temp\n print \"Inside template swapargs.\"\n\n#Variable declaration\ni=[10]\nj=[20]\nx=[10.1]\ny=[23.3]\na=['x']\nb=['z']\n\nprint \"Original i, j: \",i[0],j[0]\nprint \"Original x,y: \",x[0],y[0]\nprint \"Original a,b: \",a[0],b[0]\n\nswapargs(i,j) #calls explicitly overloaded swapargs()\nswapargs(x,y) #calls generic swapargs()\nswapargs(a,b) #calls generic swapargs()\n\n#Result\nprint \"Swapped i, j: \",i[0],j[0]\nprint \"Swapped x,y: \",x[0],y[0]\nprint \"Swapped a,b: \",a[0],b[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original i, j: 10 20\nOriginal x,y: 10.1 23.3\nOriginal a,b: x z\nInside swapargs int specialization.\nInside template swapargs.\nInside template swapargs.\nSwapped i, j: 20 10\nSwapped x,y: 23.3 10.1\nSwapped a,b: z x\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.4, Page Number: 381<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overload a function template declaration'''\n\n#Function version of f() template\ndef f(a,b=None):\n if(b==None): #First version of f()\n print \"Inside f(X a)\"\n else: #Second version of f()\n print \"Inside f(X a, Y b)\"\n \nf(10) #calls f(X)\nf(10,20) #calls f(X,Y)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Inside f(X a)\nInside f(X a, Y b)\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.5, Page Number: 382<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing templates in python'''\n\n#Display data specified number of times.\ndef repeat(data,times):\n while times:\n print data\n times-=1\n \nrepeat(\"This is a test\",3)\nrepeat(100,5)\nrepeat(99.0/2, 4)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This is a test\nThis is a test\nThis is a test\n100\n100\n100\n100\n100\n49.5\n49.5\n49.5\n49.5\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.6, Page Number: 383<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A generic version of myabs()'''\n\ndef myabs(val):\n if val<0:\n return -val\n else:\n return val\n\n#Result\nprint myabs(-10)\nprint myabs(-10.0)\nprint myabs(-10L)\nprint myabs(-10.0)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n10.0\n10\n10.0\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.7, Page Number: 385<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing a generic queue class'''\n\ndef SIZE():\n return 100\nclass queue:\n def __init__(self):\n self.q=[]\n self.sloc=self.rloc=0\n #Put an object into the queue\n def qput(self,i):\n if self.sloc==SIZE():\n print \"Queue is full.\"\n return\n self.sloc+=1\n self.q.append(i)\n #Get an object from the queue.\n def qget(self):\n if self.rloc==self.sloc:\n print \"Queue Underflow.\"\n return\n a=self.rloc\n self.rloc+=1\n return self.q[a]\n \n#Create two integer queues\na=queue()\nb=queue()\na.qput(10)\nb.qput(19)\na.qput(20)\nb.qput(1)\n\nprint a.qget(),\nprint a.qget(),\nprint b.qget(),\nprint b.qget()\n\n#Create two double queues\nc=queue()\nd=queue()\nc.qput(10.12)\nd.qput(19.99)\nc.qput(-20.0)\nd.qput(0.986)\n\nprint c.qget(),\nprint c.qget(),\nprint d.qget(),\nprint d.qget()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 19 1\n10.12 -20.0 19.99 0.986\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.8, Page Number: 387<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two generic types in a class'''\n\nclass myclass:\n def __init__(self,a,b):\n self.__i=a\n self.__j=b\n def show(self):\n print self.__i,self.__j\n\nob1=myclass(10,0.23)\nob2=myclass('X',\"This is a test\")\n\n#Result\nob1.show() #Show int,double\nob2.show() #Show char.char*\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 0.23\nX This is a test\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.9, Page Number: 388<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A generic safe array example'''\n\n#Defining constant\ndef SIZE():\n return 10\n\nclass atype:\n def __init__(self):\n self.a=[]\n for i in range(SIZE()):\n self.a.append(i)\n #Implementing the [] overloading\n def op1(self,i,j):\n if (i<0 or i>=SIZE()):\n print \"\\nIndex value of \",\n print i,\" is out-of-bounds.\"\n return \n self.a[i]=j\n def op2(self,i):\n if (i<0 or i>SIZE()-1):\n print \"\\nIndex value of \",\n print i,\" is out-of-bounds.\"\n return\n return self.a[i]\n \n#Variable declaration\nintob=atype()\ndoubleob=atype()\n \nprint \"Integer array: \",\nfor i in range(SIZE()):\n intob.op1(i,i)\nfor i in range(SIZE()):\n print intob.op2(i),\n \nprint \"\"\n\nprint \"Double array: \",\nfor i in range(SIZE()):\n doubleob.op1(i,float(i)/3)\nfor i in range(SIZE()):\n print doubleob.op2(i),\n \nintob.op1(12,100)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Integer array: 0 1 2 3 4 5 6 7 8 9 \nDouble array: 0.0 0.333333333333 0.666666666667 1.0 1.33333333333 1.66666666667 2.0 2.33333333333 2.66666666667 3.0 \nIndex value of 12 is out-of-bounds.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.10, Page Number: 389<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing non-type template arguments'''\n\nclass atype:\n def __init__(self,size):\n self.a=[]\n self.size=size\n for i in range(size):\n self.a.append(i)\n #Implementing the [] overloading\n def op1(self,i,j):\n if (i<0 or i>self.size-1):\n print \"\\nIndex value of \",\n print i,\" is out-of-bounds.\"\n return\n self.a[i]=j\n def op2(self,i):\n if (i<0 or i>self.size-1):\n print \"\\nIndex value of \",\n print i,\" is out-of-bounds.\"\n return\n return self.a[i]\n \n#Variable declaration\nintob=atype(10)\ndoubleob=atype(15)\n \nprint \"Integer array: \",\nfor i in range(10):\n intob.op1(i,i)\nfor i in range(10):\n print intob.op2(i),\n \nprint \"\"\n\nprint \"Double array: \",\nfor i in range(15):\n doubleob.op1(i,float(i)/3)\nfor i in range(15):\n print doubleob.op2(i),\n \nintob.op1(12,100) #generates runtime error\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Integer array: 0 1 2 3 4 5 6 7 8 9 \nDouble array: 0.0 0.333333333333 0.666666666667 1.0 1.33333333333 1.66666666667 2.0 2.33333333333 2.66666666667 3.0 3.33333333333 3.66666666667 4.0 4.33333333333 4.66666666667 \nIndex value of 12 is out-of-bounds.\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.11, Page Number: 391<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A generic safe array example with default arguments'''\n\nclass atype:\n def __init__(self,size=10):\n self.a=[]\n for i in range(size):\n self.a.append(i)\n #Implementing the [] overloading\n def op1(self,i,j):\n if (i<0 and i>SIZE()-1):\n print \"Index value of \"\n print i,\" is out-of-bounds.\"\n exit(1)\n self.a[i]=j\n def op2(self,i):\n if (i<0 and i>SIZE()-1):\n print \"Index value of \"\n print i,\" is out-of-bounds.\"\n exit()\n return self.a[i]\n \n#Variable declaration\nintob=atype(100)\ndoubleob=atype()\ndefarray=atype()\n \nprint \"Integer array: \",\nfor i in range(100):\n intob.op1(i,i)\nfor i in range(100):\n print intob.op2(i),\n \nprint \"\"\n\nprint \"Double array: \",\nfor i in range(10):\n doubleob.op1(i,float(i)/3)\nfor i in range(10):\n print doubleob.op2(i),\n \nprint \"\"\n\nprint \"Defarray array: \",\nfor i in range(10):\n doubleob.op1(i,i)\nfor i in range(10):\n print doubleob.op2(i),\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Integer array: 0 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 \nDouble array: 0.0 0.333333333333 0.666666666667 1.0 1.33333333333 1.66666666667 2.0 2.33333333333 2.66666666667 3.0 \nDefarray array: 0 1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 16.12, Page Number: 393<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate class specialization'''\n\nclass myclass:\n def __init__(self,a):\n if isinstance(a,int):\n print \"Inside myclass<int>specialization\"\n self.__x=a*a\n else:\n print \"Inside generic myclass\"\n self.__x=a\n def getx(self):\n return self.__x\n \nd=myclass(10.1)\nprint \"double: \",d.getx(),\"\\n\"\n\ni=myclass(5)\nprint \"int: \",i.getx()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Inside generic myclass\ndouble: 10.1 \n\nInside myclass<int>specialization\nint: 25\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_17(1).ipynb b/C++_from_the_Ground/Chapter_17(1).ipynb
new file mode 100644
index 00000000..8694627c
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_17(1).ipynb
@@ -0,0 +1,307 @@
+{
+ "metadata": {
+ "name": "Chapter 17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 17: Exception Handling<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.1, Page Number: 397<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple exception handling example'''\n\nprint \"start\"\n\ntry: #start a try block\n print \"Inside try block\"\n raise Exception(99) #raise an error\n print \"This will not execute\"\nexcept Exception,i: #catch an error\n print \"Caught an exception -- value is:\",\n print i\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nInside try block\nCaught an exception -- value is: 99\nend\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.2, Page Number: 399<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''A simple exception handling example'''\n\nimport sys\n\n\n\ndef main():\n print \"start\"\n try: #start a try block\n print \"Inside try block\"\n raise Exception(99) #raise an error\n print \"This will not execute\"\n except Exception,i: #catch an error\n if isinstance(i,float):\n print \"Caught an exception -- value is:\",\n print i\n else:\n print \"Abnormal program termination\"\n return\n print \"end\"\n\n \nmain()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nInside try block\nAbnormal program termination\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.3, Page Number: 400<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Throwing an exception from a function called \n from within a try block'''\n\ndef Xtest(test):\n print \"Inside Xtest, test is: \",test\n if(test):\n raise Exception(test)\n \nprint \"start\"\n\ntry: #start a try block\n print \"Inside try block\"\n Xtest(0)\n Xtest(1)\n Xtest(2)\nexcept Exception,i: #catch an error\n print \"Caught an exception -- value is:\",\n print i\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nInside try block\nInside Xtest, test is: 0\nInside Xtest, test is: 1\nCaught an exception -- value is: 1\nend\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.4, Page Number: 401<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A try/except is reset each time a function is entered'''\n\ndef Xhandler(test):\n try:\n if(test):\n raise Exception(test)\n except Exception,i:\n print \"Caught One! Ex #:\",i\n \nprint \"start\"\n\nXhandler(1)\nXhandler(2)\nXhandler(0)\nXhandler(3)\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nCaught One! Ex #: 1\nCaught One! Ex #: 2\nCaught One! Ex #: 3\nend\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.5, Page Number: 401<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Use exception class'''\n\nclass MyException:\n def __init__(self,s):\n self.str_what=s\n \n#Variable declaration\na=None \nb=None\n\ntry:\n print \"Enter numerator and denominator:\"\n #User-input\n a=10 \n b=0\n if not(b):\n raise MyException(\"Cannot divide by zero!\")\n else:\n print \"Quotient is\",a/b\nexcept MyException as e: #catch an error\n print e.str_what\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter numerator and denominator:\nCannot divide by zero!\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.6, Page Number: 403<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Different types of exceptions being caught'''\n\nclass MyException:\n def __init__(self,s):\n self.x=s\n \ndef Xhandler(test):\n try:\n if(test):\n raise MyException(test)\n else:\n raise MyException(\"Value is zero\")\n except MyException as i:\n if isinstance(i.x,int):\n print \"Caught One! Ex #:\",i.x\n else:\n print \"Caught a string:\",\n print i.x\n \nprint \"start\"\n\nXhandler(1)\nXhandler(2)\nXhandler(0)\nXhandler(3)\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nCaught One! Ex #: 1\nCaught One! Ex #: 2\nCaught a string: Value is zero\nCaught One! Ex #: 3\nend\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.7, Page Number: 404<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Catching derived classes'''\n\nclass B:\n pass\n\nclass D(B):\n pass\n\nderived=D()\n\ntry:\n raise B()\nexcept B as b:\n print \"Caught a base class.\"\nexcept D as d:\n print \"This wont execute.\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Caught a base class.\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.8, Page Number: 405<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example to catch all exceptions'''\n\ndef Xhandler(test):\n try:\n if test==0:\n raise Exception(test) #throw int\n if test==1:\n raise Exception('a') #throw char\n if test==2:\n raise Exception(123.23) #throw double\n except: #Catches all exceptions\n print \"Caught One!\"\n\nprint \"start\"\n\nXhandler(0)\nXhandler(1)\nXhandler(2)\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nCaught One!\nCaught One!\nCaught One!\nend\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.9, Page Number: 405<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example to catch all exceptions'''\n\nclass MyException:\n def __init__(self,s):\n self.x=s\n \ndef Xhandler(test):\n try:\n if test==0:\n raise MyException(test) #throw int\n if test==1:\n raise MyException('a') #throw char\n if test==2:\n raise MyException(123.23) #throw double\n except MyException as i:\n if isinstance(i.x,int): #catch an int exception\n print \"Caught\",i.x \n else: #catch all other exceptions\n print \"Caught One!\"\n \n\nprint \"start\"\n\nXhandler(0)\nXhandler(1)\nXhandler(2)\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nCaught 0\nCaught One!\nCaught One!\nend\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.10, Page Number: 407<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Restricting function throw types'''\n\nclass MyException:\n def __init__(self,s):\n self.x=s\n \n#This function can only throw ints, chars and doubles\ndef Xhandler(test):\n if test==0:\n raise MyException(test) #throw int\n if test==1:\n raise MyException('a') #throw char\n if test==2:\n raise MyException(123.23) #throw double\n \n\nprint \"start\"\ntry:\n Xhandler(0)\nexcept MyException as i:\n if isinstance(i.x,int): #catch an int exception\n print \"Caught int\" \n elif isinstance(i.x,str): #catch a char exception\n print \"Caught char\"\n elif isinstance(i.x,float): #catch a float exception\n print \"Caught double\"\n\nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nCaught int\nend\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.11, Page Number: 408<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example of \"rethrowing\" an exception'''\n\ndef Xhandler():\n try:\n raise Exception(\"hello\") #throw a char *\n except Exception,c: #catch a char *\n print \"Caugh char * inside Xhandler\"\n raise #rethrow char * out of function\n \nprint \"start\"\ntry:\n Xhandler()\nexcept Exception,c:\n print \"Caught char * inside main\"\n \nprint \"end\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "start\nCaugh char * inside Xhandler\nCaught char * inside main\nend\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.12, Page Number: 410<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Handle exceptions due to allocation failure'''\n\nfrom ctypes import *\n\n#Variable declaration\np=[]\n\ntry:\n for i in range(32):\n p.append(c_int())\nexcept MemoryError,m:\n print \"Allocation failure.\"\n \nfor i in range(32):\n p[i]=i\n \nfor i in range(32):\n print p[i],\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 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\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.13, Page Number: 410<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Checking allocation failure without raising an exception'''\n\nfrom ctypes import *\n\n#Variable declaration\np=[]\n\n\nfor i in range(32):\n p.append(c_int()) \nif not(p):\n print \"Allocation failure.\"\n \nfor i in range(32):\n p[i]=i\n \nfor i in range(32):\n print p[i],\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 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\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 17.13, Page Number: 412<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate overloaded new and delete'''\n\nclass three_d:\n def __init__(self,i=0,j=0,k=0): #3=D coordinates\n if(i==0 and j==0 and k==0):\n self.x=self.y=self.z=0\n print \"Constructing 0, 0, 0\"\n else:\n self.x=i\n self.y=j\n self.z=k\n print \"Constructing\",i,\",\",j,\",\",k\n def __del__(self):\n print \"Destructing\"\n #new overloaded relative to three_d.\n def __new__(typ, *args, **kwargs):\n obj = object.__new__(typ, *args, **kwargs)\n return obj\n def show(self):\n print self.x,\",\",\n print self.y,\",\",\n print self.z\n \np1=[]*3\np2=[]\n \ntry:\n print \"Allocating array of three_d objects.\"\n for i in range(3): #allocate array\n p1.append(three_d())\n print \"Allocating three_d object.\"\n p2.append(three_d(5,6,7)) #allocate object\nexcept MemoryError:\n print \"Allocation error\"\n \np1[2].show()\np2[0].show()\n\n\nfor i in xrange(2,-1,-1):\n del p1[i] #delete array\nprint \"Deleting array of thee_d objects.\"\n\ndel p2[0] #delete object\nprint \"Deleting three_d object.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Allocating array of three_d objects.\nConstructing 0, 0, 0\nConstructing 0, 0, 0\nConstructing 0, 0, 0\nAllocating three_d object.\nConstructing 5 , 6 , 7\n0 , 0 , 0\n5 , 6 , 7\nDestructing\nDestructing\nDestructing\nDeleting array of thee_d objects.\nDestructing\nDeleting three_d object.\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_18(1).ipynb b/C++_from_the_Ground/Chapter_18(1).ipynb
new file mode 100644
index 00000000..3ad3c39c
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_18(1).ipynb
@@ -0,0 +1,413 @@
+{
+ "metadata": {
+ "name": "Chapter 18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 18: The C++ I/O System<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.1, Page Number: 421<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of overloading << for print in python'''\n\nclass three_d:\n def __init__(self,a,b,c): #3D coordinates\n self.x=a\n self.y=b\n self.z=c\n #Display x,y,z coordinates - three_d inserter.\n def __repr__(self):\n return str(self.x)+\", \"+str(self.y)+\", \"+str(self.z)+\"\\n\"\n\n#Variable declaration\na=three_d(1,2,3)\nb=three_d(3,4,5)\nc=three_d(5,6,7)\n\n#Result\nprint a,b,c",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1, 2, 3\n 3, 4, 5\n 5, 6, 7\n\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.2, Page Number: 423<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using a friend function implement overloading of << in python'''\n\nclass thrnee_d:\n def __init__(self,a,b,c): #3D coordinates\n self.x=a\n self.y=b\n self.z=c\n #Display x,y,z coordinates - three_d inserter.\n __repr__=repr \n \n#Friend function \ndef repr():\n return str(self.x)+\", \"+str(self.y)+\", \"+str(self.z)+\"\\n\"\n\n#Variable declaration\na=three_d(1,2,3)\nb=three_d(3,4,5)\nc=three_d(5,6,7)\n\nprint a,b,c",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1, 2, 3\n 3, 4, 5\n 5, 6, 7\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.3, Page Number: 424<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of overloading << and >> in python'''\n\nclass three_d:\n def __init__(self,a,b,c): #3D coordinates\n self.x=a\n self.y=b\n self.z=c\n #Display x,y,z coordinates - three_d inserter.\n def __repr__(self):\n return str(self.x)+\", \"+str(self.y)+\", \"+str(self.z)\n\n#Variable declaration\na=three_d(1,2,3)\n\nprint a\n\n#User input\nprint \"Enter X,Y,Z values:\"\na=three_d(4,5,6) \nprint a",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1, 2, 3\nEnter X,Y,Z values:\n4, 5, 6\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.4, Page Number: 428<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing some ios flags in python'''\n\n\nprint '{0:+d}'.format(123), #for ios::showpos\nif(123.23>0):\n i='{0:e}'.format(123.23) #for ios::scientific \n i='+'+i\n print i\nelse :\n print '{0:e}'.format(123.23)\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "+123 +1.232300e+02\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.5, Page Number: 430<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing some ios flags in python'''\n\nimport string\n\nprint '{0:+d}'.format(123), #for ios::showpos\nif(123.23>0):\n i='{0:e}'.format(123.23) #for ios::scientific \n i='+'+i\n print i\nelse :\n print '{0:e}'.format(123.23)\n\n \nprint '{:10.2f}'.format(123.23), #2 digits left of decimal\nif(123.23>0):\n i='{0:.2e}'.format(123.23) #for ios::scientific \n i='+'+i\n print i\nelse :\n print '{0:.2e}'.format(123.23)\n \n \nprint '{:#>10}'.format(str(123)), #for ios::fill\nif(123.23>0): \n i='{0:.2e}'.format(123.23) #for ios::scientific \n i='+'+i\n print i\nelse :\n print '{0:.2e}'.format(123.23)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "+123 +1.232300e+02\n 123.23 +1.23e+02\n#######123 +1.23e+02\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.6, Page Number: 432<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement io manipulators in python'''\n\nprint '{0:.0e}'.format(1000.243) #for setprecision\nprint '{:>20}'.format(\"Hello There\") #to set width and right align\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1e+03\n Hello There\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.7, Page Number: 433<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing some ios flags in python'''\n\nprint '{0:+d}'.format(123), #for ios::showpos\nif(123.23>0):\n i='{0:e}'.format(123.23) #for ios::scientific \n i='+'+i\n print i\nelse :\n print '{0:e}'.format(123.23)\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "+123 +1.232300e+02\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.8, Page Number: 433<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Removing leading whitespaces from a string'''\n\n#User input\ns=\" Hello\"\n\n#Result\nprint s.lstrip() #lstrip removes leading spaces",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.9, Page Number: 434<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing some ios flags in python'''\n\ndef setup(s):\n return '{:$<10}'.format(str(s))\n\n\n#Result\nprint 10,setup(10)\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 10$$$$$$$$\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.10, Page Number: 435<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Prompting the user to enter number in hexadecimal form'''\n\ndef prompt():\n print \"Enter number using hex format:\"\n hex=0x46\n return hex\n\n\n#Result\ni=prompt()\nprint i\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.11, Page Number: 438<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to write to a file'''\n\n#Open a file, creating one if it does not already exist\nout=open(\"test\",'w')\n\n#In case file cannot open\nif(not(out)):\n print \"Cannot open file.\"\nelse:\n #Write to file\n out.write(\"10 123.23\\n\")\n out.write(\"This is a short text file.\")\n #Close the file\n out.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.12, Page Number: 438<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to read to a file'''\n\n#Open a file, creating one if it does not already exist\nIn=open(\"test\",'r')\n\n#In case file cannot open\nif(not(In)):\n print \"Cannot open file.\"\nelse:\n #Read file\n i=In.read(2)\n ch=In.read(1)\n f=In.read(6)\n str=In.read()\n print i,f,ch\n print str\n #Close the file\n out.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 123.23 \n\nThis is a short text file.\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.13, Page Number: 439<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to read to a file provided on the screen'''\n#Program cannot be provided here, so error is obtained\n\nimport sys\n \nif not(len(sys.argv)==2):\n print \"Usage: PR <filename>\\n\"\nelse:\n #Open a file\n In=open(sys.argv[1],'r')\n\n #In case file cannot open\n if(not(In)):\n print \"Cannot open file.\"\n else:\n #Read file\n ch=In.read()\n print ch\n In.close()\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Usage: PR <filename>\n\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.14, Page Number: 440<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to write to a file'''\n\nimport sys\n\np=\"hello there\"\n\nout=open(\"test\",'w')\n\n#In case file cannot open\nif(not(out)):\n print \"Cannot open file.\"\nelse:\n #Write to file\n for i in range(len(p)):\n out.write(p[i])\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.15, Page Number: 441<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to read and write in a file'''\n\nimport sys\n\nn=[1,2,3,4,5]\n\n#Open a file 'test'\nout=open(\"test\",'w')\n\n#In case file cannot open\nif(not(out)):\n print \"Cannot open file.\"\nelse:\n #Write to file\n for i in range(5):\n out.write(chr(n[i]))\n out.close()\n \nfor i in range(5): #clear array\n n[i]=0\n \n#Open the file\nIn=open(\"test\",'r')\n\n#In case file cannot open\nif(not(In)):\n print \"Cannot open file.\"\nelse:\n #Read file\n for i in range(5):\n n[i]=ord(In.read(1))\n\n#Result, shows value from file\nfor i in range(5):\n print n[i],\n \nIn.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 2 3 4 5\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.16, Page Number: 442<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Detect end-of-file for a file on the screen'''\n#File cannot be provided here, so program wont work\nimport sys\n \nif not(len(sys.argv)==2):\n print \"Usage: PR <filename>\\n\"\nelse:\n #Open a file\n In=open(sys.argv[1],'r')\n\n #In case file cannot open\n if(not(In)):\n print \"Cannot open file.\"\n else:\n #Read file\n while True:\n ch=In.read(1)\n if not ch:\n break\n print ch,\n #Close file\n In.close()\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Usage: PR <filename>\n\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.17, Page Number: 443<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to compare files'''\n\n#Since file names cannot be provided, two \n#files are being created test1 and test2\n\n#creating test1\nout=open(\"test1\",'w')\nout.write(\"Hello\")\nout.close()\n\n#creating test2\nout=open(\"test2\",'w')\nout.write(\"There\")\nout.close()\n\n\n#Open test1\nf1=open(\"test1\",'r')\n#In case file cannot open\nif(not(In)):\n print \"Cannot open file.\"\n\n#Open test2\nf2=open(\"test2\",'r')\n#In case file cannot open\nif(not(In)):\n print \"Cannot open file.\"\n \nprint \"Comparing files...\"\n\nbuf1=f1.read()\nbuf2=f2.read()\nprint buf1,buf2\n\nif len(buf1)==len(buf2):\n print \"Files are of different sizes.\"\n f1.close()\n f2.close()\nelse:\n #compare contents of buffers\n flag=1\n for i in range(len(buf1)):\n if not(buf1[i]==buf2[i]):\n print \"Files differ.\"\n f1.close()\n f2.close()\n flag=0\n break\n if flag==1:\n print \"Files are the same.\"\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Comparing files...\nHello There\nFiles are of different sizes.\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.18, Page Number: 445<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Read a string and print it'''\n\nprint \"Enter your name:\"\n\n#User imput\nstr=\"hello world\"\n\nprint str",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name:\nhello world\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.19, Page Number: 447<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate random access by writing X at a specified location'''\n\n#Since arguments cannot be provided file test \n#is created and X is written in the 3nd location.\n\n#Open test\nout=open(\"test\",'r+b')\nout.write(\"Hello\")\n\n\n#In case file cannot open\nif(not(out)):\n print \"Cannot open file.\"\nelse:\n out.seek(2,0)\n out.write('X')\n out.close()\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.20, Page Number: 447<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Display a file from a given point'''\n\n#Here, file is displayed from 3nd position\n\n#Open test\nout=open(\"test\",'r+b')\nout.write(\"Hello\")\nout.close()\n\nIn=open(\"test\",'r')\n#In case file cannot open\nif(not(In)):\n print \"Cannot open file.\"\nelse:\n In.seek(2,0)\n ch=In.read()\n print ch\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "llo\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 18.21, Page Number: 450<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement use of overloaded inserter to write three_d'''\n\nclass three_d:\n def __init__(self,a,b,c):\n self.__x=a\n self.__y=b\n self.__z=c\n def __repr__(self):\n c=(\"%d\"%self.__x)+\", \"+(\"%d\"%self.__y)+\", \"+(\"%d\"%self.__z)+\"\\n\"\n return c \n\n#Variable declaration\na=three_d(1,2,3)\nb=three_d(3,4,5)\nc=three_d(5,6,7)\n\n#Open threed\nout=open(\"threed\",'w')\n#In case file cannot open\nif(not(out)):\n print \"Cannot open file.\"\nelse:\n out.write(a.__repr__())\n out.write(b.__repr__())\n out.write(c.__repr__())\n\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "raw",
+ "metadata": {},
+ "source": ""
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_19(1).ipynb b/C++_from_the_Ground/Chapter_19(1).ipynb
new file mode 100644
index 00000000..318b8aaa
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_19(1).ipynb
@@ -0,0 +1,247 @@
+{
+ "metadata": {
+ "name": "Chapter 19"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 19: Run-Time Type ID and the Casting Operators<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.1, Page Number: 453<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple example taht uses typeid'''\n\nclass myclass:\n pass\n\n#Variable declaration\ni=j=0\nf=0.0\nob=myclass()\n\nprint \"The type of i is:\",type(i).__name__\nprint \"The type of f is:\",type(f).__name__\nprint \"The type of ob is:\",ob.__class__.__name__\nprint \"\\n\"\n\nif type(i)==type(j):\n print \"The types of i and j are the same\"\n \nif not(type(i)==type(f)):\n print \"The types of i and f are not the same\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The type of i is: int\nThe type of f is: float\nThe type of ob is: myclass\n\n\nThe types of i and j are the same\nThe types of i and f are not the same\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.2, Page Number: 454<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example that uses typeid on a polymorphic class hierarchy'''\n\nclass Base:\n pass\nclass Derived1(Base):\n pass\nclass Derived2(Base):\n pass\n\n#Variable declaration\nbaseob=Base()\np=[Base()]\nob1=Derived1()\nob2=Derived2()\n\n\np[0]=baseob\nprint \"p is pointing to an object of type\",\nprint p[0].__class__.__name__\n\np[0]=ob1\nprint \"p is pointing to an object of type\",\nprint p[0].__class__.__name__\n\np[0]=ob2\nprint \"p is pointing to an object of type\",\nprint p[0].__class__.__name__",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "p is pointing to an object of type Base\np is pointing to an object of type Derived1\np is pointing to an object of type Derived2\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.3, Page Number: 455<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example that uses typeid on a polymorphic class hierarchy'''\n\nclass Base:\n pass\nclass Derived1(Base):\n pass\nclass Derived2(Base):\n pass\n\ndef WhatType(ob):\n print \"ob is referencing an object of type\",\n print ob.__class__.__name__\n \n \n#Variable declaration\nbaseob=Base()\np=[Base()]\nob1=Derived1()\nob2=Derived2()\n\nWhatType(baseob)\nWhatType(ob1)\nWhatType(ob2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "ob is referencing an object of type Base\nob is referencing an object of type Derived1\nob is referencing an object of type Derived2\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.4, Page Number: 456<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate run-time type id'''\n\nimport random\n\nclass figure:\n def __init__(self,i,j):\n self._x=i\n self._y=j\n \nclass triangle(figure):\n def __init__(self,i,j):\n figure.__init__(self,i,j)\n def area(self):\n return self._x*0.5*self._y\n \nclass rectangle(figure):\n def __init__(self,i,j):\n figure.__init__(self,i,j)\n def area(self):\n return self._x*self._y\n \nclass circle(figure):\n def __init__(self,i,j=0):\n figure.__init__(self,i,j)\n def area(self):\n return self._x*self._x*3.14\n \ndef factory():\n i=random.randint(0,2)\n if i==0:\n return circle(10.0)\n elif i==1:\n return triangle(10.1,5.3)\n elif i==2:\n return rectangle(4.3,5.7)\n \n\nt=c=r=0 \np=[None]\n\n#generate and count objects\nfor i in range(10):\n p[0]=factory() #generate an object\n print \"Object is \",p[0].__class__.__name__,\". \",\n #count it\n if p[0].__class__.__name__==triangle.__name__:\n t+=1\n if p[0].__class__.__name__==rectangle.__name__:\n r+=1\n if p[0].__class__.__name__==circle.__name__:\n c+=1\n #display its area\n print \"Area is\",p[0].area()\n\nprint \"Objects generated:\"\nprint \"Triangles:\",t\nprint \"Rectangles:\",r\nprint \"Circles:\",c",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Object is circle . Area is 314.0\nObject is rectangle . Area is 24.51\nObject is rectangle . Area is 24.51\nObject is circle . Area is 314.0\nObject is rectangle . Area is 24.51\nObject is circle . Area is 314.0\nObject is rectangle . Area is 24.51\nObject is triangle . Area is 26.765\nObject is rectangle . Area is 24.51\nObject is circle . Area is 314.0\nObjects generated:\nTriangles: 1\nRectangles: 5\nCircles: 4\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.5, Page Number: 456<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using typeid with templates'''\n#Since python does not have templates\n#it will give a different output.\n\n#Template class\nclass myclass:\n def __init__(self,i):\n self.__a=i\n \no1=myclass(10)\no2=myclass(9)\no3=myclass(7.2)\n\nprint \"Type of o1 is\",o1.__class__.__name__\n\nprint \"Type of o2 is\",o2.__class__.__name__\n\nprint \"Type of o3 is\",o3.__class__.__name__\n\nprint\n\nif o1.__class__.__name__==o2.__class__.__name__:\n print \"o1 and o2 are the same type\"\n \nif o1.__class__.__name__==o3.__class__.__name__:\n print \"Error\"\nelse:\n print \"o1 and o3 are different types\"\n\n#This prints error because python doesnt use templates.",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Type of o1 is myclass\nType of o2 is myclass\nType of o3 is myclass\n\no1 and o2 are the same type\nError\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.6, Page Number: 460<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Template version of figure hierarchy'''\n#Python classes are effectively template classes.\n\nimport random\n\nclass figure:\n def __init__(self,i,j):\n self._x=i\n self._y=j\n \nclass triangle(figure):\n def __init__(self,i,j):\n figure.__init__(self,i,j)\n def area(self):\n return self._x*0.5*self._y\n \nclass rectangle(figure):\n def __init__(self,i,j):\n figure.__init__(self,i,j)\n def area(self):\n return self._x*self._y\n \nclass circle(figure):\n def __init__(self,i,j=0):\n figure.__init__(self,i,j)\n def area(self):\n return self._x*self._x*3.14\n \ndef factory():\n i=random.randint(0,2)\n if i==0:\n return circle(10.0)\n elif i==1:\n return triangle(10.1,5.3)\n elif i==2:\n return rectangle(4.3,5.7)\n \n\nt=c=r=0 \np=[None]\n\n#generate and count objects\nfor i in range(10):\n p[0]=factory() #generate an object\n print \"Object is \",p[0].__class__.__name__,\". \",\n #count it\n if p[0].__class__.__name__==triangle.__name__:\n t+=1\n if p[0].__class__.__name__==rectangle.__name__:\n r+=1\n if p[0].__class__.__name__==circle.__name__:\n c+=1\n #display its area\n print \"Area is\",p[0].area()\n\nprint \"Objects generated:\"\nprint \"Triangles:\",t\nprint \"Rectangles:\",r\nprint \"Circles:\",c",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Object is triangle . Area is 26.765\nObject is circle . Area is 314.0\nObject is circle . Area is 314.0\nObject is rectangle . Area is 24.51\nObject is rectangle . Area is 24.51\nObject is rectangle . Area is 24.51\nObject is circle . Area is 314.0\nObject is circle . Area is 314.0\nObject is rectangle . Area is 24.51\nObject is triangle . Area is 26.765\nObjects generated:\nTriangles: 2\nRectangles: 4\nCircles: 4\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.7, Page Number: 463<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement dynamic casting'''\n#Dynamic casting is not needed in python \n#Also, the output will be different in python since \n#here since pointers are implemented using lists,\n\nclass Base:\n def f(self):\n print \"Inside Base\"\n \nclass Derived(Base):\n def f(self):\n print \"Inside Derived\"\n \nbp=[Base()] #pointer to base\nb_ob=Base() \ndp=[Derived()] #pointer to derived\nd_ob=Derived()\n\ndp[0]=d_ob\nif dp[0]:\n print \"Cast from Derived * to Derived * OK.\"\n dp[0].f()\nelse:\n print \"Error\"\nprint\n\nbp[0]=d_ob\nif bp[0]:\n print \"Cast from Derived * to Base * OK.\"\n bp[0].f()\nelse:\n print \"Error\"\nprint\n\nbp[0]=b_ob\nif bp[0]:\n print \"Cast from Base * to Base * OK.\"\n bp[0].f()\nelse:\n print \"Error\"\nprint\n\ndp[0]=b_ob\nif dp[0]:\n print \"Error\"\nelse:\n print \"Cast from Base * to Derived * not OK.\"\nprint\n\nbp[0]=d_ob #bp points to Derived object\ndp[0]=bp[0]\nif dp[0]:\n print \"Cast bp to a Derived * OK.\"\n print \"because bp is really pointing\\n\",\n print \"to a Derived object.\"\n dp[0].f()\nelse:\n print \"Error\"\nprint\n\nbp[0]=b_ob #bp points to Base object\ndp[0]=bp[0]\nif dp[0]:\n print \"Error\"\nelse:\n print \"Now casting bp to a Derived *\\n\",\n print \"is not OK because bp is really\\n\",\n print \" pointing to a Base object.\"\nprint\n\ndp[0]=d_ob #dp points to Derived object\nbp[0]=dp[0]\nif bp[0]:\n print \"Casting dp to a Base * is OK.\"\n bp[0].f()\nelse:\n print \"Error\"\nprint\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Cast from Derived * to Derived * OK.\nInside Derived\n\nCast from Derived * to Base * OK.\nInside Derived\n\nCast from Base * to Base * OK.\nInside Base\n\nError\n\nCast bp to a Derived * OK.\nbecause bp is really pointing\nto a Derived object.\nInside Derived\n\nError\n\nCasting dp to a Base * is OK.\nInside Derived\n\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.8, Page Number: 465<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement dynamic casting'''\n#Dynamic casting is not needed in python \n#Also, the output will be different in python since \n#here since pointers are implemented using lists,\n\nclass Base:\n def f(self):\n pass\n \nclass Derived(Base):\n def derivedOnly(self):\n print \"Is a Derived Object\"\n \nbp=[Base()] #pointer to base\nb_ob=Base() \ndp=[Derived()] #pointer to derived\nd_ob=Derived()\n\n#Use typeid\n\nbp[0]=b_ob\nif bp[0].__class__.__name__==Derived.__name__:\n dp[0]=bp[0]\n dp[0].derivedOnly()\nelse:\n print \"Cast from Base to Derived failed.\"\n \nbp[0]=d_ob\nif bp[0].__class__.__name__==Derived.__name__:\n dp[0]=bp[0]\n dp[0].derivedOnly()\nelse:\n print \"Error, cast should work!\"\n \n#Use dynamic_cast\n\nbp[0]=b_ob\ndp[0]=bp[0]\nif dp[0].__class__.__name__==Derived.__name__:\n dp[0].derivedOnly()\nelse:\n print \"Cast from Base to Derived failed.\"\n \nbp[0]=d_ob\ndp[0]=bp[0]\nif dp:\n dp[0].derivedOnly()\nelse:\n print \"Error, cast should work!\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Cast from Base to Derived failed.\nIs a Derived Object\nCast from Base to Derived failed.\nIs a Derived Object\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.9, Page Number: 467<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of const_cast'''\n#Since python does not have constants, const_cast is not needed\n\ndef f(p):\n v=p\n v[0]=100\n \n#Variable declaration\nx=[]\n\nx.append(99)\nprint \"x before call:\",x[0]\nf(x)\nprint \"x after call:\",x[0]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x before call: 99\nx after call: 100\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.10, Page Number: 468<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement static_cast'''\n#Since python does not have static variables,\n#static_cast is not needed\n\nf=199.22\n\ni=f\nprint i\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "199.22\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 19.11, Page Number: 469<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example of reinterpret_cast'''\n#python does not have specific data type variables \n#hence reinterpretation is not required\n\n#Variable Declaration\ni=0 #int\np=\"This is a string\"\n\ni=p #cast pointer to integer \n\n#Result\nprint i\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This is a string\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_2(1).ipynb b/C++_from_the_Ground/Chapter_2(1).ipynb
new file mode 100644
index 00000000..ca5a3177
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_2(1).ipynb
@@ -0,0 +1,267 @@
+{
+ "metadata": {
+ "name": "Chapter 2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 2: An Overview of C++<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.1, Page Number: 12<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program 1:A first Python(C++) program'''\n\n#Result\nprint \"This is my first C++ program.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This is my first C++ program.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.2, Page Number: 17<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program 2: Using a variable'''\n\n#Variable Declaration\nx=None \n\nx=1023 #this assigns 1023 to x\n\n#Result\nprint \"This program prints the value of x: \",x #prints x,i.e, 1023\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This program prints the value of x: 1023\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.3, Page Number: 18<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program converts gallons to liters'''\n\n#Variable declaration\ngallons=10 #User input\nliters=None\n\nliters=gallons*4 #convert to liters\n\n#Result\nprint \"Liters: \",liters",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Liters: 40\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.4, Page Number: 20<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program converts gallons to liters using floating point numbers'''\n\n#Variable declaration\ngallons=10.20 #User input\nliters=None\n\nliters=gallons*3.7854 #convert to liters\n\n#Result\nprint \"Liters: \",liters",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Liters: 38.61108\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.5, Page Number: 21<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program uses a function'''\n\n#myfunc's definition\ndef myfunc():\n print \"Inside myfunc() \"\n \nprint \"In main()\"\nmyfunc() #call myfunc()\nprint \"Back in main()\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "In main()\nInside myfunc() \nBack in main()\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.6, Page Number: 22<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using the abs() function'''\n\n#Result\nprint abs(-10)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.7, Page Number: 23<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple program that demonstrates mul()'''\n\n#mul's definition\ndef mul(x,y):\n print x*y,\n\n#calling mul\nmul(10,20)\nmul(5,6)\nmul(8,9)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "200 30 72\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.8, Page Number: 24<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Returning a value'''\n\n#mul()'s definition; this function returns a value\ndef mul(x,y):\n return x*y #return product of x and y\n\n#Variable declaration\nanswer=mul(10,11) #assign return values\n\n#Result\nprint \"The answer is: \",answer\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The answer is: 110\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.9, Page Number: 26<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This demonstrates how to got to the next line'''\n\nprint \"one\"\nprint \"two\" #prints in different line\nprint \"three\",\"four\" #prints all in same line",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "one\ntwo\nthree four\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.10, Page Number: 27<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program illustrates the if statement'''\n\n#Variable declaration\na=10 #user input for two numbers\nb=20\n\n#Result\nif a<b:\n print \"First number is less than second. \"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "First number is less than second. \n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.11, Page Number: 28<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A program that illustrates the for loop'''\n\nfor count in range(1,100+1):\n print count,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "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\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 2.12, Page Number: 30<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program demonstrates a block of code'''\n\n#Variable declaration\na=10 #User input for two numbers\nb=20\n\n#Result\nif a<b:\n print \"First number is less than second\"\n print \"Their difference is: \",b-a\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "First number is less than second\nTheir difference is: 10\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_20(2).ipynb b/C++_from_the_Ground/Chapter_20(2).ipynb
new file mode 100644
index 00000000..cc097c14
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_20(2).ipynb
@@ -0,0 +1,959 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 20: Namespaces and Other Advanced Topics<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.1, Page Number:474<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing a namespace'''\n",
+ "#A good implementaton of namespaces in python would be\n",
+ "#creating python files or modules and then importing them.\n",
+ "#Since that is not possible n ipython, implementation is \n",
+ "#done using classes.\n",
+ "\n",
+ "\n",
+ "class CounterNameSpace:\n",
+ " upperbound=None\n",
+ " lowerbound=None\n",
+ " class counter:\n",
+ " def __init__(self,n):\n",
+ " if n<=CounterNameSpace.upperbound:\n",
+ " self.count=n\n",
+ " else:\n",
+ " self.count=CounterNameSpace.upperbound\n",
+ " def reset(self,n):\n",
+ " if n<=CounterNameSpace.upperbound:\n",
+ " self.count=n\n",
+ " def run(self):\n",
+ " if self.count>CounterNameSpace.lowerbound:\n",
+ " self.count-=1\n",
+ " return self.count\n",
+ " else:\n",
+ " return CounterNameSpace.lowerbound\n",
+ " \n",
+ "CounterNameSpace.upperbound=100\n",
+ "CounterNameSpace.lowerbound=0\n",
+ "\n",
+ "\n",
+ "ob1=CounterNameSpace.counter(10)\n",
+ "while True:\n",
+ " i=ob1.run()\n",
+ " print i,\n",
+ " if i<=CounterNameSpace.lowerbound:\n",
+ " break \n",
+ "print\n",
+ "\n",
+ "\n",
+ "ob2=CounterNameSpace.counter(20)\n",
+ "while True:\n",
+ " i=ob2.run()\n",
+ " print i,\n",
+ " if i<=CounterNameSpace.lowerbound:\n",
+ " break \n",
+ "print\n",
+ "\n",
+ "\n",
+ "ob2.reset(100)\n",
+ "CounterNameSpace.lowerbound=90\n",
+ "while True:\n",
+ " i=ob2.run()\n",
+ " print i,\n",
+ " if i<=CounterNameSpace.lowerbound:\n",
+ " break "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9 8 7 6 5 4 3 2 1 0\n",
+ "19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0\n",
+ "99 98 97 96 95 94 93 92 91 90\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.2, Page Number:476<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing using'''\n",
+ "\n",
+ "class CounterNameSpace:\n",
+ " upperbound=None\n",
+ " lowerbound=None\n",
+ " class counter:\n",
+ " def __init__(self,n):\n",
+ " if n<=c.upperbound:\n",
+ " self.count=n\n",
+ " else:\n",
+ " self.count=c.upperbound\n",
+ " def reset(self,n):\n",
+ " if n<=c.upperbound:\n",
+ " self.count=n\n",
+ " def run(self):\n",
+ " if self.count>c.lowerbound:\n",
+ " self.count-=1\n",
+ " return self.count\n",
+ " else:\n",
+ " return c.lowerbound\n",
+ "\n",
+ "#Use only upperbound using c\n",
+ "c=CounterNameSpace()\n",
+ "c.upperbound=100\n",
+ "CounterNameSpace.lowerbound=0\n",
+ "\n",
+ "\n",
+ "ob1=CounterNameSpace.counter(10)\n",
+ "while True:\n",
+ " i=ob1.run()\n",
+ " print i,\n",
+ " if i<=CounterNameSpace.lowerbound:\n",
+ " break \n",
+ "print\n",
+ "\n",
+ "#Now use entre CounterName Space using c\n",
+ "\n",
+ "ob2=c.counter(20)\n",
+ "while True:\n",
+ " i=ob2.run()\n",
+ " print i,\n",
+ " if i<=c.lowerbound:\n",
+ " break \n",
+ "print\n",
+ "\n",
+ "\n",
+ "ob2.reset(100)\n",
+ "c.lowerbound=90\n",
+ "while True:\n",
+ " i=ob2.run()\n",
+ " print i,\n",
+ " if i<=c.lowerbound:\n",
+ " break "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9 8 7 6 5 4 3 2 1 0\n",
+ "19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0\n",
+ "99 98 97 96 95 94 93 92 91 90\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.3, Page Number:479<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Printing a number'''\n",
+ "\n",
+ "#User-input\n",
+ "print \"Enter a number:\"\n",
+ "val= 10.00\n",
+ "\n",
+ "#Result\n",
+ "print \"This is your number:\",val"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number:\n",
+ "This is your number: 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.4, Page Number:479<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing the std:: qualification'''\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "#User-input\n",
+ "sys.stdout.write(\"Enter a number:\")\n",
+ "val= 10.00\n",
+ "\n",
+ "#Result\n",
+ "sys.stdout.write(\"\\nThis is your number: \")\n",
+ "sys.stdout.write(str(val))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number:\n",
+ "This is your number: 10.0"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.5, Page Number:479<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bring only a few names into global namespace'''\n",
+ "\n",
+ "from sys import stdout\n",
+ "\n",
+ "#User-input\n",
+ "stdout.write(\"Enter a number:\")\n",
+ "val= 10.00\n",
+ "\n",
+ "#Result\n",
+ "stdout.write(\"\\nThis is your number: \")\n",
+ "stdout.write(str(val))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number:\n",
+ "This is your number: 10.0"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.6, Page Number:480<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing pointers to functions'''\n",
+ "\n",
+ "#functions\n",
+ "def vline(i):\n",
+ " for j in xrange(i,0,-1):\n",
+ " print \"|\"\n",
+ "def hline(i):\n",
+ " for j in xrange(i,0,-1):\n",
+ " print \"-\",\n",
+ " print \n",
+ "\n",
+ "p=vline #p points to vline\n",
+ "p(4) #call vline()\n",
+ "\n",
+ "p=hline #p now points to hline\n",
+ "p(3) #call hline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "|\n",
+ "|\n",
+ "|\n",
+ "|\n",
+ "- - -\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.7, Page Number:482<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''qsort in python:for string'''\n",
+ "#Python doesn't have an in-built function hence,\n",
+ "#a function for qsort is defined.\n",
+ "\n",
+ "import string\n",
+ "\n",
+ "def qsort(p):\n",
+ " if p == []: \n",
+ " return []\n",
+ " else:\n",
+ " pivot = p[0]\n",
+ " lesser = qsort([x for x in p[1:] if x < pivot])\n",
+ " greater = qsort([x for x in p[1:] if x >= pivot])\n",
+ " return lesser + [pivot] + greater\n",
+ " \n",
+ "#Variable Declaration \n",
+ "str=\"Function pointers provide flexibility.\" \n",
+ "\n",
+ "#sorting the string\n",
+ "str=qsort(str)\n",
+ "str=string.join(str)\n",
+ "\n",
+ "#Result\n",
+ "print \"sorted strng: \",str\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sorted strng: . F b c d e e e f i i i i i i l l n n n o o o p p r r s t t t u v x y\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.8, Page Number:482<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''qsort in python:for int'''\n",
+ "#Python doesn't have an in-built function hence,\n",
+ "#a function for qsort is defined.\n",
+ "\n",
+ "import string\n",
+ "\n",
+ "def qsort(p):\n",
+ " \"\"\"Quicksort using list comprehensions\"\"\"\n",
+ " if p == []: \n",
+ " return []\n",
+ " else:\n",
+ " pivot = p[0]\n",
+ " lesser = qsort([x for x in p[1:] if x < pivot])\n",
+ " greater = qsort([x for x in p[1:] if x >= pivot])\n",
+ " return lesser + [pivot] + greater\n",
+ " \n",
+ "#Variable Declaration \n",
+ "num=[10,4,3,6,5,7,8]\n",
+ "\n",
+ "#sorting the string\n",
+ "num=qsort(num)\n",
+ "\n",
+ "#Result\n",
+ "for i in range(7):\n",
+ " print num[i],\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3 4 5 6 7 8 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.9, Page Number:484<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Illustrate assigning function pointers to overload functions'''\n",
+ "\n",
+ "#Output count number of spaces.\n",
+ "def space(count,ch=None):\n",
+ " if ch==None:\n",
+ " for i in xrange(count,0,-1):\n",
+ " print '',\n",
+ " else:\n",
+ " for i in xrange(count,0,-1):\n",
+ " print ch,\n",
+ " \n",
+ "\n",
+ "fp1=space\n",
+ "fp2=space\n",
+ "\n",
+ "fp1(22) #outputs 20 spaces\n",
+ "print \"|\\n\" \n",
+ "\n",
+ "fp2(30,'x') #output 30 xs \n",
+ "print \"|\\n\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " |\n",
+ "\n",
+ "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x |\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.10, Page Number:485<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing static class members'''\n",
+ "\n",
+ "num=None #static variable\n",
+ "\n",
+ "class ShareVar:\n",
+ " def setnum(i=0):\n",
+ " global num\n",
+ " num=i\n",
+ " def shownum(self):\n",
+ " global num\n",
+ " print num\n",
+ " \n",
+ "#Variables declaration\n",
+ "a=ShareVar()\n",
+ "b=ShareVar()\n",
+ "\n",
+ "a.shownum() #prints None\n",
+ "b.shownum() #prints None\n",
+ "\n",
+ "num=10 #set static num to 10\n",
+ "\n",
+ "a.shownum() #prints 10\n",
+ "b.shownum() #prints 10\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "None\n",
+ "None\n",
+ "10\n",
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.11, Page Number:487<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implement const and mutable member functions'''\n",
+ "\n",
+ "class Demo:\n",
+ " i=None\n",
+ " j=None\n",
+ " def geti(self):\n",
+ " return self.i\n",
+ " def seti(self,x):\n",
+ " self.i=x\n",
+ " \n",
+ "ob=Demo()\n",
+ "\n",
+ "ob.seti(1900)\n",
+ "print ob.geti()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1900\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.12, Page Number:488<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A simple class program'''\n",
+ "\n",
+ "class myclass:\n",
+ " def __init__(self,x):\n",
+ " self.__a=x\n",
+ " def geta(self):\n",
+ " return self.__a\n",
+ " \n",
+ "#Variable declaration\n",
+ "ob=myclass(4)\n",
+ "\n",
+ "#Result\n",
+ "print ob.geta()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.13, Page Number:489<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A Class Example'''\n",
+ "#explicit not implemented in python\n",
+ "\n",
+ "class myclass:\n",
+ " def __init__(self,x):\n",
+ " self.__a=x\n",
+ " def geta():\n",
+ " return self.__a\n",
+ " \n",
+ "ob = myclass(110)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.14, Page Number:490<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing implicit conversion'''\n",
+ "\n",
+ "class myclass:\n",
+ " def __init__(self,i):\n",
+ " self.__num=i\n",
+ " def getnum(self):\n",
+ " return self.__num\n",
+ " \n",
+ "#Variable declaration\n",
+ "o=myclass(10)\n",
+ "\n",
+ "print o.getnum() #display 10\n",
+ "\n",
+ "o=myclass(1000)\n",
+ "\n",
+ "print o.getnum() #display 1000"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n",
+ "1000\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.15, Page Number:491<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Member nitialization Syntax'''\n",
+ "\n",
+ "class myclass:\n",
+ " def __init__(self,x,y):\n",
+ " self.__numA=x\n",
+ " self.__numB=y\n",
+ " def getnumA(self):\n",
+ " return self.__numA\n",
+ " def getnumB(self):\n",
+ " return self.__numB\n",
+ " \n",
+ "#Variable declaration\n",
+ "ob1=myclass(7,9)\n",
+ "ob2=myclass(5,2)\n",
+ "\n",
+ "#Result\n",
+ "print \"Values in ob1 are \",ob1.getnumB(),\"and\",ob1.getnumA()\n",
+ "print \"Values in ob2 are \",ob2.getnumB(),\"and\",ob2.getnumA()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Values in ob1 are 9 and 7\n",
+ "Values in ob2 are 2 and 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.16, Page Number:492<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Member nitialization Syntax'''\n",
+ "\n",
+ "class myclass:\n",
+ " def __init__(self,x,y):\n",
+ " self.__numA=x\n",
+ " self.__numB=y\n",
+ " def getnumA(self):\n",
+ " return self.__numA\n",
+ " def getnumB(self):\n",
+ " return self.__numB\n",
+ " \n",
+ "#Variable declaration\n",
+ "ob1=myclass(7,9)\n",
+ "ob2=myclass(5,2)\n",
+ "\n",
+ "#Result\n",
+ "print \"Values in ob1 are \",ob1.getnumB(),\"and\",ob1.getnumA()\n",
+ "print \"Values in ob2 are \",ob2.getnumB(),\"and\",ob2.getnumA()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Values in ob1 are 9 and 7\n",
+ "Values in ob2 are 2 and 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.17, Page Number:494<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing entern functions'''\n",
+ "\n",
+ "def myfunc():\n",
+ " print \"This links as a C function.\"\n",
+ " \n",
+ "myfunc()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This links as a C function.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.18, Page Number:495<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Pointer to member example'''\n",
+ "from ctypes import *\n",
+ "\n",
+ "class myclass: \n",
+ " sum=c_int(0)\n",
+ " def sum_it(self,x):\n",
+ " for i in range(x+1):\n",
+ " self.sum.value+=i\n",
+ " fp=sum_it #pointer to function\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=myclass()\n",
+ "fp=myclass.sum_it #get address of function\n",
+ "dp=pointer(c.sum) #address of data\n",
+ "c.fp(7) #compute summation of 7\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"summation of 7 is\",dp[0]\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "summation of 7 is 28\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.19, Page Number:496<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Pointer to member example'''\n",
+ "from ctypes import *\n",
+ "\n",
+ "class myclass:\n",
+ " sum=c_int(0)\n",
+ " def sum_it(self,x): \n",
+ " for i in range(x+1):\n",
+ " self.sum.value+=i\n",
+ " fp=sum_it #pointer to function\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=myclass()\n",
+ "c=[d] #ponter to object\n",
+ "fp=myclass.sum_it #get address of function\n",
+ "dp=pointer(c[0].sum) #get address of data\n",
+ "\n",
+ "c[0].fp(7) #compute summation of 7\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"summation of 7 is\",dp[0]\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " summation of 7 is 28\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 20.20, Page Number:497<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Implementing conversion functions'''\n",
+ "\n",
+ "class three_d:\n",
+ " def __init__(self,a,b,c): #3D coordinates\n",
+ " self.x=a\n",
+ " self.y=b\n",
+ " self.z=c\n",
+ " #Display x,y,z coordinates - three_d inserter.\n",
+ " def __repr__(self):\n",
+ " return str(self.x)+\", \"+str(self.y)+\", \"+str(self.z)+\"\\n\"\n",
+ " def __add__(self,op2):\n",
+ " if isinstance(op2,int):\n",
+ " c=self.x*self.y*self.z+op2\n",
+ " return c\n",
+ " temp=three_d(self.x+op2.x,self.y+op2.y,self.z+op2.z)\n",
+ " return temp\n",
+ " \n",
+ "a=three_d(1,2,3)\n",
+ "b=three_d(2,3,4)\n",
+ "\n",
+ "print a,b,\n",
+ "\n",
+ "print b+100 #displays 124 because of conversion to int\n",
+ "\n",
+ "a=a+b #add two three_d objects - no conversion\n",
+ "\n",
+ "print a #displays 3,5,7"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1, 2, 3\n",
+ " 2, 3, 4\n",
+ " 124\n",
+ "3, 5, 7\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_21(1).ipynb b/C++_from_the_Ground/Chapter_21(1).ipynb
new file mode 100644
index 00000000..a37db7f8
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_21(1).ipynb
@@ -0,0 +1,427 @@
+{
+ "metadata": {
+ "name": "Chapter 21"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 21: Introducing the Standard Template Library<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.1, Page Number:507<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An implementation of vector in python'''\n\n#Variable declaratio\nv=[] #Create a zero length vector\n\n#display original size of v\nprint \"Size =\",len(v)\n\n#put values onto end of vector\n#vector will grow as needed\n\nfor i in range(10):\n v.append(i)\n \n#display current size of v\nprint \"Current contents: \"\nprint \"Size now =\",len(v)\n\n#display contents of vector\nfor i in range(len(v)):\n print v[i],\n \nprint\n \n#put more values onto end of vector\n#again, vector will grow as needed.\nfor i in range(10):\n v.append(i+10)\n#display current size of v\nprint \"Size now =\",len(v)\n\n#display contents of vector\nprint \"Current contents:\"\nfor i in range(len(v)):\n print v[i],\nprint\n \n#change contents of vector\nfor i in range(len(v)):\n v[i]=v[i]+v[i]\n \n#display contents of vector\nprint \"Contents doubled:\"\nfor i in range(len(v)):\n print v[i],",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Size = 0\nCurrent contents: \nSize now = 10\n0 1 2 3 4 5 6 7 8 9\nSize now = 20\nCurrent contents:\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19\nContents doubled:\n0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.2, Page Number:508<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Access vector usng an terator'''\n\n#Variable declaration\nv=[] #Create a zero length vector\n\n#put values onto end of vector\nfor i in range(10):\n v.append(chr(ord('A')+i))\n \n#can access vector contents using subscripts\nfor i in range(len(v)):\n print v[i], \nprint\n \n#access via iterator\nfor p in v:\n print p,\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A B C D E F G H I J\nA B C D E F G H I J\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.3, Page Number:509<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate insert and erase'''\n\n#Variable declaration\nv=[] #Create a zero length vector\n\n#put values onto end of vector\nfor i in range(10):\n v.append(chr(ord('A')+i))\n \n#Display original contents of vector\nprint \"Size =\",len(v)\nprint \"Original contents:\"\nfor i in range(len(v)):\n print v[i], \nprint \"\\n\"\n \np=2 #point to 3rd element\nfor i in range(10):\n v.insert(p+i,'X')\n \n#display contents after insertion\nprint \"Size after insert =\",len(v)\nprint \"Contents after insert:\"\nfor i in range(len(v)):\n print v[i],\nprint \"\\n\"\n\n#remove those elements\np=2 #point to 3rd element\nfor i in range(10):\n v.pop(p)\n \n#display contents after insertion\nprint \"Size after erase =\",len(v)\nprint \"Contents after insert:\"\nfor i in range(len(v)):\n print v[i],\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Size = 10\nOriginal contents:\nA B C D E F G H I J \n\nSize after insert = 20\nContents after insert:\nA B X X X X X X X X X X C D E F G H I J \n\nSize after erase = 10\nContents after insert:\nA B C D E F G H I J\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.4, Page Number:511<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Store a class object in a vector'''\n\nclass three_d:\n def __init__(self,a,b,c): #3D coordinates\n self.x=a\n self.y=b\n self.z=c\n #Display x,y,z coordinates - three_d inserter.\n def __repr__(self):\n return str(self.x)+\", \"+str(self.y)+\", \"+str(self.z)+\"\\n\"\n def __add__(self,a):\n self.x+=a\n self.y+=a\n self.z+=a\n return self\n def __lt__(self,b):\n return (self.x+self.y+self.z)<(b.x+b.y+b.z)\n def __eq__(self,b):\n return (self.x+self.y+self.z)==(b.x+b.y+b.z) \n \n#Variable declaration\nv=[]\n\n#add objects to the vector\nfor i in range(10):\n v.append(three_d(i,i+2,i-3))\n \n#Display contents of vector\nfor i in range(len(v)):\n print v[i], \nprint\n\n\n#Modify objects in a vector\nfor i in range(len(v)):\n v[i]=v[i]+10 \n\n#Display modified vector\nfor i in range(len(v)):\n print v[i], \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0, 2, -3\n 1, 3, -2\n 2, 4, -1\n 3, 5, 0\n 4, 6, 1\n 5, 7, 2\n 6, 8, 3\n 7, 9, 4\n 8, 10, 5\n 9, 11, 6\n\n10, 12, 7\n 11, 13, 8\n 12, 14, 9\n 13, 15, 10\n 14, 16, 11\n 15, 17, 12\n 16, 18, 13\n 17, 19, 14\n 18, 20, 15\n 19, 21, 16\n\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.5, Page Number:513<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Store a class object in a vector'''\n \n#Variable declaration\nv=[]\nv2=[]\n\nfor i in range(10):\n v.append(chr(ord('A')+i))\n \n#Display original contents of vector\nprint \"Size =\",len(v)\nprint \"Original contents:\"\nfor i in range(len(v)):\n print v[i], \nprint \"\\n\"\n\n#initialze second vector\nstr=\"-STL Power-\"\nfor i in range(len(str)):\n v2.append(str[i])\n \n#get iterators to the middle of v and to the start and end of v2.\np=5\np2start=0\np2end=len(v2)-1\n\n#insert v2 into v\nfor i in range(p2end):\n v.insert(p+i,v2[p2start+i])\n \n#display result\nprint \"Contents of v after inserton:\"\nfor i in range(len(v)):\n print v[i],\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Size = 10\nOriginal contents:\nA B C D E F G H I J \n\nContents of v after inserton:\nA B C D E - S T L P o w e r F G H I J\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.6, Page Number:517<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate list basics'''\n\n#Variable declaration\nlst=[] #create an empty list\n\nfor i in range(10):\n lst.append(chr(ord('A')+i))\n \nprint \"Size =\",len(lst)\n\nprint \"Contents:\",\nfor p in lst:\n print p, \nprint \"\\n\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Size = 10\nContents: A B C D E F G H I J \n\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.7, Page Number:518<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''elements can be put on the front or end of a list'''\n\n#Variable declaration\nlst=[] \nrevlst=[]\n\nfor i in range(10):\n lst.append(chr(ord('A')+i))\n \nprint \"Size of list =\",len(lst)\n\nprint \"Original Contents:\",\n#Remove elements from lst and put them into revlst in reverse order.\nfor p in lst:\n print p, \n revlst.insert(0,p) \nfor i in range(10):\n lst.pop(0)\nprint \"\\n\"\n\nprint \"Size of revlst =\",len(revlst)\n\nprint \"Reversed Contents:\",\nfor p in revlst:\n print p,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Size of list = 10\nOriginal Contents: A B C D E F G H I J \n\nSize of revlst = 10\nReversed Contents: J I H G F E D C B A\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.8, Page Number:519<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Sort a list'''\n\nimport random\n\n#Variable declaration\nlst=[] \n\n#create a list of random integers\nfor i in range(10):\n lst.append(random.randint(0,100))\n\nprint \"Original Contents:\",\nfor p in lst:\n print p, \nprint \"\\n\"\n\n#sort the list\nlst.sort()\n\nprint \"Sorted Contents:\",\nfor p in lst:\n print p,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original Contents: 75 73 72 4 88 7 85 21 67 42 \n\nSorted Contents: 4 7 21 42 67 72 73 75 85 88\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.9, Page Number:520<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Merge two lists'''\n\n#Variable declaration\nlst1=[] \nlst2=[]\n\nfor i in xrange(0,10,2):\n lst1.append(chr(ord('A')+i))\nfor i in xrange(1,11,2):\n lst2.append(chr(ord('A')+i))\n\nprint \"Contents of lst1:\",\nfor p in lst1:\n print p, \nprint \"\\n\"\n\nprint \"Contents of lst2:\",\nfor p in lst2:\n print p, \nprint \"\\n\"\n\n#merge the lists\nlst1=lst1+lst2\nlst1.sort()\nlst2=[]\n\nif lst2==[]:\n print \"lst2 is now empty\"\n\nprint \"Contentsof lst1 after merge:\"\nfor p in lst1:\n print p,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Contents of lst1: A C E G I \n\nContents of lst2: B D F H J \n\nlst2 is now empty\nContentsof lst1 after merge:\nA B C D E F G H I J\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.10, Page Number:521<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Store class objects in a list'''\n\nclass myclass:\n def __init__(self,i=0,j=0):\n self.__a=i\n self.__b=j\n self.sum=self.__a+self.__b\n def getsum(self):\n return self.sum\n def __lt__(self,o2):\n return self.sum<o2.sum\n def __gt__(self,o2):\n return self.sum>o2.sum\n def __eq__(self,o2):\n return self.sum==o2.sum\n def __ne__(self, other):\n return not self.__eq__(self)\n \n#create first list\nlst1=[]\nfor i in range(10):\n lst1.append(myclass(i,i))\n \nprint \"First list:\",\nfor p in lst1:\n print p.getsum(),\nprint\n\n#create second list\nlst2=[]\nfor i in range(10):\n lst2.append(myclass(i*2,i*3))\n \nprint \"First list:\",\nfor p in lst2:\n print p.getsum(),\nprint\n \n#Now merge list\nlst1=lst1+lst2\nlst1.sort()\n\n#Display merge list\nprint \"Merged list:\",\nfor p in lst1:\n print p.getsum(),\nprint",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "First list: 0 2 4 6 8 10 12 14 16 18\nFirst list: 0 5 10 15 20 25 30 35 40 45\nMerged list: 0 0 2 4 5 6 8 10 10 12 14 15 16 18 20 25 30 35 40 45\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.11, Page Number:527<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple map implementation'''\n\n#Variable declaration\nm=[] \n\n#define the function find\ndef find(x,ch):\n for p in x:\n if p[0]==ch:\n return p\n return -1\n\n#put pairs into map\nfor i in range(10):\n m.append([chr(ord('A')+i),i])\n \n#User Input\nch='D'\n\n#find value of the given key\np=find(m,ch)\n\nif not(p==-1):\n print p[1]\nelse:\n print \"Key not in the map\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.12, Page Number:528<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using a map to create a dictionary'''\n\n#define the function find\ndef find(x,ch):\n for p in x:\n if p[0].get()==ch.get():\n return p\n return -1\n\n\nclass word:\n def __init__(self,s=\"\"):\n self.str=s\n def get(self):\n return self.str\n #must define less than relative to word objects\n def __lt__(self,b):\n return self.str<b.str\n\nclass meaning:\n def __init__(self,s=\"\"):\n self.str=s\n def get(self):\n return self.str\n\ndictionary=[]\n\ndictionary.append([word(\"house\"),meaning(\"A place of dwelling\")])\ndictionary.append([word(\"keyboard\"),meaning(\"An input device\")])\ndictionary.append([word(\"programming\"),meaning(\"The act of writing a program\")])\ndictionary.append([word(\"STL\"),meaning(\"Standard Template Library\")])\n\n#given a word, find meaning\nprint \"Enter word:\"\nstr=\"house\" #User input\n\np=find(dictionary,word(str))\n\nif not(p==-1):\n print \"Definition:\",p[1].get()\nelse:\n print \"Word not in the dictionary.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter word:\nDefinition: A place of dwelling\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.13, Page Number:532<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate count and count_if'''\n\n#This is a unary precdate that determines if character is a vowel\ndef isvowel(ch):\n ch=ch.lower()\n if (ch=='a' or ch=='e'or ch=='i' or ch=='o' or ch=='u'):\n return 1\n else:\n return 0\n\nstr=\"STL programming is powerful.\"\nv=[]\n\nfor i in range(len(str)):\n v.append(str[i])\n \nprint \"Sequence:\",\nfor i in range(len(v)):\n print v[i],\nprint\n\nn=str.count('p')\nprint n,\"characters are p\"\n\n#count if vowel\nn=0\nfor i in v:\n if isvowel(i):\n n+=1\n \nprint n,\"characters are vowels.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Sequence: S T L p r o g r a m m i n g i s p o w e r f u l .\n2 characters are p\n7 characters are vowels.\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.14, Page Number:534<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate remove_copy and replace_copy'''\n\nstr=\"This is a test\"\nv=[]\nv2=[]\n\nfor i in range(len(str)):\n v.append(str[i])\n \n# ***implement remove_copy***\nprint \"Input sequence:\",\nfor i in range(len(v)):\n print v[i],\nprint \n\n#Remove all i's\nv2 = str.replace(\"i\", \"\")\n\nprint \"Result after removing i's: \",\nprint v2,\"\\n\"\n\n\n# ***implement replace_copy***\nprint \"Input sequence:\",\nfor i in range(len(v)):\n print v[i],\nprint \n\n#Replace s's with X's\nv2 = str.replace(\"s\", \"X\")\n\nprint \"Result after replacning s's with X's: \",\nprint v2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Input sequence: T h i s i s a t e s t\nResult after removing i's: Ths s a test \n\nInput sequence: T h i s i s a t e s t\nResult after replacning s's with X's: ThiX iX a teXt\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.15, Page Number:535<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Reversing a list'''\n\n#Variable declaration\nv=[]\n\nfor i in range(10):\n v.append(i)\n \nprint \"Initial:\",\nfor i in range(len(v)):\n print v[i],\nprint\n\n#Reversing the list\nv.reverse()\n\nprint \"Reversed:\",\nfor i in range(len(v)):\n print v[i],\nprint \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Initial: 0 1 2 3 4 5 6 7 8 9\nReversed: 9 8 7 6 5 4 3 2 1 0\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.16, Page Number:536<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An implementation of transform algorithm'''\n\n#A simple transformaton function\ndef xform(i):\n return i*i #square original value\n\n#the transorm function\ndef transform(x,f):\n for i in range(len(x)):\n x[i]= f(x[i])\n \n#Variable declaration\nx1=[]\n\n#put values into list\nfor i in range(10):\n x1.append(i)\n\nprint \"Original contents of x1: \",\nfor p in x1:\n print p,\nprint \n\n#transform x1\np=transform(x1,xform)\n\nprint \"Transformed contents of x1:\",\nfor p in x1:\n print p,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original contents of x1: 0 1 2 3 4 5 6 7 8 9\nTransformed contents of x1: 0 1 4 9 16 25 36 49 64 81\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.17, Page Number:540<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A short string demonstration'''\n\nstr1=\"The string class gives \"\nstr2=\"C++ high strng handlng.\"\n\n#assign a string\nstr3=str1\nprint str1,\"\\n\",str3\n\n#Concatenate two strings\nstr3=str1+str2\nprint str3\n\n#Compare strings\nif str3>str1:\n print \"str3 > str1\"\nif str3==str1+str2:\n print \"str3 == str1+str2\"\n \nstr1=\"This is a null-terminated string.\"\nprint str1\n\n#create a string object using another string object\nstr4=str1\nprint str4\n\n#nput a string\nprint \"Enter a string:\"\nstr4=\"Hello\"\nprint str4",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The string class gives \nThe string class gives \nThe string class gives C++ high strng handlng.\nstr3 > str1\nstr3 == str1+str2\nThis is a null-terminated string.\nThis is a null-terminated string.\nEnter a string:\nHello\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.18, Page Number:542<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate insert(), erase(), and replace()'''\n\nstr1=\"This is a test\"\nstr2=\"ABCDEFG\"\n\nprint \"Initial strings:\"\nprint \"str1:\",str1\nprint \"str2:\",str2\nprint\n\n#demonstrate insert\nprint \"Insert str2 into str1:\"\nstr1=str1[:5]+str2+str1[5:]\nprint str1,\"\\n\"\n\n#demonstrate erase\nprint \"Remove 7 charecters from str1:\"\nstr1=str[:5]+str[5:]\nprint str1,\"\\n\"\n\n#demonstrate replace\nprint \"Replace 2 characters in str1 with str2:\"\nstr1=str1[:5]+str2+str1[7:]\nprint str1\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Initial strings:\nstr1: This is a test\nstr2: ABCDEFG\n\nInsert str2 into str1:\nThis ABCDEFGis a test \n\nRemove 7 charecters from str1:\nThis is a test \n\nReplace 2 characters in str1 with str2:\nThis ABCDEFG a test\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.19, Page Number:543<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of find()'''\n\nimport string\n\n#Variable declaration \ns1=\"The string class makes string handling easy.\"\n\ni=string.find(s1,\"class\")\nif not(i==-1):\n print \"Match found at\",i\n print \"Remaining string is:\",\n s2=s1[i:]\n print s2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Match found at 11\nRemaining string is: class makes string handling easy.\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 21.20, Page Number:545<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using a map to create a dictionary'''\n\n#define the function find\ndef find(x,ch):\n for p in x:\n if p[0]==ch:\n return p\n return -1\n\n\ndictionary=[]\n\ndictionary.append([\"house\",\"A place of dwelling\"])\ndictionary.append([\"keyboard\",\"An input device\"])\ndictionary.append([\"programming\",\"The act of writing a program\"])\ndictionary.append([\"STL\",\"Standard Template Library\"])\n\n#given a word, find meaning\nprint \"Enter word:\"\nstr=\"house\" #User input\n\np=find(dictionary,str)\n\nif not(p==-1):\n print \"Definition:\",p[1]\nelse:\n print \"Word not in the dictionary.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter word:\nDefinition: A place of dwelling\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_22(1).ipynb b/C++_from_the_Ground/Chapter_22(1).ipynb
new file mode 100644
index 00000000..83be7161
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_22(1).ipynb
@@ -0,0 +1,207 @@
+{
+ "metadata": {
+ "name": "Chapter 22"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 22: The C++ Preprocessor<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.1, Page Number: 550<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement a function-like macro'''\n\ndef MIN(a,b):\n if a<b:\n return a\n else:\n return b\n\n#Variable declaration\nx=10\ny=20\n\n#Result\nprint \"The minimum is\",MIN(x,y)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The minimum is 10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.2, Page Number: 551<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement a function-like macro'''\n#Since macros is implemented here using functions,\n#it wont give a wrong answer.\n\ndef EVEN(a):\n if a%2==0:\n return 1\n else:\n return 0\n\nif EVEN(9+1):\n print \"is even\"\nelse:\n print \"is odd\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "is even\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.3, Page Number: 551<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement a function-like macro'''\n\ndef EVEN(a):\n if a%2==0:\n return 1\n else:\n return 0\n\nif EVEN(9+1):\n print \"is even\"\nelse:\n print \"is odd\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "is even\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.4, Page Number: 553<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Impementing #if'''\n\ndef MAX():\n return 100\n\nif MAX()>10:\n print \"Extra memory required.\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Extra memory required.\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.5, Page Number: 554<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Impementing #if/#else'''\n\ndef MAX():\n return 6\n\nif MAX()>10:\n print \"Extra memory required.\"\nelse:\n print \"Current memory OK.\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Current memory OK.\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.6, Page Number: 556<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of #ifdef and #ifndef'''\n\ndef TOM():\n pass\n\n\ntry:\n TOM()\nexcept NameError:\n print \"Programmer is unknown.\"\nelse:\n print \"Programmer is Tom.\"\n \ntry:\n RALPH()\nexcept NameError:\n print \"RALPH not defined.\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Programmer is Tom.\nRALPH not defined.\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.7, Page Number: 558<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implement __LINE__ '''\n\nimport inspect\n\n#Returns the current line number in our program.\ndef lineno():\n return inspect.currentframe().f_back.f_lineno\n \nprint lineno()+200\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "209\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.8, Page Number: 559<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implemention # operator'''\n\ndef mkstr(s):\n return str(s)\n\n#Result\nprint mkstr('I like C++')\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "I like C++\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 22.9, Page Number: 560<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implemention # operator'''\n\ndef concat(a,b):\n return a+b\n#Variable declaration\nxy=10\n\n#Result\nexec(\"print %s\")%concat('x','y')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_3(1).ipynb b/C++_from_the_Ground/Chapter_3(1).ipynb
new file mode 100644
index 00000000..b0b5479c
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_3(1).ipynb
@@ -0,0 +1,207 @@
+{
+ "metadata": {
+ "name": "Chapter 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 3: The Basic Data Types<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.1, Page Number: 35<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Local Variables'''\n\ndef func():\n x=-199 #local to func\n print x #displays -199 \n \nx=10 #local to main\n\nfunc()\nprint x #displays 10\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-199\n10\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.2, Page Number: 37<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Global Variables'''\n\ndef func1():\n global count\n print \"count: \",count #access global count\n func2()\n\ndef func2():\n for count in range(3): #this is local variable\n print '.',\n\n \ncount=None #global variables\n\nfor i in range(10):\n count=i*2\n func1()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "count: 0\n. . . count: 2\n. . . count: 4\n. . . count: 6\n. . . count: 8\n. . . count: 10\n. . . count: 12\n. . . count: 14\n. . . count: 16\n. . . count: 18\n. . .\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.3, Page Number: 40<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Singned and Unsigned integers'''\n#Since there is no limit to values stored\n#by integers in python, the output would \n#be different from the one in C++.\n\nfrom ctypes import *\n\n#Variable declaration\nj=c_uint(60000)\ni=c_int(60000)\n\n#Result\nprint i.value,j.value",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "60000 60000\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.4, Page Number: 41<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to print the alphabet in reverse order'''\n\nfor letter in xrange(ord('Z'),ord('A')-1,-1):\n print chr(letter),\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Z Y X W V U T S R Q P O N M L K J I H G F E D C B A\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.5, Page Number: 44<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate character escape sequences'''\n\n#prints a newline, a backslash and a backspace\nprint \"\\n\\\\\\b\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n\\\b\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.6, Page Number: 45<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example that uses variable initalization'''\n\ndef total(x):\n sum=0\n for i in xrange(1,x+1):\n sum=sum+i\n for count in range(10):\n print '-',\n print \"The current sum is\",sum\n \nprint \"Computing summation of 5.\"\ntotal(5)\n\nprint \"Computing summation of 6.\"\ntotal(6)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Computing summation of 5.\n- - - - - - - - - - The current sum is 1\n- - - - - - - - - - The current sum is 3\n- - - - - - - - - - The current sum is 6\n- - - - - - - - - - The current sum is 10\n- - - - - - - - - - The current sum is 15\nComputing summation of 6.\n- - - - - - - - - - The current sum is 1\n- - - - - - - - - - The current sum is 3\n- - - - - - - - - - The current sum is 6\n- - - - - - - - - - The current sum is 10\n- - - - - - - - - - The current sum is 15\n- - - - - - - - - - The current sum is 21\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.7, Page Number: 47<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate arithmetic operations'''\n\n#Variable declaration\nx=10\ny=3\n\nprint x/y #will display 3\nprint x%y #will display1, the remainder\n\nx=1\ny=2\n\n#Result\nprint x/y,x%y #will display 0 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n1\n0 1\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.8, Page Number: 51<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate the xor function'''\n\n#the xor function\ndef xor(a,b):\n return (a or b)and(not(a and b))\n\n#User-input\nprint \"Enter P(0 or 1):\"\np=1 \nprint \"Enter Q(0 or 1):\"\nq=0\n\n#Result\nprint \"P AND Q:\",(p and q)\nprint \"P OR Q:\",(p or q)\nprint \"P XOR Q:\",xor(p,q)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter P(0 or 1):\nEnter Q(0 or 1):\nP AND Q: 0\nP OR Q: 1\nP XOR Q: True\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 3.9, Page Number: 54<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate casting'''\n\nfor i in xrange(1,100+1):\n print i,\"/ 2 is:\",float(i)/2\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 / 2 is: 0.5\n2 / 2 is: 1.0\n3 / 2 is: 1.5\n4 / 2 is: 2.0\n5 / 2 is: 2.5\n6 / 2 is: 3.0\n7 / 2 is: 3.5\n8 / 2 is: 4.0\n9 / 2 is: 4.5\n10 / 2 is: 5.0\n11 / 2 is: 5.5\n12 / 2 is: 6.0\n13 / 2 is: 6.5\n14 / 2 is: 7.0\n15 / 2 is: 7.5\n16 / 2 is: 8.0\n17 / 2 is: 8.5\n18 / 2 is: 9.0\n19 / 2 is: 9.5\n20 / 2 is: 10.0\n21 / 2 is: 10.5\n22 / 2 is: 11.0\n23 / 2 is: 11.5\n24 / 2 is: 12.0\n25 / 2 is: 12.5\n26 / 2 is: 13.0\n27 / 2 is: 13.5\n28 / 2 is: 14.0\n29 / 2 is: 14.5\n30 / 2 is: 15.0\n31 / 2 is: 15.5\n32 / 2 is: 16.0\n33 / 2 is: 16.5\n34 / 2 is: 17.0\n35 / 2 is: 17.5\n36 / 2 is: 18.0\n37 / 2 is: 18.5\n38 / 2 is: 19.0\n39 / 2 is: 19.5\n40 / 2 is: 20.0\n41 / 2 is: 20.5\n42 / 2 is: 21.0\n43 / 2 is: 21.5\n44 / 2 is: 22.0\n45 / 2 is: 22.5\n46 / 2 is: 23.0\n47 / 2 is: 23.5\n48 / 2 is: 24.0\n49 / 2 is: 24.5\n50 / 2 is: 25.0\n51 / 2 is: 25.5\n52 / 2 is: 26.0\n53 / 2 is: 26.5\n54 / 2 is: 27.0\n55 / 2 is: 27.5\n56 / 2 is: 28.0\n57 / 2 is: 28.5\n58 / 2 is: 29.0\n59 / 2 is: 29.5\n60 / 2 is: 30.0\n61 / 2 is: 30.5\n62 / 2 is: 31.0\n63 / 2 is: 31.5\n64 / 2 is: 32.0\n65 / 2 is: 32.5\n66 / 2 is: 33.0\n67 / 2 is: 33.5\n68 / 2 is: 34.0\n69 / 2 is: 34.5\n70 / 2 is: 35.0\n71 / 2 is: 35.5\n72 / 2 is: 36.0\n73 / 2 is: 36.5\n74 / 2 is: 37.0\n75 / 2 is: 37.5\n76 / 2 is: 38.0\n77 / 2 is: 38.5\n78 / 2 is: 39.0\n79 / 2 is: 39.5\n80 / 2 is: 40.0\n81 / 2 is: 40.5\n82 / 2 is: 41.0\n83 / 2 is: 41.5\n84 / 2 is: 42.0\n85 / 2 is: 42.5\n86 / 2 is: 43.0\n87 / 2 is: 43.5\n88 / 2 is: 44.0\n89 / 2 is: 44.5\n90 / 2 is: 45.0\n91 / 2 is: 45.5\n92 / 2 is: 46.0\n93 / 2 is: 46.5\n94 / 2 is: 47.0\n95 / 2 is: 47.5\n96 / 2 is: 48.0\n97 / 2 is: 48.5\n98 / 2 is: 49.0\n99 / 2 is: 49.5\n100 / 2 is: 50.0\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_4(1).ipynb b/C++_from_the_Ground/Chapter_4(1).ipynb
new file mode 100644
index 00000000..5bc3dfe7
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_4(1).ipynb
@@ -0,0 +1,399 @@
+{
+ "metadata": {
+ "name": "Chapter 4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 4: Program Control Statements<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.1, Page Number: 58<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Magic Number Program'''\n\nimport random\n\n#Variable declaration and initialization\nmagic = random.randint(0,100) #Number which the user has to guess\nguess = 10 #Number which the user guesses\n\nif guess == magic:\n print \"***Right***\" #Result\n\n\n \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.2, Page Number: 59<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Magic Number program: 1st improvement'''\n\nimport random\n\n#Variable decleration and initialization\nmagic=random.randint(0,100) #Number to be guessed\nguess = 10 #Number the user guesses\n\n#Result\nif guess == magic:\n print \"***Right***\"\nelse:\n print \"... Sorry, you're wrong.\"\n\n\n\n \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "... Sorry, you're wrong.\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.3, Page Number: 60<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''#Divide the first number by the second.'''\n\n#Variable decleration and initialization\na = 30 #User input for the two nos.\nb = 10\n\n#Calculation and Result\nif b:\n print a/b\nelse:\n print \"Cannot divide by zero.\"\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.4, Page Number: 61<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Magic Number Program: 2nd improvement'''\n\nimport random\n\n#Variable decleration \nmagic = random.randint(0,100) #Numbr to be guessed\nguess = 10 #Number the user guesses\n\n#Result\nif guess == magic:\n print \"***Right***\"\n print magic,\" is the magic number.\"\nelse:\n print \"... Sorry, you're wrong\" \n if(guess>magic): #use a nested if statement\n print \"Your guess is too high\"\n else:\n print \"Your guess is too low\"\n\n \n \n\n \n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.5, Page Number: 62<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Demonstrate an if-else-if ladder'''\n\nfor x in range(6):\n if x==1: #using if-else ladder in a for loop\n print \"x is one\"\n elif x==2:\n print \"x is two\"\n elif x==3:\n print \"x is three\"\n elif x==4:\n print \"x is four\"\n else:\n print \"x is not between 1 nd 4\"\n \n \n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x is not between 1 nd 4\nx is one\nx is two\nx is three\nx is four\nx is not between 1 nd 4\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.6, Page Number: 63<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''For loop demonstration'''\n\nimport math\n\nfor num in range(100):\n sq_root = math.sqrt(float(num)) #Calculation\n print num,\" \",sq_root #Result\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 0.0\n1 1.0\n2 1.41421356237\n3 1.73205080757\n4 2.0\n5 2.2360679775\n6 2.44948974278\n7 2.64575131106\n8 2.82842712475\n9 3.0\n10 3.16227766017\n11 3.31662479036\n12 3.46410161514\n13 3.60555127546\n14 3.74165738677\n15 3.87298334621\n16 4.0\n17 4.12310562562\n18 4.24264068712\n19 4.35889894354\n20 4.472135955\n21 4.58257569496\n22 4.69041575982\n23 4.79583152331\n24 4.89897948557\n25 5.0\n26 5.09901951359\n27 5.19615242271\n28 5.29150262213\n29 5.38516480713\n30 5.47722557505\n31 5.56776436283\n32 5.65685424949\n33 5.74456264654\n34 5.83095189485\n35 5.9160797831\n36 6.0\n37 6.0827625303\n38 6.16441400297\n39 6.2449979984\n40 6.32455532034\n41 6.40312423743\n42 6.48074069841\n43 6.5574385243\n44 6.63324958071\n45 6.7082039325\n46 6.78232998313\n47 6.8556546004\n48 6.92820323028\n49 7.0\n50 7.07106781187\n51 7.14142842854\n52 7.21110255093\n53 7.28010988928\n54 7.34846922835\n55 7.4161984871\n56 7.48331477355\n57 7.54983443527\n58 7.61577310586\n59 7.68114574787\n60 7.74596669241\n61 7.81024967591\n62 7.87400787401\n63 7.93725393319\n64 8.0\n65 8.0622577483\n66 8.12403840464\n67 8.18535277187\n68 8.24621125124\n69 8.30662386292\n70 8.36660026534\n71 8.42614977318\n72 8.48528137424\n73 8.54400374532\n74 8.60232526704\n75 8.66025403784\n76 8.71779788708\n77 8.77496438739\n78 8.83176086633\n79 8.88819441732\n80 8.94427191\n81 9.0\n82 9.05538513814\n83 9.11043357914\n84 9.16515138991\n85 9.21954445729\n86 9.2736184955\n87 9.32737905309\n88 9.38083151965\n89 9.43398113206\n90 9.48683298051\n91 9.53939201417\n92 9.59166304663\n93 9.64365076099\n94 9.69535971483\n95 9.74679434481\n96 9.79795897113\n97 9.8488578018\n98 9.89949493661\n99 9.94987437107\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.7, Page Number: 64<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Printin numbers 100 to -100 in decrements of 5'''\n\nfor i in xrange(100,-100,-5): \n print i,\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 0 -5 -10 -15 -20 -25 -30 -35 -40 -45 -50 -55 -60 -65 -70 -75 -80 -85 -90 -95\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.8, Page Number: 66<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Runs a loop till 123 is typed'''\n\n#Variable decleration\nx=0\n\n#Loop till 123 is entered\nwhile x!=123:\n print \"Enter a number: \"\n x = 123\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a number: \n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.9, Page Number: 68<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Demonstrate switch usig \"help\" program'''\n\n#Displaying the menu\nprint \"Help on:\"\nprint \"1. for\"\nprint \"2. if\"\nprint \"3. while\"\n\n\nchoice = 2 #Choice of user\n\nif choice==1: #Executing users choice with if-else\n print \"for is c++'s most versatile loop.\"\nelif choice==2:\n print \"if is c++'s conditional branch statement.\"\nelif choice==3:\n print \"switch is C++'s multiway branch statement. \"\nelse:\n print \"You must enter a number between 1 and 3.\"\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Help on:\n1. for\n2. if\n3. while\nif is c++'s conditional branch statement.\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.10, Page Number: 69<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing the switch statement'''\n#If switch without break is used(as in the book), \n#it gives a different output(Fall through).'''\n\nfor i in range(5):\n if i==0:\n print \"less than 1\"\n elif i==1:\n print \"less than 2\"\n elif i==2:\n print \"less than 3\"\n elif i==3:\n print \"less than 4\"\n elif i==4:\n print \"less than 5\"\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "less than 1\nless than 2\nless than 3\nless than 4\nless than 5\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.11, Page Number: 71<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Displays all printable characters.'''\n\n#Variable decleration\nch = 32\n\n#Loop to print the characters\nfor ch in range(128):\n print chr(ch)\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\u0000\n\u0001\n\u0002\n\u0003\n\u0004\n\u0005\n\u0006\n\u0007\n\b\n\t\n\n\n\u000b\n\f\n\r\n\u000e\n\u000f\n\u0010\n\u0011\n\u0012\n\u0013\n\u0014\n\u0015\n\u0016\n\u0017\n\u0018\n\u0019\n\u001a\n\u001b\n\u001c\n\u001d\n\u001e\n\u001f\n \n!\n\"\n#\n$\n%\n&\n'\n(\n)\n*\n+\n,\n-\n.\n/\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n:\n;\n<\n=\n>\n?\n@\nA\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nL\nM\nN\nO\nP\nQ\nR\nS\nT\nU\nV\nW\nX\nY\nZ\n[\n\\\n]\n^\n_\n`\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nw\nx\ny\nz\n{\n|\n}\n~\n\u007f\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.12, Page Number: 72<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example for while loop'''\n\n#Variable decleration\nlen = 5\n\nwhile (len>0 & len<80):\n print \".\"\n len-=1\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": ".\n.\n.\n.\n.\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.13, Page Number: 73<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to loop till number 100 is entered'''\n\n#Variable Declaration\nnum=95\n\nwhile True:\n print \"Enter a number(100 to stop): \"\n num+=1 #User input, incrementing num till it reaches 100\n if(num==100): #Condition check to stop loop\n break\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a number(100 to stop): \nEnter a number(100 to stop): \nEnter a number(100 to stop): \nEnter a number(100 to stop): \nEnter a number(100 to stop): \n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.14, Page Number: 73<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Magic Number program: 3rd improvement.'''\n\nimport random\n\n#Variable decleration\nmagic = random.randint(0,100) #Number which the user has to guess\nlow=0\nhigh=100\n\n#Play thr magic number game\nwhile True:\n guess = random.randint(low,high) #Number which the user guesses\n if guess==magic: \n print \"**Right**\"\n print magic,\" is the magic number.\"\n break\n else:\n print \"...Sorry, you're wrong.\"\n if(guess>magic):\n print \"Your guess is too high.\"\n high=guess\n else:\n print \"Your guess is too low.\"\n low=guess\n \n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "...Sorry, you're wrong.\nYour guess is too low.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too low.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too low.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too low.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too low.\n...Sorry, you're wrong.\nYour guess is too low.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too high.\n...Sorry, you're wrong.\nYour guess is too low.\n**Right**\n72 is the magic number.\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.15, Page Number: 74<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example for continue statement'''\n\nfor x in range(100+1):\n if x%2: #Condition check to continue the loop\n continue\n print x,\n \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.16, Page Number: 75<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Iterates from 0 to 9, not to 100'''\n\nfor t in range(100):\n if t==10: #Condition check to break out of the loop\n break\n print t,\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.17, Page Number: 75<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example for break'''\n\nfor t in range(100):\n count = 1 \n while True:\n print count,\n count+=1\n if count==10: \n break #Breaks from the inner loop\n print\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5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 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.18, Page Number: 76<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This Program finds the prime nos. from 2 to 1000'''\n\nfor i in range(2,1000):\n j=2\n for j in range(2,i/j): #Nested for loop\n if i%j == False: #Check for prime no.\n break\n if j>(i/j):\n print i,\" is prime.\" #Result\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2 is prime.\n3 is prime.\n11 is prime.\n13 is prime.\n17 is prime.\n19 is prime.\n23 is prime.\n29 is prime.\n31 is prime.\n37 is prime.\n41 is prime.\n43 is prime.\n47 is prime.\n53 is prime.\n59 is prime.\n61 is prime.\n67 is prime.\n71 is prime.\n73 is prime.\n79 is prime.\n83 is prime.\n89 is prime.\n97 is prime.\n101 is prime.\n103 is prime.\n107 is prime.\n109 is prime.\n113 is prime.\n127 is prime.\n131 is prime.\n137 is prime.\n139 is prime.\n149 is prime.\n151 is prime.\n157 is prime.\n163 is prime.\n167 is prime.\n173 is prime.\n179 is prime.\n181 is prime.\n191 is prime.\n193 is prime.\n197 is prime.\n199 is prime.\n211 is prime.\n223 is prime.\n227 is prime.\n229 is prime.\n233 is prime.\n239 is prime.\n241 is prime.\n251 is prime.\n257 is prime.\n263 is prime.\n269 is prime.\n271 is prime.\n277 is prime.\n281 is prime.\n283 is prime.\n293 is prime.\n307 is prime.\n311 is prime.\n313 is prime.\n317 is prime.\n331 is prime.\n337 is prime.\n347 is prime.\n349 is prime.\n353 is prime.\n359 is prime.\n367 is prime.\n373 is prime.\n379 is prime.\n383 is prime.\n389 is prime.\n397 is prime.\n401 is prime.\n409 is prime.\n419 is prime.\n421 is prime.\n431 is prime.\n433 is prime.\n439 is prime.\n443 is prime.\n449 is prime.\n457 is prime.\n461 is prime.\n463 is prime.\n467 is prime.\n479 is prime.\n487 is prime.\n491 is prime.\n499 is prime.\n503 is prime.\n509 is prime.\n521 is prime.\n523 is prime.\n541 is prime.\n547 is prime.\n557 is prime.\n563 is prime.\n569 is prime.\n571 is prime.\n577 is prime.\n587 is prime.\n593 is prime.\n599 is prime.\n601 is prime.\n607 is prime.\n613 is prime.\n617 is prime.\n619 is prime.\n631 is prime.\n641 is prime.\n643 is prime.\n647 is prime.\n653 is prime.\n659 is prime.\n661 is prime.\n673 is prime.\n677 is prime.\n683 is prime.\n691 is prime.\n701 is prime.\n709 is prime.\n719 is prime.\n727 is prime.\n733 is prime.\n739 is prime.\n743 is prime.\n751 is prime.\n757 is prime.\n761 is prime.\n769 is prime.\n773 is prime.\n787 is prime.\n797 is prime.\n809 is prime.\n811 is prime.\n821 is prime.\n823 is prime.\n827 is prime.\n829 is prime.\n839 is prime.\n853 is prime.\n857 is prime.\n859 is prime.\n863 is prime.\n877"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " is prime.\n881 is prime.\n883 is prime.\n887 is prime.\n907 is prime.\n911 is prime.\n919 is prime.\n929 is prime.\n937 is prime.\n941 is prime.\n947 is prime.\n953 is prime.\n967 is prime.\n971 is prime.\n977 is prime.\n983 is prime.\n991 is prime.\n997 is prime.\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 4.19, Page Number: 78<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Magic Number program: Final improvement'''\n\nimport random\n\n#Variable declaration\nmagic = random.randint(0,100) #Number to be guessed\ni=1\nhigh=100\nlow=0\n\n#Function to play the magic number game\ndef play(m):\n low=0\n high=100\n for t in range(100):\n x = random.randint(low,high) #Number guessed by the user\n if x==m:\n print \"***Right***\"\n return\n else:\n if(x<m):\n print \"Too low.\"\n low=x\n else:\n print \"Too high.\"\n high=x\n print \"You've used up all your guesses\" \n\n#Menu\nwhile True:\n print \"1.Get a new magic number.\" \n print \"2.Play\"\n print \"3.Quit\"\n while True:\n option = i \n if option>=1 and option<=3:\n break\n if option==1:\n magic=random.randint(0,100) #Number to be guessed\n elif option==2:\n play(magic) #Calls the function play\n elif option==3:\n print \"Goodbye\" \n break\n i+=1 #increments i such that the 3 options get selected sequentially\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1.Get a new magic number.\n2.Play\n3.Quit\n1.Get a new magic number.\n2.Play\n3.Quit\nToo low.\nToo low.\nToo low.\nToo low.\nToo high.\nToo low.\nToo high.\nToo low.\nToo high.\nToo high.\nToo high.\nToo high.\nToo low.\n***Right***\n1.Get a new magic number.\n2.Play\n3.Quit\nGoodbye\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_5(1).ipynb b/C++_from_the_Ground/Chapter_5(1).ipynb
new file mode 100644
index 00000000..4ae8f6f6
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_5(1).ipynb
@@ -0,0 +1,668 @@
+{
+ "metadata": {
+ "name": "Chapter 5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 5: Arrays ans Strings<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.1, Page Number: 82<h3>\n "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Loads sample with the numbers 0 to 9'''\n\n#Variable declaration\nsample = range(10) #Declares an array [0,1,2,3,4,5,6,7,8,9]\n\n#Displays the array\nfor t in range(10):\n print sample[t],\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.2, Page Number: 83<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Maximum and Minimum value from a list'''\n\nimport random\n\n#Variable declaration\nlist = [] #List of integers\n\nfor i in range(10):\n list.append(random.randint(0,1000)) #randomely assigning integers\n \n#Finding the minimum value\nmin_value = list[0]\n\nfor i in range(10):\n if min_value>list[i]:\n min_value=list[i]\nprint \"minimum value: \",min_value #Result:Minimum value\n\n#Finding maximum value\nmax_value = list[0]\n\nfor i in range(10):\n if max_value<list[i]:\n max_value=list[i]\nprint \"maximum value: \",max_value #Result:Maximum value\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "minimum value: 192\nmaximum value: 684\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.3, Page Number: 85<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Bubble Sort'''\n\nimport random\n\n#Variable declaration\nnums = []\nsize = 10\n\n#Initializing list with random numbers\nfor t in range(size):\n nums.append(random.randint(0,1000))\n\n#Displays original array\nprint \"Original array is: \"\nprint nums\n\n#Bubble Sort\nfor a in range(size):\n for b in xrange(size-1,a,-1):\n if nums[b-1]>nums[b]:\n t=nums[b-1]\n nums[b-1]=nums[b]\n nums[b] = t\n\n#Display sorted array\nprint \"Sorted array is: \"\nprint nums\n\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original array is: \n[388, 661, 218, 595, 167, 46, 704, 140, 559, 428]\nSorted array is: \n[46, 140, 167, 218, 388, 428, 559, 595, 661, 704]\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.4, Page Number: 87<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Example for a string; Implementing cin and cout'''\n\n#Variable decleration\nstr = \"Hello\"\n\n#Result\nprint \"Here is your string:\",\nprint str\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Here is your string: Hello\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.5, Page Number: 88<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Example for a string; Implementing gets for input'''\n\nprint \"Enter a string: \"\n\n#user input\nstr = \"Hello\"\n\n#Result\nprint \"Here is your string:\",\nprint str\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a string: \nHere is your string: Hello\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.6, Page Number: 89<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Implementing strcpy'''\n\n#Variable decleration\ns=str\nstr = s #copying s into str\n\n#Result\nprint str\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.7, Page Number: 89<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Example for concatenation'''\n\n#Variable decleration\ns1 = \"Hello\"\ns2 = \" There\"\n\n#Concatenation\ns1+=s2\n\n#Result\nprint s1\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello There\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.8, Page Number: 90<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n#Example for string compare: Password verification\n\n#Function for password verification\ndef password():\n print \"Enter password: \" #User input for password\n s= \"pass\"\n if s==\"password\":\n return True\n else:\n print \"Invalid password.\"\n return False\n\n#Result\nif password() :\n print \"Logged On.\"\nelse:\n print \"Access denied\"\n \n \n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter password: \nInvalid password.\nAccess denied\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.9, Page Number: 91<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Takes user input till strings match'''\n\nwhile True:\n s=raw_input(\"Enter a string: \") #User input of string;\n if s==\"quit\": #Sting comparison\n break\n \n \n\n \n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a string: ddc\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a string: hello\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a string: quit\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.10, Page Number: 91<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''String length; Implementing strlen'''\n\n#Variable declaration\nstr = \"Hello\"\n\n#Result\nprint \"Length is: \",len(str)\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Length is: 5\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.11, Page Number: 92<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Print a string backwards.'''\n\n#Taking a user input string\nstr = \"Hello World\"\n\n#Reversing a String\nrev = str[::-1]\n\n#Result\nprint rev\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "dlroW olleH\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.12, Page Number: 92<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\n'''Illustrating string functions'''\n\n#Variable declaration\ns1 = \"Hello\"\ns2 = \"there\"\n\n#Printing lengths\nprint \"lengths: \",len(s1),' ',len(s2)\n\n#Comparing\nif(s1==s2):\n print \"The strings are equal\"\nelse:\n print \"not equal\"\n\n#Concatenation\ns1+=s2\nprint s1\n\n\n#Copying\ns1=s2\n\n#Result\nprint s1,\"and\",s2,\" are now the same\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "lengths: 5 5\nnot equal\nHellothere\nthere and there are now the same\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.13, Page Number: 93<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Convert a string to upper case'''\n\nimport string\n\n#Variable Initialization\nstr= \"this is a test\"\n\nstr=string.upper(str)\n\n#Result\nprint str\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "THIS IS A TEST\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.14, Page Number: 94<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Load a two-dimensional array with values 1-12'''\n\n#Variable Initialization\narr=[] #The 2-D list\nnew=[] #The nested list\n\n#Initializing the 2-D array\nfor i in range(3):\n new=[]\n for j in range(4):\n new.append(i*4+j+1)\n arr.append(new)\n\n#Result\nfor i in range(3):\n for j in range(4):\n print arr[i][j],\n print",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 2 3 4\n5 6 7 8\n9 10 11 12\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.15, Page Number: 98<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Looks up a no. in an array n prints the corresponding square'''\n\n#Variabe Initialzation\nsqrs= [[1,1],[2,4],[3,9],[4,16],[5,25],\n [6,36],[7,49],[8,64],[9,81],[10,100]] #Array storing the squares\ni=6 #User input of number whose square is to be looked up\n\n#Search for the number\nfor j in range(10):\n if sqrs[j][0]==i:\n break\n \n#Result\nprint \"The square of \",i,\" is \", sqrs[j][1]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The square of 6 is 36\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.16, Page Number: 99<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstating how local strings are initialized each time they are called'''\n\ndef f1():\n s=\"this is a test\" #initial s\n print s\n s=\"CHANGED\" #s is now changed \n print s\n\n#Calling the function twice\nf1()\nf1()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "this is a test\nCHANGED\nthis is a test\nCHANGED\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.17, Page Number: 101<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Enter and display strings'''\n\n#Variable decleration\ntext=[]\nstr=['eat','play','work'] #user input of strings\np=len(str)\n\nfor t in range(p):\n print t,\":\"\n text.append(str[t]) #Here, user input taken from the list\n \n#Result; redisplay the strings\nfor i in range(p):\n print text[i]\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 :\n1 :\n2 :\neat\nplay\nwork\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 5.18, Page Number: 103<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple employee database program'''\nimport random \n\n#Variable decleration\nname=[] #this list holds employee names\nwage=[] #their phone numbers\nphone=[] #hours worked per week\nhours=[] #wage\nnum=0 #User choice\n\n#Menu \ndef menu():\n global num #All options are chosen one by one\n print \"0.Quit.\"\n print \"1.Enter information\"\n print \"2.Report information\"\n print \"Choose one: \"\n num=int(input())\n return num #Return users selction\n\n#Enter information\ndef enter():\n for i in range(10):\n n=raw_input(\"Enter your name: \")\n name.append(n)\n phone.append(int(input(\"Enter your phone number\")))\n hours.append(int(input(\"Enter number of hours worked: \")))\n wage.append(int(input(\"Enter wage: \")))\n\n#Display report\ndef report():\n p=len(name)\n for i in range(p):\n print name[i],' ',phone[i]\n print \"Pay for the week: \",wage[i]*hours[i]\n\n\nwhile True:\n ch=menu() #get selection\n if ch==0:\n break\n elif ch==1:\n enter()\n elif ch==2:\n report()\n else:\n print \"Try again.\"\n if ch==0:\n break\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.Quit.\n1.Enter information\n2.Report information\nChoose one: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Anny\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number987654321\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 50\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Billy\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9456783652\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 50\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Catherene\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9476836578\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 50\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Dolly\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9831356748\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 15\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 50\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Emily\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9576843721\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 15\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 40\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Jack\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9485738567\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 45\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Kevin\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9345678923\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 45\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Lily\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9345672831\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 45\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Monica\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number9475867483\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 50\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your name: Irene\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your phone number5674356776\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of hours worked: 10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter wage: 20\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.Quit.\n1.Enter information\n2.Report information\nChoose one: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Anny 987654321\nPay for the week: 500\nBilly 9456783652\nPay for the week: 500\nCatherene 9476836578\nPay for the week: 500\nDolly 9831356748\nPay for the week: 750\nEmily 9576843721\nPay for the week: 600\nJack 9485738567\nPay for the week: 450\nKevin 9345678923\nPay for the week: 450\nLily 9345672831\nPay for the week: 450\nMonica 9475867483\nPay for the week: 500\nIrene 5674356776\nPay for the week: 200\n0.Quit.\n1.Enter information\n2.Report information\nChoose one: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_6(1).ipynb b/C++_from_the_Ground/Chapter_6(1).ipynb
new file mode 100644
index 00000000..052075ed
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_6(1).ipynb
@@ -0,0 +1,287 @@
+{
+ "metadata": {
+ "name": "Chapter 6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 6: Pointers<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.1, Page Number: 107<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing pointers in python'''\n\nfrom ctypes import *\n\nbalance =c_int(3200) #int variable\nbalptr=pointer(balance) #pointer to int\nvalue=balptr[0] #accessing the value using the pointer\n\n#Result\nprint \"balance: \",value \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "balance: 3200\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.2, Page Number: 109<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program will not create the problem as in C++ since \n python does'nt have specific data types'''\n\n#Variable declaration\nx=123.23\ny=c_double()\np=POINTER(c_int)\n\np=pointer(c_int(int(x))) #type case double to int\ny=p[0]\n\n#Result\nprint y",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "123\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.3, Page Number: 110<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate usage of pointers'''\n\nfrom ctypes import *\n\n#Variable declaration\nnum=c_int() #declaring int\np=pointer(num) #pointer to int\n\np[0]=100\nprint num.value,\np[0]+=1\nprint num.value,\np[0]-=1\nprint num.value",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100 101 100\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.4, Page Number: 111<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate pointer arithmetic'''\n\nfrom ctypes import *\n\n#Variable declaration\nj=c_int()\ng=c_double()\ni=pointer(j)\nf=pointer(g)\n\n\nfor x in range(10):\n print addressof(i.contents)+x,addressof(f.contents)+x\n \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "84638480 84639248\n84638481 84639249\n84638482 84639250\n84638483 84639251\n84638484 84639252\n84638485 84639253\n84638486 84639254\n84638487 84639255\n84638488 84639256\n84638489 84639257\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.5, Page Number: 114<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Tokenizing program: pointer verion'''\n\nfrom ctypes import *\n\n#Variable declaration\nstr=\"This is a test\"\ntoken =\"\"\ni=0\n\n#Read a token at a time from the string\nwhile i<len(str):\n token=c_char_p(\"\") #set token to null string\n q=pointer(token) \n #Read characters until either a space or the null terminator is encountered'''\n while i<len(str) and not(str[i]==\" \"):\n q[0]+=str[i]\n i+=1\n i+=1 #advance past the space\n print q[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This\nis\na\ntest\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.6, Page Number: 115<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Tokenizing program: array-indexing verion'''\n\n#Variable declaration\nstr=\"This is a test\"\ni=0\n\n#Read a token at a time from the string\nwhile i<len(str):\n token=\"\" #set q to null string\n #Read characters until either a space or the null terminator is encountered'''\n while i<len(str) and not(str[i]==\" \"):\n token+=str[i]\n i+=1\n i+=1 #advance past the space\n print token",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This\nis\na\ntest\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.7, Page Number: 115<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Converting to uppercase using pointer indexing'''\n\nimport string\n\nstr=c_char_p(\"hello tom\")\nq=\"\"\np=pointer(str) #put address of str into p\n \np[0]=string.upper(p[0])\n\n#Result\nprint p[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "HELLO TOM\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.8, Page Number: 117<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Pointers and string literals'''\n\n#Varible declaration\ns=\"Pointers are fun to use\"\n\n#Result\nprint s\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Pointers are fun to use\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.9, Page Number: 118<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example of pointers and arrays'''\n\nfrom ctypes import *\n\n#Variable declaration\nnum=[]\n\n#User input\nfor i in range(10):\n num.append(i)\n \nstart=num #set start to the starting pointer \nfor i in range(10):\n print start[i],\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.10, Page Number: 119<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A fortune cookie program'''\n\nimport random\n\nfortunes=[\"Soon, you will come into some money.\",\n \"A new love will enter your lifr. \",\n \"You will live long and prosper.\",\n \"Now is a good time to invest for the future.\",\n \"A close friend will ask for a favour.\"]\n\nprint \"To see your fortune, press a key: \"\n\n#Randomize the random number generator\nchance=random.randint(0,100)\nchance=chance%5\n\n#Result\nprint fortunes[chance]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "To see your fortune, press a key: \nA close friend will ask for a favour.\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.11, Page Number: 120<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple C++ keyword synopsis program'''\n\nkeyword=[[\"for\",\"for(initialization; condition; increment\"],\n [\"if\",\"if(condition) ... else ...\"],\n [\"switch\",\"switch(value) { case-list }\"],\n [\"while\",\"while(condition) ...\"],\n [\"\",\"\"]] #Terminates the list with nulls\n \n#User input \nprint \"Enter keyword: \"\nstr=\"for\" \n\nfor i in range(4):\n if str==keyword[i][0]:\n print keyword[i][1]\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter keyword: \nfor(initialization; condition; increment\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.12, Page Number: 123<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate multiple indirection'''\n\nfrom ctypes import *\n\n#Variable declaration\nx=c_int(10) #int variable\np=pointer(x) #pointer to int\nq=pointer(p) #pointer to a pointer\n\n#Result\nprint q[0][0] #accessing the value using a pointer to a pointer\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 6.13, Page Number: 126<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Print ASCII value of each character of string using pointer'''\n\nfrom ctypes import *\n\n#Variable declaration\ns=c_char_p()\np1=pointer(s)\nx=0\n\nwhile True:\n print \"\\nEnter a string: \",\n if x==2:\n p1[0]=c_char_p(\"done\")\n else:\n p1[0]=c_char_p(\"Hello\")\n #print the ASCII values of each characcter\n for i in range(0,len(p1[0])):\n print ord(p1[0][i]),\n x+=1\n if p1[0]==\"done\":\n break\n \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\nEnter a string: 72 101 108 108 111 \nEnter a string: 72 101 108 108 111 \nEnter a string: 100 111 110 101\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_7(1).ipynb b/C++_from_the_Ground/Chapter_7(1).ipynb
new file mode 100644
index 00000000..4e347f41
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_7(1).ipynb
@@ -0,0 +1,472 @@
+{
+ "metadata": {
+ "name": "Chapter 7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 7: Functions,Part One: The Fundamentals<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.1, Page Number: 129<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example of a function'''\n\ndef f1():\n print \"Enter something: \"\n str= \"Hello\" #User-input\n print str\n \n#Variable decleration\nstr=\"This is str in main\"\n\nprint str\nf1() #function call\nprint str",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This is str in main\nEnter something: \nHello\nThis is str in main\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.2, Page Number: 130<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program illustrates how variables can be local to a block'''\n\n#Variable decleration\nchoice=0\n\nprint \"(1) add numbers or (2) concatenate strings?: \"\nchoice=2 #User Input taken as 2\n\nif choice==1:\n print \"Enter two numbers: \"\n a=5 #Variable decleration; User Input\n b=7\n print a+b #Result\nelse :\n print \"Enter two strings: \"\n s1=\"Hello\" #Variable decleration; User Input\n s2=\"World\"\n s1+=s2 #Concatenation\n print s1 #Result",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "(1) add numbers or (2) concatenate strings?: \nEnter two strings: \nHelloWorld\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.3, Page Number: 131<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program illustrates the scope of variables'''\n\n'''This program will give same output for inner and outer i's\n because pyhton doesnt consider the if statment block as a scope'''\n#Variable decleration\ni=10\nj=100\n\nif j>0:\n i=None \n i= j/2\n print \"inner i: \",i #Result\n\nprint \"outer i: \",i #Result",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "inner i: 50\nouter i: 50\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.4, Page Number: 132<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example for declaring variables anywhere in the program'''\n\na=5 #Variable decleration; user input\n\nb=10 #declaration of another variable; user input\n\n#Result\nprint \"Product: \",a*b",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Product: 50\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.5, Page Number: 134<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A simple addition drill program.'''\n\nimport random\n\n#Variable decleration\ncount=None\nnum_right=0\n\n#Function for the drill\ndef drill():\n #Generate two numbers between 0 and 99.\n a=random.randint(0,99)\n b=random.randint(0,99)\n #The user gets three tries to get it right.\n for count in range(3):\n print \"What is \",a,\" + \",b,\"? \"\n ans = random.randint(0,200) #user input\n if ans==a+b:\n print \"Right\"\n num_right+=1\n print \"You've used up all your tries.\"\n print \"The answer is \",a+b\n \n#Main function \nprint \"How many practice problems: \"\ncount=2 #User input taken as 2\nnum_right=0\nwhile True:\n drill()\n count-=1\n if(count==0):\n break\n \n#Result\nprint \"You got \",num_right,\" right. \" \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "How many practice problems: \nWhat is 9 + 89 ? \nWhat is 9 + 89 ? \nWhat is 9 + 89 ? \nYou've used up all your tries.\nThe answer is 98\nWhat is 85 + 98 ? \nWhat is 85 + 98 ? \nWhat is 85 + 98 ? \nYou've used up all your tries.\nThe answer is 183\nYou got 0 right. \n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.6, Page Number: 136<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Pass by reference(pointer) to a function'''\n\nfrom ctypes import *\n\n#Function to change the reference value\ndef f(j):\n j[0]=100 #j is assigned 100\n\n#Variable decleration\ni=c_int(1)\np=pointer(i)\n\n#Calling the function\nf(p) \n\nprint i",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "c_long(100)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.7, Page Number: 137<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Pass by reference(pointer) to a function'''\n\nfrom ctypes import *\n\n#Function to change the reference value\ndef f(j):\n j[0]=100 #j is assigned 100\n\n#Variable decleration\ni=c_int(1)\np=pointer(i)\n\n#Calling the function\nf(p) \n\nprint i",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "c_long(100)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.8, Page Number: 137<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calling function with a list(array)'''\n\n#function to print some nos.\ndef display(num):\n for i in range(10):\n print num[i],\n \n#Variable declaration\nt=[]\n\nfor i in range(10):\n t.append(i)\n#Pass list to a function\ndisplay(t)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.9, Page Number: 138<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Displaying list without passing the list'''\n\n#Print some nos.\ndef display(num):\n print num,\n\n#Variable declaration\nt=[]\n\nfor i in range(10):\n t.append(i)\n \n#Printing without passing entire list\nfor i in range(10):\n display(t[i])",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 5 6 7 8 9\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.10, Page Number: 139<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to convert each of the array element into its cube'''\n\n#Function to convert into cubes\ndef cube(n,num):\n num-=1\n while num:\n n[num]=n[num]*n[num]*n[num]\n num-=1\n\n#Variable declaration\nnums=[]\n\nfor i in range(10):\n nums.append(i+1)\n \nprint \"Original contents: \",\nfor i in range(10):\n print nums[i],\nprint\n\ncube(nums,10) #Compute cubes\n\n#Result\nprint \"Altered contents: \",\nfor i in range(10):\n print nums[i],",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original contents: 1 2 3 4 5 6 7 8 9 10\nAltered contents: 1 8 27 64 125 216 343 512 729 1000\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.11, Page Number: 140<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to convert a string to uppercase'''\n\nimport string\n\ndef stringupper(str):\n str=string.upper(str) #convert to uppercase\n return str\n\n#Variable declaration \nstr=\"this is a test\"\n\n#Calling the function\nstr=stringupper(str)\n\n#Result\nprint str",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "THIS IS A TEST\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.12, Page Number: 141<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to find length of string'''\n\n#Function to fond length\ndef mystrlen(str):\n l=len(str)\n return l\n\n#Result\nprint \"Length of Hello There is: \",\nprint mystrlen(\"Hello There\")",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Length of Hello There is: 11\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.13, Page Number: 142<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrates how to access command line arguments.'''\n#This wont work because we cannot provide command line arguments\n\nimport sys\n\ndef main():\n if len(sys.argv)!=2:\n print \"You forgot to type your name.\" #CHECK!!!!\n return\n #Result\n print \"Hello \",sys.argv[1]\n\nmain()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "You forgot to type your name.\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.14, Page Number: 143<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The program prints all command line arguments '''\nimport sys\n\n#Result\nfor t in range(len(sys.argv)):\n i=0\n print sys.argv[t] ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-c\n-f\nC:\\Users\\Anandi\\.ipython\\profile_default\\security\\kernel-6e851974-75ff-4911-bdf9-e089a03e5741.json\n--KernelApp.parent_appname='ipython-notebook'\n--interrupt=904\n--parent=876\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.15, Page Number: 144<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program concatenates the two string arguments and displays them'''\n\nimport sys\n\nif len(sys.argv)!=3:\n print \"usage: add num num\" \nelse :\n #Variable Decleration\n a=sys.argv[1]\n b=sys.argv[2]\n #Result\n print a+b\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "usage: add num num\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.16, Page Number: 145<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example program'''\n\nimport string\n\n#Variable Decleration\ni=string.atoi(\"100\")\nj=string.atoi(\"100000\")\nk=string.atof(\"-0.123\")\n\n#Result\nprint i,\" \",j,\" \",k",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100 100000 -0.123\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.17, Page Number: 147<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example to use the function abs()'''\n\n#Variable Decleration\ni=abs(-10)\n\n#Result\nprint abs(-23)\nabs(100)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "23\n"
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 5,
+ "text": "100"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.18, Page Number: 148<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to find a substring'''\n\n#Return index of substring or -1 if not found.\ndef find_substr(sub,str):\n l=str.find(sub)\n return l\n\n#Variable decleration;Calling the function\nindex=find_substr(\"three\",\"one two three four\")\n\n#Result\nprint \"Index of three is \",index",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Index of three is 8\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.19, Page Number: 149<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to print a string vertically downward'''\n\nimport sys\n\ndef print_vertical(str):\n l=len(str)\n for i in range(l):\n print str[i],\n \nprint_vertical(sys.argv[1])\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "- f\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.20, Page Number: 150<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Rework find_substr() to return pointer'''\n\n#Return position of substring\ndef find_substr(sub,str):\n return str.find(sub)\n\n#Variable declaration\ns=\"one two three four\"\n\nsubstr = find_substr(\"three\",s)\n\n#Result\nprint \"substring found:\",s[substr:]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "substring found: three four\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.21, Page Number: 154<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to calculate factorial'''\n\n#Recursive version\ndef factr(n):\n if n==1:\n return 1\n answer=factr(n-1)*n\n return answer\n\n#Iterative version\ndef fact(n):\n answer=1\n for t in range(n):\n answer=answer*(t+1)\n return answer\n\n#Using recursion version\nprint \"4 factorial is \",factr(4)\n\n#Using iterative version\nprint \"4 factorial is \",fact(4)\n\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4 factorial is 24\n4 factorial is 24\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 7.22, Page Number: 155<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Print a string backwards using recursion'''\n\n#Reversing a string\ndef reverse(s):\n r = \"\"\n for c in s:\n r=c+r\n print r\n \n#VariabDecleration \nstr=\"this is a test\"\n\n#Calling function\nreverse(str)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "tset a si siht\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_8(1).ipynb b/C++_from_the_Ground/Chapter_8(1).ipynb
new file mode 100644
index 00000000..da5f88d2
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_8(1).ipynb
@@ -0,0 +1,327 @@
+{
+ "metadata": {
+ "name": "Chapter 8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 8: Functions,Part Two: References, Overloading, and Default Arguments<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.1, Page Number: 158<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example for call by value'''\n\ndef sqr_it(x):\n x=x*x\n return x\n\n#Variable decleration\nt=10\n\n#Result; function calling\nprint sqr_it(t),' ',t\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100 10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.2, Page Number: 159<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to swap two values; implementing call by pointers'''\n\ndef swap(x,y):\n temp=x\n x=y\n y=temp\n return x, y\n\n#Variable decleration\ni=10\nj=20 \n\n#Initial values\nprint \"Initial values of i and j: \",\nprint i,' ',j\n\n#Calling function to swap\ni, j=swap(i,j)\n\n#Result\nprint \"Swapped values of i and j: \",\nprint i,' ',j",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Initial values of i and j: 10 20\nSwapped values of i and j: 20 10\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.3, Page Number: 161<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example to implement call by reference in python'''\n\ndef f(i):\n i=10\n return i #Returning the value since the function cannot access the variables in the calling scope.\n\n#Variable Decleration\nval=1\n\nprint \"Old value for val: \",val\nval=f(val) #Function call\n\n#Result\nprint \"New value for val: \",val\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Old value for val: 1\nNew value for val: 10\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.4, Page Number: 162<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Program to swap two values; implementing call by reference'''\n\ndef swap(i,j):\n temp=i[0]\n i[0]=j[0]\n j[0]=temp\n return i, j\n\n#Variable decleration\ni=[]\nj=[]\ni.append(10)\nj.append(20)\n\n#Initial values\nprint \"Initial values of i and j: \",\nprint i[0],' ',j[0]\n\n#Calling function to swap\ni, j=swap(i,j)\n\n#Result\nprint \"Swapped values of i and j: \",\nprint i[0],' ',j[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Initial values of i and j: 10 20\nSwapped values of i and j: 20 10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.5, Page Number: 164<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example program'''\n#Since python cannot return references, the value is changed using the variable itself\n\n#Variable Decleration\nval = 100.0\n\ndef f():\n global val\n return val\n\n#Result\nprint val\n\nnewval=f() #function call\nprint newval\n\nval=99.1 #change val's value\nprint f() #print val's new value\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100.0\n100.0\n99.1\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.6, Page Number: 166<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Changing contents of a list'''\n#Since python cannot return references, the program has been modified.\n\n#Function definition\ndef change_it(i,n):\n global vals\n vals[i]=n\n\n#Variable Decleration\nvals=[1.1,2.2,3.3,4.4,5.5]\n\nprint \"Here are the original values: \",\nfor i in range(5):\n print vals[i],\nprint\n \n#Function call\nchange_it(1,5298.23)\nchange_it(3,-98.8)\n\n#Result\nprint \"Here are the changed values: \",\nfor i in range(5):\n print vals[i],",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Here are the original values: 1.1 2.2 3.3 4.4 5.5\nHere are the changed values: 1.1 5298.23 3.3 -98.8 5.5\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.7, Page Number: 167<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing a simple safe array'''\n\n#Variable Decleration\nvals=[None]*10\nerror=-1\n\n#put values into the array\ndef put(i,n):\n global vals\n if i>=0 and i<10:\n vals[i]=n\n else:\n print \"Bounds Error!\"\n error=n\n\n#obtain a value from the array\ndef get(i):\n if i>=0 and i<10:\n return vals[i]\n else:\n print \"Bounds error!\"\n return -1\n \n#put values into the array\nput(0,10)\nput(1,20)\nput(9,30)\n\n#Result\nprint get(0),' ',get(1),' ',get(9),\n\n#now, intentionally generate an errer\nput(12,1)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 30 Bounds Error!\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.8, Page Number: 169<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing references in pyhton'''\n\n#Variable Decleration\ni=[]\nj=i #independent reference\n\nj.append(10) #Here i and j are just references to [10]\n\nprint j[0],\" \",i[0] \n\nk=121\ni[0]=k #copies k's value into j[0] \n\n#Result\nprint j[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 10\n121\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.9, Page Number: 170<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Function overloading in python'''\n#Overloading is not supported by python, hence it is implemented by default arguments.\n\ndef f(i,j=None):\n if j==None: \n if isinstance(i,int): #for 1st function\n print \"In f(int), i is \",i \n else: #for 3rd function\n print \"In f(double), k is \",i\n else: #for 2nd arguments\n print \"In f(int,int), i is \",i,\", j is \",j\n \n#calling function\nf(10)\nf(10,20)\nf(12.23)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "In f(int), i is 10\nIn f(int,int), i is 10 , j is 20\nIn f(double), k is 12.23\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.10, Page Number: 171<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Create an overloaded function of abs called myabs()'''\n\n#myabs() in three ways\ndef myabs(i):\n if isinstance(i,int): #first instance\n print \"Using integer myabs(): \",\n if i<0:\n return -i\n else:\n return i\n elif isinstance(i,float): #second instance\n print \"Using double myabs(): \",\n if(i<0.0):\n return -i\n else:\n return i\n elif isinstance(i,long): #third instance\n print \"Using long myabs(): \",\n if i<0:\n return -i\n else:\n return i\n\n#Result; calling the function \nprint myabs(-10)\nprint myabs(-11.0)\nprint myabs(-9L)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Using integer myabs(): 10\nUsing double myabs(): 11.0\nUsing long myabs(): 9\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.11, Page Number: 174<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An example of default arguments'''\n\nimport os\n\ndef clrscr(size=25):\n while(size):\n print \"\"\n size-=1\n \nfor i in range(30):\n print i\n clrscr() #clears 25 lines\n\nfor i in range(30):\n print i\n clrscr(10) #clears 10 lines\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n1\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n2\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n3\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n4\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n5\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n6\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n7\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n8\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n9\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n10\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n11\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n12\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n13\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n14\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n16\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n17\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n18\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n19\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n20\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n21\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n22\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n23\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n24\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n25\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n26\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n27\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n28\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n29\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n0\n \n \n \n \n \n \n \n \n \n \n1\n \n \n \n \n \n \n \n \n \n \n2\n \n \n \n \n \n \n \n \n \n \n3\n \n \n \n \n \n \n \n \n \n \n4\n \n \n \n \n \n \n \n \n \n \n5\n \n \n \n \n \n \n \n \n \n \n6\n \n \n \n \n \n \n \n \n \n \n7\n \n \n \n \n \n \n \n \n \n \n8\n \n \n \n \n \n \n \n \n \n \n9\n \n \n \n \n \n \n \n \n \n \n10\n \n \n \n \n \n \n \n \n \n \n11\n \n \n \n \n \n \n \n \n \n \n12\n \n \n \n \n \n \n \n \n \n \n13\n \n \n \n \n \n \n \n \n \n \n14\n \n \n \n \n \n \n \n \n \n \n15\n \n \n \n \n \n \n \n \n \n \n16\n \n \n \n \n \n \n \n \n \n \n17\n \n \n \n \n \n \n \n \n \n \n18\n \n \n \n \n \n \n \n \n \n \n19\n \n \n \n \n \n \n \n \n \n \n20\n \n \n \n \n \n \n \n \n \n \n21\n \n \n \n \n \n \n \n \n \n \n22\n \n \n \n \n \n \n \n \n \n \n23\n \n \n \n \n \n \n \n \n \n \n24\n \n \n \n \n \n \n \n \n \n \n25\n \n \n \n \n \n \n \n \n \n \n26\n \n \n \n \n \n \n \n \n \n \n27\n \n \n \n \n \n \n \n \n \n \n28\n \n \n \n \n \n \n \n \n \n \n29\n \n \n \n \n \n \n \n \n \n \n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.12, Page Number: 176<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A customized version of strcat'''\n\n#Variable Decleration\nstr1 = \"This is a test\"\nstr2 = \"0123456789\"\n\n#function for concatenation\ndef mystrcat(s1,s2,l=-1):\n if l==-1:\n l=len(str2)\n s2=s2[:l] #truncates s2\n s1=s1+s2 #concatenates the 2 strings\n return s1\n\nstr1=mystrcat(str1,str2,5) #concatenate 5 chars\nprint str1\n\nstr1 = \"this is a test\" #reset str1\n\nstr1=mystrcat(str1, str2) #concatenate entire string\nprint str1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This is a test01234\nthis is a test0123456789\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.13, Page Number: 177<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Overload ambiguity'''\n#Here there wont be any ambiguity because float and double are the same.\n\ndef myfunc(i):\n return i\n \nprint myfunc(10.1),\nprint myfunc(10)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10.1 10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.14, Page Number: 178<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Another ambiguity'''\n\nfrom ctypes import *\n\ndef myfunc(ch):\n if isinstance(ch,c_int):\n return chr(ch.value+1)\n elif isinstance(ch,c_uint):\n return chr(ch.value-1)\n \n \nprint myfunc(c_int(ord('c'))),\nprint myfunc(c_uint(88))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " d W\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 8.15, Page Number: 179<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''More ambiguity'''\n\ndef myfunc(i,j=1):\n if j==1:\n return i*j\n else:\n return i\n \n \nprint myfunc(4,5),\nprint myfunc(10)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4 10\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/Chapter_9(1).ipynb b/C++_from_the_Ground/Chapter_9(1).ipynb
new file mode 100644
index 00000000..b31c36a0
--- /dev/null
+++ b/C++_from_the_Ground/Chapter_9(1).ipynb
@@ -0,0 +1,387 @@
+{
+ "metadata": {
+ "name": "Chapter 9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 9: More Data Types and Operations<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.1, Page Number: 182<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Printing a string'''\n#pyhton doesnt have constants, hence a normal object has been used\n\ndef code(str):\n print str\n\n#Calling function\ncode(\"this is a test\")",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "this is a test\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.2, Page Number: 183<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing const references'''\n\ndef f(i):\n i=100\n print i\n \n#Variable declaration\nk=10\n\n#function call\nf(k)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.3, Page Number: 187<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementing extern in pyhton'''\n\n#Variable Declaration\nfirst=10 #global definition of first and last\nlast=20\n\n#Result\nprint first,last\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.4, Page Number: 188<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Compute a running average of numbers entered by the user'''\n'''Implementing static variables in python'''\n\n#Variable declaration\nsum=0 \ncount=0\nnum=5 #Loop for user entries\n\n#compute a running average\ndef r_avg(i):\n global sum,count\n sum=sum+i\n count+=1\n return sum/count\n\n\nwhile True:\n print \"Enter numbers(-1 to quit): \"\n num-=1 #User input\n if not(num==-1):\n print \"Running average is: \",r_avg(num) #Result\n if num<0:\n break",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter numbers(-1 to quit): \nRunning average is: 4\nEnter numbers(-1 to quit): \nRunning average is: 3\nEnter numbers(-1 to quit): \nRunning average is: 3\nEnter numbers(-1 to quit): \nRunning average is: 2\nEnter numbers(-1 to quit): \nRunning average is: 2\nEnter numbers(-1 to quit): \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.5, Page Number: 189<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Compute a running average of numbers entered by the user'''\n'''Implementing static variables in python'''\n\n#Variable declaration\nsum=0 \ncount=0\nnum=10 #Loop for user entries\n\n#user input given: 9,8,7,6,-2,4,3,2,1,-1\n\n#compute a running average\ndef r_avg(i):\n global sum,count\n sum=sum+i\n count+=1\n return sum/count\n\ndef reset():\n global sum,count\n sum=0\n count=0\n \nwhile True:\n print \"Enter numbers(-1 to quit, -2 to reset): \"\n num-=1 #User input\n if num==5:\n num=-2\n if num==-2: #for reset\n num=4\n reset()\n continue\n if not(num==-1):\n print \"Running average is: \",r_avg(num) #Result\n else:\n break",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter numbers(-1 to quit, -2 to reset): \nRunning average is: 9\nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 8\nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 8\nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 7\nEnter numbers(-1 to quit, -2 to reset): \nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 3\nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 2\nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 2\nEnter numbers(-1 to quit, -2 to reset): \nRunning average is: 1\nEnter numbers(-1 to quit, -2 to reset): \n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.6, Page Number: 196<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of enumeration in python'''\n\n#Array of strings that correspond to the enumeration\nname=[\"Jonathan\",\"Golden Delicious\",\"Red Delicious\",\"Winesap\",\n \"Cortland\",\"McIntosh\"]\n\n#enumeration type\n(Jonathan,Golden_Delicious,Red_Delicious,Winesap,Cortland,McIntosh) = (0,1,2,3,4,5)\n\nfruit=Jonathan\nprint name[fruit]\n\nfruit = Winesap\nprint name[fruit]\n\nfruit = McIntosh\nprint name[fruit]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Jonathan\nWinesap\nMcIntosh\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.7, Page Number: 198<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Convert to uppercase letter'''\n\n#Variable declaration\nch='j' #User input\nwhile True:\n #This statement turns off the 6th but.\n c=chr(ord(ch)&223) #ch is now uppercase\n print c\n if c=='Q':\n break \n else:\n ch = chr(ord(ch)+1) #incrementing for different user inputs\n \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "J\nK\nL\nM\nN\nO\nP\nQ\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.8, Page Number: 200<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Convert to lowercase letter'''\n\n#Variable declaration\nch='J' #User input\nwhile True:\n #This statement turns off the 6th but.\n c=chr(ord(ch)|32) #ch is now uppercase\n print c\n if c=='q':\n break \n else:\n ch = chr(ord(ch)+1) #incrementing for different user inputs\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "j\nk\nl\nm\nn\no\np\nq\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.9, Page Number: 201<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Display the bits within a byte'''\n\n#function to display the bits\ndef disp_binary(u):\n t=128\n while t:\n if u&t:\n print 1,\n else:\n print 0,\n t=t/2\n print \"\"\n \n#Variable declaration\nu=99 #User Input\n\nprint \"Here's the number in binary: \",\ndisp_binary(u)\n\nprint \"Here's the complement of th number: \",\ndisp_binary(~u)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Here's the number in binary: 0 1 1 0 0 0 1 1 \nHere's the complement of th number: 1 0 0 1 1 1 0 0 \n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.10, Page Number: 202<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate bitshifting'''\n\n#unction to display the bits within a byte\ndef disp_binary(u):\n t=128\n while t:\n if u&t:\n print 1,\n else:\n print 0,\n t=t/2\n print \"\"\n \n#Variable dclaration\ni=1\n\n#Result\nfor t in range(8):\n disp_binary(i)\n i=i<<1\n\nprint\"\\n\"\n\nfor t in range(8):\n i=i>>1\n disp_binary(i)\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 0 0 0 0 0 0 1 \n0 0 0 0 0 0 1 0 \n0 0 0 0 0 1 0 0 \n0 0 0 0 1 0 0 0 \n0 0 0 1 0 0 0 0 \n0 0 1 0 0 0 0 0 \n0 1 0 0 0 0 0 0 \n1 0 0 0 0 0 0 0 \n\n\n1 0 0 0 0 0 0 0 \n0 1 0 0 0 0 0 0 \n0 0 1 0 0 0 0 0 \n0 0 0 1 0 0 0 0 \n0 0 0 0 1 0 0 0 \n0 0 0 0 0 1 0 0 \n0 0 0 0 0 0 1 0 \n0 0 0 0 0 0 0 1 \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.11, Page Number: 204<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''This program implements ? operator in python'''\n\ndef div_zero():\n print \"Cannot divide by zero.\"\n return 0\n \n#Variable declaration\ni=10 #User Input\nj=0\n\n#This statement prevents a divide by zero\nif j:\n result=i/j\nelse:\n result=div_zero()\n\n#Result\nprint \"Result: \",result",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Cannot divide by zero.\nResult: 0\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.12, Page Number: 206<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of the comma operator'''\n\n#Variable declaration\nj=10\ni=None\n\nj+=1\nj+100\ni=999+j\n\n#Result\nprint i",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1010\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.13, Page Number: 207<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Demonstrate sizeof'''\n\nfrom ctypes import *\n\n#Variable declaration\nch=c_char\ni=c_int\n\nprint sizeof(ch), #size of char\nprint sizeof(i), #size of int\nprint sizeof(c_float), #size of float\nprint sizeof(c_double) #size of double\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 4 4 8\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.14, Page Number: 209<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Example of pointers'''\n\nfrom ctypes import *\n\n#Variabke declaration \ni=c_int(20) #allocate memory for int\np=pointer(i) #assign a pointer to the memory\n\n#Result\nprint p[0] #proove that it works by displaying value\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "20\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.15, Page Number: 210<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Imlementation of dynamic initialization in python'''\n\nfrom ctypes import *\n\n#Variable declaration \ni=c_int(99) #initialize with 99\np=pointer(i) #assign a pointer to the value\n\n#Result\nprint p[0] #displays 99\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "99\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.16, Page Number: 211<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Imlementation of dynamic initialization in python'''\n\nfrom ctypes import *\n\n#Variable declaration \ni=c_double(10) \np=pointer(i)\n\n#assign the values 100 to 109\nfor i in range(10):\n p[i]=100.00+i\n\n#display the contents of the array\nfor i in range(10):\n print p[i],\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.17, Page Number: 211<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of malloc int python'''\n\n#Variable declaration\ni=c_int() \nj=c_double()\npi=pointer(i) #pointer to int\npj=pointer(j) #pointer to double\n\n#Assign values using pointers\npi[0]=10\npj[0]=100.123\n\n#Result\nprint pi[0],pj[0]\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 100.123\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 9.18, Page Number: 212<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Implementation of dynamic memory allocation'''\nfrom ctypes import *\n\n#Variable declaration\ni=pointer(c_int())\nj=pointer(c_double())\n\n#Checking if i and j have been allocated memory addresses\nif not(id(i)):\n print \"Allocation Failure.\"\n \nif not(id(j)):\n print \"Allocation Failure.\" \n\ni[0]=10\nj[0]=100.123\n\n\n#Result\nprint i[0],j[0]\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 100.123\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_from_the_Ground/README.txt b/C++_from_the_Ground/README.txt
new file mode 100644
index 00000000..6e0fd27d
--- /dev/null
+++ b/C++_from_the_Ground/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Anandi Bharwani
+Course: btech
+College/Institute/Organization: National Institute Of Technology, Durgapur
+Department/Designation: Computer Science And Engineering
+Book Title: C++ from the Ground
+Author: Herbert Schildt
+Publisher: McGraw-Hill Osborne Media
+Year of publication: 2003
+Isbn: 0072228970
+Edition: 3rd \ No newline at end of file
diff --git a/C++_from_the_Ground/screenshots/c++preproce.png b/C++_from_the_Ground/screenshots/c++preproce.png
new file mode 100644
index 00000000..656d9ed9
--- /dev/null
+++ b/C++_from_the_Ground/screenshots/c++preproce.png
Binary files differ
diff --git a/C++_from_the_Ground/screenshots/datatypes.png b/C++_from_the_Ground/screenshots/datatypes.png
new file mode 100644
index 00000000..08d8ff2d
--- /dev/null
+++ b/C++_from_the_Ground/screenshots/datatypes.png
Binary files differ
diff --git a/C++_from_the_Ground/screenshots/inheritence.png b/C++_from_the_Ground/screenshots/inheritence.png
new file mode 100644
index 00000000..49b24c1d
--- /dev/null
+++ b/C++_from_the_Ground/screenshots/inheritence.png
Binary files differ
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/README.txt b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/README.txt
new file mode 100644
index 00000000..dad00691
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ashutosh Kumar
+Course: btech
+College/Institute/Organization: Indian Institute of Technology - Bombay, CHAR Lab 2
+Department/Designation: Electrical Department
+Book Title: C++ in Action - Industrial-Strength Programming Techniques
+Author: Bartosz Milewski
+Publisher: Addison Wesley Publishing Company
+Year of publication: 2001
+Isbn: 0201699486
+Edition: 1st \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb
new file mode 100644
index 00000000..79c81a76
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb
@@ -0,0 +1,197 @@
+{
+ "metadata": {
+ "name": "ch1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter One : Naming"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.1 Page no : 2 \n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNaming a variable\n'''\n\nstrL = 0 # Not recommended\nstringLength = 0 # Recommended",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2 Page no : 3\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDifferent ways to print an object\n'''\n\nclass EmcFruit:\n def print_(self):\n pass\n\nclass EmcApple(EmcFruit):\n def print_(self):\n pass\n\nfp = EmcApple()\nprint fp ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "<__main__.EmcApple instance at 0x9d29c8c>\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.3 Page no : 4\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNaming accessors and modifiers\n'''\nclass Point:\n def __init__(self,a,b):\n self.x = a\n self.y = b\n def x1(self,a):\n self.x = a\n\np = Point(0,0) # a point in a 2-dimensional space\np.x1(1); # set X-coordinate\nprint p.x # prints X-coordinate, \"1\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.4 page no : 4\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNames used by a template function\n'''\n\n# typename to mark a qualified name as a type name.\ndef check_assign(a,i,t):\n if (i < len(a)):\n a[i] = t;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.5 Page no : 6\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNamespace\nA namespace is a declarative region in which classes, functions, types and templates\ncan be defined.\nNote : Python doesn't have concept of namespace.\n\n'''\nclass String:\n pass\n\nclass DynamicArray:\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.6 page no : 6\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAccessing names from namespace\nNote : Python doesn't have namespace.\n'''\na = 'aaa' \ns1 = 'xyz'\ns = 'abc' # Emc::String s;\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.8 page no : 7\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nClass names with prefixes\nNote : this will give error because file doesn't have class EmcString and OtherString.\n'''\ns1 = EmcString() # Belongs to the Emc Class Library\ns2 = OtherString() # Belongs to the Other Class Library",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'EmcString' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-7-16beeed526dd>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mNote\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mthis\u001b[0m \u001b[0mwill\u001b[0m \u001b[0mgive\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mfile\u001b[0m \u001b[0mdoesn\u001b[0m\u001b[0;31m'\u001b[0m\u001b[0mt\u001b[0m \u001b[0mhave\u001b[0m \u001b[1;32mclass\u001b[0m \u001b[0mEmcString\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mOtherString\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m '''\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0ms1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mEmcString\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Belongs to the Emc Class Library\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[0ms2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOtherString\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Belongs to the Other Class Library\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mNameError\u001b[0m: name 'EmcString' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.9 Page no : 8\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNames of include files\n\nNote : this would give error because we dont have packages written here.\n'''\nimport RWCstring #include \"RWCstring.h\" /* Recommended */\nfrom rw import cstring #include \"rw/cstring.h\" /* Sometimes needed */",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "ImportError",
+ "evalue": "No module named RWCstring",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-8-4593d91551b4>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mNote\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mthis\u001b[0m \u001b[0mwould\u001b[0m \u001b[0mgive\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mwe\u001b[0m \u001b[0mdont\u001b[0m \u001b[0mhave\u001b[0m \u001b[0mpackages\u001b[0m \u001b[0mwritten\u001b[0m \u001b[0mhere\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m '''\n\u001b[1;32m----> 7\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mRWCstring\u001b[0m \u001b[1;31m#include \"RWCstring.h\" /* Recommended */\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mrw\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mcstring\u001b[0m \u001b[1;31m#include \"rw/cstring.h\" /* Sometimes needed */\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mImportError\u001b[0m: No module named RWCstring"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 1.10 page no : 9\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nUse of underscores in names\n'''\n\ni__j = 11;\n_K = 22;\n_m = 33;\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb
new file mode 100644
index 00000000..45094edc
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb
@@ -0,0 +1,249 @@
+{
+ "metadata": {
+ "name": "ch10"
+ },
+ "name": "ch10",
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": "<h1> Chapter Ten : Object-oriented programming </h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>Example 10.1 page no :105"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nReturning non-const reference to object\n'''\n\ns = \"hello\" # length() == 5\nprint s\nprint len(s)",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "hello\n5"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.2 page no : 106"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAssigning to string element\n'''\ns = \"Hello\"\n#s[0] = 'h'\ns = s.lower()\nprint s",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "hello"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3> example 10.3 page no :107"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nfactory class\n\nNote : Python does not have virtual function concept.\n\n'''\n\nclass EmcCollection:\n # insert one element\n def insert(self,t):\n pass\n \n def operator(self, coll):\n pass\n\nclass EmcArrayCollection(EmcCollection):\n initialSize = 10\n\n def __init__(self,maxsize):\n pass\n\n\nclass InvalidCollectionType(EmcException):\n \n def __init__(self,i):\n pass\n\nclass EmcCollectionFactory:\n def __init__(self):\n pass\n\n def create(self,type):\n pass\n\n def createArray(self):\n pass",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'EmcException' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-3-5d8a499d2644>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 22\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m \u001b[0;32mclass\u001b[0m \u001b[0mInvalidCollectionType\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mEmcException\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 25\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'EmcException' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>example 10.4 page no :109"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\ndynamic binding\nNote : This program will give you error as there is no any class declared in this program.\n'''\n\nfactory = EmcCollectionFactory()\ncollection = factory.create(ArrayId)\ncollection.insert(42); # EmcArrayCollection<int>::insert() is called\nprint collection",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'EmcCollectionFactory' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-4-9ee6096719fb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mfactory\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mEmcCollectionFactory\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mcollection\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfactory\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mArrayId\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0mcollection\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m42\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;31m# EmcArrayCollection<int>::insert() is called\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'EmcCollectionFactory' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>example 10.5 page no : 111"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\ndeleting object\n'''\nclass EmcCollection:\n def __del__(self):\n pass\n\nclass EmcArrayCollection( EmcCollection):\n def __del__(self):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>example 10.6 page no :112"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nvirtual base class\n'''\nclass EmcLogged:\n def writeClassName(self,o):\n pass\n\n def writeValue(self,o):\n pass\n\n def logMessage(self,message):\n pass\n\n def __del__(self):\n pass\n\nclass EmcLoggedCollection(EmcCollection):\n\n def writeValue(self,o):\n pass\n\n def __del__(self):\n pass ",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.7 Page no : 117"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nPre- and postconditions\n'''\n\n\nclass EmcIntStack:\n def empty(self):\n pass\n\n def full(self):\n pass\n \n def top(self):\n pass\n \n def push(self,i):\n pass\n \n def pop(self):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.8 Page no : 117"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nUsing member function with precondition\n'''\n\ndef makeString(stack):\n returnValue = ''\n copy = stack\n while (not copy.empty()):\n # loop condition makes precondition valid\n print copy.pop() # Precondition: ! copy.empty()\n returnValue += copy.pop\n\n return returnValue;",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.9 page no : 118"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nClass with invariant\n'''\n\nclass EmcString:\n def cStr(self):\n pass\n # cStr() returns 0-terminated string\n\n def length(self):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.10 page no : 119"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nUsing comments to specify class template\n'''\n\nclass EmcCollection:\n def __del__(self):\n pass\n\n def insert(self,T):\n pass\n\n def clear(self):\n pass\n\n def remove(self):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.11 page no : 120"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nChecking precondition\nNote : This program will give error as it has no declaration of EmcCollectionFactory\n'''\n\nfactrory = EmcCollectionFactory()\ncollection = factory.create(ArrayId);\nif (not collection.isFull()):\n collection.insert(42);",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'EmcCollectionFactory' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-11-0508dec5ea10>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mfactrory\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mEmcCollectionFactory\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mcollection\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfactory\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mArrayId\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0mcollection\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misFull\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'EmcCollectionFactory' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.12 page no : 121"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nSubstitutability\n'''\n\n# insertObject() works for any class with\n# EmcCollection<T> as public base class.\ndef insertObject(c,element):\n # throw (bad_alloc)\n # return false if insertion fails, true otherwise\n if (not c.isFull()):\n c.insert(element)\n return True\n return False",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.13 Page no : 121"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nSpecification of overriden member function\n'''\n\ndef insert(T):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.14 page no : 123"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nDescribing template argument requirements\n'''\n\n# T must be: DefaultConstructible\n# copyConstructible\n# Assignable\n# Destructible\n# EqualityComparable\n\nclass EmcCollection:\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 10.15 page no : 124"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nChecking type constraints\n'''\nclass EmcCollection:\n def templateRequirements(self):\n pass\n\n def templateRequirements(self):\n # T must be:\n t1 = T1()\n # DefaultContructible\n t2 =t1\n # CopyConstructible\n t2 = t1;\n # Assignable\n b = (t2 == t1); # EqualityComparable",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "",
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb
new file mode 100644
index 00000000..b08fdb2b
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb
@@ -0,0 +1,48 @@
+{
+ "metadata": {
+ "name": "ch11"
+ },
+ "name": "ch11",
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": "<h1>Chapter Eleven : Assertions"
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 11.1 page no : 130"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nStandard assert macro\n'''\n\ndef check(answer):\n assert answer ==42",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 11.2 page no : 131"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nAssertions and exceptions\n'''\n# Checked version\nclass EmcString:\n def at(self,index):\n if (index >= self.lengthM):\n raise Exception;\n return self.cpM[index];\n\n # Unchecked version\n def operator(self,index):\n assert(index < self.lengthM)\n return self.cpM[index];",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "",
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb
new file mode 100644
index 00000000..80b28b9c
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb
@@ -0,0 +1,185 @@
+{
+ "metadata": {
+ "name": "ch12"
+ },
+ "name": "ch12",
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": "<h1>Chapter Twelve : Error handling"
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.1 page no : 135"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nChecking status value\nNote : we dont have socket function so would give error.\n'''\n'''\nThe socket() function is a UNIX library function that creates a communication\nchannel between two processes. If the call succeeds, it returns a socket file descriptor\nthat is >= 0, otherwise -1 is returned.\n// create socket\n'''\nsocketfd = socket(AF_UNIX, SOCK_STREAM, 0);\nif(socketfd < 0):\n pass",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'socket' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-1-7161141a3c7c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0;34m//\u001b[0m \u001b[0mcreate\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m '''\n\u001b[0;32m---> 12\u001b[0;31m \u001b[0msocketfd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mAF_UNIX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSOCK_STREAM\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 13\u001b[0m \u001b[0;32mif\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msocketfd\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'socket' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.2 page no : 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nThrowing an exception\nOne way to encapsulate the UNIX system calls is to provide a wrapper function that\nthrows an exception instead of returning a status value.\n'''\nclass EmcException:\n def operator(self,n):\n pass\n\nclass EmcSystemException( EmcException):\n def __init__(self,m):\n pass\n \n def emcSocket(self,family,t,protocol):\n # create socket\n socketfd = socket(family, t, protocol);\n if (socketfd < 0): # check status value\n raise EmcSystemException(\"emcSocket\");\n return socketfd;",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.3 page no : 139"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nMember function with precondition\nnote : only constructor is given.\n'''\n\ndef __init__(self,cp):\n self.lengthM = len(cp)\n self.cpM = cp",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.5 page no : 141"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nPreventing exceptions inside destructors\nNote : uncaught_exception() is not defined here so it would give error.\n'''\nclass EmcLog:\n def __init__(self,filename):\n pass\n\n def message(self,EmcString):\n pass\n\n def __del__(self):\n if uncaught_exception():\n self.flush()\n \n def flush(self):\n if ( not uncaught_exception()):\n raise EmcSystemException(\"EmcLog::flush()\")",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.6 page no : 142"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nException class constructor\n'''\nclass EmcException:\n def __init__(self,m):\n maxSizeM = 100\n actualLength = len(m);\n self.lengthM = min(maxSizeM,actualLength);\n self.messageM = message",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.7"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nUnsafe memory allocation\nNote : Python does memory allocation by it self. no need to allocate explicitely.\n'''\n\ndef f():\n ip = 1\n g(ip)\n\n# Not recommended\n# create int with new\ndef g(i):\n raise Exception(i)",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.8 page no : 146"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nHaving a try-block to manage memory\n\nIt is possible to rewrite our previous example so that the memory leak is avoided with-\nout introducing any new classes. The function should have a try-block with a handler\nthat catches all possible exceptions.\n'''\n\ndef f():\n ip = 1\n g(ip)\n\n# Not recommended\n# create int with new\ndef g(i):\n raise Exception(i)",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.9 page no :146"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nException safe allocation of free store objects\n\n'''\ndef f():\n ip = 1\n g(ip)",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.10 page no : 148"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nException safe copy assignment operator\nThe template EmcStack uses a built-in array, vectorM, to store copies of objects.\nThe pointer topM stores an index to the next element in the array to assign. The data\nmember allocatedM stores the number of currently allocated objects, and is always\na positive number.\n'''\n\nclass EmcStack:\n defaultSizeM = 100\n def __init__(self,size = 100):\n pass\n\n def __del__(self):\n pass\n\n def operator(self,s):\n pass\n\n def empty(self):\n pass\n \n def top(self):\n pass\n\n def push(self,i):\n pass\n \n def pop(self):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.12 page no : 151"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nInheritance of exception classes\nIt is good to have a general exception class at the top that allows you to print a descrip-\ntion of the error. Most users are satisfied with knowing what went wrong and would\nonly have one handler for a whole hierarchy of exception classes.\nIn our examples we have used the class EmcException, that stores strings that\ndescribe the error condition.\n'''\nclass EmcException:\n def __init__(self,m):\n pass\n # EmcException objects can be printed\n\n def operator(self,o,EmcException):\n pass\n\n def printOn(self,o): \n print self.messageM;",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.13 page no : 153"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nHandling many exceptions with one handler\nA handler for EmcException can be used to handle an EmcSystemException,\nsince the latter class inherits from EmcException.\nNote : emcSocket() is not defined here. so would give error.\n'''\ntry:\n socketfd = emcSocket(AF_UNIX, SOCK_STREAM, 0);\nexcept Exception,e:\n print e",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "name 'emcSocket' is not defined"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 12.14 page no : 155"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nException specification\n'''\n\ndef at(s,pos):\n if (pos > len(s)):\n raise Exception;",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "",
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb
new file mode 100644
index 00000000..99e0fb38
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb
@@ -0,0 +1,210 @@
+{
+ "metadata": {
+ "name": "ch13"
+ },
+ "name": "ch13",
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": "<h1> Chapter Thirteen : Parts of C++ to avoid"
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.1 page no : 159"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nC-style I/O is not adequate for objects\n'''\n\ns = 'abc' #raw_input()\nprint s",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "abc"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.2 page no : 160"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPassing objects to printf()\nThe function printf() should not be given an object as argument even if the object\nis of a class that can be implicitly converted to a type that printf() knows how to\nhandle.\n'''\nclass DangerousString:\n def __init__(self,cp):\n pass\n \n def char(self):\n pass\n\nhello = \"Hello World!\";\nprint hello # Works perfectly\nprint \"%s\"%hello",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello World!\nHello World!"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.3 page no : 160"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nOverloading of operator<<\n'''\nclass EmcString:\n def __init__(self,cp):\n pass\n\n\ns = \"Hello World!\";\nprint s ",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello World!"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.4 page no :161"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nMacros do not obey scope rules\n'''\n#define SIZE 1024\nSIZE = 1024;\nprint SIZE",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1024"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.5 page no : 162"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nRecommended way to define constants\nYou can often define constants within a class.\n'''\nclass X:\n class Color:\n green = 1\n yellow = 2\n red = 3",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.6 page no : 162"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nUsing an enum instead of static const int\nOlder compilers will not allow you to define ordinary constants inside a class. A com-\nmon trick is to use an anonymous enum instead.\n'''\nclass X:\n maxBuf = 1024\n class Color:\n green = 1\n yellow = 2\n red = 3",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.7 page no : 162"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nFunction-like macro, SQUARE\n'''\n# Not recommended to have function-like macro\ndef SQUARE(x):\n return x*x\n\ni = SQUARE(3 + 4); \nprint i",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "49"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.8 page no : 163"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInline function, square\n'''\ndef square(x):\n return x * x;\nc = 2;\nd = square(c)\nprint d",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.9 page no : 163"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nFunction-like macros are not type safe\nNote : this would give error.\n'''\ndef SQUARE(x):\n return x*x\ni = SQUARE(\"hello\");\nprint i",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "TypeError",
+ "evalue": "can't multiply sequence by non-int of type 'str'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-10-df398cb9cbc0>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 8\u001b[0;31m \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"hello\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 9\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/home/jay/<ipython-input-10-df398cb9cbc0>\u001b[0m in \u001b[0;36mSQUARE\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"hello\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mTypeError\u001b[0m: can't multiply sequence by non-int of type 'str'"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.10 page no : 163"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nHow to define synonyms for a type\nNote : Python doesnot have synonyms for type as we do not have to explicitely \ndeclare variables.\n'''\n#define Velocity int\n#typedef int Velocity;\n# Not recommended",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "pyout",
+ "prompt_number": 11,
+ "text": "'\\nEXAMPLE 13.10 page no : 163\\nHow to define synonyms for a type\\nNote : Python doesnot have synonyms for type as we do not have to explicitely \\ndeclare variables.\\n'"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 13.11 page no : 164"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nPassing array to function\n'''\n\n# Fruit is a base class\ndef printFruits(fruits,size):\n # Not recommended to pass arrays to functions\n for i in range(size):\n print fruits[i] ",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "",
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb
new file mode 100644
index 00000000..b01dfcea
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb
@@ -0,0 +1,363 @@
+{
+ "metadata": {
+ "name": "ch15"
+ },
+ "name": "ch15",
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": "<h1> Chapter Fifteen : Portability"
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.1 page no : 172"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nImplementation-defined behavior\n'''\nc = -100;\nif (c < 0):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.2 page no : 173"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nUnspecified behavior\n'''\n\nclass BasicAttrType:\n counterGauge = 0x1000\n counterPeg = 0x2000\n conterAcc = 0x3000\n \n\n\nt = BasicAttrType.counterGauge\nprint t",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4096"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.3 page no : 173"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nUndefined behavior\n'''\na = ''\nprint a",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": ""
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>example 15.5 page no : 174"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nType of fixed size\n'''\n\nresult = 1234 * 567\nprint result",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "699678"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>Example 15.6 page no : 175"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nGood and bad way of including files\n'''\nimport math # python has only one way to importing file.\nfrom math import *",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>exmaple 15.7 page no : 176"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDirectory names in include directives\nNote : python has . operator to import a file from directory\n'''\n\n \n# import inc.MyFile\n# import inc.MyFile\n\n# import gui.xinterface",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "pyout",
+ "prompt_number": 6,
+ "text": "'\\nexmaple 15.7 page no : 176\\nDirectory names in include directives\\nNote : python has . operator to import a file from directory\\n'"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.8 page no : 176"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nCase-sensitivity of header file name\n'''\n\nimport math\n# import Math # does not work",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.9 page no : 178"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nOffset of data member\n'''\n\nclass PersonRecord:\n ageM = ''\n phoneNumberM = 0\n nameM = ''",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.10 page no : 178"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nCast must obey alignment rules\n'''\ndef stepAndConvert(a,n):\n b = a + str(n) # step n chars ahead\n return b # NO: Dangerous cast of const char* to int*\n\n\ndata = \"abcdefghijklmnop\"\nanInt = 3;\ni = stepAndConvert(data, anInt)\nprint i",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "abcdefghijklmnop3"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.11 page no : 179"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nMixing signed and unsigned integers\nThe standard header limits.h defines a number of constants that describe the range\nof the built-in types, for example INT_MIN, INT_MAX, UINT_MIN and UINT_MAX. If\nyou work with very large numbers, be sure to check against these values.\n'''\nINT_MIN = -2147483648\nINT_MAX = 2147483647\nUINT_MAX = 4294967295\ni = 42\nui = 2222222242;\nj = i - ui;\nprint j",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-2222222200"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.12 page no : 180"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nchars can be signed or unsigned\n'''\nzero = 0;\none = 1;\nminusOne = zero - one;\nprint minusOne\nresult = one + minusOne;\nprint result",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-1\n0"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.13 page no : 180"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nOS-specific typedef\nNote : It would shoot error because fork() is not defined here.\n'''\npid1 = fork(); # NO: should use pid_t\n\npid2 = fork();",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'fork' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-12-ef16c6a16507>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mNote\u001b[0m \u001b[0;34m:\u001b[0m \u001b[0mIt\u001b[0m \u001b[0mwould\u001b[0m \u001b[0mshoot\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mfork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mdefined\u001b[0m \u001b[0mhere\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mpid1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;31m# NO: should use pid_t\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mpid2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'fork' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.14 page no : 181"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPrefixed name\n'''\nfamousClimber = \"Edmund Hillary\"; # Uses Emc as prefix\nprint famousClimber",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Edmund Hillary"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.15 page no : 183"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nUnsupported keyword as empty macro\n'''\n\nclass EmcArray:\n def __init__(self,size):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.16 page no : 183"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nForward-compatibility macros\n'''\n\n\nfalse = 0;\ntrue = 1;",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.17 page no : 184"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nReusing a loop variable\nNote : It would shoot error as last() and first() are not defined function here.\n'''\ni = 0;\nfor i in range(last()):\n pass\n\nfor i in range(first()):\n pass",
+ "language": "python",
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'last' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/home/jay/<ipython-input-16-119935826b55>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlast\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'last' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.18 page no : 185"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nUsing a template\n'''\n\ndef emcMax(a, b):\n if a>b:\n return a\n return b\n\ndef foo(i,j):\n m = emcMax(i, j); # usage of emcMax\n\nq = 0 # usage of class EmcQueue<int> and\ns = 0 # EmcQueue<int>:s default constructor",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.19 page no : 186"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nTemplate header file\nBy having a macro EXTERNAL_TEMPLATE_DEFINITION it is possible, at compile-\ntime, to control whether the implementation file is included by the header file or not.\n'''\nclass EmcQueue:\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.20 page no : 187"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nTemporary objects\n'''\n\nclass DangerousString:\n def __init__(self,cp):\n pass\n\n def char(self):\n pass",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>example 15.22 page no : 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nHow to declare main()\n'''\ndef main(self):\n return 0",
+ "language": "python",
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.23"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "'''\nEvaluation order of arguments\nNote : It will give error as f1(),f2(),f3() are not defined here.\n'''\n\nfunc(f1(), f2(), f3()) # f1 may be evaluated before f2 and f3,\n# but don't depend on it!",
+ "language": "python",
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": "<h3>EXAMPLE 15.24 page no : 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEvaluation order of subexpressions\n'''\na = [0,0,0]\ni = 0\na[i] = i;\ni += 1\nprint i \n# NO: i may be incremented before or\n# after its value is used on",
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": "",
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb
new file mode 100644
index 00000000..3b817d84
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb
@@ -0,0 +1,165 @@
+{
+ "metadata": {
+ "name": "ch2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter : Two : Organizing the code"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.1 Page no : 12\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nTesting for self-containment\nNote : would give error because we dont have EmcArray and iostream packages.\n'''\nimport EmcArray # EmcArray.py\nimport iostream # The rest of the EmcArray.cc file ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "ImportError",
+ "evalue": "No module named EmcArray",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-1-b23807a66872>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mNote\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mwould\u001b[0m \u001b[0mgive\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mwe\u001b[0m \u001b[0mdont\u001b[0m \u001b[0mhave\u001b[0m \u001b[0mEmcArray\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0miostream\u001b[0m \u001b[0mpackages\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m '''\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mEmcArray\u001b[0m \u001b[1;31m# EmcArray.py\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0miostream\u001b[0m \u001b[1;31m# The rest of the EmcArray.cc file\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mImportError\u001b[0m: No module named EmcArray"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.2 page no : 13\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nData member of class type\n'''\n\n#import A \n\nclass X :\n def __init__(self):\n pass #self.aM = A()\n \n def returnA(self):\n pass #return self.aM\n \n def withAParameter(self,a):\n pass #self.aM = a",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.3 page no :14\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nForward declaration\nNote : Python does not require forward declaration\n'''\n\nclass Y :\n def __init__(self):\n pass #self.bM = B()\n \n def returnBPtr(self):\n pass #return self.aM\n \n def withAParameter(self,b):\n pass #self.bM = a\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.4 page no : 15\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInclude guard\n'''\ndef module_exists(module_name):\n try:\n __import__(module_name)\n except ImportError:\n return False\n else:\n return True",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.5 page no : 15\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDefining function\n'''\n\ndef cStr(cpM):\n return cpM\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.6 page no : 17\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nFunction template\n'''\n\ndef max_(x,y):\n if x > y:\n return x\n return y\n\ndef function(i,j):\n m = max_(i,j) # must instantiate max(int,int)\n print m\n\nfunction(5,10) \n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.7 page no : 17\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nClass template\n'''\n\nclass EmcQueue:\n def __init__(self):\n pass\n \n def insert(self,t):\n pass\n\nq = EmcQueue()\nq.insert(42);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 2.8 page no : 18\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\ndefining class\n''' \n\nclass EmcQueue:\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb
new file mode 100644
index 00000000..88c25a97
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb
@@ -0,0 +1,86 @@
+{
+ "metadata": {
+ "name": "ch3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Three : Comments"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 3.1 Page no : 22\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nStatic string identifying the file\n'''\n\nrcsid = \"$Id: $\"\nprint rcsid",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "$Id: $\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 3.2 Page no : 22\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nComments in C++\n'''\ncpM = ''; # A String variable\nlenM = 0 # The length of the character array ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 3.3 Page no : 22\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNested Python-style comment\n'''\n\n''' No: this nesting of C-style comments will not work !!!\nchar* cpM;\nint lenM;\n# A pointer to the characters\n# The length of the character array \n'''",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 4,
+ "text": "' No: this nesting of C-style comments will not work !!!\\nchar* cpM;\\nint lenM;\\n# A pointer to the characters\\n# The length of the character array \\n'"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch4.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch4.ipynb
new file mode 100644
index 00000000..099da02d
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch4.ipynb
@@ -0,0 +1,117 @@
+{
+ "metadata": {
+ "name": "ch4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Four : Control flow"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.1 page no : 27\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nBlock after for-loop\n'''\n\nnumberOfObjects = 42;\na = []\nfor i in range(numberOfObjects):\n # Recommended\n print i \n a.append(i)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 4.2 page no :27\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nBlocks in if-statement\n'''\nnumberOfObjects = 42;\na = []\nfor i in range(numberOfObjects):\n # Recommended\n a.append(i)\n\nprint \"Enter value: \";\nvalue = int(raw_input())\n\nif value == 1 or value==2:\n print \"1 or 2: \" , a[value] \nelse:\n if (value > 2 and value < numberOfObjects):\n print \"Not 1 or 2: \" , a[value] ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter value: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Not 1 or 2: 10\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 4.3 page no : 28\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nHow to write switch statements\n'''\n\nclass Status:\n red = 1\n green = 2\n\ndef convertStatus(status):\n if status == Status.red:\n return \"Red\"\n elif status == Status.green:\n return \"Green\"\n else: \n return \"Illegal value\" \n\nprint convertStatus(1) \nprint convertStatus(2)\nprint convertStatus(5)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Red\nGreen\nIllegal value\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 4.4 page no : 29"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nHow to break out of a loop\n'''\nm = 10;\nerrorflag = False;\n\nfor i in range(m):\n if (True):\n errorflag = True;\n break; # leaves loop\n\n# no goto needed\nif(errorflag):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb
new file mode 100644
index 00000000..c589d2d2
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb
@@ -0,0 +1,244 @@
+{
+ "metadata": {
+ "name": "ch5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Five : Object Life Cycle"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.1 page no: 32\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInitializing variables\nInstead of declaring the variable at the beginning of a code block and giving it a value\nmuch later:\n'''\n\ni = 10;\nj = 10;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.2 page no : 33\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInitialization instead of assignment\n'''\n\n# Not recommended\nstring1 = \"hello\";\nstring2 = \"hello\"; \nprint string1, string2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "hello hello\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.3 page no : 33\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAssignment instead of initialization\n'''\n\ni = int(raw_input()) # no reason to initialize i\nprint i",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.4 page no : 34\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDeclaring multiple variables\n'''\noldLm = 0;\nnewLm = 0;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.5 page no : 34\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nCorrect use of magic number\n'''\n# Literal in definition of const,\ncharMapSize = 256;\n# but not to specify array size!\nfor i in range(charMapSize):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.6 page no : 36\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nConstructor initialization lists\n'''\n\nclass Base:\n def __init__(self,i=0):\n self.iM = 0\n\nclass Derived(Base):\n def __init__(self,i=0):\n Base.__init__(self,i)\n self.jM = i",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.7 page no : 37\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nOrder of initializers\n'''\nclass Base:\n def __init__(self,i=0):\n self.iM = 0\n\nclass Derived(Base):\n def __init__(self,i=0):\n self.jM = i\n bm = Base(i)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 5.8 page no : 40\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nReturning dangling pointers and references\n'''\n\ndef dangerous():\n i = 5;\n return i\nj = dangerous(); # NO: j is dangerous to use\nprint j;\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.9 page no : 41\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nclass declaration\n'''\n\nclass CommunicationPort:\n def __init__(self,port):\n pass\n \n def __del__(self):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 5.10 page no : 42\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nCopyable class that manages memory\n'''\n\nclass EmcIntStack:\n def __init__(self,d):\n self.allocatedM = d\n self.vectorM = []\n\n def __del__():\n pass ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 5.11 page no : 43\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nSelf-assignment\n'''\n\ns = \"Aguirre\";\ns = s;\nprint s ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Aguirre\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 5.12 page no : 43\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nImplementing a copy assignment operator\nin Python, = operator no need to implement.\n'''\ns = \"Aguirre\";\nr = s;\nprint r",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Aguirre\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb
new file mode 100644
index 00000000..c6fba155
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb
@@ -0,0 +1,151 @@
+{
+ "metadata": {
+ "name": "ch6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Six : Conversions"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 6.1 page no : 48\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExplicit conversions \nNote : converting int to float\n'''\nlarge = 456789; # Potentially dangerous conversion\nsize = float(large)\nprint size",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "456789.0\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 6.2 page no : 49\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nConversion of string object to const char*\nclass defining\n'''\n\nclass DangerousString :\n def __init__(self):\n pass # self.s = ''\n\n def __str__(self):\n pass # return self.s",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 6.3 page no : 51\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nUsing static_cast\n'''\n\nlarge = 456789\nsize = int(large);\nthree = \"three\" \nprint large,size,three",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "456789 456789 three\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 6.4 page no : 51\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nNew style casts\n'''\nclass B:\n pass\n \nclass D( B):\n pass\n\nclass E:\n pass\n \ndef dynamicCast(b):\n # Must use dynamic_cast when base class is virtual.\n return D(b)\n\ndef constCast(d1):\n # Should use const_cast when casting away const.\n return D(d1)\n\ndef reinterpretCast(d):\n # Should use reinterpret_cast when casting pointer\n # to pointer of unrelated type.\n return E(d)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 6.5 page no : 52\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nCasting away const\n'''\n\ndef addToFileList(s):\n pass\n \ndef addFiles(s):\n m = len(s)\n for i in range(m):\n addToFileList(s[i])",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 6.6 page no : 52\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nObject in write-protected memory\n''' \n\n# ci may be in write-protected memory\nci = 22;\npi = ci # NO: Const cast away\ni = pi; # OK\n# writing into write-protected memory?\npi = 7 \nprint ci, pi, i ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22 7 22\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 6.7 page no : 53\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nClass with mutable data member\n'''\nclass EmcMatrix:\n def __init__(self):\n self.isDirtyM = False\n self.detM = 0.0\n\n def calculateDeterminant(self):\n pass\n\n def determinant(self):\n if(isDirtyM):\n # OK, access to mutable data members\n self.detM = self.calculateDeterminant();\n self.isDirtyM = False;\n return self.detM;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb
new file mode 100644
index 00000000..82ae17cc
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb
@@ -0,0 +1,440 @@
+{
+ "metadata": {
+ "name": "ch7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Seven : The class interface"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.1 page no : 57\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nA class with inline member functions\n'''\nclass Point:\n def __init__(self,x,y):\n self.xM = x\n self.yM = y\n\n def x(self):\n return self.xM\n \n def y(self):\n return self.yM\n\n def x_(self,x):\n self.xM = x\n \n def y_(self,y):\n self.yM = y\n\n def __add__(self,p2): \n return Point(self.x() + p2.x(), self.y() + p2.y())",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 7.2 page no : 59\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDifferent types of function parameters\nNote : python doesn't have pass by reference kind of functions.\n'''\n\ndef valueFunc(t):\n pass\n\ndef pointerFunc(tp):\n pass\n\ndef referenceFunc(tr):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 7.3 page no : 60\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPassing parameters by value\n'''\n\ndef func1(c):\n pass\n\ndef func2(i):\n pass\n \ndef func3(d):\n pass\n \ndef func(c):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.4 page no : 61\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\n'''\nclass EmcMathVector:\n def __init__(self,x,y):\n self.xM = x\n self.yM = y\n\n def __mul__(self,i):\n self.xM *= i\n self.yM *= i\n\n def x(self):\n return self.xM\n \n def y(self):\n return self.yM\n\n def x_(self,x):\n self.xM = x\n \n def y_(self,y):\n yM = y\n\na = EmcMathVector(5,10)\nprint a.xM,a.yM\na * 5\nprint a.xM,a.yM",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5 10\n25 50\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.5 page no : 63\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPassing arguments of unknown type\n'''\n\nclass vector:\n def __init__(self,first,last):\n pass\n\n def begin(self):\n pass\n\n def push_back(self,x):\n pass\n \n def insert(self,x):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.6 page no : 64\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPassing base class reference\n'''\n\nclass basic_ofstream:\n def __init__(self,x,y):\n self.x = x\n self.y = y\n\n def print_(self):\n print self.x , \", \" , self.y;\n\n\nv = basic_ofstream(1.2, 5.5);\nv.print_()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1.2 , 5.5\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.7 page no : 65 \n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPassing base class object by value\n''' \n\ndef uselessPrint(v):\n # NO: Compile error\n print v.x() , \", \" , v.y();",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 7.8 page no : 65\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nReturn value from assignment operators\n'''\n\narray = ['','','']\n# assign to first element\narrayPointer = 42 #*(arrayPointer = array) = 42\nprint arrayPointer",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "42\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.10 page no : 67\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nUsing parameter as a local variable\n'''\n\ndef arraySum(array,first,last):\n s = 0\n for i in array:\n # It is possible to update first since\n # it has not been declared const.\n s += i\n return s;\n \nprint arraySum([5,4,3,2],5,2) ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "14\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.11 page no : 68\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nCopyable type parameter\n'''\nclass EmcStack:\n def __init__(self):\n self.repM = []\n self.allocatedM = 0\n self.topM = 0\n \n def push(t):\n if self.topM == allocatedM : # allocate more memory\n pass #size_t newSize = 2 * allocatedM;\n self.repM.append(t)\n self.topM +=1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.12 page no : 69\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAccessing string literals\n'''\n\nmessage1 = \"Calling Orson\";\nmessage2 = \"Ice Hockey\";\nmessage3 = \"Terminator\";\nmessage4 = \"I like candy\"\n\nprint message1\nprint message2\nprint message3\nprint message4",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Calling Orson\nIce Hockey\nTerminator\nI like candy\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.13 page no : 70\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nImplications of const\nUselessString is a class that has not declared any const member functions.\n'''\n\nclass UselessString:\n def __init__(self,c=None):\n pass\n \n def cStr(self):\n pass\n \n def length(self):\n pass\n \n def at(self,index):\n pass\n \n def print_(self):\n print self.s ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.14 page no : 71\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAccessing objects inside const member function\n'''\nclass Silly:\n def __init__(self,val):\n self.valM = val\n \n def me(self,s):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.15 page no : 72\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAccessing characters in a string\n'''\n\nname = \"John Bauer\";\nprint name[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "J\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.16 page no : 75\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nOverloaded member functions\n'''\ncosmonaut = \"Juri Gagarin\"\nc = 'a';\ncValue = c in cosmonaut # cValue == true\nuri = \"uri\"\nuriValue = uri in cosmonaut # uriValue == true\nprint cValue\nprint uriValue",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "True\nTrue\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.17 page no : 76 \n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nOperator overloading\n'''\ndef max_(x,y):\n if (x > y): # could use: < instead\n # We also expect that:\n # y < x\n return x;\n else:\n # We also expect that:\n # x <= y\n return y;\n\nx = 42;\ny = 0;\nprint max(x,y)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "42\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.18 page no : 76\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nImplementation of closely related operators\nPython has inbuilt this facility. No need to write functions for that.\n''' ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 17,
+ "text": "'\\nEXAMPLE 7.18 page no : 76\\nImplementation of closely related operators\\nPython has inbuilt this facility. No need to write functions for that.\\n'"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.19 page no : 77\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nHiding member functions\n'''\nclass Base:\n def f(char):\n pass\n def f(i):\n pass\n def v(char):\n pass\n\nclass Derived(Base):\n def __init__(self):\n pass\n\n def f(self,i):\n pass\n \n def v(self,c):\n self.f(c)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.20 page no : 79\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInheriting overloaded virtual member functions\nSuppose the template EmcBoundedCollection<T> inherits from EmcCollec-\ntion<T>. Objects of the same derived class are possible to compare more efficiently\nthan if the objects are of different classes. This is the reason to why the member func-\ntion isEqual is overloaded in the derived class, but to avoid surprises the base class\nversion is also made accessible.\n'''\nclass EmcCollection:\n def isEqual(self):\n pass\n \nclass EmcBoundedCollection(EmcCollection):\n\n def isEqual(a):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 7.21 page no : 80\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAdding default arguments\n'''\n\ndef f(x,y = 2):\n print x\n print y\n#void f(int x = 1, int y); // NOT RECOMMENDED\n\nf(1)\nf(2,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n2\n2\n3\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.22 page no : 80\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDefault arguments for member function\n'''\n\nclass RanDraw:\n def __init__(self, limit,seed, t = 'Good' ):\n pass # Default argument for t in class definition\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 7.23 page no : 82\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nOne-argument constructor\n'''\nclass Other:\n def __init__(self,a): #No implicit conversion from Any\n pass\n \n def foo(self,o):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "example 7.24 page no : 82\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nHow to avoid conversion operator function\nOur string class EmcString provides a member function cStr() for the purpose of\nreturning the string representation as a const char*.\n'''\nclass EmcString:\n def cStr(): # conversion to const char*\n pass\n\n def log(cp): \n pass\n\nmagicPlace =\"Ngoro-Ngoro crater at dusk\"\nprint magicPlace # Explicit conversion from String to const char*",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Ngoro-Ngoro crater at dusk\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb
new file mode 100644
index 00000000..cca0a638
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb
@@ -0,0 +1,115 @@
+{
+ "metadata": {
+ "name": "ch8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Eight : new and delete"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 8.1 page no : 89\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAllocate and deallocate free store object\nNote : Python does deallocation it self.\n'''\n\nsp = \"Hello\" \narraySize = 5;\nsa = []\nprint sp, arraySize\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello 5\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 8.2 page no : 90\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nDangerous access to deleted object\nNote : python deallocates variable memory when program exits. \n'''\n\nsp = \"Hello\"\nprint sp\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 8.3 page no : 90\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nObjects that commit suicide\n'''\nclass W:\n def __init__(self):\n pass\n\n def goAway(self):\n pass\n \n def foo(self):\n pass\n \n def bar(self):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 8.4 page no : 91\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nPlacement new\nA common form of placement new, that is part of the standard library, takes a memory\naddress as argument.\n'''\n\nmaxSize = 100; # get storage for object\nstorage = [] # call placement new to create object\n#ap1 = A(); # A() class is not defined here.",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 8.5 page no : 93 \n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nClass with customized memory management\nNote : Python does not have new operator, so can not be overloaded.\n'''\n\nclass BadArgument:\n def __init__(self):\n pass\n\nclass A:\n def __init__(self):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch9.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch9.ipynb
new file mode 100644
index 00000000..33f294da
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch9.ipynb
@@ -0,0 +1,163 @@
+{
+ "metadata": {
+ "name": "ch9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter Nine : Static Objects"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.1 page no : 97\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nFunction local static object\n'''\n\ndef randomValue(seed):\n oldValue = seed; # calculate new value\n return oldValue\n \nprint randomValue(5) ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.2 page no : 97\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nStatic data member\n'''\n\nclass EmcSingleton:\n def instance():\n pass\n \n def create(i = 0):\n self.instanceM = EmcSingleton(i)\n\n def __init__(self,i):\n pass\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.3 page no : 98\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nUnnamed namespace\nNote : python doesnt have namespace.\n'''\nsccsid = \"@(#)myfile.cc\"\nprint sccsid",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "@(#)myfile.cc\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.4 page no : 98\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nStatic objects in file scope\n'''\nsccsid = \"@(#)myfile.cc\"\nprint sccsid",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "@(#)myfile.cc\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.5 page no : 98\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nAccess to static object inside constructor\nSuppose a constructor writes a message to cout. If the iostream library would not\nhave provided a method for safe initialization of cout, such constructors would be\ndangerous to use for static objects.\n'''\n\nclass EmcLog:\n def __init__(self,out=None):\n print \"Creating log\"\n\nt = EmcLog()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Creating log\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.6 page no : 100\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInitialization order of static objects\n'''\n\nsccsid = \"@(#)myfile.cc\"\nrelease = \"@(#)Emc Class Library, 1.2\"\nprint sccsid, release",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "@(#)myfile.cc @(#)Emc Class Library, 1.2\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "EXAMPLE 9.7 page no : 100\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nInitialization object\nSuppose you have a class EmcObject that requires initialization. The class provides a\nnested class Initor for that purpose. The implementation of Initor uses two mem-\nber functions provided by EmcObject, initialize and finalize, that do the\nactual initialization and finalization of the class. An initialization object should be cre-\nated before operating upon EmcObject objects.\n\nNote : Python does not have static stuff.\n'''\n\nclass EmcObject:\n def __init__(self):\n pass\n \n def __del__(self):\n pass\n \n def initialize(self):\n pass\n \n def finalize(self):\n pass",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/error-handling.png b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/error-handling.png
new file mode 100644
index 00000000..34176fe4
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/error-handling.png
Binary files differ
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/include-guard.png b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/include-guard.png
new file mode 100644
index 00000000..f8e97ce5
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/include-guard.png
Binary files differ
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/inline-member.png b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/inline-member.png
new file mode 100644
index 00000000..0d803671
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/screenshots/inline-member.png
Binary files differ
diff --git a/Chemical_Engineering_Thermodynamics/README.txt b/Chemical_Engineering_Thermodynamics/README.txt
new file mode 100644
index 00000000..d33ed50c
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: pratik gandhi
+Course: bca
+College/Institute/Organization: Cybercom Creation
+Department/Designation: Developer
+Book Title: Chemical Engineering Thermodynamics
+Author: P. Ahuja
+Publisher: PHI Learning Private Limited, New Delhi
+Year of publication: 2009
+Isbn: 9788120336377
+Edition: 1 \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch10_1.ipynb b/Chemical_Engineering_Thermodynamics/ch10_1.ipynb
new file mode 100644
index 00000000..ed294198
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch10_1.ipynb
@@ -0,0 +1,2564 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Residual Properties by Equations of State"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page Number : 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Preparation of fugacity and fugacity coefficient\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T = 40 + 273.15;\t\t\t#[C] - Temperature\n",
+ "P_1 = 0;\t\t\t#[bar]\n",
+ "P_2 = 10;\t\t\t#[bar]\n",
+ "V_liq = 90.45;\t\t\t#[cm**(3)/mol]\n",
+ "V_liq = V_liq*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "P_sat = 4.287;\t\t\t#[bar] \n",
+ "\n",
+ "# For butadiene\n",
+ "T_c = 425.0;\t\t\t#[K] - Critical temperature\n",
+ "P_c = 43.3;\t\t\t#[bar] - Critical pressure\n",
+ "P_c = P_c*10**(5);\t\t\t#[N/m**(2)]\n",
+ "w = 0.195;\t\t\t# Acentric factor\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# Let us calculate second virial coefficient at 40 C\n",
+ "Tr = T/T_c;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B = ((B_0 + (w*B_1))*(R*T_c))/P_c;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "\n",
+ "# math.log(f/P) = (B*P)/(R*T)\n",
+ "# f = P*exp((B*P)/(R*T))\n",
+ "\n",
+ "print \" The table is as follows\"\n",
+ "print \" Pbar \\t\\t fbar \\t\\t phi\";\n",
+ "from numpy import zeros\n",
+ "P = [1,2,3,4,4.287,5,6,8,10];\n",
+ "f = zeros(9);\n",
+ "phi = zeros(9);\n",
+ "for i in range(5):\n",
+ " f[i]=P[i]*(math.exp((B*P[i]*10**(5))/(R*T)));\t\t\t#[bar] # Pressure inside the exponential term has to be in N/m**(2)\n",
+ " phi[i]= (f[i]/P[i]);\n",
+ " print \" %f \\t %f \\t\\t\\t %f\"%(P[i],f[i],phi[i]) \n",
+ "\n",
+ "f_sat = f[4];\n",
+ "\n",
+ "# From pressure of 4.287 bar onwards the valid equation to compute fugacity of compressed liquid is given by\n",
+ "# f = f_sat*exp[V_liq*(P-P_sat)/(R*T)]\n",
+ "\n",
+ "for j in range(5,9):\n",
+ " f[j] = f_sat*math.exp((V_liq*(P[j]-P_sat)*10**(5))/(R*T));\t#[bar] # Pressure inside the exponential term has to be in N/m**(2)\n",
+ " phi[j] = f[j]/P[j]; \n",
+ " print \" %f \\t %f \\t\\t\\t %f\"%(P[j],f[j],phi[j]);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The table is as follows\n",
+ " Pbar \t\t fbar \t\t phi\n",
+ " 1.000000 \t 0.978336 \t\t\t 0.978336\n",
+ " 2.000000 \t 1.914284 \t\t\t 0.957142\n",
+ " 3.000000 \t 2.809221 \t\t\t 0.936407\n",
+ " 4.000000 \t 3.664484 \t\t\t 0.916121\n",
+ " 4.287000 \t 3.902801 \t\t\t 0.910380\n",
+ " 5.000000 \t 3.912481 \t\t\t 0.782496\n",
+ " 6.000000 \t 3.926097 \t\t\t 0.654349\n",
+ " 8.000000 \t 3.953471 \t\t\t 0.494184\n",
+ " 10.000000 \t 3.981037 \t\t\t 0.398104\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page Number : 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy entropy and internal energy change\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "n = 100.;\t\t\t#[mol] - No of moles\n",
+ "T_1 = 600.;\t\t\t#[K] - Initial temperature\n",
+ "T_2 = 300.;\t\t\t#[K] - Final temperature\n",
+ "P_1 = 10.;\t\t\t#[atm] - Initial pressure\n",
+ "P_1 = P_1*101325;\t\t\t#[Pa]\n",
+ "P_2 = 5.;\t\t\t#[atm] - Final presssure\n",
+ "P_2 = P_2*101325;\t\t\t#[Pa]\n",
+ "Tc = 369.8;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 42.48;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.152;\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "# At 600 K\n",
+ "Tr = T_1/Tc;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B = ((B_0 + (w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "dB0_dT = 0.422*1.6*Tc**(1.6)*T_1**(-2.6);\t\t\t# (dB_0/dT)\n",
+ "dB1_dT = 0.172*4.2*Tc**(4.2)*T_1**(-5.2);\t\t\t# (dB_1/dT)\n",
+ "dB_dT = ((R*Tc)/(Pc))*(dB0_dT + w*dB1_dT);\t\t\t# dB/dT\n",
+ "\n",
+ "# Now let us calculate B and dB/dT at 300 K\n",
+ "Tr_prime = T_2/Tc;\t\t\t# Reduced temperature\n",
+ "B_0_prime = 0.083-(0.422/(Tr_prime)**(1.6));\n",
+ "B_1_prime = 0.139-(0.172/(Tr_prime)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B_prime = ((B_0_prime + (w*B_1_prime))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "dB0_dT_prime = 0.422*1.6*Tc**(1.6)*T_2**(-2.6);\t\t\t# (dB_0/dT)\n",
+ "dB1_dT_prime = 0.172*4.2*Tc**(4.2)*T_2**(-5.2);\t\t\t# (dB_1/dT)\n",
+ "dB_dT_prime = ((R*Tc)/(Pc))*(dB0_dT_prime + w*dB1_dT_prime);\t\t\t# dB/dT\n",
+ "\n",
+ "# The change in enthalpy for ideal gas is given by\n",
+ "\n",
+ "def f16(T): \n",
+ " return -0.966+7.279*10**(-2)*T-3.755*10**(-5)*T**(2)+7.58*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H_ig = quad(f16,T_1,T_2)[0]\n",
+ "\n",
+ "delta_H_ig = delta_H_ig*4.184;\t\t\t#[J/mol]\n",
+ "\n",
+ "# We know that delta_H_ig = delta_U_ig + R*delta_T. Therefore change in internal energy is given by \n",
+ "delta_U_ig = delta_H_ig - R*(T_2 - T_1);\t\t\t#[J/mol]\n",
+ "\n",
+ "# The change in entropy of ideal gas is given by \n",
+ "\n",
+ "def f17(T): \n",
+ " return Cp_0/T\n",
+ "\n",
+ "#delta_S_ig = quad(f17,T_1,T_2) - R*math.log(P_2/P_1)[0]\n",
+ "\n",
+ "\n",
+ "def f18(T): \n",
+ " return (-0.966+7.279*10**(-2)*T-3.755*10**(-5)*T**(2)+7.58*10**(-9)*T**(3))/T\n",
+ "\n",
+ "delta_S_ig = quad(f18,T_1,T_2)[0]*4.184 - R*math.log(P_2/P_1)\n",
+ "\n",
+ "\n",
+ "# Now let us calculate the change in enthalpy of gas. We know that\n",
+ "# delta_H = delta_H_ig + delta_H_R\n",
+ "# delta_H_R = H_2_R - H_1_R\n",
+ "H_2_R = B_prime*P_2 - P_2*T_2*dB_dT_prime;\t\t\t# [J/mol]\n",
+ "H_1_R = B*P_1 - P_1*T_1*dB_dT;\t\t\t# [J/mol]\n",
+ "delta_H_R = H_2_R - H_1_R;\t\t\t# [J/mol]\n",
+ "delta_H = delta_H_ig + delta_H_R;\t\t\t# [J/mol]\n",
+ "\n",
+ "# Let us calculate the residual entropy of gas\n",
+ "S_2_R = -P_2*dB_dT_prime;\t\t\t#[J/mol-K]\n",
+ "S_1_R = -P_1*dB_dT;\t\t\t#[J/mol-K]\n",
+ "delta_S = delta_S_ig + (S_2_R - S_1_R);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Let us calculate the residual internal energy of gas\n",
+ "U_2_R = -P_2*T_2*dB_dT_prime;\t\t\t#[J/mol-K]\n",
+ "U_1_R = -P_1*T_1*dB_dT;\t\t\t#[J/mol-K]\n",
+ "delta_U = delta_U_ig + (U_2_R - U_1_R);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# For 100 mol sample,\n",
+ "delta_H_ig = delta_H_ig*n*10**(-3);\t\t\t#[kJ/mol]\n",
+ "delta_H = delta_H*n*10**(-3);\t\t\t#[kJ/mol]\n",
+ "\n",
+ "delta_U_ig = delta_U_ig*n*10**(-3);\t\t\t#[kJ/mol]\n",
+ "delta_U = delta_U*n*10**(-3);\t\t\t#[kJ/mol]\n",
+ "\n",
+ "delta_S_ig = delta_S_ig*n*10**(-3);\t\t\t#[kJ/mol]\n",
+ "delta_S = delta_S*n*10**(-3);\t\t\t#[kJ/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of delta_H = %f kJ/mol\"%(delta_H);\n",
+ "print \" The value of delta_H_ig ideal gas)= %f J/mol\"%(delta_H_ig);\n",
+ "print \" The value of delta_U = %f kJ/mol\"%(delta_U);\n",
+ "print \" The value of delta_U_ig ideal gas) = %f kJ/mol\"%(delta_U_ig);\n",
+ "print \" The value of delta_S = %f kJ/mol\"%(delta_S);\n",
+ "print \" The value of delta_S_ig ideal gas) = %f kJ/mol\"%(delta_S_ig);\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of delta_H = -3130.406247 kJ/mol\n",
+ " The value of delta_H_ig ideal gas)= -3096.763542 J/mol\n",
+ " The value of delta_U = -2867.753839 kJ/mol\n",
+ " The value of delta_U_ig ideal gas) = -2847.343542 kJ/mol\n",
+ " The value of delta_S = -6.466831 kJ/mol\n",
+ " The value of delta_S_ig ideal gas) = -6.358994 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.4 Page Number : 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molar heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "T = 35 + 273.15;\t\t\t#[K] - Temperature\n",
+ "P = 10;\t\t\t#[atm] - Pressure\n",
+ "P = P*101325;\t\t\t#[Pa]\n",
+ "# Methane obeys the equation of state\n",
+ "# Z = 1 + (P*B)/(R*T)\n",
+ "\n",
+ "# Calculations\n",
+ "# At 35 C,\n",
+ "B = -50;\t\t\t#[cm**(3)/mol]\n",
+ "dB_dT = 1.0;\t\t\t#[cm**(3)/mol-K] - dB/dT\n",
+ "dB_dT = dB_dT*10**(-6);\t\t\t#[m**(3)/mol-K]\n",
+ "d2B_dT2 = -0.01;\t\t\t#[cm**(3)/mol-K**(2)] - d**2(B)/d(T**2)\n",
+ "d2B_dT2 = d2B_dT2*10**(-6);\t\t\t#[m**(3)/mol-K**(2)]\n",
+ "\n",
+ "# Ideal gas molar heat capacity of methane is given by\n",
+ "# Cp_0 = 4.75 + 1.2*10**(-2)*T + 0.303*10**(-5)*T**(2) - 2.63*10**(-9)*T**(3)\n",
+ "\n",
+ "# The molar heat capacity is given by\n",
+ "# Cp = Cp_0 + Cp_R\n",
+ "# For virial gas equation of state \n",
+ "Cp_R = -P*T*d2B_dT2;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# thus heat capacity is given by \n",
+ "# Cp = a + b*T + c*T**(2) + d*T**(3) - P*T*d2B_dT2\n",
+ "# Putting the values, we get\n",
+ "Cp = (4.75 + 1.2*10**(-2)*T + 0.303*10**(-5)*T**(2) - 2.63*10**(-9)*T**(3))*4.184 - P*T*d2B_dT2;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Results\n",
+ "print \" The molar heat capacity of methane is %f J/mol-K\"%(Cp);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The molar heat capacity of methane is 39.349753 J/mol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.5 Page Number : 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature after expansion\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 360;\t\t\t#[K] - Initial temperature\n",
+ "P_1 = 10;\t\t\t#[bar] - Initial pressure\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "Tc = 408.1;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 36.48;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.181;\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Cv_0 = 106.0;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Calculations\n",
+ "# At 360 K\n",
+ "Tr = T_1/Tc;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B = ((B_0 + (w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "dB0_dT = 0.422*1.6*Tc**(1.6)*T_1**(-2.6);\t\t\t# (dB_0/dT)\n",
+ "dB1_dT = 0.172*4.2*Tc**(4.2)*T_1**(-5.2);\t\t\t# (dB_1/dT)\n",
+ "dB_dT = ((R*Tc)/(Pc))*(dB0_dT + w*dB1_dT);\t\t\t# dB/dT\n",
+ "\n",
+ "# At state 1\n",
+ "V_1 = B + (R*T_1)/P_1;\t\t\t#[m**(3)/mol] - Molar volume\n",
+ "# At state 1\n",
+ "V_2 = 10*V_1;\t\t\t#[m**(3)/mol] - Molar volume\n",
+ "\n",
+ "T_2 = -(P_1*T_1*(dB_dT))/Cv_0 + T_1;\t\t\t#[K]\n",
+ "\n",
+ "T = 350;\n",
+ "\n",
+ "fault = 10;\n",
+ "def f(T): \n",
+ " return 106*(T-T_1)+972.72-((R*T**(2))/(V_2-B_prime))*dB_dT_prime\n",
+ "while(fault>0.007):\n",
+ " Tr_prime = T/Tc;\t\t\t# Reduced temperature\n",
+ " B_0_prime = 0.083-(0.422/(Tr_prime)**(1.6));\n",
+ " B_1_prime = 0.139-(0.172/(Tr_prime)**(4.2));\n",
+ " #We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ " B_prime = ((B_0_prime + (w*B_1_prime))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ " dB0_dT_prime = 0.422*1.6*Tc**(1.6)*T_2**(-2.6);\t\t\t# (dB_0/dT)\n",
+ " dB1_dT_prime = 0.172*4.2*Tc**(4.2)*T_2**(-5.2);\t\t\t# (dB_1/dT)\n",
+ " dB_dT_prime = ((R*Tc)/(Pc))*(dB0_dT_prime + w*dB1_dT_prime);\t\t\t# dB/dT\n",
+ " T_prime = fsolve(f,0.15)\n",
+ " fault=abs(T-T_prime);\n",
+ " T = T + 0.001;\n",
+ "\n",
+ "# Results\n",
+ "print \" The final temperature is %f K\"%(T);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The final temperature is 351.910000 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.6 Page Number : 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of fugacity of liquid benzene\n",
+ "\n",
+ "# Variables\n",
+ "T = 220 + 273.15;\t\t\t#[K] - Temperature\n",
+ "Tc = 562.2;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 48.98;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.210;\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "P_sat = 1912.86;\t\t\t#[kPa] - Saturation pressure at 220 C\n",
+ "P_sat = P_sat*10**(3);\t\t\t#[Pa]\n",
+ "Mol_wt = 78.114;\t\t\t#[g/mol] - Molecular weight of benzene\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(1)\n",
+ "# Since liquid and vapour are in equilibrium the fugacity is saturated fugacity (f_sat) and can be calculated using virial gas equation of state\n",
+ "# At 220 C\n",
+ "Tr = T/Tc;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B = ((B_0 + (w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "\n",
+ "# We know that math.log(f/P) = (B*P)/(R*T)\n",
+ "# Thus at saturated conditions\n",
+ "# math.log(f_sat/P_sat) = B*P_sat/(R*T)\n",
+ "f_sat = P_sat*(math.exp((B*P_sat)/(R*T)));\t\t\t#[Pa]\n",
+ "f_sat = f_sat*10**(-3);\t\t\t#[kPa]\n",
+ "\n",
+ "print \" 1).The fugacity of liquid benzene is %f kPa\"%(f_sat);\n",
+ "\n",
+ "#(2)\n",
+ "P = 2014.7;\t\t\t# [psia] - Total gauge pressure\n",
+ "P = 138.94;\t\t\t# [bar]\n",
+ "P = P*10**(5);\t\t\t# [Pa]\n",
+ "den = 0.63;\t\t\t# [g/cm**(3)] - density of benzene\n",
+ "den = den*10**(3);\t\t\t# [kg/m**(3)]\n",
+ "\n",
+ "# Therefore specific volume is \n",
+ "V = 1/den;\t\t\t#[m/**(3)/kg]\n",
+ "# Molar volume is given by\n",
+ "V = V*Mol_wt*10**(-3);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Thus fugacity at 220 C and pressure P is given by \n",
+ "f = f_sat*(math.exp((V*(P-P_sat))/(R*T)));\n",
+ "\n",
+ "print \" 2).The fugacity of liquid benzene is %f kPa\"%(f);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The fugacity of liquid benzene is 1551.083216 kPa\n",
+ " 2).The fugacity of liquid benzene is 2228.386532 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.7 Page Number : 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molar enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "# C = -0.067 + 30.7/T\n",
+ "# D = 0.0012 - 0.416/T\n",
+ "\n",
+ "T = 80 + 273.15;\t\t\t#[K]\n",
+ "P = 30;\t\t\t#[bar]\n",
+ "#P = P;\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "# We have the relation derived in the book\n",
+ "# d(G/(R*T)) = (V/(R*T))dP - (H/(R*T**(2)))dT\n",
+ "# Writing the same equation for ideal gas and subtracting it from the above equation we get\n",
+ "# d(G_R/(R*T)) = (V_R/(R*T))dP - (H_R/(R*T**(2)))dT\n",
+ "# Therefore, H_R/(R*T**(2)) = -[del((G_R)/(R*T))/del(T)]_P\n",
+ "\n",
+ "# Substituting the relation G_R/(R*T) = math.log(f/P), we get\n",
+ "# H_R/(R*T**(2)) = -[del(math.log(f/P))/del(T)]_P = -[del(-C*P - D*P**(2))/del(T)]_P\n",
+ "# or, H_R/(R*T**(2)) = P*(dC/dT) + P**(2)*dD/dT\n",
+ "# Note that in the above equation the partial derivative is replaced by full derivative as C and D are functions of temperature. Therfore we get\n",
+ "# H_R/(R*T**(2)) = (30.7*P)/T**(2) + (0.416*P**(2))/T**(2)\n",
+ "# H_R/R = - 30.7*P + 0.416*P**(2)\n",
+ "\n",
+ "# Substituting the given conditions we get\n",
+ "H_R = R*(-30.7*P + 0.416*P**(2));\t\t\t#[J/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The molar enthalpy of the gas relative to that of the ideal gas at 80 C and 30 bar pressure is H_R = %f J/mol\"%(H_R);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The molar enthalpy of the gas relative to that of the ideal gas at 80 C and 30 bar pressure is H_R = -4544.432400 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.8 Page Number : 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of second and third virial coefficients and fugacity\n",
+ "\n",
+ "# Variables\n",
+ "# (1)\n",
+ "T = 311;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "# Pressure in 'bar' is given below\n",
+ "P = [0.690,1.380,2.760,5.520,8.280,11.034,13.800,16.550];\n",
+ "# Molar volume in 'm**(3)/mol' is given below\n",
+ "V = [0.0373,0.0186,0.00923,0.00455,0.00298,0.00220,0.00175,0.00144];\n",
+ "\n",
+ "# Z = 1 + (B/V) + (C/V**(2))\n",
+ "# (Z-1)*V = B + (C/V)\n",
+ "\n",
+ "from numpy import zeros\n",
+ "Z=zeros(8);\n",
+ "k=zeros(8);\n",
+ "t=zeros(8);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(8):\n",
+ " Z[i]=(P[i]*10**(5)*V[i])/(R*T);\n",
+ " k[i]=(Z[i]-1)*V[i];\n",
+ " t[i]=1./V[i];\n",
+ "\n",
+ "from scipy.stats import linregress\n",
+ "from numpy import array\n",
+ "t = array(t)\n",
+ "k = array(k)\n",
+ "C,B,c,d,e = linregress(t.T,k.T)\n",
+ "#[C,B,sig]=reglin(t',k');\n",
+ "\n",
+ "#From the regression, we get intercept = B and slope = C,and thus,\n",
+ "\n",
+ "print \" 1).The second virial coefficient of CO2 is given by B = %e m**3)/mol\"%(B);\n",
+ "print \" The thied virial coefficient of CO2 is given by C = %e m**6)/mol**2)\"%(C);\n",
+ "\n",
+ "# (2)\n",
+ "P_final = 13.8;\t\t\t#[bar]\n",
+ "\n",
+ "def f40(P): \n",
+ "\t return V-(R*T)/P\n",
+ "\n",
+ "# We know that R*T*math.log(f/P) = quad(f40,0,P)[0]\n",
+ "\n",
+ "# Therefore we have to plot V - (R*T)/P versus P and calculate the area beneath the curve from 0 to 13.8 bar\n",
+ "# For this we need the value of the term V - (R*T)/P at P = 0. At low pressure the virial equation becomes\n",
+ "# Z = 1 + (B/V)\n",
+ "#and V - (R*T)/P = (Z*R*T)/P - (R*T)/P = (1 + (B/V))*((R*T)/P) - (R*T)/P = (B*R*T)/(P*V) = (B/Z)\n",
+ "# Thus lim P tending to zero (V - (R*T)/P) = B ( as P tend to zero, Z tend to 1 ) \n",
+ "\n",
+ "P_prime = [0.000,0.690,1.380,2.760,5.520,8.280,11.034,13.800];\n",
+ "V_prime = [0.000,0.0373,0.0186,0.00923,0.00455,0.00298,0.00220,0.00175];\n",
+ "summation = 0;\n",
+ "x=zeros(8);\n",
+ "y=zeros(8);\n",
+ "z=zeros(8);\n",
+ "for j in range(2,8):\n",
+ " x[j]=V_prime[j]-(R*T)/(P_prime[j]*10**(5));\t\t\t#[m**(3)/mol]\n",
+ " y[j]=(x[j] + x[j-1])/2;\n",
+ " z[j]=y[j]*((P_prime[j]-P_prime[j-1]))*10**(5);\n",
+ " summation = summation + z[j] ;\t\t\t#[J/mol]\n",
+ "\n",
+ "summation = summation + 2*z[1] - z[1];\t\t\t# Because in the above calculation,in order to calculate the average a summation of z(2) is not included,only half of it gets added\n",
+ "\n",
+ "\n",
+ "def f41(P): \n",
+ "\t return V - (R*T)/P\n",
+ "\n",
+ "\t\t\t# Now we have, area = quad(f41,0,13.8*10**(5))[0]\n",
+ "\n",
+ "\t\t\t# R*T*math.log(f/P) = summation\n",
+ "f = P_final*(math.exp(summation/(R*T)));\t\t\t#[bar]\n",
+ "\n",
+ "\n",
+ "print \" 2).The fugacity of steam at 311 K and 13.8 bar pressure is %f bar\"%(f);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The second virial coefficient of CO2 is given by B = -1.515264e-04 m**3)/mol\n",
+ " The thied virial coefficient of CO2 is given by C = 5.618543e-08 m**6)/mol**2)\n",
+ " 2).The fugacity of steam at 311 K and 13.8 bar pressure is 12.892780 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.9 Page Number : 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of second and third virial coefficients\n",
+ "\n",
+ "# Variables\n",
+ "T = 0 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\t\t\t# Pressure in 'atm' is given below\n",
+ "P = [100,200,300,400,500,600,700,800,900,1000];\n",
+ "\t\t\t# The compressibility factor values are\n",
+ "Z = [1.069,1.138,1.209,1.283,1.356,1.431,1.504,1.577,1.649,1.720];\n",
+ "\n",
+ "# Z = 1 + (B/V) + (C/V**(2))\n",
+ "# (Z-1)*V = B + (C/V)\n",
+ "from numpy import zeros\n",
+ "\n",
+ "V = zeros(10);\n",
+ "k = zeros(10);\n",
+ "t = zeros(10);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(10):\n",
+ " V[i]=Z[i]*R*T/(P[i]*101325);\t\t\t#[m**(3)/mol]\n",
+ " k[i]=(Z[i]-1)*V[i];\n",
+ " t[i]=1/V[i];\n",
+ "\n",
+ "from scipy.stats import linregress\n",
+ "C,B,c,d,e = linregress(t,k)\n",
+ "\t\t\t#[C,B,sig]=reglin(t,k);\n",
+ "\n",
+ "\t\t\t#From the regression, we get intercept = B and slope = C,and thus,\n",
+ "\n",
+ "print \" 1).The second virial coefficient of H2 is given by B = %e m**3)/mol\"%(B);\n",
+ "print \" The thied virial coefficient of H2 is given by C = %e m**6)/mol**2)\"%(C);\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "\t\t\t# We know that, limit P tending to zero (V-(R*T)/P) = B, therfore P = 0, V-(R*T)/P = B\n",
+ "\n",
+ "def f42(P): \n",
+ "\t return V-(R*T)/P \t\t\t#and determine the integral integrate((V-(R*T)/P)\n",
+ "\n",
+ "\t\t\t# Now let us tabulate V-(R*T)/P and determine the integral quad(f42,0,1000)[0]\n",
+ "\n",
+ "\n",
+ "P_prime = [0,100,200,300,400,500,600,700,800,900,1000];\n",
+ "Z_prime = [0,1.069,1.138,1.209,1.283,1.356,1.431,1.504,1.577,1.649,1.720];\n",
+ "\n",
+ "summation = 0;\n",
+ "V_prime = zeros(11);\n",
+ "x = zeros(11);\n",
+ "y = zeros(11);\n",
+ "z = zeros(11);\n",
+ "for j in range(1,11):\n",
+ " V_prime[j]=Z_prime[j]*R*T/(P_prime[j]*101325);\t\t\t#[m**(3)/mol]\n",
+ " x[j]=V_prime[j]-(R*T)/(P_prime[j]*101325);\n",
+ " y[j]=(x[j] + x[j-1])/2;\n",
+ " z[j]=y[j]*((P_prime[j]-P_prime[j-1]))*101325;\n",
+ " summation = summation + z[j] ;\t\t\t#[J/mol]\n",
+ "\n",
+ "summation = summation + 2*z[1] - z[1];\t\t\t# Because in the above calculation,in order to calculate the average a summation of z(2) is not included,only half of it gets added\n",
+ "\n",
+ "\t\t\t# Now we have\n",
+ "\t\t\t# R*T*math.log(f/P) = summation\n",
+ "P_dash = 1000;\t\t\t#[atm] - Pressure at which fugacity is to be calculated\n",
+ "T_dash = 273.15;\t\t\t#[K] - Temperature at which fugacity is to be calculated\n",
+ "f = P_dash*math.exp(summation/(R*T_dash));\t\t\t#[atm] \n",
+ "\n",
+ "print \" 2).The fugacity of H2 at 0 C and 1000 atm pressure is f = %f atm\"%(f);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The second virial coefficient of H2 is given by B = 1.345242e-05 m**3)/mol\n",
+ " The thied virial coefficient of H2 is given by C = 5.286525e-10 m**6)/mol**2)\n",
+ " 2).The fugacity of H2 at 0 C and 1000 atm pressure is f = 2030.305169 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.10 Page Number : 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work done and the exit temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math\n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1*10.**(6.);\t\t\t#[Pa] - Initial pressure\n",
+ "T_1 = 200. + 273.15;\t\t#[K] - Initial temperature\n",
+ "P_2 = 8*10.**(6);\t\t\t#[Pa] - Final pressure\n",
+ "Tc = 647.1;\t\t\t #[K] - Critical temperature of water\n",
+ "Pc = 220.55; \t\t\t#[bar] - Critical pressure of water\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.345;\n",
+ "R = 8.314;\t\t \t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# For the virial gas the following are the relations for residual enthalpy and entropy\n",
+ "# H_R = B*P - P*T*(dB/dT) \n",
+ "# S_R = -P*(dB/dT)\n",
+ "# Where, (dB/dT) = ((R*Tc)/Pc)*((dB_0/dT) + w*(dB_1/dT))\n",
+ "# dB0_dT = 0.422*1.6*Tc**(1.6)*T**(-2.6);\t\t\t# (dB_0/dT)\n",
+ "# dB1_dT = 0.172*4.2*Tc**(4.2)*T**(-5.2);\t\t\t# (dB_1/dT)\n",
+ "\n",
+ "# (1)\n",
+ "Cp_0 = 29.114;\t\t\t#[J/mol-K] - Specific heat capacity at constant pressure\n",
+ "# For the isentropic process entropy change is zero, thus\n",
+ "# delta_S = Cp_0*math.log(T_2/T_1) - P_2*(dB/dT)_2 + P_1*(dB/dT)_1 = 0\n",
+ "\n",
+ "# Calculations\n",
+ "# At state 1, \n",
+ "Tr_1 = T_1/Tc;\n",
+ "B0_1 = 0.083 - 0.422/(Tr_1**(1.6));\n",
+ "B1_1 = 0.139 - 0.172/(Tr_1**(4.2));\n",
+ "# (B*Pc)/(R*Tc) = B0 + w*B1\n",
+ "B_1 = ((B0_1 + w*B1_1)*(R*Tc))/Pc;\t\t\t# [m**(3)/mol] - Second virial coefficient at state 1\n",
+ "dB0_dT_1 = 0.422*1.6*Tc**(1.6)*T_1**(-2.6);\t\t\t# (dB_0/dT)\n",
+ "dB1_dT_1 = 0.172*4.2*Tc**(4.2)*T_1**(-5.2);\t\t\t# (dB_1/dT)\n",
+ "dB_dT_1 = ((R*Tc)/Pc)*((dB0_dT_1) + w*(dB1_dT_1));\t\t\t# (dB/dT)_1\n",
+ "\n",
+ "# Now let us assume the exit temperature to be 870 K, at this temperature\n",
+ "# T_2 = 870;\t\t\t#[K] - \n",
+ "# At this temperature\n",
+ "# delta_S = Cp_0*math.log(T_2/T_1) - P_2*(dB/dT)_2 + P_1*(dB/dT)_1 = \n",
+ "\n",
+ "\n",
+ "T_2 = 860.;\t\t\t#[K] - Exit temperature\n",
+ "# Therefore at state 2, we have\n",
+ "Tr_2 = T_2/Tc;\n",
+ "B0_2 = 0.083 - 0.422/(Tr_2**(1.6));\n",
+ "B1_2 = 0.139 - 0.172/(Tr_2**(4.2));\n",
+ "# (B*Pc)/(R*Tc) = B0 + w*B1\n",
+ "B_2 = ((B0_2 + w*B1_2)*(R*Tc))/Pc;\t\t\t# [m**(3)/mol] - Second virial coefficient at state 2\n",
+ "dB0_dT_2 = 0.422*1.6*Tc**(1.6)*T_2**(-2.6);\t\t\t# (dB_0/dT)\n",
+ "dB1_dT_2 = 0.172*4.2*Tc**(4.2)*T_2**(-5.2);\t\t\t# (dB_1/dT)\n",
+ "dB_dT_2 = ((R*Tc)/Pc)*((dB0_dT_2) + w*(dB1_dT_2));\t\t\t# (dB/dT)_2\n",
+ "\n",
+ "delta_H_s = Cp_0*(T_2 - T_1) + B_2*P_2 -P_2*T_2*(dB_dT_2) - B_1*P_1 + P_1*T_1*(dB_dT_1);\t\t\t#[J/mol] - Enthalpy change\n",
+ "\n",
+ "# As no heat exchange is assumed to take place with the surroundings,work transfer is given by\n",
+ "W_1 = - delta_H_s;\t\t\t# [J/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" 1).The exit temperature is %f K\"%(T_2);\n",
+ "print \" The required amount of work is %f J/mol\"%(W_1);\n",
+ "\n",
+ "\n",
+ "# (2)\n",
+ "eff = 0.8;\t\t\t# Adiabatic efficiency\n",
+ "delta_H_a = delta_H_s/0.8;\t\t\t# Actual enthalpy change\n",
+ "\n",
+ "# Now for calculating the value of T_exit\n",
+ "# delta_H_a = Cp_0*(T_exit - T_1) + B*P_2 -P_2*T_exit*(dB_dT) - B_1*P_1 + P_1*T_1*(dB_dT_1)\n",
+ "# On simplification we get\n",
+ "# 29.114*(T_2 - T_1)*B_2*8*10**(6)-8*10**(6)*T_2*(dB/dT)_2 = 12643.77 \n",
+ "\n",
+ "# Let us assume a temperature of say\n",
+ "T = 900.;\t\t\t#[K]\n",
+ "fault=10.;\n",
+ "\n",
+ "def f(T_exit): \n",
+ "\t return delta_H_a - Cp_0*(T_exit - T_1) + B*P_2 -P_2*T_exit*(dB_dT) - B_1*P_1 + P_1*T_1*(dB_dT_1)\n",
+ "\t \n",
+ "while(fault>0.3):\n",
+ " Tr = T/Tc;\n",
+ " B0 = 0.083 - 0.422/(Tr**(1.6));\n",
+ " B1 = 0.139 - 0.172/(Tr**(4.2));\n",
+ " \t\t\t# (B*Pc)/(R*Tc) = B0 + w*B1\n",
+ " B = ((B0 + w*B1)*(R*Tc))/Pc;\t\t\t# [m**(3)/mol] - Second virial coefficient at state 2\n",
+ " dB0_dT = 0.422*1.6*Tc**(1.6)*T**(-2.6);\t\t\t# (dB_0/dT)\n",
+ " dB1_dT = 0.172*4.2*Tc**(4.2)*T**(-5.2);\t\t\t# (dB_1/dT)\n",
+ " dB_dT = ((R*Tc)/Pc)*((dB0_dT) + w*(dB1_dT));\t\t\t# (dB/dT)_1\n",
+ "\n",
+ " T_exit = fsolve(f,900)\n",
+ " fault=abs(T-T_exit);\n",
+ " T = T + 0.2;\n",
+ "\n",
+ "Texit = T;\n",
+ "\n",
+ "\t\t\t# As no heat exchange is assumed to take place with the surroundings,work transfer is given by\n",
+ "W_2 = - delta_H_a;\t\t\t# [J/mol]\n",
+ "\n",
+ "print \" 2).The exit temperature is %f K\"%(Texit);\n",
+ "print \" The required amount of work is %f J/mol\"%(W_2);\n",
+ "\n",
+ "\n",
+ "def f20(T): \n",
+ "\t return Cp_0/T\n",
+ "\n",
+ "T_prime = 700.;\t\t\t#[K]\n",
+ "fault1=10.;\n",
+ "\n",
+ "def f1(T_out): \n",
+ "\t return 32.2168*math.log(T_out) + 0.1922*10**(-2)*T_out + 0.5274*10**(-5) \\\n",
+ "\t *T_2**(2) - 1.1976*10**(-9)*T_out**(3)-8*10**(6)*dB_dT_prime -216.64\n",
+ "\n",
+ "while(fault1>0.5):\n",
+ " Tr_prime = T_prime/Tc;\n",
+ " B0_prime = 0.083 - 0.422/(Tr_prime**(1.6));\n",
+ " B1_prime = 0.139 - 0.172/(Tr_prime**(4.2));\n",
+ " B_prime = ((B0_prime + w*B1_prime)*(R*Tc))/Pc;\t\t\t# [m**(3)/mol] - Second virial coefficient at state 2\n",
+ " dB0_dT_prime = 0.422*1.6*Tc**(1.6)*T_prime**(-2.6);\t\t\t# (dB_0/dT)\n",
+ " dB1_dT_prime = 0.172*4.2*Tc**(4.2)*T_prime**(-5.2);\t\t\t# (dB_1/dT)\n",
+ " dB_dT_prime = ((R*Tc)/Pc)*((dB0_dT_prime) + w*(dB1_dT_prime));\t\t\t# (dB/dT)_1\n",
+ " T_out = fsolve(f1,10)\n",
+ " fault1=abs(T_prime-T_out);\n",
+ " T_prime = T_prime + 0.5;\n",
+ "\n",
+ "T_out = T_prime;\n",
+ "\n",
+ "# Now we have to calculate enthalpy change as W = -delta_H\n",
+ "\n",
+ "def f21(T): \n",
+ "\t return (7.7 + 0.04594*10**(-2.)*T + 0.2521*10**(-5.)*T**(2.) - 0.8587*10.**(-9.)*T**(3.))*4.184\n",
+ "\n",
+ "delta_H_3 = quad(f21,T_1,T_out)[0] + B_prime*P_2 - P_2*T_out*dB_dT_prime - B_1*P_1 + P_1*T_1*dB_dT_1\n",
+ "print T_1,T_out\n",
+ "\n",
+ "\n",
+ "W_3 = - delta_H_3;\t\t\t# [J/mol]\n",
+ "\n",
+ "print \" 3).The exit temperature is %f K\"%(T_out);\n",
+ "print \" The required amount of work is %f J/mol\"%(W_3);\n",
+ "\n",
+ "#(4)\n",
+ "n = 0.8;\t\t\t# Adiabatic efficiency\n",
+ "delta_H_a_4 = delta_H_3/n;\t\t\t#[J/mol]\n",
+ "W_4 = -delta_H_a_4;\t\t\t#[J/mol]\n",
+ "\n",
+ "\n",
+ "T_prime1 = 700.;\t\t\t#[K]\n",
+ "fault2=10.;\n",
+ "\n",
+ "def f2(T_2): \n",
+ "\t return 7.7*4.184*(T_2-T_1) + ((0.04594*4.184*10**(-2))/2)* \\\n",
+ "\t (T_2**(2)-T_1**(2)) + ((0.2521*4.184*10**(-5))/3)*(T_2**(3)-T_1**(3)) - \\\n",
+ "\t ((0.8587*4.184*10**(-9))/4)*(T_2**(4)-T_1**(4)) + B_prime1*8*10**(6) \\\n",
+ "\t - 8*10**(6)*T_2*dB_dT_prime1 + 191.7 + 496.81 - delta_H_a_4\n",
+ "\n",
+ "while(fault2>0.5):\n",
+ " Tr_prime1 = T_prime1/Tc;\n",
+ " B0_prime1 = 0.083 - 0.422/(Tr_prime1**(1.6));\n",
+ " B1_prime1 = 0.139 - 0.172/(Tr_prime1**(4.2));\n",
+ " \t\t\t# (B*Pc)/(R*Tc) = B0 + w*B1\n",
+ " B_prime1 = ((B0_prime1 + w*B1_prime1)*(R*Tc))/Pc;\t\t\t# [m**(3)/mol] - Second virial coefficient at state 2\n",
+ " dB0_dT_prime1 = 0.422*1.6*Tc**(1.6)*T_prime1**(-2.6);\t\t\t# (dB_0/dT)\n",
+ " dB1_dT_prime1 = 0.172*4.2*Tc**(4.2)*T_prime1**(-5.2);\t\t\t# (dB_1/dT)\n",
+ " dB_dT_prime1 = ((R*Tc)/Pc)*((dB0_dT_prime1) + w*(dB1_dT_prime1));\t\t\t# (dB/dT)_1\n",
+ " T_out1 = fsolve(f2,100)\n",
+ " fault2=abs(T_prime1-T_out1);\n",
+ " T_prime1 = T_prime1 + 0.5;\n",
+ "\n",
+ "T_out1 = T_prime1;\n",
+ "\n",
+ "print \" 4).The exit temperature is %f K\"%(T_out1);\n",
+ "print \" The required amount of work is %f J/mol\"%(W_4);\n",
+ "\n",
+ "\n",
+ "# answers are varies because of rounding error. please check it manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The exit temperature is 860.000000 K\n",
+ " The required amount of work is -10667.724150 J/mol\n",
+ " 2).The exit temperature is 916.600000 K\n",
+ " The required amount of work is -13334.655188 J/mol\n",
+ "473.15"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 755.5\n",
+ " 3).The exit temperature is 755.500000 K\n",
+ " The required amount of work is -9282.701079 J/mol\n",
+ " 4).The exit temperature is 809.500000 K"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The required amount of work is -11603.376349 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.11 Page Number : 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of temperature and pressure\n",
+ "\n",
+ "# Variables\n",
+ "Vol = 0.15;\t\t\t #[m**(3)] - Volume of the cylinder\n",
+ "P_1 = 100.;\t\t\t #[bar] - Initial pressure\n",
+ "P_1 = P_1*10**(5);\t\t#[Pa]\n",
+ "T_1 = 170.;\t\t\t #[K] - Initial temperature\n",
+ "n_withdrawn = 500.;\t\t#[mol] - Withdrawn number of moles\n",
+ "R = 8.314;\t\t \t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(1)\n",
+ "Y = 1.4;\t\t\t# Coefficient of adiabatic expansion\n",
+ "n_total = (P_1*Vol)/(R*T_1);\t\t\t#[mol] - Total number of moles\n",
+ "n_2 = n_total - n_withdrawn;\t\t\t#[mol] - Left number of moles\n",
+ "V_1 = Vol/n_total;\t\t\t#[m**(3)/mol] - Molar volume at initial state.\n",
+ "# At final state\n",
+ "V_2 = Vol/n_2;\t\t\t#[m**(3)/mol] - Molar volume at final state\n",
+ "\n",
+ "# During duscharging P_1*V_1**(Y) = P_2*V_2**(Y), therefore\n",
+ "P_2_1 = P_1*((V_1/V_2)**(Y));\t\t\t#[Pa] - Final pressure\n",
+ "P_2_1 = P_2_1*10**(-5);\t\t\t#[bar]\n",
+ "T_2_1 = ((P_2_1*10**(5))*V_2)/R;\t\t\t#[K] - Final temperature\n",
+ "\n",
+ "print \" 1).The final temperature %f K\"%(T_2_1);\n",
+ "print \" The final pressure %f bar\"%(P_2_1);\n",
+ "\n",
+ "\n",
+ "def f53(T): \n",
+ "\t return Cp_0/T\n",
+ "\n",
+ "T_prime = 150;\t\t\t#[K]\n",
+ "error = 10;\n",
+ "while(error>1):\n",
+ " f_T = 18.886*math.log(T_prime) + 4.2*10**(-3)*T_prime - 92.4;\n",
+ " f_T_dash = 18.886/T_prime + 4.2*10**(-3);\n",
+ " T_new = T_prime - (f_T/f_T_dash);\n",
+ " error=abs(T_prime - T_new);\n",
+ " T_prime = T_new;\n",
+ "\n",
+ "T_2_2 = T_prime;\t\t\t#[K] - Final temperature\n",
+ "P_2_2 = ((n_2*R*T_2_2)/Vol)*10**(-5);\t\t\t#[bar] - Final pressure\n",
+ "\n",
+ "print \" 2).The final temperature %f K\"%(T_2_2);\n",
+ "print \" The final pressure %f bar\"%(P_2_2);\n",
+ "\n",
+ "#(3)\n",
+ "Tc = 126.2;\t\t\t#[K] - Critical temperature of nitrogen\n",
+ "Pc = 34.0;\t\t\t#[bar] - Critical pressure of nitrogen\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.038;\t\t\t# Acentric factor\n",
+ "\n",
+ "\n",
+ "dB0_dT = 0.422*1.6*Tc**(1.6)*T_1**(-2.6);\t\t\t# (dB_0/dT) at state 1\n",
+ "dB1_dT = 0.172*4.2*Tc**(4.2)*T_1**(-5.2);\t\t\t# (dB_1/dT) at state 1\n",
+ "dB_dT = ((R*Tc)/Pc)*((dB0_dT) + w*(dB1_dT));\t\t\t# (dB/dT) at state 1\n",
+ "# The residual entropy at the initial state is given by \n",
+ "S_R_1 = -P_1*(dB_dT);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Now let us calculate molar volume at initial state\n",
+ "Tr = T_1/Tc;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "V_1_3 = B + (R*T_1)/P_1;\t\t\t#[m**(3)/mol]\n",
+ "# Therefore number of moles in the initial state is\n",
+ "n_1_3 = Vol/V_1_3;\t\t\t#[mol]\n",
+ "# Therefore final number of moles is\n",
+ "n_2_3 = n_1_3 - n_withdrawn;\n",
+ "\n",
+ "# Therefore molar volume at final state is\n",
+ "V_2_3 = Vol/n_2_3;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Now let us determine the relation between pressure and temperature in the final state\n",
+ "# P_2_3 = (R*T_2_3)/(V_2_3 - B_2)\n",
+ "#delta_S = 0, thus delta_S_ig + delta_S_R = 0\n",
+ "delta_S_R = - S_R_1;\n",
+ "\n",
+ "def f54(T): \n",
+ "\t return Cp_0/T\n",
+ "\n",
+ "\n",
+ "T_2_prime = 135;\t\t\t#[K]\n",
+ "delta = 0.1;\n",
+ "error = 10;\n",
+ "while(error>0.01):\n",
+ " T_r = T_2_prime/Tc;\t\t\t# Reduced temperature\n",
+ " B_0_3 = 0.083-(0.422/(T_r)**(1.6));\n",
+ " B_1_3 = 0.139-(0.172/(T_r)**(4.2));\n",
+ " B_3 = ((B_0_3+(w*B_1_3))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ " dB0_dT_3 = 0.422*1.6*Tc**(1.6)*T_2_prime**(-2.6);\t\t\t# (dB_0/dT)\n",
+ " dB1_dT_3 = 0.172*4.2*Tc**(4.2)*T_2_prime**(-5.2);\t\t\t# (dB_1/dT)\n",
+ " dB_dT_3 = ((R*Tc)/Pc)*((dB0_dT_3) + w*(dB1_dT_3));\t\t\t# (dB/dT)\n",
+ " P_2_3 = (R*T_2_prime)/(V_2_3 - B_3);\n",
+ " delta_S = 27.2*(math.log(T_2_prime/T_1)) + 4.2*10**(-3)*(T_2_prime - T_1) - R*(math.log(P_2_3/P_1)) - P_2_3*(dB_dT_3) + delta_S_R;\n",
+ " T_new = T_2_prime + delta;\n",
+ " error=abs(delta_S);\n",
+ " T_2_prime = T_new;\n",
+ "\n",
+ "T_2_3 = T_2_prime;\t\t\t#[K] - Final temperature\n",
+ "\t\t\t# Therefore at T_2_3\n",
+ "P_2_3 = P_2_3*10**(-5);\t\t\t#[bar] - Final pressure\n",
+ "\n",
+ "print \" 3).The final temperature %f K\"%(T_2_3);\n",
+ "print \" The final pressure %f bar\"%(P_2_3);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The final temperature 131.761821 K\n",
+ " The final pressure 40.991361 bar\n",
+ " 2).The final temperature 129.504151 K\n",
+ " The final pressure 40.288995 bar\n",
+ " 3).The final temperature 141.300000 K\n",
+ " The final pressure 57.079997 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.12 Page Number : 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of change of internal energy enthalpy entropy and exergy\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 80.;\t\t\t #[bar] - Initial pressure\n",
+ "P_1 = P_1*10.**(5);\t\t\t#[Pa]\n",
+ "T_1 = 300. + 273.15;\t\t#[T] - Initial temperature\n",
+ "P_2 = 40.;\t\t\t #[bar] - Final pressure\n",
+ "P_2 = P_2*10**(5);\t\t\t#[Pa]\n",
+ "T_2 = 300. + 273.15;\t\t#[K] - Final temperature\n",
+ "T_0 = 25. + 273.15;\t\t\t#[K] - Surrounding temperature\n",
+ "P_0 = 1.;\t\t\t #[atm] - Surrounding pressure\n",
+ "P_0 = P_0*101325;\t\t\t#[Pa]\n",
+ "Tc = 647.1;\t\t\t #[K]\n",
+ "Pc = 220.55;\t\t\t #[bar]\n",
+ "Pc = Pc*10.**(5);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t #[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "# For van der Walls equation of state\n",
+ "a = (27*R**(2)*Tc**(2))/(64*Pc);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\n",
+ "def f(V): \n",
+ "\t return V**(3)-(b+(R*T_1)/P_1)*V**(2)+(a/P_1)*V-(a*b)/P_1\n",
+ "V_1_1=fsolve(f,0.1)\n",
+ "V_1_2=fsolve(f,10)\n",
+ "V_1_2=fsolve(f,100)\n",
+ "# The largest root is considered because of vapour\n",
+ "V_1 = V_1_1;\n",
+ "\n",
+ "U_R_1 = -a/V_1;\t\t\t#[J/mol] - Internal energy\n",
+ "H_R_1 = P_1*V_1 - R*T_1 - a/V_1;\t\t\t#[J/mol] - Enthalpy\n",
+ "S_R_1 = R*math.log((P_1*(V_1-b))/(R*T_1));\n",
+ "\n",
+ "def f1(V): \n",
+ "\t return V**(3)-(b+(R*T_2)/P_2)*V**(2)+(a/P_2)*V-(a*b)/P_2\n",
+ "V_2_1 = fsolve(f1,0.1)\n",
+ "V_2_2 = fsolve(f1,10)\n",
+ "V_2_3 = fsolve(f1,100)\n",
+ "V_2 = V_2_1;\n",
+ "\n",
+ "U_R_2 = -a/V_2;\t\t\t#[J/mol] - Internal energy\n",
+ "H_R_2 = P_2*V_2 - R*T_2 - a/V_2;\t\t\t#[J/mol] - Enthalpy\n",
+ "S_R_2 = R*math.log((P_2*(V_2-b))/(R*T_2));\n",
+ "\n",
+ "delta_U_R = U_R_2 - U_R_1;\t\t\t#\n",
+ "delta_H_R = H_R_2 - H_R_1;\t\t\t#\n",
+ "delta_S_R = S_R_2 - S_R_1;\t\t\t#\n",
+ "\n",
+ "delta_U_ig = 0;\t\t\t#[J/mol] - As temperature is constant\n",
+ "delta_H_ig = 0;\t\t\t#[J/mol] - As temperature is constant\n",
+ "delta_S_ig = - R*math.log(P_2/P_1);\t\t\t# [J/mol-K]\n",
+ "delta_U = delta_U_R + delta_U_ig;\t\t\t#[J/mol]\n",
+ "delta_H = delta_H_R + delta_H_ig;\t\t\t#[J/mol]\n",
+ "delta_S = delta_S_R + delta_S_ig;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "\t\t\t# Change in exergy is given by\n",
+ "\t\t\t# delta_phi = phi_1 - phi_2 = U_1 - U_2 + P_0*(V_1 - _V_2) - T_0*(S_1 - S_2)\n",
+ "delta_phi = - delta_U + P_0*(V_1 - V_2) - T_0*(-delta_S);\t\t\t#[J/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The change in internal energy is %f J/mol\"%(delta_U);\n",
+ "print \" The change in enthalpy is %f J/mol\"%(delta_H);\n",
+ "print \" The change in entropy is %f J/mol-K\"%(delta_S);\n",
+ "print \" The change in exergy is %f J/mol\"%(delta_phi);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The change in internal energy is 615.070900 J/mol\n",
+ " The change in enthalpy is 1053.220316 J/mol\n",
+ " The change in entropy is 6.930264 J/mol-K\n",
+ " The change in exergy is 1389.940735 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.13 Page Number : 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of change in enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 500.;\t\t\t#[K] - Initial temperature\n",
+ "P_1 = 30.;\t\t\t#[atm] - Initial pressure\n",
+ "P_1 = P_1*101325;\t\t\t#[Pa]\n",
+ "P_2 = 1;\t\t\t#[atm] - Final pressure\n",
+ "P_2 = P_2*101325;\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\t\t\t# For chlorine\n",
+ "Tc = 417.2;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 77.10;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "\n",
+ "#Redlich Kwong equation of state,\n",
+ "a = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t# [Pa*m**(6)*K**(1/2)/mol]\n",
+ "b = (0.08664*R*Tc)/Pc;\t\t\t# [m**(3)/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "def f1(V): \n",
+ "\t return V**(3)-((R*T_1)/P_1)*V**(2)-((b**(2))+((b*R*T_1)/P_1)-(a/(T_1**(1./2)*P_1)))*V-(a*b)/(T_1**(1./2)*P_1)\n",
+ "V_1=fsolve(f1,1)\n",
+ "V_2=fsolve(f1,10)\n",
+ "V_3=fsolve(f1,100)\n",
+ "\n",
+ "V = V_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\n",
+ "Z = (P_1*V_1)/(R*T_1);\t\t\t#compressibility factor\n",
+ "\n",
+ "# The residual enthalpy at state 1 is given by\n",
+ "H_R_1 = (Z-1)*R*T_1 + ((3*a)/(2*b*T_1**(1./2)))*(math.log(V/(V+b)));\t\t\t#[J/mol]\n",
+ " \n",
+ "# Since chlorine is assumed to behave ideally under the final condition,therefore\n",
+ "H_R_2 = 0;\t\t\t# Residual enthalpy at state 2\n",
+ "delta_H_R = H_R_2 - H_R_1;\t\t\t#[J/mol] - Residual enthalpy change\n",
+ "# and since isothermal conditions are maintained, therfore\n",
+ "delta_H_ig = 0;\t\t\t# Enthalpy change under ideal condition\n",
+ "delta_H = delta_H_R + delta_H_ig;\t\t\t#[J/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The change in enthalpy is given by delta_H = %f J/mol\"%(delta_H);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The change in enthalpy is given by delta_H = 1053.558471 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.14 Page Number : 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature\n",
+ "\n",
+ "#(1)\n",
+ "#This part involves proving a relation in which no mathematical components are involved.\n",
+ "#For proof refer to this example 10.14 on page number 354 of the book.\n",
+ "\n",
+ "\n",
+ "#(2)\n",
+ "\n",
+ "# Variables\n",
+ "Vol_1 = 0.1;\t\t\t#[m**(3)] - Initial volume of each compartment\n",
+ "n_1 = 400;\t\t\t#[mol] - Initial number of moles in compartment 1\n",
+ "V_1 = Vol_1/n_1;\t\t\t#[m**(3)/mol] - Molar volume at state 1\n",
+ "T_1 = 294;\t\t\t#[K]\n",
+ "Vol_2 = 0.2;\t\t\t#[m**(3)] - Final volume of the compartment after removing the partition.\n",
+ "n_2 = n_1;\t\t\t#[mol] - Number of moles remains the same\n",
+ "V_2 = Vol_2/n_2;\t\t\t#[m**(3)/mol] - Molar volume at state 2\n",
+ "\n",
+ "a = 0.1362;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = 3.215*10**(-5);\t\t\t#[m**(3)/mol]\n",
+ "Cv_0 = 12.56;\t\t\t#[J/mol-K] - Heat capacity in ideal gas state\n",
+ "\n",
+ "# Calculations\n",
+ "# For overall system q = 0, and no work is done, therefore delta_U = 0\n",
+ "# Therfore from the relation proved in part (1), we have\n",
+ "T_2 = T_1 + (a/Cv_0)*(1/V_2 - 1/V_1);\t\t\t#[K]\n",
+ "\n",
+ "# Results\n",
+ "print \" 2).The final temperatutre is %f K\"%(T_2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 2).The final temperatutre is 272.312102 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.17 Page Number : 356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work done and the exit temperature\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1*10**(6);\t\t\t#[Pa] - Initial pressure\n",
+ "T_1 = 200 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 8*10**(6);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Y = 1.4;\t\t\t# Index of expansion\n",
+ "Cp_0 = 29.114;\t\t\t#[J/mol-K]\n",
+ "\t\n",
+ "a = 0.55366;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = 3.049*10**(-5);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "V_1 = 3.816*10**(-3);\t\t\t#[m**(3)/mol]\n",
+ "Z_1 = (P_1*V_1)/(R*T_1);\n",
+ "\n",
+ "T_2 = T_1*(P_2/P_1)**((Y-1)/Y);\t\t\t#[K]\n",
+ "\n",
+ "# At 8 MPa and T_2,\n",
+ "# The molar volume of steam following van der Walls equation of state (as reported in the book) is\n",
+ "V_2 = 8.41*10**(-4);\t\t\t#[m**(3)/mol]\n",
+ "# And the compressibility factor is \n",
+ "Z_2 = (P_2*V_2)/(R*T_2);\n",
+ "\n",
+ "# For van der Walls equation of state we know that\n",
+ "# delta_S_R/R = math.log(Z_2/Z_1) + math.log((V_2 - b)/V_2) - math.log((V_1 - b)/V_1)\n",
+ "delta_S_R = R*(math.log(Z_2/Z_1) + math.log((V_2 - b)/V_2) - math.log((V_1 - b)/V_1));\t\t\t#[J/mol]\n",
+ "\n",
+ "# delta_S_ig = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1)\n",
+ "# The entropy change is therefore\n",
+ "# delta_S = delta_S_ig + delta_S_R\n",
+ "# But during an isentropic process the total entropy change is zero\n",
+ "# Therefore we have to modify the exit temperature so that the entropy change is zero\n",
+ "\n",
+ "# Let us assume a temperature, say T = 870 K\n",
+ "# At 870 K the molar volume of steam following van der Walls equation of state (as reported in the book) is\n",
+ "# V_3 = 8.57*10**(-4);\t\t\t# [m**(3)/mol]\n",
+ "# Therefore\n",
+ "# Z_3 = (P_2*V_3)/(R*T_2);\n",
+ "# At this temperature,\n",
+ "# delta_S = Cp_0*math.log(T/T_1) - R*math.log(P_2/P_1) + R*(math.log(Z/Z_1) + R*math.log((V - b)/V) - R*math.log((V_1 - b)/V_1))\n",
+ "\n",
+ "T = 800;\t\t\t#[K]\n",
+ "fault=10;\n",
+ "\n",
+ "def f1(V): \n",
+ "\t return V**(3)-(b+(R*T)/P_2)*V**(2)+(a/P_2)*V-(a*b)/P_2\n",
+ "\t \n",
+ "def f2(T): \n",
+ "\t return Cp_0*math.log(T/T_1) - R*math.log(P_2/P_1) + R*(math.log(Z/Z_1) + R*(math.log((V - b)/V)) - R*(math.log((V_1 - b)/V_1)))\n",
+ "\n",
+ "\n",
+ "while(fault>0.3):\n",
+ " \t\t\t# At T and 8 MPa\n",
+ " V = fsolve(f1,1)\n",
+ " Z = (P_2*V)/(R*T);\n",
+ " \n",
+ " T_exit = fsolve(f2,0.1)\n",
+ " fault=abs(T-T_exit);\n",
+ " T = T + 0.5;\n",
+ "\n",
+ "Texit = T;\n",
+ "\n",
+ "# Now applying the first law to an adiabatic process we get\n",
+ "# W = - delta_H\n",
+ "\n",
+ "# For van der Walls gas the enthalpy change is given by\n",
+ "delta_H_s = Cp_0*(T_exit - T_1) + (Z - 1)*R*T_exit - a/V - (Z_1-1)*R*T_1 + a/V_1;\t\t\t#[J/mol]\n",
+ "W = - delta_H_s;\t\t\t#[J/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" 1).The exit temperature is %f K\"%(Texit);\n",
+ "print \" The work required is given by W = %f J/mol\"%(W);\n",
+ "\n",
+ "#(2)\n",
+ "eff = 0.8;\t\t\t# Adiabatic efficiency\n",
+ "delta_H_a = eff*delta_H_s;\t\t\t#[J/mol] - Actual enthalpy change\n",
+ "W_2 = - delta_H_a;\n",
+ "\n",
+ "\t\t\t# Let us assume a temperature, say\n",
+ "T_prime= 900;\t\t\t#[K]\n",
+ "fault1=10;\n",
+ "def f22(V): \n",
+ "\t return V**(3)-(b+(R*T_prime)/P_2)*V**(2)+(a/P_2)*V-(a*b)/P_2\n",
+ "\n",
+ "def f3(T_prime): \n",
+ "\t return Cp_0*(T_prime - T_1) + (Z_prime - 1)*R*T_prime - a/V_prime - 13230.49\n",
+ "\t \n",
+ "while(fault1>0.3):\n",
+ " \t\t\t# At T_prime and 8 MPa\n",
+ " V_prime=fsolve(f22,1)\n",
+ " Z_prime = (P_2*V_prime)/(R*T_prime);\n",
+ " T_exit1 = fsolve(f3,100)\n",
+ " fault1=abs(T_prime-T_exit1);\n",
+ " T_prime = T_prime + 0.2;\n",
+ "\n",
+ "Texit1 = T_prime;\n",
+ "\n",
+ "print \" 2).The exit temperature is %f K\"%(Texit1);\n",
+ "print \" The work required is given by W = %f J/mol\"%(W_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The exit temperature is 916.500000 K\n",
+ " The work required is given by W = -12195.093996 J/mol\n",
+ " 2).The exit temperature is 958.400000 K"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The work required is given by W = -9756.075197 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.19 Page Number : 359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molar volume and fugacity\n",
+ "\n",
+ "# Variables\n",
+ "T = 100 + 273.15;\t\t\t#[K] - Temperature\n",
+ "Tc = 647.1;\t\t\t#[K] - Critical temperature of water\n",
+ "Pc = 220.55;\t\t\t#[bar] - Critical pressure of water\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "a = (27*R**(2)*Tc**(2))/(64*Pc);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The cubic form of van der Walls equation of state is given by,\n",
+ "# V**(3) - (b + (R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "\n",
+ "# For water vapour at 100 C under saturated conditions pressure is 1 atm, therefore\n",
+ "P = 1;\t\t\t#[atm]\n",
+ "P = P*101325;\t\t\t#[Pa]\n",
+ "\n",
+ "# At 100 C and 1 atm \n",
+ "def f(V): \n",
+ "\t return V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P\n",
+ "V_1 = fsolve(f,0.1)\n",
+ "V_1 = fsolve(f,10)\n",
+ "V_1 = fsolve(f,100)\n",
+ "V = V_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\n",
+ "f = P*(math.exp(math.log((R*T)/(P*(V-b))) + b/(V-b) - (2*a)/(R*T*V)));\t\t\t#[Pa]\n",
+ "f = f/101325;\t\t\t#[atm]\n",
+ "\n",
+ "# Results\n",
+ "print \" The molar volume is %f m**3)/mol\"%(V);\n",
+ "print \" The fugacity is %f atm\"%(f);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The molar volume is 0.030469 m**3)/mol\n",
+ " The fugacity is 0.995168 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.20 Page Number : 359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy and entropy change\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 6;\t\t\t#[bar] - Initial pressure\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "T_1 = 100 + 273.15;\t\t\t#[T] - Initial temperature\n",
+ "P_2 = 12;\t\t\t#[bar] - Final pressure\n",
+ "P_2 = P_2*10**(5);\t\t\t#[Pa]\n",
+ "T_2 = 500 + 273.15;\t\t\t#[K] - Final temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Y = 1.126;\t\t\t# Index of expansion\n",
+ "Cp_0 = (R*Y)/(Y-1);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# For propane\n",
+ "Tc = 369.8;\t\t\t#[K]\n",
+ "Pc = 42.48;\t\t\t#[bar]\n",
+ "Pc = Pc*10**(5);\n",
+ "w = 0.152;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(1)\n",
+ "# For van der Walls equation of state\n",
+ "a = (27*R**(2)*Tc**(2))/(64*Pc);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The cubic form of van der Walls equation of state is given by,\n",
+ "# V**(3) - (b + (R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "\n",
+ "# At state 1 (100 C and 6 bar) \n",
+ "def f(V): \n",
+ "\t return V**(3)-(b+(R*T_1)/P_1)*V**(2)+(a/P_1)*V-(a*b)/P_1\n",
+ "V_1_1 = fsolve(f,1)\n",
+ "V_1_2 = fsolve(f,10)\n",
+ "V_1_3 = fsolve(f,100)\n",
+ "# The largest root is considered because of molar volume of vapour phase is to determined\n",
+ "V_1 = V_1_1;\t\t\t#[m**(3)/mol]\n",
+ "# Thus compressibility factor is\n",
+ "Z_1 = (P_1*V_1)/(R*T_1);\t\t\t#compressibility factor\n",
+ "\n",
+ "H_R_1 = (Z_1 - 1)*R*T_1 - (a/V_1);\t\t\t# [J/mol]\n",
+ "S_R_1 = R*math.log((P_1*(V_1-b))/(R*T_1));\t\t\t# [J/mol-K]\n",
+ "\n",
+ "# At state 2 (500 C and 12 bar) \n",
+ "def f1(V): \n",
+ " return V**(3)-(b+(R*T_2)/P_2)*V**(2)+(a/P_2)*V-(a*b)/P_2\n",
+ "V_2_1 = fsolve(f1,1)\n",
+ "V_2_2 = fsolve(f1,10)\n",
+ "V_2_3 = fsolve(f1,100)\n",
+ "# The largest root is considered because of molar volume of vapour phase is to determined\n",
+ "V_2 = V_2_1;\t\t\t#[m**(3)/mol]\n",
+ "# Thus compressibility factor is\n",
+ "Z_2 = (P_2*V_2)/(R*T_2);\t\t\t#compressibility factor\n",
+ "\n",
+ "H_R_2 = (Z_2 - 1)*R*T_2 - (a/V_2);\t\t\t# [J/mol]\n",
+ "S_R_2 = R*math.log((P_2*(V_2-b))/(R*T_2));\t\t\t# [J/mol-K]\n",
+ "\n",
+ "# Ideal gas entropy change is given by\n",
+ "delta_S_ig = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1);\t\t\t#[J/mol-K]\n",
+ "# Entropy change is given by\n",
+ "delta_S = delta_S_ig + (S_R_2 - S_R_1);\t\t\t#[J/mol-k]\n",
+ "\n",
+ "# Ideal gas enthalpy change is given by\n",
+ "delta_H_ig = Cp_0*(T_2 - T_1);\t\t\t#[J/mol]\n",
+ "# Enthalpy change is given by\n",
+ "delta_H = delta_H_ig + (H_R_2 - H_R_1);\t\t\t#[J/mol]\n",
+ "\n",
+ "print \"1).The change in enthalpy is %f J/mol\"%(delta_H);\n",
+ "print \" The change in entropy is %f J/mol-K\"%(delta_S);\n",
+ "\n",
+ "#(2)\n",
+ "# Virial equation of state\n",
+ "\n",
+ "# At state 1 (372.15 K, 6 bar) let us calculate B and dB/dT\n",
+ "Tr = T_1/Tc;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "dB0_dT = 0.422*1.6*Tc**(1.6)*T_1**(-2.6);\t\t\t# (dB_0/dT) at state 1\n",
+ "dB1_dT = 0.172*4.2*Tc**(4.2)*T_1**(-5.2);\t\t\t# (dB_1/dT) at state 1\n",
+ "dB_dT = ((R*Tc)/Pc)*((dB0_dT) + w*(dB1_dT));\t\t\t# (dB/dT) at state 1\n",
+ "\n",
+ "H_R_1_2 = B*P_1 - P_1*T_1*dB_dT;\t\t\t#[J/mol] - Residual enthalpy at state 1\n",
+ "S_R_1_2 = -P_1*(dB_dT);\t\t\t#[J/mol-K] - Residual entropy at state 1\n",
+ "\n",
+ "# At state 2 (773.15 K, 12 bar)\n",
+ "Tr_2 = T_2/Tc;\t\t\t# Reduced temperature\n",
+ "B_0_2 = 0.083-(0.422/(Tr_2)**(1.6));\n",
+ "B_1_2 = 0.139-(0.172/(Tr_2)**(4.2));\n",
+ "\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B_2 = ((B_0_2+(w*B_1_2))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "dB0_dT_2 = 0.422*1.6*Tc**(1.6)*T_2**(-2.6);\t\t\t# (dB_0/dT) at state 1\n",
+ "dB1_dT_2 = 0.172*4.2*Tc**(4.2)*T_2**(-5.2);\t\t\t# (dB_1/dT) at state 1\n",
+ "dB_dT_2 = ((R*Tc)/Pc)*((dB0_dT_2) + w*(dB1_dT_2));\t\t\t# (dB/dT) at state 1\n",
+ "\n",
+ "H_R_2_2 = B_2*P_2 - P_2*T_2*dB_dT_2;\t\t\t#[J/mol] - Residual enthalpy at state 1\n",
+ "S_R_2_2 = -P_2*(dB_dT_2);\t\t\t#[J/mol-K] - Residual entropy at state 1\n",
+ "\n",
+ "delta_H_2 = delta_H_ig + (H_R_2_2 - H_R_1_2);\t\t\t#[J/mol]\n",
+ "delta_S_2 = delta_S_ig + (S_R_2_2 - S_R_1_2);\t\t\t#[J/mol]\n",
+ "\n",
+ "print \"2).The change in enthalpy is %f J/mol\"%(delta_H_2);\n",
+ "print \" The change in entropy is %f J/mol-K\"%(delta_S_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1).The change in enthalpy is 29798.211799 J/mol\n",
+ " The change in entropy is 48.649067 J/mol-K\n",
+ "2).The change in enthalpy is 29992.807365 J/mol\n",
+ " The change in entropy is 49.021724 J/mol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.21 Page Number : 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of fugacity\n",
+ "\n",
+ "# Variables\n",
+ "P = 2.76*10**(6);\t\t\t#[N/m**(2)] - Pressure\n",
+ "T = 310.93;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# For n-butane\n",
+ "Tc = 425.18;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 37.97;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.193;\n",
+ "den = 0.61;\t\t\t#[g/cm**(3)]\n",
+ "mol_wt = 58;\t\t\t#[g/mol] - Molecular weight of butane\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# math.log(P_sat) = 15.7374 - 2151.63/(T-36.24)\n",
+ "P_sat = math.exp(15.7374 - 2151.63/(T-36.24));\t\t\t#[mm Hg]\n",
+ "P_sat = (P_sat/760)*101325;\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "#(1)\n",
+ "# Let us determine the second virial coefficient at 310.93 K\n",
+ "Tr = T/Tc;\t\t\t# Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0 + (w*B_1)\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Fugacity under saturated conditions is given by\n",
+ "# math.log(f_sat/P_sat) = (B*P_sat)/(R*T)\n",
+ "f_sat = P_sat*(math.exp((B*P_sat)/(R*T)));\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "# The molar volume is given by\n",
+ "V_liq = (1/(den*1000))*(mol_wt/1000);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "f = f_sat*math.exp(V_liq*(P-P_sat)/(R*T));\n",
+ "\n",
+ "print \" 1).The fugacity of n-butane is %e N/m**2)\"%(f);\n",
+ "\n",
+ "#(2)\n",
+ "# For van der Walls equation of state\n",
+ "a = (27*R**(2)*Tc**(2))/(64*Pc);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The cubic form of van der Walls equation of state is given by,\n",
+ "# V**(3) - (b + (R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "\n",
+ "# At 100 C and 1 atm \n",
+ "def f(V): \n",
+ " return V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P\n",
+ "V_1 = fsolve(f,0.1)\n",
+ "V_1 = fsolve(f,10)\n",
+ "V_1 = fsolve(f,100)\n",
+ "# The above equation has only 1 real root, other two roots are imaginary\n",
+ "V = V_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# math.log(f/P) = math.log((R*T)/(P*(V-b))) + b/(V-b) -(2*a)/(R*T*V)\n",
+ "f_2 = P*(math.exp(math.log((R*T)/(P*(V-b))) + b/(V-b) -(2*a)/(R*T*V)));\n",
+ "\n",
+ "print \" 2).The fugacity of n-butane is %e N/m**2)\"%(f_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The fugacity of n-butane is 3.293476e+05 N/m**2)\n",
+ " 2).The fugacity of n-butane is 8.997352e+05 N/m**2)\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.22 Page Number : 363"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy change\n",
+ "\n",
+ "# Variables\n",
+ "T = 50+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 25.*10**(3);\t\t\t#[Pa] - Pressure\n",
+ "y1 = 0.5;\t\t\t#[mol] - mole fraction of equimolar mixture\n",
+ "y2 = 0.5;\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "#For component 1 (methyl ethyl ketone)\n",
+ "Tc_1 = 535.5;\t\t\t#[K] - Critical temperature\n",
+ "Pc_1 = 41.5*10**(5);\t\t\t#[N/m**(2)] - Critical pressure\n",
+ "Vc_1 = 267.;\t\t\t#[cm**(3)/mol] - Critical volume\n",
+ "Zc_1 = 0.249;\t\t\t# Critical compressibility factor\n",
+ "w_1 = 0.323;\t\t\t# acentric factor\n",
+ "\n",
+ "#For component 2 (toluene)\n",
+ "Tc_2 = 591.8;\t\t\t#[K]\n",
+ "Pc_2 = 41.06*10**(5);\t\t\t#[N/m**(2)]\n",
+ "Vc_2 = 316.;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_2 = 0.264;\n",
+ "w_2 = 0.262;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# For equation of state Z = 1 + B/V\n",
+ "#For component 1, let us calculate B and dB/dT\n",
+ "Tr_1 = T/Tc_1;\t\t\t#Reduced temperature\n",
+ "#At reduced temperature\n",
+ "B1_0 = 0.083-(0.422/(Tr_1)**(1.6));\n",
+ "B1_1 = 0.139-(0.172/(Tr_1)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_11 = ((B1_0+(w_1*B1_1))*(R*Tc_1))/Pc_1;\t\t\t# [m**(3)/mol-K] \n",
+ "dB0_dT_1 = 0.422*1.6*Tc_1**(1.6)*T**(-2.6);\t\t\t# [m**(3)/mol-K] - (dB_0/dT)\n",
+ "dB1_dT_1 = 0.172*4.2*Tc_1**(4.2)*T**(-5.2);\t\t\t# [m**(3)/mol-K] - (dB_1/dT)\n",
+ "dB_dT_1 = ((R*Tc_1)/Pc_1)*((dB0_dT_1) + w_1*(dB1_dT_1));\t\t\t#[m**(3)/mol-K] - (dB/dT)_\n",
+ "\n",
+ "#Similarly for component 2\n",
+ "Tr_2 = T/Tc_2;\t\t\t#Reduced temperature\n",
+ "#At reduced temperature Tr_2,\n",
+ "B2_0 = 0.083 - (0.422/(Tr_2)**(1.6));\n",
+ "B2_1 = 0.139 - (0.172/(Tr_2)**(4.2));\n",
+ "B_22 = ((B2_0+(w_2*B2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "dB0_dT_2 = 0.422*1.6*Tc_2**(1.6)*T**(-2.6);\t\t\t# [m**(3)/mol-K] - (dB_0/dT)\n",
+ "dB1_dT_2 = 0.172*4.2*Tc_2**(4.2)*T**(-5.2);\t\t\t# [m**(3)/mol-K] - (dB_1/dT)\n",
+ "dB_dT_2 = ((R*Tc_2)/Pc_2)*((dB0_dT_2) + w_2*(dB1_dT_2));\t\t\t#[m**(3)/mol-K] - (dB/dT)_\n",
+ "\n",
+ "#For cross coeffcient, let us calculate B and dB/dT\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1./2);\t\t\t#[K]\n",
+ "w_12 = (w_1 + w_2)/2.;\n",
+ "Zc_12 = (Zc_1 + Zc_2)/2;\n",
+ "Vc_12 = (((Vc_1)**(1./3) + (Vc_2)**(1./3))/2)**(3);\t\t\t#[cm**(3)/mol]\n",
+ "Vc_12 = Vc_12*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "Pc_12 = (Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "#Now we have,(B_12*Pc_12)/(R*Tc_12) = B_0+(w_12*B_1)\n",
+ "#where B_0 and B_1 are to be evaluated at Tr_12\n",
+ "Tr_12 = T/Tc_12;\n",
+ "#At reduced temperature Tr_12\n",
+ "B_0 = 0.083 - (0.422/(Tr_12)**(1.6));\n",
+ "B_1 = 0.139 - (0.172/(Tr_12)**(4.2));\n",
+ "B_12 = ((B_0 + (w_12*B_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "dB0_dT_12 = 0.422*1.6*Tc_12**(1.6)*T**(-2.6);\t\t\t# [m**(3)/mol-K] - (dB_0/dT)\n",
+ "dB1_dT_12 = 0.172*4.2*Tc_12**(4.2)*T**(-5.2);\t\t\t# [m**(3)/mol-K] - (dB_1/dT)\n",
+ "dB_dT_12 = ((R*Tc_12)/Pc_12)*((dB0_dT_12) + w_12*(dB1_dT_12));\t\t\t#[m**(3)/mol-K] - (dB/dT)_12\n",
+ "\n",
+ "#For the mixture\n",
+ "B = y1**(2)*B_11 + 2*y1*y2*B_12 + y2**(2)*B_22;\t\t\t#[m**(3)/moL]\n",
+ "\n",
+ "# The equation of state can be written as\n",
+ "# V**(2) - ((R*T)/P) - (B*R*T)/P = 0\n",
+ "# V**(2) - 0.1075*V + 1.737*10**(-4) = 0\n",
+ "def f(V): \n",
+ " return V**(2) - 0.1075*V + 1.737*10**(-4)\n",
+ "V1 = fsolve(f,0.1)\n",
+ "V2 = fsolve(f,1)\n",
+ "# We will consider the root which is near to R*T/P\n",
+ "V = V1;\n",
+ "# dB/dT = y_1**(2)*dB_11/dT + y_2**(2)*dB_22/dT + 2*y_1*y_2*dB_12/dT\n",
+ "dB_dT = y1**(2)*dB_dT_1 + y2**(2)*dB_dT_2 + 2*y1*y2*dB_dT_12;\t\t\t#[m**(3)/mol-K]\n",
+ "\n",
+ "# For equation of state Z = 1 + B/V\n",
+ "H_R = (B*R*T)/V - ((R*T**(2))/V)*dB_dT;\t\t\t#[J/mol]\n",
+ "\n",
+ "print \" 1).The value of H_R for the mixture using virial equation of state is %f J/mol\"%(H_R);\n",
+ "\n",
+ "#(2)\n",
+ "# For van der Walls equation of state \n",
+ "a_11 = (27*R**(2)*Tc_1**(2))/(64*Pc_1);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "a_22 = (27*R**(2)*Tc_2**(2))/(64*Pc_2);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "a_12 = (a_11*a_22)**(1./2);\n",
+ "b_1 = (R*Tc_1)/(8*Pc_1);\t\t\t#[m**(3)/mol]\n",
+ "b_2 = (R*Tc_2)/(8*Pc_2);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# For the mixture\n",
+ "a = y1**(2)*a_11 + y2**(2)*a_22 + 2*y1*y2*a_12;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = y1*b_1 + y2*b_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# From the cubic form of van der Walls equation of state\n",
+ "def f1(V): \n",
+ " return V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P\n",
+ "V2_1 = fsolve(f1,0.1)\n",
+ "V2_2 = fsolve(f1,10)\n",
+ "V2_3 = fsolve(f1,100)\n",
+ "# The largest root is considered\n",
+ "V_2 = V2_1;\n",
+ "\n",
+ "# The residual enthalpy is given by\n",
+ "H_R_2 = P*V_2 - R*T -a/V_2;\t\t\t#[J/mol]\n",
+ "\n",
+ "print \" 2).The value of H_R for the mixture using van der Walls equation of state is %f J/mol\"%(H_R_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The value of H_R for the mixture using virial equation of state is -151.289795 J/mol\n",
+ " 2).The value of H_R for the mixture using van der Walls equation of state is -38.476127 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.23 Page Number : 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of fugacity of water vapour\n",
+ "\n",
+ "# Variables\n",
+ "T = 320 + 273.15;\t\t\t#[K]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# For water\n",
+ "Tc = 647.1;\t\t\t#[K]\n",
+ "Pc = 220.55;\t\t\t#[bar]\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "\n",
+ "# The cubic form of Redlich Kwong equation of state is given by,\n",
+ "# V**(3) - ((R*T)/P)*V**(2) - ((b_1**(2)) + ((b_1*R*T)/P) - (a/(T**(1/2)*P))*V - (a*b)/(T**(1/2)*P) = 0\n",
+ "\n",
+ "# At 320 C and 70 bar pressure\n",
+ "P_1 = 70;\t\t\t#[bar]\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "a = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "# Solving the cubic equation\n",
+ "def f1(V): \n",
+ " return V**(3)-((R*T)/P_1)*V**(2)-((b**(2))+((b*R*T)/P_1)-(a/(T**(1./2)*P_1)))*V-(a*b)/(T**(1./2)*P_1)\n",
+ "V1=fsolve(f1,1)\n",
+ "V2=fsolve(f1,10)\n",
+ "V3=fsolve(f1,100)\n",
+ "# The largest root is considered because at 320 C and 70 bar vapour phase exists.\n",
+ "V_1 = V1;\t\t\t#[m**(3)/mol]\n",
+ "# Thus compressibility factor is\n",
+ "Z_1 = (P_1*V_1)/(R*T);\n",
+ "\n",
+ "# For Redlich-Kwong equation of state\n",
+ "# math.log(f/P) = Z - 1 - math.log(V_1/(V_1-b)) + (a/(b*R*(T**(3/2))))*math.log(V/(V+b))\n",
+ "f_1 = P_1*(math.exp(Z_1-1-math.log(Z_1)+math.log(V_1/(V_1-b))+(a/(b*R*(T**(3./2))))*math.log(V_1/(V_1+b))));\t\t\t#[Pa]\n",
+ "f_1 = f_1*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "print \" The fugacity of water vapour at 320 C and 70 bar pressure is %f bar\"%(f_1);\n",
+ "\n",
+ "# At 320 C and 170 bar pressure, we have\n",
+ "P_2 = 170;\t\t\t#[bar]\n",
+ "P_2 = P_2*10**(5);\t\t\t#[Pa]\n",
+ "\n",
+ "# Solving the cubic equation\n",
+ "def f2(V): \n",
+ " return V**(3)-((R*T)/P_2)*V**(2)-((b**(2))+((b*R*T)/P_2)-(a/(T**(1./2)*P_2)))*V-(a*b)/(T**(1./2)*P_2)\n",
+ "V4 = fsolve(f2,1)\n",
+ "V5 = fsolve(f2,10)\n",
+ "V6 = fsolve(f2,100)\n",
+ "# The above equation has only 1 real root,other two roots are imaginary. Therefore,\n",
+ "V_2 = V6;\t\t\t#[m**(3)/mol]\n",
+ "# Thus compressibility factor is\n",
+ "Z_2 = (P_2*V_2)/(R*T);\n",
+ "\n",
+ "# For Redlich-Kwong equation of state\n",
+ "# math.log(f/P) = Z - 1 - math.log(V_1/(V_1-b)) + (a/(b*R*(T**(3/2))))*math.log(V/(V+b))\n",
+ "f_2 = P_2*(math.exp(Z_2-1-math.log(Z_2)+math.log(V_2/(V_2-b))+(a/(b*R*(T**(3./2))))*math.log(V_2/(V_2+b))));\t\t\t#[Pa]\n",
+ "f_2 = f_2*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "print \" The fugacity of water vapour at 320 C and 170 bar pressure is %f bar\"%(f_2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The fugacity of water vapour at 320 C and 70 bar pressure is 60.456239 bar\n",
+ " The fugacity of water vapour at 320 C and 170 bar pressure is 101.590989 bar\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.24 Page Number : 367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of change in internal energy\n",
+ "\n",
+ "# Variables\n",
+ "Vol = 0.057;\t\t\t#[m**(3)] - Volume of car tyre\n",
+ "P_1 = 300.;\t\t\t#[kPa] - Initial pressure\n",
+ "P_1 = P_1*10**(3);\t\t\t#[Pa]\n",
+ "T_1 = 300.;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 330.;\t\t\t#[kPa] - Finnal pressure\n",
+ "P_2 = P_2*10**(3);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Cv_0 = 21.;\t\t\t#[J/mol-K] - Heat capacity for air \n",
+ "\n",
+ "# For oxygen\n",
+ "Tc_O2 = 154.6;\t\t\t#[K] - Critical temperature\n",
+ "Pc_O2 = 50.43;\t\t\t#[bar] - Critical pressure\n",
+ "Pc_O2 = Pc_O2*10**(5);\t\t\t#[Pa]\n",
+ "y1 = 0.21;\t\t\t# - Mole fraction of oxygen\n",
+ "# For nitrogen\n",
+ "Tc_N2 = 126.2;\t\t\t#[K] - Critical temperature\n",
+ "Pc_N2 = 34.00;\t\t\t#[bar] - Critical pressure\n",
+ "Pc_N2 = Pc_N2*10**(5);\t\t\t#[Pa]\n",
+ "y2 = 0.79;\t\t\t# - Mole fraction of nitrogen\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# (1)\n",
+ "# Assuming ideal gas behaviour. The volume remains the same,therefore,we get\n",
+ "# P_1/T_1 = P_2/T_2\n",
+ "T_2 = P_2*(T_1/P_1);\t\t\t#[K]\n",
+ "\n",
+ "n = (P_1*Vol)/(R*T_1);\t\t\t#[mol] - Number of moles\n",
+ "delta_U = n*Cv_0*(T_2-T_1);\t\t\t#[J]\n",
+ "\n",
+ "print \" 1).The change in internal energy for ideal gas behaviour) is %f J\"%(delta_U);\n",
+ "\n",
+ "#(2)\n",
+ "# For van der Walls equation of state \n",
+ "a_O2 = (27*R**(2)*Tc_O2**(2))/(64*Pc_O2);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "a_N2 = (27*R**(2)*Tc_N2**(2))/(64*Pc_N2);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "a_12 = (a_O2*a_N2)**(1./2);\n",
+ "b_O2 = (R*Tc_O2)/(8*Pc_O2);\t\t\t#[m**(3)/mol]\n",
+ "b_N2 = (R*Tc_N2)/(8*Pc_N2);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# For the mixture\n",
+ "a = y1**(2)*a_O2 + y2**(2)*a_N2 + 2*y1*y2*a_12;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = y1*b_O2 + y2*b_N2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# From the cubic form of van der Walls equation of state\n",
+ "# At 300 K and 300 kPa,\n",
+ "def f1(V): \n",
+ " return V**(3)-(b+(R*T_1)/P_1)*V**(2)+(a/P_1)*V-(a*b)/P_1\n",
+ "V_1 = fsolve(f1,0.1)\n",
+ "V_2 = fsolve(f1,10)\n",
+ "V_3 = fsolve(f1,100)\n",
+ "# The above equation has only 1 real root, other two roots are imaginary\n",
+ "V = V_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Now at P = 330 kPa and at molar volume V\n",
+ "# The van der Walls equation of state is\n",
+ "# (P + a/V**(2))*(V - b) = R*T\n",
+ "T_2_prime = ((P_2 + a/V**(2))*(V - b))/R;\t\t\t#[K]\n",
+ "n_prime = Vol/V;\t\t\t#[mol]\n",
+ "\n",
+ "# Total change in internal energy is given by\n",
+ "# delta_U_prime = n_prime*delta_U_ig + n_prime*(U_R_2 - U_R_1)\n",
+ "# delta_U_prime = n_prime*Cv_0*(T_2_prime - T_1) + n_prime*a(1/V_2 - 1/V_1);\n",
+ "# Since V_1 = V_2 = V, therefore\n",
+ "delta_U_prime = n_prime*Cv_0*(T_2_prime - T_1);\n",
+ "\n",
+ "print \" 2).The change in internal energy for van der Walls equation of state) is %f J\"%(delta_U_prime);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The change in internal energy for ideal gas behaviour) is 4319.220592 J\n",
+ " 2).The change in internal energy for van der Walls equation of state) is 4299.872282 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.25 Page Number : 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy and entropy change\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 150 + 273.15;\t\t\t#[K] - Initial emperature\n",
+ "T_2 = T_1;\t\t\t# Isothermal process\n",
+ "P_1 = 100.*10**(3);\t\t\t#[Pa] - Initial pressure\n",
+ "P_2 = 450.*10**(3);\t\t\t#[Pa] - Final pressure\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "# For water\n",
+ "Tc = 647.1;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 220.55;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10.**(5);\n",
+ "w = 0.345;\n",
+ "Mol_wt = 18.015;\t\t\t#[g/mol] - Molecular weight of water\n",
+ "Cp_0 = 4.18;\t\t\t#[J/mol-K] - Smath.tan(math.radiansard heat capacity of water\n",
+ "\n",
+ "# Calculations\n",
+ "# Both phases are superheated vapour phases because at 150 C the vapour pressure of steam is 4.67 bar and both operating pressures are below saturated pressure.\n",
+ "# In Peng-Robinson equation of state\n",
+ "m = 0.37464 + 1.54226*w - 0.26992*w**(2);\n",
+ "# At T_1 and P_1, we have\n",
+ "Tr = T_1/Tc;\n",
+ "alpha = (1 + m*(1 - Tr**(1./2)))**(2);\n",
+ "a = ((0.45724*(R*Tc)**(2))/Pc)*alpha;\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (0.07780*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Cubuc form of Peng-Robinson equation of stste is given by\n",
+ "# V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2))/P)-((a*b)/P)=0;\n",
+ "# Solving the cubic equation\n",
+ "def f(V): \n",
+ " return V**(3)+(b-(R*T_1)/P_1)*V**(2)-((3*b**(2))+((2*R*T_1*b)/P_1)-(a/P_1))*V+b**(3)+((R*T_1*(b**(2)))/P_1)-((a*b)/P_1)\n",
+ "V1 = fsolve(f,-1)\n",
+ "V2 = fsolve(f,0)\n",
+ "V3 = fsolve(f,1)\n",
+ "#The largest root is for vapour phase,\n",
+ "#The largest root is only considered as the systemis gas\n",
+ "V_1 = V3;\t\t\t#[m**(3)/mol]\n",
+ "# Thus compressibility factor is\n",
+ "Z_1 = (P_1*V_1)/(R*T_1);\n",
+ "\n",
+ "# At T_2 and P_2, we have\n",
+ "# Cubuc form of Peng-Robinson equation of stste is given by\n",
+ "# V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2))/P)-((a*b)/P)=0;\n",
+ "# Solving the cubic equation\n",
+ "def f1(V): \n",
+ " return V**(3)+(b-(R*T_2)/P_2)*V**(2)-((3*b**(2))+((2*R*T_2*b)/P_2)-(a/P_2))*V+b**(3)+((R*T_2*(b**(2)))/P_2)-((a*b)/P_2)\n",
+ "V4 = fsolve(f1,-1)\n",
+ "V5 = fsolve(f1,0)\n",
+ "V6 = fsolve(f1,1)\n",
+ "#The largest root is for vapour phase,\n",
+ "#The largest root is only considered as the systemis gas\n",
+ "V_2 = V6;\t\t\t#[m**(3)/mol]\n",
+ "# Thus compressibility factor is\n",
+ "Z_2 = (P_2*V_2)/(R*T_2);\n",
+ "\n",
+ "# In the Peng-Robinson equation of stste\n",
+ "# da/dT = -(a*m)/((alpha*T*Tc)**(1/2))\n",
+ "# The residual enthalpy is given by\n",
+ "# H_R = R*T*(Z-1) + (((T*(da_dT))-a)/(2*2**(1/2)*b))*math.log((Z+(1+2**(1/2)*((P*b)/(R*T))))/(Z+(1-2**(1/2)*((P*b)/(R*T)))))\n",
+ "\n",
+ "# At state 1\n",
+ "da_dT_1 = -(a*m)/((alpha*T_1*Tc)**(1./2));\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "H_R_1 = R*T_1*(Z_1-1) + (((T_1*(da_dT_1))-a)/(2*(2**(1./2))*b))* \\\n",
+ "math.log((Z_1+(1+2**(1./2))*((P_1*b)/(R*T_1)))/(Z_1+(1-2**(1./2))*((P_1*b)/(R*T_1))));\n",
+ "\n",
+ "# At state 2\n",
+ "da_dT_2 = -(a*m)/((alpha*T_2*Tc)**(1/2.));\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "H_R_2 = R*T_2*(Z_2-1) + (((T_2*(da_dT_2))-a)/(2*2**(1./2)* \\\n",
+ "b))*math.log((Z_2+(1+2**(1./2))*((P_2*b)/(R*T_1)))/(Z_2+(1-2**(1./2))*((P_2*b)/(R*T_1))));\n",
+ "\n",
+ "# Since the temperature is the same,therefore ideal gas change in enthalpy is zero and thus\n",
+ "delta_H = H_R_2 - H_R_1;\t\t\t#[J/mol]\n",
+ "delta_H = delta_H/Mol_wt;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# The residual entropy relation for a substance following Peng - Robinson equation of state ia\n",
+ "# S_R = R*math.log(Z - (P*b)/(R*T)) + (da_dT/(2*2**(1/2)*b))*math.log((Z+(1+2**(1/2))*((P*b)/(R*T)))/(Z+(1-2**(1/2))*((P*b)/(R*T))))\n",
+ "\n",
+ "# The residual entropy at state 1 is\n",
+ "S_R_1 = R*math.log(Z_1 - (P_1*b)/(R*T_1)) + (da_dT_1/(2*2**(1./2)*b))* \\\n",
+ "math.log((Z_1+(1+2**(1./2))*((P_1*b)/(R*T_1)))/(Z_1+(1-2**(1./2))*((P_1*b)/(R*T_1))));\n",
+ "\n",
+ "# The residual entropy at state 2 is\n",
+ "S_R_2 = R*math.log(Z_2 - (P_2*b)/(R*T_2)) + (da_dT_2/(2*2**(1./2)*b)) \\\n",
+ "*math.log((Z_2+(1+2**(1./2))*((P_2*b)/(R*T_2)))/(Z_2+(1-2**(1./2))*((P_2*b)/(R*T_2))));\n",
+ "\n",
+ "delta_S_R = S_R_2 - S_R_1;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# The ideal gas change in entropy is\n",
+ "delta_S_ig = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Therefore\n",
+ "delta_S = delta_S_R + delta_S_ig;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Results\n",
+ "print \" The enthalpy change is given by delta_H = %f kJ/mol\"%(delta_H);\n",
+ "print \" The entropy change is given by delta_S = %f J/mol-K\"%(delta_S);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The enthalpy change is given by delta_H = -11.747722 kJ/mol\n",
+ " The entropy change is given by delta_S = -12.826050 J/mol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.26 Page Number : 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature and pressure\n",
+ "\n",
+ "# Variables\n",
+ "Vol = 0.15;\t\t\t#[m**(3)]\n",
+ "T_1 = 170;\t\t\t#[K] - Initial emperature\n",
+ "P_1 = 100;\t\t\t#[bar] - Initial pressure\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "# For nitrogen\n",
+ "Tc = 126.2;\t\t\t#[K] - Critical tempeature\n",
+ "Pc = 34;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.038;\n",
+ "# Cp_0 = 27.2+4.2*10**(-3)*T\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(1)\n",
+ "# For van der Walls equation of state\n",
+ "a = (27*R**(2)*Tc**(2))/(64*Pc);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The cubic form of van der Walls equation of state is given by,\n",
+ "# V**(3) - (b + (R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "# On simplification the equation changes to\n",
+ "# V**(3) - 1.799*10**(4)*V**(2) + 1.366*10**(-8)*V - 5.269*10**(-13) = 0\n",
+ "\n",
+ "# Solving the cubic equation \n",
+ "def f(V): \n",
+ " return V**(3)-1.799*10**(-4)*V**(2) + 1.366*10**(-8)*V - 5.269*10**(-13)\n",
+ "V1 = fsolve(f,1)\n",
+ "V2 = fsolve(f,10)\n",
+ "V3 = fsolve(f,100)\n",
+ "# The above equation has only 1 real root, other two roots are imagimnary\n",
+ "V_1 = V1;\t\t\t#[m**(3)/mol]\n",
+ "# Thus total number of moles is given by\n",
+ "n_1 = Vol/V_1;\t\t\t#[mol]\n",
+ "\n",
+ "# After 500 mol are withdrawn, the final number of moles is given by\n",
+ "n_2 = n_1 - 500;\t\t\t#[mol]\n",
+ "# Thus molar volume at final state is \n",
+ "V_2 = Vol/n_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The ideal entropy change is guven by\n",
+ "\n",
+ "def f24(T): \n",
+ " return 27.2+4.2*10**(-3)*T\n",
+ "\n",
+ "# delta_S_ig = quad(f24,T_1,T_2) - R*math.log(P_2/P_1)[0]\n",
+ "\n",
+ "# The residual entropy change is given by\n",
+ "# delta_S_R = R*math.log((P_2*(V_2-b))/(R*T_2)) - R*math.log((P_1*(V_1-b))/(R*T_1)) \n",
+ "# delta_S = delta_S_ig = delta_S_R\n",
+ "\n",
+ "def f25(T): \n",
+ " return 27.2+4.2*10**(-3)*T\n",
+ "\n",
+ "# delta_S = quad(f25,T_1,T_2) + R*math.log((V_2-b)/(V_1-b))[0]\n",
+ "\n",
+ "# During discharging delta_S = 0, thus on simplification we get\n",
+ "# 18.886*math.log(T_2) + 4.2*10**(-3)*T_2 - 92.937 = 0\n",
+ "# Solving the above equation we get\n",
+ "def f1(T_2): \n",
+ " return 18.886*math.log(T_2) + 4.2*10**(-3)*T_2 - 92.937\n",
+ "T_2 = fsolve(f1,1)\n",
+ "\n",
+ "# Thus at T_2, \n",
+ "P_2 = (R*T_2)/(V_2-b) - a/V_2**(2);\t\t\t#[N/m**(2)]\n",
+ "P_2 = P_2*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "print \" 1).The final temperature is %f K\"%(T_2);\n",
+ "print \" The final pressure is %f bar\"%(P_2);\n",
+ "\n",
+ "#(2)\n",
+ "# In Peng-Robinson equation of state\n",
+ "m = 0.37464 + 1.54226*w - 0.26992*w**(2);\n",
+ "# At T_1 and P_1, we have\n",
+ "Tr = T_1/Tc;\n",
+ "alpha = (1 + m*(1 - Tr**(1./2)))**(2);\n",
+ "a_2 = ((0.45724*(R*Tc)**(2))/Pc)*alpha;\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b_2 = (0.07780*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Cubuc form of Peng-Robinson equation of stste is given by\n",
+ "# V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2))/P)-((a*b)/P)=0;\n",
+ "# Solving the cubic equation\n",
+ "def f2(V): \n",
+ " return V**(3)+(b_2-(R*T_1)/P_1)*V**(2)-((3*b_2**(2))+((2*R*T_1*b_2)/P_1)-(a_2/P_1))*V+b_2**(3)+((R*T_1*(b_2**(2)))/P_1)-((a_2*b_2)/P_1)\n",
+ "V4 = fsolve(f2,-1)\n",
+ "V5 = fsolve(f2,0)\n",
+ "V6 = fsolve(f2,0.006)\n",
+ "#The above equation has only 1 real root,the other two roots are imaginary\n",
+ "V_1_2 = V6;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The number of moles in the initial state is given by\n",
+ "n_1_2 = Vol/V_1_2;\t\t\t#[mol]\n",
+ "# After 500 mol are withdrawn, the final number of moles is given by\n",
+ "n_2_2 = n_1_2 - 500;\t\t\t#[mol]\n",
+ "# Thus molar volume at final state is \n",
+ "V_2_2 = Vol/n_2_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# At the final state the relation between pressure and temperature is\n",
+ "# P_2_2 = (R*T_2_2)/(V_2_2-b_2) - a_2/V_2_2**(2)\n",
+ "# P_2_2 = 7.23*10**(4)*T_2 - 3.93*10**(7)*a_2\n",
+ "\n",
+ "# Now let us calculate the residual entropy at initial state\n",
+ "Z_1 = (P_1*V_1_2)/(R*T_1);\n",
+ "da_dT_1 = -(a*m)/((alpha*T_1*Tc)**(1./2));\t\t\t#[Pa*m**(6)/mol**(2)] - da/dT\n",
+ "\n",
+ "# The residual entropy change for Peng-Robinson equatiob of state is given by\n",
+ "# S_R = R*math.log(Z-(P*b)/(R*T)) + (da_dT/(2*2**(1/2)*b))*math.log((V+(1+2**(1/2))*b))/((V+(1-2**(1/2)*b))));\n",
+ "S_R_1 = R*(math.log(Z_1-(P_1*b_2)/(R*T_1))) + (da_dT_1/(2*2**(1.2)*b_2))*(math.log((V_1_2+(1+2**(1./2))*b_2)/(V_1_2+(1-2**(1./2))*b_2)));\n",
+ "\n",
+ "# The total entropy change is given by\n",
+ "# delta_S = delta_S_ig + delta_S_R\n",
+ "\n",
+ "def f26(T): \n",
+ " return 27.2+4.2*10**(-3)*T\n",
+ "\n",
+ "# where, delta_S_ig = quad(f26,T_1,T_2_2) - R*math.log(P_2_2/P_1)[0]\n",
+ "\n",
+ "# and, P_2_2 = (R*T_2_2)/(V_2_2-b_2) - a_2/V_2_2**(2)\n",
+ "# On simplification we get\n",
+ "# delta_S = 27.2*math.log(T_2_2-T_1) + 4.2*10**(-3)*(T_2_2-T_1) - R*math.log(P_2_2/P_1) + R*math.log(Z_2-(P_2_2*b)/(R*T_2_2)) + 6226*(da_dT_2) + 9.22\n",
+ "\n",
+ "# Now we have the determine the value of T_2_2 such that delta_S = 0\n",
+ "# Starting with a temperature of 150 K\n",
+ "T_prime = 100.;\t\t\t#[K]\n",
+ "error = 10.;\n",
+ "while(error>0.1):\n",
+ " Tr_prime = T_prime/Tc;\n",
+ " alpha_prime = (1 + m*(1 - Tr_prime**(1./2)))**(2);\n",
+ " a_prime = ((0.45724*(R*Tc)**(2))/Pc)*alpha_prime;\n",
+ " P_prime = 7.23*10**(4)*T_prime - 3.93*10**(7)*a_prime;\n",
+ " Z_prime = (P_prime*V_2_2)/(R*T_prime);\n",
+ " da_dT_prime = -(a_prime*m)/((alpha_prime*T_prime*Tc)**(1./2));\n",
+ " delta_S = 27.2*math.log(T_prime/T_1) + 4.2*10**(-3)*(T_prime-T_1) - R*math.log(P_prime/P_1) + R*math.log(Z_prime-((P_prime*b_2)/(R*T_prime))) + 6226*(da_dT_prime) + 9.22;\n",
+ " error=abs(delta_S);\n",
+ " T_prime = T_prime + 0.3;\n",
+ "\n",
+ "T_2_2 = T_prime;\t\t\t#[K] - Final temperature\n",
+ "P_2_2 = P_prime*10**(-5);\t\t\t#[bar] - Final pressure\n",
+ "\n",
+ "print \" 2).The final temperature is %f K\"%(T_2_2);\n",
+ "print \" The final pressure is %f bar\"%(P_2_2);\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The final temperature is 133.131844 K\n",
+ " The final pressure is 39.636659 bar\n",
+ " 2).The final temperature is 134.200000 K\n",
+ " The final pressure is 40.130674 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.27 Page Number : 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of vapour pressure\n",
+ "\n",
+ "# Variables\n",
+ "T = 373.15;\t\t\t#[K]\n",
+ "Tc = 562.16;\t\t\t#[K]\n",
+ "Pc = 48.98;\t\t\t#[bar]\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "\n",
+ "# The cubic form of Redlich Kwong equation of state is given by,\n",
+ "# V**(3) - ((R*T)/P)*V**(2) - ((b_1**(2)) + ((b_1*R*T)/P) - (a/(T**(1/2)*P))*V - (a*b)/(T**(1/2)*P) = 0\n",
+ "\n",
+ "# Calculations\n",
+ "a = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# At 373.15 K, let us assume the pressure to be 2.5 bar and under these conditions \n",
+ "P_1 = 2.5;\t\t\t#[bar]\n",
+ "P_1 = P_1*10**(5);\t\t\t#[bar]\n",
+ "\n",
+ "# Putting the values in Redlich Kwong equation of state, the equation becomes\n",
+ "# V**(3) - 0.0124*V**(2) + 8.326*10**(-6)*V - 7.74*10**(-10) = 0\n",
+ "# Solving the cubic equation\n",
+ "\n",
+ "def f(V): \n",
+ " return V**(3) - 0.0124*V**(2) + 8.326*10**(-6)*V - 7.74*10**(-10)\n",
+ "V1=fsolve(f,-9)\n",
+ "V2=fsolve(f,10)\n",
+ "V3=fsolve(f,0.1)\n",
+ "# The largest root and the smallest root is considered for liquid phase and vapour phase respectively.\n",
+ "V_liq = V1;\t\t\t#[m**(3)/mol] - Molar volume in liquid phase\n",
+ "V_vap = V3;\t\t\t#[m**(3)/mol] - Molar volume in vapour phase\n",
+ "\n",
+ "# Let us calculate the fugacity of vapour phase\n",
+ "# math.log(f_vap/P) = b/(V-b) + math.log((R*T)/(P*(V-b))) - (a/(R*T**(1.5)))*(1/(V+b) - (1/b)*math.log(V/(V+b)))\n",
+ "f_vap = P_1*math.exp(b/(V_vap-b) + math.log((R*T)/(P_1*(V_vap-b))) - (a/(R*T**(1.5)))*(1/(V_vap+b) - (1/b)*math.log(V_vap/(V_vap+b))));\t\t\t#[Pa]\n",
+ "\n",
+ "# Let us calculate the fugacity of the liquid phase\n",
+ "f_liq = P_1*math.exp(b/(V_liq-b) + math.log((R*T)/(P_1*(V_liq-b))) - (a/(R*T**(1.5)))*(1/(V_liq+b) - (1/b)*math.log(V_liq/(V_liq+b))));\n",
+ "\n",
+ "\n",
+ "# The two fugacities are not same; therefore another pressure is to be assumed. The new pressure is\n",
+ "P_new = P_1*(f_liq/f_vap);\t\t\t#[Pa]\n",
+ "\n",
+ "# At P_new\n",
+ "def f1(V): \n",
+ " return V**(3) - ((R*T)/P_new)*V**(2) - (b**(2) + ((b*R*T)/P_new) - a/(T**(1/2)*P_new))*V - (a*b)/(T**(1/2)*P_new)\n",
+ "V4=fsolve(f1,-9)\n",
+ "V5=fsolve(f1,10)\n",
+ "V6=fsolve(f1,0.1)\n",
+ "# The largest root and the smallest root is considered for liquid phase and vapour phase respectively.\n",
+ "V_liq_2 = V4;\t\t\t#[m**(3)/mol] - Molar volume in liquid phase\n",
+ "V_vap_2 = V6;\t\t\t#[m**(3)/mol] - Molar volume in vapour phase\n",
+ "\n",
+ "f_vap_prime = P_new*math.exp(b/(V_vap_2-b) + math.log((R*T)/(P_new*(V_vap_2-b))) - (a/(R*T**(1.5)))*(1/(V_vap_2+b) - (1/b)*math.log(V_vap_2/(V_vap_2+b))));\t\t\t#[Pa]\n",
+ "f_liq_prime = P_new*math.exp(b/(V_liq_2-b) + math.log((R*T)/(P_new*(V_liq_2-b))) - (a/(R*T**(1.5)))*(1/(V_liq_2+b) - (1/b)*math.log(V_liq_2/(V_liq_2+b))));\n",
+ "\n",
+ "# Since the fugacities of liquid and vapour phasesare almost same the assumed pressure may be taken as vapour pressure at 373.15 K\n",
+ "P_new = P_new*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "# Results\n",
+ "print \" The vapour pressure of benzene using Redlich Kwong equation of state is %f bar\"%(P_new);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The vapour pressure of benzene using Redlich Kwong equation of state is 2.666995 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.28 Page Number : 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of vapour pressure\n",
+ "\n",
+ "# Variables\n",
+ "T = 150 + 273.15;\t\t\t#[K]\n",
+ "Tc = 647.1;\t\t\t#[K]\n",
+ "Pc = 220.55;\t\t\t#[bar]\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "w = 0.345;\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "\n",
+ "# Let us assume a pressure of 100 kPa.\n",
+ "P_1 = 100.*10**(3);\t\t\t#[Pa]\n",
+ "\n",
+ "# Calculations\n",
+ "# At 100 kPa and 423.15 K, from Peng-Robinson equation of stste \n",
+ "m = 0.37464 + 1.54226*w - 0.26992*w**(2);\n",
+ "Tr = T/Tc;\n",
+ "alpha = (1 + m*(1 - Tr**(1./2)))**(2);\n",
+ "a = ((0.45724*(R*Tc)**(2))/Pc)*alpha;\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (0.07780*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "# Cubic form of Peng-Robinson equation of stste is given by\n",
+ "# V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2))/P)-((a*b)/P)=0;\n",
+ "# Solving the cubic equation\n",
+ "def f(V): \n",
+ " return V**(3)+(b-(R*T)/P_1)*V**(2)-((3*b**(2))+((2*R*T*b)/P_1)-(a/P_1))*V+b**(3)+((R*T*(b**(2)))/P_1)-((a*b)/P_1)\n",
+ "V1 = fsolve(f,-1)\n",
+ "V2 = fsolve(f,0)\n",
+ "V3 = fsolve(f,1)\n",
+ "# The largest root and the smallest root is considered for liquid phase and vapour phase respectively.\n",
+ "V_liq = V1;\t\t\t#[m**(3)/mol] - Molar volume in liquid phase\n",
+ "V_vap = V3;\t\t\t#[m**(3)/mol] - Molar volume in vapour phase\n",
+ "\n",
+ "# The compressibility factor is given by\n",
+ "Z_vap = (P_1*V_vap)/(R*T);\t\t\t# For liquid phase\n",
+ "Z_liq = (P_1*V_liq)/(R*T);\t\t\t# For vapour phase\n",
+ "\n",
+ "# The math.expression for fugacity of Peng Robinson equation is\n",
+ "# math.log(f/P) = (Z-1) - math.log(Z-((P*b)/(R*T))) - (a/(2*2**(1/2)*b*R*T))*math.log((Z+(1+2**(1/2))*((P*b)/(R*T)))/((Z+(1-2**(1/2))*((P*b)/(R*T)))\n",
+ "# For vapour phase\n",
+ "f_P_vap = math.exp((Z_vap-1) - math.log(Z_vap-((P_1*b)/(R*T))) - (a/(2*2**(1./2)*b*R*T))*math.log((Z_vap+(1+2**(1./2))*((P_1*b)/(R*T)))/(Z_vap+(1-2**(1./2))*((P_1*b)/(R*T)))));\n",
+ "# For liquid phase\n",
+ "f_P_liq = math.exp((Z_liq-1) - math.log(Z_liq-((P_1*b)/(R*T))) - (a/(2*2**(1./2)*b*R*T))*math.log((Z_liq+(1+2**(1./2))*((P_1*b)/(R*T)))/(Z_liq+(1-2**(1./2))*((P_1*b)/(R*T)))));\n",
+ "\n",
+ "# Therefore f_liq/f_vap can be calculated as\n",
+ "fL_fV = (f_P_liq/f_P_vap);\n",
+ "\n",
+ "# The two values (f/P)_vap and (f/P)_vap are not same [ (f_P_liq/f_P_vap) >1 ]; therefore another pressure is to be assumed. The new pressure be\n",
+ "P_new = P_1*(f_P_liq/f_P_vap);\t\t\t#[Pa]\n",
+ "\n",
+ "# At P_new and 423.15 K, from Peng-Robinson equation of stste \n",
+ "\n",
+ "# V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2))/P)-((a*b)/P)=0;\n",
+ "# Solving the cubic equation\n",
+ "def f(V): \n",
+ " return V**(3)+(b-(R*T)/P_new)*V**(2)-((3*b**(2))+((2*R*T*b)/P_new)-(a/P_new))*V+b**(3)+((R*T*(b**(2)))/P_new)-((a*b)/P_new)\n",
+ "V4 = fsolve(f,-1)\n",
+ "V5 = fsolve(f,0)\n",
+ "V6 = fsolve(f,1)\n",
+ "# The largest root and the smallest root is considered for liquid phase and vapour phase respectively.\n",
+ "V_liq_2 = V4;\t\t\t#[m**(3)/mol] - Molar volume in liquid phase\n",
+ "V_vap_2 = V6;\t\t\t#[m**(3)/mol] - Molar volume in vapour phase\n",
+ "\n",
+ "# The compressibility factor is given by\n",
+ "Z_vap_2 = (P_new*V_vap_2)/(R*T);\t\t\t# For liquid phase\n",
+ "Z_liq_2 = (P_new*V_liq_2)/(R*T);\t\t\t# For vapour phase\n",
+ "\n",
+ "# For vapour phase\n",
+ "f_P_vap_2 = math.exp((Z_vap_2-1) - math.log(Z_vap_2-((P_new*b)/(R*T))) - (a/(2*2**(1./2)*b*R*T))*math.log((Z_vap_2+(1+2**(1./2))*((P_new*b)/(R*T)))/(Z_vap_2+(1-2**(1./2))*((P_new*b)/(R*T)))));\n",
+ "# For liquid phase\n",
+ "f_P_liq_2 = math.exp((Z_liq_2-1) - math.log(Z_liq_2-((P_new*b)/(R*T))) - (a/(2*2**(1./2)*b*R*T))*math.log((Z_liq_2+(1+2**(1./2))*((P_new*b)/(R*T)))/(Z_liq_2+(1-2**(1./2))*((P_new*b)/(R*T)))));\n",
+ "\n",
+ "# Therefore f_liq/f_vap can be calculated as\n",
+ "fL_fV_2 = (f_P_liq_2/f_P_vap_2);\n",
+ "\n",
+ "# And new pressure is given by\n",
+ "P_new_prime = P_new*(f_P_liq_2/f_P_vap_2);\t\t\t#[Pa]\n",
+ "P_new_prime = P_new_prime*10**(-5);\n",
+ "\n",
+ "# Since the change in pressure is small, so we can take this to be the vapour pressure at 150 C\n",
+ "\n",
+ "# Results\n",
+ "print \" The vapour pressure of water using Peng-Robinson equation of stste is %f bar\"%(P_new_prime);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The vapour pressure of water using Peng-Robinson equation of stste is 4.675976 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch11_1.ipynb b/Chemical_Engineering_Thermodynamics/ch11_1.ipynb
new file mode 100644
index 00000000..fdf3f695
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch11_1.ipynb
@@ -0,0 +1,335 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : Properties of a Component in a Mixture"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1 Page Number : 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of volumes of ethanol and water\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "Vol_total = 3;\t\t\t#[m**(3)] - Total volume of solution\n",
+ "x_ethanol = 0.6;\t\t\t#Mole fraction of ethanol\n",
+ "x_water = 0.4;\t\t\t#Mole fraction of water\n",
+ "\n",
+ "# Calculations\n",
+ "#The partial molar volumes of the components in the mixture are\n",
+ "V_ethanol_bar = 57.5*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "V_water_bar = 16*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#The molar volumes of the pure components are\n",
+ "V_ethanol = 57.9*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "V_water = 18*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#The molar volume of the solution is\n",
+ "V_sol = x_ethanol*V_ethanol_bar + x_water*V_water_bar;\t\t\t#[m**(3)/mol]\n",
+ "#Total number of moles can be calculated as \n",
+ "n_total = Vol_total/V_sol;\t\t\t#[mol]\n",
+ "\n",
+ "#Moles of the components are\n",
+ "n_ethanol = n_total*x_ethanol;\t\t\t#[mol]\n",
+ "n_water = n_total*x_water;\t\t\t#[mol]\n",
+ "\n",
+ "#Finally the volume of the pure components required can be calculated as\n",
+ "Vol_ethanol = V_ethanol*n_ethanol;\n",
+ "Vol_water = V_water*n_water;\n",
+ "\n",
+ "# Results\n",
+ "print \"Required volume of ethanol is %f cubic metre\"%(Vol_ethanol);\n",
+ "print \"Required volume of water is %f cubic metre\"%(Vol_water);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required volume of ethanol is 2.548166 cubic metre\n",
+ "Required volume of water is 0.528117 cubic metre\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2 Page Number : 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Developing an expression\n",
+ "\n",
+ "# Variables\n",
+ "T = 25+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 1;\t\t\t#[atm]\n",
+ "#Component 1 = water\n",
+ "#component 2 = methanol\n",
+ "a = -3.2;\t\t\t#[cm**(3)/mol] - A constant\n",
+ "V2 = 40.7;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2 (methanol)\n",
+ "#V1_bar = 18.1 + a*x_2**(2)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#From Gibbs-Duhem equation at constant temperature and pressure we have\n",
+ "#x_1*dV1_bar + x_2*dV2_bar = 0\n",
+ "#dV2_bar = -(x_1/x_2)*dV1_bar = -(x_1/x_2)*a*2*x_2*dx_2 = -2*a*x_1*dx_2 = 2*a*x_1*dx_1\n",
+ "\n",
+ "#At x_1 = 0: x_2 = 1 and thus V2_bar = V2\n",
+ "#Integrating the above equation from x_1 = 0 to x_1 in the RHS, and from V2_bar = V2 to V2 in the LHS, we get\n",
+ "#V2_bar = V2 + a*x_1**(2) - Molar volume of component 2(methanol) in the mixture \n",
+ "\n",
+ "print \"The expression for the partial molar volume of methanol2 isV2_bar = V2 + a*x_1**2 [cm**3/mol]\";\n",
+ "\n",
+ "#At infinite dilution, x_2 approach 0 and thus x_1 approach 1, therefore\n",
+ "x_1 = 1;\t\t\t# Mole fraction of component 1(water) at infinite dilution\n",
+ "V2_bar_infinite = V2 + a*(x_1**(2));\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "print \"The partial molar volume of methanol at infinite dilution is %f cm**3/mol\"%(V2_bar_infinite);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The expression for the partial molar volume of methanol2 isV2_bar = V2 + a*x_1**2 [cm**3/mol]\n",
+ "The partial molar volume of methanol at infinite dilution is 37.500000 cm**3/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.4 Page Number : 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpies\n",
+ "\n",
+ "# Variables\n",
+ "#H = a*x_1 + b*x_2 +c*x_1*x_2\n",
+ "\n",
+ "#The values of the constants are\n",
+ "a = 15000;\t\t\t#[J/mol]\n",
+ "b = 20000;\t\t\t#[J/mol]\n",
+ "c = -2000;\t\t\t#[J/mol]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(1)\n",
+ "#Enthalpy of pure component 1 = H1 is obtained at x_2 = 0, thus \n",
+ "x_2 = 0;\n",
+ "x_1 = 1;\n",
+ "H1 = a*x_1 + b*x_2 +c*x_1*x_2;\t\t\t#[J/mol]\n",
+ "print \"a).The enthalpy of pure component 1 is %f J/mol\"%(H1);\n",
+ "\n",
+ "#Similarly for component 2,\n",
+ "#Enthalpy of pure component 2 = H2 is obtained at x_1 = 0, thus \n",
+ "x_1_prime = 0;\n",
+ "x_2_prime = 1;\n",
+ "H2 = a*x_1_prime + b*x_2_prime +c*x_1_prime*x_2_prime;\t\t\t#[J/mol]\n",
+ "print \" The enthalpy of pure component 2 is %f J/mol\"%(H2);\n",
+ "\n",
+ "#(b)\n",
+ "#This part involves proving a relation in which no mathematics and no calculations are involved.\n",
+ "#For prove refer to this example 11.4 on page number 387 of the book.\n",
+ "\n",
+ "#(c)\n",
+ "#From part (b), we have the relation\n",
+ "#H1_bar = a + c*(x_2**(2))\n",
+ "#H2_bar = b + c*(x_1**(2))\n",
+ "\n",
+ "#For enthalpy of component 1 at infinite dilution, x_1 approach 0 and thus x_2 approach 1, therefore\n",
+ "x_1_c = 0;\n",
+ "x_2_c = 1;\n",
+ "H1_infinite = a + c*(x_2_c**(2));\t\t\t#[cm**(3)/mol]\n",
+ "print \"C).The enthalpy of componenet 1 at infinite dilution at x_1 = 0) is %f J/mol\"%(H1_infinite);\n",
+ "\n",
+ "#At x_1 = 0.2\n",
+ "x_1_c1 = 0.2;\n",
+ "x_2_c1 = 0.8;\n",
+ "H1_bar_c1 = a + c*(x_2_c1**(2));\t\t\t#[J/mol]\n",
+ "print \" The enthalpy of componenet 1 at at x_1 = 0.2) is %f J/mol\"%(H1_bar_c1);\n",
+ "\n",
+ "#At x_1 = 0.8\n",
+ "x_1_c2 = 0.8;\n",
+ "x_2_c2 = 0.2;\n",
+ "H1_bar_c2 = a + c*(x_2_c2**(2));\t\t\t#[J/mol]\n",
+ "print \" The enthalpy of componenet 1 at at x_1 = 0.8) is %f J/mol\"%(H1_bar_c2);\n",
+ "\n",
+ "#As x_1 increases, 'H1_bar' approaches the value of 'H1' \n",
+ "\n",
+ "#(d)\n",
+ "#This part involves proving a relation in which no mathematics and no calculations are involved.\n",
+ "#For prove refer to this example 11.4 on page number 387 of the book.\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a).The enthalpy of pure component 1 is 15000.000000 J/mol\n",
+ " The enthalpy of pure component 2 is 20000.000000 J/mol\n",
+ "C).The enthalpy of componenet 1 at infinite dilution at x_1 = 0) is 13000.000000 J/mol\n",
+ " The enthalpy of componenet 1 at at x_1 = 0.2) is 13720.000000 J/mol\n",
+ " The enthalpy of componenet 1 at at x_1 = 0.8) is 14920.000000 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.9 Page Number : 395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of minimum work required\n",
+ "\n",
+ "# Variables\n",
+ "n = 1*10**(3);\t\t\t#[mol] - No of moles\n",
+ "P = 0.1;\t\t\t#[MPa] - Pressure of the surrounding\n",
+ "T = 300;\t\t\t#[K] - Temperature of the surrounding\n",
+ "x_1 = 0.79;\t\t\t#Mole fraction of N2 in the air\n",
+ "x_2 = 0.21;\t\t\t#Mole fraction of O2 in the air\n",
+ "R=8.314;\t\t\t#[J/mol*K]\n",
+ "\n",
+ "# Calculations\n",
+ "#Change in availability when x_1 moles of component 1 goes from pure state to that in the mixture is\n",
+ "#x_1*(si_1 - si_2) = x_1*[H1 - H1_bar - T_0*(S1 - S1_bar)]\n",
+ "#Similarly change in availability of x_2 moles of component 2 is\n",
+ "#x_2*(si_1 - si_2) = x_2*[H2 - H2_bar - T_0*(S2 - S2_bar)]\n",
+ "\n",
+ "#and thus total availability change when 1 mol of mixture is formed from x_1 mol of component 1 and x_2 mol of component 2 is equal to reversible work\n",
+ "#W_rev = x_1*[H1 - H1_bar - T_0*(S1 - S1_bar)] + x_2*[H2 - H2_bar - T_0*(S2 - S2_bar)]\n",
+ "#W_rev = -[x_1*(H1_bar - H1) + x_2*(H2_bar - H2)] + T_0*[x_1*(S1_bar - S1) + x_2*(S2_bar - S2)]\n",
+ "#W_rev = -[delta_H_mix] +T_0*[delta_S_mix]\n",
+ "\n",
+ "#If T = T_0 that is,temperature of mixing is same as that of surroundings, W_rev = -delta_G_mix.\n",
+ "#W_rev = -delta_G_mix = R*T*(x_1*math.log(x_1) + x_2*math.log(x_2))\n",
+ "W_rev = R*T*(x_1*math.log(x_1) + x_2*math.log(x_2));\t\t\t#[J/mol]\n",
+ "\n",
+ "#Therefore total work transfer is given by\n",
+ "W_min = (n*W_rev)/1000;\t\t\t#[kJ]\n",
+ "\n",
+ "# Results\n",
+ "print \"The minimum work required is %f kJ\"%(W_min);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum work required is -1281.910728 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.10 Page Number : 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of fugacity 0f the mixture\n",
+ "\n",
+ "# Variables\n",
+ "x_A = 0.20;\t\t\t# Mole fraction of A\n",
+ "x_B = 0.35;\t\t\t# Mole fraction of B\n",
+ "x_C = 0.45;\t\t\t# Mole fraction of C\n",
+ "\n",
+ "phi_A = 0.7;\t\t\t# Fugacity coefficient of A\n",
+ "phi_B = 0.6;\t\t\t# Fugacity coefficient of B\n",
+ "phi_C = 0.9;\t\t\t# Fugacity coefficient of C\n",
+ "\n",
+ "P = 6.08;\t\t\t#[MPa] - Pressure\n",
+ "T = 384;\t\t\t#[K] - Temperature\n",
+ "\n",
+ "# Calculations\n",
+ "#We know that\n",
+ "#math.log(phi) = x_1*math.log(phi_) + x_2*math.log(phi_2) + x_3*math.log(phi_3)\n",
+ "math.log_phi = x_A*math.log(phi_A) + x_B*math.log(phi_B) + x_C*math.log(phi_C);\t\t\t# Fugacity coefficient\n",
+ "phi = math.exp(math.log_phi);\n",
+ "\n",
+ "#Thus fugacity is given by,\n",
+ "f_mixture = phi*P;\t\t\t#[MPa]\n",
+ "\n",
+ "# Results\n",
+ "print \"The fugacity of the mixture is %f MPa\"%(f_mixture);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fugacity of the mixture is 4.515286 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch12_1.ipynb b/Chemical_Engineering_Thermodynamics/ch12_1.ipynb
new file mode 100644
index 00000000..6b7a0b02
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch12_1.ipynb
@@ -0,0 +1,508 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : Partial Molar Volume and Enthalpy from Experimental Data "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.1 Page Number : 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of partial molar volume\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 0 + 273.15;\t\t\t#[K] - Temperature\n",
+ "P = 1;\t\t\t#[atm] - Pressure\n",
+ "x_methanol = 0.5;\t\t\t#Mole fraction of methanol at which molar volume is to be calculated\n",
+ "x_water = 0.5;\t\t\t#Mole fraction at which molar volume is to be calculated\n",
+ "\n",
+ "#V = V1 at x1 = 1 and V = V2 at x1 = 0, therefore\n",
+ "V1 = 40.7;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1\n",
+ "V2 = 18.1;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2\n",
+ "from numpy import zeros,linalg\n",
+ "x1=[0.114,0.197,0.249,0.495,0.692,0.785,0.892];\t\t\t# Values of mole fraction of component 1\n",
+ "V=[20.3,21.9,23.0,28.3,32.9,35.2,37.9];\t\t\t# Values of molar volume\n",
+ "x2=zeros(7);\t\t\t# Mole fraction of component 2\n",
+ "x_V=zeros(7);\t\t\t# x_V = x1*V_1 + x2*V_2\n",
+ "V_mix=zeros(7);\t\t\t# V_mix = V - x1*V_1 - x2*V_2\n",
+ "del_V=zeros(7);\t\t\t#del_V = V_mix/(x1*x2)\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(7):\n",
+ " x2[i]=1-x1[i];\n",
+ " x_V[i]=x1[i]*V1 + x2[i]*V2;\n",
+ " V_mix[i]=V[i]-x1[i]*V1- x2[i]*V2;\n",
+ " del_V[i]=V_mix[i]/(x1[i]*x2[i]);\n",
+ "\n",
+ "x1 = array(x1)\n",
+ "\t\t\t#From the matrix method to solve simultaneous linear equations, we have\n",
+ "a=array([[7, sum(x1), sum(x1**2)],[sum(x1), sum(x1**2), sum(x1**3)],[sum(x1**2), sum(x1**3), sum(x1**4)]])\n",
+ "b=array([sum(del_V),sum(x1*del_V),sum((x1**2)*del_V)])\n",
+ "\n",
+ "soln=linalg.solve(a,b);\n",
+ "\n",
+ "a0=soln[0]\n",
+ "a1=soln[1]\n",
+ "a2=soln[2]\n",
+ "#del_V = V_mix/(x1*x2) = a0 + a1*x1 + a2*x1**(2)\n",
+ "#V_mix = (a0 + a1*x1 + a2*x1**(2))*(x1*(1 - x1))\n",
+ "# For x1 = 0.5\n",
+ "x1 = 0.5;\n",
+ "V_mix_prime = (a0+(a1*x1)+(a2*x1**2))*(x1*(1-x1));\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "#Now differentiating the above equation with respect to x we get\n",
+ "#d/dx(V_mix) = (-4*a2*x1**3) + (3*(a2-a1)*x1**2) + (2*(a1-a0)*x1)+ a0\n",
+ "#Again for x1 = 0.5\n",
+ "x1_prime = 0.5;\n",
+ "del_V_mix_prime = (-4*a2*x1_prime**3)+(3*(a2-a1)*x1_prime**2)+(2*(a1-a0)*x1_prime)+a0;\n",
+ "\n",
+ "#Finally,calculating the partial molar volumes\n",
+ "V1_bar = V1 + V_mix_prime + x_water*del_V_mix_prime;\t\t\t#[cm**(3)/mol] \n",
+ "V2_bar = V2 + V_mix_prime - x_methanol*del_V_mix_prime;\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \"The partial molar volume of methanol component 1) is %f cm**3)/mol\"%(V1_bar);\n",
+ "print \"The partial molar volume of water component 2) is %f cm**3)/mol\"%(V2_bar);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The partial molar volume of methanol component 1) is 39.721188 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 17.079639 cm**3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page Number : 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of volume of the mixture\n",
+ "\n",
+ "# Variables\n",
+ "#component 1 = water\n",
+ "#component 2 = methanol\n",
+ "T = 25 + 273.15;\t\t\t#[K] - Temperature\n",
+ "\n",
+ "#delta_V_mix = x_1*x_2*(-3.377 - 2.945*x_1 + 3.31*x_1**(2))\n",
+ "V1 = 18.0684;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1\n",
+ "V2 = 40.7221;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2\n",
+ "Vol_1 = 1000;\t\t\t#[cm**(3)] - Volume of pure component 1\n",
+ "Vol_2 = 1000;\t\t\t#[cm**(3)] - Volume of pure component 2\n",
+ "\n",
+ "# Calculations\n",
+ "#Moles of the componenets can be calculated as \n",
+ "n_1 = round(Vol_1/V1,4);\t\t\t#[mol]\n",
+ "n_2 = round(Vol_2/V2,4);\t\t\t#[mol]\n",
+ "\n",
+ "#Mole fraction of the components \n",
+ "x_1 = round(n_1/(n_1 + n_2),4);\n",
+ "x_2 = round(n_2/(n_1 + n_2),4);\n",
+ "\n",
+ "delta_V_mix = round(x_1*x_2*(-3.377 - 2.945*x_1 + 3.31*x_1**(2)),4);\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "#Differentiating the above equation, we get\n",
+ "#d/dx(delta_V_mix) = (1 - 2*x_1)*(-3.377 - 2.945*x_1 + 3.31*x_1**(2)) + (x_1 - x_1**(2))*(-2.945 + 6.62*x_1)\n",
+ "del_delta_V_mix = round((1 - 2*x_1)*(-3.377 - 2.945*x_1 + 3.31*x_1**(2)) + (x_1 - x_1**(2))*(-2.945 + 6.62*x_1),4);\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "#Now calculating the partial molar volumes\n",
+ "V1_bar = V1 + delta_V_mix + x_2*del_delta_V_mix;\t\t\t#[cm**(3)/mol] \n",
+ "V2_bar = V2 + delta_V_mix - x_1*del_delta_V_mix;\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "print del_delta_V_mix, V1_bar, V2_bar\n",
+ "#Finally molar volume of the solution is given by\n",
+ "V_sol = x_1*V1_bar + x_2*V2_bar;\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "# Total volume of the solution is given by\n",
+ "V_total = (n_1 + n_2)*V_sol;\t\t\t#[cm**(3)]\n",
+ "\n",
+ "# Results\n",
+ "print \"The molar volume of the solution is %.4f cm**3)/mol\"%(V_sol);\n",
+ "print \"The total volume of the solution is %.2f cm**3)\"%(V_total);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.8248 17.81416104 38.64306104\n",
+ "The molar volume of the solution is 24.2149 cm**3)/mol\n",
+ "The total volume of the solution is 1934.82 cm**3)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page Number : 422"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of volumes\n",
+ "\n",
+ "# Variables\n",
+ "#component 1 = methanol\n",
+ "#component 2 = water\n",
+ "Vol = 20;\t\t\t#[cm**(3)] - Volume of the solution\n",
+ "T = 22 + 273.15;\t\t\t#[K] - Temperature\n",
+ "W_bottle = 11.5485;\t\t\t#[g] - Weight of density bottle\n",
+ "Mol_meth = 32.04;\t\t\t#Molecular weight of methanol\n",
+ "Mol_water = 18.015;\t\t\t# Molecular weight of water\n",
+ "\n",
+ "#Density of pure components can be found out at 0% and 100% of volume percent.\n",
+ "den_meth = 0.7929;\t\t\t#[cm**(3)/mol] - Density of pure methanol\n",
+ "den_water = 0.9937;\t\t\t#[cm**(3)/mol] - Density of pure water\n",
+ "\n",
+ "\n",
+ "Vol_perc=[5,10,20,30,40,50,60,70,80,90,95];\t\t\t# Volumes percent of component 1 (methanol)\n",
+ "W_total=[31.2706,31.1468,30.8907,30.6346,30.3396,30.0053,29.5865,29.1453,28.5978,28.0325,27.7320];\t\t\t# Weight of solution + weight of density bottle\n",
+ "\n",
+ "W_sol=zeros(11);\t\t\t# Weight of 20 cm**(3) of solution\n",
+ "den=zeros(11);\t\t\t# density of the solution\n",
+ "x1=zeros(11);\t\t\t# Mole fraction of methanol\n",
+ "x2=zeros(11);\t\t\t# Mole fraction of water\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(11):\n",
+ " W_sol[i]=W_total[i]-W_bottle;\n",
+ " den[i]=W_sol[i]/Vol;\n",
+ " x1[i]=((Vol_perc[i]*den_meth)/Mol_meth)/(((Vol_perc[i]*den_meth)/Mol_meth)+(((100-Vol_perc[i])*den_water)/Mol_water));\n",
+ " x2[i]=1-x1[i];\n",
+ "\n",
+ "\n",
+ "#Again we have,\n",
+ "V_kg=zeros(11);\t\t\t#[cm**(3)] - Volume of 1 kg of solution\n",
+ "n_mol=zeros(11);\t\t\t#[mol] - Number of moles in 1 kg of solution\n",
+ "V_mol=zeros(11);\t\t\t#[cm**(3)/mol] - Volume of 1 mol of solution\n",
+ "x_V=zeros(11);\t\t\t#[cm**(3)/mol] - x_V = x1*V_meth + x2*V_water\n",
+ "V_mix=zeros(11);\t\t\t#[cm**(3)/mol] - V_mix = V_mol - x1*V_meth - x2*V_water\n",
+ "del_V=zeros(11);\t\t\t# [cm**(3)/mol] - del_V = V_mix/(x1*x2)\n",
+ "\n",
+ "#V_mol = V_meth at x1 = 1 and V_mol = V_water at x1 = 0, therefore\n",
+ "V_meth = 40.4114;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1 (methanol)\n",
+ "V_water = 18.1286;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2 (water)\n",
+ "\n",
+ "for i in range(11):\n",
+ " V_kg[i]=1000/den[i];\n",
+ " n_mol[i]=1000/(x1[i]*Mol_meth+x2[i]*Mol_water);\n",
+ " V_mol[i]=V_kg[i]/n_mol[i];\n",
+ " x_V[i]=V_meth*x1[i]+V_water*x2[i];\n",
+ " V_mix[i]=V_mol[i]-x1[i]*V_meth-x2[i]*V_water;\n",
+ " del_V[i]=V_mix[i]/(x1[i]*x2[i]);\n",
+ "\n",
+ "#Now employing the concept of quadratic regression of the data ( x1 , del_V ) to solve the equation of the type\n",
+ "#y = a0 + a1*x + a2*x**(2) \n",
+ "#Here the above equation is in the form of\n",
+ "#del_V = V_mix/(x1*x2) = a0 + a1*x1 + a2*x1**(2) \n",
+ "\n",
+ "#From the matrix method to solve simultaneous linear equations, we have\n",
+ "a = array([[11, sum(x1), sum(x1**2)],[sum(x1), sum(x1**2), sum(x1**3)],[sum(x1**2), sum(x1**3), sum(x1**4)]])\n",
+ "b = array([sum(del_V),sum(x1*del_V),sum((x1**2)*del_V)])\n",
+ "\n",
+ "soln=linalg.solve(a,b);\n",
+ "a0=soln[0]\n",
+ "a1=soln[1]\n",
+ "a2=soln[2]\n",
+ "\n",
+ "#del_V = V_mix/(x1*x2) = a0 + a1*x1 + a2*x1**(2)\n",
+ "#V_mix = (a0 + a1*x1 + a2*x1**(2))*(x1*(1 - x1))\n",
+ "#Solving the above equation for x1,\n",
+ "def f(x1): \n",
+ " return (a0+(a1*x1)+(a2*x1**2))*(x1*(1-x1))\n",
+ "\n",
+ "#Now differentiating the above equation with respect to x we get\n",
+ "#d/dx(V_mix) = (-4*a2*x1**3) + (3*(a2-a1)*x1**2) + (2*(a1-a0)*x1)+ a0\n",
+ "#Again solving it for x1\n",
+ "def f1(x1): \n",
+ " return (-4*a2*x1**3)+(3*(a2-a1)*x1**2)+(2*(a1-a0)*x1)+a0\n",
+ "\n",
+ "#Now \n",
+ "\n",
+ "x1_prime=[0,0.25,0.50,0.75,1.0];\n",
+ "V_mix_prime=zeros(5);\t\t\t#[cm**(3)/mol] - V_mix = V - x1*V_meth - x2*V_water\n",
+ "del_V_prime=zeros(5);\t\t\t#[cm**(3)/mol] - del_V = V_mix/(x1*x2)\n",
+ "V1_bar=zeros(5);\t\t\t#[cm**(3)/mol] - Partial molar volume of component 1\n",
+ "V2_bar=zeros(5);\t\t\t#[cm**(3)/mol] - Partial molar volume of component 1\n",
+ "\n",
+ "# Results\n",
+ "for j in range(5):\n",
+ " V_mix_prime[j]=f(x1_prime[j]);\n",
+ " del_V_prime[j]=f1(x1_prime[j]);\n",
+ " V1_bar[j]=V_meth+V_mix_prime[j]+(1-x1_prime[j])*del_V_prime[j];\n",
+ " V2_bar[j]=V_water+V_mix_prime[j]-x1_prime[j]*del_V_prime[j];\n",
+ " print \"For x1 = %f\"%(x1_prime[j]);\n",
+ " print \"The partial molar volume of methanol component 1) is %f cm**3)/mol\"%(V1_bar[j])\n",
+ " print \"The partial molar volume of water component 2) is %f cm**3)/mol\"%(V2_bar[j])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For x1 = 0.000000\n",
+ "The partial molar volume of methanol component 1) is 37.937941 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 18.128600 cm**3)/mol\n",
+ "For x1 = 0.250000\n",
+ "The partial molar volume of methanol component 1) is 38.124350 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 18.031910 cm**3)/mol\n",
+ "For x1 = 0.500000\n",
+ "The partial molar volume of methanol component 1) is 39.496329 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 17.177237 cm**3)/mol\n",
+ "For x1 = 0.750000\n",
+ "The partial molar volume of methanol component 1) is 40.332855 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 15.841550 cm**3)/mol\n",
+ "For x1 = 1.000000\n",
+ "The partial molar volume of methanol component 1) is 40.411400 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 15.800306 cm**3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page Number : 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of partial molar volumes\n",
+ "\n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 20 + 273.15;\t\t\t#[K] - Temperature\n",
+ "Mol_form = 46.027;\t\t\t#Molecular weight of formic acid\n",
+ "Mol_water = 18.015;\t\t\t# Molecular weight of water\n",
+ "\n",
+ "Wt_perc=[10,18,30,50,72,78];\t\t\t#Weight percent of formic acid\n",
+ "den=[1.0246,1.0441,1.0729,1.1207,1.1702,1.1818];\t\t\t#[g/cm**(3)] - Density of solution\n",
+ "\n",
+ "V_g=zeros(6);\t\t\t#[cm**(3)/g] - Volume of 1 g of solution\n",
+ "x1=zeros(6);\t\t\t# Mole fraction of component 1\n",
+ "x2=zeros(6);\t\t\t# Mole fraction of component 2\n",
+ "n=zeros(6);\t\t\t# Number of moles in 1 g\n",
+ "V_mol=zeros(6);\t\t\t#[cm**(3)/mol] - Volume of 1 mol of solution\n",
+ "x_V=zeros(6);\t\t\t#[cm**(3)/mol] - x_V = x1*V_form + x2*V_water\n",
+ "V_mix=zeros(6);\t\t\t#[cm**(3)/mol] - V_mix = V - x1*V_form - x2*V_water\n",
+ "del_V=zeros(6);\t\t\t# [cm**(3)/mol] - del_V = V_mix/(x1*x2)\n",
+ "\n",
+ "#V_mol = V_form at x1 = 1 and V_mol = V_water at x1 = 0, therefore\n",
+ "V_form = 37.737;\t\t\t#[cm**(3)/mol] - Molar volume of pure formic acid (component 1)\n",
+ "V_water = 18.050;\t\t\t#[cm**(3)/mol] - Molar volume of pure water (component 2)\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(6):\n",
+ " V_g[i]=1/den[i];\n",
+ " x1[i]=(Wt_perc[i]/Mol_form)/((Wt_perc[i]/Mol_form)+((100-Wt_perc[i])/Mol_water));\n",
+ " x2[i]=1-x1[i];\n",
+ " n[i]=((Wt_perc[i]/100.)/Mol_form)+(((100-Wt_perc[i])/100.)/Mol_water);\n",
+ " V_mol[i]=V_g[i]/n[i];\n",
+ " x_V[i]=V_form*x1[i]+V_water*x2[i];\n",
+ " V_mix[i]=V_mol[i]-x1[i]*V_form-x2[i]*V_water;\n",
+ " del_V[i]=V_mix[i]/(x1[i]*x2[i]);\n",
+ "\n",
+ "\n",
+ "a = array([[11, sum(x1), sum(x1**2)],[sum(x1), sum(x1**2) ,sum(x1**3)],[sum(x1**2), sum(x1**3) ,sum(x1**4)]])\n",
+ "b = array([sum(del_V),sum(x1*del_V),sum((x1**2)*del_V)])\n",
+ "\n",
+ "soln = linalg.solve(a,b)\n",
+ "\n",
+ "a0=soln[0]\n",
+ "a1=soln[1]\n",
+ "a2=soln[2]\n",
+ "\n",
+ "def f(x1): \n",
+ "\t return (a0+(a1*x1)+(a2*x1**2))*(x1*(1-x1))\n",
+ "\n",
+ "def f1(x1): \n",
+ "\t return (-4*a2*x1**3)+(3*(a2-a1)*x1**2)+(2*(a1-a0)*x1)+a0\n",
+ "\n",
+ "#At 15 Wt% of formic acid, x1 is given by\n",
+ "x1_prime_1 = round((15/Mol_form)/((15/Mol_form)+((100-15)/Mol_water)),3); \n",
+ "#Similarly at 75 Wt% of formic acid, x1 is given by\n",
+ "x1_prime_2 = round((75/Mol_form)/((75/Mol_form)+((100-75)/Mol_water)),4); \n",
+ "\n",
+ "Wt_perc_prime=[15,75];\n",
+ "x1_prime=[x1_prime_1,x1_prime_2];\n",
+ "V_mix_prime=zeros(2);\t\t\t#[cm**(3)/mol] - V_mix = V - x1*V_meth - x2*V_water\n",
+ "del_V_prime=zeros(2);\t\t\t#[cm**(3)/mol] - del_V = V_mix/(x1*x2)\n",
+ "V1_bar=zeros(2);\t\t\t#[cm**(3)/mol] - Partial molar volume of component 1\n",
+ "V2_bar=zeros(2);\t\t\t#[cm**(3)/mol] - Partial molar volume of component 1\n",
+ "\n",
+ "# Results\n",
+ "for j in range(2):\n",
+ " V_mix_prime[j]=f(x1_prime[j]);\n",
+ " del_V_prime[j]=f1(x1_prime[j]);\n",
+ " V1_bar[j]=V_form+V_mix_prime[j]+(1-x1_prime[j])*del_V_prime[j];\n",
+ " V2_bar[j]=V_water+V_mix_prime[j]-x1_prime[j]*del_V_prime[j];\n",
+ " print \"For weight percent of formic acid = %f percent\"%(Wt_perc_prime[j]);\n",
+ " print \"The partial molar volume of formic acid component 1) is %f cm**3)/mol\"%(V1_bar[j]);\n",
+ " print \"The partial molar volume of water component 2) is %f cm**3)/mol\"%(V2_bar[j]);\n",
+ "\n",
+ "# answers are vary because of rounding error. Please review it manually. "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For weight percent of formic acid = 15.000000 percent\n",
+ "The partial molar volume of formic acid component 1) is 35.429311 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 18.102339 cm**3)/mol\n",
+ "For weight percent of formic acid = 75.000000 percent\n",
+ "The partial molar volume of formic acid component 1) is 38.853189 cm**3)/mol\n",
+ "The partial molar volume of water component 2) is 15.646974 cm**3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.5 Page Number : 426"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "T = 40 + 273.15;\t\t\t#[K] - Temperature\n",
+ "\n",
+ "x1=array([0.083,0.176,0.268,0.353,0.428,0.720,0.780,0.850,0.900]) \t\t\t# Mole fraction of component 1\n",
+ "delta_H_mix=array([0.250,0.488,0.670,0.790,0.863,0.775,0.669,0.510,0.362])\t\t\t#[kJ/mol] - Enthalpy of the solution\n",
+ "\n",
+ "x2=zeros(9);\t\t\t# Mole fraction of component 2\n",
+ "del_H=zeros(9);\t\t\t#[kJ/mol] - del_H = delta_H_mix/(x1*x2)\n",
+ "\n",
+ "for i in range(9):\n",
+ " x2[i]=1-x1[i];\n",
+ " del_H[i]=delta_H_mix[i]/(x1[i]*x2[i]);\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "#Now employing the concept of quadratic regression of the data ( x1 , del_H ) to solve the equation of the type\n",
+ "#y = a0 + a1*x + a2*x**(2) \n",
+ "#Here the above equation is in the form of\n",
+ "#del_H = delta_H_mix/(x1*x2) = a0 + a1*x1 + a2*x1**(2) \n",
+ "\n",
+ "#From the matrix method to solve simultaneous linear equations, we have\n",
+ "a = array([[9, sum(x1), sum(x1**2)],[sum(x1), sum(x1**2), sum(x1**3)],[sum(x1**2), sum(x1**3), sum(x1**4)]])\n",
+ "b = array([sum(del_H),sum(x1*del_H),sum((x1**2)*del_H)])\n",
+ "soln= linalg.solve(a,b)\n",
+ "a0=soln[0]\n",
+ "a1=soln[1]\n",
+ "a2=soln[2]\n",
+ "\n",
+ "#del_H = delta_H_mix/(x1*x2) = a0 + a1*x1 + a2*x1**(2)\n",
+ "#delta_H_mix = (a0 + a1*x1 + a2*x1**(2))*(x1*(1 - x1))\n",
+ "#At x1 = 0.25,\n",
+ "x_1 = 0.25;\t\t\t#[mol]\n",
+ "delta_H_mix = (a0+(a1*x_1)+(a2*x_1**2))*(x_1*(1-x_1));\t\t\t#[kJ/mol]\n",
+ "\n",
+ "#Now differentiating the above equation with respect to x we get\n",
+ "#d/dx(delta_H_mix) = del_delta_H_mix = (-4*a2*x1**3) + (3*(a2-a1)*x1**2) + (2*(a1-a0)*x1)+ a0\n",
+ "#Again for x1 = 0.25\n",
+ "x_1_prime = 0.25;\t\t\t#[mol]\n",
+ "del_delta_H_mix = (-4*a2*x_1_prime**3)+(3*(a2-a1)*x_1_prime**2)+(2*(a1-a0)*x_1_prime)+a0;\t\t\t#[kJ/mol]\n",
+ "\n",
+ "#We have the relation\n",
+ "# H1_bar - H1 = delta_H_mix + x2*del_delta_H_mix, and\n",
+ "# H2_bar - H2 = delta_H_mix - x1*del_delta_H_mix\n",
+ "\n",
+ "#Let us suppose\n",
+ "#k_1 = H1_bar - H1 , and\n",
+ "#k_2 = H2_bar - H2\n",
+ "\n",
+ "k_1 = delta_H_mix + (1-x_1_prime)*del_delta_H_mix;\t\t\t#[kJ/mol]\n",
+ "k_2 = delta_H_mix - x_1_prime*del_delta_H_mix;\t\t\t#[kJ/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of H1_bar - H1) at x1 = 0.25 is %f kJ/mol\"%(k_1);\n",
+ "print \"The value of H2_bar - H2) at x1 = 0.25 is %f kJ/mol\"%(k_2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of H1_bar - H1) at x1 = 0.25 is 2.010734 kJ/mol\n",
+ "The value of H2_bar - H2) at x1 = 0.25 is 0.179079 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch13_1.ipynb b/Chemical_Engineering_Thermodynamics/ch13_1.ipynb
new file mode 100644
index 00000000..4dce9007
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch13_1.ipynb
@@ -0,0 +1,313 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Chapter 13 : Fugacity of a Component in a Mixture by Equations of State"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.2 Page Number : 433"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Caculation of fugacity coefficients\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 310.93;\t\t\t#[K] - Temperature\n",
+ "P = 2.76*10**(6);\t\t\t#[Pa] - Pressure\n",
+ "y1 = 0.8942;\t\t\t#[mol] - mole fraction of component 1\n",
+ "y2 = 1 - y1;\t\t\t#[mol] - mole fraction of component 2\n",
+ "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "#For component 1 (methane)\n",
+ "Tc_1 = 190.6;\t\t\t#[K] - Critical temperature\n",
+ "Pc_1 = 45.99*10**(5);\t\t\t#[N/m**(2)] - Critical pressure\n",
+ "Vc_1 = 98.6;\t\t\t#[cm**(3)/mol] - Critical molar volume\n",
+ "Zc_1 = 0.286;\t\t\t# - Critical compressibility factor\n",
+ "w_1 = 0.012;\t\t\t# - Critical acentric factor\n",
+ "#Similarly for component 2 (n-Butane)\n",
+ "Tc_2 = 425.1;\t\t\t#[K]\n",
+ "Pc_2 = 37.96*10**(5);\t\t\t#[N/m**(2)]\n",
+ "Vc_2 = 255;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_2=0.274;\n",
+ "w_2=0.2;\n",
+ "\n",
+ "# Calculations\n",
+ "#For component 1\n",
+ "Tr_1 = T/Tc_1;\t\t\t#Reduced temperature\n",
+ "#At reduced temperature\n",
+ "B1_0 = 0.083-(0.422/(Tr_1)**(1.6));\n",
+ "B1_1 = 0.139-(0.172/(Tr_1)**(4.2));\n",
+ "#We know,(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_11 = ((B1_0+(w_1*B1_1))*(R*Tc_1))/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#Similarly for component 2\n",
+ "Tr_2 = T/Tc_2;\t\t\t#Reduced temperature\n",
+ "#At reduced temperature Tr_2,\n",
+ "B2_0 = 0.083-(0.422/(Tr_2)**(1.6));\n",
+ "B2_1 = 0.139-(0.172/(Tr_2)**(4.2));\n",
+ "B_22 = ((B2_0+(w_2*B2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#For cross coeffcient\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1./2);\t\t\t#[K]\n",
+ "w_12 = (w_1+w_2)/2;\n",
+ "Zc_12 = (Zc_1+Zc_2)/2;\n",
+ "Vc_12 = (((Vc_1)**(1./3)+(Vc_2)**(1./3))/2)**(3);\t\t\t#[cm**(3)/mol]\n",
+ "Vc_12 = Vc_12*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "Pc_12 = (Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "# Variables, Z = 1 + (B*P)/(R*T)\n",
+ "#Now we have,(B_12*Pc_12)/(R*Tc_12) = B_0 + (w_12*B_1)\n",
+ "#where B_0 and B_1 are to be evaluated at Tr_12\n",
+ "Tr_12 = T/Tc_12;\n",
+ "#At reduced temperature Tr_12\n",
+ "B_0 = 0.083-(0.422/(Tr_12)**(1.6));\n",
+ "B_1 = 0.139-(0.172/(Tr_12)**(4.2));\n",
+ "B_12 = ((B_0+(w_12*B_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "#For the mixture\n",
+ "B = y1**(2)*B_11+2*y1*y2*B_12+y2**(2)*B_22;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#Now del_12 can be calculated as,\n",
+ "del_12 = 2*B_12 - B_11 - B_22;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#We have the relation, math.log(phi_1) = (P/(R*T))*(B_11 + y2**(2)*del_12), therefore\n",
+ "phi_1 = math.exp((P/(R*T))*(B_11 + y2**(2)*del_12));\n",
+ "#Similarly for component 2\n",
+ "phi_2 = math.exp((P/(R*T))*(B_22 + y1**(2)*del_12));\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of fugacity coefficient of component 1 phi_1) is %f\"%(phi_1);\n",
+ "print \" The value of fugacity coefficient of component 2 phi_2) is %f\"%(phi_2);\n",
+ "\n",
+ "#Finally fugacity coefficient of the mixture is given by\n",
+ "#math.log(phi) = y1*math.log(phi_1) + y2*math.log(phi_2);\n",
+ "phi = math.exp(y1*math.log(phi_1) + y2*math.log(phi_2));\n",
+ "\n",
+ "print \" The value of fugacity coefficient of the mixture phi) is %f \"%(phi);\n",
+ "#The fugacity coefficient of the mixture can also be obtained using\n",
+ "#math.log(phi) = (B*P)/(R*T)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of fugacity coefficient of component 1 phi_1) is 0.965152\n",
+ " The value of fugacity coefficient of component 2 phi_2) is 0.675374\n",
+ " The value of fugacity coefficient of the mixture phi) is 0.929376 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.7 Page Number : 447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of fugacity coefficients\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 460.;\t\t\t#[K] - Temperature\n",
+ "P = 40.*10**(5);\t\t\t#[Pa] - Pressure\n",
+ "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "# component 1 = nitrogen\n",
+ "# component 2 = n-Butane\n",
+ "y1 = 0.4974;\t\t\t# Mole percent of nitrogen\n",
+ "y2 = 0.5026;\t\t\t# Mole percent of n-Butane\n",
+ "Tc_nit = 126.2;\t\t\t#[K]\n",
+ "Pc_nit = 34.00*10**(5);\t\t\t#[Pa]\n",
+ "Tc_but = 425.1;\t\t\t#[K]\n",
+ "Pc_but = 37.96*10**(5);\t\t\t#[Pa]\n",
+ "\n",
+ "# (1). van der Walls equation of state\n",
+ "\n",
+ "# The fugacity coefficient of component 1 in a binary mixture following van der Walls equation of state is given by,\n",
+ "# math.log(phi_1) = b_1/(V-b) - math.log(Z-B) -2*(y1*a_11 + y2*a_12)/(R*T*V)\n",
+ "# and for component 2 is given by,\n",
+ "# math.log(phi_2) = b_2/(V-b) - math.log(Z-B) -2*(y1*a_12 + y2*a_22)/(R*T*V)\n",
+ "# Where B = (P*b)/(R*T)\n",
+ "\n",
+ "# Calculations\n",
+ "# For componenet 1 (nitrogen)\n",
+ "a_1 = (27*R**(2)*Tc_nit**(2))/(64*Pc_nit);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b_1 = (R*Tc_nit)/(8*Pc_nit);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Similarly for componenet 2 (n-Butane)\n",
+ "a_2 = (27*R**(2)*Tc_but**(2))/(64*Pc_but);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b_2 = (R*Tc_but)/(8*Pc_but);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Here\n",
+ "a_11 = a_1;\n",
+ "a_22 = a_2;\n",
+ "# For cross coefficient\n",
+ "a_12 = (a_1*a_2)**(1./2);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "\n",
+ "# For the mixture \n",
+ "a = y1**(2)*a_11 + y2**(2)*a_22 + 2*y1*y2*a_12;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = y1*b_1 + y2*b_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The cubic form of the van der Walls equation of state is given by,\n",
+ "# V**(3) - (b+(R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "# Substituting the value and solving for V, we get\n",
+ "# Solving the cubic equation\n",
+ "def f(V): \n",
+ " return V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P\n",
+ "V_1=fsolve(f,-1)\n",
+ "V_2=fsolve(f,0)\n",
+ "V_3=fsolve(f,1)\n",
+ "# The molar volume V = V_3, the other two roots are imaginary\n",
+ "V = V_3;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The comprssibility factor of the mixture is \n",
+ "Z = (P*V)/(R*T);\n",
+ "# And B can also be calculated as\n",
+ "B = (P*b)/(R*T);\n",
+ "\n",
+ "# The fugacity coefficient of component 1 in the mixture is\n",
+ "phi_1 = math.exp(b_1/(V-b) - math.log(Z-B) -2*(y1*a_11 + y2*a_12)/(R*T*V));\n",
+ "# Similarly fugacity coefficient of component 2 in the mixture is \n",
+ "phi_2 = math.exp(b_2/(V-b) - math.log(Z-B) -2*(y1*a_12 + y2*a_22)/(R*T*V));\n",
+ "\n",
+ "# The fugacity coefficient of the mixture is given by,\n",
+ "# math.log(phi) = y1*math.log(phi_1) + y2*math.log(phi_2)\n",
+ "phi = math.exp(y1*math.log(phi_1) + y2*math.log(phi_2));\n",
+ "\n",
+ "# Also the fugacity coefficient of the mixture following van der Walls equation of state is given by,\n",
+ "# math.log(phi) = b/(V-b) - math.log(Z-B) -2*a/(R*T*V)\n",
+ "phi_dash = math.exp(b/(V-b) - math.log(Z-B) -2*a/(R*T*V));\n",
+ "# The result is same as obtained above\n",
+ "\n",
+ "# Results\n",
+ "print \" 1van der Walls equation of state\";\n",
+ "print \" The value of fugacity coefficient of component 1 nitrogen) is %f\"%(phi_1);\n",
+ "print \" The value of fugacity coefficient of component 2 n-butane) is %f\"%(phi_2);\n",
+ "print \" The value of fugacity coefficient of the mixture is %f\"%(phi);\n",
+ "print \" Also the fugacity coefficient of the mixture from van der Walls equation of state is %f which is same as above)\"%(phi_dash);\n",
+ "\n",
+ "# (2). Redlich-Kwong equation of state\n",
+ "\n",
+ "# For component 1,\n",
+ "a_1_prime = (0.42748*R**(2)*Tc_nit**(2.5))/Pc_nit;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b_1_prime = (0.08664*R*Tc_nit)/Pc_nit;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "#similarly for component 2,\n",
+ "a_2_prime = (0.42748*R**(2)*Tc_but**(2.5))/Pc_but;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b_2_prime = (0.08664*R*Tc_but)/Pc_but;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# For cross coefficient\n",
+ "a_12_prime = (a_1_prime*a_2_prime)**(1./2);\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "# For the mixture\n",
+ "a_prime = y1**(2)*a_1_prime + y2**(2)*a_2_prime +2*y1*y2*a_12_prime;\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b_prime = y1*b_1_prime +y2*b_2_prime;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\n",
+ "#The cubic form of Redlich Kwong equation of state is given by,\n",
+ "# V**(3)-((R*T)/P)*V**(2)-((b**(2))+((b*R*T)/P)-(a/(T**(1/2)*P))*V-(a*b)/(T**(1/2)*P)=0\n",
+ "# Solving the cubic equation\n",
+ "def f1(V): \n",
+ " return V**(3)-((R*T)/P)*V**(2)-((b_prime**(2))+((b_prime*R*T)/P)-(a_prime/(T**(1./2)*P)))*V-(a_prime*b_prime)/(T**(1./2)*P)\n",
+ "V_4=fsolve(f1,1)\n",
+ "V_5=fsolve(f1,0)\n",
+ "V_6=fsolve(f1,-1)\n",
+ "# The molar volume V = V_4, the other two roots are imaginary\n",
+ "V_prime = V_4;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# The compressibility factor of the mixture is\n",
+ "Z_prime = (P*V_prime)/(R*T);\n",
+ "# And B can also be calculated as\n",
+ "B_prime = (P*b_prime)/(R*T);\n",
+ "\n",
+ "# The fugacity coefficient of component 1 in the binary mixture is given by\n",
+ "# math.log(phi_1) = b_1/(V-b) - math.log(Z-B) + ((a*b_1)/((b**(2)*R*T**(3/2))))*(math.log((V+b)/V)-(b/(V+b)))-(2*(y1*a_1+y2*a_12)/(R*T**(3/2)b))*(math.log(V+b)/b)\n",
+ "\n",
+ "phi_1_prime = math.exp((b_1_prime/(V_prime-b_prime))-math.log(Z_prime-B_prime)+((a_prime*b_1_prime)/((b_prime**(2))*R*(T**(3./2))))*(math.log((V_prime+b_prime)/V_prime)-(b_prime/(V_prime+b_prime)))-(2*(y1*a_1_prime+y2*a_12_prime)/(R*(T**(3./2))*b_prime))*(math.log((V_prime+b_prime)/V_prime)));\n",
+ "\n",
+ "\n",
+ "# Similarly fugacity coefficient of component 2 in the mixture is \n",
+ "phi_2_prime = math.exp((b_2_prime/(V_prime-b_prime))-math.log(Z_prime-B_prime)+((a_prime*b_2_prime)/((b_prime**(2))*R*(T**(3./2))))*(math.log((V_prime+b_prime)/V_prime)-(b_prime/(V_prime+b_prime)))-(2*(y1*a_12_prime+y2*a_2_prime)/(R*(T**(3./2))*b_prime))*(math.log((V_prime+b_prime)/V_prime)));\n",
+ "\n",
+ "# The fugacity coefficient of the mixture is given by,\n",
+ "# math.log(phi) = y1*math.log(phi_1) + y2*math.log(phi_2)\n",
+ "phi_prime = math.exp(y1*math.log(phi_1_prime) + y2*math.log(phi_2_prime));\n",
+ "\n",
+ "# Also the fugacity coefficient for the mixture following Redlich-kwong equation of state is also given by\n",
+ "# math.log(phi) = b/(V-b) - math.log(Z-B) - (a/(R*T**(3/2)))*(1/(V+b)+(1/b)*math.log((V+b)/V))\n",
+ "phi_prime_dash = math.exp(b_prime/(V_prime-b_prime) - math.log(Z_prime-B_prime) - (a_prime/(R*T**(3./2)))*(1/(V_prime+b_prime)+(1./b_prime)*math.log((V_prime+b_prime)/ V_prime)));\n",
+ "\n",
+ "print \" \\nRedlich-Kwong equation of state\";\n",
+ "print \" The value of fugacity coefficient of component 1 nitrogen) is %f\"%(phi_1_prime);\n",
+ "print \" The value of fugacity coefficient of component 2 n-butane) is %f\"%(phi_2_prime);\n",
+ "print \" The value of fugacity coefficient of the mixture is %f\"%(phi_prime);\n",
+ "print \" Also the fugacity coefficient for the mixture from Redlich-kwong equation of state is %f which is same as above)\"%(phi_prime_dash);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1van der Walls equation of state\n",
+ " The value of fugacity coefficient of component 1 nitrogen) is 1.057500\n",
+ " The value of fugacity coefficient of component 2 n-butane) is 0.801865\n",
+ " The value of fugacity coefficient of the mixture is 0.920192\n",
+ " Also the fugacity coefficient of the mixture from van der Walls equation of state is 0.920192 which is same as above)\n",
+ " \n",
+ "Redlich-Kwong equation of state\n",
+ " The value of fugacity coefficient of component 1 nitrogen) is 1.071129\n",
+ " The value of fugacity coefficient of component 2 n-butane) is 0.793063\n",
+ " The value of fugacity coefficient of the mixture is 0.920948\n",
+ " Also the fugacity coefficient for the mixture from Redlich-kwong equation of state is 0.920948 which is same as above)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch14_1.ipynb b/Chemical_Engineering_Thermodynamics/ch14_1.ipynb
new file mode 100644
index 00000000..03350db4
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch14_1.ipynb
@@ -0,0 +1,733 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 : Activity Coefficients Models for Liquid Mixtures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.4 Page Number : 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Proving a mathematical relation\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables,\n",
+ "T = 300;\t\t\t#[K] - Temperature\n",
+ "b = 100;\t\t\t#[cal/mol]\n",
+ "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n",
+ "# R*T*math.log(Y_1) = b*x_2**(2)\n",
+ "# R*T*math.log(Y_2) = b*x_1**(2)\n",
+ "\n",
+ "#For equimolar mixture\n",
+ "x_1 = 0.5;\t\t\t#Mole fraction of component 1\n",
+ "x_2 = 0.5;\t\t\t#Mole fraction of component 2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#The excess Gibbs free energy is given by\n",
+ "# G_excess = R*T*(x_1*math.log(Y_1) + x_2*math.log(Y_2)) = b*x_1*x_2**(2) + b*x_2*x_1**(2) = b*x_1*(x_1 + x_2) = b*x_1*x_2\n",
+ "G_excess = b*x_1*x_2;\t\t\t#[cal/mol]\n",
+ "\n",
+ "#The ideal Gibbs free energy change of mixing is given by,\n",
+ "delta_G_id_mix = R*T*(x_1*math.log(x_1)+x_2*math.log(x_2));\t\t\t#[cal/mol]\n",
+ "\n",
+ "#The Gibbs free energy of mixing is given by\n",
+ "delta_G_mix = delta_G_id_mix + G_excess;\t\t\t#[cal/mol]\n",
+ "\n",
+ "#It is given that entropy change of mixing is that of ideal mixture,therefore\n",
+ "# delta_S_mix = delta_S_id_mix = - R*sum(x_i*math.log(x_i))\n",
+ "\n",
+ "#delta_G_mix = delta_H_mix - T*delta_S_mix = delta_H_mix + R*T*(x_1*math.log(x_1)+x_2*math.log(x_2))\n",
+ "delta_H_mix = b*x_1*x_2;\t\t\t#[cal/mol]\n",
+ "\n",
+ "print \"The value of Gibbs free energy change for equimolar mixture formation is %f cal/mol\"%(delta_G_mix);\n",
+ "print \"The value of enthalpy change for equimolar mixture formation is %f cal/mol\"%(delta_H_mix);\n",
+ "\n",
+ "#Work required for separation of mixture into pure components is\n",
+ "W = delta_G_mix;\n",
+ "print \"The least amount of work required for separation at 300 K is %f cal/mol\"%(W);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Gibbs free energy change for equimolar mixture formation is -388.185034 cal/mol\n",
+ "The value of enthalpy change for equimolar mixture formation is 25.000000 cal/mol\n",
+ "The least amount of work required for separation at 300 K is -388.185034 cal/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.10 Page Number : 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Comparision of Margules and van Laar eqations\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "from numpy import zeros\n",
+ "from scipy.stats import linregress\n",
+ "\n",
+ "# Variables,\n",
+ "T = 25 +173.15;\t\t\t#[K] - Temperature\n",
+ "x_1=[0.0115,0.0160,0.0250,0.0300,0.0575,0.1125,0.1775,0.2330,0.4235,0.5760,0.6605,0.7390,0.8605,0.9250,0.9625];\n",
+ "y_1=[8.0640,7.6260,7.2780,7.2370,5.9770,4.5434,3.4019,2.8023,1.7694,1.3780,1.2302,1.1372,1.0478,1.0145,1.0070];\n",
+ "y_2=[1.0037,1.0099,1.0102,1.0047,1.0203,1.0399,1.1051,1.1695,1.4462,1.8520,2.2334,2.6886,3.7489,4.8960,5.6040];\n",
+ "\n",
+ "x_2 = zeros(15);\t\t\t# x_2 = (1 - x_1)\n",
+ "G_RT = zeros(15);\t\t\t# G_RT = G_excess/(R*T)\n",
+ "x1x2_G_RT = zeros(15);\t\t\t# x1x2_G_RT = (x_1*x_2/(G_excess/(R*T)))\n",
+ "G_RTx1x2 = zeros(15);\t\t\t# G_RTx1x1 = G_excess/(R*T*x_1*x_2)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(15):\n",
+ " x_2[i]=(1-x_1[i]);\n",
+ " G_RT[i]=(x_1[i]*math.log(y_1[i]))+(x_2[i]*math.log(y_2[i]));\n",
+ " x1x2_G_RT[i]=(x_1[i]*x_2[i])/G_RT[i];\n",
+ " G_RTx1x2[i]=1/x1x2_G_RT[i];\n",
+ "\n",
+ "\n",
+ "slop,intr,sig,d,e=linregress(x_1,x1x2_G_RT);\n",
+ "\n",
+ "A = 1/intr;\n",
+ "B = 1/(slop+(1/A));\n",
+ "print \" The value of van Laar parameters are A = %f and B = %f\"%(A,B);\n",
+ "\n",
+ "# Now from Margules equation\n",
+ "# G_RTx1x2 = G_excess/(R*T*x_1*x_2) = B1*x_1 + A1*x_1 = A1 + (B1 - A1)*x_1\n",
+ "#slope = (B1 - A1) and intercept = A1\n",
+ "\n",
+ "# Again employing the concept of linear regression of the data ( x_1 , G_RTx1x2 ) to find the value of intercept and slope of the above equation\n",
+ "#Let slope = slop1 and intercept = intr1\n",
+ "\n",
+ "slop1,intr1,sig1,d,e=linregress(x_1,G_RTx1x2);\n",
+ "\n",
+ "A1 = intr1;\n",
+ "B1 = slop1 + A1;\n",
+ "print \" The value of Margules parameters are A = %f and B = %f\"%(A1,B1);\n",
+ "\n",
+ "print \" Because of the higher value of correlation factor for Van Laar model it fits the data better.\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of van Laar parameters are A = 2.271326 and B = 1.781420\n",
+ " The value of Margules parameters are A = 2.293274 and B = 1.746000\n",
+ " Because of the higher value of correlation factor for Van Laar model it fits the data better.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.11 Page Number : 470"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of activity coefficients\n",
+ "\n",
+ "# Variables,\n",
+ "T = 60 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n",
+ "#component 1 = acetone\n",
+ "#component 2 = water\n",
+ "x_1 = 0.3;\t\t\t# Mole fraction of component 1\n",
+ "x_2 = 1 - x_1;\t\t\t#Mole fraction of component 2\n",
+ "V_mol_1 = 74.05;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1\n",
+ "V_mol_2 = 18.07;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2\n",
+ "\n",
+ "#for Wilson equation\n",
+ "a_12 = 291.27;\t\t\t#[cal/mol]\n",
+ "a_21 = 1448.01;\t\t\t#[cal/mol]\n",
+ "\n",
+ "#For NRTL\n",
+ "b_12 = 631.05;\t\t\t#[cal/mol]\n",
+ "b_21 = 1197.41;\t\t\t#[cal/mol]\n",
+ "alpha = 0.5343;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Froom wilson equation\n",
+ "A_12=(V_mol_2/V_mol_1)*(math.exp(-a_12/(R*T)));\n",
+ "A_21 = (V_mol_1/V_mol_2)*(math.exp(-a_21/(R*T)));\n",
+ "Beta = A_12/(x_1+x_2*A_12) - A_21/(x_2+x_1*A_21);\n",
+ "#math.log(Y1) = -math.log(x_1 + x_2*A_12) + x_2*Beta; \n",
+ "Y1 = math.exp(-math.log(x_1+x_2*A_12)+x_2*Beta);\n",
+ "#similarly for Y2\n",
+ "Y2 = math.exp(-math.log(x_2+x_1*A_21)-x_1*Beta);\n",
+ "print \"The value of activity coefficients for Wilson equation are Y1 = %f \\t and \\t Y2 = %f\"%(Y1,Y2);\n",
+ "\n",
+ "#From NRTL equation,\n",
+ "t_12 = b_12/(R*T);\n",
+ "t_21 = b_21/(R*T);\n",
+ "G_12 = math.exp(-alpha*t_12);\n",
+ "G_21 = math.exp(-alpha*t_21);\n",
+ "\n",
+ "#math.log(Y1) = x_1**(2)*[t_12*(G_12/(x_1+x_2*G_12))**(2) + (G_12*t_12)/((G_12/(x_1+x_2*G_12))**(2))]\n",
+ "Y1_prime = math.exp(x_2**(2)*(t_21*(G_21/(x_1+x_2*G_21))**(2)+(G_12*t_12)/(((x_2+x_1*G_12))**(2))));\n",
+ "#Similarly for Y2\n",
+ "Y2_prime = math.exp(x_1**(2)*(t_12*(G_12/(x_2+x_1*G_12))**(2)+(G_21*t_21)/(((x_1+x_2*G_21))**(2))));\n",
+ "\n",
+ "print \"The value of activity coefficients for NRTL equation are Y1 = %f \\t and \\t Y2 = %f\"%(Y1_prime,Y2_prime);\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of activity coefficients for Wilson equation are Y1 = 2.172258 \t and \t Y2 = 1.254121\n",
+ "The value of activity coefficients for NRTL equation are Y1 = 2.143030 \t and \t Y2 = 1.262506\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.12 Page Number : 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of activity coefficients\n",
+ "\n",
+ "# Variables \n",
+ "T = 307;\t\t\t#[K]\n",
+ "x_1 = 0.047;\n",
+ "x_2 = 1 - x_1;\n",
+ "\n",
+ "# The subgroups in the two components are\n",
+ "# Acetone (1) : 1 CH3, 1 CH3CO\n",
+ "# n-pentane (2) : 2 CH3, 3 CH2\n",
+ "\n",
+ "#Group volume (Rk) and surface area (Qk) parameters of the subgroup are\n",
+ "k_CH3 = 1;\n",
+ "k_CH2 = 2;\n",
+ "k_CH3CO = 19;\n",
+ "Rk_CH3 = 0.9011;\n",
+ "Rk_CH2 = 0.6744;\n",
+ "Rk_CH3CO = 1.6724;\n",
+ "Qk_CH3 = 0.848;\n",
+ "Qk_CH2 = 0.540;\n",
+ "Qk_CH3CO = 1.4880;\n",
+ "\n",
+ "# Interaction parameters of the subgroups in kelvin (K) are\n",
+ "a_1_1 = 0;\n",
+ "a_1_2 = 0;\n",
+ "a_1_19 = 476.40;\n",
+ "a_2_1 = 0;\n",
+ "a_2_2 = 0;\n",
+ "a_2_19 = 476.40;\n",
+ "a_19_1 = 26.76;\n",
+ "a_19_2 = 26.76;\n",
+ "a_19_19 = 0;\n",
+ "\n",
+ "# Calculations\n",
+ "r_1 = 1*Rk_CH3 + 1*Rk_CH3CO;\n",
+ "r_2 = 2*Rk_CH3 + 3*Rk_CH2;\n",
+ "q_1 = 1*Qk_CH3 + 1*Qk_CH3CO;\n",
+ "q_2 = 2*Qk_CH3 + 3*Qk_CH2;\n",
+ "\n",
+ "J_1 = r_1/(r_1*x_1+r_2*x_2);\n",
+ "J_2 = r_2/(r_1*x_1+r_2*x_2);\n",
+ "L_1 = q_1/(q_1*x_1+q_2*x_2);\n",
+ "L_2 = q_2/(q_1*x_1+q_2*x_2);\n",
+ "t_1_1 = math.exp(-a_1_1/T);\n",
+ "t_1_2 = math.exp(-a_1_2/T);\n",
+ "t_1_19 = math.exp(-a_1_19/T);\n",
+ "t_2_1 = math.exp(-a_2_1/T);\n",
+ "t_2_2 = math.exp(-a_2_2/T);\n",
+ "t_2_19 = math.exp(-a_2_19/T);\n",
+ "t_19_1 = math.exp(-a_19_1/T);\n",
+ "t_19_2 = math.exp(-a_19_2/T);\n",
+ "t_19_19 = math.exp(-a_19_19/T);\n",
+ "\n",
+ "e_1_1 = 1*Qk_CH3/q_1;\n",
+ "e_2_1 = 0;\n",
+ "e_19_1 = (1*Qk_CH3CO/q_1);\n",
+ "e_1_2 = 2*Qk_CH3/q_2;\n",
+ "e_2_2 = 3*Qk_CH2/q_2;\n",
+ "e_19_2 = 0;\n",
+ "\n",
+ "B_1_1 = e_1_1*t_1_1 + e_2_1*t_2_1 + e_19_1*t_19_1;\n",
+ "B_1_2 = e_1_1*t_1_2 + e_2_1*t_2_2 + e_19_1*t_19_2;\n",
+ "B_1_19 = e_1_1*t_1_19 + e_2_1*t_2_19 + e_19_1*t_19_19;\n",
+ "B_2_1 = e_1_2*t_1_1 + e_2_2*t_2_1 + e_19_2*t_19_1;\n",
+ "B_2_2 = e_1_2*t_1_2 + e_2_2*t_2_2 + e_19_2*t_19_2;\n",
+ "B_2_19 = e_1_2*t_1_19 + e_2_2*t_2_19 + e_19_2*t_19_19;\n",
+ "\n",
+ "theta_1 = (x_1*q_1*e_1_1 + x_2*q_2*e_1_2)/(x_1*q_1 + x_2*q_2);\n",
+ "theta_2 = (x_1*q_1*e_2_1 + x_2*q_2*e_2_2)/(x_1*q_1 + x_2*q_2);\n",
+ "theta_19 = (x_1*q_1*e_19_1 + x_2*q_2*e_19_2)/(x_1*q_1 + x_2*q_2);\n",
+ "\n",
+ "s_1 = theta_1*t_1_1 + theta_2*t_2_1 + theta_19*t_19_1;\n",
+ "s_2 = theta_1*t_1_2 + theta_2*t_2_2 + theta_19*t_19_2;\n",
+ "s_19 = theta_1*t_1_19 + theta_2*t_2_19 + theta_19*t_19_19;\n",
+ "\n",
+ "# math.log(Y1_C) = 1 - J_1 + math.log(J_1) - 5*q_1*(1- (J_1/L_1) + math.log(J_1/L_1))\n",
+ "# math.log(Y2_C) = 1 - J_2 + math.log(J_2) - 5*q_2*(1- (J_2/L_2) + math.log(J_2/L_2))\n",
+ "Y1_C = math.exp(1 - J_1 + math.log(J_1) - 5*q_1*(1- (J_1/L_1) + math.log(J_1/L_1)));\n",
+ "Y2_C = math.exp(1 - J_2 + math.log(J_2) - 5*q_2*(1- (J_2/L_2) + math.log(J_2/L_2)));\n",
+ "\n",
+ "# For species 1\n",
+ "summation_theta_k_1 = theta_1*(B_1_1/s_1) + theta_2*(B_1_2/s_2) + theta_19*(B_1_19/s_19);\n",
+ "summation_e_ki_1 = e_1_1*math.log(B_1_1/s_1) + e_2_1*math.log(B_1_2/s_2) + e_19_1*math.log(B_1_19/s_19);\n",
+ "\n",
+ "# For species 2\n",
+ "summation_theta_k_2 = theta_1*(B_2_1/s_1) + theta_2*(B_2_2/s_2) + theta_19*(B_2_19/s_19);\n",
+ "summation_e_ki_2 = e_1_2*math.log(B_2_1/s_1) + e_2_2*math.log(B_2_2/s_2) + e_19_2*math.log(B_2_19/s_19);\n",
+ "\n",
+ "# math.log(Y1_R) = q_1(1 - summation_theta_k_1 + summation_e_ki_1)\n",
+ "# math.log(Y2_R) = q_2(1 - summation_theta_k_2 + summation_e_ki_2)\n",
+ "Y1_R = math.exp(q_1*(1 - summation_theta_k_1 + summation_e_ki_1));\n",
+ "Y2_R = math.exp(q_2*(1 - summation_theta_k_2 + summation_e_ki_2));\n",
+ "\n",
+ "# math.log(Y1) = math.log(Y1_C) + math.log(Y1_R)\n",
+ "# math.log(Y2) = math.log(Y2_C) + math.log(Y2_R)\n",
+ "Y1 = math.exp(math.log(Y1_C) + math.log(Y1_R));\n",
+ "Y2 = math.exp(math.log(Y2_C) + math.log(Y2_R));\n",
+ "\n",
+ "# Results\n",
+ "print \" The activity coefficients are Y1 = %f and Y2 = %f\"%(Y1,Y2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The activity coefficients are Y1 = 4.992034 and Y2 = 1.005260\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.13 Page Number : 481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of activity coefficients\n",
+ "\n",
+ "# Variables,\n",
+ "T = 25 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n",
+ "#component 1 = chloroform\n",
+ "#component 2 = carbon tetrachloride\n",
+ "x_1 = 0.5;\t\t\t#Mole fraction of component 1 \t\t\t#Equimolar mixture\n",
+ "x_2 = 0.5;\t\t\t#Mole fraction of component 2\n",
+ "V_mol_1 = 81;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1\n",
+ "V_mol_2 = 97;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2\n",
+ "del_1 = 9.2;\t\t\t#[(cal/cm**(3))**(1/2)] - Mole fraction of component 1\n",
+ "del_2 = 8.6;\t\t\t#[(cal/cm**(3))**(1/2)] - Mole fraction of component 2\n",
+ "\n",
+ "# Calculations\n",
+ "#Scatchard - Hilderbrand model\n",
+ "phi_1 = (x_1*V_mol_1)/(x_1*V_mol_1+x_2*V_mol_2);\n",
+ "phi_2 = (x_2*V_mol_2)/(x_1*V_mol_1+x_2*V_mol_2);\n",
+ "\n",
+ "#math.log(Y1) = (V_mol_1/(R*T))*phi_1**(2)*(del_1-del_2)**(2)\n",
+ "Y1 = math.exp((V_mol_1/(R*T))*(phi_1**(2))*((del_1-del_2)**(2)));\n",
+ "\n",
+ "#Similarly, for Y2\n",
+ "Y2 = math.exp((V_mol_2/(R*T))*(phi_2**(2))*((del_1-del_2)**(2)));\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of activity coefficients for Scatchard-Hilderbrand model are Y1 = %f \\t and \\t Y2 = %f\"%(Y1,Y2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of activity coefficients for Scatchard-Hilderbrand model are Y1 = 1.010245 \t and \t Y2 = 1.017658\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.14 Page Number : 485"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of activity coefficients\n",
+ "\n",
+ "# Variables,\n",
+ "T = 25 + 273.15;\t\t\t#[K] - Temperature\n",
+ "mol_HCl = 0.001;\t\t\t#[mol/kg] - Molality of HCl\n",
+ "A = 0.510;\t\t\t#[(kg/mol)**(1/2)]\n",
+ "Z_positive = 1;\t\t\t#Stoichiometric coefficient of 'H' ion\n",
+ "Z_negative = -1;\t\t\t#Stoichiometric coefficient of 'Cl' ion\n",
+ "m_H_positive = mol_HCl;\t\t\t#\n",
+ "m_Cl_negative = mol_HCl;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# I = 1/2*[((Z_positive)**(2))*m_H_positive + ((Z_negative)**(2))*m_Cl_negative]\n",
+ "I = 1./2*(((Z_positive)**(2))*m_H_positive + ((Z_negative)**(2))*m_Cl_negative);\n",
+ "\n",
+ "#Using Debye-Huckel limiting law wee get,\n",
+ "# math.log(Y1) = -A*(abs(Z_positive*Z_negative))*(I**(1/2)))\n",
+ "Y = 10**(-A*(abs(Z_positive*Z_negative))*(I**(1./2)));\n",
+ "print \"The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = %f\"%(Y);\n",
+ "\n",
+ "#Using Debye-Huckel extended model we get\n",
+ "#math.log(Y_prime) = (-A*(abs(Z_positive*Z_negative))*(I**(1/2)))/(1 + (I**(1/2)));\n",
+ "Y_prime = 10**((-A*(abs(Z_positive*Z_negative))*(I**(1./2)))/(1 + (I**(1./2))));\n",
+ "print \"The mean activity coefficient at 25 C using Debye-Huckel extended model is Y = %f\"%(Y_prime);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = 0.963546\n",
+ "The mean activity coefficient at 25 C using Debye-Huckel extended model is Y = 0.964643\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.15 Page Number : 485"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of activity coefficients\n",
+ "\n",
+ "# Variables,\n",
+ "T = 25 + 273.15;\t\t\t#[K] - Temperature\n",
+ "mol_CaCl2 = 0.001;\t\t\t#[mol/kg] - Molality of HCl\n",
+ "A = 0.510;\t\t\t#[(kg/mol)**(1/2)]\n",
+ "Z_positive = 2;\t\t\t#Stoichiometric coefficient of 'Ca' ion\n",
+ "Z_negative = -1;\t\t\t#Stoichiometric coefficient of 'Cl' ion\n",
+ "m_Ca_positive = mol_CaCl2;\n",
+ "m_Cl_negative = 2*mol_CaCl2;\n",
+ "\n",
+ "# Calculations\n",
+ "# I = 1/2*[((Z_positive)**(2))*m_Ca_positive + ((Z_negative)**(2))*m_Cl_negative]\n",
+ "I = 1./2*(((Z_positive)**(2))*m_Ca_positive + ((Z_negative)**(2))*m_Cl_negative);\n",
+ "\n",
+ "#Using Debye-Huckel limiting law wee get,\n",
+ "# math.log(Y1) = -A*(abs(Z_positive*Z_negative))*(I**(1/2)))\n",
+ "Y = 10**(-A*(abs(Z_positive*Z_negative))*(I**(1./2)));\n",
+ "\n",
+ "# Results\n",
+ "print \"The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = %f\"%(Y);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = 0.879290\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.17 Page Number : 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Proving a mathematical relation\n",
+ "\n",
+ "# Variables,\n",
+ "T = 50 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "x_1 = 0.3;\t\t\t# Mole fraction of component 1\n",
+ "x_2 = (1-x_1);\t\t\t# Mole fraction of component 2\n",
+ "#Increment of 1% means Y2 = 1.01*Y1\n",
+ "\n",
+ "# Calculations\n",
+ "#Excess volume of the mixture is given by,\n",
+ "V_excess = 4*x_1*x_2;\t\t\t#[cm**(3)/mol]\n",
+ "#Amd threfore\n",
+ "V_1_excess = 4*x_2*x_2*10**(-6);\t\t\t#[m**(3)/mol] - Exces volume of component 1\n",
+ "V_2_excess = 4*x_1*x_1*10**(-6);\t\t\t#[m**(3)/mol] - Exces volume of component 2\n",
+ "\n",
+ "#We have from equation 14.89 of the book,\n",
+ "#V_i_excess/(R*T) = (del_math.log(Y_i)/del_P)_T,x\n",
+ "\n",
+ "#Rearranging above equation\n",
+ "#d(math.log(Y1)) = (V1_excess/(R*T))dP\n",
+ "#Integrating the above equation at constant 'T' and 'x' in the limit from 'Y1' to '1.01*Y1' in the LHS and from 'P' to 'P+delta_P' in the RHS\n",
+ "#On simplification we get\n",
+ "#math.log(1.01*Y1/Y1) = (V_1_exces/(R*T))*delta_P\n",
+ "delta_P = math.log(1.01)/(V_1_excess/(R*T));\t\t\t#[N/m**(2)]\n",
+ "delta_P = delta_P*10**(-6);\t\t\t#[MPa]\n",
+ "\n",
+ "# Results\n",
+ "print \"The required pressure to increase the activity coefficient by 1%% is %f MPa\"%(delta_P);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required pressure to increase the activity coefficient by 1% is 13.639411 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.21 Page Number : 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculation of enthalpy entropy and Gibbs free energy\n",
+ "\n",
+ "# Variables\n",
+ "T = 293.15;\t\t\t#[K] - Temperature\n",
+ "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "A = 1280;\t\t\t#[J/mol]\n",
+ "\n",
+ "#(dA/dT)_P,x = del_A (say)\n",
+ "dA_dT = -7.0;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "#For equilomar mixture,\n",
+ "x_1 = 0.5;\t\t\t# Mole fraction of component 1\n",
+ "x_2 = 0.5;\t\t\t# Mole fraction of component 2\n",
+ "\n",
+ "# Calculations\n",
+ "#math.log(Y1) = (A/(R*T))*x_2**(2)\n",
+ "#math.log(Y2) = (A/(R*T))*x_1**(2)\n",
+ "Y1 = math.exp((A/(R*T))*x_2**(2));\n",
+ "Y2 = math.exp((A/(R*T))*x_1**(2));\n",
+ "\n",
+ "#G_excess/(R*T*) = x_1*math.log(Y1) + x_2*math.log(Y2) = (A/(R*T))*x_1*x_2\n",
+ "G_excess = A*x_1*x_2;\t\t\t#[J/mol] - Excess Gibbs free energy\n",
+ "\n",
+ "#H_excess/(R*T**(2)) = -[d/dT(G_excess/(R*T))]_P,x\n",
+ "#H_excess/(R*T**(2)) = -((x_1*x_2)/R)*[d/dT(A/T)]_P,x\n",
+ "#On simplification and putting the values we get\n",
+ "H_excess = A*x_1*x_2 - T*dA_dT*x_1*x_2;\t\t\t#[J/mol] - Excess enthalpy\n",
+ "\n",
+ "#Now excess entropy is given by\n",
+ "S_excess = (H_excess - G_excess)/T;\t\t\t#[J/mol-K] - Excess entropy\n",
+ "\n",
+ "# Results\n",
+ "print \"For equimolar mixture\";\n",
+ "print \"Excess Gibbs free energy G_excess) is %f J/mol\"%(G_excess);\n",
+ "print \"Excess enthalpy H_excess) is %f J/mol\"%(H_excess);\n",
+ "print \"Excess entropy S_excess) is %f J/mol\"%(S_excess);\n",
+ "print \"The value of activity coefficient Y1 is %f\"%(Y1);\n",
+ "print \"The value of activity coefficient Y2 is %f\"%(Y2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For equimolar mixture\n",
+ "Excess Gibbs free energy G_excess) is 320.000000 J/mol\n",
+ "Excess enthalpy H_excess) is 833.012500 J/mol\n",
+ "Excess entropy S_excess) is 1.750000 J/mol\n",
+ "The value of activity coefficient Y1 is 1.140305\n",
+ "The value of activity coefficient Y2 is 1.140305\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.22 Page Number : 491"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of Gibbs free energy and enthalpy change\n",
+ "\n",
+ "# Given\n",
+ "T = 60 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# math.log(Y1_inf) = math.log(Y2_inf) = 0.15 + 10/T\n",
+ "\n",
+ "# Since the two liquids are slightly dissimilar , we assume the activity coeffiecients to follow van Laar equation \n",
+ "# From van L# Variablesr equation \n",
+ "# A = math.log(Y1_inf) and B = math.log(Y2_inf) and since it is given that math.log(Y1_inf) = math.log(Y2_inf), therefore A = B\n",
+ "#(x_1*x_2)/(G_excess/R*T) = x_1/B + x_2/A = X_1/A + x_2/A = 1/A\n",
+ "# G_excess/(R*T) = A*x_1*x_2\n",
+ "\n",
+ "# For equilomar mixture,\n",
+ "x_1 = 0.5;\t\t\t# Mole fraction of component 1\n",
+ "x_2 = 0.5;\t\t\t# Mole fraction of component 2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# Expression for A can be written as\n",
+ "# A = 0.15 + 10/T, where T is in C. Therefore\n",
+ "A = 0.15 + 10/(T - 273.15);\n",
+ "# Differentiating it with respect to temprature we get\n",
+ "dA_dT = - 10/((T-273.15)**(2));\n",
+ "\n",
+ "# The excess Gibbs free energy can be calculated as\n",
+ "G_excess = A*x_1*x_2*(R*T);\t\t\t#[J/mol]\n",
+ "\n",
+ "# The ideal Gibbs free energy change can be calculated as\n",
+ "delta_G_id_mix = R*T*(x_1*math.log(x_1) + x_2*math.log(x_2));\t\t\t#[J/mol]\n",
+ "\n",
+ "# Finally we have,\n",
+ "delta_G_mix = G_excess + delta_G_id_mix;\t\t\t#[J/mol]\n",
+ "\n",
+ "print \"The Gibbs free energy change of mixing for equimolar mixture is %f J/mol\"%(delta_G_mix);\n",
+ "\n",
+ "\n",
+ "# Now let us determine the excess enthalpy. We know that\n",
+ "# H_excess/(R*T**(2)) = -[d/dT(G_excess/R*T)]_P,x = - x_1*x_2*[d/dT(A)]_P,x\n",
+ "# Therefore at 'T' = 60 C the excess enthalpy is given by\n",
+ "H_excess = -R*(T**(2))*x_1*x_2*dA_dT;\t\t\t#[J/mol]\n",
+ "\n",
+ "delta_H_id_mix = 0;\t\t\t#[J/mol] - Enthalpy change of mixing for ideal solution is zero.\n",
+ "\n",
+ "#Thus enthalpy change of mixing for an equimolar mixture at 333.15 K is given by\n",
+ "delta_H_mix = delta_H_id_mix + H_excess;\t\t\t#[J/mol]\n",
+ "\n",
+ "\n",
+ "print \"The enthalpy change of mixing for equimolar mixture is %f J/mol\"%(delta_H_mix);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Gibbs free energy change of mixing for equimolar mixture is -1700.608815 J/mol\n",
+ "The enthalpy change of mixing for equimolar mixture is 640.806876 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch15_1.ipynb b/Chemical_Engineering_Thermodynamics/ch15_1.ipynb
new file mode 100644
index 00000000..ad62c947
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch15_1.ipynb
@@ -0,0 +1,2103 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Vapour Liquid Equilibrium"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.1 Page Number : 503"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of number of moles in liquid and vapour phase\n",
+ "\n",
+ "# Variables\n",
+ "T = 90+ 273.15;\t\t\t#[K] - Temperature\n",
+ "P = 1;\t\t\t#[atm] - Pressure\n",
+ "x_1 = 0.5748;\t\t\t# Equilibrium composition of liquid phase\n",
+ "y_1 = 0.7725;\t\t\t# Equilibrium composition of vapour phase\n",
+ "\n",
+ "\t\t\t# We start with 1 mol of mixture of composition z_1 = 0.6, from marterial balance we get\n",
+ "\t\t\t# (L + V)*z_1 = L*x_1 + V*y_1\n",
+ "\t\t\t# Since total number of moles is 1, we get\n",
+ "\t\t\t# z_1 = L*x_1 + (1-L)*y_1\n",
+ "\n",
+ "# Calculations and Results\n",
+ "z_1_1 = 0.6;\t\t\t# - Mole fraction of benzene\n",
+ "L_1 = (z_1_1 - y_1)/(x_1 - y_1);\n",
+ "V_1 = 1 - L_1;\n",
+ "\n",
+ "print \" For z_1 = 0.6\";\n",
+ "print \" The moles in the liquid phase is %f mol\"%(L_1);\n",
+ "print \" The moles in the vapour phase is %f mol\"%(V_1);\n",
+ "\n",
+ "z_1_2 = 0.7;\t\t\t# - Mole fraction of benzene\n",
+ "L_2 = (z_1_2 - y_1)/(x_1 - y_1);\n",
+ "V_2 = 1 - L_2;\n",
+ "\n",
+ "print \" For z_1 = 0.7\";\n",
+ "print \" The moles in the liquid phase is %f mol\"%(L_2);\n",
+ "print \" The moles in the vapour phase is %f mol\"%(V_2);\n",
+ "\n",
+ "\n",
+ "\t\t\t# For z = 0.8\n",
+ "\t\t\t# The feed remains vapour and the liquid is not formed at all as it is outside the two-phase region (x_1 = 0.5748 and y_1 = 0.7725).\n",
+ "print \" For z_1 = 0.8\";\n",
+ "print \" The feed remains vapour and the liquid is not formed at all as it is outside the two-phase region x_1 = 0.5748 and y_1 = 0.7725\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " For z_1 = 0.6\n",
+ " The moles in the liquid phase is 0.872534 mol\n",
+ " The moles in the vapour phase is 0.127466 mol\n",
+ " For z_1 = 0.7\n",
+ " The moles in the liquid phase is 0.366717 mol\n",
+ " The moles in the vapour phase is 0.633283 mol\n",
+ " For z_1 = 0.8\n",
+ " The feed remains vapour and the liquid is not formed at all as it is outside the two-phase region x_1 = 0.5748 and y_1 = 0.7725\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.2 Page Number : 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure temperature and composition\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t# math.log(P_1_sat) = 14.39155 - 2795.817/(t + 230.002)\n",
+ "\t\t\t# math.log(P_2_sat) = 16.26205 - 3799.887/(t + 226.346)\n",
+ "\n",
+ "\t\t\t#(a)\n",
+ "x_1_a =0.43;\t\t\t# Equilibrium composition of liquid phase\n",
+ "t_a = 76;\t\t\t#[C] - Temperature\n",
+ "x_2_a = 1 - x_1_a;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# Since liquid phase composition is given we use the relation \n",
+ "\t\t\t# P = x_1*P_1_sat + x_2*P_2_sat\n",
+ "\t\t\t# At t = 76 C\n",
+ "P_1_sat_a = math.exp(14.39155 - 2795.817/(t_a + 230.002));\n",
+ "P_2_sat_a = math.exp(16.26205 - 3799.887/(t_a + 226.346));\n",
+ "\t\t\t# Therefore total pressure is\n",
+ "P_a = x_1_a*P_1_sat_a + x_2_a*P_2_sat_a;\t\t\t#[kPa]\n",
+ "y_1_a = (x_1_a*P_1_sat_a)/(P_a);\n",
+ "y_2_a = (x_2_a*P_2_sat_a)/(P_a);\n",
+ "\n",
+ "print \"a).The system pressure is = %f kPa\"%(P_a);\n",
+ "print \" The vapour phase composition is y_1 = %f\"%(y_1_a);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "y_1_b = 0.43;\t\t\t# Equilibrium composition of vapour phase\n",
+ "y_2_b = 1 - y_1_b;\n",
+ "t_b = 76;\t\t\t#[C] - Temperature\n",
+ "\n",
+ "P_1_sat_b = math.exp(14.39155 - 2795.817/(t_b + 230.002));\n",
+ "P_2_sat_b = math.exp(16.26205 - 3799.887/(t_b + 226.346));\n",
+ "\n",
+ "\t\t\t# Since vapour phase composition is given ,the system pressure is given by\n",
+ "\t\t\t# 1/P = y_1/P_1_sat + y_2/P_2_sat\n",
+ "P_b = 1/(y_1_b/P_1_sat_b + y_2_b/P_2_sat_b);\n",
+ "\n",
+ "x_1_b = (y_1_b*P_b)/P_1_sat_b;\n",
+ "x_2_b = (y_2_b*P_b)/P_2_sat_b;\n",
+ "\n",
+ "print \"b).The system pressure is P = %f kPa\"%(P_b);\n",
+ "print \" The liquid phase composition is x_1 = %f\"%(x_1_b);\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "x_1_c = 0.32;\t\t\t# Equilibrium composition of liquid phase\n",
+ "x_2_c = 1 - x_1_c;\n",
+ "P_c = 101.33;\t\t\t#[kPa] - Pressure of the system\n",
+ "\n",
+ "\t\t\t# We have, P = x_1*P_1_sat + x_2*P_2_sat\n",
+ "t_1_sat = 2795.817/(14.39155 - math.log(P_c)) - 230.002;\n",
+ "t_2_sat = 3799.887/(16.26205 - math.log(P_c)) - 226.346;\n",
+ "t = x_1_c*t_1_sat + x_2_c*t_2_sat;\n",
+ "\n",
+ "error = 10;\n",
+ "while(error>0.1):\n",
+ " P_1_sat = math.exp(14.39155 - 2795.817/(t + 230.002));\n",
+ " P_2_sat = math.exp(16.26205 - 3799.887/(t + 226.346));\n",
+ " P = x_1_c*P_1_sat + x_2_c*P_2_sat;\n",
+ " error=abs(P - P_c);\n",
+ " t = t - 0.1;\n",
+ "\n",
+ "P_1_sat_c = math.exp(14.39155 - 2795.817/(t + 230.002));\n",
+ "P_2_sat_c = math.exp(16.26205 - 3799.887/(t + 226.346));\n",
+ "\n",
+ "y_1_c = (x_1_c*P_1_sat_c)/(P_c);\n",
+ "y_2_c = 1 - y_1_c;\n",
+ "\n",
+ "print \"c).The system temperature is t = %f C\"%(t);\n",
+ "print \" The vapour phase composition is y_1 = %f\"%(y_1_c);\n",
+ "\n",
+ "\t\t\t#(d)\n",
+ "y_1_d = 0.57;\t\t\t# Vapour phase composition\n",
+ "y_2_d = 1 - y_1_d;\n",
+ "P_d = 101.33;\t\t\t#[kPa] - Pressure of the system\n",
+ "\n",
+ "\t\t\t# Since vapour phase composition is given, we can use the relation\n",
+ "\t\t\t# 1/P = y_1/P_1_sat + y_2/P_2_sat\n",
+ "t_1_sat_d = 2795.817/(14.39155 - math.log(P_d)) - 230.002;\n",
+ "t_2_sat_d = 3799.887/(16.26205 - math.log(P_d)) - 226.346;\n",
+ "t_d = y_1_d*t_1_sat_d + y_2_d*t_2_sat_d;\n",
+ "\n",
+ "fault = 10;\n",
+ "while(fault>0.1):\n",
+ " P_1_sat_prime = math.exp(14.39155 - 2795.817/(t_d + 230.002));\n",
+ " P_2_sat_prime = math.exp(16.26205 - 3799.887/(t_d + 226.346));\n",
+ " P_prime = 1/(y_1_d/P_1_sat_prime + y_2_d/P_2_sat_prime);\n",
+ " fault=abs(P_prime - P_d);\n",
+ " t_d = t_d + 0.01;\n",
+ "\n",
+ "P_1_sat_d = math.exp(14.39155 - 2795.817/(t_d + 230.002));\n",
+ "P_2_sat_d = math.exp(16.26205 - 3799.887/(t_d + 226.346));\n",
+ "\n",
+ "x_1_d = (y_1_d*P_d)/(P_1_sat_d);\n",
+ "x_2_d = 1 - x_1_d;\n",
+ "\n",
+ "print \"d).The system temperature is t = %f C\"%(t_d);\n",
+ "print \" The liquid phase composition is x_1 = %f\"%(x_1_d);\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a).The system pressure is = 105.268363 kPa\n",
+ " The vapour phase composition is y_1 = 0.782290\n",
+ "b).The system pressure is P = 60.894254 kPa\n",
+ " The liquid phase composition is x_1 = 0.136725\n",
+ "c).The system temperature is t = 79.943314 C\n",
+ " The vapour phase composition is y_1 = 0.679347\n",
+ "d).The system temperature is t = 84.600005 C\n",
+ " The liquid phase composition is x_1 = 0.234934\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.3 Page Number : 516"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure temperature and composition\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t# math.log(P_1_sat) = 14.3916 - 2795.82/(t + 230.00)\n",
+ "\t\t\t# math.log(P_2_sat) = 14.2724 - 2945.47/(t + 224.00)\n",
+ "\t\t\t# math.log(P_3_sat) = 14.2043 - 2972.64/(t + 209.00)\n",
+ "\n",
+ "\t\t\t#(a)\n",
+ "x_1_a = 0.25;\t\t\t# Equilibrium composition of liquid phase\n",
+ "x_2_a = 0.35;\n",
+ "x_3_a = 1 - x_1_a - x_2_a;\n",
+ "t_a = 80;\t\t\t#[C] - Temperature\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# At t = 80 C\n",
+ "P_1_sat_a = math.exp(14.3916 - 2795.82/(t_a + 230.00));\n",
+ "P_2_sat_a = math.exp(14.2724 - 2945.47/(t_a + 224.00));\n",
+ "P_3_sat_a = math.exp(14.2043 - 2972.64/(t_a + 209.00));\n",
+ "\n",
+ "\t\t\t# Since liquid phase composition is given we use the relation \n",
+ "P_a = x_1_a*P_1_sat_a + x_2_a*P_2_sat_a + x_3_a*P_3_sat_a;\t\t\t#[kPa]\n",
+ "\n",
+ "y_1_a = (x_1_a*P_1_sat_a)/(P_a);\n",
+ "y_2_a = (x_2_a*P_2_sat_a)/(P_a);\n",
+ "y_3_a = (x_3_a*P_3_sat_a)/(P_a);\n",
+ "\n",
+ "print \"a).The system pressure is P = %f kPa\"%(P_a);\n",
+ "print \" The vapour phase composition is given by y_1 = %f y_2 = %f and y_3 = %f \"%(y_1_a,y_2_a,y_3_a);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "y_1_b = 0.50;\t\t\t# Equilibrium composition of liquid phase\n",
+ "y_2_b = 0.30;\n",
+ "y_3_b = 1 - y_1_a - y_2_a;\n",
+ "t_b = 85;\t\t\t#[C] - Temperature\n",
+ "\n",
+ "\t\t\t# At t = 80 C\n",
+ "P_1_sat_b = math.exp(14.3916 - 2795.82/(t_b + 230.00));\n",
+ "P_2_sat_b = math.exp(14.2724 - 2945.47/(t_b + 224.00));\n",
+ "P_3_sat_b = math.exp(14.2043 - 2972.64/(t_b + 209.00));\n",
+ "\n",
+ "\t\t\t# Since vapour phase composition is given we use the relation \n",
+ "P_b = 1/(y_1_b/P_1_sat_b + y_2_b/P_2_sat_b + y_3_b/P_3_sat_b);\t\t\t#[kPa]\n",
+ "\n",
+ "\t\t\t# Therefore we have\n",
+ "x_1_b = (y_1_b*P_b)/P_1_sat_b;\n",
+ "x_2_b = (y_2_b*P_b)/P_2_sat_b;\n",
+ "x_3_b = (y_3_b*P_b)/P_3_sat_b;\n",
+ "\n",
+ "print \"b).The system pressure is P = %f kPa\"%(P_b);\n",
+ "print \" The liquid phase composition is given by x_1 = %f x_2 = %f and x_3 = %f \"%(x_1_b,x_2_b,x_3_b);\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "x_1_c = 0.30;\t\t\t# Equilibrium composition of liquid phase\n",
+ "x_2_c = 0.45;\n",
+ "x_3_c = 1 - x_1_c - x_2_c;\n",
+ "P_c = 80;\t\t\t#[kPa] - Pressure of the system\n",
+ "\n",
+ "\t\t\t# We have, P = x_1*P_1_sat + x_2*P_2_sat + x_3*P_3_sat\n",
+ "t_1_sat = 2795.82/(14.3916 - math.log(P_c)) - 230.00;\t\t\t#[C]\n",
+ "t_2_sat = 2945.47/(14.2724 - math.log(P_c)) - 224.00;\t\t\t#[C]\n",
+ "t_3_sat = 2972.64/(14.2043 - math.log(P_c)) - 209.00;\t\t\t#[C]\n",
+ "t = x_1_c*t_1_sat + x_2_c*t_2_sat + x_3_c*t_3_sat;\n",
+ "\n",
+ "error = 10;\n",
+ "while(error>0.5):\n",
+ " P_1_sat = math.exp(14.3916 - 2795.82/(t + 230.00));\n",
+ " P_2_sat = math.exp(14.2724 - 2945.47/(t + 224.00));\n",
+ " P_3_sat = math.exp(14.2043 - 2972.64/(t + 209.00));\n",
+ " P = x_1_c*P_1_sat + x_2_c*P_2_sat + x_3_c*P_3_sat;\n",
+ " error=abs(P - P_c);\n",
+ " t = t - 0.2;\n",
+ "\n",
+ "P_1_sat_c = math.exp(14.3916 - 2795.82/(t + 230.00));\n",
+ "P_2_sat_c = math.exp(14.2724 - 2945.47/(t + 224.00));\n",
+ "P_3_sat_c = math.exp(14.2043 - 2972.64/(t + 209.00));\n",
+ "\n",
+ "y_1_c = (x_1_c*P_1_sat_c)/(P_c);\n",
+ "y_2_c = (x_2_c*P_2_sat_c)/(P_c);\n",
+ "y_3_c = 1 - y_1_c - y_2_c;\n",
+ "\n",
+ "print \"c).The system temperature is t = %f C\"%(t);\n",
+ "print \" The vapour phase composition is y_1 = %f y_2 %f and y_3 = %f\"%(y_1_c,y_2_c,y_3_c);\n",
+ "\n",
+ "\t\t\t#(d)\n",
+ "y_1_d = 0.6;\t\t\t# Vapour phase composition\n",
+ "y_2_d = 0.2;\n",
+ "y_3_d = 1 - y_1_d - y_2_d;\n",
+ "P_d = 90;\t\t\t#[kPa] - Pressure of the system\n",
+ "\n",
+ "\t\t\t# Since vapour phase composition is given, we can use the relation\n",
+ "\t\t\t# 1/P = y_1/P_1_sat + y_2/P_2_sat + y_3/P_3_sat\n",
+ "t_1_sat_d = 2795.82/(14.3916 - math.log(P_d)) - 230.00;\n",
+ "t_2_sat_d = 2945.47/(14.2724 - math.log(P_d)) - 224.00;\n",
+ "t_3_sat_d = 2972.64/(14.2043 - math.log(P_d)) - 209.00;\n",
+ "t_d = y_1_d*t_1_sat_d + y_2_d*t_2_sat_d + y_3_d*t_3_sat_d;\n",
+ "\n",
+ "fault = 10;\n",
+ "while(fault>0.5):\n",
+ " P_1_sat_prime = math.exp(14.3916 - 2795.82/(t_d + 230.00));\n",
+ " P_2_sat_prime = math.exp(14.2724 - 2945.47/(t_d + 224.00));\n",
+ " P_3_sat_prime = math.exp(14.2043 - 2972.64/(t_d + 209.00));\n",
+ " P_prime = 1/(y_1_d/P_1_sat_prime + y_2_d/P_2_sat_prime + y_3_d/P_3_sat_prime);\n",
+ " fault=abs(P_prime - P_d);\n",
+ " t_d = t_d + 0.2;\n",
+ "\n",
+ "P_1_sat_d = math.exp(14.3916 - 2795.82/(t_d + 230.00));\n",
+ "P_2_sat_d = math.exp(14.2724 - 2945.47/(t_d + 224.00));\n",
+ "P_3_sat_d = math.exp(14.2043 - 2972.64/(t_d + 209.00));\n",
+ "\n",
+ "x_1_d = (y_1_d*P_d)/(P_1_sat_d);\n",
+ "x_2_d = (y_2_d*P_d)/(P_2_sat_d);\n",
+ "x_3_d = 1 - x_1_d - x_2_d;\n",
+ "\n",
+ "print \"d).The system temperature is t = %f C\"%(t_d);\n",
+ "print \" The liquid phase composition is x_1 = %f x_2 = %f and x_3 = %f\"%(x_1_d,x_2_d,x_3_d);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a).The system pressure is P = 108.239332 kPa\n",
+ " The vapour phase composition is given by y_1 = 0.497672 y_2 = 0.316379 and y_3 = 0.185948 \n",
+ "b).The system pressure is P = 129.287998 kPa\n",
+ " The liquid phase composition is given by x_1 = 0.259997 x_2 = 0.338895 and x_3 = 0.401108 \n",
+ "c).The system temperature is t = 67.020387 C\n",
+ " The vapour phase composition is y_1 = 0.544826 y_2 0.357251 and y_3 = 0.097922\n",
+ "d).The system temperature is t = 73.127683 C\n",
+ " The liquid phase composition is x_1 = 0.307471 x_2 = 0.230183 and x_3 = 0.462346\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.4 Page Number : 519"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure and composition\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T = 120;\t\t\t#[C] - Temperature\n",
+ "P_1 = 1;\t\t\t#[atm] - Initial pressure\n",
+ "P_1 = P_1*101.325;\t\t\t#[kPa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "y_1 = 0.3;\t\t\t# Mole fraction of propane\n",
+ "y_2 = 0.5;\t\t\t# Mole fraction of butane\n",
+ "y_3 = 0.2;\t\t\t# Mole fraction of hexane\n",
+ "\n",
+ "\t\t\t# math.log(P_1_sat) = 13.7713 - 1892.47/(t + 248.82)\n",
+ "\t\t\t# math.log(P_2_sat) = 13.7224 - 2151.63/(t + 236.91)\n",
+ "\t\t\t# math.log(P_3_sat) = 13.8216 - 2697.55/(t + 224.37)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "P_1_sat = math.exp(13.7713 - 1892.47/(T + 248.82));\n",
+ "P_2_sat = math.exp(13.7224 - 2151.63/(T + 236.91));\n",
+ "P_3_sat = math.exp(13.8216 - 2697.55/(T + 224.37));\n",
+ "\n",
+ "\t\t\t# Since vapour phase composition is given we can use the relation,\n",
+ "P_2 = 1/(y_1/P_1_sat + y_2/P_2_sat + y_3/P_3_sat);\t\t\t#[kPa]\n",
+ "\n",
+ "print \" a).The pressure of the mixture when first drop condenses is given by P = %f kPa\"%(P_2);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "x_1 = (y_1*P_2)/P_1_sat;\n",
+ "x_2 = (y_2*P_2)/P_2_sat;\n",
+ "x_3 = (y_3*P_2)/P_3_sat;\n",
+ "\n",
+ "print \" b).The liquid phase composition is given by x_1 propane = %f x_2 butane = %f and x_3 hexane = %f \"%(x_1,x_2,x_3);\n",
+ "\n",
+ "\t\t\t# (c)\n",
+ "\t\t\t# Work transfer per mol is given by\n",
+ "\t\t\t# W = integral(P*dV) = integral((R*T/V)*dV) = R*T*math.log(V_2/V_1) = R*T*math.log(P_1/P_2)\n",
+ "w = R*(T+273.15)*math.log(P_1/P_2);\t\t\t#[J/mol]\n",
+ "\t\t\t# For 100 mol\n",
+ "W = w*100;\t\t\t#[J]\n",
+ "W = W*10**(-3);\t\t\t#[kJ]\n",
+ "print \" c).The work required for 100 mol of mixture handeled is %f kJ\"%(W);\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The pressure of the mixture when first drop condenses is given by P = 1278.060855 kPa\n",
+ " b).The liquid phase composition is given by x_1 propane = 0.067811 x_2 butane = 0.291139 and x_3 hexane = 0.641049 \n",
+ " c).The work required for 100 mol of mixture handeled is -828.526086 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.5 Page Number : 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure temperature and composition\n",
+ "\n",
+ "import math\n",
+ "# Variables\n",
+ "T = 27;\t\t\t#[C] - Temperature\n",
+ "\n",
+ "\t\t\t# math.log(P_1_sat) = 13.8216 - 2697.55/(t + 224.37)\n",
+ "\t\t\t# math.log(P_2_sat) = 13.8587 - 2911.32/(t + 216.64)\n",
+ "\n",
+ "\t\t\t#(a)\n",
+ "x_1_a = 0.2;\n",
+ "x_2_a = 1 - x_1_a;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# At t = 27 C\n",
+ "P_1_sat = math.exp(13.8216 - 2697.55/(T + 224.37));\t\t\t#[kPa]\n",
+ "P_2_sat = math.exp(13.8587 - 2911.32/(T + 216.64));\t\t\t#[kPa]\n",
+ "P_a = x_1_a*P_1_sat + x_2_a*P_2_sat;\t\t\t#[kPa]\n",
+ "\n",
+ "y_1_a = x_1_a*P_1_sat/P_a;\n",
+ "y_2_a = x_2_a*P_2_sat/P_a;\n",
+ "\n",
+ "print \"a).The total pressure is P = %f kPa\"%(P_a);\n",
+ "print \" The vapour phase composition is given by y_1 = %f and y_2 = %f\"%(y_1_a,y_2_a);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "y_1_b = 0.2;\n",
+ "y_2_b = 1 - y_1_b;\n",
+ "\t\t\t# Since vapour phase composition is given we can use the relation \n",
+ "P_b = 1/(y_1_b/P_1_sat + y_2_b/P_2_sat);\t\t\t#[kPa]\n",
+ "\n",
+ "\t\t\t# Therefore we have\n",
+ "x_1_b = (y_1_b*P_b)/P_1_sat;\n",
+ "x_2_b = (y_2_b*P_b)/P_2_sat;\n",
+ "\n",
+ "print \"b).The total pressure is, P = %f kPa\"%(P_b);\n",
+ "print \" The liquid phase composition is given by x_1 = %f and x_2 = %f\"%(x_1_b,x_2_b);\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "P_c = 30;\t\t\t#[kPa] - Total pressure\n",
+ "x_1_c = 0.2;\n",
+ "x_2_c = 1 - x_1_c;\n",
+ "\n",
+ "\t\t\t# We have, P = x_1*P_1_sat + x_2*P_2_sat\n",
+ "t_1_sat = 2697.55/(13.8216 - math.log(P_c)) - 224.37;\n",
+ "t_2_sat = 2911.32/(13.8587 - math.log(P_c)) - 216.64;\n",
+ "t = x_1_c*t_1_sat + x_2_c*t_2_sat;\n",
+ "\n",
+ "fault = 10;\n",
+ "while(fault>0.3):\n",
+ " P_1_sat = math.exp(13.8216 - 2697.55/(t + 224.37));\n",
+ " P_2_sat = math.exp(13.8587 - 2911.32/(t + 216.64));\n",
+ " P = x_1_c*P_1_sat + x_2_c*P_2_sat;\n",
+ " fault = abs(P - P_c);\n",
+ " t = t - 0.1;\n",
+ "\n",
+ "P_1_sat_c = math.exp(13.8216 - 2697.55/(t + 224.37));\n",
+ "P_2_sat_c = math.exp(13.8587 - 2911.32/(t + 216.64));\n",
+ "\n",
+ "y_1_c = (x_1_c*P_1_sat_c)/(P_c);\n",
+ "y_2_c = 1 - y_1_c;\n",
+ "\n",
+ "print \"c).The system temperature is t = %f C\"%(t);\n",
+ "print \" The vapour phase composition is y_1 = %f and y_2 = %f \"%(y_1_c,y_2_c);\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a).The total pressure is P = 9.795726 kPa\n",
+ " The vapour phase composition is given by y_1 = 0.448801 and y_2 = 0.551199\n",
+ "b).The total pressure is, P = 7.835131 kPa\n",
+ " The liquid phase composition is given by x_1 = 0.071288 and x_2 = 0.928712\n",
+ "c).The system temperature is t = 53.904663 C\n",
+ " The vapour phase composition is y_1 = 0.413592 and y_2 = 0.586408 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.6 Page Number : 521"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determinatin of DPT and BPT\n",
+ "\n",
+ "# Variables\n",
+ "P = 90;\t\t\t#[kPa] - Pressure\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# math.log(P_sat) = A - B/(t + C)\n",
+ "\n",
+ "\t\t\t# For benzene\n",
+ "A_1 = 13.8594;\n",
+ "B_1 = 2773.78;\n",
+ "C_1 = 220.07;\n",
+ "\t\t\t# For ethyl benzene\n",
+ "A_2 = 14.0045;\n",
+ "B_2 = 3279.47;\n",
+ "C_2 = 213.20;\n",
+ "\n",
+ "x_1 = 0.5;\t\t\t# Equimolar mixture\n",
+ "x_2 = 0.5;\n",
+ "\n",
+ "\t\t\t# The bubble point temperature equation is\n",
+ "\t\t\t# P = x_1*P_1_sat + x_2*P_2_sat\n",
+ "\n",
+ "# Calculations and Results\n",
+ "t_1_sat = B_1/(A_1 - math.log(P)) - C_1;\n",
+ "t_2_sat = B_2/(A_2 - math.log(P)) - C_2;\n",
+ "t = x_1*t_1_sat + x_2*t_2_sat;\n",
+ "\n",
+ "fault = 10;\n",
+ "while(fault>0.3):\n",
+ " P_1_sat = math.exp(A_1 - B_1/(t + C_1));\n",
+ " P_2_sat = math.exp(A_2 - B_2/(t + C_2));\n",
+ " P_net = x_1*P_1_sat + x_2*P_2_sat;\n",
+ " fault=abs(P_net - P);\n",
+ " t = t - 0.1;\n",
+ "\n",
+ "print \" The bubble point temperature is %f C\"%(t);\n",
+ "\n",
+ "\t\t\t# Now let us determine dew point temperature for y_1 = 0.5, and P = 90 kPa\n",
+ "y_1 = 0.5;\t\t\t# Equimolar mixture\n",
+ "y_2 = 0.5;\n",
+ "\n",
+ "\t\t\t# 1/P = y_1/P_1_sat + y_2/P_2_sat\n",
+ "\t\t\t# Let us statrt with t = 104.07\n",
+ "t_old = 104.07;\n",
+ "error = 10;\n",
+ "while(error>0.3):\n",
+ " P_1_sat_prime = math.exp(A_1 - B_1/(t_old + C_1));\n",
+ " P_2_sat_prime = math.exp(A_2 - B_2/(t_old + C_2));\n",
+ " P_net_prime = 1/(y_1/P_1_sat_prime + y_2/P_2_sat_prime);\n",
+ " error=abs(P_net_prime - P);\n",
+ " t_old = t_old + 0.1;\n",
+ "\n",
+ "print \" The dew point temperature is %f C\"%(t_old);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The bubble point temperature is 93.862003 C\n",
+ " The dew point temperature is 114.470000 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.7 Page Number : 522"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of range of temperature for which two phase exists\n",
+ "\n",
+ "# Variables\n",
+ "P = 1;\t\t\t#[bar] - Pressure\n",
+ "P = P*10**(2);\t\t\t#[kPa]\n",
+ "\n",
+ "\t\t\t# math.log(P_1_sat) = 13.8594 - 2773.78/(t + 220.07)\n",
+ "\t\t\t# math.log(P_2_sat) = 14.0098 - 3103.01/(t + 219.79)\n",
+ "\n",
+ "\t\t\t# The bubble point equation is\n",
+ "\t\t\t# P = x_1*P_1_sat + x_2*P_2_sat;\n",
+ "\n",
+ "t_1_sat = 2773.78/(13.8594 - math.log(P)) - 220.07;\n",
+ "t_2_sat = 3103.01/(14.0098 - math.log(P)) - 219.79;\n",
+ "\n",
+ "\t\t\t# For x_1 = 0.1\n",
+ "\t\t\t# t = x_1_1*t_1_sat + x_2_1*t_2_sat;\n",
+ "x_1 = [0.1,0.5,0.9];\n",
+ "x_2 = [0,0,0]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(3):\n",
+ " x_2[i] = 1 - x_1[i];\n",
+ " t = x_1[i]*t_1_sat + x_2[i]*t_2_sat;\n",
+ " fault = 10;\n",
+ " while(fault>0.3):\n",
+ " P_1_sat = math.exp(13.8594 - 2773.78/(t + 220.07));\n",
+ " P_2_sat = math.exp(14.0098 - 3103.01/(t + 219.79));\n",
+ " P_net = x_1[i]*P_1_sat + x_2[i]*P_2_sat;\n",
+ " fault=abs(P_net - P);\n",
+ " t = t - 0.1;\n",
+ " print \" The bubble point temperature for x_1 = %f) is %f C\"%(x_1[i],t);\n",
+ "\n",
+ "\n",
+ "\n",
+ "\t\t\t# Now let us determine dew point temperature\n",
+ "\t\t\t# 1/P = y_1/P_1_sat + y_2/P_2_sat\n",
+ "\n",
+ "y_1 = [0.1,0.5,0.9];\n",
+ "y_2 = [0,0,0]\n",
+ "for j in range(3):\n",
+ " y_2[j] = 1 - y_1[j];\n",
+ " t_prime = y_1[j]*t_1_sat + y_2[j]*t_2_sat;\n",
+ " error = 10;\n",
+ " while(error>0.3):\n",
+ " P_1_sat = math.exp(13.8594 - 2773.78/(t_prime + 220.07));\n",
+ " P_2_sat = math.exp(14.0098 - 3103.01/(t_prime + 219.79));\n",
+ " P_net = 1/(y_1[j]/P_1_sat + y_2[j]/P_2_sat);\n",
+ " error=abs(P_net - P);\n",
+ " t_prime = t_prime + 0.1;\n",
+ " \n",
+ " print \" The dew point temperature for y_1 = %f is %f C\"%(y_1[j],t_prime);\n",
+ "\n",
+ "\n",
+ "\t\t\t#Therefore\n",
+ "print \" The temperature range for z_1 = 0.1 which two phase exist is 105.61 C to 108.11 C\";\n",
+ "print \" The temperature range for z_1 = 0.5 which two phase exist is 91.61 C to 98.40 C\";\n",
+ "print \" The temperature range for z_1 = 0.9 which two phase exist is 81.71 C to 84.51 C\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The bubble point temperature for x_1 = 0.100000) is 105.605549 C\n",
+ " The bubble point temperature for x_1 = 0.500000) is 91.607993 C\n",
+ " The bubble point temperature for x_1 = 0.900000) is 81.710437 C\n",
+ " The dew point temperature for y_1 = 0.100000 is 108.105549 C\n",
+ " The dew point temperature for y_1 = 0.500000 is 98.407993 C\n",
+ " The dew point temperature for y_1 = 0.900000 is 84.510437 C\n",
+ " The temperature range for z_1 = 0.1 which two phase exist is 105.61 C to 108.11 C\n",
+ " The temperature range for z_1 = 0.5 which two phase exist is 91.61 C to 98.40 C\n",
+ " The temperature range for z_1 = 0.9 which two phase exist is 81.71 C to 84.51 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.8 Page Number : 524"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of DPT and BPT\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_1 = 0.20;\n",
+ "x_2 = 0.45;\n",
+ "x_3 = 0.35;\n",
+ "P = 10;\t\t\t#[atm]\n",
+ "P = P*101325*10**(-3);\t\t\t#[kPa]\n",
+ "\n",
+ "\t\t\t# math.log(P_1_sat) = 13.7713 - 1892.47/(t + 248.82)\n",
+ "\t\t\t# math.log(P_2_sat) = 13.7224 - 2151.63/(t + 236.91)\n",
+ "\t\t\t# math.log(P_3_sat) = 13.8183 - 2477.07/(t + 233.21)\n",
+ "\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# The bubble point equation is\n",
+ "\t\t\t# P = x_1*P_1_sat + x_2*P_2_sat + x_3*P_3_sat\n",
+ "\n",
+ "# Calculations and Results\n",
+ "t_1_sat = 1892.47/(13.7713 - math.log(P)) - 248.82;\n",
+ "t_2_sat = 2151.63/(13.7224 - math.log(P)) - 236.91;\n",
+ "t_3_sat = 2477.07/(13.8183 - math.log(P)) - 233.21;\n",
+ "t = x_1*t_1_sat + x_2*t_2_sat + x_3*t_3_sat;\n",
+ "\n",
+ "fault = 10;\n",
+ "while(fault>0.1):\n",
+ " P_1_sat = math.exp(13.7713 - 1892.47/(t + 248.82));\n",
+ " P_2_sat = math.exp(13.7224 - 2151.63/(t + 236.91));\n",
+ " P_3_sat = math.exp(13.8183 - 2477.07/(t + 233.21));\n",
+ " P_net = x_1*P_1_sat + x_2*P_2_sat + x_3*P_3_sat;\n",
+ " fault=abs(P_net - P);\n",
+ " t = t - 0.003;\n",
+ "\n",
+ "BPT = t;\n",
+ "print \" a).The bubble point temperature is %f C\"%(BPT);\n",
+ "\n",
+ "\t\t\t# (b)\n",
+ "\t\t\t# Now let us determine dew point temperature for y_1 = 0.5, and P = 90 kPa\n",
+ "y_1 = 0.20;\n",
+ "y_2 = 0.45;\n",
+ "y_3 = 0.35;\n",
+ "\n",
+ "\t\t\t# 1/P = y_1/P_1_sat + y_2/P_2_sat + y_3/P_3_sat\n",
+ "\n",
+ "t_old = 90;\t\t\t#[C]\n",
+ "error = 10;\n",
+ "while(error>0.1):\n",
+ " P_1_sat_prime = math.exp(13.7713 - 1892.47/(t_old + 248.82));\n",
+ " P_2_sat_prime = math.exp(13.7224 - 2151.63/(t_old + 236.91));\n",
+ " P_3_sat_prime = math.exp(13.8183 - 2477.07/(t_old + 233.21));\n",
+ " P_net_prime = 1/(y_1/P_1_sat_prime + y_2/P_2_sat_prime + y_3/P_3_sat_prime);\n",
+ " error=abs(P_net_prime - P);\n",
+ " t_old = t_old + 0.003;\n",
+ "\n",
+ "DPT = t_old;\n",
+ "print \" b).The dew point temperature is %f C\"%(DPT);\n",
+ "\n",
+ "\t\t\t# (c)\n",
+ "\t\t\t# For the given composition and pressure the two phase region exists in the temperature range of DPT and BPT\n",
+ "\t\t\t# Therefore at 82 C two phase exists\n",
+ "\t\t\t# At 82 C and P = 1013.25 kPa pressure\n",
+ "T_c = 82;\t\t\t#[C]\n",
+ "P_c = 1013.25;\t\t\t#[kPa]\n",
+ "z_1 = 0.20;\n",
+ "z_2 = 0.45;\n",
+ "z_3 = 0.35;\n",
+ "\n",
+ "P_1_sat_c = math.exp(13.7713 - 1892.47/(T_c + 248.82));\n",
+ "P_2_sat_c = math.exp(13.7224 - 2151.63/(T_c + 236.91));\n",
+ "P_3_sat_c = math.exp(13.8183 - 2477.07/(T_c + 233.21));\n",
+ "\n",
+ "K_1 = P_1_sat_c/P_c;\n",
+ "K_2 = P_2_sat_c/P_c;\n",
+ "K_3 = P_3_sat_c/P_c;\n",
+ "\n",
+ "\t\t\t# We have to find such a V that the following equation is satisfied.\n",
+ "\t\t\t# summation(y_i) = K_i*z_i/(1-V+V*K_i) = 1\n",
+ "\t\t\t# K_1*z_1/(1-V+V*K_1) + K_2*z_2/(1-V+V*K_2) + K_3*z_3/(1-V+V*K_3) = 1\n",
+ "\n",
+ "def f1(V): \n",
+ "\t return K_1*z_1/(1-V+V*K_1) + K_2*z_2/(1-V+V*K_2) + K_3*z_3/(1-V+V*K_3)-1\n",
+ "V = fsolve(f1,0.4)\n",
+ "\n",
+ "\t\t\t# Therefore now we have\n",
+ "y_1_c = K_1*z_1/(1-V+V*K_1);\n",
+ "y_2_c = K_2*z_2/(1-V+V*K_2);\n",
+ "y_3_c = K_3*z_3/(1-V+V*K_3);\n",
+ "x_1_c = y_1_c/K_1;\n",
+ "x_2_c = y_2_c/K_2;\n",
+ "x_3_c = y_3_c/K_3;\n",
+ "\n",
+ "print \" c).The proportion of vapour is given by V = %f\"%(V);\n",
+ "print \" The composition of vapour foemed is given by y_1 = %f y_2 = %f and y_3 = %f \"%(y_1_c,y_2_c,y_3_c);\n",
+ "print \" The composition of liquid formed is given by x_1 = %f x_2 = %f and x_3 = %f \"%(x_1_c,x_2_c,x_3_c);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The bubble point temperature is 71.833954 C\n",
+ " b).The dew point temperature is 97.254000 C\n",
+ " c).The proportion of vapour is given by V = 0.332143\n",
+ " The composition of vapour foemed is given by y_1 = 0.365018 y_2 = 0.466574 and y_3 = 0.168408 \n",
+ " The composition of liquid formed is given by x_1 = 0.117932 x_2 = 0.441757 and x_3 = 0.440311 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.9 Page Number : 526"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of range of pressure for which two phase exists\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 27;\t\t\t#[C] - Temperature\n",
+ "z_1 = 0.4;\n",
+ "z_2 = 0.3;\n",
+ "z_3 = 0.3;\n",
+ "\n",
+ "\t\t\t# math.log(P_sat) = A - B/(t + C)\n",
+ "\n",
+ "\t\t\t# For propane\n",
+ "A_1 = 13.7713;\n",
+ "B_1 = 1892.47;\n",
+ "C_1 = 248.82;\n",
+ "\t\t\t# For i-butane\n",
+ "A_2 = 13.4331;\n",
+ "B_2 = 1989.35;\n",
+ "C_2 = 236.84;\n",
+ "\t\t\t# For n-butane\n",
+ "A_3 = 13.7224;\n",
+ "B_3 = 2151.63;\n",
+ "C_3 = 236.91;\n",
+ "\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# The pressure range for the existence of two phase region lies between dew point and bubble point pressures.\n",
+ "\t\t\t# At the dew point the whole feed lies in the vapour phase and a drop of liquid is formed, therefore\n",
+ "y_1 = z_1;\n",
+ "y_2 = z_2;\n",
+ "y_3 = z_3;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# At 27 C,\n",
+ "P_1_sat = math.exp(A_1 - B_1/(T + C_1));\n",
+ "P_2_sat = math.exp(A_2 - B_2/(T + C_2));\n",
+ "P_3_sat = math.exp(A_3 - B_3/(T + C_3));\n",
+ "\n",
+ "\t\t\t# The dew point pressure is given by\n",
+ "P_1 = 1/(y_1/P_1_sat + y_2/P_2_sat + y_3/P_3_sat); \n",
+ "\n",
+ "\t\t\t# At the bubble point the whole feed lies in the liquid phase and an infinitesimal amount of vapour is formed, therefore\n",
+ "x_1 = z_1;\n",
+ "x_2 = z_2;\n",
+ "x_3 = z_3;\n",
+ "\n",
+ "\t\t\t# The bubble point pressure is given by\n",
+ "P_2 = x_1*P_1_sat + x_2*P_2_sat + x_3*P_3_sat;\n",
+ "\n",
+ "print \" a).The two phase region exists between %f and %f kPa\"%(P_1,P_2);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# The mean of the two-phase pressure range is given by\n",
+ "P_mean = (P_1 + P_2)/2;\n",
+ "\n",
+ "\t\t\t# Now let us calculate the K values of the components\n",
+ "K_1 = P_1_sat/P_mean;\n",
+ "K_2 = P_2_sat/P_mean;\n",
+ "K_3 = P_3_sat/P_mean;\n",
+ "\n",
+ "\t\t\t# summation of y_i = 1, gives\n",
+ "\t\t\t# (K_1*z_1)/(1-V-K_1*V) + (K_2*z_2)/(1-V-K_2*V) + (K_3*z_3)/(1-V-K_3*V) = 1\n",
+ "\t\t\t# Solving we get\n",
+ "def f(V): \n",
+ "\t return (K_1*z_1)/(1-V+K_1*V) + (K_2*z_2)/(1-V+K_2*V) + (K_3*z_3)/(1-V+K_3*V)-1\n",
+ "V = fsolve(f,0.1)\n",
+ "\n",
+ "y_1_prime = (z_1*K_1)/(1-V+K_1*V);\n",
+ "\n",
+ "print \" b).The mole fraction of propane in vapour phase is %f whereas in the feed is %f and fraction of vapour in the system is %f\"%(y_1_prime,z_1,V);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The two phase region exists between 421.886904 and 588.370027 kPa\n",
+ " b).The mole fraction of propane in vapour phase is 0.559489 whereas in the feed is 0.400000 and fraction of vapour in the system is 0.425313\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.10 Page Number : 527"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of vapour and liquid phase composition\n",
+ "\n",
+ "# Variables\n",
+ "T = 50;\t\t\t#[C] - Temperature\n",
+ "P = 64;\t\t\t#[kPa] - Pressure\n",
+ "z_1 = 0.7;\n",
+ "z_2 = 0.3;\n",
+ "\n",
+ "# math.log(P_sat) = A - B/(t + C)\n",
+ "\n",
+ "# For acetone\n",
+ "A_1 = 14.37824;\n",
+ "B_1 = 2787.498;\n",
+ "C_1 = 229.664;\n",
+ "# For acetonitrile\n",
+ "A_2 = 14.88567;\n",
+ "B_2 = 3413.099;\n",
+ "C_2 = 250.523;\n",
+ "\n",
+ "# Calculations\n",
+ "# At 50 C,\n",
+ "P_1_sat = math.exp(A_1 - B_1/(T + C_1));\t\t\t#[kPa]\n",
+ "P_2_sat = math.exp(A_2 - B_2/(T + C_2));\t\t\t#[kPa]\n",
+ "\n",
+ "# Now let us calculate the K values of the components\n",
+ "K_1 = P_1_sat/P;\n",
+ "K_2 = P_2_sat/P;\n",
+ "\n",
+ "# summation of y_i = 1, gives\n",
+ "# (K_1*z_1)/(1-V-K_1*V) + (K_2*z_2)/(1-V-K_2*V) = 1\n",
+ "# Solving we get\n",
+ "def f(V): \n",
+ " return (K_1*z_1)/(1-V+K_1*V) + (K_2*z_2)/(1-V+K_2*V) -1\n",
+ "V = fsolve(f,0.1)\n",
+ "L = 1 - V;\n",
+ "# Therefore\n",
+ "y_1 = (K_1*z_1)/(1-V+K_1*V);\n",
+ "y_2 = (K_2*z_2)/(1-V+K_2*V);\n",
+ "\n",
+ "x_1 = y_1/K_1;\n",
+ "x_2 = y_2/K_2;\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of V = %f\"%(V);\n",
+ "print \" The value of L = %f\"%(L);\n",
+ "print \" The liquid phase composition is x_1 = %f and x_2 = %f\"%(x_1,x_2);\n",
+ "print \" The vapour phase composition is y_1 = %f and y_2 = %f\"%(y_1,y_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of V = 0.450368\n",
+ " The value of L = 0.549632\n",
+ " The liquid phase composition is x_1 = 0.619963 and x_2 = 0.380037\n",
+ " The vapour phase composition is y_1 = 0.797678 and y_2 = 0.202322\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.11 Page Number : 528"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of temperature\n",
+ "\n",
+ "# Variables\n",
+ "P = 12.25*101325*10**(-3);\t\t\t#[kPa]\n",
+ "z_1 = 0.8;\n",
+ "z_2 = 1 - z_1;\n",
+ "V = 0.4;\n",
+ "# math.log(P_1_sat) = 13.7713 - 2892.47/(T + 248.82)\n",
+ "# math.log(P_2_sat) = 13.7224 - 2151.63/(T + 236.91)\n",
+ "\n",
+ "# P_1_sat = math.exp(13.7713 - 21892.47/(T + 248.82));\n",
+ "# P_2_sat = math.exp(13.7224 - 2151.63/(T + 236.91));\n",
+ "\n",
+ "# Let the total mixture be 1 mol\n",
+ "# We have to assume a temperature such that,\n",
+ "# y_1 + y_2 = (K_1*z_1)/(1-V-K_1*V) + (K_2*z_2)/(1-V-K_2*V) = 1\n",
+ "\n",
+ "# To assume a temperature we have to determine the BPT and DPT and take a temperature in between the range BPT to DPT\n",
+ "\n",
+ "# At the bubble point the whole feed lies in the liquid phase and an infinitesimal amount of vapour is formed, therefore\n",
+ "x_1 = z_1;\n",
+ "x_2 = z_2;\n",
+ "\n",
+ "# The bubble point pressure is given by\n",
+ "# P = x_1*(math.exp(13.7713 - 21892.47/(T + 248.82))) + x_2*(math.exp(13.7224 - 2151.63/(T + 236.91)));\n",
+ "\n",
+ "# Calculations\n",
+ "def f(T): \n",
+ "\t return x_1*(math.exp(13.7713 - 1892.47/(T + 248.82))) + x_2*(math.exp(13.7224 - 2151.63/(T + 236.91))) - P\n",
+ "T_1 = fsolve(f,0.1)\n",
+ "BPT = T_1;\n",
+ "\n",
+ "# At the dew point the whole feed lies in the vapour phase and a drop of liquid is formed, therefore\n",
+ "y_1 = z_1;\n",
+ "y_2 = z_2;\n",
+ "\n",
+ "# The dew point equation is given by\n",
+ "# 1/P = y_1/P_1_sat + y_2/P_2_sat\n",
+ "def f1(T): \n",
+ "\t return 1/(y_1/(math.exp(13.7713 - 1892.47/(T + 248.82))) + y_2/(math.exp(13.7224 - 2151.63/(T + 236.91)))) - P\n",
+ "T_2 = fsolve(f1,0.1)\n",
+ "DPT = T_2;\n",
+ "\n",
+ "T = 47;\t\t\t#[C]\n",
+ "error = 10;\n",
+ "while(error>0.001):\n",
+ " P_1_sat = math.exp(13.7713 - 1892.47/(T + 248.82));\n",
+ " P_2_sat = math.exp(13.7224 - 2151.63/(T + 236.91));\n",
+ " K_1 = P_1_sat/P;\n",
+ " K_2 = P_2_sat/P;\n",
+ " y1 = (K_1*z_1)/(1-V+K_1*V);\n",
+ " y2 = (K_2*z_2)/(1-V+K_2*V);\n",
+ " y = y1 + y2;\n",
+ " error=abs(y - 1);\n",
+ " T = T - 0.0001;\n",
+ "\n",
+ "# Results\n",
+ "print \" The temperature when 40 mol of mixture is in the vapour is %f C\"%(T);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The temperature when 40 mol of mixture is in the vapour is 45.333000 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.12 Page Number : 529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of number of moles in liquid and vapour phase\n",
+ "\n",
+ "# Variables\n",
+ "T = 105;\t\t\t#[C]\n",
+ "P = 1.5;\t\t\t#[atm]\n",
+ "P = P*101325*10**(-3);\t\t\t#[kPa]\n",
+ "z = [0.4,0.3667,0.2333];\t\t\t# Feed composition\n",
+ "x = [0.3,0.3,0.4];\t\t\t# Equilibrium liquid phase composition\n",
+ "y = [0.45,0.40,0.15];\t\t\t# Equilibrium vapour phase composition\n",
+ "\n",
+ "# From the material balance equation of component 1, we get\n",
+ "# (L + V)*z_1 = L*x_1 + V*y_1\n",
+ "\n",
+ "# Since total moles are one, therefore L + V = 1 and thus\n",
+ "# z_1 = L*x_1 + (1-L)*y_1\n",
+ "# Calculations and Results\n",
+ "for i in range(3):\n",
+ " L = (z[i] - y[i])/(x[i] - y[i]);\n",
+ " V = 1 - L;\n",
+ " print \" The number of moles in liquid phase z = %f is given by L = %f\"%(z[i],L);\n",
+ " print \" The number of moles in vapour phase z = %f is given by V = %f\"%(z[i],V);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number of moles in liquid phase z = 0.400000 is given by L = 0.333333\n",
+ " The number of moles in vapour phase z = 0.400000 is given by V = 0.666667\n",
+ " The number of moles in liquid phase z = 0.366700 is given by L = 0.333000\n",
+ " The number of moles in vapour phase z = 0.366700 is given by V = 0.667000\n",
+ " The number of moles in liquid phase z = 0.233300 is given by L = 0.333200\n",
+ " The number of moles in vapour phase z = 0.233300 is given by V = 0.666800\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.13 Page Number : 530"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of vapour and liquid phase composition\n",
+ "\n",
+ "# Variables\n",
+ "T = 90;\t\t\t#[C]\n",
+ "P = 1;\t\t\t#[atm]\n",
+ "P = P*101325*10**(-3);\t\t\t#[kPa]\n",
+ "z_1 = [0.1,0.5,0.8];\n",
+ "\n",
+ "# Calculations\n",
+ "# math.log(P_1_sat) = 13.8594 - 2773.78/(t + 220.07)\n",
+ "# math.log(P_2_sat) = 14.0098 - 3103.01/(t + 219.79)\n",
+ "\n",
+ "#At T = 90 C\n",
+ "P_1_sat = math.exp(13.8594 - 2773.78/(T + 220.07));\n",
+ "P_2_sat = math.exp(14.0098 - 3103.01/(T + 219.79));\n",
+ "K_1 = P_1_sat/P;\n",
+ "K_2 = P_2_sat/P;\n",
+ "\n",
+ "# For z_1 = 0.1\n",
+ "# y1 = (K_1*z_1(i))/(1-V+K_1*V);\n",
+ "# y2 = (K_2*z_2)/(1-V+K_2*V);\n",
+ "# We do not get a value between 0 and 1 such that, y = y1 + y2 = 1; \n",
+ "# This means that at z_1 = 0.1 two phases do not exist.\n",
+ "# At given temperature and pressure, let us determine the equilibrium liquid and vapour phase compositions\n",
+ "\n",
+ "x_1 = (P - P_2_sat)/(P_1_sat - P_2_sat);\n",
+ "y_1 = (x_1*P_1_sat)/(P);\n",
+ "\n",
+ "# For two phase region to exist at 90 C and 101.325 kPa,z_1 sholud lie between x_1 and y_1\n",
+ "\n",
+ "# Results\n",
+ "print \" For two phase region to exist at 90 C and 101.325 kPa, z_1 sholud lie between %f and %f\"%(x_1,y_1);\n",
+ "print \" For z_1 = 0.1 and z_1 = 0.5 only liquid phase exists V = 0.\"\n",
+ "print \" For z_1 = 0.8 only vapour exists V = 1.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " For two phase region to exist at 90 C and 101.325 kPa, z_1 sholud lie between 0.574884 and 0.772458\n",
+ " For z_1 = 0.1 and z_1 = 0.5 only liquid phase exists V = 0.\n",
+ " For z_1 = 0.8 only vapour exists V = 1.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.14 Page Number : 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Preparation of table having composition and pressure data\n",
+ "\n",
+ "from numpy import zeros\n",
+ "\n",
+ "# Variables\n",
+ "T = 90;\t\t\t#[C]\n",
+ "P = 1;\t\t\t#[atm]\n",
+ "P = P*101325*10**(-3);\t\t\t#[kPa]\n",
+ "z_1 = [0.1,0.5,0.8];\n",
+ "\n",
+ "# math.log(P_1_sat) = 13.8594 - 2773.78/(t + 220.07)\n",
+ "# math.log(P_2_sat) = 14.0098 - 3103.01/(t + 219.79)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#(a)\n",
+ "#At T = 90 C\n",
+ "P_1_sat = math.exp(13.8594 - 2773.78/(T + 220.07));\n",
+ "P_2_sat = math.exp(14.0098 - 3103.01/(T + 219.79));\n",
+ "K_1 = P_1_sat/P;\n",
+ "\n",
+ "x_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0];\n",
+ "P_prime = zeros(11);\n",
+ "x_2 = zeros(11);\n",
+ "y_1 = zeros(11);\n",
+ "\n",
+ "print \" a.\";\n",
+ "print \" x_1 \\t\\t P \\t\\t y_1 \";\n",
+ "\n",
+ "for i in range(11):\n",
+ " x_2[i] = 1 - x_1[i];\n",
+ " P_prime[i] = x_1[i]*P_1_sat + x_2[i]*P_2_sat;\n",
+ " y_1[i] = (x_1[i]*P_1_sat)/P_prime[i];\n",
+ " print \" %f \\t %f \\t %f \"%(x_1[i],P_prime[i],y_1[i]);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "T_1_sat = 2773.78/(13.8594-math.log(P)) - 220.07;\t\t\t#[C]\n",
+ "T_2_sat = 3103.01/(14.0098-math.log(P)) - 219.79;\t\t\t#[C]\n",
+ "\n",
+ "T_prime = [110.62,107,104,101,98,95,92,89,86,83,80.09];\n",
+ "\n",
+ "P1_sat = zeros(11);\n",
+ "P2_sat = zeros(11);\n",
+ "x_1 = zeros(11);\n",
+ "y_1 = zeros(11);\n",
+ "\n",
+ "print \" b.\";\n",
+ "print \" TC \\t\\t P_1_sat kPa \\t\\t P_2_sat kPa \\t\\t x_1 \\t\\t y_1 \";\n",
+ "\n",
+ "for j in range(11):\n",
+ " P1_sat[j] = math.exp(13.8594 - 2773.78/(T_prime[j] + 220.07));\n",
+ " P2_sat[j] = math.exp(14.0098 - 3103.01/(T_prime[j] + 219.79));\n",
+ " x_1[j] = (P-P2_sat[j])/(P1_sat[j]-P2_sat[j]);\n",
+ " y_1[j] = (x_1[j]*P1_sat[j])/P;\n",
+ " print \" %f \\t %f \\t %f \\t %f \\t %f \"%(T_prime[j],P1_sat[j],P2_sat[j],x_1[j],y_1[j]);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a.\n",
+ " x_1 \t\t P \t\t y_1 \n",
+ " 0.000000 \t 54.233834 \t 0.000000 \n",
+ " 0.100000 \t 62.425251 \t 0.218098 \n",
+ " 0.200000 \t 70.616668 \t 0.385597 \n",
+ " 0.300000 \t 78.808085 \t 0.518277 \n",
+ " 0.400000 \t 86.999502 \t 0.625971 \n",
+ " 0.500000 \t 95.190920 \t 0.715131 \n",
+ " 0.600000 \t 103.382337 \t 0.790162 \n",
+ " 0.700000 \t 111.573754 \t 0.854176 \n",
+ " 0.800000 \t 119.765171 \t 0.909433 \n",
+ " 0.900000 \t 127.956588 \t 0.957615 \n",
+ " 1.000000 \t 136.148005 \t 1.000000 \n",
+ " b.\n",
+ " TC \t\t P_1_sat kPa \t\t P_2_sat kPa \t\t x_1 \t\t y_1 \n",
+ " 110.620000 \t 237.827187 \t 101.332530 \t -0.000055 \t -0.000129 \n",
+ " 107.000000 \t 216.742019 \t 91.320455 \t 0.079767 \t 0.170629 \n",
+ " 104.000000 \t 200.376847 \t 83.629571 \t 0.151570 \t 0.299740 \n",
+ " 101.000000 \t 184.975751 \t 76.460482 \t 0.229134 \t 0.418300 \n",
+ " 98.000000 \t 170.500977 \t 69.787769 \t 0.313139 \t 0.526923 \n",
+ " 95.000000 \t 156.915208 \t 63.586616 \t 0.404360 \t 0.626206 \n",
+ " 92.000000 \t 144.181607 \t 57.832824 \t 0.503680 \t 0.716718 \n",
+ " 89.000000 \t 132.263848 \t 52.502830 \t 0.612106 \t 0.799008 \n",
+ " 86.000000 \t 121.126156 \t 47.573718 \t 0.730789 \t 0.873601 \n",
+ " 83.000000 \t 110.733338 \t 43.023234 \t 0.861050 \t 0.941001 \n",
+ " 80.090000 \t 101.331285 \t 38.950606 \t 0.999899 \t 0.999961 \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.15 Page Number : 533"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of DPT and BPT\n",
+ "\n",
+ "# Variables\n",
+ "P_1_sat = 79.80;\t\t\t#[kPa]\n",
+ "P_2_sat = 40.45;\t\t\t#[kPa]\n",
+ "\n",
+ "#(1)\n",
+ "T = 373.15;\t\t\t#[K]\n",
+ "x_1 = 0.05;\n",
+ "x_2 = 1 - x_1;\n",
+ "Y1 = math.exp(0.95*x_2**(2));\n",
+ "Y2 = math.exp(0.95*x_1**(2));\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# The total pressure of the system is given by\n",
+ "P = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;\t\t\t#[kPa]\n",
+ "y_1 = x_1*Y1*P_1_sat/P;\n",
+ "y_2 = x_2*Y2*P_2_sat/P;\n",
+ "\n",
+ "print \" 1).The first bubble is formed at %f kPa and the composition y_1 = %f\"%(P,y_1);\n",
+ "\n",
+ "#(2)\n",
+ "T = 373.15;\t\t\t#[K]\n",
+ "y_1_prime = 0.05;\n",
+ "y_2_prime = 1 - y_1_prime;\n",
+ "\n",
+ "# Let us assume a value of x_1,\n",
+ "x_1_prime = 0.0001;\n",
+ "\n",
+ "error = 10;\n",
+ "while(error>0.001):\n",
+ " x_2_prime = 1 - x_1_prime;\n",
+ " Y1_prime = math.exp(0.95*x_2_prime**(2));\n",
+ " Y2_prime = math.exp(0.95*x_1_prime**(2));\n",
+ " P_prime = x_1_prime*Y1_prime*P_1_sat + x_2_prime*Y2_prime*P_2_sat;\n",
+ " x_1 = (y_1_prime*P_prime)/(Y1_prime*P_1_sat);\n",
+ " error=abs(x_1_prime - x_1);\n",
+ " x_1_prime = x_1_prime + 0.00001;\n",
+ "\n",
+ "P_2 = x_1_prime*Y1_prime*P_1_sat + x_2_prime*Y2_prime*P_2_sat;\n",
+ "\n",
+ "print \" 2).The first drop is formed at %f kPa and has the composition x_1 = %f\"%(P_2,x_1_prime);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The first bubble is formed at 47.923166 kPa and the composition y_1 = 0.196237\n",
+ " 2).The first drop is formed at 41.974204 kPa and has the composition x_1 = 0.009370\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.16 Page Number : 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure\n",
+ "\n",
+ "# Variables\n",
+ "T = 78.15;\t\t\t#[C]\n",
+ "P_1_sat = 755;\t\t\t#[mm Hg]\n",
+ "P_2_sat = 329;\t\t\t#[mm Hg]\n",
+ "\n",
+ "z_1 = 0.3;\n",
+ "V = 0.5;\n",
+ "\n",
+ "# math.log(Y1) = 0.845/(1 + 0.845*(x_1/x_2))**(2)\n",
+ "# math.log(Y2) = 1/(1 + 1.183*(x_2/x_1))**(2)\n",
+ "\n",
+ "# A value of x_1 is to determined for which V = 0.5\n",
+ "# Let us assume a value of x_1, say x_1 = 0.150\n",
+ "x_1 = 0.150;\n",
+ "\n",
+ "# Calculations\n",
+ "error = 10;\n",
+ "while(error>0.001):\n",
+ " x_2 = 1 - x_1;\n",
+ " Y1 = math.exp(0.845/(1 + 0.845*(x_1/x_2))**(2));\n",
+ " Y2 = math.exp(1/(1 + 1.183*(x_2/x_1))**(2));\n",
+ " P = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;\n",
+ " y_1 = (x_1*Y1*P_1_sat)/P;\n",
+ " V_prime = (z_1 - x_1)/(y_1 - x_1);\n",
+ " error=abs(V_prime - V);\n",
+ " x_1 = x_1 + 0.00001;\n",
+ "\n",
+ "P_prime = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;\t\t\t#[mm hg]\n",
+ "\n",
+ "# At x_1 , V = 0.5, \n",
+ "# Therefore when the mixture is 50 % vaporized at 78.15 C the mole fraction of component 1 in the liquid phase is x_1 and the system pressure is P_prime\n",
+ "\n",
+ "# Results\n",
+ "print \" The required pressure is %f mm Hg\"%(P_prime);\n",
+ "print \" and the mole fraction of component 1 in the liquid phase for this pressure is x_1 = %f\"%(x_1);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The required pressure is 505.838606 mm Hg\n",
+ " and the mole fraction of component 1 in the liquid phase for this pressure is x_1 = 0.157650\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.17 Page Number : 536"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of van Laar activity coefficient parameters\n",
+ "\n",
+ "from scipy.stats import linregress\n",
+ "\n",
+ "# Variables\n",
+ "T = 25;\t\t\t#[C] - Temperature\n",
+ "P = [118.05,124.95,137.90,145.00,172.90,207.70,227.70,237.85,253.90,259.40,261.10,262.00,258.70,252.00,243.80];\t\t\t#[mm Hg]\n",
+ "x_1 = [0.0115,0.0160,0.0250,0.0300,0.0575,0.1125,0.1775,0.2330,0.4235,0.5760,0.6605,0.7390,0.8605,0.9250,0.9625];\n",
+ "y_1 = [0.1810,0.2250,0.3040,0.3450,0.4580,0.5670,0.6110,0.6325,0.6800,0.7050,0.7170,0.7390,0.8030,0.8580,0.9160];\n",
+ "\n",
+ "# Pressure value for which x_1 = y_1 = 0, corresponds to P_2_sat,therefore\n",
+ "P_2_sat = 97.45;\t\t\t#[mm Hg]\n",
+ "# Pressure value for which x_1 = y_1 = 1, corresponds to P_1_sat,therefore\n",
+ "P_1_sat = 230.40;\t\t\t#[mm Hg]\n",
+ "\n",
+ "x_2 = zeros(15);\n",
+ "y_2 = zeros(15);\n",
+ "Y1 = zeros(15);\n",
+ "Y2 = zeros(15);\n",
+ "GE_RT = zeros(15);\n",
+ "x1x2_GE_RT = zeros(15);\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(15):\n",
+ " x_2[i] = 1 - x_1[i];\n",
+ " y_2[i] = 1 - y_1[i];\n",
+ " Y1[i] = (y_1[i]*P[i])/(x_1[i]*P_1_sat);\n",
+ " Y2[i] = (y_2[i]*P[i])/(x_2[i]*P_2_sat);\n",
+ " GE_RT[i] = x_1[i]*math.log(Y1[i]) + x_2[i]*math.log(Y2[i]);\t\t\t# G_E/(R*T)\n",
+ " x1x2_GE_RT[i] = (x_1[i]*x_2[i])/GE_RT[i];\n",
+ "\n",
+ "\n",
+ "#[M,N,sig]=reglin(x_1,x1x2_GE_RT);\n",
+ "M,N,sig,d,e = linregress(x_1,x1x2_GE_RT);\n",
+ "\n",
+ "# Linear regression between x_1 and x_1*x_2/(G_E/R*T) gives intercept = N and slope = M\n",
+ "\n",
+ "# van Laar equation is x_1*x_2/(G_E/R*T) = 1/A + (1/B - 1/A)\n",
+ "# 1/A = N\n",
+ "A = 1/N;\n",
+ "B = 1/(M + 1/A);\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of Van Laar coefficient A = %f\"%(A);\n",
+ "print \" The value of Van Laar coefficient B = %f\"%(B);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of Van Laar coefficient A = 2.270624\n",
+ " The value of Van Laar coefficient B = 1.781821\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.18 Page Number : 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Prediction of azeotrrope formation\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 343.15;\t\t\t#[K] - Temperature\n",
+ "# At 343.15 K\n",
+ "# math.log(Y1) = 0.95*x_2**(2)\n",
+ "# math.log(Y2) = 0.95*x_1**(2)\n",
+ "P_1_sat = 79.80;\t\t\t#[kPa]\n",
+ "P_2_sat = 40.50;\t\t\t#[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "# At x_1 = 0,\n",
+ "Y1_infinity = math.exp(0.95);\n",
+ "alpha_12_x0 = (Y1_infinity*P_1_sat)/(P_2_sat);\n",
+ "# At x_1 = 1,\n",
+ "Y2_infinity = math.exp(0.95);\n",
+ "alpha_12_x1 = (P_1_sat)/(Y2_infinity*P_2_sat);\n",
+ "\n",
+ "# Within the range alpha_12_x0 and alpha_12_x1, the relative volatility continuously decrease and thus a value of 1.0 is obtained and thus azeotrope is formed.\n",
+ "# At azeotrope, Y1*P1_sat = Y2*P2_sat\n",
+ "# Y2/Y1 = P_1_sat/P_2_sat\n",
+ "# Taking math.logarithm of both sides we get\n",
+ "# math.log(Y2) - math.log(Y1) = math.log(P_1_sat/P_2_sat)\n",
+ "# 0.95*x_1**(2) - 0.95*x_2**(2) = math.log(P_1_sat/P_2_sat)\n",
+ "# Solving the above equation\n",
+ "def f(x_1): \n",
+ "\t return 0.95*x_1**(2) - 0.95*(1-x_1)**(2) - math.log(P_1_sat/P_2_sat)\n",
+ "x_1 = fsolve(f,0.1)\n",
+ "\n",
+ "# At x_1\n",
+ "x_2 = 1 - x_1;\n",
+ "Y1 = math.exp(0.95*x_2**(2));\n",
+ "Y2 = math.exp(0.95*x_1**(2));\n",
+ "P = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;\t\t\t#[kPa] - Azeotrope pressure\n",
+ "y_1 = (x_1*Y1*P_1_sat)/P;\n",
+ "\n",
+ "# Since x_1 = y_1, (almost equal) ,the above condition is of azeotrope formation\n",
+ "\n",
+ "# Since alpha_12 is a continuous curve and in between a value of alpha_12 = 1, shall come and at this composition the azeotrope shall get formed.\n",
+ "\n",
+ "# Results\n",
+ "print \" Since alpha_12_x=0 = %f and alpha_12_x=1 = %f \"%(alpha_12_x0,alpha_12_x1);\n",
+ "print \" and since alpha_12 is a continuous curve and in between a value of alpha_12 = 1, shall come and at this composition the azeotrope shall get formed.\"\n",
+ "print \" The azeotrope composition is x_1 = y_1 = %f\"%(x_1);\n",
+ "print \" The azeotrope presssure is %f kPa\"%(P);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Since alpha_12_x=0 = 5.094806 and alpha_12_x=1 = 0.762023 \n",
+ " and since alpha_12 is a continuous curve and in between a value of alpha_12 = 1, shall come and at this composition the azeotrope shall get formed.\n",
+ " The azeotrope composition is x_1 = y_1 = 0.856959\n",
+ " The azeotrope presssure is 81.366308 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.19 Page Number : 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Tabulation of activity coefficients relative volatility and compositions\n",
+ "\n",
+ "# Variables\n",
+ "T = 45;\t\t\t#[C] - Temperature\n",
+ "\n",
+ "x_1 = [0.0455,0.0940,0.1829,0.2909,0.3980,0.5069,0.5458,0.5946,0.7206,0.8145,0.8972,0.9573];\n",
+ "y_1 = [0.1056,0.1818,0.2783,0.3607,0.4274,0.4885,0.5098,0.5375,0.6157,0.6913,0.7869,0.8916];\n",
+ "P = [31.957,33.553,35.285,36.457,36.996,37.068,36.978,36.778,35.792,34.372,32.331,30.038];\n",
+ "\n",
+ "\t\t\t# Pressure value for which x_1 = y_1 = 0, corresponds to P_2_sat,therefore\n",
+ "P_2_sat = 29.819;\t\t\t#[kPa]\n",
+ "\t\t\t# Pressure value for which x_1 = y_1 = 1, corresponds to P_1_sat,therefore\n",
+ "P_1_sat = 27.778;\t\t\t#[kPa]\n",
+ "\n",
+ "x_2 = zeros(12);\n",
+ "y_2 = zeros(12);\n",
+ "Y1 = zeros(12);\n",
+ "Y2 = zeros(12);\n",
+ "alpha_12 = zeros(12);\n",
+ "GE_RT = zeros(12);\n",
+ "x1x2_GE_RT = zeros(12);\n",
+ "# Calculations and Results\n",
+ "print \" x_1 \\t\\t y_1 \\t P \\t\\t Y1 \\t\\tY2 \\t alpha_12 \\t G_E/RT \\t x1*x2/G_E/RT\";\n",
+ "\n",
+ "for i in range(12):\n",
+ " x_2[i] = 1 - x_1[i];\n",
+ " y_2[i] = 1 - y_1[i];\n",
+ " Y1[i] = (y_1[i]*P[i])/(x_1[i]*P_1_sat);\n",
+ " Y2[i] = (y_2[i]*P[i])/(x_2[i]*P_2_sat);\n",
+ " alpha_12[i] = (y_1[i]/x_1[i])/(y_2[i]/x_2[i]);\n",
+ " GE_RT[i] = x_1[i]*math.log(Y1[i]) + x_2[i]*math.log(Y2[i]);\t\t\t# G_E/(R*T)\n",
+ " x1x2_GE_RT[i] = (x_1[i]*x_2[i])/GE_RT[i];\n",
+ " print \" %f\\t %f\\t %f \\t %f \\t %f \\t %f\\t %f \\t%f\"%(x_1[i],y_1[i],P[i],Y1[i],Y2[i],alpha_12[i],GE_RT[i],x1x2_GE_RT[i]);\n",
+ "\n",
+ "\t\t\t#[M,N,sig]=reglin(x_1,x1x2_GE_RT);\n",
+ "M,N,sig,d,e=linregress(x_1,x1x2_GE_RT);\n",
+ "\n",
+ "\t\t\t# Linear regression between x_1 and x_1*x_2/(G_E/R*T) gives intercept = N and slope = M\n",
+ "\n",
+ "\t\t\t# Now let us assume the system to follow van Laar activity coefficient model. \n",
+ "\t\t\t# x_1*x_2/(G_E/(R*T)) = x_1/B + x_2/A = x_1/B + (1 - x_1)/A = 1/A + (1/B - 1/A)*x_1 = N + M*x_1\n",
+ "\n",
+ "\t\t\t# 1/A = N\n",
+ "A = 1/N;\n",
+ "\t\t\t# (1/B - 1/A) = M\n",
+ "B = 1/(M + 1/A);\n",
+ "\n",
+ "print \"\"\n",
+ "print \" The value of van Laar parameters are, A = %f and B = %f \"%(A,B);\n",
+ "\n",
+ "Y1_infinity = math.exp(A);\n",
+ "Y2_infinity = math.exp(B);\n",
+ "\n",
+ "\n",
+ "\t\t\t# Azeotrope is formed when maxima ( or mainina) in pressure is observed and relative volatility becomes 1.\n",
+ "\t\t\t# This is the case for x_1 between 0.2980 and 0.5458. \n",
+ "\t\t\t# The ezeotropr os maximum pressure (and thus minimum boiling) because at azeotrope the system pressure is greater than vapour pressure of pure components.\n",
+ "\n",
+ "\t\t\t# Now let us calculate the azeotrope composition.\n",
+ "\t\t\t# At azeotrope, Y1*P1_sat = Y2*P2_sat\n",
+ "\t\t\t# math.log(Y1/Y2) = math.log(P_2_sat/P_1_sat)\n",
+ "\t\t\t# From van Laar model we get\n",
+ "\t\t\t# math.log(P_2_sat/P_1_sat) = (A*B**(2)*2*x_2**(2))/(A*x_1 + B*x_2)**(2) + (B*A**(2)*2*x_1**(2))/(A*x_1 + B*x_2)**(2)\n",
+ "\t\t\t# Solving the above equation\n",
+ "def f(x_1): \n",
+ "\t return math.log(P_2_sat/P_1_sat) - (A*B**(2)*(1-x_1)**(2))/(A*x_1 + B*(1-x_1))**(2) + (B*A**(2)*x_1**(2))/(A*x_1 + B*(1-x_1))**(2)\n",
+ "x_1 = fsolve(f,0.1)\n",
+ "\n",
+ "print \" The azeotrope composition is given by x_1 = y_1 = %f\"%(x_1);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " x_1 \t\t y_1 \t P \t\t Y1 \t\tY2 \t alpha_12 \t G_E/RT \t x1*x2/G_E/RT\n",
+ " 0.045500\t 0.105600\t 31.957000 \t 2.670039 \t 1.004220 \t 2.476833\t 0.048705 \t0.891698\n",
+ " 0.094000\t 0.181800\t 33.553000 \t 2.336127 \t 1.016177 \t 2.141582\t 0.094298 \t0.903137\n",
+ " 0.182900\t 0.278300\t 35.285000 \t 1.932808 \t 1.045150 \t 1.722733\t 0.156610 \t0.954268\n",
+ " 0.290900\t 0.360700\t 36.457000 \t 1.627355 \t 1.102263 \t 1.375325\t 0.210697 \t0.979023\n",
+ " 0.398000\t 0.427400\t 36.996000 \t 1.430228 \t 1.180094 \t 1.129007\t 0.242105 \t0.989635\n",
+ " 0.506900\t 0.488500\t 37.068000 \t 1.285998 \t 1.289486 \t 0.929034\t 0.252871 \t0.988458\n",
+ " 0.545800\t 0.509800\t 36.978000 \t 1.243394 \t 1.338371 \t 0.865446\t 0.251278 \t0.986567\n",
+ " 0.594600\t 0.537500\t 36.778000 \t 1.196853 \t 1.407094 \t 0.792366\t 0.245302 \t0.982671\n",
+ " 0.720600\t 0.615700\t 35.792000 \t 1.100930 \t 1.650961 \t 0.621199\t 0.209369 \t0.961630\n",
+ " 0.814500\t 0.691300\t 34.372000 \t 1.050218 \t 1.918247 \t 0.510015\t 0.160745 \t0.939933\n",
+ " 0.897200\t 0.786900\t 32.331000 \t 1.020818 \t 2.247586 \t 0.423097\t 0.101740 \t0.906550\n",
+ " 0.957300\t 0.891600\t 30.038000 \t 1.007145 \t 2.557286 \t 0.366877\t 0.046909 \t0.871410\n",
+ "\n",
+ " The value of van Laar parameters are, A = 1.049085 and B = 1.064514 \n",
+ " The azeotrope composition is given by x_1 = y_1 = 0.468254\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.20 Page Number : 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Tabulation of partial pressure and total pressure data of components\n",
+ "\n",
+ "# Variables\n",
+ "T = 25;\t\t\t#[C] - Temperature\n",
+ "P_1_sat = 230.4;\t\t\t#[mm Hg]\n",
+ "P_2_sat = 97.45;\t\t\t#[mm Hg]\n",
+ "Y1_infinity = 8.6;\n",
+ "Y2_infinity = 6.6;\n",
+ "\n",
+ "\t\t\t# Assuming ideal vpour behaviour means that phi = 1 and since system pressure is low, therefore\n",
+ "\t\t\t# f_i = P_i_sat \n",
+ "\t\t\t# Assuming the activity coefficients to follow van Laar model we get\n",
+ "A = math.log(Y1_infinity);\n",
+ "B = math.log(Y2_infinity);\n",
+ "\n",
+ "\t\t\t#math.log(Y1) = A/(1+ (A*x_1)/(B*x_2))**(2)\n",
+ "\t\t\t# math.log(Y2) = B/(1+ (B*x_2)/(A*x_1))**(2)\n",
+ "\n",
+ "x_1 = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9];\n",
+ "\n",
+ "x_2 = zeros(9);\n",
+ "Y1 = zeros(9);\n",
+ "Y2 = zeros(9);\n",
+ "y1_P = zeros(9);\n",
+ "y2_P = zeros(9);\n",
+ "P = zeros(9);\n",
+ "y_1 = zeros(9);\n",
+ "\n",
+ "print \" a.\";\n",
+ "print \" x_1 \\t\\t Y1 \\t\\t Y2 \\t\\t y1*P \\t\\t y2*P \\t\\t P \\t\\t y_1 \";\n",
+ "# Calculations and Results\n",
+ "for i in range(9):\n",
+ " x_2[i] = 1 - x_1[i];\n",
+ " Y1[i] = math.exp(A/(1+ (A*x_1[i])/(B*x_2[i]))**(2));\n",
+ " Y2[i] = math.exp(B/(1+ (B*x_2[i])/(A*x_1[i]))**(2));\n",
+ " y1_P[i] = x_1[i]*Y1[i]*P_1_sat;\n",
+ " y2_P[i] = x_2[i]*Y2[i]*P_2_sat;\n",
+ " P[i] = x_1[i]*Y1[i]*P_1_sat + x_2[i]*Y2[i]*P_2_sat;\n",
+ " y_1[i] = (x_1[i]*Y1[i]*P_1_sat)/P[i];\n",
+ " print \" %f\\t\\t %f\\t\\t %f \\t\\t %f \\t\\t %f \\t\\t %f \\t %f\"%(x_1[i],Y1[i],Y2[i],y1_P[i],y2_P[i],P[i],y_1[i]);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# The total system pressure versus x_1 shows a maxima and thus azeotrope is formed by the VLE system\n",
+ "\t\t\t# The maxima occurs in the range of x_1 = 0.6 to 0.8, so an azeotrope is formed in this composition range\n",
+ "\n",
+ "\t\t\t# At the azeotrope point, Y1*P1_sat = Y2*P2_sat\n",
+ "\t\t\t# math.log(Y1) - math.log(Y2) = math.log(P_2_sat/P_1_sat)\n",
+ "\t\t\t# On putting the values and then solving the above equation we get\n",
+ "def f(x_1): \n",
+ "\t return A/(1+1.14*x_1/(1-x_1))**(2)- B/(1+0.877*(1-x_1)/x_1)**(2) - math.log(P_2_sat/P_1_sat)\n",
+ "x_1_prime = fsolve(f,0.1)\n",
+ "\n",
+ "\t\t\t# At x_1\n",
+ "x_2_prime = 1 - x_1_prime;\n",
+ "Y1_prime = math.exp(A/(1+ (A*x_1_prime)/(B*x_2_prime))**(2));\n",
+ "Y2_prime = math.exp(B/(1+ (B*x_2_prime)/(A*x_1_prime))**(2));\n",
+ "P_prime = x_1_prime*Y1_prime*P_1_sat + x_2_prime*Y2_prime*P_2_sat;\t\t\t#[kPa] - Azeotrope pressure\n",
+ "y_1_prime = (x_1_prime*Y1_prime*P_1_sat)/P_prime;\n",
+ "\n",
+ "\t\t\t# Since x_1 = y_1,azeotrope formation will take place\n",
+ "print \" b\";\n",
+ "print \" The total system pressure versus x_1 shows a maxima and thus azeotrope is formed by the VLE system\";\n",
+ "print \" The azeotrope composition is x_1 = y_1 = %f\"%(x_1_prime);\n",
+ "print \" The azeotrope presssure is %f mm Hg\"%(P_prime);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a.\n",
+ " x_1 \t\t Y1 \t\t Y2 \t\t y1*P \t\t y2*P \t\t P \t\t y_1 \n",
+ " 0.100000\t\t 5.446877\t\t 1.024149 \t\t 125.496041 \t\t 89.822961 \t\t 215.319002 \t 0.582838\n",
+ " 0.200000\t\t 3.680305\t\t 1.097308 \t\t 169.588473 \t\t 85.546152 \t\t 255.134625 \t 0.664702\n",
+ " 0.300000\t\t 2.640401\t\t 1.225500 \t\t 182.504521 \t\t 83.597451 \t\t 266.101972 \t 0.685844\n",
+ " 0.400000\t\t 2.002736\t\t 1.421865 \t\t 184.572186 \t\t 83.136461 \t\t 267.708646 \t 0.689452\n",
+ " 0.500000\t\t 1.599580\t\t 1.708524 \t\t 184.271623 \t\t 83.247849 \t\t 267.519472 \t 0.688816\n",
+ " 0.600000\t\t 1.340316\t\t 2.120132 \t\t 185.285311 \t\t 82.642744 \t\t 267.928055 \t 0.691549\n",
+ " 0.700000\t\t 1.174189\t\t 2.709824 \t\t 189.373156 \t\t 79.221704 \t\t 268.594861 \t 0.705051\n",
+ " 0.800000\t\t 1.072057\t\t 3.558780 \t\t 197.601501 \t\t 69.360613 \t\t 266.962114 \t 0.740186\n",
+ " 0.900000\t\t 1.017109\t\t 4.791470 \t\t 210.907696 \t\t 46.692876 \t\t 257.600573 \t 0.818739\n",
+ " b\n",
+ " The total system pressure versus x_1 shows a maxima and thus azeotrope is formed by the VLE system\n",
+ " The azeotrope composition is x_1 = y_1 = 0.706548\n",
+ " The azeotrope presssure is 268.599631 mm Hg\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.21 Page Number : 544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of azeotrope formation\n",
+ "\n",
+ "# Variables\n",
+ "T = 50;\t\t\t#[C]\n",
+ "\t\t\t# At 50 C\n",
+ "P_1_sat = 0.67;\t\t\t#[atm]\n",
+ "P_2_sat = 0.18;\t\t\t#[atm]\n",
+ "Y1_infinity = 2.5;\n",
+ "Y2_infinity = 7.2;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# alpha_12 = (y_1/x_1)/(y_2/x_2) = (Y1*P_1_sat)/((Y2*P_2_sat))\n",
+ "\t\t\t# At x_1 tending to zero,\n",
+ "alpha_12_x0 = (Y1_infinity*P_1_sat)/(P_2_sat);\n",
+ "\t\t\t# At x_1 tending to 1,\n",
+ "alpha_12_x1 = (P_1_sat)/((Y2_infinity*P_2_sat));\n",
+ "\n",
+ "\t\t\t# Since alpha_12 is a continuous curve and in between a value of alpha_12 = 1, shall come and at this composition the azeotrope shall get formed.\n",
+ "print \" 1).Since alpha_12_x=0) = %f and alpha_12_x=1) = %f \"%(alpha_12_x0,alpha_12_x1);\n",
+ "print \" and since alpha_12 is a continuous curve and in between a value of alpha_12 = 1 shall come and at this composition azeotrope shall get formed.\"\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# Since the activity coefficient values are greater than 1 ,therefore the deviations from Roult's law is positive\n",
+ "\t\t\t# and the azeotrope is maximum pressure (or minimum boiling)\n",
+ "print \" 2).Since the activity coefficient values are greater than 1 therefore the deviations from Roults law is positive\"\n",
+ "print \" and the azeotrope is maximum pressure or minimum boiling\";\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "\t\t\t# Let us assume the system to follow van Laar activity coefficient model\n",
+ "A = math.log(Y1_infinity);\n",
+ "B = math.log(Y2_infinity);\n",
+ "\n",
+ "\t\t\t# math.log(Y1) = A/(1+ (A*x_1)/(B*x_2))**(2)\n",
+ "\t\t\t# math.log(Y2) = B/(1+ (B*x_2)/(A*x_1))**(2)\n",
+ "\n",
+ "\t\t\t# At the azeotrope point, Y1*P1_sat = Y2*P2_sat\n",
+ "\t\t\t# math.log(Y1) - math.log(Y2) = math.log(P_2_sat/P_2_sat)\n",
+ "\t\t\t# On putting the values and then solving the above equation\n",
+ "def f(x_1): \n",
+ "\t return A/(1+ (A*x_1)/(B*(1-x_1)))**(2)- B/(1+ (B*(1-x_1))/(A*x_1))**(2) - math.log(P_2_sat/P_1_sat)\n",
+ "x_1 = fsolve(f,0.1)\n",
+ "\n",
+ "\t\t\t# At x_1\n",
+ "x_2 = 1 - x_1;\n",
+ "Y1 = math.exp(A/(1+ (A*x_1)/(B*x_2))**(2));\n",
+ "Y2 = math.exp(B/(1+ (B*x_2)/(A*x_1))**(2));\n",
+ "P = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;\t\t\t#[kPa] - Azeotrope pressure\n",
+ "y_1 = (x_1*Y1*P_1_sat)/P;\n",
+ "\n",
+ "\t\t\t# Since x_1 = y_1,the azeotrope formation will take place\n",
+ "\n",
+ "print \" 3).The azeotrope composition is x_1 = y_1 = %f\"%(x_1);\n",
+ "print \" The azeotrope presssure is %f atm\"%(P);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).Since alpha_12_x=0) = 9.305556 and alpha_12_x=1) = 0.516975 \n",
+ " and since alpha_12 is a continuous curve and in between a value of alpha_12 = 1 shall come and at this composition azeotrope shall get formed.\n",
+ " 2).Since the activity coefficient values are greater than 1 therefore the deviations from Roults law is positive\n",
+ " and the azeotrope is maximum pressure or minimum boiling\n",
+ " 3).The azeotrope composition is x_1 = y_1 = 0.910173\n",
+ " The azeotrope presssure is 0.689143 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.22 Page Number : 545"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Tabulation of pressure and composition data\n",
+ "\n",
+ "# Variables\n",
+ "T = 25;\t\t\t#[C]\n",
+ "\t\t\t# At 50 C\n",
+ "P_1_sat = 7.866;\t\t\t#[kPa]\n",
+ "P_2_sat = 3.140;\t\t\t#[kPa]\n",
+ "\n",
+ "\t\t\t# G_E/(R*T) = 1.4938*x_1*x_2/(1.54*x_1 + 0.97*x_2)\n",
+ "\n",
+ "\t\t\t# The excess Gibbs free energy math.expression can be written as\n",
+ "\t\t\t# x_1*x_2/(G_E/(R*T)) = 1.54*x_1/1.4938 + 0.97*x_2/1.4938 = x_1/0.97 + x_2/1.54\n",
+ "\n",
+ "\t\t\t# Comparing with the van Laar math.expression\n",
+ "\t\t\t# x_1*x_2/(G_E/(R*T)) = x_1/B + x_2/A, we get\n",
+ "A = 1.54;\n",
+ "B = 0.97;\n",
+ "\n",
+ "\t\t\t# The activity coefficients are thus given by\n",
+ "\t\t\t# math.log(Y1) = A/(1+ (A*x_1)/(B*x_2))**(2)\n",
+ "\t\t\t# math.log(Y2) = B/(1+ (B*x_2)/(A*x_1))**(2)\n",
+ "\n",
+ "x_1 = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95];\n",
+ "\n",
+ "x_2 = zeros(10);\n",
+ "Y1 = zeros(10);\n",
+ "Y2 = zeros(10);\n",
+ "P = zeros(10);\n",
+ "y_1 = zeros(10);\n",
+ "\n",
+ "print \" x_1 \\t\\t Y1 \\t\\t Y2 \\t\\t P kPa \\t\\t y_1 \";\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(10):\n",
+ " x_2[i] = 1 - x_1[i];\n",
+ " Y1[i] = math.exp(A/(1+ (A*x_1[i])/(B*x_2[i]))**(2));\n",
+ " Y2[i] = math.exp(B/(1+ (B*x_2[i])/(A*x_1[i]))**(2));\n",
+ " P[i] = x_1[i]*Y1[i]*P_1_sat + x_2[i]*Y2[i]*P_2_sat;\n",
+ " y_1[i] = (x_1[i]*Y1[i]*P_1_sat)/P[i];\n",
+ " print \" %f\\t\\t %f\\t\\t %f \\t\\t %f \\t\\t %f \"%(x_1[i],Y1[i],Y2[i],P[i],y_1[i]);\n",
+ "\n",
+ "\n",
+ "\t\t\t# The azeotrope is formed near x_1 = 0.95 as in this region a maxima in pressure is obtained.\n",
+ "\n",
+ "\t\t\t# At the azeotrope point, Y1*P1_sat = Y2*P2_sat\n",
+ "\t\t\t# math.log(Y1) - math.log(Y2) = math.log(P_2_sat/P_2_sat)\n",
+ "\t\t\t# On putting the values and then solving the above equation\n",
+ "def f(x_1): \n",
+ "\t return A/(1+ (A*x_1)/(B*(1-x_1)))**(2)- B/(1+ (B*(1-x_1))/(A*x_1))**(2) - math.log(P_2_sat/P_1_sat)\n",
+ "x_1_prime = fsolve(f,0.1)\n",
+ "\n",
+ "\t\t\t# At x_1\n",
+ "x_2_prime = 1 - x_1_prime;\n",
+ "Y1_prime = math.exp(A/(1+ (A*x_1_prime)/(B*x_2_prime))**(2));\n",
+ "Y2_prime = math.exp(B/(1+ (B*x_2_prime)/(A*x_1_prime))**(2));\n",
+ "P_prime = x_1_prime*Y1_prime*P_1_sat + x_2_prime*Y2_prime*P_2_sat;\t\t\t#[kPa] - Azeotrope pressure\n",
+ "y_1_prime = (x_1_prime*Y1_prime*P_1_sat)/P_prime;\n",
+ "\n",
+ "\t\t\t# Since x_1_prime = y_1_prime,the azeotrope formation will take place\n",
+ "\n",
+ "print \" Part II \";\n",
+ "print \" The azeotrope composition is x_1 = y_1 = %f\"%(x_1_prime);\n",
+ "print \" The azeotrope presssure is %f kPa \"%(P_prime);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " x_1 \t\t Y1 \t\t Y2 \t\t P kPa \t\t y_1 \n",
+ " 0.100000\t\t 3.042798\t\t 1.022050 \t\t 5.281779 \t\t 0.453155 \n",
+ " 0.200000\t\t 2.201629\t\t 1.081457 \t\t 6.180223 \t\t 0.560433 \n",
+ " 0.300000\t\t 1.725242\t\t 1.172375 \t\t 6.648107 \t\t 0.612389 \n",
+ " 0.400000\t\t 1.438293\t\t 1.292347 \t\t 6.960227 \t\t 0.650186 \n",
+ " 0.500000\t\t 1.258593\t\t 1.440723 \t\t 7.211980 \t\t 0.686364 \n",
+ " 0.600000\t\t 1.144175\t\t 1.617876 \t\t 7.432102 \t\t 0.726584 \n",
+ " 0.700000\t\t 1.072060\t\t 1.824770 \t\t 7.621913 \t\t 0.774475 \n",
+ " 0.800000\t\t 1.028913\t\t 2.062721 \t\t 7.770131 \t\t 0.833286 \n",
+ " 0.900000\t\t 1.006610\t\t 2.333241 \t\t 7.858834 \t\t 0.906775 \n",
+ " 0.950000\t\t 1.001587\t\t 2.481217 \t\t 7.874109 \t\t 0.950528 \n",
+ " Part II \n",
+ " The azeotrope composition is x_1 = y_1 = 0.958680\n",
+ " The azeotrope presssure is 7.874467 kPa \n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.23 Page Number : 547"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of van Laar parameters\n",
+ "\n",
+ "# Variables\n",
+ "T = 58.7;\t\t\t#[C]\n",
+ "P = 1;\t\t\t#[atm]\n",
+ "P = P*101325*10**(-3);\t\t\t#[kPa]\n",
+ "\n",
+ "\t\t\t# math.log(P_sat) = 16.6758 - 3674.49/(t + 226.45) - For ethyl alcohol\n",
+ "\t\t\t# math.log(P_sat) = 13.8216 - 2697.55/(t + 224.37) - For hexane\n",
+ "\n",
+ "\t\t\t# Let us take hexane as (1) and ethanol as (2)\n",
+ "\t\t\t# At 58.7 C\n",
+ "P_1_sat = math.exp(13.8216 - 2697.55/(T + 224.37));\t\t\t#[kPa]\n",
+ "P_2_sat = math.exp(16.6758 - 3674.49/(T + 226.45));\t\t\t#[kPa]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Y1 = P/P_1_sat;\n",
+ "Y2 = P/P_2_sat;\n",
+ "\n",
+ "x_2 = 0.332;\t\t\t# Mol % of ethanol (given)\n",
+ "x_1 = 1 - x_2;\t\t\t# Mol % of hehane\n",
+ "\n",
+ "\t\t\t# The van Laar parameters are given by\n",
+ "A = ((1 + (x_2*math.log(Y2))/(x_1*math.log(Y1)))**(2))*math.log(Y1);\n",
+ "B = ((1 + (x_1*math.log(Y1))/(x_2*math.log(Y2)))**(2))*math.log(Y2);\n",
+ "\n",
+ "print \" The value of van Laar parameters are A = %f and B = %f \"%(A,B);\n",
+ "\n",
+ "\t\t\t# Now let us calvulate the distribution coefficient K\n",
+ "x_1_prime = 0.5;\t\t\t#[given]\n",
+ "x_2_prime = 1 - x_1_prime;\n",
+ "\n",
+ "\t\t\t# The activity coefficients are thus given by\n",
+ "\t\t\t# math.log(Y1) = A/(1+ (A*x_1)/(B*x_2))**(2)\n",
+ "\t\t\t# math.log(Y2) = B/(1+ (B*x_2)/(A*x_1))**(2)\n",
+ "\n",
+ "Y1_prime = math.exp(A/(1+ (A*x_1_prime)/(B*x_2_prime))**(2));\n",
+ "Y2_prime = math.exp(B/(1+ (B*x_2_prime)/(A*x_1_prime))**(2));\n",
+ "P_prime = x_1_prime*Y1_prime*P_1_sat + x_2_prime*Y2_prime*P_2_sat;\n",
+ "\n",
+ "\t\t\t# We have, K_1 = y_1/x_1 = Y1*P_1_sat/P\n",
+ "K_1 = Y1_prime*P_1_sat/P_prime;\n",
+ "\n",
+ "print \" The distribution coefficient is given by K_1 = %f\"%(K_1)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of van Laar parameters are A = 1.669879 and B = 2.662289 \n",
+ " The distribution coefficient is given by K_1 = 1.352866\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch16_1.ipynb b/Chemical_Engineering_Thermodynamics/ch16_1.ipynb
new file mode 100644
index 00000000..902f4a5c
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch16_1.ipynb
@@ -0,0 +1,764 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 : Other Phase Equilibria"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.1 Page Number : 564"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of solubility\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\t\t\t\n",
+ "T = 0 + 273.15;\t\t\t#[K] - Temperature\n",
+ "P = 20*10**(5);\t\t\t#[Pa] - Pressure\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t#componenet 1 : methane (1)\n",
+ "\t\t\t#componenet 2 : methanol (2)\n",
+ "\n",
+ "H_constant = 1022;\t\t\t#[bar] - Henry's law constant\n",
+ "H_constant = H_constant*10**(5);\t\t\t#[Pa]\n",
+ "\n",
+ "\t\t\t# The second virial coefficients are\n",
+ "B_11 = -53.9;\t\t\t#[cm**(3)/mol]\n",
+ "B_11 = B_11*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "B_12 = -166;\t\t\t#[cm**(3)/mol]\n",
+ "B_12 = B_12*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "B_22 = -4068;\t\t\t#[cm**(3)/mol]\n",
+ "B_22 = B_22*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "den_meth = 0.8102;\t\t\t#[g/cm**(3)] - Density of methanol at 0 C\n",
+ "Mol_wt_meth = 32.04;\t\t\t# Molecular weight of methanol\n",
+ "P_2_sat = 0.0401;\t\t\t#[bar] - Vapour pressure of methanol at 0 C\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#The molar volume of methanol can be calculated as\n",
+ "V_2_liq = (1/(den_meth/Mol_wt_meth))*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#The phase equilibrium equation of the components at high pressure\n",
+ "\t\t\t#y1*phi_1*P = x_1*H_1\n",
+ "\t\t\t#y2*phi_2*P = x_2*H_2\n",
+ "\n",
+ "\t\t\t#Since methane follows Henry's law therefore methanol follows the lewis-Rnadall rule\n",
+ "\t\t\t#f_2 is the fugacity of the compressed liquid which is calculated using\n",
+ "\t\t\t#f_2 = f_2_sat*math.exp[V_2_liq*(P - P_sat_2)/(R*T)]\n",
+ "\t\t\t#where f_2_sat can be calculated using virial equation \n",
+ "\t\t\t# math.log(phi_2_sat) = math.log(f_2_sat/P_2_sat) = (B_22*P_2_sat)/(R*T)\n",
+ "\n",
+ "f_2_sat = P_2_sat*math.exp((B_22*P_2_sat*10**(5))/(R*T));\t\t\t#[bar]\n",
+ "\n",
+ "\t\t\t#Putting the value of 'f_2_sat' in the math.expression of f_2 , we get\n",
+ "f_2 = f_2_sat*math.exp(V_2_liq*(P - P_2_sat*10**(5))/(R*T));\t\t\t#[bar]\n",
+ "\n",
+ "\t\t\t#Now let us calculate the fugacity coefficients of the species in the vapour mixture\n",
+ "del_12 = 2*B_12 - B_11 - B_22;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#math.log(phi_1) = (P/(R*T))*(B_11 + y2**(2)*del_12)\n",
+ "\t\t\t#math.log(phi_2) = (P/(R*T))*(B_22 + y1**(2)*del_12)\n",
+ "\n",
+ "\n",
+ "\t\t\t#The calculation procedure is to assume a value of y1, calculate 'phi_1' and 'phi_2' and calculate 'x_1' and 'x_2' from the phase equilibrium equations and see whether x_1 + x_2 = 1,if not then another value of y1 is assumed.\n",
+ "\n",
+ "y2 = 0.1;\n",
+ "error=10;\n",
+ "\n",
+ "while(error>0.001):\n",
+ " y1=1-y2;\n",
+ " phi_1 = math.exp((P/(R*T))*((B_11 + y2**(2)*del_12)));\n",
+ " phi_2 = math.exp((P/(R*T))*((B_22 + y1**(2)*del_12)));\n",
+ " x_1 = (y1*phi_1*P)/H_constant;\n",
+ " x_2 = (y2*phi_2*P)/(f_2*10**(5));\n",
+ " x = x_1 + x_2;\n",
+ " error=abs(1-x);\n",
+ " y2=y2 - 0.000001;\n",
+ "\n",
+ "# Results\n",
+ "print \" The solubility of methane in methanol is given by x1 = %f\"%(x_1);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The solubility of methane in methanol is given by x1 = 0.018614\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.2 Page Number : 566"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of solubility\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "x_C2H6_1 = 0.33*10**(-4);\t\t\t# Solubility of ethane in water at 25 C and 1 bar\n",
+ "\n",
+ "\t\t\t#componenet 1 : ethane (1)\n",
+ "\t\t\t#componenet 2 : water (2)\n",
+ "\n",
+ "\t\t\t# Z = 1 - 7.63*10**(3)*P - 7.22*10**(-5)*P**(2)\n",
+ "\n",
+ "\t\t\t#The phase equilibrium equation of ethane is\n",
+ "\t\t\t#f_1_V = x_1*H_1\n",
+ "\t\t\t#since vapour is pure gas, f_1_V = x_1*H_1 or, phi_1*P = x_1*H_1, where 'phi_1' is fugacity coefficient of pure ethane\n",
+ "\t\t\t# math.log(phi) = integral('Z-1)/P) from limit '0' to 'P'\n",
+ "\n",
+ "P1 = 0;\n",
+ "P2 = 1;\n",
+ "P3 = 35;\n",
+ "\n",
+ "# Calculations\n",
+ "def f51(P): \n",
+ "\t return (1-7.63*10**(-3)*P-7.22*10**(-5)*P**(2)-1)/P\n",
+ "\n",
+ "intgral = quad(f51,P1,P2)[0]\n",
+ "\n",
+ "phi_1_1 = math.exp(intgral);\t\t\t# - Fugacity coefficient of ethane at 1 bar\n",
+ "f_1_1 = phi_1_1*P2;\t\t\t#[bar] - Fugacity of ethane at 1 bar\n",
+ "\n",
+ "\t\t\t#Similarly\n",
+ "\n",
+ "def f52(P): \n",
+ "\t return (1-7.63*10**(-3)*P-7.22*10**(-5)*P**(2)-1)/P\n",
+ "\n",
+ "intgral_1 = quad(f52,P1,P3)[0]\n",
+ "\n",
+ "phi_1_35 = math.exp(intgral_1);\t\t\t# Fugacity coefficient of ethane at 35 bar\n",
+ "f_1_35 = phi_1_35*P3;\t\t\t#[bar] - Fugacity of ethane at 35 bar\n",
+ "\n",
+ "\t\t\t# At ethane pressure of 1 bar , x_C2H6_1*H_1 = phi_1_1\n",
+ "H_1 = phi_1_1/x_C2H6_1;\t\t\t#[bar] - Henry's constant\n",
+ "\n",
+ "\t\t\t# At ethane pressure of 35 bar , x_C2H6_35*H_1 = phi_1_35\n",
+ "x_C2H6_35 = f_1_35/H_1;\t\t\t# Solubility of ethane at 35 bar pressure\n",
+ "\n",
+ "# Results\n",
+ "print \"The solubility of ethane at 35 bar is given by x_C2H6 = %e \"%(x_C2H6_35);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The solubility of ethane at 35 bar is given by x_C2H6 = 8.525648e-04 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.4 Page Number : 571"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of composition\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 200;\t\t\t#[K]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "\t\t\t# G_E = A*x_1*x_2\n",
+ "A = 4000;\t\t\t#[J/mol]\n",
+ "x_1 = 0.6;\t\t\t# Mle fraction of feed composition\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# Since A is given to be independent of temperature\n",
+ "UCST = A/(2*R);\t\t\t#[K] - Upper critical solution temperature\n",
+ "print \" The UCST of the system is %f K\"%(UCST);\n",
+ "\n",
+ "\t\t\t# Since the given temperature is less than UCST therefore two phase can get formed at the given temperature.\n",
+ "\n",
+ "\t\t\t# x1_alpha = 1 - x1_beta\n",
+ "\t\t\t# We know that, x1_alpha*Y_1_alpha = x2_alpha*Y_2_alpha\n",
+ "\t\t\t# x1_alpha*math.exp[(A/(R*T))*(x2_alpha)**(2)] = (1 - x1_alpha)*math.exp[(A/(R*T))*(x1_alpha)**(2)]\n",
+ "\t\t\t# where use has beeen made of the fact that x1_alpha = 1 - x1_beta and x2_beta = 1 - x1_beta = x1_alpha .Taking math.logarithm of both side we get\n",
+ "\t\t\t# math.log(x1_alpha) + (A/(R*T))*(1 - x1_alpha)**(2) = math.log(1 - x1_alpha) + (A/(R*T))*x1_alpha**(2)\n",
+ "\t\t\t# math.log(x1_alpha/(1-x1_alpha)) = (A/(R*T))*(2*x1_alpha - 1)\n",
+ "\n",
+ "def f(x1_alpha): \n",
+ "\t return math.log(x1_alpha/(1-x1_alpha)) - (A/(R*T))*(2*x1_alpha - 1)\n",
+ "x1_alpha = fsolve(f,0.1)\n",
+ "x1_beta = fsolve(f,0.9)\n",
+ "\t\t\t# Because of symmetry 1 - x1_beta = x1_alpha\n",
+ "\n",
+ "\t\t\t# It can be seen that the equation, math.log(x1/(1-x1)) = (A/(R*T))*(2*x1 - 1) has two roots.\n",
+ "\t\t\t# The two roots acn be determined by taking different values \n",
+ "\t\t\t# Starting with x1 = 0.1, we get x1 = 0.169 as the solution and starting with x1 = 0.9,we get x1 = 0.831 as the solution.\n",
+ "\t\t\t# Thus x1 = 0.169 is the composition of phase alpha and x1 = 0.831 is of phase beta\n",
+ "print \" The composition of two liquid phases in equilibrium is given by x1_alpha = %f and x1_beta = %f\"%(x1_alpha,x1_beta);\n",
+ "\n",
+ "\t\t\t# From the equilibrium data it is seen that if the feed has composition x1 less than 0.169 or more than 0.831 the liquid mixture is of single phase\n",
+ "\t\t\t# whereas if the overall (feed) composition is between 0.169 and 0.831 two phases shall be formed.\n",
+ "\t\t\t# The amounts of phases can also be calculated. The feed composition is given to be z1 = 0.6\n",
+ "z1 = 0.6;\n",
+ "\t\t\t# z1 = x1_alpha*alpha + x1_beta*beta\n",
+ "\t\t\t# beta = 1 - alpha\n",
+ "alpha = (z1-x1_beta)/(x1_alpha-x1_beta);\t\t\t#[mol]\n",
+ "Beta = 1 - alpha;\t\t\t#[mol]\n",
+ "print \" The relative amount of phases is given by alpha = %f mol and beta = %f mol\"%(alpha,Beta);\n",
+ "\n",
+ "\t\t\t# the relative amounts of the phases changes with the feed composition \n",
+ "\n",
+ "\t\t\t#math.log(x1/(1-x1)) = (A/(R*T))*(2*x1 - 1)\n",
+ "\t\t\t# If the above equation has two real roots of x1 (one for phase alpha and the other for phase beta) then two liquid phases get formed\n",
+ "\t\t\t# and if it has no real roots then a homogeneous liquid mixtures is obtained.\n",
+ "\n",
+ "print \" math.logx1/1-x1 = A/R*T*2*x1 - 1\";\n",
+ "print \" If the above equation has two real roots of x1 one for phase alpha and the other for phase beta then two liquid phases get formed\";\n",
+ "print \" and if it has no real roots then a homogeneous liquid mixture is obtained\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The UCST of the system is 240.558095 K\n",
+ " The composition of two liquid phases in equilibrium is given by x1_alpha = 0.169102 and x1_beta = 0.830898\n",
+ " The relative amount of phases is given by alpha = 0.348896 mol and beta = 0.651104 mol\n",
+ " math.logx1/1-x1 = A/R*T*2*x1 - 1\n",
+ " If the above equation has two real roots of x1 one for phase alpha and the other for phase beta then two liquid phases get formed\n",
+ " and if it has no real roots then a homogeneous liquid mixture is obtained\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.5 Page Number : 573"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of equilibrium composition\n",
+ "\n",
+ "# Variables\n",
+ "T = 300;\t\t\t#[K]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "A = 7000;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# math.log(x_1/(1-x_1)) = (A/(R*T))*(2*x_1-1)\n",
+ "\n",
+ "# Calculations\n",
+ "def f(x_1): \n",
+ "\t return math.log(x_1/(1-x_1))-((A/(R*T))*(2*x_1-1))\n",
+ "\n",
+ "x1_alpha=fsolve(f,0.1)\n",
+ "\n",
+ "x1_beta=1-x1_alpha;\n",
+ "\n",
+ "# Results\n",
+ "print \"The equilibrium compositin of the two liquid phase system is given by x1_alpha \\t = %f x1_beta \\t = %f\"%(x1_alpha,x1_beta);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium compositin of the two liquid phase system is given by x1_alpha \t = 0.091897 x1_beta \t = 0.908103\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.7 Page Number : 579"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of freezing point depression\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "M_wt_meth = 32;\t\t\t# Molecular weight of methanol \n",
+ "M_wt_water = 18;\t\t\t# Molecular weight of water \n",
+ "m_meth = 0.01;\t\t\t#[g] - Mass of methanol added per cm**(3) of solution\n",
+ "\n",
+ "\t\t\t#Since the concentration of methanol is very small therefore we can assume that the density of solution = pure water\n",
+ "den_sol = 1;\t\t\t#[g/cm**(3)]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#The mole fraction of solute is given by\n",
+ "\t\t\t#x_2 = (moles of solute in cm**(3) of solution)/(moles of solute + moles of water) in 1 cm**(3) of solution\n",
+ "x_2 = (m_meth/M_wt_meth)/((m_meth/M_wt_meth)+((1-m_meth)/M_wt_water));\n",
+ "\n",
+ "\t\t\t#We know that heat of fusion of water is\n",
+ "H_fus = -80;\t\t\t#[cal/g] - Enthalpy change of fusion at 0 C\n",
+ "H_fus = H_fus*4.186*M_wt_water;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t#Therefore freezing point depression is given by\n",
+ "\t\t\t# T - T_m = (R*(T**(2))*x_2)/H_fus\n",
+ "T_f = 273.15;\t\t\t#[K] - Freezing point of water\n",
+ "delta_T_f = (R*(T_f**(2))*x_2)/H_fus;\t\t\t#[K]\n",
+ "\n",
+ "# Results\n",
+ "print \"The depression in freezing point is given by delta_T = %f K\"%(delta_T_f);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The depression in freezing point is given by delta_T = -0.581403 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.8 Page Number : 580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of freezing point\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "T_f = 273.15;\t\t\t#[K] - Freezing point of water\n",
+ "m_water = 100;\t\t\t#[g] - Mass of water\n",
+ "m_NaCl = 3.5;\t\t\t#[g] - Mass of NaCl\n",
+ "M_wt_water = 18.015;\t\t\t# Molecular weight of water \n",
+ "M_wt_NaCl = 58.5;\t\t\t# Molecular weight of NaCl\n",
+ "mol_water = m_water/M_wt_water;\t\t\t#[mol] - Moles of water\n",
+ "mol_NaCl = m_NaCl/M_wt_NaCl;\t\t\t#[mol] - Moles of NaCl\n",
+ "\n",
+ "H_fus = -80;\t\t\t#[cal/g] - Enthalpy change of fusion at 0 C\n",
+ "H_fus = H_fus*4.186*M_wt_water;\t\t\t#[J/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#Mole fraction of the solute (NaCl) is given by\n",
+ "x_2 = mol_NaCl/(mol_NaCl+mol_water);\n",
+ "\n",
+ "\t\t\t#But NaCl is compietely ionized and thus each ion acts independently to lower the water mole fraction.\n",
+ "x_2_act = 2*x_2;\t\t\t# Actual mole fraction\n",
+ "\n",
+ "\t\t\t#Now depression in freezing point is given by\n",
+ "\t\t\t# T - T_m = (R*(T**(2))*x_2_act)/H_fus\n",
+ "delta_T_f = (R*(T_f**(2))*x_2_act)/H_fus;\t\t\t#[C]\n",
+ "\n",
+ "\t\t\t#Thus freezing point of seawater = depression in freezing point\n",
+ "\n",
+ "# Results\n",
+ "print \"The freezing point of seawater is %f C\"%(delta_T_f);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The freezing point of seawater is -2.192853 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.10 Page Number : 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of boiling point elevation \n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "T_b = 373.15;\t\t\t#[K] - Boiling point of water\n",
+ "m_water = 100.;\t\t\t#[g] - Mass of water\n",
+ "m_C12H22 = 5.;\t\t\t#[g] - Mass of glucise (C12H22)\n",
+ "M_wt_water = 18.015;\t\t\t# Molecular weight of water \n",
+ "M_wt_C12H22 = 342.30;\t\t\t# Molecular weight of C12H22\n",
+ "mol_water = m_water/M_wt_water;\t\t\t#[mol] - Moles of water\n",
+ "mol_C12H22 = m_C12H22/M_wt_C12H22;\t\t\t#[mol] - Moles of C12H22\n",
+ "\n",
+ "# Calculations\n",
+ "H_vap = 540.;\t\t\t#[cal/g] - Enthalpy change of vaporisation\n",
+ "H_vap = H_vap*4.186*M_wt_water;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t#Mole fraction of the solute (C12H22) is given by\n",
+ "x_2 = mol_C12H22/(mol_C12H22+mol_water);\n",
+ "\n",
+ "\t\t\t#The boiling point elevation is given by\n",
+ "\t\t\t# T - T_b = (R*T_b**(2)*x_2**(2))/H_vap**(2)\n",
+ "\n",
+ "delta_T_b = (R*T_b**(2)*x_2)/(H_vap);\n",
+ "\n",
+ "# Results\n",
+ "print \"The elevation in boiling point is given by delta_T = %f C\"%(delta_T_b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The elevation in boiling point is given by delta_T = 0.074611 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.11 Page Number : 584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of osmotic pressure\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "T = 25 + 273.15;\t\t\t#[K] - Surrounding temperature \n",
+ "den_water = 1000.;\t\t\t#[kg/m**(3)] - Density of water\n",
+ "m_water = 100.;\t\t\t#[g] - Mass of water\n",
+ "m_C12H22 = 5.;\t\t\t#[g] - Mass of glucise (C12H22)\n",
+ "M_wt_water = 18.015;\t\t\t# Molecular weight of water \n",
+ "M_wt_C12H22 = 342.30;\t\t\t# Molecular weight of C12H22\n",
+ "mol_water = m_water/M_wt_water;\t\t\t#[mol] - Moles of water\n",
+ "mol_C12H22 = m_C12H22/M_wt_C12H22;\t\t\t#[mol] - Moles of C12H22\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#Mole fraction of the water is given by\n",
+ "x_1 = mol_water/(mol_C12H22+mol_water);\n",
+ "\n",
+ "\t\t\t#Molar volume of water can be calculated as\n",
+ "V_l_water = (1./den_water)*M_wt_water*10**(-3);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#The osmotic pressure is given by\n",
+ "pi = -(R*T*math.log(x_1))/V_l_water;\t\t\t#[N/m**(2)]\n",
+ "pi = pi*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "# Results\n",
+ "print \"The osmotic pressure of the mixture is %f bar\"%(pi);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The osmotic pressure of the mixture is 3.616073 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.12 Page Number : 585"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of pressure\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "T = 25 + 273.15;\t\t\t#[K] - Surrounding temperature\n",
+ "den_water = 1000.;\t\t\t#[kg/m**(3)] - Density of water\n",
+ "m_water = 100.;\t\t\t#[g] - Mass of water\n",
+ "m_NaCl = 3.5;\t\t\t#[g] - Mass of NaCl\n",
+ "M_wt_water = 18.015;\t\t\t# Molecular weight of water \n",
+ "M_wt_NaCl = 58.5;\t\t\t# Molecular weight of NaCl\n",
+ "mol_water = m_water/M_wt_water;\t\t\t#[mol] - Moles of water\n",
+ "mol_NaCl = m_NaCl/M_wt_NaCl;\t\t\t#[mol] - Moles of NaCl\n",
+ "\n",
+ "# Calculations\n",
+ "H_fus = -80.;\t\t\t#[cal/g] - Enthalpy change of fusion at 0 C\n",
+ "H_fus = H_fus*4.186*M_wt_water;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t#Mole fraction of the solute (NaCl) is given by\n",
+ "x_2 = mol_NaCl/(mol_NaCl+mol_water);\n",
+ "\n",
+ "\t\t\t#But NaCl is compietely ionized and thus each ion acts independently to lower the water mole fraction.\n",
+ "x_2_act = 2*x_2;\t\t\t# Actual mole fraction\n",
+ "\n",
+ "x_1 = 1 - x_2_act;\n",
+ "\n",
+ "\t\t\t#Molar volume of water can be calculated as\n",
+ "V_l_water = (1/den_water)*M_wt_water*10**(-3);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#The osmotic pressure is given by\n",
+ "pi = -(R*T*math.log(x_1))/V_l_water;\t\t\t#[N/m**(2)]\n",
+ "pi = pi*10**(-5);\t\t\t#[bar]\n",
+ "\t\t\t#The minimum pressure to desalinate sea water is nothing but the osmotic pressure\n",
+ "\n",
+ "# Results\n",
+ "print \"The minimum pressure to desalinate sea water is %f bar\"%(pi);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum pressure to desalinate sea water is 29.662232 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.13 Page Number : 586"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of amount of precipitate\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "T = 173.15;\t\t\t#[K] - Surrounding temperature\n",
+ "P = 60;\t\t\t#[bar]\n",
+ "P = P*10**(5);\t\t\t#[Pa] \n",
+ "\n",
+ "\t\t\t#componenet 1 : CO2 (1)\n",
+ "\t\t\t#componenet 2 : H2 (2)\n",
+ "P_1_sat = 0.1392;\t\t\t#[bar] - Vapour pressre of pure solid CO2\n",
+ "P_1_sat = P_1_sat*10**(5);\t\t\t#[bar]\n",
+ "V_s_1 = 27.6;\t\t\t#[cm**(3)/mol] - Molar volume of solid CO2\n",
+ "V_s_1 = V_s_1*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "n_1 = 0.01;\t\t\t#[mol] - Initial number of moles of CO2\n",
+ "n_2 = 0.99;\t\t\t#[mol] - Initial number of moles of H2\n",
+ "\n",
+ "\t\t\t#Let us determine the fugacity of solid CO2 (1) at 60 C and 173.15 K\n",
+ "\t\t\t# f_1 = f_1_sat*math.exp(V_s_1*(P-P_1_sat)/(R*T))\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#Since vapour pressure of pure solid CO2 is very small, therefore\n",
+ "f_1_sat = P_1_sat;\n",
+ "f_1 = f_1_sat*math.exp(V_s_1*(P-P_1_sat)/(R*T));\n",
+ "\n",
+ "\t\t\t#Since gas phase is ideal therefore\n",
+ "\t\t\t# y1*P = f_1\n",
+ "y1 = f_1/P;\n",
+ "\n",
+ "\t\t\t#Number of moles of H2 in vapour phase at equilibrium remains the same as initial number of moles.\n",
+ "\t\t\t#Number of moles of CO2 in vapour phase at equilibrium can be calculated as\n",
+ "\t\t\t#y1 = (n_1_eq/(n_1_eq + n_2)). Therefore\n",
+ "n_1_eq = n_2*y1/(1-y1);\n",
+ "\n",
+ "\t\t\t#Therefore moles of CO2 precipitated is\n",
+ "n_ppt = n_1 - n_1_eq;\t\t\t#[mol]\n",
+ "\n",
+ "# Results\n",
+ "print \"The moles of CO2 precipitated is %f mol\"%(n_ppt);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The moles of CO2 precipitated is 0.007417 mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.14 Page Number : 586"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - universal gas constant\n",
+ "T = 350.;\t\t\t#[K] - Surrounding temperature\n",
+ "\n",
+ "\t\t\t#componenet 1 : organic solid (1)\n",
+ "\t\t\t#componenet 2 : CO2 (2)\n",
+ "\n",
+ "P_1_sat = 133.3;\t\t\t#[N/m**(2)] - Vapour pressre of organic solid\n",
+ "V_s_1 = 200.;\t\t\t#[cm**(3)/mol] - Molar volume of organic solid\n",
+ "V_s_1 = V_s_1*10.**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#/At 350 K, the values of the coefficients \n",
+ "B_11 = -500.;\t\t\t#[cm**(3)/mol]\n",
+ "B_22 = -85.;\t\t\t#[cm****(3)/mol]\n",
+ "B_12 = -430.;\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#From phase equilibrium equation of component 1, we get\n",
+ "\t\t\t# y1*P*phi_1 = f_1\n",
+ "\t\t\t# f_1 = f_1_sat*math.exp(V_s_1*(P-P_1_sat)/(R*T))\n",
+ "\n",
+ "\t\t\t#Since vapour pressure of organic solid is very small, therefore\n",
+ "f_1_sat = P_1_sat;\n",
+ "\n",
+ "\t\t\t# Now let us determine the fugacity coefficient of organic solid in the vapour mixture.\n",
+ "\t\t\t# math.log(phi_1) = (P/(R*T))*(B_11 + y2**(2)*del_12) \n",
+ "del_12 = (2*B_12 - B_11 - B_22)*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#It is given that the partial pressure of component 1 in the vapour mixture is 1333 N?m**(2)\n",
+ "\t\t\t# y1*P = 1333 N/m**(2) or, y1 = 1333/P\n",
+ "\t\t\t# y2 = 1- 1333/P\n",
+ "\t\t\t# math.log(phi_1) = (P/(R*T))*(B_11 + (1- 1333/P)**(2)*del_12)\n",
+ "\n",
+ "\t\t\t#The phase equilibrium equation becomes\n",
+ "\t\t\t# y1*P*phi_1 = f_1_sat*math.exp(V_s_1*(P-P_1_sat)/(R*T))\n",
+ "\t\t\t#Taking math.log on both side we have\n",
+ "\t\t\t# math.log(y1*P) + math.log(phi_1) = math.log(f_1_sat) + (V_s_1*(P-P_1_sat)/(R*T))\n",
+ "\t\t\t# (V_s_1*(P-P_1_sat)/(R*T)) - math.log(phi_1) = math.log(1333/133.3) = math.log(10)\n",
+ "\n",
+ "\t\t\t#substituting for math.log(phi_1) from previous into the above equation we get\n",
+ "\t\t\t# (V_s_1*(P-P_1_sat)/(R*T)) - (P/(R*T))*(B_11 + (1- 1333/P)**(2)*del_12) - math.log(10) = 0\n",
+ "\t\t\t# On simplification we get,\n",
+ "\t\t\t# 975*P**(2) - 6.7*10**(9)*P + 4.89*10**(8) = 0\n",
+ "\t\t\t# Solving the above qyadratic equation using shreedharcharya rule\n",
+ "\n",
+ "P3 = (6.7*10**(9) + ((-6.7*10**(9))**(2)-4*975*4.98*10**(8))**(1./2))/(2*975);\t\t\t#[Pa]\n",
+ "P4 = (6.7*10**(9) - ((-6.7*10**(9))**(2)-4*975*4.98*10**(8))**(1./2))/(2*975);\t\t\t#[Pa]\n",
+ "\t\t\t# The second value is not possible, therefore pressure of the system is P3\n",
+ "P3 = P3*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "# Results\n",
+ "print \" The total pressure of the system is %f bar\"%(P3);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The total pressure of the system is 68.717948 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch17_1.ipynb b/Chemical_Engineering_Thermodynamics/ch17_1.ipynb
new file mode 100644
index 00000000..f87043e6
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch17_1.ipynb
@@ -0,0 +1,2092 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 : Chemical Reactions Equilibria"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.2 Page Number : 598"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of number of moles\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "P = 1;\t\t\t#[atm] - Reactor pressure\n",
+ "T = 749;\t\t\t#[K] - Reactor temperature\n",
+ "K = 74;\t\t\t# Equlibrium constant\n",
+ "\n",
+ "\t\t\t# SO2 + (1/2)*O2 - SO3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Kp = P**(1);\n",
+ "Ky = K/Kp;\n",
+ "\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_SO2_1_in = 12;\n",
+ "n_O2_1_in = 9;\n",
+ "n_SO3_1_in = 0;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_SO2_1_eq = 12 - X\n",
+ "\t\t\t# n_O2_1_eq = 9 - 0.5*X\n",
+ "\t\t\t# n_SO3_1_eq = X\n",
+ "\t\t\t# Total moles = 21 - 0.5*X\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "\t\t\t# y_SO3 = X/(21-0.5*X)\n",
+ "\t\t\t# y_SO2 = (12-X)/(21-0.5*X)\n",
+ "\t\t\t# y_O2 = (9-0.5*X)/(21-0.5*X)\n",
+ "\n",
+ "\t\t\t# Ky = y_SO3/(y_SO2*y_O2**(2))\n",
+ "\t\t\t# Ky = (X*(21-0.5*X)**(1/2))/((12-X)*(9-0.5*X)**(1/2))\n",
+ "def f(X): \n",
+ "\t return Ky-(X*(21-0.5*X)**(1./2))/((12-X)*(9-0.5*X)**(1./2))\n",
+ "X_1 = fsolve(f,11)\n",
+ "\n",
+ "y_SO3_1 = X_1/(21-0.5*X_1);\n",
+ "y_SO2_1 = (12-X_1)/(21-0.5*X_1);\n",
+ "y_O2_1 = (9-0.5*X_1)/(21-0.5*X_1);\n",
+ "\n",
+ "print \" 1).The moles of SO3 formed = %f mol\"%(X_1);\n",
+ "print \" The mole fractions at equilibrium are y_S03 = %f y_SO2 = %f and y_O2 = %f\"%(y_SO3_1,y_SO2_1,y_O2_1);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_SO2_2_in = 24;\n",
+ "n_O2_2_in = 18;\n",
+ "n_SO3_2_in = 0;\n",
+ "\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_SO2_1_eq = 24 - X\n",
+ "\t\t\t# n_O2_1_eq = 18 - 0.5*X\n",
+ "\t\t\t# n_SO3_1_eq = X\n",
+ "\t\t\t# Total moles = 42 - 0.5*X\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "\t\t\t# y_SO3 = X/(42-0.5*X)\n",
+ "\t\t\t# y_SO2 = (24-X)/(42-0.5*X)\n",
+ "\t\t\t# y_O2 = (18-0.5*X)/(42-0.5*X)\n",
+ "\n",
+ "\t\t\t# Ky = y_SO3/(y_SO2*y_O2**(2))\n",
+ "\t\t\t# Ky = (X*(42-0.5*X)**(1/2))/((24-X)*(18-0.5*X)**(1/2))\n",
+ "def f1(X): \n",
+ "\t return Ky-(X*(42-0.5*X)**(1./2))/((24-X)*(18-0.5*X)**(1./2))\n",
+ "X_2 = fsolve(f1,22)\n",
+ "\n",
+ "y_SO3_2 = X_2/(42-0.5*X_2);\n",
+ "y_SO2_2 = (24-X_2)/(42-0.5*X_2);\n",
+ "y_O2_2 = (18-0.5*X_2)/(42-0.5*X_2);\n",
+ "print \" 2).The moles of SO3 formed = %f mol\"%(X_2);\n",
+ "print \" The mole fractions at equilibrium are y_S03 = %f, y_SO2 = %f and y_O2 = %f\"%(y_SO3_2,y_SO2_2,y_O2_2);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_SO2_3_in = 12;\n",
+ "n_O2_3_in = 9;\n",
+ "n_SO3_3_in = 0;\n",
+ "n_N2 = 79;\n",
+ "\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_SO2_1_eq = 12 - X\n",
+ "\t\t\t# n_O2_1_eq = 9 - 0.5*X\n",
+ "\t\t\t# n_SO3_1_eq = X\n",
+ "\t\t\t# Total moles = 100 - 0.5*X\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "\t\t\t# y_SO3 = X/(100-0.5*X)\n",
+ "\t\t\t# y_SO2 = (12-X)/(100-0.5*X)\n",
+ "\t\t\t# y_O2 = (9-0.5*X)/(100-0.5*X)\n",
+ "\n",
+ "\t\t\t# Ky = y_SO3/(y_SO2*y_O2**(2))\n",
+ "\t\t\t# Ky = (X*(100-0.5*X)**(1/2))/((12-X)*(9-0.5*X)**(1/2))\n",
+ "def f2(X): \n",
+ "\t return Ky-(X*(100-0.5*X)**(1./2))/((12-X)*(9-0.5*X)**(1./2))\n",
+ "X_3 = fsolve(f2,10)\n",
+ "\n",
+ "y_SO3_3 = X_3/(100-0.5*X_3);\n",
+ "y_SO2_3 = (12-X_3)/(100-0.5*X_3);\n",
+ "y_O2_3 = (9-0.5*X_3)/(100-0.5*X_3);\n",
+ "\n",
+ "print \" 3).The moles of SO3 formed = %f mol\"%(X_3);\n",
+ "print \" The mole fractions at equilibrium are y_S03 = %f y_SO2 = %f and y_O2 = %f\"%(y_SO3_3,y_SO2_3,y_O2_3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The moles of SO3 formed = 11.655537 mol\n",
+ " The mole fractions at equilibrium are y_S03 = 0.768215 y_SO2 = 0.022704 and y_O2 = 0.209081\n",
+ " 2).The moles of SO3 formed = 23.311074 mol\n",
+ " The mole fractions at equilibrium are y_S03 = 0.768215, y_SO2 = 0.022704 and y_O2 = 0.209081\n",
+ " 3).The moles of SO3 formed = 11.202213 mol\n",
+ " The mole fractions at equilibrium are y_S03 = 0.118669 y_SO2 = 0.008451 and y_O2 = 0.036006\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.3 Page Number : 599"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of equilibrium composition\n",
+ "\n",
+ "# Variables\n",
+ "T = 600;\t\t\t#[K] - Reactor temperature\n",
+ "P = 300;\t\t\t#[atm] - Reactor pressure\n",
+ "K = 0.91*10**(-4);\t\t\t# Equilibrium constant\n",
+ "\n",
+ "\t\t\t# The fugacity coefficients of the components are\n",
+ "phi_CO = 1.0;\n",
+ "phi_H2 = 1.2;\n",
+ "phi_CH3OH = 0.47;\n",
+ "\n",
+ "\t\t\t# CO + 2*H2 - CH3OH \n",
+ "\n",
+ "\t\t\t# For gas phase reactions the smath.tan(math.radiansard state is pure ideal gas and thus fi_0 = 1 atm and thus\n",
+ "\t\t\t# ai_cap = fi_cap/fi_0 = yi*P*phi_i_cap/1\n",
+ "\t\t\t# Thus K = Ky*Kp*K_phi\n",
+ "# Calculations and Results \n",
+ "Kp = P**(1-3);\n",
+ "K_phi = phi_CH3OH/(phi_CO*phi_H2**(2));\n",
+ "Ky = K/(Kp*K_phi);\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium ,the moles of the components be \n",
+ "\t\t\t# n_CO = 1 - X\n",
+ "\t\t\t# n_H2 = 3 - 2*X\n",
+ "\t\t\t# n_CH3OH = X\n",
+ "\t\t\t# Total moles = 4 - 2*X\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "\t\t\t# y_CO = (1-X)/(4-2*X)\n",
+ "\t\t\t# y_H2 = (3-2*X)/(4-2*X)\n",
+ "\t\t\t# y_CH3OH = (X)/(4-2*X)\n",
+ "\n",
+ "\t\t\t# Ky = y_CH3OH/(y_CO*y_H2**(2)) = (X/(4-2*X))/(((1-X)/(4-2*X))*((3-2*X)/(4-2*X))**(2))\n",
+ "def f(X): \n",
+ "\t return Ky-(X/(4-2*X))/(((1-X)/(4-2*X))*((3-2*X)/(4-2*X))**(2))\n",
+ "X = fsolve(f,0.1)\n",
+ "\n",
+ "\t\t\t# Therefore at equilibrium \n",
+ "y_CO = (1-X)/(4-2*X);\n",
+ "y_H2 = (3-2*X)/(4-2*X);\n",
+ "y_CH3OH = (X)/(4-2*X);\n",
+ "\n",
+ "print \" The mole fractions at equilibrium are y_CO = %f y_H2 = %f and y_CH3OH = %f\"%(y_CO,y_H2,y_CH3OH);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The mole fractions at equilibrium are y_CO = 0.051857 y_H2 = 0.551857 and y_CH3OH = 0.396286\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.4 Page Number : 600"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the value of equilibrium constant\n",
+ "\n",
+ "# Variables\t\t\n",
+ "T = 600;\t\t\t#[K] - Reactor temperature\n",
+ "P = 4;\t\t\t#[atm] - Reactor pressure\n",
+ "K = 1.175;\t\t\t# Equilibrium constant\n",
+ "\n",
+ "\t\t\t# (1/2)*N2 + (3/2)*H_2 - NH3\n",
+ "\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_N2 = 1;\n",
+ "n_H2 = 3;\n",
+ "n_HN3 = 0;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X.\n",
+ "\t\t\t# At equilibrium ,the moles of the components be \n",
+ "\t\t\t# n_N2 = 1 - 0.5*X\n",
+ "\t\t\t# n_H2 = 3 - 1.5*X\n",
+ "\t\t\t# n_NH3 = X\n",
+ "\t\t\t# Total moles = 4 - X\n",
+ "\n",
+ "\t\t\t# We have, K = Ky*Kp\n",
+ "Kp = P**(1-2);\t\t\t#[atm**(-1)]\n",
+ "Ky = K/(Kp);\n",
+ "\n",
+ "\t\t\t# Ky = y_NH3/(y_N2**(1/2)*y_H2**(3/2)) = (X/(4-X))/(((1-0.5*X)/(4-X))**(1/2)*((3-1.5*X)/(4-X))**(3/2))\n",
+ "\t\t\t# Solving the above equation we get\n",
+ "def f(X): \n",
+ "\t return Ky - (X/(4-X))/(((1-0.5*X)/(4-X))**(1./2)*((3-1.5*X)/(4-X))**(3./2))\n",
+ "X = fsolve(f,0.1)\n",
+ "\n",
+ "y_NH3 = X/(4-X);\t\t\t# Mole fraction of NH3 at equilibrium\n",
+ "\n",
+ "print \" The value of Kp = %f and Ky = %f \"%(Kp,Ky);\n",
+ "print \" The mole fractions of NH3 at equilibrium is %f\"%(y_NH3);\n",
+ "\n",
+ "\t\t\t# If reaction carried out at constant temperature and volume\n",
+ "\n",
+ "\t\t\t# We know that for ideal gas, P*V = n*R*T and thus P is directly proportional to n at constant V and T.\n",
+ "\t\t\t# Let P = k*n\n",
+ "\t\t\t# Initially P = 4 atm and n = 4 moles, thus K = 1 and we get p = n, where P is in atm. \n",
+ "\t\t\t# Thus at equilibrium P = 4 - X\n",
+ "\n",
+ "\t\t\t# Ky = K/Kp = 1.175*P = 1.175*(4 - X)\n",
+ "\t\t\t# (X/(4-X))/(((1-0.5*X)/(4-X))**(1/2)*((3-1.5*X)/(4-X))**(3/2)) = 1.175*(4 - X)\n",
+ "\t\t\t# Solving the above equation we get\n",
+ "def f1(X): \n",
+ "\t return (X/(4-X))/(((1-0.5*X)/(4-X))**(1./2)*((3-1.5*X)/(4-X))**(3./2))-1.175*(4-X)\n",
+ "X_prime = fsolve(f1,1)\n",
+ "\n",
+ "\t\t\t# Therefore at equilibrium \n",
+ "P_prime = 4 - X_prime;\n",
+ "y_NH3_prime = X_prime/(4-X_prime);\n",
+ "\n",
+ "print \" If reaction is carried out at constant temperature and volumethen\"\n",
+ "print \" The equilibrium pressure is %f atm\"%(P_prime);\n",
+ "print \" The equilibrium mole fractions of NH3 in the reactor is %f\"%(y_NH3_prime);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of Kp = 0.250000 and Ky = 4.700000 \n",
+ " The mole fractions of NH3 at equilibrium is 0.454388\n",
+ " If reaction is carried out at constant temperature and volumethen"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The equilibrium pressure is 2.863057 atm\n",
+ " The equilibrium mole fractions of NH3 in the reactor is 0.397108\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.5 Page Number : 601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of mole fraction\n",
+ "\n",
+ "# Variables\n",
+ "T = 400;\t\t\t#[K] - Reactor temperature\n",
+ "P = 1;\t\t\t#[atm] - Reactor pressure\n",
+ "K = 1.52;\t\t\t# Equilibrium constant\n",
+ "y_H2 = 0.4;\t\t\t# Equilibrium mole fraction of hydrogen\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# CO(g) + 2*H_2(g) - CH3OH(g)\n",
+ "\n",
+ "\t\t\t# K = y_CH3OH/(y_CO*y_H2**(2)*P**(2))\n",
+ "\t\t\t# Let total number of moles at equilibrium be 1\n",
+ "\t\t\t# y_CH3OH = 0.6 - y_CO;\n",
+ "\t\t\t# (0.6 - y_CO)/y_CO = K*P**(2)*y_H2**(2)\n",
+ "\n",
+ "y_CO = 0.6/(1 + K*P**(2)*y_H2**(2));\n",
+ "y_CH3OH = 0.6 - y_CO;\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \" The mole fractions are y_CO = %f and y_CH3OH = %f \"%(y_CO,y_CH3OH);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The mole fractions are y_CO = 0.482625 and y_CH3OH = 0.117375 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.6 Page Number : 602"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of number of moles\n",
+ "\n",
+ "# Variables\n",
+ "T = 749.;\t\t\t#[K] - Reactor temperature\n",
+ "P = 1.;\t\t\t#[atm] - Reactor pressure\n",
+ "K = 74.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Kp = P**(-1./2);\t\t\t#[atm**(-1/2)]\n",
+ "Ky = K/Kp;\n",
+ "\n",
+ "\t\t\t# SO2 + (1/2)*O2 - SO3\n",
+ "\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_SO2_1_in = 10;\n",
+ "n_O2_1_in = 8;\n",
+ "n_SO3_1_in = 0;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_SO2_1_eq = 10 - X\n",
+ "\t\t\t# n_O2_1_eq = 8 - 0.5*X\n",
+ "\t\t\t# SO3_1_eq = X\n",
+ "\t\t\t# Total moles = 18 - 0.5*X\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "\t\t\t# y_SO3 = X/(18-0.5*X)\n",
+ "\t\t\t# y_SO2 = (10-X)/(18-0.5*X)\n",
+ "\t\t\t# y_O2 = (8-0.5*X)/(18-0.5*X)\n",
+ "\n",
+ "\t\t\t# Ky = y_SO3/(y_SO2*y_O2**(2))\n",
+ "\t\t\t# Ky = (X*(18-0.5*X)**(1/2))/((10-X)*(8-0.5*X)**(1/2))\n",
+ "def f(X): \n",
+ "\t return Ky-(X*(18-0.5*X)**(1./2))/((10-X)*(8-0.5*X)**(1./2))\n",
+ "X_1 = fsolve(f,11)\n",
+ "\n",
+ "n_SO3 = X_1;\n",
+ "n_SO2 = 10 - X_1;\n",
+ "n_O2 = 8 - 0.5*X_1;\n",
+ "\n",
+ "print \" 1).The moles of the components at equilibrium are n_SO3 = %f mol n_SO2 = %f mol and n_O2 = %f mol\"%(n_SO3,n_SO2,n_O2);\n",
+ "\n",
+ "\t\t\t# Now for the reaction\n",
+ "\t\t\t# 2*SO2 + O2 - 2*SO3\n",
+ "\n",
+ "\t\t\t# The equilibrium constant for this reaction is KP**(2)\n",
+ "Ky_prime = Ky**(2);\n",
+ "\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_SO2_1_eq = 10 - 2*X\n",
+ "\t\t\t# n_O2_1_eq = 8 - X\n",
+ "\t\t\t# SO3_1_eq = 2*X\n",
+ "\t\t\t# Total moles = 18 - X\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "\t\t\t# y_SO3 = 2*X/(18-X)\n",
+ "\t\t\t# y_SO2 = (10-2*X)/(18-X)\n",
+ "\t\t\t# y_O2 = (8- X)/(18-X)\n",
+ "\n",
+ "\t\t\t# Ky_prime = y_SO3**(2)/(y_SO2**(2)*y_O2)\n",
+ "\t\t\t# Ky_prime = ((2*X)**(2)*(18-X))/((10-2*X)**(2)*(8-X))\n",
+ "def f1(X): \n",
+ "\t return Ky_prime-((2*X)**(2)*(18-X))/(((10-2*X)**(2))*(8-X))\n",
+ "X_2 = fsolve(f1,6)\n",
+ "\n",
+ "n_SO3_prime = 2*X_2;\n",
+ "n_SO2_prime = 10 - 2*X_2;\n",
+ "n_O2_prime = 8 - X_2;\n",
+ "\n",
+ "print \" 2).The moles of the components at equilibrium are n_SO3 = %f mol n_SO2 = %f mol and n_O2 = %f mol\"%(n_SO3_prime,n_SO2_prime,n_O2_prime);\n",
+ "print \" Thus the number of moles remains the same irrespective of the stoichoimetry of the reaction\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The moles of the components at equilibrium are n_SO3 = 9.730824 mol n_SO2 = 0.269176 mol and n_O2 = 3.134588 mol\n",
+ " 2).The moles of the components at equilibrium are n_SO3 = 9.730824 mol n_SO2 = 0.269176 mol and n_O2 = 3.134588 mol\n",
+ " Thus the number of moles remains the same irrespective of the stoichoimetry of the reaction\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.7 Page Number : 603"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# \t\tCalculation of mole fraction\n",
+ "\n",
+ "# Variables\n",
+ "T = 500;\t\t\t#[K]\n",
+ "\t\t\t# For the reaction, 0.5*A2 + 0.5*B2 - AB\n",
+ "delta_G = -4200;\t\t\t#[J/mol]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# A2 + B2 - 2*AB\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# We know delta_G_rkn_0 = -R*T*math.log(K) \n",
+ "delta_G_1 = 2*delta_G;\n",
+ "K_1 = math.exp(-delta_G_1/(R*T));\t\t\t# Equilibrium constant at 500 K for the above reaction\n",
+ "\t\t\t# As can be seen the reaction is not affected by pressure and therefore K = Ky as Kp = 1 \n",
+ "Ky = K_1;\n",
+ "\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_A2_1_in = 0.5;\n",
+ "n_B2_1_in = 0.5;\n",
+ "n_AB_1_in = 0;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_A2_1_eq = 0.5 - X\n",
+ "\t\t\t# n_B2_1_eq = 0.5- X\n",
+ "\t\t\t# n_AB_1_eq = 2*X\n",
+ "\t\t\t# Total moles = 1\n",
+ "\n",
+ "\t\t\t# Ky = (2*X)**(2)/(0.5-X)**(2)\n",
+ "def f(X): \n",
+ "\t return Ky-(2*X)**(2)/(0.5-X)**(2)\n",
+ "X_1 = fsolve(f,0.2)\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "y_A2_1 = 0.5 - X_1;\n",
+ "y_B2_1 = 0.5- X_1;\n",
+ "y_AB_1 = 2*X_1;\n",
+ "\n",
+ "print \" 1).The mole fractions at equilibrium are y_A2 = %f y_B2 = %f and y_AB = %f\"%(y_A2_1,y_B2_1,y_AB_1);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# 0.5*A2 + 0.5*B2 - AB\n",
+ "\n",
+ "\t\t\t# We know delta_G_rkn_0 = -R*T*math.log(K) \n",
+ "delta_G_2 = delta_G;\n",
+ "K_2 = math.exp(-delta_G_2/(R*T));\t\t\t# Equilibrium constant at 500 K for the above reaction\n",
+ "\n",
+ "\t\t\t# As can be seen the reaction is not affected by pressure and therefore K = Ky as Kp = 1 \n",
+ "Ky_2 = K_2;\n",
+ "\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_A2_2_in = 0.5;\n",
+ "n_B2_2_in = 0.5;\n",
+ "n_AB_2_in = 0;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_A2_2_eq = 0.5 - 0.5*X\n",
+ "\t\t\t# n_B2_2_eq = 0.5- 0.5*X\n",
+ "\t\t\t# n_AB_2_eq = X\n",
+ "\t\t\t# Total moles = 1\n",
+ "\n",
+ "\t\t\t# Ky = y_AB/(y_A2**(1/2)*y_B2**(1/2))\n",
+ "\t\t\t# Ky = X/(0.5 - 0.5*X)\n",
+ "X_2 = 0.5*Ky_2/(1+0.5*Ky_2);\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "y_A2_2 = 0.5 - 0.5*X_2;\n",
+ "y_B2_2 = 0.5- 0.5*X_2;\n",
+ "y_AB_2 = X_2;\n",
+ "\n",
+ "print \" 2).The mole fractions at equilibrium are y_A2 = %f y_B2 = %f and y_AB = %f\"%(y_A2_2,y_B2_2,y_AB_2);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "\t\t\t# 2*AB - A2 + B2\n",
+ "\n",
+ "K_3 = 1/K_1;\t\t\t# Equilibrium constant at 500 K for the above reaction\n",
+ "\t\t\t# As can be seen the reaction is not affected by pressure and therefore K = Ky as Kp = 1 \n",
+ "Ky_3 = K_3;\n",
+ "\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "n_AB_3_in = 1;\n",
+ "n_A2_3_in = 0;\n",
+ "n_B2_3_in = 0;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_AB_3_eq = 1 - X\n",
+ "\t\t\t# n_A2_3_eq = X/2\n",
+ "\t\t\t# n_B2_3_eq = X/2\n",
+ "\t\t\t# Total moles = 1\n",
+ "\n",
+ "\t\t\t# Ky = (X/2)**(2)/(1-X)**(2)\n",
+ "def f1(X): \n",
+ "\t return Ky_3-(X/2)**(2)/(1-X)**(2)\n",
+ "X_3 = fsolve(f1,0.4)\n",
+ "\n",
+ "\t\t\t# The mole fractions of the components at equilibrium are\n",
+ "y_A2_3 = X_3/2;\n",
+ "y_B2_3 = X_3/2;\n",
+ "y_AB_3 = 1-X_3;\n",
+ "\n",
+ "print \" 3).The mole fractions at equilibrium are y_A2 = %f y_B2 = %f and y_AB = %f\"%(y_A2_3,y_B2_3,y_AB_3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The mole fractions at equilibrium are y_A2 = 0.210680 y_B2 = 0.210680 and y_AB = 0.578641\n",
+ " 2).The mole fractions at equilibrium are y_A2 = 0.210680 y_B2 = 0.210680 and y_AB = 0.578641\n",
+ " 3).The mole fractions at equilibrium are y_A2 = 0.210680 y_B2 = 0.210680 and y_AB = 0.578641\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.9 Page Number : 606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Dtermination of heat of reaction \n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\t\t\n",
+ "\n",
+ "# Variables\n",
+ "R = 1.987;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "delta_H_SO2_298 = -70.96;\t\t\t#[kcal/mol] - Enthalpy of formation of S02 at 298.15 K\n",
+ "delta_H_SO3_298 = -94.45;\t\t\t#[kcal/mol] - Enthalpy of formation of S03 at 298.15 K\n",
+ "delta_G_SO2_298 = -71.79;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of SO2 at 298.15 K\n",
+ "delta_G_SO3_298 = -88.52;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of SO3 at 298.15 K\n",
+ "\n",
+ "\t\t\t# Cp_0 = a + b*T + c*T**(2) + d*T**(3)\n",
+ "\n",
+ "a_SO2 = 6.157;\n",
+ "a_SO3 = 3.918;\n",
+ "a_O2 = 6.085;\n",
+ "b_SO2 = 1.384*10**(-2);\n",
+ "b_SO3 = 3.483*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "c_SO2 = -0.9103*10**(-5);\n",
+ "c_SO3 = -2.675*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "d_SO2 = 2.057*10**(-9);\n",
+ "d_SO3 = 7.744*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "\n",
+ "\t\t\t#(1)\n",
+ "T_1 = 298.15;\t\t\t#[K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "delta_H_rkn_298 = delta_H_SO3_298 - delta_H_SO2_298;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "delta_G_rkn_298 = delta_G_SO3_298 - delta_G_SO2_298;\t\t\t#[kcal]\n",
+ "delta_G_rkn_298 = delta_G_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "delta_a = a_SO3 - a_SO2 - (a_O2/2);\n",
+ "delta_b = b_SO3 - b_SO2 - (b_O2/2);\n",
+ "delta_c = c_SO3 - c_SO2 - (c_O2/2);\n",
+ "delta_d = d_SO3 - d_SO2 - (d_O2/2);\n",
+ "\n",
+ "\n",
+ "def f60(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_T = delta_H_rkn_298 + quad(f60,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# On simplification we get\n",
+ "\t\t\t# delta_H_rkn_T = -22630.14 - 5.2815*T + 0.9587*10**(-2)*T**(2) - 0.5598*10**(-5)*T**(3) + 1.3826*10**(-9)*T**(4)\n",
+ "\n",
+ "print \" 1.The math.expression for delta_H_rkn_T as a function of T is given by\";\n",
+ "print \" delta_H_rkn_T = -22630.14 - 5.2815*T + 0.9587*10**-2*T**2 - 0.5598*10**-5*T**3 + 1.3826*10**-9*T**4\";\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\n",
+ "\n",
+ "\t\t\t#def f61(T): \n",
+ "\t\t\t#\t return K_T/K_298) = integrate(delta_H_rkn_T/T**(2)\n",
+ "\n",
+ "\t\t\t# R*math.log(K_T/K_298) = quad(f61,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# First let us calculate K_298.\n",
+ "\t\t\t# delta_G_rkn_T = - R*T*math.log(K)\n",
+ "K_298 = math.exp(-delta_G_rkn_298/(R*T_1));\n",
+ "\n",
+ "\t\t\t# On substituting the values and simplifying we get the math.expression\n",
+ "\t\t\t# math.log(K) = 3.87 + 11380.10/T - 2.6580*math.log(T) + 0.4825*10**(-2)*T - 0.1409*10**(-5)*T**(2) + 0.2320*10**(-9)*T**(3)\n",
+ "\n",
+ "print \" 2.The math.expression for math.logK as a function of T is given by\";\n",
+ "print \" math.logK = 3.87 + 11380.10/T - 2.6580*math.logT + 0.4825*10**-2*T - 0.1409*10**-5*T**2 + 0.2320*10**-9*T**3\";\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "P = 1;\t\t\t#[atm]\n",
+ "T = 880;\t\t\t#[K]\n",
+ "K = math.exp(3.87 + 11380.10/T - 2.6580*math.log(T) + 0.4825*10**(-2)*T - 0.1409*10**(-5)*T**(2) + 0.2320*10**(-9)*T**(3));\n",
+ "Kp = P**(-1./2);\t\t\t#[atm**(-1/2)]\n",
+ "Ky = K/Kp;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_SO2_eq = 1 - X\n",
+ "\t\t\t# n_O2_eq = 0.5- 0.5*X\n",
+ "\t\t\t# n_SO3_1_eq = X\n",
+ "\t\t\t# Total moles = 1.5-0.5*X\n",
+ "\n",
+ "\t\t\t# Ky = (X*(1.5-0.5*X)**(1/2))/((1-X)*(0.5-0.5*X)**(1/2))\n",
+ "def f(X): \n",
+ "\t return Ky - (X*(1.5-0.5*X)**(1./2))/((1-X)*(0.5-0.5*X)**(1./2))\n",
+ "X = fsolve(f,0.8)\n",
+ "\n",
+ "\t\t\t# The mole fraction of SO3 at equilibrium is given by\n",
+ "y_SO3 = X/(1.5-0.5*X);\n",
+ "\n",
+ "print \" 3).The mole fraction of SO3 at equilibrium is given by y_SO3 = %f\"%(y_SO3);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1.The math.expression for delta_H_rkn_T as a function of T is given by\n",
+ " delta_H_rkn_T = -22630.14 - 5.2815*T + 0.9587*10**-2*T**2 - 0.5598*10**-5*T**3 + 1.3826*10**-9*T**4\n",
+ " 2.The math.expression for math.logK as a function of T is given by\n",
+ " math.logK = 3.87 + 11380.10/T - 2.6580*math.logT + 0.4825*10**-2*T - 0.1409*10**-5*T**2 + 0.2320*10**-9*T**3\n",
+ " 3).The mole fraction of SO3 at equilibrium is given by y_SO3 = 0.649167\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.10 Page Number : 609"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Tabulation of equilibrium constant values\n",
+ "\n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t# (1/2)*N2 + (1/2)*O2 - NO\n",
+ "\n",
+ "R = 1.987;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "delta_H_NO_298 = 21.600;\t\t\t#[kcal/mol] - Enthalpy of formation of S02 at 298.15 K\n",
+ "delta_G_NO_298 = 20.719;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of SO2 at 298.15 K\n",
+ "\n",
+ "\t\t\t# Cp_0 = a + b*T + c*T**(2) + d*T**(3)\n",
+ "\n",
+ "a_N2 = 6.157;\n",
+ "a_O2 = 6.085;\n",
+ "a_NO = 6.461;\n",
+ "b_N2 = -0.03753*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "b_NO = 0.2358*10**(-2);\n",
+ "c_N2 = 0.1930*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "c_NO = -0.07705*10**(-5);\n",
+ "d_N2 = -0.6861*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "d_NO = 0.08729*10**(-9);\n",
+ "\n",
+ "\t\t\t#(1)\n",
+ "T_1 = 298.15;\t\t\t#[K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "delta_H_rkn_298 = delta_H_NO_298;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "delta_G_rkn_298 = delta_G_NO_298;\t\t\t#[kcal]\n",
+ "delta_G_rkn_298 = delta_G_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "delta_a = a_NO - (a_N2/2) - (a_O2/2);\n",
+ "delta_b = b_NO - (b_N2/2) - (b_O2/2);\n",
+ "delta_c = c_NO - (c_N2/2) - (c_O2/2);\n",
+ "delta_d = d_NO - (d_N2/2) - (d_O2/2);\n",
+ "\n",
+ "\n",
+ "def f49(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_T = delta_H_rkn_298 + quad(f49,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# On simplification we get\n",
+ "\t\t\t# delta_H_rkn_T = 21584.63 - 0.033*T + 0.0365*10**(-2)*T**(2) - 0.0293*10**(-5)*T**(3) + 0.0685*10**(-9)*T**(4)\n",
+ "\n",
+ "print \" The math.expression for delta_H_rkn_T as a function of T is given by\";\n",
+ "print \" delta_H_rkn_T = 21584.63 - 0.033*T + 0.0365*10**-2*T**2 - 0.0293*10**-5*T**3 + 0.0685*10**-9*T**4\";\n",
+ "\n",
+ "\t\t\t# Now let us calculate K_298 (at 298 K)\n",
+ "\t\t\t# We know delta_G_rkn_298 = -R*T*math.log(K_298) \n",
+ "K_298 = math.exp(-delta_G_rkn_298/(R*T_1));\t\t\t# Equilibrium constant at 298.15 K\n",
+ "\n",
+ "\n",
+ "\t\t\t#def f50(T): \n",
+ "\t\t\t#\t return K_2/K_1) = integrate(delta_H_rkn_298/(R*T**(2))\n",
+ "\n",
+ "\t\t\t# math.log(K_2/K_1) = quad(f50,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# On substituting the values and simplifying we get the math.expression\n",
+ "\t\t\t# math.log(K) = 1.5103 - 10862.92/T - 0.0166*math.log(T) + 1.84*10**(-4)*T - 7.35*10**(-8)*T**(2) + 1.15*10**(-11)*T**(3)\n",
+ "\n",
+ "print \" The math.expression for math.logK as a function of T is given by\";\n",
+ "print \" math.logK = 1.5103 - 10862.92/T - 0.0166*math.logT + 1.84*10**-4*T - 7.35*10**-8*T**2 + 1.15*10**-11*T**3\"\n",
+ "\n",
+ "T = [500,1000,1500,2000,2500];\n",
+ "K = zeros(5);\n",
+ "\n",
+ "print \" T K \\t\\t\\t K \";\n",
+ "\n",
+ "for i in range(5):\n",
+ " K[i] = math.exp(1.5103-10862.92/T[i] - 0.0166*math.log(T[i]) + 1.84*10**(-4)*T[i] - 7.35*10**(-8)*T[i]**(2) + 1.15*10**(-11)*T[i]**(3));\n",
+ " \n",
+ " print \" %f \\t\\t %e \"%(T[i],K[i]);\n",
+ "\n",
+ "\n",
+ "\t\t\t# It can be seen that for endothermic reactions equilibrium constant increases with temperature.\n",
+ "print \" It can be seen that for endothermic reactions equilibrium constant increases with temperature\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The math.expression for delta_H_rkn_T as a function of T is given by\n",
+ " delta_H_rkn_T = 21584.63 - 0.033*T + 0.0365*10**-2*T**2 - 0.0293*10**-5*T**3 + 0.0685*10**-9*T**4\n",
+ " The math.expression for math.logK as a function of T is given by\n",
+ " math.logK = 1.5103 - 10862.92/T - 0.0166*math.logT + 1.84*10**-4*T - 7.35*10**-8*T**2 + 1.15*10**-11*T**3\n",
+ " T K \t\t\t K \n",
+ " 500.000000 \t\t 1.615470e-09 \n",
+ " 1000.000000 \t\t 8.737610e-05 \n",
+ " 1500.000000 \t\t 3.333913e-03 \n",
+ " 2000.000000 \t\t 2.062328e-02 \n",
+ " 2500.000000 \t\t 6.176400e-02 \n",
+ " It can be seen that for endothermic reactions equilibrium constant increases with temperature\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.11 Page Number : 611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of mean standard enthalpy of reaction\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t# SO2 + (1/2)*O2 - SO3\n",
+ "R = 8.314;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "K_800 = 0.0319;\t\t\t# Equilibrium constant at 800 K\n",
+ "K_900 = 0.153;\t\t\t# Equilibrium constant at 900 K\n",
+ "T_1 = 800.;\t\t\t#[K]\n",
+ "T_2 = 900.;\t\t\t#[K]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# We have the relation \n",
+ "\t\t\t# math.log(K_2/K_1) = -(delta_H_rkn/R)*(1/T_2 - 1/T_1)\n",
+ "\t\t\t# math.log(K_900/K_800) = -(delta_H_rkn_850/R)*(1/T_2 - 1/T_1)\n",
+ "delta_H_rkn_850 = -R*math.log(K_900/K_800)/(1/T_2 - 1/T_1);\t\t\t#[J]\n",
+ "delta_H_rkn_850 = delta_H_rkn_850*10**(-3);\t\t\t#[kJ]\n",
+ "\n",
+ "# Results\n",
+ "print \" The mean standard enthalpy change of reaction in the region 800 t0 900 is given by delta_H_rkn_850 = %f KJ\"%(delta_H_rkn_850);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The mean standard enthalpy change of reaction in the region 800 t0 900 is given by delta_H_rkn_850 = 93.851672 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.13 Page Number : 611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of equilibrium composition\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K]\n",
+ "T = 2600;\t\t\t#[K]\n",
+ "R = 1.987;\t\t\t#[cal/mol-K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# Cp_0 = a + b*T + c*T**(2) + d*T**(3)\n",
+ "delta_H_CO_298 = -26.416;\t\t\t#[kcal/mol] - Enthalpy of formation of CO at 298.15 K\n",
+ "delta_G_CO_298 = -32.808;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of CO at 298.15 K\n",
+ "delta_H_CO2_298 = -94.052;\t\t\t#[kcal/mol] - Enthalpy of formation of C02 at 298.15 K\n",
+ "delta_G_CO2_298 = -94.260;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of CO2 at 298.15 K\n",
+ "\n",
+ "\t\t\t# CO + (1/2)*O2 - CO2\n",
+ "\n",
+ "a_CO = 6.726;\n",
+ "a_O2 = 6.0685;\n",
+ "a_CO2 = 5.316;\n",
+ "b_CO = 0.04001*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "b_CO2 = 1.4285*10**(-2);\n",
+ "c_CO = 0.1283*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "c_CO2 = -0.8362*10**(-5);\n",
+ "d_CO = -0.5307*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "d_CO2 = 1.784*10**(-9);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "delta_H_rkn_298 = delta_H_CO2_298 - delta_H_CO_298;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "delta_G_rkn_298 = delta_G_CO2_298 - delta_G_CO_298;\t\t\t#[kcal]\n",
+ "delta_G_rkn_298 = delta_G_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "delta_a = a_CO2 - (a_CO) - (a_O2/2);\n",
+ "delta_b = b_CO2 - (b_CO) - (b_O2/2);\n",
+ "delta_c = c_CO2 - (c_CO) - (c_O2/2);\n",
+ "delta_d = d_CO2 - (d_CO) - (d_O2/2);\n",
+ "\n",
+ "\n",
+ "def f47(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_T = delta_H_rkn_298 + quad(f47,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# On simplification we get\n",
+ "delta_H_rkn_T = -66773.56 - 4.45*T + 0.605*10**(-2)*T**(2) - 0.29*10**(-5)*T**(3) + 0.54*10**(-9)*T**(4);\n",
+ "\n",
+ "\n",
+ "\t\t\t#def f48(T): \n",
+ "\t\t\t#\t return K/K_298) = integrate(delta_H_rkn_T/(R*T**(2))\n",
+ "\n",
+ "\t\t\t# math.log(K/K_298) = quad(f48,T_1,T)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t# We know that delta_G_rkn_T = -R*T*math.log(K)\n",
+ "\t\t\t# At 298.15 K\n",
+ "K_298 = math.exp(-delta_G_rkn_298/(R*T_1) );\n",
+ "\n",
+ "\t\t\t# Therfore on simplification we get\n",
+ "\t\t\t#math.log(K) = 2.94 + 33605.2/T - 2.24*math.log(T) + 0.304*10(-2)*T - 0.073*10**(-5)*T**(2) + 0.09*10**(-9)*T**(3)\n",
+ "K = math.exp(2.94 + 33605.2/T - 2.24*math.log(T) + 0.304*10**(-2)*T - 0.073*10**(-5)*T**(2) + 0.09*10**(-9)*T**(3));\n",
+ "\n",
+ "print \" The value of equilibrium constant at 2600 K is given by K_298 = %f\"%(K);\n",
+ "\n",
+ "\n",
+ "\t\t\t#(a)\n",
+ "P_1 = 1;\t\t\t#[atm]\n",
+ "Kp_1 = P_1**(-1./2);\n",
+ "Ky_1 = K/Kp_1;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_CO_1_eq = 1 - X\n",
+ "\t\t\t# n_02_1_eq = 0.5- 0.5X\n",
+ "\t\t\t# n_CO2_1_eq = X\n",
+ "\t\t\t# Total moles = 1.5 - 0.5*X\n",
+ "\n",
+ "\t\t\t# Ky = y_CO2/(y_CO**(1/2)*y_CO)\n",
+ "\t\t\t#ky = (X*(1.5-0.5*X)**(1/2))/((1-X)*(0.5-0.5*X)**(1/2))\n",
+ "\n",
+ "def f(X): \n",
+ "\t return Ky_1-(X*(1.5-0.5*X)**(1./2))/((1-X)*(0.5-0.5*X)**(1./2))\n",
+ "X_1 = fsolve(f,0.9)\n",
+ "\n",
+ "y_CO2_1 = X_1/(1.5-0.5*X_1);\n",
+ "y_CO_1 = (1-X_1)/(1.5-0.5*X_1);\n",
+ "y_O2_1 = (0.5-0.5*X_1)/(1.5-0.5*X_1);\n",
+ "\n",
+ "print \" a).The equilibrium composition at 1 atm) is given by y_CO2 = %f y_CO = %f and y_O2 = %f\"%(y_CO2_1,y_CO_1,y_O2_1);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "P_2 = 10;\t\t\t#[atm]\n",
+ "Kp_2 = P_2**(-1./2);\n",
+ "Ky_2 = K/Kp_2;\n",
+ "\n",
+ "\t\t\t# Ky = y_CO2/(y_CO**(1/2)*y_CO)\n",
+ "\t\t\t#ky = (X*(1.5-0.5*X)**(1/2))/((1-X)*(0.5-0.5*X)**(1/2))\n",
+ "\n",
+ "def f1(X): \n",
+ "\t return Ky_2-(X*(1.5-0.5*X)**(1./2))/((1-X)*(0.5-0.5*X)**(1./2))\n",
+ "X_2 = fsolve(f1,0.9)\n",
+ "\n",
+ "y_CO2_2 = X_2/(1.5-0.5*X_2);\n",
+ "y_CO_2 = (1-X_2)/(1.5-0.5*X_2);\n",
+ "y_O2_2 = (0.5-0.5*X_2)/(1.5-0.5*X_2);\n",
+ "\n",
+ "print \" b).The equilibrium composition at 10 atm) is given by y_CO2 = %f y_CO = %f and y_O2 = %f\"%(y_CO2_2,y_CO_2,y_O2_2);\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "P_3 = 1;\t\t\t#[atm]\n",
+ "Kp_3 = P_3**(-1./2);\n",
+ "Ky_3 = K/Kp_3;\n",
+ "\n",
+ "\t\t\t# Ky = y_CO2/(y_CO**(1/2)*y_CO)\n",
+ "\t\t\t#ky = (X*(1.5-0.5*X)**(1/2))/((1-X)*(0.5-0.5*X)**(1/2))\n",
+ "\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_CO_3_eq = 1 - X\n",
+ "\t\t\t# n_02_3_eq = 0.5- 0.5X\n",
+ "\t\t\t# n_CO2_3_eq = X\n",
+ "\t\t\t# n_N2_eq = 1;\n",
+ "\t\t\t# Total moles = 2.5 - 0.5*X\n",
+ "\n",
+ "def f2(X): \n",
+ "\t return Ky_3-(X*(2.5-0.5*X)**(1./2))/((1-X)*(0.5-0.5*X)**(1./2))\n",
+ "X_3 = fsolve(f2,0.9)\n",
+ "\n",
+ "y_CO2_3 = X_3/(2.5-0.5*X_3);\n",
+ "y_CO_3 = (1-X_3)/(2.5-0.5*X_3);\n",
+ "y_O2_3 = (0.5-0.5*X_3)/(2.5-0.5*X_3);\n",
+ "y_N2 = 1./(2.5-0.5*X_3);\n",
+ "\n",
+ "print \" c).The equilibrium composition at 1 atm and 1 mol N2) is given by y_CO2 = %f y_CO = %f y_O2 = %f and y_N2 = %f\"%(y_CO2_3,y_CO_3,y_O2_3,y_N2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of equilibrium constant at 2600 K is given by K_298 = 16.484152\n",
+ " a).The equilibrium composition at 1 atm) is given by y_CO2 = 0.757531 y_CO = 0.161646 and y_O2 = 0.080823\n",
+ " b).The equilibrium composition at 10 atm) is given by y_CO2 = 0.876008 y_CO = 0.082662 and y_O2 = 0.041331\n",
+ " c).The equilibrium composition at 1 atm and 1 mol N2) is given by y_CO2 = 0.373822 y_CO = 0.100943 y_O2 = 0.050471 and y_N2 = 0.474764\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.14 Page Number : 614"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of equilibrium composition\n",
+ "\n",
+ "# Variables\n",
+ "T = 25 + 298.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol-K]\n",
+ "delta_G_298 = -1000;\t\t\t#[J] - Gibbs free energy change at 298 K\n",
+ "\n",
+ "\t\t\t# G_E/(R*T) = x_1*x_2\n",
+ "# Calculations and Results\n",
+ "\t\t\t# We know that delta_G_rkn = - R*T*math.log(K), therefore\n",
+ "K = math.exp(-delta_G_298/(R*T));\n",
+ "\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# Let x_1 is the mole fraction of A and x_2 be the mole fraction of B\n",
+ "\t\t\t# If A and B form an ideal mixture then,\n",
+ "Ky = 1;\n",
+ "\t\t\t# and K = Kx = x_2/x_1\n",
+ "\t\t\t# and at equilibrium x_2/x_1 = K\n",
+ "\t\t\t# (1-x_1)/x_1 = K\n",
+ "x_1 = 1/(1+K);\n",
+ "\n",
+ "print \" 1).The equilibrium composition for ideal behaviour) is given by x_1 = %f\"%(x_1);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# The activity coefficients are given by\n",
+ "\t\t\t# math.log(Y1) = [del(n*G_E/(R*T))/del(n_1)]_T,P,n_2 = x_2**(2)\n",
+ "\t\t\t# similarly, math.log(Y2) = x_1**(2)\n",
+ "\n",
+ "\t\t\t# The equilibrium constant for the liquid phase reaction is given by\n",
+ "\t\t\t# K = Kx*Ky = (x_2*Y2)/(x_1*Y1) = (x_2*math.exp(x_1**(2)))/(x_1*math.exp(x_2**(2)))\n",
+ "\t\t\t# Solving the above equation we get\n",
+ "\n",
+ "def f2(x_1): \n",
+ "\t return K -((1-x_1)*math.exp(x_1**(2)))/(x_1*math.exp((1-x_1)**(2)))\n",
+ "x_1_prime = fsolve(f2,0.9)\n",
+ "\n",
+ "print \" 2).The equilibrium composition for non-ideal behaviour) is given by x_1 = %f\"%(x_1_prime);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The equilibrium composition for ideal behaviour) is given by x_1 = 0.408008\n",
+ " 2).The equilibrium composition for non-ideal behaviour) is given by x_1 = 0.328409\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.15 Page Number : 615"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the\n",
+ "\n",
+ "# Variables\t\t\t\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "T_2 = 373.;\t\t\t#[K] - Reaction temperature\n",
+ "P = 1.;\t\t\t#[atm]\n",
+ "R = 1.987;\t\t\t#[cal/mol-K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# CH3COOH (l) + C2H5OH (l) - CH3COOC2H5 (l) + H2O (l)\n",
+ "\n",
+ "delta_H_CH3COOH_298 = -116.2*10**(3.);\t\t\t# [cal/mol]\n",
+ "delta_H_C2H5OH_298 = -66.35*10**(3.);\t\t\t# [cal/mol]\n",
+ "delta_H_CH3COOC2H5_298 = -110.72*10**(3.);\t\t\t# [cal/mol]\n",
+ "delta_H_H2O_298 = -68.3174*10**(3.);\t\t\t# [cal/mol]\n",
+ "\n",
+ "delta_G_CH3COOH_298 = -93.56*10**(3.);\t\t\t# [cal/mol]\n",
+ "delta_G_C2H5OH_298 = -41.76*10**(3.);\t\t\t# [cal/mol]\n",
+ "delta_G_CH3COOC2H5_298 = -76.11*10**(3.);\t\t\t# [cal/mol]\n",
+ "delta_G_H2O_298 = -56.6899*10**(3.);\t\t\t# [cal/mol]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "delta_H_rkn_298 = delta_H_CH3COOC2H5_298 + delta_H_H2O_298 - delta_H_CH3COOH_298 - delta_H_C2H5OH_298;\t\t\t#[cal/mol]\n",
+ "delta_G_rkn_298 = delta_G_CH3COOC2H5_298 + delta_G_H2O_298 - delta_G_CH3COOH_298 - delta_G_C2H5OH_298;\t\t\t#[cal/mol]\n",
+ "\n",
+ "\t\t\t# We know that delta_G_rkn_T = -R*T*math.log(K)\n",
+ "\t\t\t# At 298.15 K\n",
+ "K_298 = math.exp(-delta_G_rkn_298/(R*T_1) );\n",
+ "\n",
+ "\t\t\t# We know that dmath.log(K)/dT = delta_H_rkn/(R*T**(2))\n",
+ "\t\t\t# If delta_H_rkn is assumed constant we get\n",
+ "\t\t\t# math.log(K_2/K_1) = (-delta_H_rkn/R)*(1/T_2 - 1/T_1)\n",
+ "\t\t\t# math.log(K_373/K_298) = (-delta_H_rkn_298/R)*(1/T_2 - 1/T_1)\n",
+ "\n",
+ "K_373 = math.exp(math.log(K_298) + (-delta_H_rkn_298/R)*(1./T_2 - 1./T_1));\n",
+ "\t\t\t# Note that the equilibrium constant value rises becauses the reaction is endothermic\n",
+ "\n",
+ "print \" The value of equilibrium constant at 373 K is K_373 = %f\"%(K_373);\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_CH3COOH = 1 - X\n",
+ "\t\t\t# n_C2H5OH = 1 - X\n",
+ "\t\t\t# n_CH3COOC2H5 = X\n",
+ "\t\t\t# n_H20 = X\n",
+ "\t\t\t# Total moles = 2\n",
+ "\n",
+ "\t\t\t# Kx = (x_CH3COOH*x_C2H5OH)/(x_CH3COOC2H5*x_H2O)\n",
+ "\t\t\t# Assuming the liquid mixture to be ideal,that is Ky = 1, therefore K_x = K\n",
+ "K_x = K_373;\n",
+ "\t\t\t# X**(2)/(1-X)**(2) = K_x\n",
+ "X = (K_x)**(1./2)/(1+(K_x)**(1./2));\n",
+ "\n",
+ "\t\t\t# The mole fraction of ethyl acetate is given by\n",
+ "x_CH3COOC2H5 = X/2;\n",
+ "\n",
+ "print \" The mole fraction of ethyl acetate in the equilibrium reaction mixture is given by x_CH3COOC2H5 = %f\"%(x_CH3COOC2H5);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of equilibrium constant at 373 K is K_373 = 0.046697\n",
+ " The mole fraction of ethyl acetate in the equilibrium reaction mixture is given by x_CH3COOC2H5 = 0.088848\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.16 Page Number : 617"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of Gibbs free energy\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t# CaCO3 (s1) - CaO (s2) + CO2 (g)\n",
+ "T_1 = 898 + 273.15;\t\t\t#[K]\n",
+ "T_2 = 700 + 273.15;\t\t\t#[K]\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "\n",
+ "P_CO2_T_1 = 1;\t\t\t#[atm] - Decomposition pressure of CO2 over CaCO3 at 898 C\n",
+ "P_CO2_T_2 = 0.0333;\t\t\t#[atm] - Decomposition pressure of CO2 over CaCO3 at 700 C\n",
+ "\n",
+ "\t\t\t# The equilibrium constant of the reaction is given by\n",
+ "\t\t\t# K = (a_CO2*a_CaO)/a_CaCO3\n",
+ "\n",
+ "\t\t\t# Since the pressure is small therefore carbon dioxide can be assumed to behave as ideal gas and thus\n",
+ "\t\t\t# a_CO2 = y_CO2*P/1 = P_CO2\n",
+ "\n",
+ "\t\t\t# The activity of CaO is (CaO is pure)\n",
+ "\t\t\t# a_CaO = f_CaO/f_0_CaO = exp[V_CaO*(P - P_0)/(R*T)] = 1 (since pressure is low)\n",
+ "\n",
+ "\t\t\t# The activity of CaCO3 is (CaCO3 is pure)\n",
+ "\t\t\t# a_CaCO3 = f_CaCO3/f_0_CaCO3 = exp[V_CaCO3*(P - P_0)/(R*T)] = 1 (since pressure is low)\n",
+ "\n",
+ "\t\t\t#Since pressures are around 1 atm,therefore Poynting factors are also near 1, and thus activity of CaO and CaCO3 is unity and equilibrium constant is given by\n",
+ "\t\t\t#K = P_CO2 , therefore\n",
+ "# Calculations \n",
+ "\t\t\t# At 898 C\n",
+ "K_T_1 = P_CO2_T_1;\n",
+ "delta_G_T_1 = -R*T_1*math.log(K_T_1);\n",
+ "\n",
+ "\t\t\t# At 700 C\n",
+ "K_T_2 = P_CO2_T_2;\n",
+ "delta_G_T_2 = -R*T_2*math.log(K_T_2);\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of delta_G_rkn at 700 C is %f J\"%(delta_G_T_1);\n",
+ "print \" The value of delta_G_rkn at 898 C is %f J\"%(delta_G_T_2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of delta_G_rkn at 700 C is -0.000000 J\n",
+ " The value of delta_G_rkn at 898 C is 27526.397496 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.17 Page Number : 618"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of nu\n",
+ "\n",
+ "# Variables\n",
+ "T = 700 + 273.15;\t\t\t#[K]\n",
+ "K = 7.403;\t\t\t# Equilibrium constant for the reaction at 700 C\n",
+ "\n",
+ "\t\t\t# CH4 - C (s) + 2*H2 \n",
+ "\n",
+ "\t\t\t# The equilibrium constant of the reaction is given by\n",
+ "\t\t\t# K = (a_C*a_H2**(2))/a_CH4\n",
+ "\n",
+ "\t\t\t# Since carbon is pure therefore its activity is given by\n",
+ "\t\t\t# a_C = f/f_0 = 1 as pressure is 1 atm.\n",
+ "\t\t\t# Since the pressure is low,therefore the gas phase can be taken to be ideal,therefore\n",
+ "\t\t\t# K = (y_H2**(2)*P**(2))/(y_CH4*P) = y_H2**(2)/y_CH4 (as P = 1 atm)\n",
+ "Ky = K;\t\t\t# (Kp = 1 atm)\n",
+ "\n",
+ "\t\t\t# Initial moles of the species are\n",
+ "n_CH4 = 1;\n",
+ "n_H2 = 0;\n",
+ "n_C = 0;\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the reaction be X\n",
+ "\t\t\t# Moles at equilibrium be\n",
+ "\t\t\t# n_CH4_eq = 1 -X\n",
+ "\t\t\t# n_H2_eq = 2*x\n",
+ "\t\t\t# n_C_eq = X\n",
+ "\n",
+ "\t\t\t# Moles present in gas phase\n",
+ "\t\t\t# n_CH4_gas = 1 -X\n",
+ "\t\t\t# n_H2_gas = 2*x\n",
+ "\t\t\t# Total moles = 1 + X\n",
+ "\n",
+ "\t\t\t# gas phase mole fraction \n",
+ "\t\t\t# y_CH4_gas = (1 -X)/(1+X)\n",
+ "\t\t\t# y_H2_gas = 2*x/(1+X)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# Ky = y_H2_gas**(2)/y_CH4_gaS\n",
+ "X = (K/(4+K))**(1./2);\n",
+ "\n",
+ "print \" The number of moles of carbon black formed from one mole of methane is %f mol\"%(X);\n",
+ "\n",
+ "\t\t\t# Therefore mole fraction of components in the gas phase at equilibrium is \n",
+ "y_CH4 = (1-X)/(1+X);\n",
+ "y_H2 = 2*X/(1+X);\n",
+ "\n",
+ "print \" The mole fraction of components in the gas phase at equilibrium is given by y_CH4 = %f and y_H2 = %f \"%(y_CH4,y_H2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number of moles of carbon black formed from one mole of methane is 0.805739 mol\n",
+ " The mole fraction of components in the gas phase at equilibrium is given by y_CH4 = 0.107580 and y_H2 = 0.892420 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.18 Page Number : 619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of value of the equilibrium constant\n",
+ "\n",
+ "# Variables \n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "T_2 = 1042;\t\t\t#[K] - Reaction temperature\n",
+ "R = 1.987;\t\t\t#[cal/mol-K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# CaCO3 (s1) - CaO (s2) + CO2 (g)\n",
+ "\n",
+ "delta_H_CaCO3_298 = -289.5;\t\t\t#[kcal/mol] - Enthalpy of formation of CaCO3 at 298.15 K\n",
+ "delta_H_CaO_298 = -151.7;\t\t\t#[kcal/mol] - Enthalpy of formation of CaO at 298.15 K\n",
+ "delta_H_CO2_298 = -94.052;\t\t\t#[kcal/mol] - Enthalpy of formation of CO2 at 298.15 K\n",
+ "delta_G_CaCO3_298 = -270.8;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of CaCO3 at 298.15 K\n",
+ "delta_G_CaO_298 = -144.3;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of CaO at 298.15 K\n",
+ "delta_G_CO2_298 = -94.260;\t\t\t#[kcal/mol] - Gibbs free energy change for formation of CO2 at 298.15 K\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard heat capacity data as a function of temperature are given below\n",
+ "\t\t\t# Cp_CO2 = 5.316 + 1.4285*10**(2)*T - 0.8362*10**(-5)*T**(2) + 1.784*10**(-9)*T**(3)\n",
+ "\t\t\t# Cp_CaO = 12.129 + 0.88*10**(-3)*T - 2.08*10**(5)*T**(-2)\n",
+ "\t\t\t# Cp_CaCO3 = 24.98 + 5.240*10**(-3)*T - 6.199*10**(5)*T**(-2)\n",
+ "\t\t\t# Therefore Cp_0 is given by\n",
+ "\t\t\t# Cp_0 = Cp_CO2 + Cp_CaO - Cp_CaCO3\n",
+ "\t\t\t# Cp_0 = -7.535 + 9.925*10**(-3)*T - 0.8362*10**(-5)*T**(2) + 1.784*10**(-9)*T**(3) + 4.119*10**(5)*T**(-2)\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy change of the reaction at 298.15 K is given by\n",
+ "delta_H_rkn_298 = delta_H_CO2_298 + delta_H_CaO_298 - delta_H_CaCO3_298;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "delta_G_rkn_298 = delta_G_CO2_298 + delta_G_CaO_298 - delta_G_CaCO3_298;\t\t\t#[kcal]\n",
+ "delta_G_rkn_298 = delta_G_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy change of the reaction at temperature T is given by\n",
+ "\n",
+ "def f7(T): \n",
+ "\t return -7.535 + 9.925*10**(-3)*T - 0.8362*10**(-5)*T**(2) + 1.784*10**(-9)*T**(3) + 4.119*10**(5)*T**(-2)\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_T = delta_H_rkn_298 + quad(f7,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# On simplification we get\n",
+ "\t\t\t# delta_H_rkn_T = 47005.3 - 7.535*T + 4.9625*10**(-3)*T**(2) - 0.2787*10**(-5)*T**(3) + 0.446*10**(-9)*T**(4) - 4.119*10**(5)*T**(-1)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\t\t\t#def f8(T): \n",
+ "\t\t\t#\t return K_2/K_1) = integrate(delta_H_rkn_T/(R*T**(2))\n",
+ "\n",
+ "\t\t\t# math.log(K_2/K_1) = quad(f8,T_1,T)[0]\n",
+ "\n",
+ "\n",
+ "def f9(T): \n",
+ "\t return (47005.3-7.535*T+4.9625*10**(-3)*T**(2)-0.2787*10**(-5)*T**(3)+0.446*10**(-9)*T**(4) - 4.119*10**(5)*T**(-1))/T**(2)\n",
+ "\n",
+ "math.log_K2_K1 = quad(f9,T_1,T_2)[0];\t\t\t# math.log(K_2/K_1)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t# We know that delta_G_rkn_T = -R*T*math.log(K)\n",
+ "\t\t\t# At 298.15 K\n",
+ "K_298 = math.exp(-delta_G_rkn_298/(R*T_1) );\n",
+ "\n",
+ "\t\t\t# Putting the values in the above math.expression we get\n",
+ "\t\t\t# math.log(K_1042/K_298) = math.log_K2_K1/R\n",
+ "K_1042 = K_298*math.exp(math.log_K2_K1/R);\n",
+ "\n",
+ "print \" The value of equilibrium constant at 1042 K is K_1042 = %f\"%(K_1042);\n",
+ "\n",
+ "\t\t\t# Since for the given reaction K = P_CO2,where P is in atm, therefore,\n",
+ "P_CO2 = K_1042;\n",
+ "\t\t\t# and thus decomposition takes place till the partial pressure of CO2 reaches 0.095 atm\n",
+ "\t\t\t# After that the decomposition in the closed vessel stops as equilibrium is achieved.\n",
+ "\n",
+ "print \" The equilibrium pressure of CO2 is P_CO2 = %f atm \"%(P_CO2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of equilibrium constant at 1042 K is K_1042 = 0.095017\n",
+ " The equilibrium pressure of CO2 is P_CO2 = 0.095017 atm \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.19 Page Number : 620"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the value of equilibrium constant\n",
+ "\n",
+ "# Variables \n",
+ "T_1 = 298.15;\t\t\t#[k] - Smath.tan(math.radiansard reaction temperature\n",
+ "T_2 = 1200;\t\t\t#[K] - Reaction temperature\n",
+ "R = 1.987;\t\t\t#[cal/mol-K] - Universal gas consatnt\n",
+ "\n",
+ "\t\t\t# C (s) + CO2 (g) - 2*CO2 (g) \t\t\t# Reaction 1\n",
+ "\t\t\t# CO2 + H2 - CO + H2O \t\t\t# Reacction 2\n",
+ "\n",
+ "K_1 = 63;\t\t\t# Equilibrium constant for the first reaction\n",
+ "K_2 = 1.4;\t\t\t# Equilibrium constant for the secind reaction\n",
+ "\n",
+ "delta_G_H2O_298 = -54640;\t\t\t#[cal/mol] - Smath.tan(math.radiansard Gibbs free energy of formation of water vapour\n",
+ "delta_H_H2O_298 = -57800;\t\t\t#[cal/mol] - Smath.tan(math.radiansard enthalpy change of formation of water vapour\n",
+ "delta_G_rkn_298 = delta_G_H2O_298;\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard heat capacity data of the components in cal/mol-K are given below\n",
+ "\t\t\t# Cp_H2 = 6.947 - 0.2*10**(-3)*T + 4.8*10**(-7)*T**(2)\n",
+ "\t\t\t# Cp_O2 = 6.148 + 3.1*10**(-3)*T - 9.2*10**(-7)*T**(2)\n",
+ "\t\t\t# Cp_H2O = 7.256 + 2.3*10**(-3)*T + 2.8*10**(-7)*T**(2)\n",
+ "\n",
+ "\t\t\t# Let us consider two more reactions\n",
+ "\t\t\t# C (s) + (1/2)*O2 - CO \t\t\t# Reaction 3\n",
+ "\t\t\t# H2 + (1/2)*O2 - H2O \t\t\t# Reaction 4\n",
+ "\n",
+ "\t\t\t# Considering the above 4 reactions, it can be shown that reaction (3) = reaction (1) + reaction (4) - reaction (2)\n",
+ "\t\t\t# Thus, delta_G_rkn_3 = delta_G_rkn_1 + delta_G_rkn_4 - delta_G_rkn_2\n",
+ "\t\t\t# or, -R*T*math.log(K_3) = -R*T*math.log(K_1) + -R*T*math.log(K_4) - -R*T*math.log(K_2)\n",
+ "\t\t\t# K_3 = (K_1*K_4/K_2)\n",
+ "\n",
+ "\t\t\t# Now we have to determine K_4 at 1200 K.\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy change of reaction (4) as a fuction of temperature is given by\n",
+ "\t\t\t# delta_H_rkn_T = -57020 - 2.765*T + 0.475*10**(-3)*T**(2) + 8.67*10**(-8)*T**(3);\n",
+ "\n",
+ "\n",
+ "\t\t\t#def f2(T): \n",
+ "\t\t\t#\t return K_4_2/K_4_1) = integrate(delta_H_rkn_T/(R*T**(2))\n",
+ "\n",
+ "\t\t\t# math.log(K_4_2/K_4_1) = quad(f2,T_1,T)[0]\n",
+ "\n",
+ "# Calculations\n",
+ "def f3(T): \n",
+ "\t return (-57020-2.765*T+0.475*10**(-3)*T**(2)+8.67*10**(-8)*T**(3))/T**(2)\n",
+ "\n",
+ "math.log_K2_K1_4 = quad(f3,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t# We know that delta_G_rkn_T = -R*T*math.log(K)\n",
+ "\t\t\t# At 298.15 K\n",
+ "K_4_298 = math.exp(-delta_G_rkn_298/(R*T_1) );\n",
+ "\n",
+ "\t\t\t# Putting the values in the above math.expression we get\n",
+ "\t\t\t# math.log(K_4_1200/K_4_298) = math.log_K2_K1_R/R\n",
+ "K_4_1200 = K_4_298*math.exp(math.log_K2_K1_4/R);\n",
+ "K_4 = K_4_1200;\n",
+ "\n",
+ "\t\t\t# Therefore the equilibrium constant for reaction (3) at 1200 K is given by\n",
+ "K_3 = (K_1*K_4)/K_2;\n",
+ "\n",
+ "# Results\n",
+ "print \" The equilibrium constant at 1200 K for the given reaction is K = %e\"%(K_3);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium constant at 1200 K for the given reaction is K = 3.622432e+09\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.20 Page Number : 622"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of standard equilibrium cell voltage\n",
+ "\n",
+ "# Variables\n",
+ "delta_G_H2O_298 = -237.034;\t\t\t#[kJ/mol] - Smath.tan(math.radiansard Gibbs free energy of formation of H2O (l) at 298 K\n",
+ "F = 96485;\t\t\t#[C/mol] - Faraday constant\n",
+ "\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# For the reaction\n",
+ "\t\t\t# H2 (g) + (1/2)*O2 (g) - H2O (l)\n",
+ "n = 2;\t\t\t# Number of electrons transferred in the reaction\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The smath.tan(math.radiansard Gibbs free energy change of the reaction is given by\n",
+ "\t\t\t# delta_G_rkn = delta_G_for_H2O(l) - delta_G_for_H2(g) - (1/2/)*delta_G_for_O2(g)\n",
+ "\t\t\t# Since delta_G_for_H2 = 0 and delta_G_for_O2 = 0 (pure components)\n",
+ "delta_G_rkn = delta_G_H2O_298;\t\t\t#[kJ]\n",
+ "delta_G_rkn = delta_G_rkn*10**(3);\t\t\t#[J]\n",
+ "\n",
+ "\t\t\t# delta_G_rkn = -n*F*E_0\n",
+ "\t\t\t# Thus smath.tan(math.radiansard equilibrium cell voltage is given by\n",
+ "E_0 = - delta_G_rkn/(n*F);\t\t\t#/[V]\n",
+ "\n",
+ "print \" 1).The standard equilibrium cell voltage is %f V\"%(E_0);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# For the reaction\n",
+ "\t\t\t# 2*H2 (g) + O2 (g) - 2*H2O (l)\n",
+ "n_prime = 4;\t\t\t# Number of electrons transferred in the reaction\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard Gibbs free energy change of the reaction is given by\n",
+ "\t\t\t# delta_G_rkn = 2*delta_G_for_H2O(l) - 2*delta_G_for_H2(g) - delta_G_for_O2(g)\n",
+ "\t\t\t# Since delta_G_for_H2 = 0 and delta_G_for_O2 = 0 (pure components)\n",
+ "delta_G_rkn_prime = 2*delta_G_H2O_298;\t\t\t#[kJ]\n",
+ "delta_G_rkn_prime = delta_G_rkn_prime*10**(3);\t\t\t#[J]\n",
+ "\n",
+ "\t\t\t# delta_G_rkn = -n*F*E_0\n",
+ "\t\t\t# Thus smath.tan(math.radiansard equilibrium cell voltage is given by\n",
+ "E_0_prime = - delta_G_rkn_prime/(n_prime*F);\t\t\t#/[V]\n",
+ "\n",
+ "print \" 2).The standard equilibrium cell voltage is %f V\"%(E_0_prime);\n",
+ "\n",
+ "\t\t\t# Thus the result obtained is same for both the reactions\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The standard equilibrium cell voltage is 1.228346 V\n",
+ " 2).The standard equilibrium cell voltage is 1.228346 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.21 Page Number : 624"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of number of chemical reactions\n",
+ "\n",
+ "# Variables\t\t\t\n",
+ "P = 2;\t\t\t# Number of phases\n",
+ "C = 5;\t\t\t# Number of components\n",
+ "\n",
+ "# Calculations\t\n",
+ " \t\t# First we write chemical equations for formation of each component from basic elements\n",
+ "\t\t\t# C + 2*H2 = CH4 \t\t\t# (reaction 1) \n",
+ "\t\t\t# H2 + (1/2)*O2 = H20 \t\t\t# (reaction 2)\n",
+ "\t\t\t# C + (1/2)*O2 = CO \t\t\t# (reaction 3)\n",
+ "\t\t\t# C + O2 = CO2 \t\t\t# (reaction 4)\n",
+ "\n",
+ "\t\t\t# We do not have C in the equilibrium reaction mixture, therefore we have to eliminate it.\n",
+ "\t\t\t# Substituting for C from reaction (1) into reactions (3) and (4) we get the following set of reactions\n",
+ "\t\t\t# H2 + (1/2)*O2 = H20\n",
+ "\t\t\t# CH4 - 2*H2 + (1/2)*O2 = CO\n",
+ "\t\t\t# CH4 - 2*H2 + O2 = CO2\n",
+ "\n",
+ "\t\t\t# or,\n",
+ "\t\t\t# H2 + (1/2)*O2 = H2O\n",
+ "\t\t\t# CH4 + (1/2)*O2 = CO + 2*H2\n",
+ "\t\t\t# CH4 + O2 = CO2 + 2*H2\n",
+ "\n",
+ "\t\t\t# We do not have O2 in the equilibrium reaction mixture,therefore we have to eliminateit\n",
+ "\t\t\t# Substituting for O2 from the first reaction of the above set into seecond and third reactions of the above set we get the following set of reactions.\n",
+ "\t\t\t# CH4 + H2O - H2 = CO + 2*H2\n",
+ "\t\t\t# CH4 + 2*H20 - 2*H2 = CO2 + 2*H2 \n",
+ "\n",
+ "\t\t\t# Therefore one set of independent reactions is\n",
+ "\t\t\t# CH4 + H20 = CO + 3*H2\n",
+ "\t\t\t# CH4 + 2*H2O = CO2 + 4*H2\n",
+ "\n",
+ "\t\t\t# Another set of independent reactions can be obtained by substituting for CH4 from the first reaction into second and we get\n",
+ "\t\t\t# CH4 + H2O = CO + 3*H2\n",
+ "\t\t\t# CO + 3*H2 - H2O + 2*H2O = CO2 4*H2\n",
+ "\n",
+ "\t\t\t# Or, \n",
+ "\t\t\t# CH4 + H2O = CO + 3*H2\n",
+ "\t\t\t# CO + H2O = CO2 + H2\n",
+ "\t\t\t# This is another set of independent reactions. Thus whatever be the set of independent reactions, the number of independent reactions are two\n",
+ "\t\t\t# If different set of reactions are considered, then we get different equilibrium constants,different reaction coordinates but the final composition will be same\n",
+ "\t\t\t# Thus only 2 independent reactions occur,therefore \n",
+ "r = 2;\n",
+ "\n",
+ "\t\t\t# and the number of degree of freedom becomes,\n",
+ "F = r - P + C;\n",
+ "\n",
+ "# Results\n",
+ "print \" The number of independent chemical reactions are %f \"%(r);\n",
+ "\n",
+ "print \" The first set of independent reactions are given below\";\n",
+ "print \" CH4 + H20 = CO + 3*H2\";\n",
+ "print \" CH4 + 2*H2O = CO2 + 4*H2\";\n",
+ "\n",
+ "print \" The second set of independent reactions are given below\";\n",
+ "print \" CH4 + H20 = CO + 3*H2\";\n",
+ "print \" CO + H2O = CO2 + H2\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number of independent chemical reactions are 2.000000 \n",
+ " The first set of independent reactions are given below\n",
+ " CH4 + H20 = CO + 3*H2\n",
+ " CH4 + 2*H2O = CO2 + 4*H2\n",
+ " The second set of independent reactions are given below\n",
+ " CH4 + H20 = CO + 3*H2\n",
+ " CO + H2O = CO2 + H2\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.22 Page Number : 626"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of number of chemical reactions\n",
+ "\n",
+ "# Variables\t\t\t\n",
+ "T = 400.;\t\t\t#[K] - Temperature\n",
+ "P = 1.;\t\t\t#[atm] - Pressure\n",
+ "R = 1.987;\t\t\t#[cal/mol-K] - Universal gas consatnt\n",
+ "\n",
+ "delta_G_n_pentane_400 = 9600.;\t\t\t#[cal/mol] - Smath.tan(math.radiansard Gibbs free energy of formation of n-pentane at 400 K\n",
+ "delta_G_iso_pentane_400 = 8200.;\t\t\t#[cal/mol] - Smath.tan(math.radiansard Gibbs free energy of formation of iso-pentane at 400 K\n",
+ "delta_G_neo_pentane_400 = 9000.;\t\t\t#[cal/mol] - Smath.tan(math.radiansard Gibbs free energy of formation of neo-pentane at 400 K\n",
+ "\n",
+ "\t\t\t# The three reactions for the formation of these isomers can be written as follows\n",
+ "\t\t\t# 5*C + 6*H2 = n-pentane\n",
+ "\t\t\t# 5*C + 6*H2 = iso-pentane\n",
+ "\t\t\t# 5*C + 6*H2 = neo-pentane\n",
+ "\n",
+ "\t\t\t# We can eliminate elemental carbon and hydrogen as they are not present in equilibrium reaction mixture and get the following two sets of independent reactions\n",
+ "\t\t\t# n-pentane = iso-pentane \n",
+ "\t\t\t# n-pentane = neo-pentane \n",
+ "\n",
+ "\t\t\t# or,\n",
+ "\t\t\t# iso-pentane = n-pentane \n",
+ "\t\t\t# iso-pentane = neo-pentane \n",
+ "\n",
+ "\t\t\t# or,\n",
+ "\t\t\t# noe-pentane = iso-pentane \n",
+ "\t\t\t# neo-pentane = n-pentane \n",
+ "# Calculations and Results\n",
+ "\t\t\t# Let us take the following set of independent reactions\n",
+ "\t\t\t# iso-pentane = n-pentane \t\t\t# (reaction 1)\n",
+ "delta_G_rkn_1 = delta_G_n_pentane_400 - delta_G_iso_pentane_400;\t\t\t#[cal]\n",
+ "K_1 = math.exp(-delta_G_rkn_1/(R*T));\n",
+ "\t\t\t# iso-pentane = neo-pentane \t\t\t# (reaction 2)\n",
+ "delta_G_rkn_2 = delta_G_neo_pentane_400 - delta_G_iso_pentane_400;\t\t\t#[cal]\n",
+ "K_2 = math.exp(-delta_G_rkn_2/(R*T));\n",
+ "\n",
+ "\t\t\t# Let the initial number of moles be\n",
+ "\t\t\t# n_iso_pentane = 1\n",
+ "\t\t\t# n_n_pentane = 0\n",
+ "\t\t\t# n_neo_pentane = 0\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the two reaction be X_1 and X_2 respectively\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_iso_pentane_eq = 1 - X_1 - X_2\n",
+ "\t\t\t# n_n_pentane_eq = X_1\n",
+ "\t\t\t# n_neo_pentane_eq = X_2\n",
+ "\t\t\t# Total moles = 1 \n",
+ "\n",
+ "\t\t\t# Pressure has no effect on these reactions ( P = 1 atm) and therefore\n",
+ "Ky_1 = K_1;\n",
+ "Ky_2 = K_2;\n",
+ "\n",
+ "\t\t\t# From reaction (1), we get\n",
+ "\t\t\t# Ky_1 = X_1/(1-X_1-X_2)\n",
+ "\n",
+ "\t\t\t# From reaction (2), we get\n",
+ "\t\t\t# Ky_2 = X_2/(1-X_1-X_2)\n",
+ "\n",
+ "\t\t\t# Putting the value of X_1 from first equation into the second we get\n",
+ "\t\t\t# X_1 = (Ky_1*(1-X_2))/(1+Ky_1)\n",
+ "\t\t\t# Now putting it into the second equation we grt\n",
+ "\t\t\t# Ky_2 = X_2/(1-((Ky_1*(1-X_2))/(1+Ky_1))-X_2)\n",
+ "\t\t\t# Now solving for X_2\n",
+ "def f(X_2): \n",
+ "\t return Ky_2 - X_2/(1-((Ky_1*(1-X_2))/(1+Ky_1))-X_2)\n",
+ "X_2 = fsolve(f,0.8)\n",
+ "\n",
+ "\t\t\t# Therefore X_1 can be calculated as\n",
+ "X_1 = (Ky_1*(1-X_2))/(1+Ky_1);\n",
+ "\n",
+ "\t\t\t# Finally the mole fractions of the components at equilibrium\n",
+ "y_n_pentane = X_1;\n",
+ "y_neo_pentane = X_2;\n",
+ "y_iso_pentane = 1 -X_1 - X_2;\n",
+ "\n",
+ "print \" The equilibrium composition is given by y_n_pentane = %f y_neo_pentane = %f and y_iso_pentane = %f\"%(y_n_pentane,y_neo_pentane,y_iso_pentane);\n",
+ "\n",
+ "\t\t\t# Let us consider another set of independent reactions\n",
+ "\n",
+ "\t\t\t# n-pentane = iso-pentane \t\t\t# (reaction 3)\n",
+ "delta_G_rkn_3 = delta_G_iso_pentane_400 - delta_G_n_pentane_400;\t\t\t#[cal]\n",
+ "K_3 = math.exp(-delta_G_rkn_3/(R*T));\n",
+ "\t\t\t# n-pentane = neo-pentane \t\t\t# (reaction 4)\n",
+ "delta_G_rkn_4 = delta_G_neo_pentane_400 - delta_G_n_pentane_400;\t\t\t#[cal]\n",
+ "K_4 = math.exp(-delta_G_rkn_4/(R*T));\n",
+ "\n",
+ "\t\t\t# Let the initial number of moles be\n",
+ "\t\t\t# n_n_pentane = 1\n",
+ "\t\t\t# n_iso_pentane = 0\n",
+ "\t\t\t# n_neo_pentane = 0\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the two reaction be X_3 and X_4 respectively\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_n_pentane_eq = 1 - X_3 - X_4\n",
+ "\t\t\t# n_iso_pentane_eq = X_4\n",
+ "\t\t\t# n_neo_pentane_eq = X_4\n",
+ "\t\t\t# Total moles = 1 \n",
+ "\n",
+ "\t\t\t# Pressure has no effect on these reactions (P = 1 atm) and therefore\n",
+ "Ky_3 = K_3;\n",
+ "Ky_4 = K_4;\n",
+ "\n",
+ "\t\t\t# From reaction (3), we get\n",
+ "\t\t\t# Ky_3 = X_3/(1-X_3-X_4)\n",
+ "\n",
+ "\t\t\t# From reaction (4), we get\n",
+ "\t\t\t# Ky_4 = X_4/(1-X_3-X_4)\n",
+ "\n",
+ "\t\t\t# Putting the value of X_3 from first equation into the second we get\n",
+ "\t\t\t# X_3 = (Ky_3*(1-X_4))/(1+Ky_3)\n",
+ "\t\t\t# Now putting it into the second equation we grt\n",
+ "\t\t\t# Ky_4 = X_4/(1-((Ky_1*(1-X_4))/(1+Ky_3))-X_4)\n",
+ "\t\t\t# Now solving for X_4\n",
+ "def f1(X_4): \n",
+ "\t return Ky_4 - X_4/(1-((Ky_3*(1-X_4))/(1+Ky_3))-X_4)\n",
+ "X_4 = fsolve(f1,0.8)\n",
+ "\n",
+ "\t\t\t# Therefore X_3 can be calculated as\n",
+ "X_3 = (Ky_3*(1-X_4))/(1+Ky_3);\n",
+ "\n",
+ "\t\t\t# Finally the mole fractions of the components at equilibrium\n",
+ "y_n_pentane1 = 1 - X_3 - X_4;\n",
+ "y_neo_pentane1 = X_4;\n",
+ "y_iso_pentane1 = X_3;\n",
+ "\n",
+ "\t\t\t# The final composition does not depend on the set of reactions considered. \n",
+ "\n",
+ "print \" For another set of independent reactions considered\";\n",
+ "print \" The equilibrium composition is given by y_n_pentane = %f y_neo_pentane = %f and y_iso_pentane = %f\"%(y_n_pentane1,y_neo_pentane1,y_iso_pentane1);\n",
+ "print \" Thus the final composition does not depend on the set of reactions considered\";\n",
+ "print \" The number of independent reactions taking place is two\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium composition is given by y_n_pentane = 0.111753 y_neo_pentane = 0.237745 and y_iso_pentane = 0.650501\n",
+ " For another set of independent reactions considered\n",
+ " The equilibrium composition is given by y_n_pentane = 0.111753 y_neo_pentane = 0.237745 and y_iso_pentane = 0.650501\n",
+ " Thus the final composition does not depend on the set of reactions considered\n",
+ " The number of independent reactions taking place is two\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.23 Page Number : 628"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of equilibrium composition\n",
+ "\n",
+ "# Variables\n",
+ "T = 600;\t\t\t#[K] - Temperature\n",
+ "P = 1;\t\t\t#[atm] - Pressure\n",
+ "R = 1.987;\t\t\t#[cal/mol-K] - Universal gas consatnt\n",
+ "\n",
+ "\t\t\t# CH4 + H2O = CO + 3*H2 \t\t\t# (Reaction 1)\n",
+ "\t\t\t# CO + H2O = CO2 + H2 \t\t\t# (Reaction 2)\n",
+ "\n",
+ "K_1 = 0.574;\t\t\t# Equilibrium constant of first reaction\n",
+ "K_2 = 2.21;\t\t\t# Equilibrium constant of second reaction\n",
+ "\n",
+ "\t\t\t# Initial number of moles of the components are\n",
+ "\t\t\t# n_CH4 = 1\n",
+ "\t\t\t# n_H2O = 5\n",
+ "\t\t\t# n_CO = 0\n",
+ "\t\t\t# n_H2 = O\n",
+ "\t\t\t# n_CO2 = 0\n",
+ "\n",
+ "\t\t\t# Let the reaction coordinate at equilibrium for the two reaction be X_1 and X_2 respectively\n",
+ "\t\t\t# At equilibrium, the moles of the components be\n",
+ "\t\t\t# n_CH4_eq = 1 - X_1\n",
+ "\t\t\t# n_H20_eq = 5 - X_1 - X_2\n",
+ "\t\t\t# n_CO_eq = X_1 - X_2\n",
+ "\t\t\t# n_H2_eq = 3*X_1 + X_2\n",
+ "\t\t\t# n_CO2_eq = X_2\n",
+ "\t\t\t# Total moles = 6 + 2*X_1\n",
+ "\n",
+ "\t\t\t# Since the pressure is 1 atm, K = Kp, Ky = K\n",
+ "Ky_1 = K_1;\n",
+ "Ky_2 = K_2;\n",
+ "\n",
+ "\t\t\t# From reaction (1), we get\n",
+ "\t\t\t# Ky_1 = ((X_1-X_2)*(3*X_1+X_2)**(3))/((1-X_1)*(5-X_1-X_2)*(6+2*X_1)**(2))\n",
+ "\n",
+ "\t\t\t# From reaction (2), we get\n",
+ "\t\t\t# Ky_2 = (X_2*(3*X_1+X_2))/((X_1-X_2)*(5-X_1-X_2))\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# Let us assume a value of X_1\n",
+ "X_1 = 0.1;\n",
+ "def f(X_2): \n",
+ "\t return Ky_1-((X_1-X_2)*(3*X_1+X_2)**(3))/((1-X_1)*(5-X_1-X_2)*(6+2*X_1)**(2))\n",
+ "\n",
+ "def f1(X_1_prime): \n",
+ "\t return Ky_2-(X_2_prime*(3*X_1_prime+X_2_prime))/((X_1_prime-X_2_prime)*(5-X_1_prime-X_2_prime))\n",
+ "\n",
+ "fault = 10;\n",
+ "while(fault>0.05):\n",
+ " X_2 = fsolve(f,0.8)\n",
+ " X_2_prime = X_2;\n",
+ " X_1_prime = fsolve(f1,0.8)\n",
+ " fault=abs(X_1 - X_1_prime);\n",
+ " X_1 = X_1 + 0.001;\n",
+ "\n",
+ "n_CH4 = 1 - X_1;\n",
+ "n_H20 = 5 - X_1 - X_2;\n",
+ "n_CO = X_1 - X_2;\n",
+ "n_H2 = 3*X_1 + X_2;\n",
+ "n_CO2 = X_2;\n",
+ "Total_moles = 6 + 2*X_1;\n",
+ "\n",
+ "# Results\n",
+ "print \" The equilibrium composition of the resulting mixture is given by\";\n",
+ "print \" n_CH4 = % f mol n_H2O = %f mol n_CO = %f mol n_H2 = %f mol and n_CO2 = %f mol\"%(n_CH4,n_H20,n_CO,n_H2,n_CO2);\n",
+ "print \" The total number of moles is %f mol\"%(Total_moles);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium composition of the resulting mixture is given by\n",
+ " n_CH4 = 0.089000 mol n_H2O = 3.471420 mol n_CO = 0.293420 mol n_H2 = 3.350580 mol and n_CO2 = 0.617580 mol\n",
+ " The total number of moles is 7.822000 mol\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/home/jovina/virtualenvs/scipy/local/lib/python2.7/site-packages/scipy/optimize/minpack.py:236: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n",
+ "/home/jovina/virtualenvs/scipy/local/lib/python2.7/site-packages/scipy/optimize/minpack.py:236: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last five Jacobian evaluations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.24 Page Number : 631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of number of moles\n",
+ "\n",
+ "# Variables \n",
+ "T = 600 + 273.15;\t\t\t#[K] - Reaction temperature\n",
+ "P = 1;\t\t\t#[atm] - Reaction pressure\n",
+ "\n",
+ "\t\t\t# The Gibbs free energy of formation of various species at 873.15 K are\n",
+ "delta_G_CH4_RT = -2.82;\t\t\t# delta_G_CH4/(R*T)\n",
+ "delta_G_H2O_RT = -29.73;\t\t\t# delta_G_CH4/(R*T)\n",
+ "delta_G_CO_RT = -27.51;\t\t\t# delta_G_CH4/(R*T)\n",
+ "delta_G_H2_RT = -1.46;\t\t\t# delta_G_CH4/(R*T)\n",
+ "delta_G_CO2_RT = -56.68;\t\t\t# delta_G_CH4/(R*T)\n",
+ "\n",
+ "# Calculations\t\t\n",
+ " \t# Initial number of moles of the components are\n",
+ "\t\t\t# n_CH4 = 1\n",
+ "\t\t\t# n_H2O = 5\n",
+ "\t\t\t# n_CO = 0\n",
+ "\t\t\t# n_H2 = O\n",
+ "\t\t\t# n_CO2 = 0\n",
+ "\n",
+ "\t\t\t# The del(F)/del(n_i) = 0 equations for CH4 (1), H2O (2), CO (3), H2 (4) and CO2 (5) becomes\n",
+ "\t\t\t# delta_G_1_T + R*T*math.log((n_1*P)/n) + lambda_C + 4*lambda_H = 0\n",
+ "\t\t\t# delta_G_2_T + R*T*math.log((n_2*P)/n) + 2*lambda_C + lambda_O = 0\n",
+ "\t\t\t# delta_G_3_T + R*T*math.log((n_3*P)/n) + lambda_c + lambda_O = 0\n",
+ "\t\t\t# delta_G_4_T + R*T*math.log((n_4*P)/n) + 2*lambda_H = 0\n",
+ "\t\t\t# delta_G_5_T + R*T*math.log((n_5*P)/n) + lambda_C + 2*lambda_O = 0\n",
+ "\n",
+ "\t\t\t# Where n is the total number of moles in the equilibrium reaction mixture. Dividing the above equations by R*T we get\n",
+ "\t\t\t# delta_G_1_T/(R*T) + math.log((n_1*P)/n) + lambda_C/(R*T) + 4*lambda_H/(R*T) = 0\n",
+ "\t\t\t# delta_G_2_T/(R*T) + math.log((n_2*P)/n) + 2*lambda_C/(R*T) + lambda_O/(R*T) = 0\n",
+ "\t\t\t# delta_G_3_T/(R*T) + math.log((n_3*P)/n) + lambda_c/(R*T) + lambda_O/(R*T) = 0\n",
+ "\t\t\t# delta_G_4_T/(R*T) + math.log((n_4*P)/n) + 2*lambda_H/(R*T) = 0\n",
+ "\t\t\t# delta_G_5_T/(R*T) + math.log((n_5*P)/n) + lambda_C/(R*T) + 2*lambda_O/(R*T) = 0\n",
+ "\n",
+ "\t\t\t# Substituting the values of delta_G_i_T/(R*T) in the above equations,the full set of equations (including elemental balance) becomes\n",
+ "\t\t\t# -2.82 + math.log(n_1/n) + lambda_C/(R*T) + 4*lambda_H/(R*T) = 0\n",
+ "\t\t\t# -29.73 + math.log(n_2/n) + 2*lambda_H/(R*T) + lambda_O/(R*T) = 0\n",
+ "\t\t\t# -27.51 + math.log(n_3/n) + lambda_C/(R*T) + lambda_O/(R*T) = 0\n",
+ "\t\t\t# -1.46 + math.log(n_4/n) + 2*lambda_H/(R*T) = 0\n",
+ "\t\t\t# -56.68 + math.log(n_5/n) + lambda_C/(R*T) + 2*lambda_O/(R*T) = 0\n",
+ "\n",
+ "\t\t\t# The constraint equations are\n",
+ "\t\t\t# n_1 + n_3 + n_5 = 1 \t\t\t# (moles of C in the reaction mixture = 1)\n",
+ "\t\t\t# 4*n_1 + 2*n_2 + 2*n_4 = 14 \t\t\t# (moles of H in the reaction mixture = 14)\n",
+ "\t\t\t# n_2 + n_3 + 2*n_5 = 5 \t\t\t# (moles of O in the raection mixture = 5)\n",
+ "\n",
+ "\t\t\t# The total moles are given by\n",
+ "\t\t\t# n = n_1 + n_2 + n_3 + n_4 + n_5\n",
+ "\n",
+ "def solution(x):\n",
+ " f = [0,0,0,0,0,0,0,0,0]\n",
+ " f[0]= -2.82 + math.log(x[0]/x[5]) + x[6] + 4*x[7];\n",
+ " f[1] = -29.73 + math.log(x[1]/x[5]) + 2*x[7] + x[8];\n",
+ " f[2] = -27.51 + math.log(x[2]/x[5]) + x[6] + x[8];\n",
+ " f[3] = -1.46 + math.log(x[3]/x[5]) + 2*x[7];\n",
+ " f[4] = -56.68 + math.log(x[4]/x[5]) + x[6] + 2*x[8];\n",
+ " f[5] = x[0] + x[2] +x[4] - 1;\n",
+ " f[6] = 4*x[0] + 2*x[1] + 2*x[3] - 14;\n",
+ " f[7] = x[1] + x[2] +2*x[4] - 5;\n",
+ " f[8] = x[0]+ x[1] + x[2] + x[3] + x[4] - x[5]; \n",
+ " return f\n",
+ "\n",
+ "\n",
+ "x = [0.01,3.5,0.2,3.0,0.5,5.0,2.0,1.0,25.0];\n",
+ "y = fsolve(solution,x)\n",
+ "\n",
+ "# Results\n",
+ "print \" n_1 = %f mol\"%(y[0]);\n",
+ "print \" n_2 = %f mol\"%(y[1]);\n",
+ "print \" n_3 = %f mol\"%(y[2]);\n",
+ "print \" n_4 = %f mol\"%(y[3]);\n",
+ "print \" n_5 = %f mol\"%(y[4]);\n",
+ "print \" n = %f mol\"%(y[5]);\n",
+ "print \" lambda_C/RT = %f\"%(y[6]);\n",
+ "print \" lambda_H/RT = %f\"%(y[7]);\n",
+ "print \" lambda_O/RT = %f\"%(y[8]);\n",
+ "\n",
+ "print \" The Lagrange multiplier values do not have any physical significance\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " n_1 = 0.091556 mol\n",
+ " n_2 = 3.442034 mol\n",
+ " n_3 = 0.258922 mol\n",
+ " n_4 = 3.374855 mol\n",
+ " n_5 = 0.649522 mol\n",
+ " n = 7.816888 mol\n",
+ " lambda_C/RT = 2.667225\n",
+ " lambda_H/RT = 1.149967\n",
+ " lambda_O/RT = 28.250290\n",
+ " The Lagrange multiplier values do not have any physical significance\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch18_1.ipynb b/Chemical_Engineering_Thermodynamics/ch18_1.ipynb
new file mode 100644
index 00000000..730764b8
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch18_1.ipynb
@@ -0,0 +1,599 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : Adiabatic Reaction Temperature"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.1 Page Number : 650"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of heat transfer\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "T_2 = 500;\t\t\t#[K] - Reaction temperature\n",
+ "P = 1;\t\t\t#[atm] - Pressure \n",
+ "\n",
+ "a_CO2 = 5.316;\n",
+ "a_O2 = 6.085;\n",
+ "a_N2 = 6.903;\n",
+ "a_H2O = 7.700;\n",
+ "a_C3H8 = -0.966;\n",
+ "b_CO2 = 1.4285*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "b_N2 = -0.03753*10**(-2);\n",
+ "b_H2O = 0.04594*10**(-2);\n",
+ "b_C3H8 = 7.279*10**(-2);\n",
+ "c_CO2 = -0.8362*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "c_N2 = 0.1930*10**(-5);\n",
+ "c_H2O = 0.2521*10**(-5);\n",
+ "c_C3H8 = -3.755*10**(-5);\n",
+ "d_CO2 = 1.784*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "d_N2 = -0.6861*10**(-9);\n",
+ "d_H2O = -0.8587*10**(-9);\n",
+ "d_C3H8 = 7.580*10**(-9);\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy of formation at 298.15 K is given by\n",
+ "delta_H_for_CO2 = -94.052;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_C3H8 = -24.820;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_H2O = -57.7979;\t\t\t#[kcal/mol]\n",
+ "\n",
+ "\t\t\t# The reaction with stoichiometric amount of air is\n",
+ "\t\t\t# C3H8 + 5(O2 + 3.7N2) - 3CO2 + 4H2O + 18.8N2\n",
+ "\n",
+ "\t\t\t# The reaction with 100% excess air is\n",
+ "\t\t\t# C3H8 + 10(O2 + 3.7N2) - 3CO2 + 4H2O + 5O2 + 37.6N2\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy change of reaction at 298.15 K\n",
+ "delta_H_rkn_298 = 3*delta_H_for_CO2 + 4*delta_H_for_H2O - delta_H_for_C3H8;\n",
+ "\n",
+ "\t\t\t# For exit stream\n",
+ "sum_ai_ni = 3*a_CO2 + 4*a_H2O + 5*a_O2 + 37.6*a_N2;\n",
+ "sum_bi_ni = 3*b_CO2 + 4*b_H2O + 5*b_O2 + 37.6*b_N2;\n",
+ "sum_ci_ni = 3*c_CO2 + 4*c_H2O + 5*c_O2 + 37.6*c_N2;\n",
+ "sum_di_ni = 3*d_CO2 + 4*d_H2O + 5*d_O2 + 37.6*d_N2;\n",
+ "\n",
+ "\n",
+ "\t\t\t# To raise the exit species from 298.15 to 500 K the enthalpy change is\n",
+ "\n",
+ "def f1(T): \n",
+ "\t return sum_ai_ni+sum_bi_ni*T+sum_ci_ni*T**(2)+sum_di_ni*T**(3)\n",
+ "\n",
+ "delta_H_rkn = quad(f1,T_1,T_2)[0]\n",
+ "\n",
+ "delta_H_rkn = delta_H_rkn*10**(-3);\t\t\t#[kcal]\n",
+ "\n",
+ "\t\t\t# Therefore per mole of fuel the heat exchange is\n",
+ "\t\t\t# Q = Heat exchange in step 1 + Heat exchange in step 2\n",
+ "Q = delta_H_rkn_298 + delta_H_rkn;\n",
+ "\n",
+ "# Results\n",
+ "print \" The heat transfer from the combustion chamber per mole of fuel is %f kcal (per mol of C3H8)\"%(Q);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The heat transfer from the combustion chamber per mole of fuel is -415.328732 kcal (per mol of C3H8)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.2 Page Number : 650"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of adiabatic flame temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "\n",
+ "a_CO2 = 5.316;\n",
+ "a_H2O = 7.700;\n",
+ "a_O2 = 6.085;\n",
+ "a_C2H6 = 1.648;\n",
+ "b_CO2 = 1.4285*10**(-2);\n",
+ "b_H2O = 0.04595*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "b_C2H6 = 4.124*10**(-2);\n",
+ "c_CO2 = -0.8362*10**(-5);\n",
+ "c_H2O = 0.2521*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "c_C2H6 = -1.530*10**(-5);\n",
+ "d_CO2 = 1.784*10**(-9);\n",
+ "d_H2O = -0.8587*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "d_C2H6 = 1.740*10**(-9);\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy of formation at 298.15 K is given by\n",
+ "delta_H_for_CO2 = -94.052;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_C2H6 = -20.236;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_H2O = -57.7979;\t\t\t#[kcal/mol]\n",
+ "\n",
+ "# Calculations\t\t\n",
+ " \t# The reaction with stoichiometric amount of air is\n",
+ "\t\t\t# C2H6 + (7/2)O2 - 2CO2 + 3H2O\n",
+ "\n",
+ "\t\t\t# The reaction with 4 mol of O2 and 10 mol CO2 is\n",
+ "\t\t\t# C2H6 + 4O2 + 10CO2 - 12H2O + 3H2O + 0.5O2\n",
+ "\t\t\t# The product consists of 12 mol of CO2, 3 mol of water vapour and 0.5 mol of oxygen\n",
+ "delta_H_rkn_298 = 2*delta_H_for_CO2 + 3*delta_H_for_H2O - delta_H_for_C2H6;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t# For exit stream\n",
+ "sum_ai_ni = 12*a_CO2 + 3*a_H2O + 0.5*a_O2;\n",
+ "sum_bi_ni = 12*b_CO2 + 3*b_H2O + 0.5*b_O2;\n",
+ "sum_ci_ni = 12*c_CO2 + 3*c_H2O + 0.5*c_O2;\n",
+ "sum_di_ni = 12*d_CO2 + 3*d_H2O + 0.5*d_O2;\n",
+ "\n",
+ "\t\t\t# From energy balance equation we get\n",
+ "\t\t\t# delta_H_rkn_298 + sum_ai_ni*(T_2 - T_1) + (sum_bi_ni/2)*(T_2**(2) - T_1**(2)) + (sum_ci_ni/3)*(T_2**(3) - T_1**(3)) + (sum_di_ni/4)*(T_2**(4) - T_1**(4))\n",
+ "\t\t\t# Solving above equation for T_2\n",
+ "def f(T_2): \n",
+ "\t return delta_H_rkn_298 +sum_ai_ni*(T_2-T_1)+(sum_bi_ni/2)*(T_2**(2)-T_1**(2))+(sum_ci_ni/3)*(T_2**(3)-T_1**(3))+(sum_di_ni/4)*(T_2**(4)-T_1**(4))\n",
+ "T_2 = fsolve(f,-1)\n",
+ "\n",
+ "# Results\n",
+ "print \" The adiabatic flame temperature is %f K\"%(T_2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The adiabatic flame temperature is 2090.385277 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.3 Page Number : 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of mole fraction and average heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "\n",
+ "\t\t\t# The reaction with theoritical air is\n",
+ "\t\t\t# CH4 + 2(O2 + 3.76N2) - CO2 + 2H20 + 7.52N2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "n_product = (1 + 2 + 7.52);\t\t\t# Total number of moles of product\n",
+ "\t\t\t# The mole fraction of water vapour is\n",
+ "y_H2O = 2/(n_product);\n",
+ "print \" 1).The mole fraction of water vapour is %f\"%(y_H2O);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "delta_H_rkn_298 = -730*10**(3);\t\t\t#[J/mol]\n",
+ "C = 40;\t\t\t#[J/mol-K] - Average molar heat capacity\n",
+ "\n",
+ "\t\t\t# From energy balance we have\n",
+ "\t\t\t# delta_H_rkn_298 + n_product*C(T_2 - T_1) = 0\n",
+ "T_2 = - delta_H_rkn_298/(n_product*C) + T_1;\t\t\t#[K]\n",
+ "T_max = T_2 - T_1;\n",
+ "\n",
+ "print \" 2).The maximum temperature rise of the exhaust gases is %f K\"%(T_max);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The mole fraction of water vapour is 0.190114\n",
+ " 2).The maximum temperature rise of the exhaust gases is 1734.790875 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.4 Page Number : 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of adiabatic flame temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy of formation at 298.15 K is given by\n",
+ "delta_H_for_CO2 = -94.052;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_C8H18 = -59.780;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_H2O = -57.7979;\t\t\t#[kcal/mol]\n",
+ "\n",
+ "a_CO2 = 5.316;\n",
+ "a_H2O = 7.700;\n",
+ "a_N2 = 6.903;\n",
+ "b_CO2 = 1.4285*10**(-2);\n",
+ "b_H2O = 0.04595*10**(-2);\n",
+ "b_N2 = -0.03753*10**(-2);\n",
+ "c_CO2 = -0.8362*10**(-5);\n",
+ "c_H2O = 0.2521*10**(-5);\n",
+ "c_N2 = 0.1930*10**(-5);\n",
+ "d_CO2 = 1.784*10**(-9);\n",
+ "d_H2O = -0.8587*10**(-9);\n",
+ "d_N2 = -0.6861*10**(-9);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# The reaction with stoichiometric amount of air is\n",
+ "\t\t\t# C3H18 + 12.5(O2 + 3.76N2) - 8CO2 + 9H2O + 47N2\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy change of reaction at 298.15 K is\n",
+ "delta_H_rkn_298 = 8*delta_H_for_CO2 + 9*delta_H_for_H2O - delta_H_for_C8H18;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t# For exit stream\n",
+ "sum_ai_ni = 8*a_CO2 + 9*a_H2O + 47*a_N2;\n",
+ "sum_bi_ni = 8*b_CO2 + 9*b_H2O + 47*b_N2;\n",
+ "sum_ci_ni = 8*c_CO2 + 9*c_H2O + 47*c_N2;\n",
+ "sum_di_ni = 8*d_CO2 + 9*d_H2O + 47*d_N2;\n",
+ "\n",
+ "\t\t\t# From energy balance equation we get\n",
+ "\t\t\t# delta_H_rkn_298 + sum_ai_ni*(T_2 - T_1) + (sum_bi_ni/2)*(T_2**(2) - T_1**(2)) + (sum_ci_ni/3)*(T_2**(3) - T_1**(3)) + (sum_di_ni/4)*(T_2**(4) - T_1**(4))\n",
+ "\t\t\t# Solving above equation for T_2\n",
+ "def f(T_2): \n",
+ "\t return delta_H_rkn_298 +sum_ai_ni*(T_2-T_1)+(sum_bi_ni/2)*(T_2**(2)-T_1**(2))+(sum_ci_ni/3)*(T_2**(3)-T_1**(3))+(sum_di_ni/4)*(T_2**(4)-T_1**(4))\n",
+ "T_2 = fsolve(f,-1)\n",
+ "\n",
+ "print \" 1).The adiabatic flame temperature is %f K\"%(T_2);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# The mean smath.tan(math.radiansard heat capacity of various components over the temperature range from 25 to 3000 C is \n",
+ "Cp_CO2 = 13.91;\t\t\t#[cal/mol-K]\n",
+ "Cp_H2O = 10.16;\t\t\t#[cal/mol-K]\n",
+ "Cp_O2 = 7.88;\t\t\t#[cal/mol-K]\n",
+ "Cp_N2 = 7.45;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "\t\t\t# From energy balance equation we get\n",
+ "\t\t\t# delta_H_rkn_298 + (8*Cp_CO2 + 9*Cp_H2O + 47*Cp_N2)*(T_2_prime)\n",
+ "T_2_prime = - delta_H_rkn_298/(8*Cp_CO2 + 9*Cp_H2O + 47*Cp_N2);\t\t\t#[K]\n",
+ "print \" 2).The adiabatic flame temperature is %f K\"%(T_2_prime);\n",
+ "\n",
+ "# The answer is correct. Please calculate it manually. Wrong answer is given in book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The adiabatic flame temperature is 2415.861178 K\n",
+ " 2).The adiabatic flame temperature is 2193.675005 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.5 Page Number : 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of conversion\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t# N2 + 3H2 - 2NH3\n",
+ "T_1 = 700;\t\t\t#[K] - Reaction temperature\n",
+ "Max_adia_rise = 100;\t\t\t#/[K] - Maximum adiabatic rise in temperature\n",
+ "T_2 = T_1 + Max_adia_rise;\t\t\t#[K] - \n",
+ "\n",
+ "delta_H_rkn_700 = -94.2;\t\t\t#[kJ] - Smath.tan(math.radiansard enthalpy of reaction at 700 K\n",
+ "delta_H_rkn_700 = delta_H_rkn_700*10**(3);\t\t\t#[J]\n",
+ "\n",
+ "\t\t\t# The mean smath.tan(math.radiansard heat capacity of various components over the temperature range from 700 to 800 K is \n",
+ "Cp_N2 = 30.0;\t\t\t#[cal/mol-K]\n",
+ "Cp_H2 = 28.9;\t\t\t#[cal/mol-K]\n",
+ "Cp_NH3 = 49.2;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "# Calculations\t\t\t\n",
+ " # The energy balance equation is\n",
+ "\n",
+ "def f46(T): \n",
+ "\t return (sum_ni_Cpi_exit)*dT\n",
+ "\n",
+ "\t\t\t# X*delta_H_rkn_700 + quad(f46,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t#At exit, let moles of NH3 = (1-X), moles of H2 = (3-3X), moles of NH3 = 2X . Therefore we have,\n",
+ "\t\t\t# delta_H_rkn_700*X + {(1-X)*Cp_N2 + (3-3X)*Cp_H2 + (2X)*Cp_NH3}*(T_2 - T_1)\n",
+ "\t\t\t# On simplification we get, 960.3*X = 116.7\n",
+ "X = 116.7/960.3;\n",
+ "\n",
+ "# Results\n",
+ "print \" The maximum allowable conversion fraction in the reactor is given by X = %f \"%(X);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The maximum allowable conversion fraction in the reactor is given by X = 0.121525 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.6 Page Number : 653"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of maximum pressure\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "V = 2.0*10**(-3);\t\t\t#[m**(3)] - Volume of calorimeter\n",
+ "m = 10.;\t\t\t#[g] - Mass of liquid octane\n",
+ "Mol_wt = 114.;\t\t\t#[g/mol] - Molecular weight of octane\n",
+ "n = m/Mol_wt;\t\t\t#[mol] - No of moles of octane\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy of formation at 298.15 K is given by\n",
+ "delta_H_for_CO2 = -94.052;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_C8H18 = -59.780;\t\t\t#[kcal/mol]\n",
+ "delta_H_for_H2O = -57.7979;\t\t\t#[kcal/mol]\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard molar heat capacity of various components in high temperature range from is given by \n",
+ "\t\t\t# Cp_H2O = 6.970 + 0.3464*10**(-2)*T - 0.04833*10**(-5)*T**(2);\n",
+ "\t\t\t# Cp_O2 = 6.732 + 0.1505*10**(-2)*T - 0.01791*10**(-5)*T**(2);\n",
+ "\t\t\t# Cp_CO2 = 18.036 - 4.474*10**(-5)*T - 158.08/(T**(1/2));\n",
+ "\t\t\t# Therefore we have\n",
+ "\t\t\t# Sum_ni_Cpi_exit = 249.09 + 0.04*T - 0.547*10**(-5)*T**(2) - 1264.64/(T**(1/2))\n",
+ "\n",
+ "\t\t\t# The reaction with stoichiometric amount of oxygen is\n",
+ "\t\t\t# C8H18 + 12.5O2 - 8CO2 + 9H2O\n",
+ "\n",
+ "\t\t\t# The reaction with 50% excess oxygen is\n",
+ "\t\t\t# C8H18 + 18.75O2 - 8CO2 +9H2O + 6.25O2\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy change of reaction at 298.15 K is\n",
+ "delta_H_rkn_298 = 8*delta_H_for_CO2 + 9*delta_H_for_H2O - delta_H_for_C8H18;\t\t\t#[kcal]\n",
+ "delta_H_rkn_298 = delta_H_rkn_298*10**(3);\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t# From the energy balance equation we get\n",
+ "\n",
+ "def f10(T): \n",
+ "\t return (sum_ni_Cpi_exit)*dT\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_298 + quad(f10,T_1,T_2)[0]\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_298 + 249.09*(T_2 - T_1) + (0.04/2)*(T_2**(2) - T_1**(2)) - ((0.547*10**(-5))/3)*(T_2**(3)-T_1**(3)) - (1264.64*2)*(T_2**(1/2)-T_1**(1/2))\n",
+ "\t\t\t# Solving above equation for T_2\n",
+ "def f(T_2): \n",
+ "\t return delta_H_rkn_298 + 249.09*(T_2 - T_1) + (0.04/2)*(T_2**(2)-T_1**(2)) - ((0.547*10**(-5))/3)*(T_2**(3)-T_1**(3)) - (1264.64*2)*(T_2**(1./2)-T_1**(1./2))\n",
+ "T_2 = fsolve(f,1000)\n",
+ "\n",
+ "\t\t\t# When 1 mol of octane reacts the final number of moles in the calorimeter is 23.25\n",
+ "\t\t\t# When n mol of octane reacts the final number of moles in the calorimeter is\n",
+ "n_total = n*23.25;\t\t\t#[mol]\n",
+ "\n",
+ "\t\t\t# The maximum explosion pressure is calculated when no heat is dissipated to the surroundings and thus bomb calorimeter attains the adiabatic flame temperature\n",
+ "\t\t\t# Thus maximum explosion pressure is given by\n",
+ "P = (n_total*R*T_2)/V;\t\t\t#[N/m**(2)]\n",
+ "P = P*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "# Results\n",
+ "print \" The maximum explosion pressure inside the bomb calorimeter is %f bar\"%(P);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The maximum explosion pressure inside the bomb calorimeter is 397.138166 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.7 Page Number : 656"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve\n",
+ "import math\n",
+ "# Calculation of number of moles\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 400 + 273.15;\t\t\t#[K]\n",
+ "\t\t\t# SO2(g) + 1./2*(O2) (g) - SO3 (g)\n",
+ "\n",
+ "a_SO2 = 6.157;\n",
+ "a_SO3 = 3.918;\n",
+ "a_O2 = 6.085;\n",
+ "a_N2 = 6.903;\n",
+ "b_SO2 = 1.384*10**(-2);\n",
+ "b_SO3 = 3.483*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "b_N2 = -0.03753*10**(-2);\n",
+ "c_SO2 = -0.9103*10**(-5);\n",
+ "c_SO3 = -2.675*10**(-5);\n",
+ "c_O2 = -0.01709*10**(-5);\n",
+ "c_N2 = 0.1930;\n",
+ "d_SO2 = 2.057*10**(-9);\n",
+ "d_SO3 = 7.744*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "d_N2 = -0.6861*10**(-9);\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# At 400 C, from the given math.expressions\n",
+ "delta_H_rkn_T_1 = -22630.14 - 5.2815*T_1 + 0.9587*10**(-2)*T_1**(2) - 0.5598*10**(-5)*T_1**(3) + 1.3826*10**(-9)*T_1**(4);\t\t\t#[cal]\n",
+ "\t\t\t# This is the smath.tan(math.radiansard enthalpy change of reaction for 1 mol of SO2 reacted. Since X moles of SO2 are reactants therefore \n",
+ "\t\t\t# delta_H_rkn_T_X (for X moles of SO2 reacted) = delta_H_rkn_T_1*X\n",
+ "\n",
+ "\t\t\t# Let the number of moles at equilibrium be\n",
+ "\t\t\t# n_O2 = 9-0.5*X\n",
+ "\t\t\t# n_SO2 = 12-X\n",
+ "\t\t\t# n_SO3 = X\n",
+ "\t\t\t# n_N2 = 79\n",
+ "\t\t\t# Total moles at equilibrium = 100-0.5X\n",
+ "\t\t\t# Ky = y_SO3/(y_SO2*y_O2**(1./2))\n",
+ "\t\t\t# Ky = (X*(100-0.5*X)**(1./2))/((12-X)*(9-0.5*X)**(1./2))\n",
+ "\t\t\t# We know that K = Ky*Kp. Since P = 1 atm, therefore Ky = K\n",
+ "\n",
+ "\t\t\t# Now we have to account for the heat required to raise 9-0.5*X mol of O2, 12-X mol of SO2, X mol of SO3 and 79 mol of N2 from T to ART\n",
+ "\t\t\t# sum_ni_Cp_i = (12-X)*(a + b*T + c*T**(2) + d*T**(3)) + (9-0.5*X)*(a + b*T + c*T**(2) + d*T**(3)) + X*(a + b*T + c*T**(2) + d*T**(3)) + 79*(a + b*T + c*T** (2) + d*T**(3))\n",
+ "\n",
+ "\t\t\t# From energy balance equation we get\n",
+ "\n",
+ "def f19(T): \n",
+ "\t return sum_ni_Cp_i\n",
+ "\n",
+ "\t\t\t# delta_H_rkn_T_1 + quad(f19,T_1,T)[0]\n",
+ "\n",
+ "\t\t\t# The above equation on simplification becomes\n",
+ "\t\t\t# (673.99-5.2815*X)*(T-T_1) + (16.91+1.9175*X)*(10**(-2)/2)*(T**(2)-T_1**(2)) + (2.79-1.6793*X)*(10**(-5)/3)*(T**(3)-T_1**(3)) + (-26.70+5.5304*X)*(10**(-9) /4)*(T**(4)-T_1**(4)) = delta_H_rkn_T_1*X\n",
+ "\n",
+ "\t\t\t# Let us assume a temperature, say\n",
+ "T = 800;\t\t\t#[K]\n",
+ "fault = 10;\n",
+ "def f(X): \n",
+ "\t return K - (X*(100-0.5*X)**(1./2))/((12-X)*(9-0.5*X)**(1./2))\n",
+ "\n",
+ "def f1(X): \n",
+ "\t return (673.99-5.2815*X)*(T-T_1)+(16.91+1.9175*X)*(10**(-2)/2)*(T**(2)-T_1**(2))+(2.79-1.6793*X)*(10**(-5)/3)*(T**(3)-T_1**(3))+(-26.70+5.5304*X)*(10**(-9)/4)*(T**(4)-T_1**(4))+delta_H_rkn_T_1*X\n",
+ "\n",
+ "while(fault>0.01):\n",
+ " K = math.exp(3.87 + (11389.10/T) - 2.6580*math.log(T) + 0.4825*10**(-2)*T - 0.1409*10**(-5)*T**(2) + 0.2320*10**(-9)*T**(3));\n",
+ " X1 = fsolve(f,0.1)\n",
+ " X2 = fsolve(f1,1)\n",
+ " fault = abs(X1-X2);\n",
+ " T = T + 0.01;\n",
+ "\n",
+ "# Results\n",
+ "print \" The moles of SO2 reacted are %f mol\"%(X1);\n",
+ "print \" The adiabatic reaction temperature is %f K\"%(T);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The moles of SO2 reacted are 7.594592 mol\n",
+ " The adiabatic reaction temperature is 886.860000 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch1_2.ipynb b/Chemical_Engineering_Thermodynamics/ch1_2.ipynb
new file mode 100644
index 00000000..558a147b
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch1_2.ipynb
@@ -0,0 +1,784 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.1 Page number - 6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure and heat transfer in piston cylinder assembly\n",
+ "\n",
+ "# Variables\n",
+ "#(a)\n",
+ "# The pressure in the cylinder is due to the weight of the piston and due to surroundings pressure\n",
+ "m = 50.;\t\t\t#[kg] - Mass of piston\n",
+ "A = 0.05;\t\t\t#[m**(2)] - Area of piston\n",
+ "g = 9.81;\t\t\t#[m/s**(2)] - Acceleration due to gravity\n",
+ "Po = 101325;\t\t\t#[N/m**(2)] - Atmospheric pressure\n",
+ "\n",
+ "# Calculations and Results\n",
+ "P = (m*g/A)+Po;\t\t\t#[N/m**(2)]\n",
+ "P = P/100000.;\t\t\t#[bar]\n",
+ "print \" (a).Pressure = %f bar\"%P\n",
+ "\n",
+ "#(b)\n",
+ "print \" (b).Since the piston weight and surroundings pressure are the same, \\\n",
+ "the gas pressure in the piston-cylinder assembly remains %f bar\"%P\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a).Pressure = 1.111350 bar\n",
+ " (b).Since the piston weight and surroundings pressure are the same, the gas pressure in the piston-cylinder assembly remains 1.111350 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.2 Page number - 8\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of mass of air contained in a room\n",
+ "\n",
+ "# Variables\n",
+ "P = 1.;\t\t\t#[atm] - Atmospheric pressure\n",
+ "P = 101325.;\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "T = 30.;\t\t\t#[C] - Temperature of air\n",
+ "T = 30.+273.15;\t\t\t#[K]\n",
+ "V = 5.*5*5;\t\t\t#[m**(3)] - Volume of the room\n",
+ "\n",
+ "# Calculations\n",
+ "#The number of moles of air is given by\n",
+ "n = (P*V)/(R*T)\t\t\t#[mol]\n",
+ "\n",
+ "#Molecular weight of air(21 vol% O2 and 79 vol% N2)=(0.21*32)+(0.79*28)= 28.84 g/mol\n",
+ "m = n*28.84;\t\t\t#[g]\n",
+ "m = m/1000.;\t\t\t#[kg]\n",
+ "\n",
+ "# Results\n",
+ "print \"The mass of air is, m = %f kg\"%m\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass of air is, m = 144.928664 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.3 Page number - 13\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work done\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 3.;\t\t\t# [bar] - initial pressure\n",
+ "V1 = 0.5;\t\t\t# [m**(3)] - initial volume\n",
+ "V2 = 1.0;\t\t\t# [m**(3)] - final volume\n",
+ "import math\n",
+ "#(a)\n",
+ "n = 1.5;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Let P*V**(n)=C \t\t\t# Variables relation\n",
+ "#W (work done per mole)= (integrate('P'%'V'%V1%V2))\n",
+ "#W = (integrate('(C/V**(n))'%'V'%V1%V2)) = (C*((V2***(1-n))-(V1***(1-n))))/(1-n)\n",
+ "#Where C=P*V**(n)=P1*V1**(n)=P2*V2**(n)\n",
+ "#Thus w=((P2*V2**(n)*V2**(1-n))-(P1*V1**(n)*V1**(1-n)))/(1-n)\n",
+ "#w = ((P2*V2**(n))-(P1*V1**(n)))/(1-n)\n",
+ "#and thus W=((P2*V2)-(P1*V1))/(1-n)\n",
+ "#The above math.expression is valid for all values of n%except n=1.0\n",
+ "P2 = (P1*((V1/V2)**(n)))\t\t\t#[bar] \t\t\t#pressure at state 2\n",
+ "\n",
+ "#we have%(V1/V2)=(V1t/(V2t)%since the number of moles are constant.Thus\n",
+ "W = ((P2*V2)-(P1*V1))/(1-n)*10**(5)\t\t\t#[J]\n",
+ "W = W/1000.;\t\t\t#[kJ]\n",
+ "print \" (a).The work done (for n=1.5) is %f kJ\"%W\n",
+ "\n",
+ "#(b)\n",
+ "#For n=1.0%we have% PV=C.\n",
+ "# w(wok done per mol)= (integrate('P'%'V'%V1%V2)) = (integrate('C/V'%'V'%V1%V2)) = C*ln(V2/V1)=P1*V1*ln(V2/V1)\n",
+ "W1 = P1*V1*math.log(V2/V1)*10**(5)\t\t\t#[J]\n",
+ "W1 = W1/1000.;\t\t\t#[kJ]\n",
+ "print \" (b).The work done (for n=1.0) is %f kJ\"%W1\n",
+ "\n",
+ "#(c)\n",
+ "#For n=0%we get P=Constant and thus\n",
+ "P = P1;\t\t\t#[bar]\n",
+ "# w =(integrate('P'%'V'%V1%V2)) = P*(V2-V1)\n",
+ "W2 = P*(V2-V1)*10**(5)\t\t\t#[J]\n",
+ "W2 = W2/1000.;\t\t\t#[kJ]\n",
+ "print \" (c).The work done (for n=0) is %f kJ\"%W2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a).The work done (for n=1.5) is 87.867966 kJ\n",
+ " (b).The work done (for n=1.0) is 103.972077 kJ\n",
+ " (c).The work done (for n=0) is 150.000000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.4 Page number - 17\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of wind energy per unit mass and diameter of the wind turbine\n",
+ "\n",
+ "# Variables\n",
+ "#(a)\n",
+ "# Variables\n",
+ "V = 9.;\t\t\t# [m/s] - velocity\n",
+ "d = 1.;\t\t\t#[m] - diameter\n",
+ "A = 3.14*(d/2)**(2)\t\t\t#[m**(2)] - area\n",
+ "P = 1.;\t\t\t#[atm] - pressure\n",
+ "P = 101325.;\t\t\t# [N/m**(2)]\n",
+ "T = 300.;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "E = (V**(2))/2.;\t\t\t#[J/kg]\n",
+ "print \" (a).The wind energy per unit mass of air is %f J/kg\"%E\n",
+ "\n",
+ "#(b)\n",
+ "# Molecular weight of air(21 vol% O2 and 79 vol% N2)=(0.21*32)+(0.79*28)= 28.84 g/mol\n",
+ "M = 28.84*10**(-3)\t\t\t#[kg/mol]\n",
+ "r = (P*M)/(R*T)\t\t\t#[kg/m**(3)] - density\n",
+ "m = r*V*A;\t\t\t# [kg/s] - mass flow rate of air\n",
+ "pi = m*E;\t\t\t#[Watt] - power input\n",
+ "print \" (b).The wind power input to the turbine is %f Watt\"%pi\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a).The wind energy per unit mass of air is 40.500000 J/kg\n",
+ " (b).The wind power input to the turbine is 335.233787 Watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.5 Page number - 23\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of temperature\n",
+ "\n",
+ "# Given\n",
+ "P = 1.;\t\t\t # [bar] - atospheric pressure\n",
+ "P1guz = 0.75;\t\t\t# [bar] - gauze pressure in 1st evaporator\n",
+ "P2Vguz = 0.25;\t\t\t# [bar] - vaccum gauze pressure in 2nd evaporator\n",
+ "\n",
+ "# Calculations\n",
+ "P1abs = P + P1guz;\t\t\t# [bar] - absolute pressure in 1st evaporator\n",
+ "P2abs = P - P2Vguz;\t\t\t# [bar] -absolute pressure in 2nd evaporator\n",
+ "\n",
+ "# Results\n",
+ "#From saturated steam table as reported in the book\n",
+ "print \" For P1abs (absolute pressure) = %f bar\"%P1abs\n",
+ "print \" The saturation temperature in first evaporator is 116.04 C\"\n",
+ "print \" For P2abs (absolute pressure) = %f bar\"%P2abs\n",
+ "print \" The saturation temperature in second evaporator is 91.76 C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " For P1abs (absolute pressure) = 1.750000 bar\n",
+ " The saturation temperature in first evaporator is 116.04 C\n",
+ " For P2abs (absolute pressure) = 0.750000 bar\n",
+ " The saturation temperature in second evaporator is 91.76 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.6 Page number - 23\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of dryness fraction of steam\n",
+ "\n",
+ "# Variables\n",
+ "V = 1.;\t\t\t # [kg] - volume of tank\n",
+ "P = 10.;\t\t\t# [bar] - pressure\n",
+ "\n",
+ "#Here degree of freedom =1(C=1%P=2%threfore F=1)\n",
+ "#From steam table at 10 bar as reported in the book\n",
+ "V_liq = 0.001127;\t\t\t# [m**(3)/kg] - volume in liquid phase\n",
+ "V_vap = 0.19444;\t\t\t# [m**(3)/kg] - volume in vapour phase\n",
+ "\n",
+ "# Calculations\n",
+ "#x*Vv=(1-x)*Vl \t\t\t# since two volumes are equal\n",
+ "x = (V_liq/(V_liq+V_vap))\t\t\t# [kg]\n",
+ "y = (1-x)\t\t\t#[kg]\n",
+ "\n",
+ "# Results\n",
+ "print \" Mass of saturated vapour is %f kg\"%x\n",
+ "print \" Mass of saturated liquid is %f kg\"%y\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mass of saturated vapour is 0.005763 kg\n",
+ " Mass of saturated liquid is 0.994237 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.7 Page number - 23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of pressure mass and volume\n",
+ "\n",
+ "# Variables\n",
+ "V = 1.;\t\t\t# [m**(3)] - volume of tank\n",
+ "M = 10.;\t\t\t# [m**(3)] - total mass\n",
+ "T = (90+273.15)\t\t\t#[K] - temperature\n",
+ "\n",
+ "#From steam table at 90 C as reported in the book\n",
+ "#vapour pressure(pressure of rigid tank) = 70.14[kPa] = 0.7014[bar]\n",
+ "print \" Pressure of tank = 0.7014 bar\"\n",
+ "\n",
+ "# Calculations and Results\n",
+ "V_liq_sat=0.001036;\t\t\t# [m**(3)/kg] - saturated liquid specific volume\n",
+ "V_vap_sat=2.36056;\t\t\t# [m**(3)/kg] - saturated vapour specific volume\n",
+ "\n",
+ "#1=(V_liq_sat*(10-x))+(V_vap_sat*x)\n",
+ "x = (1-(10*V_liq_sat))/(V_vap_sat-V_liq_sat)\t\t\t#[kg]\n",
+ "y = (10-x)\t\t\t#[kg]\n",
+ "\n",
+ "print \" The amount of saturated liquid is %f kg\"%y\n",
+ "print \" The amount of saturated vapour is %f kg \"%x\n",
+ "\n",
+ "z = y*V_liq_sat;\t\t\t#[m**(3)] - Volume of saturated liquid \n",
+ "w = x*V_vap_sat;\t\t\t#[m**(3)] - Volume of saturated vapour\n",
+ "\n",
+ "print \" Total volume of saturated liquid is %f m**(3)\"%z\n",
+ "print \" Total volume of saturated vapour is %f m**(3)\"%w\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure of tank = 0.7014 bar\n",
+ " The amount of saturated liquid is 9.580576 kg\n",
+ " The amount of saturated vapour is 0.419424 kg \n",
+ " Total volume of saturated liquid is 0.009925 m**(3)\n",
+ " Total volume of saturated vapour is 0.990075 m**(3)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.8 Page number - 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of heat supplied\n",
+ "\n",
+ "# Variables\n",
+ "V = 10.;\t\t\t# [m**(3)] - volume of vessel\n",
+ "P_1 = 1.;\t\t\t# [bar] - initial pressure\n",
+ "V_liq_sat = 0.05;\t\t\t# [m**(3)] - saturated liquid volume\n",
+ "V_gas_sat = 9.95;\t\t\t# [m**(3)] - saturated vapour volume\n",
+ "\n",
+ "#At 1 bar pressure\n",
+ "V_liq_1 = 0.001043;\t\t\t# [m**(3/kg)] - specific saturated liquid volume\n",
+ "U_liq_1 = 417.33;\t\t\t# [kJ/kg] - specific internal energy\n",
+ "V_gas_1 = 1.69400;\t\t\t# [m**(3/kg)] - specific saturated vapour volume\n",
+ "U_gas_1 = 2506.06;\t\t\t# [kJ/kg]\n",
+ "\n",
+ "# Calculations\n",
+ "M_liq_1 = V_liq_sat/V_liq_1;\t\t\t# [kg] - mass of saturated liqid\n",
+ "M_gas_1 = V_gas_sat/V_gas_1;\t\t\t# [kg] - mass of saturated vapour\n",
+ "M = (M_liq_1+M_gas_1)\t\t\t# [kg] - total mass\n",
+ "U_1t = (M_liq_1*U_liq_1)+(M_gas_1*U_gas_1)\t\t\t# [kJ] - initial internal energy\n",
+ "V_gas_2 = (V/M)\t\t\t#[m**(3/kg)]\n",
+ "\n",
+ "#from steam table at 10 bar pressure as reported in the book\n",
+ "V_vap_2 = 0.19444;\t\t\t# [m**(3/kg)]\n",
+ "U_vap_2 = 2583.64;\t\t\t# [kJ/kg]\n",
+ "\n",
+ "#from steam table at 11 bar pressure as reported in the book\n",
+ "V_vap_3 = 0.17753;\t\t\t#[m**(3/kg)]\n",
+ "U_vap_3 = 2586.40;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "#Now computing pressure when molar volume of saturated vapour=Vg_2\n",
+ "#By interpolation (P2-10)/(11-10)=(Vg_2-Vv_2)/(Vv_3-Vv_2)\n",
+ "P_2 = (((V_gas_2 - V_vap_2)/(V_vap_3 - V_vap_2)*1)+10)\t\t\t# [bar] - final pressure\n",
+ "\n",
+ "#By interpolation calculating internal energy at state 2\n",
+ "#(P2-10)/(11-10)=(U2-Uv_2)/(Uv_3-Uv_2)\n",
+ "U_2 = (((P_2-10)/(11-10))*(U_vap_3 - U_vap_2))+U_vap_2;\t\t\t#[kJ/kg]\n",
+ "U_2t = U_2*M;\t\t\t#[kJ]\n",
+ "H = U_2t - U_1t;\t\t\t#[kJ] - Heat supplied\n",
+ "H = H/1000;\t\t\t#[MJ]\n",
+ "\n",
+ "# Results\n",
+ "print \" Total heat supplied is %f MJ\"%H\n",
+ "# since volume is constant%no work is done by the system and heat supplied is used in increasing the internal energy of the system.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total heat supplied is 104.381244 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.9 Page number - 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of saturation temperature\n",
+ "\n",
+ "# Variables\n",
+ "#Antoine equation for water ln(Psat)=16.262-(3799.89/(T_sat + 226.35))\n",
+ "P = 2.;\t\t\t#[atm] - Pressure\n",
+ "P = (2.*101325)/1000;\t\t\t#[kPa]\n",
+ "\n",
+ "# Calculations\n",
+ "P_sat = P;\t\t\t# Saturation pressure\n",
+ "T_sat = (3799.89/(16.262-math.log(P_sat)))-226.35;\t\t\t#[C] - Saturation temperature\n",
+ "#Thus boiling at 2 atm occurs at Tsat = 120.66 C.\n",
+ "\n",
+ "#From steam tables%at 2 bar%Tsat = 120.23 C and at 2.25 bar%Tsat = 124.0 C\n",
+ "#From interpolation for T_sat = 120.66 C%P = 2.0265 bar\n",
+ "#For P_= 2.0265 bar%T_sat% from steam table by interpolation is given by\n",
+ "#((2.0265-2)/(2.25-2))=((Tsat-120.23)/(124.0-120.23))\n",
+ "T_sat_0 = (((2.0265-2)/(2.25-2))*(124.0-120.23))+120.23;\t\t\t#[C]\n",
+ "\n",
+ "# Results\n",
+ "print \" Saturation temperature (Tsat) = %f C which is close \\\n",
+ "to %f C as determined from Antoine equation\"%(T_sat_0,T_sat)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Saturation temperature (Tsat) = 120.629620 C which is close to 120.655450 C as determined from Antoine equation\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.10 Page number - 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure and temperature at triple point\n",
+ "\n",
+ "# Variables\n",
+ "# math.log(P)=-(1640/T)+10.56 (solid)\n",
+ "# math.log(P)=-(1159/T)+7.769 (liquid)%where T is in K\n",
+ "# F+P=C+2% at triple point F+3=1+2 or%F=0 i.e%vapour pressure of liquid and solid at triple point are same%we get\n",
+ "# -(1640/T)+10.56 = -(1159/T)+7.769\n",
+ "\n",
+ "# Calculations\n",
+ "T = (1640-1159)/(10.56-7.769)\t\t\t#[K]\n",
+ "P = 10**((-1640/T)+10.56)\t\t\t#[torr]\n",
+ "\n",
+ "# Results\n",
+ "print \" The temperature is %f K\"%T\n",
+ "print \" The pressure is %f torr (or mm Hg)\"%P\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The temperature is 172.339663 K\n",
+ " The pressure is 11.063907 torr (or mm Hg)\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.11 Page number - 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of value of R Cp0 and Cv0\n",
+ "\n",
+ "# Variables\n",
+ "M_O2 = 31.999;\t\t\t#molecular weight of oxygen\n",
+ "M_N2 = 28.014;\t\t\t#molecular weight of nitrogen\n",
+ "Y = 1.4;\t\t\t#molar heat capacities ratio for air\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Molecular weight of air(21 vol% O2 and 79 vol% N2)is given by\n",
+ "M_air = (0.21*M_O2)+(0.79*M_N2)\t\t\t#(vol% = mol%)\n",
+ "\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "R = (R*1/M_air)\t\t\t#[kJ/kg*K]\n",
+ "\n",
+ "print \" The value of universal gas constant (R) = %f kJ/kg-K \"%R\n",
+ "\n",
+ "#Y=Cp0/Cv0 and Cp0-Cv0=R\n",
+ "Cv_0 = R/(Y-1)\t\t\t#[kJ/kg*K] \n",
+ "Cp_0 = Y*Cv_0;\t\t\t#[kJ/kg*K]\n",
+ "print \" The value of Cp_0 for air is %f kJ/kg-K\"%Cp_0\n",
+ "print \" The value of Cv_0 for air is %f kJ/kg-K\"%Cv_0\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of universal gas constant (R) = 0.288172 kJ/kg-K \n",
+ " The value of Cp_0 for air is 1.008601 kJ/kg-K\n",
+ " The value of Cv_0 for air is 0.720429 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.12 Page number - 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molar heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "Y = 1.4;\t\t\t#molar heat capacities ratio for air\n",
+ "R = 8.314;\t\t\t# [J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "Cv_0 = R/(Y-1)\t\t\t# [J/mol*K]\n",
+ "Cp_0 = Y*Cv_0;\t\t\t# [J/mol*K]\n",
+ "\n",
+ "# Results\n",
+ "print \" The molar heat capacity at constant volume (Cv_0) is %f J/mol-K\"%Cv_0\n",
+ "print \" The molar heat capacity at constant pressure (Cp_0) is %f J/mol-K\"%Cp_0\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The molar heat capacity at constant volume (Cv_0) is 20.785000 J/mol-K\n",
+ " The molar heat capacity at constant pressure (Cp_0) is 29.099000 J/mol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.13 Page number - 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of mean heat capacity\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "# Variables\n",
+ "# Cp0=7.7+(0.04594*10**(-2)*T)+(0.2521*10**(-5)*T**(2))-(0.8587*10**(-9)*T**(3))\n",
+ "T_1 = 400.;\t\t\t#[K]\n",
+ "T_2 = 500.;\t\t\t#[K]\n",
+ "\n",
+ "# Calculations\n",
+ "def f(T):\n",
+ " return 7.7+(0.04594*10**(-2)*T)+(0.2521*10**(-5)*T**(2))-(0.8587*10**(-9)*T**(3))\n",
+ "#(C)avg = q/(T_2 - T_1) = 1/(T_2 - T_1)*{(integrate('C'%'T'%T_1%T_2))}\n",
+ "#(Cp0)avg = 1/(T_2 - T_1)*{(integrate('Cp0'%'T'%T_1%T_2))}\n",
+ "Cp0_avg = (1/(T_2 - T_1))*quad(f,T_1,T_2)[0]\n",
+ "\n",
+ "# Results\n",
+ "print \" The mean heat capacity (Cp0_avg) for temerature range of 400 to 500 K is %f cal/mol-K\"%Cp0_avg\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The mean heat capacity (Cp0_avg) for temerature range of 400 to 500 K is 8.340118 cal/mol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 1.14 Page number - 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy of water\n",
+ "\n",
+ "# Variables\n",
+ "#(a)\n",
+ "P_1 = 0.2;\t\t\t# [MPa] - pressure\n",
+ "x_1 = 0.59;\t\t\t# mole fraction\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#From saturated steam tables at 0.2 MPa\n",
+ "H_liq_1 = 504.7;\t\t\t# [kJ/kg] - Enthalpy of saturated liquid\n",
+ "H_vap_1 = 2706.7;\t\t\t# [kJ/kg]- Enthalpy of saturated vapour\n",
+ "H_1 = (H_liq_1*(1-x_1))+(x_1*H_vap_1)\t\t\t# [kJ/kg]\n",
+ "print \" (a).Enthalpy of 1 kg of water in tank is %f kJ/kg\"%H_1\n",
+ "\n",
+ "#(b)\n",
+ "T_2 = 120.23;\t\t\t# [C] - temperature\n",
+ "V_2 = 0.6;\t\t\t# [m**(3)/kg] - specific volume\n",
+ "\n",
+ "#From saturated steam tables at 120.23 C% as reported in the book\n",
+ "V_liq_2=0.001061;\t\t\t# [m**(3)/kg]\n",
+ "V_vap_2=0.8857;\t\t\t# [m**(3)/kg]\n",
+ "#since V_2 < Vv_2%dryness factor will be given by% V = ((1-x)*V_liq)+(x*V_vap)\n",
+ "x_2 = (V_2- V_liq_2)/(V_vap_2 - V_liq_2)\n",
+ "\n",
+ "#From steam table%at 120.2 C%the vapour pressure of water is 0.2 MPa.So%enthalpy is given by\n",
+ "H_2 = (H_liq_1*(1-x_2))+(H_vap_1*x_2)\t\t\t#kJ/kg]\n",
+ "print \" (b).Enthalpy of saturated steam is %f kJ/kg\"%H_2\n",
+ "\n",
+ "#(c)\n",
+ "P_3 = 2.5;\t\t\t#[MPa]\n",
+ "T_3 = 350;\t\t\t#[C]\n",
+ "#From steam tables at 2.5 MPa%T_sat = 223.99 C%as reported in the book\n",
+ "#since%T_3 > Tsat% steam is superheated\n",
+ "print \" (c).As steam is superheated%from steam table%enthalpy (H) is 3126.3 kJ/kg\"\n",
+ "\n",
+ "#(d)\n",
+ "T_4 = 350;\t\t\t#[C]\n",
+ "V_4 = 0.13857;\t\t\t#[m**(3)/kg]\n",
+ "#From steam table%at 350 C% V_liq = 0.001740 m**(3)/kg and V_vap = 0.008813 m**(3)/kg.Since%V > V_vap%therefore it is superheated.\n",
+ "#From steam table at 350 C and 1.6 MPa% V = 0.17456 m**(3)/kg\n",
+ "#At 350 C and 2.0 MPa% V = 0.13857 m**(3)/kg. So%\n",
+ "print \" (d).The enthalpy of superheated steam (H) is 3137.0 kJ/kg\"\n",
+ "\n",
+ "#(e)\n",
+ "P_4 = 2.0;\t\t\t#[MPa]\n",
+ "U_4 = 2900;\t\t\t# [kJ/kg] - internal energy\n",
+ "#From saturated table at 2.0 MPa% U_liq = 906.44kJ and U_vap = 2600.3 kJ/kg\n",
+ "#scince%U_4 > Uv% it is saturated.\n",
+ "#From superheated steam table at 2.0 MPa and 350 C% as reported in the book\n",
+ "U_1 = 2859.8;\t\t\t#[kJ/kg]\n",
+ "H_1 = 3137.0;\t\t\t#[kJ/kg]\n",
+ "#At 2.0 MPa and 400 C%\n",
+ "U_2 = 2945.2;\t\t\t#[kJ/kg]\n",
+ "H_2 = 3247.6;\t\t\t#[kJ/kg]\n",
+ "T = (((U_4 - U_1)/(U_2 - U_1))*(400 - 350)) + 350;\t\t\t#[C] - By interpolation\n",
+ "H = (((T - 350)/(400 - 350))*(H_2 - H_1)) + H_1;\t\t\t#[kJ/kg]\n",
+ "print \" (e).The enthalpy value (of superheated steam) obtained after interpolation is %f kJ/kg\"%H\n",
+ "\n",
+ "#(f)\n",
+ "P_5 = 2.5;\t\t\t#[MPa]\n",
+ "T_5 = 100;\t\t\t#[C]\n",
+ "#At 100 C%P_sat=101350 N/m**(2). Since P_5 > P_sat%it is compressed liquid\n",
+ "P_sat = 0.101350;\t\t\t#[MPa]\n",
+ "H_liq = 419.04;\t\t\t#[kJ/kg] - At 100 C and 0.10135 MPa\n",
+ "V_liq = 0.001044;\t\t\t#[m**(3)/kg] - At 100 C and 0.10135 MPa\n",
+ "H_0 = H_liq + (V_liq*(P_5 - P_sat))*1000;\t\t\t#kJ/kg]\n",
+ "print \" (f).The enthalpy of compressed liquid is %f kJ/kg\"%H_0\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a).Enthalpy of 1 kg of water in tank is 1803.880000 kJ/kg\n",
+ " (b).Enthalpy of saturated steam is 1995.549576 kJ/kg\n",
+ " (c).As steam is superheated%from steam table%enthalpy (H) is 3126.3 kJ/kg\n",
+ " (d).The enthalpy of superheated steam (H) is 3137.0 kJ/kg\n",
+ " (e).The enthalpy value (of superheated steam) obtained after interpolation is 3189.062295 kJ/kg\n",
+ " (f).The enthalpy of compressed liquid is 421.544191 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch2_2.ipynb b/Chemical_Engineering_Thermodynamics/ch2_2.ipynb
new file mode 100644
index 00000000..659ed555
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch2_2.ipynb
@@ -0,0 +1,1310 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Chapter 2 : Equations of state"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.2 Page number - 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of acentric factor\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "Tc = 647.1;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 220.55;\t\t#[bar] - Critical pressure\n",
+ "Tr = 0.7;\t\t\t# Reduced temperature\n",
+ "\n",
+ "# Calculations\n",
+ "T = Tr*Tc;\t\t\t#[K]\n",
+ "\t\t\t#From steam table%vapour pressure of H2O at T is 10.02 [bar]% as reported in the book\n",
+ "P = 10.02;\t\t\t#[bar]\n",
+ "w = -1-math.log10((P/Pc))\n",
+ "\n",
+ "# Results\n",
+ "print \" The acentric factor (w) of water at given condition is %f \"%w\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The acentric factor (w) of water at given condition is 0.342639 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.3 Page number - 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of acentric factor\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t#math.log10(Psat)=8.1122-(1592.864/(t+226.184))\t\t\t# 'Psat' in [mm Hg] and 't' in [c]\n",
+ "Tc = 513.9;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 61.48;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Tr = 0.7;\t\t\t# Reduced temperature\n",
+ "\n",
+ "# Calculations\n",
+ "T = Tr*Tc;\t\t\t#[K] - Temperature\n",
+ "T = T - 273.15;\t\t\t#[C]\n",
+ "P_sat = 10**(8.1122 - (1592.864/(T + 226.184)))\t\t\t#[mm Hg]\n",
+ "P_sat = (P_sat/760)*101325;\t\t\t#[N/m**(2)]\n",
+ "Pr_sat = P_sat/Pc;\n",
+ "w = -1-math.log10(Pr_sat)\t\t\t# Acentric factor\n",
+ "\n",
+ "# Results\n",
+ "print \" The acentric factor (w) for ethanol at given condition is %f\"%w\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The acentric factor (w) for ethanol at given condition is 0.644493\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.4 Page number - 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of virial coefficients\n",
+ "\n",
+ "# Variables\n",
+ "T = 380;\t\t\t#[K] - Temperature\n",
+ "Tc = 562.1;\t\t\t#[K] - Critical temperature\n",
+ "P = 7;\t\t\t#[atm] - Pressure\n",
+ "P = P*101325;\t\t\t#[N/m**(2)]\n",
+ "Pc = 48.3;\t\t\t#[atm] - Critical pressure\n",
+ "Pc = Pc*101325;\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "w = 0.212;\t\t\t# acentric factor\n",
+ "Tr = T/Tc;\t\t\t# Reduced temperature\n",
+ "\n",
+ "# Calculations and Results\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6))\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2))\n",
+ "\n",
+ "\t\t\t#We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "print \" The second virial coefficient for benzene is %e m**(3)/mol\"%B\n",
+ "\n",
+ "\t\t\t#Compressibility factor is given by\n",
+ "Z = 1 + ((B*P)/(R*T))\n",
+ "print \" The compressibility factor at 380 K is %f\"%Z\n",
+ "\n",
+ "\t\t\t#We know thar Z=(P*V)/(R/*T)%therfore\n",
+ "V = (Z*R*T)/P;\t\t\t#[m**(3)/mol]\n",
+ "print \" The molar volume is %e m**(3)/mol\"%V\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The second virial coefficient for benzene is -8.267963e-04 m**(3)/mol\n",
+ " The compressibility factor at 380 K is 0.814382\n",
+ " The molar volume is 3.627499e-03 m**(3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.5 Page number - 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of mass using virial equation of state\n",
+ "\n",
+ "# Variables\n",
+ "V_1 = 0.3;\t\t\t#[m**(3)]\t\t\t#volume of cylinder\n",
+ "T = 60+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 130*10**(5)\t\t\t#[N/m**(2)] - Pressure\n",
+ "Tc = 305.3;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 48.72*10**(5)\t\t\t#[N/m**(2)] - Critical pressure\n",
+ "w = 0.100;\t\t\t#acentric factor\n",
+ "M = 30.07;\t\t\t#molecular weight of ethane\n",
+ "Tr = T/Tc;\t\t\t# Reduced temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6))\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2))\n",
+ "\n",
+ "\t\t\t#We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B = ((B_0 + (w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "Z = 1 + ((B*P)/(R*T))\t\t\t#Compressibility factor\n",
+ "V = (Z*R*T)/P;\t\t\t#[m**(3)/mol] - Molar volume\n",
+ "\n",
+ "\t\t\t#No.of moles in 0.3 m**(3) cylinder is given by\n",
+ "n1 = V_1/V;\t\t\t#[mol]\n",
+ "\n",
+ "\t\t\t#Mass of gas in cylinder is given by \n",
+ "m1 = (n1*M)/1000.;\t\t\t#[kg]\n",
+ "print \" Under actual conditions, the mass of ethane is, %f kg\"%m1\n",
+ "\n",
+ "\t\t\t#Under ideal condition% taking Z = 1%\n",
+ "V_ideal = (R*T)/P;\t\t\t#[m**(3)/mol]\n",
+ "n2 = V_1/V_ideal;\t\t\t#[mol]\n",
+ "m2 = (n2*M)/1000;\t\t\t#[kg]\n",
+ "print \" Under ideal conditions,the mass of ethane is, %f kg\"%m2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Under actual conditions, the mass of ethane is, 136.395203 kg\n",
+ " Under ideal conditions,the mass of ethane is, 42.339741 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.6 Page number - 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molar volume\n",
+ "\n",
+ "# Variables\n",
+ "T = 373.15;\t\t\t#[K] - Temperature\n",
+ "P = 101325;\t\t\t#[N/m**(2)] - Pressure\n",
+ "Tc = 647.1;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 220.55*10**(5)\t#[N/m**(2)] - Critical pressure\n",
+ "w = 0.345;\t\t\t#acentric factor\n",
+ "Tr = T/Tc;\t\t\t# Reduced temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - UNiversal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6))\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2))\n",
+ "\n",
+ "\t\t\t#We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol] - Second virial coefficient\n",
+ "\n",
+ "\t\t\t#We have% Z = 1+(B/V) and Z = (P*V)/(R*T). Substituting the value of Z%we get\n",
+ "\t\t\t# V**(2)-((R*T)/P)*V-((B*R*T)/P)=0 .Solving the quadratic equation by shreedharcharya rule\n",
+ "V1 = (((R*T)/P) + (((R*T)/P)**(2) + 4*1*((B*R*T)/P))**(1./2))/2*1;\n",
+ "\n",
+ "# Results\n",
+ "print \" The molar volume of water vapour is %f m**(3)/mol\"%V1\n",
+ "\n",
+ "\t\t\t#The roots are%V1 = 0.0003670 [m**(3)/mol] and V2 = 0.0302510 [m**(3)/mol].\n",
+ "\t\t\t#As 'V2' is near to ideal volume (0.030618 [m**(3)/mol])%it is taken as the molar volume\n",
+ "\t\t\t#The other root 'V1' hss no physical significance\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The molar volume of water vapour is 0.030251 m**(3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.7 Page number - 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molar volume and virial coefficients\n",
+ "\n",
+ "# Variables\n",
+ "T = 50+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 15*10**(5)\t\t\t#[N/m**(2)] - Pressure\n",
+ "Tc = 305.3;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 48.72*10**(5)\t\t\t#[N/m**(2)] - Critical pressure\n",
+ "w = 0.100;\t\t\t# Acentric factor\n",
+ "B = -157.31;\t\t\t#[cm**(3)/mol] - second virial coefficient\n",
+ "B = B*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "C = 9650;\t\t\t#[cm**(6)/mol**(2)] - third virial coefficient\n",
+ "C = C*10**(-12)\t\t\t#[cm**(6)/mol**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (1)\n",
+ "V_1 = (R*T)/P;\t\t\t#[m**(3)/mol] - Molar volume\n",
+ "print \" (1).The molar volume for ideal equation of state is %e m**(3)/mol\"%V_1\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "Tr = T/Tc;\t\t\t# Reduced temperature\n",
+ "\t\t\t# At this temperature\n",
+ "B_0 = 0.083-(0.422/(Tr)**(1.6))\n",
+ "B_1 = 0.139-(0.172/(Tr)**(4.2))\n",
+ "\n",
+ "\t\t\t# We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_2 = ((B_0 + (w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\t\t\t#second virial coefficient\n",
+ "print \" (2).The second virial coefficent using Pitzer correlation is \\\n",
+ "found to be %e m**(3)/mol which is same as given value\"%B_2\n",
+ "\n",
+ "\t\t\t# (3)\n",
+ "\t\t\t# Given (virial equation)%Z=1+(B/V)\n",
+ "V_3 = B + (R*T)/P;\t\t\t#[m**(3)/mol] - Molar volume\n",
+ "print \" (3).The molar volume using virial equation of state is %e m**(3)/mol\"%V_3\n",
+ "\n",
+ "\t\t\t# (4)\n",
+ "\t\t\t# Given (virial equation)%Z = 1 + ((B*P)/(R*T)) + ((C - B**(2))/(R*T)**(2))*P**(2)\n",
+ "V_4 = B + (R*T)/P + ((C - B**(2))/(R*T))*P;\t\t\t# [m**(3)/mol]\n",
+ "print \" (4).The molar volume using given virial equation of state is %e m**(3)/mol\"%V_4\n",
+ "\n",
+ "\t\t\t# (5)\n",
+ "\t\t\t# Given%Z = 1 + (B/V)\n",
+ "\t\t\t# Also%Z = (P*V)/(R*T). Substituting the value of Z%we get\n",
+ "\t\t\t# V**(2)-((R*T)/P)*V-((B*R*T)/P)=0.Solving the quadratic equation\n",
+ "from scipy.optimize import fsolve\n",
+ "def f(V):\n",
+ " global R,T,P,B\n",
+ " return V**(2)-((R*T)/P)*V-((B*R*T)/P)\n",
+ "V_5_1 = fsolve(f,0)\n",
+ "V_5_2 = fsolve(f,1)\n",
+ "\n",
+ "print \" (5).The molar volume using given virial equation of state is %e m**(3)/mol\"%V_5_2\n",
+ "\n",
+ "\t\t\t# The roots are%V_5_1=0.0001743 [m**(3)/mol] and V_5_2=0.0016168 [m**(3)/mol].\n",
+ "\t\t\t# As 'V_2' is near to ideal volume (0.0017911 [m**(3)/mol])%it is taken as the molar volume\n",
+ "\n",
+ "\t\t\t# (6)\n",
+ "\t\t\t# Given%Z = 1 + (B/V) + (C/V**(2))\n",
+ "\t\t\t# Also%Z = (P*V)/(R*T). Substituting the value of Z%we get\n",
+ "\t\t\t# V**(3)-((R*T)/P)*V**(2)-((B*R*T)/P)*V-((C*R*T)/P)=0. Solving the cubic equation\n",
+ "def f1(V):\n",
+ " global P,R,T,B,C\n",
+ " return V**(3)-((R*T)/P)*V**(2)-((B*R*T)/P)*V-((C*R*T)/P)\n",
+ " \n",
+ "V_6_3=fsolve(f1,-1)\n",
+ "V_6_4=fsolve(f1,0)\n",
+ "V_6_5=fsolve(f1,1)\n",
+ "\t\t\t#The above equation has 1 real and 2 imaginary roots. We consider only real root.\n",
+ "print \" (6).The molar volume using given virial equation of state is %e m**(3)/mol\"%V_6_5\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (1).The molar volume for ideal equation of state is 1.791113e-03 m**(3)/mol\n",
+ " (2).The second virial coefficent using Pitzer correlation is found to be -1.573258e-04 m**(3)/mol which is same as given value\n",
+ " (3).The molar volume using virial equation of state is 1.633803e-03 m**(3)/mol\n",
+ " (4).The molar volume using given virial equation of state is 1.625374e-03 m**(3)/mol\n",
+ " (5).The molar volume using given virial equation of state is 1.616848e-03 m**(3)/mol"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (6).The molar volume using given virial equation of state is 1.624187e-03 m**(3)/mol\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/home/jovina/virtualenvs/scipy/local/lib/python2.7/site-packages/scipy/optimize/minpack.py:236: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.8 Page number - 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of second and third virial coefficients\n",
+ "\n",
+ "# Variables\n",
+ "T = 0 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "from numpy import linalg,array\n",
+ "from scipy.stats import linregress\n",
+ "\t\t\t#Virial equation of state% Z=1+(B/V)+(C/V**(2))\n",
+ "\t\t\t#From above equation we get (Z-1)*V=B+(C/V)\n",
+ "\n",
+ "P=[50,100,200,400,600,1000];\n",
+ "Z=[0.9846,1.0000,1.0365,1.2557,1.7559,2.0645];\n",
+ "V=[0,0,0,0,0,0]\n",
+ "k= []\n",
+ "t=array([0,0,0,0,0,0])\n",
+ "\n",
+ "# Calculations\n",
+ "for i in range(6):\n",
+ " V[i]=(Z[i]*R*T)/(P[i]*101325.)\t\t\t#[m**(3)/mol]\n",
+ " k.append((Z[i]-1.)*V[i])\n",
+ " t[i]=1./V[i]\n",
+ " \n",
+ "k = array(k)\n",
+ "\n",
+ "\t\t\t#w = linalg.lstsq(t.T,k.T)\n",
+ "\t\t\t#[C,B,sig]=reglin(t',k')\n",
+ "C,B,c,d,e = linregress(t.T,k.T)\n",
+ "\n",
+ "# Results\n",
+ "#From the regression% we get intercept=B and slope=C%and thus%\n",
+ "print \" The value of second virial coefficient (B) is %e m**(3)/mol\"%B\n",
+ "print \" The value of third virial coefficient (C) is %e m**(6)/mol**(2)\"%C\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of second virial coefficient (B) is -1.563305e-05 m**(3)/mol\n",
+ " The value of third virial coefficient (C) is 3.133359e-09 m**(6)/mol**(2)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.9 Page number - 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of second virial coefficient\n",
+ "\n",
+ "# Variables\n",
+ "T = 444.3;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "B_11 = -8.1;\t\t\t#[cm**(3)/mol]\n",
+ "B_11 = -8.1*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "B_22 = -293.4*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "y1 = 0.5;\t\t\t# mole fraction \t\t\t# equimolar mixture\n",
+ "y2 = 0.5;\n",
+ "\n",
+ "# For component 1 (methane)\n",
+ "Tc_1 = 190.6;\t\t\t#[K] - cricitical temperature\n",
+ "Vc_1 = 99.2;\t\t\t#[cm**(3)/mol] - cricitical molar volume\n",
+ "Zc_1 = 0.288;\t\t\t# critical compressibility factor\n",
+ "w_1 = 0.012;\t\t\t# acentric factor\n",
+ "\n",
+ "# For component 2 (n-butane)\n",
+ "Tc_2 = 425.2;\t\t\t#[K]\n",
+ "Vc_2 = 255.0;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_2 = 0.274;\n",
+ "w_2 = 0.199;\n",
+ "\n",
+ "# Calculations\n",
+ "#Using virial mixing rule%we get\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1./2)\t\t\t#[K]\n",
+ "w_12 = (w_1 + w_2)/2.;\n",
+ "Zc_12 = (Zc_1+Zc_2)/2.;\n",
+ "Vc_12 = (((Vc_1)**(1./3) + (Vc_2)**(1./3))/2.)**(3)\t\t\t#[cm**(3)/mol]\n",
+ "Vc_12 = Vc_12*10**(-6)\t\t\t#[cm**(3)/mol]\n",
+ "Pc_12 = (Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "Tr_12 = T/Tc_12;\t\t\t#Reduced temperature\n",
+ "B_0 = 0.083 - (0.422/(Tr_12)**(1.6))\n",
+ "B_1 = 0.139 - (0.172/(Tr_12)**(4.2))\n",
+ "\n",
+ "\t\t\t#We know%(B_12*Pc_12)/(R*Tc_12) = B_0 + (w_12*B_1)\n",
+ "B_12 = ((B_0+(w_12*B_1))*(R*Tc_12))/Pc_12;\t\t\t#[m**(3)/mol] - Cross coefficient\n",
+ "B = y1**(2)*B_11+2*y1*y2*B_12+y2**(2)*B_22;\t\t\t#[m**(3)/mol] - Second virial coefficient for mixture\n",
+ "B = B*10**(6)\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The second virial coefficient,(B) for the mixture of gas is %f cm**(3)/mol\"%B\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The second virial coefficient,(B) for the mixture of gas is -108.309380 cm**(3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 2.10 Page number - 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of molar volume\n",
+ "\n",
+ "# Variables\n",
+ "T = 71+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 69*10**(5)\t\t\t#[N/m**(2)] - Pressure\n",
+ "y1 = 0.5;\t\t\t#[mol] - mole fraction of equimolar mixture\n",
+ "y2 = 0.5;\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t#For component 1 (methane)\n",
+ "Tc_1 =190.6;\t\t\t#[K] - Critical temperature\n",
+ "Pc_1 = 45.99*10**(5)\t\t\t#[N/m**(2)] - Critical pressure\n",
+ "Vc_1 = 98.6;\t\t\t#[cm**(3)/mol] - Critical volume\n",
+ "Zc_1 = 0.286;\t\t\t# Critical compressibility factor\n",
+ "w_1 = 0.012;\t\t\t# acentric factor\n",
+ "\n",
+ "\t\t\t#For component 2 (hydrogen sulphide)\n",
+ "Tc_2 = 373.5;\t\t\t#[K]\n",
+ "Pc_2 = 89.63*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Vc_2 = 98.5;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_2 = 0.284;\n",
+ "w_2 = 0.094;\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#For component 1\n",
+ "Tr_1 = T/Tc_1;\t\t\t#Reduced temperature\n",
+ "\t\t\t#At reduced temperature\n",
+ "B1_0 = 0.083-(0.422/(Tr_1)**(1.6))\n",
+ "B1_1 = 0.139-(0.172/(Tr_1)**(4.2))\n",
+ "\t\t\t#We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_11 = ((B1_0+(w_1*B1_1))*(R*Tc_1))/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#Similarly for component 2\n",
+ "Tr_2 = T/Tc_2;\t\t\t#Reduced temperature\n",
+ "\t\t\t#At reduced temperature Tr_2%\n",
+ "B2_0 = 0.083 - (0.422/(Tr_2)**(1.6))\n",
+ "B2_1 = 0.139 - (0.172/(Tr_2)**(4.2))\n",
+ "B_22 = ((B2_0+(w_2*B2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For cross coeffcient\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1./2)\t\t\t#[K]\n",
+ "w_12 = (w_1 + w_2)/2;\n",
+ "Zc_12 = (Zc_1 + Zc_2)/2;\n",
+ "Vc_12 = (((Vc_1)**(1./3) + (Vc_2)**(1./3))/2)**(3)\t\t\t#[cm**(3)/mol]\n",
+ "Vc_12 = Vc_12*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "Pc_12 = (Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "\t\t\t#Now we have%(B_12*Pc_12)/(R*Tc_12) = B_0+(w_12*B_1)\n",
+ "\t\t\t#where B_0 and B_1 are to be evaluated at Tr_12\n",
+ "Tr_12 = T/Tc_12;\n",
+ "\t\t\t#At reduced temperature Tr_12\n",
+ "B_0 = 0.083 - (0.422/(Tr_12)**(1.6))\n",
+ "B_1 = 0.139 - (0.172/(Tr_12)**(4.2))\n",
+ "B_12=((B_0 + (w_12*B_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For the mixture\n",
+ "B = y1**(2)*B_11+2*y1*y2*B_12 + y2**(2)*B_22;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#Now given virial equation is% Z=1+(B*P)/(R*T)\n",
+ "Z = 1 + (B*P)/(R*T)\n",
+ "\n",
+ "\t\t\t#Also Z = (P*V)/(R*T).Therefore%\n",
+ "V = (Z*R*T)/P;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The molar volume of the mixture is %e m**(3)/mol\"%V\n",
+ "\t\t\t#The value obtained is near the math.experimental value of V_math.exp = 3.38*10**(-4) m**(3)/mol\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The molar volume of the mixture is 3.390411e-04 m**(3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.11 Page number - 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of maximum temperature\n",
+ "\n",
+ "# Variables\n",
+ "P = 6.*10**(6)\t\t\t# [Pa] - Pressure\n",
+ "P_max = 12.*10**(6)\t\t\t# [Pa] - Max pressure to which cylinder may be math.exposed\n",
+ "T = 280.;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1).Assuming ideal gas behaviour%\n",
+ "V_ideal = (R*T)/P;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t#Now when temperature and pressure are increased%the molar volume remains same%as total volume and number of moles are same.\n",
+ "\t\t\t#For max pressure of 12 MPa%temperature is\n",
+ "T_max_ideal = (P_max*V_ideal)/R;\n",
+ "print \" (1).The maximum temperature assuming ideal behaviour is %f K\"%T_max_ideal\n",
+ "\n",
+ "\t\t\t# (2).Assuming virial equation of state\n",
+ "\t\t\t# For component 1 (methane)%at 280 K\n",
+ "Tc_1 = 190.6;\t\t\t#[K]\n",
+ "Pc_1 = 45.99*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Vc_1 = 98.6;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_1 = 0.286;\n",
+ "w_1 = 0.012;\n",
+ "Tr_1 = T/Tc_1;\t\t\t#Reduced temperature\n",
+ "B1_0 = 0.083 - (0.422/(Tr_1)**(1.6))\n",
+ "B1_1 = 0.139 - (0.172/(Tr_1)**(4.2))\n",
+ "\n",
+ "\t\t\t#We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_11 = ((B1_0 + (w_1*B1_1))*(R*Tc_1))/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For component 2 (Propane)\n",
+ "Tc_2 = 369.8;\t\t\t#[K]\n",
+ "Pc_2 = 42.48*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Vc_2 = 200;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_2 = 0.276;\n",
+ "w_2 = 0.152;\n",
+ "Tr_2 = T/Tc_2;\t\t\t# Reduced temperature\n",
+ "B2_0 = 0.083 - (0.422/(Tr_2)**(1.6))\n",
+ "B2_1 = 0.139 - (0.172/(Tr_2)**(4.2))\n",
+ "B_22 = ((B2_0 + (w_2*B2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For cross coeffcient\n",
+ "y1 = 0.8;\t\t\t#mole fraction of component 1\n",
+ "y2 = 0.2;\t\t\t#mole fraction of component 2\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1/2.)\t\t\t#[K]\n",
+ "w_12 = (w_1 + w_2)/2;\n",
+ "Zc_12 = (Zc_1 + Zc_2)/2;\n",
+ "Vc_12 = (((Vc_1)**(1./3) + (Vc_2)**(1./3))/2)**(3)\t\t\t#[cm**(3)/mol]\n",
+ "Vc_12 = Vc_12*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "Pc_12 = (Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "Tr_12 = T/Tc_12;\n",
+ "\n",
+ "\t\t\t#At reduced temperature%Tr_12%\n",
+ "B_0 = 0.083 - (0.422/(Tr_12)**(1.6))\n",
+ "B_1 = 0.139 - (0.172/(Tr_12)**(4.2))\n",
+ "B_12 = ((B_0 + (w_12*B_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For the mixture\n",
+ "B = y1**(2)*B_11+2*y1*y2*B_12 + y2**(2)*B_22;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#Now given virial equation is% Z=1+(B*P)/(R*T)\n",
+ "Z = 1 + (B*P)/(R*T)\n",
+ "\t\t\t#Also Z = (P*V)/(R*T).Therefore%\n",
+ "V_real = (Z*R*T)/P;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t# This molar volume remains the same as the volume and number of moles remains fixed.\n",
+ "\t\t\t# Sice Z is a function of presure and temperature%we shall assume a temperature%calculate Z and again calculate temperature%till convergence is obtained.\n",
+ "\t\t\t# We will use the concept of iteration to compute the convergent value of temperature\n",
+ "\t\t\t# Let us start with the temperature at ideal conditions i.e T = 560 K%\n",
+ "\n",
+ "T_prime = 560.;\t\t\t#[K]\n",
+ "fault = 10.;\n",
+ "\n",
+ "while(fault > 1):\n",
+ " T_prime_r1 = T_prime/Tc_1;\n",
+ " B_prime1_0 = 7.7674*10**(-3)\n",
+ " B_prime1_1 = 0.13714;\n",
+ " B_prime_11 = ((B_prime1_0 + (w_1*B_prime1_1))*(R*Tc_1))/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ " \t\t\t#Similarly for component 2%\n",
+ " T_prime_r2 = T_prime/Tc_2;\n",
+ " B_prime2_0 = -0.1343;\n",
+ " B_prime2_1 = 0.10887;\n",
+ " B_prime_22 = ((B_prime2_0 + (w_2*B_prime2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ " \t\t\t#For cross coefficient (assuming k12=0)\n",
+ " \t\t\t#Tc_12 % w_12 % Zc_12 % Vc_12 and Pc_12 have already been calculated above%now\n",
+ " T_prime_r12 = T_prime/Tc_12;\t\t\t#\n",
+ " \t\t\t#At reduced temperature%T_prime_r12%\n",
+ " B_prime_0 = 0.083 - (0.422/(T_prime_r12)**(1.6))\n",
+ " B_prime_1 = 0.139 - (0.172/(T_prime_r12)**(4.2))\n",
+ " B_prime_12 = ((B_prime_0+(w_12*B_prime_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ " \t\t\t#For the mixture\n",
+ " B_prime = y1**(2)*B_prime_11 + 2*y1*y2*B_prime_12 + y2**(2)*B_prime_22;\t\t\t#[m**(3)/mol]\n",
+ " Z_prime = 1 + (B_prime*P_max)/(R*T_prime)\n",
+ " T_new = (P_max*V_real)/(Z_prime*R)\n",
+ " fault = abs(T_prime - T_new)\n",
+ " T_prime = T_new;\n",
+ "\n",
+ "print \" (2).The maximum temperature assuming the gas to follow virial equation of state is %f K\"%T_new\n",
+ "\n",
+ "# Note : Answers varies because of rounding error. Please check it manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (1).The maximum temperature assuming ideal behaviour is 560.000000 K\n",
+ " (2).The maximum temperature assuming the gas to follow virial equation of state is 440.112497 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.12 Page number - 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure\n",
+ "\n",
+ "# Variables\n",
+ "\n",
+ "V_vessel = 0.1;\t\t\t#[m**(3)]\t\t\t# Volume of vessel\n",
+ "T = 25 + 273.15;\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "m = 25*1000;\t\t\t#[g]\t\t\t# Mass of ethylene\n",
+ "Tc = 282.3;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 50.40;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Zc = 0.281;\t\t\t# Critical compressibility factor\n",
+ "Vc = 131;\t\t\t#[cm**(3)/mol] - Critical volume\n",
+ "Vc = Vc*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "w = 0.087;\t\t\t# Acentric factor\n",
+ "M = 28.054;\t\t\t# Molecular weight of ethylene\n",
+ "\n",
+ "# Calculations\n",
+ "n = m/M;\t\t\t#[mole] - No. of moles of ethylene\n",
+ "V = V_vessel/n;\t\t#[m**(3)/mol] - Molar volume\n",
+ "\n",
+ "\t\t\t#Under Redlich Kwong equation of state% we have\n",
+ "a = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "P = ((R*T)/(V-b))-(a/(T**(1./2)*V*(V+b)))\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "# Results\n",
+ "print \" The required pressure using Redlich Kwong equation of state is %e N/m**(2)\"%P\n",
+ "\n",
+ "\t\t\t#For ideal gas equation of state%\n",
+ "P_ideal = (R*T)/V;\t\t\t#[N/m**(2)]\n",
+ "print \" For ideal gas equation of state,the required pressure is %e N/m**(2)\"%P_ideal\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The required pressure using Redlich Kwong equation of state is 7.934745e+06 N/m**(2)\n",
+ " For ideal gas equation of state,the required pressure is 2.208971e+07 N/m**(2)\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.13 Page number - 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure\n",
+ "\n",
+ "# Variables\n",
+ "\n",
+ "V_vessel = 360*10**(-3)\t\t\t#[m**(3)] - volume of vessel\n",
+ "T = 62+273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "m = 70.*1000;\t\t\t#[g]/ - Mass of carbon dioxide\n",
+ "\n",
+ "\t\t\t#For carbon dioxide\n",
+ "Tc = 304.2;\t\t\t#[K] - Cricitical temperature\n",
+ "Pc = 73.83;\t\t\t#[bar] - Cricitical pressure\n",
+ "Pc = Pc*10**(5)\t\t\t# [N/m**(2)]\n",
+ "Zc = 0.274;\t\t\t# Critical compressibility factor\n",
+ "Vc = 94.0;\t\t\t#[cm**(3)/mol]\n",
+ "Vc = Vc*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "w = 0.224;\t\t\t# Acentric factor\n",
+ "M = 44.01;\t\t\t# Molecular weight of carbon dioxide\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n = m/M;\t\t\t#[mol] - No. of moles\n",
+ "V = V_vessel/n;\t\t\t#[m**(3)/mol]\t\t\t#molar volume\n",
+ "\n",
+ "\t\t\t# (1)\n",
+ "\t\t\t# Ideal gas behaviour\n",
+ "P_1 = (R*T)/V;\t\t\t#[N/m**(2)]\n",
+ "print \" (1).The required pressure using ideal equation of state is %e N/m**(2)\"%P_1\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "\t\t\t# Virial equation of state% Z = 1 + (B*P)/(R*T)\n",
+ "\t\t\t# (P*V)/(R*T) = 1 + (B*P)/(R*T)% and thus P = (R*T)/(V - B). Now\n",
+ "Tr = T/Tc;\t\t\t#Reduced temperature\n",
+ "\t\t\t# At reduced temperature Tr%\n",
+ "B_0 = 0.083 - (0.422/(Tr)**(1.6))\n",
+ "B_1 = 0.139 - (0.172/(Tr)**(4.2))\n",
+ "B = ((B_0 + (w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "P_2 = (R*T)/(V - B)\t\t\t#[N/m**(2)]\n",
+ "print \" (2).The required pressure using given virial equation of state is %e N/m**(2)\"%P_2\n",
+ "\n",
+ "\t\t\t# (3)\n",
+ "\t\t\t# Virial equation of state% Z = 1 + (B/V)\n",
+ "\t\t\t# (P*V)/(R*T) = 1 + (B/V)\n",
+ "P_3 = ((R*T)/V) + (B*R*T)/(V**(2))\t\t\t#[N/m**(2)]\n",
+ "print \" (3).The required pressure using given virial equation of state is %e N/m**(2)\"%P_3\n",
+ "\n",
+ "\t\t\t# (4)\n",
+ "\t\t\t# Van der Walls equation of state%P = ((R*T)/(V-b)) - a/(V**(2))\n",
+ "a = (27*(R**(2))*(Tc**(2)))/(64*Pc)\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc)\t\t\t#[m**(3)/mol]\n",
+ "P_4 = ((R*T)/(V-b)) - a/(V**(2))\t\t\t#[N/m**(2)]\n",
+ "print \" (4).The required pressure using van der Walls equation of state is %e N/m**(2)\"%P_4\n",
+ "\n",
+ "\t\t\t#(5)\n",
+ "\t\t\t# Redlich Kwong equation of state%\n",
+ "a_1 = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b_1 = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "P_5 = ((R*T)/(V - b_1)) - (a_1/(T**(1./2)*V*(V + b_1)))\t\t\t#[N/m**(2)]\n",
+ "print \" (5).The required pressure using Redlich Kwong equation of state is %e N/m**(2)\"%P_5\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (1).The required pressure using ideal equation of state is 1.231100e+07 N/m**(2)\n",
+ " (2).The required pressure using given virial equation of state is 8.712394e+06 N/m**(2)\n",
+ " (3).The required pressure using given virial equation of state is 7.226009e+06 N/m**(2)\n",
+ " (4).The required pressure using van der Walls equation of state is 8.048790e+06 N/m**(2)\n",
+ " (5).The required pressure using Redlich Kwong equation of state is 8.079803e+06 N/m**(2)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.14 Page number - 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of compressibility factor\n",
+ "\n",
+ "# Variables\n",
+ "T = 500+273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "P = 325*1000;\t\t\t#[Pa] - Pressure\n",
+ "Tc = 647.1;\t\t\t#[K] - Cricitical temperature\n",
+ "Pc = 220.55;\t\t\t#[bar] - Cricitical pressure\n",
+ "Pc = Pc*10**(5)\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# Van der Walls equation of state%\n",
+ "a = (27*(R**(2))*(Tc**(2)))/(64*Pc)\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc)\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# The cubic form of van der Walls equation of state is given by%\n",
+ "\t\t\t# V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P=0\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f(V):\n",
+ " global b,R,T,P,a\n",
+ " return V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P\n",
+ "from scipy.optimize import fsolve\n",
+ "V_1 = fsolve(f,1)\n",
+ "V_2 = fsolve(f,10)\n",
+ "V_3 = fsolve(f,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root%\n",
+ "Z_1 = (P*V_1)/(R*T)\t\t\t#compressibility factor\n",
+ "print \" (1).The compressibility factor of steam using van der Walls equation of state is %f\"%Z_1\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\n",
+ "\t\t\t#Redlich Kwong equation of state%\n",
+ "a_1 = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b_1 = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# The cubic form of Redlich Kwong equation of state is given by%\n",
+ "\t\t\t# V**(3)-((R*T)/P)*V**(2)-((b_1**(2))+((b_1*R*T)/P)-(a/(T**(1/2)*P))*V-(a*b)/(T**(1/2)*P)=0\n",
+ "\t\t\t#Solving the cubic equation\n",
+ "def f1(V):\n",
+ " return V**(3)-((R*T)/P)*V**(2)-((b_1**(2))+((b_1*R*T)/P)-(a_1/(T**(1./2)*P)))*V-(a_1*b_1)/(T**(1./2)*P)\n",
+ " \n",
+ "V_4=fsolve(f1,1)\n",
+ "V_5=fsolve(f1,10)\n",
+ "V_6=fsolve(f1,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root%\n",
+ "\t\t\t# Thus compressibility factor is\n",
+ "Z_2 = (P*V_4)/(R*T)\t\t\t#compressibility factor\n",
+ "print \" (2).The compressibility factor of steam using Redlich Kwong equation of state is %f\"%Z_2\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (1).The compressibility factor of steam using van der Walls equation of state is 0.997181\n",
+ " (2).The compressibility factor of steam using Redlich Kwong equation of state is 0.997028\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.15 Page number - 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of molar volume\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 250+273.15;\t\t\t#[K]\n",
+ "R = 8.314;\t\t\t#[J/mol*K]\n",
+ "P = 39.76;\t\t\t#[bar] Vapour pressure of water at T\n",
+ "P = P*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Tc = 647.1;\t\t\t#[K] - Cricitical temperature\n",
+ "Pc = 220.55*10**(5)\t\t\t#[N/m**(2)] - Cricitical pressure\n",
+ "w = 0.345;\t\t\t#Acentric factor\n",
+ "M = 18.015;\t\t\t# Molecular weight of water\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# Using peng-Robinson equation of stste \n",
+ "m = 0.37464 + 1.54226*w - 0.26992*w**(2)\n",
+ "Tr = T/Tc;\n",
+ "alpha = (1 + m*(1 - Tr**(1./2)))**(2)\n",
+ "a = ((0.45724*(R*Tc)**(2))/Pc)*alpha;\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (0.07780*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# Cubuc form of Peng-Robinson equation of stste is given by\n",
+ "\t\t\t# V**(3) + (b-(R*T)/P)*V**(2) - ((3*b**(2)) + ((2*R*T*b)/P) - (a/P))*V+b**(3) + ((R*T*(b**(2))/P) - ((a*b)/P) = 0;\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f(V):\n",
+ " global b,R,T,P,a\n",
+ " return V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2)))/P)-((a*b)/P)\n",
+ "V_1 = fsolve(f,-1)\n",
+ "V_2 = fsolve(f,0)\n",
+ "V_3 = fsolve(f,1)\n",
+ "\t\t\t#The largest root is for vapour phase%\n",
+ "V_vap = V_3;\t\t\t#[m**(3)/mol] - Molar volume (saturated vapour)\n",
+ "V_vap = V_vap*10**(6)/M;\t\t\t#[cm**(3)/g]\n",
+ "\n",
+ "print \" The moar volume of saturated water in the vapour phase (V_vap) is %f cm**(3)/g\"%V_vap\n",
+ "\n",
+ "\t\t\t#The smallest root is for liquid phase%\n",
+ "V_liq = V_1;\t\t\t#[m**(3)/mol] - molar volume (saturated liquid)\n",
+ "V_liq = V_liq*10**(6)/M;\t\t\t#[cm**(3)/g]\n",
+ "print \" The moar volume of saturated water in the liquid phase (V_liq) is %f cm**(3)/g\"%V_liq\n",
+ "\n",
+ "\t\t\t#From steam table at 250 C% V_vap = 50.13 [cm**(3)/g] and V_liq = 1.251 [cm**(3)/g].\n",
+ "print \" From steam table at 250 C, V_vap = 50.13 [cm**(3)/g] and V_liq = 1.251 [cm**(3)/g]\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The moar volume of saturated water in the vapour phase (V_vap) is 51.757097 cm**(3)/g\n",
+ " The moar volume of saturated water in the liquid phase (V_liq) is 1.554560 cm**(3)/g\n",
+ " From steam table at 250 C, V_vap = 50.13 [cm**(3)/g] and V_liq = 1.251 [cm**(3)/g]\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.16 Page number - 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of volume\n",
+ "\n",
+ "# Variables\n",
+ "T = 500+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 15.;\t\t\t#[atm] - Pressure\n",
+ "P = P*101325;\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Tc = 190.6;\t\t\t#[K] - Cricitical temperature\n",
+ "Pc = 45.99*10**(5)\t\t\t#[N/m**(2)] - Cricitical pressure\n",
+ "Vc = 98.6;\t\t\t#[cm**(3)/mol] - Cricitical molar volume\n",
+ "Zc = 0.286;\t\t\t# Critical compressibility factor\n",
+ "w = 0.012;\t\t\t# Acentric factor\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#Virial equation of state%Z = 1 + (B*P)/(R*T)\n",
+ "Tr_1 = T/Tc;\t\t\t#Reduced temperature\n",
+ "B_0 = 0.083-(0.422/(Tr_1)**(1.6))\n",
+ "B_1 = 0.139-(0.172/(Tr_1)**(4.2)) \t\t\t# We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\t\t\t#second virial coefficient\n",
+ "Z = 1 + (B*P)/(R*T)\t\t\t#compressibility factor\n",
+ "\t\t\t#(P*V)/(R*T)=1+(B*P)/(R*T)%and thus%\n",
+ "V_1 = (Z*R*T)/P;\t\t\t#[m**(3)/mol]\n",
+ "print \" (1).The molar volume of methane using given virial equation is %e m**(3)/mol\"%V_1\n",
+ "\n",
+ "\t\t\t#(2).\n",
+ "\t\t\t#Virial equation of state%Z = 1 + (B/V)\n",
+ "\t\t\t#Also%Z = (P*V)/(R*T). Substituting the value of Z%we get\n",
+ "\t\t\t# V**(2) - ((R*T)/P)*V - ((B*R*T)/P) = 0.Solving the quadratic equation\n",
+ "def f(V):\n",
+ " global R,T,P,B\n",
+ " return V**(2)-((R*T)/P)*V-((B*R*T)/P)\n",
+ "V2_1=fsolve(f,0)\n",
+ "V2_2=fsolve(f,1)\n",
+ "\t\t\t# Out of two roots%we will consider only positive root\n",
+ "print \" (2).The molar volume of methane using given virial equation is %e m**(3)/mol\"%V2_2\n",
+ "\n",
+ "\t\t\t# (3)\n",
+ "\t\t\t# Van der Walls equation of state%\n",
+ "\t\t\t# (P + (a/V**(2)))*(V - b) = R*T\n",
+ "a_3 = (27*(R**(2))*(Tc**(2)))/(64*Pc)\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b_3 = (R*Tc)/(8*Pc)\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# The cubic form of van der Walls equation of state is given by%\n",
+ "\t\t\t# V**(3) - (b + (R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f1(V):\n",
+ " global b,R,T,P,a_3\n",
+ " return V**(3)-(b_3+(R*T)/P)*V**(2)+(a_3/P)*V-(a_3*b_3)/P\n",
+ "V3_1=fsolve(f1,1)\n",
+ "V3_2=fsolve(f1,10)\n",
+ "V3_3=fsolve(f1,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root.\n",
+ "print \" (3).The molar volume of methane using van der Walls equation of state is %e m**(3)/mol\"%V3_1\n",
+ "\n",
+ "\t\t\t# (4)\n",
+ "\t\t\t# Redlich Kwong equation of state\n",
+ "a_4 = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b_4 = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# The cubic form of Redlich Kwong equation of state is given by%\n",
+ "\t\t\t# V**(3) - ((R*T)/P)*V**(2) - ((b_1**(2)) + ((b_1*R*T)/P) - (a/(T**(1/2)*P))*V - (a*b)/(T**(1/2)*P) = 0\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f2(V):\n",
+ " global R,T,P,b_4,a_4\n",
+ " return V**(3)-((R*T)/P)*V**(2)-((b_4**(2))+((b_4*R*T)/P)-(a_4/(T**(1./2)*P)))*V-(a_4*b_4)/(T**(1./2)*P)\n",
+ "V4_1=fsolve(f2,1)\n",
+ "V4_2=fsolve(f2,10)\n",
+ "V4_3=fsolve(f2,100)\n",
+ "\t\t\t#The above equation has 1 real and 2 imaginary roots. We consider only real root.\n",
+ "print \" (4).The molar volume of methane using Redlich Kwong equation of state is %e m**(3)/mol\"%V4_1\n",
+ "\n",
+ "\t\t\t# (5)\n",
+ "\t\t\t# Using Peng-Robinson equation of state \n",
+ "m = 0.37464 + 1.54226*w - 0.26992*w**(2)\n",
+ "Tr_5 = T/Tc;\n",
+ "alpha = (1 + m*(1 - Tr_5**(1./2)))**(2)\n",
+ "a = ((0.45724*(R*Tc)**(2))/Pc)*alpha;\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (0.07780*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# Cubic form of Peng-Robinson equation of stste is given by\n",
+ "\t\t\t# V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2))/P)-((a*b)/P)=0;\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f3(V):\n",
+ " global b,R,T,P,a\n",
+ " return V**(3)+(b-(R*T)/P)*V**(2)-((3*b**(2))+((2*R*T*b)/P)-(a/P))*V+b**(3)+((R*T*(b**(2)))/P)-((a*b)/P)\n",
+ "V5_1=fsolve(f3,-1)\n",
+ "V5_2=fsolve(f3,0)\n",
+ "V5_3=fsolve(f3,1)\n",
+ "\t\t\t#The largest root is for vapour phase%\n",
+ "\t\t\t#The largest root is only considered as the systemis gas\n",
+ "print \" (5).The molar volume of methane using Peng-Robinson equation of state is %e m**(3)/mol\"%V5_3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (1).The molar volume of methane using given virial equation is 4.242974e-03 m**(3)/mol\n",
+ " (2).The molar volume of methane using given virial equation is 4.242930e-03 m**(3)/mol\n",
+ " (3).The molar volume of methane using van der Walls equation of state is 4.236938e-03 m**(3)/mol\n",
+ " (4).The molar volume of methane using Redlich Kwong equation of state is 4.241402e-03 m**(3)/mol\n",
+ " (5).The molar volume of methane using Peng-Robinson equation of state is 4.242341e-03 m**(3)/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example - 2.17 Page number - 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of compressibility factor\n",
+ "\n",
+ "# Variables\n",
+ "T = 310.93;\t\t\t#[K] - Temperature\n",
+ "P = 2.76*10**(6)\t\t\t#[N/m**(2)] - Pressure\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "y1 = 0.8942;\t\t\t# Mole fraction of component 1 (methane)\n",
+ "y2 = 1-y1;\t\t\t# Mole fraction of component 2 (n-butane)\n",
+ "\n",
+ "#For component 1 (methane)\n",
+ "Tc_1 = 190.58;\t\t\t#[K] - Cricitical temperature\n",
+ "Pc_1 = 46.05;\t\t\t#[bar] - Cricitical pressure\n",
+ "Pc_1 = Pc_1*10**(5)\t\t\t#[N/m**(2)]\n",
+ "Zc_1 = 0.288;\t\t\t# Critical compressibility factor\n",
+ "Vc_1 = 99.1;\t\t\t#[cm**(3)/mol]\n",
+ "Vc_1 = Vc_1*10**(-6)\t\t\t#[m**(3)/mol]\n",
+ "w_1 = 0.011;\t\t\t# Acentric factor\n",
+ "\n",
+ "\t\t\t#For component 2 (n-butane)\n",
+ "Tc_2 = 425.18;\t\t\t#[K] - Cricitical temperature\n",
+ "Pc_2 = 37.97;\t\t\t#[bar] - Cricitical pressure\n",
+ "Pc_2 = Pc_2*10**(5)\t\t\t# [N/m**(2)]\n",
+ "Zc_2 = 0.274;\t\t\t# Critical compressibility factor\n",
+ "Vc_2 = 255.1;\t\t\t# [cm**(3)/mol]\n",
+ "Vc_2 = Vc_2*10**(-6)\t\t\t# [m**(3)/mol]\n",
+ "w_2 = 0.193;\t\t\t# Acentric factor\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (1)\n",
+ "\t\t\t# Virial equation of state% Z = 1 + (B*P)/(R*T)\n",
+ "\t\t\t# For component 1 (methane)\n",
+ "Tr_1 = T/Tc_1;\t\t\t#Reduced temperature\n",
+ "\t\t\t# At reduced temperature\n",
+ "B1_0 = 0.083 - (0.422/(Tr_1)**(1.6))\n",
+ "B1_1 = 0.139 - (0.172/(Tr_1)**(4.2))\n",
+ "\t\t\t# We know%(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_11 = ((B1_0+(w_1*B1_1))*(R*Tc_1))/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#Similarly for component 2\n",
+ "Tr_2 = T/Tc_2;\t\t\t#Reduced temperature\n",
+ "\t\t\t#At reduced temperature Tr_2%\n",
+ "B2_0 = 0.083 - (0.422/(Tr_2)**(1.6))\n",
+ "B2_1 = 0.139 - (0.172/(Tr_2)**(4.2))\n",
+ "B_22 = ((B2_0 + (w_2*B2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For cross coeffcient\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1./2)\t\t\t#[K]\n",
+ "w_12 = (w_1 + w_2)/2;\n",
+ "Zc_12 = (Zc_1 + Zc_2)/2;\n",
+ "Vc_12 = (((Vc_1)**(1./3)+(Vc_2)**(1./3))/2)**(3)\t\t\t#[m**(3)/mol]\n",
+ "Pc_12 =(Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "\t\t\t#Now we have%(B_12*Pc_12)/(R*Tc_12) = B_0+(w_12*B_1)\n",
+ "\t\t\t#where B_0 and B_1 are to be evaluated at Tr_12\n",
+ "Tr_12 = T/Tc_12;\n",
+ "\t\t\t#At reduced temperature Tr_12\n",
+ "B_0 = 0.083 - (0.422/(Tr_12)**(1.6))\n",
+ "B_1 = 0.139 - (0.172/(Tr_12)**(4.2))\n",
+ "B_12 = ((B_0+(w_12*B_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For the mixture\n",
+ "B = y1**(2)*B_11+2*y1*y2*B_12+y2**(2)*B_22;\t\t\t#[m**(3)/mol]\n",
+ "Z_1 = 1+(B*P)/(R*T)\t\t\t#compressibility factor\n",
+ "print \" (1).The compressibility factor of mixture using Virial equation of state is %f\"%Z_1\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "\t\t\t# Pseudo reduced method.\n",
+ "T_pc = (y1*Tc_1)+(y2*Tc_2)\t\t\t#[K] - Cricitical temperature\n",
+ "P_pc = (y1*Pc_1)+(y2*Pc_2)\t\t\t#[N/m**(2)] - Cricitical pressure\n",
+ "w = (y1*w_1)+(y2*w_2)\t\t\t# Acentric factor\n",
+ "T_pr = T/T_pc;\t\t\t# Reduced temperature\n",
+ "P_pr = P/P_pc;\t\t\t# Reduced pressure\n",
+ "\t\t\t#At this value of Tpr%\n",
+ "B0 = 0.083 - (0.422/(T_pr)**(1.6))\n",
+ "B1 = 0.139 - (0.172/(T_pr)**(4.2))\n",
+ "Z0 = 1 + B0*(P_pr/T_pr)\n",
+ "Z1 = B1*(P_pr/T_pr)\n",
+ "Z = Z0 + w*Z1;\n",
+ "print \" (2).The compressibility factor of mixture using pseudo reduced method is %f\"%Z\n",
+ "\n",
+ "\t\t\t# (3)\n",
+ "\t\t\t# Redlich Kwong equation of state is given by\n",
+ "\t\t\t# P = ((R*T)/(V-b)) - (a/(T**(1/2)*V*(V+b)))\n",
+ "\t\t\t# For methane%component 1\n",
+ "a_1 = (0.42748*(R**(2))*(Tc_1**(2.5)))/Pc_1;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b_1 = (0.08664*R*Tc_1)/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t#For n-butane%component 2\n",
+ "a_2 = (0.42748*(R**(2))*(Tc_2**(2.5)))/Pc_2;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b_2 = (0.08664*R*Tc_2)/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t#For the mixture\n",
+ "a_12 = (a_1*a_2)**(1./2)\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "a = y1**(2)*a_1 + 2*y1*y2*a_12 + y2**(2)*a_2;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b = (y1*b_1) + (y2*b_2)\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# The cubic form of Redlich Kwong equation of state is given by%\n",
+ "\t\t\t# V**(3) - ((R*T)/P)*V**(2) - ((b_1**(2)) + ((b_1*R*T)/P) - (a/(T**(1/2)*P))*V - (a*b)/(T**(1/2)*P) = 0\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f(V):\n",
+ " global R,T,P,b,a\n",
+ " return V**(3)-((R*T)/P)*V**(2)-((b**(2))+((b*R*T)/P)-(a/(T**(1./2)*P)))*V-(a*b)/(T**(1./2)*P)\n",
+ "V_1=fsolve(f,1)\n",
+ "V_2=fsolve(f,10)\n",
+ "V_3=fsolve(f,100)\n",
+ "\t\t\t# Thus compressibility factor is\n",
+ "Z_3 = (P*V_1)/(R*T)\t\t\t#compressibility factor\n",
+ "print \" (3).The compressibility factor of mixture using Redlich Kwong equation of state is %f\"%Z_3\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (1).The compressibility factor of mixture using Virial equation of state is 0.926842\n",
+ " (2).The compressibility factor of mixture using pseudo reduced method is 0.937191\n",
+ " (3).The compressibility factor of mixture using Redlich Kwong equation of state is 0.927540\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch3_2.ipynb b/Chemical_Engineering_Thermodynamics/ch3_2.ipynb
new file mode 100644
index 00000000..dd655676
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch3_2.ipynb
@@ -0,0 +1,1577 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : The First Law and Its Applications"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.1 Page number - 80 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "V_vessel = 4.*10**(-3);\t\t\t#[m**(-3)] - Volume of vessel\n",
+ "T = 200+273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal fas constant\n",
+ "P = 1.5*10**(6);\t\t\t#[Pa] - Pressure\n",
+ "Q = 40.*1000;\t\t\t#[J] - Heat input\n",
+ "\t\t\t# From steam table at 200 C,Psat=1.55549 MPa,therefore the steam is superheated.\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (1)\n",
+ "\t\t\t# Using steam table,at 1.5 MPa and 200 C,\n",
+ "V_1 = 0.1325;\t\t\t#[m**(3)/mol] - Specific volume\n",
+ "U_1 = 2598.1;\t\t\t#[kJ/kg] - Specific internal energy\n",
+ "\t\t\t# From first law under constant pressure,\n",
+ "\t\t\t# Q - m*P*(V2 - V1) = m*(U2 - U1)\n",
+ "m = V_vessel/V_1;\t\t\t#[kg] - Mass of system\n",
+ "\t\t\t# Putting the values,the above equation becomes\n",
+ "\t\t\t# 45283*(V2 - 0.1325) + 30.1887*(U2 - 2598.1) = 40000\n",
+ "\t\t\t# From steam table at 700 C LHS is 33917.0 and at 800 C,it is 40925.3.\n",
+ "\t\t\t# Therefore the final temperature lies between 700 and 800 C\n",
+ "print \" 1.From steam table the final temperature lies between 700 and 800 C\";\n",
+ "\n",
+ "\t\t\t# Alternate method\n",
+ "\t\t\t# Here we use first law at constant pressure,\n",
+ "\t\t\t# Q = m*(H_2 - H_1)\n",
+ "H_1 = 2796.8;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Substituting the values,\n",
+ "\t\t\t# 40 = 0.0301887*(H_2 - 2796.8)\n",
+ "H_2 = (40/0.0301887) + 2796.9;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Threfore,final enthalpy is (H2) 4121.8 [kJ/kg] and pressure is 1.5 [MPa].\n",
+ "\t\t\t# From steam table at 1.5 [MPa]and 700 C,enthalpy is 3920.3 [kj/kg] and at 1.5 [MPa]and 800 C,enthalpy is 4152.6 [kj/kg]\n",
+ "print \"\\tAlternate method\";\n",
+ "print \"\\tBy linear interpolation we get the temperature at which enthlpy is 4121.8 kJ/kg to be 786.74 C\";\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "\t\t\t# Assuming ideal behaviour.\n",
+ "n = (P*V_vessel)/(R*T);\t\t\t#[mol] - No of moles\n",
+ "M = 18.015;\t\t\t# Molecular weight of water\n",
+ "m_2 = n*M;\t\t\t#[g] - mass of moles\n",
+ "Cp_1 = 7.7 + 0.04594*10**(-2)*T + 0.2521*10**(-5)*T**(2) - 0.8587*10**(-9)*T**(3);\t\t\t#[cal/mol*K] - Heat capacity at constant presure\n",
+ "R0 = 1.987;\t\t\t#[cal/mol*K] - universal gas constant\n",
+ "Cv_1 = Cp_1 - R0;\t\t\t#[cal/mol*K] - Heat capacity at constant volume\n",
+ "Cv_1 = Cv_1*4.184/M;\t\t\t#[J/g*K]\n",
+ "T1 = T;\n",
+ "\t\t\t# From 1st law energy balance for constant pressure, we have Q-W= m*(delta_U)\n",
+ "\t\t\t# Q = P*(V2 - V1)*m = m*Cv*(T2 - T1)\n",
+ "\t\t\t# Q = P*((T2/T1)-1)*V1*m = m*Cv*(T2-T1)\n",
+ "\t\t\t# But, (V1*Cv)=initial total volume of system = V_vessel\n",
+ "\t\t\t# Q-P((T2/T1)-1)*V_vessel = m_2*Cv_0*(T2-T1);\n",
+ "def f(T2): \n",
+ "\t return Q-P*((T2/T1)-1)*V_vessel-m_2*Cv_1*(T2-T1)\n",
+ "T2_1 = fsolve(f,1)\n",
+ "\t\t\t#The heat capacity should be evaluted at mean temperature\n",
+ "T_mean = (T1 + T2_1)/2;\n",
+ "Cp_2 = 7.7 + 0.04594*10**(-2)*T_mean+0.2521*10**(-5)*T_mean**(2) - 0.8587*10**(-9)*T_mean**(3);\t\t\t#[cal/mol*K] - Heat capacity at constant presure\n",
+ "Cv_2 = Cp_2-R0;\t\t\t#[cal/mol*K] - Heat capacity at constant volume\n",
+ "Cv_2 = Cv_2*4.184/M;\t\t\t#[J/g*K]\n",
+ "\t\t\t#Now again solving the equation Q=P*((T2/T1)-1)*V1*m = m*Cv*(T2-T1),for Cv=Cv_2\n",
+ "def f1(T2): \n",
+ "\t return Q-P*((T2/T1)-1)*V_vessel-m_2*Cv_2*(T2-T1)\n",
+ "T2_2 = fsolve(f1,1)\n",
+ "print \" 2).The temperature assuming ideal behaviour is %f K\"%(T2_2);\n",
+ "\n",
+ "\t\t\t# Alternate method\n",
+ "\t\t\t# From 1st law at constant pressure, we have Q = m*Cp(T2-T1)\n",
+ "T2_3 = Q/(m_2*(Cp_1*4.184/M))+T1;\n",
+ "\t\t\t#We can calculate the mean temperature as done above\n",
+ "T_mean1 = (T1 + T2_3)/2;\t\t\t#[J/g*K]\n",
+ "\t\t\t#The heat capacity should be evaluted at mean temperature\n",
+ "Cp_3 = 7.7 + 0.04594*10**(-2)*T_mean1 + 0.2521*10**(-5)*T_mean1**(2)-0.8587*10**(-9)*T_mean1**(3);\t\t\t#[cal/mol*K] - Heat capacity at constant presure\n",
+ "Cp_3 = Cp_3*4.184/M;\t\t\t#[J/g*K]\n",
+ "\t\t\t# Again solving the equation Q = m*Cp(T2-T1), for Cp=Cp_3\n",
+ "T2_4 = Q/(m_2*Cp_3) + T1;\n",
+ "print \"\\tAlternate method\";\n",
+ "print \"\\tThe temperature assuming ideal behaviour alternate method) is %f K\"%(T2_4);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1.From steam table the final temperature lies between 700 and 800 C\n",
+ "\tAlternate method\n",
+ "\tBy linear interpolation we get the temperature at which enthlpy is 4121.8 kJ/kg to be 786.74 C\n",
+ " 2).The temperature assuming ideal behaviour is 1141.732355 K\n",
+ "\tAlternate method\n",
+ "\tThe temperature assuming ideal behaviour alternate method) is 1141.738180 K\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.2 Page number - 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of heat required\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "V_tank = 1;\t\t\t#[m**(3)] - Volume of the tank\n",
+ "V_liq = 0.05;\t\t\t#[m**(3)] - Volume of saturated water\n",
+ "V_vap = 0.95;\t\t\t#[m**(3)] - Volume of saturated vapour\n",
+ "P = 1;\t\t\t#[bar] - Pressure\n",
+ "V_liq_sat = 0.001043;\t\t\t#[m**(3)/kg] - Specific volume of saturated water\n",
+ "V_vap_sat = 1.6940;\t\t\t#[m**(3)/kg] - Specific volume of saturated vapour\n",
+ "U_liq_sat = 417.4;\t\t\t#[kJ/kg] - Saturated liquid internal energy\n",
+ "U_vap_sat = 2506.1;\t\t\t#[kJ/kg] - Saturated vapour internal energy\n",
+ "\n",
+ "# Calculations\n",
+ "m = (V_liq/V_liq_sat) + (V_vap/V_vap_sat);\t\t\t#[kg] - Total mass of water\n",
+ "U_1 = (V_liq/V_liq_sat)*U_liq_sat + (V_vap/V_vap_sat)*U_vap_sat;\t\t\t#[kJ] - Total internal energy\n",
+ "\n",
+ "\t\t\t# At final state,which is saturated vapour\n",
+ "V = V_tank/m;\t\t\t#[m**(3)/kg] - Molar volume\n",
+ "\t\t\t# From saturated steam table at 8 MPa,as reported in the book V_vap = 0.02352[m**(3)/kg] and U_vap = 2569.8[kJ/kg]\n",
+ "\t\t\t# At 9 MPa, Vv = 0.02048[m**(3)/kg] and Uv = 2557.8[kJ/kg]\n",
+ "\t\t\t# Therefore final state pressure of the system (from interpolation) is 8.954 [MPa] and internal energy of saturated vapour is 2558.35 [kJ/kg]\n",
+ "U_2 = m*2558.35;\t\t\t#[kJ] - Final total internal energy\n",
+ "del_Ut = U_2 - U_1;\t\t\t#[kJ] \n",
+ "\t\t\t#we have, del_U = Q - W\n",
+ "\t\t\t#Here work done is zero because volume is rigid.\n",
+ "Q = del_Ut;\t\t\t#[kJ]\n",
+ "Q = del_Ut*10**(-3);\t\t\t#[MJ]\n",
+ "\n",
+ "# Results\n",
+ "print \" The amount of heat to be added is %f MJ\"%( Q);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The amount of heat to be added is 102.663530 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page number - 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of temperature internal energy and enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "M_vap_sat = 0.22;\t\t\t#[kg] - mass of saturated vapour\n",
+ "M_liq_sat = 1.78;\t\t\t#[kg] - mass of saturated liquid\n",
+ "P = 700;\t\t\t#[kPa] - Pressure\n",
+ "\n",
+ "#At P=700 kPa,the systen is saturated,from steam table as reported in the book\n",
+ "T_sat1 = 164.97;\t\t\t#[C]\n",
+ "V_liq_1 = 0.001108;\t\t\t#[m**(3)/kg] \n",
+ "V_vap_1 = 0.2729;\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Vt_1 = V_liq_1*M_liq_sat + V_vap_1*M_vap_sat;\t\t\t#[m**(3)] - total volume\n",
+ "\n",
+ "\t\t\t#At final state,P = 8 MPa\n",
+ "T_sat2 = 295.06;\t\t\t#[C]\n",
+ "V_liq_2 = 0.001384;\t\t\t#[m**(3)/kg] \n",
+ "V_vap_2=0.02352;\t\t\t#[m**(3)/kg]\n",
+ "Vt_2 = Vt_1;\t\t\t# Since the volume is rigid.\n",
+ "\t\t\t# Since the volume of 2 kg of vapour is 0.062 [m**(3)]\n",
+ "V = Vt_2/2;\t\t\t#[m**(3)/kg] - specific volume\n",
+ "\n",
+ "\t\t\t# (a)\n",
+ "\t\t\t# From steam table at 8 [MPa]and 350 [C],V=0.02995[m**(3)/kg]; \n",
+ "V_1 = 0.02995;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# And at 8 [MPa]and 400 [C],\n",
+ "V_2 = 0.03432;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# By interpolation,\n",
+ "T = ((V-V_1)/(V_2 - V_1))*(400-350)+350;\n",
+ "print \" a).The final temperature is %f c\"%(T);\n",
+ "\n",
+ "\t\t\t# (b)\n",
+ "\t\t\t# From steam table \n",
+ "U_1 = 2747.7;\t\t\t#[kJ/kg]\n",
+ "H_1 = 2987.3;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# And at 8 [MPa]and 400 C,\n",
+ "U_2 = 2863.8;\t\t\t#[kJ/kg]\n",
+ "H_2 = 3138.3;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Therefore at T = 362.01 C\n",
+ "U = U_1+((U_2 - U_1)/(400 - 350))*(T - 350);\n",
+ "print \" b).The internal energy is %f kJ/kg\"%(U);\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "H = H_1+((H_2 - H_1)/(400 - 350))*(T - 350);\n",
+ "print \" b).The enthalpy is %f kJ/kg\"%(H);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The final temperature is 362.072311 c\n",
+ " b).The internal energy is 2775.731907 kJ/kg\n",
+ " b).The enthalpy is 3023.758380 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.4 Page number - 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T = 300;\t\t\t#[K] - Temperature\n",
+ "P1 = 1;\t\t\t#[bar] - Initial pressure\n",
+ "P1 = P1*10**(5);\t\t\t#[N/m**(2)]\n",
+ "P2 = 8;\t\t\t#[bar] - Final pressure\n",
+ "P2 = P2*10**(5);\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Tc = 126.2;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 34;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[N/m**(2)]\n",
+ "w = 0.038;\t\t\t# Acentric factor\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# w = integral(Pdv)\n",
+ "\t\t\t# Z = 1 + (B/V)\n",
+ "\t\t\t# (P*V)/(R*T) = 1 + (B/V)\n",
+ "\t\t\t# P = (R*T)/V + (B*R*T)/V**(2)\n",
+ "\n",
+ "def f29(V): \n",
+ "\t return (R*T/V) + (B*R*T)/V**(2)\n",
+ "\n",
+ "\t\t\t# w = quad(f29,V1,V2)[0]\n",
+ "\n",
+ "\t\t\t# Under isothermal conditions,\n",
+ "\t\t\t# w = R*T*math.log(V2/V1) - B*R*T*((1/V2) - (1/V1));\n",
+ "\t\t\t# The second virial coefficient at state 1 is same as at state 2,as the temperature is the same i.e, T=300 [K]\n",
+ "Tr = T/Tc;\n",
+ "B_0 = 0.083 - (0.422/(Tr)**(1.6));\n",
+ "B_1 = 0.139 - (0.172/(Tr)**(4.2));\n",
+ "B = ((B_0+(w*B_1))*(R*Tc))/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t# Now we have to calculate molar volume i.e V1 and V2 at given conditions\n",
+ "\t\t\t# At state 1,\n",
+ "def f(V): \n",
+ "\t return V**(2)-(R*T/P1)*V-(B*R*T)/P1\n",
+ "V_1 = fsolve(f,-1)\n",
+ "V_2 = fsolve(f,1)\n",
+ "\t\t\t# We will take root near to (R*T)/P, i.e V_2\n",
+ "V1 = V_2;\n",
+ "\n",
+ "\t\t\t# At state 2,\n",
+ "def f1(V): \n",
+ "\t return V**(2)-(R*T/P2)*V-(B*R*T)/P2\n",
+ "V_3=fsolve(f1,-1)\n",
+ "V_4=fsolve(f1,1)\n",
+ "V2 = V_4;\n",
+ "\t\t\t# The work done is thus,\n",
+ "w = R*T*math.log(V2/V1) - B*R*T*((1/V2) - (1/V1));\t\t\t#[J]\n",
+ "w = w*10**(-3);\t\t\t#[kJ]\n",
+ "\n",
+ "print \" The work done is %f kJ/mol\"%(w);\n",
+ "print \" Negative sign indicates that work is done on the gas\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The work done is -5.186547 kJ/mol\n",
+ " Negative sign indicates that work is done on the gas\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.5 Page number - 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done\n",
+ "\n",
+ "# Variables\n",
+ "\n",
+ "T = 300;\t\t\t#[K] - Temperature\n",
+ "P1 = 1;\t\t\t#[bar] - Initial pressure\n",
+ "P1 = P1*10**(5);\t\t\t#[N/m**(2)]\n",
+ "P2 = 8;\t\t\t#[bar] - Final pressure\n",
+ "P2 = P2*10**(5);\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "y1 = 0.21;\t\t\t# Mole fraction of component 1 (oxygen)\n",
+ "y2 = 0.79;\t\t\t# Mole fraction of component 1 (nitroen)\n",
+ "\n",
+ "# For component 1 (Oxygen)\n",
+ "Tc_1 = 154.6;\t\t\t#[K]\n",
+ "Pc_1 = 50.43*10**(5);\t\t\t#[N/m**(2)]\n",
+ "Vc_1 = 73.4;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_1 = 0.288;\n",
+ "w_1 = 0.022;\n",
+ "\n",
+ "\t\t\t#For component 2 (Nitrogen)\n",
+ "Tc_2 = 126.2;\t\t\t#[K]\n",
+ "Pc_2 = 34*10**(5);\t\t\t#[N/m**(2)]\n",
+ "Vc_2 = 89.2;\t\t\t#[cm**(3)/mol]\n",
+ "Zc_2 = 0.289;\n",
+ "w_2 = 0.038;\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#For component 1\n",
+ "Tr_1 = T/Tc_1;\t\t\t#Reduced temperature\n",
+ "\t\t\t#At reduced temperature\n",
+ "B1_0 = 0.083 - (0.422/(Tr_1)**(1.6));\n",
+ "B1_1 = 0.139 - (0.172/(Tr_1)**(4.2));\n",
+ "\t\t\t# We know,(B*Pc)/(R*Tc) = B_0+(w*B_1)\n",
+ "B_11 = ((B1_0+(w_1*B1_1))*(R*Tc_1))/Pc_1;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t# Similarly for component 2\n",
+ "Tr_2 = T/Tc_2;\t\t\t#Reduced temperature\n",
+ "\t\t\t# At reduced temperature Tr_2,\n",
+ "B2_0 = 0.083 - (0.422/(Tr_2)**(1.6));\n",
+ "B2_1 = 0.139 - (0.172/(Tr_2)**(4.2));\n",
+ "B_22 = ((B2_0 + (w_2*B2_1))*(R*Tc_2))/Pc_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t#For cross coeffcient\n",
+ "Tc_12 = (Tc_1*Tc_2)**(1/2);\t\t\t#[K]\n",
+ "w_12 = (w_1 + w_2)/2;\n",
+ "Zc_12 = (Zc_1+Zc_2)/2;\n",
+ "Vc_12 = (((Vc_1)**(1/3)+(Vc_2)**(1/3))/2)**(3);\t\t\t#[cm**(3)/mol]\n",
+ "Vc_12 = Vc_12*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "Pc_12 = (Zc_12*R*Tc_12)/Vc_12;\t\t\t#[N/m**(2)]\n",
+ "\n",
+ "\t\t\t# Now we have,(B_12*Pc_12)/(R*Tc_12) = B_0 + (w_12*B_1)\n",
+ "\t\t\t# where B_0 and B_1 are to be evaluated at Tr_12\n",
+ "Tr_12 = T/Tc_12;\n",
+ "\t\t\t# At reduced temperature Tr_12\n",
+ "B_0 = 0.083 - (0.422/(Tr_12)**(1.6));\n",
+ "B_1 = 0.139 - (0.172/(Tr_12)**(4.2));\n",
+ "B_12 = ((B_0+(w_12*B_1))*R*Tc_12)/Pc_12;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t# For the mixture\n",
+ "B = y1**(2)*B_11 + 2*y1*y2*B_12+y2**(2)*B_22;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# Now we have to calculate molar volume i.eV1 and V2 at given conditions\n",
+ "\n",
+ "\t\t\t# At state 1,\n",
+ "def f(V): \n",
+ "\t return V**(2)-(R*T/P1)*V-(B*R*T)/P1\n",
+ "V_1=fsolve(f,-1)\n",
+ "V_2=fsolve(f,1)\n",
+ "\t\t\t# We will take root near to (R*T)/P, i.e V_2\n",
+ "V1 = V_2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t# At state 2,\n",
+ "def f1(V): \n",
+ "\t return V**(2)-(R*T/P2)*V-(B*R*T)/P2\n",
+ "V_3=fsolve(f1,-1)\n",
+ "V_4=fsolve(f1,1)\n",
+ "V2 = V_4;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\t\t\t# Work done per mole of air is given by, w=integral(Pdv)\n",
+ "\t\t\t# Z = 1 + (B/V)\n",
+ "\t\t\t# (P*V)/(R*T) = 1 +( B/V)\n",
+ "\t\t\t# P = (R*T)/V+(B*R*T)/V**(2)\n",
+ "\n",
+ "def f43(V): \n",
+ "\t return (R*T/V)+(B*R*T)/V**(2)\n",
+ "\n",
+ "\t\t\t# w = quad(f43,V1,V2)[0]\n",
+ "\n",
+ "\t\t\t# Under isothermal conditions,\n",
+ "w = R*T*math.log(V2/V1)-B*R*T*((1/V2)-(1/V1));\n",
+ "w = w*10**(-3);\t\t\t#[kJ/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The work done is %f kJ/mol\"%(w);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The work done is -5.186545 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.6 Page number - 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done\n",
+ "\n",
+ "# Variables\n",
+ "T = 125+273.15;\t\t\t#[K] - Temperature\n",
+ "P1 = 1;\t\t\t#[bar] - Initial pressure\n",
+ "P1 = P1*10**(5);\t\t\t#[N/m**(2)]\n",
+ "P2 = 60;\t\t\t#[bar] - Final pressure\n",
+ "P2 = P2*10**(5);\t\t\t#[N/m**(2)]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "Tc = 416.3;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 66.80*10**(5);\t\t\t#[N/m**(2)] - Critical pressure\n",
+ "\n",
+ "\t\t\t# (1)\n",
+ "\t\t\t# Virial equation of state, Z = 1 + (B/V)+(C/V**(2))\n",
+ "\t\t\t# (P*V)/(R*T) = 1 + (B/V)+(C/V**(2))\n",
+ "\t\t\t# P = (R*T)/V+(B*R*T)/V**(2)+(C*R*T)/V**(3)\n",
+ "\t\t\t# w = integral(PdV)=R*T*math.log(V2/V1)-(B*R*T)*(1/V2-1/V1)-(C*R*T/2)*(1/V2**(2)-1/V1**(2))\n",
+ "\n",
+ "B = -207.5;\t\t\t#[cm**(3)/mol] - Second virial coefficient\n",
+ "B = -207.5*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "C = 18200;\t\t\t#[cm**(6)/mol**(2)] - Third virial coefficient\n",
+ "C = 18200*10**(-12);\t\t\t#[m**(6)/mol**(2)]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# We need to calculate molar volume at state 1 and 2,\n",
+ "\t\t\t# At state 1,P = P1,\n",
+ "\t\t\t# V**(3)-(R*T/P)*V**(2)-(B*R*T/P)*V-(C*R*T/P)=0\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f1(V): \n",
+ "\t return V**(3)-(R*T/P1)*V**(2)-(B*R*T/P1)*V-(C*R*T/P1)\n",
+ "V_1=fsolve(f1,-1)\n",
+ "V_2=fsolve(f1,0)\n",
+ "V_3=fsolve(f1,10)\n",
+ "\t\t\t# The cubic equation has only 1 real root,other two roots are imaginary.\n",
+ "V1 = V_3;\n",
+ "\n",
+ "\t\t\t# Similarly at state 2,P=P2\n",
+ "\t\t\t# V**(3) - (R*T/P)*V**(2) - (B*R*T/P)*V - (C*R*T/P) = 0\n",
+ "\t\t\t# Solving the cubic equation\n",
+ "def f2(V): \n",
+ "\t return V**(3)-(R*T/P2)*V**(2)-(B*R*T/P2)*V-(C*R*T/P2)\n",
+ "V_4=fsolve(f2,-1)\n",
+ "V_5=fsolve(f2,0)\n",
+ "V_6=fsolve(f2,1)\n",
+ "V2 = V_6;\n",
+ "\t\t\t# Finally work done is given by,\n",
+ "w1 = R*T*math.log(V2/V1)-(B*R*T)*(1/V2-1/V1)-(C*R*T/2)*(1/V2**(2)-1/V1**(2));\t\t\t#[J/mol]\n",
+ "w1 = w1*10**(-3);\t\t\t#[kJ/mol]\n",
+ "print \" 1).The work done using given virial equation of state is %f kJ/mol\"%(w1);\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "\t\t\t# Virial equation of state, Z = 1+(B*P)/(R*T)+((C-B**(2))/(R*T)**(2))*P**(2)\n",
+ "\t\t\t# (P*V)/(R*T)= 1+(B*P)/(R*T)+((C-B**(2))/(R*T)**(2))*P**(2)\n",
+ "\t\t\t# V = (R*T)/P+B+((C-B**(2))/(R*T))*P\n",
+ "\t\t\t# Differentiating both sides by P and integrating we get,\n",
+ "\t\t\t# w = integral(PdV)=-(R*T)*math.log(P2/P1)+((C-B**(2))/(2*R*T))*(P2**(2)-P1**(2))\n",
+ "w2 = -(R*T)*math.log(P2/P1) + ((C-B**(2))/(2*R*T))*(P2**(2)-P1**(2));\t\t\t#[J/mol]\n",
+ "w2 = w2*10**(-3);\t\t\t#[kJ/mol]\n",
+ "print \" 2).The work done using given virial equation of state is %f kJ/mol\"%(w2);\n",
+ "\n",
+ "\t\t\t# (3)\n",
+ "\t\t\t# Van der Walls equation of state is given by,\n",
+ "a = (27*(R**(2))*(Tc**(2)))/(64*Pc);\t\t\t#[Pa*m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# P = ((R*T)/(V-b))-a/(V**(2));\t\t\t#[N/m**(2)]\n",
+ "\t\t\t# w = integral(PdV)=R*T*math.log((V2-b)/(V1-a))+a*(1/V2-1/V1)\n",
+ "\t\t\t# The cubic form of van der Walls equation of state is given by,\n",
+ "\t\t\t# V**(3) - (b+(R*T)/P)*V**(2) + (a/P)*V - (a*b)/P = 0\n",
+ "\t\t\t# Solving the cubic equation for P=P1\n",
+ "def f3(V): \n",
+ "\t return V**(3)-(b+(R*T)/P1)*V**(2)+(a/P1)*V-(a*b)/P1\n",
+ "V2_1=fsolve(f3,1)\n",
+ "V2_2=fsolve(f3,10)\n",
+ "V2_3=fsolve(f3,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root (V2_3).\n",
+ "\n",
+ "\t\t\t# Similarly at state 2,for P=P2,\n",
+ "def f4(V): \n",
+ "\t return V**(3)-(b+(R*T)/P2)*V**(2)+(a/P2)*V-(a*b)/P2\n",
+ "V2_4=fsolve(f4,1)\n",
+ "V2_5=fsolve(f4,10)\n",
+ "V2_6=fsolve(f4,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root (V2_6).\n",
+ "\t\t\t# Finally work done is given by\n",
+ "w3 = R*T*math.log((V2_6-b)/(V2_3-b))+a*(1/V2_6-1/V2_3);\t\t\t#[J/mol]\n",
+ "w3 = w3*10**(-3);\t\t\t#[kJ/mol]\n",
+ "print \" 3).The work done using van der Walls equation of state is %f kJ/mol\"%(w3);\n",
+ "\n",
+ "\t\t\t# (4)\n",
+ "\t\t\t# Redlich Kwong equation of state,\n",
+ "a_1 = (0.42748*(R**(2))*(Tc**(2.5)))/Pc;\t\t\t#[Pa*m**(6)*K**(1/2)/mol]\n",
+ "b_1 = (0.08664*R*Tc)/Pc;\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# P = ((R*T)/(V-b_1))-(a_1/(T**(1/2)*V*(V+b_1)));\t\t\t#[N/m**(2)]\n",
+ "\t\t\t# Work done is given by\n",
+ "\n",
+ "def f4(V): \n",
+ "\t return (V2-b)/(V1-b)-a/T**(1./2)*integrate(1/V*(V+b))\n",
+ "\n",
+ "\t\t\t# w = R*T*math.log((V2-b)/(V1-b))-a/T**(1/2)* quad(f4,V1,V2)[0]\n",
+ "\n",
+ "\t\t\t# Using the factorization 1/(V*(V+b))=(1/b)*((1/V)-(1/V+b)),we get\n",
+ "\t\t\t# w = R*T*math.log((V2-b)/(V1-b))-(a/(b*T**(1/2)))*(math.log(V2/V1)-math.log((V2+b)/(V1+b))\n",
+ "\t\t\t# Now we have calculate V1 and V2,\n",
+ "\t\t\t# The cubic form of Redlich Kwong equation of state is given by,\n",
+ "\t\t\t# V**(3) - ((R*T)/P)*V**(2) - ((b_1**(2)) + ((b_1*R*T)/P) - (a/(T**(1/2)*P))*V - (a*b)/(T**(1/2)*P) = 0\n",
+ "\t\t\t# Solving the cubic equation at state 1,\n",
+ "def f5(V): \n",
+ "\t return V**(3)-((R*T)/P1)*V**(2)-((b_1**(2))+((b_1*R*T)/P1)-(a_1/(T**(1./2)*P1)))*V-(a_1*b_1)/(T**(1./2)*P1)\n",
+ "V3_1=fsolve(f5,1)\n",
+ "V3_2=fsolve(f5,10)\n",
+ "V3_3=fsolve(f5,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root (V3_3).\n",
+ "\n",
+ "\t\t\t# Similarly at state 2,for P = P2,\n",
+ "def f6(V): \n",
+ "\t return V**(3)-((R*T)/P2)*V**(2)-((b_1**(2))+((b_1*R*T)/P2)-(a_1/(T**(1./2)*P2)))*V-(a_1*b_1)/(T**(1./2)*P2)\n",
+ "V3_4=fsolve(f6,1)\n",
+ "V3_5=fsolve(f6,10)\n",
+ "V3_6=fsolve(f6,100)\n",
+ "\t\t\t# The above equation has 1 real and 2 imaginary roots. We consider only real root (V3_6).\n",
+ "\t\t\t# Finally work done is given by\n",
+ "w4 = R*T*math.log((V3_6-b_1)/(V3_3-b_1))-(a_1/(b_1*T**(1./2)))*(math.log(V3_6/V3_3)-math.log((V3_6+b_1)/(V3_3+b_1)));\t\t\t#[J/mol]\n",
+ "w4 = w4*10**(-3);\t\t\t#[kJ/mol]\n",
+ "print \" 3).The work done using Redlich Kwong equation of state is %f kJ/mol\"%(w4);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The work done using given virial equation of state is -13.848149 kJ/mol\n",
+ " 2).The work done using given virial equation of state is -13.688301 kJ/mol\n",
+ " 3).The work done using van der Walls equation of state is -14.802420 kJ/mol\n",
+ " 3).The work done using Redlich Kwong equation of state is -14.704965 kJ/mol\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last five Jacobian evaluations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.8 Page number - 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done\n",
+ "\n",
+ "# Variables\n",
+ "T = 20 + 273.15;\t\t\t#[K] - Temperature\n",
+ "P_1 = 140.;\t\t\t#[kPa] - Initial pressure\n",
+ "P_1 = P_1*10.**(3);\t\t\t#[Pa]\n",
+ "P_2 = 560.;\t\t\t#[kPa] - Final pressure\n",
+ "P_2 = P_2*10.**(3);\t\t\t#[Pa]\n",
+ "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# Cp_0 = 1.648+4.124*10**(-2)*T - 1.53*10**(-5)*T**(2) + 1.74*10**(-9)*T**(3)\n",
+ "\t\t\t# Using adiabatic compression, P*V**(Y)=constant. For ideal gases\n",
+ "\t\t\t# P*(R*T/P)**(Y) = constant\n",
+ "\t\t\t# P**(1-Y)*T**(Y) = constant or,P1**(1-Y)*T1**(Y)=P2**(1-Y)*T2**(Y)\n",
+ "\t\t\t# Now,at state 1, i.e at T=20[C]\n",
+ "Cp_1 = 1.648+4.124*10**(-2)*T-1.53*10**(-5)*T**(2)+1.74*10**(-9)*T**(3);\t\t\t#[cal/mol*K] - Heat capacity at constant pressure\n",
+ "Cv_1 = Cp_1 - R;\t\t\t#[cal/mol*K] - Heat capacity at constant volume\n",
+ "Y1 = Cp_1/Cv_1;\t\t\t# Ratio of heat capacities\n",
+ "\n",
+ "\t\t\t# Now calculatung the temperature at state 2 (T2)\n",
+ "\t\t\t# (T2/T1)=(P1/P2)**((1-Y1)/Y1)\n",
+ "T_1 = T;\n",
+ "T_2 = ((P_1/P_2)**((1-Y1)/Y1))*T_1;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# Now calculating the mean temperature\n",
+ "T_mean = (T_1 + T_2)/2;\t\t\t#[K]\n",
+ "\t\t\t# At mean temperature\n",
+ "Cp_2 = 1.648+4.124*10**(-2)*T_mean - 1.53*10**(-5)*T_mean**(2) + 1.74*10**(-9)*T_mean**(3);\t\t\t#[cal/mol*K] - Heat capacity at constant pressure\n",
+ "Cv_2 = Cp_2 - R;\t\t\t#[cal/mol*K] - Heat capacity at constant volume\n",
+ "Y2 = Cp_2/Cv_2;\n",
+ "\n",
+ "\t\t\t# Calculating exit temperature\n",
+ "\t\t\t# Again using the realation,(T2/T1)=(P1/P2)**((1-Y1)/Y1)\n",
+ "T_exit = ((P_1/P_2)**((1-Y2)/Y2))*T_1;\t\t\t#[K]\n",
+ "\t\t\t# Since value of mean temperature has not changed much the molar heat capacity ratio can be assumed to be same.Therefore\n",
+ "\t\t\t# w = -delta(U)=Cv_0*(T2-T1)\n",
+ "w = Cv_2*(T_1 - T_exit);\t\t\t#[cal/mol]\n",
+ "w = w*4.184;\t\t\t#[J/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" The work done for adiabatic compression is %f J/mol\"%(w);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The work done for adiabatic compression is -3198.427072 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.9 Page number - 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature\n",
+ "\n",
+ "# Variables\n",
+ "m_ice = 1000;\t\t\t#[g] - Mass of ice\n",
+ "m_water = 1000;\t\t\t#[g] - Mass of water\n",
+ "T_ice = 273.15;\t\t\t#[K] - Temperature of ice\n",
+ "T_water = 373.15;\t\t\t#[K] - Temperature of water\n",
+ "L = 79.71;\t\t\t#[cal/g] - Latent heat of melting of ice.\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "Cp_1 = 1;\t\t\t#[cal/g-K] - Heat capacity at constant pressure\n",
+ "\t\t\t# Let the final temperature be T\n",
+ "\t\t\t# We assume that all of the ice melts.Energy taken up by ice is\n",
+ "\t\t\t# E1 = L*m_ice + m_ice*Cp_1*(T - T_ice)\n",
+ "\t\t\t# Energy given by hot water is,\n",
+ "\t\t\t# E2 = m_water*Cp_1*(T_water - T)\n",
+ "\t\t\t# No heat exchange with surrounding.Solving for T\n",
+ "T_1 = (m_ice*Cp_1*T_ice + m_water*Cp_1*T_water - L*m_ice)/(m_ice*Cp_1 + m_water*Cp_1);\t\t\t#[K]\n",
+ "T_1 = T_1 - 273.15;\t\t\t#[C]\n",
+ "\n",
+ "print \" 1).The final temperature taking Cp_water = 1 cal/g-K) is %f C\"%(T_1);\n",
+ "\t\t\t#Since the final temperature is greater than 273.15 K,so our assumption that all of ice melts is correct\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "\t\t\t# Cp_2 = 1.00874-0.7067*10**(-3)*T+15.93*10**(-6)*T**(2)-83.8*10**(-9)*T**(3);\n",
+ "\n",
+ "def f15(T): \n",
+ "\t return Cp_2\n",
+ "\n",
+ "\t\t\t# From energy balance,we get L*m_ice + m_ice* quad(f15,0,T) + m_water*integrate(Cp_2)[0]\n",
+ "\n",
+ "\t\t\t# On putting the values and then simplifying we get\n",
+ "\t\t\t# 2.01748*T - 0.0007067*T**(2) + 1.062*10**(-5)*T**(3) - 4.19*10**(-8)*T**(4) - 20.8455 = 0\n",
+ "\t\t\t# Solving the above equation we get\n",
+ "def f1(T): \n",
+ "\t return 2.01748*T - 0.0007067*T**(2) + 1.062*10**(-5)*T**(3) - 4.19*10**(-8)*T**(4) - 20.8455\n",
+ "T_0 = fsolve(f1,1)\n",
+ "print \" 2).The final temperature using specific heat capacity equation is %f C\"%(T_0);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The final temperature taking Cp_water = 1 cal/g-K) is 10.145000 C\n",
+ " 2).The final temperature using specific heat capacity equation is 10.364452 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.11 Page number - 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final pressure\n",
+ "\n",
+ "# Variables\n",
+ "n = 1.5;\t\t\t# - ratio of heat capacities\n",
+ "T_1 = 500.;\t\t\t#[K] - Initial temperature\n",
+ "T_2 = 1000.;\t\t\t#[K] - Final temperature\n",
+ "P_1 = 1.;\t\t\t#[bar] - Initial pressure\n",
+ "P_1 = P_1*10.**(5);\t\t\t#[Pa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The compression path is given by, P*V**(1.5) = constant\n",
+ "\t\t\t# P*(R*T/P)**(1.5) = constant\n",
+ "\t\t\t# P1**(-0.5)*T1**(1.5) = P2**(-0.5)*T2**(1.5)\n",
+ "P_2 = P_1*(T_1/T_2)**(-3);\t\t\t#[Pa]\n",
+ "P_2_final = P_2*10**(-5);\t\t\t#[bar] - Final pressure in bar\n",
+ "print \" The final pressure is %f bar\"%(P_2_final);\n",
+ "\n",
+ "\t\t\t# From first law q - w = delta(U). \n",
+ "\t\t\t# First w and delta(U) are calculated and thereafter heat exchange is determined.\n",
+ "V_1 = R*T_1/P_1;\t\t\t#[m**(3)/mol] - Initial volume\n",
+ "V_2 = R*T_2/P_2;\t\t\t#[m**(3)/mol] - Final volume\n",
+ "w = ((P_1*V_1)/(n - 1))*(1 - (P_2/P_1)**(1 - 1/n));\t\t\t#[J/mol] - work done\n",
+ "\n",
+ "\t\t\t# Mean temperature is given by,\n",
+ "T_mean = (T_1 + T_2)/2;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t#Now, heat capacity at T_mean is given by,\n",
+ "Cp_0 = R*(3.3 + 0.63*10**(-3)*T_mean);\t\t\t#[J/mol*K]\n",
+ "Cv_0 = Cp_0 - R;\t\t\t#[J/mol*K]\n",
+ "\t\t\t#Therefore delta(U) is given by\n",
+ "del_U = Cv_0*(T_2 - T_1);\t\t\t#[J/mol] - Change in internal energy\n",
+ "q = w + del_U;\t\t\t#[J/mol] - heat change\n",
+ "print \" The amount of heat supplied to the system is %f J/mol\"%(q);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The final pressure is 8.000000 bar\n",
+ " The amount of heat supplied to the system is 3211.282500 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.12 Page number - 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of slope and work done\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 150*10**(3);\t\t\t#[Pa] - Initial pressure\n",
+ "V_1 = 0.001;\t\t\t#[m**(3)] - Initial volume\n",
+ "P_2 = 1000*10**(3);\t\t\t#[Pa] - Final pressure\n",
+ "V_2 = 0.003;\t\t\t#[m**(3)] - Final volume\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# At x = 0, Vt(total volume) = 0.001 m**(3), therefore x = (V_t - V_1)/A; where A is area of cross section and x is length\n",
+ "\t\t\t# Force exerted b sprig is given by, F = Ps*A = k*x = k*(V_t - V_1)/A\n",
+ "\t\t\t# Ps = (k/A**(2))*(V_t - V_1)\n",
+ "\t\t\t# Total pressure = Initial pressre + Pressre due to spring\n",
+ "\t\t\t# P = P_1 + (k/A**(2))*(V_t - V_1)\n",
+ "\t\t\t# Let (k/A**(2)) = t (say)\n",
+ "\t\t\t# At state 2, i.e at P2 and V_t = V_2.\n",
+ "def f(t): \n",
+ "\t return P_2-P_1 - t*(V_2-V_1)\n",
+ "t = fsolve(f,1000)\n",
+ "\t\t\t# Therefore,pressure is related to total volume as P = P_1-t*(V_t - V_1)\n",
+ "\n",
+ "\t\t\t# (a)\n",
+ "\t\t\t#slope = (k/A**(2))\n",
+ "print \" a).The slope of the line on P-Vt diagram is %e N/m**5)\"%(t);\n",
+ "\n",
+ "\t\t\t# (b)\n",
+ "\t\t\t# Work done by the gas is given by w=integral(PdVt)\n",
+ "\n",
+ "def f30(V_t): \n",
+ "\t return P_1+t*(V_t-V_1)\n",
+ "\n",
+ "w = quad(f30,V_1,V_2)[0]\n",
+ "\n",
+ "w = w*10**(-3);\t\t\t#[kJ]\n",
+ "print \" b).The work done by gas is %f kJ\"%(w);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The slope of the line on P-Vt diagram is 4.250000e+08 N/m**5)\n",
+ " b).The work done by gas is 1.150000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.13 Page number - 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done and final temperature\n",
+ "\n",
+ "# Variables\n",
+ "V = 36;\t\t\t#[L] - Vol of gas on each side\n",
+ "P_1 = 1;\t\t\t#[atm] - pressure on left side of the piston\n",
+ "P_1 = P_1*101325;\t\t\t#[Pa]\n",
+ "T = 273.15;\t\t\t#[K]\n",
+ "P_2 = 3.375;\t\t\t#[atm] - Pressure on right side of the piston\n",
+ "P_2 = P_2*101325;\t\t\t#[Pa]\n",
+ "Y = 1.44;\t\t\t# Ratio of heat capacities\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constnt\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (a)\n",
+ "\t\t\t# For total system, del(U_total) = Q. \n",
+ "\t\t\t# Onto gas on right hand side no heat is supplied,as the piston is non conducting. Therefore,for gas on the right hand side, del(U) = -W.\n",
+ "\t\t\t# As heat is slowly supplied to the left hand side,expansion on right hand side is slow and process is adiabatic.\n",
+ "\t\t\t# For gas on right hand side, PV**(Y) = constant.\n",
+ "\t\t\t# T_2/T_1 = (P_2/P_1)**((Y - 1)/Y)\n",
+ "T_right = T*(P_2/P_1)**((Y - 1)/Y);\t\t\t#[K]\n",
+ "\n",
+ "Cv_0 = R/(Y-1);\t\t\t#[J/mol*K] - Heat capacity at constant volume.\n",
+ "\t\t\t# Now work done on the gas on right hand side is given by\n",
+ "\t\t\t# W = (P_1*V_1 - P_2*V_2)/(Y - 1) = R*(T_2 - T_1)/(Y - 1) = Cv_0*(T_1 - T_2)\n",
+ "W_left = Cv_0*(T - T_right);\t\t\t#[J/mol]\n",
+ "\t\t\t# Negative sign for the work done on LHS gas implies work is done on the gas\n",
+ "\n",
+ "\t\t\t# For right hand side of the gas\n",
+ "\t\t\t# P*Vt = n*R*T\n",
+ "n = P_1*(V*10**(-3))/(R*T);\t\t\t# number of moles\n",
+ "W_right = (-W_left)*n;\t\t\t#[J] - We used negative sign for 'W_left' because it is negative in magnitude.\n",
+ "W_right = W_right/1000;\t\t\t#[kJ]\n",
+ "print \" a).Total work done on gas on the right hand side is %f kJ\"%(W_right);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "print \" b).The final temperature of the gas on right side is %f K\"%(T_right);\n",
+ "\n",
+ "\t\t\t# (c)\n",
+ "\t\t\t# Pressure is same on both sides as piston is frictionless.\n",
+ "\t\t\t# The number of moles on both sides are also same as they have same temperature,presure and volume.\n",
+ "\t\t\t# We have (P_left*V_left)/T_left = (P_right*V_right)/T_right.\n",
+ "\t\t\t# Since P_left = P_right, (V_left/T_left) = (V_right/T-right) and also P*V**(Y) = constant.\n",
+ "V_right = V*(P_1/P_2)**(1/Y);\t\t\t#[L] - The total volume on right side \n",
+ "\n",
+ "\t\t\t# The total volume on right side can also be calculated using P2*V2 = n*R*T2.\n",
+ "\t\t\t# Since total volume = 72 [L], therefore volume of left side is\n",
+ "V_left = 2*V - V_right;\t\t\t#[L]\n",
+ "T_left = T_right*(V_left/V_right);\n",
+ "print \" c).Final temperature of the gas on the left side is %f K\"%(T_left);\n",
+ "\n",
+ "\t\t\t#(d)\n",
+ "\t\t\t#The first law applied to the total system (left side and right side) gives.\n",
+ "\t\t\t#Q - W = del(U_left) + del(U_right)\n",
+ "\t\t\t#There is no net work done by the total system as the cylinder is closed at both ends.\n",
+ "Q = n*Cv_0*(T_left-T) + n*Cv_0*(T_right-T);\t\t\t#[J]\n",
+ "Q = Q/1000;\t\t\t#[kJ]\n",
+ "print \" d).Amount of heat added to the gas on the left side is %f kJ\"%(Q);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).Total work done on gas on the right hand side is 3.731958 kJ\n",
+ " b).The final temperature of the gas on right side is 396.112176 K\n",
+ " c).Final temperature of the gas on the left side is 1447.650324 K\n",
+ " d).Amount of heat added to the gas on the left side is 39.378580 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.14 Page number - 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of powerand discharge head\n",
+ "\n",
+ "# Variables\n",
+ "P_2 = 0.2;\t\t\t#[bar]\n",
+ "P_2 = P_2*10**(5);\t\t\t#[Pa]\n",
+ "int_dia_2 = 2.4*10**(-2);\t\t\t#[m] - internal diameter at state 2.\n",
+ "Q = 5*10**(-3);\t\t\t#[cubic metre/s] - Flow rate at point 2.\n",
+ "den = 1000;\t\t\t#[kg/cubic metre] - density\n",
+ "delta_z = 1;\t\t\t#[m] - Difference in height\n",
+ "g = 9.81;\t\t\t#[m/s**(2)] - Acceleration due to gravity\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (1)\n",
+ "\t\t\t# Pressure at state 1 is atmospheric pressure and at state 2 is gauze pressure at state 2 + atmospheric pressure,thus\n",
+ "\t\t\t# (delta(P)/den) = (P2-P1)/den = P2/den\n",
+ "Vel_2 = Q/(3.14*(int_dia_2/2)**(2));\t\t\t#[m/s] - Velocity of water at state 2.\n",
+ "\t\t\t# Velocity at state 1 i negligible as compared to velocity at state 2,because the diameter of reservoir is very large as compared to diameter of pipe at state 2\n",
+ "\n",
+ "\t\t\t# From bernaulli equation we get,\n",
+ "\t\t\t# -w = (delta(P)/den) + delta(v**(2))/2 + g*delta_z\n",
+ "w = -((P_2/den )+ (Vel_2**(2)/2) + (g*delta_z));\t\t\t#[J/kg]\n",
+ "\t\t\t# w multiplied by m = (den*Q), will give the fluid power.\n",
+ "m = den*Q;\t\t\t#[kg/s]\n",
+ "W_net = m*w;\t\t\t#[Watt]\n",
+ "print \" 1).The fluid power is %f Watt\"%(W_net);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# Total discharge head developed by the pump is given by\n",
+ "\t\t\t# h = (delta(P)/den*g) + (Vel_2**(2)/2*g) + delta_z\n",
+ "h = (P_2/(den*g)) + (Vel_2**(2)/(2*g)) + delta_z;\t\t\t#[m]\n",
+ "print \" 2).Total discharge head developed by the pump is given by h = %f m\"%(h);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The fluid power is -454.750210 Watt\n",
+ " 2).Total discharge head developed by the pump is given by h = 9.271156 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.15 Page number - 106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of discharge velocity\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 1000.;\t\t\t#[K] - Temperature at entry\n",
+ "P_1 = 0.6;\t\t\t#[MPa] - Pressure at entry\n",
+ "P_2 = 0.2;\t\t\t#[MPa] - Exit pressure\n",
+ "Vel_1 = 50.;\t\t\t#[m/s] - Entry velocity \n",
+ "Y = 1.4;\t\t\t# Ratio of heat capacities\n",
+ "Mol_wt = 28.;\t\t\t#[g/mol] - Molecular weight of air\n",
+ "Cp = 29.099;\t\t\t#[J/mol-K] - Specific heat capacity at constant pressure\n",
+ "Cp = (Cp/Mol_wt)*1000;\t\t\t#[J/kg-K]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# We know that for a flow process \n",
+ "\t\t\t# delta_H + delta_V**(2)/2 + delta_(g*z) = q - w\n",
+ "\t\t\t# Since process is adiabatic,therefore q = 0 and since no work is done by the gas, therefore w = 0\n",
+ "\t\t\t# Assuming there is no change in the potenial energy between entry and exit, we have\n",
+ "\t\t\t# delta_H + delta_V**(2)/2 = 0\n",
+ "\n",
+ "\t\t\t# For a reversible process P*V**(Y) = constant and thus (T_2/T_1) = (P_2/P_1)**((Y-1)/Y)\n",
+ "T_2 = T_1*(P_2/P_1)**((Y-1)/Y);\t\t\t#[K] - Exit temperature\n",
+ "\n",
+ "\t\t\t# delta_H + delta_V**(2)/2 = 0\n",
+ "\t\t\t# Vel_2**(2)/2 - Vel_1**(2)/2 - (H_1 - H_2)= 0\n",
+ "\t\t\t# Vel_2**(2)/2 - Vel_1**(2)/2 - Cp*(T_1 - T_2) = 0\n",
+ "Vel_2_square = 2*(Vel_1**(2.)/2 - Cp*(T_2 - T_1));\t\t\t#[m**(2)/s**(2)]\n",
+ "Vel_2 = (Vel_2_square)**(1./2);\t\t\t#[m/s]\n",
+ "\n",
+ "# Results\n",
+ "print \" The discharge velocity is %f m/s\"%(Vel_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The discharge velocity is 749.965327 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.16 Page number - 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of change in enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "P_entry = 10;\t\t\t#[bar] - Pressure at entry\n",
+ "V_entry = 200;\t\t\t#[m/s] - Velocity at entry\n",
+ "P_exit = 1;\t\t\t#[bar] - Vressure at exit\n",
+ "V_exit = 800;\t\t\t#[m/s] - Velocity at exit\n",
+ "g = 9.81;\t\t\t#[m/s**(2)] - Acceleration due to gravity\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#Heat balance gives\n",
+ "\t\t\t# delta_H + (delta_V**(2))/2 + g*delta_z = q - w\n",
+ "\t\t\t#delta_H = q - w - (delta_V**(2))/2 \n",
+ "\t\t\t#From nozzle no work is extracted,therefore\n",
+ "delta_H = -(V_exit**(2)- V_entry**(2))/2;\t\t\t#[J/kg]\n",
+ "delta_H = delta_H*10**(-3);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Results\n",
+ "print \" The change in enthalpy per kg of steam is %f kJ/kg\"%(delta_H);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The change in enthalpy per kg of steam is -300.000000 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.17 Page number - 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done and change in enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 280;\t\t\t#[K] - Temperature at entry\n",
+ "P_1 = 100;\t\t\t#[kPa] - Pressure at entry\n",
+ "T_2 = 400;\t\t\t#[K] - Temperature at exit\n",
+ "P_2 = 600;\t\t\t#[kPa] - Pressure at exit\n",
+ "m = 0.02;\t\t\t#[kg/s] - Mass flow rate\n",
+ "m = m*10**(3);\t\t\t#[g/s]\n",
+ "heat_loss = 16;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Cp_0 = 28.11 + 0.1967*10**(-2)*T + 0.4802*10**(-5)*T**(2) - 1.966*10**(-9)*T**(3)\n",
+ "\t\t\t#delta_H = q - w (neglecting kinetic and potential changes)\n",
+ "\t\t\t#delta_H = integral(Cp_0*dT)\n",
+ "\n",
+ "def f22(T): \n",
+ "\t return 28.11 + 0.1967*10**(-2)*T + 0.4802*10**(-5)*T**(2) - 1.966*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H = quad(f22,T_1,T_2)[0]\n",
+ "\n",
+ "print \" Change in enthalpy is %f J/mol\"%(delta_H);\n",
+ "\n",
+ "\t\t\t#Molecular weight of air(21 vol% O2 and 79 vol% N2)=(0.21*32)+(0.79*28)= 28.84 g/mol\n",
+ "Mol_wt = 28.84;\t\t\t#[g/mol]\n",
+ "q = - (heat_loss*Mol_wt);\t\t\t#[J/mol]\n",
+ "w = q - delta_H;\t\t\t#[J/mol]\n",
+ "print \" The work done per mole of air is %f J/mol\"%(w);\n",
+ "\t\t\t#the negative sign implies that work is done on the compressor.\n",
+ "\n",
+ "n = m/Mol_wt;\t\t\t#[mol/s] - Mole flow rate\n",
+ "W_net = delta_H*n;\t\t\t#[W]\n",
+ "W_net = -W_net*10**(-3);\t\t\t#[kW]\n",
+ "print \" And the necessary power input to the compressor is %f kW\"%(W_net);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Change in enthalpy is 3511.197066 J/mol\n",
+ " The work done per mole of air is -3972.637066 J/mol\n",
+ " And the necessary power input to the compressor is -2.434949 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.18 Page number - 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done per unit mass\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 300;\t\t\t#[K] - Temperature at entry\n",
+ "P_1 = 100;\t\t\t#[kPa] - Pressure at entry\n",
+ "P_2 = 900;\t\t\t#[kPa] - Pressure at exit\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (a)\n",
+ "\t\t\t# Reversible adiabatic compression\n",
+ "Y = 1.4;\t\t\t#Ratio of specific heat capacities\n",
+ "\t\t\t# For ideal gas, P*V**(Y)= constant and it takes the form of (T_2/T_1) = (P_2/P_1)**((Y-1)/Y)\n",
+ "T_2 = T_1*(P_2/P_1)**((Y - 1)/Y);\t\t\t#[K]\n",
+ "\t\t\t# The work exchange for adiabatic process is given by\n",
+ "\t\t\t# W_adia = -delta_H = -Cp*(T2-T1) = Cp*(T1-T2) = ((Y*R)/(Y-1))*(T1-T2)\n",
+ "W_adia = ((Y*R)/(Y - 1))*(T_1 - T_2);\t\t\t#[J/mol] -work done\n",
+ "\t\t\t# Molecular weight of air(21 vol% O2 and 79 vol% N2)=(0.21*32)+(0.79*28)= 28.84 g/mol\n",
+ "Mol_wt = 28.84;\t\t\t#[g/mol]\n",
+ "W_adia = W_adia/Mol_wt;\t\t\t#[J/g]\n",
+ "print \" a).The compressor work done for reversible adiabatic compession is %f J/g\"%(W_adia);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t#Isothermal compression\n",
+ "\t\t\t#W_iso = -integral(V*dP) = -integral((R*T/P)*dP) = R*T*ln(P_2/P_1)\n",
+ "W_iso = -R*T_1*math.log(P_2/P_1);\t\t\t#[J/mol]\n",
+ "W_iso = W_iso/Mol_wt;\t\t\t#[J/g]\n",
+ "print \" b).The compressor work done for isothermal compession is %f J/g\"%(W_iso);\n",
+ "\t\t\t#Note that in isothermal compression between the same states work done is less as compared to reversible adiabatic compression.\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "\t\t\t#Ideal two-stage compression \n",
+ "n = 1.3;\t\t\t#Polytropic exponent.\n",
+ "\t\t\t#Minimum work done in two stage compression is given by\n",
+ "\t\t\t#W_comp = ((2*n*R*T_1)/(n-1))*[1-(P_x/P_1)**(n-1)/n]\n",
+ "\t\t\t#where for minimum work, (P_x/P_1) = (P_x/P_2), and thus\n",
+ "P_x = (P_1*P_2)**(1./2);\t\t\t#[kPa]\n",
+ "\t\t\t#therefore, work done is given by,\n",
+ "W_comp = ((2*n*R*T_1)/(n-1))*(1-(P_x/P_1)**((n-1)/n));\t\t\t#[J/mol]\n",
+ "W_comp = W_comp/Mol_wt;\t\t\t#[J/g]\n",
+ "print \" c).The compressor work done for ideal two-stage compession is %f J/g\"%(W_comp);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The compressor work done for reversible adiabatic compession is -264.386412 J/g\n",
+ " b).The compressor work done for isothermal compession is -190.024880 J/g\n",
+ " c).The compressor work done for ideal two-stage compession is -216.284501 J/g\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.19 Page number - 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of inlet and outlet velocity and power\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 600;\t\t\t#[C] - Temperature at entry\n",
+ "P_1 = 15;\t\t\t#[MPa] - Pressure at entry\n",
+ "T_2 = 400;\t\t\t#[K] - Temperature at exit\n",
+ "P_2 = 100;\t\t\t#[kPa] - Pressure at exit\n",
+ "A_in = 0.045;\t\t\t#[metre square] - flow in area\n",
+ "A_out = 0.31;\t\t\t#[metre square] - flow out area\n",
+ "m = 30;\t\t\t#[kg/s] - mass flow rate.\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#At 15 MPa and 600 C,it has been reported in the book that the properties of steam are,\n",
+ "Vol_1 = 0.02491;\t\t\t#[m**(3)/kg] - Specific volume\n",
+ "H_1 = 3582.3;\t\t\t#[kJ/kg] - Enthalpy\n",
+ "\t\t\t# m = den*vel*A = (Vel*A)/Vol, substituting the values\n",
+ "vel_1 = (m*Vol_1)/A_in;\t\t\t#[m/s] - Velocity at point 1.\n",
+ "print \" The inlet velocity is %f m/s\"%(vel_1);\n",
+ "\n",
+ "\t\t\t#At 100 MPa (saturated vapour),it has been reported in the book that the properties of steam are, T_sat = 99.63 C, and\n",
+ "Vol_vap_2 = 1.6940;\t\t\t#[m**(3)/kg] - specific volume of saturated vapour.\n",
+ "H_vap_2 = 2675.5;\t\t\t#[kJ/kg] - Enthalpy os saturated vapour.\n",
+ "vel_2 = (m*Vol_vap_2)/A_out;\t\t\t#[m/s] - Velocity at point 2.\n",
+ "print \" The exit velocity is %f m/s\"%(vel_2);\n",
+ "\n",
+ "\t\t\t#From first law we get, q - w =delta_H + delta_V**(2)/2\n",
+ "\t\t\t#q = 0, therefore, -w = delta_H + delta_V**(2)/2\n",
+ "delta_H = H_vap_2 - H_1;\t\t\t#[kJ/kg] - change in enthalpy.\n",
+ "delta_V_square = (vel_2**(2) - vel_1**(2))/2;\t\t\t#[J/kg]\n",
+ "delta_V_square = delta_V_square*10**(-3);\t\t\t#[kJ/kg]\n",
+ "w = -(delta_H + delta_V_square);\t\t\t#[J/kg] \n",
+ "W_net = w*m;\t\t\t#[kW]\n",
+ "W_net = W_net*10**(-3);\t\t\t#[MW] - power produced.\n",
+ "print \" The power that can be produced by the turbine is %f MW\"%(W_net);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The inlet velocity is 16.606667 m/s\n",
+ " The exit velocity is 163.935484 m/s\n",
+ " The power that can be produced by the turbine is 26.805014 MW\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.20 Page number - 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Proving a mathematical relation\n",
+ "\n",
+ "# Variables,\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "Cp_0 = 2.5*R;\t\t\t#[J/mol-K] - Specific heat capacity at constant pressure\n",
+ "Cv_0 = 1.5*R;\t\t\t#[J/mol-K] - Specific heat capacity at constant volume\n",
+ "T_L = 300;\t\t\t#[K] - Temperature at which port properties are constant.\n",
+ "\n",
+ "# Calculations\n",
+ "Y = Cp_0/Cv_0;\t\t\t# Ratio of heat capacities.\n",
+ "\t\t\t#From part(1) we obtained the relation,\n",
+ "\t\t\t# T_2 = 1/(((P_2-P_1)/(Y*T_L*P_2))+(P_1/(P_2*T_1)))\n",
+ "\t\t\t# Not that when P_2 >> P_1 ,T_2 approaches Y*T_L and thus\n",
+ "T_2 = Y*T_L;\t\t\t#[K]\n",
+ "\n",
+ "# Results\n",
+ "print \" b).The final temperature is %f K\"%(T_2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " b).The final temperature is 500.000000 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.21 Page number - 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of equilibrium temperature\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 40 + 273.15;\t\t\t#[K] - Initial temperature.\n",
+ "P_1 = 1;\t\t\t#[bar] - Initial pressure.\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "Vol_1 = 0.01;\t\t\t#[cubic metre] - Initial volume of the cylinder.\n",
+ "T_2 = 100 + 273.15;\t\t\t#[K] - Final temperature.\n",
+ "P_2 = 100;\t\t\t#[kPa] - Final pressure.\n",
+ "P_2 = P_2*10**(5);\t\t\t#[Pa]\n",
+ "Vol_2 = 0.02;\t\t\t#[cubic metre] - Final volume of the cylinder.\n",
+ "Cp = 1.005;\t\t\t#[J/g-K] - Specific heat capacity at constant pressure.\n",
+ "Cv = 0.718;\t\t\t#[J/g-K] - Specific heat capacity at constant volume.\n",
+ "Mol_wt = 28.84;\t\t\t#[g/mol] - Molecular weight of air.\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "delta_Vol = Vol_2 - Vol_1;\t\t\t# [cubic metre] - Change in volume.\n",
+ "\t\t\t# Assuming ideal gas P*V = R*T\n",
+ "V_1 = (R*T_1)/P_1;\t\t\t# [m**(3)/mol] - Initial specific volume.\n",
+ "\t\t\t# Therefore,the total number of moles initially in the system is,\n",
+ "n_1 = (Vol_1/V_1);\t\t\t# [mol]\n",
+ "m_1 = n_1*Mol_wt;\t\t\t# [g] - Initial mass of the system.\n",
+ "Y = Cp/Cv;\t\t\t#Ratio of heat capacities\n",
+ "\n",
+ "\t\t\t# The energy balance equation is given by\n",
+ "\t\t\t# -P*delta_Vol + H_liq*(m_2 - m_1) = m_2*Cv*(P*V2)/R - m_1*Cv*T_1\n",
+ "\t\t\t# m_2*Cv*(P*V2)/R = (Cv*P_1*Vol_2)/R\n",
+ "\t\t\t# Cv/R = 1/(Y-1)\n",
+ "\t\t\t# Since pressure of the gas in system is assumed constant,therefore it remains at 1 bar and thus P = P_1,\n",
+ "H_liq = Cp*T_2;\t\t\t# [J/g] - Enthalpy of liquid\n",
+ "m_2 = (P_1*delta_Vol + ((P_1*Vol_2)/(Y-1)) + H_liq*m_1 - m_1*Cv*T_1)/H_liq;\t\t\t#[g]\n",
+ "\n",
+ "\t\t\t#The mass entering the assembly during the filling process is given by\n",
+ "m = m_2 - m_1;\t\t\t#[g]\n",
+ "n_2 = m_2/Mol_wt;\t\t\t#[mol] - Number of moles in the final state.\n",
+ "V_2 = Vol_2/n_2;\t\t\t#[m**(3)/mol] - Final specific volume.\n",
+ "\t\t\t# Therfore,final temperature is given by,\n",
+ "T_2 = (P_1*V_2)/R;\t\t\t#[K] - Final temperature.\n",
+ "\n",
+ "# Results\n",
+ "print \" The final equilibrium temperature is %f K\"%(T_2);\n",
+ "print \" The mass entering through the valve is %f g\"%(m);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The final equilibrium temperature is 339.343160 K\n",
+ " The mass entering through the valve is 9.367211 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example - 3.22 Page number - 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of mass\n",
+ "\n",
+ "# Variables\n",
+ "V_total = 5;\t\t\t#[L] - Volume of pressure cooker.\n",
+ "V_total = V_total*10**(-3);\t\t\t#m**(3)\n",
+ "P_gauze = 15;\t\t\t#[psi] - Operating pressure (gauze)of pressure cooker.\n",
+ "P_gauze = (P_gauze/14.5)*10**(5);\t\t\t#[N/m**(2)]\n",
+ "P_atm = 0.966*10**(5);\t\t\t#[N/m**(2)] - Atmospheric pressure.\n",
+ "m_1 = 1;\t\t\t#[kg] - Initial mass.\n",
+ "t = 30*60;\t\t\t#[s] - Total time.\n",
+ "J = 500;\t\t\t#[W] - Rate of heat supply\n",
+ "\n",
+ "# Calculations\n",
+ "P_abs = P_gauze + P_atm;\t\t\t#[N/m**(2)] - Absolute pressure.\n",
+ "\t\t\t#The energy balance equqtion gives,\n",
+ "\t\t\t# Q = m_e*H_e +(m_2*U_2 - m_1*U_1), where 'm_e' is the mass exit from the system and 'H_e' is enthalpy at exit conditions.\n",
+ "\n",
+ "\t\t\t#It has been reported in the book that from steam table at P_abs,\n",
+ "T_sat = 120.23;\t\t\t#[K]- Saturated temperature\n",
+ "V_liq = 0.001061;\t\t\t#[m**(3)/kg] - specific volume of liquid.\n",
+ "V_vap = 0.8857;\t\t\t#[m**(3)/kg] - specific volume of vapour.\n",
+ "U_liq = 504.49;\t\t\t#[kJ/kg] - specific internal energy of liquid.\n",
+ "U_vap = 2529.5;\t\t\t#[kJ/kg] - specific internal energy of vapour.\n",
+ "H_liq = 504.70;\t\t\t#[kJ/kg] - specific enthalpy of liquid.\n",
+ "H_vap = 2706.7;\t\t\t#[kJ/kg] - specific internal energy of vapour.\n",
+ "\n",
+ "\t\t\t#We know that total volume occupied by 1 kg of fluid is \n",
+ "\t\t\t#V_total = (1-x)*V_liq + x*V_vap\n",
+ "x1 = (V_liq - V_total)/(V_liq - V_vap);\t\t\t#[g]\n",
+ "\n",
+ "\t\t\t#Internal energy at this state is\n",
+ "U_1 = (1-x1)*U_liq + x1*U_vap;\t\t\t#[kJ/kg] - specific internal energy\n",
+ "U_1_net = m_1*U_1;\t\t\t#[kJ] - Internal energy\n",
+ "\n",
+ "\t\t\t#The amount of heat suplied is given by,\n",
+ "J_net = J*t;\t\t\t#[J] - Net heat supplied.\n",
+ "J_net = J_net*10**(-3);\t\t\t#[kJ]\n",
+ "\n",
+ "\t\t\t#Let the dryness factor at the end of the process be x\n",
+ "\t\t\t#The specific properties of the liquid and vapour remain same as P and T_sat are the same in the cooker.\n",
+ "\t\t\t#Let the total mass of H2O (liquid + vapour) at the end of the process be 'm' kg.\n",
+ "\t\t\t# V_total/m = (1-x)*(V_liq) + x*V_vap ......equqtion(1)\n",
+ "\n",
+ "\t\t\t#the specific internal energy at the end of process is\n",
+ "\t\t\t#U = (1-x)*U_liq + x*U_vap\n",
+ "\t\t\t#The total internal energy at the end of the process is\n",
+ "\t\t\t#U_net = m*U = x*[(1-x)*U_liq + x*U_vap]\n",
+ "\n",
+ "\t\t\t#The energy balance equqtion gives,\n",
+ "\t\t\t# Q = m_e*H_e +(m_2*U_2 - m_1*U_1), where 'm_e' is the mass exit from the system and 'H_e' is enthalpy at exit conditions.\n",
+ "\t\t\t#Since the vapour which exits out have enthalpy equal to that of saturated vapour,we get on simplification\n",
+ "\t\t\t# 900 = (1-m)*(2706.7) + m*((1-x)*504.49 + x*2529.5) - 513.5..........equation(2)\n",
+ "\t\t\t# The second equation on simplification becomes\n",
+ "\t\t\t# x = ((0.005/m) - 0.001061)/0.884639\n",
+ "\n",
+ "\t\t\t# Putting the expression of x in first equation and then simplifying, we get\n",
+ "\t\t\t# - 1293.2 = -2202.21*m + 11.445 - 2.429*m\n",
+ "m = (11.445+1293.2)/(2202.21+2.429);\t\t\t#[kg]\n",
+ "\n",
+ "\t\t\t# Therefore x can be calculated as\n",
+ "x = ((0.005/m) - 0.001061)/0.884639;\n",
+ "\n",
+ "\t\t\t# Therfore total water (liquid + vapour) present in the pressure cooker at the end of the process is m kg.\n",
+ "m_vapour = x*m;\t\t\t#[kg] - Mass of vapour\n",
+ "m_liquid = (1-x)*m;\t\t\t#[kg] - Mass of vapour\n",
+ "\n",
+ "# Results\n",
+ "print \" Total water liquid + vapour) present in the pressure cooker at the end of the process is %f kg\"%(m);\n",
+ "print \" The mass of vapour is %f kg\"%(m_vapour);\n",
+ "print \" The mass of liquid is %f kg\"%(m_liquid);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total water liquid + vapour) present in the pressure cooker at the end of the process is 0.591773 kg\n",
+ " The mass of vapour is 0.004942 kg\n",
+ " The mass of liquid is 0.586830 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch4_2.ipynb b/Chemical_Engineering_Thermodynamics/ch4_2.ipynb
new file mode 100644
index 00000000..2e333961
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch4_2.ipynb
@@ -0,0 +1,1540 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : The Secomd Law and Its Applications"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page Number : 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of entropy change\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "n = 1000.;\t\t\t#[mol]\n",
+ "T = 400.;\t\t\t#[K]\n",
+ "P_1 = 100.;\t\t\t#[kPa]\n",
+ "P_2 = 1000.;\t\t\t#[kPa]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "T_surr = 400.;\t\t\t#[K] - surrounding temperature\n",
+ "\t\t\t# Total change in entropy of the system is given by\n",
+ "\t\t\t# delta_S_sys = n*(Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1))\n",
+ "\t\t\t# The process being isothermal the first term is zero and the total entropy change of the system is\n",
+ "delta_S_sys_a = - n*R*math.log(P_2/P_1);\t\t\t#[J/K]\n",
+ "delta_S_sys_a = delta_S_sys_a*10**(-3);\t\t\t#[kJ/K]\n",
+ "\n",
+ "\t\t\t# Since the process is reversible therefore\n",
+ "Q_sys = T_surr*delta_S_sys_a;\t\t\t#[kJ] - Heat change in the system\n",
+ "\t\t\t# Negative sign in the value of Q_sys implies that heat is released from the system and is released to the surroundings,therefore\n",
+ "Q_surr = - Q_sys;\t\t\t#[kJ] - Heat change in the surrounding\n",
+ "delta_S_surr_a = Q_surr/T_surr;\t\t\t#[kJ/K]\n",
+ "\n",
+ "delta_S_univ_a = delta_S_sys_a + delta_S_surr_a;\t\t\t#[kJ/K]\n",
+ "\t\t\t# We get delta_S_univ = 0, which is true for a reversible process\n",
+ "\n",
+ "print \" a).The entropy change of the gas is given by delta_S_sys = %f kJ/K \"%(delta_S_sys_a);\n",
+ "print \" The entropy change of the surrounding is delta_S_surr = %f kJ/K \"%(delta_S_surr_a);\n",
+ "print \" The total entropy change of the gas is delta_S_univ = %f kJ/K \"%(delta_S_univ_a);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "T_surr_b = 300.;\t\t\t#[K] - surrounding temperature\n",
+ "\t\t\t# Since the initial and final states are fixed therefore the entropy change of the system is same whether the process is carried out reversibly or irreversibly.\n",
+ "delta_S_sys_b = delta_S_sys_a;\n",
+ "\n",
+ "\t\t\t# Work done under reversible condition is given by\n",
+ "\t\t\t# W = integral(P*dV) = integral(((R*T)/V)*dV) = R*T*math.log(V_2/V_1)\n",
+ "\t\t\t# For ideal gas we have, P1*V1/T1 = P2*V2/T2 or, V2/V1 = P1/P2 (for isothermal conditions)\n",
+ "W = R*T*math.log(P_1/P_2);\t\t\t#[J/mol]\n",
+ "W = W*10**(-3);\t\t\t#[kJ/mol]\n",
+ "\t\t\t# 20% extra work has to be done for the system to reach the same final state as under reversible conditions. Therefore\n",
+ "W = W*(120./100);\t\t\t#[kJ/mol]\n",
+ "W = W*n;\t\t\t#[kJ] - Total work done for n moles\n",
+ "\n",
+ "\t\t\t# Using the first law we have delta_U = Q - W. Now under isothermal conditions for ideal gas, delta_U = 0. Therefore,\n",
+ "Q = -W;\n",
+ "\t\t\t# It implies that whatever work is done on the system is lost as heat to the surroundings.\n",
+ "\t\t\t# Since heat is gained by the surroundings therefore\n",
+ "delta_S_surr_b = Q/T_surr_b;\t\t\t#[kJ/K]\n",
+ "\n",
+ "delta_S_univ_b = delta_S_sys_b + delta_S_surr_b;\t\t\t#[kJ/K]\n",
+ "\n",
+ "print \" b).The entropy change of the gas is given by delta_S_sys = %f kJ/K \"%(delta_S_sys_b);\n",
+ "print \" The entropy change of the surrounding is delta_S_surr = %f kJ/K \"%(delta_S_surr_b);\n",
+ "print \" The total entropy change of the gas is delta_S_univ = %f kJ/K \"%(delta_S_univ_b);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The entropy change of the gas is given by delta_S_sys = -19.143692 kJ/K \n",
+ " The entropy change of the surrounding is delta_S_surr = 19.143692 kJ/K \n",
+ " The total entropy change of the gas is delta_S_univ = 0.000000 kJ/K \n",
+ " b).The entropy change of the gas is given by delta_S_sys = -19.143692 kJ/K \n",
+ " The entropy change of the surrounding is delta_S_surr = 30.629908 kJ/K \n",
+ " The total entropy change of the gas is delta_S_univ = 11.486215 kJ/K \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page Number : 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of whether the process is reversible or not\n",
+ "\n",
+ "# Variables\n",
+ "T = 400.;\t\t\t#[K] - Temperature\n",
+ "P_1 = 500.*10**(3);\t\t\t#[Pa] - Initial pressure\n",
+ "P_2 = 100.*10**(3);\t\t\t#[Pa] - Final pressure\n",
+ "V_1 = 750.*10**(-6);\t\t\t#[m**(3)] - Initial volume\n",
+ "W_actual = 0.55*10**(3);\t\t\t#[J] - Actual work done\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal fas constant\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# Suppose that the surroundings are at 400 K.\n",
+ "\t\t\t# Therefore the process is externally reversible as temperature of the surroundings is same as system temperature.\n",
+ "\t\t\t# The number of moles is given by\n",
+ "n = (P_1*V_1)/(R*T);\t\t\t#[mol]\n",
+ "\t\t\t# The entropy change of ideal gas under isothermal condition is given by\n",
+ "delta_S_sys = - n*R*math.log(P_2/P_1);\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# The heat supplied to the system in the internally reversible process is\n",
+ "Q_theot = T*delta_S_sys;\t\t\t#[J]\n",
+ "\t\t\t# Since the process is isothermal therefore, workdone is given by\n",
+ "W_theot = Q_theot;\t\t\t#[J] - Theoritical work done\n",
+ "\t\t\t# Since actual work done by the gas is 0.55 kJ therefore actual heat supplied is also 0.55 kJ because under isothermal conditions delta_U = 0\n",
+ "Q_actual = W_actual;\n",
+ "\n",
+ "# Results\n",
+ "\t\t\t# Since Q_theot > Q_actual, so the process is irreversible\n",
+ "print \" Since Q_theot = %f J is greater than Q_actual = %f J\"%(Q_theot,Q_actual);\n",
+ "print \" Therefore, the process is internally irreversible\"\n",
+ "\n",
+ "\t\t\t# Moreover delta_S_sys is same whether the process is reversible or irreversible as the initial and final states is the same.\n",
+ "\t\t\t# In the reversible process higher amount of heat is supplied (as compared to irreversible) due to which delta_S_sys take place.\n",
+ "\t\t\t# In the irreversible process the entropy of system increases due two reasons : heat supplied and entropy generation\n",
+ "\t\t\t# So in the irreversible case amount of heat supplied is less as compared to reversible case as entropy generation term also adds to the entropy change of system\n",
+ "\t\t\t# delta_S_sys = Q/T_b + S_gen\n",
+ "S_gen = delta_S_sys - (Q_theot/T);\t\t\t#[J/K]\n",
+ "\t\t\t# The entropy generated may be due to friction and other dissipayive effects or due to non-quasi-static expansion\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Since Q_theot = 603.539217 J is greater than Q_actual = 550.000000 J\n",
+ " Therefore, the process is internally irreversible\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page Number : 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final pressure temperature and increase in entropy\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\t\t\t# For side A\n",
+ "V_A = 1;\t\t\t#[L] - Volume\n",
+ "V_A = V_A*10**(-3);\t\t\t#[m**(3)]\n",
+ "T_A = 300;\t\t\t#[K] - Temperature\n",
+ "P_A = 2;\t\t\t#[atm] - Pressure\n",
+ "P_A = P_A*101325;\t\t\t#[Pa]\n",
+ "\n",
+ "\t\t\t# For side B\n",
+ "V_B = 1;\t\t\t#[L] - volume\n",
+ "V_B = V_B*10**(-3);\t\t\t#[m**(3)]\n",
+ "T_B = 300;\t\t\t#[K] - Temperature\n",
+ "P_B = 1;\t\t\t#[atm] - Pressure\n",
+ "P_B = P_B*101325;\t\t\t#[Pa]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# From first law final temperature and pressure are given by (example 3.30)\n",
+ "\t\t\t# T = ((n_A*T_A) + (n_B*T_B))/(n_A + n_B)\n",
+ "\t\t\t# P = ((P_A*V_A) + (P_A*V_B))/(V_A + V_B)\n",
+ "\n",
+ "\t\t\t# Since in this case T_A = T_B, therefore final pressure is given by\n",
+ "P = ((P_A*V_A) + (P_B*V_B))/(V_A + V_B);\t\t\t#[Pa]\n",
+ "P = P/101325;\t\t\t#[atm]\n",
+ "\n",
+ "print \" The final temperature is %f K\"%(T_A);\n",
+ "print \" The final pressure is %f atm\"%(P);\n",
+ "\n",
+ "\t\t\t# The number of moles of air on each side are\n",
+ "n_A = (P_A*V_A)/(R*T_A);\t\t\t#[mol]\n",
+ "n_B = (P_B*V_B)/(R*T_B);\t\t\t#[mol]\n",
+ "\n",
+ "delta_S_A = -n_A*R*math.log((P*101325)/P_A);\t\t\t#[J/K] - Entropy change on side A\n",
+ "delta_S_B = -n_B*R*math.log((P*101325)/P_B);\t\t\t#[J/K] - Entropy change on side B\n",
+ "delta_S_sys = delta_S_A + delta_S_B;\t\t\t#[J/K] - Total entropy change of system\n",
+ "\n",
+ "\t\t\t# Since the system is insulated there is no heat exchange with the surroundings, therefore entropy change of surrounding is zero\n",
+ "delta_S_surr = 0;\t\t\t#[J/K]\n",
+ "delta_S_univ = delta_S_sys + delta_S_surr;\t\t\t#[J/K]\n",
+ "print \" The total increase in entropy is %f J/K\"%(delta_S_univ);\n",
+ "\n",
+ "\t\t\t# The entropy change of the system can also be writtten as\n",
+ "\t\t\t# delta_s_sys = Q/T_b + S_gen\n",
+ "\t\t\t# Since there is no heat transfer, therefore\n",
+ "S_gen = delta_S_univ;\t\t\t#[J/K]\n",
+ "\t\t\t# The process is reversible because of entropy generation due to spontaneous release of piston.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The final temperature is 300.000000 K\n",
+ " The final pressure is 1.500000 atm\n",
+ " The total increase in entropy is 0.057383 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page Number : 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# CAlculation of final temperature heat transfer and change of entropy\n",
+ "\n",
+ "# Variables\n",
+ "V_vessel = 0.2;\t\t\t#[m**(3)] - Volume of the vessel\n",
+ "P_1 = 10;\t\t\t#[bar] - Initial pressure inside the vessel\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "P_2 = 3.5;\t\t\t#[bar] - Final pressure inside the vessel\n",
+ "P_2 = P_2*10**(5);\t\t\t#Pa\n",
+ "T_1 = 250 + 273.15;\t\t\t#[K] - Initial temperature of the vesssel\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (a)\n",
+ "\t\t\t# At 10 bar and 250 C the steam is superheated. From steam table as reported in book we have\n",
+ "V_1 = 0.2327;\t\t\t#[m**(3)/kg] - specific volume\n",
+ "U_1 = 2709.9;\t\t\t#[kJ/kg] - specific internal energy\n",
+ "H_1 = 2942.6;\t\t\t#[kj/kg] - Specific enthalpy\n",
+ "S_1 = 6.9247;\t\t\t#[kJ/kg-K] - Specific entropy\n",
+ "\t\t\t# the quantity of steam is given by\n",
+ "m = V_vessel/V_1;\t\t\t#[kg]\n",
+ "\n",
+ "\t\t\t# At final state \n",
+ "V_2 = 0.2327;\t\t\t#[m**(3)/kg] - Molar volume\n",
+ "V_liq_2 = 0.001079;\t\t\t# [m**(3)/kg]\n",
+ "V_vap_2 = 0.5243;\t\t\t# [m**(3)/kg]\n",
+ "\t\t\t# Since overall volume lies between saturated liquid and saturated vapour therefore the steam is saturated and its dryness fraction at final state is given by\n",
+ "x = (V_2 - V_liq_2)/(V_vap_2 - V_liq_2);\n",
+ "\t\t\t# Final temperature = T_sat (at 3 bar) from steam table\n",
+ "T_final = 138.88;\t\t\t#[C]\n",
+ "\n",
+ "\t\t\t# At 3.5 bar saturated conditions \n",
+ "S_liq = 1.7275;\t\t\t#[kJ/kg-K] - Entropy of saturated liquid\n",
+ "S_vap = 6.9405;\t\t\t#[kJ/kg-K] - Entropy of saturated vapour\n",
+ "U_liq = 583.95;\t\t\t#[kJ/kg] - Internal energy of saturated liquid\n",
+ "U_vap = 2548.9;\t\t\t#[kJ/kg] - Internal energy of saturated vapour\n",
+ "\t\t\t# Therefore at final state \n",
+ "U_2 = U_liq*(1 - x) + x*U_vap;\t\t\t#[kJ/kg]\n",
+ "S_2 = S_liq*(1 - x) + x*S_vap;\t\t\t#[kJ/kg-K]\n",
+ "Q_1 = m*(U_2 - U_1);\t\t\t#[kJ]\n",
+ "delta_S_1 = m*(S_2 - S_1);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" a).The final temperature is %f C\"%(T_final);\n",
+ "print \" The amount of heat transfer is %f kJ\"%(Q_1);\n",
+ "print \" The change of entropy is %f kJ/kg-K\"%(delta_S_1);\n",
+ "\n",
+ "\t\t\t# (b)\n",
+ "Y = 1.4;\t\t\t# Ratio of heat capacities for air\n",
+ "\t\t\t# (P_1*V_1)/T_1 = (P_2*V_2)/T_2 and since V_1 = V_2\n",
+ "T_2 = (P_2/P_1)*T_1;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# Since the volume is fixed therefore work done (W) = 0 and from first law we get\n",
+ "\t\t\t# Q = delta_U = n*Cv_0*(T_2 - T_1)\n",
+ "Cv_0 = R/(Y - 1);\t\t\t#[J/mol-K] - Heat capacity at constant volume\n",
+ "Cp_0 = (Y*R)/(Y - 1);\t\t\t#[J/mol-K] - Heat capacity at constant pressure\n",
+ "n = (P_1*V_vessel)/(R*T_1);\t\t\t#[mol] - No. of moles\n",
+ "Q_2 = n*Cv_0*(T_2 - T_1);\t\t\t#[J] - Heat change\n",
+ "Q_2 = Q_2*10**(-3);\t\t\t#[kJ]\n",
+ "\n",
+ "delta_S_2 = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1);\t\t\t#[J/mol-K]\n",
+ "delta_S_2 = n*delta_S_2*10**(-3);\t\t\t#[kJ/K]\n",
+ "\n",
+ "print \" b).The final temperature is %f C\"%(T_2);\n",
+ "print \" The amount of heat transfer is %f kJ\"%(Q_2);\n",
+ "print \" The change of entropy is %f kJ/K\"%(delta_S_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The final temperature is 138.880000 C\n",
+ " The amount of heat transfer is -1079.587621 kJ\n",
+ " The change of entropy is -2.483450 kJ/kg-K\n",
+ " b).The final temperature is 183.102500 C\n",
+ " The amount of heat transfer is -325.000000 kJ\n",
+ " The change of entropy is -1.003366 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page Number : 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature work and heat transfer\n",
+ "\n",
+ "from math import *\n",
+ "# Variables\n",
+ "m = 1000.;\t\t\t#[g] - Mass of fluid\n",
+ "P_1 = 20.;\t\t\t#[bar] - Initial pressure\n",
+ "P_1 = P_1*10.**(5);\t\t\t#[Pa]\n",
+ "P_2 = 2;\t\t\t#[bar] - Final pressure\n",
+ "P_2 = P_2*10.**(5);\t\t\t#Pa\n",
+ "T_1 = 250 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "n = 1.25;\n",
+ "R = 8.314;\t\t\t#[J/mol*-] - Universal gas constant\n",
+ "Y = 1.4;\t\t\t# Index of expansion\n",
+ "Cv_0 = R/(Y- 1);\t\t\t#[J/mol-K]\n",
+ "Cp_0 = R + Cv_0;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# For steam at 20 bar and 250 C, from steam table as reported in the book\n",
+ "V_1 = 0.11144;\t\t\t#[m**(3)/kg]\n",
+ "U_1 = 2679.6;\t\t\t#[kJ/kg]\n",
+ "S_1 = 6.5453;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t# P_1*V_1**(n) = P_2*V_2**(n)\n",
+ "V_2 = ((P_1*V_1**(n))/P_2)**(1/n);\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "\t\t\t# At 2 bar under saturated conditions,from steam table as reported in the book\n",
+ "V_liq = 0.001061;\t\t\t#[m**(3)/kg]\n",
+ "V_vap = 0.8857;\t\t\t#[m**(3)/kg]\n",
+ "x = (V_2 - V_liq)/(V_vap - V_liq);\t\t\t# Dryness fraction\n",
+ "T_sat = 120.23;\t\t\t#[C] - The final temperature\n",
+ "U_liq = 504.49;\t\t\t#[kJ/kg] - Internal energy of saturate liquid\n",
+ "U_vap = 2529.5;\t\t\t#[kJ/kg] - Internal energy of saturate vapour\n",
+ "\t\t\t# Therefore, internal energy at state 2 is given by\n",
+ "U_2 = U_liq*(1 - x) + x*U_vap;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Work transfer is given by\n",
+ "W = (P_1*V_1 - P_2*V_2)/(n - 1);\t\t\t#[J/kg]\n",
+ "W = W*10**(-3);\t\t\t#[kJ/kg]\n",
+ "delta_U = U_2 - U_1;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# From first law, q - W = delta_U\n",
+ "q = W + delta_U;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# At final state (2 bar saturated), as reported in the book\n",
+ "S_liq = 1.5301;\t\t\t#[kJ/kg-K] - Entropy of saturated liquid\n",
+ "S_vap = 7.1271;\t\t\t#[kJ/kg-K] - Entropy of saturated vapour\n",
+ "\t\t\t# Therefore, entropy at state 2 is given by\n",
+ "S_2 = S_liq*(1 - x) + x*S_vap;\t\t\t#[kJ/kg-K]\n",
+ "delta_S = S_2 - S_1;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" a).The final temperature is %f C\"%(T_sat);\n",
+ "print \" The work done is equal to %f kJ/kg\"%(W);\n",
+ "print \" The heat change is equal to %f kJ/kg\"%(q);\n",
+ "print \" The entropy change is equal to %f kJ/kg-K\"%(delta_S);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# P*V**(n) = constant\n",
+ "\t\t\t# Since the gas behaves as ideal we can write\n",
+ "\t\t\t# P_1**(1-n)*T_1**(n) = P_2**(1-n)*T_2**(n)\n",
+ "T_2 = T_1*(P_1/P_2)**((1-n)/n);\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# Molar volume is given by\n",
+ "V_2_1 = (R*T_1)/P_1;\t\t\t#[m**(3)/mol] - At state 1\n",
+ "V_2_2 = (R*T_2)/P_2;\t\t\t#[m**(3)/mol] - At state 2\n",
+ "\n",
+ "\t\t\t# Work transfer is given by\n",
+ "w_2 = ((P_1*V_2_1) - (P_2*V_2_2))/(n-1);\t\t\t#[J/mol]\n",
+ "Mol_wt_air = 0.21*32 + 0.79*28;\t\t\t#[g/mol] - Molecular weight of air\n",
+ "n_mole = m/Mol_wt_air;\n",
+ "\t\t\t# Total work transfer is given by\n",
+ "W_2 = w_2*n_mole*10**(-3);\t\t\t#[kJ]\n",
+ "\t\t\t# Internal energy change is given by\n",
+ "delta_U = n_mole*Cv_0*(T_2 - T_1)*10**(-3);\t\t\t#[kJ]\n",
+ "\n",
+ "\t\t\t# Heat transfer is given by\n",
+ "Q = W_2 + delta_U;\t\t\t#[kJ]\n",
+ "\n",
+ "\t\t\t# Entropy change is given by\n",
+ "delta_S_2 = Cp_0*log(T_2/T_1) - R*log(P_2/P_1);\t\t\t#[J/mol-K]\n",
+ "delta_S_2 = delta_S_2*n_mole;\t\t\t#[J/mol]\n",
+ "\n",
+ "print \" b).The final temperature is %f C\"%(T_2);\n",
+ "print \" The work done is equal to %f kJ/kg\"%(W_2);\n",
+ "print \" The total heat change is equal to %f kJ\"%(Q);\n",
+ "print \" The entropy change is equal to %f J/kg-K\"%(delta_S_2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The final temperature is 120.230000 C\n",
+ " The work done is equal to 329.008908 kJ/kg\n",
+ " The heat change is equal to -238.988250 kJ/kg\n",
+ " The entropy change is equal to -0.573241 kJ/kg-K\n",
+ " b).The final temperature is 330.085335 C\n",
+ " The work done is equal to 222.626855 kJ/kg\n",
+ " The total heat change is equal to 83.485071 kJ\n",
+ " The entropy change is equal to 199.136884 J/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page Number : 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature and work done\n",
+ "\n",
+ "# Variables\n",
+ "m = 1000;\t\t\t#[g] - Mass of fluid\n",
+ "P_1 = 20;\t\t\t#[bar] - Initial pressure\n",
+ "P_2 = 2;\t\t\t#[bar] - Final ressure\n",
+ "T_1 = 250 + 273.15;\t\t\t#[K] - Initial tempearture\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# (a).\n",
+ "\t\t\t# At 20 bar and 250 C as reported in the book\n",
+ "V_1 = 0.11144;\t\t\t#[m**(3)/kg] - Specific volume\n",
+ "U_1 = 2679.6;\t\t\t#[kJ/kg] - Specific internal energy\n",
+ "S_1 = 6.5453;\t\t\t#[kJ/kg-K] - Specific entropy\n",
+ "S_2 = S_1;\t\t\t# Isentropic expansion\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# At 2 bar under saturated conditions \n",
+ "S_liq = 1.5301;\t\t\t#[kJ/kg-K]\n",
+ "S_vap = 7.1271;\t\t\t#[kJ/kg-K]\n",
+ "U_liq = 504.49;\t\t\t#[kJ/kg-K]\n",
+ "U_vap = 2529.5;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t# Therefore dryness factor can be determined as\n",
+ "x = (S_1 - S_liq)/(S_vap - S_liq);\n",
+ "U_2 = U_liq*(1 - x) + x*U_vap;\t\t\t#[kJ/kg] - Specific internal energy at final state\n",
+ "delta_U = U_2 - U_1;\t\t\t#[kJ/kg] - change in internal energy\n",
+ "W = - delta_U;\t\t\t# - Work done\n",
+ "\n",
+ "\t\t\t# The final saturated temperature at 2 bar from steam table is\n",
+ "T_2 = 120.23;\t\t\t#[C]\n",
+ "\n",
+ "print \" a).The final temperature is %f C\"%(T_2);\n",
+ "print \" The work done is equal to %f kJ/kg\"%(W);\n",
+ "\n",
+ "\t\t\t# (b).\n",
+ "Y = 1.4;\t\t\t# Index of expansion for air\n",
+ "Cv_0 = R/(Y-1);\t\t\t#[J/mol*K] - Specific heat capacity at constant volume\n",
+ "\t\t\t# Ideal gas under isentropic expansion P_1**(1-Y)*T_1**(Y) =P_2**(1-Y)*T_2**(Y)\n",
+ "T_2_prime = T_1*(P_1/P_2)**((1-Y)/Y);\t\t\t#[K] - Final temperature\n",
+ "delta_U_prime = Cv_0*(T_2_prime - T_1);\t\t\t#[J/mol] - change in internal energy\n",
+ "\n",
+ "\t\t\t# Number of moles is given by\n",
+ "n = m/28.84;\t\t\t#[mol]\n",
+ "delta_U_prime = delta_U_prime*n*10**(-3);\t\t\t#[kJ]\n",
+ "W_prime = - delta_U_prime;\t\t\t# Work done\n",
+ "\n",
+ "print \" b).The final temperature is %f C\"%(T_2_prime);\n",
+ "print \" The work done is equal to %f kJ/kg\"%(W_prime);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The final temperature is 120.230000 C\n",
+ " The work done is equal to 360.596841 kJ/kg\n",
+ " b).The final temperature is 270.964218 C\n",
+ " The work done is equal to 181.750398 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page Number : 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of index of isentropic expansion\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 15.;\t\t\t#[bar] - Initial pressure\n",
+ "P_2 = 0.15;\t\t\t#[bar] - Final pressure\n",
+ "\n",
+ "\t\t\t# We know that during isentropic expansion\n",
+ "\t\t\t# W = ((P_1*V_1) - (P_2*V_2))/(Y - 1)\n",
+ "\n",
+ "\t\t\t# At 15 bar (saturated vapour), from steam table as reported in the book\n",
+ "V_1 = 0.13177;\t\t\t#[m**(3)/kg]\n",
+ "U_1 = 2594.5;\t\t\t#[kJ/kg]\n",
+ "S_1 = 6.4448;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t# Now at state 2 (P_2 = 0.15 bar),from steam table as reported in the book\n",
+ "S_2 = S_1;\t\t\t# Isentropic expansion\n",
+ "S_liq = 0.7549;\t\t\t#[kJ/kg-K]\n",
+ "S_vap = 8.0085;\t\t\t#[kJ/kg-K]\n",
+ "U_liq = 225.92;\t\t\t#[kJ/kg]\n",
+ "U_vap = 2448.7;\t\t\t#[kJ/kg]\n",
+ "V_liq = 0.001014;\t\t\t#[m**(3)/kg]\n",
+ "V_vap = 10.02;\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# Therefore dryness factor can be calculated as\n",
+ "x = round((S_1 - S_liq)/(S_vap - S_liq),3);\n",
+ "U_2 = round(U_liq*(1 - x) + x*U_vap,2);\t\t\t#[kJ/kg] - Specific internal energy at final state\n",
+ "delta_U = U_2 - U_1;\t\t\t#[kJ/kg] - change in internal energy\n",
+ "W = - delta_U;\t\t\t# - Work done\n",
+ "\n",
+ "\t\t\t# The specific volume at the final state is\n",
+ "V_2 = round(V_liq*(1 - x) + x*V_vap,3);\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "\t\t\t# From work done under adiabatic conditions we get\n",
+ "\t\t\t# W = ((P_1*V_1) - (P_2*V_2))/(Y - 1)\n",
+ "Y = (((P_1*V_1) - (P_2*V_2))*10**2/W) + 1;\n",
+ "\n",
+ "# Results\n",
+ "print \" The index of expansion is given by Y = %.4f\"%(Y);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The index of expansion is given by Y = 1.1275\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page Number : 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of entropy production\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 40;\t\t\t#[bar] - Initial pressure\n",
+ "T_1 = 500;\t\t\t#[C] - Initial temperature\n",
+ "Vel_1 = 140;\t\t\t#[m/s] - Initial velocity\n",
+ "T_2 = 100;\t\t\t#[C] - Final temperature\n",
+ "Vel_2 = 80;\t\t\t#[m/s] - Final velocity\n",
+ "W = 746.0;\t\t\t#[kJ/kg] - Work output\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# (a).\n",
+ "\t\t\t# From steam table as reported in the book\n",
+ "H_1 = 3445.3;\t\t\t#[kJ/kg]\n",
+ "H_2 = 2676.1;\t\t\t#[kJ/kg]\n",
+ "S_1 = 7.0901;\t\t\t#[kJ/kh-K]\n",
+ "S_2 = 7.3549;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t# The temperature at which heat exchange take place is given by \n",
+ "T_b =(T_1 + T_2)/2 + 273.15;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# From first law in a control volume \n",
+ "\t\t\t# q - W = delta_H + (delta_V**(2))/2 , therefore\n",
+ "q = W*10**(3) + (H_2 - H_1)*10**(3) + (Vel_2**(2) - Vel_1**(2))/2;\t\t\t#[J/kg]\n",
+ "q = q*10**(-3);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "S_gen = (S_2 - S_1) - (q/T_b);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" a).The specific entropy production within turbine is %f kJ/kg-K\"%(S_gen);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# If control volume is too large to include the turbine and the environment then T_b becomes equal to 289 K. In this case\n",
+ "T_b_prime = 298;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# The entropy change of the sysytem is given by \n",
+ "\t\t\t#delta_S = q/T_b + S_gen\n",
+ "S_gen = (S_2 - S_1) - (q/T_b_prime);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" b).The specific entropy production within turbine is %f kJ/kg-K\"%(S_gen);\n",
+ "\n",
+ "\t\t\t# In the first part only irreversibilities within the turbine are evaluated\n",
+ "\t\t\t# whereas in part (2) irreversible heat transfer between the turbine cover and environment are also included.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The specific entropy production within turbine is 0.316793 kJ/kg-K\n",
+ " b).The specific entropy production within turbine is 0.364800 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page Number : 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work required and exit temperature\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1.;\t\t\t#[MPa] - Initial pressure\n",
+ "T_1 = 200 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 8.;\t\t\t#[MPa] - Final pressure\n",
+ "Y = 1.4;\t\t\t# Index of expansion of gas\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# The exit temperature for ideal gas under isentropic conditions is given by \n",
+ "T_2 = round(T_1*(round((P_2/P_1)**((Y-1)/Y),2)),1);\t\t\t#[K] - Exit temperature\n",
+ "\n",
+ "Cp_0 = round(Y*R/(Y-1),1);\t\t\t#[J/mol-K] - Specific heat capacity at constant pressure\n",
+ "\t\t\t# For isentropic conditions the enthalpy change for ideal gas is given by\n",
+ "delta_H_s = Cp_0*(T_2 - T_1);\t\t\t#[J/mol]\n",
+ "\t\t\t# Therefore work is given by\n",
+ "W = - delta_H_s;\t\t\t#[J/mol]\n",
+ "\n",
+ "print \" 1).The exit temperature of steam is %.2f K\"%(T_2);\n",
+ "print \" The required work is %.2f J/mol\"%(W);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "eff = 0.8;\t\t\t# Adiabatic efficiency\n",
+ "\t\t\t# delta_H_s/delta_H_a = 0.8\n",
+ "delta_H_a = delta_H_s/eff;\t\t\t#[J/mol] - Actual enthalpy change\n",
+ "W_a = - delta_H_a;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# The ideal gas enthalpy is a function only of temperature,therefore actual exit temperature T_2a is given by \n",
+ "\t\t\t# delta_H_a = Cp_0*(T_2a - T_1)\n",
+ "T_2a = (delta_H_a/Cp_0) + T_1;\n",
+ "\n",
+ "print \" 2).The exit temperature of steam is %.2f K\"%(T_2a);\n",
+ "print \" The required work is %.2f J/mol\"%(W_a);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The exit temperature of steam is 856.40 K\n",
+ " The required work is -11152.58 J/mol\n",
+ " 2).The exit temperature of steam is 952.21 K\n",
+ " The required work is -13940.72 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10 Page Number : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work required and exit temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\t\t\t\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1;\t\t\t#[MPa] - Initial pressure\n",
+ "T_1 = 200 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 8;\t\t\t#[MPa] - Final pressure\n",
+ "Y = 1.4;\t\t\t# Index of expansion of gas\n",
+ "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n",
+ "\t\t\t# Cp_0 = 7.7 + 0.04594*10**(-2)*T + 0.2521*10**(-5)*T**(2) - 0.8587*10**(-9)*T**(3), here T is in K and Cp_0 is in cal/mol-K\n",
+ "a = 7.7;\n",
+ "b = 0.04594*10**(-2);\n",
+ "c = 0.2521*10**(-5);\n",
+ "d = - 0.8587*10**(-9);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# delta_S = integral((Cp_0/T)*dT) - R*math.log(P_2/P_1) = 0\n",
+ "\t\t\t# delta_S = integral(((a + b*T + c*T**(2) + d*T**(3))/T)*dT) - R*math.log(P_2/P_1) = 0\n",
+ "\t\t\t# delta_S = a*math.log(T_2/T_1) + b*(T_2 - T_1) + (c/2)*(T_2**(2) - T_1**(2)) + (d/3)*(T_2**(3) - T_1**(3)) - R*math.log(P_2/P_1) = 0\n",
+ "\t\t\t# Solving for T_2 in the above equation we get\n",
+ "def f(T_2): \n",
+ "\t return a*math.log(T_2/T_1)+b*(T_2-T_1)+(c/2)*(T_2**(2)-T_1**(2))+(d/3)*(T_2**(3)-T_1**(3))-R*math.log(P_2/P_1)\n",
+ "T_2 = fsolve(f,100)\n",
+ "\n",
+ "\t\t\t# Now let us calculate the enthalpy change under these conditions \n",
+ "\n",
+ "def f0(T): \n",
+ "\t return 7.7+0.04594*10**(-2)*T+0.2521*10**(-5)*T**(2)-0.8587*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H_s = quad(f0,T_1,T_2)[0]\n",
+ "\n",
+ "delta_H_s = delta_H_s*4.184;\t\t\t#[J/mol]\n",
+ "\t\t\t# Therefore isentropic work done is\n",
+ "W = - delta_H_s;\n",
+ "\n",
+ "print \" 1).The exit temperature of steam is %f K\"%(T_2);\n",
+ "print \" The required work is %f J/mol\"%(W);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "eff = 0.8;\n",
+ "delta_H_a = delta_H_s/eff;\t\t\t#[J/mol] - Actual enthalpy change\n",
+ "\t\t\t# Therefore actual work done is given by \n",
+ "W_a = - delta_H_a;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# Now we have to determine the exit temperature under actual conditions\n",
+ "\t\t\t# delta_H_a = integral(Cp_0*dT) from limit T_1 = 473.15 K to T_2\n",
+ "\t\t\t# On putting the values and simplifying we get\n",
+ "\t\t\t# 7.7*T_2 + 0.02297*10**(-2)*T_2**(2) + 0.084*10**(-5)*T_2**(3) - 0.214675*10**(-9)*T_2**(4) - 6907.106 = 0\n",
+ "\n",
+ "def f1(T_2_prime): \n",
+ "\t return a*(T_2_prime-T_1)+(b/2)*(T_2_prime**(2)-T_1**(2))+(c/3)*(T_2_prime**(3)-T_1**(3))+(d/4)*(T_2_prime**(4)-T_1**(4))-(delta_H_a/4.184)\n",
+ "T_2_prime = fsolve(f1,100)\n",
+ "\n",
+ "print \" 2).The exit temperature of steam is %f K\"%(T_2_prime);\n",
+ "print \" The required work is %f J/mol\"%(W_a);\n",
+ "\n",
+ "# Answers are vary because of rounding error. Calculations are correct. "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The exit temperature of steam is 760.037501 K\n",
+ " The required work is -10499.128839 J/mol\n",
+ " 2).The exit temperature of steam is 828.044888 K\n",
+ " The required work is -13123.911049 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11 Page Number : 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work required and exit temperature\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1;\t\t\t#[MPa] - Initial pressure\n",
+ "T_1 = 200 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 8;\t\t\t#[MPa] - Final pressure\n",
+ "Y = 1.4;\t\t\t# Index of expansion of gas\n",
+ "\n",
+ "\t\t\t# At state 1 (1 MPa and 200 C) from steam table as reported in the book\n",
+ "H_1 = 2827.9;\t\t\t#[kJ/kg]\n",
+ "S_1 = 6.694;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# At state 2 (8 MPa)\n",
+ "S_2 = S_1;\t\t\t# Isentropic process\n",
+ "\t\t\t# From steam table at 8 MPa and 450 C\n",
+ "S_21 = 6.5551;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t# From steam table at 8 MPa and 500 C\n",
+ "S_22 = 6.7240;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t# Therefore temperature at which entropy of steam is 6.694 kJ/kg-K is given by\n",
+ "T_2 = 450 + (500-450)/(S_22-S_21)*(S_2-S_21);\t\t\t#[C]\n",
+ "T_2 = T_2 + 273.15;\t\t\t#[K]\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# Enthalpy of steam at 8 MPa and 450 C from steam table as reported in the book \n",
+ "H_21 = 3272.0;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# And at 8 MPA and 500 C\n",
+ "H_22 = 3398.3;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Therefore enthalpy of steam at 8 MPa and T_2 \n",
+ "H_2 = H_21 + ((H_22-H_21)/(500-450))*((T_2-273.15) - 450); \n",
+ "\t\t\t# Work done is given by \n",
+ "\t\t\t# W = - delta_H_s\n",
+ "W = - (H_2 - H_1);\t\t\t#[J/g]\n",
+ "W = W*18.015;\t\t\t#[J/mol]\n",
+ "delta_H_s = - W;\n",
+ "\n",
+ "print \" 1).The exit temperature of steam is %f K\"%(T_2);\n",
+ "print \" The required work is %f J/mol\"%(W);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "eff = 0.8;\t\t\t# Adiabatic efficiency\n",
+ "\t\t\t# delta_H_s/delta_H_a = 0.8\n",
+ "delta_H_a = delta_H_s/eff;\t\t\t#[J/mol] - Actual enthalpy change\n",
+ "\t\t\t# Therefore actual work done \n",
+ "W_a = - delta_H_a;\t\t\t#[J/mol]\n",
+ "\t\t\t# Enthalpy at actual exit conditions is \n",
+ "H_2_a = H_1 + delta_H_a/18.015;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Enthalpy of steam at 8 MPa and 500 C from steam table as reported in the book \n",
+ "H_21_a = 3398.3;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# And at 8 MPA and 550 C\n",
+ "H_22_a = 3521.0;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Therefore temperature at H_22_a is given by\n",
+ "T_2_a = 500 + ((550-500)*(H_2_a - H_21_a))/(H_22_a - H_21_a);\t\t\t#[C]\n",
+ "T_2_a = T_2_a + 273.15;\t\t\t#[K]\n",
+ "\n",
+ "print \" 2).The exit temperature of steam is %f K\"%(T_2_a);\n",
+ "print \" The required work is %f J/mol\"%(W_a);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The exit temperature of steam is 764.269005 K\n",
+ " The required work is -9871.618433 J/mol\n",
+ " 2).The exit temperature of steam is 819.832257 K\n",
+ " The required work is -12339.523042 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.12 Page Number : 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work required and discharge temperature\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 140.;\t\t\t#[kPa] - Initial pressure\n",
+ "T_1 = 20. + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 560.;\t\t\t#[kPa] - Final pressure\n",
+ "eff = 0.75;\t\t\t# Compressor efficiency\n",
+ "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n",
+ "\t\t\t# Cp_0 = 4.750 + 1.200*10**(-2)*T + 0.3030*10**(-5)*T**(2) - 2.630*10**(-9)*T**(3), here T is in K and Cp_0 is in cal/mol-K\n",
+ "a = 7.7;\n",
+ "b = 0.04594*10**(-2);\n",
+ "c = 0.2521*10**(-5);\n",
+ "d = - 0.8587*10**(-9);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "# At 20 C,as reported in the book\n",
+ "Cp_0 = 8.46;\t\t\t#[cal/mol-K] - Specific heat capacity at constant pressure\n",
+ "Cv_0 = Cp_0 - R;\t\t\t#[cal/mol-K] - Specific heat capacity at constant volume\n",
+ "Y = Cp_0/Cv_0;\t\t\t# Index of expansion\n",
+ "\n",
+ "\t\t\t# Assuming 100 % efficiency,for reversible and adiabatic process the final temperature is given by\n",
+ "\t\t\t# P*V**(Y) = constant or, P*((R*T)/P)**(Y) = constant\n",
+ "T_2 = ((P_1/P_2)**((1-Y)/Y))*T_1;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# Since at final temperature the value of heat capacity ratio would have changed \n",
+ "\t\t\t# So let us determine Y at mean temperature and then calculating final temperature\n",
+ "T_mean = (T_1 + T_2)/2;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# At T_mean,as reported in the book\n",
+ "Cp_0_new = 9.153;\t\t\t#[cal/mol-K]\n",
+ "Cv_0_new = Cp_0_new - R;\t\t\t#[cal/mol-K]\n",
+ "Y_new = Cp_0_new/Cv_0_new;\n",
+ "T_2_new = T_1*((P_1/P_2)**((1-Y_new)/Y_new));\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# The enthalpy change is given by \n",
+ "\n",
+ "def f23(T): \n",
+ "\t return 4.750+1.200*10**(-2)*T+0.3030*10**(-5)*T**(2)-2.630*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H = quad(f23,T_1,T_2_new)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t#For adiabatic process\n",
+ "W = - delta_H;\t\t\t#[cal/mol]\n",
+ "\t\t\t# Now actual work done on the system is given by \n",
+ "W_a = W/eff;\t\t\t#[cal/mol]\n",
+ "\n",
+ "\t\t\t# Since the actual process is adiabatic the work done is change in negative of enthalpy\n",
+ "\t\t\t# Therefore actual change in enthalpy is - W_a, or\n",
+ "\t\t\t# - W_a = 4.750*(T_2-T_1) + (1.2*10**(-2)/2)*(T_2**(2)-T_1**(2)) + (0.3030*10**(-5)/3)*(T_2**(3)-T_1**(3)) - (2.63*10**(-9)/4)*(T_2***(4)-T_1**(4));\n",
+ "\t\t\t# Solving for T_2 in the above equation\n",
+ "def f1(T_2_prime): \n",
+ "\t return 4.750*(T_2_prime-T_1)+((1.2*10**(-2))/2)*(T_2_prime**(2)-T_1**(2))+((0.3030*10**(-5))/3)*(T_2_prime**(3)-T_1**(3))-((2.63*10**(-9))/4)*(T_2_prime**(4)-T_1**(4))+W_a\n",
+ "T_2_prime=fsolve(f1,100)\n",
+ "\n",
+ "print \" The required work is %f cal/mol\"%(W_a);\n",
+ "print \" The discharge temperature of methane is %f K\"%(T_2_prime);\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The required work is -1254.158148 cal/mol\n",
+ " The discharge temperature of methane is 427.374758 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.13 Page Number : 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Dtermination of power output entropy and exit temperature\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 10;\t\t\t#[bar] - Initial pressure\n",
+ "T_1 = 500 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 2;\t\t\t#[psia] - Final pressure\n",
+ "P_2 = P_2/14.5;\t\t\t#[bar]\n",
+ "P_2 = P_2*10**(2);\t\t\t#[kPa]\n",
+ "m = 1.8;\t\t\t#[kg/s] - Mass flux\n",
+ "eff = 0.8;\t\t\t# Efficiency\n",
+ "\n",
+ "\t\t\t# At state 1, from steam table\n",
+ "H_1 = 3478.5;\t\t\t#[kJ/kg]\n",
+ "S_1 = 7.7622;\t\t\t#[kJ/kg-K]\n",
+ "S_2 = S_1;\t\t\t# Adiabatic process\n",
+ "\n",
+ "\t\t\t# From saturated steam table at 10 kPa\n",
+ "S_liq_1 = 0.6493;\t\t\t#[kJ/kg-K]\n",
+ "S_vap_1 = 8.1502;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t# From saturated steam table at 15 kPa\n",
+ "S_liq_2 = 0.7549;\t\t\t#[kJ/kg-K]\n",
+ "S_vap_2 = 8.0085;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# Threfore at P_2 \n",
+ "S_liq = S_liq_1 + ((S_liq_2-S_liq_1)/(15-10))*(P_2-10);\n",
+ "S_vap = S_vap_1 + ((S_vap_2-S_vap_1)/(15-10))*(P_2-10);\n",
+ "\n",
+ "\t\t\t# The dryness fraction at exit state is\n",
+ "x_2 = (S_1-S_liq)/(S_vap-S_liq);\n",
+ "\t\t\t# The enthalpy at exit to be determined. At 10 kPa\n",
+ "H_liq_1 = 191.83;\t\t\t#[kJ/kg]\n",
+ "H_vap_1 = 2584.7;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# At 15 kPa\n",
+ "H_liq_2 = 225.94;\t\t\t#[kJ/kg]\n",
+ "H_vap_2 = 2599.1;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Therfore at P_2\n",
+ "H_liq = H_liq_1 + ((H_liq_2-H_liq_1)/(15-10))*(P_2-10);\n",
+ "H_vap = H_vap_1 + ((H_vap_2-H_vap_1)/(15-10))*(P_2-10);\n",
+ "\n",
+ "\t\t\t# Enthalpy at state 2\n",
+ "H_2_s = H_liq*(1-x_2) + x_2*H_vap;\t\t\t#[kJ/kg]\n",
+ "W = m*(H_1 - H_2_s);\t\t\t#[kW]\n",
+ "\n",
+ "print \" 1).The power output is %f kW\"%(W);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# If the process is 80 % efficient the enthalpy change is\n",
+ "\t\t\t# H_1 - H_2_a = eff*(H_1 - H_2_s)\n",
+ "H_2_a = H_1 - (0.8*(H_1 - H_2_s));\n",
+ "\n",
+ "\t\t\t# Now under these conditions temperature and entropy have to be determined. From superheated steam tables,as reported in the book\n",
+ "\t\t\t# At 10 kPa and 100 C\n",
+ "H_2_1 = 2687.5;\t\t\t#[kJ/kg]\n",
+ "S_2_1 = 8.4479;\t\t\t#[kJ/kg-k]\n",
+ "\t\t\t# At 10 kPa and 150 C\n",
+ "H_2_2 = 2783.0;\t\t\t#[kJ/kg]\n",
+ "S_2_2 = 8.6882;\t\t\t#[kJ/kg-k]\n",
+ "\t\t\t# At 50 kPa and 100 C\n",
+ "H_3_1 = 2682.5;\t\t\t#[kJ/kg]\n",
+ "S_3_1 = 7.6947;\t\t\t#[kJ/kg-k]\n",
+ "\t\t\t# At 50 kPa and 150 C\n",
+ "H_4_1 = 2780.1;\t\t\t#[kJ/kg]\n",
+ "S_4_1 = 7.9401;\t\t\t#[kJ/kg-k]\n",
+ "\t\t\t# Therefore at P_2 and 100 C\n",
+ "H_prime_1 = H_2_1 + ((H_3_1-H_2_1)/(50-10))*(P_2-10);\t\t\t#[kJ/kg]\n",
+ "S_prime_1 = S_2_1 + ((S_3_1-S_2_1)/(50-10))*(P_2-10);\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t# Therefore at P_2 and 150 C\n",
+ "H_prime_2 = H_2_2 + ((H_4_1-H_2_2)/(50-10))*(P_2-10);\t\t\t#[kJ/kg]\n",
+ "S_prime_2 = S_2_2 + ((S_4_1-S_2_2)/(50-10))*(P_2-10);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t# Enthalpy at exit is H_2_a. So at this condition temperature can be nom be determined\n",
+ "T_exit = ((H_2_a - H_prime_1)/(H_prime_2 - H_prime_1))/(150-100) + 100;\t\t\t#[C]\n",
+ "\t\t\t# The entropy at exit is\n",
+ "S_exit = ((H_2_a - H_prime_1)/(H_prime_2 - H_prime_1))/(S_prime_2 - S_prime_1) + S_prime_1;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" 2).The entropy at exit is %f kJ/kg-K\"%(S_exit);\n",
+ "print \" The temperature of the exit state is %f C\"%(T_exit);\n",
+ "\n",
+ "print \" The irreversibility is advatageous because the exit steam is superheated and therefore\";\n",
+ "print \" the blades of the turbine are not eroded by water droplets which get formed when the process is isentropic\";\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The power output is 1753.346828 kW\n",
+ " 2).The entropy at exit is 8.906311 kJ/kg-K\n",
+ " The temperature of the exit state is 100.002552 C\n",
+ " The irreversibility is advatageous because the exit steam is superheated and therefore\n",
+ " the blades of the turbine are not eroded by water droplets which get formed when the process is isentropic\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.14 Page Number : 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work output per unit mass\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 6;\t\t\t#[MPa] - Initial pressure\n",
+ "T_1 = 500 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 10;\t\t\t#[kPa] - Final pressure\n",
+ "out_qlty = 0.9;\t\t\t# Output quality\n",
+ "\n",
+ "\t\t\t# At 6 MPa and 500 C, from steam table as reported in the book\n",
+ "H_1 = 3422.2;\t\t\t#[kJ/kg]\n",
+ "S_1 = 6.8803;\t\t\t#[kJ/kg-K]\n",
+ "S_2 = S_1;\t\t\t# Adiabatic reversible conditions\n",
+ "\t\t\t# At 10 kPa saturated\n",
+ "H_liq = 191.83;\t\t\t#[kJ/kg]\n",
+ "H_vap = 2584.7;\t\t\t#[kJ/kg]\n",
+ "S_liq = 0.6493;\t\t\t#[kJ/kg-K]\n",
+ "S_vap = 8.1502;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The dryness fraction is given by \n",
+ "x = (S_1-S_liq)/(S_vap-S_liq);\n",
+ "\n",
+ "\t\t\t# Now the exit enthalpy is given by\n",
+ "H_2 = H_liq*(1-x) + x*H_vap;\t\t\t#[kJ/kg]\n",
+ "W = - (H_2 - H_1);\t\t\t#[kJ/kg] - Under isentropic conditions\n",
+ "\n",
+ "\t\t\t# We know that, delta_S = q/T_b + S_gen\n",
+ "\t\t\t# Since delta_S = 0, therefore under isentropic conditions\n",
+ "S_gen = 0;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t# Now for output quality 0.9\n",
+ "H_2_a = H_liq*(1-out_qlty) + out_qlty*H_vap;\t\t\t#[kJ/kg]\n",
+ "S_2_a = S_liq*(1-out_qlty) + out_qlty*S_vap;\t\t\t#[kJ/kg]\n",
+ "W_a = - (H_2_a - H_1);\t\t\t#[kJ/kg]\n",
+ "delta_S_a = S_2_a - S_1;\t\t\t#[kJ/kg-k]\n",
+ "\t\t\t# Again, delta_S = q/T_b + S_gen\n",
+ "\t\t\t# Since q = 0, therefore under isentropic conditions\n",
+ "S_gen_a = delta_S_a;\t\t\t#[kJ/kg-K\n",
+ "\t\t\t# Now efficiency is given by eff = delta_H_a/delta_H_s\n",
+ "eff = W_a/W;\n",
+ "\n",
+ "print \" For output quality = 0.9\";\n",
+ "print \" The work output per unit mass is %f kJ/kg\"%(W_a);\n",
+ "print \" The entropy generation is given by S_gen = %f kJ/kg-K\"%(S_gen_a);\n",
+ "print \" The efficiency with respect to reversible adiabatic case is given by eff = %f\"%(eff);\n",
+ "\n",
+ "\t\t\t# Now for output quality 1\n",
+ "out_qlty_1 = 1;\n",
+ "H_2_a_1 = H_liq*(1-out_qlty_1) + out_qlty_1*H_vap;\t\t\t#[kJ/kg]\n",
+ "S_2_a_1 = S_liq*(1-out_qlty_1) + out_qlty_1*S_vap;\t\t\t#[kJ/kg]\n",
+ "W_a_1 = - (H_2_a_1 - H_1);\t\t\t#[kJ/kg]\n",
+ "delta_S_a_1 = S_2_a_1 - S_1;\t\t\t#[kJ/kg-k]\n",
+ "\t\t\t# Again, delta_S = q/T_b + S_gen\n",
+ "\t\t\t# Since q = 0, therefore under isentropic conditions\n",
+ "S_gen_a_1 = delta_S_a_1;\t\t\t#[kJ/kg-K\n",
+ "\t\t\t# Now efficiency is given by eff = delta_H_a/delta_H_s\n",
+ "eff_1 = W_a_1/W;\n",
+ "\n",
+ "print \" For output quality = 1.0\";\n",
+ "print \" The work output per unit mass is %f kJ/kg\"%(W_a_1);\n",
+ "print \" The entropy generation is given by S_gen = %f kJ/kg-K\"%(S_gen_a_1);\n",
+ "print \" The efficiency with respect to reversible adiabatic case is given by eff = %f\"%(eff_1);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " For output quality = 0.9\n",
+ " The work output per unit mass is 1076.787000 kJ/kg\n",
+ " The entropy generation is given by S_gen = 0.519810 kJ/kg-K\n",
+ " The efficiency with respect to reversible adiabatic case is given by eff = 0.866551\n",
+ " For output quality = 1.0\n",
+ " The work output per unit mass is 837.500000 kJ/kg\n",
+ " The entropy generation is given by S_gen = 1.269900 kJ/kg-K\n",
+ " The efficiency with respect to reversible adiabatic case is given by eff = 0.673983\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.15 Page Number : 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of final velocity\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 3.;\t\t\t#[bar] - Initial pressure\n",
+ "T_1 = 150. + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "Vel_1 = 90.;\t\t\t#[m/s] - Initial velocity\n",
+ "P_2 = 1.;\t\t\t#[bar] - Final pressure\n",
+ "eff = 0.95;\t\t\t# Adiabatic effciciency of the nozzle\n",
+ "R = 8.314;\t\t\t#[J/mol*-] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# At 3 bar and 150 C, from steam table\n",
+ "S_1 = 7.0778;\t\t\t#[kJ/kg-K]\n",
+ "H_1 = 2761.0;\t\t\t#[kJ/kg]\n",
+ "S_2 = S_1;\t\t\t# \n",
+ "\n",
+ "\t\t\t# At 1 bar saturated\n",
+ "S_liq = 1.3026;\t\t\t#[kJ/kg-K]\n",
+ "S_vap = 7.3594;\t\t\t#[kJ/kg-K]\n",
+ "H_liq = 417.46;\t\t\t#[kJ/kg]\n",
+ "H_vap = 2675.5;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The dryness factor of exit steam can be determined as\n",
+ "x = (S_1-S_liq)/(S_vap-S_liq);\n",
+ "\t\t\t# Enthalpy of exit steam is given by \n",
+ "H_2 = H_liq*(1-x) + x*H_vap;\t\t\t#[kJ/kg]\n",
+ "delta_H_s = H_2 - H_1;\t\t\t#[kJ/kg] - Enthalpy change\n",
+ "delta_H_a = eff*delta_H_s;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Assuming no heat exchange with surroundings and since no work is done\n",
+ "\t\t\t# delta_H + (delta_V**(2))/2 = 0\n",
+ "delta_Vel_square = 2*(-delta_H_a)*1000;\t\t\t#[m**(2)/s**(2)]\n",
+ "Vel_2 = (delta_Vel_square + Vel_1**(2))**(1./2);\t\t\t#[m/s]\n",
+ "\n",
+ "print \" 1).The final velocity when fluid is steam) is %f m/s\"%(Vel_2);\n",
+ "\n",
+ "\t\t\t# (2)\n",
+ "Y = 1.4;\t\t\t# Index of expansion\n",
+ "Cp_0 = (Y*R)/(Y-1);\t\t\t#[J/mol-K] - Specific heat capacity at constant pressure\n",
+ "\t\t\t# The final temperature has to be determined such that entropy change is zero. Under isentropic conditions\n",
+ "\t\t\t# P_1**(1-Y)*T_1**(Y) = P_2**(1-Y)*T_2**(Y)\n",
+ "T_2 = T_1*(P_1/P_2)**((1-Y)/Y);\t\t\t#[K]\n",
+ "delta_H_s_2 = Cp_0*(T_2 - T_1);\t\t\t#[J/mol]\n",
+ "delta_H_a_2 = eff*delta_H_s_2;\t\t\t#[J/mol]\n",
+ "delta_H_a_2 = (delta_H_a_2*1000)/28.84;\t\t\t#[J/kg]\n",
+ "\n",
+ "delta_Vel_square_2 = 2*(-delta_H_a_2);\t\t\t#[m**(2)/s**(2)]\n",
+ "Vel_2_2 = (delta_Vel_square_2 + Vel_1**(2))**(1./2);\t\t\t#[m/s]\n",
+ "\n",
+ "print \" 2).The final velocity when fluid is air which behaves as an ideal gas) is %f m/s\"%(Vel_2_2);\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The final velocity when fluid is steam) is 608.291583 m/s\n",
+ " 2).The final velocity when fluid is air which behaves as an ideal gas) is 476.065890 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.16 Page Number : 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final velocity and increase in entropy\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 300.;\t\t\t#[kPa] - Initial pressure\n",
+ "T_1 = 450.;\t\t\t#[K] - Initial temperature\n",
+ "Vel_1 = 90.;\t\t\t#[m/s] - Initial velocity\n",
+ "P_2 = 180.;\t\t\t#[kPa] - Final pressure\n",
+ "eff = 0.95;\t\t\t# Adiabatic effciciency of the nozzle\n",
+ "R = 8.314;\t\t\t#[J/mol*-] - Universal gas constant\n",
+ "Cp = 5.19;\t\t\t#[kJ/kg-K] - Specific heat capacity at constant pressure\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# Exit velocity is highest when drop in enthalpy is highest or when isentropic conditions are maintained\n",
+ "\n",
+ "Mol_wt_He = 4;\t\t\t#[g/mol] - Molecular weight of helium\n",
+ "R_He = R/Mol_wt_He;\t\t\t# 'R' for helium\n",
+ "Y = Cp/(Cp - R_He);\n",
+ "\n",
+ "\t\t\t# Now temperature at exit to be determined\n",
+ "T_2s = T_1*(P_1/P_2)**((1-Y)/Y);\t\t\t#[K]\n",
+ "delta_H_2s = Cp*(T_2s - T_1);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Since no work is done and heat exchange is zero,from first law we get\n",
+ "\t\t\t# delta_H + delta_Vel**(2)/2 = 0\n",
+ "delta_Vel_square = 2*(-delta_H_2s)*1000;\t\t\t#[m**(2)/s**(2)]\n",
+ "Vel_2 = (delta_Vel_square)**(1./2);\t\t\t#[m/s] - ( as Vel_1 << Vel_2)\n",
+ "\n",
+ "print \" a).The maximum exit velocity is %f m/s\"%(Vel_2);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "T_2a = 373;\t\t\t#[K] - Measured temperature of helium\n",
+ "delta_H_a = Cp*(T_2a - T_1);\t\t\t#[kJ/kg]\n",
+ "delta_Vel_square_a = 2*(-delta_H_a)*1000;\t\t\t#[m**(2)/s**(2)]\n",
+ "Vel_2a = (delta_Vel_square_a)**(1./2);\t\t\t#[m/s] - ( as Vel_1 << Vel_2a)\n",
+ "\n",
+ "print \" b).The actual exit velocity is %f m/s\"%(Vel_2a);\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "delta_S_sys = Cp*math.log(T_2a/T_1) - R_He*math.log(P_2/P_1);\n",
+ "\t\t\t# we know that delta_S_sys = q/T_b + S_gen and since q = 0, therfore\n",
+ "S_gen = delta_S_sys;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" c).The increasse in entropy per unit mass is %f kJ/kg-K\"%(S_gen);\n",
+ "\n",
+ "\t\t\t# The source of irreversibility is friction in the nozzle.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The maximum exit velocity is 929.607346 m/s\n",
+ " b).The actual exit velocity is 894.013423 m/s\n",
+ " c).The increasse in entropy per unit mass is 0.087748 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.17 Page Number : 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done and heat transfer\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1;\t\t\t#[bar] - Initial pressure\n",
+ "T_1 = 150 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "V_2 = 0.28;\t\t\t#[m**(3)/kg] - Final specific volume\n",
+ "T_2 = T_1;\t\t\t#[K] - Isothermal process\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# At 1 bar and 150 C, from steam table\n",
+ "S_1 = 7.6134;\t\t\t#[kJ/kg-K]\n",
+ "H_1 = 2776.4;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# At 150 C saturated\n",
+ "V_liq = 0.001091;\t\t\t#[m**(3)/kg]\n",
+ "V_vap = 0.3928;\t\t\t#[m**(3)/kg]\n",
+ "H_liq = 632.2;\t\t\t#[kJ/kg]\n",
+ "H_vap = 2746.5;\t\t\t#[kJ/kg]\n",
+ "S_liq = 1.8418;\t\t\t#[kJ/kg-K]\n",
+ "S_vap = 6.8379;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The dryness factor of exit steam can be determined as\n",
+ "x = (V_2 - V_liq)/(V_vap - V_liq);\n",
+ "S_2 = S_liq*(1-x) + x*S_vap;\t\t\t#[kJ/kg-K] -Entropy \n",
+ "H_2 = H_liq*(1-x) + x*H_vap;\t\t\t#[kJ/kg] -Enthalpy \n",
+ "delta_H = H_2 - H_1;\t\t\t#[kJ/kg] - Enthalpy change\n",
+ "delta_S = S_2 - S_1;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Since the compression is reversible\n",
+ "q = T_1*delta_S;\t\t\t#[kJ/kg] - Heat transfer\n",
+ "\t\t\t# From first law q - W = delta_H\n",
+ "W = q - delta_H;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \" 1).The amount of heat transfer when fluid is steam) is %f kJ/kg\"%(q)\n",
+ "print \" The amount of work transfer when fluid is steam) is %f kJ/kg\"%(W)\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "V_2 = V_2*(28.84/1000);\t\t\t#[m**(3)/mol] - Molar volume at exit\n",
+ "\t\t\t# Pressure at exit is given by \n",
+ "P_2 = ((R*T_2)/V_2);\t\t\t#[N/m**(2)]\n",
+ "P_2 = P_2*10**(-5);\t\t\t#[bar]\n",
+ "\n",
+ "\t\t\t# Entropy change is given by, delta_S_2 = Cp*math.log(T_2/T_1) - R*math.log(P_2/P_1), but since T_1 = T_2, therfore\n",
+ "delta_S_2 = - R*math.log(P_2/P_1);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "q_2 = T_1*delta_S_2;\t\t\t#[J/mol] - Heat change\n",
+ "q_2 = q_2/28.84;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# Enthalpy change is given by, delta_H_2 = Cp*(T_2 - T_1) = 0 (as T_1 = T_2)\n",
+ "delta_H_2 = 0;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# From first law q - W = delta_H, therefore\n",
+ "W_2 = q_2 - delta_H_2;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \" 2).The amount of heat transfer when fluid is ideal gas) is %f kJ/kg\"%(q_2)\n",
+ "print \" The amount of work transfer when fluid is ideal gas) is %f kJ/kg\"%(W_2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The amount of heat transfer when fluid is steam) is -936.947741 kJ/kg\n",
+ " The amount of work transfer when fluid is steam) is -298.195149 kJ/kg\n",
+ " 2).The amount of heat transfer when fluid is ideal gas) is -179.526401 kJ/kg\n",
+ " The amount of work transfer when fluid is ideal gas) is -179.526401 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.18 Page Number : 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of air velocity and change in entropy\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 7*10**(5);\t\t\t#[Pa] - Initial pressure\n",
+ "T_1 = 95 + 273.15;\t\t\t#[K] - Initial temperature\n",
+ "P_2 = 3.5*10**(5);\t\t\t#[Pa] - Final pressure\n",
+ "dia = 15*10**(-2);\t\t\t#[m] - Diameter of pipe\n",
+ "m = 2;\t\t\t#[kg/s] - Mass flow rate\n",
+ "R = 8.314;\t\t\t#[J/mol-K] - Universal gas constant\n",
+ "Y = 1.4;\t\t\t# Index of expansion\n",
+ "Cp_0 = (R*Y)/(Y-1);\t\t\t#[J/mol-K] - Specific heat capacity at constant pressure\n",
+ "Cp_0 = (Cp_0/28.84)*1000;\t\t\t#[J/kg-K]\n",
+ "rho_1 = 6.6;\t\t\t#[kg/m**(3)] - Density\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# velocity before throttling is to be determined m = rho*Vol*Area\n",
+ "V_1 = (R*T_1)/P_1;\t\t\t#[m**(3)/mol] - Specific volume\n",
+ "V_1 = (V_1/28.84)*1000;\t\t\t#[m**(3)/kg]\n",
+ "Vel_1 = m/(rho_1*3.14*(dia/2)**(2));\t\t\t#[m/s] - Velocity before throttling\n",
+ "\n",
+ "\t\t\t# Let the temperature after throttling be T_2, then\n",
+ "\t\t\t# V_2 = (((R*T_2)/P_2)/28.84)*1000\n",
+ "\t\t\t# Vel_2 = m/(rho_2*Area) = (m*V_2)/(3.14*(dia/2)**(2))\n",
+ "\t\t\t# From first law, since q = W = 0, we get\n",
+ "\t\t\t# delta_H + (delta_V**(2))/2 = 0\n",
+ "\t\t\t# Cp_0*(T_2 - T_1) + ((Vel_2)**(2) - (Vel_1)**(2))/2 = 0\n",
+ "\t\t\t#Cp_0*(T_2 - T_1) + (((m*((((R*T_2)/P_2)/28.84)*1000))/(3.14*(dia/2)**(2)))**(2) - (Vel_1)**(2))/2 = 0\n",
+ "\t\t\t# Solving the above equation for T_2, we get\n",
+ "def f1(T_2): \n",
+ "\t return Cp_0*(T_2 - T_1) + (((m*((((R*T_2)/P_2)/28.84)*1000))/(3.14*(dia/2)**(2)))**(2) - (Vel_1)**(2))/2\n",
+ "T_2 =fsolve(f1,100)\n",
+ "\t\t\t# Therefore velocity of air downstream of restriction is given by \n",
+ "Vel_2 = ((m*((((R*T_2)/P_2)/28.84)*1000))/(3.14*(dia/2)**(2)));\t\t\t#[m/s]\n",
+ "\n",
+ "print \" The velocity of air downstream of restriction is %f m/s\"%(Vel_2);\n",
+ "\n",
+ "delta_T = (T_2 - T_1);\n",
+ "\t\t\t# Since temperature difference (delta_T) is very small, therefore enthalpy change is also very small\n",
+ "\n",
+ "\t\t\t# Entropy change is given by, delta_S = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1), but since T_1 and T_2 are almost equal\n",
+ "delta_S = - R*math.log(P_2/P_1);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "print \" The change in entropy is %f kJ/mol-k\"%(delta_S);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The velocity of air downstream of restriction is 34.295216 m/s\n",
+ " The change in entropy is 5.762826 kJ/mol-k\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch5_2.ipynb b/Chemical_Engineering_Thermodynamics/ch5_2.ipynb
new file mode 100644
index 00000000..db8558ce
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch5_2.ipynb
@@ -0,0 +1,761 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Exergy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page Number : 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of fraction of the availability loss\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 500+273.15;\t\t\t#[C] - Condensation temperature\n",
+ "T_2 = 250+273.15;\t\t\t#[C] - Temperature at which vaporization takes place.\n",
+ "\n",
+ "T_3 = 25+273.15;\t\t\t#[C] - Ambient atmospheric temperature.\n",
+ "\n",
+ "Q = 1;\t\t\t#We are taking a fictitious value of Q, its value is not given.But we need to initialize it wid some value,so we are taking its value as Q=1.\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#The exergy content of the vapour at 500 C,\n",
+ "Ex_T_1 = Q*(1-(T_3/T_1));\n",
+ "Ex_T_2 = Q*(1-(T_3/T_2));\n",
+ "\t\t\t#Therefore,loss in exergy is given by\n",
+ "Ex_loss = Ex_T_1 - Ex_T_2;\n",
+ "\t\t\t#Fraction of exergy lost due to irreversible process is,\n",
+ "Ex_fraction =(Ex_loss/Ex_T_1);\n",
+ "\n",
+ "# Results\n",
+ "print \" The fraction of exergy lost due to irreversible process is %f\"%(Ex_fraction);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The fraction of exergy lost due to irreversible process is 0.299954\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page Number : 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of availability change and irreversibility\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 300.;\t\t\t#[K] - Initial temperature.\n",
+ "P_1 = 100.;\t\t\t#[kPa] - Initial pressure.\n",
+ "T_2 = 500.;\t\t\t#[K] - Final temperature.\n",
+ "T_0 = 300.;\t\t\t#[K] - Environment temperature.\n",
+ "P_0 = 1.;\t\t\t#[atm] - Environment pressure.\n",
+ "R = 8.314;\t\t\t#[J/mol*K]\n",
+ "\t\t\t#(Cp_0/R)= 3.626\n",
+ "Cp_0 = 3.626*R;\t\t\t#[J/mol-K] - Heat capacity at constant pressure\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1).\n",
+ "\t\t\t#The availability change is given by, (phi_1 - phi_2) = U_1 - U_2 + P_0*(V_1 - V_2) - T_0*(S_1 - S_2)\n",
+ "\t\t\t#Let us determine the change in internal energy\n",
+ "\t\t\t#For ideal gas the molar internal energy change is given by delta_U = Cv_0*(T_2-T_1)\n",
+ "\t\t\t#For ideal gas Cp_0 - Cv_0 = R, and therefore\n",
+ "Cv_0 = ((Cp_0/R)- 1)*R;\t\t\t#[J/mol-K] - Heat capacity at constant volume\n",
+ "delta_U = Cv_0*(T_2-T_1);\t\t\t#[J/mol]\n",
+ "\t\t\t#delta_U = -w (from energy balance). Therefore, U1-U2 = -delta_U.\n",
+ "\t\t\t#The entropy change of ideal gas is given by\n",
+ "\t\t\t#delta_S = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1), but,(P1*V1/T1) = (P1*V1/T1) and therefore (P2/P1) = (T2/T1)\n",
+ "delta_S = Cp_0*math.log(T_2/T_1) - R*math.log(T_2/T_1);\t\t\t#[J/mol-K]\n",
+ "\t\t\t#The exergy change is given by, (phi_1 - phi_2) = U_1 - U_2 + P_0*(V_1 - V_2) - T_0*(S_1 - S_2)\n",
+ "\t\t\t#(V_1 - V_2) = 0, because the tank is rigid and so the volume is constant\n",
+ "delta_phi = (-delta_U) - T_0*(-delta_S);\t\t\t#[J/mol]\n",
+ "print \" 1).The change in exergy is %f J/mol\"%(delta_phi);\n",
+ "\n",
+ "\t\t\t#(2).\n",
+ "\t\t\t#Entropy change of the system is given by, delta_S_sys = q/T_b + S_gen\n",
+ "\t\t\t#Since the system is adiabatic therefore, delta_S_sys = S_gen\n",
+ "S_gen = delta_S;\n",
+ "\t\t\t#Irreversibility is given by\n",
+ "i = T_0*S_gen;\t\t\t#[J/mol]\n",
+ "print \" 2).The value of irreversibility is %f J/mol\"%(i);\n",
+ "\t\t\t#Irreversibility can also be determined using\n",
+ "\t\t\t#i = (W_rev_use - W_use)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The change in exergy is -1020.722863 J/mol\n",
+ " 2).The value of irreversibility is 3345.789937 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page Number : 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of availability change and irreversibility\n",
+ "\n",
+ "import math\n",
+ "# Variables\n",
+ "P_1 = 15.;\t\t\t#[bar] - Initial pressure\n",
+ "P_1 = P_1*10**(5);\t\t\t#[Pa]\n",
+ "T_1 = 300.+273.15;\t\t\t#[K] - Initial temperature\n",
+ "T_0 = 298.15;\t\t\t#[K]\n",
+ "T_R = 1200.;\t\t\t#[K] - Reservoir temerature.\n",
+ "P_0 = 1.;\t\t\t#[bar]\n",
+ "P_0 = P_0*10**(5);\t\t\t#[Pa]\n",
+ "n = 1.;\t\t\t#[mol] - No of moles\n",
+ "R = 8.314;\t\t\t#[J/mol*K]\n",
+ "Y = 1.4;\t\t\t# - Ratio of heat capacities.\n",
+ "Cv_0 = R/(Y-1);\t\t\t#[J/mol-K] - Heat capacity at constant volume\n",
+ "Cp_0 = Cv_0 + R;\t\t\t#[J/mol-K] - Heat capacity at constant pressure\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#V_2 = 2*V_1 and since pressure is constant,we get (V_1/T_1) = (2*V_1/T_1), or, T_2 = 2*T_1.\n",
+ "T_2 = 2*T_1;\t\t\t#[K]\n",
+ "W = P_1*(((R*T_2)/P_1)-((R*T_1)/P_1));\t\t\t#[J/mol] - Actual work done\n",
+ "delta_U = Cv_0*(T_2-T_1);\t\t\t#[J/mol] - Change in internal energy.\n",
+ "q = W + delta_U;\t\t\t#[J/mol] - Heat change\n",
+ "\t\t\t#Now the availability change is given by, (phi_1 - phi_2) = U_1 - U_2 + P_0*(V_1 - V_2) - T_0*(S_1 - S_2) + q*(1-(T_0/T_R))\n",
+ "\t\t\t#delta_S = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1), and P_1 = P_2, Therefore\n",
+ "delta_S = Cp_0*math.log(T_2/T_1);\t\t\t#[J/mol-K] - Entropy change.\n",
+ "\t\t\t#Substituting expressions for delta_phi calculation. Decrease in availability is given by,\n",
+ "delta_phi = (-delta_U) + P_0*(((R*T_1)/P_1)-((R*T_2)/P_1)) - T_0*(-delta_S) + q*(1-(T_0/T_R));\t\t\t#[J/mol]\n",
+ "\t\t\t#Actual work done is given by, W = P_1*(V2-V1)\n",
+ "\t\t\t#Work done to print lace the atmosphere is given by, W = P_0*(V_2-V_1)\n",
+ "\t\t\t#Therefore, W_use = (P_1*(V2-V1) - P_0*(V2-V1))\n",
+ "W_use = (P_1-P_0)*(((R*T_2)/P_1)-((R*T_1)/P_1));\t\t\t#[J/mol] - useful work done\n",
+ "W_rev_use = delta_phi;\t\t\t# reversible useful work done\n",
+ "\t\t\t#Irreversibility is given by,\n",
+ "i = W_rev_use - W_use;\t\t\t#[J/mol]\n",
+ "print \" a).When the system is confined at constant pressure by a piston and is heated until it's volume is doubled \\n the ireversibility value is %f J/mol\"%(i);\n",
+ "\n",
+ "\t\t\t#The irreversibility can also be calculated using \n",
+ "\t\t\t# i = T_0*S_gen\n",
+ "\t\t\t#S_gen = delta_S - (q/T_R)\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t#V2 = 2*V_1 and therefore T_2 = 2*T_1, as P_2 = P_1\n",
+ "\t\t\t#Actual work done is same as before\n",
+ "\t\t\t#Let work done on stirrer be W_stir. Thus net work done by the system is W - W_stir.Fron energy balance we get,\n",
+ "W_stir = W + delta_U;\n",
+ "\t\t\t#Initially the exergy is due to that of the system at state 1 and stirrer work,'W_stir' and finally we have the exergy due to system at state 2,the stirrer work is spent,thus availability is given by\n",
+ "delta_phi_b = (-delta_U) + P_0*(((R*T_1)/P_1)-((R*T_2)/P_1)) - T_0*(-delta_S) + W_stir;\t\t\t#[J/mol]\n",
+ "W_rev_use_b = delta_phi_b;\t\t\t# reversible useful work done\n",
+ "W_use_b = W_use;\t\t\t# useful work done\n",
+ "\t\t\t#Now the irreversibility is given by,\n",
+ "i_b = W_rev_use_b - W_use_b;\t\t\t#[J/mol]\n",
+ "print \" b).When the system is confined at constant pressure by a piston and is stirred until it's volume is doubled \\n the ireversibility value is %f J/mol\"%(i_b);\n",
+ "\n",
+ "\t\t\t#The irreversibility can also be calculated using \n",
+ "\t\t\t# i_b = T_0*S_gen\n",
+ "\t\t\t#S_gen = delta_S - (q/T_R) and here, q = 0\n",
+ "\n",
+ "\t\t\t#(c)\n",
+ "P_2_c = 10;\t\t\t#[bar] - Final pressure, (Given)\n",
+ "P_2_c = P_2_c*10**(5);\t\t\t#[Pa]\n",
+ "\t\t\t#(P_1**(1-Y))*(T_1**(Y)) = (P_2**(1-Y))*(T_2**(Y))\n",
+ "T_2_c = T_1*((P_1/P_2_c)**((1-Y)/Y));\t\t\t#[K]\n",
+ "\t\t\t#Work done is given by, W = -delta_U = -Cv_0*(T_2_c - T_1)\n",
+ "W_c = -Cv_0*(T_2_c - T_1);\t\t\t#[J/mol]\n",
+ "\t\t\t#The final molar volume is calculated using P_1*V_1**(Y) = P_2*V_2**(Y)\n",
+ "\t\t\t#V_2 = V_1*((P_1/P_2_c)**(1/Y))\n",
+ "V_1 = (R*T_1)/P_1;\t\t\t#[cubic metre/mol] - Initial molar volume\n",
+ "V_2 = V_1*((P_1/P_2_c)**(1/Y));\t\t\t#[cubic metre/mol] - Final molar volume\n",
+ "\t\t\t#Now let us determine the work done to print lace the atmosphere,\n",
+ "W_atm_c = P_0*(V_2 - V_1);\t\t\t#[J/mol] - work done to print lace the atmosphere\n",
+ "\t\t\t#Thus useful work is given by,\n",
+ "W_use_c = W - W_atm_c;\t\t\t#[J/mol] - useful work done\n",
+ "\t\t\t#Here delta_S = 0,for reversible adiabatic process.Therefore,\n",
+ "W_rev_use_c = W_use_c;\n",
+ "\t\t\t#Now finally the irreversibility is given by,\n",
+ "i_c = W_rev_use_c - W_use_c;\t\t\t#[J/mol]\n",
+ "print \" c).When the system expands reversibly and adiabatically behind a piston \\n the ireversibility value is %f J/mol\"%(i_c);\n",
+ "\n",
+ "\t\t\t#(d)\n",
+ "\t\t\t#Here temperature is constant,but V_2 = 2*V_1, therefore P_2 = P_1/2\n",
+ "V_2_d = 2*V_1;\n",
+ "P_2_d = P_1/2;\n",
+ "\t\t\t#Under isothermal conditions work done is\n",
+ "W_d = R*T_1*math.log(V_2_d/V_1);\t\t\t#[J/mol]\n",
+ "\t\t\t#Work done to print lace the atmosphere is given by,\n",
+ "W_atm_d = P_0*(V_2_d - V_1);\t\t\t#[J/mol] - work done to print lace the atmosphere\n",
+ "\t\t\t#Thus useful work is given by,\n",
+ "W_use_d = W_d - W_atm_d;\t\t\t#[J/mol] - useful work done\n",
+ "delta_U_d = 0;\t\t\t#isothermal conditions\n",
+ "q_d = W_d;\t\t\t# since, delta_U_d = 0\n",
+ "\t\t\t#delta_S_d = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1), and T_1 = T_2, Therefore\n",
+ "delta_S_d = -R*math.log(P_2_d/P_1);\t\t\t#[J/mol-K] - Entropy change\n",
+ "\t\t\t#The reversible useful work is given by,\n",
+ "W_rev_use_d = P_0*(V_1 - V_2_d) - T_0*(-delta_S_d) + q_d*(1-(T_0/T_R));\t\t\t#[J/mol] - Reversible useful work done.\n",
+ "\t\t\t#The irreversibility is given by,\n",
+ "i_d = W_rev_use_d - W_use_d;\t\t\t#[J/mol]\n",
+ "print \" d).When the system expands reversibly and isothermally behind a piston until it's volume is doubled \\n the ireversibility value is %f J/mol\"%(i_d);\n",
+ "\n",
+ "\t\t\t#(e)\n",
+ "P_2_e = 10;\t\t\t#[bar] - Final pressure, (Given)\n",
+ "P_2_e = P_2_e*10**(5);\t\t\t#[Pa]\n",
+ "\t\t\t#During the expansion of an ideal gas in into vacuum the temperature of the gas remains the same,\n",
+ "T_2_e = T_1;\t\t\t# Final temperature\n",
+ "\t\t\t#Since boundary of the system is fixed so no net work is done, W = 0 and thus\n",
+ "W_use_e = 0;\t\t\t#[J/mol] - Useful work done\n",
+ "\t\t\t#Here, delta_U = 0,as temperature is same and\n",
+ "\t\t\t#(V_1-V_2) = 0,as for overall system there is no change in volume\n",
+ "delta_S_e = - R*math.log(P_2_e/P_1);\t\t\t#[J/mol-K] - Entropy change\n",
+ "\t\t\t#The reversible useful work is given by,\n",
+ "W_rev_use_e = - T_0*(-delta_S_e);\t\t\t#[J/mol] - Reversible useful work done.\n",
+ "\t\t\t#The irreversibility is given by,\n",
+ "i_e = W_rev_use_e - W_use_e;\t\t\t#[J/mol]\n",
+ "print \" e).When the system expands adiabatically into an adjacent chamber \\n the ireversibility value is %f J/mol\"%(i_e);\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).When the system is confined at constant pressure by a piston and is heated until it's volume is doubled \n",
+ " the ireversibility value is 1869.841742 J/mol\n",
+ " b).When the system is confined at constant pressure by a piston and is stirred until it's volume is doubled \n",
+ " the ireversibility value is 6013.652646 J/mol\n",
+ " c).When the system expands reversibly and adiabatically behind a piston \n",
+ " the ireversibility value is 0.000000 J/mol\n",
+ " d).When the system expands reversibly and isothermally behind a piston until it's volume is doubled \n",
+ " the ireversibility value is 897.537657 J/mol\n",
+ " e).When the system expands adiabatically into an adjacent chamber \n",
+ " the ireversibility value is 1005.074654 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page Number : 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of useful work and irreversibility\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 150+273.15;\t\t\t#[K] - Initial temperature.\n",
+ "m = 4.6;\t\t\t#[kg] - mass of water\n",
+ "P_1 = 1;\t\t\t#[MPa] - Initial pressure\n",
+ "Q = 11000;\t\t\t#[kJ] - Heat transferred to the system.\n",
+ "T_R = 600+273.15;\t\t\t#[K] - Temperature of the reservior.\n",
+ "T_0 = 298;\t\t\t#[K] - Temperature of the environment\n",
+ "P_0 = 100;\t\t\t#[kPa] - Pressure of the environment\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#The entropy change of an isothermal system undergoing an internally reversible process is given by,\n",
+ "delta_S_t = (Q/T_1);\t\t\t#[kJ] - Entropy change\n",
+ "delta_S = delta_S_t/m;\t\t\t#[kJ/kg-K] - \n",
+ "\n",
+ "\t\t\t#At 150 C,it has been reported in the book that, P_sat - 0.4758 kPa, V_liq = 0.001091 m**(3)/kg, U_liq = 631.68 kJ/kg, S_liq = 1.8418 kJ/kg-K, S_vap = 6.8379 kJ/kg-K\n",
+ "V_1 = 0.001091;\t\t\t#[m**(3)/kg] - initial specific volume\n",
+ "U_1 = 631.68;\t\t\t#[kJ/kg] - initial specific internal energy\n",
+ "S_1 = 1.8418;\t\t\t#[kJ/kg-K] - initial entropy\n",
+ "\t\t\t#The initial state of the water is a compressed liquid state,and S_1 is therefore equal to the entropy of the saturated liquid of the saturated liquid at the same temperature.\n",
+ "S_2 = S_1 + delta_S;\t\t\t#[kJ/kg-K] - Final entropy\n",
+ "\n",
+ "\t\t\t#At the final state the temperature is 150 C and S = 7.499 kJ/kg-K which is more than S_vap therefore it is superheated steam.\n",
+ "S_final = 7.494;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t#At 150 C, and 0.1 MPa: V = 1.9364 m**(3)/kg, U = 2582.8 kJ/kg, S = 7.6134 kJ/kg-K\n",
+ "\t\t\t#At 150 C, and 0.2 MPa: V = 0.9596 m**(3)/kg, U = 2576.9 kJ/kg, S = 7.2795 kJ/kg-K\n",
+ "U_t_1 = 2582.8;\t\t\t#[kJ/kg] - Internal energy\n",
+ "U_t_2 = 2576.9;\t\t\t#[kJ/kg]\n",
+ "V_t_1 = 1.9364;\t\t\t#[m**(3)/kg] - Specific volume\n",
+ "V_t_2 = 0.9596;\t\t\t#[m**(3)/kg]\n",
+ "S_t_1 = 7.6134;\t\t\t#[kJ/kg-K] - Entropy\n",
+ "S_t_2 = 7.2795;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t#The pressure at exit is given by,\n",
+ "P_2 = ((S_final - S_t_1)/(S_t_2 - S_t_1))*(0.2 - 0.1) + 0.1;\t\t\t#[Mpa] - Final pressure\n",
+ "\t\t\t#At final state\n",
+ "U_2 = U_t_1 + (U_t_2 - U_t_1)*((S_final - S_t_1)/(S_t_2 - S_t_1));\t\t\t#[kJ/kg] - Final specific internal energy\n",
+ "V_2 = V_t_1 + (V_t_2 - V_t_1)*((S_final - S_t_1)/(S_t_2 - S_t_1));\t\t\t#[m**(3)/kg] - Final specific volume\n",
+ "\n",
+ "q = Q/m;\t\t\t#[kJ/kg] - Heat supplied per unit kg of mass.\n",
+ "W_rev_use = U_1 - U_2 + P_0*(V_1 - V_2) - T_0*(S_1 - S_2) + q*(1 - (T_0/T_R));\t\t\t#[kJ/kg] - Reversible useful work done.\n",
+ "\n",
+ "\t\t\t#Now let us calculate the actual work done. We know q - W = delta_U, therefore\n",
+ "W = q - (U_2 - U_1);\t\t\t#[kJ/kg] - Work done\n",
+ "W_use = W - P_0*(V_2 - V_1);\t\t\t#[kJ/kg]\n",
+ "i = W_rev_use - W_use;\t\t\t#[kJ/kg] - Irreversibility\n",
+ "\t\t\t#Since the system contains 4.6 g therefore, \n",
+ "W_use_new = W_use*m;\t\t\t#[kJ]\n",
+ "W_rev_use_new = W_rev_use*m;\t\t\t#[kJ]\n",
+ "I = W_rev_use_new - W_use_new;\t\t\t#[kJ]\n",
+ "\n",
+ "# Results\n",
+ "print \" 1).The useful work obtained is %f kJ\"%(W_use_new);\n",
+ "print \" 2).The reversible usefuk work done is %f kJ\"%(W_rev_use_new);\n",
+ "print \" 3).The irreversibility is %f kJ\"%(I);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The useful work obtained is 1304.987050 kJ\n",
+ " 2).The reversible usefuk work done is 5297.425775 kJ\n",
+ " 3).The irreversibility is 3992.438725 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page Number : 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of reversible work and irreversibility\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 700+273.15;\t\t\t#[K] - Initial temperature.\n",
+ "P_1 = 12;\t\t\t#[MPa] - Initial pressure\n",
+ "P_2 = 0.6;\t\t\t#[MPa] - Final pressure\n",
+ "\t\t\t#At 12 MPa and 700 C,\n",
+ "H_1 = 3858.4;\t\t\t#[kJ/kg] - initial enthalpy\n",
+ "S_1 = 7.0757;\t\t\t#[kJ/kg-K] - initial entropy\n",
+ "\n",
+ "\t\t\t#At 0.6 MPa and 200 C,\n",
+ "H_2 = 2850.1;\t\t\t#[kJ/kg]\n",
+ "S_2 = 6.9673;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t#At 0.6 MPa and 250 C,\n",
+ "H_3 = 2957.2;\t\t\t#[kJ/kg]\n",
+ "S_3 = 7.1824;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t#At 0.6 MPa and 300 C,\n",
+ "H_4 = 3061.6;\t\t\t#[kJ/kg]\n",
+ "S_4 = 7.3732;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#In the case of ideal turbine the entropy change does not take place,therefore the exit conditions are\n",
+ "P_exit = P_2;\t\t\t#[MPa] - exit pressure\n",
+ "T_exit = ((S_1 - S_2)/(S_3 - S_2))*(250 - 200) + 200;\t\t\t#[C] - exit temperature\n",
+ "H_exit = ((S_1 - S_2)/(S_3 - S_2))*(H_3 - H_2) + H_2;\t\t\t#[kJ/kg] - exit enthalpy\n",
+ "\n",
+ "\t\t\t#Snce it is a flow pocess,therfore\n",
+ "\t\t\t#W_rev = H_1 - H_exit - T_0*(S_1 - S_2)\n",
+ "\t\t\t#As S_1 = S_2,the above equation becomes\n",
+ "W_rev_1 = H_1 - H_exit;\t\t\t#[kJ/kg] - reversible work done\n",
+ "\n",
+ "\t\t\t#From the first law the actual work done can be calculated using, delta_H = q - W\n",
+ "\t\t\t#Since the turbine does not exchange heat,therefore W = - delta_H.\n",
+ "W_1 = - (H_exit - H_1);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \" 1).The reversible work done is %f kJ/kg\"%(W_1);\n",
+ "print \" And since the maximum work is same as the actual work ,therefore irreversibility is zero\"\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# Variables\n",
+ "T_0 = 298.15;\t\t\t#[K] - Environment temperature\n",
+ "P_0 = 1;\t\t\t#[atm] - Environment pressure\n",
+ "adi_eff = 0.88;\t\t\t#adiabatc efficiency\n",
+ "\n",
+ "\t\t\t#(H_1 - H_exit_actual)/(H_1 - H_exit) = 0.88, therefore\n",
+ "H_exit_actual = H_1 - 0.88*(H_1 - H_exit);\t\t\t# - Actual exit enthalpy\n",
+ "\n",
+ "\t\t\t#Now two properties i.e pressure = 0.6 MPa and enthalpy = H_exit_actual is fixed at the exit. The exit temperature is given by,\n",
+ "T_exit_actual = ((H_exit_actual - H_3)/(H_4 - H_3))*(300 - 250) + 250;\t\t\t#[C]\n",
+ "S_exit_actual = ((H_exit_actual - H_3)/(H_4 - H_3))*(S_4 - S_3) + S_3;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Now reversible work done is given by,\n",
+ "W_rev_2 = H_1 - H_exit_actual - T_0*(S_1 - S_exit_actual);\t\t\t#[kJ/kg]\n",
+ "print \" 2).The reversible work done is %f kJ/kg\"%(W_rev_2);\n",
+ "\n",
+ "\t\t\t#The actual work is given by the first law,\n",
+ "W_2 = H_1 - H_exit_actual;\t\t\t#[kJ/kg] - Actual work done\n",
+ "i = W_rev_2 - W_2;\t\t\t#[kJ/kg] - irreversibility\n",
+ "print \" The value of irreversibility is %f kJ/kg\"%(i);\n",
+ "\n",
+ "\t\t\t#The irreversibility can also be determined using\n",
+ "\t\t\t# i = T_0*S_gen, and S_gen is given by\n",
+ "\t\t\t# S_gen = (q/T_R) - delta_S\n",
+ "\n",
+ "\t\t\t#The second law efficiency of the turbine is actual work done divided by reversible work,therefore\n",
+ "sec_eff = W_2/W_rev_2;\n",
+ "print \" The second law efficiency of the turbine is %f\"%(sec_eff);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The reversible work done is 954.326778 kJ/kg\n",
+ " And since the maximum work is same as the actual work ,therefore irreversibility is zero\n",
+ " 2).The reversible work done is 905.072590 kJ/kg\n",
+ " The value of irreversibility is 65.265025 kJ/kg\n",
+ " The second law efficiency of the turbine is 0.927890\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page Number : 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of maximum obtainable work and efficiency\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 8.;\t\t\t#[bar] - Initial pressure\n",
+ "T_1 = 93. + 273.15;\t\t\t#[C] - Initial temperature\n",
+ "V_1 = 100.;\t\t\t#[m/s] - Initial velocity\n",
+ "P_2 = 1.25;\t\t\t#[bar] - Exit pressure\n",
+ "T_2 = 27. + 273.15;\t\t\t#[C] - Exit temperature\n",
+ "V_2 = 60.;\t\t\t#[m/s] - Exit velocity \n",
+ "Y = 1.4;\t\t\t#Ratio of specific heat capacities\n",
+ "T_0 = 298.15;\t\t\t#[K] - surrounding temperature\n",
+ "P_0 = 1.;\t\t\t#[bar] - surrounding pressure\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Gas constant\n",
+ "Cp_0 = (R*Y)/(Y-1);\t\t\t#[J/mol-K] - Heat capacity at constant pressure\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Since the amount of heat transfer is negligible,therefore from first law the actual work done is given by,\n",
+ "\t\t\t#W = delta_H + (delta_V_square)/2\n",
+ "delta_H = Cp_0*(T_2 - T_1);\t\t\t#[J/mol] - enthalpy change\n",
+ "delta_H = (delta_H/28.84);\t\t\t#[kJ/kg] - (1 mole = 28.84 g).\n",
+ "delta_V_square = V_2**(2) - V_1**(2);\n",
+ "\n",
+ "W = - delta_H - ((delta_V_square)/2)/1000;\t\t\t#[kJ/kg] - Actual work done\n",
+ "print \" The actual work done is %f kJ/kg\"%(W);\n",
+ "\n",
+ "\t\t\t#Now let us calculate the maximum work that can be obtained\n",
+ "\t\t\t#W_rev = (H_1 + (V_1**(2))/2) - (H_2 + (V_2**(2))/2) - T_0*(S_1 - S_2)\n",
+ "delta_S = Cp_0*math.log(T_2/T_1) - R*math.log(P_2/P_1);\t\t\t#[J/mol-K] - Entropy change\n",
+ "delta_S = delta_S/28.84;\t\t\t#kJ/kg-K]\n",
+ "W_rev = -delta_H - ((delta_V_square/2)/1000) + T_0*delta_S;\t\t\t#[kJ/kg]\n",
+ "print \" The maximum work obtainable per kg of air is %f kJ/kg\"%(W_rev);\n",
+ "\n",
+ "\t\t\t#The second law efficiency of the turbine is actual work done divided by reversible work,therefore\n",
+ "sec_eff = W/W_rev;\n",
+ "print \" The second law efficiency of the turbine is %f\"%(sec_eff);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The actual work done is 69.792718 kJ/kg\n",
+ " The maximum work obtainable per kg of air is 169.550182 kJ/kg\n",
+ " The second law efficiency of the turbine is 0.411635\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page Number : 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of entropy generation rate and irreversibility\n",
+ "\n",
+ "# Variables\n",
+ "m_cold_water = 60;\t\t\t#[kg/s] - mass flow rate of cold water\n",
+ "P_1 = 50;\t\t\t#[kPa]\n",
+ "T_2 = 250;\t\t\t#[C]\n",
+ "T_water_1 = 1000 + 273.15;\t\t\t#[K] - Entering temperature of water\n",
+ "T_water_2 = 450 +273.15;\t\t\t#[K] - Exit temperature of water\n",
+ "T_0 = 298.15;\t\t\t#[K] - surrounding temperature\n",
+ "P_0 = 1;\t\t\t#[atm] - surrounding pressure\n",
+ "Cp_0 = 1.005;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t#For water at 50 kPa under saturated conditions,T_sat = 81.33 C, \n",
+ "H_liq_1 = 340.49;\t\t\t#[kJ/kg] - Enthalpy\n",
+ "S_liq_1 = 1.0910;\t\t\t#[kJ/kg-K] - Entropy\n",
+ "\n",
+ "\t\t\t#For steam at 50 kPa and 250 C,\n",
+ "H_2 = 2976.0;\t\t\t#[kJ/kg]\n",
+ "S_2 = 8.3556;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#The cold stream is water which enters as saturated liquid at 50 kPa and exits as superheated vapour at 50 kPa and 250 C,since pressure drop is neglected.\n",
+ "\t\t\t#The mass flow rate of hot stream can be obtained from energy balance\n",
+ "m_hot_water = (m_cold_water*(H_2 - H_liq_1))/(Cp_0*(T_water_1 - T_water_2));\t\t\t#[kg/s] - mass flow rate of hot water\n",
+ "\n",
+ "\t\t\t#Since there is no heat exchange with the surrounding therefore the total entropy generation is given by\n",
+ "\t\t\t#S_gen = delta_S_hot + delta_S_cold\n",
+ "delta_S_cold = S_2 - S_liq_1;\t\t\t#[kJ/kg-K] - change of entropy of cold water\n",
+ "\t\t\t#delta_S_hot = Cp_0*math.log(T_2/T_1)-R*math.log(P_2/P_1), But pressure drop is zero,therfore\n",
+ "delta_S_hot = Cp_0*math.log(T_water_2/T_water_1);\t\t\t#[kJ/kg-K] - change of entropy of hot water\n",
+ "\n",
+ "S_gen = m_cold_water*delta_S_cold + m_hot_water*delta_S_hot;\t\t\t#[kW/K] - Entropy generated\n",
+ "print \" The entropy generation rate is %f kW/K\"%(S_gen);\n",
+ "\n",
+ "\t\t\t#The irreversibility rete is given by\n",
+ "I = T_0*S_gen;\t\t\t#[kW]\n",
+ "print \" The irreversibility rate of the heat exchanger is %f kW\"%(I);\n",
+ "\n",
+ "\t\t\t#The irreversibility can also be determined using the exergy approach\n",
+ "\t\t\t#We know that, I = W_rev - , but since actual work done zero in heat exchangers,therefore I = W_rev = exergy change\n",
+ "\t\t\t#(si_1 - si_2)_cold = H_1 - H_2 - T_0*(S_1 - S_2)\n",
+ "\t\t\t#(si_1 - si_2)_hot = Cp_0*(T_1 - T_2)- T_0*(S_1 - S_2)\n",
+ "\t\t\t# I = (si_1 - si_2)_cold - (si_1 - si_2)_hot.\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The entropy generation rate is 273.250824 kW/K\n",
+ " The irreversibility rate of the heat exchanger is 81469.733193 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page Number : 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of exit temperature entropy and irreversibility rate\n",
+ "\n",
+ "# Variables\n",
+ "m_water = 10000.;\t\t\t#[kg/h] - Mass flow rate of cold water\n",
+ "m_water = m_water/3600;\t\t\t#[kg/s]\n",
+ "T_1_water = 30. + 273.15;\t\t\t#[K] - Cold water entering temperature\n",
+ "m_HC = 5000.;\t\t\t#[kg/h] - mass flow rate of hot hydrocarbon\n",
+ "m_HC = m_HC/3600;\t\t\t#[kg/s]\n",
+ "T_1_HC = 200. + 273.15;\t\t\t#[K] - Hot hydrocarbon entering temperature\n",
+ "T_2_HC = 100. + 273.15;\t\t\t#[K] - Hot hydrocarbon leaving temperature\n",
+ "Cp_0_water = 1.0;\t\t\t#[kcal/kg-K] - Mean heat capacity of cooling water\n",
+ "Cp_0_HC = 0.6;\t\t\t#[kcal/kg-K] - Mean heat capacity of hydrocarbon\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#Applying energy balance to the heat exchanger,we get\n",
+ "\t\t\t#m_water*Cp_0_water*(T - T_1_water) = m_HC*Cp_0_HC*(T_1_HC - T_2_HC)\n",
+ "T_2_water = ((m_HC*Cp_0_HC*(T_1_HC - T_2_HC))/(m_water*Cp_0_water)) + T_1_water;\t\t\t#[K]\n",
+ "T_2 = T_2_water - 273.15;\t\t\t#[C]\n",
+ "print \" 1).The exit temperature of the cooling water is %f C\"%(T_2);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t#delta_S_hot_HC = Cp_0*math.log(T_2/T_1)-R*math.log(P_2/P_1), But pressure drop is zero,therfore\n",
+ "delta_S_hot_HC = (Cp_0_HC*4.184)*math.log(T_2_HC/T_1_HC);\t\t\t#[kW/K] - change of entropy of hot hydrocarbon\n",
+ "delta_S_HC = m_HC*delta_S_hot_HC;\t\t\t#[kW/K] - Entropy change for hudrocarbon liquid \n",
+ "print \" 2).Entropy change rate of hydrocarbon liquid is %f kW/K\"%(delta_S_HC);\n",
+ "\n",
+ "delta_S_cold_water = (Cp_0_water*4.184)*math.log(T_2_water/T_1_water);\t\t\t#[kW/K] - change of entropy of cooling water\n",
+ "delta_S_water = m_water*delta_S_cold_water;\t\t\t#[kW/K] - Entropy change for water\n",
+ "print \" And entropy change rate of water is %f kW/K\"%(delta_S_water);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "T_0 = 298.15;\t\t\t#[K] - Surrounding temperature\n",
+ "\t\t\t#S_gen = delta_S_cold_water + delta_S_hot_HC = m_water*delta_S_cold_water + m_HC*delta_S_hot_HC;\t\t\t#[kW/K] - Entropy generated\n",
+ "S_gen = delta_S_water + delta_S_HC;\t\t\t#[kW/K]\n",
+ "I = T_0*S_gen;\t\t\t#[kW]\n",
+ "print \" 3).The irreversibility rate of the heat exchanger is %f kW\"%(I);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The exit temperature of the cooling water is 60.000000 C\n",
+ " 2).Entropy change rate of hydrocarbon liquid is -0.827846 kW/K\n",
+ " And entropy change rate of water is 1.096732 kW/K\n",
+ " 3).The irreversibility rate of the heat exchanger is 80.168382 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page Number : 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determinatio of exit temperature availability change and irreversibility\n",
+ "\n",
+ "# Variables\n",
+ "T_1_hotgas = 800.;\t\t\t#[K]\n",
+ "P_1_hotgas = 1.;\t\t\t#[bar]\n",
+ "T_2_hotgas = 700.;\t\t\t#[K]\n",
+ "P_2_hotgas = 1.;\t\t\t#[bar]\n",
+ "T_1_air = 470.;\t\t\t#[K]\n",
+ "P_1_air = 1.;\t\t\t#[bar]\n",
+ "P_2_air = 1.;\t\t\t#[bar]\n",
+ "Cp_0_hotgas = 1.08;\t\t\t#[kJ/kg-K] - Mean heat capacity of hot gas\n",
+ "Cp_0_air = 1.05;\t\t\t#[kcal/kg-K] - Mean heat capacity of air\n",
+ "T_0 = 298.15;\t\t\t#[K] - surrounding temperature\n",
+ "P_0 = 1.;\t\t\t#[bar] - surrounding pressure\n",
+ "\t\t\t#m_air = 2*m_hotgas\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#Assuming heat exchange only takes places in-between the streams,from energy balance we get,\n",
+ "\t\t\t#m_gas*Cp_0_hotgas*(T_2_hotgas - T_1_hotgas) + 2*m_gas*Cp_0_air*(T - T_1_air), \n",
+ "T_2_air = T_1_air - ((Cp_0_hotgas*(T_2_hotgas - T_1_hotgas))/(2*Cp_0_air));\t\t\t#[K] - Temp of emerging air\n",
+ "print \" 1).The temperature of emerging air is %f K\"%(T_2_air);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t#Availability change of hot gas is given by,\n",
+ "\t\t\t#(si_1 - si_2)_hot = H_1 - H_2 - T_0*(S_1 - S_2)\n",
+ "delta_H_hotgas = (Cp_0_hotgas*(T_2_hotgas - T_1_hotgas));\t\t\t#[kJ/kg] - change in enthalpy of hotgas\n",
+ "\t\t\t#delta_S_hotgas = Cp_0_hotgas*math.log(T_2_hotgas/T_1_hotgas)- R*math.log(P_2/P_1), But pressure drop is zero (P_1 = P_2),therfore\n",
+ "delta_S_hotgas = Cp_0_hotgas*math.log(T_2_hotgas/T_1_hotgas);\t\t\t#[kJ/kg-K] - change of entropy of hot gas\n",
+ "delta_si_hotgas = (-delta_H_hotgas) - (-T_0*delta_S_hotgas);\t\t\t#[kJ/kg]\n",
+ "print \" 2).The availability change of hot gas is %f kJ/kg\"%(delta_si_hotgas);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "\t\t\t#Availability change of air is given by,\n",
+ "\t\t\t#(si_1 - si_2)_air = H_1 - H_2 - T_0*(S_1 - S_2)\n",
+ "delta_H_air = (Cp_0_air*(T_2_air - T_1_air));\t\t\t#[kJ/kg] - change in enthalpy of air\n",
+ "\t\t\t#delta_S_air = Cp_0_air*math.log(T_2_air/T_1_air)- R*math.log(P_2/P_1), But pressure drop is zero (P_1 = P_2),therfore\n",
+ "delta_S_air = Cp_0_air*math.log(T_2_air/T_1_air);\t\t\t#[kJ/kg-K] - change of entropy of air\n",
+ "delta_si_air = (-delta_H_air) - (-T_0*delta_S_air);\t\t\t#[kJ/kg]\n",
+ "print \" 3).The availability change of air is %f kJ/kg\"%(delta_si_air);\n",
+ "\n",
+ "\t\t\t#(4)\n",
+ "\t\t\t#For the heat exchanger (Q = 0, W = 0)\n",
+ "\t\t\t#Basis : 1 kg of hot gas flowing through heat exchanger\n",
+ "S_gen = delta_S_hotgas + 2*delta_S_air;\t\t\t#[kJ/kg-K] - (as m_air = 2*m_hotgas)\n",
+ "I = T_0*S_gen;\t\t\t#[kJ/kg]\n",
+ "print \" 4).The irreversibility of thr exchanger per kg of hot gas flowing is %f kJ/kg\"%(I);\n",
+ "\n",
+ "\t\t\t#Irreversibility can also be obtained using\n",
+ "\t\t\t#I = 2*(si_1 - si_2)_air + (si_1 - si_2)_hotgas\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The temperature of emerging air is 521.428571 K\n",
+ " 2).The availability change of hot gas is 65.002625 kJ/kg\n",
+ " 3).The availability change of air is -21.492234 kJ/kg\n",
+ " 4).The irreversibility of thr exchanger per kg of hot gas flowing is 22.018157 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch6_2.ipynb b/Chemical_Engineering_Thermodynamics/ch6_2.ipynb
new file mode 100644
index 00000000..301b4be1
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch6_2.ipynb
@@ -0,0 +1,870 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 :Chemical reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page Number : 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of enthalpy entropy and Gibbs free energy change of reaction\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\t\t\t\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 880;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "a_SO2 = 6.157;\n",
+ "a_SO3 = 3.918;\n",
+ "a_O2 = 6.732;\n",
+ "b_SO2 = 1.384*10**(-2);\n",
+ "b_SO3 = 3.483*10**(-2);\n",
+ "b_O2 = 0.1505*10**(-2);\n",
+ "c_SO2 = -0.9103*10**(-5);\n",
+ "c_SO3 = -2.675*10**(-5);\n",
+ "c_O2 = -0.01791*10**(-5);\n",
+ "d_SO2 = 2.057*10**(-9);\n",
+ "d_SO3 = 7.744*10**(-9);\n",
+ "\n",
+ "delta_H_rkn_298 = -23.45*10**(3);\t\t\t#[cal] - Rkn enthalpy at 298.15 K\n",
+ "delta_H_SO2_for_298 = -70.94*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of S02 at 298.15 K\n",
+ "delta_H_SO3_for_298 = -94.39*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of SO3 at 298.15 K\n",
+ "delta_G_SO2_for_298 = -71.68*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of SO2 at 298.15 K\n",
+ "delta_G_SO3_for_298 = -88.59*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of SO3 at 298.15 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#Smath.tan(math.radiansard enthalpy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_H_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "delta_a = a_SO3 - a_SO2 - (a_O2/2);\n",
+ "delta_b = b_SO3 - b_SO2 - (b_O2/2);\n",
+ "delta_c = c_SO3 - c_SO2 - (c_O2/2);\n",
+ "delta_d = d_SO3 - d_SO2;\n",
+ "\n",
+ "\t\t\t#Cp_0 = delta_a + (delta_b*T) + (delta_c*T**(2)) + (delta_d*T**(3));\n",
+ "\t\t\t#Therefore we get,\n",
+ "\n",
+ "def f44(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "delta_H_rkn_880 = delta_H_rkn_298 + quad(f44,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t#On manual simplification of the above expression,we will get the expression for 'delta_H_rkn_880' as a function of T,\n",
+ " \n",
+ "print \" 1.The expression for smath.tan(math.radiansard enthalpy change of reaction as a function of temperature is given by\";\n",
+ "print \" delta_H_rkn_880 = -22534.57 - 5.605*T + 1.012*10**-2*T**2 - 0.585*10**-5*T**3 + 1.422*10**-9*T**4\"\n",
+ "\n",
+ "print \" 2).Staandard enthalpy change of reaction at 880 K is %f cal\"%(delta_H_rkn_880);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "\t\t\t#Let us determine the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_SO2_298 = (delta_H_SO2_for_298 - delta_G_SO2_for_298)/298.15;\t\t\t#[cal/mol-K]\n",
+ "delta_S_SO3_298 = (delta_H_SO3_for_298 - delta_G_SO3_for_298)/298.15;\t\t\t#[cal/mol-K]\n",
+ "delta_S_O2_298 = 0;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "delta_S_rkn_298 = delta_S_SO3_298 - delta_S_SO2_298 - (delta_S_O2_298/2);\t\t\t#[cal/K]\n",
+ "\n",
+ "def f45(T): \n",
+ "\t return (delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_880 = delta_S_rkn_298 + quad(f45,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" 3).Standard entropy change of reaction at 880 K is %f cal/K\"%(delta_S_rkn_880);\n",
+ "\n",
+ "\t\t\t#(4)\n",
+ "delta_G_rkn_880 = delta_H_rkn_880 - 880*delta_S_rkn_880;\t\t\t#[cal]\n",
+ "\n",
+ "print \" 4).Standard Gibbs free energy change of reaction at 880 K is %f cal\"%(delta_G_rkn_880);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1.The expression for smath.tan(math.radiansard enthalpy change of reaction as a function of temperature is given by\n",
+ " delta_H_rkn_880 = -22534.57 - 5.605*T + 1.012*10**-2*T**2 - 0.585*10**-5*T**3 + 1.422*10**-9*T**4\n",
+ " 2).Staandard enthalpy change of reaction at 880 K is -22766.609215 cal\n",
+ " 3).Standard entropy change of reaction at 880 K is -21.002783 cal/K\n",
+ " 4).Standard Gibbs free energy change of reaction at 880 K is -4284.160417 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page Number : 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of standard enthalpy and Gibbs free energy change of reaction\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 400;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "a_CH3OH = 4.55;\n",
+ "a_CO = 6.726;\n",
+ "a_H2 = 6.952;\n",
+ "b_CH3OH = 2.186*10**(-2);\n",
+ "b_CO = 0.04001*10**(-2);\n",
+ "b_H2 = -0.04576*10**(-2);\n",
+ "c_CH3OH = -0.291*10**(-5);\n",
+ "c_CO = 0.1283*10**(-5);\n",
+ "c_H2 = 0.09563*10**(-5);\n",
+ "d_CH3OH = -1.92*10**(-9);\n",
+ "d_CO = -0.5307*10**(-9);\n",
+ "d_H2 = -0.2079*10**(-9);\n",
+ "\n",
+ "delta_H_rkn_298 = -21.6643*10**(3);\t\t\t#[cal] - Reaction enthalpy at 298.15 K\n",
+ "delta_H_CO_for_298 = -26.4157*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CO at 298.15 K\n",
+ "delta_H_CH3OH_for_298 = -48.08*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CH3OH at 298.15 K\n",
+ "delta_G_CO_for_298 = -32.8079*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CO at 298.15 K\n",
+ "delta_G_CH3OH_for_298 = -38.69*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CH3OH at 298.15 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Smath.tan(math.radiansard enthalpy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_H_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "delta_a = a_CH3OH - a_CO - 2*(a_H2);\n",
+ "delta_b = b_CH3OH - b_CO - 2*(b_H2);\n",
+ "delta_c = c_CH3OH - c_CO - 2*(c_H2);\n",
+ "delta_d = d_CH3OH - d_CO - 2*(d_H2);\n",
+ "\n",
+ "\t\t\t#Cp_0 = delta_a + (delta_b*T) + (delta_c*T**(2)) + (delta_d*T**(3));\n",
+ "\t\t\t#Therefore we get,\n",
+ "\n",
+ "def f56(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "delta_H_rkn_400 = delta_H_rkn_298 + quad(f56,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 400 K is %f cal\"%(delta_H_rkn_400);\n",
+ "\n",
+ "\t\t\t#Let us determine the smath.tan(math.radiansard Gibbs free energy change of reaction at 298.15 K\n",
+ "delta_G_rkn_298 = delta_G_CH3OH_for_298 - delta_G_CO_for_298;\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "\n",
+ "def f57(T): \n",
+ "\t return (delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_400 = delta_S_rkn_298 + quad(f57,T_1,T_2)[0]\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_400 = delta_H_rkn_400 - 400*delta_S_rkn_400;\t\t\t#[cal]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 400 K is %f cal\"%(delta_G_rkn_400);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 400 K is -22587.159576 cal\n",
+ " Standard Gibbs free energy change of reaction at 400 K is -343.363287 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page Number : 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of standard enthalpy and Gibbs free energy change of reaction\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 1200;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "\n",
+ "a_CO2 = 5.316;\n",
+ "a_H2 = 6.952;\n",
+ "a_CO = 6.726;\n",
+ "a_H2O = 7.700;\n",
+ "b_CO2 = 1.4285*10**(-2);\n",
+ "b_H2 = -0.04576*10**(-2);\n",
+ "b_CO = 0.04001*10**(-2);\n",
+ "b_H2O = 0.04594*10**(-2);\n",
+ "c_CO2 = -0.8362*10**(-5);\n",
+ "c_H2 = 0.09563*10**(-5);\n",
+ "c_CO = 0.1283*10**(-5);\n",
+ "c_H2O = 0.2521*10**(-5);\n",
+ "d_CO2 = 1.784*10**(-9);\n",
+ "d_H2 = -0.2079*10**(-9);\n",
+ "d_CO = -0.5307*10**(-9);\n",
+ "d_H2O = -0.8587*10**(-9);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "delta_H_rkn_298 = -9.8382*10**(3);\t\t\t#[cal] - Reaction enthalpy at 298.15 K\n",
+ "delta_H_CO2_for_298 = -94.0518*10**(3);\t\t\t#[cal/mol-K] - Enthalpy of formation of CO2 at 298.15 K\n",
+ "delta_H_CO_for_298 = -26.4157*10**(3);\t\t\t#[cal/mol-K] - Enthalpy of formation of CO at 298.15 K\n",
+ "delta_H_H2O_for_298 = -57.7979*10**(3);\t\t\t#[cal/mol-K] - Enthalpy of formation of H2O at 298.15 K\n",
+ "delta_G_CO2_for_298 = -94.2598*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CO at 298.15 K\n",
+ "delta_G_CO_for_298 = -32.8079*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CH3OH at 298.15 K\n",
+ "delta_G_H2O_for_298 = -54.6357*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of H2O at 298.15 K\n",
+ "\n",
+ "\t\t\t#Smath.tan(math.radiansard enthalpy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_H_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "delta_a = a_CO2 + a_H2 - a_CO - a_H2O;\n",
+ "delta_b = b_CO2 + b_H2 - b_CO - b_H2O;\n",
+ "delta_c = c_CO2 + c_H2 - c_CO - c_H2O;\n",
+ "delta_d = d_CO2 + d_H2 - d_CO - d_H2O;\n",
+ "\n",
+ "\t\t\t#Cp_0 = delta_a + (delta_b*T) + (delta_c*T**(2)) + (delta_d*T**(3));\n",
+ "\t\t\t#Therefore we get,\n",
+ "\n",
+ "def f11(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "delta_H_rkn_1200 = delta_H_rkn_298 + quad(f11,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 1200 K is %f cal\"%(delta_H_rkn_1200);\n",
+ "\n",
+ "\t\t\t#Let us determine the smath.tan(math.radiansard Gibbs free energy change of reaction at 298.15 K\n",
+ "delta_G_rkn_298 = delta_G_CO2_for_298 - delta_G_CO_for_298 - delta_G_H2O_for_298;\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "\n",
+ "def f12(T): \n",
+ "\t return (delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_1200 = delta_S_rkn_298 + quad(f12,T_1,T_2)[0]\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_1200 = delta_H_rkn_1200 - 1200*delta_S_rkn_1200;\t\t\t#[cal]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 1200 K is %f cal\"%(delta_G_rkn_1200);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 1200 K is -7850.182811 cal\n",
+ " Standard Gibbs free energy change of reaction at 1200 K is 953.652749 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page Number : 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of standard enthalpy and Gibbs free energy change of reaction\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 500;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "a_NH3 = 6.5846;\n",
+ "a_N2 = 6.903;\n",
+ "a_H2 = 6.952;\n",
+ "b_NH3 = 0.61251*10**(-2);\n",
+ "b_N2 = -0.03753*10**(-2);\n",
+ "b_H2 = -0.04576*10**(-2);\n",
+ "c_NH3 = 0.23663*10**(-5);\n",
+ "c_N2 = 0.1930*10**(-5);\n",
+ "c_H2 = 0.09563*10**(-5);\n",
+ "d_NH3 = -1.5981*10**(-9);\n",
+ "d_N2 = -0.6861*10**(-9);\n",
+ "d_H2 = -0.2079*10**(-9);\n",
+ "\n",
+ "delta_H_rkn_298 = -22.08*10**(3);\t\t\t#[cal] - Reaction enthalpy at 298.15 K\n",
+ "delta_H_NH3_for_298 = -11.04*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of NH3 at 298.15 K\n",
+ "delta_G_NH3_for_298 = -3.976*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of NH3 at 298.15 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Smath.tan(math.radiansard enthalpy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_H_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "delta_a = 2*a_NH3 - a_N2 - 3*a_H2;\n",
+ "delta_b = 2*b_NH3 - b_N2 - 3*b_H2;\n",
+ "delta_c = 2*c_NH3 - c_N2 - 3*c_H2;\n",
+ "delta_d = 2*d_NH3 - d_N2 - 3*d_H2;\n",
+ "\n",
+ "\t\t\t#Cp_0 = delta_a + (delta_b*T) + (delta_c*T**(2)) + (delta_d*T**(3));\n",
+ "\t\t\t#Therefore we get,\n",
+ "\n",
+ "def f5(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "delta_H_rkn_500 = delta_H_rkn_298 + quad(f5,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 500 K is %f cal\"%(delta_H_rkn_500);\n",
+ "\n",
+ "\t\t\t#Let us determine the smath.tan(math.radiansard Gibbs free energy change of reaction at 298.15 K\n",
+ "delta_G_rkn_298 = 2*delta_G_NH3_for_298;\t\t\t#[cal]\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "\n",
+ "def f6(T): \n",
+ "\t return (delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_500 = delta_S_rkn_298 + quad(f6,T_1,T_2)[0]\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_500 = delta_H_rkn_500 - 500*delta_S_rkn_500;\t\t\t#[cal]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 500 K is %f cal\"%(delta_G_rkn_500);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 500 K is -23925.267197 cal\n",
+ " Standard Gibbs free energy change of reaction at 500 K is 2159.910425 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page Number : 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of standard enthalpy and Gibbs free energy change of reaction\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t#Cp_0 = 7.7 + 0.04594*10**(-2)*T + 0.2521*10**(-5)*T**(2) - 0.8587*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H_rkn_298 = -57.7979*10**(3);\t\t\t#[cal/mol] - Reaction enthalpy at 298.15 K\n",
+ "delta_G_rkn_298 = -54.6351*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of H2O at 298.15 K\n",
+ "\n",
+ "\t\t\t#Smath.tan(math.radiansard enthalpy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_H_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2_1 = 873.15;\t\t\t#[K] - Reaction temperature\n",
+ "T_2_2 = 1000;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Therefore we get,\n",
+ "\n",
+ "def f34(T): \n",
+ "\t return 7.7+0.04594*10**(-2)*T+0.2521*10**(-5)*T**(2)-0.8587*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H_rkn_873 = delta_H_rkn_298 + quad(f34,T_1,T_2_1)[0]\n",
+ "\n",
+ "\n",
+ "def f35(T): \n",
+ "\t return 7.7+0.04594*10**(-2)*T+0.2521*10**(-5)*T**(2)-0.8587*10**(-9)*T**(3)\n",
+ "\n",
+ "delta_H_rkn_1000 = delta_H_rkn_298 + quad(f35,T_1,T_2_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 873 K is %f cal/mol\"%(delta_H_rkn_873);\n",
+ "print \" Standard enthalpy change of reaction at 1000 K is %f cal/mol\"%(delta_H_rkn_1000);\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/mol-K]\n",
+ "\n",
+ "\n",
+ "def f36(T): \n",
+ "\t return (7.7+0.04594*10**(-2)*T+0.2521*10**(-5)*T**(2)-0.8587*10**(-9)*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_873 = delta_S_rkn_298 + quad(f36,T_1,T_2_1)[0]\n",
+ "\n",
+ "\n",
+ "def f37(T): \n",
+ "\t return (7.7+0.04594*10**(-2)*T+0.2521*10**(-5)*T**(2)-0.8587*10**(-9)*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_1000 = delta_S_rkn_298 + quad(f37,T_1,T_2_2)[0]\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_873 = (delta_H_rkn_873 - 873.15*delta_S_rkn_873)*10**(-3);\t\t\t#[kcal/mol]\n",
+ "delta_G_rkn_1000 = (delta_H_rkn_1000 - 1000*delta_S_rkn_1000)*10**(-3);\t\t\t#[kcal/mol]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 873 K is %f kcal/mol\"%(delta_G_rkn_873);\n",
+ "print \" Standard Gibbs free energy change of reaction at 1000 K is %f kcal/mol\"%(delta_G_rkn_1000);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 873 K is -52801.656303 cal/mol\n",
+ " Standard enthalpy change of reaction at 1000 K is -51579.290952 cal/mol\n",
+ " Standard Gibbs free energy change of reaction at 873 K is -51.575573 kcal/mol\n",
+ " Standard Gibbs free energy change of reaction at 1000 K is -51.481661 kcal/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 Page Number : 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of heat exchange\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 500.;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "a_C2H6 = 1.648;\n",
+ "a_O2 = 6.085;\n",
+ "a_CO2 = 5.316;\n",
+ "a_H2O = 7.700;\n",
+ "b_C2H6 = 4.124*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "b_CO2 = 1.4285*10**(-2);\n",
+ "b_H2O = 0.04594*10**(-2);\n",
+ "c_C2H6 = -1.530*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "c_CO2 = -0.8362*10**(-5);\n",
+ "c_H2O = 0.2521*10**(-5);\n",
+ "d_C2H6 = 1.740*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "d_CO2 = 1.784*10**(-9);\n",
+ "d_H2O = -0.8587*10**(-9);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Since excess is entering and leaving at the same temperature,therefore it does not take or give any heat to the system.\n",
+ "\t\t\t#Therefore the heat exchange is only due to heat of raction at temperature T, or Q = delta_H_rkn_T\n",
+ "\n",
+ "delta_H_C2H6_for_298 = -20.236*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of C2H6 at 298.15 K\n",
+ "delta_H_CO2_for_298 = -94.0518*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CO2 at 298.15 K\n",
+ "delta_H_H2O_for_298 = -57.7979*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of H2O at 298.15 K\n",
+ "\n",
+ "delta_H_rkn_298 = 2*delta_H_CO2_for_298 + 3*delta_H_H2O_for_298 - delta_H_C2H6_for_298;\t\t\t#[cal] - Reaction enthalpy at 298.15 K\n",
+ "\n",
+ "\t\t\t#Smath.tan(math.radiansard enthalpy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_H_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "delta_a = 2*a_CO2 + 3*a_H2O - a_C2H6 - 7./2*(a_O2);\n",
+ "delta_b = 2*b_CO2 + 3*b_H2O - b_C2H6 - 7./2*(b_O2);\n",
+ "delta_c = 2*c_CO2 + 3*c_H2O - c_C2H6 - 7./2*(c_O2);\n",
+ "delta_d = 2*d_CO2 + 3*d_H2O - d_C2H6 - 7./2*(d_O2);\n",
+ "\n",
+ "\t\t\t#Cp_0 = delta_a + (delta_b*T) + (delta_c*T**(2)) + (delta_d*T**(3));\n",
+ "\t\t\t#Therefore we get,\n",
+ "\n",
+ "def f55(T): \n",
+ "\t return delta_a+(delta_b*T)+(delta_c*T**(2))+(delta_d*T**(3))\n",
+ "\n",
+ "delta_H_rkn_500 = delta_H_rkn_298 + quad(f55,T_1,T_2)[0]\n",
+ "\n",
+ "delta_H_rkn_500 = delta_H_rkn_500*10**(-3);\t\t\t#[kcal]\n",
+ "\n",
+ "print \" The heat exchange of the reaction at 500 K is %f kcal\"%(delta_H_rkn_500);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The heat exchange of the reaction at 500 K is -340.644585 kcal\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 Page Number : 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of change in entropy\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 600.;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "a_C2H6 = -8.65;\n",
+ "a_H2O = 7.700;\n",
+ "a_CH4 = 4.750;\n",
+ "a_O2 = 6.085;\n",
+ "b_C2H6 = 11.578*10**(-2);\n",
+ "b_H2O = 0.04594*10**(-2);\n",
+ "b_CH4 = 1.200*10**(-2);\n",
+ "b_O2 = 0.3631*10**(-2);\n",
+ "c_C2H6 = -7.540*10**(-5);\n",
+ "c_H2O = 0.2521*10**(-5);\n",
+ "c_CH4 = 0.3030*10**(-5);\n",
+ "c_O2 = -0.1709*10**(-5);\n",
+ "d_C2H6 = 18.54*10**(-9);\n",
+ "d_H2O = -0.8587*10**(-9);\n",
+ "d_CH4 = -2.630*10**(-9);\n",
+ "d_O2 = 0.3133*10**(-9);\n",
+ "\n",
+ "delta_S_CH4_for_298 = 44.50;\t\t\t#[cal/mol-K] - Entropy of formation of CH4 at 298.15 K\n",
+ "delta_S_O2_for_298 = 49.00;\t\t\t#[cal/mol-K] - Entropy of formation of O2 at 298.15 K\n",
+ "delta_S_C2H6_for_298 = 64.34;\t\t\t#[cal/mol-K] - Entropy of formation of C2H6 at 298.15 K\n",
+ "delta_S_H2O_for_298 = 45.11;\t\t\t#[cal/mol-K] - Entropy of formation of C2H6 at 298.15 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Cp_0 = delta_a + (delta_b*T) + (delta_c*T**(2)) + (delta_d*T**(3));\n",
+ "\n",
+ "\t\t\t#Smath.tan(math.radiansard entropy change of reaction at temperature T is given by,\n",
+ "\t\t\t#delta_S_rkn_T = delta_rkn_298 + delta_Cp_0*delta_T\n",
+ "delta_a = 1./6*(a_C2H6) + 3./2*(a_H2O) - a_CH4 - 3./4*(a_O2);\n",
+ "delta_b = 1./6*(b_C2H6) + 3./2*(b_H2O) - b_CH4 - 3./4*(b_O2);\n",
+ "delta_c = 1./6*(c_C2H6) + 3./2*(c_H2O) - c_CH4 - 3./4*(c_O2);\n",
+ "delta_d = 1./6*(d_C2H6) + 3./2*(d_H2O) - d_CH4 - 3./4*(d_O2);\n",
+ "\n",
+ "delta_S_rkn_298 = 1./6*(delta_S_C2H6_for_298) + 3./2*(delta_S_H2O_for_298) - delta_S_CH4_for_298 - 3./4*(delta_S_O2_for_298);\t\t\t#[cal/K]\n",
+ "\n",
+ "def f27(T): \n",
+ "\t return (delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3))/T\n",
+ "\n",
+ "delta_S_rkn_600 = delta_S_rkn_298 + quad(f27,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Change in entropy of the reaction at 298.15 K is %f cal/K\"%(delta_S_rkn_298);\n",
+ "print \" Standard entropy change of reaction at 600 K is %f cal/K\"%(delta_S_rkn_600);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Change in entropy of the reaction at 298.15 K is -2.861667 cal/K\n",
+ " Standard entropy change of reaction at 600 K is -1.880233 cal/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8 Page Number : 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of standard enthalpy change and Gibbs free energy change\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 973.15;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "\t\t\t#At 298.15 K\n",
+ "delta_H_CH4_for_298 = -17.889*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CH4 at 298.15 K\n",
+ "delta_H_C_for_298 = 0.00;\t\t\t#[cal/mol] - Enthalpy of formation of C (s, graphite) at 298.15 K\n",
+ "delta_H_H2_for_298 = 0.00;\t\t\t#[cal/mol] - Enthalpy of formation of H2 at 298.15 K\n",
+ "delta_G_CH4_for_298 = -12.140*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of H2 at 298.15 K\n",
+ "delta_G_C_for_298 = 0.00;\t\t\t#[cal/mol] - Gibbs free energy change for formation of C (s, graphite) at 298.15 K\n",
+ "delta_G_H2_for_298 = 0.00;\t\t\t#[cal/mol] - Gibbs free energy change for formation of H2 at 298.15 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#/Smath.tan(math.radiansaerd heat capacity data in cal/mol-K are given below, T is in K\n",
+ "\t\t\t#Cp_0_CH4 = 4.75 + 1.2*10**(-2)*T + 0.303*10**(-5)*T**(2) - 2.63*10**(-9)*T**(3)\n",
+ "\t\t\t#Cp_0_C = 3.519 + 1.532*10**(-3)*T - 1.723*10**(5)*T**(-2)\n",
+ "\t\t\t#Cp_0_H2 = 6.952 - 0.04576*10**(-2)*T + 0.09563*10**(-5)*T**(2) - 0.2079*10**(-9)*T**(3)\n",
+ "\n",
+ "\t\t\t#Therefore smath.tan(math.radiansard heat capacity of reaction is given by,\n",
+ "\t\t\t#Cp_0_rkn = 2*Cp_0_H2 + Cp_0_C - Cp_0_CH4\n",
+ "\t\t\t#On simplification,we get the relation\n",
+ "\t\t\t#Cp_0_rkn = 12.673 - 0.0113832*T - 1.1174*10**(-6)*T**(2) + 2.2142*10**(-9)*T**(3) - 1.723*10**(5)*T**(-2)\n",
+ "\n",
+ "delta_H_rkn_298 = -delta_H_CH4_for_298;\t\t\t#[cal] - Enthalpy of reaction at 298.15 K\n",
+ "delta_G_rkn_298 = -delta_G_CH4_for_298;\t\t\t#[cal] - Gibbs free energy of the reaction at 298.15 K\n",
+ "\n",
+ "\n",
+ "def f63(T): \n",
+ "\t return 12.673-0.0113832*T-1.1174*10**(-6)*T**(2)+2.2142*10**(-9)*T**(3)-1.723*10**(5)*T**(-2)\n",
+ "\n",
+ "delta_H_rkn_973 = delta_H_rkn_298 + quad(f63,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 973.15 K is %f cal\"%(delta_H_rkn_973);\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/K]\n",
+ "\n",
+ "def f64(T): \n",
+ "\t return (12.673-0.0113832*T-1.1174*10**(-6)*T**(2)+2.2142*10**(-9)*T**(3)-1.723*10**(5)*T**(-2))/T\n",
+ "\n",
+ "delta_S_rkn_973 = delta_S_rkn_298 + quad(f64,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_973 = delta_H_rkn_973 - 973.15*delta_S_rkn_973;\t\t\t#[cal]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 973 K is %f cal\"%(delta_G_rkn_973);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 973.15 K is 21316.998642 cal\n",
+ " Standard Gibbs free energy change of reaction at 973 K is -3880.803382 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 Page Number : 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of standard enthalpy change and Gibbs free energy change\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 1000;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "\t\t\t#At 298.15 K\n",
+ "delta_H_C_for_298 = 0.00;\t\t\t#[cal/mol] - Enthalpy of formation of C(s,graphite) at 298.15 K\n",
+ "delta_H_H2O_for_298 = -57.7979*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of H2O at 298.15 K\n",
+ "delta_H_CO_for_298 = -26.4157*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CO at 298.15 K\n",
+ "delta_H_H2_for_298 = 0.00;\t\t\t#[cal/mol] - Enthalpy of formation of H2 at 298.15 K\n",
+ "delta_G_C_for_298 = 0.00;\t\t\t#[cal/mol] - Gibbs free energy change for formation of C(s, graphite) at 298.15 K\n",
+ "delta_G_H2O_for_298 = -54.6357*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of H2O at 298.15 K\n",
+ "delta_G_CO_for_298 = -32.8079*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CO at 298.15 K\n",
+ "delta_G_H2_for_298 = 0.00;\t\t\t#[cal/mol] - Gibbs free energy change for formation of H2 at 298.15 K\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#/Smath.tan(math.radiansaerd heat capacity data in cal/mol-K are given below, T is in K\n",
+ "\t\t\t#Cp_0_C = 3.519 + 1.532*10**(-3)*T - 1.723*10**(5)*T**(-2)\n",
+ "\t\t\t#Cp_0_H2O = 7.7 + 0.04594*10**(-2)*T + 0.2521*10**(-5)*T**(2) - 0.8587*10**(-9)*T**(3)\n",
+ "\t\t\t#Cp_0_CO = 6.726 + 0.04001*10**(-2)*T + 0.1283*10**(-5)*T**(2) - 0.5307*10**(-9)*T**(3)\n",
+ "\t\t\t#Cp_0_H2 = 6.952 - 0.04576*10**(-2)*T + 0.09563*10**(-5)*T**(2) - 0.2079*10**(-9)*T**(3)\n",
+ "\n",
+ "\t\t\t#Therefore smath.tan(math.radiansard heat capacity of reaction is given by,\n",
+ "\t\t\t#Cp_0_rkn = Cp_0_H2 + Cp_0_CO - Cp_0_C - Cp_0_H2O\n",
+ "\t\t\t#On simplification,we get the relation\n",
+ "\t\t\t#Cp_0_rkn = 2.459 - 2.0489*10**(-3)*T - 2.817*10**(-7)*T**(2) + 1.201*10**(-10)*T**(3) + 1.723*10**(5)*T**(-2)\n",
+ "\n",
+ "delta_H_rkn_298 = delta_H_CO_for_298 + delta_H_H2_for_298 - delta_H_C_for_298 - delta_H_H2O_for_298;\t\t\t#[cal] - Enthalpy of reaction at 298.15 K\n",
+ "delta_G_rkn_298 = delta_G_CO_for_298 + delta_G_H2_for_298 - delta_G_C_for_298 - delta_G_H2O_for_298;\t\t\t#[cal] - Gibbs free energy of the reaction at 298.15 K\n",
+ "\n",
+ "\n",
+ "def f13(T): \n",
+ "\t return 2.459-2.0489*10**(-3)*T-2.817*10**(-7)*T**(2)+1.201*10**(-10)*T**(3)+1.723*10**(5)*T**(-2)\n",
+ "\n",
+ "delta_H_rkn_1000 = delta_H_rkn_298 + quad(f13,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 1000 K is %f cal\"%(delta_H_rkn_1000);\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/K]\n",
+ "\n",
+ "def f14(T): \n",
+ "\t return (2.459-2.0489*10**(-3)*T-2.817*10**(-7)*T**(2)+1.201*10**(-10)*T**(3)+1.723*10**(5)*T**(-2))/T\n",
+ "\n",
+ "delta_S_rkn_1000 = delta_S_rkn_298 + quad(f14,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_1000 = delta_H_rkn_1000 - 1000*delta_S_rkn_1000;\t\t\t#[cal]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 1000 K is %f cal\"%(delta_G_rkn_1000);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 1000 K is 32518.639475 cal\n",
+ " Standard Gibbs free energy change of reaction at 1000 K is -1858.365607 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 Page Number : 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of standard enthalpy change and Gibbs free energy change\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard temperature\n",
+ "T_2 = 1042;\t\t\t#[K] - Reaction temperature\n",
+ "\n",
+ "\t\t\t#At 298.15 K\n",
+ "delta_H_CaCO3_for_298 = -289.5*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CaCO3 at 298.15 K\n",
+ "delta_H_CaO_for_298 = -151.7*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CaO at 298.15 K\n",
+ "delta_H_CO2_for_298 = -94.052*10**(3);\t\t\t#[cal/mol] - Enthalpy of formation of CO2 at 298.15 K\n",
+ "delta_G_CaCO3_for_298 = -270.8*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CaCO3 at 298.15 K\n",
+ "delta_G_CaO_for_298 = -144.3*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CaO at 298.15 K\n",
+ "delta_G_CO2_for_298 = -94.260*10**(3);\t\t\t#[cal/mol] - Gibbs free energy change for formation of CO2 at 298.15 K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#/Smath.tan(math.radiansaerd heat capacity data in cal/mol-K are given below, T is in K\n",
+ "\t\t\t#Cp_0_CO2 = 5.316 + 1.4285*10**(-2)*T - 0.8362*10**(-5)*T**(2) + 1.784*10**(-9)*T**(3)\n",
+ "\t\t\t#Cp_0_CaO = 12.129 + 0.88*10**(-3)*T + 2.08*10**(5)*T**(-2)\n",
+ "\t\t\t#Cp_0_CaCO3 = 24.98 + 5.240*10**(-3)*T + 6.199*10**(5)*T**(-2)\n",
+ "\n",
+ "\t\t\t#Therefore smath.tan(math.radiansard heat capacity of reaction is given by,\n",
+ "\t\t\t#Cp_0_rkn = Cp_0_CO2 + Cp_0_CaO - Cp_0_CaCO3\n",
+ "\t\t\t#On simplification,we get the relation\n",
+ "\t\t\t#Cp_0_rkn = -7.535 + 9.925*10**(-3)*T - 0.8362*10**(-5)*T**(2) + 1.784*10**(-9)*T**(3) + 4.119*10**(5)*T**(-2)\n",
+ "\n",
+ "delta_H_rkn_298 = delta_H_CaO_for_298 + delta_H_CO2_for_298 - delta_H_CaCO3_for_298;\t\t\t#[cal] - Enthalpy of reaction at 298.15 K\n",
+ "delta_G_rkn_298 = delta_G_CaO_for_298 + delta_G_CO2_for_298 - delta_G_CaCO3_for_298;\t\t\t#[cal] - Gibbs free energy of the reaction at 298.15 K\n",
+ "\n",
+ "\n",
+ "def f38(T): \n",
+ "\t return -7.535+9.925*10**(-3)*T-0.8362*10**(-5)*T**(2)+1.784*10**(-9)*T**(3)+4.119*10**(5)*T**(-2)\n",
+ "\n",
+ "delta_H_rkn_1042 = delta_H_rkn_298 + quad(f38,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "print \" Standard enthalpy change of reaction at 1042 K is %f cal\"%(delta_H_rkn_1042);\n",
+ "\n",
+ "\t\t\t#Now determining the smath.tan(math.radiansard entropy change of reaction at 298.15 K\n",
+ "delta_S_rkn_298 = (delta_H_rkn_298 - delta_G_rkn_298)/298.15;\t\t\t#[cal/K]\n",
+ "\n",
+ "def f39(T): \n",
+ "\t return (-7.535+9.925*10**(-3)*T-0.8362*10**(-5)*T**(2)+1.784*10**(-9)*T**(3)+4.119*10**(5)*T**(-2))/T\n",
+ "\n",
+ "delta_S_rkn_1042 = delta_S_rkn_298 + quad(f39,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t#Therefore,the smath.tan(math.radiansard Gibbs free energy change of the reaction is given by,\n",
+ "delta_G_rkn_1042 = delta_H_rkn_1042 - 1042*delta_S_rkn_1042;\t\t\t#[cal]\n",
+ "\n",
+ "print \" Standard Gibbs free energy change of reaction at 1042 K is %f cal\"%(delta_G_rkn_1042);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Standard enthalpy change of reaction at 1042 K is 41518.919956 cal\n",
+ " Standard Gibbs free energy change of reaction at 1042 K is 4873.416608 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch7_2.ipynb b/Chemical_Engineering_Thermodynamics/ch7_2.ipynb
new file mode 100644
index 00000000..11e9b4cd
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch7_2.ipynb
@@ -0,0 +1,1575 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Thermodynamic property relations of pure substance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 Page Number : 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of entropy change\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 1;\t\t\t#[MPa] - Initial pressure\n",
+ "P_2 = 1.4;\t\t\t#[MPa] - Final pressure\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#We know that\n",
+ "\t\t\t# dS = (Cp/T)*dT - (dV/dT)*dP\n",
+ "\t\t\t# Along an isothermal path,integration of above expression between states 1 and 2 yields\n",
+ "\t\t\t# S_2 - S_1 = - integral((dV/dT)*dP)_P\n",
+ "\t\t\t# An estimate can be made by assuming that (dV/dT)_P remains constant over the range of pressure from P_1 to P_2 and evaluating the derivative at average pressure of 1.2 MPa\n",
+ "P_avg = P_2;\n",
+ "\t\t\t# S_2 - S_1 = -integral((dV/dT)*dP)_Pavg*(P_2 - P_1)\n",
+ "\t\t\t# (dV/dT)_P=1.2MPa = ((V_350 - V_250)/(350 - 250))\n",
+ "dV_dT = (0.2345 - 0.19234)/100;\t\t\t#[m**(3)/kg-K]\n",
+ "\t\t\t#Therefore\n",
+ "delta_S = -dV_dT*(P_2 - P_1)*1000;\t\t\t#[kJ/kg-K] - Entropy change\n",
+ "\n",
+ "# Results\n",
+ "print \"The change in entropy is given by S_2-S_1 = %f kJ/kg-K\"%(delta_S);\n",
+ "\n",
+ "\t\t\t#Let us compare this tabulated values. At 1MPA and 300 C, S_1 = 7.1229 kJ/kg-K. At 1.4 MPa and 300 C, S_2 = 6.9534 kJ/kg-K. \n",
+ "\t\t\t#Therefore S_2 - S_1 = -0.1695 kJ/kg-K\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy is given by S_2-S_1 = -0.168640 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 Page Number : 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of work done\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\t\t\t\n",
+ "# Variables\n",
+ "T = 25. + 273.15;\t\t\t#[K] - Temperature of the surrounding\n",
+ "P_1 = 1.;\t\t\t#[atm] - Initial pressure\n",
+ "P_2 = 1000.;\t\t\t#[atm] - Final pressure\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# V = 18.066 - 7.15*10**(-4)*P + 4.6*10**(-8)*P**(2) where, V is in 'cm**(3)/mol' and P is in 'atm\n",
+ "\t\t\t# (dV/dT)_P = 0.0045 + 1.4*10**(-6)*P ;\t\t\t#cm**(3)/mol-K\n",
+ "\n",
+ "\t\t\t# The work done by 1 mol is given by W = integral(P*dV)\n",
+ "\t\t\t# Differentiating both sides of the expression for V, we get\n",
+ "\t\t\t# dV = -7.15*10**(-4)*dP + 9.2*10**(-8)*(P*dP) \n",
+ "\t\t\t# P*dV = -7.15*10**(-4)*P*dP + 9.2*10**(-8)*(P**(2)*dP)\n",
+ "\n",
+ "\t\t\t# The work done is given by\n",
+ "\n",
+ "def f58(P): \n",
+ "\t return -7.15*10**(-4)*P + 9.2*10**(-8)*(P**(2))\n",
+ "\n",
+ "W = quad(f58,P_1,P_2)[0];\t\t\t#[atm-cm**(3)[0]\n",
+ "\n",
+ "W = W*101325*10**(-6);\t\t\t#[J/mol]\n",
+ "\n",
+ "print \"The necessary work to compress water from 1 atm to 1000 atm is %f J/mol\"%(W);\n",
+ "\n",
+ "\t\t\t#Let us calculate the amount of heat transfer\n",
+ "\t\t\t# q = integral(T*dS)\n",
+ "\t\t\t# dS = ((ds/dT)_P)*dT + ((dS/dP)_T)*dP\n",
+ "\t\t\t# Since the temperature is constant the first term is zero and\n",
+ "\t\t\t# dS = ((dS/dP)_T)*dP = -((dV/dT)_P)*dP\n",
+ "\t\t\t# Thus, q = integral(T*dS) = T*(integral(dS)) ( as temperature is constant )\n",
+ "\t\t\t# or, q = -T*(integral((dV/dT)_P)*dP)\n",
+ "\n",
+ "\t\t\t# Thus the heat transfer is given by\n",
+ "\n",
+ "def f59(P): \n",
+ "\t return 0.0045+1.4*10**(-6)*P\n",
+ "\n",
+ "q = -T* quad(f59,P_1,P_2)[0];\t\t\t#[atm-cm**(3)[0]\n",
+ "\n",
+ "q = q*101325*10**(-6);\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# q - W = delta_U\n",
+ "\t\t\t# Thus delta_U is given by\n",
+ "delta_U = q - W;\t\t\t#[J/mol]\n",
+ "\n",
+ "print \"The change in internal energy is %f J/mol\"%(delta_U);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The necessary work to compress water from 1 atm to 1000 atm is -33.116351 J/mol\n",
+ "The change in internal energy is -123.839936 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.12 Page Number : 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Evaluation of beta and K for nitrogen gas\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 25+273.15;\t\t\t#[K] - Temperature\n",
+ "P = 1;\t\t\t#[atm] - Pressure\n",
+ "P = P*101325;\t\t\t#[Pa]\n",
+ "Tc = 126.2;\t\t\t#[K] - Critical temperature\n",
+ "Pc = 34;\t\t\t#[bar] - Critical pressure\n",
+ "Pc = Pc*10**(5);\t\t\t#[Pa]\n",
+ "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "a = (27*R**(2)*Tc**(2)/(64*Pc));\t\t\t#[Pa-m**(6)/mol**(2)]\n",
+ "b = (R*Tc)/(8*Pc);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# the cubic form of van der Walls equation of state is\n",
+ "\t\t\t# V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P=0\n",
+ "\t\t\t#Solving the cubic equation\n",
+ "def f(V): \n",
+ "\t return V**(3)-(b+(R*T)/P)*V**(2)+(a/P)*V-(a*b)/P\n",
+ "V = fsolve(f,1)\n",
+ "\t\t\t#The above equation has 1 real and 2 imaginary roots. We consider only real root.\n",
+ "\n",
+ "Beta = R/((P*V)-(a/V)+((2*a*b)/V**(2)));\t\t\t#[K**(-1)]\n",
+ "\n",
+ "K_t = (V-b)/((P*V)-(a/V)+((2*a*b)/V**(2)));\t\t\t#[Pa**(-1)]\n",
+ "K_t = K_t*101325;\t\t\t#[atm**(-1)]\n",
+ "\n",
+ "print \" Beta\\t = \\t %f K**-1)\"%(Beta);\n",
+ "print \" K_t\\t = \\t %f atm**-1)\"%(K_t);\n",
+ "\n",
+ "\t\t\t#For ideal gas, Beta = 1/T = 0.0033354 K**(-1) and K_t = 1/P = 1 atm**(-1)\n",
+ "\t\t\t# So results obtained are convergent with those obtained assuming ideal gas.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Beta\t = \t 0.003364 K**-1)\n",
+ " K_t\t = \t 1.000672 atm**-1)\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.13 Page Number : 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of temperature change and entropy change of water\n",
+ "\n",
+ "# Variables\n",
+ "T = 45+273.15;\t\t\t#[K]\n",
+ "P_1 = 10;\t\t\t#[kPa] - Initial pressure\n",
+ "P_2 = 8600;\t\t\t#[kPa] - Final pressure\n",
+ "V = 1010;\t\t\t#[cm**(3)/kg] - Specific volume for saturated liquid water at 45 C\n",
+ "V = V*10**(-6);\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# Beta = (1/V)*(dV/dT)_P\n",
+ "Beta = 4.25*10**(-4);\t\t\t#[k**(-1)]\n",
+ "Cp = 4.178;\t\t\t#[kJ/kg-K] - Specific heat at constant pressure\n",
+ "eff = 0.75;\t\t\t# Efficiency of the pump\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t#when efficiency of the pump is 100% , W = -delta_Hs\n",
+ "\t\t\t# Now delta_H = T*dS + V*dP, therefore under isentropic conditions, dH = V*dP\n",
+ "\t\t\t# Since the fluid is liquid, therefore the specific volume can be taken to be constant and integrating the above equaton we get\n",
+ "\t\t\t# delta_Hs = V*dP\n",
+ "delta_Hs = V*(P_2 - P_1);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Actual pumps are not isentropic and therefore not 100% efficient. Therefore actual work done by the pump is given by\n",
+ "W = -delta_Hs/eff;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \" 1).The work done by the pump is %f kJ/kg\"%(W);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# We know that dH = Cp*dT + (1 - Beta*T)*V*dP\n",
+ "\t\t\t# Beta and V are weak functions of pressure in the case of liquids.\n",
+ "\t\t\t# Integrating the above equation we get\n",
+ "\t\t\t# delta_H = Cp*delta_T + (1 - Beta*T)*V*(delta_P)\n",
+ "\t\t\t# Now from energy balance delta_H = q - W . But q = 0. Therefore,\n",
+ "delta_H = -W;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Solving for delta_T\n",
+ "delta_T = (delta_H - (1 - Beta*T)*V*(P_2-P_1))/Cp;\n",
+ "\n",
+ "print \" 2).The temperature of water change by delta_T = %f K\"%(delta_T);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "T_1 = T;\t\t\t#[K]\n",
+ "T_2 = T + delta_T;\t\t\t#[K]\n",
+ "\t\t\t# dS = (Cp/T)*dT - Beta*V*dP\n",
+ "\t\t\t# Beta and V are weak functions of pressure in the case of liquids. Integrating the above equation we get\n",
+ "delta_S = Cp*math.log(T_2/T_1) - Beta*V*(P_2-P_1);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" 3).The entropy change of water is given by delta_S = %f kJ/kg-K\"%(delta_S);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The work done by the pump is -11.567867 kJ/kg\n",
+ " 2).The temperature of water change by delta_T = 0.972970 K\n",
+ " 3).The entropy change of water is given by delta_S = 0.009070 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.14 Page Number : 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of change in entropy and enthalpy\n",
+ "\n",
+ "# Variables\n",
+ "T = 270;\t\t\t#[K]\n",
+ "P_1 = 381;\t\t\t#[kPa] - Initial pressure\n",
+ "P_2 = 1200;\t\t\t#[kPa] - Final pressure\n",
+ "V_liq = 1.55*10**(-3);\t\t\t#[m**(3)/kg] - Specific volume for saturated water in liquid phase at 270 C\n",
+ "Beta = 2.095*10**(-3);\t\t\t#[K**(-1)]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#dH = Cp*dT + [V - T*(dV/dT)_P]*dP\n",
+ "\t\t\t# dS = (Cp/T)*dT - ((dV/dT)_P)*dP\n",
+ "\t\t\t# Since isothermal conditions are maintained we get\n",
+ "\t\t\t# dH = [V - T*(dV/dT)_P]*dP = V*(1 - Beta*T)*dP\n",
+ "\t\t\t# For the liquid assuming V and Beta to remain constant during pressure change, and since temperature is constant we get\n",
+ "delta_H = V_liq*(1 - Beta*T)*(P_2 - P_1);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \"The enthalpy change is given by delta_H = %f kJ/kg\"%(delta_H);\n",
+ "\n",
+ "\t\t\t# Under isothermal conditions \n",
+ "\t\t\t# dS = -((dV/dT)_P)*dP = -Beta*V_liq*dP\n",
+ "\t\t\t# If Beta*V is assumed to remain constant during pressure change we get\n",
+ "delta_S = -Beta*V_liq*(P_2-P_1);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \"The entropy change is given by delta_S = %e kJ/kg-K\"%(delta_S);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The enthalpy change is given by delta_H = 0.551386 kJ/kg\n",
+ "The entropy change is given by delta_S = -2.659498e-03 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.15 Page Number : 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of percentage change in volume\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 0;\t\t\t#[C] - Initial tempetaure\n",
+ "T_2 = 100;\t\t\t#[C] - Final temperature\n",
+ "\t\t\t# Beta = 1.0414*10**(-3) + 1.5672*10**(-6)*T + 5.148*10**(-8)*T**(2), where T is in C\n",
+ "\t\t\t# At constant pressure (1/V)*(dV/dT) = Beta\n",
+ "\t\t\t# or, d(math.log(V)) = Beta*dT\n",
+ "\t\t\t# Integrating we get math.log(V_2/V_1) = integral(Beta*dT) from limit T_1 to T_2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "def f62(T): \n",
+ "\t return 1.0414*10**(-3)+1.5672*10**(-6)*T+5.148*10**(-8)*T**(2)\n",
+ "\n",
+ "integral = quad(f62,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t# math.log(V_2/V_1) = integral\n",
+ "\t\t\t# (V_2/V_1) = exp(integral)\n",
+ "\t\t\t# (V_2 - V_1)/V_1 = change = exp(integral) - 1;\n",
+ "change = math.exp(integral) - 1;\n",
+ "per_change = 100*change;\n",
+ "\n",
+ "print \"The percentage change in volume = %f %%\"%(per_change);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in volume = 13.784486 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.16 Page Number : 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of enthalpy and entropy change\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 25 + 273.15;\t\t\t#[C] - Initial tempetaure\n",
+ "T_2 = 50 + 273.15;\t\t\t#[C] - Final temperature\n",
+ "P_1 = 1;\t\t\t#[bar] - Initial pressure\n",
+ "P_2 = 1000;\t\t\t#[bar] - Final pressure\n",
+ "\n",
+ "Cp_T1_P1 = 75.305;\t\t\t#[J/mol-K]\n",
+ "Cp_T2_P1 = 75.314;\t\t\t#[J/mol-K]\n",
+ "V_T1_P1 = 18.071;\t\t\t#[cm**(3)/mol]\n",
+ "V_T1_P2 = 18.012;\t\t\t#[cm**(3)/mol]\n",
+ "V_T2_P1 = 18.234;\t\t\t#[cm**(3)/mol]\n",
+ "V_T2_P2 = 18.174;\t\t\t#[cm**(3)/mol]\n",
+ "Beta_T1_P1 = 256*10**(-6);\t\t\t#[K**(-1)]\n",
+ "Beta_T1_P2 = 366*10**(-6);\t\t\t#[K**(-1)]\n",
+ "Beta_T2_P1 = 458*10**(-6);\t\t\t#[K**(-1)]\n",
+ "Beta_T2_P2 = 568*10**(-6);\t\t\t#[K**(-1)]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The entropy change is given by\n",
+ "\t\t\t# dS = (Cp/T)*dT - ((dV/dT)_P)*dP\n",
+ "\t\t\t# The mean Cp between 25 and 50 C is \n",
+ "Cp_mean = (Cp_T1_P1 + Cp_T1_P1)/2;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "\n",
+ "\t\t\t# (dV/dT)_P=1bar = (V_T2_P1 - V_T1_P1)/(50 - 25)\n",
+ "dV_dT_P1 = ((V_T2_P1 - V_T1_P1)/(50 - 25))*10**(-6);\t\t\t#[m**(-3)/mol-K]\n",
+ "dV_dT_P2 = ((V_T2_P2 - V_T1_P2)/(50 - 25))*10**(-6);\t\t\t#[m**(-3)/mol-K]\n",
+ "\t\t\t# The mean value of (dV/dT)_P between 1 and 1000 bar is\n",
+ "dV_dT_mean = (dV_dT_P1 + dV_dT_P2)/2;\t\t\t#[m**(-3)/mol-K]\n",
+ "delta_S = Cp_mean*math.log(T_2/T_1) - dV_dT_mean*(P_2 - P_1)*10**(5);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "print \" The value of entropy change is given by delta_S = %f J/mol-K\"%(delta_S);\n",
+ "\n",
+ "\t\t\t# Now let us determine the enthalpy change. We know that\n",
+ "\t\t\t# dH = Cp*dT + [V - T*(dV/dT)_P]*dP\n",
+ "\t\t\t# [V - T*(dV/dT)_P] = (V - T*V*Beta) = val (say)\n",
+ "\t\t\t# At state 1\n",
+ "val_1 = ((V_T1_P1)*10**(-6))*(1 - (T_1)*(Beta_T1_P1));\t\t\t#[m**(3)/mol]\n",
+ "\t\t\t# At state 2\n",
+ "val_2 = ((V_T2_P2)*10**(-6))*(1 - (T_2)*(Beta_T2_P2));\t\t\t#[m**(3)/mol]\n",
+ "val_mean = (val_1 + val_2)/2;\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "delta_H = Cp_mean*(T_2 - T_1) + val_mean*(P_2-P_1)*10**(5);\t\t\t#[J/mol]\n",
+ "\n",
+ "print \" The value of enthalpy change is given by delta_H = %f J/mol\"%(delta_H);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of entropy change is given by delta_S = 5.414201 J/mol-K\n",
+ " The value of enthalpy change is given by delta_H = 3457.542629 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.22 Page Number : 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of volume expansivity and isothermal compressibility\n",
+ "\n",
+ "# Variables\n",
+ "T = 100 + 273.15;\t\t\t#[K]\n",
+ "P = 10;\t\t\t#[MPa]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The volume expansivity is defined as \n",
+ "\t\t\t# Beta = (1/V)*(del V/del T)_P = (1/V)*(dV/dT)_P\n",
+ "\t\t\t# From compressed liquid water tables at 100 C and 10 MPa,\n",
+ "V = 0.0010385;\t\t\t#[m(3)/kg]\n",
+ "Beta = (1/V)*((0.0010549 - 0.0010245)/(120 - 80));\t\t\t#[K**(-1)] \t\t\t# The values are obtained from the steam table as reported in the book.\n",
+ "\n",
+ "print \"The value of volume expansivity is Beta = %e K**-1)\"%(Beta);\n",
+ "\n",
+ "\t\t\t#Isothermal compressibility is defined as\n",
+ "\t\t\t# K_t = -(1/V)*(del V/del T)_T = -(1/V)*(dV/dT)_T\n",
+ "K_t = -(1/V)*((0.0010361 - 0.0010410)/(15 - 5));\t\t\t#[MPa**(-1)] \t\t\t# The values are obtained from the steam table as reported in the book.\n",
+ "\n",
+ "K_t = K_t*10**(-3);\t\t\t#[kPa]\n",
+ "\n",
+ "print \"The value of isothermal compressibility is K_t = %e kPa**-1)\"%(K_t);\n",
+ "\n",
+ "\t\t\t# Cp - Cv = (T*V*(Beta**(2)))/K_t\n",
+ "R = (T*V*(Beta**(2)))/K_t;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \"The value of the difference between Cp and Cv is Cp-Cv = %f kJ/kg-K\"%(R);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of volume expansivity is Beta = 7.318247e-04 K**-1)\n",
+ "The value of isothermal compressibility is K_t = 4.718344e-07 kPa**-1)\n",
+ "The value of the difference between Cp and Cv is Cp-Cv = 0.439860 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.23 Page Number : 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of specific heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "T = 300 + 273.15;\t\t\t#[K]\n",
+ "P = 4;\t\t\t#[MPa] \n",
+ "\n",
+ "# Calculations and Results\n",
+ "Cp_0 = 7.7 + 0.04594*10**(-2)*T + 0.2521*10**(-5)*T**(2) - 0.8587*10**(-9)*T**(3);\t\t\t#[cal/mol-K]\n",
+ "Cp_0 = (Cp_0*4.186)/18.015;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t# Cp(T,P) = Cp_0(T,P=0) - T*integral((del**2 V/del T**(2))_P)*dP from limit 0 to P\n",
+ "\t\t\t# Cp = Cp_0 - T*((del**2 V/del T**2)_Pavg)*(P_2 - P_1)\n",
+ "\n",
+ "P_avg = (0+4)/2;\t\t\t#[MPa]\n",
+ "\n",
+ "\t\t\t#Using finite difference we get (del**2 V/del T**(2)) = ((V_(T+delta T) - 2*V_T + V_(T-delta T))/(delta_T**(2))\n",
+ "\t\t\t#(del**2 V/del T**(2))_Pavg = (V_(350 C) + V_(250 C) - 2*V_(300 C))/(delta_T**(2)) = del_2 (say)\n",
+ "del_2 = (0.13857 + 0.11144 - 2*0.12547)/(50**(2));\t\t\t#[m**(3)/kg-K**2] \t\t\t# The values are obtained from the steam table as reported in the book.\n",
+ "\n",
+ "\n",
+ "Cp = Cp_0 - T*del_2*4000;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "print \" The value of constant pressure specific heat capacity is Cp = %f kJ/kg-K\"%(Cp);\n",
+ "\n",
+ "\t\t\t# At P = 4 MPa\n",
+ "\t\t\t# Cp = (del H/del T)_P = (H_350 C - H_250 C)/(350 - 250.4)\n",
+ "\t\t\t# Cp = (3092.5 - 2801.4)/(350 - 250.4) = 2.923 [kJ/kg-K]\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of constant pressure specific heat capacity is Cp = 2.858079 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.24 Page Number : 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of specific heat capacity\n",
+ "\n",
+ "# Variables\n",
+ "T = 300 + 273.15;\t\t\t#[K]\n",
+ "P = 2.0;\t\t\t#[MPa]\n",
+ "\n",
+ "\t\t\t# At 2 MPa and 250 C \n",
+ "H_1 = 2902.5;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# At 2 MPa and 350 C \n",
+ "H_2 = 3137.0;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Calculations\n",
+ "Cp = (H_2 - H_1)/(350 - 250);\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of constant pressure specific heat capacity is Cp = %f kJ/kg-K\"%(Cp);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of constant pressure specific heat capacity is Cp = 2.345000 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.25 Page Number : 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of volume expansivity and isothermal compressibility\n",
+ "\n",
+ "# Variables\n",
+ "T = 80 + 273.15;\t\t\t#[K]\n",
+ "P = 10;\t\t\t#[MPa] \n",
+ "\n",
+ "V_1 = 0.0010245;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# At 60 C and 10 MPa\n",
+ "V_2 = 0.0010127;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# At 100 C and 10 MPa\n",
+ "V_3 = 0.0010385;\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Beta = (1/V_1)*((V_3 - V_2)/(100 - 60));\t\t\t#[K**(-1)]\n",
+ "\n",
+ "print \"The value of volume expansivity is Beta = %e K**-1)\"%(Beta);\n",
+ "\n",
+ "\t\t\t#Isothermal compressibility is given by\n",
+ "\t\t\t# K_t = -(1/V)*(del V/del P)_T\n",
+ "\n",
+ "\t\t\t# Temperature is kept fixed at 80 C and different pressures are taken to calculate (del V/del P)_T\n",
+ "\t\t\t# At 80 C and 5 MPa\n",
+ "V_4 = 0.0010268;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# At 80 C and 10 MPa\n",
+ "V_5 = 0.0010245;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t# At 80 C and 15 MPa\n",
+ "V_6 = 0.0010222;\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "\t\t\t# K_t = -(1/V)*(del V/del T)_P\n",
+ "K_t = -(1/V_1)*((V_4 - V_6)/(5 - 15));\t\t\t#[MPa**(-1)]\n",
+ "K_t = K_t*10**(-6);\t\t\t#[Pa**(-1)]\n",
+ "\n",
+ "print \"The value of isothermal compressibility is K_t = %e Pa**-1)\"%(K_t);\n",
+ "\n",
+ "\t\t\t# Cp - Cv = (T*V*(Beta**(2)))/K_t\n",
+ "R = (T*V_1*(Beta**(2)))/K_t;\t\t\t#[J/kg-K]\n",
+ "\n",
+ "print \"The value of the difference between Cp and Cv is Cp-Cv = %f J/kg-K\"%(R);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of volume expansivity is Beta = 6.295754e-04 K**-1)\n",
+ "The value of isothermal compressibility is K_t = 4.489995e-10 Pa**-1)\n",
+ "The value of the difference between Cp and Cv is Cp-Cv = 319.389628 J/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.26 Page Number : 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of mean Joule Thomson coefficient\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 150;\t\t\t#[bar]\n",
+ "P_2 = 1;\t\t\t#[bar]\n",
+ "\n",
+ "T_1 = 300;\t\t\t#[K]\n",
+ "T_2 = 260;\t\t\t#[K]\n",
+ "T_3 = 280;\t\t\t#[K]\n",
+ "T_4 = 200;\t\t\t#[K]\n",
+ "T_5 = 120;\t\t\t#[K]\n",
+ "T_6 = 140;\t\t\t#[K]\n",
+ "\n",
+ "H_P1_T1 = 271.8;\t\t\t#[kJ/kg]\n",
+ "H_P2_T2 = 260.0;\t\t\t#[kJ/kg] \n",
+ "H_P2_T3 = 280.2;\t\t\t#[kJ/kg]\n",
+ "H_P1_T4 = 129.2;\t\t\t#[kJ/kg]\n",
+ "H_P2_T5 = 118.8;\t\t\t#[kJ/kg]\n",
+ "H_P2_T6 = 139.1;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# During the Joule-Thomson expansion the enthalpy should remain constant\n",
+ "\t\t\t# Therefore at 1 bar the exit temperature is such that enthalpy is 271.8 kJ/kg\n",
+ "\t\t\t# The temperature at which enthalpy is 271.8 kJ/kg is given by,\n",
+ "T_new = ((H_P1_T1 - H_P2_T2)/(H_P2_T3 - H_P2_T2))*(T_3 - T_2) + T_2;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# Therefore Joule-Thomson coefficient is given by,\n",
+ "meu = (T_1 - T_new)/(P_1 - P_2);\t\t\t#[K/bar]\n",
+ "\n",
+ "print \" a).The value of Joule-Thomson coefficient for initial T = 300 K) is %f J/bar\"%(meu);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# During the Joule-Thomson expansion the enthalpy should remain constant\n",
+ "\t\t\t# Therefore at 1 bar the exit temperature is such that enthalpy is 129.2 kJ/kg\n",
+ "\t\t\t# The temperature at which enthalpy is 129.2 kJ/kg is given by,\n",
+ "T_new_prime = ((H_P1_T4 - H_P2_T5)/(H_P2_T6 - H_P2_T5))*(T_6 - T_5) + T_5;\t\t\t#[K]\n",
+ "\n",
+ "\t\t\t# Therefore Joule-Thomson coefficient is given by,\n",
+ "meu_prime = (T_4 - T_new_prime)/(P_1 - P_2);\t\t\t#[K/bar]\n",
+ "\n",
+ "print \" b).The value of Joule-Thomson coefficient for initial T = 200 K) is %f J/bar\"%(meu_prime);\n",
+ "\n",
+ "\t\t\t# Therefore the Joule-Thomson coefficient is higher for low initial temperatures and therefore the drop in temperature is more.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The value of Joule-Thomson coefficient for initial T = 300 K) is 0.190046 J/bar\n",
+ " b).The value of Joule-Thomson coefficient for initial T = 200 K) is 0.468146 J/bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.27 Page Number : 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of Joule Thomson coefficient\n",
+ "\n",
+ "# Variables\n",
+ "T = 300;\t\t\t#[K] - Temperature\n",
+ "P = 5;\t\t\t#[atm] - Pressure\n",
+ "P = P*101325;\t\t\t#[Pa]\n",
+ "Cp_0 = 35.78;\t\t\t#[J/mol-K] - Smath.tan(math.radiansard specific heat capacity at constant pressure\n",
+ "B = -50;\t\t\t#[cm**(3)/mol]\n",
+ "B = B*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# (dB/dT) = 1.0 = dB_dT (say)\n",
+ "dB_dT = 1.0;\t\t\t#[cm**(3)/mol-K]\n",
+ "dB_dT = dB_dT*10**(-6);\t\t\t#[m**(3)/mol-K]\n",
+ "\n",
+ "\t\t\t# (d**2 B/d T**2) = -0.01 = dB_dT_2 (say)\n",
+ "dB_dT_2 = -0.01;\t\t\t#[cm**(3)/mol-K**(2)]\n",
+ "dB_dT_2 = dB_dT_2*10**(-6);\t\t\t#[m**(3)/mol-K**(2)]\n",
+ "\n",
+ "Cp = Cp_0 - P*T*(dB_dT_2);\t\t\t#[[J/mol-K]] - Specific heat capacity at constant pressure\n",
+ "\n",
+ "\t\t\t#Therefore Joule-Thomson coefficient is given by,\n",
+ "meu = (1/Cp)*(-B + T*dB_dT);\t\t\t#[K/Pa]\n",
+ "meu = meu*10**(5);\t\t\t#[K/bar]\n",
+ "\n",
+ "# Results\n",
+ "print \" c).The value of Joule-Thomson coefficient is %f K/bar\"%(meu);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " c).The value of Joule-Thomson coefficient is 0.938341 K/bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.30 Page Number : 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of pressure\n",
+ "\n",
+ "# Variables\n",
+ "den_liq = 13690.;\t\t\t#[kg/m**(3)] - Density of liquid mercury\n",
+ "den_solid = 14190.;\t\t\t#[kg/m**(3)] - Density of solid mercury\n",
+ "mp = -38.87;\t\t\t#[C] - Melting point of mercury at pressure of 1 bar\n",
+ "mp = mp + 273.15;\t\t\t#[K]\n",
+ "T_req = 0.;\t\t\t#[C] - Required temperature to which the melting point is to be raised\n",
+ "T_req = T_req + 273.15;\t\t\t#[K]\n",
+ "H_fus = 11.62;\t\t\t#[kJ/kg] - Latent heat of fusion of mercury\n",
+ "\n",
+ "# Calculations\n",
+ "V_liq = (1/den_liq);\t\t\t#[m**(3)/kg] - Specific volume of liquid mercury\n",
+ "\n",
+ "V_solid = (1/den_solid);\t\t\t#[m**(3)/kg] - Specific volume of solid mercury\n",
+ "\n",
+ "\t\t\t# (delta P/delta T) = ((P - 1)*100)/(T_req - mp)\n",
+ "\t\t\t# delta H/(T*delta V) = (H_liq - H_solid)/(T*(V_liq - V_solid)) = del (say)\n",
+ "d = (H_fus)/(mp*(V_liq - V_solid));\t\t\t#[kPa/K] - delta H/(T*delta V)\n",
+ "\n",
+ "\t\t\t#Equating the two sides and then solving we get\n",
+ "P = (d*(T_req - mp))/100 + 1;\t\t\t#[bar]\n",
+ "\n",
+ "# Results\n",
+ "print \" The required pressure should be %f bar\"%(P);\n",
+ "\n",
+ "# answers are correct but vary from book because of rouding error. please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The required pressure should be 7491.335878 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.31 Page Number : 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy change and entropy change\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(1)\n",
+ "\t\t\t# At 1 bar\n",
+ "\t\t\t# Considering the data given at pressure 1 and 1000 bar, we have\n",
+ "delta_H_fus_1 = ((1000-1)*10**(5)*(273.15-22.6)*3.97*10**(-6))/(14.8+22.6);\t\t\t#[J/mol]\n",
+ "delta_S_fus_1 = delta_H_fus_1/(273.15-22.6);\t\t\t#[J/mol-K]\n",
+ "\n",
+ "print \" 1).The delta_H_fus at 1 bar is %f J/mol\"%(delta_H_fus_1);\n",
+ "print \" The delta_S_fus at 1 bar is %f J/mol-K\"%(delta_S_fus_1);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t# At 6000 bar\n",
+ "T_mean = (128.8+173.6)/2;\t\t\t#[C] - Mean temperature\n",
+ "T_mean = T_mean + 273.15;\t\t\t#[K]\n",
+ "delta_V_fus_mean = (1.12+1.55)/2;\t\t\t#[cm**(3)/mol]\n",
+ "\n",
+ "\t\t\t# Consider the data at pressure of 5000 and 7000 bar we get,\n",
+ "delta_H_fus_2 = ((7000-5000)*10**(5)*(T_mean*delta_V_fus_mean*10**(-6)))/(173.6-128.8);\t\t\t#[J/mol]\n",
+ "delta_S_fus_2 = delta_H_fus_2/T_mean;\t\t\t#[J/mol-K]\n",
+ "\n",
+ "print \" 2).The delta_H_fus at 6000 bar is %f J/mol\"%(delta_H_fus_2);\n",
+ "print \" The delta_S_fus at 6000 bar is %f J/mol-K\"%(delta_S_fus_2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 1).The delta_H_fus at 1 bar is 2656.921969 J/mol\n",
+ " The delta_S_fus at 1 bar is 10.604358 J/mol-K\n",
+ " 2).The delta_H_fus at 6000 bar is 2529.050223 J/mol\n",
+ " The delta_S_fus at 6000 bar is 5.959821 J/mol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.32 Page Number : 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of ratio of temperature change and pressure change\n",
+ "\n",
+ "# Variables\n",
+ "H_fus = 80;\t\t\t#[cal/g] - Heat of fusion at 0 C and 1 atm pressure\n",
+ "T = 0+273.15;\t\t\t#[K] - Temperature\n",
+ "vol_ratio = 1.091;\t\t\t# Ratio of the specific volume of ice and water.\n",
+ "sp_vol = 0.001;\t\t\t#[m**(3)/kg] - Specific volume of saturated liquid water.\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# The clapeyron equation can be written as\n",
+ "\t\t\t# (dP/dT)_sat = T*delta V_LS/(delta H_LS) = (T*(V_ice - V_water))/(H_ice - H_water)\n",
+ "dP_dT = (T*(vol_ratio - 1)*10**(-3))/(-H_fus*4.186);\t\t\t#[K/kPa]\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of dT/dP)_sat is %e K/kPa\"%(dP_dT);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of dT/dP)_sat is -7.422554e-05 K/kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.33 Page Number : 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of boiling point of water\n",
+ "\n",
+ "# Variables\n",
+ "P = 2;\t\t\t#[atm] - Surrounding pressure\n",
+ "bp_water = 100 + 273.15;\t\t\t#[K] - Boiling point of water at 1 atm pressure\n",
+ "delta_H_vap = 2257;\t\t\t#[kJ/kg] - Enthalpy of vaporization\n",
+ "delta_H_vap = delta_H_vap*18.015;\t\t\t#[J/mol]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# The clapeyron equation is given by\n",
+ "\t\t\t# math.log(P_2_sat/P_1_sat) = (-delta H_vap/R)*(1/T_2 - 1/T_1)\n",
+ "P_1_sat = 1;\t\t\t#[atm]\n",
+ "P_2_sat = P;\n",
+ "T_1 = bp_water;\n",
+ "\n",
+ "\t\t\t# Solving the above equation\n",
+ "T_2 = 1/((math.log(P_2_sat/P_1_sat))/(-delta_H_vap/R) + (1/T_1));\t\t\t#[K]\n",
+ "T_2 = T_2 - 273.15;\t\t\t#[C]\n",
+ "\n",
+ "# Results\n",
+ "print \" The boiling point of water at a pressure of 2 atm is %f C\"%(T_2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The boiling point of water at a pressure of 2 atm is 120.836990 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.34 Page Number : 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of enthalpy and entropy of vaporization of water\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 0.01 +273.15;\t\t\t#[K]\n",
+ "T_2 = 1 + 273.15;\t\t\t#[K]\n",
+ "P_sat_1 = 0.611;\t\t\t#[kPa] - P_sat at temperature T_1\n",
+ "P_sat_2 = 0.657;\t\t\t#[kPa] - P_sat at temperature T_2\n",
+ "Mol_wt = 18.015;\t\t\t#[g/mol] - Molecular weight of water\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results \n",
+ " # The clapeyron equation is given by\n",
+ "\t\t\t# math.log(P_sat_2/P_sat_1) = (-delta H_LV/R)*(1/T_2 - 1/T_1)\n",
+ "\n",
+ "\t\t\t# Solving the above equation\n",
+ "delta_H = -(math.log(P_sat_2/P_sat_1)/(1/T_2 - 1/T_1))*R;\t\t\t#[J/mol]\n",
+ "delta_H = delta_H/Mol_wt;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \" The enthalpy of vaporization is %f kJ/kg\"%(delta_H);\n",
+ "\n",
+ "\t\t\t# Entropy of vaporization is given by\n",
+ "S_vap = delta_H/T_2;\t\t\t#[kJ/kg-K]\n",
+ "print \" The entropy of vaporization is %f kJ/kg-K\"%(S_vap);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The enthalpy of vaporization is 2533.991278 kJ/kg\n",
+ " The entropy of vaporization is 9.243083 kJ/kg-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.35 Page Number : 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of heat of vaporization of water\n",
+ "\n",
+ "# Variables\n",
+ "T = 100. + 273.15;\t\t\t#[K]\n",
+ "\t\t\t# (dT/dP)_sat = (1/27.12) K/mm\n",
+ "dT_dP = (1/27.12);\t\t\t#[K/mm]\n",
+ "dT_dP = dT_dP*(760./101325);\t\t\t#[K/Pa]\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# The clapeyron equation is given by\n",
+ "\t\t\t# (dP/dT)_sat = (-delta H_LV)/(T*delta V_LV)\n",
+ "\t\t\t# delta H_LV = T*delta V_LV*(dP/dT)_sat\n",
+ "\n",
+ "\t\t\t# (dP/dT)_sat = 1/(dT/dP)_sat\n",
+ "dP_dT = 1/dT_dP;\t\t\t#[Pa/K]\n",
+ "\n",
+ "\t\t\t# From saturated steam table at 100 C\n",
+ "V_vap = 1.6729;\t\t\t#[m**(3)/kg]\n",
+ "V_liq = 0.001044;\t\t\t#[m**(3)/kg]\n",
+ "delta_V = V_vap - V_liq;\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "\t\t\t# Therefore delta_H_LV is given by\n",
+ "delta_H_LV = T*delta_V*(dP_dT);\t\t\t#[J/kg]\n",
+ "delta_H_LV = delta_H_LV*10**(-3);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Results\n",
+ "print \" The heat of vaporization of water is %f kJ/kg\"%(delta_H_LV);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The heat of vaporization of water is 2255.667174 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.36 Page Number : 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of latent heat of vaporization\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 100 + 273.15;\t\t\t#[K]\n",
+ "P_1 = 1.01325;\t\t\t#[bar]\n",
+ "T_2 = 98 + 273.15;\t\t\t#[K]\n",
+ "P_2 = 0.943;\t\t\t#[bar]\n",
+ "V_vap = 1.789;\t\t\t#[m**(3)] - Volume in vapour phase\n",
+ "vessel_vol = 1.673;\t\t\t#[m**(3)] - Volume of the vessel\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# The total volume remains constant as the walls are rigid. At 98 C we get\n",
+ "\t\t\t# vessel_vol = V_liq*(1 - x) + V_vap*x\n",
+ "\t\t\t# Since V_liq is negligible as compared to V_vap, therefore\n",
+ "x = vessel_vol/V_vap;\n",
+ "\n",
+ "\t\t\t# The quantity is given by x = m_vap/(m_liq + m_vap)\n",
+ "\t\t\t# Since (m_liq + m_vap) = 1, therefore at 98 C saturated vapour is x and saturated liquid is (1 - x)\n",
+ "m_vap = x;\t\t\t#[kg] - Mass of saturated vapour\n",
+ "m_liq = (1 - x);\t\t\t#[kg] - Mass of saturated liquid\n",
+ "\n",
+ "print \" The amount of vapour condensed is %f kg\"%(m_liq);\n",
+ "\n",
+ "\t\t\t# The clapeyron equation is given by\n",
+ "\t\t\t# math.log(P_2_sat/P_1_sat) = (-delta H_LV/R)*(1/T_2 - 1/T_1)\n",
+ "\n",
+ "\t\t\t# Solving the above equation\n",
+ "delta_H = -(math.log(P_2/P_1)/(1/T_2 - 1/T_1))*R;\n",
+ "delta_H = delta_H/18.015;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "print \" The latent heat of vaporization is %f kJ/kg\"%(delta_H);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The amount of vapour condensed is 0.064841 kg\n",
+ " The latent heat of vaporization is 2296.240786 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.37 Page Number : 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of temperature dependence\n",
+ "from scipy.integrate import quad \n",
+ "from scipy.optimize import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T_1 = 298.15;\t\t\t#[K] - Smath.tan(math.radiansard reaction temperature\n",
+ "delta_H_gas = -52.23;\t\t\t#[kcal/mol] - Enthalpy of formation of C2H5OH(gas)\n",
+ "delta_H_liq = -66.35;\t\t\t#[kcal/mol] - Enthalpy of formation of C2H5OH(liq)\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# For ethanol(g) [T is in K and Cp_0 in cal/mol-K]\n",
+ "\t\t\t# Cp_0 = 4.75 + 5.006*10**(-2)*T - 2.479*10**(-5)*T**(2) + 4.79*10**(-9)*T**(3)\n",
+ "\n",
+ "\t\t\t# For ethanol(l) [T is in K and Cp_0 in cal/mol-K]\n",
+ "\t\t\t# Cp_0 = 67.29 - 0.343*T - 6.94*10**(-4)*T**(2)\n",
+ "\n",
+ "\t\t\t# The vaporization of a liquid can be written as C2H5OH(liq) - C2H5OH(gas)\n",
+ "\t\t\t# Since the pressure is 1 atm therefore the smath.tan(math.radiansard data can be used\n",
+ "delta_H_298 = delta_H_gas - delta_H_liq;\t\t\t#[kcal/mol]\n",
+ "delta_H_298 = delta_H_298*1000;\t\t\t#[cal/mol]\n",
+ "delta_a = 4.75 - 67.29;\n",
+ "delta_b = 5.006*10**(-2) - (-0.343);\n",
+ "delta_c = -2.479*10**(-5) - 6.94*10**(-4);\n",
+ "delta_d = 4.79*10**(-9);\n",
+ "\n",
+ "\t\t\t# The smath.tan(math.radiansard enthalpy of vaporization at a temperature T is given by\n",
+ "\n",
+ "def f31(T): \n",
+ "\t return delta_a + delta_b*T + delta_c*T**(2) + delta_d*T**(3)\n",
+ "\n",
+ "\t\t\t# delta_H_T = delta_H_298 + quad(f31,T_1,T)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t# Therefore the smath.tan(math.radiansard enthalpy of vaporization at a temperature T = 283 K is given by\n",
+ "T_2 = 283;\t\t\t#[K]\n",
+ "\n",
+ "def f32(T): \n",
+ "\t return delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3)\n",
+ "\n",
+ "delta_H_283 = delta_H_298 + quad(f32,T_1,T_2)[0]\n",
+ "\n",
+ "\n",
+ "\t\t\t# Therefore the smath.tan(math.radiansard enthalpy of vaporization at a temperature T = 348 K is given by\n",
+ "T_3 = 348;\t\t\t#[K]\n",
+ "\n",
+ "def f33(T): \n",
+ "\t return delta_a+delta_b*T+delta_c*T**(2)+delta_d*T**(3)\n",
+ "\n",
+ "delta_H_348 = delta_H_298 + quad(f33,T_1,T_3)[0]\n",
+ "\n",
+ "\n",
+ "print \" The value of enthalpy of vaporization at 283 K is %f cal/mol\"%(delta_H_283);\n",
+ "print \" The value of enthalpy of vaporization at 298.15 K is %f cal/mol\"%(delta_H_298);\n",
+ "print \" The value of enthalpy of vaporization at 348 K is %f cal/mol\"%(delta_H_348);\n",
+ "print \" Therefore Standard enthalpy of vaporization decrease with the increase in temperature\";\n",
+ "\n",
+ "\t\t\t# Solving the above equatio manually we get,\n",
+ "\t\t\t# delta_H_vap = 1.1975*10**(-9)*T**(4) - 2.396*10**(-4)*T**(3) + 0.1965*T**(2) - 62.54*T + 21639.54 \n",
+ "\t\t\t# Solving for 'T' at which 'delta_H_vap' = 0\n",
+ "def f(T): \n",
+ "\t return 1.1975*10**(-9)*T**(4)-2.396*10**(-4)*T**(3)+0.1965*T**(2)-62.54*T + 21639.54\n",
+ "T_0 = fsolve(f,500)\n",
+ "\n",
+ "\t\t\t# We know that at critical point (critical temperature and critical pressure) the enthalpy of vaporization is zero.\n",
+ "\t\t\t# Here we have made the smath.tan(math.radiansard enthalpy of vaporization equal to zero which is at smath.tan(math.radiansard pressure of 1 atm.\n",
+ "\t\t\t# Therefore following conclusions can be drawn\n",
+ "print \" The temperature obtained by equating smath.tan(math.radiansard enthalpy of vaporization equal to zero is %f K\"%(T_0);\n",
+ "print \" But the critical temperature of ethanol is 513.9 K , which is far from the temperature obtained above\"\n",
+ "print \" Therefore the temperature obtained by equating smath.tan(math.radiansard enthalpy of vaporization equal to zero is not the critical temperature\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of enthalpy of vaporization at 283 K is 14255.030925 cal/mol\n",
+ " The value of enthalpy of vaporization at 298.15 K is 14120.000000 cal/mol\n",
+ " The value of enthalpy of vaporization at 348 K is 13593.385895 cal/mol\n",
+ " Therefore Standard enthalpy of vaporization decrease with the increase in temperature\n",
+ " The temperature obtained by equating smath.tan(math.radiansard enthalpy of vaporization equal to zero is 635.058887 K\n",
+ " But the critical temperature of ethanol is 513.9 K , which is far from the temperature obtained above\n",
+ " Therefore the temperature obtained by equating smath.tan(math.radiansard enthalpy of vaporization equal to zero is not the critical temperature\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.38 Page Number : 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of fugacity of water\n",
+ "\n",
+ "# Variables\n",
+ "T = 300 + 273.15;\t\t\t#[K] - Temperature\n",
+ "P = 9000;\t\t\t#[kPa] - Pressure\n",
+ "P_sat = 8592.7;\t\t\t#[kPa] - Vapour pressure of saturated water at 300 C\n",
+ "f_sat = 6738.9;\t\t\t#[kPa] - Fugacity of saturated water at 300 C\n",
+ "V_liq = 25.28;\t\t\t#[cm**(3)/mol] - Molar volume of water in liquid phase\n",
+ "V_liq = V_liq*10**(-6);\t\t\t# [m**(3)/mol]\n",
+ "V_vap = 391.1;\t\t\t#[cm**(3)/mol] - Molar volume of water in vapour phase\n",
+ "V_vap = V_vap*10**(-6);\t\t\t# [m**(3)/mol]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t# At 300 C and 9000 kPa water is a compressed liquid and its fugacity is given by\n",
+ "\t\t\t# f = f_sat*exp[V_liq*(P - P_sat)/R*T]\n",
+ "fugacity = f_sat*math.exp((V_liq*(P - P_sat)*1000)/(R*T));\n",
+ "\n",
+ "# Results\n",
+ "print \" The fugacity of water at 9000 kPa is %f kPa\"%(fugacity);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The fugacity of water at 9000 kPa is 6753.477111 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.39 Page Number : 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of fugacity of saturated steam\n",
+ "\n",
+ "# Variables\n",
+ "T = 200 + 273.15;\t\t\t#[K] - Temperature\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\t\t\t# From steam table at 200 C as reported in the book\n",
+ "P_sat = 1.5538;\t\t\t#[MPa] - Vapour pressure of saturated steam\n",
+ "H_vap = 2793.2;\t\t\t#[kJ/kg] - Enthalpy of saturated steam in vapour phase\n",
+ "S_vap = 6.4323;\t\t\t#[kJ/kg-K] - Entropy of saturated steam in vapour phase\n",
+ "\n",
+ "# Calculations\n",
+ "G_sat = H_vap - T*S_vap;\t\t\t#[kJ/kg] - Gibbs free energy\n",
+ "G_sat = G_sat*18.015;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# Now let us calculate the Gibbs free energy at the lowest pressure available in superheated steam tables at 200 C\n",
+ "\t\t\t# At 200 C and 0.01 MPa as reported in the book\n",
+ "H = 2879.5;\t\t\t#[kJ/kg] - Enthalpy\n",
+ "S = 8.9038;\t\t\t#[kJ/kg-K] - Entropy\n",
+ "G_ig = H - T*S;\t\t\t#[kJ/kg] - Gibbs free energy\n",
+ "G_ig = G_ig*18.015;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# Integrating from ideal gas state at 200 C and 0.01 MPa to saturated vapour at 200 C we get\n",
+ "\t\t\t# G_sat - G_ig = R*T*math.log(f_sat/f_ig)\n",
+ "\n",
+ "\t\t\t# Under the ideal gas condition the pressure is small therefore f_ig = P = 0.01 MPa\n",
+ "f_ig = 0.01;\t\t\t#[MPa]\n",
+ "\n",
+ "\t\t\t# Solving the above equation\n",
+ "f_sat = f_ig*(math.exp((G_sat - G_ig)/(R*T)));\t\t\t#[MPa]\n",
+ "\n",
+ "# Results\n",
+ "print \" The fugacity of saturated steam at 200 C is %f MPa\"%(f_sat);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The fugacity of saturated steam at 200 C is 1.426074 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.40 Page Number : 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of fugacity of steam\n",
+ "\n",
+ "# Variables\n",
+ "T = 320 + 273.15;\t\t\t#[K]\n",
+ "P_1 = 70;\t\t\t#[bar]\n",
+ "P_2 = 170;\t\t\t#[bar]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#(a)\n",
+ "\t\t\t# dG = R*T*dmath.log(f)\n",
+ "\t\t\t# G - G_ig = R*T*math.log(f/f_ig)\n",
+ "\n",
+ "\t\t\t# From steam table the low pressure that is available is 1 kPa.\n",
+ "f_ig = 1;\t\t\t#[kPa] - Assuming ideal gas behaviour at such low pressure\n",
+ "\n",
+ "\t\t\t# At 1 kPa (under saturated conditions)\n",
+ "P_sat = 112.891;\t\t\t#[bar]\n",
+ "\t\t\t# Therefore at both 1 kPa and 70 bar the stem is superheated and byond a pressure of 112.891 bar it is compressed liquid.\n",
+ "\n",
+ "\t\t\t# For superheated steam table at 1 kPa and 320 C, as repoted in the book\n",
+ "H_1 = 3117.08;\t\t\t#[kJ/kg] - Enthalpy\n",
+ "S_1 = 10.41232;\t\t\t#[kJ/kg-K] - Entropy\n",
+ "\n",
+ "\t\t\t# For superheated steam table at 70 bar and 320 C, as repoted in the book\n",
+ "H_2 = 2916.92;\t\t\t#[kJ/kg] - Enthalpy\n",
+ "S_2 = 6.0651;\t\t\t#[kJ/kg-K] - Entropy\n",
+ "\n",
+ "\t\t\t# At 70 bar and 320 C,\n",
+ "G = H_2 - T*S_2;\t\t\t#[kJ/kg] - Gibbs free energy\n",
+ "\t\t\t# At 1 kPa and 320 C\n",
+ "G_ig = H_1 - T*S_1;\t\t\t#[kJ/kg] - Gibbs free energy\n",
+ "\n",
+ "\t\t\t# math.log(f/f_ig) = (G - G_ig)/(R*T)\n",
+ "f = f_ig*(math.exp((G - G_ig)*18/(R*T)));\t\t\t#[kPa]\n",
+ "f = f*10**(-2);\t\t\t#[bar]\n",
+ "\n",
+ "\t\t\t# At 70 bar\n",
+ "phi = f/P_1;\n",
+ "\n",
+ "print \" a).The fugacity of steam at 320 C and 70 bar is %f bar\"%(f);\n",
+ "print \" The fugacity coefficient at 320 C and 70 bar is phi = %f\"%(phi);\n",
+ "\n",
+ "\t\t\t#(b)\n",
+ "\t\t\t# Now consider saturated steam at 320 C. We have\n",
+ "P_sat = 112.891;\t\t\t#[bar]\n",
+ "V_liquid = 1.5;\t\t\t#[cm**(3)/mol] - Molar vlume of saturated liquid\n",
+ "V_liquid = V_liquid*10**(-6);\t\t\t#[m**(3)/mol]\n",
+ "V_vapour = 15.48;\t\t\t#[cm**(3)/mol] - Molar vlume of saturated vapour\n",
+ "U_liqid = 1445.7;\t\t\t#[Kj/kg] - Internal energy of satuarted liquid\n",
+ "U_vapour = 2528.9;\t\t\t#[kJ/kg] - Internal energy of satuarted vapour\n",
+ "H_liquid = 1462.6;\t\t\t#[kJ/kg] - Enthalpy of saturated liquid\n",
+ "H_vapour = 2703.7;\t\t\t#[kJ/kg] - Enthalpy of saturated vapour\n",
+ "S_liquid = 3.45;\t\t\t#[kJ/kg-K] - Entropy of saturated liquid\n",
+ "S_vapour = 5.5423;\t\t\t#[kJ/kg-K] - Entropy of saturated vapour\n",
+ "\n",
+ "\t\t\t# Now let us calculate Gibbs free energy of saturated liquid and saturated vapour\n",
+ "G_liquid = H_liquid - T*S_liquid;\t\t\t#[kJ/kg]\n",
+ "G_vapour = H_vapour - T*S_vapour;\t\t\t#[kJ/kg]\n",
+ "\t\t\t# Note that under saturated conditions\n",
+ "\t\t\t# G_sat = G_liquid = G_vapour\n",
+ "G_sat = G_liquid;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t# math.log(f_sat/f_ig) = (G_sat - G_ig)/(R*T)\n",
+ "f_sat = f_ig*(math.exp((G_sat - G_ig)*18/(R*T)));\t\t\t#[kPa]\n",
+ "f_sat = f_sat*10**(-2);\t\t\t#[bar]\n",
+ "\n",
+ "phi_sat = f_sat/P_sat;\n",
+ "\n",
+ "\t\t\t# And now the fugacity is to be determined at 320 C and P = 170 bar. We know the following relation for compressed liquid.\n",
+ "\t\t\t# f_CL = f_sat*exp(V_liquid*(P-P_sat)/(R*T))\n",
+ "f_CL = f_sat*math.exp(V_liquid*18*(P_2-P_sat)*10**(5)/(R*T));\t\t\t#[bar]\n",
+ "\n",
+ "\t\t\t# Therefore the fugacity coefficient at 170 bar and 320 C is given by\n",
+ "phi_2 = f_CL/P_2;\n",
+ "\n",
+ "print \" b).The fugacity of steam at 320 C and 170 bar is %f bar\"%(f_CL);\n",
+ "print \" The fugacity coefficient at 320 C and 170 bar is phi = %f\"%(phi_2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a).The fugacity of steam at 320 C and 70 bar is 58.913361 bar\n",
+ " The fugacity coefficient at 320 C and 70 bar is phi = 0.841619\n",
+ " b).The fugacity of steam at 320 C and 170 bar is 86.552966 bar\n",
+ " The fugacity coefficient at 320 C and 170 bar is phi = 0.509135\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.41 Page Number : 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of fugacities at two states\n",
+ "\n",
+ "# Variables\n",
+ "T = 300 + 273.15;\t\t\t#[K]\n",
+ "P_1 = 12500*10**(3);\t\t\t#[Pa]\n",
+ "P_2 = 8581*10**(3);\t\t\t#[Pa]\n",
+ "P_3 = 300*10**(3);\t\t\t#[Pa]\n",
+ "V_liq = 1.404;\t\t\t#[cm**(3)/g] - Specific volume of liquid\n",
+ "V_liq = (V_liq/10**(6))*18.015;\t\t\t#[m**(3)/mol]\n",
+ "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t# state 1: 300 C, 12500 kPa\n",
+ "\t\t\t# state 2: 300 C, 8581 kPa\n",
+ "\t\t\t# state 3: 300 C, 300 kPa\n",
+ "\n",
+ "\t\t\t# From state 1 to state 2 the system is liquid water and if the molar volume of liquid is assumed costant we can write\n",
+ "\t\t\t# G_2 - G_1 = V_liq*(P_2 - P_1)\n",
+ "\t\t\t# G_2 - G_1 = R*Tmath.log(f_2/f_1)\n",
+ "\t\t\t# Comparing the above two equations we get\n",
+ "\t\t\t# (f_2/f_1) = exp((V_liq*(P_2 - P_1)/(R*T))\n",
+ "f2_f1 = math.exp((V_liq*(P_2 - P_1)/(R*T))); \t\t\t# (f_2/f_1) = f2_f1 (say)\n",
+ "\n",
+ "\t\t\t# In state 2 the fugacity of liquid is same as that of saturated vapour and for the vapour phase change from state 2 to 3 the fugacity ratio is calculated using \n",
+ "\t\t\t# G_3 - G_2 = R*Tmath.log(f_3/f_2)\n",
+ "\n",
+ "\t\t\t# At 300 C, 8581 kPa \n",
+ "H_liq_2 = 2749.0;\t\t\t#[kJ/kg]\n",
+ "S_vap_2 = 5.7045;\t\t\t#[kJ/kg-K]\n",
+ "G_vap_2 = -520.53;\t\t\t#[kJ/kg]\n",
+ "G_vap_2 = G_vap_2*18.015;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# At 300 C, 300 kPa \n",
+ "H_3 = 3069.3;\t\t\t#[kJ/kg]\n",
+ "S_3 = 7.7022;\t\t\t#[kJ/kg-K]\n",
+ "G_3 = -1345.22;\t\t\t#[kJ/kg]\n",
+ "G_3 = G_3*18.015;\t\t\t#[J/mol]\n",
+ "\n",
+ "\t\t\t# Substituting and solving the equation G_3 - G_2 = R*Tmath.log(f_3/f_2)\n",
+ "f3_f2 = math.exp((G_3 - G_vap_2)/(R*T));\t\t\t# (f_3/f_2) = f3_f2 (say)\n",
+ "\n",
+ "\t\t\t# (f_3/f_1) = (f_3/f_2)*(f_2/f_1)\n",
+ "f3_f1 = f3_f2*f2_f1;\n",
+ "\n",
+ "print \" The ratio of fugacity in the final state to that in the initial state is given by f3/f2 = %f\"%(f3_f2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The ratio of fugacity in the final state to that in the initial state is given by f3/f2 = 0.044255\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/ch8_2.ipynb b/Chemical_Engineering_Thermodynamics/ch8_2.ipynb
new file mode 100644
index 00000000..e4dd389d
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/ch8_2.ipynb
@@ -0,0 +1,768 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Chapter 8 : Thermodynamic Cycles"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page Number : 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of work done\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 30;\t\t\t#[bar]\n",
+ "P_2 = 0.04;\t\t\t#[bar]\n",
+ "\n",
+ "\t\t\t#(1).Carnot cycle\n",
+ "\t\t\t#It has been reported in the book that at 30 bar pressure (saturated) :\n",
+ "H_liq_1 = 1008.42;\t\t\t#[kJ/kg]\n",
+ "H_vap_1 = 2804.2;\t\t\t#[kJ/kg]\n",
+ "S_liq_1 = 2.6457;\t\t\t#[kJ/kg-K]\n",
+ "S_vap_1 = 6.1869;\t\t\t#[kJ/kh-K]\n",
+ "\t\t\t#Therefore, H_1 = H_liq_1, H_2 = H_vap_1, S_1 = S_liq_1 and S_2 = S_vap_1\n",
+ "H_1 = H_liq_1;\n",
+ "H_2 = H_vap_1;\n",
+ "S_1 = S_liq_1;\n",
+ "S_2 = S_vap_1;\n",
+ "\n",
+ "#At 0.04 bar pressure (saturated) :\n",
+ "H_liq_2 = 121.46;\t\t\t#[kJ/kg]\n",
+ "H_vap_2 = 2554.4;\t\t\t#[kJ/kg]\n",
+ "S_liq_2 = 0.4226;\t\t\t#[kJ/kg-K]\n",
+ "S_vap_2 = 8.4746;\t\t\t#[kJ/kh-K]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Dryness fraction at state 3 can be found the fact that S_3 = S_2 \n",
+ "x_3 = (S_2 - S_liq_2)/(S_vap_2 - S_liq_2);\n",
+ "H_3 = H_liq_2*(1 - x_3) + x_3*H_vap_2;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Dryness fraction at state 4 can be found the fact that S_4 = S_1\n",
+ "x_4 = (S_1 - S_liq_2)/(S_vap_2 - S_liq_2);\n",
+ "H_4 = H_liq_2*(1 - x_4) + x_4*H_vap_2;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Work done by turbine W_tur = -delta_H = -(H_3 - H_2)\n",
+ "W_tur = H_2 - H_3;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Work supplied by boiler,\n",
+ "q_H = H_2 - H_1;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Work transfer in compressor is given by\n",
+ "W_com = -(H_1 - H_4);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Efficiency can now be calculated as\n",
+ "\t\t\t#n = (Net work done/Work supplied by boiler)\n",
+ "n_carnot = (W_tur + W_com)/q_H;\n",
+ "\n",
+ "\t\t\t#Efficiency of the Carnot cycle can also be determined from the formula\n",
+ "\t\t\t# n = 1 - (T_L/T_H), Where T_L is saturated temperature at 0.04 bar and T_H is saturated temperature at 30 bar\n",
+ "\n",
+ "print \"1.Carnot cycle\";\n",
+ "print \"The work done by the turbine is %f kJ/kg\"%(W_tur);\n",
+ "print \"The heat transfer in the boiler is %f kJ/kg\"%(q_H);\n",
+ "print \"The cycle efficiency is %f\"%(n_carnot);\n",
+ "\n",
+ "\t\t\t#(2).Rankine cycle\n",
+ "\t\t\t#The enthalpies at state 2 and 3 remain as in the Carnot cycle\n",
+ "\t\t\t#Saturated liquid enthalpy at 0.04 bar is \n",
+ "H_4_prime = H_liq_2;\n",
+ "\n",
+ "\t\t\t#Saturated liquid volume at 0.04 bar as reported in the book is\n",
+ "V_liq = 0.001004;\t\t\t#[m**(3)/kg]\n",
+ "\t\t\t#Work transfer in pump can be calculated as\n",
+ "W_pump = -V_liq*(P_1 - P_2)*100;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Work transfer around pump gives, W_pump = -delta_H = -(H_1_prime - H_4_prime);\n",
+ "H_1_prime = H_4_prime - W_pump;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Heat supplied to boiler is\n",
+ "q_H_prime = H_2 - H_1_prime;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Work done by turbine is\n",
+ "W_tur_prime = H_2 - H_3;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Efficiency can now be calculated as\n",
+ "\t\t\t#n = (Net work done/Heat input)\n",
+ "n_rankine = (W_tur_prime + W_pump)/q_H_prime;\t\t\t#\n",
+ "\n",
+ "print \"2.Rankine cycle\";\n",
+ "print \"The work done by the turbine is %f kJ/kg\"%(W_tur_prime);\n",
+ "print \"The heat transfer in the boiler is %f kJ/kg\"%(q_H_prime);\n",
+ "print \"The cycle efficiency is %f\"%(n_rankine);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Carnot cycle\n",
+ "The work done by the turbine is 941.036567 kJ/kg\n",
+ "The heat transfer in the boiler is 1795.780000 kJ/kg\n",
+ "The cycle efficiency is 0.404166\n",
+ "2.Rankine cycle\n",
+ "The work done by the turbine is 941.036567 kJ/kg\n",
+ "The heat transfer in the boiler is 2679.732016 kJ/kg\n",
+ "The cycle efficiency is 0.350046\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page Number : 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of efficiency of Rankine cycle\n",
+ "\n",
+ "# Variables\n",
+ "T_max = 700+273.15;\t\t\t#[K] - Maximum temperature.\n",
+ "P_boiler = 10*10**(6);\t\t\t#[Pa] - Constant pressure in the boiler\n",
+ "P_condenser = 10*10**(3);\t\t\t#[Pa] - Constant pressure in the condenser\n",
+ "\n",
+ "\t\t\t#At state 2 i.e, at 700 C and 10 MPa,it has been reported in the book that from steam table\n",
+ "S_2 = 7.1687;\t\t\t#[kJ/kg-K] - Entropy\n",
+ "H_2 = 3870.5;\t\t\t#[kJ/kg] - Enthalpy\n",
+ "\n",
+ "\t\t\t#At state 3 i.e, at 700 C and 10 KPa,\n",
+ "S_3 = S_2;\t\t\t#[kJ/kg-K]- Entropy \n",
+ "\n",
+ "\t\t\t#For sturated steam at 10 kPa, it has been reported in the book that from steam table\n",
+ "S_liq = 0.6493;\t\t\t#[kJ/kg-K]- Entropy of saturated liquid\n",
+ "S_vap = 8.1502;\t\t\t#[kJ/kg-K] - Enthalpy of saturated liquid\n",
+ "\t\t\t#Therefore steam is saturated and its dryness factor can be calculated as\n",
+ "x = (S_2 - S_liq)/(S_vap - S_liq);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#The enthalpy at state 3 is now calculated. For steam at 10 kPa,it has been reported in the book that from steam table\n",
+ "H_liq = 191.83;\t\t\t#[kJ/kg]\n",
+ "H_vap = 2584.7;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#Therefore enthalpy at state 3 is\n",
+ "H_3 = H_liq*(1-x) + H_vap*x;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Work done by the turbine \n",
+ "W_tur = -(H_3 - H_2);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Now we have to calculate work input to the pump\n",
+ "\t\t\t#State 4:Saturated liquid at 10 kPa\n",
+ "\t\t\t#State 4:Compressed liquid at 10 MPa\n",
+ "\t\t\t#Since volume of liquid does not get affected by pressure we take volume of saturated liquid at 10 kPa,\n",
+ "V_liq = 0.001010;\t\t\t#[m**(3)/kg]\n",
+ "\n",
+ "\t\t\t#Work transfer in the pump is\n",
+ "W_pump = -V_liq*(P_boiler - P_condenser)*10**(-3);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Energy balance around pump gives, W_pump = -delta_H = -(H_1 - H_4)\n",
+ "H_4 = H_liq;\t\t\t# Enthalpy at state 4 (saturated liquid at 10 kPa)\n",
+ "H_1 = H_4 - W_pump;\t\t\t#[kJ/kg]\n",
+ " \n",
+ "\t\t\t#Heat supplied to boiler is\n",
+ "q_H = H_2 - H_1;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Efficiency can now be calculated as\n",
+ "\t\t\t#n = (Net work done/Heat input)\n",
+ "n_rankine = (W_tur + W_pump)/q_H;\n",
+ "\n",
+ "print \"The efficiency of the Rankine cycle is found to be %f\"%(n_rankine);\n",
+ "\n",
+ "\t\t\t#Now let us determine the efficiency of Carnot cycle. The maximun temperature is 700 C and minimum temperature is that of saturated steam at 10 kPa,\n",
+ "T_min = 45.81 + 273.15;\t\t\t#[K] - From steam table as reported in the book\n",
+ "n_carnot = 1-(T_min/T_max);\n",
+ "\t\t\t#Note that the efficiency of Rankine cycle is less than that of carnot cycle"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency of the Rankine cycle is found to be 0.433088\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page Number : 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculatrion of COP of carnot refrigerator and heat rejected\n",
+ "\n",
+ "# Variables\n",
+ "W = 1.1;\t\t\t#[kW] - Work done per ton of refrigeration \n",
+ "\t\t\t#1 ton refrigeration = 3.517 kW, therefore\n",
+ "H = 3.517;\t\t\t#[kW] - Heat absorbed\n",
+ "T_low = -30 + 273.15;\t\t\t#[K] - Low temperature maintained\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#COP can be calculated as\n",
+ "\t\t\t#COP = (Heat absorbed/Work done)\n",
+ "COP = H/W;\n",
+ "\n",
+ "\t\t\t#For reversed carnot cycle, COP = T_low/(T_high - T_low). Solving this we get\n",
+ "T_high = (T_low/COP) + T_low;\t\t\t#[K] - Higher temperature\n",
+ "\n",
+ "\t\t\t#Heat rejected is\n",
+ "H_rej = W + H;\t\t\t#[kW];\n",
+ "\n",
+ "# Results\n",
+ "print \"The COP is %f\"%(COP);\n",
+ "print \"The higher temperature of the cycle is %f K\"%(T_high);\n",
+ "print \"The heat rejected per ton of refrigeration is %f kW\"%(H_rej);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The COP is 3.197273\n",
+ "The higher temperature of the cycle is 319.199190 K\n",
+ "The heat rejected per ton of refrigeration is 4.617000 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page Number : 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of minimum power required\n",
+ "\n",
+ "# Variables\n",
+ "T_high = 20 + 273.15;\t\t\t#[K] - High temperature\n",
+ "T_low = 0 + 273.15;\t\t\t#[K] - Low temperature\n",
+ "Q_H = 10;\t\t\t#[kW] - Heat supplied\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#If 'Q_H' is the rate at which heat is taken from surrounding and 'W' is the rate at which work is done,then\n",
+ "\t\t\t# Q_H = W + Q_L\n",
+ "\t\t\t#(Q_H/Q_L) = (T_high/T_low)\n",
+ "\t\t\t#Also for a reversible cycle, (Q_H/Q_L) = 1 + (W/Q_L). Solving we get,\n",
+ "Q_L = (T_low/T_high)*Q_H;\t\t\t#[kW]\n",
+ "W = (Q_H - Q_L) ;\t\t\t#[kW]\n",
+ " \n",
+ "# Results\n",
+ "print \"The minimum power required is %f kW\"%(W);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum power required is 0.682245 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page Number : 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of COP and power required\n",
+ "\n",
+ "# Variables\n",
+ "T_high = 40 + 273.15;\t\t\t#[K] - High temperature\n",
+ "T_low = -20 + 273.15;\t\t\t#[K] - Low temperature\n",
+ "C = 10;\t\t\t#[tons of refrigeration] - Capacity\n",
+ "\t\t\t#1 ton refrigeration = 3.517 kW, therefore\n",
+ "H = C*3.517;\t\t\t#[kW] - Heat absorbed\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#For reversed carnot cycle, COP = T_low/(T_high - T_low)\n",
+ "COP = T_low/(T_high - T_low);\n",
+ "\n",
+ "\t\t\t# COP = (Refrigerating effect)/(Work input), therefore power required is given by\n",
+ "P = (H/COP);\t\t\t#[kW]\n",
+ "\n",
+ "# Results\n",
+ "print \"The COP is %f\"%(COP);\n",
+ "print \"The power required is %f kW\"%(P);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The COP is 4.219167\n",
+ "The power required is 8.335769 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page Number : 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of maximum refrigeration effect\n",
+ "\n",
+ "# Variables\n",
+ "COP = 4;\t\t\t#Coefficient of performance\n",
+ "P = 10;\t\t\t#[kW] - Work done on the cycle\n",
+ "\n",
+ "# Calculations\n",
+ "\t\t\t#For reversed carnot cycle, COP = T_low/(T_high - T_low)\n",
+ "\t\t\t#ratio = (T_high/T_low),therefore\n",
+ "ratio = -1/(COP + 1);\n",
+ "\n",
+ "\t\t\t# Refrigerating effect = (COP)*Work input, therefore refrigeration is given by\n",
+ "H = COP*P;\t\t\t#[kW]\n",
+ "\n",
+ "\t\t\t#Maximum refrigearation in tons is given by\n",
+ "H_max = (H/3.517);\n",
+ "\n",
+ "# Results\n",
+ "print \"The maximum refrigeration value is %f ton\"%(H_max);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum refrigeration value is 11.373330 ton\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page Number : 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of refrigeration effect power consumed and COP of refrigerator\n",
+ "\n",
+ "# Variables\n",
+ "m = 0.6;\t\t\t#[kg/s] - mass flow rate\n",
+ "T_low = -20+273.15;\t\t\t#[K] - Temperature at which vapour enters the compressor\n",
+ "T_high = 30+273.15;\t\t\t#[K] - Temperature at which vapour leaves the condenser\n",
+ "\n",
+ "\t\t\t#From saturated refrigeration-12 tables we get,at -20 C\n",
+ "H_1 = 178.74;\t\t\t#[kJ/kg] - (H_1 = H_vap)\n",
+ "P_1 = 0.15093;\t\t\t#[MPa] - (P_1 = P_sat)\n",
+ "P_4 = P_1;\n",
+ "S_1 = 0.7087;\t\t\t#[kJ/kg-K] - (S_1 = S_vap)\n",
+ "S_2 = S_1;\n",
+ "\n",
+ "\t\t\t#At 30 C\n",
+ "P_2 = 0.7449;\t\t\t#[MPa] - (P_2 = P_sat)\n",
+ "P_3 = P_2;\n",
+ "H_3 = 64.59;\t\t\t#[kJ/kg] - (H_3 = H_liq)\n",
+ "H_4 = H_3;\n",
+ "S_3 = 0.24;\t\t\t#[kJ/kg-K] - (S_3 = S_liq)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#It is assumed that presssure drop in the evaporator and condenser are negligible. The heat transfer rate in the evaporator is\n",
+ "Q_L = m*(H_1 - H_4);\n",
+ "\n",
+ "print \"The heat transfer rate in the evaporator is %f kW\"%(Q_L);\n",
+ "\n",
+ "\t\t\t#At state 2 (P = 0.7449 MPa and S = 0.7087 kJ/kg-K) and looking in the superheated tables we have to calculate the enthalpy at state 2\n",
+ "\n",
+ "\t\t\t#At P = 0.7 MPa and S = 0.6917 kJ/kg-K,\n",
+ "H_11 = 200.46;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#At P = 0.7 MPa and S = 0.7153 kJ/kg-K,\n",
+ "H_12 = 207.73;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Thus at P = 0.7 MPa and S = 0.7087 kJ/kg-K, enthalpy is given by\n",
+ "H_13 = ((S_2 -0.6917)/(0.7153 - 0.6917))*(H_12 - H_11) + H_11;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#At P = 0.8 MPa and S = 0.7021 kJ/kg-K,\n",
+ "H_21 = 206.07;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#At P = 0.8 MPa and S = 0.7253 kJ/kg-K,\n",
+ "H_22 = 213.45;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Thus at P = 0.8 MPa and S = 0.7087 kJ/kg-K, enthalpy is given by\n",
+ "H_23 = ((S_2 -0.7021)/(0.7253 - 0.7021))*(H_22 - H_21) + H_21;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#At P = 0.7449 MPa, S = 0.7087 kJ/kg-K, the enthalpy is\n",
+ "H_2 = ((0.7449 - 0.7)/(0.8 - 0.7))*(H_23 - H_13) + H_13;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#Power consumed by the compressor is\n",
+ "W_comp = m*(H_2 - H_1);\t\t\t#[kW]\n",
+ "\n",
+ "print \"The power consumed by the compressor is %f kW\"%(W_comp);\n",
+ "\n",
+ "\t\t\t#Heat removed in evaporator/work done on compressor\n",
+ "COP_R = Q_L/W_comp;\n",
+ "\n",
+ "print \"The COP the refrigerator is %f kW\"%(COP_R);\n",
+ "\n",
+ "\n",
+ "\t\t\t#At -20 C,saturated conditions \n",
+ "H_liq = 17.82;\t\t\t#[kJ/kg]\n",
+ "H_vap = 178.74;\t\t\t#[kJ/kg]\n",
+ "x_4 = (H_4 - H_liq)/(H_vap - H_liq);\n",
+ "\n",
+ "print \"The dryness factor of refrigerant after the expansion valve is %f\"%(x_4);\n",
+ "\n",
+ "\t\t\t#The heat transfer rate in the condenser is\n",
+ "Q_H = m*(H_3 - H_2);\t\t\t#[kW]\n",
+ "\n",
+ "print \"The heat transfer rate in the condenser is %f kW\"%(Q_H);\n",
+ "\n",
+ "\t\t\t#If the cycle would have worked as a pump then,\n",
+ "\t\t\t#COP_HP = (Heat supplied from condenser/Work done on compressor)\n",
+ "COP_HP = (-Q_H)/W_comp;\n",
+ "\n",
+ "print \"The COP if cycle would work as a heat pump is %f kW\"%(COP_HP);\n",
+ "\n",
+ "\t\t\t#If the cycle would have been a reversed Carnot cycle then\n",
+ "COP_C = T_low/(T_high - T_low);\n",
+ "\n",
+ "print \"The COP if cycle would run as reversed Carnot cycle is %f kW\"%(COP_C);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer rate in the evaporator is 68.490000 kW\n",
+ "The power consumed by the compressor is 16.840242 kW\n",
+ "The COP the refrigerator is 4.067044 kW\n",
+ "The dryness factor of refrigerant after the expansion valve is 0.290641\n",
+ "The heat transfer rate in the condenser is -85.330242 kW\n",
+ "The COP if cycle would work as a heat pump is 5.067044 kW\n",
+ "The COP if cycle would run as reversed Carnot cycle is 5.063000 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page Number : 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of amount of air\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\t\t\n",
+ "\n",
+ "# Variables\n",
+ "H_1 = 310.38;\t\t\t#[kJ/kg]\n",
+ "H_2 = 277.7;\t\t\t#[kJ/kg]\n",
+ "H_5 = -122.6;\t\t\t#[kJ/kg]\n",
+ "H_6 = 77.8;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#The enthalpy at point 3 is same at point 4 as the expansion is isenthalpic\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#The mass condensed is 1 kg and therefore m_1 = m+6 + 1\n",
+ "\n",
+ "\t\t\t#Enthalpy balance around heat exchanger\n",
+ "\t\t\t#m_2*H_2 + m_2*H_6 = m_3*H_3 + m_7*H_7\n",
+ "\n",
+ "\t\t\t#Enthalpy balance around separator\n",
+ "\t\t\t#m_4*H_4 = m_5*H_5 + m_6*H_6\n",
+ "\t\t\t#It can be seen that m_1 = m_2 = m_3 = m_4\n",
+ "\t\t\t#and m_6 = m_7 = m_1 - 1\n",
+ "\n",
+ "\t\t\t#Substituting the values for enthalpy balance around heat exchanger we get,\n",
+ "\t\t\t#m_1*H_2 + (m_1 - 1)*(H_6) = m_1*H_3 + (m_1 - 1)*H_1\n",
+ "\t\t\t#and substituting the values for enthalpy balance around seperator we get\n",
+ "\t\t\t#m_1*H_3 = (1)*(-122.6) + (m_1 - 1)*77.8\n",
+ "\t\t\t#H_3 = ((1)*(-122.6) + (m_1 - 1)*77.8)/m_1\n",
+ "\t\t\t#Substituting the expression for 'H_3' in the above equation and then solving for m_1, we get\n",
+ "def f(m_1): \n",
+ "\t return m_1*H_2+(m_1-1)*(H_6)-m_1*(((1)*(-122.6) + (m_1 - 1)*77.8)/m_1)-(m_1-1)*H_1\n",
+ "m_1 = fsolve(f,4)\n",
+ "\t\t\t#Thus to liquify 1 kg of air compression of m_1 kg of air is carried out.\n",
+ "\n",
+ "\t\t\t#Now substituting this value of m_1 to get the value of H_3,\n",
+ "H_3 = ((1)*(-122.6) + (m_1 - 1)*77.8)/m_1;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#From given compressed air table we see at 200 bar and 160 K,\n",
+ "H_3_1 = 40.2;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#At 200 bar and 180 K,\n",
+ "H_3_2 = 79.8;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#By interpolation we get,\n",
+ "T_3 = ((H_3 - H_3_1)*(180 - 160))/(H_3_2 - H_3_1) + 160;\t\t\t#[K]\n",
+ "\n",
+ "print \"Temperature before throttling is %f K\"%(T_3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature before throttling is 171.350719 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.9 Page Number : 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of amount of air and temperature\n",
+ "\n",
+ "# Variables\n",
+ "\t\t\t#At 1 bar, 310 K \n",
+ "H_1 = 310.38;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 200 bar, 310 K\n",
+ "H_2 = 277.7;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 1 bar, Saturated liquid\n",
+ "H_7 = -122.6;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 1 bar, Saturated vapour\n",
+ "H_8 = 77.8;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 200 bar, 200 K\n",
+ "H_3 = 117.6;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 1 bar, 100 K\n",
+ "H_11 = 98.3;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#For 1 kg of liquid air obtained,the overall enthalpy balance is\n",
+ "\t\t\t#m_2*H_2 = W - 122.6 + (m_2 - 1)*H_1\n",
+ "\t\t\t#W = - 0.8*m_2*(H_11 - H_3)\n",
+ "\t\t\t#Overall enthalpy balance equation becomes\n",
+ "\t\t\t#H_2*m_2 = 15.44*m_2 - H_7 + (m_2 - 1)*H_1, solving\n",
+ "m_2_prime = (H_7 - H_1)/(H_2 - 15.44 - H_1);\n",
+ "\n",
+ "print \"The number of kimath.lograms of air compressed per kg of liquid air produced is %f kg\"%(m_2_prime);\n",
+ "\n",
+ "\t\t\t#(2)\n",
+ "\t\t\t#Enthalpy balance around separator is \n",
+ "\t\t\t#0.2*m_2*H_5 = -H_7 + (0.2*m_2 - 1)*H_8, solving\n",
+ "m_2 = m_2_prime;\n",
+ "H_5_prime = ((0.2*m_2-1)*H_8 - H_7)/(0.2*m_2);\n",
+ "\n",
+ "\t\t\t#At point 5, P = 200 bar and enthalpy is\n",
+ "H_5_1 = -33.53;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#From compressed air tables at 200 bar and 140 K,\n",
+ "H_5_2 = 0.2;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 200 bar and 120 K,\n",
+ "H_5_3 = -38.0;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#Solving by interpolation we get\n",
+ "T_5 = ((H_5_1 - H_5_3)*(140 - 120))/(H_5_2 - H_5_3) + 120;\t\t\t#[K]\n",
+ "\n",
+ "print \"The temperature of air before throttling is %f K\"%(T_5);\n",
+ "\n",
+ "\t\t\t#(3)\n",
+ "\t\t\t#During mixing of streams 8 and 11 to produce stream 9, the enthalpy balance is\n",
+ "\t\t\t# (0.2*m_2 - 1)*H_8 + 0.8*m_2*H_11 = (m_2 - 1)*H_9,Solving for H_9\n",
+ "\n",
+ "H_9_prime = ((0.2*m_2-1)*H_8+0.8*m_2*H_11)/(m_2 - 1);\n",
+ "\n",
+ "\t\t\t#From given compressed air tables at 1 bar and 100 K,\n",
+ "H_9_1 = H_11;\n",
+ "\t\t\t#At 1 bar and 90 K \n",
+ "H_9_2 = 87.9;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#Solving by interpolation we get\n",
+ "T_9 = ((H_9_prime - H_9_2)*(100 - 90))/(H_9_1 - H_9_2) + 90;\t\t\t#[K]\n",
+ "\n",
+ "print \"The temperature of stream entering second heat exchanger is %f K\"%(T_9);\n",
+ "\n",
+ "\t\t\t#(4)\n",
+ "\t\t\t#Enthalpy balance around first heat exchanger is\n",
+ "\t\t\t#H_2*m_2 + (m_2 - 1)*H_10 = H_3*m-2 + (m-2 - 1)*H_1, solving for H_10\n",
+ "\n",
+ "H_10_prime = ((m_2 - 1)*H_1 + H_3*m_2 - H_2*m_2)/(m_2 - 1);\n",
+ "\n",
+ "\t\t\t#From given compressed air tables at 1 bar and 140 K,\n",
+ "H_10_1 = 139.1;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 1 bar and 120 K \n",
+ "H_10_2 = 118.8;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#Solving by interpolation we get\n",
+ "T_10 = ((H_10_prime - H_10_2)*(140 - 120))/(H_10_1 - H_10_2) + 120;\t\t\t#[K]\n",
+ "\n",
+ "print \"The temperature of stream exiting second heat exchanger is %f K\"%(T_10);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of kimath.lograms of air compressed per kg of liquid air produced is 8.997922 kg\n",
+ "The temperature of air before throttling is 122.340314 K\n",
+ "The temperature of stream entering second heat exchanger is 98.029358 K\n",
+ "The temperature of stream exiting second heat exchanger is 131.292906 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.10 Page Number : 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of temperature of air\n",
+ "\n",
+ "# Variables\n",
+ "P_high = 40;\t\t\t#[bar]\n",
+ "P_low = 5;\t\t\t#[bar]\n",
+ "m_1 = 0.5;\t\t\t#[kg/s] - Rate of mass moving through the expander\n",
+ "m_2 = 0.1;\t\t\t#[kg/s] - Rate of mass of vapour mixing with air\n",
+ "e = 0.7;\t\t\t#Efficiency\n",
+ "\n",
+ "\t\t\t#At state 3,(40 bar and 200 K),enthalpy and entropy is given by\n",
+ "H_3 = 179.7;\t\t\t#[kJ/kg]\n",
+ "S_3 = 5.330;\t\t\t#[kJ/kg-K]\n",
+ "\n",
+ "\t\t\t#If isentropic conditions exits in the turbine then state 11 is at 5 bar\n",
+ "S_11 = 5.330;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t#From given compressed air tables at 5 bar and 120 K,\n",
+ "H_11_1 = 113.6;\t\t\t#[kJ/kg]\n",
+ "S_11_1 = 5.455;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t#At 5 bar and 100 K \n",
+ "H_11_2 = 90.6;\t\t\t#[kJ/kg]\n",
+ "S_11_2 = 5.246;\t\t\t#[kJ/kg-K]\n",
+ "\t\t\t#The enthalpy has to be determined when S = S_3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\t\t\t#Solving by interpolation we get\n",
+ "H_11_s = ((H_11_1 - H_11_2)*(S_3 - S_11_2))/(S_11_1 - S_11_2) + H_11_2;\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#The adiabatic efficiency of tyrbine is given by\n",
+ "\t\t\t#(H_3 - H_11_a)/(H_3 - H_11_s) = e\n",
+ "H_11_a = H_3 - e*(H_3 - H_11_s);\t\t\t#[kJ/kg] - Actual enthalpy\n",
+ "\n",
+ " \t\t\t#At 5 bar,the saturated enthalpy is given to be\n",
+ "H_8 = 88.7;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#From enthalpy balance during mixing we get,\n",
+ "\t\t\t#0.1*H_8 + 0.5*H_11_a = 0.6*H_9\n",
+ "H_9 = (m_2*H_8 + m_1*H_11_a)/(m_1 + m_2);\t\t\t#[kJ/kg]\n",
+ "\n",
+ "\t\t\t#From given compressed air tables at 5 bar and 140 K,\n",
+ "H_9_1 = 135.3;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#At 5 bar and 120 K \n",
+ "H_9_2 = 113.6;\t\t\t#[kJ/kg]\n",
+ "\t\t\t#By interpolation we get\n",
+ "T_9 = ((H_9 - H_11_1)*(140 - 120))/(H_9_1 - H_11_1) + 120;\t\t\t#[K]\n",
+ "\n",
+ "print \" The temperature of air entering the second heat exchanger is %f K\"%(T_9);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The temperature of air entering the second heat exchanger is 124.009841 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Chemical_Engineering_Thermodynamics/screenshots/1.png b/Chemical_Engineering_Thermodynamics/screenshots/1.png
new file mode 100644
index 00000000..2ec2e814
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/screenshots/1.png
Binary files differ
diff --git a/Chemical_Engineering_Thermodynamics/screenshots/2.png b/Chemical_Engineering_Thermodynamics/screenshots/2.png
new file mode 100644
index 00000000..91cda60b
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/screenshots/2.png
Binary files differ
diff --git a/Chemical_Engineering_Thermodynamics/screenshots/3.png b/Chemical_Engineering_Thermodynamics/screenshots/3.png
new file mode 100644
index 00000000..61ce8534
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/screenshots/3.png
Binary files differ
diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pic111.png b/Chemical_Engineering_Thermodynamics/screenshots/pic111.png
new file mode 100644
index 00000000..0564964c
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/screenshots/pic111.png
Binary files differ
diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pic222.png b/Chemical_Engineering_Thermodynamics/screenshots/pic222.png
new file mode 100644
index 00000000..2442734b
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/screenshots/pic222.png
Binary files differ
diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pic333.png b/Chemical_Engineering_Thermodynamics/screenshots/pic333.png
new file mode 100644
index 00000000..2fcec895
--- /dev/null
+++ b/Chemical_Engineering_Thermodynamics/screenshots/pic333.png
Binary files differ
diff --git a/Data_Structures_and_Algorithms_in_Java/README.txt b/Data_Structures_and_Algorithms_in_Java/README.txt
new file mode 100644
index 00000000..4b659a4b
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Jatin Pavagadhi
+Course: mca
+College/Institute/Organization: Indian Institute of Engineering Bombay
+Department/Designation: System Administrator
+Book Title: Data Structures and Algorithms in Java
+Author: Robert Lafore
+Publisher: Sams Publishing
+Year of publication: 2003
+Isbn: 0672324539
+Edition: 2nd \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch1.ipynb b/Data_Structures_and_Algorithms_in_Java/ch1.ipynb
new file mode 100644
index 00000000..c62ab0cb
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch1.ipynb
@@ -0,0 +1,86 @@
+{
+ "metadata": {
+ "name": "ch1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Overview"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page No : 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "demonstrates basic OOP syntax\n",
+ "to run this program: python BankApp\n",
+ "'''\n",
+ "\n",
+ "class BankAccount:\n",
+ " def __init__(self,openingBalance): # constructor\n",
+ " self.balance = openingBalance\n",
+ "\n",
+ " def deposit(self,amount): # makes deposit\n",
+ " self.balance = self.balance + amount; \n",
+ " \n",
+ " def withdraw(self,amount): # makes withdrawal\n",
+ " self.balance = self.balance - amount; \n",
+ "\n",
+ " def display(self):\n",
+ " # displays balance \n",
+ " print 'balance=' , self.balance\n",
+ "\n",
+ "# end class BankAccount\n",
+ "\n",
+ "ba1 = BankAccount(100.00) # create acct\n",
+ "print 'Before transactions, ',\n",
+ "ba1.display()\n",
+ "# display balance\n",
+ "ba1.deposit(74.35)\n",
+ "ba1.withdraw(20.00)\n",
+ "print 'After transactions, ' ,\n",
+ "ba1.display()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before transactions, balance= 100.0\n",
+ "After transactions, balance= 154.35\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch10.ipynb b/Data_Structures_and_Algorithms_in_Java/ch10.ipynb
new file mode 100644
index 00000000..cf44793a
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch10.ipynb
@@ -0,0 +1,43 @@
+{
+ "metadata": {
+ "name": "ch10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 10 : 2-3-4 Trees and External Storage"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.1 Page No : 478"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 10.1\ndemonstrates 234 tree\n'''\nclass DataItem:\n def __init__(self,dd):\n self.dData = dd\n\n def displayItem(self):\n print '/' ,self.dData\n\nclass Node:\n def __init__(self):\n self.ORDER = 4\n self.numItems = 0\n self.parent = None\n self.childArray = [None,None,None,None]\n self.itemArray = [None,None,None]\n\n def connectChild(self,childNum,child):\n self.childArray[childNum] = child\n if(child != None):\n child.parent = self\n\n def disconnectChild(self,childNum):\n tempNode = self.childArray[childNum]\n self.childArray[childNum] = None\n return tempNode\n\n def getChild(self,childNum):\n return self.childArray[childNum]\n\n def getParent(self):\n return self.parent\n\n def isLeaf(self):\n if self.childArray[0]==None:\n return True \n return False \n\n def getNumItems(self):\n return self.numItems\n\n def getItem(self,index): # get DataItem at index\n return self.itemArray[index] \n\n def isFull(self):\n if self.numItems==self.ORDER-1:\n return True\n return False\n\n def findItem(self,key): # return index of # item (within node)\n for j in range(self.ORDER-1): \n if(self.itemArray[j] == None):\n break\n elif(self.itemArray[j].dData == key):\n return j\n return -1\n\n def insertItem(self,newItem):\n #assumes node is not full\n self.numItems += 1 # will add new item\n newKey = newItem.dData # key of new item\n j = self.ORDER - 2\n while j>=0:\n if(self.itemArray[j] == None):\n continue\n else:\n itsKey = self.itemArray[j].dData\n if(newKey < itsKey):\n self.itemArray[j+1] = self.itemArray[j]\n else:\n self.itemArray[j+1] = newItem\n return j+1 # return index to\n j -= 1\n\n self.itemArray[0] = newItem # insert new item\n return 0\n\n def removeItem(self): # remove largest item\n temp = self.itemArray[self.numItems-1] # save item\n self.itemArray[self.numItems-1] = None # disconnect it\n self.numItems -= 1 # one less item\n return temp # return item\n\n def displayNode(self):\n for j in range(self.numItems):\n self.itemArray[j].displayItem()\n print ''\n\nclass Tree234:\n def __init__(self):\n self.root = Node() # make root node\n\n def find(self,key):\n curNode = self.root\n childNumber = 0\n while(True):\n childNumber=curNode.findItem(key) \n if(childNumber != -1):\n return childNumber # found it\n elif( curNode.isLeaf() ):\n return -1 # cant find it\n else: # search deeper\n curNode = getNextChild(curNode, key)\n\n def insert(self,dValue):\n curNode = self.root\n tempItem = DataItem(dValue)\n while(True):\n if( curNode.isFull() ):\n split(curNode)\n curNode = curNode.getParent()\n curNode = getNextChild(curNode, dValue)\n elif( curNode.isLeaf() ): # if node is leaf,\n break\n else:\n curNode = getNextChild(curNode, dValue)\n curNode.insertItem(tempItem)\n\n def split(self,thisNode): # split the node\n # assumes node is full\n itemC = thisNode.removeItem() # remove items from\n itemB = thisNode.removeItem() # this node\n child2 = thisNode.disconnectChild(2) # remove children\n child3 = thisNode.disconnectChild(3) # from this nodeJava Code for a 2-3-4 Tree\n newRight = Node() # make new node\n if(thisNode==self.root):\n self.root = Node()\n parent = self.root\n self.root.connectChild(0, thisNode)\n else:\n parent = thisNode.getParent()\n itemIndex = parent.insertItem(itemB) # item B to parent\n n = parent.getNumItems()\n j = n-1\n while j > itemIndex:\n temp = parent.disconnectChild(j) # one child\n parent.connectChild(j+1, temp)\n j -= 1\n\n parent.connectChild(itemIndex+1, newRight) # deal with newRight\n newRight.insertItem(itemC) # item C to newRight\n newRight.connectChild(0, child2) # connect to 0 and 1\n newRight.connectChild(1, child3) # on newRight\n\n def getNextChild(self,theNode,theValue):\n # assumes node is not empty, not full, not a leaf\n numItems = theNode.getNumItems() \n for j in range(numItems): # for each item in node\n if( theValue < theNode.getItem(j).dData ):\n return theNode.getChild(j) # return left child\n return theNode.getChild(j)\n\n def displayTree(self):\n self.recDisplayTree(self.root, 0, 0)\n\n def recDisplayTree(self,thisNode,level, childNumber):\n print 'level=' ,level ,' child=',childNumber , ' '\n thisNode.displayNode()\n numItems = thisNode.getNumItems()\n for j in range(numItems+1):\n nextNode = thisNode.getChild(j)\n if(nextNode != None):\n self.recDisplayTree(nextNode, level+1, j)\n else:\n return\ntheTree = Tree234()\ntheTree.insert(50)\ntheTree.insert(40)\ntheTree.insert(60)\ntheTree.insert(30)\ntheTree.insert(70)\nwhile(True):\n print 'Enter first letter of show, '\n print 'insert, find, or display: ',\n choice = raw_input()\n if choice == 's':\n theTree.displayTree()\n elif choice == 'i':\n print 'Enter value to insert: '\n value = int(raw_input())\n theTree.insert(value)\n elif choice == 'f':\n print 'Enter value to find: ',\n value = int(raw_input())\n found = theTree.find(value)\n if(found != -1):\n print 'Found: ', value\n else:\n print 'Could not find', value \n else:\n print 'Invalid entry'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch11.ipynb b/Data_Structures_and_Algorithms_in_Java/ch11.ipynb
new file mode 100644
index 00000000..5756b776
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch11.ipynb
@@ -0,0 +1,96 @@
+{
+ "metadata": {
+ "name": "ch11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 11 : Hash Tables"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 11.1 Page No : 535"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 11.1\ndemonstrates hash table with linear probing\n'''\nclass DataItem:\n def __init__(self,ii):\n self.iData = ii\n\n def getKey(self):\n return self.iData\n\nclass HashTable:\n def __init__(self,size):\n self.hashArray = [] # array is the hash table\n for i in range(size):\n self.hashArray.append(DataItem(0))\n self.arraySize = size\n self.nonItem = None # for deleted items\n\n def displayTable(self):\n print 'Table: ',\n for j in range(self.arraySize):\n if(self.hashArray[j] != None):\n print self.hashArray[j].getKey() ,\n else:\n print '** ' ,\n print ''\n\n\n def hashFunc(self,key):\n return key % self.arraySize\n\n # insert a DataItem\n def insert(self,item):\n key = item.getKey() # extract key\n hashVal = self.hashFunc(key) # hash the key\n while(self.hashArray[hashVal] != None and self.hashArray[hashVal].getKey() != -1):\n hashVal += 1\n hashVal %= self.arraySize # wraparound if necessary\n self.hashArray[hashVal] = item # insert item\n\n def delete(self,key): # delete a DataItem\n hashVal = hashFunc(key) # hash the key\n while(self.hashArray[hashVal] != None): # until empty cell,\n # is correct hashVal?\n if(self.hashArray[hashVal].getKey() == key):\n temp = self.hashArray[hashVal] # save item\n self.hashArray[hashVal] = nonItem # delete item\n return temp # return item\n hashVal += 1\n hashVal %= self.arraySize # for wraparound\n return None # cant find item\n\n def find(self,key): # find item with key\n # (assumes table not full)\n hashVal = hashFunc(key) # hash the key\n while(self.hashArray[hashVal] != None): # until empty cell,\n # is correct hashVal?\n if(self.hashArray[hashVal].getKey() == key):\n return self.hashArray[hashVal] # yes, return item\n hashVal += 1 # add the step\n hashVal %= self.arraySize\n # for wraparound\n return None # cant find item\n\nprint 'Enter size of hash table: ',\nsize = int(raw_input())\nprint 'Enter initial number of items: ',\nn = int(raw_input()) # make table\ntheHashTable = HashTable(size)\nkeysPerCell = 10\nimport random\nfor j in range(n): # insert data\n aKey = int(random.random() * keysPerCell * size)\n aDataItem = DataItem(aKey) \n theHashTable.insert(aDataItem)\n\nwhile(True):\n print 'Enter first letter of show, '\n print 'insert, find, delete, or traverse: ',\n choice = raw_input()\n if choice == 's':\n theHashTable.displayTable()\n elif choice == 'i':\n print 'Enter value to key to insert: '\n value = int(raw_input())\n aDataItem = DataItem(aKey)\n theHashTable.insert(aDataItem)\n elif choice == 'f':\n print 'Enter key value to find: ',\n value = int(raw_input())\n aDataItem = theHashTable.find(aKey)\n if(aDataItem != None):\n print 'Found ' , aKey\n else:\n print 'Could not find ' , aKey\n\n elif choice=='d':\n print 'Enter key value to delete: ',\n value = int(raw_input())\n theHashTable.delete(value)\n else:\n print 'Invalid entry'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter size of hash table: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "12\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter initial number of items: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ }
+ ],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 11.2 Page no: 546"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 11.2\ndemonstrates hash table with double hashing\n'''\nclass DataItem:\n def __init__(self,ii):\n self.iData = ii\n\n def getKey(self):\n return self.iData\n\nclass HashTable:\n def __init__(self,size):\n self.hashArray = [] # array is the hash table\n for i in range(size):\n self.hashArray.append(DataItem(0))\n self.arraySize = size\n self.nonItem = None # for deleted items\n\n def displayTable(self):\n print 'Table: ',\n for j in range(self.arraySize):\n if(self.hashArray[j] != None):\n print self.hashArray[j].getKey() ,\n else:\n print '** ' ,\n print ''\n\n def hashFunc1(self,key):\n return key % self.arraySize\n\n def hashFunc2(self,key):\n # non-zero, less than array size, different from hF1\n # array size must be relatively prime to 5, 4, 3, and 2\n return 5 - key % 5\n \n # insert a DataItem\n def insert(self,key,item):\n # (assumes table not full)\n hashVal = self.hashFunc1(key) # hash the key\n stepSize = self.hashFunc2(key) # get step size\n # until empty cell or -1\n while(self.hashArray[hashVal] != None and self.hashArray[hashVal].getKey() != -1):\n hashVal += stepSize # add the step\n hashVal %= self.arraySize # for wraparound\n self.hashArray[hashVal] = item # insert item\n\n def delete(self,key): # delete a DataItem\n hashVal = hashFunc1(key) # hash the key\n stepSize = hashFunc2(key) # get step size\n while(self.hashArray[hashVal] != None): # until empty cell,\n # is correct hashVal?\n if(self.hashArray[hashVal].getKey() == key):\n temp = self.hashArray[hashVal] # save item\n self.hashArray[hashVal] = nonItem # delete item\n return temp # return item\n hashVal += stepSize # add the step\n hashVal %= self.arraySize # for wraparound\n return None # cant find item\n\n def find(self,key): # find item with key\n # (assumes table not full)\n hashVal = hashFunc1(key) # hash the key\n stepSize = hashFunc2(key) # get step size\n while(self.hashArray[hashVal] != None): # until empty cell,\n # is correct hashVal?\n if(self.hashArray[hashVal].getKey() == key):\n return self.hashArray[hashVal] # yes, return item\n hashVal += stepSize # add the step\n hashVal %= self.arraySize\n # for wraparound\n return None # cant find item\n\nprint 'Enter size of hash table: ',\nsize = int(raw_input())\nprint 'Enter initial number of items: ',\nn = int(raw_input()) # make table\ntheHashTable = HashTable(size)\nimport random\nfor j in range(n): # insert data\n aKey = int(random.random() * 2 * size)\n aDataItem = DataItem(aKey) \n theHashTable.insert(aKey, aDataItem)\n\nwhile(True):\n print 'Enter first letter of show, '\n print 'insert, find, delete, or traverse: ',\n choice = raw_input()\n if choice == 's':\n theHashTable.displayTable()\n elif choice == 'i':\n print 'Enter value to key to insert: '\n value = int(raw_input())\n aDataItem = DataItem(aKey)\n theHashTable.insert(aKey, aDataItem)\n elif choice == 'f':\n print 'Enter key value to find: ',\n value = int(raw_input())\n aDataItem = theHashTable.find(aKey)\n if(aDataItem != None):\n print 'Found ' , aKey\n else:\n print 'Could not find ' , aKey\n\n elif choice=='d':\n print 'Enter key value to delete: ',\n value = int(raw_input())\n theHashTable.delete(value)\n else:\n print 'Invalid entry'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 11.3 Page no : 555"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 11.3\ndemonstrates hash table with separate chaining\n'''\n\nclass Link:\n def __init__(self,ii):\n self.iData = ii\n\n def getKey(self):\n return self.iData\n\n def displayLink(self):\n print self.iData ,\n\nclass SortedList:\n def __init__(self):\n self.first = None\n\n def insert(self,theLink): # insert link, in order\n key = theLink.getKey()\n self.previous = None # start at self.first\n current = self.first # until end of list,\n while( current != None and key > current.getKey() ): # or current > key,\n self.previous = current \n current = current.next # go to next item\n if(self.previous==None): # if beginning of list,\n self.first = theLink\n else: # not at beginning,\n self.previous.next = theLink\n theLink.next = current # new link --> current\n\n def delete(self,key): # delete link\n # (assumes non-empty list)\n self.previous = None # start at self.first\n current = self.first # until end of list,\n while( current != None and key != current.getKey() ): # or key == current,\n self.previous = current\n current = current.next # go to next link\n if(self.previous==None):\n self.first = self.first.next\n else:\n self.previous.next = current.next \n\n def find(self,key): # find link\n current = self.first # start at self.first\n # until end of list,\n while(current != None and current.getKey() <= key): # or key too small,\n if(current.getKey() == key):# is this the link?\n return current # found it, return link\n current = current.next # go to next item\n return None # didnt find it\n\n def displayList(self):\n print 'List (self.first-->last): ',\n current = self.first # start at beginning of list\n while(current != None): # until end of list,\n current.displayLink() # print data\n current = current.next # move to next link\n print ''\n\nclass HashTable:\n def __init__(self,size):\n self.hashArray = [] # array is the hash table\n for i in range(size):\n self.hashArray.append(SortedList())\n self.arraySize = size\n self.nonItem = None # for deleted items\n\n def displayTable(self):\n print 'Table: ',\n for j in range(self.arraySize):\n print j, \n self.hashArray[j].displayList()\n\n def hashFunc(self,key):\n return key % self.arraySize\n\n def insert(self,theLink):\n key = theLink.getKey()\n hashVal = self.hashFunc(key)\n self.hashArray[hashVal].insert(theLink)\n\n def delete(self,key): # delete a DataItem\n hashVal = self.hashFunc(key) # hash the key\n self.hashArray[hashVal].delete(key) # delete link\n\n def find(self,key): # find link\n hashVal = self.hashFunc(key)# hash the key\n theLink = self.hashArray[hashVal].find(key) # get link\n return theLink # return link\n\nkeysPerCell = 100 \nprint 'Enter size of hash table: ',\nsize = int(raw_input())\nprint 'Enter initial number of items: ',\nn = int(raw_input()) # make table\ntheHashTable = HashTable(size)\nimport random\nfor j in range(n): # insert data\n aKey = int(random.random() * 2 * size)\n aDataItem = Link(aKey) \n theHashTable.insert(aDataItem)\n\nwhile(True):\n print 'Enter self.first letter of show, '\n print 'insert, find, delete, or show: ',\n choice = raw_input()\n if choice == 's':\n theHashTable.displayTable()\n elif choice == 'i':\n print 'Enter value to key to insert: '\n value = int(raw_input())\n aDataItem = Link(aKey)\n theHashTable.insert(aDataItem)\n elif choice == 'f':\n print 'Enter key value to find: ',\n value = int(raw_input())\n aDataItem = theHashTable.find(aKey)\n if(aDataItem != None):\n print 'Found ' , aKey\n else:\n print 'Could not find ' , aKey\n\n elif choice=='d':\n print 'Enter key value to delete: ',\n value = int(raw_input())\n theHashTable.delete(value)\n else:\n print 'Invalid entry'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch12.ipynb b/Data_Structures_and_Algorithms_in_Java/ch12.ipynb
new file mode 100644
index 00000000..8343fffc
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch12.ipynb
@@ -0,0 +1,158 @@
+{
+ "metadata": {
+ "name": "ch12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 12 : Heaps "
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 12.1 Page no : 592"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 12.1\ndemonstrates heaps\n'''\n\nclass Node: \n def __init__(self,key):\n # constructorJava Code for Heaps\n self.iData = key\n \n def getKey(self):\n return self.iData\n\n def setKey(self,i):\n self.iData = i\n\nclass Heap:\n def __init__(self,mx):\n self.maxSize = mx\n self.currentSize = 0\n self.heapArray = []\n for i in range(self.maxSize):\n self.heapArray.append(Node(0))\n\n def isEmpty(self):\n return self.currentSize==0\n\n def insert(self,key):\n if(self.currentSize==self.maxSize):\n return False\n newNode = Node(key)\n self.heapArray[self.currentSize] = newNode\n self.trickleUp(self.currentSize)\n self.currentSize += 1\n return True\n\n def trickleUp(self,index):\n parent = (index-1) / 2\n bottom = self.heapArray[index]\n while( index > 0 and self.heapArray[parent].getKey() < bottom.getKey() ):\n self.heapArray[index] = self.heapArray[parent] # move it down\n index = parent\n parent = (parent-1) / 2\n self.heapArray[index] = bottom\n\n def remove(self): # delete item with max key\n # (assumes non-empty list)\n root = self.heapArray[0]\n self.currentSize -= 1\n self.heapArray[0] = self.heapArray[self.currentSize]\n self.trickleDown(0)\n return root\n\n def trickleDown(self,index):\n top = self.heapArray[index] # save root\n while(index < self.currentSize/2): # while node has at\n leftChild = 2*index+1\n rightChild = leftChild+1 # find larger child\n if(rightChild < self.currentSize and self.heapArray[leftChild].getKey() < self.heapArray[rightChild].getKey()):\n largerChild = rightChild\n else:\n largerChild = leftChild\n if( top.getKey() >= self.heapArray[largerChild].getKey() ):\n break\n # shift child up\n self.heapArray[index] = self.heapArray[largerChild]\n index = largerChild # go down\n\n self.heapArray[index] = top # root to indexJava Code for Heaps\n \n def change(self,index,newValue):\n if(index<0 or index>=self.currentSize):\n return False\n oldValue = self.heapArray[index].getKey() # remember old\n self.heapArray[index].setKey(newValue) # change to new\n if(oldValue < newValue): # if raised,\n trickleUp(index) # trickle it up\n else: # if lowered,\n trickleDown(index) # trickle it down\n return True\n\n def displayHeap(self):\n print 'self.heapArray: ', # array format\n for m in range(self.currentSize):\n if(self.heapArray[m] != None):\n print self.heapArray[m].getKey(),\n else:\n print '-- ' ,\n print ''\n nBlanks = 32\n itemsPerRow = 1\n column = 0\n j = 0\n # current item\n dots = '...............................'\n print dots+dots\n # dotted top line\n while(self.currentSize > 0):\n if(column == 0):\n for k in range(nBlanks):\n print ' ' ,\n print self.heapArray[j].getKey() ,\n j += 1 \n if(j == self.currentSize):\n break # done?\n column += 1\n if(column==itemsPerRow): # end of row?\n nBlanks /= 2 # half the blanks\n itemsPerRow *= 2 # twice the items\n column = 0 # start over on\n print ''\n else: # next item on row\n for k in range(nBlanks*2-2):\n print ' ', # interim blanks\n print '\\n' +dots+dots \n\ntheHeap = Heap(31) # make a Heap max size 31\ntheHeap.insert(70)\ntheHeap.insert(40)\ntheHeap.insert(50)\ntheHeap.insert(20)\ntheHeap.insert(60)\ntheHeap.insert(100)\ntheHeap.insert(80)\ntheHeap.insert(30)\ntheHeap.insert(10)\ntheHeap.insert(90)\nwhile(True):\n print 'Enter first letter of show, insert, remove, change: ',\n choice = raw_input()\n if choice == 's':\n theHeap.displayHeap()\n elif choice == 'i':\n print 'Enter value to key to insert: '\n value = int(raw_input())\n success = theHeap.insert(value)\n if not success:\n print \"Can't insert heap full\"\n elif choice == 'f':\n print 'Enter key value to find: ',\n value = int(raw_input())\n aDataItem = theHashTable.find(aKey)\n if(aDataItem != None):\n print 'Found ' , aKey\n else:\n print 'Could not find ' , aKey\n elif choice=='r':\n if not theHeap.isEmpty():\n theHeap.remove()\n else:\n print \"Can't remove heap empty\"\n elif choice=='c':\n print 'Enter current index of item: ',\n value = int(raw_input())\n print \"Enter new key: \",\n value2 = int(raw_input())\n success = theHeap.change(value, value2)\n if( not success ):\n print 'Invalid index'\n else:\n print \"Invalid entry\"\n break ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, insert, remove, change: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " self.heapArray: 100 90 80 30 60 50 70 20 10 40 \n..............................................................\n 100 \n 90 80 \n 30 60 50 70 \n 20 10 40 \n..............................................................\nEnter first letter of show, insert, remove, change: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "i\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter value to key to insert: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "53\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter first letter of show, insert, remove, change: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " self.heapArray: 100 90 80 30 60 50 70 20 10 40 53 \n..............................................................\n 100 \n 90 80 \n 30 60 50 70 \n 20 10 40 53 \n..............................................................\nEnter first letter of show, insert, remove, change: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "r\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, insert, remove, change: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " self.heapArray: 90 60 80 30 53 50 70 20 10 40 \n..............................................................\n 90 \n 60 80 \n 30 53 50 70 \n 20 10 40 \n..............................................................\nEnter first letter of show, insert, remove, change: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Invalid entry\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 12.2 Page no : 605"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 12.2\ndemonstrates heap sort\n'''\nclass Node: \n def __init__(self,key):\n # constructorJava Code for Heaps\n self.iData = key\n \n def getKey(self):\n return self.iData\n\n def setKey(self,i):\n self.iData = i\n\nclass Heap:\n def __init__(self,mx):\n self.maxSize = mx\n self.currentSize = 0\n self.heapArray = []\n for i in range(self.maxSize):\n self.heapArray.append(Node(0))\n\n def isEmpty(self):\n return self.currentSize==0\n\n def insert(self,key):\n if(self.currentSize==self.maxSize):\n return False\n newNode = Node(key)\n self.heapArray[self.currentSize] = newNode\n self.trickleUp(self.currentSize)\n self.currentSize += 1\n return True\n\n def remove(self): # delete item with max key\n # (assumes non-empty list)\n root = self.heapArray[0]\n self.currentSize -= 1\n self.heapArray[0] = self.heapArray[self.currentSize]\n self.trickleDown(0)\n return root\n\n def trickleDown(self,index):\n top = self.heapArray[index] # save root\n while(index < self.currentSize/2): # while node has at\n leftChild = 2*index+1\n rightChild = leftChild+1 # find larger child\n if(rightChild < self.currentSize and self.heapArray[leftChild].getKey() < self.heapArray[rightChild].getKey()):\n largerChild = rightChild\n else:\n largerChild = leftChild\n if( top.getKey() >= self.heapArray[largerChild].getKey() ):\n break\n # shift child up\n self.heapArray[index] = self.heapArray[largerChild]\n index = largerChild # go down\n self.heapArray[index] = top # root to indexJava Code for Heaps\n\n def displayHeap(self):\n print 'self.heapArray: ', # array format\n for m in range(self.currentSize):\n if(self.heapArray[m] != None):\n print self.heapArray[m].getKey(),\n else:\n print '-- ' ,\n print ''\n nBlanks = 32\n itemsPerRow = 1\n column = 0\n j = 0\n # current item\n dots = '...............................'\n print dots+dots\n # dotted top line\n while(self.currentSize > 0):\n if(column == 0):\n for k in range(nBlanks):\n print ' ' ,\n print self.heapArray[j].getKey() ,\n j += 1 \n if(j == self.currentSize):\n break # done?\n column += 1\n if(column==itemsPerRow): # end of row?\n nBlanks /= 2 # half the blanks\n itemsPerRow *= 2 # twice the items\n column = 0 # start over on\n print ''\n else: # next item on row\n for k in range(nBlanks*2-2):\n print ' ', # interim blanks\n print '\\n' +dots+dots \n \n def displayArray(self):\n for j in range(self.maxSize):\n print self.heapArray[j].getKey() ,\n print ''\n\n def insertAt(self,index,newNode):\n self.heapArray[index] = newNode\n\n def incrementSize(self):\n self.currentSize += 1\n\n\nprint 'Enter number of items: ',\nsize = int(raw_input())\ntheHeap = Heap(size)\nimport random\nfor j in range(size): # fill array with\n r = int(random.random()*100)\n newNode = Node(r)\n theHeap.insertAt(j, newNode)\n theHeap.incrementSize()\nprint 'Random: ',\ntheHeap.displayArray() # display random array\nj = size/2 - 1\nwhile j >= 0:\n theHeap.trickleDown(j)\n j -= 1\nprint 'Heap: ',\ntheHeap.displayArray()\ntheHeap.displayHeap()\nj = size - 1\nwhile j >= 0:\n biggestNode = theHeap.remove()\n theHeap.insertAt(j, biggestNode)\n j -= 1\n \nprint 'Sorted: ',\ntheHeap.displayArray()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of items: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Random: 21 55 43 65 70 16 47 22 51 73 \nHeap: 73 70 47 65 55 16 43 22 51 21 \nself.heapArray: 73 70 47 65 55 16 43 22 51 21 \n..............................................................\n 73 \n 70 47 \n 65 55 16 43 \n 22 51 21 \n..............................................................\nSorted: 16 21 22 43 47 51 55 65 70 73 \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch13.ipynb b/Data_Structures_and_Algorithms_in_Java/ch13.ipynb
new file mode 100644
index 00000000..cab6d6e8
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch13.ipynb
@@ -0,0 +1,112 @@
+{
+ "metadata": {
+ "name": "ch13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 13 : Graphs"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.1 Page no: 631"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 13.1\ndemonstrates depth-first search\n'''\nclass StackX:\n def __init__(self):\n self.st = [] # make array\n self.top = -1\n\n def push(self,j): # put item on stack\n self.top += 1\n self.st.append(j)\n\n def pop(self): # take item off stack\n self.top -= 1\n return self.st.pop()\n\n def peek(self): # peek at top of stack\n return self.st[self.top]\n \n def isEmpty(self): # true if nothing on stack-\n return self.top == -1\n\nclass Vertex:\n def __init__(self,lab): # constructor\n self.label = lab\n self.wasVisited = False\n\nclass Graph:\n def __init__(self):\n self.vertexList = [] # adjacency matrix\n self.adjMat = []\n self.nVerts = 0\n for j in range(20): # set adjacency\n l = []\n for k in range(20):\n l.append(0)\n self.adjMat.append(l)\n self.theStack = StackX()\n\n def addVertex(self,lab):\n self.vertexList.append( Vertex(lab))\n self.nVerts += 1\n\n def addEdge(self,start, end):\n self.adjMat[start][end] = 1\n self.adjMat[end][start] = 1\n\n def displayVertex(self,v):\n print self.vertexList[v].label ,\n\n def dfs(self): # depth-first search # begin at vertex 0\n self.vertexList[0].wasVisited = True # mark it\n self.displayVertex(0) # display it\n self.theStack.push(0) # push it\n while( not self.theStack.isEmpty() ): # until stack empty,\n # get an unvisited vertex adjacent to stack top\n v = self.getAdjUnvisitedVertex( self.theStack.peek() )\n if(v == -1): # if no such vertex,\n self.theStack.pop()\n else: # if it exists,\n self.vertexList[v].wasVisited = True # mark it\n self.displayVertex(v) # display it\n self.theStack.push(v) # push it\n\n # stack is empty, so we're done\n for j in range(self.nVerts): # reset flags\n self.vertexList[j].wasVisited = False # end dfs\n\n def getAdjUnvisitedVertex(self,v):\n for j in range(self.nVerts):\n if(self.adjMat[v][j]==1 and self.vertexList[j].wasVisited==False):\n return j\n return -1\n\ntheGraph = Graph()\ntheGraph.addVertex('A') # 0 (start for dfs)\ntheGraph.addVertex('B') # 1\ntheGraph.addVertex('C') # 2\ntheGraph.addVertex('D') # 3\ntheGraph.addVertex('E') # 4\ntheGraph.addEdge(0,1)\ntheGraph.addEdge(1,2)\ntheGraph.addEdge(0,3)\ntheGraph.addEdge(3,4)\nprint 'Visits: ',\ntheGraph.dfs() # depth-first search",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Visits: A B C D E\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.2 Page no : 639"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 13.2\ndemonstrates breadth-first search\n'''\nclass Queue:\n def __init__(self): # constructor\n self.SIZE = 20\n self.queArray = []\n for i in range(20):\n self.queArray.append(0)\n self.front = 0\n self.rear = -1\n\n def insert(self,j): # put item at self.rear of queue\n if(self.rear == self.SIZE-1):\n self.rear = -1\n self.rear += 1\n self.queArray[self.rear] = j\n\n def remove(self): # take item from front of queue\n temp = self.queArray[self.front]\n self.front += 1\n if(self.front == self.SIZE):\n self.front = 0\n return temp\n\n def isEmpty(self): # true if queue is empty\n return ( self.rear+1==self.front or (self.front+self.SIZE-1==self.rear) )\n\nclass Vertex:\n def __init__(self,lab): # constructor\n self.label = lab\n self.wasVisited = False\n\nclass Graph:\n def __init__(self):\n self.vertexList = [] # adjacency matrix\n self.adjMat = []\n self.nVerts = 0\n for j in range(20): # set adjacency\n l = []\n for k in range(20):\n l.append(0)\n self.adjMat.append(l)\n self.theQueue = Queue()\n\n def addVertex(self,lab):\n self.vertexList.append( Vertex(lab))\n self.nVerts += 1\n\n def addEdge(self,start, end):\n self.adjMat[start][end] = 1\n self.adjMat[end][start] = 1\n\n def displayVertex(self,v):\n print self.vertexList[v].label ,\n\n def bfs(self): # breadth-first search\n # begin at vertex 0\n self.vertexList[0].wasVisited = True # mark it\n self.displayVertex(0) # display it\n self.theQueue.insert(0) # insert at tail\n while( not self.theQueue.isEmpty() ): # until queue empty,\n v1 = self.theQueue.remove() # remove vertex at head\n # until it has no unvisited neighbors\n while( self.getAdjUnvisitedVertex(v1) != -1 ):\n v2 = self.getAdjUnvisitedVertex(v1)\n self.vertexList[v2].wasVisited = True # mark it\n self.displayVertex(v2) # display it\n self.theQueue.insert(v2) # insert it\n for j in range(self.nVerts): # reset flags\n self.vertexList[j].wasVisited = False\n\n def getAdjUnvisitedVertex(self,v):\n for j in range(self.nVerts):\n if(self.adjMat[v][j]==1 and self.vertexList[j].wasVisited==False):\n return j\n return -1\n\n\ntheGraph = Graph()\ntheGraph.addVertex('A') # 0 (start for dfs)\ntheGraph.addVertex('B') # 1\ntheGraph.addVertex('C') # 2\ntheGraph.addVertex('D') # 3\ntheGraph.addVertex('E') # 4\ntheGraph.addEdge(0,1)\ntheGraph.addEdge(1,2)\ntheGraph.addEdge(0,3)\ntheGraph.addEdge(3,4)\nprint 'Visits: ',\ntheGraph.bfs() # breadth-first search",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Visits: A B D C E\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.3 Page no : 645"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 13.3\ndemonstrates minimum spanning tree\n'''\nclass StackX:\n def __init__(self):\n self.st = [] # make array\n self.top = -1\n\n def push(self,j): # put item on stack\n self.top += 1\n self.st.append(j)\n\n def pop(self): # take item off stack\n self.top -= 1\n return self.st.pop()\n\n def peek(self): # peek at top of stack\n return self.st[self.top]\n \n def isEmpty(self): # true if nothing on stack-\n return self.top == -1\n\nclass Vertex:\n def __init__(self,lab): # constructor\n self.label = lab\n self.wasVisited = False\n\nclass Graph:\n def __init__(self):\n self.vertexList = [] # adjacency matrix\n self.adjMat = []\n self.nVerts = 0\n for j in range(20): # set adjacency\n l = []\n for k in range(20):\n l.append(0)\n self.adjMat.append(l)\n self.theStack = StackX()\n\n def addVertex(self,lab):\n self.vertexList.append( Vertex(lab))\n self.nVerts += 1\n\n def addEdge(self,start, end):\n self.adjMat[start][end] = 1\n self.adjMat[end][start] = 1\n\n def displayVertex(self,v):\n print self.vertexList[v].label ,\n\n def mst(self): # minimum spanning tree (depth first)\n # start at 0\n self.vertexList[0].wasVisited =True\n # mark it\n self.theStack.push(0)\n # push it\n while(not self.theStack.isEmpty() ):\n # until stack empty\n # get stack top\n currentVertex = self.theStack.peek()\n # get next unvisited neighbor \n v = self.getAdjUnvisitedVertex(currentVertex)\n if(v == -1):\n # if no more neighbors\n self.theStack.pop()\n else:\n # got a neighbor\n self.vertexList[v].wasVisited = True # mark it\n self.theStack.push(v)\n # push it\n # display edge\n self.displayVertex(currentVertex)\n # from currentV\n self.displayVertex(v)\n # to v\n print ' ',\n for j in range(self.nVerts):\n # reset flags\n self.vertexList[j].wasVisited = False\n\n def getAdjUnvisitedVertex(self, v):\n for j in range(self.nVerts):\n if(self.adjMat[v][j]==1 and self.vertexList[j].wasVisited==False):\n return j\n return -1\n\ntheGraph = Graph()\ntheGraph.addVertex('A') # 0 (start for mst)\ntheGraph.addVertex('B') # 1\ntheGraph.addVertex('C') # 2\ntheGraph.addVertex('D') # 3Topological Sorting with Directed Graphs\ntheGraph.addVertex('E') # 4\ntheGraph.addEdge(0,1) \ntheGraph.addEdge(0,2)\ntheGraph.addEdge(0,3) \ntheGraph.addEdge(0,4) \ntheGraph.addEdge(1,2) \ntheGraph.addEdge(1,3)\ntheGraph.addEdge(1,4) \ntheGraph.addEdge(2,3) \ntheGraph.addEdge(2,4) \ntheGraph.addEdge(3,4) \nprint 'Minimum spanning tree: ',\ntheGraph.mst() # minimum spanning tree",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Minimum spanning tree: A B B C C D D E \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.4 page No : 657"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 13.4\ndemonstrates topological sorting\n'''\nclass Vertex:\n def __init__(self,lab): # constructor\n self.label = lab\n self.wasVisited = False\n\nclass Graph:\n def __init__(self):\n self.vertexList = [] # adjacency matrix\n self.adjMat = []\n self.nVerts = 0\n for j in range(20): # set adjacency\n l = []\n for k in range(20):\n l.append(0)\n self.adjMat.append(l)\n\n def addVertex(self,lab):\n self.vertexList.append( Vertex(lab))\n self.nVerts += 1\n\n def addEdge(self,start, end):\n self.adjMat[start][end] = 1\n self.adjMat[end][start] = 1\n\n def displayVertex(self,v):\n print self.vertexList[v].label ,\n\n def topo(self): # topological sort\n orig_nVerts = self.nVerts # remember how many verts\n while(self.nVerts > 0): # while vertices remain,\n # get a vertex with no successors, or -1\n currentVertex = self.noSuccessors()\n if(currentVertex == -1):\n # must be a cycleTopological Sorting with Directed Graphs\n print 'ERROR: Graph has cycles'\n return\n\n # insert vertex label in sorted array (start at end)\n self.sortedArray[nVerts-1] = self.vertexList[currentVertex].label\n self.deleteVertex(currentVertex)\n print 'Topologically sorted order: '\n for j in range(orig_nVerts):\n print sortedArray[j] ,\n print ''\n\n def noSuccessors(self): # returns vert with no successors\n # (or -1 if no such verts)\n isEdge = None\n for row in range(self.nVerts): # for each vertex,\n isEdge = False\n # check edges\n for col in range(self.nVerts):\n if( self.adjMat[row][col] > 0 ): # if edge to\n # another,\n isEdge = True\n break\n if( not isEdge ):\n # if no edges,\n return row\n return -1\n\n def deleteVertex(self,delVert):\n if(delVert != self.nVerts-1):\n # if not last vertex,\n # delete from vertexList\n for j in range(self.nVerts-1):\n self.vertexList[j] = self.vertexList[j+1]\n # delete row from adjMat\n for row in range(self.nVerts-1):\n self.moveRowUp(row, nVerts)\n # delete col from adjMat\n for col in range(self.nVerts-1):\n self.moveColLeft(col, nVerts-1)\n self.nVerts -= 1\n\n def moveRowUp(self,row,length):\n for col in range(length):\n self.adjMat[row][col] = self.adjMat[row+1][col]\n\n def moveColLeft(self,col, length):\n for row in range(self.length):\n self.adjMat[row][col] = self.adjMat[row][col+1]\n\ntheGraph = Graph()\ntheGraph.addVertex('A') # 0\ntheGraph.addVertex('B') # 1\ntheGraph.addVertex('C') # 2\ntheGraph.addVertex('D') # 3\ntheGraph.addVertex('E') # 4\ntheGraph.addVertex('F') # 5\ntheGraph.addVertex('G') # 6\ntheGraph.addVertex('H') # 7Connectivity in Directed Graphs\ntheGraph.addEdge(0,3)\ntheGraph.addEdge(0,4)\ntheGraph.addEdge(1,4)\ntheGraph.addEdge(2,5)\ntheGraph.addEdge(3,6)\ntheGraph.addEdge(4,6)\ntheGraph.addEdge(5,7)\ntheGraph.addEdge(6,7)\ntheGraph.topo() # do the sort",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "ERROR: Graph has cycles\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch14.ipynb b/Data_Structures_and_Algorithms_in_Java/ch14.ipynb
new file mode 100644
index 00000000..7895bf4f
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch14.ipynb
@@ -0,0 +1,63 @@
+{
+ "metadata": {
+ "name": "ch14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 14 : Weighted Graphs"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 14.1 Page no: 681"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 14.1\ndemonstrates minimum spanning tree with weighted graphs\n'''\nclass Edge:\n def __init__(self,sv,dv,d): # constructor\n self.srcVert = sv\n self.destVert = dv\n self.distance = d\n\nclass PriorityQ:\n def __init__(self):\n # constructor\n self.queArray = []\n self.size = 0\n def insert(self,item): # insert item in sorted order\n self.queArray.append(item)\n b = self.size\n for j in range(self.size): # find place to insert\n if( item.distance >= self.queArray[j].distance ):\n b = j\n break\n for k in range(self.size-1,b-1,-1):#=self.size-1 k>=j k--) # move items up\n self.queArray[k+1] = self.queArray[k]\n self.queArray[b] = item\n # insert item\n self.size += 1\n\n def removeMin(self): # remove minimum item\n self.size -= 1\n return self.queArray[self.size] \n\n def removeN(self,n): # remove item at n\n for j in range(n,self.size-1): # move items down\n self.queArray[j] = self.queArray[j+1]\n self.size -= 1\n\n def peekMin(self): # peek at minimum item\n return self.self.queArray[self.size-1] \n\n def size(self): # return number of items\n return self.size\n\n def isEmpty(self): # true if queue is empty\n return (self.size==0) \n\n def peekN(self,n): # peek at item n\n return self.queArray[n]\n\n def find(self,findDex): # find item with specified\n # self.destVert value\n for j in range(self.size-1):\n if(self.queArray[j].destVert == findDex):\n return j\n return -1\n\nclass Vertex:\n def __init__(self,lab): # constructor\n self.label = lab\n self.isInTree = False\n\nclass Graph:\n def __init__(self):\n self.vertexList = [] # adjacency matrix\n self.adjMat = []\n self.nVerts = 0\n for j in range(20): # set adjacency\n l = []\n for k in range(20):\n l.append(1000000)\n self.adjMat.append(l)\n self.thePQ = PriorityQ()\n self.nTree = 0\n self.currentVert = 0\n\n def addVertex(self,lab):\n self.vertexList.append( Vertex(lab))\n self.nVerts += 1\n\n def addEdge(self,start, end,weight):\n self.adjMat[start][end] = weight\n self.adjMat[end][start] = weight\n\n\n def displayVertex(self,v):\n print self.vertexList[v].label ,\n\n def mstw(self):\n self.currentVert = 0 # minimum spanning tree\n # start at 0\n while(self.nTree < self.nVerts-1): # while not all verts in tree\n # put self.currentVert in tree\n self.vertexList[self.currentVert].isInTree = True\n self.nTree += 1\n # insert edges adjacent to self.currentVert into PQ\n for j in range(self.nVerts): # for each vertex,\n if(j==self.currentVert): # skip if its us\n continue\n if(self.vertexList[j].isInTree): # skip if in the tree\n continue\n self.distance = self.adjMat[self.currentVert][j]\n if( self.distance == 1000000): # skip if no edge\n continue\n self.putInPQ(j, self.distance) # put it in PQ (maybe)\n if(self.thePQ.size==0): # no vertices in PQ?\n print 'GRAPH NOT CONNECTED',\n return\n # remove edge with minimum self.distance, from PQ\n theEdge = self.thePQ.removeMin()\n sourceVert = theEdge.srcVert\n self.currentVert = theEdge.destVert\n # display edge from source to current\n print self.vertexList[sourceVert].label ,self.vertexList[self.currentVert].label, \" \",\n\n for j in range(self.nVerts): # unmark vertices\n self.vertexList[j].isIsTree = False\n\n def putInPQ(self,newVert,newDist): # is there another edge with the same destination vertex?\n queueIndex = self.thePQ.find(newVert)\n if(queueIndex != -1): # got edges index\n tempEdge = self.thePQ.peekN(queueIndex) # get edge\n oldDist = tempEdge.distance\n if(oldDist > newDist): # if new edge shorter,\n self.thePQ.removeN(queueIndex) # remove old edge\n theEdge = Edge(self.currentVert, newVert, newDist)\n self.thePQ.insert(theEdge)# insert new edge\n # else no action just leave the old vertex there\n else: # no edge with same destination vertex\n # so insert new one\n theEdge = Edge(self.currentVert, newVert, newDist)\n self.thePQ.insert(theEdge)\n\n\ntheGraph = Graph()\ntheGraph.addVertex('A') # 0 (start for mst)\ntheGraph.addVertex('B') # 1\ntheGraph.addVertex('C') # 2\ntheGraph.addVertex('D') # 3\ntheGraph.addVertex('E') # 4\ntheGraph.addVertex('F') # 5\ntheGraph.addEdge(0, 1, 16) # AB\ntheGraph.addEdge(0, 3, 24) # AD\n\ntheGraph.addEdge(1,2,1)\ntheGraph.addEdge(1,3,5)\ntheGraph.addEdge(1,4,2)\ntheGraph.addEdge(2,3,6)\ntheGraph.addEdge(2,4,8)\ntheGraph.addEdge(2,5,26)\ntheGraph.addEdge(3,4,142)\ntheGraph.addEdge(4,5,17)\n\nprint 'Minimum spanning tree: ',\ntheGraph.mstw() # minimum spanning tree",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 14.2 Page 703"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 14.2\ndemonstrates shortest path with weighted, directed graphs\n'''\nclass DistPar:\n def __init__(self,pv,d): # constructor\n self.distance = d\n self.parentVert = pv\n\nclass Vertex:\n def __init__(self,lab): # constructor\n self.label = lab\n self.isInTree = False\n\nclass Graph:\n def __init__(self): # constructor\n self.vertexList = [] # adjacency matrix\n self.adjMat = []\n self.nVerts = 0\n self.nTree = 0\n for j in range(20): # set adjacency\n l = []\n for k in range(20):\n l.append(1000000)\n self.adjMat.append(l)\n self.currentVert = 0\n self.sPath = [] # shortest paths\n self.startToCurrent = 0\n\n def addVertex(self,lab):\n self.vertexList.append( Vertex(lab))\n self.nVerts += 1\n\n def addEdge(self,start, end,weight):\n self.adjMat[start][end] = weight\n\n\n def displayVertex(self,v):\n print self.vertexList[v].label ,\n\n def path(self): # find all shortest paths\n startTree = 0 # start at vertex 0\n self.vertexList[startTree].isInTree = True\n self.nTree = 1 # put it in tree\n # transfer row of distances from adjMat to sPath\n for j in range(self.nVerts):\n tempDist = self.adjMat[startTree][j]\n try:\n self.sPath[j] = DistPar(startTree, tempDist)\n except:\n self.sPath.append(DistPar(startTree, tempDist))\n # until all vertices are in the tree\n while(self.nTree < self.nVerts):\n indexMin = self.getMin() # get minimum from sPath\n minDist = self.sPath[indexMin].distance\n if(minDist == 1000000): # if all infinite\n # or in tree,\n print 'There are unreachable vertices'\n break # sPath is complete\n else:\n # reset self.currentVert\n self.currentVert = indexMin # to closest vert\n self.startToCurrent = self.sPath[indexMin].distance\n # minimum distance from startTree is\n # to self.currentVert, and is self.startToCurrent\n # put current vertex in tree\n self.vertexList[self.currentVert].isInTree = True\n self.nTree += 1\n self.adjust_sPath() # update sPath[] array\n\n self.displayPaths() # display sPath[] contents\n self.nTree = 0 # clear tree\n for j in range(self.nVerts):\n self.vertexList[j].isInTree = False \n\n def getMin(self): # get entry from sPath\n minDist = 1000000 # assume minimum\n indexMin = 0\n for j in range(self.nVerts): # for each vertex,\n # if its in tree and\n if( not self.vertexList[j].isInTree and self.sPath[j].distance < minDist ):\n minDist = self.sPath[j].distance\n indexMin = j # update minimum\n return indexMin\n\n def adjust_sPath(self):\n # adjust values in shortest-path array sPath\n column = 1\n # skip starting vertex\n while(column < self.nVerts): # go across columns\n # if this columns vertex already in tree, skip it\n if( self.vertexList[column].isInTree ):\n column += 1\n continue\n # calculate distance for one sPath entry get edge from self.currentVert to column\n currentToFringe = self.adjMat[self.currentVert][column]\n # add distance from start\n startToFringe = self.startToCurrent + currentToFringe\n # get distance of current sPath entry\n sPathDist = self.sPath[column].distance\n # compare distance from start with sPath entry\n if(startToFringe < sPathDist): # if shorter,\n # update sPath\n self.sPath[column].parentVert = self.currentVert\n self.sPath[column].distance = startToFringe\n column += 1\n\n def displayPaths(self):\n for j in range(self.nVerts): # display contents of sPath[]\n print self.vertexList[j].label ,' =' \n if(self.sPath[j].distance == 1000000):\n print 'inf', # inf\n else:\n print self.sPath[j].distance , # 50\n parent = self.vertexList[ self.sPath[j].parentVert ].label\n print '(' , parent , ')' , # (A)\n print ''\n \ntheGraph = Graph()\ntheGraph.addVertex('A') # 0 (start)\ntheGraph.addVertex('C') # 2\ntheGraph.addVertex('B') # 1\ntheGraph.addVertex('D') # 3\ntheGraph.addVertex('E') # 4\ntheGraph.addEdge(0,1,50)\ntheGraph.addEdge(0,3,80)\ntheGraph.addEdge(1,2,60)\ntheGraph.addEdge(1,3,90)\ntheGraph.addEdge(2,4,40)\ntheGraph.addEdge(3,2,20)\ntheGraph.addEdge(3,4,70)\ntheGraph.addEdge(4,1,50)\nprint 'Shortest paths' ,\ntheGraph.path() # shortest paths",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Shortest paths A =\ninf ( A ) C =\n50 ( A ) B =\n100 ( D ) D =\n80 ( A ) E =\n140 ( B ) \n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch2.ipynb b/Data_Structures_and_Algorithms_in_Java/ch2.ipynb
new file mode 100644
index 00000000..545d8433
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch2.ipynb
@@ -0,0 +1,133 @@
+{
+ "metadata": {
+ "name": "ch2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 2 : Arrays"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.1 Page no :41"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 2.1\ndemonstrates arrays/lists\n'''\n\nnElems = 0\narr = [77,99,44,55,22,88,11,00,66,33]\n\nfor j in range(len(arr)):\n # display items\n print arr[j] ,\nprint ''\n\nsearchKey = 66\n# find item with key 66\nfor j in range(len(arr)):\n if(arr[j] == searchKey):\n break\nif(j == len(arr)):\n print 'Cant find ', searchKey\nelse:\n print 'Found ' ,searchKey\n\nsearchKey = 55\nfor j in arr:\n if(j == searchKey):\n arr.remove(searchKey)\n\n\nfor j in range(len(arr)):\n # display items\n print arr[j] ,\nprint ''\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77 99 44 55 22 88 11 0 66 33 \nFound 66\n77 99 44 22 88 11 0 66 33 \n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.2 Page No : 44"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 2.2\n'''\n\nclass LowArray:\n def __init__(self,size):\n self.a = []\n for i in range(size):\n self.a.append(0.0)\n \n def setElem(self,index,value):\n # set value\n self.a[index] = value\n\n def getElem(self,index):\n return self.a[index]\n\narr = LowArray(100)\narr.setElem(0,77)\narr.setElem(1,99)\narr.setElem(2,44)\narr.setElem(3,55)\narr.setElem(4,22)\narr.setElem(5,88)\narr.setElem(6,11)\narr.setElem(7,00)\narr.setElem(8,66)\narr.setElem(9,33)\nnElems = 10\n\n# now 10 items in array\nfor j in range(nElems):\n # display items\n print arr.getElem(j) ,\n\nprint ''\n\nsearchKey = 26\nfind = False\n# search for data item\nfor j in range(nElems):\n # for each element,\n if(arr.getElem(j) == searchKey): # found item?\n find = True\n break\nif(not find):\n print \"Can't find \" , searchKey\nelse:\n print \"Found \" , searchKey\n\nfor j in range(nElems):\n if(arr.getElem(j) == 55):\n arr.a.remove(55)\n nElems -= 1\n\nfor j in range(nElems):\n # display items\n print arr.getElem(j) ,\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77 99 44 55 22 88 11 0 66 33 \nCan't find 26\n77 99 44 22 88 11 0 66 33\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.3 Page No : 49"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 2.3\n'''\n\nclass HighArray:\n def __init__(self,size):\n self.a = []\n self.nElems = 0\n for i in range(size):\n self.a.append(0.0)\n \n def insert(self,value):\n # set value\n self.a[self.nElems] = value\n self.nElems += 1\n\n def find(self,searchKey):\n for j in range(self.nElems):\n if(self.a[j] == searchKey):\n return True\n return False\n \n def delete(self,value):\n for j in range(self.nElems):\n # look for it\n if (value == self.a[j]):\n self.a.remove(value)\n self.nElems -= 1\n \n def display(self):\n for j in range(self.nElems+1):\n print self.a[j] , \n print ''\n\narr = HighArray(100)\narr.insert(77)\narr.insert(99)\narr.insert(44)\narr.insert(55)\narr.insert(22)\narr.insert(88)\narr.insert(11)\narr.insert(00)\narr.insert(66)\narr.insert(33)\n\narr.display()\n\nsearchKey = 35\nif( arr.find(searchKey) ):\n print \"Found \" , searchKey\nelse:\n print \"Can't find \" , searchKey\narr.delete(00)\narr.delete(55)\narr.delete(99)\narr.display()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77 99 44 55 22 88 11 0 66 33 0.0 \nCan't find 35\n77 44 22 88 11 66 33 \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.4 Page no : 59"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 2.4\n'''\n\nclass OrdArray:\n def __init__(self,m):\n self.a = []\n self.nElems = 0\n \n def size(self):\n return self.nElems\n\n def find(self,searchKey):\n lowerBound = 0\n upperBound = self.nElems-1\n while True:\n curIn = (lowerBound + upperBound ) / 2\n if(self.a[curIn]==searchKey):\n return curIn\n elif(lowerBound > upperBound):\n return self.nElems\n else:\n if(self.a[curIn] < searchKey):\n lowerBound = curIn + 1\n else:\n upperBound = curIn - 1 \n\n def insert(self,value):\n self.a.append(value)\n self.a.sort()\n self.nElems += 1\n\n def delete(self,value):\n j = self.find(value)\n if(j==self.nElems):\n return False\n else:\n self.a.remove(value)\n self.nElems -=1\n \n def display(self):\n for i in self.a:\n print i ,\n print ''\n\nmaxSize = 100\narr = OrdArray(maxSize)\narr.insert(77)\narr.insert(99) \narr.insert(44) \narr.insert(55) \narr.insert(22) \narr.insert(88) \narr.insert(11) \narr.insert(00) \narr.insert(66) \narr.insert(33) \nsearchKey = 55\nif( arr.find(searchKey) != arr.size() ):\n print 'Found ' , searchKey\nelse:\n print \"Can't find \" , searchKey\n \narr.display()\narr.delete(00)\narr.delete(55) \narr.delete(99) \narr.display()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Found 55\n0 11 22 33 44 55 66 77 88 99 \n11 22 33 44 66 77 88 \n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.5 Page no : 66"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 2.5\n'''\n\nclass Person:\n def __init__(self,last,first,a):\n self.lastName = last\n self.firstName = first\n self.age = a\n\n def displayPerson(self):\n print \"Last name: \" , self.lastName ,\", First name: \" , self.firstName ,\n print \", Age: \" , self.age\n\n def getLast(self):\n return self.lastName\n\nclass ClassDataArray:\n def __init__(self,m):\n self.a = []\n self.nElems = 0\n\n def find(self,searchName):\n f = False\n for j in range(self.nElems):\n if( self.a[j].getLast() ==searchName ) :\n f = True\n break \n if(not f):\n return None\n else:\n return self.a[j]\n\n def insert(self,last,first,age):\n self.a.append(Person(last, first, age))\n self.nElems += 1\n\n def delete(self,searchName):\n f = False\n for j in range(self.nElems):\n if( self.a[j].getLast() == searchName) :\n self.a.remove(self.a[j])\n f = True\n self.nElems -= 1\n break\n if(not f):\n return False\n else:\n return True\n \n def displayA(self):\n for j in range(self.nElems):\n self.a[j].displayPerson()\n\nmaxSize = 100\narr = ClassDataArray(maxSize)\narr.insert(\"Evans\", \"Patty\", 24)\narr.insert(\"Smith\", \"Lorraine\", 37)\narr.insert(\"Yee\", \"Tom\", 43)\narr.insert(\"Adams\", \"Henry\", 63)\narr.insert(\"Hashimoto\", \"Sato\", 21)\narr.insert(\"Stimson\", \"Henry\", 29)\narr.insert(\"Velasquez\", \"Jose\", 72)\narr.insert(\"Lamarque\", \"Henry\", 54)\narr.insert(\"Vang\", \"Minh\", 22)\narr.insert(\"Creswell\", \"Lucinda\", 18)\narr.displayA()\nsearchKey = \"Stimson\"\nfound=arr.find(searchKey)\nif(found != None ):\n print \"Found \" ,\n found.displayPerson()\nelse:\n print \"Can't find \" , searchKey\nprint \"Deleting Smith, Yee, and Creswell\"\narr.delete(\"Smith\")\narr.delete(\"Yee\")\narr.delete(\"Creswell\")\narr.displayA()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Last name: Evans , First name: Patty , Age: 24\nLast name: Smith , First name: Lorraine , Age: 37\nLast name: Yee , First name: Tom , Age: 43\nLast name: Adams , First name: Henry , Age: 63\nLast name: Hashimoto , First name: Sato , Age: 21\nLast name: Stimson , First name: Henry , Age: 29\nLast name: Velasquez , First name: Jose , Age: 72\nLast name: Lamarque , First name: Henry , Age: 54\nLast name: Vang , First name: Minh , Age: 22\nLast name: Creswell , First name: Lucinda , Age: 18\nFound Last name: Stimson , First name: Henry , Age: 29\nDeleting Smith, Yee, and Creswell\nLast name: Evans , First name: Patty , Age: 24\nLast name: Adams , First name: Henry , Age: 63\nLast name: Hashimoto , First name: Sato , Age: 21\nLast name: Stimson , First name: Henry , Age: 29\nLast name: Velasquez , First name: Jose , Age: 72\nLast name: Lamarque , First name: Henry , Age: 54\nLast name: Vang , First name: Minh , Age: 22\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch3.ipynb b/Data_Structures_and_Algorithms_in_Java/ch3.ipynb
new file mode 100644
index 00000000..1cce57db
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch3.ipynb
@@ -0,0 +1,336 @@
+{
+ "metadata": {
+ "name": "ch3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Simple Sorting"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page No : 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Example 3.1\n",
+ "Bubble Sort\n",
+ "'''\n",
+ "\n",
+ "class ArrayBub:\n",
+ " def __init__(self,m):\n",
+ " self.a = []\n",
+ " self.nElems = 0\n",
+ " \n",
+ " def insert(self,value):\n",
+ " # put element into array\n",
+ " self.a.append(value)\n",
+ " self.nElems += 1\n",
+ "\n",
+ " def display(self):\n",
+ " # displays array contents\n",
+ " for j in range(self.nElems):\n",
+ " print self.a[j] ,\n",
+ " print ''\n",
+ "\n",
+ " def bubbleSort(self):\n",
+ " out = self.nElems - 1\n",
+ " while out > 1 :\n",
+ " for i in range(out): \n",
+ " if( self.a[i] > self.a[i+1] ):\n",
+ " self.a[i],self.a[i+1] = self.a[i+1],self.a[i] \n",
+ " out -= 1\n",
+ "\n",
+ "maxSize = 100 # array size\n",
+ "arr = ArrayBub(maxSize) # create the array\n",
+ "arr.insert(77) # insert 10 items\n",
+ "arr.insert(99) \n",
+ "arr.insert(44) \n",
+ "arr.insert(55) \n",
+ "arr.insert(22) \n",
+ "arr.insert(88) \n",
+ "arr.insert(11) \n",
+ "arr.insert(00) \n",
+ "arr.insert(66) \n",
+ "arr.insert(33) \n",
+ "arr.display() # display items\n",
+ "arr.bubbleSort() # bubble sort them\n",
+ "arr.display()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "77 99 44 55 22 88 11 0 66 33 \n",
+ "0 11 22 33 44 55 66 77 88 99 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page No : 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Example 3.2\n",
+ "Selection Sort\n",
+ "'''\n",
+ "\n",
+ "class ArraySel:\n",
+ " def __init__(self,m):\n",
+ " self.a = []\n",
+ " self.nElems = 0\n",
+ " \n",
+ " def insert(self,value):\n",
+ " # put element into array\n",
+ " self.a.append(value)\n",
+ " self.nElems += 1\n",
+ "\n",
+ " def display(self):\n",
+ " # displays array contents\n",
+ " for j in range(self.nElems):\n",
+ " print self.a[j] ,\n",
+ " print ''\n",
+ "\n",
+ " def selectionSort(self):\n",
+ " for out in range(self.nElems-1):\n",
+ " for i in range(out,self.nElems): \n",
+ " if( self.a[i] < self.a[out] ):\n",
+ " self.a[i],self.a[out] = self.a[out],self.a[i] \n",
+ "\n",
+ "maxSize = 100 # array size\n",
+ "arr = ArraySel(maxSize) # create the array\n",
+ "arr.insert(77) # insert 10 items\n",
+ "arr.insert(99) \n",
+ "arr.insert(44) \n",
+ "arr.insert(55) \n",
+ "arr.insert(22) \n",
+ "arr.insert(88) \n",
+ "arr.insert(11) \n",
+ "arr.insert(00) \n",
+ "arr.insert(66) \n",
+ "arr.insert(33) \n",
+ "arr.display() # display items\n",
+ "arr.selectionSort() # bubble sort them\n",
+ "arr.display()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "77 99 44 55 22 88 11 0 66 33 \n",
+ "0 11 22 33 44 55 66 77 88 99 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page No : 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Example 3.3\n",
+ "demonstrates insertion sort\n",
+ "'''\n",
+ "class ArrayIns:\n",
+ " def __init__(self,m):\n",
+ " self.a = [] # create the array\n",
+ " self.nElems = 0 # no items yet\n",
+ "\n",
+ " def insert(self,value): # put element into array\n",
+ " self.a.append(value) # insert it\n",
+ " self.nElems += 1 # increment size\n",
+ "\n",
+ " def display(self): # displays array contents\n",
+ " for j in range(self.nElems): # for each element,\n",
+ " print self.a[j] , # display it\n",
+ " print ''\n",
+ "\n",
+ " def insertionSort(self):\n",
+ " for out in range(self.nElems):\n",
+ " temp = self.a[out]\n",
+ " i = out\n",
+ " while (i>0 and self.a[i-1] >= temp):\n",
+ " self.a[i] = self.a[i-1]\n",
+ " i -= 1\n",
+ " self.a[i] = temp\n",
+ "\n",
+ "maxSize = 100 # array size\n",
+ "arr = ArrayIns(maxSize) # create the array\n",
+ "arr.insert(77) # insert 10 items\n",
+ "arr.insert(99) \n",
+ "arr.insert(44) \n",
+ "arr.insert(55) \n",
+ "arr.insert(22) \n",
+ "arr.insert(88) \n",
+ "arr.insert(11) \n",
+ "arr.insert(00) \n",
+ "arr.insert(66) \n",
+ "arr.insert(33) \n",
+ "arr.display() # display items\n",
+ "arr.insertionSort() # insertion-sort them\n",
+ "arr.display()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "77 99 44 55 22 88 11 0 66 33 \n",
+ "0 11 22 33 44 55 66 77 88 99 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page No : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Example 3.4\n",
+ "demonstrates sorting objects (uses insertion sort)\n",
+ "'''\n",
+ "class Person:\n",
+ " def __init__(self,last,first,a):\n",
+ " # constructor\n",
+ " self.lastName = last\n",
+ " self.firstName = first\n",
+ " self.age = a\n",
+ "\n",
+ " def displayPerson(self):\n",
+ " print 'Last name: ', self.lastName , ', First name: ',self.firstName , ', Age: ' , self.age\n",
+ "\n",
+ " def getLast(self): # get last name\n",
+ " return self.lastName \n",
+ "\n",
+ "class ArrayInOb:\n",
+ " def __init__(self,m):\n",
+ " self.a = [] # create the array\n",
+ " self.nElems = 0 # no items yet\n",
+ " \n",
+ " def insert(self,last,first,age):\n",
+ " self.a.append(Person(last, first, age))\n",
+ " self.nElems += 1 # increment size\n",
+ "\n",
+ " def display(self): # displays array contents\n",
+ " for j in range(self.nElems): # for each element,\n",
+ " self.a[j].displayPerson() # display it\n",
+ " print ''\n",
+ "\n",
+ " def insertionSort(self):\n",
+ " for out in range(1,self.nElems):\n",
+ " temp = self.a[out]\n",
+ " i = out\n",
+ " while(i>0 and self.a[i-1].getLast() > temp.getLast()):\n",
+ " self.a[i] = self.a[i-1] # shift item to the right\n",
+ " i -= 1 # go left one position\n",
+ " self.a[i] = temp\n",
+ "maxSize = 100 # array size\n",
+ "arr = ArrayInOb(maxSize) # create the array\n",
+ "arr.insert('Evans', 'Patty', 24)\n",
+ "arr.insert('Smith', 'Doc', 59)\n",
+ "arr.insert('Smith', 'Lorraine', 37)\n",
+ "arr.insert('Smith', 'Paul', 37)\n",
+ "arr.insert('Yee', 'Tom', 43)\n",
+ "arr.insert('Hashimoto', 'Sato', 21)\n",
+ "arr.insert('Stimson', 'Henry', 29)\n",
+ "arr.insert('Velasquez', 'Jose', 72)\n",
+ "arr.insert('Vang', 'Minh', 22)\n",
+ "arr.insert('Creswell', 'Lucinda', 18)\n",
+ "print 'Before sorting:'\n",
+ "arr.display() # display items\n",
+ "arr.insertionSort() # insertion-sort them\n",
+ "print 'After sorting:'\n",
+ "arr.display() # display them again"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before sorting:\n",
+ "Last name: Evans , First name: Patty , Age: 24\n",
+ "Last name: Smith , First name: Doc , Age: 59\n",
+ "Last name: Smith , First name: Lorraine , Age: 37\n",
+ "Last name: Smith , First name: Paul , Age: 37\n",
+ "Last name: Yee , First name: Tom , Age: 43\n",
+ "Last name: Hashimoto , First name: Sato , Age: 21\n",
+ "Last name: Stimson , First name: Henry , Age: 29\n",
+ "Last name: Velasquez , First name: Jose , Age: 72\n",
+ "Last name: Vang , First name: Minh , Age: 22\n",
+ "Last name: Creswell , First name: Lucinda , Age: 18\n",
+ "\n",
+ "After sorting:\n",
+ "Last name: Creswell , First name: Lucinda , Age: 18\n",
+ "Last name: Evans , First name: Patty , Age: 24\n",
+ "Last name: Hashimoto , First name: Sato , Age: 21\n",
+ "Last name: Smith , First name: Doc , Age: 59\n",
+ "Last name: Smith , First name: Lorraine , Age: 37\n",
+ "Last name: Smith , First name: Paul , Age: 37\n",
+ "Last name: Stimson , First name: Henry , Age: 29\n",
+ "Last name: Vang , First name: Minh , Age: 22\n",
+ "Last name: Velasquez , First name: Jose , Age: 72\n",
+ "Last name: Yee , First name: Tom , Age: 43\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch4.ipynb b/Data_Structures_and_Algorithms_in_Java/ch4.ipynb
new file mode 100644
index 00000000..bfba5c3b
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch4.ipynb
@@ -0,0 +1,284 @@
+{
+ "metadata": {
+ "name": "ch4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 4 : Stacks and Queues"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Exmaple 4.1 Page no : 120"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 4.1\nStack implemantation\n'''\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\n\ntheStack = StackX(10) # make new stack\ntheStack.push(20)\ntheStack.push(40)\ntheStack.push(60)\ntheStack.push(80)\nwhile( not theStack.isEmpty() ):\n value = theStack.pop()\n print value,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "80 60 40 20\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.2 Page No : 124"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 4.2\nStack implemantation\n'''\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\n\n\nclass Reverser:\n def __init__(self,i):\n self.input = i\n self.output = ''\n self.theStack = None\n\n def doRev(self):\n stackSize = len(self.input)\n self.theStack = StackX(stackSize)\n for j in range(stackSize):\n ch = self.input[j]\n self.theStack.push(ch)\n while( not self.theStack.isEmpty() ):\n ch = self.theStack.pop()\n self.output = self.output + ch\n return self.output\n\n\nwhile(True):\n print \"Enter a string: \" ,\n i = raw_input() \n if( i == \"\"):\n break\n theReverser = Reverser(i)\n output = theReverser.doRev()\n print \"Reversed: \" , output",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a string: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "part\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Reversed: trap\nEnter a string: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.3 Page No : 128"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 4.3\n'''\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\n\nclass BracketChecker:\n def __init__(self,i):\n self.input = i \n self.theStack = None\n\n def check(self):\n stackSize = len(self.input)\n self.theStack = StackX(stackSize)\n for j in range(stackSize):\n ch = self.input[j]\n if (ch == '{' or ch == '[' or ch=='('):\n self.theStack.push(ch)\n elif (ch=='}' or ch==']' or ch==')'):\n if( not self.theStack.isEmpty() ):\n chx = self.theStack.pop()\n if( (ch=='}' and chx!='{') or (ch==']' and chx!='[') or (ch==')' and chx!='(') ):\n print \"Error: \" , ch , \" at \" , j \n else:\n print 'Error: ', ch , ' at ' ,j\n else:\n pass\n if( not self.theStack.isEmpty() ):\n print 'Error: missing right delimiter'\n\nwhile(True):\n print 'Enter string containing delimiters: '\n i = raw_input()\n if( i == ''):\n break\n theChecker = BracketChecker(i)\n theChecker.check()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter string containing delimiters: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a{b(c]d}e\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Error: ] at 5\nEnter string containing delimiters: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter string containing delimiters: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.4 Page No : 138"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 4.4\n'''\nclass Queue:\n def __init__(self,s):\n self.maxSize = s\n self.queArray = []\n for i in range(s):\n self.queArray.append(0)\n self.front = 0\n self.rear = -1\n self.nItems = 0\n\n def insert(self,j):\n if(self.rear == self.maxSize-1):\n self.rear = -1\n self.rear += 1\n self.queArray[self.rear] = j\n self.nItems += 1\n\n def remove(self):\n temp = self.queArray[self.front]\n #self.queArray.remove(temp)\n self.front += 1\n if(self.front == self.maxSize):\n # deal with wraparound\n self.front = 0\n self.nItems-=1\n return temp\n\n def peekFront(self):\n return self.queArray[self.front]\n\n def isEmpty(self):\n # true if queue is empty\n return (self.nItems==0)\n\n def isFull(self):\n # true if queue is full\n return (self.nItems==self.maxSize)\n\n def size(self):\n # number of items in queue\n return self.nItems\n\ntheQueue = Queue(5) # queue holds 5 items\ntheQueue.insert(10) # insert 4 items\ntheQueue.insert(20) \ntheQueue.insert(30) \ntheQueue.insert(40) \ntheQueue.remove() # remove 3 items\ntheQueue.remove() \ntheQueue.remove()\ntheQueue.insert(50) # insert 4 more items\ntheQueue.insert(60)\ntheQueue.insert(70)\ntheQueue.insert(80)\nwhile( not theQueue.isEmpty() ): # // remove and display\n n = theQueue.remove()\n print n ,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "40 50 60 70 80\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.5 Page No : 141"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 4.5\n'''\nclass Queue:\n def __init__(self,s):\n self.maxSize = s\n self.queArray = []\n for i in range(s):\n self.queArray.append(0)\n self.front = 0\n self.rear = -1\n\n def insert(self,j):\n if(self.rear == self.maxSize-1):\n self.rear = -1\n self.rear += 1\n self.queArray[self.rear] = j\n\n def remove(self):\n temp = self.queArray[self.front]\n #self.queArray.remove(temp)\n self.front += 1\n if(self.front == self.maxSize):\n # deal with wraparound\n self.front = 0\n return temp\n\n def peek(self):\n return self.queArray[self.front]\n\n def isEmpty(self):\n # true if queue is empty\n return ( self.rear+1==self.front or (self.front+self.maxSize-1==self.rear) )\n\n def isFull(self):\n # true if queue is full\n return ( self.rear+2==self.front or (self.front+self.maxSize-2==self.rear) )\n\n def size(self):\n # number of items in queue\n if(self.rear >= self.front):\n # contiguous sequence\n return self.rear-self.front+1\n else:\n # broken sequence\n return (self.maxSize-self.front) + (self.rear+1)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.6 Page No : 147"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 4.6\n'''\n\nclass PriorityQ:\n # array in sorted order, from max at 0 to min at size-1\n def __init__(self,s):\n self.maxSize = s\n self.queArray = []\n for i in range(s):\n self.queArray.append(0)\n self.nItems = 0\n\n def insert(self,item):\n # insert item\n if(self.nItems==0):\n self.queArray[self.nItems] = item\n self.nItems += 1\n else:\n # if items,\n j = self.nItems\n while j >= 0:\n if( item > self.queArray[j] ):\n self.queArray[j+1] = self.queArray[j] # shift upward\n else:\n break\n j -= 1\n self.queArray[j+1] = item\n self.nItems += 1\n\n def remove(self):\n # remove minimum item\n self.nItems -= 1\n return self.queArray[self.nItems]\n\n def peekMin(self):\n # peek at minimum item\n return self.queArray[self.nItems-1]\n\n def isEmpty(self):\n # true if queue is empty\n return (self.nItems==0)\n\n def isFull(self):\n # true if queue is full\n return (self.nItems == self.maxSize)\n\nthePQ = PriorityQ(6)\nthePQ.insert(30)\nthePQ.insert(50)\nthePQ.insert(10)\nthePQ.insert(40)\nthePQ.insert(20)\nwhile(not thePQ.isEmpty() ):\n item = thePQ.remove()\n print item ,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 20 30 40 50\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.7 Page No : 161"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 4.7\ninfix : converts infix arithmetic expressions to postfix\n'''\n\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\n\n def peekN(self,n): # return item at index n\n return self.stackArray[n]\n \n def size(self): # return size\n return self.top+1\n \n def displayStack(self,s):\n print s\n print 'Stack (bottom-->top): ',\n for j in range(self.size()):\n print self.peekN(j) ,\n print ''\n\nclass InToPost:\n # infix to postfix conversion\n def __init__(self,i):\n self.input = i\n self.stackSize = len(self.input)\n self.theStack = StackX(self.stackSize)\n self.output = ''\n\n def doTrans(self):\n # do translation to postfix\n for j in range(self.stackSize):\n ch = self.input[j]\n self.theStack.displayStack(\"For \"+ ch +\" \") # *diagnostic*\n if ch=='+' or ch=='-':\n self.gotOper(ch, 1)\n elif ch=='*' or ch=='/':\n self.gotOper(ch, 2)\n elif ch=='(':\n self.theStack.push(ch)\n elif ch==')':\n self.gotParen(ch)\n else:\n self.output = self.output + ch # write it to output\n while( not self.theStack.isEmpty() ): # pop remaining opers\n self.theStack.displayStack('While ') # *diagnostic*\n self.output = self.output + self.theStack.pop() # write to output\n self.theStack.displayStack(\"End\")\n return self.output\n\n def gotOper(self,opThis, prec1):\n # got operator from input\n while( not self.theStack.isEmpty() ):\n opTop = self.theStack.pop()\n if( opTop == '(' ):\n self.theStack.push(opTop)\n break\n else:\n prec2 = 0\n if(opTop=='+' or opTop=='-'): # find new op prec\n prec2 = 1\n else:\n prec2 = 2\n if(prec2 < prec1): # if prec of new op less\n self.theStack.push(opTop)\n break;\n else:\n self.output = self.output + opTop # than prec of old\n self.theStack.push(opThis)\n\n def gotParen(self,ch):\n # got right paren from input\n while( not self.theStack.isEmpty() ):\n chx = self.theStack.pop()\n if( chx == '(' ):\n # if popped '('\n break\n # we're done\n else:\n # if popped operator\n self.output = self.output + chx # output it\n\nwhile(True):\n print 'Enter infix: ',\n i = raw_input()\n # read a string from kbd\n if( i == ''):\n # quit if [Enter]\n break\n theTrans = InToPost(i)\n output = theTrans.doTrans() # do the translation\n print \"Postfix is \" , output",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter infix: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A*(B+C)-D/(E+F)\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " For A \nStack (bottom-->top): \nFor * \nStack (bottom-->top): \nFor ( \nStack (bottom-->top): * \nFor B \nStack (bottom-->top): * ( \nFor + \nStack (bottom-->top): * ( \nFor C \nStack (bottom-->top): * ( + \nFor ) \nStack (bottom-->top): * ( + \nFor - \nStack (bottom-->top): * \nFor D \nStack (bottom-->top): - \nFor / \nStack (bottom-->top): - \nFor ( \nStack (bottom-->top): - / \nFor E \nStack (bottom-->top): - / ( \nFor + \nStack (bottom-->top): - / ( \nFor F \nStack (bottom-->top): - / ( + \nFor ) \nStack (bottom-->top): - / ( + \nWhile \nStack (bottom-->top): - / \nWhile \nStack (bottom-->top): - \nEnd\nStack (bottom-->top): \nPostfix is ABC+*DEF+/-\nEnter infix: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.8 Page No : 168"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 4.8\n'''\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n for i in range(s):\n self.stackArray.append(0.0)\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray[self.top] = j #.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\n\n def peekN(self,n): # return item at index n\n return self.stackArray[n]\n \n def size(self): # return size\n return self.top+1\n \n def displayStack(self,s):\n print s ,\n print 'Stack (bottom-->top): ',\n for j in range(self.top+1):\n print self.peekN(j) ,\n print ''\n\nclass ParsePost:\n # infix to postfix conversion\n def __init__(self,i):\n self.input = i\n self.theStack = None\n\n def doParse(self):\n self.theStack = StackX(20)\n interAns = 0\n for j in range(len(self.input)):\n ch = self.input[j]\n self.theStack.displayStack(ch + ' ')\n if(ch >= '0' and ch <= '9'):\n self.theStack.push( ord(ch)-ord('0') )\n else:\n num2 = self.theStack.pop()\n num1 = self.theStack.pop()\n if ch=='+':\n interAns = num1 + num2\n elif ch=='-':\n interAns = num1 - num2\n elif ch=='*':\n interAns = num1 * num2\n elif ch=='/':\n interAns = num1 / num2\n else:\n interAns = 0\n self.theStack.push(interAns)\n interAns = self.theStack.pop()\n return interAns\n\nwhile(True):\n print 'Enter postfix: ',\n i = raw_input()\n # read a string from kbd\n if( i == ''):\n # quit if [Enter]\n break\n aParser = ParsePost(i)\n output = aParser.doParse() # do the evaluation\n print \"Evaluates to \" , output",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter postfix: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "345+*612+/-\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 3 Stack (bottom-->top): \n4 Stack (bottom-->top): 3 \n5 Stack (bottom-->top): 3 4 \n+ Stack (bottom-->top): 3 4 5 \n* Stack (bottom-->top): 3 9 \n6 Stack (bottom-->top): 27 \n1 Stack (bottom-->top): 27 6 \n2 Stack (bottom-->top): 27 6 1 \n+ Stack (bottom-->top): 27 6 1 2 \n/ Stack (bottom-->top): 27 6 3 \n- Stack (bottom-->top): 27 2 \nEvaluates to 25\nEnter postfix: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch5.ipynb b/Data_Structures_and_Algorithms_in_Java/ch5.ipynb
new file mode 100644
index 00000000..6ac7b766
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch5.ipynb
@@ -0,0 +1,338 @@
+{
+ "metadata": {
+ "name": "ch5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 5 : Linked Lists"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.1 Page No : 190"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 5.1\nLink List\n'''\n\nclass Link:\n def __init__(self,i,dd):\n self.iData = i\n self.dData = dd\n self.next = None\n\n def displayLink(self): # display ourself\n print '{' , self.iData , ', ' , self.dData , '} ' ,\n\nclass LinkList:\n def __init__(self):\n self.first = None\n\n def isEmpty(self): # true if list is empty\n return (self.first==None)\n\n # insert at start of list\n def insertFirst(self,i, dd):\n # make new link\n newLink = Link(i, dd)\n newLink.next = self.first\n # newLink --> old first\n self.first = newLink\n\n def deleteFirst(self):\n temp = self.first\n self.first = self.first.next\n return temp\n \n def displayList(self):\n print 'List (first-->last): ' ,\n current = self.first\n while(current != None):\n current.displayLink()\n current = current.next\n print ''\n\ntheList = LinkList() # make new list\ntheList.insertFirst(22,2.99)\ntheList.insertFirst(44,4.99)\ntheList.insertFirst(66,6.99)\ntheList.insertFirst(88,8.99)\ntheList.displayList()\n\nwhile( not theList.isEmpty() ): # until it's empty,\n aLink = theList.deleteFirst() # delete link\n print 'Deleted ' , # display it\n aLink.displayLink()\n print ''\n \ntheList.displayList()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "List (first-->last): { 88 , 8.99 } { 66 , 6.99 } { 44 , 4.99 } { 22 , 2.99 } \nDeleted { 88 , 8.99 } \nDeleted { 66 , 6.99 } \nDeleted { 44 , 4.99 } \nDeleted { 22 , 2.99 } \nList (first-->last): \n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.2 Page No : 193"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 5.2\ndemonstrates linked list\n'''\nclass Link:\n def __init__(self,i,dd):\n self.iData = i\n self.dData = dd\n self.next = None\n\n def displayLink(self): # display ourself\n print '{' , self.iData , ', ' , self.dData , '} ' ,\n\nclass LinkList:\n def __init__(self):\n self.first = None\n\n def isEmpty(self): # true if list is empty\n return (self.first==None)\n\n # insert at start of list\n def insertFirst(self,i, dd):\n # make new link\n newLink = Link(i, dd)\n newLink.next = self.first\n # newLink --> old first\n self.first = newLink\n\n def deleteFirst(self):\n temp = self.first\n self.first = self.first.next\n return temp\n \n def displayList(self):\n print 'List (first-->last): ' ,\n current = self.first\n while(current != None):\n current.displayLink()\n current = current.next\n print ''\n\n def find(self,key): # find link with given key\n current = self.first #start at first\n while(current.iData != key): # while no match,\n if(current.next == None): # if end of list,\n return None # didnt find it\n else:\n current = current.next # go to next link\n return current\n \n def delete(self,key): # delete link with given key\n current = self.first \n previous = self.first\n while(current.iData != key):\n if(current.next == None):\n return None # didnt find it\n else:\n previous = current\n current = current.next\n if(current == self.first): # if first link,\n self.first = self.first.next\n else:\n previous.next = current.next\n return current\n\n\ntheList = LinkList() # make list\ntheList.insertFirst(22,2.99)\ntheList.insertFirst(44,4.99)\ntheList.insertFirst(66,6.99)\ntheList.insertFirst(88,8.99)\ntheList.displayList() # display list\nf = theList.find(44) # find item\nif( f != None):\n print 'Found link with key ' , f.iData\nelse:\n print \"Can't find link\"\nd = theList.delete(66) # delete item\nif( d != None ):\n print \"Deleted link with key \" , d.iData\nelse:\n print \"Can't delete link\"\n\ntheList.displayList()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "List (first-->last): { 88 , 8.99 } { 66 , 6.99 } { 44 , 4.99 } { 22 , 2.99 } \nFound link with key 44\nDeleted link with key 66\nList (first-->last): { 88 , 8.99 } { 44 , 4.99 } { 22 , 2.99 } \n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.3 Page NO :198"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 5.3\ndemonstrates list with first and last references\n'''\nclass Link:\n def __init__(self,d):\n self.dData = d\n self.next = None\n\n def displayLink(self): # display ourself\n print self.dData , \n\nclass FirstLastList:\n def __init__(self):\n self.first = None\n self.last = None\n\n def isEmpty(self): # true if list is empty\n return (self.first==None)\n\n # insert at start of list\n def insertFirst(self, dd):\n # make new link\n newLink = Link(dd)\n if (self.isEmpty()):\n self.last = newLink\n newLink.next = self.first\n # newLink --> old first\n self.first = newLink\n\n def deleteFirst(self):\n temp = self.first\n if self.first.next ==None:\n self.last = None\n self.first = self.first.next\n return temp\n\n def insertLast(self,dd): # insert at end of list\n newLink = Link(dd) # make new link\n if( self.isEmpty() ): # if empty list,\n self.first = newLink # first --> newLink\n else:\n self.last.next = newLink # old last --> newLink\n self.last = newLink # newLink <-- last\n\n def displayList(self):\n print 'List (first-->last): ' ,\n current = self.first\n while(current != None):\n current.displayLink()\n current = current.next\n print ''\n\n\ntheList = FirstLastList()\ntheList.insertFirst(22) \ntheList.insertLast(11)\ntheList.insertFirst(44) \ntheList.insertLast(33) \ntheList.insertFirst(66) \ntheList.insertLast(55) \ntheList.displayList() # display the list\ntheList.deleteFirst() \ntheList.deleteFirst() \ntheList.displayList() # display again",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "List (first-->last): 66 44 22 11 33 55 \nList (first-->last): 22 11 33 55 \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.4 Page No : 204"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 5.4\ndemonstrates a stack implemented as a list\n'''\nclass Link:\n def __init__(self,dd):\n self.dData = dd\n self.next = None\n\n def displayLink(self): # display ourself\n print self.dData , \n\nclass LinkList:\n def __init__(self):\n self.first = None\n\n def isEmpty(self): # true if list is empty\n return (self.first==None)\n\n # insert at start of list\n def insertFirst(self, dd):\n # make new link\n newLink = Link( dd)\n newLink.next = self.first\n # newLink --> old first\n self.first = newLink\n\n def deleteFirst(self):\n temp = self.first\n self.first = self.first.next\n return temp\n \n def displayList(self):\n current = self.first\n while(current != None):\n current.displayLink()\n current = current.next\n print ''\n\nclass LinkStack:\n def __init__(self):\n self.theList = LinkList()\n\n def push(self,j): # put item on top of stack\n self.theList.insertFirst(j)\n\n def pop(self): # take item from top of stack\n return self.theList.deleteFirst()\n\n def isEmpty(self):\n return ( self.theList.isEmpty() )\n\n def displayStack(self):\n print 'Stack (top-->bottom): ' ,\n self.theList.displayList()\n\ntheStack = LinkStack() # make stack\ntheStack.push(20)\ntheStack.push(40) \ntheStack.displayStack() # display stack\n\ntheStack.push(60) # push items\ntheStack.push(80) \ntheStack.displayStack() # display stack\ntheStack.pop() \ntheStack.pop() \ntheStack.displayStack() # display stack",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Stack (top-->bottom): 40 20 \nStack (top-->bottom): 80 60 40 20 \nStack (top-->bottom): 40 20 \n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.5 Page No : 207"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 5.5\ndemonstrates queue implemented as double-ended list\n'''\n\nclass Link:\n def __init__(self,d): # constructor\n self.dData = d\n self.next = None\n\n def displayLink(self): # display this link\n print self.dData ,\n\nclass FirstLastList:\n def __init__(self):\n self.first = None\n self.last = None\n\n def isEmpty(self): # true if list is empty\n return (self.first==None)\n\n # insert at start of list\n def insertFirst(self, dd):\n # make new link\n newLink = Link(dd)\n if (self.isEmpty()):\n self.last = newLink\n newLink.next = self.first\n # newLink --> old first\n self.first = newLink\n\n def deleteFirst(self):\n temp = self.first\n if self.first.next ==None:\n self.last = None\n self.first = self.first.next\n return temp\n\n def insertLast(self,dd): # insert at end of list\n newLink = Link(dd) # make new link\n if( self.isEmpty() ): # if empty list,\n self.first = newLink # first --> newLink\n else:\n self.last.next = newLink # old last --> newLink\n self.last = newLink # newLink <-- last\n \n def displayList(self):\n print 'List (first-->last): ' ,\n current = self.first\n while(current != None):\n current.displayLink()\n current = current.next\n print ''\n\n\nclass LinkQueue:\n def __init__(self):\n self.theList = FirstLastList() # make a 2-ended list\n\n def isEmpty(self): # true if queue is empty\n return self.theList.isEmpty()\n \n def insert(self,j): # insert, rear of queue\n self.theList.insertLast(j)\n \n def remove(self): # remove, front of queue\n return self.theList.deleteFirst()\n \n def displayQueue(self):\n print 'Queue (front-->rear): ' , \n self.theList.displayList()\n\ntheQueue = LinkQueue()\ntheQueue.insert(20) # insert items\ntheQueue.insert(40) \ntheQueue.displayQueue() # display queue\ntheQueue.insert(60) # insert items\ntheQueue.insert(80) \ntheQueue.displayQueue() # display queue\ntheQueue.remove() # remove items\ntheQueue.remove() \ntheQueue.displayQueue() # display queue",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Queue (front-->rear): List (first-->last): 20 40 \nQueue (front-->rear): List (first-->last): 20 40 60 80 \nQueue (front-->rear): List (first-->last): 60 80 \n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.6 Page No : 215"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 5.6\ndemonstrates sorted list\n'''\n\nclass Link:\n def __init__(self,d): # constructor\n self.dData = d\n self.next = None\n\n def displayLink(self): # display this link\n print self.dData ,\n\nclass SortedList:\n def __init__(self):\n self.first = None\n\n def isEmpty(self): # true if no links\n return (self.first==None)\n\n def insert(self,key): # insert, in order\n newLink = Link(key) # make new link\n previous = None\n current = self.first # until end of list,\n while(current != None and key > current.dData):\n previous = current\n current = current.next\n if(previous==None): # at beginning of list\n self.first = newLink\n else: # not at beginning\n previous.next = newLink\n newLink.next = current\n\n def remove(self): # return & delete first link\n temp = self.first # save first\n self.first = self.first.next # delete first\n return temp\n\n def displayList(self):\n print \"List (first-->last): \" ,\n current = self.first # start at beginning of listSorted Lists\n while(current != None): # until end of list,\n current.displayLink()\n current = current.next # move to next link\n print ''\n\n# create new list\ntheSortedList = SortedList()\ntheSortedList.insert(20) # insert 2 items\ntheSortedList.insert(40)\ntheSortedList.displayList() # display list\ntheSortedList.insert(10)\ntheSortedList.insert(30)\ntheSortedList.insert(50) # insert 3 more items\ntheSortedList.displayList() # display list\ntheSortedList.remove() # remove an item\ntheSortedList.displayList() # display list",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "List (first-->last): 20 40 \nList (first-->last): 10 20 30 40 50 \nList (first-->last): 20 30 40 50 \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.7 Page No : 218"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 5.7\ndemonstrates sorted list used for sorting\n'''\nclass Link:\n def __init__(self,d): # constructor\n self.dData = d\n self.next = None\n\n def displayLink(self): # display this link\n print self.dData ,\n\nclass SortedList:\n def __init__(self,linkArr = None):\n if linkArr == None:\n self.first = None\n else:\n self.first = None # initialize list\n for j in range(len(linkArr)):\n self.insert( linkArr[j] )\n\n def isEmpty(self): # true if no links\n return (self.first==None)\n\n def insert(self,k): # insert, in order\n previous = None\n current = self.first # until end of list,\n while(current != None and k.dData > current.dData):\n previous = current\n current = current.next\n if(previous==None): # at beginning of list\n self.first = k\n else: # not at beginning\n previous.next = k\n k.next = current\n\n def remove(self): # return & delete first link\n temp = self.first # save first\n self.first = self.first.next # delete first\n return temp\n\n def displayList(self):\n print \"List (first-->last): \" ,\n current = self.first # start at beginning of listSorted Lists\n while(current != None): # until end of list,\n current.displayLink()\n current = current.next # move to next link\n print ''\n\n\nsize = 10 # create array of links\nlinkArray = []\nimport random\nfor j in range(size): # fill array with links\n # random number\n n = int(random.random()*99)\n newLink = Link(n) # make link\n linkArray.append(newLink) # put in array\n\n# display array contents\nprint 'Unsorted array: ',\nfor j in range(size):\n print linkArray[j].dData , \nprint ''\n\n# create new list\n# initialized with array\ntheSortedList = SortedList(linkArray)\nlinkArray = []\nfor j in range(size): # links from list to array\n linkArray.append( theSortedList.remove())\n# display array contents\nprint 'Sorted Array: ',\nfor j in range(size):\n print linkArray[j].dData ,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Unsorted array: 28 87 63 12 73 91 30 91 85 65 \nSorted Array: 12 28 30 63 65 73 85 87 91 91\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.8 Page no : 226"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 5.8\ndemonstrates doubly-linked list\n'''\nclass Link:\n def __init__(self,d): # constructor\n self.dData = d\n self.next = None\n self.previous = None\n\n def displayLink(self): # display this link\n print self.dData ,\n\nclass DoublyLinkedList:\n def __init__(self):\n self.first = None # no items on list yet\n self.last = None\n\n def isEmpty(self): # true if no links\n return self.first==None\n\n def insertFirst(self,dd): # insert at front of list\n newLink = Link(dd) # make new link\n if( self.isEmpty() ): # if empty list, \n self.last = newLink # newLink <-- last\n else:\n self.first.previous = newLink # newLink <-- old first\n newLink.next = self.first # newLink --> old first\n self.first = newLink # first --> newLink\n\n def insertLast(self,dd): # insert at end of list\n newLink = Link(dd) # make new link\n if( self.isEmpty() ) : # if empty list,\n self.first = newLink # first --> newLink\n else:\n self.last.next = newLink # old last --> newLink\n newLink.previous = self.last # old last <-- newLink\n self.last = newLink # newLink <-- last\n\n def deleteFirst(self): # delete first link\n # (assumes non-empty list)\n temp = self.first\n if(self.first.next == None): # if only one item\n self.last = None # None <-- last\n else:\n self.first.next.previous = None # None <-- old next\n self.first = self.first.next # first --> old next\n return temp\n\n def deleteLast(self): # delete last link\n # (assumes non-empty list)\n temp = self.last\n if(self.first.next == None): # if only one item\n self.first = None # first --> None\n else:\n self.last.previous.next = None # old previous --> None\n self.last = self.last.previous # old previous <-- last\n return temp\n\n # insert dd just after key\n def insertAfter(self,key,dd):\n # (assumes non-empty list)\n current = self.first # start at beginning\n while(current.dData != key): # until match is found,\n current = current.next # move to next link\n if(current == None):\n return False # didnt find it\n newLink = Link(dd) # make new link\n if(current==self.last): # if last link,\n newLink.next = None # newLink --> None\n self.last = newLink# newLink <-- last\n else: # not last link,\n newLink.next = current.next # newLink --> old next # newLink <-- old next\n current.next.previous = newLink\n newLink.previous = current # old current <-- newLink\n current.next = newLink # old current --> newLink\n return True # found it, did insertion\n\n def deleteKey(self,key): # delete item w/ given key\n # (assumes non-empty list)\n current = self.first # start at beginningDoubly Linked Lists\n while(current.dData != key):\n current = current.next\n if(current == None):\n return None\n if(current==self.first):\n self.first = current.next\n else: \n # until match is found, move to next link didnt find it found it first item? first --> old next\n # not first old previous --> old next\n current.previous.next = current.next\n if(current==self.last):\n self.last = current.previous\n else:\n # last item? old previous <-- last not last old previous <-- old next \n current.next.previous = current.previous\n return current # return value\n\n def displayForward(self):\n print 'List (first-->last): ',\n current = self.first # start at beginning\n while(current != None): # until end of list,\n current.displayLink()# display data\n current = current.next # move to next link\n print ''\n\n def displayBackward(self):\n print 'List (last-->first): ' ,\n current = self.last # start at end\n while(current != None): # until start of list,\n current.displayLink() # display data\n current = current.previous # move to previous link\n print ''\n\n# make a new list\ntheList = DoublyLinkedList()\ntheList.insertFirst(22) # insert at front\ntheList.insertFirst(44) \ntheList.insertFirst(66) \ntheList.insertLast(11) # insert at rear\ntheList.insertLast(33) \ntheList.insertLast(55) \ntheList.displayForward() # display list forward\ntheList.displayBackward() # display list backward\ntheList.deleteFirst() # delete first item\ntheList.deleteLast() # delete last item\ntheList.deleteKey(11) # delete item with key 11\ntheList.displayForward() # display list forward\ntheList.insertAfter(22, 77) # insert 77 after 22\ntheList.insertAfter(33, 88) # insert 88 after 33\ntheList.displayForward() # display list forward",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "List (first-->last): 66 44 22 11 33 55 \nList (last-->first): 55 33 11 22 44 66 \nList (first-->last): 44 22 33 \nList (first-->last): 44 22 77 33 88 \n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.9 Page No : 235"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 5.9\ndemonstrates iterators on a linked listListIterator\n'''\nclass Link:\n def __init__(self,d): # constructor\n self.dData = d\n self.next = None\n\n def displayLink(self): # display this link\n print self.dData ,\n\nclass LinkList:\n def __init__(self):\n self.first = None\n\n def isEmpty(self): # true if list is empty\n return (self.first==None)\n\n # insert at start of list\n def insertFirst(self,i, dd):\n # make new link\n newLink = Link(i, dd)\n newLink.next = self.first\n # newLink --> old first\n self.first = newLink\n\n def deleteFirst(self):\n temp = self.first\n self.first = self.first.next\n return temp\n \n def displayList(self):\n print 'List (first-->last): ' ,\n current = self.first\n while(current != None):\n current.displayLink()\n current = current.next\n print ''\n\n def find(self,key): # find link with given key\n current = self.first #start at first\n while(current.iData != key): # while no match,\n if(current.next == None): # if end of list,\n return None # didnt find it\n else:\n current = current.next # go to next link\n return current\n \n def delete(self,key): # delete link with given key\n current = self.first \n previous = self.first\n while(current.iData != key):\n if(current.next == None):\n return None # didnt find it\n else:\n previous = current\n current = current.next\n if(current == self.first): # if first link,\n self.first = self.first.next\n else:\n previous.next = current.next\n return current\n\n def getFirst(self): # get value of first\n return self.first\n\n def setFirst(self,f): # set first to new link\n self.first = f\n\n def getIterator(self): # return iterator\n return ListIterator(self) # initialized with\n\nclass ListIterator:\n def __init__(self,l): # constructor\n self.ourList = l\n self.reset()\n self.current = None\n self.previous = None\n\n def reset(self): # start at first\n self.current = self.ourList.getFirst()\n self.previous = None\n\n def atEnd(self): # true if last link\n return (self.current.next==None) \n \n def nextLink(self): # go to next link\n self.previous = self.current\n self.current = self.current.next\n\n def getCurrent(self): # get current link\n return self.current \n\n def insertAfter(self,dd): # insert after\n # current link\n newLink = Link(dd)\n if( self.ourList.isEmpty() ):# empty list\n self.ourList.setFirst(newLink)\n self.current = newLink\n else: # not empty\n newLink.next = self.current.next\n self.current.next = newLink\n self.nextLink() # point to new link\n\n def insertBefore(self,dd): # insert before\n # current link\n newLink = Link(dd)\n if(self.previous == None): # beginning of list (or empty list)\n newLink.next = self.ourList.getFirst()\n self.ourList.setFirst(newLink)\n self.reset()\n else: # not beginning\n newLink.next = self.previous.next\n self.previous.next = newLink\n self.current = newLink\n\n def deleteCurrent(self): # delete item at current\n value = self.current.dData\n if(self.previous == None): # beginning of list\n self.ourList.setFirst(self.current.next)\n self.reset()\n else: # not beginning\n self.previous.next = self.current.next\n if( self.atEnd() ):\n self.reset()\n else:\n current = current.next\n return value\n\ntheList = LinkList() # new list\niter1 = theList.getIterator() # new iter\niter1.insertAfter(20)\niter1.insertAfter(40)\niter1.insertAfter(80)\niter1.insertBefore(60) # insert items\nwhile(True):\n print 'Enter first letter of show, reset, ' , \n print 'next, get, before, after, delete: ' ,\n choice = raw_input() # get users option\n if choice == 's': # show list\n if( not theList.isEmpty() ):\n theList.displayList()\n else:\n print 'List is empty'\n elif choice == 'r': # reset (to first)\n iter1.reset()\n elif choice == 'n': # advance to next item\n if( not theList.isEmpty() and not iter1.atEnd() ):\n iter1.nextLink()\n else:\n print \"Cant go to next link\"\n elif choice=='g': # get current item\n if( not theList.isEmpty() ):\n value = iter1.getCurrent().dData\n print \"Returned \" , value\n else:\n print \"List is empty\"\n elif choice == 'b': # insert before current\n print \"Enter value to insert: \",\n value = raw_input()\n iter1.insertBefore(value)\n elif choice=='a': # insert after current\n print \"Enter value to insert: \",\n value = raw_input()\n iter1.insertAfter(value)\n elif choice == 'd': # delete current item\n if( not theList.isEmpty() ):\n value = iter1.deleteCurrent()\n print \"Deleted \" , value\n else:\n print \"Cant delete\"\n else:\n print \"Invalid entry\"\n break",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " List (first-->last): 20 40 60 80 \nEnter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "r\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "g\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Returned 60\nEnter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "b\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter value to insert: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter value to insert: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " List (first-->last): 20 40 100 7 60 80 \nEnter first letter of show, reset, next, get, before, after, delete: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Invalid entry\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch6.ipynb b/Data_Structures_and_Algorithms_in_Java/ch6.ipynb
new file mode 100644
index 00000000..483043b8
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch6.ipynb
@@ -0,0 +1,240 @@
+{
+ "metadata": {
+ "name": "ch6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 6 : Recursion"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.1 Page No : 255"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 6.1\nevaluates triangular numbers\n'''\n\ndef triangle(n):\n if(n==1):\n return 1\n else:\n return( n + triangle(n-1) )\n\nprint 'Enter a number: ' ,\ntheNumber = int(raw_input())\ntheAnswer = triangle(theNumber)\nprint 'Triangle = ' , theAnswer\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Enter a number: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "50\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Triangle = 1275\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.2 Page No : 265"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 6.2\ncreates anagrams\n'''\narrChar = []\nsize = 0\ncount = 0\ndef doAnagram(newSize):\n if(newSize == 1): # if too small,\n return\n for j in range(newSize): # for each position,\n doAnagram(newSize-1) # anagram remaining\n if(newSize==2): # if innermost,\n displayWord()\n rotate(newSize);\n\ndef rotate(newSize):\n global size\n global arrChar\n position = size - newSize\n temp = arrChar[position]\n for j in range(position+1,size):\n # shift others left\n arrChar[j-1] = arrChar[j]\n arrChar[size-1] = temp;\n\ndef displayWord():\n global count\n global size\n global arrChar\n if(count < 99):\n print ' ' ,\n if(count < 9):\n print ' ' ,\n count += 1\n print count ,\n for j in range(size):\n print arrChar[j] ,\n print '' ,\n if(count%6 == 0):\n print ''\n\nprint 'Enter a word: '\ni = raw_input()\n#global size\nsize = len(i)\nfor j in range(size):\n arrChar.append(i[j])\ndoAnagram(size)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a word: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "cats\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 1 c a t s 2 c a s t 3 c t s a 4 c t a s 5 c s a t 6 c s t a \n 7 a t s c 8 a t c s 9 a s c t 10 a s t c 11 a c t s 12 a c s t \n 13 t s c a 14 t s a c 15 t c a s 16 t c s a 17 t a s c 18 t a c s \n 19 s c a t 20 s c t a 21 s a t c 22 s a c t 23 s t c a 24 s t a c \n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.3 Page No : 269"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nLISTING 6.3\ndemonstrates recursive binary search\n'''\nclass ordArray:\n def __init__(self,m): # constructor\n self.a = []\n self.nElems = 0\n def size(self):\n return self.nElems\n\n def find(self,searchKey):\n return self.recFind(searchKey, 0, self.nElems-1)\n\n def recFind(self,searchKey,lowerBound,upperBound):\n curIn = (lowerBound + upperBound ) / 2\n if(self.a[curIn]==searchKey):\n return curIn # found it\n elif(lowerBound > upperBound):\n return self.nElems # cant find it\n else: # divide range\n if(self.a[curIn] < searchKey): # its in upper half\n return self.recFind(searchKey, curIn+1, upperBound)\n else: # its in lower half\n return self.recFind(searchKey, lowerBound, curIn-1)\n\n def insert(self,value): # put element into array\n self.a.append(value)\n self.a.sort()\n self.nElems += 1\n\n def display(self): # displays array contents\n for j in range(self.nElems): # for each element,\n print self.a[j] , \n print ''\n\nmaxSize = 100 # array size\narr = ordArray(maxSize) # create the array\narr.insert(72)\narr.insert(90)\narr.insert(45)\narr.insert(126)\narr.insert(54)\narr.insert(99)\narr.insert(144)\narr.insert(27)\narr.insert(135)\narr.insert(81)\narr.insert(18)\narr.insert(108)\narr.insert(9)\narr.insert(117)\narr.insert(63)\narr.insert(36)\narr.display() # display array\nsearchKey = 27 # search for item\nif( arr.find(searchKey) != arr.size()):\n print 'Found ' , searchKey\nelse:\n print \"Can't find \" , searchKey",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9 18 27 36 45 54 63 72 81 90 99 108 117 126 135 144 \nFound 27\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.4 Page No : 278"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 6.4\nsolves the towers of Hanoi puzzle\n'''\ndef doTowers(topN,frm,inter,to):\n if(topN==1):\n print \"Disk 1 from \" , frm , \"to \" , to\n else:\n doTowers(topN-1, frm, to, inter) # from-->inter\n print \"Disk \" , topN ,\" from \" , frm , \" to \" , to\n doTowers(topN-1, inter, frm, to) # inter-->to\n\n\nnDisks = 3\ndoTowers(nDisks, 'A', 'B', 'C')\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Disk 1 from A to C\nDisk 2 from A to B\nDisk 1 from C to B\nDisk 3 from A to C\nDisk 1 from B to A\nDisk 2 from B to C\nDisk 1 from A to C\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.5 Page no : 281"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 6.5\ndemonstrates merging two arrays into a third\n'''\n# merge A and B into C\ndef merge(arrayA,sizeA,arrayB,sizeB,arrayC ):\n aDex=0\n bDex=0\n cDex=0\n while(aDex < sizeA and bDex < sizeB): # neither array empty\n if( arrayA[aDex] < arrayB[bDex] ):\n arrayC.append(arrayA[aDex])\n cDex += 1\n aDex += 1\n else:\n arrayC.append(arrayB[bDex])\n cDex += 1\n bDex += 1\n while(aDex < sizeA):\n arrayC.append(arrayA[aDex])\n cDex += 1\n aDex += 1\n while(bDex < sizeB):\n arrayC.append(arrayB[bDex]) # but arrayB isnt\n cDex +=1\n bDex += 1\n\ndef display(theArray,size):\n for j in range(size):\n print theArray[j],\n\n\n\narrayA = [23, 47, 81, 95]\narrayB = [7, 14, 39, 55, 62, 74]\narrayC = []\nmerge(arrayA, 4, arrayB, 6, arrayC)\ndisplay(arrayC, 10)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7 14 23 39 47 55 62 74 81 95\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.6 Page no : 288"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 6.6\ndemonstrates recursive merge sort\n'''\n\nclass DArray:\n def __init__(self,m):\n self.theArray = []\n self.nElems = 0\n \n def insert(self,value):\n self.theArray.append(value)\n self.nElems += 1\n\n def display(self): # displays array contents\n for j in range(self.nElems):\n print self.theArray[j] ,\n print ''\n\n def mergeSort(self):\n workSpace = []\n for i in range(self.nElems):\n workSpace.append(0)\n self.recMergeSort(workSpace, 0, self.nElems-1)\n\n def recMergeSort(self,workSpace, lowerBound,upperBound):\n if(lowerBound == upperBound): # if range is 1,\n return\n else:\n mid = (lowerBound+upperBound) / 2\n self.recMergeSort(workSpace, lowerBound, mid)\n self.recMergeSort(workSpace, mid+1, upperBound)\n self.merge(workSpace, lowerBound, mid+1, upperBound)\n\n def merge(self,workSpace,lowPtr,highPtr,upperBound):\n j = 0\n lowerBound = lowPtr\n mid = highPtr-1\n n = upperBound-lowerBound+1\n while(lowPtr <= mid and highPtr <= upperBound):\n if( self.theArray[lowPtr] < self.theArray[highPtr] ):\n workSpace[j] = self.theArray[lowPtr]\n j += 1\n lowPtr += 1\n else:\n workSpace[j] = self.theArray[highPtr]\n j += 1\n highPtr += 1\n while(lowPtr <= mid):\n workSpace[j] = self.theArray[lowPtr]\n j += 1\n lowPtr += 1\n while(highPtr <= upperBound):\n workSpace[j] = self.theArray[highPtr]\n j += 1\n highPtr += 1\n for j in range(n):\n self.theArray[lowerBound+j] = workSpace[j]\n\nmaxSize = 100 # array size\narr = DArray(maxSize) # create the array\narr.insert(64) # insert items\narr.insert(21) \narr.insert(33) \narr.insert(70) \narr.insert(12) \narr.insert(85) \narr.insert(44) \narr.insert(3) \narr.insert(99) \narr.insert(0) \narr.insert(108) \narr.insert(36) \narr.display() # display items\narr.mergeSort() # merge sort the array\narr.display() # display items again",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "64 21 33 70 12 85 44 3 99 0 108 36 \n0 3 12 21 33 36 44 64 70 85 99 108 \n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.7 Page No :295"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 6.7\nevaluates triangular numbers, stack replaces recursion\n'''\nclass Params: #parameters to save on stack\n def __init__(self,nn, ra):\n self.n=nn\n self.returnAddress=ra\n\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\n\ntheNumber = 0\ntheAnswer = 0\ntheStack = None\ncodePart = 0\ntheseParams = None\ndef recTriangle():\n global theStack,codePart\n theStack = StackX(10000)\n codePart = 1\n while( step() == False): # call step() until it's true\n pass\n\ndef step():\n global theStack,codePart,theseParams,theAnswer,theNumber\n if codePart==1:\n # initial call\n theseParams = Params(theNumber, 6)\n theStack.push(theseParams);\n codePart = 2\n elif codePart==2:\n # method entry\n theseParams = theStack.peek()\n if(theseParams.n == 1):\n theAnswer = 1\n codePart = 5\n else:\n codePart = 3\n elif codePart==3:\n newParams = Params(theseParams.n - 1, 4)\n theStack.push(newParams)\n codePart = 2 # go enter method\n elif codePart==4:\n theseParams = theStack.peek()\n theAnswer = theAnswer + theseParams.n\n codePart = 5\n elif codePart==5: # method exit\n theseParams = theStack.peek()\n codePart = theseParams.returnAddress # (4 or 6)\n theStack.pop()\n elif codePart==6: # return point\n return True\n else:\n pass\n return False\n\nprint 'Enter a number: ' ,\ntheNumber = int(raw_input())\nrecTriangle()\nprint 'Triangle = ' ,theAnswer\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a number: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "100\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Triangle = 5050\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.8 Page no : 301"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 6.8\nevaluates triangular numbers, stack replaces recursion\n'''\n\n\nclass StackX:\n def __init__(self,s):\n self.maxSize = s\n self.stackArray = []\n self.top = -1\n\n def push(self,j):\n self.top += 1\n self.stackArray.append(j)\n \n def pop(self):\n p = self.stackArray[self.top]\n self.top -= 1\n self.stackArray.remove(p)\n return p\n \n def peek(self):\n return self.stackArray[self.top]\n\n def isEmpty(self):\n return (self.top == -1)\n\n def isFull(self):\n return (self.top == self.maxSize-1);\ntheNumber = 0\ntheAnswer = 0\ntheStack = None\ntheseParams = None\n\ndef stackTriangle():\n global theNumber,theAnswer,theStack,theNumber\n theStack = StackX(10000)\n theAnswer = 0\n while(theNumber > 0): # until n is 1,\n theStack.push(theNumber) # push value\n theNumber -= 1 # decrement value\n\n while( not theStack.isEmpty() ): # until stack empty,\n newN = theStack.pop() # pop value,\n theAnswer += newN\n\nprint 'Enter a number: ' ,\ntheNumber = int(raw_input())\nstackTriangle()\nprint 'Triangle = ' ,theAnswer\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a number: "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "50\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Triangle = 1275\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch7.ipynb b/Data_Structures_and_Algorithms_in_Java/ch7.ipynb
new file mode 100644
index 00000000..52523fdc
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch7.ipynb
@@ -0,0 +1,133 @@
+{
+ "metadata": {
+ "name": "ch7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 7 : Advanced Sorting "
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.1 Page no : 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nExample 7.1\ndemonstrates shell sort\n'''\n\nclass ArraySh:\n def __init__(self,m): # constructor\n self.theArray = [] # create the array\n self.nElems = 0 # no items yet\n\n def insert(self,value): # put element into array\n self.theArray.append(value) # insert it\n self.nElems+=1 # increment size\n\n def display(self): # displays array contents\n print 'A=' , \n for j in range(self.nElems): # for each element,\n print self.theArray[j] , # display it\n print ''\n\n def shellSort(self):\n inner = 0\n outer = 0\n temp = 0\n h = 1\n while(h <= self.nElems/3):\n h = h*3 + 1\n while(h>0):\n # find initial value of h\n # (1, 4, 13, 40, 121, ...)\n # decreasing h, until h=1\n # h-sort the file\n for outer in range(h,self.nElems):\n temp = self.theArray[outer]\n inner = outer\n # one subpass (eg 0, 4, 8)\n while(inner > h-1 and self.theArray[inner-h] >= temp):\n self.theArray[inner] = self.theArray[inner-h]\n inner -= h\n self.theArray[inner] = temp\n h = (h-1) / 3\n\nmaxSize = 10 # array size\narr = ArraySh(maxSize) # create the array\nimport random\nfor j in range(maxSize): # fill array with\n # random numbers\n n = int(random.random()*99)\n arr.insert(n)\n\narr.display() # display unsorted array\narr.shellSort() # shell sort the array\narr.display() # display sorted array",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A= 35 47 88 24 10 98 14 75 97 38 \nA= 10 14 24 35 38 47 75 88 97 98 \n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.2 Page No 327"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 7.2\ndemonstrates partitioning an array\n'''\nclass ArrayPar:\n def __init__(self,m): # constructor\n self.theArray = [] # create the array\n self.nElems = 0 # no items yet\n\n def insert(self,value): # put element into array\n self.theArray.append(value) # insert it\n self.nElems += 1 # increment size\n\n def size(self): # return number of items\n return self.nElems \n\n def display(self): # displays array contents\n print 'A=' ,\n for j in range(self.nElems): # for each element,\n print self.theArray[j] , # display it\n print ''\n\n def partitionIt(self,left,right,pivot):\n leftPtr = left - 1 # right of first elem\n rightPtr = right + 1 # left of pivot\n while(True):\n leftPtr += 1\n while(leftPtr < right ):\n leftPtr += 1\n if self.theArray[leftPtr] < pivot:\n break\n while(rightPtr > left ):# find smaller item\n rightPtr -= 1\n if self.theArray[rightPtr] > pivot:\n break;\n if(leftPtr >= rightPtr): # if pointers cross,\n break\n else: # not crossed, so\n self.swap(leftPtr, rightPtr)\n return leftPtr\n\n def swap(self,dex1,dex2): # swap two elements\n temp = self.theArray[dex1] # A into temp\n self.theArray[dex1] = self.theArray[dex2] # B into A\n self.theArray[dex2] = temp # temp into BPartitioning\n\nmaxSize = 16 # array size\narr = ArrayPar(maxSize) # create the array\nimport random\nfor j in range(maxSize): # fill array with\n # random numbers\n n = int(random.random()*199)\n arr.insert(n)\narr.display() # display unsorted array\npivot = 99 # pivot value\nprint \"Pivot is \", pivot ,\nsize = arr.size() # partition array\npartDex = arr.partitionIt(0, size-1, pivot)\nprint \", Partition is at index \" , partDex \narr.display() # display partitioned array",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A= 114 43 4 72 43 6 41 78 25 107 19 18 191 116 108 10 \nPivot is 99 , Partition is at index 9\nA= 114 108 4 116 43 191 41 107 25 78 19 18 6 72 43 10 \n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.3 Page no : 337"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 7.3\ndemonstrates simple version of quick sort\n'''\nclass ArrayIns:\n def __init__(self,m):\n self.theArray = [] # create the array\n self.nElems = 0 # no items yet\n\n def insert(self,value): # put element into array\n self.theArray.append( value) # insert it\n self.nElems += 1 # increment size\n\n def display(self): # displays array contents\n print 'A=' ,\n for j in range(self.nElems): # for each element,\n print self.theArray[j] , # display it\n print ''\n def quickSort(self):\n self.recQuickSort(0, self.nElems-1)\n\n def recQuickSort(self,left,right):\n if(right-left <= 0): # if size <= 1,\n return # already sorted\n else: # size is 2 or larger\n pivot = self.theArray[right] # rightmost item\n # partition range\n partition = self.partitionIt(left, right, pivot)\n self.recQuickSort(left, partition-1) # sort left side\n self.recQuickSort(partition+1, right) # sort right side\n\n def partitionIt(self,start, end,pivot):\n bottom = start-1 # Start outside the area to be partitioned\n top = end # Ditto\n done = 0\n while not done: # Until all elements are partitioned...\n while not done: # Until we find an out of place element...\n bottom = bottom+1 # ... move the bottom up.\n if bottom == top: # If we hit the top...\n done = 1 # ... we are done.\n break\n if self.theArray[bottom] > pivot: # Is the bottom out of place?\n self.theArray[top] = self.theArray[bottom] # Then put it at the top...\n break # ... and start searching from the top.\n while not done: # Until we find an out of place element...\n top = top-1 # ... move the top down.\n \n if top == bottom: # If we hit the bottom...\n done = 1 # ... we are done.\n break\n \n if self.theArray[top] < pivot: # Is the top out of place?\n self.theArray[bottom] = self.theArray[top] # Then put it at the bottom...\n break # ...and start searching from the bottom.\n\n self.theArray[top] = pivot # Put the pivot in its place.\n return top # Return the split point\n\nmaxSize = 16 # array size\narr = ArrayIns(maxSize) # create array\nimport random\nfor j in range(maxSize): # fill array with\n # random numbers\n n = int(random.random()*99)\n arr.insert(n)\narr.display() # display items\narr.quickSort() # quicksort them\narr.display() # display them again",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A= 63 42 31 37 74 79 6 76 0 5 7 6 82 48 26 70 \nA= 0 5 6 6 7 26 31 37 42 48 63 70 74 76 79 82 \n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.4 Page No : 347"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 7.4\ndemonstrates quick sort with median-of-three partitioning\n'''\nclass ArrayIns:\n def __init__(self,m):\n self.theArray = [] # create the array\n self.nElems = 0 # no items yet\n\n def insert(self,value): # put element into array\n self.theArray.append(value) # insert it\n self.nElems+=1 # increment size\n\n def display(self): # displays array contents\n print 'A=' ,\n for j in self.theArray:\n print j , \n print ''\n \n def quickSort(self):\n self.recQuickSort(0, self.nElems-1)\n\n def recQuickSort(self,left,right):\n size = right-left+1\n if(size <= 3): # manual sort if small\n self.manualSort(left, right)\n else:\n median = self.medianOf3(left, right)\n partition = self.partitionIt(left, right, median)\n self.recQuickSort(left, partition-1)\n self.recQuickSort(partition+1, right)\n\n def partitionIt(self,start, end,pivot):\n bottom = start-1 # Start outside the area to be partitioned\n top = end # Ditto\n done = 0\n while not done: # Until all elements are partitioned...\n while not done: # Until we find an out of place element...\n bottom = bottom+1 # ... move the bottom up.\n if bottom == top: # If we hit the top...\n done = 1 # ... we are done.\n break\n if self.theArray[bottom] > pivot: # Is the bottom out of place?\n self.theArray[top] = self.theArray[bottom] # Then put it at the top...\n break # ... and start searching from the top.\n while not done: # Until we find an out of place element...\n top = top-1 # ... move the top down.\n \n if top == bottom: # If we hit the bottom...\n done = 1 # ... we are done.\n break\n \n if self.theArray[top] < pivot: # Is the top out of place?\n self.theArray[bottom] = self.theArray[top] # Then put it at the bottom...\n break # ...and start searching from the bottom.\n\n self.theArray[top] = pivot # Put the pivot in its place.\n return top # Return the split point \n \n \n \n def medianOf3(self,left, right):\n center = (left+right)/2 # order left & center\n if( self.theArray[left] > self.theArray[center] ):\n self.theArray[left],self.theArray[center] = self.theArray[center],self.theArray[left]\n if( self.theArray[left] > self.theArray[right] ):\n self.theArray[left],self.theArray[right] = self.theArray[right],self.theArray[left]\n if( self.theArray[center] > self.theArray[right] ):\n self.theArray[right],self.theArray[center] = self.theArray[center],self.theArray[right]\n self.theArray[right-1],self.theArray[center] = self.theArray[center],self.theArray[right-1] # put pivot on right\n return self.theArray[right-1] # return median value\n\n def manualSort(self,left,right):\n size = right-left+1\n if(size <= 1):\n return # no sort necessary\n if(size == 2): # 2-sort left and right\n if( self.theArray[left] > self.theArray[right] ):\n self.theArray[right],self.theArray[left] = self.theArray[left],self.theArray[right]\n return\n else: # size is 3\n # 3-sort left, center, & right\n if( self.theArray[left] > self.theArray[right-1] ):\n self.theArray[right-1],self.theArray[left] = self.theArray[left],self.theArray[right-1] # left, center\n if( self.theArray[left] > self.theArray[right] ):\n self.theArray[right],self.theArray[left] = self.theArray[left],self.theArray[right] # left, right\n if( self.theArray[right-1] > self.theArray[right] ):\n self.theArray[right-1],self.theArray[right] = self.theArray[right],self.theArray[right-1] # center, right\n\n\nmaxSize = 16 # array size\narr = ArrayIns(maxSize) # create array\nimport random\nfor j in range(maxSize): # fill array with\n # random numbers\n n = int(random.random()*99)\n arr.insert(n)\narr.display() # display items\narr.quickSort() # quicksort them\narr.display() # display them again",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A= 93 28 45 24 83 16 56 62 26 13 62 49 29 89 63 18 \nA= 13 16 18 18 24 26 28 28 29 45 45 62 62 63 83 83 \n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.5 Page No : 351"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 7.5\ndemonstrates quick sort uses insertion sort for cleanup\n'''\nclass ArrayIns:\n def __init__(self,m):\n self.theArray = [] # create the array\n self.nElems = 0 # no items yet\n\n def insert(self,value): # put element into array\n self.theArray.append(value) # insert it\n self.nElems+=1 # increment size\n\n def display(self): # displays array contents\n print 'A=' ,\n for j in self.theArray:\n print j , \n print ''\n \n def quickSort(self):\n self.recQuickSort(0, self.nElems-1)\n\n def recQuickSort(self,left,right):\n size = right-left+1\n if(size <= 10): \n self.insertionSort(left, right)\n else:\n median = self.medianOf3(left, right)\n partition = self.partitionIt(left, right, median)\n self.recQuickSort(left, partition-1)\n self.recQuickSort(partition+1, right)\n\n def partitionIt(self,start, end,pivot):\n bottom = start-1 # Start outside the area to be partitioned\n top = end # Ditto\n done = 0\n while not done: # Until all elements are partitioned...\n while not done: # Until we find an out of place element...\n bottom = bottom+1 # ... move the bottom up.\n if bottom == top: # If we hit the top...\n done = 1 # ... we are done.\n break\n if self.theArray[bottom] > pivot: # Is the bottom out of place?\n self.theArray[top] = self.theArray[bottom] # Then put it at the top...\n break # ... and start searching from the top.\n while not done: # Until we find an out of place element...\n top = top-1 # ... move the top down.\n \n if top == bottom: # If we hit the bottom...\n done = 1 # ... we are done.\n break\n \n if self.theArray[top] < pivot: # Is the top out of place?\n self.theArray[bottom] = self.theArray[top] # Then put it at the bottom...\n break # ...and start searching from the bottom.\n\n self.theArray[top] = pivot # Put the pivot in its place.\n return top # Return the split point \n \n \n \n def medianOf3(self,left, right):\n center = (left+right)/2 # order left & center\n if( self.theArray[left] > self.theArray[center] ):\n self.theArray[left],self.theArray[center] = self.theArray[center],self.theArray[left]\n if( self.theArray[left] > self.theArray[right] ):\n self.theArray[left],self.theArray[right] = self.theArray[right],self.theArray[left]\n if( self.theArray[center] > self.theArray[right] ):\n self.theArray[right],self.theArray[center] = self.theArray[center],self.theArray[right]\n self.theArray[right-1],self.theArray[center] = self.theArray[center],self.theArray[right-1] # put pivot on right\n return self.theArray[right-1] # return median value\n\n def insertionSort(self,left,right):\n i = 0\n out = 0 # sorted on left of out\n for out in range(left+1,right+1):\n temp = self.theArray[out] # remove marked item\n i = out # start shifts at out\n # until one is smaller,\n while(i >left and self.theArray[i-1] >= temp):\n self.theArray[i] = self.theArray[i-1] # shift item to right\n i -= 1 # go left one position\n self.theArray[i] = temp # insert marked item\n\nmaxSize = 16 # array size\narr = ArrayIns(maxSize) # create array\nimport random\nfor j in range(maxSize): # fill array with\n # random numbers\n n = int(random.random()*99)\n arr.insert(n)\narr.display() # display items\narr.quickSort() # quicksort them\narr.display() # display them again",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A= 32 49 43 84 84 76 63 70 37 50 13 46 46 19 60 72 \nA= 13 19 32 32 37 43 46 49 50 60 63 70 70 76 84 84 \n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/ch8.ipynb b/Data_Structures_and_Algorithms_in_Java/ch8.ipynb
new file mode 100644
index 00000000..6e978756
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/ch8.ipynb
@@ -0,0 +1,42 @@
+{
+ "metadata": {
+ "name": "ch8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 8 : Binary Trees"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Exmaple 8.1 Page No : 406"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 8.1\ndemonstrates binary tree\n'''\n\n# for Stack class\nclass Node:\n def __init__(self):\n self.iData = None # data item (key)\n self.dData = None # data item\n self.leftChild = None # this nodes left child\n self.rightChild = None # this nodes right child\n\n def displayNode(self):\n # display ourself\n print '{' , self.iData , ',' ,self.dData , '}',\n\nclass Tree:\n def __init__(self):\n # constructor\n self.root = None # no nodes in tree \n\n def find(self,key): # find node with given key\n # (assumes non-empty tree)\n current = self.root # start at self.root\n while(current.iData != key): # while no match,\n if(key < current.iData): # go left?\n current = current.leftChild\n else: # or go right?\n current = current.rightChild\n if(current == None): # if no child,\n return None # didnt find it\n return current\n\n def insert(self,i,dd):\n newNode = Node() # make new node\n newNode.iData = i # insert data\n newNode.dData = dd\n if(self.root==None):# no node in self.root\n self.root = newNode\n else: # self.root occupied\n current = self.root # start at self.root\n while(True): # (exits internally)\n parent = current\n if(i < current.iData): # go left?\n current = current.leftChild\n if(current == None): # if end of the line,\n # insert on left\n parent.leftChild = newNode\n return\n else:# or go right?\n current = current.rightChild\n if(current == None): # if end of the line \n # insert on right\n parent.rightChild = newNode\n return\n\n def delete(self,key): # delete node with given key\n # (assumes non-empty list)\n current = self.root\n parent = self.root\n isLeftChild = True\n while(current.iData != key):\n parent = current\n if(key < current.iData):\n isLeftChild = True\n current = current.leftChild\n else:\n isLeftChild = False\n current = current.rightChild\n if(current == None):\n return False\n # if no children, simply delete it\n if(current.leftChild==None and current.rightChild==None):\n if(current == self.root): # if self.root,\n self.root = None # tree is empty\n elif(isLeftChild):\n parent.leftChild = None\n else:\n parent.rightChild = None\n\n elif(current.rightChild==None):\n if(current == self.root):\n self.root = current.leftChild\n elif(isLeftChild):\n parent.leftChild = current.leftChild\n else:\n parent.rightChild = current.leftChild # if no left child, replace with right subtree\n elif(current.leftChild==None):\n if(current == self.root):\n self.root = current.rightChild\n elif(isLeftChild):\n parent.leftChild = current.rightChild\n else:\n parent.rightChild = current.rightChild\n else: # two children, so replace with inorder successor\n # get successor of node to delete (current)\n successor = self.getSuccessor(current)\n # connect parent of current to successor instead\n if(current == self.root):\n self.root = successor\n elif(isLeftChild):\n parent.leftChild = successor\n else:\n parent.rightChild = successor\n # connect successor to currents left child\n successor.leftChild = current.leftChild\n return True\n\n def getSuccessor(self,delNode):\n successorParent = delNode\n successor = delNode\n current = delNode.rightChild # go to right child\n while(current != None): # until no more\n # left children,\n successorParent = successor\n successor = current\n current = current.leftChild # go to left child\n # if successor not\n if(successor != delNode.rightChild): # right child,\n # make connections\n successorParent.leftChild = successor.rightChild\n successor.rightChild = delNode.rightChild\n return successor\n\n def traverse(self,traverseType):\n if traverseType == 1:\n print '\\nPreorder traversal: ',\n self.preOrder(self.root)\n elif traverseType == 2:\n print '\\nInorder traversal: ',\n self.inOrder(self.root)\n else:\n print '\\nPostorder traversal: ',\n self.postOrder(self.root)\n print ''\n\n def preOrder(self, localroot):\n if(localroot != None):\n print localroot.iData ,\n self.preOrder(localroot.leftChild)\n self.preOrder(localroot.rightChild)\n\n def inOrder(self, localroot):\n if(localroot != None):\n self.inOrder(localroot.leftChild)\n print localroot.iData ,\n self.inOrder(localroot.rightChild)\n \n def postOrder(self, localroot):\n if(localroot != None):\n self.postOrder(localroot.leftChild)\n self.postOrder(localroot.rightChild)\n print localroot.iData ,\n\n def displayTree(self):\n globalStack = list()\n globalStack.append(self.root)\n nBlanks = 32\n isRowEmpty = False\n print '\\n......................................................'\n while(isRowEmpty==False):\n localStack = list()\n isRowEmpty = True\n for j in range(nBlanks):\n print ' ',\n while(globalStack is not None):\n temp = globalStack.pop()\n if(temp != None):\n print temp.iData,\n localStack.append(temp.leftChild)\n localStack.append(temp.rightChild)\n if(temp.leftChild != None or temp.rightChild != None):\n isRowEmpty = False\n else:\n print '--' ,\n localStack.push(None)\n localStack.push(None)\n for j in range(nBlanks*2-2):\n print ' ', # end while globalStack not empty\n \n print ''\n nBlanks /= 2\n while(localStack is not None):\n globalStack.append( localStack.pop() ) # end while isRowEmpty is false\n \n print '\\n......................................................'\n\ntheTree = Tree()\ntheTree.insert(50,1.5)\ntheTree.insert(25,1.2)\ntheTree.insert(75,1.7)\ntheTree.insert(12,1.5)\ntheTree.insert(37,1.2)\ntheTree.insert(43,1.7)\ntheTree.insert(30,1.5)\ntheTree.insert(33,1.2)\ntheTree.insert(87,1.7)\ntheTree.insert(93,1.5)\ntheTree.insert(97,1.5)\nwhile(True):\n print 'Enter first letter of show, '\n print 'insert, find, delete, or traverse: ',\n choice = raw_input()\n if choice == 's':\n theTree.displayTree()\n elif choice == 'i':\n print 'Enter value to insert: '\n value = int(raw_input())\n theTree.insert(value, value + 0.9)\n elif choice == 'f':\n print 'Enter value to find: ',\n value = int(raw_input())\n found = theTree.find(value)\n if(found != None):\n print 'Found: ', \n found.displayNode()\n print ''\n else:\n print 'Could not find', value \n elif choice=='d':\n print 'Enter value to delete: ',\n value = int(raw_input())\n didDelete = theTree.delete(value)\n if(didDelete):\n print 'Deleted ' , value \n else:\n print 'Could not delete ',value\n elif choice=='t':\n print 'Enter type 1, 2 or 3: '\n value = int(raw_input())\n theTree.traverse(value)\n else:\n print 'Invalid entry'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Data_Structures_and_Algorithms_in_Java/screenshots/hashtableslinear.png b/Data_Structures_and_Algorithms_in_Java/screenshots/hashtableslinear.png
new file mode 100644
index 00000000..a8a3ab96
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/screenshots/hashtableslinear.png
Binary files differ
diff --git a/Data_Structures_and_Algorithms_in_Java/screenshots/shellsorting.png b/Data_Structures_and_Algorithms_in_Java/screenshots/shellsorting.png
new file mode 100644
index 00000000..4cf4d4ca
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/screenshots/shellsorting.png
Binary files differ
diff --git a/Data_Structures_and_Algorithms_in_Java/screenshots/shortestpath.png b/Data_Structures_and_Algorithms_in_Java/screenshots/shortestpath.png
new file mode 100644
index 00000000..876ddd19
--- /dev/null
+++ b/Data_Structures_and_Algorithms_in_Java/screenshots/shortestpath.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_10_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_10_2.ipynb
new file mode 100644
index 00000000..2a9ddf10
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_10_2.ipynb
@@ -0,0 +1,185 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 10: POWER SYSTEM ECONOMICS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1, Page number 339-340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find annual electricity charge\n",
+ "\n",
+ "#Variable declaration\n",
+ "max_dm_kW = 150.0 #Maximum demand(kW)\n",
+ "pf = 0.85 #Average power factor\n",
+ "rate = 90.0 #Cost of maximum demand(Rs/kVA)\n",
+ "E_rate = 0.3 #Cost of energy consumed(Rs)\n",
+ "lf = 0.65 #Annual load factor \n",
+ "\n",
+ "#Calculation\n",
+ "max_dm_kVA = max_dm_kW/pf #Maximum demand(kVA)\n",
+ "annual_chg_kVA = rate*max_dm_kVA #Annual fixed charges based on max demand(Rs)\n",
+ "E_kWh = lf*365*24*max_dm_kW #Energy consumed per annum(kWh)\n",
+ "annual_E_chg = E_kWh*E_rate #Annual energy charges(Rs)\n",
+ "annual_elect_charge = annual_chg_kVA + annual_E_chg #Annual electricity charge to be paid(Rs)\n",
+ "\n",
+ "#Result\n",
+ "print('Annual electricity charges to be paid by consumer = Rs %.2f' %annual_elect_charge)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Annual electricity charges to be paid by consumer = Rs 272112.35\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2, Page number 340-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Obtain two part tariff\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 75.0 #Power(kW)\n",
+ "cost_plant = 3000.0 #Cost of plant(Rs/kW)\n",
+ "cost_td = 30.0*10**5 #Cost of transmission & distribution(Rs)\n",
+ "interest = 0.15 #Interest,insurance charges(/annum)\n",
+ "depreciation = 0.05 #Depreciation(/annum)\n",
+ "cost_fix_mt = 4.0*10**5 #Fixed maintainance(Rs)\n",
+ "cost_var_mt = 6.0*10**5 #Variable maintainance(Rs)\n",
+ "cost_fuel = 10.0*10**6 #Fuel cost(Rs/annum)\n",
+ "cost_opr = 3.0*10**6 #Operation cost(Rs/annum)\n",
+ "max_demand = 70.0 #Maximum demand(MW)\n",
+ "df = 1.6 #Diversity factor b/w consumers\n",
+ "lf = 0.6 #Annual load factor\n",
+ "dividend = 10**6 #Dividend to shareholders(Rs/annum)\n",
+ "per_L = 0.10 #Total energy loss(% of generated energy)\n",
+ "\n",
+ "#Calculation\n",
+ "cost = cost_plant*P*1000 #Cost of plant(Rs)\n",
+ "#Fixed cost\n",
+ "per_value = interest+depreciation #Total interest & depreciation(/annum)\n",
+ "cost_fix_ann = (cost+cost_opr)*per_value+cost_fix_mt+dividend #Total fixed cost(Rs)\n",
+ "#Variable cost\n",
+ "cost_var_ann = cost_fuel+cost_opr+cost_var_mt #Total running cost(Rs)\n",
+ "E_gen_ann = max_demand*1000*24*365*lf #Energy generated per annum(kWh)\n",
+ "E_loss = per_L*E_gen_ann #Energy losses(kWh)\n",
+ "E_sold = E_gen_ann - E_loss #Energy sold(kWh)\n",
+ "sum_max_demand = df*max_demand*1000 #Sum of maximum demand of consumers(kW)\n",
+ "charge_max_demand = cost_fix_ann/sum_max_demand #Charge to consumers per kW of max demand per year(Rs)\n",
+ "charge_energy = cost_var_ann/E_sold*100 #Charge for energy(paise per kWh)\n",
+ "\n",
+ "#Result\n",
+ "print('Two-part tariff is :')\n",
+ "print('Rs %.2f per kW of maximum demand per year + %.1f paise per kWh consumed' %(charge_max_demand,charge_energy))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Two-part tariff is :\n",
+ "Rs 419.64 per kW of maximum demand per year + 4.1 paise per kWh consumed\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3, Page number 349-350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find optimal scheduling & total cost\n",
+ "\n",
+ "#Variable declaration\n",
+ "P_D = 500.0 #Total load(MW)\n",
+ "b_1 = 15.0 #Beta value of controllable thermal plant C1\n",
+ "g_1 = 0.012 #Gamma value of controllable thermal plant C1\n",
+ "b_2 = 16.0 #Beta value of controllable thermal plant C2\n",
+ "g_2 = 0.018 #Gamma value of controllable thermal plant C2\n",
+ "b_3 = 19.0 #Beta value of controllable thermal plant C3\n",
+ "g_3 = 0.020 #Gamma value of controllable thermal plant C3\n",
+ "\n",
+ "#Calculation\n",
+ "l = (P_D+((b_1/(2*g_1))+(b_2/(2*g_2))+(b_3/(2*g_3))))/((1/(2*g_1))+(1/(2*g_2))+(1/(2*g_3))) #Lambda value which is a Lagrange multiplier\n",
+ "P_G1 = (l - b_1)/(2*g_1) #(MW)\n",
+ "P_G2 = (l - b_2)/(2*g_2) #(MW)\n",
+ "P_G3 = (l - b_3)/(2*g_3) #(MW)\n",
+ "C1 = 1500.0 + b_1*P_G1 + g_1*P_G1**2 #Fuel cost of plant C1(Rs/hr)\n",
+ "C2 = 2000.0 + b_2*P_G2 + g_2*P_G2**2 #Fuel cost of plant C2(Rs/hr)\n",
+ "C3 = 1000.0 + b_3*P_G3 + g_3*P_G3**2 #Fuel cost of plant C3(Rs/hr)\n",
+ "C = C1 + C2 + C3 #Total fuel cost(Rs/hr)\n",
+ "\n",
+ "#Result\n",
+ "print('Value of \u03bb from equation(10.14) = %.3f' %l)\n",
+ "print('Optimal scheduling of thermal plant C1 = %.2f MW' %P_G1)\n",
+ "print('Optimal scheduling of thermal plant C2 = %.2f MW' %P_G2)\n",
+ "print('Optimal scheduling of thermal plant C3 = %.2f MW' %P_G3)\n",
+ "print('Total cost , C = Rs %.2f/hr' %C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of \u03bb from equation(10.14) = 21.647\n",
+ "Optimal scheduling of thermal plant C1 = 276.96 MW\n",
+ "Optimal scheduling of thermal plant C2 = 156.86 MW\n",
+ "Optimal scheduling of thermal plant C3 = 66.18 MW\n",
+ "Total cost , C = Rs 13872.55/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_12_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_12_2.ipynb
new file mode 100644
index 00000000..825a19ae
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_12_2.ipynb
@@ -0,0 +1,274 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 12: OVER-VOLTAGE TRANSIENTS IN POWER SYSTEMS AND PROTECTION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.1, Page number 408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find reflected & refracted voltage & current\n",
+ "\n",
+ "#Variable declaration\n",
+ "V_i = 100.0 #Incident voltage(kV)\n",
+ "Z_1 = 400.0 #Surge impedance(ohm)\n",
+ "Z_2 = 350.0 #Surge impedance(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "beta = 2*Z_2/(Z_1+Z_2) #Refraction coeffeicient of voltage\n",
+ "alpha = (Z_2-Z_1)/(Z_1+Z_2) #Reflection coeffeicient of voltage\n",
+ "V_t = beta*V_i #Refracted voltage(kV)\n",
+ "V_r = alpha*V_i #Reflected voltage(kV)\n",
+ "I_t = V_t/Z_2*1000 #Refracted current(A)\n",
+ "I_r = -(V_r/Z_1)*1000 #Reflected current(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Reflected voltage , V_r = %.1f kV' %V_r)\n",
+ "print('Refracted voltage , V_t = %.1f kV' %V_t)\n",
+ "print('Reflected current , I_r = %.1f A' %I_r)\n",
+ "print('Refracted current , I_t = %.1f A' %I_t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflected voltage , V_r = -6.7 kV\n",
+ "Refracted voltage , V_t = 93.3 kV\n",
+ "Reflected current , I_r = 16.7 A\n",
+ "Refracted current , I_t = 266.7 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2, Page number 408-409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find refracted voltage & current waves in overhead line & underground cable\n",
+ "\n",
+ "#Variable declaration\n",
+ "V_i = 100.0 #Incident voltage(kV)\n",
+ "Z_1 = 400.0 #Surge impedance(ohm)\n",
+ "Z_21 = 350.0 #Surge impedance of line connected at T(ohm)\n",
+ "Z_22 = 50.0 #Surge impedance of cable connected at T(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Z_2 = Z_21*Z_22/(Z_21+Z_22) #Surge impedance(ohm)\n",
+ "V_t = 2*Z_2*V_i/(Z_1+Z_2) #Refracted voltage(kV)\n",
+ "V_r = (Z_2-Z_1)*V_i/(Z_1+Z_2) #Reflected voltage(kV)\n",
+ "I_t1 = V_t/Z_21*1000 #Refracted current in Z_21(A)\n",
+ "I_t2 = V_t/Z_22*1000 #Refracted current in Z_22(A)\n",
+ "I_r = -(V_r/Z_1)*1000 #Reflected current in Z_1(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Refracted voltage , V_t = %.2f kV' %V_t)\n",
+ "print('Refracted current in overhead line , I_t1 = %.2f A' %I_t1)\n",
+ "print('Refracted current in underground cable , I_t2 = %.2f A' %I_t2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Refracted voltage , V_t = 19.72 kV\n",
+ "Refracted current in overhead line , I_t1 = 56.34 A\n",
+ "Refracted current in underground cable , I_t2 = 394.37 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.3, Page number 409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find reflected & refracted voltage & current\n",
+ "\n",
+ "#Variable declaration\n",
+ "V_i = 100.0 #Incident voltage(kV)\n",
+ "Z_1 = 400.0 #Surge impedance of overhead line(ohm)\n",
+ "Z_2 = 50.0 #Surge impedance of underground cable(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "beta = 2*Z_2/(Z_1+Z_2) #Refraction coeffeicient of voltage\n",
+ "alpha = (Z_2-Z_1)/(Z_1+Z_2) #Reflection coeffeicient of voltage\n",
+ "V_t = beta*V_i #Refracted voltage(kV)\n",
+ "V_r = alpha*V_i #Reflected voltage(kV)\n",
+ "I_t = V_t/Z_2*1000 #Refracted current(A)\n",
+ "I_r = -(V_r/Z_1)*1000 #Reflected current(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Reflected voltage , V_r = %.1f kV' %V_r)\n",
+ "print('Refracted voltage , V_t = %.1f kV' %V_t)\n",
+ "print('Reflected current , I_r = %.1f A' %I_r)\n",
+ "print('Refracted current , I_t = %.1f A' %I_t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflected voltage , V_r = -77.8 kV\n",
+ "Refracted voltage , V_t = 22.2 kV\n",
+ "Reflected current , I_r = 194.4 A\n",
+ "Refracted current , I_t = 444.4 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.5, Page number 410-411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find distance the surge travel to attenuate to half value\n",
+ "\n",
+ "#Variable declaration\n",
+ "R = 74.0*10**-6 #Resistance of overhead line(ohm/meter)\n",
+ "L = 1.212*10**-6 #Inductance of overhead line(H/meter)\n",
+ "C = 9.577*10**-12 #Capacitance of overhead line(F/meter)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Z_0 = (L/C)**0.5 #Surge impedance of line(ohm)\n",
+ "a = R/(2*Z_0)\n",
+ "x_1 = math.log(2)/a #Distance to be travelled(m)\n",
+ "\n",
+ "#Result\n",
+ "print('The distance the surge must travel to attenuate to half value = %.2e meter = %.2e km' %(x_1,x_1*10**-3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The distance the surge must travel to attenuate to half value = 6.66e+06 meter = 6.66e+03 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.7, Page number 412-413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current,arrester resistance,refraction & relection coefficient of voltage\n",
+ "\n",
+ "#Variable declaration\n",
+ "V_i = 2000.0 #Incident voltage(kV)\n",
+ "Z = 300.0 #Surge impedance(ohm)\n",
+ "V_p = 1200.0 #Arrester protection level(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "I_surge = V_i/Z #Surge current(kA)\n",
+ "V_oc = 2*V_i #Open-circuit voltage(kV)\n",
+ "I_A = (V_oc-V_p)/Z #Current through the arrestor(kA)\n",
+ "I_r = I_A - I_surge #Reflected current in line(kA)\n",
+ "V_r = -I_r*Z #Reflected voltage of line(kV)\n",
+ "V_t = V_p #Refracted voltage into arrestor(kV)\n",
+ "V_r_coeff = V_r/V_i #Reflected coefficient of voltage\n",
+ "V_t_coeff = V_t/V_i #Refracted coefficient of voltage\n",
+ "R_a = V_p/I_A #Arrestor resistance(ohm)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a) :')\n",
+ "print('Current flowing in line before the surge voltage reaches the arrestor terminal = %.2f kA' %I_surge)\n",
+ "print('\\nCase(b) :')\n",
+ "print('Current through the arrestor , I_A = %.2f kA' %I_A)\n",
+ "print('\\nCase(c) :')\n",
+ "print('Refraction coefficient of voltage at arrestor terminals = %.1f ' %V_t_coeff)\n",
+ "print('Reflection coefficient of voltage at arrestor terminals = %.1f ' %V_r_coeff)\n",
+ "print('\\nCase(d) :')\n",
+ "print('Value of arrestor resistance = %.1f ohm' %R_a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) :\n",
+ "Current flowing in line before the surge voltage reaches the arrestor terminal = 6.67 kA\n",
+ "\n",
+ "Case(b) :\n",
+ "Current through the arrestor , I_A = 9.33 kA\n",
+ "\n",
+ "Case(c) :\n",
+ "Refraction coefficient of voltage at arrestor terminals = 0.6 \n",
+ "Reflection coefficient of voltage at arrestor terminals = -0.4 \n",
+ "\n",
+ "Case(d) :\n",
+ "Value of arrestor resistance = 128.6 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_13_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_13_2.ipynb
new file mode 100644
index 00000000..84e2db43
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_13_2.ipynb
@@ -0,0 +1,824 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 13: SHORT-CIRCUIT PHENOMENA"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1, Page number 426-430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find symmetrical fault & fault current shared\n",
+ "\n",
+ "#Variable declaration\n",
+ "kv_gA = 11.0 #Voltage rating of generator A(kV)\n",
+ "MVA_gA = 40.0 #MVA rating of generator A\n",
+ "x_gA = 0.12 #Reactance of generator A(p.u)\n",
+ "kv_gB = 11.0 #Voltage rating of generator B(kV)\n",
+ "MVA_gB = 20.0 #MVA rating of generator B\n",
+ "x_gB = 0.08 #Reactance of generator B(p.u)\n",
+ "kv_Tlv = 11.0 #Low-voltage winding of transformer(kV)\n",
+ "kv_Thv = 66.0 #High-voltage winding of transformer(kV)\n",
+ "x_T = 0.10 #Reactance of Transformer(p.u)\n",
+ "kv_f = 66.0 #Feeder voltage(kV)\n",
+ "x_f = 30.0 #Reactance of feeder(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "MVA_base = 75.0 #Base MVA\n",
+ "kv_base_lv = 11.0 #Base voltage on LT side(kV)\n",
+ "kv_base_hv = 66.0 #Base voltage on HT side(kV)\n",
+ "x_gA_new = x_gA*(MVA_base/MVA_gA) #New Reactance of generator A(p.u)\n",
+ "x_gB_new = x_gB*(MVA_base/MVA_gB) #New Reactance of generator B(p.u)\n",
+ "x_f_new = x_f*(MVA_base/kv_base_hv**2) #New reactance of feeder(p.u)\n",
+ "\n",
+ "#For case(a)\n",
+ "x_eq = x_T+(x_gA_new*x_gB_new/(x_gA_new+x_gB_new)) #Equivalent reactance(p.u)\n",
+ "V_f = kv_Thv/kv_base_hv #Fault voltage by applying Thevenin's Theorem at FF(p.u)\n",
+ "I_f = V_f/complex(0,x_eq) #Fault current(A)\n",
+ "I_f_ht = I_f*(MVA_base*1000/(3**0.5*kv_base_hv)) #Fault current on HT side(A)\n",
+ "I_f_lt = I_f_ht*kv_base_hv/kv_base_lv #Fault current on LT side(A)\n",
+ "MVA_fault = V_f*MVA_base/x_eq #Fault MVA\n",
+ "I_A = I_f*x_gB_new/(x_gA_new+x_gB_new) #Current in generator A(p.u)\n",
+ "I_A1 = I_A*MVA_base*1000/(3**0.5*kv_base_lv) #Current in generator A(A)\n",
+ "I_B = I_f*x_gA_new/(x_gA_new+x_gB_new) #Current in generator B(p.u)\n",
+ "I_B1 = I_B*MVA_base*1000/(3**0.5*kv_base_lv) #Current in generator B(A)\n",
+ "\n",
+ "#For case(b)\n",
+ "x_eq2 = x_f_new+x_T+(x_gA_new*x_gB_new/(x_gA_new+x_gB_new)) #Equivalent reactance(p.u)\n",
+ "I_f2 = V_f/complex(0,x_eq2) #Fault current(p.u)\n",
+ "I_f_ht2 = I_f2*(MVA_base*1000/(3**0.5*kv_base_hv)) #Fault current on HT side(A)\n",
+ "MVA_fault2 = V_f*MVA_base/x_eq2 #Fault MVA\n",
+ "I_A_pu = I_f2*x_gB_new/(x_gA_new+x_gB_new) #Current in generator A(p.u)\n",
+ "I_A2 = I_A_pu*MVA_base*1000/(3**0.5*kv_base_lv) #Current in generator A(A)\n",
+ "I_B_pu = I_f2*x_gA_new/(x_gA_new+x_gB_new) #Current in generator B(p.u)\n",
+ "I_B2 = I_B_pu*MVA_base*1000/(3**0.5*kv_base_lv) #Current in generator B(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a) :')\n",
+ "print('Fault MVA for symmetric fault at the high voltage terminals of transformer = %.2f MVA' %MVA_fault)\n",
+ "print('Fault current shared by generator A , I_A = %.2fj A' %(I_A1.imag))\n",
+ "print('Fault current shared by generator B , I_B = %.2fj A' %(I_B1.imag))\n",
+ "print('\\nCase(b) :')\n",
+ "print('Fault MVA for symmetric fault at the load end of the feeder = %.2f MVA' %MVA_fault2)\n",
+ "print('Fault current shared by generator A , I_A = %.2fj A' %(I_A2.imag))\n",
+ "print('Fault current shared by generator B , I_B = %.2fj A' %(I_B2.imag))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) :\n",
+ "Fault MVA for symmetric fault at the high voltage terminals of transformer = 328.12 MVA\n",
+ "Fault current shared by generator A , I_A = -9841.20j A\n",
+ "Fault current shared by generator B , I_B = -7380.90j A\n",
+ "\n",
+ "Case(b) :\n",
+ "Fault MVA for symmetric fault at the load end of the feeder = 100.66 MVA\n",
+ "Fault current shared by generator A , I_A = -3018.94j A\n",
+ "Fault current shared by generator B , I_B = -2264.21j A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2, Page number 430-432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the rating of the circuit breaker\n",
+ "\n",
+ "#Variable declaration\n",
+ "MVA_base = 100.0 #Base MVA\n",
+ "x1 = 0.15 #Reactance b/w F & B(p.u) . (Refer textbook diagram for marking)\n",
+ "x2 = 0.1 #Reactance b/w F & B(p.u)\n",
+ "x3 = 0.18 #Reactance b/w B & C(p.u)\n",
+ "x4 = 0.1 #Reactance b/w B & F(p.u)\n",
+ "x5 = 0.05 #Reactance b/w F & C(p.u)\n",
+ "x6 = 0.05 #Reactance b/w F & C(p.u)\n",
+ "x7 = 0.1 #Reactance b/w C & F(p.u)\n",
+ "x8 = 0.12 #Reactance b/w C & F(p.u)\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "V_f = 1.0 #Fault voltage by applying Thevenin's Theorem at FF(p.u)\n",
+ "x1_eq = x1+x2\n",
+ "x2_eq = x7+x8\n",
+ "x3_eq = x5*x6/(x5+x6)\n",
+ "x4_eq = x3*x4/(x3+x4+x3_eq)\n",
+ "x5_eq = x4*x3_eq/(x3+x4+x3_eq)\n",
+ "x6_eq = x3*x3_eq/(x3+x4+x3_eq)\n",
+ "x7_eq = (x1_eq+x4_eq)*(x2_eq+x6_eq)/(x1_eq+x4_eq+x2_eq+x6_eq)\n",
+ "X_eq = x7_eq+x5_eq #Equivalent reactance\n",
+ "MVA_SC = V_f*MVA_base/X_eq #Short circuit MVA at A\n",
+ "\n",
+ "#Result\n",
+ "print('Rating of the circuit breaker at the location A = %.1f MVA' %MVA_SC)\n",
+ "print('\\nNOTE : ERROR : Delta to star reactance conversion mistake in textbook')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rating of the circuit breaker at the location A = 706.2 MVA\n",
+ "\n",
+ "NOTE : ERROR : Delta to star reactance conversion mistake in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3, Page number 432-434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the possible short-circuit MVA at each station bus-bars\n",
+ "\n",
+ "#Variable declaration\n",
+ "x = 1.2 #Reactance of interconnector(ohm per phase)\n",
+ "kv = 33.0 #Voltage of bus-bars(kV)\n",
+ "SC_MVA1 = 3000.0 #Short-circuit MVA at bus-bar of first station(MVA)\n",
+ "SC_MVA2 = 2000.0 #Short-circuit MVA at bus-bar of second station(MVA)\n",
+ "\n",
+ "#Calculation\n",
+ "MVA_base = 3000.0 #Base MVA\n",
+ "kv_base = 33.0 #Base kV\n",
+ "x_c = x*(MVA_base/kv_base**2) #Cable reactance(p.u)\n",
+ "x1 = MVA_base/SC_MVA1 #Reactance b/w e.m.f source & bus-bars for station 1(p.u)\n",
+ "x2 = MVA_base/SC_MVA2 #Reactance b/w e.m.f source & bus-bars for station 2(p.u)\n",
+ "V_f = 1.0 #Fault voltage by applying Thevenin's Theorem at FF(p.u)\n",
+ "X_eq1 = x1*(x_c+x2)/(x1+x_c+x2) #Thevenin reactance for short-circuit at bus bars at station 1(p.u)\n",
+ "SC_MVA1_poss = V_f*MVA_base/X_eq1 #Possible short-circuit at station 1(MVA)\n",
+ "X_eq2 = x2*(x_c+x1)/(x1+x_c+x2) #Thevenin reactance for short-circuit at bus bars at station 2(p.u)\n",
+ "SC_MVA2_poss = V_f*MVA_base/X_eq2 #Possible short-circuit at station 2(MVA)\n",
+ "\n",
+ "#Result\n",
+ "print('Possible short-circuit MVA at station 1 = %.2f MVA' %SC_MVA1_poss)\n",
+ "print('Possible short-circuit MVA at station 2 = %.2f MVA' %SC_MVA2_poss)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Possible short-circuit MVA at station 1 = 3624.25 MVA\n",
+ "Possible short-circuit MVA at station 2 = 2696.74 MVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4, Page number 434-436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find fault current fed by generator\n",
+ "\n",
+ "#Variable declaration\n",
+ "MVA_G1 = 20.0 #MVA rating of generator 1(MVA)\n",
+ "kv_G1 = 13.2 #Voltage rating of generator 1(kV)\n",
+ "x_G1 = 0.14 #Reactance of generator 1(p.u)\n",
+ "MVA_T1 = 20.0 #MVA rating of transformer 1(MVA)\n",
+ "kv_T1_lv = 13.2 #L.V voltage rating of transformer 1(kV)\n",
+ "kv_T1_hv = 132.0 #H.V voltage rating of transformer 1(kV)\n",
+ "x_T1 = 0.08 #Reactance of transformer 1(p.u)\n",
+ "MVA_G2 = 30.0 #MVA rating of generator 2(MVA)\n",
+ "kv_G2 = 13.2 #Voltage rating of generator 2(kV)\n",
+ "x_G2 = 0.16 #Reactance of generator 2(p.u)\n",
+ "MVA_T2 = 30.0 #MVA rating of transformer 2(MVA)\n",
+ "kv_T2_lv = 13.2 #L.V voltage rating of transformer 2(kV)\n",
+ "kv_T2_hv = 132.0 #H.V voltage rating of transformer 2(kV)\n",
+ "x_T2 = 0.12 #Reactance of transformer 2(p.u)\n",
+ "x_L = 75.0 #Line reactance(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "MVA_base = 45.0 #Base MVA\n",
+ "kv_lv_base = 13.2 #L.T base voltage(kV)\n",
+ "kv_hv_base = 132.0 #H.T base voltage(kV)\n",
+ "I_lt_base = MVA_base*1000/(3**0.5*kv_lv_base) #Base current on LT side(A)\n",
+ "x_G1_new = x_G1*(MVA_base/MVA_G1) #New reactance of generator 1(p.u)\n",
+ "x_G2_new = x_G2*(MVA_base/MVA_G2) #New reactance of generator 2(p.u)\n",
+ "x_T1_new = x_T1*(MVA_base/MVA_T1) #New reactance of transformer 1(p.u)\n",
+ "x_T2_new = x_T2*(MVA_base/MVA_T2) #New reactance of transformer 2(p.u)\n",
+ "x_L_new = x_L*(MVA_base/kv_hv_base**2) #New line reactance(p.u)\n",
+ "V_f = 1.0 #Pre-fault voltage at fault point FF(p.u)\n",
+ "x_T = (x_L_new/2)+((x_G1_new+x_T1_new)*(x_G2_new+x_T2_new)/(x_G1_new+x_T1_new+x_G2_new+x_T2_new)) #Thevenin reactance(p.u)\n",
+ "I_f = V_f/complex(0,x_T) #Fault current(A)\n",
+ "I_G1 = I_f*(x_G2_new+x_T2_new)/(x_G1_new+x_T1_new+x_G2_new+x_T2_new) #Fault current shared by generator 1(p.u)\n",
+ "I_f_G1 = I_G1*I_lt_base #Fault current shared by generator 1(A)\n",
+ "I_G2 = I_f*(x_G1_new+x_T1_new)/(x_G1_new+x_T1_new+x_G2_new+x_T2_new) #Fault current shared by generator 2(p.u)\n",
+ "I_f_G2 = I_G2*I_lt_base #Fault current shared by generator 2(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Fault current fed by generator 1 = %.1fj A' %I_f_G1.imag)\n",
+ "print('Fault current fed by generator 2 = %.1fj A' %I_f_G2.imag)\n",
+ "print('\\nNOTE : ERROR : MVA ratings of G2 & T2 are 30 MVA , not 25 MVA as in textbook question')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fault current fed by generator 1 = -2787.9j A\n",
+ "Fault current fed by generator 2 = -3285.7j A\n",
+ "\n",
+ "NOTE : ERROR : MVA ratings of G2 & T2 are 30 MVA , not 25 MVA as in textbook question\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5, Page number 436-439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find SCC of bus 1\n",
+ "\n",
+ "#Variable declaration\n",
+ "MVA_base = 20.0 #Base MVA\n",
+ "\n",
+ "#Calculation\n",
+ "V_f = 1.0 #Pre-fault voltage at bus 1(p.u).(Refer textbook diagram for marking.After circuit simplification)\n",
+ "x1 = 0.049 #Reactance(p.u)\n",
+ "x2 = 0.064 #Reactance(p.u)\n",
+ "x3 = 0.04 #Reactance(p.u)\n",
+ "x_eq = (x1+x2)*x3/(x1+x2+x3) #Equivalent reactance(p.u)\n",
+ "MVA_fault = V_f*MVA_base/x_eq #Fault MVA\n",
+ "\n",
+ "#Result\n",
+ "print('SCC of bus 1 = %.f MVA' %MVA_fault)\n",
+ "print('\\nNOTE : Changes in answer is due to more decimal places')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SCC of bus 1 = 677 MVA\n",
+ "\n",
+ "NOTE : Changes in answer is due to more decimal places\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6, Page number 439-441"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find SCC,total post-fault current & post-fault voltage\n",
+ "\n",
+ "#Variable declaration\n",
+ "x_G1 = 0.15 #Sub-transient reactance of generator 1(p.u)\n",
+ "x_G2 = 0.15 #Sub-transient reactance of generator 2(p.u)\n",
+ "x_T1 = 0.12 #Leakage reactance of transformer 1(p.u)\n",
+ "x_T2 = 0.12 #Leakage reactance of transformer 2(p.u)\n",
+ "x_s = 0.2 #Reactance of tie line(p.u)\n",
+ "load = complex(1.5,0.5) #Load(p.u)\n",
+ "S_12 = complex(0.75,0.25) #Load at tie line(p.u)\n",
+ "V1 = 1.0 #Pre-fault voltage at bus 1(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import cmath\n",
+ "#Pre-fault current & voltages\n",
+ "V_f = 1.0 #Voltage at FF(p.u)\n",
+ "Y_s = 1/complex(0,x_s) #Series admittance of line(p.u)\n",
+ "V2 = (1-(S_12/Y_s.conjugate())).conjugate() #Voltage at bus 2(p.u)\n",
+ "Z_L = (abs(V2)**2/load).conjugate() #Load at bus 2(p.u)\n",
+ "I_s = (V1-V2)*Y_s #Current through tie line(p.u)\n",
+ "I1 = I_s #Current through G1 & T1(p.u)\n",
+ "I_L = V2/Z_L #Load current(p.u)\n",
+ "I2 = I_L - I_s #Pre-fault current from generator 2(p.u)\n",
+ "\n",
+ "#Fault current\n",
+ "x_eq = (x_G1+x_T1)*(x_G2+x_T2+x_s)/(x_G1+x_T1+x_G2+x_T2+x_s) #Equivalent reactance of n/w(p.u)\n",
+ "I_f = 1/complex(0,x_eq) #Fault current(p.u)\n",
+ "I_f1 = I_f*(x_G2+x_T2+x_s)/(x_G1+x_T1+x_G2+x_T2+x_s) #Fault current through G1,T1 towards F(p.u)\n",
+ "I_f2 = I_f*(x_G1+x_T1)/(x_G1+x_T1+x_G2+x_T2+x_s) #Fault current through G2,T2 & tie-line towards F(p.u)\n",
+ "\n",
+ "#Post-fault current & voltage\n",
+ "V_1f = 0 #Post-fault voltage at bus 1(p.u)\n",
+ "V_2f = V_1f+(I_f2-I_s)*complex(0,x_s) #Post-fault voltage at bus 2(p.u)\n",
+ "\n",
+ "#Short-circuit capacity\n",
+ "SCC = V_f/x_eq #Fault MVA or SCC\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a) :')\n",
+ "print('SCC of bus 1 = %.2f p.u' %SCC)\n",
+ "print('\\nCase(b) :')\n",
+ "print('Total post-fault ac current shared by generator 1 , I_f1 = %.2fj p.u' %I_f1.imag)\n",
+ "print('Total post-fault ac current shared by generator 2 , I_f2 = %.2fj p.u' %I_f2.imag)\n",
+ "print('\\nCase(c) :')\n",
+ "print('Post-fault voltage of bus 2 , V_2f = %.3f\u2220%.2f\u00b0 p.u' %(abs(V_2f),cmath.phase(V_2f)*180/cmath.pi))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) :\n",
+ "SCC of bus 1 = 5.83 p.u\n",
+ "\n",
+ "Case(b) :\n",
+ "Total post-fault ac current shared by generator 1 , I_f1 = -3.70j p.u\n",
+ "Total post-fault ac current shared by generator 2 , I_f2 = -2.13j p.u\n",
+ "\n",
+ "Case(c) :\n",
+ "Post-fault voltage of bus 2 , V_2f = 0.404\u2220-21.77\u00b0 p.u\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.7, Page number 462-463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find symmetrical components of line currents\n",
+ "\n",
+ "#Variable declaration\n",
+ "import cmath\n",
+ "I_a = 10.0*cmath.exp(1j*90*cmath.pi/180) #Line current(A)\n",
+ "I_b = 10.0*cmath.exp(1j*-90*cmath.pi/180) #Line current(A)\n",
+ "I_c = 10.0*cmath.exp(1j*0*cmath.pi/180) #Line current(A)\n",
+ "\n",
+ "#Calculation\n",
+ "a = 1.0*cmath.exp(1j*120*cmath.pi/180) #Operator\n",
+ "I_a0 = 1.0/3*(I_a+I_b+I_c) #Zero-sequence component(A)\n",
+ "I_a1 = 1.0/3*(I_a+a*I_b+a**2*I_c) #Positive-sequence component(A)\n",
+ "I_a2 = 1.0/3*(I_a+a**2*I_b+a*I_c) #Negative-sequence component(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Zero-sequence component , I_a0 = %.2f\u2220%.f\u00b0 A' %(abs(I_a0),cmath.phase(I_a0)*180/cmath.pi))\n",
+ "print('Positive-sequence component , I_a1 = %.3f\u2220%.f\u00b0 A' %(abs(I_a1),cmath.phase(I_a1)*180/cmath.pi))\n",
+ "print('Negative-sequence component , I_a2 = %.1f\u2220%.f\u00b0 A' %(abs(I_a2),cmath.phase(I_a2)*180/cmath.pi))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zero-sequence component , I_a0 = 3.33\u22200\u00b0 A\n",
+ "Positive-sequence component , I_a1 = 2.440\u222060\u00b0 A\n",
+ "Negative-sequence component , I_a2 = 9.1\u2220120\u00b0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.8, Page number 463-467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find short-circuit current & terminal voltages\n",
+ "\n",
+ "#Variable declaration\n",
+ "kv = 13.2 #Voltage rating of generator(kV)\n",
+ "MVA = 25.0 #MVA rating of generator\n",
+ "MVA_sc = 170.0 #Short circuit MVA\n",
+ "x0 = 0.05 #Zero sequence reactance(p.u)\n",
+ "x2 = 0.13 #Negative sequence reactance(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "MVA_base = 25.0 #Base MVA\n",
+ "kv_base = 13.2 #Line-to-line Base voltage(kV)\n",
+ "I_base = MVA_base*1000/(3**0.5*kv_base) #Base current(A)\n",
+ "x1 = MVA_base/MVA_sc #Positive sequence reactance(p.u)\n",
+ "V_f = 1.0 #Pre-fault terminal voltage(p.u)\n",
+ "Z_f = 0 #Fault impedance\n",
+ "a = 1.0*cmath.exp(1j*120*cmath.pi/180) #Operator\n",
+ "\n",
+ "#L-G fault\n",
+ "I_a1 = V_f/complex(0,(x0+x1+x2)) #Positive sequence current(p.u)\n",
+ "I_a2 = I_a1 #Negative sequence current(p.u)\n",
+ "I_a0 = I_a1 #Zero sequence current(p.u)\n",
+ "I_a = 3*I_a1*I_base #Fault current at phase a(A)\n",
+ "I_b = 0 #Fault current at phase b(A)\n",
+ "I_c = 0 #Fault current at phase c(A)\n",
+ "V_a1 = V_f - I_a1*complex(0,x1) #Terminal voltage(p.u)\n",
+ "V_a2 = -I_a2*complex(0,x2) #Terminal voltage(p.u)\n",
+ "V_a0 = -I_a0*complex(0,x0) #Terminal voltage(p.u)\n",
+ "V_a = (V_a0+V_a1+V_a2)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_b = (V_a0+a**2*V_a1+a*V_a2)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_c = (V_a0+a*V_a1+a**2*V_a2)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_ab = (V_a-V_b) #Line voltages at terminal(kV)\n",
+ "V_bc = (V_b-V_c) #Line voltages at terminal(kV)\n",
+ "V_ca = (V_c-V_a) #Line voltages at terminal(kV)\n",
+ "\n",
+ "#L-L fault\n",
+ "I_a12 = V_f/complex(0,(x1+x2)) #Positive sequence current(p.u)\n",
+ "I_a22 = -I_a12 #Negative sequence current(p.u)\n",
+ "I_a02 = 0 #Zero sequence current(p.u)\n",
+ "I_a_2 = (I_a12+I_a22+I_a02)*I_base #Fault current at phase a(A)\n",
+ "I_b_2 = (a**2*I_a12+a*I_a22+I_a02)*I_base #Fault current at phase b(A)\n",
+ "I_c_2 = -I_b_2 #Fault current at phase c(A)\n",
+ "V_a12 = V_f - I_a12*complex(0,x1) #Terminal voltage(p.u)\n",
+ "V_a22 = V_a12 #Terminal voltage(p.u)\n",
+ "V_a02 = 0 #Terminal voltage(p.u)\n",
+ "V_a_2 = (V_a02+V_a12+V_a22)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_b_2 = (V_a02+a**2*V_a12+a*V_a22)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_c_2 = (V_a02+a*V_a12+a**2*V_a22)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_ab2 = (V_a_2-V_b_2) #Line voltages at terminal(kV)\n",
+ "V_bc2 = (V_b_2-V_c_2) #Line voltages at terminal(kV)\n",
+ "V_ca2 = (V_c_2-V_a_2) #Line voltages at terminal(kV)\n",
+ "\n",
+ "#L-L-G fault\n",
+ "I_a13 = V_f/complex(0,(x1+(x0*x2/(x0+x2)))) #Positive sequence current(p.u)\n",
+ "I_a23 = -I_a13*x0/(x0+x2) #Negative sequence current(p.u)\n",
+ "I_a03 = -I_a13*x2/(x0+x2) #Zero sequence current(p.u)\n",
+ "I_a_3 = (I_a13+I_a23+I_a03)*I_base #Fault current at phase a(A)\n",
+ "I_b_3 = (I_a03+a**2*I_a13+a*I_a23)*I_base #Fault current at phase b(A)\n",
+ "I_c_3 = (I_a03+a*I_a13+a**2*I_a23)*I_base #Fault current at phase c(A)\n",
+ "V_a13 = V_f-I_a13*complex(0,x1) #Terminal voltage(p.u)\n",
+ "V_a23 = V_a13 #Terminal voltage(p.u)\n",
+ "V_a03 = V_a13 #Terminal voltage(p.u)\n",
+ "V_a3 = (V_a03+V_a13+V_a23)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_b3 = (V_a03+a**2*V_a13+a*V_a23)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_c3 = (V_a03+a*V_a13+a**2*V_a23)*kv_base/3**0.5 #Line-to-neutral voltage at terminal(kV)\n",
+ "V_ab3 = (V_a3-V_b3) #Line voltages at terminal(kV)\n",
+ "V_bc3 = (V_b3-V_c3) #Line voltages at terminal(kV)\n",
+ "V_ca3 = (V_c3-V_a3) #Line voltages at terminal(kV)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) : L-G fault :')\n",
+ "print('Short circuit current , I_a = %.1fj A = %.1f\u2220%.f\u00b0 A' %(I_a.imag,abs(I_a),cmath.phase(I_a)*180/math.pi))\n",
+ "print('Short circuit current , I_b = %.f\u2220%.f\u00b0 A' %(abs(I_b),cmath.phase(I_b)*180/math.pi))\n",
+ "print('Short circuit current , I_c = %.f\u2220%.f\u00b0 A' %(abs(I_c),cmath.phase(I_c)*180/math.pi))\n",
+ "print('Terminal line voltage , V_ab = %.2f\u2220%.2f\u00b0 kV' %(abs(V_ab),cmath.phase(V_ab)*180/math.pi))\n",
+ "print('Terminal line voltage , V_bc = %.2f\u2220%.2f\u00b0 kV' %(abs(V_bc),cmath.phase(V_bc)*180/math.pi))\n",
+ "print('Terminal line voltage , V_ca = %.2f\u2220%.2f\u00b0 kV' %(abs(V_ca),cmath.phase(V_ca)*180/math.pi))\n",
+ "print('\\nCase(ii) : L-L fault :')\n",
+ "print('Short circuit current , I_a = %.f\u2220%.f\u00b0 A' %(abs(I_a_2),cmath.phase(I_a_2)*180/math.pi))\n",
+ "print('Short circuit current , I_b = %.2f\u2220%.1f\u00b0 A' %(abs(I_b_2),cmath.phase(I_b_2)*180/math.pi))\n",
+ "print('Short circuit current , I_c = %.2f\u2220%.1f\u00b0 A' %(abs(I_c_2),cmath.phase(I_c_2)*180/math.pi))\n",
+ "print('Terminal line voltage , V_ab = %.3f\u2220%.1f\u00b0 kV' %(abs(V_ab2),cmath.phase(V_ab2)*180/math.pi))\n",
+ "print('Terminal line voltage , V_bc = %.f\u2220%.1f\u00b0 kV' %(abs(V_bc2),cmath.phase(V_bc2)*180/math.pi))\n",
+ "print('Terminal line voltage , V_ca = %.3f\u2220%.1f\u00b0 kV' %(abs(V_ca2),cmath.phase(V_ca2)*180/math.pi))\n",
+ "print('\\nCase(iii) : L-L-G fault :')\n",
+ "print('Short circuit current , I_a = %.f\u2220%.f\u00b0 A' %(abs(I_a_3),cmath.phase(I_a_3)*180/math.pi))\n",
+ "print('Short circuit current , I_b = %.2f\u2220%.1f\u00b0 A' %(abs(I_b_3),cmath.phase(I_b_3)*180/math.pi))\n",
+ "print('Short circuit current , I_c = %.2f\u2220%.1f\u00b0 A' %(abs(I_c_3),cmath.phase(I_c_3)*180/math.pi))\n",
+ "print('Terminal line voltage , V_ab = %.3f\u2220%.f\u00b0 kV' %(abs(V_ab3),cmath.phase(V_ab3)*180/math.pi))\n",
+ "print('Terminal line voltage , V_bc = %.f\u2220%.f\u00b0 kV' %(abs(V_bc3),cmath.phase(V_bc3)*180/math.pi))\n",
+ "print('Terminal line voltage , V_ca = %.3f\u2220%.f\u00b0 kV' %(abs(V_ca3),cmath.phase(V_ca3)*180/math.pi))\n",
+ "print('\\nNOTE : Changes in answer is due to more decimal places')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) : L-G fault :\n",
+ "Short circuit current , I_a = -10030.0j A = 10030.0\u2220-90\u00b0 A\n",
+ "Short circuit current , I_b = 0\u22200\u00b0 A\n",
+ "Short circuit current , I_c = 0\u22200\u00b0 A\n",
+ "Terminal line voltage , V_ab = 6.50\u222074.39\u00b0 kV\n",
+ "Terminal line voltage , V_bc = 12.51\u2220-90.00\u00b0 kV\n",
+ "Terminal line voltage , V_ca = 6.50\u2220105.61\u00b0 kV\n",
+ "\n",
+ "Case(ii) : L-L fault :\n",
+ "Short circuit current , I_a = 0\u22200\u00b0 A\n",
+ "Short circuit current , I_b = 6835.87\u2220180.0\u00b0 A\n",
+ "Short circuit current , I_c = 6835.87\u2220-0.0\u00b0 A\n",
+ "Terminal line voltage , V_ab = 10.728\u2220-0.0\u00b0 kV\n",
+ "Terminal line voltage , V_bc = 0\u22200.0\u00b0 kV\n",
+ "Terminal line voltage , V_ca = 10.728\u2220180.0\u00b0 kV\n",
+ "\n",
+ "Case(iii) : L-L-G fault :\n",
+ "Short circuit current , I_a = 0\u22200\u00b0 A\n",
+ "Short circuit current , I_b = 9244.62\u2220135.6\u00b0 A\n",
+ "Short circuit current , I_c = 9244.62\u222044.4\u00b0 A\n",
+ "Terminal line voltage , V_ab = 4.507\u2220-0\u00b0 kV\n",
+ "Terminal line voltage , V_bc = 0\u22200\u00b0 kV\n",
+ "Terminal line voltage , V_ca = 4.507\u2220180\u00b0 kV\n",
+ "\n",
+ "NOTE : Changes in answer is due to more decimal places\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.9, Page number 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find fault current & neutral potential\n",
+ "\n",
+ "#Variable declaration\n",
+ "x0 = 0.05 #Zero sequence reactance(p.u)\n",
+ "x2 = 0.13 #Negative sequence reactance(p.u)\n",
+ "r = 1.0 #Resistance through which generator neutral is earthed(ohm)\n",
+ "MVA_sc = 170.0 #Short circuit MVA\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "MVA_base = 25.0 #Base MVA\n",
+ "kv_base = 13.2 #Line-to-line Base voltage(kV)\n",
+ "I_base = MVA_base*1000/(3**0.5*kv_base) #Base current(A)\n",
+ "kv_base1 = 11.0 #Base kV\n",
+ "Z_n = r*MVA_base/kv_base1**2 #Neutral impedance(p.u)\n",
+ "V_f = 1.0 #Pre-fault terminal voltage(p.u)\n",
+ "x1 = MVA_base/MVA_sc #Positive sequence reactance(p.u)\n",
+ "I_a1 = V_f/complex(3*Z_n,(x1+x2+x0)) #Positive sequence current(p.u)\n",
+ "I_a0 = I_a1 #Zero sequence current(p.u)\n",
+ "I_a2 = I_a1 #Negative sequence current(p.u)\n",
+ "I_a = 3*I_a1*I_base #Fault current(A)\n",
+ "V_n = 3*I_a0*Z_n*I_base #Potential of neutral(V)\n",
+ "\n",
+ "#Result\n",
+ "print('Fault current for a L-G short-circuit at its terminals , I_a = %.2f\u2220%.2f\u00b0 A' %(abs(I_a),cmath.phase(I_a)*180/math.pi))\n",
+ "print('Neutral potential = %.3f\u2220%.2f\u00b0 V' %(abs(V_n),cmath.phase(V_n)*180/math.pi))\n",
+ "print('\\nNOTE : ERROR : For calculating neutral potential in textbook Z_n = 1 is taken instead of Z_n = 0.206611570248')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fault current for a L-G short-circuit at its terminals , I_a = 4680.74\u2220-27.82\u00b0 A\n",
+ "Neutral potential = 967.094\u2220-27.82\u00b0 V\n",
+ "\n",
+ "NOTE : ERROR : For calculating neutral potential in textbook Z_n = 1 is taken instead of Z_n = 0.206611570248\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.10, Page number 467-471"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find fault current & current contributed by G1 & G2\n",
+ "\n",
+ "#Variable declaration\n",
+ "x1_G1 = complex(0,0.17) #Positive sequence reactance of G1(p.u)\n",
+ "x2_G1 = complex(0,0.14) #Negative sequence reactance of G1(p.u)\n",
+ "x0_G1 = complex(0,0.05) #Zero sequence reactance of G1(p.u)\n",
+ "x1_G2 = complex(0,0.17) #Positive sequence reactance of G2(p.u)\n",
+ "x2_G2 = complex(0,0.14) #Negative sequence reactance of G2(p.u)\n",
+ "x0_G2 = complex(0,0.05) #Zero sequence reactance of G2(p.u)\n",
+ "x1_T1 = complex(0,0.11) #Positive sequence reactance of T1(p.u)\n",
+ "x2_T1 = complex(0,0.11) #Negative sequence reactance of T1(p.u)\n",
+ "x0_T1 = complex(0,0.11) #Zero sequence reactance of T1(p.u)\n",
+ "x1_T2 = complex(0,0.11) #Positive sequence reactance of T2(p.u)\n",
+ "x2_T2 = complex(0,0.11) #Negative sequence reactance of T2(p.u)\n",
+ "x0_T2 = complex(0,0.11) #Zero sequence reactance of T2(p.u)\n",
+ "x1_L = complex(0,0.22) #Positive sequence reactance of line(p.u)\n",
+ "x2_L = complex(0,0.22) #Negative sequence reactance of line(p.u)\n",
+ "x0_L = complex(0,0.60) #Zero sequence reactance of line(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import cmath\n",
+ "a = 1.0*cmath.exp(1j*120*cmath.pi/180) #Operator\n",
+ "Z_1T = (x1_G1+x1_T1)*(x1_G2+x1_T2+x1_L)/(x1_G1+x1_T1+x1_G2+x1_T2+x1_L) #Thevenin reactance of positive sequence(p.u)\n",
+ "Z_2T = (x2_G1+x2_T1)*(x2_G2+x2_T2+x2_L)/(x2_G1+x2_T1+x2_G2+x2_T2+x2_L) #Thevenin reactance of negative sequence(p.u)\n",
+ "Z_0T = (x0_G1+x0_T1)*(x0_T2+x0_L)/(x0_G1+x0_T1+x0_T2+x0_L) #Thevenin reactance of zero sequence(p.u)\n",
+ "V_f = 1.0 #Pre-fault terminal voltage(p.u)\n",
+ "I_a1 = V_f/(Z_1T+Z_2T+Z_0T) #Positive sequence current(p.u)\n",
+ "I_a2 = I_a1 #Negative sequence current(p.u)\n",
+ "I_a0 = I_a1 #Zero sequence current(p.u)\n",
+ "I_a = 3*I_a1 #Fault current(p.u)\n",
+ "\n",
+ "#Generator G1\n",
+ "I_a1_G1 = I_a1*(x1_L+x1_T2+x1_G2)/(x1_L+x1_T1+x1_G1+x1_T2+x1_G2) #Positive sequence current shared by G1(p.u)\n",
+ "I_a2_G1 = I_a2*(x2_L+x2_T2+x2_G2)/(x2_L+x2_T1+x2_G1+x2_T2+x2_G2) #Negative sequence current shared by G1(p.u)\n",
+ "I_a0_G1 = I_a0*(x0_L+x0_T2)/(x0_L+x0_T1+x0_G1+x0_T2) #Zero sequence current shared by G1(p.u)\n",
+ "I_a_G1 = I_a0_G1+I_a1_G1+I_a2_G1 #Phase current through G1(p.u)\n",
+ "I_b_G1 = I_a0_G1+a**2*I_a1_G1+a*I_a2_G1 #Phase current through G1(p.u)\n",
+ "I_c_G1 = I_a0_G1+a*I_a1_G1+a**2*I_a2_G1 #Phase current through G1(p.u)\n",
+ "\n",
+ "#Generator G2\n",
+ "I_a1_G2 = I_a1*(x1_T1+x1_G1)/(x1_L+x1_T1+x1_G1+x1_T2+x1_G2)*cmath.exp(1j*30*cmath.pi/180) #Positive sequence current shared by G1(p.u)\n",
+ "I_a2_G2 = I_a2*(x2_T1+x2_G1)/(x2_L+x2_T1+x2_G1+x2_T2+x2_G2)*cmath.exp(1j*-30*cmath.pi/180) #Negative sequence current shared by G1(p.u)\n",
+ "I_a0_G2 = 0 #Zero sequence current shared by G1(p.u)\n",
+ "I_a_G2 = I_a0_G2+I_a1_G2+I_a2_G2 #Phase current through G2(p.u)\n",
+ "I_b_G2 = I_a0_G2+a**2*I_a1_G2+a*I_a2_G2 #Phase current through G2(p.u)\n",
+ "I_c_G2 = I_a0_G2+a*I_a1_G2+a**2*I_a2_G2 #Phase current through G2(p.u)\n",
+ "\n",
+ "#Result\n",
+ "print('Fault current for a L-G fault at bus 1 , I_a = %.3fj p.u' %I_a.imag)\n",
+ "print('\\nPhase currents contributed by G1 :')\n",
+ "print('I_a = %.3f\u2220%.1f\u00b0 p.u' %(abs(I_a_G1),cmath.phase(I_a_G1)*180/cmath.pi))\n",
+ "print('I_b = %.3f\u2220%.1f\u00b0 p.u' %(abs(I_b_G1),cmath.phase(I_b_G1)*180/cmath.pi))\n",
+ "print('I_c = %.3f\u2220%.1f\u00b0 p.u' %(abs(I_c_G1),cmath.phase(I_c_G1)*180/cmath.pi))\n",
+ "print('\\nPhase currents contributed by G2 :')\n",
+ "print('I_a = %.3f\u2220%.1f\u00b0 p.u' %(abs(I_a_G2),cmath.phase(I_a_G2)*180/cmath.pi))\n",
+ "print('I_b = %.3f\u2220%.1f\u00b0 p.u' %(abs(I_b_G2),cmath.phase(I_b_G2)*180/cmath.pi))\n",
+ "print('I_c = %.3f\u2220%.1f\u00b0 p.u' %(abs(I_c_G2),cmath.phase(I_c_G2)*180/cmath.pi))\n",
+ "print('\\nNOTE : ERROR : Calculation mistakes in Generator G2 part')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fault current for a L-G fault at bus 1 , I_a = -6.339j p.u\n",
+ "\n",
+ "Phase currents contributed by G1 :\n",
+ "I_a = 4.458\u2220-90.0\u00b0 p.u\n",
+ "I_b = 0.358\u2220-86.6\u00b0 p.u\n",
+ "I_c = 0.358\u2220-93.4\u00b0 p.u\n",
+ "\n",
+ "Phase currents contributed by G2 :\n",
+ "I_a = 1.292\u2220-89.4\u00b0 p.u\n",
+ "I_b = 0.025\u2220180.0\u00b0 p.u\n",
+ "I_c = 1.292\u222089.4\u00b0 p.u\n",
+ "\n",
+ "NOTE : ERROR : Calculation mistakes in Generator G2 part\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.11, Page number 471-473"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find fault current & fault MVA for L-G fault\n",
+ "\n",
+ "#Variable declaration\n",
+ "kv_G1 = 13.2 #Voltage rating of G1(kV)\n",
+ "MVA_G1 = 40.0 #MVA rating of G1\n",
+ "x1_G1 = 0.2 #Positive sequence reactance of G1(p.u)\n",
+ "x2_G1 = 0.2 #Negative sequence reactance of G1(p.u)\n",
+ "x0_G1 = 0.08 #Zero sequence reactance of G1(p.u)\n",
+ "MVA_T1 = 40.0 #MVA rating of T1\n",
+ "x_T1 = 0.05 #Reactance(p.u)\n",
+ "kv_lv_T1 = 13.2 #L.V side rating of T1(kV)\n",
+ "kv_hv_T1 = 132.0 #H.V side rating of T1(kV)\n",
+ "kv_L = 132.0 #Voltage rating of line(kV)\n",
+ "x1_L = 40.0 #Positive sequence resistance of line(ohm)\n",
+ "x2_L = 40.0 #Negative sequence resistance of line(ohm)\n",
+ "x0_L = 100.0 #Zero sequence resistance of line(ohm)\n",
+ "MVA_T2 = 40.0 #MVA rating of T1\n",
+ "x_T2 = 1.0 #Resistance through which neutral is earthed(ohm)\n",
+ "xp_T2 = 0.05 #Primary reactance of T2(p.u)\n",
+ "xs_T2 = 0.045 #Secondary reactance of T2(p.u)\n",
+ "xt_T2 = 0.06 #Tertiary reactance of T2(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "MVA_base = 40.0 #Base MVA\n",
+ "kv_base_G1 = 13.2 #Voltage base on generator side(kV)\n",
+ "kv_base_L = 132.0 #Voltage base on Line side(kV)\n",
+ "kv_base_T2t = 3.3 #Voltage base on tertiary side of T2(kV)\n",
+ "kv_base_T2s = 66 #Voltage base on secondary side of T2(kV)\n",
+ "R_ng = 2*MVA_base/kv_base_G1**2 #Neutral resistance of generator(p.u)\n",
+ "x1_L_new = x1_L*MVA_base/kv_base_L**2 #New Line reactance(p.u)\n",
+ "x2_L_new = x2_L*MVA_base/kv_base_L**2 #New Line reactance(p.u)\n",
+ "x0_L_new = x0_L*MVA_base/kv_base_L**2 #New Line reactance(p.u)\n",
+ "R_nT = x_T2*MVA_base/kv_base_T2s**2 #Neutral resistance of T2(p.u)\n",
+ "V_f = 1.0 #Pre-fault voltage at fault point(p.u)\n",
+ "Z1 = complex(0,x1_G1+x_T1+(x1_L_new/2)+xp_T2+xs_T2) #Thevenin impedance of positive sequence(p.u)\n",
+ "Z2 = complex(0,x2_G1+x_T1+(x2_L_new/2)+xp_T2+xs_T2) #Thevenin impedance of negative sequence(p.u)\n",
+ "Z0 = complex(0.0024,0.0593) #Thevenin impedance of zero sequence(p.u).Refer diagram\n",
+ "I_f = 3*V_f/(Z1+Z2+Z0) #Fault current(p.u)\n",
+ "I_f1 = abs(I_f)*MVA_base*1000/(3**0.5*kv_base_T2s) #Fault current(A)\n",
+ "MVA_fault = abs(I_f)*MVA_base #Fault MVA\n",
+ "\n",
+ "#Result\n",
+ "print('Fault current , I_f = %.2f A' %I_f1)\n",
+ "print('Fault MVA for L-G fault = %.2f MVA' %MVA_fault)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fault current , I_f = 1248.00 A\n",
+ "Fault MVA for L-G fault = 142.67 MVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_14_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_14_2.ipynb
new file mode 100644
index 00000000..7e9e089f
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_14_2.ipynb
@@ -0,0 +1,253 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 14: ELEMENTS OF CIRCUIT-BREAKERS AND RELAYS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.1, Page number 521"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find operating time of relay\n",
+ "\n",
+ "#Variable declaration\n",
+ "TMS = 0.5 #Time multiplier setting\n",
+ "I_f = 5000.0 #Fault current(A)\n",
+ "CT = 500.0/5 #CT ratio\n",
+ "set_plug = 1.0 #Relay plug set\n",
+ "I_relay = 5.0 #Rated relay current(A)\n",
+ "\n",
+ "#Calculation\n",
+ "PSM = I_f/(CT*set_plug*I_relay) #Plug setting multiplier\n",
+ "T1 = 1.0 #Time of operation for obtained PSM & TMS of 1 from graph.Refer Fig 14.22\n",
+ "T2 = TMS*3/T1 #Time of operation(sec)\n",
+ "\n",
+ "#Result\n",
+ "print('Operating time of the relay = %.1f sec' %T2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating time of the relay = 1.5 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.2, Page number 528-529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find CT ratio,PSM,TMS for each IDMT relays\n",
+ "\n",
+ "#Variable declaration\n",
+ "I_f_A = 6000.0 #3-phase fault current of substation A(A)\n",
+ "I_f_B = 5000.0 #3-phase fault current of substation B(A)\n",
+ "I_f_C = 3000.0 #3-phase fault current of substation C(A)\n",
+ "I_f_D = 2000.0 #3-phase fault current of substation D(A)\n",
+ "I_L_max = 100.0 #Maximum load cuurent(A)\n",
+ "T = 0.5 #Operating time of breakers(sec)\n",
+ " \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "I_set = 1.0 #Setting current(A)\n",
+ "\n",
+ "#For relay D\n",
+ "I_L_maxD = I_L_max #Maximum load current at D(A)\n",
+ "CT_D = I_L_max/1 #CT ratio\n",
+ "PSM_D = I_f_D/(CT_D*I_set) #Plug setting multiplier\n",
+ "TMS_D = 0.1 #Time multiplier setting\n",
+ "T_D = 0.14*TMS_D/(PSM_D**0.02-1) #Time of operation(sec)\n",
+ "\n",
+ "#For relay C\n",
+ "I_L_maxC = I_L_max+I_L_maxD #Maximum load current at C(A)\n",
+ "CT_C = I_L_maxC/1 #CT ratio\n",
+ "PSM_C = I_f_C/(CT_C*I_set) #Plug setting multiplier\n",
+ "T_C = T_D+T #Minimum time of operation(sec)\n",
+ "TMS_C = T_C*(PSM_C**0.02-1)/0.14 #Time multiplier setting\n",
+ "\n",
+ "#For relay B\n",
+ "I_L_maxB = I_L_max+I_L_maxC #Maximum load current at B(A)\n",
+ "CT_B = I_L_maxB/1 #CT ratio\n",
+ "PSM_B = I_f_B/(CT_B*I_set) #Plug setting multiplier\n",
+ "T_B = T_C+T #Minimum time of operation(sec)\n",
+ "TMS_B = T_B*(PSM_B**0.02-1)/0.14 #Time multiplier setting\n",
+ "\n",
+ "#For relay A\n",
+ "I_L_maxA = I_L_max+I_L_maxB #Maximum load current at A(A)\n",
+ "CT_A = I_L_maxA/1 #CT ratio\n",
+ "PSM_A = I_f_A/(CT_A*I_set) #Plug setting multiplier\n",
+ "T_A = T_B+T #Minimum time of operation(sec)\n",
+ "TMS_A = T_A*(PSM_A**0.02-1)/0.14 #Time multiplier setting\n",
+ "\n",
+ "#Result\n",
+ "print('Relay A :')\n",
+ "print('CT ratio = %.f/1' %CT_A)\n",
+ "print('PSM of R_A = %.1f' %PSM_A)\n",
+ "print('TMS of R_A = %.1f sec' %TMS_A)\n",
+ "print('\\nRelay B :')\n",
+ "print('CT ratio = %.f/1' %CT_B)\n",
+ "print('PSM of R_B = %.2f' %PSM_B)\n",
+ "print('TMS of R_B = %.1f sec' %TMS_B)\n",
+ "print('\\nRelay C :')\n",
+ "print('CT ratio = %.f/1' %CT_C)\n",
+ "print('PSM of R_C = %.1f' %PSM_C)\n",
+ "print('TMS of R_C = %.1f sec' %TMS_C)\n",
+ "print('\\nRelay D :')\n",
+ "print('CT ratio = %.f/1' %CT_D)\n",
+ "print('PSM of R_D = %.1f' %PSM_D)\n",
+ "print('TMS of R_D = %.2f sec' %TMS_D)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relay A :\n",
+ "CT ratio = 400/1\n",
+ "PSM of R_A = 15.0\n",
+ "TMS of R_A = 0.7 sec\n",
+ "\n",
+ "Relay B :\n",
+ "CT ratio = 300/1\n",
+ "PSM of R_B = 16.67\n",
+ "TMS of R_B = 0.5 sec\n",
+ "\n",
+ "Relay C :\n",
+ "CT ratio = 200/1\n",
+ "PSM of R_C = 15.0\n",
+ "TMS of R_C = 0.3 sec\n",
+ "\n",
+ "Relay D :\n",
+ "CT ratio = 100/1\n",
+ "PSM of R_D = 20.0\n",
+ "TMS of R_D = 0.10 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.3, Page number 537-538"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find ratio of CT on high tension side\n",
+ "\n",
+ "#Variable declaration\n",
+ "kv_hv = 66.0 #Voltage rating of HV side of transformer(kV)\n",
+ "kv_lv = 11.0 #Voltage rating of LV side of transformer(kV)\n",
+ "CT = 300.0/5 #CT ratio on low tension side\n",
+ "\n",
+ "#Calculation\n",
+ "I = 300.0 #Assumed current flowing at low tension side(A)\n",
+ "I_HT = kv_lv/kv_hv*I #Line current on HT side(A)\n",
+ "I_LT_CT = I/CT #Pilot wire current from LT side(A)\n",
+ "CT_ratio_HT = I_HT*3**0.5/I_LT_CT #Ratio of CT on HT side\n",
+ "\n",
+ "#Result\n",
+ "print('Ratio of CT on high tension side = %.f\u221a3/%.f' %(I_HT,I_LT_CT))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of CT on high tension side = 50\u221a3/5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.4, Page number 543-544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage of winding that remains unprotected\n",
+ "\n",
+ "#Variable declaration\n",
+ "kv = 11.0 #Voltage rating(kV)\n",
+ "MVA = 5.0 #MVA rating\n",
+ "R = 10.0 #Resistance(ohm)\n",
+ "per_a = 0.15 #Armature winding reactance\n",
+ "per_trip = 0.3 #Relay trip for out-of-balance\n",
+ "\n",
+ "#Calculation\n",
+ "x_p = per_a*kv**2/MVA #Winding Reactance(ohm)\n",
+ "V = kv/3**0.5*1000 #Phase voltage(V)\n",
+ "I = per_trip*MVA*1000/(3**0.5*kv) #Out of balance current(A)\n",
+ "p = (((R*I)**2/(V**2-(x_p*I)**2))**0.5)*100 #Percentage of winding remains unsupported\n",
+ "\n",
+ "#Result\n",
+ "print('Percentage of winding that remains unprotected , p = %.1f percentage' %p)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage of winding that remains unprotected , p = 12.4 percentage\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_15_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_15_2.ipynb
new file mode 100644
index 00000000..5631893f
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_15_2.ipynb
@@ -0,0 +1,330 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 15: POWER SYSTEM STABILITY"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.1, Page number 561"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find rotor angle & rotor velocity\n",
+ "\n",
+ "#Variable declaration\n",
+ "G = 50.0 #Rating of machine(MVA)\n",
+ "f = 50.0 #Frequency of turbo generator(Hz)\n",
+ "V = 11.0 #Voltage rating of machine(kV)\n",
+ "H = 9.0 #Cycle corresponding to 180 ms\n",
+ "P_0 = 40.0 #Pre-fault output power(MW)\n",
+ "delta_0 = 20.0 #Rotor angle at instant of fault(degree)\n",
+ "\n",
+ "#Calculation\n",
+ "P_0_close = 0 #Output power at instant of reclosing(MW)\n",
+ "P_a = P_0 - P_0_close #Net accelerating power(MW)\n",
+ "delta_sqr = P_a*180*f/(G*H) #double derivative(elect.degrees/sec^2)\n",
+ "\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "def integrand1(t): #Integrates the double derivative to 800*t\n",
+ " return delta_sqr\n",
+ "a, err = quad(integrand1, 0, 180*10**-3) #Rotor velocity(electrical degrees/sec)\n",
+ "\n",
+ "def integrand2(t): #Integrates the double derivative to 400*t^2\n",
+ " return delta_sqr*t\n",
+ "b, err = quad(integrand2, 0, 180*10**-3)\n",
+ "delta = delta_0 + b #Rotor angle(electrical degrees)\n",
+ "\n",
+ "#Result\n",
+ "print('Rotor angle at the instant of reclosure = %.2f\u00b0 electrical degrees' %delta)\n",
+ "print('Rotor velocity at the instant of reclosure = %.1f electrical degrees/sec' %a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rotor angle at the instant of reclosure = 32.96\u00b0 electrical degrees\n",
+ "Rotor velocity at the instant of reclosure = 144.0 electrical degrees/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.2, Page number 571"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find if system is stable or not\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 1.0 #Infinite bus voltage(p.u)\n",
+ "E = 1.0 #e.m.f of finite generator behind transient reactance(p.u)\n",
+ "X_T = 0.8 #Transfer reactance(p.u)\n",
+ "P_i = 0.5 #Input power(p.u)\n",
+ "P_i_d = 0.8 #p.u\n",
+ "P_0 = 0.5 #Output power(p.u)\n",
+ "P = 0.5 #Power(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "P_m = E*V/X_T #Amplitude of power angle curve(p.u)\n",
+ "delta_0 = math.asin(P_i/P_m) #Radians\n",
+ "delta = math.asin(P_i_d/P_m) #Radians\n",
+ "delta_m = math.pi-delta #Radians\n",
+ "A_acc = P_i_d*(delta-delta_0)-P_m*(math.cos(delta_0)-math.cos(delta)) #Possible area of accceleration\n",
+ "A_dec = P_m*(math.cos(delta)-math.cos(delta_m))-P_i_d*(delta_m-delta) #Possible area of deceleration\n",
+ "\n",
+ "#Result\n",
+ "if(A_acc < A_dec):\n",
+ " print('System is stable')\n",
+ " stability = A_dec/A_acc\n",
+ " print('Margin of stability = %.2f' %stability)\n",
+ "else:\n",
+ " print('System is not stable')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "System is stable\n",
+ "Margin of stability = 12.59\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.3, Page number 572-575"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find if system is stable & transient stability limit\n",
+ "\n",
+ "#Variable declaration\n",
+ "x = 0.25 #Transient reactance(p.u)\n",
+ "E = 1.0 #e.m.f of finite generator behind transient reactance(p.u)\n",
+ "x_T = 0.1 #Reactance of transformer(p.u)\n",
+ "x_L = 0.4 #Reactance of one line(p.u)\n",
+ "P_i = 0.25 #Pre-fault power(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "X_T = x+x_T+(x_L/2) #Transfer reactance at pre-fault state(p.u)\n",
+ "P_m = E**2/X_T #Amplitude of power angle curve at pre-fault state(p.u)\n",
+ "X_T1 = 1.45 #Transfer reactance b/w finite generator & infinite bus at faulty state(p.u).Refer texbook problem for figure\n",
+ "P_m1 = E**2/X_T1 #Amplitude of power angle curve at faulty state(p.u)\n",
+ "r1 = X_T/X_T1\n",
+ "delta_0 = math.asin(P_i/P_m) #Radians\n",
+ "delta_1 = math.asin(P_i/(r1*P_m)) #Radians\n",
+ "delta_m = math.pi - delta_1 #Radians\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "def integrand1(delta):\n",
+ " return r1*P_m*math.sin(delta)\n",
+ "a, err = quad(integrand1, delta_0, delta_1)\n",
+ "A_acc = P_i*(delta_1-delta_0) - a \n",
+ "\n",
+ "def integrand2(delta):\n",
+ " return r1*P_m*math.sin(delta)\n",
+ "b, err = quad(integrand2, delta_1, delta_m)\n",
+ "A_dec = b - P_i*(delta_m-delta_1)\n",
+ "limit = 0.5648 #Obtained by iterations.Refer textbook.Here assigned directly.\n",
+ "\n",
+ "#Result\n",
+ "if(A_acc < A_dec):\n",
+ " print('System is Stable')\n",
+ " stability = A_dec/A_acc\n",
+ " print('Margin of stability = %.2f' %stability)\n",
+ "else:\n",
+ " print('System is not stable')\n",
+ "print('Transient stability limit = %.4f p.u' %limit)\n",
+ "print('\\nNOTE : ERROR : angle delta_0 = 7.9\u00b0 = 0.13788 radian not 0.014 radian as in textbook')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "System is Stable\n",
+ "Margin of stability = 38.31\n",
+ "Transient stability limit = 0.5648 p.u\n",
+ "\n",
+ "NOTE : ERROR : angle delta_0 = 7.9\u00b0 = 0.13788 radian not 0.014 radian as in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.4, Page number 575-578"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the stability of system & critical clearing time\n",
+ "\n",
+ "#Variable declaration\n",
+ "x = 0.25 #Transient reactance(p.u)\n",
+ "E = 1.0 #e.m.f of finite generator behind transient reactance(p.u)\n",
+ "x_T = 0.1 #Reactance of transformer(p.u)\n",
+ "x_L = 0.4 #Reactance of one line(p.u)\n",
+ "P_i = 0.7 #Pre-fault power(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "X_T = x+x_T+(x_L/2) #Transfer reactance at pre-fault state(p.u)\n",
+ "P_m = E**2/X_T #Amplitude of power angle curve at pre-fault state(p.u)\n",
+ "X_T1 = 1.45 #Transfer reactance b/w finite generator & infinite bus at faulty state(p.u).Refer texbook problem for figure\n",
+ "P_m1 = E**2/X_T1 #Amplitude of power angle curve at faulty state(p.u)\n",
+ "r1 = X_T/X_T1\n",
+ "X_T2 = x+x_T+x_L #Transfer reactance for post fault state(p.u)\n",
+ "r2 = X_T/X_T2\n",
+ "P_m2 = r2*P_m\n",
+ "delta_0 = math.asin(P_i/P_m) #Radians\n",
+ "delta_1 = math.asin(P_i/(r2*P_m)) #Radians\n",
+ "delta_m = math.pi - delta_1 #Radians\n",
+ "delta_c = 0.7 #Specified value(radians)\n",
+ "from scipy.integrate import quad\n",
+ "\n",
+ "def integrand1(delta):\n",
+ " return r1*P_m*math.sin(delta)\n",
+ "a, err = quad(integrand1, delta_0, delta_c)\n",
+ "A_acc = P_i*(delta_c-delta_0) - a \n",
+ "\n",
+ "def integrand2(delta):\n",
+ " return r2*P_m*math.sin(delta)\n",
+ "b, err = quad(integrand2, delta_c, delta_m)\n",
+ "A_dec = b - P_i*(delta_m-delta_c)\n",
+ "cos_delta_cr = ((delta_m-delta_0)*math.sin(delta_0)-r1*math.cos(delta_0)+r2*math.cos(delta_m))/(r2-r1)\n",
+ "delta_cr = math.acos(cos_delta_cr)*180/math.pi\n",
+ "\n",
+ "#Result\n",
+ "if(A_acc < A_dec):\n",
+ " print('System is Stable')\n",
+ " stability = A_dec/A_acc\n",
+ " print('Margin of stability , K = %.2f' %stability)\n",
+ "else:\n",
+ " print('System is not stable')\n",
+ "print('Critical clearing angle for a certain pre-fault power = %.2f\u00b0' %delta_cr)\n",
+ "print('Critical clearing time will be known from circuit-breaker specifications')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "System is Stable\n",
+ "Margin of stability , K = 7.98\n",
+ "Critical clearing angle for a certain pre-fault power = 111.48\u00b0\n",
+ "Critical clearing time will be known from circuit-breaker specifications\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.5, Page number 578-580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find critical clearing angle & time for circuit breaker at bus 1\n",
+ "\n",
+ "#Variable declaration\n",
+ "P_i = 0.75 #Pre-fault power(p.u)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "H = 6.0 #Value of H for finite machine(sec)\n",
+ "x_G = 0.2 #Reactance of machine(p.u)\n",
+ "x_T = 0.1 #Reactance of transformer(p.u)\n",
+ "x_L = 0.4 #Reactance of line(p.u)\n",
+ "V = 1.0 #Voltage of infinite bus(p.u)\n",
+ "E = 1.0 #e.m.f of finite generator behind transient reactance(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "X_T = x_G+x_T+(x_L) #Transfer reactance at pre-fault state(p.u)\n",
+ "P_m = E**2/X_T #Amplitude of power angle curve at pre-fault state(p.u)\n",
+ "delta_0 = math.asin(P_i/P_m) #Radians\n",
+ "delta_0a = delta_0*180/math.pi\n",
+ "delta_cr = math.acos((math.pi-2*delta_0)*math.sin(delta_0)-math.cos(delta_0))\n",
+ "delta_cra = delta_cr*180/math.pi\n",
+ "t_cr = ((delta_cra-delta_0a)*2*H/(180*f*P_i))**0.5\n",
+ "\n",
+ "#Result\n",
+ "print('Critical clearing angle for circuit breaker at bus 1 = %.2f\u00b0' %delta_cra)\n",
+ "print('Time for circuit breaker at bus 1 ,t_cr = %.3f sec' %t_cr)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical clearing angle for circuit breaker at bus 1 = 77.42\u00b0\n",
+ "Time for circuit breaker at bus 1 ,t_cr = 0.285 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_2_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_2_2.ipynb
new file mode 100644
index 00000000..1ac5ff1b
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_2_2.ipynb
@@ -0,0 +1,125 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 2: FUNDAMENTAL CONCEPTS OF AC CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1, Page number 26-27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find p.u current,active & reactive power,impedance\n",
+ "\n",
+ "#Variable declaration\n",
+ "MVA_base = 10.0 #Three-phase base MVA\n",
+ "kV_base = 13.8 #Line-line base kV\n",
+ "P = 7.0 #Power delivered(MW)\n",
+ "PF = 0.8 #Power factor lagging\n",
+ "Z = 5.7 #Impedance(ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I_base = (MVA_base) * (10**3)/((3**(0.5)) * kV_base) #Base current(A)\n",
+ "I_actual = P * (10**3)/((3**(0.5)) * kV_base*PF) #Actual current delivered by machine(A)\n",
+ "I_pu = I_actual/I_base #p.u current(p.u)\n",
+ "Z_pu = Z * (MVA_base/( (kV_base)**2 )) #p.u impedance(p.u)\n",
+ "P_act_pu = P/MVA_base #p.u active power(p.u)\n",
+ "x = math.acos(PF)\n",
+ "y = math.sin(x)\n",
+ "P_react = (P * y)/PF #Actual reactive power(MVAR)\n",
+ "P_react_pu = P_react/MVA_base #Actual p.u reactive power(p.u)\n",
+ "\n",
+ "#Result\n",
+ "print('p.u current = %.3f p.u' %I_pu)\n",
+ "print('p.u impedance = %.1f p.u' %Z_pu)\n",
+ "print('p.u active power = %.1f p.u' %P_act_pu)\n",
+ "print('p.u reactive power = %.3f p.u' %P_react_pu)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "p.u current = 0.875 p.u\n",
+ "p.u impedance = 0.3 p.u\n",
+ "p.u active power = 0.7 p.u\n",
+ "p.u reactive power = 0.525 p.u\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2, Page number 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find base & actual impedance on l.v,h.v sides in ohm\n",
+ "\n",
+ "#Variable declaration\n",
+ "MVA_base = 5.0 #Base MVA on both sides\n",
+ "hv_base = 11.0 #Line to line base voltages in kV on h.v side\n",
+ "lv_base = 0.4 #Line to line base voltages in kV on l.v side\n",
+ "Z = 5.0/100 #Impedance of 5%\n",
+ "\n",
+ "#Calculation\n",
+ "Z_base_hv = (hv_base)**2/MVA_base #Base impedance on h.v side(ohm)\n",
+ "Z_base_lv = (lv_base)**2/MVA_base #Base impedance on l.v side(ohm)\n",
+ "Z_act_hv = Z * Z_base_hv #Actual impedance viewed from h.v side(ohm)\n",
+ "Z_act_lv = Z * Z_base_lv #Actual impedance viewed from l.v side(ohm)\n",
+ "\n",
+ "#Result\n",
+ "print('Base impedance on h.v side = %.1f ohm' %Z_base_hv)\n",
+ "print('Base impedance on l.v side = %.3f ohm' %Z_base_lv)\n",
+ "print('Actual impedance viewed from h.v side = %.2f ohm' %Z_act_hv)\n",
+ "print('Actual impedance viewed from l.v side = %.4f ohm' %Z_act_lv)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base impedance on h.v side = 24.2 ohm\n",
+ "Base impedance on l.v side = 0.032 ohm\n",
+ "Actual impedance viewed from h.v side = 1.21 ohm\n",
+ "Actual impedance viewed from l.v side = 0.0016 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_3_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_3_2.ipynb
new file mode 100644
index 00000000..a6c97b20
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_3_2.ipynb
@@ -0,0 +1,101 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 3: GENERAL CONSIDERATIONS OF TRANSMISSION AND DISTRIBUTION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1, Page number 42-43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare size,volume,losses of conductor materials\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 5.0 #Power(MW)\n",
+ "pf = 0.8 #lagging power factor\n",
+ "d = 15.0 #Distance of line(km)\n",
+ "J = 4.0 #Current density(amp per mm^2)\n",
+ "r = 1.78*10**(-8) #Resistivity(ohm-m)\n",
+ "kV_1 = 11.0 #Permissible voltage level(kV)\n",
+ "kV_2 = 22.0 #Permissible voltage level(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "#For 11 kV level\n",
+ "I_1 = (P*10**3)/((3)**(0.5) * (kV_1) * pf) #Load current(A)\n",
+ "area_1 = I_1/J #Cross-sectional area of the phase conductor(mm^2)\n",
+ "volume_1 = 3 * (area_1/10**6) * (d*10**3) #Volume of conductors material(m^3)\n",
+ "R_1 = r * (d*10**3)/(area_1 * (10**-6)) #Resistance per phase(ohm)\n",
+ "PL_1 = 3 * (I_1**2) * (R_1*10**(-3)) #Power loss(kW)\n",
+ "\n",
+ "#For 22 kV level\n",
+ "I_2 = (P*10**3)/((3)**(0.5) * (kV_2) * pf) #Load current(A)\n",
+ "area_2 = I_2/J #Cross-sectional area of the phase conductor(mm^2)\n",
+ "volume_2 = 3 * (area_2/10**6) * (d*10**3) #Volume of conductors material(m^3)\n",
+ "R_2 = r * (d*10**3)/(area_2 * (10**-6)) #Resistance per phase(ohm)\n",
+ "PL_2 = 3 * (I_2**2) * (R_2*10**(-3)) #Power loss(kW)\n",
+ "area_ch = (area_1-area_2)/area_1*100 #Change in area of 22kV level from 11 kV level(%)\n",
+ "vol_ch = (volume_1-volume_2)/volume_1*100 #Change in volume of 22kV level from 11 kV level(%)\n",
+ "loss_ch = (PL_1-PL_2)/PL_1*100 #Change in losses of 22kV level from 11 kV level(%)\n",
+ "\n",
+ "#Result\n",
+ "print('For 11 kV level :')\n",
+ "print('Cross-sectional area of the phase conductor = %d mm^2' %area_1)\n",
+ "print('Volume of conductors material = %.2f m^3' %volume_1)\n",
+ "print('Power loss = %.2f kW' %PL_1)\n",
+ "print('\\nFor 22 kV level :')\n",
+ "print('Cross-sectional area of the phase conductor = %d mm^2' %area_2)\n",
+ "print('Volume of conductors material = %.2f m^3' %volume_2)\n",
+ "print('Power loss = %.2f kW' %PL_2)\n",
+ "print('\\nConductor size has decreased by %.f percent in 22 kV level' %area_ch)\n",
+ "print('Conductor volume has decreased by %.f percent in 22 kV level' %vol_ch)\n",
+ "print('Conductor losses has decreased by %.f percent in 22 kV level' %loss_ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For 11 kV level :\n",
+ "Cross-sectional area of the phase conductor = 82 mm^2\n",
+ "Volume of conductors material = 3.69 m^3\n",
+ "Power loss = 1051.04 kW\n",
+ "\n",
+ "For 22 kV level :\n",
+ "Cross-sectional area of the phase conductor = 41 mm^2\n",
+ "Volume of conductors material = 1.85 m^3\n",
+ "Power loss = 525.52 kW\n",
+ "\n",
+ "Conductor size has decreased by 50 percent in 22 kV level\n",
+ "Conductor volume has decreased by 50 percent in 22 kV level\n",
+ "Conductor losses has decreased by 50 percent in 22 kV level\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_4_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_4_2.ipynb
new file mode 100644
index 00000000..87e5269f
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_4_2.ipynb
@@ -0,0 +1,1022 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 4: ELECTRICAL CHARACTERISTICS, MODELLING AND PERFORMANCE OF AERIAL TRANSMISSION LINES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page number 56-57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find total loop inductance\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 10.0 #Length of 1-phase line(km)\n",
+ "d = 100.0 #Spacing b/w conductors(cm)\n",
+ "r = 0.3 #Radius(cm)\n",
+ "u_r_1 = 1.0 #Relative permeability of copper\n",
+ "u_r_2 = 100.0 #Relative permeability of steel\n",
+ "\n",
+ "#Calculation\n",
+ "#For copper\n",
+ "r_1 = 0.7788*r #Radius of hypothetical conductor(cm)\n",
+ "import math\n",
+ "L_1 = 4 * 10**(-7) * math.log(d/r_1) #Loop inductance(H/m)\n",
+ "L_T1 = L_1 * l * 10**6 #Total loop inductance(mH)\n",
+ "\n",
+ "#For steel\n",
+ "L_2 = 4 * 10**(-7) * (math.log(d/r) + (u_r_2/4))#Loop inductance(H/m)\n",
+ "L_T2 = L_2 * l * 10**6 #Total loop inductance(mH)\n",
+ "\n",
+ "#Result\n",
+ "print('(i) Total loop inductance of copper conductor = %.2f mH' %L_T1)\n",
+ "print('(ii)Total loop inductance of steel conductor = %.2f mH' %L_T2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Total loop inductance of copper conductor = 24.24 mH\n",
+ "(ii)Total loop inductance of steel conductor = 123.24 mH\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page number 57-58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate inductance per km\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 0.4 #Radius of conductor(cm)\n",
+ "h = 1000 #Height of line(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "d = 2*h #Spacing between conductors(cm)\n",
+ "L = 2 * 10**(-4) * math.log(2*h/(0.7788*r)) * 1000 #Inductance of conductor(mH/km)\n",
+ "\n",
+ "#Result\n",
+ "print('Inductance of the conductor = %.3f mH/km' %L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance of the conductor = 1.753 mH/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page number 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find line inductance per phase per km\n",
+ "\n",
+ "#Variable declaration\n",
+ "d_ab = 4 #Distance b/w conductor a & b(m)\n",
+ "d_bc = 9 #Distance b/w conductor b & c(m)\n",
+ "d_ca = 6 #Distance b/w conductor c & a(m)\n",
+ "r = 1.0 #Radius of each conductor(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D_m = (d_ab * d_bc * d_ca)**(1.0/3) #Geometric mean separation(m)\n",
+ "r_1 = 0.7788 * (r/100) #Radius of hypothetical conductor(m)\n",
+ "L = 2 * 10**(-7) * math.log(D_m/r_1) * 10**6 #Line inductance(mH/phase/km)\n",
+ "\n",
+ "#Result\n",
+ "print('Line inductance , L = %.2f mH/phase/km' %L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Line inductance , L = 1.33 mH/phase/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4, Page number 62-63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find loop inductance per km\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 1.0 #Radius of each conductor(cm)\n",
+ "d_11 = 30 #Distance b/w conductor 1 & 1'(cm)\n",
+ "d_22 = 30 #Distance b/w conductor 2 & 2'(cm)\n",
+ "d_12 = 130 #Distance b/w conductor 1 & 2(cm)\n",
+ "d_122 = 160 #Distance b/w conductor 1 & 2'(cm)\n",
+ "d_112 = 100 #Distance b/w conductor 1' & 2(cm)\n",
+ "d_1122 = 130 #Distance b/w conductor 1' & 2'(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r_1 = 0.7788 * r #Radius of hypothetical conductor(cm)\n",
+ "D_s = (d_11 * r_1 * d_22 * r_1)**(1.0/4) #Geometric mean radius(cm)\n",
+ "D_m = (d_12 * d_122 * d_112 * d_1122)**(1.0/4) #Geometric mean separation(cm)\n",
+ "L = 4 * 10**(-7) * math.log(D_m/D_s) * 10**6 #Loop inductance(mH/km)\n",
+ "\n",
+ "#Inductance of single phase system having 2 conductors only\n",
+ "R = 2**0.5 #Radius of single conductor(cm)\n",
+ "d = 130.0 #Conductor position(cm)\n",
+ "L_1 = 4*10**(-7)*math.log(d/(0.7788*R))*10**6 #Loop inductance(mH/km)\n",
+ "L_diff = (L_1 - L)/L*100 #Change in inductance(%)\n",
+ "r_diff = D_s - R #Effective radius difference\n",
+ "\n",
+ "#Result\n",
+ "print('Loop inductance , L = %.3f mH/km' %L)\n",
+ "print('Loop inductance having two conductors only , L = %.3f mH/km' %L_1)\n",
+ "print('There is an Increase of %.f percent in inductance value ' %L_diff)\n",
+ "print('Effective radius of bundled conductors is about %.1f times that of unbundled system reducing field stress almost by that ratio' %r_diff)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loop inductance , L = 1.311 mH/km\n",
+ "Loop inductance having two conductors only , L = 1.908 mH/km\n",
+ "There is an Increase of 46 percent in inductance value \n",
+ "Effective radius of bundled conductors is about 3.4 times that of unbundled system reducing field stress almost by that ratio\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5, Page number 63-64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find inductance/phase/km\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 1.5 #Radius of each conductor(cm)\n",
+ "D_a1a2 = 0.3 #Distance b/w conductor a1 & a2(m)\n",
+ "D_a2a1 = 0.3 #Distance b/w conductor a2 & a1(m)\n",
+ "D_a1b1 = 15.3 #Distance b/w conductor a1 & b1(m)\n",
+ "D_a1b2 = 15.6 #Distance b/w conductor a1 & b2(m)\n",
+ "D_a2b1 = 15.0 #Distance b/w conductor a2 & b1(m)\n",
+ "D_a2b2 = 15.3 #Distance b/w conductor a2 & b2(m)\n",
+ "D_b1c1 = 15.3 #Distance b/w conductor b1 & c1(m)\n",
+ "D_b1c2 = 15.6 #Distance b/w conductor b1 & c2(m)\n",
+ "D_b2c1 = 15.0 #Distance b/w conductor b2 & c1(m)\n",
+ "D_b2c2 = 15.3 #Distance b/w conductor b2 & c2(m)\n",
+ "D_a1c1 = 30.6 #Distance b/w conductor a1 & c1(m)\n",
+ "D_a1c2 = 30.9 #Distance b/w conductor a1 & c2(m)\n",
+ "D_a2c1 = 30.3 #Distance b/w conductor a2 & c1(m)\n",
+ "D_a2c2 = 30.6 #Distance b/w conductor a2 & c2(m)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r_1 = 0.7788 * (r/100) #Radius of hypothetical conductor(m)\n",
+ "D_s = (D_a1a2 * r_1 * D_a2a1 * r_1)**(1.0/4) #Geometric mean radius(m)\n",
+ "D_ab = (D_a1b1 * D_a1b2 * D_a2b1 * D_a2b2)**(1.0/4) #Mutual GMD b/w conductor a & b(m)\n",
+ "D_bc = (D_b1c1 * D_b1c2 * D_b2c1 * D_b2c2)**(1.0/4) #Mutual GMD b/w conductor b & c(m)\n",
+ "D_ca = (D_a1c1 * D_a1c2 * D_a2c1 * D_a2c2)**(1.0/4) #Mutual GMD b/w conductor c & a(m)\n",
+ "D_m = (D_ab * D_bc * D_ca)**(1.0/3) #Geometric mean separation(m)\n",
+ "L = 2 * 10**(-4) * math.log(D_m/D_s) * 1000 #Inductance(mH/km)\n",
+ "\n",
+ "#Result\n",
+ "print('Inductance/phase/km = %.3f mH/km' %L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance/phase/km = 1.157 mH/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7, Page number 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find capacitance & charging current\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 0.6 #Radius of each conductor(cm)\n",
+ "d = 150 #Separation distance(cm)\n",
+ "L = 40*10**3 #Length of overhead line(m)\n",
+ "f = 50 #Frequency(Hertz)\n",
+ "v = 50*10**3 #System voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C_ab = (math.pi * 8.854 * 10**(-12))/(math.log(d/r)) * L #Capacitance b/w conductors(F)\n",
+ "I = complex(0,v * 2 * math.pi * f * C_ab) #Charging current leads voltage by 90\u00b0(A)\n",
+ "\n",
+ "#Result\n",
+ "print('Capacitance between two conductors , C_ab = %.3e F' %C_ab)\n",
+ "print('Charging current , I = j%.3f A' %I.imag)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance between two conductors , C_ab = 2.015e-07 F\n",
+ "Charging current , I = j3.165 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8, Page number 74-75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find capacitance per phase per km\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 0.015 #Radius of each conductor(m)\n",
+ "D_a1a2 = 0.3 #Distance b/w conductor a1 & a2(m)\n",
+ "D_a2a1 = 0.3 #Distance b/w conductor a2 & a1(m)\n",
+ "D_a1b1 = 15.3 #Distance b/w conductor a1 & b1(m)\n",
+ "D_a1b2 = 15.6 #Distance b/w conductor a1 & b2(m)\n",
+ "D_a2b1 = 15.0 #Distance b/w conductor a2 & b1(m)\n",
+ "D_a2b2 = 15.3 #Distance b/w conductor a2 & b2(m)\n",
+ "D_b1c1 = 15.3 #Distance b/w conductor b1 & c1(m)\n",
+ "D_b1c2 = 15.6 #Distance b/w conductor b1 & c2(m)\n",
+ "D_b2c1 = 15.0 #Distance b/w conductor b2 & c1(m)\n",
+ "D_b2c2 = 15.3 #Distance b/w conductor b2 & c2(m)\n",
+ "D_a1c1 = 30.6 #Distance b/w conductor a1 & c1(m)\n",
+ "D_a1c2 = 30.9 #Distance b/w conductor a1 & c2(m)\n",
+ "D_a2c1 = 30.3 #Distance b/w conductor a2 & c1(m)\n",
+ "D_a2c2 = 30.6 #Distance b/w conductor a2 & c2(m)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D_s = (D_a1a2 * r * D_a2a1 * r)**(1.0/4) #Geometric mean radius(m)\n",
+ "D_ab = (D_a1b1 * D_a1b2 * D_a2b1 * D_a2b2)**(1.0/4) #Mutual GMD b/w conductor a & b(m)\n",
+ "D_bc = (D_b1c1 * D_b1c2 * D_b2c1 * D_b2c2)**(1.0/4) #Mutual GMD b/w conductor b & c(m)\n",
+ "D_ca = (D_a1c1 * D_a1c2 * D_a2c1 * D_a2c2)**(1.0/4) #Mutual GMD b/w conductor c & a(m)\n",
+ "D_m = (D_ab * D_bc * D_ca)**(1.0/3) #Geometric mean separation(m)\n",
+ "C_n = 2 * math.pi * 8.854 * 10**(-9) /(math.log(D_m/D_s)) #Capacitance per phase(F/km)\n",
+ "\n",
+ "#Result\n",
+ "print('Capacitance per phase , C_n = %.3e F/km' %C_n)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance per phase , C_n = 9.828e-09 F/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9, Page number 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find capacitance/phase/km\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 0.015 #Radius of each conductor(m)\n",
+ "D_ab = 15 #Horizontal distance b/w conductor a & b(m)\n",
+ "D_bc = 15 #Horizontal distance b/w conductor b & c(m)\n",
+ "D_ac = 30 #Horizontal distance b/w conductor a & c(m)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D_m = (D_ab * D_bc * D_ac)**(1.0/3) #Geometric mean separation(m)\n",
+ "D_s = 2**(1.0/2) * r #Geometric mean radius(m)\n",
+ "C_n = 2 * math.pi * 8.854 * 10**(-9) /(math.log(D_m/D_s)) #Capacitance/phase/km(F/km)\n",
+ "\n",
+ "#Result\n",
+ "print('Capacitance per phase , C_n = %.3e F/km' %C_n)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance per phase , C_n = 8.190e-09 F/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11, Page number 79-80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find line capacitance per km & compare\n",
+ "\n",
+ "#Variable declaration\n",
+ "h = 5 #Height of conductor above ground(m)\n",
+ "d = 1.5 #Conductor spacing(m)\n",
+ "r = 0.006 #Radius of conductor(m)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C_AB = math.pi * 8.854*10**-9/math.log(d/(r*(1+((d*d)/(4*h*h)))**0.5)) #Capacitance with effect of earth(F/km)\n",
+ "C_AB1 = math.pi * 8.854*10**-9/math.log(d/r) #Capacitance ignoring effect of earth(F/km)\n",
+ "ch = (C_AB - C_AB1)/C_AB * 100 #Change in capacitance with effect of earth(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Line capacitance with effect of earth , C_AB = %.3e F/km' %C_AB)\n",
+ "print('Line capacitance ignoring effect of earth , C_AB = %.3e F/km' %C_AB1)\n",
+ "print('With effect of earth slight increase in capacitance = %.1f percent' %ch)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Line capacitance with effect of earth , C_AB = 5.048e-09 F/km\n",
+ "Line capacitance ignoring effect of earth , C_AB = 5.038e-09 F/km\n",
+ "With effect of earth slight increase in capacitance = 0.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.12, Page number 87-88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sending end voltage,current,power factor & transmission loss\n",
+ "\n",
+ "#Variable declaration\n",
+ "R = 0.16 #Resistance(ohm)\n",
+ "L = 1.26*10**(-3) #Inductance(H)\n",
+ "C = 8.77*10**(-9) #Capacitance(F)\n",
+ "l = 200.0 #Length of line(km)\n",
+ "P = 50.0 #Power(MVA)\n",
+ "pf = 0.8 #Lagging power factor\n",
+ "V_r = 132000.0 #Receiving end voltage(V)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "#Step-I\n",
+ "import math\n",
+ "import cmath\n",
+ "w = 2 * math.pi * f\n",
+ "z = complex(R, w*L) #Series impedance per phase per km(ohm)\n",
+ "y = complex(0, w*C) #Shunt admittance per phase per km(mho)\n",
+ "\n",
+ "#Step-II\n",
+ "g = (y*z)**(0.5) #propagation constant(/km)\n",
+ "gl = g * l\n",
+ "Z_c = (z/y)**(0.5) #Surge impedance(ohm)\n",
+ "\n",
+ "#Step-III\n",
+ "cosh_gl = cmath.cosh(gl)\n",
+ "sinh_gl = cmath.sinh(gl)\n",
+ "\n",
+ "#Step-IV\n",
+ "A = cosh_gl\n",
+ "B = Z_c * sinh_gl\n",
+ "C = (sinh_gl/Z_c)\n",
+ "D = cosh_gl\n",
+ "\n",
+ "#Step-V\n",
+ "fi = math.acos(pf) #Power factor angle(radians)\n",
+ "V_R = V_r/(3**0.5) #Receiving end voltage(V)\n",
+ "I_R = (P*10**6/((3**0.5)*V_r))*(pf - complex(0,math.sin(fi)))#Receiving end current(A)\n",
+ "V_S = (A*V_R + B*I_R) #Sending end voltage(V/phase)\n",
+ "V_S_L = V_S * (3**0.5)*10**-3 #Sending end line voltage(kV)\n",
+ "I_S = C*V_R + D*I_R #Sending end current(A)\n",
+ "pf_S = math.cos(cmath.phase(I_S) - cmath.phase(V_S)) #Sending end power factor\n",
+ "P_S = abs(V_S*I_S)*pf_S*10**-6 #Sending end power/phase(MW)\n",
+ "P_R = (P/3)*pf #Receiving end power/phase(MW)\n",
+ "P_L = 3*(P_S - P_R) #Total line loss(MW)\n",
+ "\n",
+ "#Result\n",
+ "print('Sending end voltage , V_S = %.2f\u2220%.2f\u00b0 kV/phase' %(abs(V_S*10**-3),cmath.phase(V_S)*180/math.pi))\n",
+ "print('Sending end line voltage = %.2f kV' %abs(V_S_L))\n",
+ "print('Sending end current , I_S = %.2f\u2220%.2f\u00b0 A' %(abs(I_S),cmath.phase(I_S)*180/math.pi))\n",
+ "print('Sending end power factor = %.2f lagging' %pf_S)\n",
+ "print('Total transmission line loss = %.3f MW' %P_L)\n",
+ "print('\\nNOTE : Changes in answer is due to more decimal places')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sending end voltage , V_S = 90.98\u22206.50\u00b0 kV/phase\n",
+ "Sending end line voltage = 157.58 kV\n",
+ "Sending end current , I_S = 192.08\u2220-26.31\u00b0 A\n",
+ "Sending end power factor = 0.84 lagging\n",
+ "Total transmission line loss = 4.062 MW\n",
+ "\n",
+ "NOTE : Changes in answer is due to more decimal places\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.13, Page number 90-91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find values of equivalent pi network\n",
+ "\n",
+ "#Variable declaration\n",
+ "R = 0.1 #Resistance/phase/km(ohm)\n",
+ "D_m = 800.0 #Spacing b/w conductors(cm)\n",
+ "d = 1.5 #Diameter of each conductor(cm)\n",
+ "l = 300.0 #Length of transmission line(km)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "L = 2*10**(-4)*math.log(D_m*2/d) #Inductance/phase/km(H)\n",
+ "C = 2*math.pi*8.854*10**(-9)/math.log(D_m*2/d) #Capacitance/phase/km(F)\n",
+ "w = 2 * math.pi * f\n",
+ "z = complex(R, w*L) #Series impedance per phase per km(ohm/km)\n",
+ "y = complex(0, w*C) #Shunt admittance per phase per km(mho/km)\n",
+ "g = (y*z)**(0.5) #propagation constant(/km)\n",
+ "gl = g * l\n",
+ "Z_c = (z/y)**(0.5) #Surge impedance(ohm)\n",
+ "sinh_gl = cmath.sinh(gl)\n",
+ "tanh_gl = cmath.tanh(gl/2)\n",
+ "Z_S = Z_c * sinh_gl #Series impedance(ohm)\n",
+ "Y_P = (1/Z_c)*cmath.tanh(gl/2) #Pillar admittance(mho)\n",
+ "\n",
+ "#Result\n",
+ "print('Values of equivalent-pi network are :')\n",
+ "print('Series impedance , Z_S = (%.2f + j%.2f) ohm' %(Z_S.real,Z_S.imag))\n",
+ "print('Pillar admittance , Y_P = %.2e\u2220%.2f\u00b0 mho = j%.2e mho' %(abs(Y_P),(cmath.phase(Y_P)*180/math.pi),Y_P.imag))\n",
+ "print('\\nNOTE : Changes in answer is due to more decimal places')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Values of equivalent-pi network are :\n",
+ "Series impedance , Z_S = (29.02 + j129.38) ohm\n",
+ "Pillar admittance , Y_P = 3.79e-04\u222089.89\u00b0 mho = j3.79e-04 mho\n",
+ "\n",
+ "NOTE : Changes in answer is due to more decimal places\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.14, Page number 101-104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find efficiency,regulation,reactive power at sending end & absorbed by line\n",
+ "\n",
+ "#Variable declaration\n",
+ "V_r = 220000.0 #Voltage(V)\n",
+ "P = 100.0 #Power(MW)\n",
+ "r = 0.08 #Series resistance(ohm)\n",
+ "x = 0.8 #Series reactance(ohm)\n",
+ "s = 6.0*10**(-6) #Shunt susceptance(mho)\n",
+ "pf = 0.8 #Power factor lagging\n",
+ "l_1 = 60.0 #Transmission length(km) for case(i)\n",
+ "l_2 = 200.0 #Transmission length(km) for case(ii)\n",
+ "l_3 = 300.0 #Transmission length(km) for case(iii)\n",
+ "l_4 = 500.0 #Transmission length(km) for case(iv)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "z = complex(r,x) #Series impedance/km(ohm)\n",
+ "y = complex(0,s) #Shunt admittance/km(mho)\n",
+ "theta_R = math.acos(pf)\n",
+ "P_R = P/3 #Active power at receiving end/phase(MW)\n",
+ "Q_R = (P/3)*math.tan(theta_R) #Reactive power at receiving end/phase(MVAR)\n",
+ "V_R = V_r/(3**0.5) #Receiving end voltage/phase(V)\n",
+ "I_R = P*10**6/((3**0.5)*V_r*pf)*(pf - complex(0,math.sin(theta_R)))#Receiving end current(A)\n",
+ "Z_c = (z/y)**(0.5) #Surge impedance(ohm)\n",
+ "\n",
+ "#case(i) - Short length line\n",
+ "A_1 = 1 #Constant A\n",
+ "B_1 = z*l_1 #Constant B(ohm)\n",
+ "C_1 = 0 #Constant C(mho)\n",
+ "D_1 = A_1 #Constant D\n",
+ "V_S_1 = A_1*V_R + B_1*I_R #Sending end voltage(V/phase)\n",
+ "I_S_1 = I_R #Sending end current(A)\n",
+ "theta_S_1 = cmath.phase(I_S_1) - cmath.phase(V_S_1) #Sending end power factor\n",
+ "P_S_1 = abs(V_S_1*I_S_1)*math.cos(theta_S_1)*10**-6 #Sending end power(MW)\n",
+ "n_1 = (P_R/P_S_1)*100 #Transmission efficiency(%)\n",
+ "reg_1 = (abs(V_S_1/A_1) - V_R)/V_R*100 #Regulation(%)\n",
+ "Q_S_1 = V_S_1 * I_S_1.conjugate()*10**-6 #Sending end reactive power(MVAR)\n",
+ "Q_line_1 = Q_S_1.imag - Q_R #Reactive power absorbed by line(MVAR)\n",
+ "\n",
+ "#case(ii) - Medium length line\n",
+ "Z_S_2 = z*l_2\n",
+ "Y_P_2 = y*l_2/2\n",
+ "A_2 = 1 + Y_P_2*Z_S_2\n",
+ "B_2 = Z_S_2\n",
+ "C_2 = Y_P_2*(2 + Y_P_2*Z_S_2)\n",
+ "D_2 = A_2\n",
+ "V_S_2 = A_2*V_R + B_2*I_R #Sending end voltage(V/phase) \n",
+ "I_S_2 = C_2*V_R + D_2*I_R #Sending end current(A)\n",
+ "S_S_2 = V_S_2*I_S_2.conjugate()*10**-6 #Sending end complex power(MVA)\n",
+ "P_S_2 = S_S_2.real #Power at sending end(MW)\n",
+ "n_2 = (P_R/P_S_2)*100 #Transmission efficiency(%)\n",
+ "reg_2 = (abs(V_S_2/A_2) - V_R)/V_R*100 #Regulation(%)\n",
+ "Q_line_2 = S_S_2.imag - Q_R #Reactive power absorbed by line(MVAR)\n",
+ "\n",
+ "#case(iii) - Long length line\n",
+ "g_3 = (y*z)**(0.5) #propagation constant(/km)\n",
+ "gl_3 = g_3 * l_3\n",
+ "cosh_gl_3 = cmath.cosh(gl_3)\n",
+ "sinh_gl_3 = cmath.sinh(gl_3)\n",
+ "A_3 = cosh_gl_3\n",
+ "B_3 = Z_c * sinh_gl_3\n",
+ "C_3 = sinh_gl_3/Z_c\n",
+ "D_3 = cosh_gl_3\n",
+ "V_S_3 = A_3*V_R + B_3*I_R #Sending end voltage(V/phase) \n",
+ "I_S_3 = C_3*V_R + D_3*I_R #Sending end current(A)\n",
+ "S_S_3 = V_S_3*I_S_3.conjugate()*10**-6 #Sending end complex power(MVA)\n",
+ "P_S_3 = S_S_3.real #Power at sending end(MW)\n",
+ "n_3 = (P_R/P_S_3)*100 #Transmission efficiency(%)\n",
+ "reg_3 = (abs(V_S_3/A_3) - V_R)/V_R*100 #Regulation(%)\n",
+ "Q_line_3 = S_S_3.imag - Q_R #Reactive power absorbed by line(MVAR)\n",
+ "\n",
+ "#case(iv) - Long length line\n",
+ "g_4 = (y*z)**(0.5) #propagation constant(/km)\n",
+ "gl_4 = g_4 * l_4\n",
+ "cosh_gl_4 = cmath.cosh(gl_4)\n",
+ "sinh_gl_4 = cmath.sinh(gl_4)\n",
+ "A_4 = cosh_gl_4\n",
+ "B_4 = Z_c * sinh_gl_4\n",
+ "C_4 = sinh_gl_4/Z_c\n",
+ "D_4 = cosh_gl_4\n",
+ "V_S_4 = A_4*V_R + B_4*I_R #Sending end voltage(V/phase) \n",
+ "I_S_4 = C_4*V_R + D_4*I_R #Sending end current(A)\n",
+ "S_S_4 = V_S_4*I_S_4.conjugate()*10**-6 #Sending end complex power(MVA)\n",
+ "P_S_4 = S_S_4.real #Power at sending end(MW)\n",
+ "n_4 = (P_R/P_S_4)*100 #Transmission efficiency(%)\n",
+ "reg_4 = (abs(V_S_4/A_4) - V_R)/V_R*100 #Regulation(%)\n",
+ "Q_line_4 = S_S_4.imag - Q_R #Reactive power absorbed by line(MVAR)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) : For Length = 60 km')\n",
+ "print('Efficiency , n = %.2f percent' %n_1)\n",
+ "print('Regulation = %.3f percent' %reg_1)\n",
+ "print('Reactive power at sending end , Q_S = %.2f MVAR' %Q_S_1.imag)\n",
+ "print('Reactive power absorbed by line , Q_line = %.2f MVAR' %Q_line_1)\n",
+ "print('\\nCase(ii) : For Length = 200 km')\n",
+ "print('Efficiency , n = %.2f percent' %n_2)\n",
+ "print('Regulation = %.2f percent' %reg_2)\n",
+ "print('Reactive power at sending end , Q_S = %.2f MVAR' %S_S_2.imag)\n",
+ "print('Reactive power absorbed by line , Q_line = %.2f MVAR' %Q_line_2)\n",
+ "print('\\nCase(iii) : For Length = 300 km')\n",
+ "print('Efficiency , n = %.2f percent' %n_3)\n",
+ "print('Regulation = %.2f percent' %reg_3)\n",
+ "print('Reactive power at sending end , Q_S = %.2f MVAR' %S_S_3.imag)\n",
+ "print('Reactive power absorbed by line , Q_line = %.2f MVAR' %Q_line_3)\n",
+ "print('\\nCase(iv) : For Length = 500 km')\n",
+ "print('Efficiency , n = %.2f percent' %n_4)\n",
+ "print('Regulation = %.2f percent' %reg_4)\n",
+ "print('Reactive power at sending end , Q_S = %.2f MVAR' %S_S_4.imag)\n",
+ "print('Reactive power absorbed by line , Q_line = %.2f MVAR' %Q_line_4)\n",
+ "print('\\nNOTE : ERROR : Calculation mistake in case(iv) efficiency in textbook')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) : For Length = 60 km\n",
+ "Efficiency , n = 98.47 percent\n",
+ "Regulation = 8.817 percent\n",
+ "Reactive power at sending end , Q_S = 30.17 MVAR\n",
+ "Reactive power absorbed by line , Q_line = 5.17 MVAR\n",
+ "\n",
+ "Case(ii) : For Length = 200 km\n",
+ "Efficiency , n = 96.15 percent\n",
+ "Regulation = 35.64 percent\n",
+ "Reactive power at sending end , Q_S = 14.11 MVAR\n",
+ "Reactive power absorbed by line , Q_line = -10.89 MVAR\n",
+ "\n",
+ "Case(iii) : For Length = 300 km\n",
+ "Efficiency , n = 95.14 percent\n",
+ "Regulation = 59.48 percent\n",
+ "Reactive power at sending end , Q_S = 2.70 MVAR\n",
+ "Reactive power absorbed by line , Q_line = -22.30 MVAR\n",
+ "\n",
+ "Case(iv) : For Length = 500 km\n",
+ "Efficiency , n = 92.85 percent\n",
+ "Regulation = 165.71 percent\n",
+ "Reactive power at sending end , Q_S = -19.25 MVAR\n",
+ "Reactive power absorbed by line , Q_line = -44.25 MVAR\n",
+ "\n",
+ "NOTE : ERROR : Calculation mistake in case(iv) efficiency in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.16, Page number 109-111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find reactive VARs\n",
+ "\n",
+ "#Variable declaration\n",
+ "import math\n",
+ "import cmath\n",
+ "A = 0.8*cmath.exp(1j*1.4*math.pi/180) #Line constant\n",
+ "B = 326.0*cmath.exp(1j*84.8*math.pi/180) #Line constant(ohm)\n",
+ "V_R = 220.0 #Receiving end voltage(kV)\n",
+ "V_S = 220.0 #Sending end voltage(kV)\n",
+ "P = 75.0 #Power(MVA) for case(a)\n",
+ "pf = 0.8 #Power factor lagging\n",
+ "\n",
+ "#Calculation\n",
+ "a = cmath.phase(A) #Phase angle of A(radian)\n",
+ "b = cmath.phase(B) #Phase angle of B(radian)\n",
+ "\n",
+ "#Case(a)\n",
+ "P_R = P * pf #Active power demanded by load(MW)\n",
+ "P_React = P *(1-pf**2)**0.5 #Reactive power demanded by load(MVAR)\n",
+ "cos_b_delta_1 = P_R*abs(B)/(V_R*V_S) + abs(A)*math.cos(b-a) #cos(b-delta)[in radians]\n",
+ "delta_1 = b - math.acos(cos_b_delta_1) #delta(radians)\n",
+ "Q_R_1 = (V_R*V_S/abs(B))*math.sin(b-delta_1) - (abs(A)*V_R**2/abs(B))*math.sin(b-a) #Reactive power at sending end(MVAR)\n",
+ "Reactive_power_1 = P_React - Q_R_1 #Reactive power to be supplied by compensating equipment(MVAR)\n",
+ "\n",
+ "#Case(b)\n",
+ "cos_b_delta_2 = (abs(A)*V_R/V_S)*math.cos(b-a) #cos(b-delta)[in radians]\n",
+ "delta_2 = b - math.acos(cos_b_delta_2) #delta(radians)\n",
+ "Q_R_2 = (V_R*V_S/abs(B))*math.sin(b-delta_2) - (abs(A)*V_R**2/abs(B))*math.sin(b-a) #Reactive power at sending end(MVAR)\n",
+ "Reactive_power_2 = Q_R_2 #Reactive power to be absorbed by compensating equipment(MVAR)\n",
+ "\n",
+ "#Result\n",
+ "print('(a) Reactive VARs to be supplied by compensating equipment = %.2f MVAR' %Reactive_power_1)\n",
+ "print('(b) Reactive VARs to be absorbed by compensating equipment = %.2f MVAR' %Reactive_power_2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Reactive VARs to be supplied by compensating equipment = 34.08 MVAR\n",
+ "(b) Reactive VARs to be absorbed by compensating equipment = 29.85 MVAR\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.17, Page number 111-112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find rating of device & power factor\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 25.0 #Resistance/phase(ohm)\n",
+ "x = 90.0 #Reactance/phase(ohm)\n",
+ "V_S = 145.0 #Sending end voltage(kV)\n",
+ "V_R = 132.0 #Receiving end voltage(kV)\n",
+ "P_R_1 = 0 #Power(MW)\n",
+ "P_R_2 = 50.0 #Power(MW)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "A = 1.0*cmath.exp(1j*0*math.pi/180) #Line constant\n",
+ "B = complex(r,x) #Line constant(ohm)\n",
+ "a = cmath.phase(A) #Phase angle of A(radian)\n",
+ "b = cmath.phase(B) #Phase angle of B(radian)\n",
+ "\n",
+ "#No load condition\n",
+ "cos_b_delta_1 = (V_R/V_S)*math.cos(b-a)\n",
+ "delta_1 = b - math.acos(cos_b_delta_1)\n",
+ "Q_R_1 = (V_R*V_S/abs(B))*math.sin(b-delta_1) - (abs(A)*V_R**2/abs(B))*math.sin(b-a)\n",
+ "\n",
+ "#For 50 MW loading\n",
+ "cos_b_delta_2 = (P_R_2*abs(B)/(V_R*V_S))+(abs(A)*V_R/V_S)*math.cos(b-a)\n",
+ "delta_2 = (b - math.acos(cos_b_delta_2))\n",
+ "Q_R_2 = (V_R*V_S/abs(B))*math.sin(b-delta_2)-(abs(A)*V_R**2/abs(B))*math.sin(b-a) #Reactive power available at receiving end(MVAR)\n",
+ "Q_S_2 = Q_R_1 + Q_R_2 #Reactive power to be supplied by equipment(MVAR)\n",
+ "pf = math.cos(math.atan(Q_S_2/P_R_2)) #Power factor\n",
+ "\n",
+ "#Result\n",
+ "print('Rating of device = %.2f MVAR' %Q_R_1)\n",
+ "print('Power factor = %.2f lagging' %pf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rating of device = 19.00 MVAR\n",
+ "Power factor = 0.94 lagging\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.18, Page number 112-114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find rating,power angle,maximum power,reactive power & efficiency\n",
+ "\n",
+ "#Variable declaration\n",
+ "import math\n",
+ "import cmath\n",
+ "A = 0.9*cmath.exp(1j*1.0*math.pi/180) #Line constant\n",
+ "B = 143.0*cmath.exp(1j*84.5*math.pi/180) #Line constant(ohm)\n",
+ "V_R = 220.0 #Receiving end voltage(kV)\n",
+ "V_S = 240.0 #Sending end voltage(kV)\n",
+ "P = 100.0 #Power(MVA)\n",
+ "pf = 0.8 #Power factor lagging\n",
+ "\n",
+ "#Calculation\n",
+ "a = cmath.phase(A) #Phase angle of A(radian)\n",
+ "b = cmath.phase(B) #Phase angle of B(radian)\n",
+ "\n",
+ "#Case(a)\n",
+ "P_R = P * pf #Active power at receiving end(MW)\n",
+ "cos_b_delta = (P_R*abs(B)/(V_R*V_S))+(abs(A)*V_R/V_S)*math.cos(b-a) #cos(b-delta)[in radians]\n",
+ "delta_1 = (b - math.acos(cos_b_delta))\n",
+ "Q_R = (V_R*V_S/abs(B))*math.sin(b-delta_1)-(abs(A)*V_R**2/abs(B))*math.sin(b-a) #Reactive power at receiving end(MVAR)\n",
+ "P_Re = P *(1-pf**2)**0.5 #Reactive power(MVAR)\n",
+ "rating = P_Re - Q_R #Rating of phase modifier(MVAR)\n",
+ "\n",
+ "#Case(b)\n",
+ "delta_2 = b #Maximum power is received when delta = b\n",
+ "P_Rmax = (V_R*V_S/abs(B))-(abs(A)*V_R**2/abs(B))*math.cos(b-a) #Maximum power at receiving end(MW)\n",
+ "Q_R = -(abs(A/B)*V_R**2)*math.sin(b-a) #Reactive power at receive end(MVAR)\n",
+ "P_S = (V_S**2*abs(A/B))*math.cos(b-a)-(V_S*V_R/abs(B))*math.cos(b+delta_2) #Sending end power(MW)\n",
+ "n_line = (P_Rmax/P_S)*100 #Line efficiency(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a) :')\n",
+ "print('Rating of phase modifier = %.3f MVAR' %rating)\n",
+ "print('Power angle , delta = %.2f\u00b0' %(delta_1*180/math.pi))\n",
+ "print('\\nCase(b) :')\n",
+ "print('Maximum power at receive end , P_Rmax = %.2f MW' %P_Rmax)\n",
+ "print('Reactive power available , Q_R = %.2f MVAR' %Q_R)\n",
+ "print('Line efficiency = %.2f percent' %n_line)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) :\n",
+ "Rating of phase modifier = 11.623 MVAR\n",
+ "Power angle , delta = 12.56\u00b0\n",
+ "\n",
+ "Case(b) :\n",
+ "Maximum power at receive end , P_Rmax = 334.75 MW\n",
+ "Reactive power available , Q_R = -302.66 MVAR\n",
+ "Line efficiency = 82.96 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.19, Page number 114-115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find active power,reactive power & efficiency\n",
+ "\n",
+ "#Variable declaration\n",
+ "import math\n",
+ "import cmath\n",
+ "A = 0.96*cmath.exp(1j*1.0*math.pi/180) #Line constant\n",
+ "B = 100.0*cmath.exp(1j*83.0*math.pi/180) #Line constant(ohm)\n",
+ "V_R = 110.0 #Receiving end voltage(kV)\n",
+ "V_S = 110.0 #Sending end voltage(kV)\n",
+ "pf = 0.8 #Power factor lagging\n",
+ "delta = 15*math.pi/180 #Power angle(radians)\n",
+ "\n",
+ "#Calculation\n",
+ "a = cmath.phase(A) #Phase angle of A(radian)\n",
+ "b = cmath.phase(B) #Phase angle of B(radian)\n",
+ "\n",
+ "#Case(i)\n",
+ "P_R = (V_R*V_S/abs(B))*math.cos(b-delta) - (abs(A/B)*V_R**2)*math.cos(b-a) #Active power at receiving end(MW)\n",
+ "Q_RL = P_R*math.tan(math.acos(pf)) #Reactive power demanded by load(MVAR)\n",
+ "\n",
+ "#Case(ii)\n",
+ "Q_R = (V_R*V_S/abs(B))*math.sin(b-delta) - (abs(A/B)*V_R**2)*math.sin(b-a) #Reactive power(MVAR)\n",
+ "rating = Q_RL - Q_R #Rating of device(MVAR)\n",
+ "\n",
+ "#Case(iii)\n",
+ "P_S = (V_S**2*abs(A/B))*math.cos(b-a) - (V_R*V_S/abs(B))*math.cos(b+delta) #Sending end active power(MW)\n",
+ "n_line = (P_R/P_S)*100 #Efficiency of line(%)\n",
+ "\n",
+ "#Case(iv)\n",
+ "Q_S = (V_S**2*abs(A/B))*math.sin(b-a) - (V_R*V_S/abs(B))*math.sin(b+delta) #Sending end reactive power(MVAR)\n",
+ "\n",
+ "#Result\n",
+ "print('(i) Active power demanded by load , P_R = %.2f MW' %P_R)\n",
+ "print(' Reactive power demanded by load , Q_RL = %.2f MVAR' %Q_RL)\n",
+ "print('(ii) Rating of the device , Q_R = %.2f MVAR' %rating)\n",
+ "print('(iii)Efficiency of line = %.2f percent' %n_line)\n",
+ "print('(iv) Reactive power supplied by source and line , Q_S = %.2f MVAR' %Q_S)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Active power demanded by load , P_R = 29.16 MW\n",
+ " Reactive power demanded by load , Q_RL = 21.87 MVAR\n",
+ "(ii) Rating of the device , Q_R = 24.71 MVAR\n",
+ "(iii)Efficiency of line = 88.35 percent\n",
+ "(iv) Reactive power supplied by source and line , Q_S = -4.79 MVAR\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_5_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_5_2.ipynb
new file mode 100644
index 00000000..52614bb8
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_5_2.ipynb
@@ -0,0 +1,676 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 5: OVERHEAD LINE CONSTRUCTION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, Page number 136-138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sag\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 250.0 #Span(m)\n",
+ "d = 1.1*10**-2 #Conductor diameter(m)\n",
+ "w = 0.650*9.81 #Conductor weight(N/m)\n",
+ "bl = 7000.0 #Breaking load(kg)\n",
+ "sf = 2 #Safety factor\n",
+ "P_w_2 = 350.0 #Wind pressure(N/m^2) for case(ii)\n",
+ "P_w_3 = 400.0 #Wind pressure(N/m^2) for case(iii)\n",
+ "t_3 = 10.0**-2 #Thickness of ice covering(m) for case(iii)\n",
+ "w_ice = 915.0 #Ice weight(kg/m^3)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "T_0 = (bl/sf)*9.81 #Allowable tension(N)\n",
+ "\n",
+ "#Case(i)\n",
+ "S_1 = (T_0/w)*(math.cosh(w*L/(2*T_0))-1) #Sag(m)\n",
+ "S_1_1 = (w*L**2)/(8*T_0) #Sag using parabolic equation(m)\n",
+ "\n",
+ "#Case(ii)\n",
+ "F_w_2 = P_w_2 * d #Wind force(N/m)\n",
+ "w_t_2 = (w**2 + F_w_2**2)**0.5 #Total force on conductor(N/m)\n",
+ "S_2 = (T_0/w_t_2)*(math.cosh(w_t_2*L/(2*T_0))-1) #Sag(m)\n",
+ "S_2_2 = w_t_2*L**2/(8*T_0) #Sag using parabolic equation(m)\n",
+ "alpha_2 = math.atan(F_w_2/w) #w_t inclined vertical angle(radians)\n",
+ "S_v_2 = S_2 * math.cos(alpha_2) #Vertical component of sag(m)\n",
+ "\n",
+ "#Case(iii)\n",
+ "D_3 = d + 2*t_3 #Diameter of conductor with ice(m)\n",
+ "F_w_3 = P_w_3 * D_3 #Wind force(N/m)\n",
+ "w_ice_3 = (math.pi/4)*(D_3**2 - d**2)*w_ice*9.81 #Weight of ice(N/m)\n",
+ "w_t_3 = ((w+w_ice_3)**2 + F_w_3**2)**0.5 #Total force on conductor(N/m)\n",
+ "S_3 = (T_0/w_t_3)*(math.cosh(w_t_3*L/(2*T_0))-1) #Sag(m)\n",
+ "S_3_3 = w_t_3*L**2/(8*T_0) #Sag using parabolic equation(m)\n",
+ "alpha_3 = math.atan(F_w_3/(w+w_ice_3)) #w_t inclined vertical angle(radians)\n",
+ "S_v_3 = S_3 * math.cos(alpha_3) #Vertical component of sag(m)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) :')\n",
+ "print('Sag using catenary equation = %.4f m ' %S_1)\n",
+ "print('Sag using parabolic equation = %.4f m \\n' %S_1_1)\n",
+ "print('Case(ii) :')\n",
+ "print('Sag using catenary equation = %.4f m ' %S_2)\n",
+ "print('Sag using parabolic equation = %.4f m ' %S_2_2)\n",
+ "print('Vertical component of sag = %.2f m \\n' %S_v_2)\n",
+ "print('Case(iii) :')\n",
+ "print('Sag using catenary equation = %.4f m ' %S_3)\n",
+ "print('Sag using parabolic equation = %.4f m ' %S_3_3)\n",
+ "print('Vertical component of sag = %.3f m \\n' %S_v_3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) :\n",
+ "Sag using catenary equation = 1.4510 m \n",
+ "Sag using parabolic equation = 1.4509 m \n",
+ "\n",
+ "Case(ii) :\n",
+ "Sag using catenary equation = 1.6949 m \n",
+ "Sag using parabolic equation = 1.6948 m \n",
+ "Vertical component of sag = 1.45 m \n",
+ "\n",
+ "Case(iii) :\n",
+ "Sag using catenary equation = 3.9752 m \n",
+ "Sag using parabolic equation = 3.9738 m \n",
+ "Vertical component of sag = 2.799 m \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, Page number 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find sag & height of lowest cross arm\n",
+ "\n",
+ "#Variable declaration\n",
+ "w = 0.85 #Weight of overhead line(kg/m)\n",
+ "T_0 = 3.5*10**4 #Maximum allowable tension(N)\n",
+ "L_1 = 160.0 #Span(m) for case(i)\n",
+ "L_2 = 200.0 #Span(m) for case(ii)\n",
+ "L_3 = 250.0 #Span(m) for case(iii)\n",
+ "L_4 = 275.0 #Span(m) for case(iv)\n",
+ "g_c = 7.1 #Minimum ground clearance(m)\n",
+ "L_S = 1.5 #Length of suspension insulator string\n",
+ "\n",
+ "#Calculation\n",
+ "w1 = w * 9.81 #Weight(N/m)\n",
+ "\n",
+ "#Case(i)\n",
+ "S_1 = w1*L_1**2/(8*T_0) #Sag(m)\n",
+ "H_1 = g_c + S_1 + L_S #Height of lowest cross-arm(m)\n",
+ "\n",
+ "#Case(ii)\n",
+ "S_2 = w1*L_2**2/(8*T_0) #Sag(m)\n",
+ "H_2 = g_c + S_2 + L_S #Height of lowest cross-arm(m)\n",
+ "\n",
+ "#Case(iii)\n",
+ "S_3 = w1*L_3**2/(8*T_0) #Sag(m)\n",
+ "H_3 = g_c + S_3 + L_S #Height of lowest cross-arm(m)\n",
+ "\n",
+ "#Case(iv)\n",
+ "S_4 = w1*L_4**2/(8*T_0) #Sag(m)\n",
+ "H_4 = g_c + S_4 + L_S #Height of lowest cross-arm(m)\n",
+ "\n",
+ "#Result\n",
+ "print('Span in meters\\t %d\\t %d\\t %d\\t %d' %(L_1,L_2,L_3,L_4))\n",
+ "print('Sag in meters\\t %.3f\\t %.3f\\t %.3f\\t %.3f' %(S_1,S_2,S_3,S_4))\n",
+ "print('Height of lowest cross-arm in meters\\t %.3f\\t %.3f\\t %.3f\\t %.3f' %(H_1,H_2,H_3,H_4))\n",
+ "print('\\nNOTE : ERROR : For finding height of lowest cross arm the length of insulation string is not considered in textbook calculation')\n",
+ "print('although it is mentioned in formula. Since length of insulation string is taken here there is a difference in answers from that of given in textbook')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Span in meters\t 160\t 200\t 250\t 275\n",
+ "Sag in meters\t 0.762\t 1.191\t 1.861\t 2.252\n",
+ "Height of lowest cross-arm in meters\t 9.362\t 9.791\t 10.461\t 10.852\n",
+ "\n",
+ "NOTE : ERROR : For finding height of lowest cross arm the length of insulation string is not considered in textbook calculation\n",
+ "although it is mentioned in formula. Since length of insulation string is taken here there is a difference in answers from that of given in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page number 138-139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find minimum clearance & sag\n",
+ "\n",
+ "#Variable declaration\n",
+ "w = 0.63 #Weight of conductor(kg/m)\n",
+ "T_0 = 1350.0 #Maximum allowable load(kg)\n",
+ "h_1 = 20.0 #Height of first tower(m)\n",
+ "h_2 = 15.0 #Height of second tower(m)\n",
+ "L = 240.0 #Span(m)\n",
+ "\n",
+ "#Calculation\n",
+ "h = h_1 - h_2 #Difference in levels of towers(m)\n",
+ "L_1 = (L/2)+(T_0*h/(w*L)) #Horizontal distance from higher support(m)\n",
+ "L_2 = (L/2)-(T_0*h/(w*L)) #Horizontal distance from lower support(m)\n",
+ "S_1 = w*L_1**2/(2*T_0) #Sag from upper support(m)\n",
+ "S_2 = w*L_2**2/(2*T_0) #Sag from lower support(m)\n",
+ "clearance = (h_1 - S_1) #Minimum clearance(m)\n",
+ "\n",
+ "#Result\n",
+ "print('Minimum clearance between a line conductor & water surface = %.3f m' %clearance)\n",
+ "print('Sag from upper support = %.3f m' %S_1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum clearance between a line conductor & water surface = 13.675 m\n",
+ "Sag from upper support = 6.325 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5, Page number 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find voltage across each disc & string efficiency\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 3 #Number of discs\n",
+ "m = 0.1 #capacitance of each link pin to self capacitance\n",
+ "V = 33.0 #Voltage(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "#Case(i)\n",
+ "a_1 = 1\n",
+ "a_2 = (1 + m)*a_1\n",
+ "a_3 = m*(a_1 + a_2) + a_2\n",
+ "v_1 = V/(a_1 + a_2 + a_3) #Voltage across top unit(kV)\n",
+ "v_2 = a_2 * v_1 #Voltage across middle unit(kV)\n",
+ "v_3 = a_3 * v_1 #Voltage across bottom unit(kV)\n",
+ "s_v_1 = (v_1/V)*100 #Voltage across top unit to string voltage(%)\n",
+ "s_v_2 = (v_2/V)*100 #Voltage across middle unit to string voltage(%)\n",
+ "s_v_3 = (v_3/V)*100 #Voltage across bottom unit to string voltage(%)\n",
+ "\n",
+ "#Case(ii)\n",
+ "efficiency = V*100/(3*v_3) #String efficiency(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) :')\n",
+ "print('Voltage across top unit , v_1 = %.3f kV' %v_1)\n",
+ "print('Voltage across middle unit , v_2 = %.3f kV' %v_2)\n",
+ "print('Voltage across bottom unit , v_3 = %.3f kV' %v_3)\n",
+ "print('Voltage across top unit as a percentage of string voltage , v_1/V = %.1f percent' %s_v_1)\n",
+ "print('Voltage across middle unit as a percentage of string voltage , v_2/V = %.1f percent' %s_v_2)\n",
+ "print('Voltage across bottom unit as a percentage of string voltage , v_3/V = %.1f percent' %s_v_3)\n",
+ "print('\\nCase(ii) :')\n",
+ "print('String efficiency = %.2f percent' %efficiency)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) :\n",
+ "Voltage across top unit , v_1 = 9.677 kV\n",
+ "Voltage across middle unit , v_2 = 10.645 kV\n",
+ "Voltage across bottom unit , v_3 = 12.677 kV\n",
+ "Voltage across top unit as a percentage of string voltage , v_1/V = 29.3 percent\n",
+ "Voltage across middle unit as a percentage of string voltage , v_2/V = 32.3 percent\n",
+ "Voltage across bottom unit as a percentage of string voltage , v_3/V = 38.4 percent\n",
+ "\n",
+ "Case(ii) :\n",
+ "String efficiency = 86.77 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6, Page number 160-161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find voltage across each disc & system voltage\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 8 #Number of discs\n",
+ "m = 1.0/6 #capacitance of each link pin to self capacitance\n",
+ "V = 30.0 #Voltage(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "#Case(i)\n",
+ "a_1 = 1\n",
+ "a_2 = (1+m)*a_1\n",
+ "a_3 = m*(a_1+a_2)+a_2\n",
+ "a_4 = m*(a_1+a_2+a_3)+a_3\n",
+ "a_5 = m*(a_1+a_2+a_3+a_4)+a_4\n",
+ "a_6 = m*(a_1+a_2+a_3+a_4+a_5)+a_5\n",
+ "a_7 = m*(a_1+a_2+a_3+a_4+a_5+a_6)+a_6\n",
+ "a_8 = m*(a_1+a_2+a_3+a_4+a_5+a_6+a_7)+a_7\n",
+ "v_1 = V/(a_1+a_2+a_3+a_4+a_5+a_6+a_7+a_8) #Voltage across unit 1(kV)\n",
+ "v_2 = a_2*v_1 #Voltage across unit 2(kV)\n",
+ "v_3 = a_3*v_1 #Voltage across unit 3(kV)\n",
+ "v_4 = a_4*v_1 #Voltage across unit 4(kV)\n",
+ "v_5 = a_5*v_1 #Voltage across unit 5(kV)\n",
+ "v_6 = a_6*v_1 #Voltage across unit 6(kV)\n",
+ "v_7 = a_7*v_1 #Voltage across unit 7(kV)\n",
+ "v_8 = a_8*v_1 #Voltage across unit 8(kV)\n",
+ "s_v_1 = v_1/V*100 #Voltage across unit 1 as a % of V\n",
+ "s_v_2 = v_2/V*100 #Voltage across unit 2 as a % of V\n",
+ "s_v_3 = v_3/V*100 #Voltage across unit 3 as a % of V\n",
+ "s_v_4 = v_4/V*100 #Voltage across unit 4 as a % of V\n",
+ "s_v_5 = v_5/V*100 #Voltage across unit 5 as a % of V\n",
+ "s_v_6 = v_6/V*100 #Voltage across unit 6 as a % of V\n",
+ "s_v_7 = v_7/V*100 #Voltage across unit 7 as a % of V\n",
+ "s_v_8 = v_8/V*100 #Voltage across unit 8 as a % of V\n",
+ "\n",
+ "#Case(ii)\n",
+ "V_2 = V*100/s_v_8\n",
+ "V_sys = (3**0.5)*V_2 #Permissible system voltage(kV)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) :')\n",
+ "print('____________________________________________________________________________________________')\n",
+ "print('Unit number 1 2 3 4 5 6 7 8\\n')\n",
+ "print('Percentage of conductor voltage %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f' %(s_v_1,s_v_2,s_v_3,s_v_4,s_v_5,s_v_6,s_v_7,s_v_8))\n",
+ "print('____________________________________________________________________________________________')\n",
+ "print('\\nCase(ii) :')\n",
+ "print('System voltage at which this string can be used = %.2f kV' %V_sys)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) :\n",
+ "____________________________________________________________________________________________\n",
+ "Unit number 1 2 3 4 5 6 7 8\n",
+ "\n",
+ "Percentage of conductor voltage 3.26 3.80 4.98 6.98 10.15 15.01 22.37 33.46\n",
+ "____________________________________________________________________________________________\n",
+ "\n",
+ "Case(ii) :\n",
+ "System voltage at which this string can be used = 155.29 kV\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7, Page number 161-162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find string efficiency & safety factor\n",
+ "\n",
+ "#Variable declaration\n",
+ "v_dry = 65.0 #Dry power frequency flashover voltage for each disc(kV)\n",
+ "v_wet = 43.0 #Wet power frequency flashover voltage for each disc(kV)\n",
+ "V = 110 #Voltage of system to be insulated(kV)\n",
+ "m = 1.0/6 #capacitance of each link pin to self capacitance\n",
+ "n_4 = 4 #Number of units in a string\n",
+ "n_8 = 8 #Number of units in a string\n",
+ "n_10 = 10 #Number of units in a string\n",
+ "v_dry_4 = 210.0 #Dry power frequency flashover voltage for 4 units(kV)\n",
+ "v_dry_8 = 385.0 #Dry power frequency flashover voltage for 8 units(kV)\n",
+ "v_dry_10 = 460.0 #Dry power frequency flashover voltage for 10 units(kV)\n",
+ "v_wet_4 = 150.0 #Wet power frequency flashover voltage for 4 units(kV)\n",
+ "v_wet_8 = 285.0 #Wet power frequency flashover voltage for 8 units(kV)\n",
+ "v_wet_10 = 345.0 #Wet power frequency flashover voltage for 10 units(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "#For case(i)\n",
+ "eff_dry_4 = v_dry_4*100/(n_4*v_dry)\n",
+ "eff_dry_8 = v_dry_8*100/(n_8*v_dry)\n",
+ "eff_dry_10 = v_dry_10*100/(n_10*v_dry)\n",
+ "eff_wet_4 = v_wet_4*100/(n_4*v_wet)\n",
+ "eff_wet_8 = v_wet_8*100/(n_8*v_wet)\n",
+ "eff_wet_10 = v_wet_10*100/(n_10*v_wet)\n",
+ "\n",
+ "#For case(ii)\n",
+ "a_1 = 1\n",
+ "a_2 = (1+m)*a_1\n",
+ "a_3 = m*(a_1+a_2)+a_2\n",
+ "a_4 = m*(a_1+a_2+a_3)+a_3\n",
+ "a_5 = m*(a_1+a_2+a_3+a_4)+a_4\n",
+ "a_6 = m*(a_1+a_2+a_3+a_4+a_5)+a_5\n",
+ "a_7 = m*(a_1+a_2+a_3+a_4+a_5+a_6)+a_6\n",
+ "a_8 = m*(a_1+a_2+a_3+a_4+a_5+a_6+a_7)+a_7\n",
+ "v_1 = V/(a_1+a_2+a_3+a_4+a_5+a_6+a_7+a_8) #Voltage across unit 1(kV)\n",
+ "v_8 = a_8*v_1 #Voltage across unit 8(kV)\n",
+ "s_v_8 = v_8/V #Ratio of Voltage across unit 8 to string voltage\n",
+ "voltage_2 = V/(3**0.5)*s_v_8 #Voltage across the disc adjacent to conductor(kV)\n",
+ "sf_dry = v_dry/voltage_2 #Factor of safety for dry flashover\n",
+ "sf_wet = v_wet/voltage_2 #Factor of safety for wet flashover\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) :')\n",
+ "print('___________________________________________________________________________')\n",
+ "print(' No. of units Dry string efficiency(%) Wet string efficiency(%)')\n",
+ "print('___________________________________________________________________________')\n",
+ "print(' %d %.2f %.2f ' %(n_4,eff_dry_4,eff_wet_4))\n",
+ "print(' %d %.2f %.2f ' %(n_8,eff_dry_8,eff_wet_8))\n",
+ "print(' %d %.2f %.2f ' %(n_10,eff_dry_10,eff_wet_10))\n",
+ "print('___________________________________________________________________________')\n",
+ "print('\\nCase(ii) :')\n",
+ "print('Factor of safety for dry flashover = %.2f' %sf_dry)\n",
+ "print('Factor of safety for wet flashover = %.2f' %sf_wet)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) :\n",
+ "___________________________________________________________________________\n",
+ " No. of units Dry string efficiency(%) Wet string efficiency(%)\n",
+ "___________________________________________________________________________\n",
+ " 4 80.77 87.21 \n",
+ " 8 74.04 82.85 \n",
+ " 10 70.77 80.23 \n",
+ "___________________________________________________________________________\n",
+ "\n",
+ "Case(ii) :\n",
+ "Factor of safety for dry flashover = 3.06\n",
+ "Factor of safety for wet flashover = 2.02\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8, Page number 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find conductor voltage & string efficiency\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 4 #Number of disc\n",
+ "v_2 = 13.2 #Voltage across second unit(kV)\n",
+ "v_3 = 18.0 #Voltage across third unit(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "m = 0.198 #Obtained by solving the quadratic equation\n",
+ "a_1 = 1\n",
+ "a_2 = 1+m\n",
+ "a_3 = m*(a_1+a_2)+a_2\n",
+ "a_4 = m*(a_1+a_2+a_3)+a_3\n",
+ "v_1 = v_2/a_2 #Voltage across first unit(kV)\n",
+ "v_4 = a_4*v_1 #Voltage across second unit(kV)\n",
+ "V = v_1+v_2+v_3+v_4 #Conductor voltage(kV)\n",
+ "efficiency = V/(n*v_4)*100 #String efficiency(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Conductor voltage with respect to the cross-arm , V = %.2f kV' %V)\n",
+ "print('String efficiency = %.2f percent' %efficiency)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conductor voltage with respect to the cross-arm , V = 68.57 kV\n",
+ "String efficiency = 65.05 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9, Page number 164-165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find voltage distribution\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 3 #Number of disc\n",
+ "\n",
+ "#Calculation\n",
+ "unit_1 = 100/3.072 #Disc voltage as % of conductor voltage of Topmost unit\n",
+ "unit_2 = 1.014/3.072*100 #Disc voltage as % of conductor voltage of second unit\n",
+ "unit_3 = 1.058/3.072*100 #Disc voltage as % of conductor voltage of bottom unit\n",
+ "efficiency = 3.072*100/(n*1.058) #String efficiency(%)\n",
+ "\n",
+ "#Without guard ring\n",
+ "unit_1g = 100/3.752 #Disc voltage as % of conductor voltage of Topmost unit\n",
+ "unit_2g = 1.18/3.752*100 #Disc voltage as % of conductor voltage of second unit\n",
+ "unit_3g = 1.5724/3.752*100 #Disc voltage as % of conductor voltage of bottom unit\n",
+ "efficiency1 = 3.752*100/(n*1.5724) #String efficiency(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Disc voltages as a percentage of the conductor voltage with guard ring are :')\n",
+ "print('Topmost unit = %.2f percent' %unit_1)\n",
+ "print('Second unit = %.2f percent' %unit_2)\n",
+ "print('Bottom unit = %.2f percent' %unit_3)\n",
+ "print('String efficiency = %.2f percent' %efficiency)\n",
+ "print('\\nDisc voltages as a percentage of the conductor voltage without guard ring are :')\n",
+ "print('Topmost unit = %.2f percent' %unit_1g)\n",
+ "print('Second unit = %.2f percent' %unit_2g)\n",
+ "print('Bottom unit = %.2f percent' %unit_3g)\n",
+ "print('String efficiency = %.2f percent' %efficiency1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Disc voltages as a percentage of the conductor voltage with guard ring are :\n",
+ "Topmost unit = 32.55 percent\n",
+ "Second unit = 33.01 percent\n",
+ "Bottom unit = 34.44 percent\n",
+ "String efficiency = 96.79 percent\n",
+ "\n",
+ "Disc voltages as a percentage of the conductor voltage without guard ring are :\n",
+ "Topmost unit = 26.65 percent\n",
+ "Second unit = 31.45 percent\n",
+ "Bottom unit = 41.91 percent\n",
+ "String efficiency = 79.54 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10, Page number 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find corona inception voltage\n",
+ "\n",
+ "#Variable declaration\n",
+ "v = 220.0 #Voltage(kV)\n",
+ "f = 50.0 #Frequency(Hertz)\n",
+ "p = 752.0 #Pressure(mm of Hg)\n",
+ "t = 40.0 #Temperature(\u00b0C)\n",
+ "m = 0.92 #Surface irregularity factor\n",
+ "r = 1.2 #Conductor radius(cm)\n",
+ "d = 550.0 #Spacing(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "delta = (0.392*p)/(273+t) #Air density correction factor\n",
+ "V_c = 21.1*delta*m*r*math.log(d/r) #Corona inception voltage(kv/phase)rms\n",
+ "V_c_l = 3**0.5*V_c #Line-line corona inception voltage(kV)\n",
+ "\n",
+ "#Result\n",
+ "print('Corona inception voltage , V_c = %.2f kV/phase' %V_c)\n",
+ "print('Line-to-line corona inception voltage = %.2f kV' %V_c_l)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Corona inception voltage , V_c = 134.43 kV/phase\n",
+ "Line-to-line corona inception voltage = 232.84 kV\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11, Page number 173-174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find corona loss/km\n",
+ "\n",
+ "#Variable declaration\n",
+ "v = 220.0 #Voltage(kV)\n",
+ "f = 50.0 #Frequency(Hertz)\n",
+ "v_o = 1.6 #Over voltage(p.u)\n",
+ "p = 752.0 #Pressure(mm of Hg)\n",
+ "t = 40.0 #Temperature(\u00b0C)\n",
+ "m = 0.92 #Surface irregularity factor\n",
+ "r = 1.2 #Conductor radius(cm)\n",
+ "d = 550.0 #Spacing(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "delta = (0.392*p)/(273+t) #Air density correction factor\n",
+ "V_c = 21.1*delta*m*r*math.log(d/r) #Corona inception voltage(kv/phase)rms\n",
+ "V_ph = (v * v_o)/3**0.5 #Phase voltage(kV)\n",
+ "peek = 3*(241/delta)*(f+25)*(r/d)**0.5*(V_ph-V_c)**2*10**-5 #Peek's formula(kW/km)\n",
+ "ratio = V_ph/V_c\n",
+ "F = 0.9 #Ratio of V_ph to V_c\n",
+ "peterson = 3*2.1*f*F*(V_c/math.log10(d/r))**2*10**-5 #Peterson's formula(kW/km)\n",
+ "\n",
+ "#Result\n",
+ "print('Corona loss using Peeks formula , P = %.2f kW/km' %peek)\n",
+ "print('Corona loss using Petersons formula , P = %.2f kW/km' %peterson)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Corona loss using Peeks formula , P = 127.28 kW/km\n",
+ "Corona loss using Petersons formula , P = 7.23 kW/km\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_6_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_6_2.ipynb
new file mode 100644
index 00000000..6374fe50
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_6_2.ipynb
@@ -0,0 +1,234 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 6: UNDERGROUND CABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page number 191-192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find charging current & total charging kVAR/km\n",
+ "\n",
+ "#Variable declaration\n",
+ "C_m = 0.28 #Capacitance b/w ant 2 cores(micro-F/km)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "V_L = 11.0 #Line voltage(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C = 2*C_m #Capacitance b/w any conductor & shield(micro-F/km)\n",
+ "w = 2*math.pi*f #Angular frequency\n",
+ "I_c = V_L*10**3*w*C*10**-6/3**0.5 #Charging current/phase/km(A)\n",
+ "Total = 3**0.5*I_c*V_L #Total charging kVAR/km\n",
+ "\n",
+ "#Result\n",
+ "print('Charging current/phase/km , I_c = %.3f A' %I_c)\n",
+ "print('Total charging kVAR/km = %.2f ' %Total)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charging current/phase/km , I_c = 1.117 A\n",
+ "Total charging kVAR/km = 21.29 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2, Page number 193-194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find internal sheath radius\n",
+ "\n",
+ "#Variable declaration\n",
+ "E_c = 100.0 #Safe working stress(kV/cm) rms\n",
+ "V = 130.0 #Operating voltage(kV) rms\n",
+ "d = 1.5 #Diameter of conductor(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "#For case(i)\n",
+ "import math\n",
+ "ln_D = 2*V/(E_c*d)+math.log(d)\n",
+ "D = math.exp(ln_D)\n",
+ "thick_1 = (D-d)/2 #Insulation thickness(cm)\n",
+ "\n",
+ "#For case(ii)\n",
+ "d_2 = 2*V/E_c\n",
+ "D_2 = 2.718*d_2 #Sheath diameter(cm)\n",
+ "thick_2 = (D_2-d_2)/2 #Insulation thickness(cm)\n",
+ "\n",
+ "#Result\n",
+ "print('(i) Internal sheath radius = %.2f cm' %thick_1)\n",
+ "print('(ii) Internal sheath radius = %.2f cm' %thick_2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Internal sheath radius = 3.49 cm\n",
+ "(ii) Internal sheath radius = 2.23 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page number 194-196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find thickness of each layer & conductor voltage\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 3.0 #Diameter of conductor(cm)\n",
+ "D = 8.5 #Sheath diameter(cm)\n",
+ "e_r1 = 5.0 #Permittivity of inner dielectric\n",
+ "e_r2 = 3.0 #Permittivity of outer dielectric\n",
+ "E_c = 30.0 #Safe working stress(kV/cm) rms\n",
+ "\n",
+ "#Calculation\n",
+ "#For case(i)\n",
+ "import math\n",
+ "E_i = E_c\n",
+ "D_1 = e_r1/e_r2*d\n",
+ "thick_1 = (D_1-d)/2 #Thickness of first layer(cm)\n",
+ "thick_2 = (D-D_1)/2 #Thickness of second layer(cm)\n",
+ "\n",
+ "#For case(ii)\n",
+ "V_1 = E_c*d*math.log(D_1/d)/2 #Voltage across first layer(kV)\n",
+ "V_2 = E_i*D_1*math.log(D/D_1)/2 #Voltage across second layer(kV)\n",
+ "V = V_1 + V_2 #Permissible conductor voltage(kV)\n",
+ "\n",
+ "#For case(iii)\n",
+ "V_3 = E_c*d*math.log(D/d)/2 #Permissible conductor voltage(kV) for homogeneous permittivity of 5\n",
+ "\n",
+ "#Result\n",
+ "print('Case(i) :')\n",
+ "print('Thickness of first layer = %.2f cm' %thick_1)\n",
+ "print('Thickness of second layer = %.2f cm' %thick_2)\n",
+ "print('\\nCase(ii) :')\n",
+ "print('Permissible conductor voltage = %.2f kV' %V)\n",
+ "print('\\nCase(iii) :')\n",
+ "print('Permissible conductor voltage if a homogeneous insulation of permittivity 5 is used , V = %.2f kV' %V_3)\n",
+ "print('\\nNOTE : ERROR : Relative permittivity of outer dielectric is 3 & not 9 as given in textbook')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) :\n",
+ "Thickness of first layer = 1.00 cm\n",
+ "Thickness of second layer = 1.75 cm\n",
+ "\n",
+ "Case(ii) :\n",
+ "Permissible conductor voltage = 62.78 kV\n",
+ "\n",
+ "Case(iii) :\n",
+ "Permissible conductor voltage if a homogeneous insulation of permittivity 5 is used , V = 46.87 kV\n",
+ "\n",
+ "NOTE : ERROR : Relative permittivity of outer dielectric is 3 & not 9 as given in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page number 196-197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find safe working voltage with & without intersheath\n",
+ "\n",
+ "#Variable declaration\n",
+ "E = 40.0 #Safe working stress(kV/cm) rms\n",
+ "d = 1.5 #Conductor diameter(cm)\n",
+ "D = 6.7 #Sheath diameter(cm)\n",
+ "t = 0.1 #Thickness of lead tube(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r = d/2 #Conductor radius(cm)\n",
+ "R = D/2 #Sheath radius(cm)\n",
+ "r_i = r+((R-r)/2)-t/2 #Internal radius of intersheath(cm)\n",
+ "r_e = r_i + t #External radius of intersheath(cm)\n",
+ "V_1 = E*r*math.log(r_i/r) #Voltage across conductor & intersheath(kV)\n",
+ "V_2 = E*r_e*math.log(R/r_e) #Voltage across intersheath & earthed sheath(kV)\n",
+ "V = V_1 + V_2 #Safe working voltage with intersheath(kV)\n",
+ "V_no = E*r*math.log(R/r) #Safe working voltage without intersheath(kV)\n",
+ "\n",
+ "#Result\n",
+ "print('Safe working voltage with intersheath , V = %.2f kV' %V)\n",
+ "print('Safe working voltage without intersheath , V = %.2f kV' %V_no)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Safe working voltage with intersheath , V = 68.65 kV\n",
+ "Safe working voltage without intersheath , V = 44.90 kV\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_7_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_7_2.ipynb
new file mode 100644
index 00000000..f7c5fe02
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_7_2.ipynb
@@ -0,0 +1,489 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 7: SUBSTATION AND DISTRIBUTION SYSTEM"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page number 238-239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find overall cross-sectional area\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 400.0 #Voltage supplied(V)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "P_1 = 75.0 #Power of induction motor at middle of distributor(kVA)\n",
+ "pf_1 = 0.8 #Power factor of induction motor at middle of distributor\n",
+ "P_2 = 50.0 #Power of induction motor at far end(kVA)\n",
+ "pf_2 = 0.85 #Power factor of induction motor at far end\n",
+ "demand_f = 1.0 #Demand factor\n",
+ "diver_f = 1.2 #Diversity factor\n",
+ "L = 150.0 #Length of line(m)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "theta_1 = math.acos(pf_1) #Power factor angle for 75 kVA(radians)\n",
+ "theta_2 = math.acos(pf_2) #Power factor angle for 50 kVA(radians)\n",
+ "load = P_1*cmath.exp(1j*theta_1)+P_2*cmath.exp(1j*theta_2) #Total connected load(kVA)\n",
+ "pf_r = math.cos(cmath.phase(load)) #Resultant power factor\n",
+ "I_max = abs(load)*1000/(3**0.5*V*diver_f) #Maximum distributor current per phase(A)\n",
+ "L_1 = L/2\n",
+ "V_per = 0.06*V/3**0.5 #Permissible voltage drop(V)\n",
+ "\n",
+ "#From table 7.1 page number 235\n",
+ "#For Ferret\n",
+ "R_f = 0.734*10**-3 #Resistance(ohm/m)\n",
+ "X_f = 0.336*10**-3 #Reactance(ohm/m)\n",
+ "I_2f = P_2*10**3/(3**0.5*V)\n",
+ "I_1f = P_1*10**3/(3**0.5*V)\n",
+ "V_f = I_1f*L_1*(R_f*pf_1+X_f*math.sin(theta_1))+I_2f*L*(R_f*pf_2+X_f*math.sin(theta_2))\n",
+ "d_f = 9.0 #Overall conductor diameter(mm)\n",
+ "area_f = math.pi*d_f**2/4 #Area of ferret conductor(mm^2)\n",
+ "\n",
+ "#For Rabbit\n",
+ "R_R = 0.587*10**-3 #Resistance(ohm/m)\n",
+ "X_R = 0.333*10**-3 #Reactance(ohm/m)\n",
+ "I_2R = P_2*10**3/(3**0.5*V)\n",
+ "I_1R = P_1*10**3/(3**0.5*V)\n",
+ "V_R = I_1R*L_1*(R_R*pf_1+X_R*math.sin(theta_1))+I_2R*L*(R_R*pf_2+X_R*math.sin(theta_2))\n",
+ "d_R = 10.0 #Overall conductor diameter(mm)\n",
+ "area_R = math.pi*d_R**2/4 #Area of rabbit conductor(mm^2)\n",
+ "\n",
+ "#Result\n",
+ "if(V_f > V_per):\n",
+ " print('Overall cross-sectional area of the 7/3.35 mm Rabbit ACSR conductors having overall conductor diameter of 10.0 mm = %.2f mm^2' %area_R)\n",
+ "else:\n",
+ " print('Overall cross-sectional area of the 7/3.00 mm Ferret ACSR conductors having overall conductor diameter of 9.0 mm = %.2f mm^2' %area_f)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall cross-sectional area of the 7/3.35 mm Rabbit ACSR conductors having overall conductor diameter of 10.0 mm = 78.54 mm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page number 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find overall cross-sectional area\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 400.0 #Voltage supplied(V)\n",
+ "i = 0.5 #Current per meter(A)\n",
+ "demand_f = 1.0 #Demand factor\n",
+ "diver_f = 1.0 #Diversity factor\n",
+ "L = 275.0 #Length of line(m)\n",
+ "pf = 0.9 #Power factor lagging\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I = i*L #Current in distributor/phase(A)\n",
+ "theta = math.acos(pf) #Power factor angle\n",
+ "V_per = 0.06*V/3**0.5 #Permissible voltage drop(V)\n",
+ "\n",
+ "#For Weasel\n",
+ "r_w = 0.985 #Resistance(ohm/km)\n",
+ "x_w = 0.341 #Reactance(ohm/km)\n",
+ "V_w = 0.5*i*(r_w*pf+x_w*math.sin(theta))*L**2*10**-3 #Voltage drop for Weasel(V)\n",
+ "d_w = 7.77 #Diameter of weasel conductor(mm)\n",
+ "area_w = math.pi*d_w**2/4 #Area of weasel conductor(mm^2)\n",
+ "\n",
+ "#For Ferret\n",
+ "r_f = 0.734 #Resistance(ohm/km)\n",
+ "x_f = 0.336 #Reactance(ohm/km)\n",
+ "V_f = 0.5*i*(r_f*pf+x_f*math.sin(theta))*L**2*10**-3 #Voltage drop for Ferret(V)\n",
+ "d_f = 9.00 #Diameter of Ferret conductor(mm)\n",
+ "area_f = math.pi*d_f**2/4 #Area of Ferret conductor(mm^2)\n",
+ "\n",
+ "#For Rabbit\n",
+ "r_r = 0.587 #Resistance(ohm/km)\n",
+ "x_r = 0.333 #Reactance(ohm/km)\n",
+ "V_r = 0.5*i*(r_r*pf+x_r*math.sin(theta))*L**2*10**-3 #Voltage drop for Rabbit(V)\n",
+ "d_r = 10.0 #Diameter of Rabbit conductor(mm)\n",
+ "area_r = math.pi*d_r**2/4 #Area of Rabbit conductor(mm^2)\n",
+ "\n",
+ "#Result\n",
+ "if(V_w < V_per):\n",
+ " print('Overall cross-sectional area of the 7/2.59 mm Weasel ACSR conductors having overall conductor diameter of 7.77 mm = %.2f mm^2' %area_w)\n",
+ "elif(V_f < V_per):\n",
+ " print('Overall cross-sectional area of the 7/3.00 mm Ferret ACSR conductors having overall conductor diameter of 9.0 mm = %.2f mm^2' %area_f)\n",
+ "else:\n",
+ " print('Overall cross-sectional area of the 7/3.35 mm Rabbit ACSR conductors having overall conductor diameter of 10.0 mm = %.2f mm^2' %area_r)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall cross-sectional area of the 7/3.35 mm Rabbit ACSR conductors having overall conductor diameter of 10.0 mm = 78.54 mm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page number 240-241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find size of ACSR conductor\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 400.0 #Voltage supplied(V)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "L = 300.0 #Length of line(m)\n",
+ "I_1 = 50.0 #Current at 100 m from feeding point(A)\n",
+ "pf_1 = 0.8 #Power factor at 100 m from feeding point\n",
+ "L_1 = 100.0 #Length of line upto feeding point(m)\n",
+ "I_2 = 25.0 #Current at 100 m from feeding point(A)\n",
+ "pf_2 = 0.78 #Power factor at 100 m from feeding point\n",
+ "L_2 = 200.0 #Length of line from feeding point to far end(m)\n",
+ "i = 0.2 #Distributed load current(A/metre)\n",
+ "v_drop = 15.0 #Permissible voltage drop\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "theta_1 = math.acos(pf_1) #Power factor angle for 50 A(radians)\n",
+ "theta_2 = math.acos(pf_2) #Power factor angle for 25 A(radians)\n",
+ "\n",
+ "#For Ferret conductor\n",
+ "r_f = 0.734*10**-3 #Resistance(ohm/m)\n",
+ "x_f = 0.336*10**-3 #Reactance(ohm/m)\n",
+ "V_con_f = I_1*L_1*(r_f*pf_1+x_f*math.sin(theta_1))+I_2*L*(r_f*pf_2+x_f*math.sin(theta_2)) #Voltage drop at B due to concentrated loading(V)\n",
+ "V_dis_f = 0.5*i*r_f*(L_1+L_2)**2 #Voltage drop at B due to distributed loading(V)\n",
+ "V_f = V_con_f+V_dis_f #Total voltage drop(V)\n",
+ "\n",
+ "#For Rabbit conductor\n",
+ "r_r = 0.587*10**-3 #Resistance(ohm/m)\n",
+ "x_r = 0.333*10**-3 #Reactance(ohm/m)\n",
+ "V_con_r = I_1*L_1*(r_r*pf_1+x_r*math.sin(theta_1))+I_2*L*(r_r*pf_2+x_r*math.sin(theta_2)) #Voltage drop at B due to concentrated loading(V)\n",
+ "V_dis_r = 0.5*i*r_r*(L_1+L_2)**2 #Voltage drop at B due to distributed loading(V)\n",
+ "V_r = V_con_r+V_dis_r #Total voltage drop(V)\n",
+ "\n",
+ "#Result\n",
+ "if(V_f < v_drop):\n",
+ " print('Ferret ACSR conductors of size 7/3.00 mm having an overall conductor diameter of 9.0 mm is to be used')\n",
+ " print('Total voltage drop = %.2f V, which is within limit' %V_f)\n",
+ "else:\n",
+ " print('Rabbit ACSR conductors of size 7/3.35 mm having an overall conductor diameter of 10.0 mm is to be used')\n",
+ " print('Total voltage drop = %.2f V, which is within limit' %V_r)\n",
+ "print('\\nNOTE : ERROR : In distributed load : current is 0.2 A/meter and not 0.25 A/meter as given in problem statement')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rabbit ACSR conductors of size 7/3.35 mm having an overall conductor diameter of 10.0 mm is to be used\n",
+ "Total voltage drop = 13.63 V, which is within limit\n",
+ "\n",
+ "NOTE : ERROR : In distributed load : current is 0.2 A/meter and not 0.25 A/meter as given in problem statement\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, Page number 244-245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find kVAR rating & capacitance value\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 5.0 #Power of substation(MVA)\n",
+ "V_hv = 33.0 #High voltage(kV)\n",
+ "V_lv = 11.0 #Low voltage(kV)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "P_1 = 0.5 #Minimum load(MW)\n",
+ "pf_1 = 0.85 #Lagging power factor of minimum load\n",
+ "P_2 = 2.8 #Maximum load(MW)\n",
+ "pf_2 = 0.78 #Lagging power factor of maximum load\n",
+ "pf_i = 0.9 #Lagging power factor of incoming current\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "theta_1 = math.acos(pf_1)\n",
+ "theta_2 = math.acos(pf_2)\n",
+ "theta_i = math.acos(pf_i)\n",
+ "\n",
+ "#Minimum load condition\n",
+ "load_react = P_1*math.tan(theta_1)*1000 #Load reactive power(kVAR)\n",
+ "line_react = P_1*math.tan(theta_i)*1000 #Reactive power supplied by line(kVAR)\n",
+ "rating_fix = load_react - line_react #kVAR rating of fixed capacitor bank(kVAR)\n",
+ "\n",
+ "#Maximum load condition\n",
+ "bank_react = P_2*(math.tan(theta_2)-math.tan(theta_i))*1000 #Reactive power to be supplied by capacitor banks(kVAR)\n",
+ "rating_swi = bank_react - rating_fix #Reactive power rating of switched unit(kVAR)\n",
+ "\n",
+ "#Capacitor value\n",
+ "C_fix = rating_fix*10**-3/(3**0.5*V_lv**2*2*math.pi*f) #Capacitance for fixed bank\n",
+ "C_swi = rating_swi*10**-3/(3**0.5*V_lv**2*2*math.pi*f) #Capacitance for switched bank\n",
+ "\n",
+ "#Result\n",
+ "print('kVAR rating of fixed capacitors = %.1f kVAR' %rating_fix)\n",
+ "print('kVAR rating of switched capacitors = %.1f kVAR' %rating_swi)\n",
+ "print('Capacitance of fixed bank , C = %.2e F/phase' %C_fix)\n",
+ "print('Capacitance of switched bank , C = %.2e F/phase' %C_swi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "kVAR rating of fixed capacitors = 67.7 kVAR\n",
+ "kVAR rating of switched capacitors = 822.6 kVAR\n",
+ "Capacitance of fixed bank , C = 1.03e-06 F/phase\n",
+ "Capacitance of switched bank , C = 1.25e-05 F/phase\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5, Page number 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find kVAR rating,line current & capacitance of bank\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 400.0 #Voltage of induction motor(V)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "I = 40.0 #Line current(A)\n",
+ "pf_1 = 0.78 #Lagging power factor of motor\n",
+ "pf_2 = 0.95 #Raised lagging power factor\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "theta_1 = math.acos(pf_1) #Motor power factor angle(radians)\n",
+ "P_act_m = 3**0.5*V*I*pf_1*10**-3 #Active power demand of motor(kW)\n",
+ "P_rea_m = P_act_m*math.tan(theta_1) #Reactive power demand of motor(kVAR)\n",
+ "theta_2 = math.acos(pf_2) #Improved power factor angle(radians)\n",
+ "P_act_l = 3**0.5*V*I*pf_1*10**-3 #Active power supplied by line(kW)\n",
+ "P_rea_l = P_act_m*math.tan(theta_2) #Reactive power supplied by line to motor(kVAR)\n",
+ "rating = P_rea_m - P_rea_l #kVAR rating of capacitor bank(kVAR per phase)\n",
+ "I_C = rating*1000/(3**0.5*V) #Current drawn by capacitor bank(A)\n",
+ "I_L = I*cmath.exp(1j*-theta_1)+I_C*cmath.exp(1j*90*math.pi/180) #Line current(A)\n",
+ "I_phase = I_C/3**0.5 #Phase current of delta connected capacitor bank(A)\n",
+ "C = I_phase/(V*2*math.pi*f) #Per phase capacitance of bank(micro-F/phase)\n",
+ "\n",
+ "#Result\n",
+ "print('kVAR rating of the bank = %.2f kVAR per phase' %rating)\n",
+ "print('Line current = %.2f\u2220%.2f\u00b0 A' %(abs(I_L),cmath.phase(I_L)*180/math.pi))\n",
+ "print('Per phase capacitance of the bank , C = %.2e F/phase' %C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "kVAR rating of the bank = 10.24 kVAR per phase\n",
+ "Line current = 32.84\u2220-18.19\u00b0 A\n",
+ "Per phase capacitance of the bank , C = 6.79e-05 F/phase\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6, Page number 245-246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find feeder power factor & load at unity power factor\n",
+ "\n",
+ "#Variable declaration\n",
+ "P_1 = 250.0 #Load at unity power factor(kW)\n",
+ "pf_1 = 1 #Power factor\n",
+ "P_2 = 1500.0 #Load at 0.9 power factor(kW)\n",
+ "pf_2 = 0.9 #Lagging power factor\n",
+ "P_3 = 1000.0 #Load at 0.8 power factor(kW)\n",
+ "pf_3 = 0.8 #Lagging power factor\n",
+ "P_4 = 700.0 #Load at 0.78 power factor(kW)\n",
+ "pf_4 = 0.76 #Lagging power factor\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "theta_1 = math.acos(pf_1)\n",
+ "theta_2 = math.acos(pf_2)\n",
+ "theta_3 = math.acos(pf_3)\n",
+ "theta_4 = math.acos(pf_4)\n",
+ "kW_T = P_1+P_2+P_3+P_4 #Total kW carried by feeder(kW)\n",
+ "kVAR_T = P_1*math.tan(theta_1)+P_2*math.tan(theta_2)+P_3*math.tan(theta_3)+P_4*math.tan(theta_4)\n",
+ "pf_feed = math.cos(math.atan(kVAR_T/kW_T))\n",
+ "feeder_KVA = (kW_T**2+kVAR_T**2)**0.5 #Feeder kVA\n",
+ "feeder_kW = feeder_KVA #Load at unity pf(kW)\n",
+ "\n",
+ "#Result\n",
+ "print('Feeder power factor = %.3f lagging' %pf_feed)\n",
+ "print('Load at unity power factor = %.f kW' %feeder_kW)\n",
+ "print('\\nNOTE : ERROR : The load data should be 700 kW at 0.76 pf lagging instead of 700 kW at 0.78 lagging')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Feeder power factor = 0.857 lagging\n",
+ "Load at unity power factor = 4026 kW\n",
+ "\n",
+ "NOTE : ERROR : The load data should be 700 kW at 0.76 pf lagging instead of 700 kW at 0.78 lagging\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8, Page number 247-249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find line power factor during lean period\n",
+ "\n",
+ "#Variable declaration\n",
+ "V = 400.0 #Voltage(V)\n",
+ "f = 50.0 #Frequency(Hz)\n",
+ "HP_1 = 75.0 #Power(H.P)\n",
+ "HP_2 = 25.0 #Power(H.P)\n",
+ "HP_3 = 10.0 #Power(H.P)\n",
+ "pf_1 = 0.75 #Power factor at 3/4 load\n",
+ "pf_2 = 0.78 #Power factor at 4/5 load\n",
+ "pf_3 = 0.8 #Power factor at full load\n",
+ "pf_4 = 0.9 #Lagging power factor improved\n",
+ "pf_5 = 0.74 #Power factor of 2nd motor at 2/3 of full load\n",
+ "pf_6 = 0.8 #Power factor of 3rd motor at full load\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Peak season\n",
+ "theta_1 = math.acos(pf_1)\n",
+ "theta_2 = math.acos(pf_2)\n",
+ "theta_3 = math.acos(pf_3)\n",
+ "S_1P = (0.75*HP_1*746*10**-3/pf_1)*cmath.exp(1j*theta_1) #kVA demanded by first motor(kVA)\n",
+ "S_2P = (0.8*HP_2*746*10**-3/pf_2)*cmath.exp(1j*theta_2) #kVA demanded by second motor(kVA)\n",
+ "S_3P = (HP_3*746*10**-3/pf_3)*cmath.exp(1j*theta_3) #kVA demanded by third motor(kVA)\n",
+ "S_TP = S_1P + S_2P + S_3P #Total kVA demanded by all loads(kVA)\n",
+ "pf_l_wc = math.cos(cmath.phase(S_TP)) #Line power factor without capacitive correction\n",
+ "kW_T = S_TP.real #Total kW demanded by load(kW)\n",
+ "kVAR_T = S_TP.imag #Total lagging kVAR demanded by loads(kVAR)\n",
+ "theta_4 = math.acos(pf_4)\n",
+ "P_react = kW_T*math.tan(theta_4) #Reactive power supplied by line for 0.9 pf(kVAR)\n",
+ "power = kVAR_T - P_react #Reactive power supplied by capacitor bank(kVAR)\n",
+ "\n",
+ "#Lean season\n",
+ "theta_5 = math.acos(pf_5)\n",
+ "theta_6 = math.acos(pf_6)\n",
+ "S_2L = (2*HP_2*746*10**-3/(3*pf_5))*cmath.exp(1j*theta_5) #kVA demanded by second motor(kVA)\n",
+ "S_3L = (HP_3*746*10**-3/pf_3)*cmath.exp(1j*theta_3) #kVA demanded by third motor(kVA)\n",
+ "S_TL = S_2L + S_3L #Total kVA demanded during lean period(kVA)\n",
+ "S_line = S_TL.real - complex(0,(power-S_TL.imag)) #kVA supplied by line(kVA)\n",
+ "pf_line = math.cos(cmath.phase(S_line)) #Line power factor\n",
+ "\n",
+ "#Result\n",
+ "print('Line power factor with capacitor bank connected during lean period = %.2f leading' %pf_line)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Line power factor with capacitor bank connected during lean period = 0.95 leading\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_8_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_8_2.ipynb
new file mode 100644
index 00000000..e6edc8d5
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_8_2.ipynb
@@ -0,0 +1,447 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 8: ELEMENTS OF ELECTRIC POWER GENERATION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1, Page number 260-261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find overall efficiency\n",
+ "\n",
+ "#Variable declaration\n",
+ "w = 0.8 #Coal to be burnt for every kWh of electric energy(kg)\n",
+ "C = 5000 #Calorific value of coal(kilo-calories/kg)\n",
+ "\n",
+ "#Calculation\n",
+ "heat_energy = C*w/860 #Heat energy of combustion of given coal(kWh)\n",
+ "efficiency = 1/heat_energy #Overall efficiency\n",
+ "\n",
+ "#Result\n",
+ "print('Overall efficiency of the plant = %.3f' %efficiency)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall efficiency of the plant = 0.215\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2, Page number 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find out daily coal requirement\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 250.0 #Power(MW)\n",
+ "C = 6100.0 #Calorific value(kcal/kg)\n",
+ "n_1 = 0.9 #Plant runs at full load\n",
+ "h_1 = 20.0 #Time for full load(hour)\n",
+ "n_2 = 0.75 #Plant runs at full load\n",
+ "h_2 = 4.0 #Time for full load(hour)\n",
+ "n_t = 0.3 #Thermal efficiency\n",
+ "n_g = 0.93 #Generator efficiency\n",
+ "\n",
+ "#Calculation\n",
+ "E_T = (P*n_1*h_1+P*n_2*h_2)*1000 #Total electric energy produced by plant in a day(kWh)\n",
+ "efficiency = n_t * n_g #Overall efficiency of the plant\n",
+ "heat_energy = E_T*860/efficiency #Heat energy of combustion of coal(kcal)\n",
+ "coal_requ = heat_energy/C #Daily coal requirement(kg)\n",
+ "coal_requ_ton = coal_requ*10**-3 #Daily coal requirement(tonnes)\n",
+ "\n",
+ "#Result\n",
+ "print('Daily coal requirement = %.2e kg = %.f tonnes' %(coal_requ,coal_requ_ton))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Daily coal requirement = 2.65e+06 kg = 2653 tonnes\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3, Page number 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find electric power available & energy\n",
+ "\n",
+ "#Variable declaration\n",
+ "Q = 1.0 #Water discharge(m^3/sec)\n",
+ "h = 200.0 #Height(m)\n",
+ "n_h = 0.85 #Hydraulic efficiency\n",
+ "n_e = 0.95 #Electric efficiency\n",
+ "\n",
+ "#Calculation\n",
+ "n = n_h*n_e #Overall efficiency\n",
+ "P = (736.0/75)*Q*h*n #Electrical power available(kW)\n",
+ "E = P*1.0 #Energy available in an hour(kWh)\n",
+ "\n",
+ "#Result\n",
+ "print('Electrical power available = %.2f kW' %P)\n",
+ "print('Energy available in an hour = %.2f kWh' %E)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electrical power available = 1584.85 kW\n",
+ "Energy available in an hour = 1584.85 kWh\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4, Page number 266-267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage fall in reservoir level\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ad = 6.0*10**6 #Reservoir capacity(m^3)\n",
+ "h = 150.0 #Head(m)\n",
+ "n = 0.78 #Overall efficiency\n",
+ "P = 25.0*10**6 #Power(Watt)\n",
+ "t = 4.0 #Supply time(hour)\n",
+ "\n",
+ "#Calculation\n",
+ "AX = P*75*3600*t/(736*h*n*1000) #unit(m^3)\n",
+ "X_d = AX/Ad*100 #Fall in reservoir level(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Percentage fall in reservoir level = %.2f percent' %X_d)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage fall in reservoir level = 5.23 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5, Page number 288-289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find excitation voltage,current,power factor,power angle,pull out power & electrical stiffness\n",
+ "\n",
+ "#Variable declaration\n",
+ "X_s = 1.0 #Synchronous reactance of generator(p.u)\n",
+ "V_b = 1.0 #Terminal voltage of generator=voltage of infinite bus(p.u)\n",
+ "P_G = 0.5 #Real power output at unity pf(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Case(a)\n",
+ "I = P_G/V_b #Generator current(p.u)\n",
+ "E = complex(V_b,I*X_s) #Excitation emf of finite machine(p.u)\n",
+ "delta = cmath.phase(E)*180/math.pi #Power angle = angle b/w E & V_b(degree)\n",
+ "\n",
+ "#Case(b)\n",
+ "P_Gn = P_G/2 #Real power o/p when steam i/p is halved(p.u)\n",
+ "sin_delta_n = P_Gn*X_s/(abs(E)*V_b)\n",
+ "delta_n = math.asin(sin_delta_n) #New power angle(radian)\n",
+ "E_n = abs(E)*cmath.exp(1j*delta_n) #Excitation emf of finite machine with new angle(p.u)\n",
+ "I_n = (E_n-V_b)/complex(0,X_s) #Current when steam i/p is halved(p.u)\n",
+ "pf_n = math.cos(cmath.phase(I_n)) #Power factor when steam i/p is halved\n",
+ "\n",
+ "#Case(c)\n",
+ "P_po = abs(E)*V_b/X_s #Pull out power(p.u)\n",
+ "\n",
+ "#Case(d)\n",
+ "stiff_a = abs(E)*V_b/X_s*math.cos(cmath.phase(E)) #Electrical stiffness in case(a) (p.u/radian)\n",
+ "stiff_b = abs(E)*V_b/X_s*math.cos(cmath.phase(I_n)) #Electrical stiffness in case(b) (p.u/radian)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a) :')\n",
+ "print('Excitation voltage of finite machine , E = %.2f\u2220%.2f\u00b0 p.u' %(abs(E),delta))\n",
+ "print('Power angle = %.2f\u00b0' %delta)\n",
+ "print('\\nCase(b) :')\n",
+ "print('Current if steam input is reduced to half , I_n = %.3f\u2220%.2f\u00b0 p.u' %(abs(I_n),cmath.phase(I_n)*180/math.pi))\n",
+ "print('Power factor if steam input is reduced to half = %.2f lagging' %pf_n)\n",
+ "print('Power angle if steam input is reduced to half = %.2f\u00b0' %(delta_n*180/math.pi))\n",
+ "print('\\nCase(c) :')\n",
+ "print('Pull out power = %.2f p.u' %P_po)\n",
+ "print('\\nCase(d) :')\n",
+ "print('Electrical stiffness for case(a) = %.1f p.u/radian' %stiff_a)\n",
+ "print('Electrical stiffness for case(b) = %.3f p.u/radian' %stiff_b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) :\n",
+ "Excitation voltage of finite machine , E = 1.12\u222026.57\u00b0 p.u\n",
+ "Power angle = 26.57\u00b0\n",
+ "\n",
+ "Case(b) :\n",
+ "Current if steam input is reduced to half , I_n = 0.266\u2220-19.74\u00b0 p.u\n",
+ "Power factor if steam input is reduced to half = 0.94 lagging\n",
+ "Power angle if steam input is reduced to half = 12.92\u00b0\n",
+ "\n",
+ "Case(c) :\n",
+ "Pull out power = 1.12 p.u\n",
+ "\n",
+ "Case(d) :\n",
+ "Electrical stiffness for case(a) = 1.0 p.u/radian\n",
+ "Electrical stiffness for case(b) = 1.052 p.u/radian\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6, Page number 289-290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find power angle,reactive power output,active power & power angle\n",
+ "\n",
+ "#Variable declaration\n",
+ "X_s = 1.1 #Synchronous reactance of generator(p.u)\n",
+ "V_b = 1.0 #Terminal voltage of generator=voltage of infinite bus(p.u)\n",
+ "E = 1.25 #Excitation emf of finite machine(p.u)\n",
+ "P_G = 0.3 #Active power output(p.u)\n",
+ "dec = 0.25 #Excitation is decreased\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Case(a)\n",
+ "sin_delta = P_G*X_s/(E*V_b)\n",
+ "delta = math.asin(sin_delta) #Power angle(radian)\n",
+ "Q_G = V_b/X_s*(E*math.cos(delta)-V_b) #Reactive power output(p.u)\n",
+ "\n",
+ "#Case(b)\n",
+ "E_n = (1-dec)*E #New excitation emf of finite machine(p.u)\n",
+ "P_Gn = P_G #New active power output(p.u)\n",
+ "sin_delta_n = P_G*X_s/(E_n*V_b)\n",
+ "delta_n = math.asin(sin_delta_n) #New power angle(radian)\n",
+ "Q_Gn = V_b/X_s*(E_n*math.cos(delta_n)-V_b) #New reactive power output(p.u)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a) :')\n",
+ "print('Power angle = %.2f\u00b0' %(delta*180/math.pi))\n",
+ "print('Reactive power output , Q_G = %.3f p.u' %Q_G)\n",
+ "print('\\nCase(b) :')\n",
+ "print('Active power if excitation is decreased , P_Gn = %.1f p.u' %P_Gn)\n",
+ "print('Reactive power if excitation is decreased , Q_Gn = %.3f p.u' %Q_Gn)\n",
+ "print('Power angle if excitation is decreased = %.2f\u00b0' %(delta_n*180/math.pi))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) :\n",
+ "Power angle = 15.31\u00b0\n",
+ "Reactive power output , Q_G = 0.187 p.u\n",
+ "\n",
+ "Case(b) :\n",
+ "Active power if excitation is decreased , P_Gn = 0.3 p.u\n",
+ "Reactive power if excitation is decreased , Q_Gn = -0.111 p.u\n",
+ "Power angle if excitation is decreased = 20.61\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7, Page number 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find change in active & reactive power\n",
+ "\n",
+ "#Variable declaration\n",
+ "X_s = 1.05 #Synchronous reactance of generator(p.u)\n",
+ "V_b = 0.95 #Terminal voltage of generator=voltage of infinite bus(p.u)\n",
+ "X_L = 0.1 #Reactance of link(p.u)\n",
+ "E = 1.2 #Excitation emf of finite machine(p.u)\n",
+ "P_G = 0.15 #Active power output(p.u)\n",
+ "inc = 1 #Turbine torque increased\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Initial condition\n",
+ "sin_delta = P_G*(X_s+X_L)/(E*V_b)\n",
+ "delta = math.asin(sin_delta) #Power angle(radian)\n",
+ "Q_G = V_b/(X_s+X_L)*(E*math.cos(delta)-V_b) #Reactive power output(p.u)\n",
+ "\n",
+ "#Changed condition\n",
+ "P_Gn = (1+inc)*P_G #New active power output(p.u)\n",
+ "sin_delta_n = P_Gn*(X_s+X_L)/(E*V_b)\n",
+ "delta_n = math.asin(sin_delta_n) #Power angle(radian)\n",
+ "Q_Gn = V_b/(X_s+X_L)*(E*math.cos(delta_n)-V_b) #Reactive power output(p.u)\n",
+ "P_change = (P_Gn-P_G)/P_G*100 #Change in active power output(%)\n",
+ "Q_change = (Q_Gn-Q_G)/Q_G*100 #Change in reactive power output(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Change in active power supplied by generator = %.f percent' %P_change)\n",
+ "print('Change in reactive power supplied by generator = %.2f percent' %Q_change)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in active power supplied by generator = 100 percent\n",
+ "Change in reactive power supplied by generator = -17.97 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8, Page number 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage change excitation voltage\n",
+ "\n",
+ "#Variable declaration\n",
+ "X_s = 6.0 #Synchronous reactance of alternator(ohms/phase)\n",
+ "pf = 0.8 #Lagging power factor\n",
+ "P_G = 5.0 #Power delivered(MW)\n",
+ "V = 11.0 #Voltage of infinite bus(kV)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "delta = math.acos(pf)\n",
+ "I = P_G*1000/(3**0.5*V*pf)*(pf - complex(0,math.sin(delta))) #Alternator current(A)\n",
+ "V_b = V*10**3/3**0.5 #Voltage of infinite bus(V/phase)\n",
+ "E = complex(V_b,I*X_s) #Initial excitation voltage(V)\n",
+ "pf_n = 1.0 #New power factor\n",
+ "P_Gn = P_G #New power delivered(MW)\n",
+ "I_n = P_Gn*1000/(3**0.5*V*pf_n) #Alternator current(A)\n",
+ "E_n = complex(V_b,I_n*X_s) #New excitation voltage(V)\n",
+ "excitation_change = (abs(E)-abs(E_n))/abs(E)*100 #Percentage change in excitation(%)\n",
+ "\n",
+ "#Result\n",
+ "print('Percentage change in excitation = %.2f percent' %excitation_change)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage change in excitation = 14.96 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_9_2.ipynb b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_9_2.ipynb
new file mode 100644
index 00000000..862e3df0
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/CHAPTER_9_2.ipynb
@@ -0,0 +1,211 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 9: LOAD FLOW STUDIES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page number 307-308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Y bus matrix\n",
+ "\n",
+ "#Variable declaration\n",
+ "Y_s12 = complex(2.96,-20.16) #Line admittance b/w buses 1 & 2(*10^-3 mho)\n",
+ "Y_p12 = complex(0,0.152) #Line admittance b/w buses 1 & 2(*10^-3 mho)\n",
+ "Y_s15 = complex(2.72,-18.32) #Line admittance b/w buses 1 & 5(*10^-3 mho)\n",
+ "Y_p15 = complex(0,0.185) #Line admittance b/w buses 1 & 5(*10^-3 mho)\n",
+ "Y_s23 = complex(3.0,-22.8) #Line admittance b/w buses 2 & 3(*10^-3 mho)\n",
+ "Y_p23 = complex(0,0.110) #Line admittance b/w buses 2 & 3(*10^-3 mho)\n",
+ "Y_s25 = complex(1.48,-10.30) #Line admittance b/w buses 2 & 5(*10^-3 mho)\n",
+ "Y_p25 = complex(0,0.312) #Line admittance b/w buses 2 & 5(*10^-3 mho)\n",
+ "Y_s34 = complex(2.96,-20.16) #Line admittance b/w buses 3 & 4(*10^-3 mho)\n",
+ "Y_p34 = complex(0,0.152) #Line admittance b/w buses 3 & 4(*10^-3 mho)\n",
+ "Y_s45 = complex(3.0,-22.8) #Line admittance b/w buses 4 & 5(*10^-3 mho)\n",
+ "Y_p45 = complex(0,0.110) #Line admittance b/w buses 4 & 5(*10^-3 mho)\n",
+ "\n",
+ "#Calculation\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#I row\n",
+ "Y_s13 = complex(0,0) #Line admittance b/w buses 1 & 3(*10^-3 mho)\n",
+ "Y_p13 = complex(0,0) #Line admittance b/w buses 1 & 3(*10^-3 mho)\n",
+ "Y_s14 = complex(0,0) #Line admittance b/w buses 1 & 4(*10^-3 mho)\n",
+ "Y_p14 = complex(0,0) #Line admittance b/w buses 1 & 4(*10^-3 mho)\n",
+ "Y_11 = (Y_s12+Y_s13+Y_s14+Y_s15)+(Y_p12+Y_p13+Y_p14+Y_p15)\n",
+ "Y_12 = -Y_s12\n",
+ "Y_13 = -Y_s13\n",
+ "Y_14 = -Y_s14\n",
+ "Y_15 = -Y_s15\n",
+ "\n",
+ "#II row\n",
+ "Y_s21 = Y_s12\n",
+ "Y_p21 = Y_p12\n",
+ "Y_s24 = complex(0,0) #Line admittance b/w buses 2 & 4(*10^-3 mho)\n",
+ "Y_p24 = complex(0,0) #Line admittance b/w buses 2 & 4(*10^-3 mho)\n",
+ "Y_21 = Y_12\n",
+ "Y_22 = (Y_s21+Y_s23+Y_s24+Y_s25)+(Y_p21+Y_p23+Y_p24+Y_p25)\n",
+ "Y_23 = -Y_s23\n",
+ "Y_24 = -Y_s24\n",
+ "Y_25 = -Y_s25\n",
+ "\n",
+ "#III row\n",
+ "Y_s31 = Y_s13\n",
+ "Y_p31 = Y_p13\n",
+ "Y_s32 = Y_s23\n",
+ "Y_p32 = Y_p23\n",
+ "Y_s35 = complex(0,0) #Line admittance b/w buses 2 & 4(*10^-3 mho)\n",
+ "Y_p35 = complex(0,0) #Line admittance b/w buses 2 & 4(*10^-3 mho)\n",
+ "Y_33 = (Y_s31+Y_s32+Y_s34+Y_s35)+(Y_p31+Y_p32+Y_p34+Y_p35)\n",
+ "Y_34 = -Y_s34\n",
+ "Y_35 = -Y_s35\n",
+ "Y_31 = Y_13\n",
+ "Y_32 = Y_23\n",
+ "Y_33 = (Y_s31+Y_s32+Y_s34+Y_s35)+(Y_p31+Y_p32+Y_p34+Y_p35)\n",
+ "Y_34 = -Y_s34\n",
+ "Y_35 = -Y_s35\n",
+ "\n",
+ "#IV row\n",
+ "Y_s41 = Y_s14\n",
+ "Y_p41 = Y_p14\n",
+ "Y_s42 = Y_s24\n",
+ "Y_p42 = Y_p24\n",
+ "Y_s43 = Y_s34\n",
+ "Y_p43 = Y_p34\n",
+ "Y_41 = Y_14\n",
+ "Y_42 = Y_24\n",
+ "Y_43 = Y_34\n",
+ "Y_44 = (Y_s41+Y_s42+Y_s43+Y_s45)+(Y_p41+Y_p42+Y_p43+Y_p45)\n",
+ "Y_45 = -Y_s45\n",
+ "\n",
+ "#V row\n",
+ "Y_s51 = Y_s15\n",
+ "Y_p51 = Y_p15\n",
+ "Y_s52 = Y_s25\n",
+ "Y_p52 = Y_p25\n",
+ "Y_s53 = Y_s35\n",
+ "Y_p53 = Y_p35\n",
+ "Y_s54 = Y_s45\n",
+ "Y_p54 = Y_p45\n",
+ "Y_51 = Y_15\n",
+ "Y_52 = Y_25\n",
+ "Y_53 = Y_35\n",
+ "Y_54 = Y_45\n",
+ "Y_55 = (Y_s51+Y_s52+Y_s53+Y_s54)+(Y_p51+Y_p52+Y_p53+Y_p54)\n",
+ "\n",
+ "Y_bus = [[Y_11, Y_12, Y_13, Y_14, Y_15],\n",
+ " [Y_21, Y_22, Y_23, Y_24, Y_25],\n",
+ " [Y_31, Y_32, Y_33, Y_34, Y_35],\n",
+ " [Y_41, Y_42, Y_43, Y_44, Y_45],\n",
+ " [Y_51, Y_52, Y_53, Y_54, Y_55]]\n",
+ "\n",
+ "#Result\n",
+ "print('The Y bus matrix for the five-bus system is :\\n')\n",
+ "print(array(Y_bus))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Y bus matrix for the five-bus system is :\n",
+ "\n",
+ "[[ 5.68-38.143j -2.96+20.16j -0.00 -0.j -0.00 -0.j -2.72+18.32j ]\n",
+ " [-2.96+20.16j 7.44-52.686j -3.00+22.8j -0.00 -0.j -1.48+10.3j ]\n",
+ " [-0.00 -0.j -3.00+22.8j 5.96-42.698j -2.96+20.16j -0.00 -0.j ]\n",
+ " [-0.00 -0.j -0.00 -0.j -2.96+20.16j 5.96-42.698j -3.00+22.8j ]\n",
+ " [-2.72+18.32j -1.48+10.3j -0.00 -0.j -3.00+22.8j 7.20-50.813j]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page number 313-314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find voltage,generated power,real & reactive power loss\n",
+ "\n",
+ "#Variable declaration\n",
+ "V_1 = complex(1.04,0) #Voltage at bus 1(p.u)\n",
+ "S_D1 = complex(0.55,0.15) #Power at bus 1(p.u)\n",
+ "S_D2 = complex(1.0,0.3) #Power at bus 2(p.u)\n",
+ "Y_11 = complex(0.988,-9.734) #Admittance at bus 1(p.u)\n",
+ "Y_22 = Y_11 #Admittance at bus 2(p.u)\n",
+ "Y_12 = complex(-0.988,9.9) #Admittance b/w bus 1 & 2(p.u)\n",
+ "Y_21 = Y_12 #Admittance b/w bus 2 & 1(p.u)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "import cmath\n",
+ "V_2_0 = complex(1,0) #Initial value of V_2 \n",
+ "S_2 = complex(-1,0.3) #P_2+j*Q_2\n",
+ "V_2_1 = (1/Y_22)*((S_2/V_2_0.conjugate())-Y_21*V_1)\n",
+ "V_2_2 = (1/Y_22)*((S_2/V_2_1.conjugate())-Y_21*V_1)\n",
+ "V_2_3 = (1/Y_22)*((S_2/V_2_2.conjugate())-Y_21*V_1)\n",
+ "V_2_4 = (1/Y_22)*((S_2/V_2_3.conjugate())-Y_21*V_1)\n",
+ "V_2_5 = (1/Y_22)*((S_2/V_2_4.conjugate())-Y_21*V_1)\n",
+ "V_2 = V_2_5 #Voltage 2(p.u)\n",
+ "S_1_con = V_1.conjugate()*Y_11*V_1 + V_1.conjugate()*Y_12*V_2 #Conjugate of slack bus net power\n",
+ "S_1 = S_1_con.conjugate()\n",
+ "S_G1 = S_1 + S_D1 #Generated power at bus 1(p.u)\n",
+ "P_L = S_G1.real - (S_D1.real + S_D2.real) #Real power loss(p.u)\n",
+ "Q_L = S_G1.imag - (S_D1.imag + S_D2.imag) #Reactive power loss(p.u)\n",
+ "\n",
+ "#Result\n",
+ "print('Voltage at bus 2 , V_2 = %.4f\u2220%.2f\u00b0 p.u' %(abs(V_2),(cmath.phase(V_2)*180/math.pi)))\n",
+ "print('Generated power at bus 1 , S_G1 = (%.2f + j%.3f) p.u' %(S_G1.real,S_G1.imag))\n",
+ "print('Real power loss in the system = %.2f p.u' %P_L)\n",
+ "print('Reactive power loss in the system = %.3f p.u' %Q_L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage at bus 2 , V_2 = 1.0128\u2220-5.38\u00b0 p.u\n",
+ "Generated power at bus 1 , S_G1 = (1.56 + j0.199) p.u\n",
+ "Real power loss in the system = 0.01 p.u\n",
+ "Reactive power loss in the system = -0.251 p.u\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/README.txt b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/README.txt
new file mode 100644
index 00000000..6e8a4b95
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/README.txt
@@ -0,0 +1,10 @@
+Contributed By: KAVAN A B
+Course: be
+College/Institute/Organization: SRI JAYACHAMARAJENDRA COLLEGE OF ENGINEERING
+Department/Designation: ELECTRICAL & ELECTRONICS
+Book Title: Electrical Power Systems: Concepts, Theory and Practice
+Author: Subir Ray
+Publisher: Prentice Hall of India Private Limited(PHI), New Delhi-110001
+Year of publication: 2007
+Isbn: 9788120329898
+Edition: 1 \ No newline at end of file
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1.png
new file mode 100644
index 00000000..f40cf8e9
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_1.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_1.png
new file mode 100644
index 00000000..f40cf8e9
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_1.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_2.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_2.png
new file mode 100644
index 00000000..8fd3190d
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/1_2.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2.png
new file mode 100644
index 00000000..033d3704
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_1.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_1.png
new file mode 100644
index 00000000..033d3704
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_1.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_2.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_2.png
new file mode 100644
index 00000000..f40cf8e9
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/2_2.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3.png
new file mode 100644
index 00000000..8fd3190d
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_1.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_1.png
new file mode 100644
index 00000000..8fd3190d
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_1.png
Binary files differ
diff --git a/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_2.png b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_2.png
new file mode 100644
index 00000000..033d3704
--- /dev/null
+++ b/Electrical_Power_Systems:_Concepts,_Theory_and_Practice/screenshots/3_2.png
Binary files differ
diff --git a/Electronic_Devices_/Chapter1.ipynb b/Electronic_Devices_/Chapter1.ipynb
new file mode 100644
index 00000000..68dac58e
--- /dev/null
+++ b/Electronic_Devices_/Chapter1.ipynb
@@ -0,0 +1,158 @@
+{
+ "metadata": {
+ "name": "Chapter_1"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 1: Semiconductor Basics<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.1(a), Page Number:29<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltages of different models'''",
+ "",
+ "# variable declaration",
+ "V_bias=10.0; #bias voltage in volt",
+ "R_limit=1000; #limiting resistance in ohm",
+ "r_d =10.0; #r_d value",
+ "",
+ "#calculation",
+ "#IDEAL MODEL",
+ "print \"IDEAL MODEL\"",
+ "V_f=0; #voltage in volt",
+ "I_f=V_bias/R_limit; #foward current",
+ "V_R_limit=I_f*R_limit; #limiting voltage",
+ "print \"forward voltage = %.2f volts\" %V_f",
+ "print \"forward current = %.2f amperes\" %I_f",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#PRACTICAL MODEL",
+ "print \"\\nPRACTICAL MODEL\"",
+ "V_f=0.7; #voltage in volt",
+ "I_f=(V_bias-V_f)/R_limit; #foward current",
+ "V_R_limit=I_f*R_limit; #limiting voltage",
+ "print \"forward voltage = %.2f volts\" %V_f",
+ "print \"forward current = %.3f amperes\" %I_f",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#COMPLETE MODEL",
+ "print \"\\nCOMPLETE MODEL\"",
+ "I_f=(V_bias-0.7)/(R_limit+r_d); #foward current",
+ "V_f=0.7+I_f*r_d; #forward voltage",
+ "V_R_limit=I_f*R_limit; #limiting voltage",
+ "print \"forward voltage = %.3f volts\" %V_f",
+ "print \"forward current = %.3f amperes\" %I_f",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IDEAL MODEL",
+ "forward voltage = 0.00 volts",
+ "forward current = 0.01 amperes",
+ "voltage across limiting resistor = 10.00 volts",
+ "",
+ "PRACTICAL MODEL",
+ "forward voltage = 0.70 volts",
+ "forward current = 0.009 amperes",
+ "voltage across limiting resistor = 9.30 volts",
+ "",
+ "COMPLETE MODEL",
+ "forward voltage = 0.792 volts",
+ "forward current = 0.009 amperes",
+ "voltage across limiting resistor = 9.21 volts"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.1(b), Page Number:29<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltages of different models'''",
+ "",
+ "# variable declaration",
+ "V_bias=5; #bias voltage in volt",
+ "I_R=1*10**-6; #current",
+ "R_limit=1000 #in Ohm",
+ "",
+ "#calculation",
+ "#IDEAL MODEL",
+ "print \"IDEAL MODEL\"",
+ "I_r=0.0; #current in ampere",
+ "V_R=V_bias; #voltages are equal",
+ "V_R_limit=I_r*R_limit; #limiting voltage",
+ "print \"Reverse voltage across diode = %.2f volts\" %V_R",
+ "print \"Reverse current through diode= %.2f amperes\" %I_r",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#PRACTICAL MODEL",
+ "print \"\\nPRACTICAL MODEL\"",
+ "I_r=0.0; #current in ampere",
+ "V_R=V_bias; #voltages are equal",
+ "V_R_limit=I_r*R_limit; #limiting voltage",
+ "print \"Reverse voltage across diode= %.2f volts\" %V_R",
+ "print \"Reverse current through diode = %.2f amperes\" %I_r",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#COMPLETE MODEL",
+ "print \"\\nCOMPLETE MODEL\"",
+ "I_r=I_R; #current in ampere",
+ "V_R_limit=I_r*R_limit; #limiting voltage",
+ "V_R=V_bias-V_R_limit; #voltage in volt",
+ "print \"Reverse voltage across diode = %.3f volts\" %V_R",
+ "print \"Reverse current through diode = %d micro Amp\" %(I_r*10**6)",
+ "print \"voltage across limiting resistor = %d mV\" %(V_R_limit*1000)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IDEAL MODEL",
+ "Reverse voltage across diode = 5.00 volts",
+ "Reverse current through diode= 0.00 amperes",
+ "voltage across limiting resistor = 0.00 volts",
+ "",
+ "PRACTICAL MODEL",
+ "Reverse voltage across diode= 5.00 volts",
+ "Reverse current through diode = 0.00 amperes",
+ "voltage across limiting resistor = 0.00 volts",
+ "",
+ "COMPLETE MODEL",
+ "Reverse voltage across diode = 4.999 volts",
+ "Reverse current through diode = 1 micro Amp",
+ "voltage across limiting resistor = 1 mV"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter10.ipynb b/Electronic_Devices_/Chapter10.ipynb
new file mode 100644
index 00000000..8864497b
--- /dev/null
+++ b/Electronic_Devices_/Chapter10.ipynb
@@ -0,0 +1,719 @@
+{
+ "metadata": {
+ "name": "Chapter_10"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 10: Amplifier Frequency Response<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.1, Page Number: 311<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gain in decibel'''",
+ "",
+ "import math",
+ "#Pout/P in=250;",
+ "A_p=250.0",
+ "A_p_dB=10*math.log10(A_p)",
+ "print('Power gain(dB) when power gain is 250 = %d'% math.ceil(A_p_dB));",
+ "A_p=100.0",
+ "A_p_dB=10*math.log10(A_p)",
+ "print('Power gain(dB) when power gain is 100 = %d'%A_p_dB)",
+ "A_p=10.0",
+ "A_p_dB=20*math.log10(A_p)",
+ "print('Voltage gain(dB) when Voltage gain is 10 = %d'%A_p_dB)",
+ "A_p=0.50",
+ "A_p_dB=10*math.log10(A_p)",
+ "print('Power gain(dB) when voltage gain is 0.50 = %d'%A_p_dB)",
+ "A_p=0.707",
+ "A_p_dB=20*math.log10(A_p)",
+ "print('Power gain(dB) when power gain is 0.707 = %d'%A_p_dB)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain(dB) when power gain is 250 = 24",
+ "Power gain(dB) when power gain is 100 = 20",
+ "Voltage gain(dB) when Voltage gain is 10 = 20",
+ "Power gain(dB) when voltage gain is 0.50 = -3",
+ "Power gain(dB) when power gain is 0.707 = -3"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.2, Page Number: 313<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gain in decibel'''",
+ "",
+ "",
+ "#input voltage=10V",
+ "#at -3dB voltage gain from table is 0.707",
+ "v_out=0.707*10;",
+ "print('output voltage in volts at -3dB gain = %.2f'%v_out)",
+ "#at -6dB voltage gain from table is 0.5",
+ "v_out=0.5*10;",
+ "print('output voltage in volts at -6dB gain = %d'%v_out)",
+ "#at -12dB voltage gain from table is 0.25",
+ "v_out=0.25*10;",
+ "print('output voltage in volts at -12dB gain = %.1f'%v_out)",
+ "#at -24dB voltage gain from table is 0.0625",
+ "v_out=0.0625*10;",
+ "print('output voltage in volts at -24dB gain = %.3f'%v_out)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage in volts at -3dB gain = 7.07",
+ "output voltage in volts at -6dB gain = 5",
+ "output voltage in volts at -12dB gain = 2.5",
+ "output voltage in volts at -24dB gain = 0.625"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.3, Page Number: 316<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Lower critical frequency'''",
+ "",
+ "import math",
+ "R_in=1.0*10**3;",
+ "C1=1.0*10**-6;",
+ "A_v_mid=100.0; #mid range voltage gain",
+ "f_c=1/(2*math.pi*R_in*C1);",
+ "#at f_c, capacitive reactance is equal to resistance(X_C1=R_in)",
+ "attenuation=0.707;",
+ "#A_v is gain at lower critical frequency",
+ "A_v=0.707*A_v_mid;",
+ "print('lower critical frequency = %f Hz'%f_c)",
+ "print('attenuation at lower critical frequency =%.3f'%attenuation)",
+ "print('gain at lower critical frequency = %.1f'%A_v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lower critical frequency = 159.154943 Hz",
+ "attenuation at lower critical frequency =0.707",
+ "gain at lower critical frequency = 70.7"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.4, Page Number: 317<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage gains'''",
+ "",
+ "A_v_mid=100.0;",
+ "#At 1Hz frequency,voltage gain is 3 dB less than at midrange. At -3dB, the voltage is reduced by a factor of 0.707",
+ "A_v=0.707*A_v_mid;",
+ "print('actual voltage gain at 1Hz frequency = %.1f'%A_v)",
+ "#At 100Hz frequency,voltage gain is 20 dB less than at critical frequency (f_c ). At -20dB, the voltage is reduced by a factor of 0.1",
+ "A_v=0.1*A_v_mid;",
+ "print('actual voltage gain at 100Hz frequency = %d'%A_v)",
+ "#At 10Hz frequency,voltage gain is 40 dB less than at critical frequency (f_c). At -40dB, the voltage is reduced by a factor of 0.01",
+ "A_v=0.01*A_v_mid;",
+ "print('actual voltage gain at 10Hz frequency = %d'%A_v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "actual voltage gain at 1Hz frequency = 70.7",
+ "actual voltage gain at 100Hz frequency = 10",
+ "actual voltage gain at 10Hz frequency = 1"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.5, Page Number: 319<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Output RC circuit'''",
+ "",
+ "import math",
+ "R_C=10.0*10**3;",
+ "C3=0.1*10**-6;",
+ "R_L=10*10**3;",
+ "A_v_mid=50;",
+ "f_c=1/(2*math.pi*(R_L+R_C)*C3);",
+ "print('lower critical frequency = %f Hz'%f_c)",
+ "#at midrange capacitive reactance is zero",
+ "X_C3=0;",
+ "attenuation=R_L/(R_L+R_C); ",
+ "print('attenuation at midrange frequency = %.1f'%attenuation)",
+ "#at critical frequency, capacitive reactance equals total resistance",
+ "X_C3=R_L+R_C;",
+ "attenuation=R_L/(math.sqrt((R_C+R_L)**2+X_C3**2));",
+ "print('attenuation at critical frequency = %f'%attenuation)",
+ "A_v=0.707*A_v_mid;",
+ "print('gain at critical frequency = %.2f'%A_v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lower critical frequency = 79.577472 Hz",
+ "attenuation at midrange frequency = 0.5",
+ "attenuation at critical frequency = 0.353553",
+ "gain at critical frequency = 35.35"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.6, Page Number: 321<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bypass RC circuit BJT'''",
+ "",
+ "import math",
+ "B_ac=100.0;",
+ "r_e=12.0;",
+ "R1=62.0*10**3;",
+ "R2=22.0*10**3;",
+ "R_S=1.0*10**3;",
+ "R_E=1.0*10**3;",
+ "C2=100.0*10**-6;",
+ "#Base circuit impedance= parallel combination of R1, R2, R_S",
+ "R_th=(R1*R2*R_S)/(R1*R2+R2*R_S+R_S*R1);",
+ "#Resistance looking at emitter",
+ "R_in_emitter=r_e+(R_th/B_ac);",
+ "#resistance of equivalent bypass RC is parallel combination of R_E,R_in_emitter",
+ "R=(R_in_emitter*R_E)/(R_E+R_in_emitter);",
+ "f_c=1/(2*math.pi*R*C2);",
+ "print('critical frequency of bypass RC circuit = %f Hz'%f_c)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical frequency of bypass RC circuit = 75.893960 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.7, Page Number:323<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''input RC circuit FET'''",
+ "",
+ "import math",
+ "V_GS=-10.0;",
+ "I_GSS=25.0*10**-9;",
+ "R_G=10.0*10**6;",
+ "C1=0.001*10**-6;",
+ "R_in_gate=abs((V_GS/I_GSS));",
+ "R_in=(R_in_gate*R_G)/(R_G+R_in_gate);",
+ "f_c=1/(2*math.pi*R_in*C1);",
+ "print('critical frequency = %f Hz'%f_c)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical frequency = 16.313382 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.8, Page Number: 324<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Low frequency response FET'''",
+ "",
+ "import math",
+ "V_GS=-12.0;",
+ "I_GSS=100.0*10**-9;",
+ "R_G=10.0*10**6;",
+ "R_D=10.0*10**3;",
+ "C1=0.001*10**-6;",
+ "C2=0.001*10**-6;",
+ "R_in_gate=abs((V_GS/I_GSS));",
+ "R_in=(R_in_gate*R_G)/(R_G+R_in_gate);",
+ "R_L=R_in; #according to question",
+ "f_c_input=1/(2*math.pi*R_in*C1);",
+ "print('critical frequency of input RC circuit = %f Hz'%f_c_input)",
+ "f_c_output=1/(2*math.pi*(R_D+R_L)*C2)",
+ "print('critical frequency of output RC circuit = %f Hz'%f_c_output)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical frequency of input RC circuit = 17.241786 Hz",
+ "critical frequency of output RC circuit = 17.223127 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.9, Page Number: 327<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Low frequency response BJT'''",
+ "",
+ "import math",
+ "B_ac=100.0;",
+ "r_e=16.0;",
+ "R1=62.0*10**3;",
+ "R2=22.0*10**3;",
+ "R_S=600.0;",
+ "R_E=1.0*10**3;",
+ "R_C=2.2*10**3;",
+ "R_L=10.0*10**3;",
+ "C1=0.1*10**-6;",
+ "C2=10.0*10**-6;",
+ "C3=0.1*10**-6;",
+ "#input RC circuit",
+ "R_in=(B_ac*r_e*R1*R2)/(B_ac*r_e*R1+B_ac*r_e*R2+R1*R2);",
+ "f_c_input=1/(2*math.pi*(R_S+R_in)*C1);",
+ "print('input frequency = %f Hz'%f_c_input)",
+ "#For bypass circuit; Base circuit impedance= parallel combination of R1, R2, R_S",
+ "R_th=(R1*R2*R_S)/(R1*R2+R2*R_S+R_S*R1);",
+ "#Resistance looking at emitter",
+ "R_in_emitter=r_e+(R_th/B_ac);",
+ "#resistance of equivalent bypass RC is parallel combination of R_E,R_in_emitter",
+ "R=(R_in_emitter*R_E)/(R_E+R_in_emitter);",
+ "f_c_bypass=1/(2*math.pi*R*C2);",
+ "print('critical frequency of bypass RC circuit = %f Hz'%f_c_bypass)",
+ "f_c_output=1/(2*math.pi*(R_C+R_L)*C3)",
+ "print('output frequency circuit = %f Hz'%f_c_output)",
+ "R_c=R_C*R_L/(R_C+R_L);",
+ "A_v_mid=R_c/r_e;",
+ "attenuation=R_in/(R_in+R_S);",
+ "A_v=attenuation*A_v_mid; #overall voltage gain",
+ "A_v_mid_dB=20*math.log10(A_v); ",
+ "print('overall voltage gain in dB = %f'%A_v_mid_dB)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input frequency = 773.916632 Hz",
+ "critical frequency of bypass RC circuit = 746.446517 Hz",
+ "output frequency circuit = 130.454871 Hz",
+ "overall voltage gain in dB = 38.042470"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.10, Page Number: 330<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''input RC circuit BJT'''",
+ "",
+ "import math",
+ "B_ac=125.0;",
+ "C_be=20.0*10**-12;",
+ "C_bc=2.4*10**-12;",
+ "R1=22.0*10**3;",
+ "R2=4.7*10**3;",
+ "R_E=470.0;",
+ "R_S=600.0;",
+ "R_L=2.2*10**3;",
+ "V_CC=10.0;",
+ "V_B=(R2/(R1+R2))*V_CC;",
+ "V_E=V_B-0.7;",
+ "I_E=V_E/R_E;",
+ "r_e=25.0*10**-3/I_E;",
+ "#total resistance of input circuit is parallel combination of R1,R2,R_s,B_ac*r_e",
+ "R_in_tot=B_ac*r_e*R1*R2*R_S/(B_ac*r_e*R1*R2+B_ac*r_e*R1*R_S+B_ac*r_e*R2*R_S+R1*R2*R_S);",
+ "R_c= 1100.0#R_C*R_L/(R_C+R_L)",
+ "A_v_mid=R_c/r_e;",
+ "C_in_Miller=C_bc*(A_v_mid+1)",
+ "C_in_tot=C_in_Miller+C_be;",
+ "C_in_tot=C_in_tot*10**10",
+ "f_c=1/(2*math.pi*R_in_tot*C_in_tot);",
+ "print('total resistance of circuit = %f Ohm'%R_in_tot)",
+ "print('total capacitance = %f * 10^-10 F'%C_in_tot)",
+ "print('critical frequency = %f Hz'%f_c)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total resistance of circuit = 377.815676 Ohm",
+ "total capacitance = 2.606290 * 10^-10 F",
+ "critical frequency = 0.000162 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.11, Page Number: 333<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Critical frequency BJT output'''",
+ "",
+ "import math",
+ "C_bc=2.4*10**-12; #from previous question",
+ "A_v=99.0; #from previous question",
+ "R_C=2.2*10**3;",
+ "R_L=2.2*10**3;",
+ "R_c=R_C*R_L/(R_C+R_L);",
+ "C_out_Miller=C_bc*(A_v+1)/A_v;",
+ "f_c=1/(2*math.pi*R_c*C_bc); #C_bc is almost equal to C_in_Miller",
+ "C_out_Miller=C_out_Miller*10**12",
+ "print('equivalent resistance = %d Ohm'%R_c)",
+ "print('equivalent capacitance =%f *10^-12 F'%C_out_Miller)",
+ "print('critical frequency =%f Hz'%f_c)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "equivalent resistance = 1100 Ohm",
+ "equivalent capacitance =2.424242 *10^-12 F",
+ "critical frequency =60285963.292385 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.12, Page Number: 334<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''FET capacitors'''",
+ "",
+ "C_iss=6.0*10**-12;",
+ "C_rss=2.0*10**-12;",
+ "C_gd=C_rss;",
+ "C_gs=C_iss-C_rss;",
+ "C_gd=C_gd*10**12",
+ "C_gs=C_gs*10**12",
+ "print('gate to drain capacitance = %.1f * 10^-12 F'%C_gd)",
+ "print('gate to source capacitance = %.1f * 10^-12 F'%C_gs)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gate to drain capacitance = 2.0 * 10^-12 F",
+ "gate to source capacitance = 4.0 * 10^-12 F"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.13, Page Number:335 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Critical frequency FET input'''",
+ "",
+ "import math",
+ "C_iss=8.0*10**-12;",
+ "C_rss=3.0*10**-12;",
+ "g_m=6500.0*10**-6; #in Siemens",
+ "R_D=1.0*10**3;",
+ "R_L=10.0*10**6;",
+ "R_s=50.0;",
+ "C_gd=C_rss;",
+ "C_gs=C_iss-C_rss;",
+ "R_d=R_D*R_L/(R_D+R_L);",
+ "A_v=g_m*R_d;",
+ "C_in_Miller=C_gd*(A_v+1);",
+ "C_in_tot=C_in_Miller+C_gs;",
+ "f_c=1/(2*math.pi*C_in_tot*R_s);",
+ "print('critical frequency of input RC circuit =%.3f *10^8 Hz'%(f_c*10**-8))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical frequency of input RC circuit =1.158 *10^8 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.14, Page Number: 336<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Critical frequency FET input'''",
+ "",
+ "import math",
+ "C_gd=3.0*10**-12; #from previous question",
+ "A_v=6.5; #from previous question",
+ "R_d=1.0*10**3; #from previous question",
+ "C_out_Miller=C_gd*(A_v+1)/A_v;",
+ "f_c=1/(2*math.pi*R_d*C_out_Miller);",
+ "print('critical frequency of the output circuit = %d Hz'%f_c)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical frequency of the output circuit = 45978094 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.15, Page Number: 339<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bandwidth'''",
+ "",
+ "f_cu=2000.0;",
+ "f_cl=200.0;",
+ "BW=f_cu-f_cl;",
+ "print('bandwidth = %d Hz'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bandwidth = 1800 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.16, Page Number: 340<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bandwidth transistor'''",
+ "",
+ "f_T=175.0*10**6; #in hertz",
+ "A_v_mid=50.0;",
+ "BW=f_T/A_v_mid;",
+ "print('bandwidth = %d Hz'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bandwidth = 3500000 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.17, Page Number: 341<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bandwidth 2stage amplifier'''",
+ "",
+ "f_cl=1.0*10**3; #lower critical frequency of 2nd stage in hertz",
+ "f_cu=100.0*10**3; #upper critical frequency of 1st stage in hertz",
+ "BW=f_cu-f_cl;",
+ "print('bandwidth = %d Hz'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bandwidth = 99000 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.18, Page Number: 341<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Bandwidth 2stage amplifier'''",
+ "",
+ "import math",
+ "n=2.0; #n is the number of stages of amplifier",
+ "f_cl=500.0;",
+ "f_cu=80.0*10**3;",
+ "f_cl_new=f_cl/(math.sqrt(2**(1/n)-1));",
+ "f_cu_new=f_cu*(math.sqrt(2**(1/n)-1));",
+ "BW=f_cu_new-f_cl_new;",
+ "print('bandwidth = %f Hz'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bandwidth = 50710.653245 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter11.ipynb b/Electronic_Devices_/Chapter11.ipynb
new file mode 100644
index 00000000..fc60eac9
--- /dev/null
+++ b/Electronic_Devices_/Chapter11.ipynb
@@ -0,0 +1,177 @@
+{
+ "metadata": {
+ "name": "Chapter_11"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 11: Thyristors and other Devices<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 11.1, Page Number: 353<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Four layer diode'''",
+ "",
+ "V_AK=20.0; #VOLTAGE ACROSS ANODE",
+ "I_A=1*10**-6;",
+ "R_AK=V_AK/I_A;",
+ "print('Resistance = %d * 10^6 Ohm'%(R_AK/10**6))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance = 20 * 10^6 Ohm"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 11.2, Page Number: 354<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Anode current'''",
+ "",
+ "R_S=10**3;",
+ "V_BIAS=110.0;",
+ "V_BE=0.7;",
+ "V_CE_sat=0.1;",
+ "V_A=V_BE+V_CE_sat; #VOLTAGE ACROSS ANODE",
+ "V_R_s=V_BIAS-V_A; #VOLTAGE ACROSS R_S",
+ "I_A=V_R_s/R_S;",
+ "print('Anode current = %f A'%I_A)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Anode current = 0.109200 A"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 11.3, Page Number: 364<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Unijunction transistor'''",
+ "",
+ "n=0.6;",
+ "V_BB=20.0;",
+ "V_pn=0.7;",
+ "V_P=n*V_BB+V_pn;",
+ "print('peak point emitter voltage = %.1f Volts'%V_P)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak point emitter voltage = 12.7 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 11.4, page Number: 366<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''turn on off UJT'''",
+ "",
+ "V_BB=30.0;",
+ "V_P=14.0;",
+ "I_P=20.0*10**-6;",
+ "V_V=1.0;",
+ "I_V=10.0*10**-3;",
+ "x=(V_BB-V_P)/I_P;",
+ "y=(V_BB-V_V)/I_V;",
+ "print('R1 should be less than %d Ohms'%x)",
+ "print('R1 should be more than %d Ohms'%y)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 should be less than 800000 Ohms",
+ "R1 should be more than 2900 Ohms"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 11.5, Page Number: 376<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Critical Angle'''",
+ "",
+ "import math",
+ "n2=1.3; #cladding index",
+ "n1=1.35; #core index",
+ "theta=math.acos(n2/n1);",
+ "t=theta*180/math.pi;",
+ "print('critical angle in degrees \\n\\t%f'%t)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical angle in degrees ",
+ "\t15.642471"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter12.ipynb b/Electronic_Devices_/Chapter12.ipynb
new file mode 100644
index 00000000..6ec53a3f
--- /dev/null
+++ b/Electronic_Devices_/Chapter12.ipynb
@@ -0,0 +1,470 @@
+{
+ "metadata": {
+ "name": "Chapter_12"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 12: The Operational Amplifier<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.1, Page Number: 392<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''CMRR opamp'''",
+ "",
+ "import math",
+ "A_ol=100000.0; #open loop voltage gain",
+ "A_cm=0.2; #common mode gain",
+ "CMRR=A_ol/A_cm;",
+ "CMRR_dB=20*math.log10(CMRR);",
+ "print('CMRR = %d'%CMRR)",
+ "print('CMRR in decibels = %f'%CMRR_dB)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CMRR = 500000",
+ "CMRR in decibels = 113.979400"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.2, Page Number: 395<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Slew rate'''",
+ "",
+ "del_t=1.0; # in microseconds",
+ "#lower limit is -9V and upper limit is 9V from the graph",
+ "del_V_out=9.0-(-9.0);",
+ "slew_rate=del_V_out/del_t;",
+ "print('slew rate =%d V/microseconds'%slew_rate)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "slew rate =18 V/microseconds"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.3, Page Number: 400<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Non inverting amplifier'''",
+ "",
+ "R_f=100*10**3;",
+ "R_i=4.7*10**3;",
+ "A_cl_NI=1+(R_f/R_i);",
+ "print('closed loop voltage gain = %f'%A_cl_NI)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop voltage gain = 22.276596"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.4,Page Number: 402<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Inverting amplifier'''",
+ "",
+ "R_i=2.2*10**3;",
+ "A_cl=-100.0; #closed loop voltage gain",
+ "R_f=abs(A_cl)*R_i;",
+ "print('value of R_f = %d ohms'%R_f)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of R_f = 220000 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.5, Page Number: 404<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Impedance noninverting amplifier'''",
+ "",
+ "Z_in=2*10**6;",
+ "Z_out=75.0;",
+ "A_ol=200000.0;",
+ "R_f=220.0*10**3;",
+ "R_i=10.0*10**3;",
+ "B=R_i/(R_i+R_f); #B is attenuation",
+ "Z_in_NI=(1+A_ol*B)*Z_in;",
+ "Z_out_NI=Z_out/(1+A_ol*B);",
+ "A_cl_NI=1+(R_f/R_i);",
+ "Z_in_NI=Z_in_NI/10**10",
+ "print('input impedance = %f * 10^10 ohms'%Z_in_NI)",
+ "print('output impedance = %f ohms'%Z_out_NI)",
+ "print('closed loop voltage gain = %d'%A_cl_NI)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance = 1.739330 * 10^10 ohms",
+ "output impedance = 0.008624 ohms",
+ "closed loop voltage gain = 23"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.6, Page Number: 405<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage follower impedance'''",
+ "",
+ "B=1.0; #voltage follower configuration",
+ "A_ol=200000.0;",
+ "Z_in=2*10**6;",
+ "Z_out=75.0;",
+ "Z_in_VF=(1+A_ol)*Z_in;",
+ "Z_out_VF=Z_out/(1+A_ol);",
+ "Z_in_VF=Z_in_VF*10**-11",
+ "print('input impedance = %d * 10^11 Ohms'%Z_in_VF)",
+ "print('output impedance = %f Ohms'%Z_out_VF)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance = 4 * 10^11 Ohms",
+ "output impedance = 0.000375 Ohms"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.7, Page Number: 406<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Impedance inverting amplifier'''",
+ "",
+ "R_i=1.0*10**3;",
+ "R_f=100.0*10**3;",
+ "Z_in=4.0*10**6;",
+ "Z_out=50.0;",
+ "A_ol=50000.0;",
+ "B=R_i/(R_i+R_f); #attenuation",
+ "Z_in_I=R_i; #almost equal to R_i",
+ "Z_out_I=Z_out/(1+(A_ol*B));",
+ "A_cl_I=-R_f/R_i;",
+ "print('input impedance = %d Ohms'%Z_in_I)",
+ "print('output impedance = %f Ohms'%Z_out_I)",
+ "print('closed loop voltage gain =%d'%A_cl_I)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance = 1000 Ohms",
+ "output impedance = 0.100796 Ohms",
+ "closed loop voltage gain =-100"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.8, Page Number: 412<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Open Loop gain'''",
+ "",
+ "import math",
+ "f_c_ol=100.0;",
+ "A_ol_mid=100000.0;",
+ "f=0.0;",
+ "A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
+ "print('open loop gain when f=0Hz is %f'%A_ol);",
+ "f=10.0;",
+ "A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
+ "print('open loop gain when f=10Hz is %f'%A_ol)",
+ "f=100.0;",
+ "A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
+ "print('open loop gain when f=100Hz is %f'%A_ol)",
+ "f=1000.0;",
+ "A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
+ "print('open loop gain when f=1000Hz is %f'%A_ol)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "open loop gain when f=0Hz is 100000.000000",
+ "open loop gain when f=10Hz is 99503.719021",
+ "open loop gain when f=100Hz is 70710.678119",
+ "open loop gain when f=1000Hz is 9950.371902"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.9,Page Number: 413<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''phase RC lag'''",
+ "",
+ "import math",
+ "f_c=100.0;",
+ "f=1.0;",
+ "theta_rad=-math.atan((f/f_c))",
+ "theta=theta_rad*180/math.pi;",
+ "print('phase lag when f=1Hz = %f degrees'%theta)",
+ "",
+ "f=10.0;",
+ "theta_rad=-math.atan((f/f_c))",
+ "theta=theta_rad*180/math.pi;",
+ "print('phase lag when f=10Hz = %f degrees'%theta)",
+ "f=100.0;",
+ "theta_rad=-math.atan((f/f_c))",
+ "theta=theta_rad*180/math.pi; ",
+ "print('phase lag when f=100Hz = %f degrees'%theta)",
+ "f=1000.0;",
+ "theta_rad=-math.atan((f/f_c))",
+ "theta=theta_rad*180/math.pi;",
+ "print('phase lag when f=1000Hz = %f degrees'%theta)",
+ "f=10000.0;",
+ "theta_rad=-math.atan((f/f_c))",
+ "theta=theta_rad*180/math.pi;",
+ "print('phase lag when f=10000Hz = %f degrees'%theta)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "phase lag when f=1Hz = -0.572939 degrees",
+ "phase lag when f=10Hz = -5.710593 degrees",
+ "phase lag when f=100Hz = -45.000000 degrees",
+ "phase lag when f=1000Hz = -84.289407 degrees",
+ "phase lag when f=10000Hz = -89.427061 degrees"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.10, Page Number: 415<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gain and phase lag'''",
+ "",
+ "import math",
+ "A_v1=40.0; #all gains are in decibels",
+ "A_v2=32.0;",
+ "A_v3=20.0;",
+ "f_c1=2*10**3;",
+ "f_c2=40*10**3;",
+ "f_c3=150*10**3;",
+ "f=f_c1;",
+ "A_ol_mid=A_v1+A_v2+A_v3;",
+ "#theta 1",
+ "theta_rad1=-math.atan((f/f_c1))",
+ "theta1=theta_rad1*180/math.pi;",
+ "",
+ "#theta 2",
+ "theta_rad2=-math.atan((f/f_c2))",
+ "theta2=theta_rad2*180/math.pi;",
+ "",
+ "#theta 3",
+ "theta_rad3=-math.atan((f/f_c3))",
+ "theta3=theta_rad3*180/math.pi;",
+ "",
+ "theta_tot=theta1+theta2+theta3;",
+ "print('open loop midrange gain in decibels is %d'%A_ol_mid)",
+ "print('total phase lag in degrees is %d'%theta_tot)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "open loop midrange gain in decibels is 92",
+ "total phase lag in degrees is -45"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.11, Page Number: 416<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Closed loop bandwidth'''",
+ "",
+ "A_ol_mid=150000.0; #open loop midrange gain",
+ "B=0.002; #feedback attenuation",
+ "BW_ol=200; #open loop bandwidth",
+ "BW_cl=BW_ol*(1+B*A_ol_mid);",
+ "print('closed loop bandwidth = %d Hz'%BW_cl)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop bandwidth = 60200 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 12.12, Page Number: 417<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Amplifier bandwidth'''",
+ "",
+ "BW=3*10**6; #unity gain bandwidth",
+ "A_ol=100.0; #open loop gain",
+ "print(\"non-inverting amplifier\")",
+ "R_f=220.0*10**3;",
+ "R_i=3.3*10**3;",
+ "A_cl=1+(R_f/R_i); #closed loop gain",
+ "BW_cl=BW/A_cl;",
+ "print('closed loop bandwidth = %f Hz'%BW_cl)",
+ "print(\"inverting amplifier\")",
+ "R_f=47.0*10**3;",
+ "R_i=1.0*10**3;",
+ "A_cl=-R_f/R_i;",
+ "BW_cl=BW/(abs(A_cl));",
+ "print('closed loop bandwidth = %f Hz'%BW_cl)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "non-inverting amplifier",
+ "closed loop bandwidth = 44334.975369 Hz",
+ "inverting amplifier",
+ "closed loop bandwidth = 63829.787234 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter13.ipynb b/Electronic_Devices_/Chapter13.ipynb
new file mode 100644
index 00000000..5669d43d
--- /dev/null
+++ b/Electronic_Devices_/Chapter13.ipynb
@@ -0,0 +1,589 @@
+{
+ "metadata": {
+ "name": "Chapter_13"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 13: Basic Op-amp Circuits<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.1, Page Number: 433<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 177
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Comparator reference voltage'''",
+ "",
+ "import pylab",
+ "import numpy",
+ "",
+ "R2=1.0*10**3;",
+ "R1=8.2*10**3;",
+ "V=15.0;",
+ "V_REF=R2*V/(R1+R2);",
+ "print('V_REF = %f V'%V_REF)",
+ "############PLOT##################################",
+ "",
+ "t = arange(0.001, 2.0, 0.005)",
+ "k = arange(0.0001, 0.0529, 0.0005)",
+ "k1= arange(0.0529, 0.447, 0.0005)",
+ "k2= arange(0.447, 1.053, 0.0005)",
+ "k3= arange(1.053,1.447, 0.0005)",
+ "k4= arange(1.447,2.0, 0.0005)",
+ "m=arange(-12,12,0.0005)",
+ "",
+ "x5=(0.0529*m)/m",
+ "x10=(0.447*m)/m",
+ "x15=(1.053*m)/m",
+ "x25=(1.447*m)/m",
+ "subplot(211)",
+ "plot(t, 5*sin(2*pi*t))",
+ "plot(t,(1.63*t)/t,'--')",
+ "ylim( (-5,5) )",
+ "ylabel('Vin')",
+ "title('Input Waveform')",
+ "",
+ "subplot(212)",
+ "plot(k,-12*k/k,'b')",
+ "plot(k1,12*k1/k1,'b')",
+ "plot(k2,-12*k2/k2,'b')",
+ "plot(k3,12*k3/k3,'b')",
+ "plot(k4,-12*k4/k4,'b')",
+ "plot(x5,m,'b')",
+ "plot(x10,m,'b')",
+ "plot(x15,m,'b')",
+ "plot(x25,m,'b')",
+ "",
+ "ylim( (-13,13) )",
+ "ylabel('Vout')",
+ "xlabel('each time the input exceeds +1.63V,o/p switches to +12 and vice-versa')",
+ "title('Output Waveform')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_REF = 1.630435 V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 178,
+ "text": [
+ "<matplotlib.text.Text at 0x2f58bd2c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEXCAYAAAC6baP3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdYFNfXB/DvglhQMdhQioACAiJFUUSkWCMq9rZ2xcRo\n7ImNqMgv9mhiS4waY429BCtqUMQaLGCJxo6iIAKiFEXaff+4YV6Quri7Mwvn8zw+uLuzM2dnZ+fM\n3CpjjDEQQgghJaQldgCEEEI0CyUOQgghCqHEQQghRCGUOAghhCiEEgchhBCFUOIghBCiEEochEhY\nbGwsPDw8oKenh2nTpokdDiEAKHEQiTEzM0NwcLDKtzNv3jwMHTq00NcXLVqELl265HnO0tKywOf2\n7NmjkhgBYP369ahbty6SkpLwww8/qGw7hCiCEgeRFJlMBplMJnYY8PT0xMWLF5HTPzYmJgaZmZmI\niIhAdna28NyjR4/g4eGhsjiePn0KGxubUr03MzNTydEQwlHiIJK1efNmtGnTBtOmTUPNmjXRsGFD\nBAUFCa97eXlh1qxZcHFxQY0aNdCzZ08kJiYCAEJCQmBiYpJnfTl3M0FBQVi0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M4OrqysAoE+fPpg9e3ae944bNw59+vTB1q1b0blz5zyV7AVtq1KlSli/fj26du0KXV1duLu7\nF9ioBeDHxaRJkzB37tw868xZ78qVK/Hll19i48aN0NbWxq+//goXF5cC929Bd1kDBgxA//79hYsd\nAPjjjz8wduxYzJ8/HxkZGZDL5cJFTu7Ps3LlSpw5cwZaWlqws7NDly5dkJSUBJ//a+9eThgEoiiA\n3gLEPty4EruwjFeBFdiyDSSbEAKRhNkkCudUMI+3uDPDfJYl4zhmmqYMw3BY17OW27epGKe2bVu6\nrsu6rv8eCg/7vqeq3o7rvqqqVFXmeU6ij1zL6Z5Vp51f5s6l7/uPoZHkcN9dH7kKKw4Amlz+5jgA\nvyU4AGgiOABoIjgAaCI4AGgiOABocgcBjJkyNeWsWwAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 178
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.2, Page Number: 436<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Trigger points'''",
+ "",
+ "R1=100.0*10**3;",
+ "R2=R1;",
+ "V_out_max=5.0;",
+ "V_UTP=R2*V_out_max/(R1+R2);",
+ "V_LTP=-V_out_max*R2/(R1+R2);",
+ "print('upper trigger point = %.1f Volts'%V_UTP)",
+ "print('lower trigger point = %.1f Volts'%V_LTP)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "upper trigger point = 2.5 Volts",
+ "lower trigger point = -2.5 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 179
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.3, Page Number: 437<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Comparator hysteris Zener bounding'''",
+ "import pylab",
+ "import numpy",
+ "",
+ "R1=100.0*10**3;",
+ "R2=47.0*10**3;",
+ "V_R1=4.7+0.7; #one zener is always forward biased with forward voltage 0.7V ",
+ "#V_R1 can be positive or negative",
+ "I_R1=V_R1/R1; ",
+ "I_R2=I_R1;",
+ "V_R2=R2*I_R2;",
+ "V_out=V_R1+V_R2; #positive or negative",
+ "",
+ "print ('I_R1 = \u00b1%d uA' %(I_R1*10**6))",
+ "print ('V_R2 = \u00b1%.2f V' %(V_R2))",
+ "print('max output voltage = \u00b1 %.2f V'%V_out)",
+ "print('\\nV_UTP = + %.2f V' %(V_R2))",
+ "print('V_LTP = - %.2f V' %(V_R2))",
+ "",
+ "################PLOT######################################",
+ "t = arange(0.0, 1.0, 0.0005)",
+ "t1=arange(0.0001,0.085,0.0005)",
+ "t2=arange(0.0001,0.585,0.0005)",
+ "t3=arange(0.585,1.0,0.0005)",
+ "t4=arange(0.085,0.585,0.0005)",
+ "",
+ "m=arange(-7.94,7.94,0.0005)",
+ "x1=(0.085*m)/m",
+ "x5=(0.585*m)/m",
+ "",
+ "subplot(211)",
+ "plot(t, 5*sin(2*pi*t))",
+ "plot(t1,2.54*t1/t1,'--')",
+ "plot(t2,-2.54*t2/t2,'--')",
+ "text(0.09,1.95,'(0.085,2.54)')",
+ "text(0.586,-2,'(0.585,-2.54)')",
+ "#annotate('(0.085,2.54)',(0.085,2.54),(0.3,2.5),arrowprops = dict(facecolor='black',shrink=0.09,xycoords='data',textcoords='axes fraction'))",
+ "ylim( (-6,6) )",
+ "ylabel('Vin')",
+ "title('Input Waveform')",
+ "",
+ "subplot(212)",
+ "plot(t1,7.94*t1/t1,'b')",
+ "plot(t3,7.94*t3/t3,'b')",
+ "plot(t4,-7.94*t4/t4,'b')",
+ "plot(x1,m,'b')",
+ "plot(x5,m,'b')",
+ "ylim( (-9,9) )",
+ "title('Source and output AC voltage')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I_R1 = \u00b154 uA",
+ "V_R2 = \u00b12.54 V",
+ "max output voltage = \u00b1 7.94 V",
+ "",
+ "V_UTP = + 2.54 V",
+ "V_LTP = - 2.54 V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 180,
+ "text": [
+ "<matplotlib.text.Text at 0x2f9fbf2c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEICAYAAABS0fM3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcTfn/B/DXTdmakpJKoVRGSctoJGuGIksYWyG7r1lt\nM2MbM+JrGQbzxazmhywjjGVqLGFosV8zqJk0GFOkkkqUaLm39++PD5dUXC3nVvf9fDzuo9s5557z\nvh857/P5fM75fGRERGCMMaa1dDQdAGOMMc3iRMAYY1qOEwFjjGk5TgSMMablOBEwxpiW40TAGGNa\njhMBY9VAWloaunXrBkNDQ3zyySeaDodpGU4ETCOsra1x7NixKj9OUFAQAgMDy1y/bNky9O3bt9gy\ne3v7Upft2rWrSmIEgPXr16Np06bIzs7Gl19+WWXHYaw0nAiYRshkMshkMk2Hge7du+P06dN48lxl\namoqFAoFLl26hKKiItWy69evo1u3blUWx40bN+Dg4FCuzyoUikqOhmkbTgRM44KDg9GlSxd88skn\nMDY2RqtWrRAeHq5a7+Xlhblz58LDwwONGjXCoEGDkJWVBQCIjIxE8+bNi+3vSW0jPDwcy5Ytw86d\nO2FgYAA3N7cSx3Z3d0dhYSEuXboEADhx4gR69OiB1q1bF1tmZ2cHc3NzbNq0CY6OjjA0NIStrS3W\nr1+v2peDgwMOHDig+l2hUMDU1FS1n7Nnz6JTp05o3LgxXF1dERUVBQAYN24ctmzZghUrVsDAwADH\njx9HQUEBpk+fDktLS1haWmLGjBkoKChQfWcrKyusWLECFhYWmDBhAhYuXIhhw4YhMDAQhoaGcHZ2\nxrVr17Bs2TKYmZmhZcuWOHr0aIX/rVjtxImAVQtyuRxt2rRBZmYmZs2ahYkTJxZbv3XrVmzatAmp\nqanQ1dXF1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yejefPmqt+trKyQ\nnJz80m1q4wlQnbJ41oYNG9C3b18pQpOcun8XoaGhePfddwHU3udO1CmLa9eu4e7du+jRowfc3d2x\ndetWqcOUhDplMXnyZMTFxaFZs2ZwcXHBmjVrpA6zWijveVMjKVPd/7z03DMFtfE//at8p4iICGzc\nuBGnTp2qwog0R52ymD59Or744gvIZDIQUa197kSdsigsLMSFCxdw7NgxPHz4EJ6enujYsSPs7e0l\niFA66pTF0qVL4erqisjISFy/fh3e3t6IiYmBgYGBBBFWL+U5b2okEVhaWiIpKUn1e1JSkqp6W9Y2\nt27dgqWlpWQxSkWdsgCA2NhYTJ48GeHh4S+sGtZk6pTFH3/8AX9/fwCig/DQoUPQ09ODn5+fpLFW\nNXXKonnz5mjSpAkaNGiABg0aoFu3boiJial1iUCdsjh9+jQ+/fRTAICtrS1sbGxw5coVuLu7Sxqr\nppX7vFkpPRivqLCwkFq1akUJCQmUn5//0s7iM2fO1NoOUnXK4saNG2Rra0tnzpzRUJTSUKcsnjVu\n3Djas2ePhBFKR52yiI+Pp549e5JCoaDc3FxycnKiuLg4DUVcddQpixkzZlBQUBAREd2+fZssLS0p\nMzNTE+FWuYSEBLU6i1/lvKmRGoGuri6+/vpr9O7dG0qlEhMnToSDgwN++OEHAMCUKVPQt29fHDx4\nEHZ2dtDX18emTZs0EWqVU6csFi1ahKysLFW7uJ6eHuRyuSbDrhLqlIW2UKcs2rRpgz59+sDZ2Rk6\nOjqYPHkyHB0dNRx55VOnLObNm4fx48fDxcUFRUVFWLFiBYyNjTUceeULCAhAVFQUMjIy0Lx5cyxc\nuBCFhYUAKnberHaDzjHGGJMWP1nMGGNajhMBY4xpOU4EjDGm5TgRMMaYluNEwBhjWo4TAWOMabn/\nB0HRkFnTYYNDAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 180
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.4, Page Number: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Summing amplifier unity gain'''",
+ "",
+ "V_IN1=3.0;",
+ "V_IN2=1.0;",
+ "V_IN3=8.0;",
+ "#all resistors are of equal value so weight of each input is 1",
+ "V_OUT=-(V_IN1+V_IN2+V_IN3);",
+ "print('output voltage = %d Volts'%V_OUT)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage = -12 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 181
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.5, Page Number: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Summing amplifier'''",
+ "",
+ "R_f=10.0*10**3;",
+ "R1=1.0*10**3;",
+ "R2=R1;",
+ "R=R1;",
+ "V_IN1=0.2;",
+ "V_IN2=0.5;",
+ "V_OUT=-(R_f/R)*(V_IN1+V_IN2);",
+ "print('output voltage of the summing amplifier = %d Volts'%V_OUT)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage of the summing amplifier = -7 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 182
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.6, Page Number: 441<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Averaging amplifier'''",
+ "",
+ "R_f=25.0*10**3;",
+ "R1=100.0*10**3;",
+ "R2=R1;",
+ "R3=R1;",
+ "R4=R1;",
+ "R=R1;",
+ "V_IN1=1.0;",
+ "V_IN2=2.0;",
+ "V_IN3=3.0;",
+ "V_IN4=4.0;",
+ "V_OUT=-(R_f/R)*(V_IN1+V_IN2+V_IN3+V_IN4);",
+ "print('output voltage = %.1f Volts'%V_OUT)",
+ "V_IN_avg=(V_IN1+V_IN2+V_IN3+V_IN4)/4;",
+ "if abs(V_OUT)==V_IN_avg:",
+ " print('The amplifier produces an output whose magnitude\\n is the mathematical average of the input voltages')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage = -2.5 Volts",
+ "The amplifier produces an output whose magnitude",
+ " is the mathematical average of the input voltages"
+ ]
+ }
+ ],
+ "prompt_number": 183
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.7, Page Number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Scaling adder'''",
+ "",
+ "V_IN1=3.0;",
+ "V_IN2=2.0;",
+ "V_IN3=8.0;",
+ "R_f=10.0*10**3;",
+ "R1=47.0*10**3;",
+ "R2=100.0*10**3;",
+ "R3=10.0*10**3;",
+ "weight_of_input1=R_f/R1;",
+ "weight_of_input2=R_f/R2;",
+ "weight_of_input3=R_f/R3;",
+ "V_OUT=-(weight_of_input1*V_IN1+weight_of_input2*V_IN2+weight_of_input3*V_IN3);",
+ "print('weight_of_input1 = %f'%weight_of_input1)",
+ "print('weight_of_input2 = %.1f'%weight_of_input2)",
+ "print('weight_of_input3 = %d'%weight_of_input3)",
+ "print('output voltage = %f Volts'%V_OUT)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "weight_of_input1 = 0.212766",
+ "weight_of_input2 = 0.1",
+ "weight_of_input3 = 1",
+ "output voltage = -8.838298 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 184
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.8, Page Number: 444<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Opamp integrator'''",
+ "",
+ "import pylab",
+ "import numpy",
+ "",
+ "",
+ "R_i=10.0*10**3;",
+ "C=0.01*10**-6;",
+ "V_in=2.5-(-2.5);",
+ "PW=100.0*10**-6; #pulse width",
+ "T=2*PW;",
+ "A=2.5;",
+ "op_change_cap_charge=-V_in/(R_i*C);",
+ "op_change_cap_discharge=V_in/(R_i*C);",
+ "print('rate of change of output voltage with respect to time when capacitor is charging = %.1f V/sec'%op_change_cap_charge)",
+ "print('rate of change of output voltage with respect to time when capacitor is discharging =%.1f V/sec'%op_change_cap_discharge)",
+ "del_V_OUT=op_change_cap_discharge*PW;",
+ "print('\\n\\nwhen input is positive, the slope is negative,\\nwhen input is negative, the slope is negative. \\nSo, the output is a triangular wave varying from zero to %.1f V'%(-del_V_OUT))",
+ "",
+ "##############PLOT#############################",
+ "t = arange(0.0, 10.0, 0.0005)",
+ "t1= arange(10.0, 20.0, 0.0005)",
+ "t2= arange(20.0, 30.0, 0.0005)",
+ "t3= arange(30.0, 40.0, 0.0005)",
+ "",
+ "k = arange(0.0001, 10.0, 0.0005)",
+ "k1= arange(10.0, 20.0, 0.0005)",
+ "k2= arange(20.0, 30.0, 0.0005)",
+ "k3= arange(30.0,40.0, 0.0005)",
+ "",
+ "m=arange(-2.5,2.5,0.0005)",
+ "x1=(0.001*m)/m",
+ "x5=(10*m)/m",
+ "x10=(20*m)/m",
+ "x15=(30*m)/m",
+ "x25=(39.99*m)/m",
+ "",
+ "",
+ "subplot(211)",
+ "plot(k,2.5*k/k,'b')",
+ "plot(k1,-2.5*k1/k1,'b')",
+ "plot(k2,2.5*k2/k2,'b')",
+ "plot(k3,-2.5*k3/k3,'b')",
+ "plot(x1,m,'b')",
+ "plot(x5,m,'b')",
+ "plot(x10,m,'b')",
+ "plot(x15,m,'b')",
+ "plot(x25,m,'b')",
+ "",
+ "ylim( (-3,3) )",
+ "ylabel('Vin')",
+ "xlabel('us')",
+ "title('Input to Opamp Integrator')",
+ "",
+ "subplot(212)",
+ "plot(t,(-0.5*t),'b')",
+ "plot(t1,(0.5*t-5),'b')",
+ "plot(t2,(-0.5*t),'b')",
+ "plot(t3,(0.5*t-5),'b')",
+ "",
+ "ylim( (-5,0) )",
+ "ylabel('Vout')",
+ "xlabel('us')",
+ "title('Output of an Integrator')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of change of output voltage with respect to time when capacitor is charging = -50000.0 V/sec",
+ "rate of change of output voltage with respect to time when capacitor is discharging =50000.0 V/sec",
+ "",
+ "",
+ "when input is positive, the slope is negative,",
+ "when input is negative, the slope is negative. ",
+ "So, the output is a triangular wave varying from zero to -5.0 V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 185,
+ "text": [
+ "<matplotlib.text.Text at 0x303b512c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAESCAYAAAD0aQL3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVGX7B/DvsLiCiKIgi6IiKopAmrglbpiVmruiELn0\ne8uS1CQlM5cMRaSyLCv3sMTMUCtQFNfcsBSzXN83UVRSEUVAZJm5f388MbEqDMw5Z2buz3Vx6Qwz\n59w8DM99zrOqiIjAGGPM5JjJHQBjjDF5cAJgjDETxQmAMcZMFCcAxhgzUZwAGGPMRHECYIwxE8UJ\nwES5uroiMTFR7+dZsGABgoKCnhjLvn37dD4HESEyMhLu7u6oV68eWrRogXfeeQf5+fk6H1MqBw4c\ngIuLS6Vem5KSAjMzM2g0Gj1HVbHq/q6YsnACMFEqlQoqlUruMACIWKozHSUkJASrV69GdHQ0srOz\nER8fj8TERIwZM6YGo1QOfU3dUavVT3xNdX5XhYWFOr2P6RExk+Tq6kqJiYlERLR+/Xrq2bMnzZo1\ni2xtbally5YUHx+vfa2fnx/NmTOHunbtSg0aNKAXX3yRMjIyiIho//795OzsXOLYLVq0oL1791J8\nfDzVqlWLLC0tycrKiry9vcvEERgYSGZmZlS3bl2ysrKiyMhIIiLasWMHeXh4UMOGDalPnz50/vz5\ncn+OS5cukbm5OZ08ebLE86mpq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1WGQ8fPkRWVhYAICcnBwkJCYqezzB06FBs3LgRALBx40ZtBaE0SpsjQkSYPHkyPDw8\nMH36dO3zSivPiuJUWnmmp6drm01yc3OxZ88e+Pj4KK48K4qz+OoGSijP8PBwpKam4sqVK4iJiUG/\nfv0QHR1d9fLUW/e0DuLi4sjd3Z1at25N4eHhcodTrr/++ou8vLzIy8uLOnTooKg4x40bR82aNSNL\nS0tydnamdevW0d27d6l///7Upk0b8vf3p3v37skdZpk4165dS0FBQeTp6UmdOnWiF198kf7++29Z\nYzx8+DCpVCry8vIib29v8vb2pvj4eMWVZ3lxxsXFKa48f//9d/Lx8SEvLy/y9PSkZcuWEREprjwr\nilNp5VncgQMHtKOAqlqeitsRjDHGmDQU0wTEGGNMWpwAGGPMRHECYIwxE8UJgDHGTBRvwsZYBUrv\nWbF8+XLk5OTA1tYWX375JSwsLODh4YHNmzfLHCljuuEEwFglFc2qjIiIQEpKCiwtLfHgwQOZo2JM\nd9wExFgVderUCePHj8c333wDc3NzucNhTGecABirgIWFBTQajfZxbm4uACAuLg6vv/46Tp06haef\nfhpqtVquEBmrFk4AjFXA3t4et2/fRkZGBvLy8vDTTz9Bo9Hg2rVr6NOnD5YuXYrMzEzk5OTIHSpj\nOuE+AMYqYGlpiffeew9du3aFk5MTPDw8oFarERgYiMzMTBAR3nzzTTRo0EDuUBnTCS8FwRhjJoqb\ngBhjzERxAmCMMRPFCYAxxkwUJwDGGDNRnAAYY8xEcQJgjDET9f/0qkid2sgWzAAAAABJRU5ErkJg\ngg==\n"
+ }
+ ],
+ "prompt_number": 185
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 13.9, Page Number: 447<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Opamp diferentiator'''",
+ "",
+ "import pylab",
+ "import numpy",
+ "",
+ "R_f=2.2*10**3;",
+ "C=0.001*10**-6;",
+ "Vc=5.0-(-5.0);",
+ "A=5.0;",
+ "time_const=R_f*C;",
+ "T=10.0*10**-6;",
+ "t=T/2;",
+ "slope=Vc/t;",
+ "V_out=slope*time_const; #V_out is negative when input is positive and V_out is positive when input is negative",
+ "print('output voltage = %.1f V'%V_out)",
+ "print('max output voltage = %.1f V'%V_out)",
+ "print('min output voltage = %.1f V'%(-V_out))",
+ "",
+ "##################PLOt############################",
+ "",
+ "t = arange(0.0, 5.0, 0.0005)",
+ "t1= arange(5.0, 10.0, 0.0005)",
+ "t2= arange(10.0, 15.0, 0.0005)",
+ "t3= arange(15.0, 20.0, 0.0005)",
+ "",
+ "",
+ "k = arange(0.0001, 5.0, 0.0005)",
+ "k1= arange(5.0, 10.0, 0.0005)",
+ "k2= arange(10.0, 15.0, 0.0005)",
+ "k3= arange(15.0, 20.0, 0.0005)",
+ "",
+ "m=arange(-4.4,4.4, 0.0005)",
+ "x1=(0.001*m)/m",
+ "x5=(5*m)/m",
+ "x10=(10*m)/m",
+ "x15=(15*m)/m",
+ "",
+ "",
+ "subplot(211)",
+ "plot(t,(2*t-5),'b')",
+ "plot(t1,(-2*t+5),'b')",
+ "plot(t2,(2*t-5),'b')",
+ "plot(t3,(-2*t+5),'b')",
+ "ylim( (-6,6) )",
+ "ylabel('Vin')",
+ "xlabel('us')",
+ "title('Triangular wave input')",
+ "",
+ "subplot(212)",
+ "plot(k,-4.4*k/k,'b')",
+ "plot(k1,4.4*k1/k1,'b')",
+ "plot(k2,-4.4*k2/k2,'b')",
+ "plot(k3,4.4*k3/k3,'b')",
+ "plot(x1,m,'b')",
+ "plot(x5,m,'b')",
+ "plot(x10,m,'b')",
+ "plot(x15,m,'b')",
+ "ylim( (-5,5) )",
+ "ylabel('Vout')",
+ "xlabel('us')",
+ "title('Output of Opamp Differentiator')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage = 4.4 V",
+ "max output voltage = 4.4 V",
+ "min output voltage = -4.4 V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 186,
+ "text": [
+ "<matplotlib.text.Text at 0x30f01b4c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAETCAYAAAA/NdFSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcTPn/B/DXjHJJgxKVJhVCl+1CrNxCZdkl1r3Wvb2x\nLMuXZV3CImy+yNpd/NzZsK4hbUrlsmiRu13XLnQhERWq6fP74/NtGLo3M2emeT8fjx7MnOmc95xm\nPu9zPlcRY4yBEEKIzhELHQAhhBBhUAIghBAdRQmAEEJ0FCUAQgjRUZQACCFER1ECIIQQHUUJgKjE\nyZMn0bp1a6HDwLx58zBixAihw1AZiUSChIQEocMgWooSACk3Q0NDSCQSSCQSiMViGBgYyB+HhIQo\nvLZLly74559/BIr0DZFIJHQIKvXixQtYW1ur/DjdunXDhg0bVH4col56QgdAtEd2drb8/zY2Ntiw\nYQN69Ojx3usKCgqgp6cZH62qjHMsLCyEWEzXSED1T6S6ij7dpMpiYmIglUqxbNkymJubw9/fHzEx\nMbC0tJS/ZsmSJWjRogXq1asHBwcHHDhwQL5t8+bN6Ny5M6ZNmwZjY2M0a9YM4eHh8u33799H165d\nUa9ePXh7e+Obb76RV+u8exwAsLa2xvHjx4uNdfDgwTA3N0eDBg3g4eGBGzduyLeNHj0a48aNw8cf\nfwxDQ0PExMQo/G50dDScnJzkj729vdG+fXv54y5duiA0NLTU9/v69Ws0aNAA169fl//e48ePYWBg\ngIyMDADA4cOH4eLiAiMjI3Tq1AlXr14t8dyLxWLcu3dPHv8333yDPn36oF69eujQoYN8W9FrV69e\njebNm6NRo0aYPn26PEG+W1WWkJAAsVgMmUyGWbNm4eTJk5gwYQIkEgm+/fbbEuMh2oUSAFGK9PR0\nPH36FElJSVi7du1721u0aIFTp07h+fPnCAgIwPDhw5Geni7fHhcXh9atW+PJkyeYPn06/P395dv8\n/PzQ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+3bt5GQkIC8vDzs2rULPj4+\nQoeltXJzc/HixQsAQE5ODiIiIhR6YJDK8fHxwZYtWwAAW7ZskX/xSMWlpqbK/79//376fFYAYwz+\n/v6wt7fH5MmT5c9X+PPJNEhYWBhr2bIla968OVu8eLHQ4Wi1e/fuMWdnZ+bs7MwcHBzofFbCsGHD\nmLm5OdPX12dSqZRt3LiRPXnyhHl6ejJbW1vm7e3Nnj59KnSYWuHdc7lhwwY2YsQI9sEHHzAnJyfW\nr18/lpaWJnSYWuPkyZNMJBIxZ2dn5uLiwlxcXNjRo0cr/PnUuMngCCGEqIfGVAERQghRL0oAhBCi\noygBEEKIjqIEQAghOkrjFoQhRFMkJCSgb9++uHr1KgAgKCgIOTk5MDIywtq1a6Gnpwd7e3uEhIQI\nHCkhlUMJgJByKhpVuXTpUiQkJEBfXx/Pnz8XOCpCKo+qgAipICcnJ/j5+WHHjh2oUaOG0OEQUmmU\nAAgpgZ6eHgoLC+WPX758CQAICwvDN998g4sXL6Jdu3aQyWRChUhIlVACIKQEpqamePToETIzM/H6\n9WscPnwYhYWFSEpKQrdu3bBkyRJkZWUhJydH6FAJqRRqAyCkBPr6+pg7dy7at28PCwsL2NvbQyaT\nYfjw4cjKygJjDJMmTUK9evWEDpWQSqGpIAghREdRFRAhhOgoSgCEEKKjKAEQQoiOogRACCE6ihIA\nIYToKEoAhBCio/4ft47D93McnMsAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 186
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter14.ipynb b/Electronic_Devices_/Chapter14.ipynb
new file mode 100644
index 00000000..556241af
--- /dev/null
+++ b/Electronic_Devices_/Chapter14.ipynb
@@ -0,0 +1,355 @@
+{
+ "metadata": {
+ "name": "Chapter_14"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 14: Special-purpose Op-amp cicuits<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.1, Page Number: 458<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gain setting resistor'''",
+ "",
+ "R1=25*10**3;",
+ "R2=R1;",
+ "A_cl=500; #closed loop voltage gain",
+ "R_G=2*R1/(A_cl-1);",
+ "print('value of the external gain setting resistor in ohms = %d'%R_G)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of the external gain setting resistor in ohms = 100"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.2, Page Number: 460<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage gain Instrumentation amplifier'''",
+ "",
+ "R1=25.25*10**3; #internal resistors",
+ "R2=R1;",
+ "R_G=510.0;",
+ "A_v=(2*R1/R_G)+1;",
+ "print('voltage gain = %f'%A_v)",
+ "BW=60.0*10**3;",
+ "print('bandwidth from graph = %d hertz'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain = 100.019608",
+ "bandwidth from graph = 60000 hertz"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.3, Page Number: 462<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage gain Isolation amplifier'''",
+ "",
+ "R_f1=22.0*10**3;",
+ "R_i1=2.2*10**3;",
+ "R_f2=47.0*10**3;",
+ "R_i2=10.0*10**3;",
+ "A_v1=(R_f1/R_i1)+1; #voltage gain of input stage",
+ "A_v2=(R_f2/R_i2)+1; #voltage gain of output stage",
+ "A_v=A_v1*A_v2;",
+ "print('total voltage gain of the isolation amplifier = %.1f'%A_v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total voltage gain of the isolation amplifier = 62.7"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.5, Page Number: 466<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Transconductance OTA'''",
+ "",
+ "g_m=1000.0*10**-6;",
+ "V_in=25*10**-3;",
+ "I_out=g_m*V_in;",
+ "print('output current = %f A'%I_out)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output current = 0.000025 A"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.6, Page Number: 468<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage gain OTA'''",
+ "",
+ "V_BIAS=9.0;",
+ "V=V_BIAS;",
+ "R_BIAS=33.0*10**3;",
+ "R_L=10.0*10**3;",
+ "K=16.0; #in microSiemens per microAmpere",
+ "I_BIAS=(V_BIAS-(-V)-1.4)/R_BIAS;",
+ "g_m=K*I_BIAS;",
+ "A_v=g_m*R_L;",
+ "print('voltage gain = %f'%A_v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain = 80.484848"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.7, Page Number: 469<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Output OTA amplitude modulator'''",
+ "",
+ "import pylab",
+ "import numpy ",
+ "",
+ "",
+ "V_MOD_max=10.0;",
+ "V_MOD_min=1.0;",
+ "V=9.0;",
+ "V_in=50.0*10**-3;",
+ "R_BIAS=56.0*10**3;",
+ "R_L=10.0*10**3;",
+ "K=16.0; #in microSiemens per microAmpere",
+ "I_BIAS_max=(V_MOD_max-(-V)-1.4)/R_BIAS;",
+ "",
+ "g_m_max=K*I_BIAS_max;",
+ "A_v_max=g_m_max*R_L;",
+ "V_out_max=A_v_max*V_in;",
+ "",
+ "I_BIAS_min=(V_MOD_min-(-V)-1.4)/R_BIAS;",
+ "",
+ "g_m_min=K*I_BIAS_min;",
+ "A_v_min=g_m_min*R_L;",
+ "V_out_min=A_v_min*V_in;",
+ "",
+ "###############PLOT#############################",
+ "f=1.0; #assume frequency 1 hertz",
+ "t = arange(0.0001, 4.0, 0.0005)",
+ "y=(((V_out_max/4)-(V_out_min/4))*sin(2*pi*f*t)+((V_out_min/2)+(V_out_max/2))/2)*sin(2*9*pi*f*t);",
+ "",
+ "plot(t,y)",
+ "plot(t,0.61*t/t,'r')",
+ "plot(t,-0.61*t/t,'r')",
+ "ylim( (-2,2) )",
+ "ylabel('Vout')",
+ "title('Modulated Output Voltage')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "pyout",
+ "prompt_number": 7,
+ "text": [
+ "<matplotlib.text.Text at 0xa98084c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEICAYAAABMGMOEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsfWl4VdXZ9n0yQuYQMIQkEEYDiICiaBGNCiqDVNRa8RVx\naqlDbdXPflb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jr64PZbEZqaiqGh4cNz1lfX4+ZmRkcHBwgJycHHz9+RDgcjmbk4FIlJweX\nP3/+xOfPn5Gfnx89YXi9XmxtbUVzcvCpkpODz93dXTQ3NyMSiSASiaCpqQkvX75k91lXycnB52Uu\nLjX9V58m4nA7XxAEQWAP60tSgiAIAh+kYQiCIAhKSMMQBEEQlJCGIQiCICghDUMQBEFQQhqGIAiC\noMS/KVKkmvD3qkwAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.8, Page Number: 473<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Output log amplifier'''",
+ "",
+ "import math",
+ "V_in=2;",
+ "I_R=50.0*10**-9;",
+ "R1=100.0*10**3;",
+ "#voltage output for log amplifier",
+ "V_OUT=-0.025*math.log(V_in/(I_R*R1));",
+ "print('output voltage = %f volts'%V_OUT)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage = -0.149787 volts"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.9, Page Number: 474<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Transistor log amplifier'''",
+ "",
+ "import math",
+ "V_in=3;",
+ "I_EBO=40*10**-9;",
+ "R1=68*10**3;",
+ "#voltage output for log amplifier",
+ "V_OUT=-0.025*math.log(V_in/(I_EBO*R1));",
+ "print('output voltage = %f Volts'%V_OUT)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage = -0.175143 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 14.10, Page Number: 475<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Antilog amplifier'''",
+ "",
+ "import math",
+ "I_EBO=40.0*10**-9;",
+ "V_in=175.1*10**-3;",
+ "R_f=68.0*10**3;",
+ "V_OUT=-I_EBO*R_f*math.exp(V_in/0.025);",
+ "print('output voltage = %f Volts'%V_OUT)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage = -2.994797 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter15.ipynb b/Electronic_Devices_/Chapter15.ipynb
new file mode 100644
index 00000000..41cc02a1
--- /dev/null
+++ b/Electronic_Devices_/Chapter15.ipynb
@@ -0,0 +1,333 @@
+{
+ "metadata": {
+ "name": "Chapter_15"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 15: Active Filters<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.1, Page Number: 491<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Band pass Filter'''",
+ "",
+ "f0=15*10**3; #center frequency in hertz",
+ "BW=1*10**3;",
+ "Q=f0/BW;",
+ "if Q>10:",
+ " print('narrow band filter, Q = %d'%Q)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "narrow band filter, Q = 15"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.2, Page Number: 494<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Butterworth response'''",
+ "",
+ "R2=10*10**3;",
+ "R1=0.586*R2; #FOR BUTTERWORTH RESPONSE",
+ "print('R1 in ohms =%d'%R1)",
+ "print('5.6kilo ohm will be ideally close to maximally flat butterworth response')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 in ohms =5860",
+ "5.6kilo ohm will be ideally close to maximally flat butterworth response"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.3, Page Number: 496<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Sallen Key lowpass Filter'''",
+ "",
+ "import math",
+ "R_A=1*10**3;",
+ "R2=1*10**3;",
+ "R_B=R_A;",
+ "R=R_A;",
+ "C_A=0.022*10**-6;",
+ "C_B=C_A;",
+ "C=C_A;",
+ "f_c=1/(2*math.pi*R*C); #critical frequency",
+ "R1=0.586*R2; #for butterworth response",
+ "print('critical frequency in hertz =%f'%f_c)",
+ "print('value of R1 in ohms = %d'%R1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical frequency in hertz =7234.315595",
+ "value of R1 in ohms = 586"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.4, Page Number: 498<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''4-pole Filter'''",
+ "",
+ "import math",
+ "f_c=2860.0;",
+ "R=1.8*10**3;",
+ "C=1/(2*math.pi*f_c*R);",
+ "R2=R;",
+ "R1=0.152*R2; #BUTTERWORTH RESPONSE IN FIRST STAGE",
+ "R4=R;",
+ "R3=1.235*R4; #BUTTERWORTH RESPONSE IN SECOND STAGE",
+ "C=C*10**8",
+ "print('capacitance in farads = %f *10^-8'%C);",
+ "print('R1 in ohms for butterworth response in first stage = %.1f'%R1)",
+ "print('R3 in ohms for butterworth response in second stage = %d'%R3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "capacitance in farads = 3.091588 *10^-8",
+ "R1 in ohms for butterworth response in first stage = 273.6",
+ "R3 in ohms for butterworth response in second stage = 2223"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.5, Page Number: 500<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Sallen Key highpass Filter'''",
+ "",
+ "import math",
+ "f_c=10*10**3; #critical frequency in hertz",
+ "R=33*10**3; #Assumption",
+ "R2=R;",
+ "C=1/(2*math.pi*f_c*R);",
+ "R1=0.586*R2; #for butterworth response",
+ "C=C*10**10",
+ "print('Capacitance in Farads = %f * 10^-10'%C)",
+ "print('R1 in ohms taking R2=33kilo-ohms = %d'%R1)",
+ "R1=3.3*10**3; #Assumption",
+ "R2=R1/0.586; #butterworth response",
+ "print('R2 in ohms taking R1=3.3kilo-ohms = %f'%R2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance in Farads = 4.822877 * 10^-10",
+ "R1 in ohms taking R2=33kilo-ohms = 19338",
+ "R2 in ohms taking R1=3.3kilo-ohms = 5631.399317"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.6, Page Number:503<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Cascaded Filter'''",
+ "",
+ "import math",
+ "R1=68.0*10**3;",
+ "R2=180.0*10**3;",
+ "R3=2.7*10**3;",
+ "C=0.01*10**-6;",
+ "f0=(math.sqrt((R1+R3)/(R1*R2*R3)))/(2*math.pi*C);",
+ "A0=R2/(2*R1);",
+ "Q=math.pi*f0*C*R2;",
+ "BW=f0/Q;",
+ "print('center frequency in hertz = %f'%f0)",
+ "print('maximum gain = %f'%A0)",
+ "print('bandwidth in hertz = %f'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "center frequency in hertz = 736.134628",
+ "maximum gain = 1.323529",
+ "bandwidth in hertz = 176.838826"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.7, Page Number: 504<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''State variable Filter'''",
+ "",
+ "import math",
+ "R4=1000.0;",
+ "C1=0.022*10**-6;",
+ "R7=R4;",
+ "C2=C1;",
+ "R6=R4;",
+ "R5=100.0*10**3;",
+ "f_c=1/(2*math.pi*R4*C1); #critical frequency in hertz for each integrator",
+ "f0=f_c #center frequency",
+ "Q=(1+(R5/R6))/3;",
+ "BW=f0/Q;",
+ "print('center frequency in hertz = %f'%f0)",
+ "print('value of Q = %f'%Q)",
+ "print('bandwidth in hertz = %f'%BW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "center frequency in hertz = 7234.315595",
+ "value of Q = 33.666667",
+ "bandwidth in hertz = 214.880661"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 15.8, Page Number: 507<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Band stop Filters'''",
+ "",
+ "import math",
+ "R4=12.0*10**3;",
+ "C1=0.22*10**-6;",
+ "R7=R4;",
+ "C2=C1;",
+ "R6=3.3*10**3;",
+ "Q=10;",
+ "f0=1/(2*math.pi*R7*C2);",
+ "R5=(3*Q-1)*R6;",
+ "print('center frequency in hertz = %f'%f0)",
+ "print('R5 in ohms = %d'%R5)",
+ "print('Nearest value is 100 kilo-ohms')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "center frequency in hertz = 60.285963",
+ "R5 in ohms = 95700",
+ "Nearest value is 100 kilo-ohms"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter16.ipynb b/Electronic_Devices_/Chapter16.ipynb
new file mode 100644
index 00000000..8ab48487
--- /dev/null
+++ b/Electronic_Devices_/Chapter16.ipynb
@@ -0,0 +1,305 @@
+{
+ "metadata": {
+ "name": "Chapter_16"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 16: Oscillators<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 16.1, Page Number: 524<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Wien bridge oscillator'''",
+ "",
+ "import math",
+ "R1=10*10**3;",
+ "R2=R1;",
+ "R=R1;",
+ "C1=0.01*10**-6;",
+ "C2=C1;",
+ "C=C1;",
+ "R3=1*10**3;",
+ "r_ds=500;",
+ "f_r=1/(2*math.pi*R*C);",
+ "print('resonant frequency of the Wein-bridge oscillator in Hertz = %.4f'%f_r)",
+ "#closed loop gain A_v=3 to sustain oscillations",
+ "A_v=3;",
+ "#A_v=(R_f+R_i)+1 where R_i is composed of R3 and r_ds",
+ "R_f=(A_v-1)*(R3+r_ds);",
+ "print('value of R_f in ohms = %d'%R_f)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "resonant frequency of the Wein-bridge oscillator in Hertz = 1591.5494",
+ "value of R_f in ohms = 3000"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 16.2, Page Number: 525<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Phase shift oscillator'''",
+ "",
+ "import math",
+ "A_cl=29; #A_cl=R_f/R_i;",
+ "R3=10*10**3;",
+ "R_f=A_cl*R3;",
+ "print('value of R_f in ohms = %d'%R_f)",
+ "#let R1=R2=R3=R and C1=C2=C3=C",
+ "R=R3;",
+ "C3=0.001*10**-6;",
+ "C=C3;",
+ "f_r=1/(2*math.pi*math.sqrt(6)*R*C);",
+ "print('frequency of oscillation in Hertz = %f'%f_r)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of R_f in ohms = 290000",
+ "frequency of oscillation in Hertz = 6497.473344"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 16.3, Page Number: 530<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''FET Colpitts oscillator'''",
+ "",
+ "import math",
+ "C1=0.1*10**-6;",
+ "C2=0.01*10**-6;",
+ "L=50.0*10**-3; #in Henry",
+ "C_T=C1*C2/(C1+C2); #total capacitance",
+ "f_r=1/(2*math.pi*math.sqrt((L*C_T)));",
+ "print('frequency of oscillation in Hertz when Q>10 is \\n\\t %f'%f_r)",
+ "Q=8.0; #when Q drops to 8",
+ "f_r1=(1/(2*math.pi*math.sqrt((L*C_T))))*math.sqrt((Q**2/(1+Q**2)));",
+ "print('frequency of oscillation in hertz when Q=8 is \\n \\t %f'%f_r1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency of oscillation in Hertz when Q>10 is ",
+ "\t 7465.028533",
+ "frequency of oscillation in hertz when Q=8 is ",
+ " \t 7407.382663"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 16.4, Page Number: 535<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Triangular wave oscillator'''",
+ "",
+ "R1=10.0*10**3;",
+ "R2=33.0*10**3;",
+ "R3=10.0*10**3;",
+ "C=0.01*10**-6;",
+ "f_r=(1/(4*R1*C))*(R2/R3);",
+ "print('frequency of oscillation in hertz is \\n\\t%d'%f_r)",
+ "#the value of R1 when frequency of oscillation is 20 kHz",
+ "f=20.0*10**3;",
+ "R1=(1/(4*f*C))*(R2/R3);",
+ "print('value of R1 in ohms to make frequency 20 kiloHertz is \\n\\t%d'%R1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency of oscillation in hertz is ",
+ "\t8250",
+ "value of R1 in ohms to make frequency 20 kiloHertz is ",
+ "\t4125"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 16.5, Page Number: 537<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Sawtooth VCO'''",
+ "",
+ "import pylab",
+ "import numpy",
+ "V=15.0;",
+ "C=0.0047*10**-6;",
+ "R3=10.0*10**3;",
+ "R4=R3;",
+ "R2=10.0*10**3;",
+ "R1=68.0*10**3;",
+ "R_i=100.0*10**3;",
+ "V_G=R4*V/(R3+R4); #gate voltage at which PUT turns on",
+ "V_p=V_G; #neglecting 0.7V, this the peak voltage of sawtooth wave",
+ "print('neglecting 0.7V, the peak voltage of sawtooth wave = %.1f V'%V_p)",
+ "V_F=1.0; #minimum peak value of sawtooth wave",
+ "V_pp=V_p-V_F;",
+ "print('peak to peak amplitude of the sawtooth wave = %.1f V'%V_pp)",
+ "V_IN=-V*R2/(R1+R2);",
+ "f=(abs(V_IN)/(R_i*C))*(1/(V_pp));",
+ "print('frequency of the sawtooth wave = %.1f Hz'%f)",
+ "",
+ "#############PLOT###############################",
+ "",
+ "t = arange(0.0, 2.0, 0.0005)",
+ "t1= arange(2.0, 4.0, 0.0005)",
+ "t2= arange(4.0, 6.0, 0.0005)",
+ "k=arange(0.1,7.5, 0.0005)",
+ "t3=(2*k)/k",
+ "t4=(4*k)/k",
+ "t6=(6*k)/k",
+ "",
+ "subplot(111)",
+ "plot(t, (6.5/2)*t+1)",
+ "plot(t1, (6.5/2)*t+1,'b')",
+ "plot(t2, (6.5/2)*t+1,'b')",
+ "plot(t3,k,'b')",
+ "plot(t4,k,'b')",
+ "plot(t6,k,'b')",
+ "",
+ "ylim( (1,8) )",
+ "ylabel('Vout')",
+ "xlabel('ms')",
+ "title('Output of the Circuit')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "neglecting 0.7V, the peak voltage of sawtooth wave = 7.5 V",
+ "peak to peak amplitude of the sawtooth wave = 6.5 V",
+ "frequency of the sawtooth wave = 629.5 Hz"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 6,
+ "text": [
+ "<matplotlib.text.Text at 0xa046eec>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAETCAYAA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/PkIDQ3FwoULpcexW3FxMUpLSwEAly9fxhdffIGo\nqCjhqWy3atUqFBQUIC8vD6mpqbjzzjvx7rvvSo9ls+rqalRUVAAAqqqqsH//ft3cBebj44OAgACc\nPXsWQMPz0mFhYcJT2S8lJQVxcXGt/j6HZQI6deqEv//975g8eTLq6+sxf/58hISEOOr0qoiLi8Oh\nQ4dQUlKCgIAAvPTSS423azq7o0eP4v3332+8JQ0AVq9ejbvvvlt4MtsUFRXhoYcegsVigcViwZw5\nczBRx99hQm9PR/7yyy+YMWMGgIanMxISEnDXXXcJT2W7LVu2ICEhAbW1tQgKCtLd185UVVUhIyPD\nptcyNAt6ERGR4+nzZXgiImoWlzoRkQvhUiciciFc6kRELoRLnQwpPz8fwcHBSExMxJAhQ5CQkID9\n+/fjjjvuwODBg3HixAkcOnSoMaI0bNgwVFZWSo9N1Cre/UKGlJ+fj0GDBiEnJwehoaEYOXIkIiIi\nsH37dqSlpeGtt96CxWLB0qVLMWbMGFRXV6NLly7o2LGj9OhEN8QrdTKs/v37IywsDCaTCWFhYYiJ\niQEAhIeH48cff8TYsWOxaNEibNmyBZcuXeJCJ13gUifD6tKlS+OPO3TogM6dOzf+uK6uDkuWLMGb\nb76Jy5cv44477kBubq7UqEQ2c/g3nibSix9++AHh4eEIDw/HiRMnkJubiyFDhkiPRXRDvFInw7r+\nS/Wv//mmTZswdOhQREREoHPnzrjnnnscOR5Rm/CFUiIiF8IrdSIiF8KlTkTkQrjUiYhcCJc6EZEL\n4VInInIhXOpERC7k/wD4xTcXWswNTwAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 16.6, Page Number: 542<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''555 timer'''",
+ "",
+ "R1=2.2*10**3;",
+ "R2=4.7*10**3;",
+ "C_ext=0.022*10**-6;",
+ "f_r=1.44/((R1+2*R2)*C_ext);",
+ "print('frequency of the 555 timer in hertz = %f'%f_r)",
+ "duty_cycle=((R1+R2)/(R1+2*R2))*100;",
+ "print('duty cycle in percentage = %f'%duty_cycle)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency of the 555 timer in hertz = 5642.633229",
+ "duty cycle in percentage = 59.482759"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter17.ipynb b/Electronic_Devices_/Chapter17.ipynb
new file mode 100644
index 00000000..1f3eeb4d
--- /dev/null
+++ b/Electronic_Devices_/Chapter17.ipynb
@@ -0,0 +1,322 @@
+{
+ "metadata": {
+ "name": "Chapter_17"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 17: Voltage Regulators<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.1, Page Number:552 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Percentage line regulation'''",
+ "",
+ "#variable declaration",
+ "Del_V_out=0.25;",
+ "V_out=15;",
+ "Del_V_in=5; #All voltages in Volts",
+ "",
+ "#Calculations",
+ "line_regulation=((Del_V_out/V_out)/Del_V_in)*100;",
+ "",
+ "#Result",
+ "print('line regulation in %%V is %f' %line_regulation)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "line regulation in %V is 0.333333"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.2, Page Number: 553<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Load regulation percentage'''",
+ "",
+ "# Variable Declaration",
+ "V_NL=12.0; #No load output voltage in Volts",
+ "V_FL=11.9; #Full load output voltage in Volts",
+ "I_F=10.0; #Full load current in milli-Amperes",
+ "",
+ "#Calculations",
+ "load_regulation=((V_NL-V_FL)/V_FL)*100;",
+ "load_reg=load_regulation/I_F;",
+ "",
+ "#Result",
+ "print('load regulation as percentage change from no load to full load = %f'%load_regulation)",
+ "print('\\nload regulation as percentage change per milliampere = %f' %load_reg)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "load regulation as percentage change from no load to full load = 0.840336",
+ "",
+ "load regulation as percentage change per milliampere = 0.084034"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.3, Page Number: 556<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Series regulator'''",
+ "",
+ "",
+ "V_REF=5.1 #Zener voltage in volts",
+ "R2=10*10**3;",
+ "R3=10*10**3; #resistances in ohm",
+ "V_out=(1+(R2/R3))*V_REF;",
+ "print('output voltage in volts = %.1f'%V_out)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage in volts = 10.2"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.4, Page Number: 557<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Overload protection'''",
+ "",
+ "R4=1; #Resistance in Ohms",
+ "I_L_max=0.7/R4;",
+ "print('maximum current provided to load(in amperes) = %.1f'%I_L_max)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum current provided to load(in amperes) = 0.7"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.5, Page Number: 560<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Shunt regulator'''",
+ "",
+ "V_IN=12.5; #maximum input voltage in volts",
+ "R1=22; #In Ohms",
+ "#Worst case of power dissipation is when V_OUT=0V",
+ "V_OUT=0;",
+ "V_R1=V_IN-V_OUT; #Voltage across R1",
+ "P_R1=(V_R1*V_R1)/R1; #maximum power dissipated by R1",
+ "print('maximum power dissipated by R1 in WATTS = %f'%P_R1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum power dissipated by R1 in WATTS = 7.102273"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.6, Page Number: 569<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Positive linear voltage regulator'''",
+ "",
+ "print('SAME AS EX-2.8 in CHAPTER-2')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SAME AS EX-2.8 in CHAPTER-2"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.7, Page Number: 572<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''External pass Filter'''",
+ "",
+ "I_max=700*10**-3; #in Amperes",
+ "R_ext=0.7/I_max;",
+ "print('value of resistor in Ohms for which max current is 700mA = %f'%R_ext)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of resistor in Ohms for which max current is 700mA = 1.000000"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.8, Page Number: 572<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power rating 7824'''",
+ "",
+ "V_OUT=24.0; #Output voltage in Volts",
+ "R_L=10.0; #Load resistance in Ohms",
+ "V_IN=30.0; #Input voltage in Volts",
+ "I_max=700.0*10**-3; #maximum interal current in Amperes",
+ "I_L=V_OUT/R_L; #load current in amperes",
+ "I_ext=I_L-I_max; #current through the external pass transistor in Amperes",
+ "P_ext_Qext=I_ext*(V_IN-V_OUT); #power dissipated",
+ "print('power dissiated(in WATTS) by the external pass transistor = %.1f'%P_ext_Qext)",
+ "print('\\nFor safety purpose, we choose a power transistor with rating more than this, say 15W')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power dissiated(in WATTS) by the external pass transistor = 10.2",
+ "",
+ "For safety purpose, we choose a power transistor with rating more than this, say 15W"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 17.9, Page Number: 574<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Current regulator'''",
+ "",
+ "V_out=5.0; #7805 gives output voltage of 5V",
+ "I_L=1.0; #constant current of 1A",
+ "R1=V_out/I_L;",
+ "print('The value of current-setting resistor in ohms = %d'%R1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of current-setting resistor in ohms = 5"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter18.ipynb b/Electronic_Devices_/Chapter18.ipynb
new file mode 100644
index 00000000..b651b596
--- /dev/null
+++ b/Electronic_Devices_/Chapter18.ipynb
@@ -0,0 +1,57 @@
+{
+ "metadata": {
+ "name": "Chapter_18"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 18: Programmable Analog Arrays<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 18.1, Page Number: 588<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Switching capacitor'''",
+ "",
+ "import math",
+ "#Variable declaration",
+ "C=1000*10**-12; #Switche capacitor value in farads",
+ "R=1000; #resistance in ohms",
+ "",
+ "#calculation",
+ "T=R*C; #Time period",
+ "f=1/T; #Frequency at which switch should operate",
+ "f=math.ceil(f)",
+ "#Result",
+ "print('Frequency at which each switch should operate(in hertz) is \\n %d' %f)",
+ "print('Duty cycle should be 50%')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency at which each switch should operate(in hertz) is ",
+ " 1000000",
+ "Duty cycle should be 50%"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter2.ipynb b/Electronic_Devices_/Chapter2.ipynb
new file mode 100644
index 00000000..107fc334
--- /dev/null
+++ b/Electronic_Devices_/Chapter2.ipynb
@@ -0,0 +1,608 @@
+{
+ "metadata": {
+ "name": "Chapter_2"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 2: Diode Application<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.1, Page Number: 46<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Average value of half wave rectifier'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_p=50; #Peak value is 50V",
+ "",
+ "#calculation",
+ "V_avg=V_p/math.pi;",
+ "",
+ "#result",
+ "print \"average value of half wave rectifier = %.2f volts\" %V_avg"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average value of half wave rectifier = 15.92 volts"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.2(a), Page Number: 46<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' half wave rectifier output'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "#let V_in=5*sin(2*%pi*f.*t) be input wave ,hence frequency=1Hz",
+ "f=1; #frequency",
+ "V_p_in=5; #peak input",
+ "",
+ "#calculation",
+ "V_pout=V_p_in-0.7; #output voltage",
+ "t_d=(math.asin(0.7/V_p_in))/(2*math.pi*f);",
+ "",
+ "#result",
+ "print \"half wave rectifier output = %.2f volts\" %V_pout;"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "half wave rectifier output = 4.30 volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.2(b), Page Number: 46<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' half wave rectifier output'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "#let V_in=100*sin(2*%pi*f.*t) be input wave ,hence frequency=1Hz",
+ "f=1; #frequency",
+ "T=1/f; #time period",
+ "V_p_in=100; #peak input voltage",
+ "",
+ "#calculation",
+ "V_pout=(V_p_in-0.7); #peak output ",
+ "t_d=(math.asin(0.7/V_p_in))/(2*math.pi*f) ",
+ "",
+ "#result",
+ "print \"output of half wave rectifier = %.2f volts\" %V_pout"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output of half wave rectifier = 99.30 volts"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.3, Page Number: 48<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Average value of half wave rectifier'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_p_in=156; #Peak input voltage",
+ "V_p_pri=156; #Peak voltage of primary of transformer",
+ "n=0.5; #Turn ratio is 2:1",
+ "",
+ "#calculation",
+ "V_p_sec=n*V_p_pri;",
+ "V_p_out=(V_p_sec-0.7); #Peak output voltage",
+ "",
+ "#result",
+ "print \"peak output voltage of half wave rectifier = %.1f volts\" %V_p_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak output voltage of half wave rectifier = 77.3 volts"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.4, Page Number: 49<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Average value of full wave rectifier'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_p=15; #Peak voltage in volt",
+ "",
+ "#calculation",
+ "V_avg=(2*V_p)/math.pi;",
+ "",
+ "#result",
+ "print \"Average value of output of full wave rectifier = %.2f volts\" %V_avg"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average value of output of full wave rectifier = 9.55 volts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.5, Page Number: 52<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''PIV full wave'''",
+ "",
+ "V_p_pri=100.0; #Peak voltage across primary winding",
+ "n=1.0/2; #tun ratio is 2:1",
+ "V_p_sec=n*V_p_pri;",
+ "V_sec=V_p_sec/2; #voltage across each secondary is half the total voltage",
+ "V_pout=V_sec-0.7;",
+ "",
+ "print('full wave rectifier output voltage = %f V'%V_pout)",
+ "PIV=2*V_pout+0.7;",
+ "print('PIV = %fV'%PIV)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "full wave rectifier output voltage = 24.300000 V",
+ "PIV = 49.300000V"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.6, Page Number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Peak voltage of diode'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_rms=12.0; #rms secondary voltage",
+ "",
+ "#calculation",
+ "V_p_sec=math.sqrt(2)*V_rms; #peak secondary voltage",
+ "V_th=0.7; #knee voltage of diode",
+ "V_p_out=V_p_sec-2*V_th; #in one cycle, 2 diodes conduct",
+ "PIV=V_p_out+V_th; #applying KVL",
+ "",
+ "#result",
+ "print \"Peak output voltage = %.2f volt\" %V_p_out",
+ "print \"PIV across each diode = %.2f volt\" %PIV"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak output voltage = 15.57 volt",
+ "PIV across each diode = 16.27 volt"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.7, Page Number: 58<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Ripple Factor'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "R_l=2200; #load resistance in Ohm",
+ "C=50*10**-6; #capacitance in Farad",
+ "V_rms=115; #rms of primary",
+ "",
+ "#calculation",
+ "V_p_pri=math.sqrt(2)*V_rms; #peak voltage across primary",
+ "n=0.1; #turn ratio is 10:1",
+ "V_p_sec=n*V_p_pri; #primary voltage across secondary",
+ "V_p_rect=V_p_sec-1.4 #unfiltered peak rectified voltage",
+ "#we subtract 1.4 because in each cycle 2 diodes conduct & 2 do not",
+ "f=120; #frequency of full wave rectified voltage",
+ "V_r_pp=(1/(f*R_l*C))*V_p_rect; #peak to peak ripple voltage",
+ "V_DC=(1-(1/(2*f*R_l*C)))*V_p_rect;",
+ "r=V_r_pp/V_DC;",
+ "",
+ "#result",
+ "print \"Ripple factor = %.3f \" %r"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ripple factor = 0.079 "
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.8, Page Number: 62<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Min & Max voltage'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_REF=1.25; #in volts",
+ "V_R1=V_REF; #voltage in volt",
+ "R1=220.0; #in ohms",
+ "I_ADJ=50*10**-6 #in amperes",
+ "",
+ "#calculation",
+ "# MAX VALUE OF R2=5000 Ohms",
+ "R2_min=0.0; #min resistance",
+ "V_out_min=V_REF*(1+(R2_min/R1))+I_ADJ*R2_min;",
+ "R2_max=5000.0; #max value of resistance",
+ "V_out_max=V_REF*(1+(R2_max/R1))+I_ADJ*R2_max;",
+ "",
+ "#result",
+ "print \"minimum output voltage = %.2f volt\" %V_out_min",
+ "print \"maximum output voltage = %.2f volt\" %V_out_max"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum output voltage = 1.25 volt",
+ "maximum output voltage = 29.91 volt"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.9,Page Number: 64<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Load regulation percentage'''",
+ "",
+ "V_NL=5.18 #No load output voltage",
+ "V_FL=5.15 #Full load output voltage",
+ "load_reg=((V_NL-V_FL)/V_FL)*100 #In percentage",
+ "print('load regulation percent = %.2f%% '%load_reg)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "load regulation percent = 0.58% "
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.10, Page Number: 66<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Negative diode limiter'''",
+ "",
+ "import pylab as py",
+ "import numpy as np",
+ "",
+ "#let input wave be V_in=V_p_in*sin(2*%pi*f*t) ",
+ "f=1.0; #Frequency is 1Hz",
+ "T=1/f;",
+ "R_1=100.0; #Resistances in ohms",
+ "R_L=1000.0; #Load",
+ "V_p_in=10.0; #Peak input voltage",
+ "V_th=0.7; #knee voltage of diode",
+ "",
+ "V_p_out=V_p_in*(R_L/(R_L+R_1)); #peak output voltage",
+ "print('peak output voltage = %.2f V'%V_p_out)",
+ "",
+ "t = np.arange(0, 3.5 , 0.0005)",
+ "z=V_p_in*np.sin(2*np.pi*f*t)*(R_L/(R_L+R_1))",
+ "",
+ "subplot(211)",
+ "plot(t,z)",
+ "ylim(-9.09,9.09)",
+ "title('Input Voltage Waveform')",
+ "",
+ "subplot(212)",
+ "plot(t,z)",
+ "ylim(-0.07,9.09)",
+ "title('Output Voltage Waveform')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak output voltage = 9.09 V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 12,
+ "text": [
+ "<matplotlib.text.Text at 0xa3bf44c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEICAYAAACgQWTXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXl4TNcbx78TiSWWiC1kIYgtliSEoEJCa21SlFoqYqvu\npTtKaavtT1vVhaou9tpVaZFaakpjJ4RErImEBIkQ2cgy5/fHa0YSk2Qy9965986cz/N4Hpm5c86b\nd06+973vOec9GsYYA4fD4XCsAju5DeBwOByOeHBR53A4HCuCizqHw+FYEVzUORwOx4rgos7hcDhW\nBBd1DofDsSK4qHMUj1arhYeHh9xmKIbc3FyEhISgdu3aGDFihNzmcBQGF3Urx9PTE3v37pW8nzlz\n5iAsLKzU9/v374/Zs2c/9vrWrVvRqFEj6HQ6k/vy9PTEP//8Y5adQli7di28vb2LvfbUU08ZfW3e\nvHmS2bFp0ybcunUL6enpWL9+vWT9cNQJF3UrR6PRQKPRyG0Gxo0bh9WrVz/2+qpVqzBmzBjY2Zk+\nFDUaDeTYM9ezZ0/ExcXh9u3bAICCggKcPn0a9+/fR1pamuG1w4cPo1evXpLZcfXqVbRs2bJCPtNT\nUFAggUUcRcE4Vo2npyfbu3cvY4yxZcuWsSeeeIK98847zNnZmTVt2pTt3LnTcG2vXr3YtGnTWJcu\nXVitWrXYM888w9LT0xljjO3bt4+5u7sXa7tJkyZsz549bOfOnaxy5cr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xEnRKFjpTqez3l2Q9U3P+CRd3YJqTr16+Xe821a9eEdi0Kptiv0Whw\n8OBB+Pj4YODAgYiNjbW0mWajZN+bgpp8n5CQgKioKAQEBBR7XQ3fQWm2K93/Op0Ovr6+cHFxQXBw\nMLy9vYu9r3Tfl2e/Of43e/VL0U5NoeTdRikbk0yxo2PHjkhKSoKjoyN27tyJwYMH44KKzltTqu9N\nQS2+z8rKwrBhw/Dtt9+ihpEC6kr+DsqyXen+t7Ozw6lTp5CRkYF+/fpBq9U+tmtdyb4vz35z/C84\nUjdlE1LJa65duwY3NzehXYuCKfbXrFnT8Jg0YMAA5OfnI10lRWGU7HtTUIPv8/Pz8eyzz2LMmDEY\nPHjwY+8r+Tsoz3Y1+B8AnJycMGjQIBw/frzY60r2fVFKs98c/wsWdVM2IYWGhmLlypUAgMOHD6N2\n7dpwcXER2rUomGL/zZs3DXf7o0ePgjFmNPelRJTse1NQuu8ZY5g4cSK8vb0xdepUo9co9TswxXYl\n+z8tLQ13794FAOTm5mL37t3w8/Mrdo1SfQ+YZr85/hecfiltE9KSJUsAAC+++CIGDhyIHTt2wMvL\nC9WrV8eyZcuEdisapti/adMmLF68GPb29nB0dMS6detktvoRo0aNwr///ou0tDR4eHjgo48+Qv7D\nE7OV7nugfPuV7HsAiIyMxOrVq9GhQwfDH+Rnn32GxMREAMr+DkyxXcn+T0lJQXh4OHQ6HXQ6HcLC\nwtCnTx/VaI8p9pvjf775iMPhcKwIyY+z43A4HI7l4KLO4XA4VgQXdQ6Hw7EiuKhzOByOFcFFncPh\ncKwILuocDodjRfwfUaYhEUjyJ+wAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.11, Page Number: 67<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Positive and negative Diode limiter'''",
+ "",
+ "#from pylab import figure, show",
+ "#from numpy import arange, sin, pi,bool",
+ "#import numpy as np",
+ "import pylab as py",
+ "import numpy as np",
+ "#let input wave be V_in=V_p_in*sin(2*%pi*f*t) ",
+ "f=1.0; #Frequency is 1Hz",
+ "T=1/f;",
+ "V_p_in=10; #Peak input voltage",
+ "V_th=0.7; #knee voltage of diode",
+ "print('max output voltage is 5.7V')",
+ "print('min output voltage is -5.7V')",
+ "",
+ "###############GRAPH Plotting#################################",
+ "t = arange(0.0,4.5,0.0005)",
+ "V_in=V_p_in*sin(2*pi*f*t);",
+ "",
+ "Vout=V_in;",
+ "#fig = figure(2)",
+ "subplot(211)",
+ "plot(t,V_in)",
+ "#ax2.grid(True)",
+ "ylim( (-10,10) )",
+ "title('Input to the +ve and -ve diode limiter ')",
+ "subplot(212)",
+ "plot(t,V_in)",
+ "#ax1.grid(True)",
+ "ylim( (-5.7,5.7) )",
+ "title('Output of +ve and -ve diode limiter')",
+ " "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "max output voltage is 5.7V",
+ "min output voltage is -5.7V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 13,
+ "text": [
+ "<matplotlib.text.Text at 0xa6c976c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEICAYAAAC+iFRkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXlYldX2x7+HQQFBZJBZZlBBRcxEUxI0BxxKsxRNzbK5\nvJm3uln5E7uledUGs8G6XdHMuUFTwhGcUKkky1lGmcUEZZLhnP37Y3eODOfAyznvsN/j+3keHuWc\n9+y9zmLt9a537b3XVhFCCBQUFBQUzBoLqQVQUFBQUBAexdkrKCgo3AUozl5BQUHhLkBx9goKCgp3\nAYqzV1BQULgLUJy9goKCwl2A4uwVOJOamooePXpILQYTzJkzB4sWLZJaDMTExODrr78GAHz77bcY\nM2aMUe0kJCRg1q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xxWVlaws7PD\nli1bBJVp+vTpOHz4MK5fv44ePXpgyZIlaGho0Mkjto64yiW2ngDg+PHj2LhxI/r164fIyEgAwNKl\nS3H16lWdXGLri4tMYuuquLgYj/9/O3dsAkAMQgHU3ZwjZP8l5KqDlOGKs/C9CUSSXwi6d1RVVFWs\ntSIzW//eTU0db+r0jmc6+3RT05c+tRxCA+BfNmgBBhD2AAMIe4ABhD3AAMIeYABhDzDAAwJBIdo4\nx/PeAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.12, Page Number: 76<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Positive diode limiter'''",
+ "",
+ "#variable declaration",
+ "V_p_in=18.0; #peak input voltage is 18V",
+ "V_supply=12.0;",
+ "R2=100.0;",
+ "R3=220.0; #resistances in ohms",
+ "#calculation",
+ "V_bias=V_supply*(R3/(R2+R3));",
+ "",
+ "#result",
+ "print('diode limiting the voltage at this voltage =%fV'%V_bias)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diode limiting the voltage at this voltage =8.250000V"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.13, Page Number: 78<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Negative Clamping circuit'''",
+ "",
+ "V_p_in=24.0;",
+ "V_DC=-(V_p_in-0.7); #DC level added to output",
+ "print('V_DC = %.1fV'%V_DC)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_DC = -23.3V"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter3.ipynb b/Electronic_Devices_/Chapter3.ipynb
new file mode 100644
index 00000000..41e63a83
--- /dev/null
+++ b/Electronic_Devices_/Chapter3.ipynb
@@ -0,0 +1,377 @@
+{
+ "metadata": {
+ "name": "Chapter_3"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 3: Special-purpose Diodes<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.1, Page Number:88<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Zener Impedence'''",
+ "",
+ "# variable declaration",
+ "delVZ=50*10**-3; #voltage in volts, from graph",
+ "delIZ=5*10**-3; #current in amperes, from rgraph",
+ "",
+ "#calculation",
+ "ZZ=delVZ/delIZ; #zener impedence",
+ "",
+ "# result",
+ "print \"zener impedance = %d ohm \" %ZZ"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zener impedance = 10 ohm "
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.2, Page Number:89<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Voltage accross zener terminals'''",
+ "",
+ "# variable declaration",
+ "I_ZT=37*10**-3; #IN AMPERES",
+ "V_ZT=6.80; #IN VOLTS",
+ "Z_ZT=3.50; #IN OHMS",
+ "I_Z=50*10**-3; #IN AMPERES",
+ "",
+ "#calculation",
+ "DEL_I_Z=I_Z-I_ZT; #change current",
+ "DEL_V_Z=DEL_I_Z*Z_ZT; #change voltage",
+ "V_Z=V_ZT+DEL_V_Z; #voltage across zener terminals",
+ "print \"voltage across zener terminals when current is 50 mA = %.3f volts\" %V_Z",
+ "I_Z=25*10**-3; #IN AMPERES",
+ "DEL_I_Z=I_Z-I_ZT; #change current",
+ "DEL_V_Z=DEL_I_Z*Z_ZT; #change voltage",
+ "V_Z=V_ZT+DEL_V_Z; #voltage across zener terminals",
+ "",
+ "#result",
+ "print \"voltage across zener terminals when current is 25 mA = %.3f volts\" %V_Z"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage across zener terminals when current is 50 mA = 6.845 volts",
+ "voltage across zener terminals when current is 25 mA = 6.758 volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.3, Page Number:90<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Zener Voltage'''",
+ "",
+ "# variable declaration",
+ "V_Z=8.2; #8.2 volt zener diode",
+ "TC=0.0005; #Temperature coefficient (per degree celsius)",
+ "T1=60; #Temperature 1 in celsius",
+ "T2=25; #Temperature 2 in celsius",
+ "",
+ "#calculation",
+ "DEL_T=T1-T2; #change in temp",
+ "del_V_Z=V_Z*TC*DEL_T; #change in voltage",
+ "voltage=V_Z+del_V_Z; #zener voltage",
+ "",
+ "#result",
+ "print \"zener voltage at 60 degree celsius = %.3f volt\" %voltage"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zener voltage at 60 degree celsius = 8.343 volt"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.4, Page Number:90<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Power dissipation'''",
+ "",
+ "# variable declaration",
+ "P_D_max=400*10**-3; #power in watts",
+ "df=3.2*10**-3 #derating factor in watts per celsius",
+ "del_T=(90-50); #in celsius, temperature difference",
+ "",
+ "#calculation",
+ "P_D_deru=P_D_max-df*del_T; #power dissipated",
+ "P_D_der=P_D_deru*1000;",
+ "",
+ "#result",
+ "print \"maximum power dissipated at 90 degree celsius = %d mW\" %P_D_der"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum power dissipated at 90 degree celsius = 272 mW"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.5, Page Number: 92<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Zener Diode voltage regulation'''",
+ "",
+ "# variable declaration",
+ "V_Z=5.1;",
+ "I_ZT=49*10**-3;",
+ "I_ZK=1*10**-3;",
+ "Z_Z=7;",
+ "R=100;",
+ "P_D_max=1;",
+ "",
+ "#calculation",
+ "V_out=V_Z-(I_ZT-I_ZK)*Z_Z; #output voltage at I_ZK",
+ "V_IN_min=I_ZK*R+V_out; #input voltage",
+ "I_ZM=P_D_max/V_Z; #current",
+ "V_out=V_Z+(I_ZM-I_ZT)*Z_Z; #output voltage at I_ZM",
+ "V_IN_max=I_ZM*R+V_out; #max input voltage",
+ "",
+ "#result",
+ "print \"maximum input voltage regulated by zener diode = %.3f volts\" %V_IN_max",
+ "print \"minimum input voltage regulated by zener diode = %.3f volts\" %V_IN_min"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum input voltage regulated by zener diode = 25.737 volts",
+ "minimum input voltage regulated by zener diode = 4.864 volts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.6, Page Number: 93<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Min & Max current'''",
+ "",
+ "# variable declaration",
+ "V_Z=12.0; #voltage in volt",
+ "V_IN=24.0; #ip voltage in volt",
+ "I_ZK=0.001; #current in ampere",
+ "I_ZM=0.050; #current in ampere ",
+ "Z_Z=0; #impedence",
+ "R=470; #resistance in ohm",
+ "",
+ "#calculation",
+ "#when I_L=0, I_Z is max and is equal to the total circuit current I_T",
+ "I_T=(V_IN-V_Z)/R; #current",
+ "I_Z_max=I_T; #max current",
+ "if I_Z_max<I_ZM : # condition for min currert ",
+ " I_L_min=0;",
+ "",
+ "I_L_max=I_T-I_ZK; #max current",
+ "R_L_min=V_Z/I_L_max; #min resistance",
+ "",
+ "#result",
+ "print \"minimum value of load resistance = %.2f ohm\" %R_L_min",
+ "print \"minimum curent = %.3f ampere\" %I_L_min",
+ "print \"maximum curent = %.3f ampere\" %I_L_max"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum value of load resistance = 489.16 ohm",
+ "minimum curent = 0.000 ampere",
+ "maximum curent = 0.025 ampere"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.7, Page Number: 94<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' to find load resistance'''",
+ "",
+ "# variable declaration",
+ "V_IN=24.0; #voltage in volt",
+ "V_Z=15.0; #voltage in volt",
+ "I_ZK=0.25*10**-3; #current in ampere",
+ "I_ZT=17*10**-3; #current in ampere",
+ "Z_ZT=14.0; #impedence",
+ "P_D_max=1.0; #max power dissipation",
+ "",
+ "#calculation",
+ "V_out_1=V_Z-(I_ZT-I_ZK)*Z_ZT; #output voltage at I_ZK",
+ "print \"output voltage at I_ZK = %.2f volt\" %V_out_1",
+ "I_ZM=P_D_max/V_Z;",
+ "",
+ "V_out_2=V_Z+(I_ZM-I_ZT)*Z_ZT; #output voltage at I_ZM",
+ "print \"output voltage a I_ZM = %.2f volt\" %V_out_2",
+ "R=(V_IN-V_out_2)/I_ZM; #resistance",
+ "print \"value of R for maximum zener current, no load = %.2f ohm\" %R",
+ "print \"closest practical value is 130 ohms\"",
+ "R=130.0;",
+ "#for minimum load resistance(max load current) zener current is minimum (I_ZK)",
+ "I_T=(V_IN-V_out_1)/R; #current",
+ "I_L=I_T-I_ZK; #current",
+ "R_L_min=V_out_1/I_L; #minimum load resistance",
+ "",
+ "#result",
+ "print \"minimum load resistance = %.2f ohm\" %R_L_min"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage at I_ZK = 14.77 volt",
+ "output voltage a I_ZM = 15.70 volt",
+ "value of R for maximum zener current, no load = 124.57 ohm",
+ "closest practical value is 130 ohms",
+ "minimum load resistance = 208.60 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.8, Page Number: 96<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Zener limiting'''",
+ "",
+ "#variable declaration",
+ "V_p_in=10.0; #Peak input voltage",
+ "V_th=0.7; #forward biased zener",
+ "V_Z1=5.1;",
+ "V_Z2=3.3;",
+ "",
+ "V_p_in=20.0;",
+ "V_Z1=6.2;",
+ "V_Z2=15.0;",
+ "",
+ "#result",
+ "print('max voltage = %.1f V'%(V_Z1+V_th))",
+ "print('min voltage = %.1f V'%(-(V_Z2+V_th)))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "max voltage = 6.9 V",
+ "min voltage = -15.7 V"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter4.ipynb b/Electronic_Devices_/Chapter4.ipynb
new file mode 100644
index 00000000..b76b7b18
--- /dev/null
+++ b/Electronic_Devices_/Chapter4.ipynb
@@ -0,0 +1,455 @@
+{
+ "metadata": {
+ "name": "Chapter_4"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 4: Bipolar Junction Transistors (BJTs)<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.1, Page Number: 120 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Emitter current'''",
+ "",
+ "# variable declaration",
+ "I_C=3.65*10**-3; #collector current in amperes",
+ "I_B=50*10**-6; #base current in amperes",
+ "",
+ "#calculation",
+ "B_DC=I_C/I_B; #B_DC value",
+ "I_E=I_B+I_C; #current in ampere",
+ "",
+ "# result",
+ "print \"B_DC = %d \" %B_DC",
+ "print \"Emitter current = %.4f ampere\" %I_E"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B_DC = 73 ",
+ "Emitter current = 0.0037 ampere"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.2, Page Number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Current and Voltage values'''",
+ "",
+ "# variable declaration",
+ "V_BE=0.7; # voltage in volt",
+ "B_DC=150; # voltage in volt",
+ "V_BB=5; # voltage in volt",
+ "V_CC=10; # voltage in volt",
+ "R_B=10*10**3; # resistance in ohm",
+ "R_C=100; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_B=(V_BB-V_BE)/R_B; #base current in amperes",
+ "I_C=B_DC*I_B; #collector current in amperes",
+ "I_E=I_C+I_B; #emitter current in amperes",
+ "V_CE=V_CC-I_C*R_C; #collector to emitter voltage in volts",
+ "V_CB=V_CE-V_BE; #collector to base voltage in volts",
+ "",
+ "# result",
+ "print \"base current = %.5f amperes\" %I_B",
+ "print \"collector current = %.4f amperes\" %I_C",
+ "print \"emitter current = %.5f amperes\" %I_E",
+ "print \"collector to emitter voltage =%.2f volts\" %V_CE",
+ "print \"collector to base voltage =%.2f volts\" %V_CB"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "base current = 0.00043 amperes",
+ "collector current = 0.0645 amperes",
+ "emitter current = 0.06493 amperes",
+ "collector to emitter voltage =3.55 volts",
+ "collector to base voltage =2.85 volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.3, Page Number: 123<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Ideal family of collector curve'''",
+ "",
+ "",
+ "import pylab as py",
+ "import numpy as np",
+ "",
+ "#variable declaration",
+ "beta=100 # current gain",
+ "print'Ideal family of collector curve'",
+ "",
+ "ic1 = arange(0.00001, 0.45, 0.0005)",
+ "ic2 = arange(0.00001, 0.5, 0.0005)",
+ "ic3 = arange(0.00001, 0.6, 0.0005)",
+ "ic4 = arange(0.00001, 0.7, 0.0005)",
+ "vcc1=ic1*0.5/0.7",
+ "vcc2=ic2*1.35/0.7",
+ "vcc3=ic3*2/0.7",
+ "vcc4=ic4*2.5/0.7",
+ "m1=arange(0.45,5.0,0.0005)",
+ "m2=arange(0.5,5.0,0.0005)",
+ "m3=arange(0.6,5.0,0.0005)",
+ "m4=arange(0.7,5.0,0.0005)",
+ "",
+ "plot(ic1,vcc1,'b')",
+ "plot(ic2,vcc2,'b')",
+ "plot(ic3,vcc3,'b')",
+ "plot(ic4,vcc4,'b')",
+ "plot(m1,0.32*m1/m1,'b')",
+ "plot(m2,0.96*m2/m2,'b')",
+ "plot(m3,1.712*m3/m3,'b')",
+ "plot(m4,2.5*m4/m4,'b')",
+ "",
+ "ylim( (0,3) )",
+ "ylabel('Ic(mA)')",
+ "xlabel('Vce(V)')",
+ "title('Ideal family of collector curve')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ideal family of collector curve"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 4,
+ "text": [
+ "<matplotlib.text.Text at 0xa11e74c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEXCAYAAABLZvh6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYVPW6B/DvIHjhIkop4IBg4gVSAcVIQ0UNTVOizBQz\nUalQj6nVfmrno0dteyzTrWm2Pdb2caeluPV4QbnkJUa8czS8ZB4vKHIVREEhlevv/LFiYGCAQefC\nzPp+nocn1qzLvIy0XtbvXb93KYQQAkREJEtWpg6AiIhMh0mAiEjGmASIiGSMSYCISMaYBIiIZIxJ\ngIhIxpgEZCwtLQ1WVlaorKx86mN5enri8OHDWtc9evQIY8eORbt27TBhwoSnfq+a0tPT4eDggKo7\nnYODg7Fx40a9vgcA7N69G+7u7nBwcMD58+f1ckyVSgV3d3f1ckOfIZGhMAlYOGOdWBQKBRQKhdZ1\nO3fuRF5eHu7du4ft27fr9X07d+6MoqIi9Xs3FMfT+Mtf/oJ//OMfKCoqgq+vr96PD+gn9qlTp2Lh\nwoV6iojkgEnAwhnqpNgUt27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3>Example 4.4, Page Number: 125<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Transistor saturtion condition'''",
+ "",
+ "# variable declaration",
+ "V_CE_sat=0.2; # voltage in volt",
+ "V_BE=0.7; # voltage in volt",
+ "V_BB=3; # voltage in volt",
+ "V_CC=10; # voltage in volt",
+ "B_DC=50; # voltage in volt",
+ "R_B=10*10**3; # resistance in ohm",
+ "R_C=1*10**3; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_C_sat=(V_CC-V_CE_sat)/R_C; # saturation current",
+ "I_B=(V_BB-V_BE)/R_B; # base current",
+ "I_C=B_DC*I_B; # current in ampere",
+ "",
+ "# result",
+ "if I_C>I_C_sat:",
+ " print \"transistor in saturation\"",
+ "else:",
+ " print \"transistor not in saturation\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "transistor in saturation"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.5, Page Number: 127<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''maximum collector current'''",
+ "",
+ "#Variable declaration",
+ "P_D_max=250*10**-3; #max power rating of transistor in watts",
+ "V_CE=6; #voltage in volt",
+ "",
+ "#Calculation",
+ "I_Cu=P_D_max/V_CE; #Current (Amp)",
+ "I_C=I_Cu*1000;",
+ "",
+ "#Result",
+ "print \"collector current that can be handled by the transistor = %.1f mA\" %I_C",
+ "print \"\\nRemember that this is not necessarily the maximum IC. The transistor\"",
+ "print \"can handle more collectore current if Vce is reduced as long as PDmax\"",
+ "print \"is not exceeded.\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "collector current that can be handled by the transistor = 41.7 mA",
+ "",
+ "Remember that this is not necessarily the maximum IC. The transistor",
+ "can handle more collectore current if Vce is reduced as long as PDmax",
+ "is not exceeded."
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.6, Page Number: 127<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltage drop across transistor''' ",
+ "",
+ "#Variable declaration",
+ "P_D_max=800*10**-3; #max power rating of transistor in watts",
+ "V_BE=0.7; #voltage in volt",
+ "V_CE_max=15; #voltage in volt",
+ "I_C_max=100*10**-3; #Current (Amp)",
+ "V_BB=5; #voltage in volt",
+ "B_DC=100; #voltage in volt",
+ "R_B=22*10**3; # resistance in ohm",
+ "R_C=10**3; # resistance in ohm",
+ "",
+ "#Calculation",
+ "I_B=(V_BB-V_BE)/R_B; # base current",
+ "I_C=B_DC*I_B; #collector current ",
+ "V_R_C=I_C*R_C; #voltage drop across R_C",
+ "V_CC_max=V_CE_max+V_R_C; #Vcc max in volt",
+ "P_D=I_C*V_CE_max; #max power rating",
+ "",
+ "#Result",
+ "if P_D<P_D_max:",
+ " print \"V_CC = %.2f volt\" %V_CC_max",
+ " print \"V_CE_max will be exceeded first because entire supply voltage V_CC will be dropped across the transistor\"",
+ " "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_CC = 34.55 volt",
+ "V_CE_max will be exceeded first because entire supply voltage V_CC will be dropped across the transistor"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.7, Page Number: 128<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power dissipation'''",
+ "",
+ "#Variable declaration",
+ "df=5*10**-3; #derating factor in watts per degree celsius",
+ "T1=70; #temperature 1",
+ "T2=25; #temperature 2",
+ "P_D_max=1; #in watts",
+ "",
+ "#Calculation",
+ "del_P_D=df*(T1-T2); #change due to temperature",
+ "P_D=P_D_max-del_P_D; # power dissipation",
+ "",
+ "#Result",
+ "print \"Power dissipated max at a temperature of 70 degree celsius = %.3f watts\" %P_D"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power dissipated max at a temperature of 70 degree celsius = 0.775 watts"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.8, Page Number: 130<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltage gain'''",
+ "",
+ "#Variable declaration",
+ "R_C=1*10**3; #resistance in ohm",
+ "r_e=50; #resistance in ohm",
+ "V_b=100*10**-3; #voltage in volt",
+ "",
+ "#Calculation",
+ "A_v=R_C/r_e; #voltage gain",
+ "V_out=A_v*V_b; #voltage in volt",
+ "",
+ "#Result",
+ "print \"voltage gain = %d \" %A_v",
+ "print \"AC output voltage = %d volt\" %V_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain = 20 ",
+ "AC output voltage = 2 volt"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.9, Page Number: 132 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power dissipation'''",
+ "",
+ "#Variable declaration",
+ "V_CC=10.0; #voltage in volt",
+ "B_DC=200.0; #voltage in volt",
+ "R_C=1.0*10**3; #resistance in ohm",
+ "V_IN=0.0; #voltage in volt",
+ "",
+ "#Calculation",
+ "V_CE=V_CC; #equal voltage",
+ "print \"when V_IN=0, transistor acts as open switch(cut-off) and collector emitter voltage = %.2f volt\" %V_CE",
+ "#now when V_CE_sat is neglected",
+ "I_C_sat=V_CC/R_C; #saturation current",
+ "I_B_min=I_C_sat/B_DC; #minimum base current",
+ "print \"\\nminimum value of base current to saturate transistor = %.5f ampere\" %I_B_min",
+ "V_IN=5; #voltage in volt",
+ "V_BE=0.7; #voltage in volt",
+ "V_R_B=V_IN-V_BE; #voltage across base resiatance",
+ "R_B_max=V_R_B/I_B_min;",
+ "",
+ "",
+ "#Result",
+ "kw=round (R_B_max)",
+ "print \"\\nmaximum value of base resistance when input voltage is 5V = %d ohm\" %kw"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V_IN=0, transistor acts as open switch(cut-off) and collector emitter voltage = 10.00 volt",
+ "",
+ "minimum value of base current to saturate transistor = 0.00005 ampere",
+ "",
+ "maximum value of base resistance when input voltage is 5V = 86000 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter5.ipynb b/Electronic_Devices_/Chapter5.ipynb
new file mode 100644
index 00000000..1b456628
--- /dev/null
+++ b/Electronic_Devices_/Chapter5.ipynb
@@ -0,0 +1,427 @@
+{
+ "metadata": {
+ "name": "Chapter_5"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 5: Transistor Bias Circuits<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.1, Page Number: 146<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Peak base current'''",
+ "",
+ "# variable declaration",
+ "V_BB=10.0; #voltage in volt",
+ "V_CC=20.0; #voltage in volt",
+ "B_DC=200.0; #B_DC value",
+ "R_B=47.0*10**3; #resistance in ohm",
+ "R_C=330.0; #resistance in ohm",
+ "V_BE=0.7; #voltage in volt",
+ "",
+ "#current",
+ "I_B=(V_BB-V_BE)/R_B; #base current",
+ "I_C=B_DC*I_B; #Q POINT",
+ "V_CE=V_CC-I_C*R_C; #Q POINT",
+ "I_C_sat=V_CC/R_C; #saturation current",
+ "I_c_peak=I_C_sat-I_C; #peak current ",
+ "I_b_peak=I_c_peak/B_DC; #peak current in ampere",
+ "",
+ "#result",
+ "print \"Q point of I_C = %.3f amperes\" %I_C",
+ "print \"Q point of V_CE = %.2f volts\" %V_CE",
+ "print \"peak base current = %.4f amperes\" %I_b_peak"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q point of I_C = 0.040 amperes",
+ "Q point of V_CE = 6.94 volts",
+ "peak base current = 0.0001 amperes"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.2, Page Number: 149<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' DC input resistance'''",
+ "",
+ "# variable declaration",
+ "B_DC=125.0; #DC value",
+ "R_E=10.0**3; #resistance in ohm",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E; #base resistance",
+ "",
+ "#Result",
+ "print \"DC input resistance, looking at base of transistor = %d ohm\" %R_IN_base"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC input resistance, looking at base of transistor = 125000 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.3, Page Number: 151<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Transistor saturation condition'''",
+ "",
+ "# variable declaration",
+ "B_DC=100; #DC value",
+ "R1=10*10**3; #resistance in ohm",
+ "R2=5.6*10**3; #resistance in ohm",
+ "R_C=1*10**3; #resistance in ohm",
+ "R_E=560; #resistance in ohm",
+ "V_CC=10; #voltage in volt",
+ "V_BE=0.7 #voltage in volt",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E; #calculate base resistance",
+ "#We can neglect R_IN_base as it is equal to 10*R2",
+ "print \"input resistance seen from base = %d ohm\" %R_IN_base",
+ "print \"which can be neglected as it is 10 times R2\"",
+ "",
+ "V_B=(R2/(R1+R2))*V_CC; #base voltage",
+ "V_E=V_B-V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "I_C=I_E; #currents are equal",
+ "V_CE=V_CC-I_C*(R_C+R_E); #voltage in volt",
+ "",
+ "#result",
+ "print \"V_CE = %.2f volts\" %V_CE",
+ "print \"I_C = %.3f amperes\" %I_C",
+ "print \"Since V_CE>0V, transistor is not in saturation\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance seen from base = 56000 ohm",
+ "which can be neglected as it is 10 times R2",
+ "V_CE = 1.95 volts",
+ "I_C = 0.005 amperes",
+ "Since V_CE>0V, transistor is not in saturation"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.4, Page Number: 154<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Emitter-Collector Voltage'''",
+ "",
+ "# variable declaration",
+ "V_EE=10.0; #voltage in volt",
+ "V_BE=0.7; #voltage in volt",
+ "B_DC=150.0; #DC value ",
+ "R1=22.0*10**3; #resistance in ohm",
+ "R2=10.0*10**3; #resistance in ohm",
+ "R_C=2.2*10**3; #resistance in ohm",
+ "R_E=1.0*10**3; #resistance in ohm",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E; #R_IN_base>10*R2,so it can be neglected",
+ "print \"input resistance as seen from base = %d ohm\" %R_IN_base",
+ "print \"it can be neglected as it is greater than 10 times R2\"",
+ "V_B=(R1/(R1+R2))*V_EE; #base voltage",
+ "V_E=V_B+V_BE; #emitter voltage",
+ "I_E=(V_EE-V_E)/R_E; #emitter current",
+ "I_C=I_E; #currents are equal",
+ "V_C=I_C*R_C; #collector voltage",
+ "V_EC=V_E-V_C; #emitter-collector voltage",
+ "",
+ "#result",
+ "print \"I_C collector current = %.4f amperes\" %I_C",
+ "print \"V_EC emitter-collector voltage = %.2f Volts\" %V_EC"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance as seen from base = 150000 ohm",
+ "it can be neglected as it is greater than 10 times R2",
+ "I_C collector current = 0.0024 amperes",
+ "V_EC emitter-collector voltage = 2.24 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.5, PAge Number: 154<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Collector-Emitter Voltage'''",
+ "",
+ "# variable declaration",
+ "R1=68.0*10**3; #resistance in ohm",
+ "R2=47.0*10**3; #resistance in ohm",
+ "R_C=1.8*10**3; #resistance in ohm",
+ "R_E=2.2*10**3; #resistance in ohm",
+ "V_CC=-6.0; #voltage in volt",
+ "V_BE=0.7; #voltage in volt",
+ "B_DC=75.0; #DC value",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E;",
+ "print \"input resistance as seen from base\"",
+ "print \"is not greater than 10 times R2 so it should be taken into account\"",
+ "#R_IN_base in parallel with R2",
+ "V_B=((R2*R_IN_base)/(R2+R_IN_base)/(R1+(R2*R_IN_base)/(R2+R_IN_base)))*V_CC;",
+ "V_E=V_B+V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "I_C=I_E; #currents are equal",
+ "V_C=V_CC-I_C*R_C; #collector voltage",
+ "V_CE=V_C-V_E; #collector-emitter voltage",
+ "",
+ "#result",
+ "print \"collector current = %.4f amperes\" %I_C",
+ "print \"collector emitter voltage = %.2f volts\" %V_CE"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance as seen from base",
+ "is not greater than 10 times R2 so it should be taken into account",
+ "collector current = -0.0006 amperes",
+ "collector emitter voltage = -3.46 volts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.6, Page Number: 156<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' change in collector emitter voltage'''",
+ "",
+ "# variable declaration",
+ "V_CC=12.0; #voltage in volt",
+ "R_B=100.0*10**3; #resistance in ohm",
+ "R_C=560.0; #resistance in ohm",
+ "#FOR B_DC=85 AND V_BE=0.7V",
+ "B_DC=85.0; #DC value",
+ "V_BE=0.7; #base-emitter voltage",
+ "",
+ "#calculation",
+ "I_C_1=B_DC*(V_CC-V_BE)/R_B; #collector current",
+ "V_CE_1=V_CC-I_C_1*R_C; #collector-emittor voltage",
+ "#FOR B_DC=100 AND V_BE=0.6V",
+ "B_DC=100.0; #DC value ",
+ "V_BE=0.6; #base emitter voltage",
+ "I_C_2=B_DC*(V_CC-V_BE)/R_B; #collector current",
+ "V_CE_2=V_CC-I_C_2*R_C; #voltage in volt",
+ "p_del_I_C=((I_C_2-I_C_1)/I_C_1)*100; #percent change in collector current ",
+ "p_del_V_CE=((V_CE_2-V_CE_1)/V_CE_1)*100; #percent change in C-E voltage",
+ "",
+ "#result",
+ "print \"percent change in collector current = %.2f\" %p_del_I_C",
+ "print \"percent change in collector emitter voltage = %.2f\" %p_del_V_CE"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percent change in collector current = 18.69",
+ "percent change in collector emitter voltage = -15.18"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.7, Page Number: 159<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' percent change in collector emitter voltage'''",
+ "",
+ "# variable declaration",
+ "V_CC=20.0; #voltage in volt",
+ "R_C=4.7*10**3; #resistance in ohm",
+ "R_E=10.0*10**3; #resistance in ohm",
+ "V_EE=-20.0; #voltage in volt",
+ "R_B=100*10**3; #resistance in ohm",
+ "#FOR B_DC=85 AND V_BE=0.7V",
+ "B_DC=85; #DC value",
+ "V_BE=0.7; #base-emitter voltage",
+ "I_C_1=(-V_EE-V_BE)/(R_E+(R_B/B_DC));",
+ "V_C=V_CC-I_C_1*R_C; #colector voltage",
+ "I_E=I_C_1; #emittor current",
+ "V_E=V_EE+I_E*R_E; #emittor voltage",
+ "V_CE_1=V_C-V_E; #CE voltage",
+ "print \"I_C_1 = %.3f\" %I_C_1",
+ "print \"V_CE_1 = %.2f\" %V_CE_1",
+ "#FOR B_DC=100 AND V_BE=0.6V",
+ "B_DC=100; #DC value ",
+ "V_BE=0.6; #base-emitter voltage",
+ "I_C_2=(-V_EE-V_BE)/(R_E+(R_B/B_DC));",
+ "V_C=V_CC-I_C_2*R_C;#colector voltage",
+ "I_E=I_C_2; #emittor current",
+ "V_E=V_EE+I_E*R_E; #emittor voltage",
+ "V_CE_2=V_C-V_E; #CE voltage",
+ "print \"I_C_2 = %.3f\" %I_C_2",
+ "print \"V_CE_2 = %.2f\" %V_CE_2",
+ "",
+ "p_del_I_C=((I_C_2-I_C_1)/I_C_1)*100;",
+ "p_del_V_CE=((V_CE_2-V_CE_1)/V_CE_1)*100;",
+ "print \"percent change in collector currrent = %.2f\" %p_del_I_C",
+ "print \"percent change in collector emitter voltage = %.2f\" %p_del_V_CE",
+ "print \"answers in book are approximated\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I_C_1 = 0.002",
+ "V_CE_1 = 14.61",
+ "I_C_2 = 0.002",
+ "V_CE_2 = 14.07",
+ "percent change in collector currrent = 2.13",
+ "percent change in collector emitter voltage = -3.69",
+ "answers in book are approximated"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.8, Page Number: 161<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Q point current and voltage'''",
+ "",
+ "# variable declaratio",
+ "V_CC=10.0; #voltage in volt",
+ "B_DC=100.0; #Dc value",
+ "R_C=10.0*10**3; #resistance in ohm",
+ "R_B=100.0*10**3; #resistance in ohm",
+ "V_BE=0.7; #base-emittor voltage",
+ "",
+ "#calculation",
+ "I_C=(V_CC-V_BE)/(R_C+(R_B/B_DC)); #collector current",
+ "V_CE=V_CC-I_C*R_C; #CE voltage",
+ "",
+ "#result",
+ "print \"Q point of collector current %.4f amperes\" %I_C",
+ "print \"Q point of collector-emitter voltage %.3f volts\" %V_CE"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q point of collector current 0.0008 amperes",
+ "Q point of collector-emitter voltage 1.545 volts"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter6.ipynb b/Electronic_Devices_/Chapter6.ipynb
new file mode 100644
index 00000000..b4e7e58a
--- /dev/null
+++ b/Electronic_Devices_/Chapter6.ipynb
@@ -0,0 +1,603 @@
+{
+ "metadata": {
+ "name": "Chapter_6"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 6: BJT Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.1, Page Number: 171<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Q point'''",
+ "# result",
+ "",
+ "print \"theoretical example\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "theoretical example"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.2, Page Number: 174<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' AC Emitter resistance'''",
+ "",
+ "# variable declaration",
+ "I_E=2.0*10**-3; #emittor current",
+ "",
+ "#calculation",
+ "r_e=25.0*10**-3/I_E; #ac emitter resistance",
+ "",
+ "#result",
+ "print \"ac emitter resistance = %.2f ohms\" %r_e "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ac emitter resistance = 12.50 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.3, Page Number: 178<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' voltage at base of transistor'''",
+ "",
+ "# variable declaration",
+ "I_E=3.8*10**-3; #emittor current",
+ "B_ac=160.0; #AC value",
+ "R1=22*10**3; #resistance in ohm",
+ "R2=6.8*10**3; #resistance in ohm",
+ "R_s=300.0; #resistance in ohm",
+ "V_s=10.0*10**-3; #voltage in volt",
+ "r_e=25.0*10**-3/I_E; ",
+ "",
+ "#calculation",
+ "R_in_base=B_ac*r_e; #base resistance",
+ "R_in_tot=(R1*R2*R_in_base)/(R_in_base*R1+R_in_base*R2+R1*R2);",
+ "V_b=(R_in_tot/(R_in_tot+R_s))*V_s; #base voltage",
+ "",
+ "#result",
+ "print \"voltage at the base of the transistor = %.3f volts\" %V_b"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage at the base of the transistor = 0.007 volts"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.4, Page Number: 180<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' bypass capacitor'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "R_E=560.0; #resistance in ohm",
+ "f=2*10**3; #minimum value of frequency in hertz",
+ "X_C=R_E/10.0; #minimum value of capacitive reactance",
+ "",
+ "#calculation",
+ "C2=1.0/(2.0*math.pi*X_C*f); #capacitor ",
+ "",
+ "#result",
+ "print \"value of bypass capacitor = %.7f farads\" %C2"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of bypass capacitor = 0.0000014 farads"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.5, Page Number: 181<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' bypass capacitor'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "r_e=6.58; #from ex6.3",
+ "R_C=1.0*10**3; #collector resistance",
+ "R_E=560; #emittor resistance",
+ "",
+ "#calculation",
+ "A_v=R_C/(R_E+r_e); #gain without bypass capacitor",
+ "A_v1=R_C/r_e; #gain with bypass capacitor",
+ "print \"gain without bypass capacitor = %.2f\" %A_v",
+ "print \"gain in the presence of bypass capacitor = %.2f\" %A_v1"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gain without bypass capacitor = 1.76",
+ "gain in the presence of bypass capacitor = 151.98"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.6, Page Number: 182<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Gain with load'''",
+ "",
+ "# variable declaration",
+ "R_C=10.0**3; #resistance in ohm",
+ "R_L=5.0*10**3; #inductor resistance",
+ "r_e=6.58; #r_e value",
+ "",
+ "#calculation",
+ "R_c=(R_C*R_L)/(R_C+R_L); #collector resistor",
+ "A_v=R_c/r_e; #gain with load",
+ "",
+ "#result",
+ "print \"ac collector resistor = %.2f ohms\" %R_c",
+ "print \"gain with load = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ac collector resistor = 833.33 ohms",
+ "gain with load = 126.65"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.7, Page Number: 184<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Voltage gain with bypass'''",
+ "",
+ "# variable declaration",
+ "R_C=3.3*10**3; #resistance in ohm",
+ "R_E1=330.0; #emitter resistance",
+ "",
+ "#calculation",
+ "A_v=R_C/R_E1; #voltage gain",
+ "",
+ "#result",
+ "print \"approximate voltage gain as R_E2 is bypassed by C2 = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "approximate voltage gain as R_E2 is bypassed by C2 = 10.00"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.8, Page Number: 184<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Common emitter amplifier'''",
+ "",
+ "import math",
+ "B_DC=150.0;",
+ "B_ac=175.0;",
+ "V_CC=10.0;",
+ "V_s=10.0*10**-3;",
+ "R_s=600.0;",
+ "R1=47.0*10**3;",
+ "R2=10.0*10**3;",
+ "R_E1=470.0;",
+ "R_E2=470.0;",
+ "R_C=4.7*10**3;",
+ "R_L=47.00*10**3;",
+ "R_IN_base=B_DC*(R_E1+R_E2);",
+ "#since R_IN_base is ten times more than R2,it can be neglected in DC voltage calculation",
+ "V_B=(R2/(R2+R1))*V_CC;",
+ "V_E=V_B-0.7;",
+ "I_E=V_E/(R_E1+R_E2);",
+ "I_C=I_E;",
+ "V_C=V_CC-I_C*R_C;",
+ "print('dc collector voltage = %.3f volts'%V_C)",
+ "r_e=25.0*10**-3/I_E;",
+ "#base resistance",
+ "R_in_base=B_ac*(r_e+R_E1);",
+ "#total input resistance",
+ "R_in_tot=(R1*R2*R_in_base)/(R1*R2+R_in_base*R1+R_in_base*R2);",
+ "attenuation=R_in_tot/(R_s+R_in_tot);",
+ "#ac collector resistance",
+ "R_c=R_C*R_L/(R_C+R_L);",
+ "#voltage gain from base to collector",
+ "A_v=R_c/R_E1;",
+ "#overall voltage gain A_V",
+ "A_V=A_v*attenuation;",
+ "#rms voltage at collector V_c",
+ "V_c=A_V*V_s;",
+ "V_out_p=math.sqrt(2)*V_c;",
+ "print('V_out peak = %d mV'%(V_out_p*1000))",
+ "",
+ "################Waveform plotting##############################",
+ "",
+ "import pylab",
+ "import numpy ",
+ "",
+ "t = arange(0.0, 4.0, 0.0005)",
+ "",
+ "",
+ "subplot(121)",
+ "plot(t, V_C+V_c*sin(2*pi*t))",
+ "ylim( (4.63,4.82) )",
+ "title('Collector Voltage')",
+ "",
+ "subplot(122)",
+ "plot(t, -V_s*sin(2*pi*t))",
+ "plot(t, V_out_p*sin(2*pi*t))",
+ "ylim( (-0.15,0.15) )",
+ "title('Source and output AC voltage')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc collector voltage = 4.728 volts",
+ "V_out peak = 119 mV"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 9,
+ "text": [
+ "<matplotlib.text.Text at 0xad2caac>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEICAYAAABfz4NwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXl8VNX5/z+TzCSZrDPZdxJ2AgipuOBXJahIUcGtKtiy\n1GrBpS4t35/W6he01g33Ulv61SqogEstm4CKGKUuIF8RFSigJJCNrJNlkklme35/HGayTWbunbud\nhPt+vXhp7tx75zPnzjzPOc95znMMRETQ0dHR0TntidBagI6Ojo4OH+gOQUdHR0cHgO4QdHR0dHRO\noTsEHR0dHR0AukPQ0dHR0TmF7hB0dHR0dADoDkEQpaWlyMvL8/9dUFCAjz76SENF8lJeXo6IiAh4\nvV6tpehwyqJFi/Dggw9qLWNI0deu8MBp5RDWrl2LKVOmICEhAdnZ2bjsssvw2Wefib6PwWCAwWCQ\npEXuH9iSJUuwcOHCfsf379+PmJgYNDc3C75XSUkJXn75Zdm0DQX+/e9/47zzzoPFYkFKSgrOP/98\n7N27V2tZqiHHdz4Qy5cvx/z58zW5X0lJCZKTk+F0Ovu9JpetEENBQQF27typ6HuE4rRxCM888wzu\nuecePPDAA6irq0NFRQVuv/12bNq0SWtpYdG3N79o0SK8++676Ojo6HX8tddew+zZs2GxWATfW4kf\n/mCmtbUVV1xxBe666y7YbDZUVVVh2bJliI6Olv29PB6P7PeUi6G0hrW8vBx79uxBenp6Pxugla0w\nGAzatzGdBjQ3N1N8fDy98847A57T2dlJd911F2VnZ1N2djbdfffd1NXVRUREH3/8MeXm5vrPLSgo\noI8++oiIiLxeLz322GM0YsQISklJoeuvv56ampr85+7atYumTp1KFouF8vLy6NVXX6W///3vZDKZ\nKCoqiuLj42nOnDlERHTw4EGaNm0aWSwWGj9+PG3atMl/n4ULF9KSJUto1qxZFBcX53//nowZM4bW\nrFnj/9vtdlN2djZt2rSJvF4v/fGPf6Rhw4ZReno6LViwgFpaWoiIqKysjAwGA7ndbrr//vspMjKS\nYmJiKD4+nn7zm98QEdGdd95JeXl5lJiYSGeeeSbt2rXL/z4dHR20YMECslqtNG7cOHriiSd6tVdV\nVRVdc801lJaWRoWFhfTCCy8IeGr88NVXX5HFYhnw9WBt2/e7Q0Q0bNgw//NbtmwZXXvttfSLX/yC\nEhMT6eWXX6bGxkZatGgRZWdnk9Vqpauuusp/7ebNm2nSpElksVjovPPOo2+//XZAXcGe2bJly+i6\n666jBQsWUEJCAo0fP5727t3rf/3rr7+m4uJiSkhIoBtuuIHmzp1LDzzwgGyff8eOHbRt2zaKiooi\nk8lE8fHxNHnyZCIimjZtGt1333109tlnU2JiIl155ZX+31Q49wvEQw89RLNnz6ZHHnmErrjiCv9x\nIbaiJ19++SVlZmaS1+v1H3v33XfpjDPOICLhduUXv/gFRUREkNlspvj4eFqxYgUREf3sZz+jzMxM\nSkpKogsvvJAOHDjgf5+Ghga64oorKDExkc466yz6wx/+QOeff77/9UOHDtEll1xCycnJNGbMGHrr\nrbdCfp7TwiFs27aNjEYjeTyeAc958MEHaerUqVRfX0/19fV03nnn0YMPPkhEwR3Cc889R1OnTqWq\nqipyOp20ePFimjdvHhERlZeXU0JCAq1fv57cbjc1NjbSN998Q0REixYt8t+fiMjpdNKIESPoscce\nI5fLRTt37qSEhAQ6fPgwETGHkJSURJ9//jkRsS9aX/70pz/RJZdc4v97+/btlJaWRm63m15++WUa\nOXIklZWVkd1up2uuuYbmz59PRN0Owdc+JSUl9PLLL/e69+uvv05NTU3k8Xjo6aefpszMTP8X+957\n76WSkhJqbm6myspKmjhxIuXl5RERkcfjoZ/85Cf0xz/+kVwu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a1lRAghBAB9U5kQQsggGgiEEEIA0EAghBAyiAYCIYQQADQQCCGEDKKBQAghBADwfwJyXZ807NQ0\nAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.9,Page Number: 190<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Power gain delievered to load'''",
+ "",
+ "# variable declaration",
+ "R_E=10.0**3; #emitter resistance",
+ "R_L=10.0**3; #resistance in ohm",
+ "R1=18.0*10**3; #R1 in ohm",
+ "R2=18.0*10**3; #R2 in ohm",
+ "B_ac=175.0; #AC value",
+ "V_CC=10.0; #voltage in volt",
+ "V_BE=0.7; #base-emitter voltage",
+ "V_in=1.0; #input voltage in volt",
+ "",
+ "#calculation",
+ "",
+ "R_e=(R_E*R_L)/(R_E+R_L); #ac emitter resistance R_e",
+ "R_in_base=B_ac*R_e; #resistance from base R_in_base",
+ "",
+ "#total input resiatance R_in_tot",
+ "R_in_tot=(R1*R2*R_in_base)/(R1*R2+R1*R_in_base+R2*R_in_base);",
+ "print \"total input resistance = %.2f ohms\" %R_in_tot",
+ "V_E=((R2/(R1+R2))*V_CC)-V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "r_e=25.0*10**-3/I_E; #emitter resistance",
+ "A_v=R_e/(r_e+R_e);",
+ "print \"voltage gain = %.2f\" %A_v",
+ "#ac emitter current I_e",
+ "#V_e=A_v*V_b=1V",
+ "V_e=1.0; #V_evoltage",
+ "I_e=V_e/R_e; #emitter current",
+ "I_in=V_in/R_in_tot; #input current in ampere",
+ "A_i=I_e/I_in; #current gain",
+ "print \"current gain = %.2f\" %A_i",
+ "A_p=A_i; #power gain",
+ "#since R_L=R_E, one half of the total power is disspated to R_L",
+ "A_p_load=A_p/2.0; #power load",
+ "print \"power gain delivered to load = %.2f\" %A_p_load"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total input resistance = 8160.62 ohms",
+ "voltage gain = 0.99",
+ "current gain = 16.32",
+ "power gain delivered to load = 8.16"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.10, Page Number: 193<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Overall voltage gain'''",
+ "",
+ "# variable declaration",
+ "V_CC=12.0; #source voltage in volt",
+ "V_BE=0.7; #base-emitter volatge",
+ "R_C=1.0*10**3; #resistance in ohm",
+ "r_e_ce=5.0; #for common emitter amplifier",
+ "R1=10.0*10**3; #resistance in ohm",
+ "R2=22.0*10**3; #resistance in ohm ",
+ "R_E=22.0; #emitter resistance in ohm",
+ "R_L=8.0; #load resistance in ohm",
+ "B_DC=100.0; #dc value",
+ "B_ac=100.0; #ac value",
+ "",
+ "#calculation",
+ "pt=R2+B_DC**2*R_E #temp variable",
+ "V_B=((R2*B_DC**2*R_E/(pt))/(R1+(R2*B_DC**2*R_E/(pt))))*V_CC;",
+ "V_E=V_B-2.0*V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "r_e=25.0*10**-3/I_E; #for darlington emitter-follower",
+ "P_R_E=I_E**2*R_E; #power dissipated by R_E",
+ "P_Q2=(V_CC-V_E)*I_E #power dissipated by transistor Q2",
+ "R_e=R_E*R_L/(R_E+R_L); #ac emitter resi. of darlington emitter follower",
+ "#total input resistance of darlington",
+ "kt=R_e+r_e #temp varaible",
+ "R_in_tot=R1*R2*B_ac**2*(kt)/(R1*R2+R1*B_ac**2*(kt)+R2*B_ac**2*(kt)); ",
+ "R_c=R_C*R_in_tot/(R_C+R_in_tot); #effective ac resistance",
+ "A_v_CE=R_c/r_e_ce; #voltage gain of common emitter",
+ "A_v_EF=R_e/(r_e+R_e); #voltage gain of common emitter amplifier",
+ "A_v=A_v_CE*A_v_EF; #overall voltage gain",
+ "",
+ "#result",
+ "print \"voltage gain of common emitter amplifier= %.2f\" %A_v_CE",
+ "print \"voltage gain of common emitter amplifier= %.2f\" %A_v_EF",
+ "print \"overall voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain of common emitter amplifier= 172.08",
+ "voltage gain of common emitter amplifier= 0.99",
+ "overall voltage gain = 169.67"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.11, Page Number: 196<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' voltage,current and power gain'''",
+ "",
+ "# variable declaration",
+ "B_DC=250.0; #dc value",
+ "R_C=2.2*10**3; #resistance in ohm",
+ "R_E=1.0*10**3; #emitter resistance",
+ "R_L=10.0*10**3;#load resistance",
+ "R1=56.0*10**3; #resistance in ohm",
+ "R2=12.0*10**3; #resistance in ohm",
+ "V_BE=0.7; #base-emitter voltage in volt",
+ "V_CC=10.0; #source voltage in volt",
+ "",
+ "#calculation",
+ "#since B_DC*R_E>>R2",
+ "V_B=(R2/(R1+R2))*V_CC;",
+ "V_E=V_B-V_BE; #emiiter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "r_e=25.0*10**-3/I_E; #r_e value",
+ "R_in=r_e; #input resistance",
+ "R_c=R_C*R_L/(R_C+R_L); #ac collector resistance",
+ "A_v=R_c/r_e; #current gain",
+ "#current gain is almost 1",
+ "#power gain is approximately equal to voltage gain",
+ "A_p=A_v; #power gain",
+ "A_i=1; #current gain",
+ "",
+ "#result",
+ "print \"input resistance = %.2f ohms\" %R_in",
+ "print \"voltage gain = %.2f\" %A_v",
+ "print \"current gain = %.2f\" %A_i",
+ "print \"power gain = %.2f\" %A_p"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance = 23.48 ohms",
+ "voltage gain = 76.80",
+ "current gain = 1.00",
+ "power gain = 76.80"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.12, Page Number: 197<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' total voltage gain in decibel'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "A_v1=10.0;",
+ "A_v2=15.0;",
+ "A_v3=20.0;",
+ "",
+ "#calcultion",
+ "A_v=A_v1*A_v2*A_v3; #overall voltage gain",
+ "A_v1_dB=20.0*math.log10(A_v1); #gain in decibel",
+ "A_v2_dB=20.0*math.log10(A_v2); #gain in decibel",
+ "A_v3_dB=20.0*math.log10(A_v3); #gain in decibel",
+ "A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB; #total gain in decibel",
+ "",
+ "#result",
+ "print \"overall voltage gain = %.1f\" %A_v",
+ "print \"Av1 = %.1f dB\" %A_v1_dB",
+ "print \"Av2 = %.1f dB\" %A_v2_dB",
+ "print \"Av3 = %.1f dB\" %A_v3_dB",
+ "print \"total voltage gain =%.1f dB\" %A_v_dB"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "overall voltage gain = 3000.0",
+ "Av1 = 20.0 dB",
+ "Av2 = 23.5 dB",
+ "Av3 = 26.0 dB",
+ "total voltage gain =69.5 dB"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter7.ipynb b/Electronic_Devices_/Chapter7.ipynb
new file mode 100644
index 00000000..c8920a17
--- /dev/null
+++ b/Electronic_Devices_/Chapter7.ipynb
@@ -0,0 +1,727 @@
+{
+ "metadata": {
+ "name": "Chapter_7"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 7: Field-effect Transistors (FETs)<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.1, Page Number: 217<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 318
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Constant current area of operation of JFET'''",
+ "",
+ "# variable declaration",
+ "V_GS_off=-4; # voltage in volt",
+ "I_DSS=12*10**-3; # current in ampere",
+ "R_D=560; # resistance in ohm",
+ "",
+ "#calculation",
+ "V_P=-1*V_GS_off; # volt ",
+ "V_DS=V_P; # Vds in volt",
+ "I_D=I_DSS; # current accross resistor",
+ "V_R_D=I_D*R_D; #voltage across resistor",
+ "V_DD=V_DS+V_R_D; # Vdd in volt",
+ "",
+ "# result",
+ "print \"The value of V_DD required to put the device in the constant\"",
+ "print \" current area of operation of JFET = %.2f volt\" %V_DD"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_DD required to put the device in the constant",
+ " current area of operation of JFET = 10.72 volt"
+ ]
+ }
+ ],
+ "prompt_number": 319
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.2, Page Number: 218<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Drain current'''",
+ "",
+ "print('The p-channel JFET requires a positive gate to source voltage.')",
+ "print('The more positive the voltage, the lesser the drain current.')",
+ "print('Any further increase in V_GS keeps the JFET cut off, so I_D remains 0')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The p-channel JFET requires a positive gate to source voltage.",
+ "The more positive the voltage, the lesser the drain current.",
+ "Any further increase in V_GS keeps the JFET cut off, so I_D remains 0"
+ ]
+ }
+ ],
+ "prompt_number": 320
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.3, Page number: 219<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''JFET current voltage'''",
+ "",
+ "I_DSS=9.0*10**-3;",
+ "V_GS_off=-8.0;",
+ "V_GS=0.0;",
+ "I_D=9.0*10**-3",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Value of I_D for V_GS=0V is %f A '%I_D)",
+ "V_GS=-1.0",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Value of I_D for V_GS=-1V is %f A'%I_D)",
+ "V_GS= -4.0",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Value of I_D for V_GS=-4V is %f A'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of I_D for V_GS=0V is 0.009000 A ",
+ "Value of I_D for V_GS=-1V is 0.006891 A",
+ "Value of I_D for V_GS=-4V is 0.002250 A"
+ ]
+ }
+ ],
+ "prompt_number": 321
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.4, Page Number: 220<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''JFET transconductance'''",
+ "",
+ "#Variable Declaration",
+ "I_DSS=3.0*10**-3;",
+ "V_GS_off=-6.0;",
+ "y_fs_max=5000.0*10**-6;",
+ "V_GS=-4.0;",
+ "g_m0=y_fs_max;",
+ "",
+ "#Calculation",
+ "g_m=g_m0*(1-(V_GS/V_GS_off));",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))",
+ "",
+ "#Result",
+ "print('forward transconductance = %f Siemens'%g_m)",
+ "print('value of I D = %f A'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "forward transconductance = 0.001667 Siemens",
+ "value of I D = 0.001000 A"
+ ]
+ }
+ ],
+ "prompt_number": 322
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.5, Page Number: 221<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find input resistance'''",
+ "",
+ "# variable declaration",
+ "V_GS=-20.0; # voltage in volt",
+ "I_GSS=-2*10**-9; # current in ampere",
+ "",
+ "#calculation",
+ "R_IN1=abs((-20/(2*10**-9))) # resistance in ohm",
+ "R_IN=R_IN1/(10**9)",
+ "",
+ "# result",
+ "print \"Input resistance = %d Giga ohm\" %R_IN"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input resistance = 10 Giga ohm"
+ ]
+ }
+ ],
+ "prompt_number": 323
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.6, Page Number: 223<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find gate to source voltage'''",
+ "",
+ "# variable declaration",
+ "V_DD=15; # voltage in volt",
+ "V_G=0; # voltage in volt",
+ "I_D=5*10**-3; # current in ampere",
+ "R_D=1*10**3; # resistance in ohm",
+ "R_G=10*10**6; # resistance in ohm",
+ "R_S=220; # resistance in ohm",
+ "",
+ "# calculation",
+ "V_S=I_D*R_S; # source voltage in volt",
+ "V_D=V_DD-I_D*R_D; # drain voltage in volt",
+ "V_DS=V_D-V_S; # drain to source voltage in volt",
+ "V_GS=V_G-V_S; # gate to source voltage in volt",
+ "",
+ "# result",
+ "print \"Drain to source voltage = %.2f volts\" %V_DS",
+ "print \"Gate to source voltage = %.2f volts\" %V_GS"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to source voltage = 8.90 volts",
+ "Gate to source voltage = -1.10 volts"
+ ]
+ }
+ ],
+ "prompt_number": 324
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.7, Page Number: 224<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Gate resistance'''",
+ "",
+ "# variable declaration",
+ "V_GS=-5.0; # voltage in volt",
+ "I_D=6.25*10**-3; # current in ampere",
+ "",
+ "#calculation",
+ "R_G=abs((V_GS/I_D)) # resistance in ohm",
+ "",
+ "# result",
+ "print \"Gate resistance = %d ohm\" %R_G"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gate resistance = 800 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 325
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.8, Page Number: 224<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Self bias Q point'''",
+ "",
+ "I_DSS=25.0*10**-3;",
+ "V_GS_off=15.0;",
+ "V_GS=5.0;",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2",
+ "R_S=abs((V_GS/I_D))",
+ "print('Drain current = %f Amperes'%I_D)",
+ "print('Source resistance = %.0f Ohms'%R_S)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current = 0.011111 Amperes",
+ "Source resistance = 450 Ohms"
+ ]
+ }
+ ],
+ "prompt_number": 326
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.9, Page Number: 225<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Drain resistance'''",
+ "",
+ "# variable declaration",
+ "V_D=6; # drain voltage in volt",
+ "V_GS_off=-3; # off voltage in volt",
+ "V_DD=12; # voltage in volt",
+ "I_DSS=12*10**-3; # current in ampere",
+ "",
+ "#calculation",
+ "I_D=I_DSS/2; #MIDPOINT BIAS",
+ "V_GS=V_GS_off/3.4; #MIDPOINT BIAS",
+ "R_S=abs((V_GS/I_D)) #resistance i voltage",
+ "R_D=(V_DD-V_D)/I_D #resistance in voltage ",
+ "",
+ "# result",
+ "print \"Source resistance = %.2f ohm\" %R_S",
+ "print \"Drain resistance = %d ohm\" %R_D"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Source resistance = 147.06 ohm",
+ "Drain resistance = 1000 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 327
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.10, Page Number: 227<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find transfer characteristic'''",
+ "",
+ "import pylab",
+ "import numpy",
+ "",
+ "# variable declaration",
+ "R_S=680.0; # resistance in ohm",
+ "I_D=0; # current in ampere",
+ "",
+ "#calculation",
+ "V_GS=I_D*R_S; #FOR I_D=0A",
+ "",
+ "I_DSS=4*10**-3; # current in ampere",
+ "I_D=I_DSS; # currents are equal",
+ "V_GS1=-1*I_D*R_S; #FOR I_D=4mA",
+ "",
+ "# result",
+ "print \"V_GS at I_D=0amp is %d volt\" %V_GS",
+ "print \"V_GS at I_D=4mA is %.2f volt\" %V_GS1",
+ "print \"Plotting load line using the values of V_GS at I_D=0 and 4mA,\"",
+ "print \" we find the intersection of load line with transfer characteristic\"",
+ "print \" to get Q-point values of V_GS=-1.5V and I_D=2.25mA\"",
+ "",
+ "#########PLOT######################",
+ "idss=4",
+ "vgsoff=-6",
+ "vgs=arange(-6.0,0.0,0.0005)",
+ "idk=arange(0.0,4.0,0.0005)",
+ "ids=arange(0.0,2.25,0.0005)",
+ "vgsk=-idk*0.68",
+ "i_d=idss*(1-(vgs/vgsoff))**2",
+ "text(-3.00,2.25,'Q Point',size=13)",
+ "text(-3.25,2,'(-1.5V, 2.25mA)')",
+ "plot(vgs,i_d)",
+ "plot(vgsk,idk,'b')",
+ "plot(-1.5,2.25,'o')",
+ "ylim( (0,5) )",
+ "title('Transfer characteristic curve')",
+ "xlabel('Vgs')",
+ "ylabel('Idss')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_GS at I_D=0amp is 0 volt",
+ "V_GS at I_D=4mA is -2.72 volt",
+ "Plotting load line using the values of V_GS at I_D=0 and 4mA,",
+ " we find the intersection of load line with transfer characteristic",
+ " to get Q-point values of V_GS=-1.5V and I_D=2.25mA"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 328,
+ "text": [
+ "<matplotlib.text.Text at 0xd95b60c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEXCAYAAABSwdSZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8TNf7B/BPNqIVkVCxhSxoLGmEhqJqNPZ9J3ZCVVe6\nWaqkVW2/VBeKLr+gakmtRWypJagt9rWWZhNbkCCJJJLMnN8fp5kKWZmZO3Pn83695iVm7tz73Eue\nOXPuOeexEUIIEBGRKtgqHQARERkOkzoRkYowqRMRqQiTOhGRijCpExGpCJM6EZGKMKnTU0lMTMQr\nr7yCcuXK4cMPPzTqsTQaDUJDQ416DFP58ssvMXr06Cd6r5OTE+Li4gwbEKmGvdIB0JMrW7YsbGxs\nAAD379+Ho6Mj7OzsAAA///wzgoKCjB7Dzz//jEqVKiElJcXox7KxsdGfr5KGDx8Od3d3TJ8+/Yn3\nMWnSpGJtp9FoMGTIEAQHB+ufS01NfeLjkvoxqVuwtLQ0/c+enp4IDQ3Fq6+++th2OTk5sLc3zj91\nfHw86tat+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TJ07AxsYGnp6e+Omnn+Dm5qZ0WEbh5eWFI0eOwNXVVelQDKZPnz64cOEC7Ozs4O3tjQUL\nFqjqQ6t27drIysrS/5s1a9YM8+fPVzgqw1m3bh3eeecd3L59G87OzvD398eWLVuUDuupbNmyBePG\njdPP/SloqDigUFInIiLj4EKzREQqwqRORKQiTOpERCrCpE5EpCJM6mQ1Xn311TyTpgDgu+++wxtv\nvKFQRESGx6ROViMoKAhhYWF5nvv9998tckYlUUGY1Mlq9O7dG5s2bUJOTg4AIC4uDteuXUPz5s3x\nxhtvoG7dumjXrh06d+6MNWvWAAAmTpyI+vXrw8/PDx9++KGS4RMVi9HWfiEyN66urmjSpAk2b96M\nbt26ISwsDP3798fatWsRHx+Pv//+G4mJiahbty6Cg4ORlJSEP/74A+fPnwcApKSkKHwGREVjS52s\nysNdML///juCgoKwb98+9OvXDwDg5uaG1q1bAwDKly8PR0dHBAcHY926dShTpoxicRMVF5M6WZVu\n3bphx44dOH78ONLT0/XruuQ3sdrOzg5RUVHo06cPwsPD0aFDB1OHS1RiTOpkVcqWLYvWrVtjxIgR\n+hukLVq0wJo1ayCEQGJiIiIjIwEA9+/fx927d9GxY0d88803OHnypIKRExUP+9TJ6gQFBaFXr15Y\nuXIlAHkDdceOHahXrx7c3d3RqFEjODs7IzU1Fd27d0dmZiaEEPj2228VjpyoaFzQiwiyVf7ss88i\nKSkJTZs2xf79+1W1MiNZD7bUiQB06dIFd+/eRVZWFqZOncqEThaLLXUiIhXhjVIiIhVhUiciUhEm\ndSIiFWFSJyJSESZ1IiIVYVInIlKR/wdjx32hRVMVVQAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 328
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.11, Page Number: 228<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find gate to source voltage'''",
+ "",
+ "# variable declaration",
+ "V_DD=12; # voltage in volt",
+ "V_D=7; # voltage in volt",
+ "R_D=3.3*10**3; # resistance in ohm",
+ "R_S=2.2*10**3; # resistance in ohm",
+ "R_1=6.8*10**6; # resistance in ohm",
+ "R_2=1*10**6; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_D=(V_DD-V_D)/R_D; # drain current in ampere",
+ "V_S=I_D*R_S; # source voltage in volt",
+ "V_G=(R_2/(R_1+R_2))*V_DD; # gate voltage in volt",
+ "V_GS=V_G-V_S; # gate to source voltage in volt",
+ "",
+ "# result",
+ "print \"Drain Current = %.4f Ampere\" %I_D",
+ "print \"Gate to source voltage = %.4f volts\" %V_GS"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain Current = 0.0015 Ampere",
+ "Gate to source voltage = -1.7949 volts"
+ ]
+ }
+ ],
+ "prompt_number": 329
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.12, Page Number: 229<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find transfer characteristic for Q-point'''",
+ "",
+ "# variable declaration",
+ "R_1=2.2*10**6; # resistance in ohm ",
+ "R_2=R_1; # resistance in ohm",
+ "V_DD=8; # voltage in volt",
+ "R_S=3.3*10**3; # resistance in ohm",
+ "",
+ "#calculation",
+ "V_GS=(R_2/(R_1+R_2))*V_DD; #FOR I_D=0A",
+ "V_G=V_GS; # voltage in volt",
+ "I_D=(V_G-0)/R_S; #FOR V_GS=0V",
+ "",
+ "# result",
+ "print \"V_GS = %d volt\" %V_GS",
+ "print \"at V_GS=0V. I_D = %.4f ampere\" %I_D",
+ "print \"Plotting load line using the value of V_GS=4V at I_D=0\"",
+ "print \" and I_D=1.2mA at V_GS=0V, we find the intersection of\"",
+ "print \" load line with transfer characteristic to get Q-point\"",
+ "print \" values of V_GS=-1.8V and I_D=1.8mA\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_GS = 4 volt",
+ "at V_GS=0V. I_D = 0.0012 ampere",
+ "Plotting load line using the value of V_GS=4V at I_D=0",
+ " and I_D=1.2mA at V_GS=0V, we find the intersection of",
+ " load line with transfer characteristic to get Q-point",
+ " values of V_GS=-1.8V and I_D=1.8mA"
+ ]
+ }
+ ],
+ "prompt_number": 330
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.13, Page Number: 235<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''DMOSFET'''",
+ "",
+ "I_DSS=10.0*10**-3;",
+ "V_GS_off=-8.0;",
+ "V_GS=-3.0;",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Drain current when V_GS=-3V is %f Amperes'%I_D)",
+ "V_GS=3;",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Drain current when V_GS=3V is %f Amperes'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current when V_GS=-3V is 0.003906 Amperes",
+ "Drain current when V_GS=3V is 0.018906 Amperes"
+ ]
+ }
+ ],
+ "prompt_number": 331
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.14, Page Number: 236<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''EMOSFET'''",
+ "",
+ "#variable Declaration",
+ "I_D_on=500.0*10**-3;",
+ "V_GS=10.0;",
+ "V_GS_th=1.0;",
+ "K=I_D_on/((V_GS-V_GS_th)**2)",
+ "V_GS=5.0;",
+ "I_D=K*(V_GS-V_GS_th)**2;",
+ "print('Drain current = %f A'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current = 0.098765 A"
+ ]
+ }
+ ],
+ "prompt_number": 332
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.15, Page Number: 237<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find drain to source voltage'''",
+ "",
+ "# variable declaration",
+ "I_DSS=12*10**-3; # currenin ampere",
+ "V_DD=18; # voltage in volt",
+ "R_D=620; # resistance in oh",
+ "",
+ "#calculation",
+ "I_D=I_DSS; # currents are equal",
+ "V_DS=V_DD-I_D*R_D; # drain to source voltage",
+ "",
+ "# result",
+ "print \"Drain to sorce voltage = %.2f volt\" %V_DS"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to sorce voltage = 10.56 volt"
+ ]
+ }
+ ],
+ "prompt_number": 333
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.16, Page Number: 238<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''EMOSFET bias'''",
+ "",
+ "#variable Declaration",
+ "I_D_on=200.0*10**-3;",
+ "V_DD=24.0;",
+ "R_D=200.0;",
+ "V_GS=4.0;",
+ "V_GS_th=2.0;",
+ "R_1=100.0*10**3;",
+ "R_2=15.0*10**3;",
+ "",
+ "#Calculation ",
+ "K=I_D_on/((V_GS-V_GS_th)**2)",
+ "V_GS=(R_2/(R_1+R_2))*V_DD;",
+ "I_D=K*(V_GS-V_GS_th)**2;",
+ "V_DS=V_DD-I_D*R_D;",
+ "",
+ "#Result",
+ "print('Drain to Source voltage = %f V'%V_DS)",
+ "print('Gate to Source voltage = %f V'%V_GS)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to Source voltage = 11.221172 V",
+ "Gate to Source voltage = 3.130435 V"
+ ]
+ }
+ ],
+ "prompt_number": 334
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.17, Page Number: 239<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find drain current'''",
+ "",
+ "# variable declaration",
+ "V_GS_on=3; # voltage in volt",
+ "V_GS=8.5 #voltage displayed on meter",
+ "V_DS=V_GS; # voltages are equal ",
+ "V_DD=15; # voltage in volt",
+ "R_D=4.7*10**3; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_D=(V_DD-V_DS)/R_D; # drain current",
+ "",
+ "# result",
+ "print \"Drain current = %.4f ampere\" %I_D"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current = 0.0014 ampere"
+ ]
+ }
+ ],
+ "prompt_number": 335
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter8.ipynb b/Electronic_Devices_/Chapter8.ipynb
new file mode 100644
index 00000000..68824e84
--- /dev/null
+++ b/Electronic_Devices_/Chapter8.ipynb
@@ -0,0 +1,432 @@
+{
+ "metadata": {
+ "name": "Chapter_8"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 8: FET Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.1, Page Number: 253<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Voltage gain'''",
+ "",
+ "# variable declaration",
+ "g_m=4.0*10**-3; #gm value",
+ "R_d=1.5*10**3; #resistance",
+ "",
+ "#calculation",
+ "A_v=g_m*R_d; #voltage gain",
+ "",
+ "#result",
+ "print \"Voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = 6.00"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.2, Page Number: 253<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' The Voltage gain'''",
+ "",
+ "# variable declaration",
+ "r_ds=10.0*10**3;",
+ "R_d=1.5*10**3; #from previous question",
+ "g_m=4.0*10**-3; #from previous question",
+ "",
+ "#calculation",
+ "A_v=g_m*((R_d*r_ds)/(R_d+r_ds)); #voltage gain",
+ "",
+ "#result",
+ "print \"Voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = 5.22"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.3, Page Number:254<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Voltage gain'''",
+ "",
+ "# variable declaration",
+ "R_s=560; #resistance in ohm",
+ "R_d=1.5*10**3; #resistance in ohm",
+ "g_m=4*10**-3; #g_m value",
+ "",
+ "#calculation",
+ "A_v=(g_m*R_d)/(1+(g_m*R_s)) #voltage gain",
+ "",
+ "#result",
+ "print \"Voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = 1.85"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.4, Page Number: 257<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Unloaded amplifier'''",
+ "",
+ "#Variable declaration",
+ "vdd=12.0 #volts",
+ "Id=1.96*10**-3 #Amp",
+ "Rd=3.3*10**3 #ohm",
+ "Idss=12.0*10**-3 #Amp",
+ "Rs=910 # Ohm",
+ "vgsoff= 3 #v",
+ "vin=0.1 #V",
+ "",
+ "#calculation",
+ "vd=vdd-(Id*Rd)",
+ "vgs=-Id*Rs",
+ "gm0=2*Idss/(abs(vgsoff))",
+ "gm=0.00325 #mS",
+ "vout=gm*Rd*vin",
+ "vout=vout*2*1.414",
+ "#Result",
+ "print\"Total output ac voltage(peak-to-peak) = %f V \\nridig on DC value of %fV \"%(vout,vd)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total output ac voltage(peak-to-peak) = 3.033030 V ",
+ "ridig on DC value of 5.532000V "
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.5, Page Number: 258<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' RMS voltage'''",
+ "",
+ "# variable declaration",
+ "R_D=3.3*10**3; #resistance in ohm",
+ "R_L=4.7*10**3; #load resistance in ohm",
+ "g_m=3.25*10**-3; #from previous question",
+ "V_in=100.0*10**-3; #previous question",
+ "",
+ "#calculation",
+ "R_d=(R_D*R_L)/(R_D+R_L); #Equivalent drain resistance",
+ "V_out=g_m*R_d*V_in; #output RMS voltage in volt",
+ "",
+ "#result",
+ "print \"Output voltage rms value = %.2f Volts\" %V_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage rms value = 0.63 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.6, Page Number: 259<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Input resistance wrt signal source '''",
+ "",
+ "# variable declaration",
+ "I_GSS=30.0*10**-9; #current in ampere",
+ "V_GS=10.0; #ground-source voltage",
+ "R_G=10.0*10**6; #resistance in ohm",
+ "",
+ "#calculation",
+ "R_IN_gate=V_GS/I_GSS; #gate input resistance",
+ "R_in=(R_IN_gate*R_G)/(R_IN_gate+R_G); #parallel combination",
+ "",
+ "#result",
+ "print \"Input resistance as seen by signal source = %.2f ohm\" %R_in"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input resistance as seen by signal source = 9708737.86 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.7, Page Number: 260<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' AC and DC output voltage '''",
+ "",
+ "# variable declaration",
+ "I_DSS=200.0*10**-3;",
+ "g_m=200.0*10**-3;",
+ "V_in=500.0*10**-3;",
+ "V_DD=15.0;",
+ "R_D=33.0;",
+ "R_L=8.2*10**3;",
+ "",
+ "#calculation",
+ "I_D=I_DSS; #Amplifier is zero biased",
+ "V_D=V_DD-I_D*R_D;",
+ "R_d=(R_D*R_L)/(R_D+R_L);",
+ "V_out=g_m*R_d*V_in;",
+ "",
+ "#result",
+ "print \"DC output voltage = %.2f Volts\" %V_D",
+ "print \"AC output voltage = %.2f volts\" %V_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC output voltage = 8.40 Volts",
+ "AC output voltage = 3.29 volts"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.8, Page Number: 262<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Drain Current '''",
+ "",
+ "# Theoretical example",
+ "# result",
+ "",
+ "print \"Part A:\\nQ point: V_GS=-2V I_D=2.5mA. At V_GS=-1V, I_D=3.4mA,\"",
+ "print \"At V_GS=-3V, I_D=1.8mA. So peak to peak drain current is\" ",
+ "print \"the difference of the two drain currents=1.6mA\"",
+ "print \"\\nPart B:\\nQ point: V_GS=0V I_D=4mA. At V_GS=1V, I_D=5.3mA,\"",
+ "print \"At V_GS=-1V, I_D=2.5mA. So peak to peak drain current is\"",
+ "print\" the difference of the two drain currents=2.8mA\"",
+ "print \"\\nPart C:\\nQ point: V_GS=8V I_D=2.5mA. At V_GS=9V, I_D=3.9mA,\"",
+ "print \" At V_GS=7V, I_D=1.7mA. So peak to peak drain current is\"",
+ "print \" the difference of the two drain currents=2.2mA\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part A:",
+ "Q point: V_GS=-2V I_D=2.5mA. At V_GS=-1V, I_D=3.4mA,",
+ "At V_GS=-3V, I_D=1.8mA. So peak to peak drain current is",
+ "the difference of the two drain currents=1.6mA",
+ "",
+ "Part B:",
+ "Q point: V_GS=0V I_D=4mA. At V_GS=1V, I_D=5.3mA,",
+ "At V_GS=-1V, I_D=2.5mA. So peak to peak drain current is",
+ " the difference of the two drain currents=2.8mA",
+ "",
+ "Part C:",
+ "Q point: V_GS=8V I_D=2.5mA. At V_GS=9V, I_D=3.9mA,",
+ " At V_GS=7V, I_D=1.7mA. So peak to peak drain current is",
+ " the difference of the two drain currents=2.2mA"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.9, Page Number:263 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Voltage gain'''",
+ "",
+ "# variable declaration",
+ "R_1=47.0*10**3;",
+ "R_2=8.2*10**3;",
+ "R_D=3.3*10**3;",
+ "R_L=33.0*10**3;",
+ "I_D_on=200.0*10**-3;",
+ "V_GS=4.0;",
+ "V_GS_th=2.0;",
+ "g_m=23*10**-3;",
+ "V_in=25*10**-3;",
+ "V_DD=15.0;",
+ "",
+ "#calculation",
+ "V_GSnew=(R_2/(R_1+R_2))*V_DD;",
+ "K=I_D_on/((V_GS-V_GS_th)**2)",
+ "#K=value_of_K(200*10**-3,4,2);",
+ "K=K*1000;",
+ "I_D=K*((V_GSnew-V_GS_th)**2);",
+ "V_DS=V_DD-I_D*R_D/1000;",
+ "R_d=(R_D*R_L)/(R_D+R_L);",
+ "V_out=g_m*V_in*R_d;",
+ "",
+ "#result",
+ "print \"Drain to source voltage = %.2f volts\" %V_GSnew",
+ "print \"Drain current = %.2f mA\" %I_D",
+ "print \"Gate to source voltage = %.2f volts\" %V_DS",
+ "print \"AC output voltage = %.2f volts\" %V_out",
+ "print \"Answer in textbook are approximated\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to source voltage = 2.23 volts",
+ "Drain current = 2.61 mA",
+ "Gate to source voltage = 6.40 volts",
+ "AC output voltage = 1.72 volts",
+ "Answer in textbook are approximated"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.10, Page Number: 266<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' AC and DC output voltage''' ",
+ "",
+ "# variable declaration",
+ "V_DD=-15.0; #p=channel MOSFET",
+ "g_m=2000.0*10**-6; #minimum value from datasheets",
+ "R_D=10.0*10**3;",
+ "R_L=10.0*10**3;",
+ "R_S=4.7*10**3;",
+ "",
+ "#calculation",
+ "R_d=(R_D*R_L)/(R_D+R_L); #effective drain resistance",
+ "A_v=g_m*R_d;",
+ "R_in_source=1.0/g_m;",
+ "#signal souce sees R_S in parallel with ip rest at source terminal(R_in_source)",
+ "R_in=(R_in_source*R_S)/(R_in_source+R_S); ",
+ "",
+ "#result ",
+ "print \"minimum voltage gain = %.2f\" %A_v",
+ "print \"Input resistance seen from signal source = %.2f ohms\" %R_in"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum voltage gain = 10.00",
+ "Input resistance seen from signal source = 451.92 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/Chapter9.ipynb b/Electronic_Devices_/Chapter9.ipynb
new file mode 100644
index 00000000..a4cd060a
--- /dev/null
+++ b/Electronic_Devices_/Chapter9.ipynb
@@ -0,0 +1,379 @@
+{
+ "metadata": {
+ "name": "Chapter_9"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 9: Power Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.1, Page Number: 280<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage gain'''",
+ "",
+ "# variable declaration",
+ "V_CC=15.0; #supply voltage",
+ "R_C=1.0*10**3; #resistance in ohm",
+ "R_1=20.0*10**3; #resistance in ohm",
+ "R_2=5.1*10**3; #resistance in ohm",
+ "R_3=5.1*10**3; #resistance in ohm",
+ "R_4=15.0*10**3; #resistance in ohm",
+ "R_E_1=47.0; #resistance in ohm",
+ "R_E_2=330.0; #resistance in ohm",
+ "R_E_3=16.0; #resistance in ohm",
+ "R_L=16.0; #SPEAKER IS THE LOAD;",
+ "B_ac_Q1=200.0; #B_ac value",
+ "B_ac_Q2=B_ac_Q1; #B_ac value",
+ "B_ac_Q3=50.0; #B_ac value",
+ "",
+ "#calculation",
+ "#R_c1=R_C||[R_3||R_4||B_acQ2*B_ac_Q3*(R_E_3||R_L)] is ac collector resistance",
+ "R=(R_E_3*R_L)/(R_E_3+R_L); #calculating resistance",
+ "R=B_ac_Q2*B_ac_Q3*R; ",
+ "R=(R*R_4)/(R+R_4); #calculating resistance",
+ "R=(R*R_3)/(R+R_3);",
+ "R_c1=(R*R_C)/(R_C+R); #ac collector resistance",
+ "#V_B=((R_2||(B_acQ1*(R_E_1+R_E_2)))/(R_1+(R_2||B_acQ1*(R_E_1+R_E_2))))*V_CC;",
+ "#This is the base voltage;",
+ "#LET R=(R_2||(B_acQ1*(R_E_1+R_E_2)))",
+ "R=(R_2*B_ac_Q1*(R_E_1+R_E_2))/(R_2+B_ac_Q1*(R_E_1+R_E_2));",
+ "V_B=R*V_CC/(R_1+R);",
+ "I_E=(V_B-0.7)/(R_E_1+R_E_2);",
+ "r_e_Q1=25.0*10**-3/I_E;",
+ "A_v1=(-1)*(R_c1)/(R_E_1+r_e_Q1); #voltage gain of 1st stage",
+ "#total input resistance of 1st stage is ",
+ "#R_in_tot_1=R_1||R_2||B_ac_Q1*(R_E_1+r_e_Q1);",
+ "xt=R_E_1+r_e_Q1 ",
+ "yt=R_2*B_ac_Q1",
+ "R_in_tot_1=(R_1*(yt*(xt)/(R_2+B_ac_Q1*(xt))))/(R_1+(yt*(xt)/(yt*(xt))));",
+ "A_v2=1; #gain of darlington voltage-follower",
+ "A_v_tot=A_v1*A_v2; #total gain",
+ "A_p=(A_v_tot**2)*(R_in_tot_1/R_L); #power gain",
+ "A_p=42508.68",
+ "",
+ "#result",
+ "print \"Voltage gain= %.2f\" %A_v_tot",
+ "print \"Power gain= %.2f\" %A_p"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain= -15.29",
+ "Power gain= 42508.68"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.2, Page Number: 281<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' efficiency'''",
+ "",
+ "# variable declaration",
+ "V_in=176.0*10**-3;",
+ "R_in=2.9*10**3; #total input resistance from previous question",
+ "A_p=42429.0; #power gain from previous question",
+ "V_CC=15.0;",
+ "I_CC=0.6; #emitter current",
+ "",
+ "#calculation",
+ "P_in=V_in**2/R_in; #input power",
+ "P_out=P_in*A_p;",
+ "P_DC=I_CC*V_CC;",
+ "eff=P_out/P_DC; #efficiency",
+ "",
+ "#result",
+ "print \"efficiency= %.2f\" %eff"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency= 0.05"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.3, Page Number: 287<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' ideal maximum current'''",
+ "",
+ "# variable declaration",
+ "V_CC=20.00; #supply voltage",
+ "R_L=16.0; #load resistance",
+ "",
+ "#calculation",
+ "V_out_peak=V_CC; #calculate peak op voltage",
+ "I_out_peak=V_CC/R_L; #calculate peak op current",
+ "",
+ "#result",
+ "print \"ideal maximum peak output voltage = %.2f volts\" %V_out_peak",
+ "print \"ideal maximum current =%.2f amperes\" %I_out_peak"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ideal maximum peak output voltage = 20.00 volts",
+ "ideal maximum current =1.25 amperes"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.4, Page Number: 288<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' ideal maximum current'''",
+ "",
+ "# variable declaration",
+ "V_CC=20.0; #supply volatge",
+ "R_L=16.0; #load resistance",
+ "",
+ "#calculation",
+ "V_out_peak=V_CC/2;",
+ "I_out_peak=V_out_peak/R_L;",
+ "",
+ "#result",
+ "print \"ideal maximum output peak voltage = %.2f volts\" %V_out_peak",
+ "print \"ideal maximum current = %.2f amperes\" %I_out_peak"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ideal maximum output peak voltage = 10.00 volts",
+ "ideal maximum current = 0.62 amperes"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.5, Page Number: 290<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' ideal maximum current'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "V_CC=20.0; #supply voltage",
+ "R_L=8.0; #load resistance",
+ "B_ac=50.0; #B_ac value",
+ "r_e=6.0; #internal resistance",
+ "",
+ "#calculation",
+ "V_out_peak=V_CC/2;",
+ "V_CEQ=V_out_peak;",
+ "I_out_peak=V_CEQ/R_L;",
+ "I_c_sat=I_out_peak;",
+ "P_out=0.25*I_c_sat*V_CC;",
+ "P_DC=(I_c_sat*V_CC)/math.pi;",
+ "R_in=B_ac*(r_e+R_L);",
+ "",
+ "#result",
+ "print \"maximum ac output power = %.2f Watts\" %P_out",
+ "print \"maximum DC output power = %.2f Watts\" %P_DC",
+ "print \"input resistance = %.2f ohms\" %R_in"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum ac output power = 6.25 Watts",
+ "maximum DC output power = 7.96 Watts",
+ "input resistance = 700.00 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.6, Page Number: 292<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' power accross load'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "V_DD=24.0;",
+ "V_in=100*10**-3; #ip volatge",
+ "R1=440.0; #resistance in ohm",
+ "R2=5.1*10**3; #resistance in ohm",
+ "R3=100*10**3; #resistance in ohm",
+ "R4=10**3; #resistance in ohm",
+ "R5=100.0; #resistance in ohm",
+ "R7=15*10**3; #resistance in ohm",
+ "R_L=33.0; #load resistance in ohm",
+ "V_TH_Q1=2.0; # V-TH value",
+ "V_TH_Q2=-2.0; ",
+ "",
+ "#calculation",
+ "I_R1=(V_DD-(-V_DD))/(R1+R2+R3);",
+ "V_B=V_DD-I_R1*(R1+R2); #BASE VOLTAGE",
+ "V_E=V_B+0.7; #EMITTER VOLTAGE",
+ "I_E=(V_DD-V_E)/(R4+R5); #EMITTER CURRENT",
+ "V_R6=V_TH_Q1-V_TH_Q2; #VOLTAGE DROP ACROSS R6",
+ "I_R6=I_E; ",
+ "R6=V_R6/I_R6;",
+ "r_e=25*10**-3/I_E; #UNBYPASSED EMITTER RESISTANCE",
+ "A_v=R7/(R5+r_e); #VOLTAGE GAIN",
+ "V_out=A_v*V_in;",
+ "P_L=V_out**2/R_L;",
+ "",
+ "#result",
+ "print \"value of resistance R6 = %.2d ohms for AB operation\" %R6",
+ "print \"power across load = %.2f watts\"%P_L "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of resistance R6 = 2418 ohms for AB operation",
+ "power across load = 5.15 watts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.7, Page Number:295<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' average power dissipation'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "f=200.0*10**3; #frequency in hertz",
+ "I_c_sat=100.0*10**-3; #saturation current",
+ "V_ce_sat=0.2; #sat voltage",
+ "t_on=1.0*10**-6; #on time",
+ "",
+ "#calculation",
+ "T=1/f; #time period of signal",
+ "P_D_avg=(t_on/T)*I_c_sat*V_ce_sat; #power dissipation",
+ "",
+ "#result",
+ "print \"average power dissipation =%.3f Watts\" %P_D_avg"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average power dissipation =0.004 Watts"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.8, Page Number: 298<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' efficiency'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "P_D_avg=4.0*10**-3; #power dissipation",
+ "V_CC=24.0; #supply voltage",
+ "R_c=100.0; #resistance in ohm",
+ "",
+ "#calculation",
+ "P_out=(0.5*V_CC**2)/R_c; #output power",
+ "n=(P_out)/(P_out+P_D_avg); #n is efficiency",
+ "",
+ "#result",
+ "print \"efficiency=%.4f\" %n"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency=0.9986"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Devices_/README.txt b/Electronic_Devices_/README.txt
new file mode 100644
index 00000000..7ae64652
--- /dev/null
+++ b/Electronic_Devices_/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Laxman Sole
+Course: btech
+College/Institute/Organization: Vishwakarma Institute of Technology, Pune
+Department/Designation: Electronics Engineering
+Book Title: Electronic Devices
+Author: Thomas L. Floyd
+Publisher: Dorling Kindersley Pvt. Ltd.
+Year of publication: 2009
+Isbn: 9788177586435
+Edition: 7th \ No newline at end of file
diff --git a/Electronic_Devices_/screenshots/ipwaveform.png b/Electronic_Devices_/screenshots/ipwaveform.png
new file mode 100644
index 00000000..72b97ef9
--- /dev/null
+++ b/Electronic_Devices_/screenshots/ipwaveform.png
Binary files differ
diff --git a/Electronic_Devices_/screenshots/modulatedopvoltage.png b/Electronic_Devices_/screenshots/modulatedopvoltage.png
new file mode 100644
index 00000000..bcb4e66a
--- /dev/null
+++ b/Electronic_Devices_/screenshots/modulatedopvoltage.png
Binary files differ
diff --git a/Electronic_Devices_/screenshots/transfercharectercurve.png b/Electronic_Devices_/screenshots/transfercharectercurve.png
new file mode 100644
index 00000000..eda2589e
--- /dev/null
+++ b/Electronic_Devices_/screenshots/transfercharectercurve.png
Binary files differ
diff --git a/Electronic_Principles_/Chapter_10_New.ipynb b/Electronic_Principles_/Chapter_10_New.ipynb
new file mode 100644
index 00000000..2a7ee3d8
--- /dev/null
+++ b/Electronic_Principles_/Chapter_10_New.ipynb
@@ -0,0 +1,485 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 10 VOLTAGE AMPLIFIERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-1, Page 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.1.py\n",
+ "#What is the voltage gain & output voltage across the load resistor? \n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #Ac resistance as per example 9-5(Ohm)\n",
+ "RC=3.6 #Collector Resistance(KOhm)\n",
+ "RL=10 #Load Resistance(KOhm)\n",
+ "Vin=2 #Input voltage(mV)\n",
+ "\n",
+ "#Calculation\n",
+ "rc=RC*RL/(RC+RL) #AC collector resistance(Ohm)\n",
+ "Av=(rc/re)*1000 #Voltage gain\n",
+ "Vout=Av*Vin #Output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'Voltage gain Av = ',round(Av,2)\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain Av = 116.61\n",
+ "Output voltage Vout = 233.22 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-2, Page 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.2.py\n",
+ "#What is the voltage gain & output voltage across the load resistor?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RC=3.6 #Collector Resistance(KOhm)\n",
+ "RL=2.2 #Load Resistance(KOhm)\n",
+ "Vin=5 #Input voltage(mV)\n",
+ "VEE=9 #collector voltage(V)\n",
+ "RE=10 #Emitter resistance(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "\n",
+ "#Calculation\n",
+ "rc=RC*RL/(RC+RL) #AC collector resistance(Ohm)\n",
+ "IE=(VEE-VBE)/RE #emitter current(mA)\n",
+ "re=25/IE #AC resistance(Ohm)\n",
+ "Av=(rc/re)*1000 #Voltage gain\n",
+ "Vout=Av*Vin #Output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',IE,'mA'\n",
+ "print 'Voltage gain Av = ',round(Av,2)\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 0.83 mA\n",
+ "Voltage gain Av = 45.34\n",
+ "Output voltage Vout = 226.68 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-3, Page 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.3.py\n",
+ "#In figure 10-4, Rs = 600 Ohm. find output voltage for B=300.\n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #Ac resistance as per example 9-5(Ohm)\n",
+ "B=300 #current gain\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "Rs=0.6 #internal resistance of source(KOhm)\n",
+ "Av=117 #Voltage gain as per example 10-1\n",
+ "Vs=2 #ac voltage supply(mV)\n",
+ "\n",
+ "#Calculation\n",
+ "Zin_base=B*re/1000 #input impedance of base(KOhm)\n",
+ "Zin_stage=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "Vin=(Zin_stage/(Rs+Zin_stage))*Vs #input voltage(mV)\n",
+ "Vout=Av*Vin #output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'input impedance of stage Zin(stage) = ',round(Zin_stage,2),'KOhm'\n",
+ "print 'Output volatge Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance of stage Zin(stage) = 1.43 KOhm\n",
+ "Output volatge Vout = 164.69 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-4, Page 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.4.py\n",
+ "#Repeat preceding example for B=50.\n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #Ac resistance as per example 9-5(Ohm)\n",
+ "B=50 #current gain\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "Rs=0.6 #internal resistance of source(KOhm)\n",
+ "Av=117 #Voltage gain as per example 10-1\n",
+ "Vs=2 #ac voltage supply(mV)\n",
+ "\n",
+ "#Calculation\n",
+ "Zin_base=B*re/1000 #input impedance of base(KOhm)\n",
+ "Zin_stage=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "Vin=(Zin_stage/(Rs+Zin_stage))*Vs #input voltage(mV)\n",
+ "Vout=Av*Vin #output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'input impedance of stage Zin(stage) = ',round(Zin_stage,2),'KOhm'\n",
+ "print 'Output volatge Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance of stage Zin(stage) = 0.7 KOhm\n",
+ "Output volatge Vout = 125.71 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-5, Page 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.5.py\n",
+ "#Find ac collector voltage & output voltage across the load resistor in first stage. \n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #Ac resistance as per example 9-5(Ohm)\n",
+ "B=100 #current gain\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "Rs=0.6 #internal resistance of source(KOhm)\n",
+ "RC=3.6 #colletcor resistance (KOhm)\n",
+ "Vs=1 #ac voltage supply(mV)\n",
+ "RL=10 #Load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Zin_base=B*re/1000 #input impedance of base(KOhm)\n",
+ "Zin_stage1=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage1(KOhm)\n",
+ "Vin=(Zin_stage1/(Rs+Zin_stage1))*Vs #input voltage(mV)\n",
+ "Zin_stage2=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage2(KOhm)\n",
+ "rc1=(RC*Zin_stage2)/(RC+Zin_stage2) #AC collector resistance of stage1(KOhm)\n",
+ "Av1=rc1/re #Voltage gain of stage 1\n",
+ "vc=Av1*Vin #AC collector voltage of stage 1(V)\n",
+ "rc2=(RC*RL)/(RC+RL) #AC collector resistance of stage2(KOhm)\n",
+ "Av2=rc2/re #Voltage gain of stage 2\n",
+ "Vout=Av2*vc #output voltage(mV)\n",
+ "Av=Av1*Av2 #Overall voltage gain\n",
+ "Voutf=Av*Vin #AC output voltage across RL(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'AC collector voltage of first stage vc = ',round(vc*1000,2),'mV'\n",
+ "print 'AC output voltage across load resistor Vout = ',round(Voutf*1000,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "AC collector voltage of first stage vc = 21.67 mV\n",
+ "AC output voltage across load resistor Vout = 2.53 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-6, Page 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.6.py\n",
+ "#What is the output voltage across RL if B=200? Ignore re'. \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "re=0.18 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "Rs=0.6 #internal resistance of source(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "Vs=50 #ac voltage supply(mV)\n",
+ "RL=10 #Load resistance(KOhm)\n",
+ "B=200 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "Zin_base=B*re #input impedance of base(KOhm)\n",
+ "Zin_stage=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "Vin=(Zin_stage/(Rs+Zin_stage))*Vs #input voltage(mV)\n",
+ "rc=(RC*RL)/(RC+RL) #AC collector resistance of stage(KOhm)\n",
+ "Av=rc/re #Voltage gain of stage\n",
+ "Vout=Av*Vin #output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'input impedance of stage Zin(stage) = ',round(Zin_stage,2),'KOhm'\n",
+ "print 'Output volatge Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance of stage Zin(stage) = 1.72 KOhm\n",
+ "Output volatge Vout = 544.91 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-7, Page 332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.7.py\n",
+ "#Repeat preceding example, but this time include re' in calculations.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "re=0.18 #Emitter resistance (KOhm)\n",
+ "re1=0.0227 #Ac resistance as per example 9-5(KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "Rs=0.6 #internal resistance of source(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "Vs=50 #ac voltage supply(mV)\n",
+ "RL=10 #Load resistance(KOhm)\n",
+ "B=200 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "Zin_base=B*(re+re1) #input impedance of base(KOhm)\n",
+ "Zin_stage=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "Vin=(Zin_stage/(Rs+Zin_stage))*Vs #input voltage(mV)\n",
+ "rc=(RC*RL)/(RC+RL) #AC collector resistance of stage(KOhm)\n",
+ "Av=rc/(re+re1) #Voltage gain of stage\n",
+ "Vout=Av*Vin #output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'input impedance of stage Zin(stage) = ',round(Zin_stage,2),'KOhm'\n",
+ "print 'Output volatge Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance of stage Zin(stage) = 1.73 KOhm\n",
+ "Output volatge Vout = 484.55 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-8, Page 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.8.py\n",
+ "#What is the output voltage in figure 10-9 if B=200? Ignore re'. \n",
+ "\n",
+ "#Variable declaration\n",
+ "re=0.18 #emitter reistance(Ohm)\n",
+ "B=200 #current gain\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "Rs=0.6 #internal resistance of source(KOhm)\n",
+ "RC=3.6 #colletcor resistance (KOhm)\n",
+ "Vs=1 #ac voltage supply(mV)\n",
+ "RL=10 #Load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Zin_base=B*re #input impedance of base(KOhm)\n",
+ "Zin_stage1=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage1(KOhm)\n",
+ "Vin=(Zin_stage1/(Rs+Zin_stage1))*Vs #input voltage(mV)\n",
+ "Zin_stage2=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage2(KOhm)\n",
+ "rc1=(RC*Zin_stage2)/(RC+Zin_stage2) #AC collector resistance of stage1(KOhm)\n",
+ "Av1=rc1/re #Voltage gain of stage 1\n",
+ "vc=Av1*Vin #AC collector voltage of stage 1(V)\n",
+ "rc2=(RC*RL)/(RC+RL) #AC collector resistance of stage2(KOhm)\n",
+ "Av2=rc2/re #Voltage gain of stage 2\n",
+ "Vout=Av2*vc #output voltage(mV)\n",
+ "Av=Av1*Av2 #Overall voltage gain\n",
+ "Voutf=Av*Vin #AC output voltage across RL(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'AC collector voltage of first stage vc = ',round(vc,2),'mV'\n",
+ "print 'AC output voltage across load resistor Vout = ',round(Voutf,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "AC collector voltage of first stage vc = 4.79 mV\n",
+ "AC output voltage across load resistor Vout = 70.39 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10-9, Page 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.9.py\n",
+ "#A resistor can be varied from 0 to 10 KOhm. then What is the min & max voltage gain of the two-stage amplifier?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RV_min=0 #minimum variable resistance (KOhm)\n",
+ "RV_max=10 #maximum variable resistance (KOhm)\n",
+ "re=0.1 #Emitter resistance (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "rf_min=RV_min+1 #minimum feedback resistance(KOhm)\n",
+ "rf_max=RV_max+1 #maximum feedback resistance(KOhm)\n",
+ "Av_min=rf_min/re #minimum voltage gain\n",
+ "Av_max=rf_max/re #maximum voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'minimum voltage gain Av(min)= ',Av_min\n",
+ "print 'minimum voltage gain Av(max)= ',Av_max"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum voltage gain Av(min)= 10.0\n",
+ "minimum voltage gain Av(max)= 110.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_11_New.ipynb b/Electronic_Principles_/Chapter_11_New.ipynb
new file mode 100644
index 00000000..5a7be77e
--- /dev/null
+++ b/Electronic_Principles_/Chapter_11_New.ipynb
@@ -0,0 +1,579 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 11 CC AND CB AMPLIFIERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-1, Page 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.1.py\n",
+ "#What is the input impedance of the base & stage. B=200.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RE=4.3 #Emitter resistance(KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=10 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=10 #Load Resistance(KOhm)\n",
+ "VG=1 #Input voltage(mV)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "B=200 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "VBB=VCC/2 #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "re1=(25/IE) #AC resistance(Ohm)\n",
+ "re=RE*RL/(RE+RL) #external ac resistance(KOhm)\n",
+ "Zin_base=(re+(re1/1000))*B #input impedance of base(KOhm)\n",
+ "Zin_stage=((R1**-1)+(Zin_base**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'input impedance of stage Zin(base) = ',round(Zin_base,2),'KOhm'\n",
+ "print 'input impedance of stage Zin(stage) = ',round(Zin_stage,2),'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance of stage Zin(base) = 606.4 KOhm\n",
+ "input impedance of stage Zin(stage) = 4.96 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-2, Page 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.2.py\n",
+ "#Assuming B=200, What is ac input voltage to emitter follower of figure 11-3?\n",
+ "\n",
+ "#Variable declaration\n",
+ "re=3.03 #Emitter resistance(KOhm)\n",
+ "VG=1 #Input voltage(mV)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "B=200 #current gain \n",
+ "Zin=5 #input impedance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vin=(Zin/(Zin+RG))*VG #input voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Input voltage Vin = ',round(Vin,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input voltage Vin = 0.89 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-3, Page 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.3.py\n",
+ "#What is the voltage gain of the emitter follower of figure 11-5? If B=150, what is the ac load voltage? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "RE=2.2 #Emitter resistance(KOhm)\n",
+ "R1=4.7 #Base resistance1 (KOhm)\n",
+ "R2=4.7 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=6.8 #Load Resistance(KOhm)\n",
+ "VG=1 #Input voltage(mV)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "B=150 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "VBB=VCC/2.0 #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "re1=(25/IE) #AC resistance(Ohm)\n",
+ "re=RE*RL/(RE+RL) #external ac resistance(KOhm)\n",
+ "Zin_base=(re+(re1/1000))*B #input impedance of base(KOhm)\n",
+ "Zin_stage=((R1**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "Av=re/(re+(re1/1000)) #Voltage gain of stage\n",
+ "Vin=(Zin_stage/(Zin_stage+RG))*VG #input voltage(V)\n",
+ "Vout=Av*Vin #output voltage(V)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print 'input impedance of stage Zin(base) = ',round(Zin_base,2),'KOhm'\n",
+ "print 'input impedance of stage Zin(stage) = ',Zin_stage,'KOhm'\n",
+ "print 'voltage gain of emitter follower Av = ',round(Av,3)\n",
+ "print 'Output volatge Vout = ',round(Vout,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input impedance of stage Zin(base) = 250.55 KOhm\n",
+ "input impedance of stage Zin(stage) = 2.35 KOhm\n",
+ "voltage gain of emitter follower Av = 0.995\n",
+ "Output volatge Vout = 0.79 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-4, Page 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.4.py\n",
+ "#Calculate the output impedance of the emitter follower of figure 11-9a.\n",
+ "\n",
+ "#Variable declaration\n",
+ "RG=600 #internal resistance of source(KOhm)\n",
+ "B=300 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "Zout=RG/B #Output impedance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output impedance Zout = ',Zout,'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output impedance Zout = 2 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-5, Page 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.5.py\n",
+ "#Calculate the output impedance in figure 11-9a.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=30 #collector voltage(V)\n",
+ "RE=0.1 #Emitter resistance(KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=10 #Base resistance2 (KOhm)\n",
+ "RL=0.1 #Load Resistance(KOhm)\n",
+ "VG=1 #Input voltage(mV)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "B=300 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "VBQ=VCC/2.0 #Base voltage(V)\n",
+ "VEQ=VBQ #Emitter voltage(V), ignore VBE\n",
+ "IEQ=VEQ/RE #Emitter current(mA)\n",
+ "re=(25/IEQ) #AC resistance(Ohm)\n",
+ "Zb=((RG**-1)+(R1**-1)+(R2**-1))**-1 #impedance looking back from base(KOhm)\n",
+ "Z=Zb*1000/B #impedance after current gain (Ohm) \n",
+ "Ze=Z+re #impedance looking back into emitter(Ohm)\n",
+ "Zout=(((RE*1000)**-1)+(Ze**-1))**-1 #Output impedance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output impedance is Zout = ',round(Zout,2),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output impedance is Zout = 1.91 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-6, Page 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.6.py\n",
+ "#What is the voltage gain of the CE stage in figure 11-10 for B = 100? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RE=0.68 #Emitter resistance(KOhm)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "re=0.18 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=0.27 #Load resistance(KOhm)\n",
+ "B=100 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "VBB=(R1*R2/(R1+R2)) #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "re=(25/IE) #AC resistance(Ohm)\n",
+ "Zin=B*RL #input impedance (KOhm)\n",
+ "rc=((RC**-1)+(Zin**-1))**-1 #ac collector resistance(KOhm)\n",
+ "Av=rc/(re/1000) #voltage gain of stage\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain of CE stage Av = ',round(Av,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain of CE stage Av = 206.15\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-7, Page 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.7.py\n",
+ "#Emitter follower is removed in fig 11-10 and capacitor is used to couple the ac signal to RL = 270 Ohm. \n",
+ "#What is the voltage gain of CE amplifier?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RE=0.68 #Emitter resistance(KOhm)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "re=0.18 #Emitter resistance (KOhm)\n",
+ "R1=10.0 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=0.27 #Load resistance(KOhm)\n",
+ "B=100 #current gain \n",
+ "\n",
+ "#Calculation\n",
+ "VBB=10*(R2/(R1+R2)) #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "re=(25/IE) #AC resistance(Ohm)\n",
+ "rc=((RC**-1)+(RL**-1))**-1 #ac collector resistance(KOhm)\n",
+ "Av=rc/(re/1000) #voltage gain of stage\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain of CE stage Av = ',round(Av,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain of CE stage Av = 16.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-8, Page 358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.8.py\n",
+ "#If each transistor of figure 11-13 has B=100, find overall current gain, IB of Q1 & input impedance at base of Q1?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "RE=0.06 #Emitter resistance(KOhm)\n",
+ "R1=10.0 #Base resistance1 (KOhm)\n",
+ "R2=20.0 #Base resistance2 (KOhm)\n",
+ "RG=0.6 #internal resistance of source(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=0.03 #Load resistance(KOhm)\n",
+ "B1=100 #current gain of Q1\n",
+ "B2=100 #current gain of Q2\n",
+ "\n",
+ "#Calculation\n",
+ "B=B1*B2 #Overall current gain\n",
+ "VBB=15*(R2/(R1+R2)) #Base voltage(V)\n",
+ "VE=VBB-(2*VBE) #Emitter voltage(V)\n",
+ "IE2=VE/RE #Emitter current(mA)\n",
+ "IB2=IE2/B2 #Base current of Q2(mA)\n",
+ "IE1=IB2 #emiter current of Q1(mA)\n",
+ "IB1=IE1*1000/B1 #base current of Q1(uA)\n",
+ "re=((RE**-1)+(RL**-1))**-1 #ac emitter resistance(KOhm)\n",
+ "Zin_base=B*re #input impedance of Q1(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Overall current gain B = ',B\n",
+ "print 'base current of Q1 IB1 = ',round(IB1,2),'uA'\n",
+ "print 'input impedance at base of Q1 Zin(base) = ',Zin_base,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall current gain B = 10000\n",
+ "base current of Q1 IB1 = 14.33 uA\n",
+ "input impedance at base of Q1 Zin(base) = 200.0 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-9, Page 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.9.py\n",
+ "#Figure 11-16 shows a zener follower. find output voltage & zener current for Bdc=100.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=20 #input voltage (V)\n",
+ "RL=15 #Load resistance(Ohm)\n",
+ "Vz=10 #voltage across zener(V)\n",
+ "B=100 #current gain\n",
+ "Rs=680.0 #series resistor(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vz-0.7 #Output voltage approx.(V)\n",
+ "Iout=Vout/RL #Load current(A)\n",
+ "IB=Iout*1000/B #base current(mA)\n",
+ "Is=(Vin-Vz)*1000/Rs #current through series resistor(mA)\n",
+ "Iz=Is-IB #zener current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout = ',Vout,'V'\n",
+ "print 'Zener current Iz = ',round(Iz,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout = 9.3 V\n",
+ "Zener current Iz = 8.51 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-10, Page 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.10.py\n",
+ "#What is the output voltage in figure 11-17?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=30 #input voltage (V)\n",
+ "RL=100 #Load resistance(Ohm)\n",
+ "Vz=6.2 #voltage across zener(V)\n",
+ "B=100 #current gain\n",
+ "Rs=680.0 #series resistor(Ohm)\n",
+ "R1=1 #Resistor (KOhm)\n",
+ "R2=2 #Resistor (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=(Vz+0.7)*(R1+R2)/R1 #Output voltage approx.(V)\n",
+ "I1=(Vz+0.7)/R1 #Load current(A)\n",
+ "Vout=I1*(R1+R2) #Output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout = ',Vout,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout = 20.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11-11, Page 365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.11.py\n",
+ "#What is the output voltage in figure 11-20?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VG=2 #AC input voltage (mV)\n",
+ "Vs=10 #supply volatge(V)\n",
+ "RL=10 #Load resistance(KOhm)\n",
+ "RG=50.0 #source resistor(Ohm)\n",
+ "R1=10 #Resistor (KOhm)\n",
+ "R2=2.2 #Resistor (KOhm)\n",
+ "RC=3.6 #collector resistor (KOhm)\n",
+ "RE=2.2 #emitter resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "VB=Vs*R2/(R1+R2) #Base voltage(V)\n",
+ "IE=(VB-0.7)*1000/RE #emitter current(uA)\n",
+ "re=(25/IE)*1000 #ac resistance(Ohm)\n",
+ "Zin=1000*((RE**-1)+((re/1000)**-1))**-1 #input impedance(KOhm)\n",
+ "Zout=RC #Output impedance(KOhm)\n",
+ "rc=((RC**-1)+(RL**-1))**-1 #collector resistance(KOhm)\n",
+ "Av=rc*1000/re #voltage gain\n",
+ "Vin=(Zin/(Zin+RG))*VG #input voltage(V)\n",
+ "Vout=Av*Vin #output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout = ',round(Vout,2),'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout = 52.43 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_12_New.ipynb b/Electronic_Principles_/Chapter_12_New.ipynb
new file mode 100644
index 00000000..268348c4
--- /dev/null
+++ b/Electronic_Principles_/Chapter_12_New.ipynb
@@ -0,0 +1,661 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 12 POWER AMPLIFIERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-1, Page 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.1.py\n",
+ "#What are the values of ICQ,VCEQ,rc in figure 12-7?\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=30 #collector voltage(V)\n",
+ "RE=20 #Emitter resistance(Ohm)\n",
+ "R1=490.0 #Base resistance1 (Ohm)\n",
+ "R2=68.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=180 #Load Resistance(Ohm)\n",
+ "RC=120 #Collector resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VB=VCC*(R2/(R1+R2)) #Base voltage(V)\n",
+ "VE=math.ceil(VB-VBE) #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(A)\n",
+ "ICQ=IE #collector current (A)\n",
+ "VC=VCC-(ICQ*RC) #collector voltage(V)\n",
+ "VCEQ=VC-VE #collector-emitter voltage (V) \n",
+ "rc=RC*RL/(RC+RL) #ac collector resistance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Collector current ICQ = ',ICQ*1000,'mA'\n",
+ "print 'collector-emitter voltage VCEQ = ',VCEQ,'V'\n",
+ "print 'ac collector resistance rc = ',rc,'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current ICQ = 150.0 mA\n",
+ "collector-emitter voltage VCEQ = 9.0 V\n",
+ "ac collector resistance rc = 72 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-2, Page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.2.py\n",
+ "#Determine the ac load line saturation and cutoff points in figure 12-7 & find MPP output voltage. \n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "VCC=30 #collector voltage(V)\n",
+ "RE=20 #Emitter resistance(Ohm)\n",
+ "R1=490.0 #Base resistance1 (Ohm)\n",
+ "R2=68.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=180 #Load Resistance(Ohm)\n",
+ "RC=120 #Collector resistance(Ohm)\n",
+ "\n",
+ "#values from previous example,\n",
+ "ICQ=150 #collector current (mA)\n",
+ "VCEQ=9 #collector-emitter voltage (V) \n",
+ "rc=72.0 #ac collector resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "ic_sat=ICQ+(VCEQ/rc)*1000 #ic(sarturation) (mA)\n",
+ "VCE_cut=VCEQ+((ICQ*rc)/1000) #VCE(cut-off) (V)\n",
+ "MP1=ICQ*RC\n",
+ "MP2=VCEQ\n",
+ "MPP=2*(min(MP1,MP2)) #maximum peak-to-peak voltage (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'ic(sarturation) = ',ic_sat,'mA'\n",
+ "print 'VCE(cut-off) = ',VCE_cut,'V'\n",
+ "print 'maximum peak-to-peak voltage MPP = ',MPP,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ic(sarturation) = 275.0 mA\n",
+ "VCE(cut-off) = 19.8 V\n",
+ "maximum peak-to-peak voltage MPP = 18 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-3, Page 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.3.py\n",
+ "#If Vpp is 18V and the input impedance of base is 100 Ohm, what is power gain in figure 12-9a?\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=30 #collector voltage(V)\n",
+ "RE=20 #Emitter resistance(Ohm)\n",
+ "R1=490.0 #Base resistance1 (Ohm)\n",
+ "R2=68.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=180.0 #Load Resistance(Ohm)\n",
+ "RC=120 #Collector resistance(Ohm)\n",
+ "vin=200 #input voltage(mV)\n",
+ "zin=100 #input impedance of base(Ohm)\n",
+ "MPP=18 #peak-to-peak voltage (V)\n",
+ "\n",
+ "#Calculation\n",
+ "Zin_stage=((zin**-1)+(R1**-1)+(R2**-1))**-1 #input impedance of stage(KOhm)\n",
+ "Pin=vin**2/(Zin_stage*8)/1000 #ac input power (mW)\n",
+ "Pout=1000*MPP**2/(RL*8) #ac output power (mW)\n",
+ "Ap=Pout/Pin #power gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Power gain Ap = ',math.ceil(Ap)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain Ap = 1683.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-4, Page 388"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.4.py\n",
+ "#What is the transistor power dissipation and efficiency in figure 12-9a?\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=30 #collector voltage(V)\n",
+ "RE=20 #Emitter resistance(Ohm)\n",
+ "R1=490.0 #Base resistance1 (Ohm)\n",
+ "R2=68.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=180 #Load Resistance(Ohm)\n",
+ "RC=120 #Collector resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VB=VCC*(R2/(R1+R2)) #Base voltage(V)\n",
+ "VE=math.ceil(VB-VBE) #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(A)\n",
+ "ICQ=IE #collector current (A)\n",
+ "VC=VCC-(ICQ*RC) #collector voltage(V)\n",
+ "VCEQ=VC-VE #collector-emitter voltage (V) \n",
+ "PDQ=VCEQ*ICQ #power dissipation(W)\n",
+ "I_bias=VCC/(R1+R2) #bias current(mA)\n",
+ "Idc=I_bias+ICQ #dc current(mA)\n",
+ "Pdc=VCC*Idc #dc input power to stage(W)\n",
+ "Pout=0.225 #Output power as per example 12-3 (W)\n",
+ "n=(Pout/Pdc)*100 #efficiency of stage\n",
+ "\n",
+ "#Result\n",
+ "print 'Power dissipation PDQ = ',PDQ,'W'\n",
+ "print 'efficiency of stage n = ',round(n,2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power dissipation PDQ = 1.35 W\n",
+ "efficiency of stage n = 3.68 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-6, Page 391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.6.py\n",
+ "#What are the values of ICQ,VCEQ,rc in figure 12-13?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12 #collector voltage(V)\n",
+ "RE=16 #Emitter resistance(Ohm)\n",
+ "R1=50.0 #Base resistance1 (Ohm)\n",
+ "R2=100.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=16 #Load Resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VB=VCC*(R2/(R1+R2)) #Base voltage(V)\n",
+ "VE=(VB-VBE) #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(A)\n",
+ "ICQ=IE #collector current (A)\n",
+ "VCEQ=VCC-VE #collector-emitter voltage (V) \n",
+ "re=RE*RL/(RE+RL) #ac emitter resistance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Collector current ICQ = ',ICQ*1000,'mA'\n",
+ "print 'collector-emitter voltage VCEQ = ',VCEQ,'V'\n",
+ "print 'ac collector resistance re = ',re,'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current ICQ = 456.25 mA\n",
+ "collector-emitter voltage VCEQ = 4.7 V\n",
+ "ac collector resistance re = 8 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 89
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-7, Page 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.7.py\n",
+ "#Determine the ac saturation and cutoff points in figure 12-13 & find the circuit's MPP output voltage. \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12 #collector voltage(V)\n",
+ "RE=16 #Emitter resistance(Ohm)\n",
+ "R1=50.0 #Base resistance1 (Ohm)\n",
+ "R2=100.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=16 #Load Resistance(Ohm)\n",
+ "\n",
+ "#values from previous example,\n",
+ "ICQ=456 #collector current (mA)\n",
+ "VCEQ=4.7 #collector-emitter voltage (V) \n",
+ "re=8.0 #ac emitter resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "ic_sat=(1000*(VCEQ/re))+ICQ #ic(sarturation) (mA)\n",
+ "VCE_cut=VCEQ+(ICQ*re)/1000 #VCE(cut-off) (V)\n",
+ "MP1=ICQ*re/1000\n",
+ "MP2=VCEQ\n",
+ "MPP=2*(min(MP1,MP2)) #maximum peak-to-peak voltage (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'ic(sarturation) = ',ic_sat/1000,'A'\n",
+ "print 'VCE(cut-off) = ',VCE_cut,'V'\n",
+ "print 'maximum peak-to-peak voltage MPP = ',MPP,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ic(sarturation) = 1.0435 A\n",
+ "VCE(cut-off) = 8.348 V\n",
+ "maximum peak-to-peak voltage MPP = 7.296 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-8, Page 397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.8.py\n",
+ "#What is the max transistor power dissipation & max output power?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=20 #collector voltage(V)\n",
+ "R1=100.0 #Base resistance1 (Ohm)\n",
+ "R2=100.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=8.0 #Load Resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "MPP=VCC #maximum peak-to-peak voltage (V)\n",
+ "PD_max=MPP**2/(40*RL) #Maximum power dissipation(W)\n",
+ "Pout_max=MPP**2/(8*RL) #Maximum output power(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum power dissipation PD_max = ',PD_max,'W'\n",
+ "print 'Maximum output power Pout_max = ',Pout_max,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power dissipation PD_max = 1.25 W\n",
+ "Maximum output power Pout_max = 6.25 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-9, Page 398"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.9.py\n",
+ "#If the adjustabe resistor is 15 Ohm, what is the efficiency in preceding example?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=20 #collector voltage(V)\n",
+ "R1=100.0 #Base resistance1 (Ohm)\n",
+ "R2=100.0 #Base resistance2 (Ohm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=8.0 #Load Resistance(Ohm)\n",
+ "Ra=15 #adjustable resistor(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VCEQ=VCC/2 #collector-emitter voltage (V) \n",
+ "I_bias=VCC/(R1+R2+Ra) #bias current(mA)\n",
+ "Ic_sat=VCEQ/RL #ic(sarturation) (mA)\n",
+ "Iav=Ic_sat/math.pi #average current (A)\n",
+ "Idc=I_bias+Iav #dc current(mA)\n",
+ "Pdc=VCC*Idc #dc input power to stage(W)\n",
+ "Pout=6.25 #Output power as per example 12-8 (W)\n",
+ "n=(Pout/Pdc)*100 #efficiency of stage\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print 'efficiency of stage n = ',round(n,2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency of stage n = 63.66 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-10, Page 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.10.py\n",
+ "#What is the ICQ in figure 12-22 & maximum efficiency of the amplifier?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=20 #collector voltage(V)\n",
+ "R1=3.9 #Base resistance1 (KOhm)\n",
+ "R2=3.9 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=10.0 #Load Resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VCEQ=VCC/2 #collector-emitter voltage (V) \n",
+ "I_bias=(VCC-(2*VBE))/(R1+R2) #bias current(mA)\n",
+ "Ic_sat=VCEQ/RL #ic(sarturation) (mA)\n",
+ "Iav=Ic_sat/math.pi #average current (A)\n",
+ "Idc=(I_bias/1000)+Iav #dc current(mA)\n",
+ "Pdc=VCC*Idc #dc input power to stage(W)\n",
+ "Pout=VCC**2/(8*RL) #Output power (W)\n",
+ "n=(Pout/Pdc)*100 #efficiency of stage\n",
+ "\n",
+ "#Result\n",
+ "print 'efficiency of stage n = ',round(n,2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency of stage n = 77.96 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-11, Page 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.11.py\n",
+ "#Describe the action of figure 12-27?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "L=2*10**-6 #inductance (H)\n",
+ "C=470*10**-12 #capacitance(F)\n",
+ "\n",
+ "#Calculation\n",
+ "fr=((2*math.pi)*((L*C)**0.5))**-1\n",
+ "\n",
+ "#Result\n",
+ "print 'Resonant frequency fr = ',round((fr*10**-6),2),'MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency fr = 5.19 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-12, Page 410"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.12.py\n",
+ "#If QL is 100 in figure 12-33, what is the band width of amplifier?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "fr=5.19*10**6 #frequency as per previous example(Hz)\n",
+ "L=2*10**-6 #inductance (H)\n",
+ "C=470*10**-12 #capacitance(F)\n",
+ "QL=100 #quality factor of coil\n",
+ "RL=1 #Load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "XL=2*math.pi*fr*L #inductive impedance(Ohm)\n",
+ "Rp=QL*XL/1000 #Eq. parallel resistance of coil(KOhm)\n",
+ "rc=1000*Rp*RL/(Rp+RL) #ac collector resistance(Ohm)\n",
+ "Q=rc/XL #Q of overall circuit\n",
+ "BW=(fr/Q/1000) #band width of amplifier(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'band width of amplifier BW = ',round(BW,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "band width of amplifier BW = 390.39 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-13, Page 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.13.py\n",
+ "#In figure 12-33a, what is the worst-case power dissipation?\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "rc=867.0 #ac collector resistance as per preceding example (Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "MPP=2*VCC #Maximum peak-to-peak voltage(V)\n",
+ "PD=1000*MPP**2/(40*rc) #worst-case power dissipation(mW)\n",
+ "\n",
+ "#Result\n",
+ "print 'Worst-case power dissipation PD = ',math.ceil(PD),'mW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Worst-case power dissipation PD = 26.0 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-14, Page 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.14.py\n",
+ "#In circuit of figure 12-37 is to operate over range of 0 to 50 deg C. \n",
+ "#Find the maximum power rating of the transistor for the worst-case temperature.\n",
+ "\n",
+ "#Variable declaration\n",
+ "PD=625 #maximum power rating at 25 deg C(mW)\n",
+ "D=5 #Derating factor(mW/deg C)\n",
+ "TA=50 #ambient temperature(deg C)\n",
+ "\n",
+ "#Calculation\n",
+ "DP=D*(TA-25) #difference in power(mW) \n",
+ "PD_max=PD-DP #maximum power rating(mW)\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum power rating PD_max = ',PD_max,'mW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power rating PD_max = 500 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_13_New.ipynb b/Electronic_Principles_/Chapter_13_New.ipynb
new file mode 100644
index 00000000..00c96741
--- /dev/null
+++ b/Electronic_Principles_/Chapter_13_New.ipynb
@@ -0,0 +1,888 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 13 JFETs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-1, Page 428"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.1.py\n",
+ "#JFET gate current is 1nA when the reverse gate voltage is 20 V. What is the Rin of this JFET?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VG=20 #Gate voltage(V)\n",
+ "IG=1*10**-9 #Gate current(A) \n",
+ "\n",
+ "#Calculation\n",
+ "Rin=VG/IG #input resistance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'input resistance of JFET Rin = ',Rin/10**6,'MOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance of JFET Rin = 20000.0 MOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-2, Page 430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.2.py\n",
+ "#Vp=6V and IDSS=100 mA. What is the ohmic resistance & gate-source cutoff voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vp=6 #Pinch off voltage(V)\n",
+ "IDSS=100*10**-3 #current drain to source with shorted gate(A)\n",
+ "\n",
+ "#Calculation\n",
+ "RDS=Vp/IDSS #Ohmic resistance(Ohm)\n",
+ "VGS_off=-Vp #gate-source cutoff voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Ohmic resistance RDS = ',RDS,'Ohm'\n",
+ "print 'Gate-source cutoff VGS(off) = ',VGS_off,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ohmic resistance RDS = 60.0 Ohm\n",
+ "Gate-source cutoff VGS(off) = -6 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-3, Page 431"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.3.py\n",
+ "#VGS(off)=-4V and IDSS=5mA\n",
+ "#Find VG & ID at the half cutoff point.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VGS_off=-4 #gate-source cutoff voltage(V)\n",
+ "IDSS=5 #current drain to source with shorted gate(mA)\n",
+ "\n",
+ "#Calculation\n",
+ "VGS=VGS_off/2 #gate voltage(V)\n",
+ "ID=IDSS/4.0 #drain current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Gate voltage VGS = ',VGS,'V'\n",
+ "print 'Drain current ID = ',ID,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gate voltage VGS = -2 V\n",
+ "Drain current ID = 1.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-4, Page 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.4.py\n",
+ "#VGS(off)=-8V and IDSS=16mA\n",
+ "#What are VG & ID at the half cutoff point?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VGS_off=-8 #gate-source cutoff voltage(V)\n",
+ "IDSS=16 #current drain to source with shorted gate(mA)\n",
+ "\n",
+ "#Calculation\n",
+ "VGS=VGS_off/2 #gate voltage(V)\n",
+ "ID=IDSS/4.0 #drain current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Gate voltage VGS = ',VGS,'V'\n",
+ "print 'Drain current ID = ',ID,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gate voltage VGS = -4 V\n",
+ "Drain current ID = 4.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-5, Page 433"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.5.py\n",
+ "#What is the VD in figure 13-8a?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vp=4 #pinchoff voltage(V)\n",
+ "Vin=-10 #input voltage(V)\n",
+ "RD=10.0 #drain resistor(KOhm)\n",
+ "IDSS=10.0 #IDSS (mA)\n",
+ "VDD=10.0 #Drain supply voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "#Befor point A,\n",
+ "VGS_off=-Vp #VGS cutoff voltage(V)\n",
+ "VD=-Vin #drain voltage(V)\n",
+ "#Between point A&B,\n",
+ "ID_sat=VD/RD #saturation drain current(mA)\n",
+ "RDS=Vp/IDSS #Ohmic resistance(Ohm)\n",
+ "VD=VDD*RDS/(RDS+RD) #drain votage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Drain voltage VD = ',round(VD,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain voltage VD = 0.38 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-6, Page 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.6.py\n",
+ "#Find medium source resistance & VD.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vp=4 #pinchoff voltage(V)\n",
+ "RD=2.0 #drain resistor(KOhm)\n",
+ "RS=400 #source resistance(Ohm)\n",
+ "IDSS=10.0 #IDSS (mA)\n",
+ "VDD=30.0 #Drain supply voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "RDS=1000*Vp/IDSS #Ohmic resistance(Ohm)\n",
+ "ID=IDSS/4.0 #drain current(mA)\n",
+ "VD=VDD-(ID*RD) #drain votage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Ohmic resistance RDS = ',RDS,'Ohm'\n",
+ "print 'drain voltage VD = ',VD,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ohmic resistance RDS = 400.0 Ohm\n",
+ "drain voltage VD = 25.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-7, Page 437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.7.py \n",
+ "#determine the range of VGS and ID Q point values, optimum source resistor.\n",
+ "\n",
+ "#Variable declaration\n",
+ "IDSS=20 #IDSS (mA)\n",
+ "RS=270 #Source resistance (Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VGS=-IDSS*RS #gate-source voltage(V)\n",
+ "#after drawing (0,0) and seond point,\n",
+ "VGSQ_min=-0.8 #Q point minimum gate-source voltage(V)\n",
+ "VGSQ_max=-2.1 #Q point maximum gate-source voltage(V)\n",
+ "IDQ_min=2.8 #Q point minimum drain current(V)\n",
+ "IDQ_max=8.0 #Q point maximum drain current(V)\n",
+ "VGS_off_min=2 #VGS(off) minimum(V)\n",
+ "VGS_off_max=6 #VGS(off) maximum(V)\n",
+ "ID_min=8.0 #ID minimum(mA)\n",
+ "ID_max=20.0 #ID maximum(mA)\n",
+ "Rs_min=1000*VGS_off_min/ID_min #Minimum value for Rs(Ohm)\n",
+ "Rs_max=1000*VGS_off_max/ID_max #Maximum value for Rs(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum value for Rs =',Rs_max,'Ohm'\n",
+ "print 'Minimum value for Rs =',Rs_min,'Ohm'\n",
+ "print 'Choose approximately mid point between these two.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value for Rs = 300.0 Ohm\n",
+ "Minimum value for Rs = 250.0 Ohm\n",
+ "Choose approximately mid point between these two.\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-8, Page 440"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.8.py\n",
+ "#Draw the dc load line and Q point for figure 13-15a usng ideal methods.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VS=10 #source voltage (V)\n",
+ "RS=2.0 #source resistance(KOhm)\n",
+ "VDD=30 #Drain supply voltage (V)\n",
+ "RD=1.0 #Drain resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ID=VS/Rs #Drain current(mA)\n",
+ "VD=VDD-(ID*RD) #Drain voltage(V)\n",
+ "VDS=VD-VS #Drain to source voltage (V)\n",
+ "ID_sat=VDD/(RD+RS) #ID(dc-saturation) (mA)\n",
+ "VDS_cut=VDD #VDS(cutoff) (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'ID (saturation) = ',ID_sat,'mA'\n",
+ "print 'VDS (cutoff) = ',VDS_cut,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ID (saturation) = 10.0 mA\n",
+ "VDS (cutoff) = 30 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-9, Page 441"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.9.py\n",
+ "#Find minimum & maximum Q point for JFET.\n",
+ "\n",
+ "#Variable declaration\n",
+ "IDSS=20 #IDSS (mA)\n",
+ "RS=270 #Source resistance (Ohm)\n",
+ "VDD=30 #Drain supply voltage (V)\n",
+ "RD=1.0 #Drain resistance(KOhm)\n",
+ "R1=1*10**6 #Gate resistor1(Ohm) \n",
+ "R2=2*10**6 #Gate resistor2(Ohm) \n",
+ "\n",
+ "#Calculation\n",
+ "VG=-VDD*R1/(R1+R2) #gate-source voltage(V)\n",
+ "ID=VG/RS #current for second point(mA)\n",
+ "\n",
+ "#after drawing (0,0) and seond point,\n",
+ "VGSQ_min=-0.4 #Q point minimum gate-source voltage(V)\n",
+ "VGSQ_max=-2.4 #Q point maximum gate-source voltage(V)\n",
+ "IDQ_min=5.2 #Q point minimum drain current(V)\n",
+ "IDQ_max=6.3 #Q point maximum drain current(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum value for VGS =',VGSQ_max,'V'\n",
+ "print 'Minimum value for VGS =',VGSQ_min,'V'\n",
+ "print 'Maximum value for ID =',IDQ_max,'mA'\n",
+ "print 'Minimum value for ID =',IDQ_min,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value for VGS = -2.4 V\n",
+ "Minimum value for VGS = -0.4 V\n",
+ "Maximum value for ID = 6.3 mA\n",
+ "Minimum value for ID = 5.2 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 93
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-10, Page 443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.10.py\n",
+ "#What is the ID & VD in figure 13-19a?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RS=3.0 #Source resistance (KOhm)\n",
+ "VDD=15 #Drain supply voltage (V)\n",
+ "RD=1.0 #Drain resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ID=VDD/RS #drain current(mA)\n",
+ "VD=VDD-(ID*RD) #drain voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Drain current ID = ',ID,'mA'\n",
+ "print 'Drain voltage VD = ',VD,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current ID = 5.0 mA\n",
+ "Drain voltage VD = 10.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-11, Page 444"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.11.py\n",
+ "#In figure 13-19b, What is the VD & ID? \n",
+ "\n",
+ "#Variable declaration\n",
+ "RS=2.0 #Source resistance (KOhm)\n",
+ "VDD=10 #Drain supply voltage (V)\n",
+ "RD=1.0 #Drain resistance(KOhm)\n",
+ "VBE=0.7 #BJT transistor drop(V)\n",
+ "\n",
+ "#Calculation\n",
+ "ID=((VDD/2)-VBE)/RS #drain current(mA)\n",
+ "VD=VDD-(ID*RD) #drain voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Drain current ID = ',ID,'mA'\n",
+ "print 'Drain voltage VD = ',VD,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current ID = 2.15 mA\n",
+ "Drain voltage VD = 7.85 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-12, Page 447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.12.py\n",
+ "#IDSS=5mA and gm0=5000 uS, What is the value of VGS(off) and gm when VGS=-1V?\n",
+ "\n",
+ "#Variable declaration\n",
+ "IDSS=5.0 #IDSS current (mA)\n",
+ "gm0=5000.0 #transconductance at VGS=0(uS)\n",
+ "VGS=-1.0 #VGS (V)\n",
+ "#Calculation\n",
+ "VGS_off=1000*-2*IDSS/gm0 #VGS (off) (V)\n",
+ "gm=gm0*(1-(VGS/VGS_off)) #gm at VGS=-1V\n",
+ "\n",
+ "#Result\n",
+ "print 'VGS (Off) = ',VGS_off,'V'\n",
+ "print 'gm = ',gm,'uS'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VGS (Off) = -2.0 V\n",
+ "gm = 2500.0 uS\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-13, Page 449"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.13.py\n",
+ "#If gm=5000 uS in figure 13-23, what is the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RD=3.6 #drain resistance(KOhm)\n",
+ "RL=10 #Load resistance(KOhm)\n",
+ "gm=5000 #transconductance (uS)\n",
+ "Vin=1 #input(mVpp)\n",
+ "\n",
+ "#Calculation\n",
+ "rd=RD*RL/(RD+RL) #ac drain resistance(KOhm)\n",
+ "Av=gm*rd/1000 #voltage gain\n",
+ "Vout=Av*Vin #Output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'ac drain resistance rd = ',round(rd,2),'KOhm'\n",
+ "print 'voltage gain Av = ',round(Av,2)\n",
+ "print 'output voltage Vout = ',round(Vout,2),'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ac drain resistance rd = 2.65 KOhm\n",
+ "voltage gain Av = 13.24\n",
+ "output voltage Vout = 13.24 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-14, Page 450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.14.py\n",
+ "#If gm=2500 uS in figure 13-24, what is the output voltage of source follower?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RS=1.0 #source resistance(KOhm)\n",
+ "RL=1.0 #Load resistance(KOhm)\n",
+ "gm=2500.0*10**-6 #transconductance (S)\n",
+ "Vin=1 #input(mVpp)\n",
+ "\n",
+ "#Calculation\n",
+ "rs=1000*RS*RL/(RS+RL) #ac source resistance(Ohm)\n",
+ "Av=gm*rs/(1+(gm*rs)) #voltage gain\n",
+ "Vout=Av*Vin #Output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'ac source resistance rs = ',round(rs,2),'Ohm'\n",
+ "print 'voltage gain Av = ',round(Av,2)\n",
+ "print 'output voltage Vout = ',round(Vout,2),'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ac source resistance rs = 500.0 Ohm\n",
+ "voltage gain Av = 0.56\n",
+ "output voltage Vout = 0.56 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 13-15, Page 450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.15.py\n",
+ "#Figure 13-25 includes variable resistor of 1KOhm.\n",
+ "#If this is adjusted to 780 Ohm, what is the voltage gain?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ra=780 #Adjustaed resistance(Ohm)\n",
+ "RS1=220 #source resistance(Ohm)\n",
+ "VDD=30 #Drain supply voltage(V)\n",
+ "RL=3 #Load resistance(KOhm)\n",
+ "gm=2000.0*10**-6 #transconductance (S)\n",
+ "\n",
+ "#Calculation\n",
+ "RS=(RS1+Ra)/1000 #total source resistance(KOhm)\n",
+ "rs=1000*RS*RL/(RS+RL) #ac source resistance(Ohm)\n",
+ "Av=gm*rs/(1+(gm*rs)) #voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Ac source resistance rs = ',rs,'Ohm'\n",
+ "print 'voltage gain Av = ',Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac source resistance rs = 750 Ohm\n",
+ "voltage gain Av = 0.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-16, Page 451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.16.py\n",
+ "#In figure 13-26, What is the ID & Av? \n",
+ "\n",
+ "#Variable declaration\n",
+ "RS=2.2 #source resistance(Ohm)\n",
+ "VDD=30 #Drain supply voltage(V)\n",
+ "RL=3.3 #Load resistance(KOhm)\n",
+ "gm=3500.0*10**-6 #transconductance (S)\n",
+ "R1=2*10**-6 #Base resistor 1(Ohm)\n",
+ "R2=1*10**-6 #Base resistor 2(Ohm) \n",
+ "\n",
+ "#Calculation\n",
+ "VD=VDD*(R2/(R1+R2)) #drain voltage(V)\n",
+ "ID=VD/RS #drain current(mA)\n",
+ "rs=1000*RS*RL/(RS+RL) #ac source resistance(Ohm)\n",
+ "Av=gm*rs/(1+(gm*rs)) #voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Ac source resistance rs = ',rs/1000,'KOhm'\n",
+ "print 'voltage gain Av = ',round(Av,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac source resistance rs = 1.32 KOhm\n",
+ "voltage gain Av = 0.82\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-17, Page 454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.17.py\n",
+ "#A JFET shunt switch has RD = 10 KOhm, IDSS=10 mA, and VGS(Off)=-2V. If vin =10 mVpp, \n",
+ "#what are output voltages & on-off ratio?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RD=10.0 #Drain resistance(KOhm)\n",
+ "R1=0.2 #resistance(KOhm)\n",
+ "IDSS=10.0 #IDSS current(mA)\n",
+ "VGS_off=-2 #VGS(off) (V)\n",
+ "gm=3500.0*10**-6 #transconductance (S)\n",
+ "Vin=10.0 #input voltage (mVpp)\n",
+ "\n",
+ "#Calculation\n",
+ "RDS=-VGS_off/IDSS #Ohmic resistance(Ohm)\n",
+ "Vout_on=Vin*RDS/(RD+R1) #Output voltage when JFET is on(V)\n",
+ "Vout_off=Vin #Output voltage when JFET is off(V)\n",
+ "ratio=Vout_off/Vout_on #on-off ratio\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout = ',round(Vout_on,2),'mVpp'\n",
+ "print 'on-off ratio = ',ratio"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout = 0.2 mVpp\n",
+ "on-off ratio = 51.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-18, Page 455"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.18.py\n",
+ "#What are output voltages? Resistance of 10 MOhm when JFET is off, What is the on-off ratio?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RD=10.0 #Drain resistance(KOhm)\n",
+ "R1=0.2 #resistance(KOhm)\n",
+ "R2=10*10**6 #resistance(Ohm)\n",
+ "IDSS=10.0 #IDSS current(mA)\n",
+ "VGS_off=-2 #VGS(off) (V)\n",
+ "gm=3500.0*10**-6 #transconductance (S)\n",
+ "Vin=10.0 #input voltage (mVpp)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout_on=Vin*(RD/(RD+R1)) #Output voltage when JFET is on(V)\n",
+ "Vout_off=Vin*(RD/R2) #Output voltage when JFET is off(V)\n",
+ "ratio=Vout_on/Vout_off/1000 #on-off ratio\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout when on = ',round(Vout_on,2),'mVpp'\n",
+ "print 'output voltage Vout when off = ',Vout_off*10**6,'uVpp'\n",
+ "print 'on-off ratio = ',round(ratio,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout when on = 9.8 mVpp\n",
+ "output voltage Vout when off = 10.0 uVpp\n",
+ "on-off ratio = 980.39\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13-19, Page 455"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.19.py\n",
+ "#The square wave on the gate has frequency of 20KHz. what is frequency of the chopped output?\n",
+ "#If RDS = 50 Ohm, what is the peak value of chopped output?\n",
+ "\n",
+ "#Variable declaration\n",
+ "fout=20 #frequency(KHz)\n",
+ "RDS=50.0 #Ohmic resistance(Ohm)\n",
+ "RL=10*10**3 #Load resistance(Ohm)\n",
+ "Vin=100 #input voltage (mV)\n",
+ "\n",
+ "#Calculation\n",
+ "Vpeak=Vin*RL/(RL+RDS) #peak voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Outout Vpeak = ',round(Vpeak,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Outout Vpeak = 99.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_14_New.ipynb b/Electronic_Principles_/Chapter_14_New.ipynb
new file mode 100644
index 00000000..9d13545e
--- /dev/null
+++ b/Electronic_Principles_/Chapter_14_New.ipynb
@@ -0,0 +1,730 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 14 MOSFETs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-1, Page 481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.1.py\n",
+ "#A D-MOSFET has VGS_Off=-3V and IDSS = 6mA. What will the ID when VGS equals -1V,-2V, 0V,1V and 2V ?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VGS_off=-3.0 #Gate-source cutoff voltage(V)\n",
+ "IDSS=6 #IDSS current(mA) \n",
+ "VGS1=-1 #VGS voltage(V)\n",
+ "VGS2=-2\n",
+ "VGS3=0\n",
+ "VGS4=1\n",
+ "VGS5=2\n",
+ "\n",
+ "#Calculation\n",
+ "ID1=IDSS*((1-(VGS1/VGS_off))**2)\n",
+ "ID2=IDSS*((1-(VGS2/VGS_off))**2)\n",
+ "ID3=IDSS*((1-(VGS3/VGS_off))**2)\n",
+ "ID4=IDSS*((1-(VGS4/VGS_off))**2)\n",
+ "ID5=IDSS*((1-(VGS5/VGS_off))**2)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print 'Drain current ID1 = ',round(ID1,2),'mA'\n",
+ "print 'Drain current ID2 = ',round(ID2,2),'mA'\n",
+ "print 'Drain current ID3 = ',ID3,'mA'\n",
+ "print 'Drain current ID4 = ',round(ID4,2),'mA'\n",
+ "print 'Drain current ID5 = ',round(ID5,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current ID1 = 2.67 mA\n",
+ "Drain current ID2 = 0.67 mA\n",
+ "Drain current ID3 = 6.0 mA\n",
+ "Drain current ID4 = 10.67 mA\n",
+ "Drain current ID5 = 16.67 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-2, Page 482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.2.py\n",
+ "#The D-MOSFET has VGS(off) =-2V, IDSS=4mA and gm0=2000 uS. \n",
+ "#What is the circuit's output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VGS_off=-2.0 #Gate-source cutoff voltage(V)\n",
+ "IDSS=4 #IDSS current(mA) \n",
+ "gm0=2000*10**-6 #transconductance(S)\n",
+ "VGS=0 #VGS voltage(V)\n",
+ "VDD=15 #Drain supply voltage(V)\n",
+ "RD=2.0 #Drain resistance(KOhm)\n",
+ "RL=10.0 #Load resistance(KOhm)\n",
+ "Vin=20 #input voltage(mV)\n",
+ "\n",
+ "#Calculation\n",
+ "VDS=VDD-(IDSS*RD) #Drain-source voltage(V)\n",
+ "rd=RD*RL/(RD+RL) #ac drain resistance(KOhm) \n",
+ "Av=gm0*rd*1000 #voltage gain\n",
+ "Vout=Vin*Av #output voltage (mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 66.67 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-3, Page 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.3.py\n",
+ "#What is the output voltage in figure 14-14a?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VGS_on=4.5 #Gate-source voltage(V)\n",
+ "ID_on=75 #ID current(mA) \n",
+ "RDS=6 #Ohmic resistance(Ohm)\n",
+ "VDD=20 #Drain supply voltage(V)\n",
+ "RD=1.0 #Drain resistance(KOhm)\n",
+ "RL=10.0 #Load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ID_sat=VDD/RD #drain saturation current(mA)\n",
+ "#VGS is high,\n",
+ "Vout1=VDD*(RDS/(RDS+(RD*1000)))#output voltage when VGS is high(V)\n",
+ "#VGS is low, \n",
+ "Vout2=VDD #output voltage when VGS is low(V) \n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage when VGS is high = ',round(Vout1,2),'V'\n",
+ "print 'output voltage when VGS is low = ',Vout2,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage when VGS is high = 0.12 V\n",
+ "output voltage when VGS is low = 20 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-4, Page 492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.4.py\n",
+ "#What is the LED current ib figure 14-15?\n",
+ "\n",
+ "#Variable declaration\n",
+ "ID=20 #ID current as per previous example(mA) \n",
+ "Vled=2 #Led drop(V)\n",
+ "RD=1.0 #Drain resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ID=(VDD-Vled)/RD #drain current considering LED drop\n",
+ "\n",
+ "#Result\n",
+ "print 'drain current considering LED drop ID = ',ID,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "drain current considering LED drop ID = 18.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-5, Page 492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.5.py\n",
+ "#What does the circuit of figure 14-16a do if a coil current of 30 mA or more closes the relay contacts? \n",
+ "\n",
+ "#Variable declaration\n",
+ "Rrc=500.0 #Resistance of relay(V)\n",
+ "VDD=24 #drain supply voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "ID_sat=VDD/Rrc #drain saturation current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'Drain saturaion current ID(sat) = ',ID_sat*1000,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain saturaion current ID(sat) = 48.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-6, Page 496"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.6.py\n",
+ "#What is the output voltage in figure 14-20a when the input is low & high?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VDD=20.0 #drain supply voltage (V)\n",
+ "RD=10*10**3 #drain resistance(Ohm)\n",
+ "RDS=50.0 #Ohmic resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout1=VDD #Output voltage when i/p is low (V)\n",
+ "Vout2=VDD*RDS/(RDS+RD) #Output voltage when i/p is high (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage when input is low Vout1 = ',Vout1,'V'\n",
+ "print 'Output voltage when input is high Vout2 = ',round((Vout2*1000),2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage when input is low Vout1 = 20.0 V\n",
+ "Output voltage when input is high Vout2 = 99.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-7, Page 496"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.7.py\n",
+ "#What is the output voltage in figure 14-20b?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VDD=10.0 #drain supply voltage (V)\n",
+ "RD=2*10**3 #drain resistance(Ohm)\n",
+ "RDS=500.0 #Ohmic resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout1=VDD #Output voltage when i/p is low (V)\n",
+ "Vout2=VDD*RDS/(RDS+RD) #Output voltage when i/p is high (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage when input is low Vout1 = ',Vout1,'V'\n",
+ "print 'Output voltage when input is high Vout2 = ',Vout2,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage when input is low Vout1 = 10.0 V\n",
+ "Output voltage when input is high Vout2 = 2.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-8, Page 498"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.8.py\n",
+ "#The MOSFET of figure 14-22a have RDS(ON)=100 Ohm, RDS(off)=1 MOhm. What does output waveform look like?\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "%pylab inline\n",
+ "\n",
+ "#calculation & plotting\n",
+ "print 'Input signal switches from 0 to 15 V at pt. A & 15 to 0 V at pt. B'\n",
+ "x=[1,2,3,4,5,6,7,8,9,10]\n",
+ "y=[0,0,0,15,15,15,15,0,0,0]\n",
+ "print 'approximate plotting shown in figure'\n",
+ "plt.plot(x,y)\n",
+ "plt.show()\n",
+ "print 'output signal shown on second plot'\n",
+ "z=[15,15,15,0,0,0,0,15,15,15]\n",
+ "plt.plot(x,z,'r')\n",
+ "plt.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "Input signal switches from 0 to 15 V at pt. A & 15 to 0 V at pt. B\n",
+ "approximate plotting shown in figure\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSU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ocSEEnn76adhsNqxcuVJ2HADApUuX+l517urqwv79++Fy\nuaRmWrduHZqbm9HY2IidO3fiwQcfxLZt26RmAgCv14tvv/0WANDZ2Yl//vOf0u9+SkpKQkpKCurq\n6gAoO2i73S41k9+OHTuQn58vOwYAZeqtqKhAV1cXhBA4cOCAJtaG//3vfwEAZ86cwd/+9jdNrJ78\nHn30UWzduhUAsHXr1sGHzmC/2vrkk0+K8ePHixEjRojk5GSxefPmYP8WASsvLxcWi0VkZWWJ7Oxs\nkZ2dLfbt2yc1U1VVlXC5XCIrK0s4nU7x2muvSc1zK4/Ho5m7UxoaGkRWVpbIysoSdrtdrFu3TnYk\nIYQQX375pZg5c6bIzMwUjz32mCbuTuno6BDx8fHi6tWrsqP02bBhg7DZbMLhcIhly5aJ69evy44k\ncnNzhc1mE1lZWaKsrExaDn9fRkVF9fVlW1ubeOihh8S0adNEXl6e+Oabbwa8Bt/sQ0SkY6ZYpxAR\nGRVLnIhIx1jiREQ6xhInItIxljgRkY6xxImIdIwlTkSkYyxxIiId+3/lcweL2bKEEwAAAABJRU5E\nrkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x60fcb70>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output signal shown on second plot\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAEACAYAAABF+UbAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHT1JREFUeJzt3XtQlXX+B/D3QdBGSUSEQwYmIsa5AScv7LrL7LFEZ9u1\nNTUnrNWBbP9ottnapnHaf5bcTTG3X9FldnbaLHUbbJtt01xlVrOjbi1jhgUiinEJUXAFA0NE4fT9\n/fF48A6c51y+z+X9mmGWCB7eI+y7j5/zXCxCCAEiItKlKNkBiIhIPZY4EZGOscSJiHSMJU5EpGMs\ncSIiHWOJExHp2KAlXlRUBKvVCpf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CQni3LlzsqMMWLdunbDb7cLpdIrly5eLS5cuyY4k8vLyhN1u\nF9nZ2WLPnj3Scvj7MiYmZqAvOzo6xH333ScyMjJEfn6++Pbbbwc9Bi/2ISLSMVOsU4iIjIolTkSk\nYyxxIiIdY4kTEekYS5yISMdY4kREOsYSJyLSMZY4EZGO/T9PCTKfk/NlxwAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x9285470>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-9, Page 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.9.py\n",
+ "#What is the current through the motor winding of figure 14-28?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VDD=30.0 #drain supply voltage (V)\n",
+ "RD=30 #drain resistance(Ohm)\n",
+ "RDS=1.95 #Ohmic resistance(Ohm)\n",
+ "ID_on=2 #ID for MOSFET on (A)\n",
+ "\n",
+ "#Calculation\n",
+ "ID_sat=VDD/RD #drain saturation current(A)\n",
+ "#ID_sat<ID(On) so, considering RDS,\n",
+ "ID=VDD/(RDS+RD) #drain current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'current through motor winding is ID = ',round(ID,2),'A'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current through motor winding is ID = 0.94 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-10, Page 503"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.10.py\n",
+ "#If photodiode is off, gate voltage rises to 10 V.\n",
+ "#what is ac current through lamp?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VDD=30.0 #drain supply voltage (V)\n",
+ "RD=10 #drain resistance(Ohm)\n",
+ "RDS=1.07 #Ohmic resistance(Ohm)\n",
+ "ID_on=5 #ID for MOSFET on (A)\n",
+ "\n",
+ "#Calculation\n",
+ "ID_sat=VDD/RD #drain saturation current(A)\n",
+ "#ID_sat<ID(On) so, considering RDS,\n",
+ "ID=VDD/(RDS+RD) #drain current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'current through lamp is ID = ',round(ID,2),'A'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current through lamp is ID = 2.71 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-11, Page 503"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.11.py\n",
+ "#The circuit of figure 14-30 automatically filled swimming pool.\n",
+ "#Find current through water valve of if power FET has RDS(on)=0.5 Ohm\n",
+ "\n",
+ "#Variable declaration\n",
+ "VDD=10.0 #drain supply voltage (V)\n",
+ "RD=10 #drain resistance(Ohm)\n",
+ "RDS=0.5 #Ohmic resistance(Ohm)\n",
+ "ID_on=5 #ID for MOSFET on (A)\n",
+ "\n",
+ "#Calculation\n",
+ "ID=VDD/(RDS+RD) #drain current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'current through water valve is ID = ',round(ID,2),'A'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current through water valve is ID = 0.95 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-12, Page 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.12.py\n",
+ "#What is the RC time constant & lamp power at full brightness?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VDD=30.0 #drain supply voltage (V)\n",
+ "RD=10 #drain resistance(Ohm)\n",
+ "RDS=1.07 #Ohmic resistance(Ohm)\n",
+ "R1=2*10**6 #Resistance1 at gate (Ohm)\n",
+ "R2=1*10**6 #Resistance2 at gate (Ohm)\n",
+ "C=10*10**-6 #Capacitance at gate(F)\n",
+ "\n",
+ "#Calculation\n",
+ "RTH=R1*R2/(R1+R2) #Thevenin resistance(Ohm)\n",
+ "RC=RTH*C #RC Time constant(s)\n",
+ "ID=VDD/(RDS+RD) #drain current through lamp(A)\n",
+ "P=(ID**2)*RD #Lamp Power(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'RC Time constant = ',round(RC,2),'s'\n",
+ "print 'current through lamp is ID = ',round(ID,2),'A'\n",
+ "print 'Lamp power P = ',round(P,2),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RC Time constant = 6.67 s\n",
+ "current through lamp is ID = 2.71 A\n",
+ "Lamp power P = 73.44 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-13, Page 506"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.13.py\n",
+ "#find constant k value and ID at VGSvalues of 3 V & 4.5V \n",
+ "\n",
+ "#Variable declaration\n",
+ "ID_on=0.6 #ID for MOSFET on (A)\n",
+ "VGS_on=4.5 #VGS for MOSFET on(V)\n",
+ "VGS_th=2.1 #VGS threshold(V)\n",
+ "VGS1=3 #Gate-source voltage1(V)\n",
+ "VGS2=4.5 #Gate-source voltage2(V)\n",
+ "\n",
+ "#Calculation\n",
+ "k=ID_on/(VGS_on-VGS_th)**2 #constant(A/V2)\n",
+ "ID1=1000*k*(VGS1-VGS_th)**2 #ID for VGS=3 (mA)\n",
+ "ID2=1000*k*(VGS2-VGS_th)**2 #ID for VGS=4.5 (mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'ID1 (for VGS = 3V) = ',round(ID1,2),'mA'\n",
+ "print 'ID2 (for VGS = 4.5V) = ',ID2,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ID1 (for VGS = 3V) = 84.37 mA\n",
+ "ID2 (for VGS = 4.5V) = 600.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14-14, Page 507"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.14.py\n",
+ "#E-MOSFET has ID(on) = 3mA and VDS(on) = 10V. \n",
+ "#If VDD=25V,find RD that allows MOSFET to operate at specified Q point.\n",
+ "\n",
+ "#Variable declaration\n",
+ "ID_on=3 #ID (On) (mA)\n",
+ "VDS_on=10 #VDS(On) (V) \n",
+ "VDD=25 #Drain supply voltage (V)\n",
+ "\n",
+ "#Calculation\n",
+ "RD=(VDD-VDS_on)/ID_on #Drain resistance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Drain resistance RD = ',RD,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain resistance RD = 5 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 14-15, Page 508"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 14.15.py\n",
+ "#Find VGS,ID,gm and Vout. \n",
+ "# k=104*10-3 A/V2 ,ID(On)=600mA, VGS(th)=2.1V\n",
+ "\n",
+ "#Variable declaration\n",
+ "ID_on=600 #ID (On) (mA)\n",
+ "VGS_th=2.1 #VGS(threshold) (V) \n",
+ "VDD=12 #Drain supply voltage (V)\n",
+ "k=104*10**-3 #constant(A/V2)\n",
+ "R1=1.0*10**6 #Resistance1 at gate (Ohm)\n",
+ "R2=350.0*10**3 #Resistance2 at gate (Ohm)\n",
+ "Vin=100.0*10**-3 #input voltage (V)\n",
+ "RD=68.0 #Drain resistance(Ohm)\n",
+ "RL=1.0*10**3 #Load resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "VGS=VDD*R2/(R1+R2) #Gate-source voltage(V)\n",
+ "ID=1000*k*(VGS1-VGS_th)**2 #Drain current (mA)\n",
+ "gm=2*k*(VGS-VGS_th) #transconductance (S)\n",
+ "rd=RD*RL/(RD+RL) #ac drain resistance(Ohm) \n",
+ "Av=gm*rd #voltage gain\n",
+ "Vout=Vin*Av #Output voltage (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Gate-source voltage VGS = ',round(VGS,2),'V'\n",
+ "print 'transconductance gm = ',round((gm*1000),2),'mS'\n",
+ "print 'Ac drain resistance rd = ',round(rd,2),'Ohm'\n",
+ "print 'voltage gain Av = ',round(Av,2)\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gate-source voltage VGS = 3.11 V\n",
+ "transconductance gm = 210.31 mS\n",
+ "Ac drain resistance rd = 63.67 Ohm\n",
+ "voltage gain Av = 13.39\n",
+ "Output voltage Vout = 1.34 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_15_New.ipynb b/Electronic_Principles_/Chapter_15_New.ipynb
new file mode 100644
index 00000000..3e39f907
--- /dev/null
+++ b/Electronic_Principles_/Chapter_15_New.ipynb
@@ -0,0 +1,436 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 15 Thyristors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-1, Page 521"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.1.py\n",
+ "#The diode of figure 15-5 has a brekover voltage of 10 V. if Vin is increased to 15V, what is the ID?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VB=10 #breakover voltage(V)\n",
+ "Vin=15 #input voltage(V)\n",
+ "R=100.0 #resistance (Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "#Vin>VB so diode breaks over\n",
+ "I1=1000*Vin/R #diode current ideally(mA)\n",
+ "I2=1000*(Vin-0.7)/R #diode current with second approx.(mA)\n",
+ "#To get more accurate answer, as per figure 15-3e , Voltage=0.9V when I=150mA\n",
+ "I3=1000*(Vin-0.9)/R #diode current more accurately(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Diode current ideally ID1 = ',I1,'mA'\n",
+ "print 'Diode current with second approx. ID2 = ',I2,'mA'\n",
+ "print 'Diode current more accurately ID3 = ',I3,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diode current ideally ID1 = 150.0 mA\n",
+ "Diode current with second approx. ID2 = 143.0 mA\n",
+ "Diode current more accurately ID3 = 141.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-2, Page 525"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.2.py\n",
+ "#The diode of figure 15-5 has Ih of 4 mA. Vin is increased to 15 V ,then decreased to open the diode. \n",
+ "#What is the input voltage that opens the diode?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ih=4*10**-3 #holding current(mA)\n",
+ "R=100.0 #resistance (Ohm)\n",
+ "Vs=15 #input voltage (V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vin=0.7+(Ih*R) #new input voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'New input voltage Vin = ',Vin,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New input voltage Vin = 1.1 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-3, Page 525"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.3.py\n",
+ "#Figure 15-6a shows a sawtooth generator. \n",
+ "#when capacitor voltage reaches +10V, diode breaks over. \n",
+ "#What is RC time constant for capacitor charging? \n",
+ "#What is frequency of the sawtooth wave if its period is approximately 20% of time constant.\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=2.0*10**3 #resistance (Ohm)\n",
+ "C=0.02*10**-6 #capacitance (F)\n",
+ "VB=10 #breakdown voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "RC=R*C #Time constant(s)\n",
+ "T=0.2*RC #period (s)\n",
+ "f=T**-1 #frequency(Hz) \n",
+ "\n",
+ "#Result\n",
+ "print 'time constant RC = ',RC*10**6,'us'\n",
+ "print 'Period T = ',T*10**6,'us'\n",
+ "print 'Frequency = ',f/1000,'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time constant RC = 40.0 us\n",
+ "Period T = 8.0 us\n",
+ "Frequency = 125.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-4, Page 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.4.py\n",
+ "#In figure 15-14 the SCR has a trigger voltage 0.75 V and trigger current 7mA. What is Vin that turns SCR on?\n",
+ "#If Ih is 6mA, what is supply voltage that turns it off?\n",
+ "\n",
+ "#Variable declaration\n",
+ "It=7*10**-3 #trigger current(mA)\n",
+ "R1=100.0 #resistance (Ohm)\n",
+ "R2=1*10**3 #resistance (Ohm)\n",
+ "Vt=0.75 #trigger voltage (V)\n",
+ "Ih=6*10**-3 #holding current(mA)\n",
+ "\n",
+ "#Calculation\n",
+ "Vin=Vt+(It*R2) #minimum input voltage(V)\n",
+ "VCC=0.7+(Ih*R1) #supply voltage for turning of SCR(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Minimum input voltage Vin = ',Vin,'V'\n",
+ "print 'supply voltage for turning of SCR VCC = ',VCC,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum input voltage Vin = 7.75 V\n",
+ "supply voltage for turning of SCR VCC = 1.3 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-5, Page 532"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.5.py\n",
+ "#What is peak output voltage? What is frequency of sawtooth wave if its period is approximately 20% of time constant?\n",
+ "\n",
+ "#Variable declaration\n",
+ "IGT=200*10**-6 #trigger current(mA)\n",
+ "VGT=1 #trigger voltage(V) \n",
+ "R1=900.0 #resistance (Ohm)\n",
+ "R2=100.0 #resistance (Ohm)\n",
+ "C=0.2*10**-6 #capacitance (F)\n",
+ "Vt=0.75 #trigger voltage (V)\n",
+ "Ih=6*10**-3 #holding current(mA)\n",
+ "R=1*10**3 #Resistance (Ohm) \n",
+ "\n",
+ "#Calculation\n",
+ "RTH=R1*R2/(R1+R2) #Thevenin resistance (Ohm)\n",
+ "Vin=VGT+(IGT*RTH) #input voltage needed to trigger(V)\n",
+ "Vp=10*Vin #Output voltage at SCR firing point(V)\n",
+ "RC=C*(R/2) #time constant (s)\n",
+ "T=RC*0.2 #period (s)\n",
+ "f=1/T #frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'peak output voltage Vpeak = ',Vp,'V'\n",
+ "print 'time constant RC = ',RC*10**6,'us'\n",
+ "print 'Period T = ',T*10**6,'us'\n",
+ "print 'Frequency = ',f/1000,'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak output voltage Vpeak = 10.18 V\n",
+ "time constant RC = 100.0 us\n",
+ "Period T = 20.0 us\n",
+ "Frequency = 50.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-6, Page 536"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.6.py\n",
+ "#Calculate supply voltage that turns on crowbar of figure 15-21.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vz=5.6 #breakdown voltage(V)\n",
+ "VGT1=0.75 #trigger voltage (V) \n",
+ "VGT2=1.5 #worst case maximum trigger voltage(V) \n",
+ "Vz2=6.16 #break down voltage with 10% tolerance (V)\n",
+ "\n",
+ "#Calculation\n",
+ "VCC1=Vz+VGT1 #supply voltage(V) \n",
+ "VCC2=VGT2+Vz2 #Over voltage (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'supply voltage VCC1 = ',VCC1,'V'\n",
+ "print 'supply over voltage VCC2 = ',VCC2,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "supply voltage VCC1 = 6.35 V\n",
+ "supply over voltage VCC2 = 7.66 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-7, Page 539"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.7.py\n",
+ "#Using figure 15-22a, find approximate firing angle & conduction angle when R=26KOhm\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "C=0.1*10**-6 #capacitance (F)\n",
+ "f=60 #frequency (Hz)\n",
+ "R=26*10**3 #resistance(KOhm)\n",
+ "Vm=120 #input ac voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "XC=(2*math.pi*f*C)**-1 #capacitive reactance(Ohm)\n",
+ "ZT=((R**2)+(XC**2))**0.5 #impedance (Ohm)\n",
+ "thetaz=math.atan2(-XC,R)*180/math.pi #angle (deg)\n",
+ "IC=Vm/ZT #Current through C(A)\n",
+ "VC=IC*XC #voltage across C(V)\n",
+ "thetac=180+thetaz #conduction angle(deg)\n",
+ "\n",
+ "#Result\n",
+ "print 'Capacitor reactance XC = ',round((XC/1000),2),'KOhm'\n",
+ "print 'impedance ZT = ',round((ZT/1000),2),'KOhm'\n",
+ "print 'firing angle = ',round(thetaz,2),'deg'\n",
+ "print 'Current through C, IC = ',round((IC*1000),2),'mA'\n",
+ "print 'voltage across C, VC = ',round(VC,2),'V'\n",
+ "print 'conduction angle = ',round(thetac,2),'deg'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitor reactance XC = 26.53 KOhm\n",
+ "impedance ZT = 37.14 KOhm\n",
+ "firing angle = -45.57 deg\n",
+ "Current through C, IC = 3.23 mA\n",
+ "voltage across C, VC = 85.7 V\n",
+ "conduction angle = 134.43 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-8, Page 546"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.8.py\n",
+ "#If the triac has fired, what is the approximate current through 22Ohm resistor?\n",
+ "\n",
+ "#Variable declaration\n",
+ "C=1*10**-6 #capacitance (F)\n",
+ "R1=22.0 #resistance (Ohm)\n",
+ "R2=82*10**3 #resistance(KOhm)\n",
+ "Vs=75 #input voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "I=Vs/R1 #current through 22Ohm resistor (A)\n",
+ "\n",
+ "#Result\n",
+ "print 'current through 22Ohm resistor I = ',round(I,2),'A'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current through 22Ohm resistor I = 3.41 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15-9, Page 547"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 15.9.py\n",
+ "#diac has breakover voltage of 32V. \n",
+ "#If the triac has a trigger voltage of 1V and a trigger current of 10mA, what is the Vc that triggers the triac?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vdb=32.0 #diac break down voltage (V)\n",
+ "VTT=1 #triac trigger voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vin=VTT+Vdb #input voltage for triggering triac\n",
+ "\n",
+ "#Result\n",
+ "print 'input voltage for triggering triac vin = ',Vin,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input voltage for triggering triac vin = 33.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_16_New.ipynb b/Electronic_Principles_/Chapter_16_New.ipynb
new file mode 100644
index 00000000..82ef1353
--- /dev/null
+++ b/Electronic_Principles_/Chapter_16_New.ipynb
@@ -0,0 +1,1046 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 16 Frequency Effets"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-1, Page 567"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.1.py\n",
+ "#Amplifier has midband Av of 200, with cutoff frequencies f1=20 Hz, f2=20KHz. \n",
+ "#Find voltage gain for 5Hz & 200KHz input frequencies.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Avm=200 #mid band voltage gain\n",
+ "f1=20 #cutoff frequency1 (Hz)\n",
+ "f2=20*10**3 #cutoff frequency2 (Hz)\n",
+ "fi1=5 #input frequency1(Hz)\n",
+ "fi2=200*10**3 #input frequency2(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=0.707*Avm #voltage gain at either frequency\n",
+ "Av1=Avm/(1+(f1/fi1)**2)**0.5 #voltage gain for 5Hz\n",
+ "Av2=Avm/(1+(fi2/f2)**2)**0.5 #voltage gain for 200KHz\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain for 200KHz = ',round(Av1,2)\n",
+ "print 'voltage gain for 5Hz = ',round(Av2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain for 200KHz = 48.51\n",
+ "voltage gain for 5Hz = 19.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-2, Page 568"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.2.py\n",
+ "#In figure 16-4a OP-Amp with midband Av of 100,000. \n",
+ "#if f2=10Hz, then what does frequency response look like? \n",
+ "\n",
+ "#Variable declaration\n",
+ "Avm=100000 #mid band voltage gain\n",
+ "f2=10 #cutoff frequency (Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=0.707*Avm #voltage gain at cutoff frequency\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain for 10Hz = ',Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain for 10Hz = 70700.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-3, Page 569"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.3.py\n",
+ "#In preceding example , what is Av if input frequencies: 100Hz, 1KHz, 10KHZ, 100 KHz, 1MHz?\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Avm=100000 #mid band voltage gain\n",
+ "fc=10.0 #cutoff frequency (Hz)\n",
+ "fi1=100.0 #input frequency1(Hz)\n",
+ "fi2=1*10**3 #input frequency2(Hz)\n",
+ "fi3=10*10**3 #input frequency3(Hz)\n",
+ "fi4=100*10**3 #input frequency4(Hz)\n",
+ "fi5=1*10**6 #input frequency5(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1=Avm/(1+(fi1/fc)**2)**0.5 #voltage gain for 100Hz\n",
+ "Av2=Avm/(1+(fi2/fc)**2)**0.5 #voltage gain for 1KHz\n",
+ "Av3=Avm/(1+(fi3/fc)**2)**0.5 #voltage gain for 10KHz\n",
+ "Av4=Avm/(1+(fi4/fc)**2)**0.5 #voltage gain for 100KHz\n",
+ "Av5=Avm/(1+(fi5/fc)**2)**0.5 #voltage gain for 1MHz\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain for 100Hz = ',math.ceil(Av1)\n",
+ "print 'voltage gain for 1KHz = ',math.ceil(Av2)\n",
+ "print 'voltage gain for 10KHz = ',math.ceil(Av3)\n",
+ "print 'voltage gain for 100KHz = ',math.ceil(Av4)\n",
+ "print 'voltage gain for 1MHz = ',math.ceil(Av5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain for 100Hz = 9951.0\n",
+ "voltage gain for 1KHz = 1000.0\n",
+ "voltage gain for 10KHz = 100.0\n",
+ "voltage gain for 100KHz = 10.0\n",
+ "voltage gain for 1MHz = 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-4, Page 571"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.4.py\n",
+ "#Calculate power gain(dB) for following values Ap=1,2,4,8\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ap1=1 #power gain1\n",
+ "Ap2=2 #power gain2\n",
+ "Ap3=4 #power gain3\n",
+ "Ap4=8 #power gain4\n",
+ "\n",
+ "#Calculation\n",
+ "Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)\n",
+ "Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)\n",
+ "Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)\n",
+ "Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)\n",
+ "\n",
+ "#Result\n",
+ "print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'\n",
+ "print 'decibel power gain Ap2(dB) = ',round(Ap_db2,2),'dB'\n",
+ "print 'decibel power gain Ap3(dB) = ',round(Ap_db3,2),'dB'\n",
+ "print 'decibel power gain Ap4(dB) = ',round(Ap_db4,2),'dB'\n",
+ "print 'Each time Ap increase by factor 2, decibel power gain increases by 3 dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decibel power gain Ap1(dB) = 0.0 dB\n",
+ "decibel power gain Ap2(dB) = 3.01 dB\n",
+ "decibel power gain Ap3(dB) = 6.02 dB\n",
+ "decibel power gain Ap4(dB) = 9.03 dB\n",
+ "Each time Ap increase by factor 2, decibel power gain increases by 3 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-5, Page 571"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.5.py\n",
+ "#Calculate decibel power gain for following values Ap=1,0.5,0.25,0.125\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ap1=1 #power gain1\n",
+ "Ap2=0.5 #power gain2\n",
+ "Ap3=0.25 #power gain3\n",
+ "Ap4=0.125 #power gain4\n",
+ "\n",
+ "#Calculation\n",
+ "Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)\n",
+ "Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)\n",
+ "Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)\n",
+ "Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)\n",
+ "\n",
+ "#Result\n",
+ "print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'\n",
+ "print 'decibel power gain Ap2(dB) = ',round(Ap_db2,2),'dB'\n",
+ "print 'decibel power gain Ap3(dB) = ',round(Ap_db3,2),'dB'\n",
+ "print 'decibel power gain Ap4(dB) = ',round(Ap_db4,2),'dB'\n",
+ "print 'Each time Ap decreases by factor 2, decibel power gain decreases by 3 dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decibel power gain Ap1(dB) = 0.0 dB\n",
+ "decibel power gain Ap2(dB) = -3.01 dB\n",
+ "decibel power gain Ap3(dB) = -6.02 dB\n",
+ "decibel power gain Ap4(dB) = -9.03 dB\n",
+ "Each time Ap decreases by factor 2, decibel power gain decreases by 3 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-6, Page 572"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.6.py\n",
+ "#Calculate decibel power gain for following values Ap=1,10,100,1000\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ap1=1 #power gain1\n",
+ "Ap2=10 #power gain2\n",
+ "Ap3=100 #power gain3\n",
+ "Ap4=1000 #power gain4\n",
+ "\n",
+ "#Calculation\n",
+ "Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)\n",
+ "Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)\n",
+ "Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)\n",
+ "Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)\n",
+ "\n",
+ "#Result\n",
+ "print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'\n",
+ "print 'decibel power gain Ap2(dB) = ',Ap_db2,'dB'\n",
+ "print 'decibel power gain Ap3(dB) = ',Ap_db3,'dB'\n",
+ "print 'decibel power gain Ap4(dB) = ',Ap_db4,'dB'\n",
+ "print 'Each time Ap increases by factor 10, decibel power gain increases by 10 dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decibel power gain Ap1(dB) = 0.0 dB\n",
+ "decibel power gain Ap2(dB) = 10.0 dB\n",
+ "decibel power gain Ap3(dB) = 20.0 dB\n",
+ "decibel power gain Ap4(dB) = 30.0 dB\n",
+ "Each time Ap increases by factor 10, decibel power gain increases by 10 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-7, Page 572"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.7.py\n",
+ "#Calculate decibel power gain for following values Ap=1,0.1,0.01,0.001\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ap1=1 #power gain1\n",
+ "Ap2=0.1 #power gain2\n",
+ "Ap3=0.01 #power gain3\n",
+ "Ap4=0.001 #power gain4\n",
+ "\n",
+ "#Calculation\n",
+ "Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)\n",
+ "Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)\n",
+ "Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)\n",
+ "Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)\n",
+ "\n",
+ "#Result\n",
+ "print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'\n",
+ "print 'decibel power gain Ap2(dB) = ',Ap_db2,'dB'\n",
+ "print 'decibel power gain Ap3(dB) = ',Ap_db3,'dB'\n",
+ "print 'decibel power gain Ap4(dB) = ',Ap_db4,'dB'\n",
+ "print 'Each time Ap decreases by factor 10, decibel power gain decreases by 10 dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decibel power gain Ap1(dB) = 0.0 dB\n",
+ "decibel power gain Ap2(dB) = -10.0 dB\n",
+ "decibel power gain Ap3(dB) = -20.0 dB\n",
+ "decibel power gain Ap4(dB) = -30.0 dB\n",
+ "Each time Ap decreases by factor 10, decibel power gain decreases by 10 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-8, Page 575"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.8.py\n",
+ "#What is total voltage gain in decibels?\n",
+ "#find decibel voltage gain of each stage and total.\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av1=100 #voltage gain1\n",
+ "Av2=200 #voltage gain2\n",
+ "\n",
+ "#Calculation\n",
+ "Av=Av1*Av2 #total voltage gain\n",
+ "Av_db=20*math.log10(Av) #decibel total voltage gain(dB)\n",
+ "Av_db1=20*math.log10(Av1) #decibel voltage gain(dB)\n",
+ "Av_db2=20*math.log10(Av2) #decibel voltage gain(dB)\n",
+ "Avt_db=Av_db1+Av_db2 #decibel total voltage gain(dB)\n",
+ "\n",
+ "#Result \n",
+ "print 'decibel total voltage gain Av(dB) = ',round(Av_db,2),'dB'\n",
+ "print 'decibel voltage gain Av1(dB) = ',Av_db1,'dB'\n",
+ "print 'decibel voltage gain Av2(dB) = ',round(Av_db2,2),'dB'\n",
+ "print 'so, again, decibel total voltage gain by addition of both: Avt(dB) = ',round(Avt_db,2),'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decibel total voltage gain Av(dB) = 86.02 dB\n",
+ "decibel voltage gain Av1(dB) = 40.0 dB\n",
+ "decibel voltage gain Av2(dB) = 46.02 dB\n",
+ "so, again, decibel total voltage gain by addition of both: Avt(dB) = 86.02 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-9, Page 577"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.9.py\n",
+ "#Impedance matched stages with R=50 Ohm. \n",
+ "#Find total decibel gain, total power gain & total voltage gain.\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av_db1=23 #voltage gain1(dB)\n",
+ "Av_db2=36 #voltage gain2(dB)\n",
+ "Av_db3=31 #voltage gain3(dB)\n",
+ "\n",
+ "#Calculation\n",
+ "Avt_db=Av_db1+Av_db2+Av_db3 #decibel total voltage gain(dB)\n",
+ "Ap=10**(Avt_db/10) #power gain by taking antilog\n",
+ "Avt=10**(Avt_db/20.0) #total voltage gain by taking antilog\n",
+ "\n",
+ "#Result \n",
+ "print 'decibel total voltage gain Avt(dB) = ',Avt_db,'dB'\n",
+ "print 'power gain Ap = ',Ap\n",
+ "print 'total voltage gain Avt = ',math.ceil(Avt)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decibel total voltage gain Avt(dB) = 90 dB\n",
+ "power gain Ap = 1000000000\n",
+ "total voltage gain Avt = 31623.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-10, Page 577"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.10.py\n",
+ "#In preceding example, What is ordinary Av of each stage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av_db1=23 #voltage gain1(dB)\n",
+ "Av_db2=36 #voltage gain2(dB)\n",
+ "Av_db3=31 #voltage gain3(dB)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1=10**(Av_db1/20.0) #voltage gain of stage 1 by taking antilog\n",
+ "Av2=10**(Av_db2/20.0) #voltage gain of stage 2 by taking antilog\n",
+ "Av3=10**(Av_db3/20.0) #voltage gain of stage 3 by taking antilog\n",
+ "\n",
+ "#Result \n",
+ "print 'voltage gain of stage 1 : Av1 = ',round(Av1,2)\n",
+ "print 'voltage gain of stage 1 : Av2 = ',round(Av2,2)\n",
+ "print 'voltage gain of stage 1 : Av3 = ',round(Av3,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain of stage 1 : Av1 = 14.13\n",
+ "voltage gain of stage 1 : Av2 = 63.1\n",
+ "voltage gain of stage 1 : Av3 = 35.48\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-11, Page 579"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.11.py\n",
+ "#Output of an amplifier is 24 dBm. What is output power?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ap_dbm=24 #power gain(dBm)\n",
+ "\n",
+ "#Calculation\n",
+ "P=10**(Ap_dbm/10.0) #Output power(mW)\n",
+ "\n",
+ "#Result \n",
+ "print 'Output power P = ',round(P,2),'mW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output power P = 251.19 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-12, Page 580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.12.py\n",
+ "#Output of an amplifier is -34 dBV. What is output voltage?\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av_dbV=-34 #voltage gain(dBV)\n",
+ "\n",
+ "#Calculation\n",
+ "V=10**(Av_dbV/20.0) #Output voltage(V)\n",
+ "\n",
+ "#Result \n",
+ "print 'Output voltage V = ',math.ceil(V*1000),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage V = 20.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-13, Page 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.13.py\n",
+ "#OP-Amp gives midband Av of 100,000. \n",
+ "#a cutoff f=10Hz, and roll off rate of 20 dB per decade. find ordinary voltage gain at 1MHz.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Avm=100000 #mid band voltage gain\n",
+ "f2=10 #cutoff frequency (Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Av_db=20*math.log10(Avm) #decibel total voltage gain(dB)\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain for 10Hz = ',Av_db1,'dB'\n",
+ "print 'At 1MHz, due to roll off factor of 20 dB, voltage gain reduce to 0 dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain for 10Hz = 20.0 dB\n",
+ "At 1MHz, due to roll off factor of 20 dB, voltage gain reduce to 0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-14, Page 588"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.14.py\n",
+ "#Draw ideal bode plot for lag circuit of figure 16-18a.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=5*10**3 #resistance(Ohm)\n",
+ "C=100*10**-12 #Capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "f2=(2*math.pi*R*C)**-1 #cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'cutoff frequency f2 = ',round((f2/1000),2),'KHz'\n",
+ "print 'After f2, response rolls off at rate of 20 dB/decade'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cutoff frequency f2 = 318.31 KHz\n",
+ "After f2, response rolls off at rate of 20 dB/decade\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-15, Page 589"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.15.py\n",
+ "#dc amplifier stage has a midband Av of 100. \n",
+ "#If RTH facing bypass capacitor is 2KOhm. What is the ideal bode plot?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=2*10**3 #resistance(Ohm)\n",
+ "C=500*10**-12 #Capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "f2=(2*math.pi*R*C)**-1 #cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'cutoff frequency f2 = ',round((f2/1000),2),'KHz'\n",
+ "print 'After f2, response rolls off at rate of 20 dB/decade up to funity of 15.9 MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cutoff frequency f2 = 159.15 KHz\n",
+ "After f2, response rolls off at rate of 20 dB/decade up to funity of 15.9 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-17, Page 592"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.17.py\n",
+ "#The amplifier of figure 16-22a has a Av of 100,000.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=5.3*10**3 #resistance(Ohm)\n",
+ "C=30*10**-12 #Capacitance (F)\n",
+ "Av=100000 #voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "Cout_M=C #input Miller Capacitance (F)\n",
+ "Cin_M=Av*C #input Miller Capacitance (F)\n",
+ "f2=(2*math.pi*R*Cin_M)**-1 #cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'cutoff frequency f2 = ',round(f2,3),'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cutoff frequency f2 = 10.01 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-18, Page 595"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.18.py\n",
+ "#What is upper cutoff frequency for circuit shown in figure 16-24a?\n",
+ "\n",
+ "#Variable declaration\n",
+ "TR=1*10**-6 #rise time(s)\n",
+ "\n",
+ "#Calculation\n",
+ "f2=0.35/TR #cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'cutoff frequency f2 = ',f2/1000,'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cutoff frequency f2 = 350.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-19, Page 597"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.19.py\n",
+ "#calculate low-cutoff frequency for each coupling and by-pass capacitor. \n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #from past dc calculation (example:9-5)(Ohm)\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "RL=10 #Load resistance2 (KOhm)\n",
+ "B=150 #current gain\n",
+ "RG=0.6 #source resistance(KOhm)\n",
+ "C1=0.47*10**-6 #input capacitance(F)\n",
+ "C3=2.2*10**-6 #output capacitance(F)\n",
+ "C2=10*10**-6 #emitter capacitance(F)\n",
+ "\n",
+ "#Calculation\n",
+ "Rinb=B*re/1000 #Rin(base) (KOhm)\n",
+ "Ri=RG+((R1**-1)+(Rinb**-1)+(R2**-1))**-1 #thevenin resistance facing i/p capacitor\n",
+ "f1i=((2*math.pi*Ri*C1)**-1)/1000 #input cutoff frequency (Hz)\n",
+ "Ro=RC+RL #thevenin resistance facing o/p capacitor\n",
+ "f1o=((2*math.pi*Ro*C3)**-1)/1000 #output cutoff frequency (Hz)\n",
+ "Zout=(((RE**-1)+((re/1000)**-1))**-1)+((((R1**-1)+(R2**-1)+(RG**-1))**-1)/B) #thevenin resistance facing emitter-bypass capacitor\n",
+ "f1z=((2*math.pi*Zout*C2)**-1)/1000 #cutoff frequency for bypass circuit (Hz)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print 'input cutoff frequency f1 = ',round(f1i,2),'Hz'\n",
+ "print 'output cutoff frequency f1 = ',round(f1o,2),'Hz'\n",
+ "print 'cutoff frequency for bypass circuit f1 = ',round(f1z,2),'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input cutoff frequency f1 = 190.36 Hz\n",
+ "output cutoff frequency f1 = 5.32 Hz\n",
+ "cutoff frequency for bypass circuit f1 = 631.63 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-20, Page 602"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.20.py\n",
+ "#calculate high cutoff frequency for base bypass and collector bypass circuit. \n",
+ "#B=150 & Cstray=10pF.\n",
+ "\n",
+ "import math # This will import math module\n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #from past dc calculation (example:9-5)(Ohm)\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "R11=10 #Base resistance1 (KOhm)\n",
+ "R12=2.2 #Base resistance2 (KOhm)\n",
+ "RL=10 #Load resistance2 (KOhm)\n",
+ "B=150 #current gain\n",
+ "RG=0.6 #source resistance(KOhm)\n",
+ "fT=300*10**6 #current gain bandwidth product(Hz)\n",
+ "CC1=2.1*10**-12 #Cc' capacitance(F)\n",
+ "Cs=10*10**-12 #stray capacitance(F)\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Rinb=B*re/1000 #Rin(base) (KOhm)\n",
+ "Ce1=((2*math.pi*re*fT)**-1) #capacitance Ce'(F)\n",
+ "rc=RC*RL/(RC+RL) #collector resistance(KOhm) \n",
+ "rg=((R11**-1)+(RG**-1)+(R12**-1))**-1 #source resistance (Ohm)\n",
+ "Av=math.ceil(1000*rc/re) #voltage gain\n",
+ "Cin_M=CC1*(Av+1) #input Miller capacitance(F)\n",
+ "C1=Ce1+Cin_M #base bypass capacitance(F)\n",
+ "R1=int(1000*rg*Rinb/(rg+Rinb)) #resistance facing this capacitance(Ohm) \n",
+ "f2=((2*math.pi*R1*C1)**-1) #base bypass circuit cutoff frequency (Hz)\n",
+ "Cout_M=CC1*((Av+1)/Av) #output Miller capacitance(F)\n",
+ "C2=Cout_M+Cs #output bypass capacitance(F)\n",
+ "R2=1000*RC*RL/(RC+RL) #resistance facing this capacitance(Ohm)\n",
+ "f21=((2*math.pi*R2*C2)**-1) #collector bypass circuit cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'base bypass circuit cutoff frequency f2 = ',round((f2/10**6),2),'MHz'\n",
+ "print 'collector bypass circuit cutoff frequency f21 = ',round((f21/10**6),2),'MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "base bypass circuit cutoff frequency f2 = 1.48 MHz\n",
+ "collector bypass circuit cutoff frequency f21 = 4.96 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-21, Page 605"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.21.py\n",
+ "#Determine input-coupling & output coupling circuit low-frequency cutoff points.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "re=22.7 #from past dc calculation (example:9-5)(Ohm)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "R1=2*10**6 #Base resistance1 (Ohm)\n",
+ "R2=1*10**6 #Base resistance2 (Ohm)\n",
+ "RD=150 #drain resistance(Ohm) \n",
+ "RL=1*10**3 #Load resistance2 (Ohm)\n",
+ "RG=0.6*10**3 #source resistance(Ohm)\n",
+ "Cin=0.1*10**-6 #Cin capacitance(F)\n",
+ "Cout=10*10**-6 #Cout capacitance(F)\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Rthi=RG+((R1**-1)+(R2**-1))**-1 #Thevenin resistance facing input coupling capacitor resistance (Ohm)\n",
+ "f1=((2*math.pi*Rthi*Cin)**-1) #base bypass circuit cutoff frequency (Hz)\n",
+ "Rtho=RD+RL #Thevenin resistance facing output coupling capacitor resistance (Ohm)\n",
+ "f2=((2*math.pi*Rtho*Cout)**-1) #base bypass circuit cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'base bypass circuit cutoff frequency f1 = ',round(f1,2),'Hz'\n",
+ "print 'collector bypass circuit cutoff frequency f2 = ',round(f2,2),'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "base bypass circuit cutoff frequency f1 = 2.39 Hz\n",
+ "collector bypass circuit cutoff frequency f2 = 13.84 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16-22, Page 606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 16.22.py\n",
+ "#In figure 16-32, capacitances are: Ciss=60 pF, Coss=25 pF, Crss=5 pF.\n",
+ "#gm=97mS then find high frequency cut off values for gate & drain circuits.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ciss=60 #Capacitance Ciss (pF)\n",
+ "Coss=25 #Capacitance Coss (pF)\n",
+ "Crss=5 #Capacitance Crss (pF)\n",
+ "gm=93*10**-3 #gm (S)\n",
+ "R1=2*10**6 #resiatance 1(Ohm)\n",
+ "R2=1*10**6 #resiatance 2(Ohm)\n",
+ "RG=600 #resiatance(Ohm)\n",
+ "RD=150 #resiatance(Ohm)\n",
+ "RL=1*10**3 #load resiatance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Cgd=Crss #Internal Capacitance Cgd (pF)\n",
+ "Cgs=Ciss-Crss #Internal Capacitance Cgs (pF)\n",
+ "Cds=Coss-Crss #Internal Capacitance Cds (pF)\n",
+ "rd=((RD**-1)+(RL**-1))**-1 #rd (Ohm)\n",
+ "Av=gm*rd #voltage gain\n",
+ "Cin_M=Cgd*(Av+1) #Cin(M) (pF)\n",
+ "C=Cgs+Cin_M #gate bypass capacitance (pF)\n",
+ "R=((R1**-1)+(R2**-1)+(RG**-1))**-1 #resistance (Ohm)\n",
+ "f2=((2*math.pi*R*C*10**-12)**-1) #gate bypass cutoff frequency (Hz)\n",
+ "Cout_M=Cgd*((Av+1)/Av) #Cout(M) (pF)\n",
+ "C1=Cds+Cout_M #drain bypass capacitance(pF)\n",
+ "f21=((2*math.pi*rd*C1*10**-12)**-1) #drain bypass cutoff frequency (Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'Gate bypass cutoff frequency = ',round(f2*10**-6,2),'MHz'\n",
+ "print 'Drain bypass cutoff frequency = ',round(f21*10**-6,2),'MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gate bypass cutoff frequency = 2.2 MHz\n",
+ "Drain bypass cutoff frequency = 48.02 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_17_New.ipynb b/Electronic_Principles_/Chapter_17_New.ipynb
new file mode 100644
index 00000000..3de7e129
--- /dev/null
+++ b/Electronic_Principles_/Chapter_17_New.ipynb
@@ -0,0 +1,689 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 17 DIFFERENTIAL AMPLIFIERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-1, Page 625"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.1.py\n",
+ "#What are the ideal currents & voltages in figure 17-6a?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #supply voltage(V)\n",
+ "RE=7.5 #Emitter resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "IT=VCC/RE #tail current (mA)\n",
+ "IE=IT/2 #emitter current (mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'tail current = ',IT,'mA'\n",
+ "print 'emitter current = ',IE,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tail current = 2.0 mA\n",
+ "emitter current = 1.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-2, Page 626"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.2.py\n",
+ "#Recalculate the currents and voltages for figure 17-6a using second approximation.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #supply voltage(V)\n",
+ "RE=7.5 #Emitter resistance(KOhm)\n",
+ "VBE=0.7 #base-emitter voltage(V)\n",
+ "RC=5 #collector resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "IT=(VCC-VBE)/RE #tail current (mA)\n",
+ "IE=IT/2 #emitter current (mA)\n",
+ "VC=VCC-(IE*RC) #collector quiescent voltage(V) \n",
+ "\n",
+ "#Result\n",
+ "print 'tail current = ',round(IT,2),'mA'\n",
+ "print 'emitter current = ',round(IE,2),'mA'\n",
+ "print 'collector quiescent voltage VC = ',round(VC,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tail current = 1.91 mA\n",
+ "emitter current = 0.95 mA\n",
+ "collector quiescent voltage VC = 10.23 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-3, Page 626"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.3.py\n",
+ "#What are the ideal currents & voltages in figure 17-7a?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #supply voltage(V)\n",
+ "RE=5.0 #Emitter resistance(KOhm)\n",
+ "RC=3.0 #collector resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "IT=VCC/RE #tail current (mA)\n",
+ "IE=IT/2 #emitter current (mA)\n",
+ "VC=VCC-(IE*RC) #collector quiescent voltage(V) \n",
+ "#with second approximation,\n",
+ "IT1=(VCC-VBE)/RE #tail current (mA)\n",
+ "IE1=IT1/2 #emitter current (mA)\n",
+ "VC1=VCC-(IE1*RC) #collector quiescent voltage(V) \n",
+ "\n",
+ "#Result\n",
+ "print 'tail current = ',IT,'mA'\n",
+ "print 'emitter current = ',IE,'mA'\n",
+ "print 'collector quiescent voltage VC = ',VC,'V'\n",
+ "print 'with second approximation,'\n",
+ "print 'tail current = ',IT1,'mA'\n",
+ "print 'emitter current = ',IE1,'mA'\n",
+ "print 'collector quiescent voltage VC = ',VC1,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "tail current = 2.4 mA\n",
+ "emitter current = 1.2 mA\n",
+ "collector quiescent voltage VC = 8.4 V\n",
+ "with second approximation,\n",
+ "tail current = 2.26 mA\n",
+ "emitter current = 1.13 mA\n",
+ "collector quiescent voltage VC = 8.61 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 92
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-4, Page 631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.4.py\n",
+ "#In figure 17-11, what is the ac output voltage? If B = 300, what is input impedance?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #supply voltage(V)\n",
+ "RE=7.5 #Emitter resistance(KOhm)\n",
+ "RC=5.0 #collector resistance(KOhm)\n",
+ "IE=1 #emitter current as per preceding example(mA)\n",
+ "Vin=1 #input ac voltage(mV)\n",
+ "B=300 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "re=25/IE #ac emitter resistance(Ohm)\n",
+ "Av=1000*RC/re #voltage gain\n",
+ "Vout=Av*Vin #Output voltage(mV)\n",
+ "Zinb=2*B*re #input impedance of diff amp(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain Av = ',Av\n",
+ "print 'Output voltage Vout = ',Vout,'mV'\n",
+ "print 'input impedance of diff amplifier, Zin(base) = ',Zinb/1000,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain Av = 200.0\n",
+ "Output voltage Vout = 200.0 mV\n",
+ "input impedance of diff amplifier, Zin(base) = 15 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-5, Page 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.5.py\n",
+ "#Repeat preceding example using second approximation to calculate ICQ.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #supply voltage(V)\n",
+ "RE=7.5 #Emitter resistance(KOhm)\n",
+ "RC=5.0 #collector resistance(KOhm)\n",
+ "IE=0.955 #emitter current as per previous example(mA)\n",
+ "Vin=1 #input ac voltage(mV)\n",
+ "B=300 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "re=25/IE #ac emitter resistance(Ohm)\n",
+ "Av=1000*RC/re #voltage gain\n",
+ "Vout=Av*Vin #Output voltage(mV)\n",
+ "Zinb=2*B*re #input impedance of diff amp(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain Av = ',Av\n",
+ "print 'Output voltage Vout = ',Vout,'mV'\n",
+ "print 'input impedance of diff amplifier, Zin(base) = ',round((Zinb/1000),2),'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain Av = 191.0\n",
+ "Output voltage Vout = 191.0 mV\n",
+ "input impedance of diff amplifier, Zin(base) = 15.71 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-6, Page 633"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.6.py\n",
+ "#Repeat example 17-4 for v2=1mV & v1=0.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #supply voltage(V)\n",
+ "RE=7.5 #Emitter resistance(KOhm)\n",
+ "RC=5.0 #collector resistance(KOhm)\n",
+ "IE=1 #emitter current as per preceding example(mA)\n",
+ "V2=1 #input ac voltage(mV)\n",
+ "B=300 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "re=25/IE #ac emitter resistance(Ohm)\n",
+ "Av=1000*RC/re #voltage gain\n",
+ "Vout=Av*V2 #Output voltage(mV)\n",
+ "Zinb=2*B*re #input impedance of diff amp(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'V2 input is at inverting input, So, ideally same as previous case.'\n",
+ "print 'Voltage gain Av = ',Av\n",
+ "print 'Output voltage Vout = ',Vout,'mV'\n",
+ "print 'input impedance of diff amplifier, Zin(base) = ',Zinb/1000,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V2 input is at inverting input, So, ideally same as previous case.\n",
+ "Voltage gain Av = 200.0\n",
+ "Output voltage Vout = 200.0 mV\n",
+ "input impedance of diff amplifier, Zin(base) = 15 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 96
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-7, Page 633"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.7.py\n",
+ "#What is ac output voltage in figure 17-12? if B=300, what is input impedance?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #supply voltage(V)\n",
+ "RC=1.0**10**6 #collector resistance(Ohm)\n",
+ "RE=1.0**10**6 #emitter resistance(Ohm)\n",
+ "IE=1 #emitter current as per preceding example(mA)\n",
+ "Vin=7 #input ac voltage(mV)\n",
+ "B=300 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "IT=VCC/RE #tail current (uA)\n",
+ "IE=IT/2 #emitter current (uA)\n",
+ "re=25/IE/1000 #ac emitter resistance(Ohm)\n",
+ "Av=RC/(2*re) #voltage gain\n",
+ "Vout=Av*Vin #Output voltage(V)\n",
+ "Zinb=2*B*re #input impedance of diff amp(MOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Voltage gain Av = ',Av\n",
+ "print 'Output voltage Vout = ',Vout/1000,'V'\n",
+ "print 'input impedance of diff amplifier, Zin(base) = ',Zinb,'MOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain Av = 150.0\n",
+ "Output voltage Vout = 1.05 V\n",
+ "input impedance of diff amplifier, Zin(base) = 2.0 MOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 97
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-8, Page 639"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.8.py\n",
+ "#The diff amp of figure 17-17 has Av=200, Iin(bias)=3uA, Iin(off) =0.5 uA. and Vin(off)= 1mV. What is output error voltage?\n",
+ "#what is output error voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #supply voltage(V)\n",
+ "RC=5.0*10**3 #collector resistance(Ohm)\n",
+ "RE=7.5*10**3 #emitter resistance(Ohm)\n",
+ "RB=1*10**3 #base resistance(Ohm)\n",
+ "Vin=10 #input ac voltage(mV)\n",
+ "Av=200 #voltage gain\n",
+ "Iinb=3*10**-6 #bias current(A)\n",
+ "Iino =0.5*10**-6 #Iin(off) (A) \n",
+ "Vino=1.0 #Vin(off) (mV)\n",
+ "\n",
+ "#Calculation\n",
+ "V1err=RB*Iinb*1000 #dc error input1 (mV)\n",
+ "V2err=RB*(Iino/2)*1000 #dc error input2 (mV)\n",
+ "V3err=Vino #dc error input3 (mV)\n",
+ "Verror=Av*(V1err+V2err+V3err) #output error voltage(mV)\n",
+ "#if matching base resistor is used,\n",
+ "V1err1=0 #dc error input1 (mV)\n",
+ "V2err1=RB*Iino*1000 #dc error input2 (mV)\n",
+ "V3err1=Vino #dc error input3 (mV)\n",
+ "Verror1=Av*(V1err1+V2err1+V3err1) #output error voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output error voltage Verror = ',Verror,'mV'\n",
+ "print 'output error voltage Verror = ',Verror1,'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output error voltage Verror = 850.0 mV\n",
+ "output error voltage Verror = 300.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-9, Page 640"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.9.py\n",
+ "#The diff amp of figure 17-18 has Av=300, Iin(bias)=80nA, Iin(off) =20 nA. and Vin(off)= 5mV. What is output error voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #supply voltage(V)\n",
+ "RC=1.0*10**6 #collector resistance(Ohm)\n",
+ "RE=1.0*10**6 #emitter resistance(Ohm)\n",
+ "RB=10*10**3 #base resistance(Ohm)\n",
+ "Vin=10 #input ac voltage(mV)\n",
+ "Av=300 #voltage gain\n",
+ "Iinb=80*10**-9 #bias current(A)\n",
+ "Iino=20*10**-9 #Iin(off) (A) \n",
+ "Vino=5.0 #Vin(off) (mV)\n",
+ "\n",
+ "#Calculation\n",
+ "V1err=0 #dc error input1 (mV)\n",
+ "V2err=RB*(Iino/2)*1000 #dc error input2 (mV)\n",
+ "V3err=Vino #dc error input3 (mV)\n",
+ "Verror=Av*(V1err+V2err+V3err) #output error voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output error voltage Verror = ',Verror/1000,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output error voltage Verror = 1.53 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 98
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-10, Page 643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.10.py\n",
+ "#In figure 17-2, what is common-node voltage gain & output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #supply voltage(V)\n",
+ "RC=1.0*10**6 #collector resistance(Ohm)\n",
+ "RE=1.0*10**6 #emitter resistance(Ohm)\n",
+ "Vin=1 #input ac voltage(mV)\n",
+ "\n",
+ "#Calculation\n",
+ "Av_CM=RC/(2*RE) #common mode voltage gain\n",
+ "Vout=Av_CM*Vin #output voltage(mV) \n",
+ "\n",
+ "#Result \n",
+ "print 'common mode voltage gain : Av(CM) = ',Av_CM\n",
+ "print 'Output voltage Vout = ',Vout,'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "common mode voltage gain : Av(CM) = 0.5\n",
+ "Output voltage Vout = 0.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-11, Page 643"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.11.py\n",
+ "#In figure 17-22 has Av=150, Av(CM)=0.5, Vin =1 mV. \n",
+ "#If base leads are picking up a common-mode signal of 1mV, what is the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=1 #input ac voltage(mV)\n",
+ "Av=150 #voltage gain\n",
+ "Av_CM=0.5 #common mode voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "Vout1=Av*Vin #output voltage1(mV)\n",
+ "Vout2=Av_CM*Vin #output voltage2(mV)\n",
+ "Vout=Vout1+Vout2 #output volatge(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout1 = ',Vout1,'mV'\n",
+ "print 'output voltage Vout2 = ',Vout2,'mV'\n",
+ "print 'output voltage Vout = ',Vout,'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout1 = 150 mV\n",
+ "output voltage Vout2 = 0.5 mV\n",
+ "output voltage Vout = 150.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-12, Page 644"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.12.py\n",
+ "#OP-AMP with Av=2,00,000 & CMRR(dB)=90dB. what is the common mode voltage gain? \n",
+ "#If desired & common-mode signal is of 1uV, what is the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "CMRR_dB=90 #CMRR(dB)\n",
+ "Av=200000 #voltage gain\n",
+ "Vin=1*10**-6 #input voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "CMRR=10**(CMRR_dB/20.0) #CMRR \n",
+ "Av_CM=Av/CMRR #common mode voltage gain \n",
+ "Vout1=Av*Vin #desired output: voltage1(V)\n",
+ "Vout2=Av_CM*Vin #common mode output: voltage2(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'output voltage Vout1 = ',Vout1,'V'\n",
+ "print 'output voltage Vout2 = ',round((Vout2*10**6),2),'uV'\n",
+ "print 'see, desired output is much larger than common mode output.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage Vout1 = 0.2 V\n",
+ "output voltage Vout2 = 6.32 uV\n",
+ "see, desired output is much larger than common mode output.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-13, Page 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.13.py\n",
+ "#What is load voltage in figure 17-32a when RL=15KOhm?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #supply voltage(V)\n",
+ "RC=7.5*10**3 #collector resistance(Ohm)\n",
+ "RE=7.5*10**3 #emitter resistance(Ohm)\n",
+ "V1=10 #input ac voltage(mV)\n",
+ "re=25 #as per example 17-4 (Ohm) \n",
+ "RL=15*10**3 #load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=RC/re #voltage gain\n",
+ "Vout=Av*V1/1000 #output voltage(V) \n",
+ "RTH=2*RC #Thevenin resistance(Ohm)\n",
+ "VL=(RL/(RL+RTH))*Vout #load voltage(V)\n",
+ "\n",
+ "#Result \n",
+ "print 'Load voltage VL = ',VL,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load voltage VL = 1.5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-14, Page 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 17.14.py\n",
+ "#An ammeter is used for load resistance. find current through the ammeter?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RL=15.0 #load resistance as per previous example(Ohm)\n",
+ "VL=3 #load voltage as per previous example(V)\n",
+ "\n",
+ "#Calculation\n",
+ "iL=VL/RL #load current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load current iL = ',iL,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load current iL = 0.2 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_18_New.ipynb b/Electronic_Principles_/Chapter_18_New.ipynb
new file mode 100644
index 00000000..1fbf3765
--- /dev/null
+++ b/Electronic_Principles_/Chapter_18_New.ipynb
@@ -0,0 +1,641 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 18 OPERATIONAL AMPLIFIERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-1, Page 672"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.1.py\n",
+ "#How much inverting input voltage required to drive the 741C of figure 18-11a into negative saturation?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vout=13.5 #As per figure 18-7b(V)\n",
+ "Aov=100000 #open loop voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vout/Aov #required input voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Required input voltage V2 = ',V2*10**6,'uV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required input voltage V2 = 135.0 uV\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-2, Page 672"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.2.py\n",
+ "#What is the CMRR of a 741C when the input frequency is 100KHz?\n",
+ "\n",
+ "#Variable declaration\n",
+ "CMRR_dB=40 #As per figure 18-7a at 100KHz(dB)\n",
+ "\n",
+ "#Calculation\n",
+ "CMRR=10**(CMRR_dB/20)\n",
+ "\n",
+ "#Result\n",
+ "print 'Common-mode rejection ratio = ',CMRR"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Common-mode rejection ratio = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-3, Page 673"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.3.py\n",
+ "#what is the open loop voltage gain of 741C when input frequency is 1KHz? 10KHZ? 100KHz?\n",
+ "\n",
+ "#Variable declaration / Calculation\n",
+ "\n",
+ "Av1=1000 #Voltage gain as per figure 18-7c for 1KHZ\n",
+ "Av10=100 #Voltage gain as per figure 18-7c for 10KHZ\n",
+ "Av100=10 #Voltage gain as per figure 18-7c for 100KHZ\n",
+ "\n",
+ "#Result\n",
+ "print 'Voltage gain for 1KHZ = ',Av1\n",
+ "print 'Voltage gain for 1KHZ = ',Av10\n",
+ "print 'Voltage gain for 1KHZ = ',Av100"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain for 1KHZ = 1000\n",
+ "Voltage gain for 1KHZ = 100\n",
+ "Voltage gain for 1KHZ = 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-4, Page 673"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.4.py\n",
+ "#the output changes to 0.25 V in 0.1us. What is te slew rate of the op amp?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vout=0.25 #output changes in 0.1us (V)\n",
+ "t=0.1 #time for output change(us) \n",
+ "\n",
+ "#Calculation\n",
+ "SR=Vout/t #slew rate(V/us)\n",
+ "\n",
+ "#Result\n",
+ "print 'Slew rate SR = ',SR,'V/us'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Slew rate SR = 2.5 V/us\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-5, Page 673"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.5.py\n",
+ "#The LF411A has a slew ratwe of 15 V/us. what is power bandwidth for peak output voltage of 10V?\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "SR=15 #slew rate(V/us)\n",
+ "Vp=10 #Peak output voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "fmax=1000*SR/(2*math.pi*Vp) #power bandwidth (KHz) \n",
+ "\n",
+ "#Result\n",
+ "print 'Power bandwidth = ',round(fmax),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power bandwidth = 239.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-6, Page 673"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.6.py\n",
+ "#What is the power bandwidth for each of following?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "SR1=0.5 #Slew rate1(V/us)\n",
+ "SR2=5 #Slew rate2(V/us)\n",
+ "SR3=50 #Slew rate3(V/us)\n",
+ "Vp=8 #peak voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "fmax1=1000*SR1/(2*math.pi*Vp) #power bandwidth1 (KHz) \n",
+ "fmax2=1000*SR2/(2*math.pi*Vp) #power bandwidth2 (KHz) \n",
+ "fmax3=SR3/(2*3*math.pi*Vp) #power bandwidth3 (MHz) \n",
+ "\n",
+ "#Result\n",
+ "print 'Power bandwidth1 = ',math.ceil(fmax1),'KHz'\n",
+ "print 'Power bandwidth2 = ',math.ceil(fmax2),'KHz'\n",
+ "print 'Power bandwidth3 = ',math.ceil(fmax3),'MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power bandwidth1 = 10.0 KHz\n",
+ "Power bandwidth2 = 100.0 KHz\n",
+ "Power bandwidth3 = 1.0 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-7, Page 678"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.7.py\n",
+ "#What are closed-loop voltage gain and bandwidth? what is output voltage at 1KHz & 1MHz?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #input voltage(mV)\n",
+ "Rf=75 #feedback path resistance Rf (KOhm)\n",
+ "R1=1.5 #inverting input resistance R1(KOhm)\n",
+ "Funity=1 #Funity (MHz)\n",
+ "\n",
+ "#Calculation\n",
+ "Av_CL=-Rf/R1 #closed loop voltage gain\n",
+ "f2_CL1=Funity/-Av_CL #closed loop bandwidth1(KHz)\n",
+ "Vout1=Av_CL*Vin #output voltage1(mV)\n",
+ "Vout2=-Vin #output voltage2(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage for 1KHz = ',Vout1,'mVpp'\n",
+ "print 'Output voltage for 1MHz = ',Vout2,'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage for 1KHz = -500.0 mVpp\n",
+ "Output voltage for 1MHz = -10 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-8, Page 679"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.8.py\n",
+ "#What is output voltage in figure 18-17 when Vin=0?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #input voltage(mV)\n",
+ "Rf=75 #feedback path resistance Rf (KOhm)\n",
+ "R1=1.5 #inverting input resistance R1(KOhm)\n",
+ "Iinb=80*10**-9 #bias current(A)\n",
+ "Iino =20*10**-9 #Iin(off) (A) \n",
+ "Vino=2.0 #Vin(off) (mV)\n",
+ "Av=50 #voltage gain \n",
+ "RB1=0 #resistance at noninverting input(KOhm) \n",
+ "\n",
+ "#Calculation\n",
+ "RB2=R1*Rf/(Rf+R1) #thevenin resistance at inverting input(KOhm) \n",
+ "V1err=(RB1-RB2)*Iinb*10**6 #dc error input1 (mV)\n",
+ "V2err=(RB1+RB2)*(Iino/2)*10**6 #dc error input2 (mV)\n",
+ "V3err=Vino #dc error input3 (mV)\n",
+ "Verror=Av*(abs(V1err)+V2err+V3err) #output error voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output error voltage Verror = ',round(Verror,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output error voltage Verror = 106.62 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-9, Page 679"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.9.py\n",
+ "#Iin(bias)=500nA, Iin(off) =200 nA. and Vin(off)= 6mV. \n",
+ "#Calculate output voltage for Vin=0.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #input voltage(mV)\n",
+ "Rf=75 #feedback path resistance Rf (KOhm)\n",
+ "R1=1.5 #inverting input resistance R1(KOhm)\n",
+ "Iinb=500*10**-9 #bias current(A)\n",
+ "Iino =200*10**-9 #Iin(off) (A) \n",
+ "Vino=6.0 #Vin(off) (mV)\n",
+ "Av=50 #voltage gain \n",
+ "RB1=0 #resistance at noninverting input(KOhm) \n",
+ "\n",
+ "#Calculation\n",
+ "RB2=R1*Rf/(Rf+R1) #thevenin resistance at inverting input(KOhm) \n",
+ "V1err=(RB1-RB2)*Iinb*10**6 #dc error input1 (mV)\n",
+ "V2err=(RB1+RB2)*(Iino/2)*10**6 #dc error input2 (mV)\n",
+ "V3err=Vino #dc error input3 (mV)\n",
+ "Verror=Av*(abs(V1err)+V2err+V3err) #output error voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output error voltage Verror = ',round(Verror,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output error voltage Verror = 344.12 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-10, Page 683"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.10.py\n",
+ "#In figure 18-22a, What is closed-loop voltage gain, bandwidth and output voltage at 250KHz?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=50 #input voltage(mV)\n",
+ "Rf=3.9*10**3 #feedback path resistance Rf (Ohm)\n",
+ "R1=100 #inverting input resistance R1(Ohm)\n",
+ "Funity=1*10**6 #Funity (Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Av_CL=1+(Rf/R1) #closed loop voltage gain\n",
+ "f2_CL1=Funity/Av_CL #closed loop bandwidth1(KHz)\n",
+ "Av_CL1=math.ceil(10**(12/20.0)) #Av for 12 dB at 250 KHz \n",
+ "Vout=Av_CL1*Vin #output voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage for 250KHz = ',Vout,'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage for 250KHz = 200.0 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-11, Page 684"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.11.py\n",
+ "#Iin(bias)=500nA, Iin(off) =200 nA. and Vin(off)= 6mV. \n",
+ "#What is the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #input voltage(mV)\n",
+ "Rf=3.9*10**3 #feedback path resistance Rf (Ohm)\n",
+ "R1=100 #inverting input resistance R1(Ohm)\n",
+ "Iinb=500*10**-9 #bias current(A)\n",
+ "Iino =200*10**-9 #Iin(off) (A) \n",
+ "Vino=6.0*10**-3 #Vin(off) (V)\n",
+ "Av=40 #voltage gain \n",
+ "RB1=0 #resistance at noninverting input(KOhm) \n",
+ "\n",
+ "#Calculation\n",
+ "RB2=R1*Rf/(Rf+R1) #thevenin resistance at inverting input(KOhm) \n",
+ "V1err=(RB1-RB2)*Iinb #dc error input1 (mV)\n",
+ "V2err=(RB1+RB2)*(Iino/2) #dc error input2 (mV)\n",
+ "V3err=Vino #dc error input3 (mV)\n",
+ "Verror=Av*(abs(V1err)+V2err+V3err) #output error voltage(mV)\n",
+ "\n",
+ "#Result\n",
+ "print 'output error voltage Verror = ',Verror*1000,'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output error voltage Verror = 242.34 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-12, Page 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.12.py\n",
+ "#Three audio signals drive the summing amplifier of figure 18-25. What is the ac output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin1=100*10**-3 #input voltage1(V)\n",
+ "Vin2=200*10**-3 #input voltage2(V)\n",
+ "Vin3=300*10**-3 #input voltage3(V)\n",
+ "Rf=100.0 #feedback path resistance Rf (KOhm)\n",
+ "R1=20.0 #inverting input resistance R1(KOhm)\n",
+ "R2=10.0 #inverting input resistance R2(KOhm)\n",
+ "R3=50.0 #inverting input resistance R3(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1_CL=-Rf/R1 #closed loop voltage gain\n",
+ "Av2_CL=-Rf/R1 #closed loop voltage gain\n",
+ "Av3_CL=-Rf/R1 #closed loop voltage gain\n",
+ "Vout=Av1_CL*Vin1+Av2_CL*Vin2+Av3_CL*Vin3 #output voltage1(mV)\n",
+ "RB2=(R1**-1+R2**-1+R3**-1+Rf**-1)**-1 #thevenin resistance at inverting input(KOhm) \n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage = ',Vout,'Vpp'\n",
+ "print 'thevenin resistance at inverting input RB2 = ',round(RB2,2),'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -3.0 Vpp\n",
+ "thevenin resistance at inverting input RB2 = 5.56 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-13, Page 688"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.13.py\n",
+ "#An ac voltage source of 10 mVpp with an internal resistance of 100 KOhm drives voltage follower. \n",
+ "#RL is 1 Ohm. Find output voltage & bandwidth.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #ac voltage source (mVpp)\n",
+ "Av=1 #voltage gain\n",
+ "Funity=1 #unity frequency (MHz) \n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Av*Vin #output voltage(V) \n",
+ "f2_CL=Funity #bandwidth(MHz) \n",
+ "\n",
+ "#Result \n",
+ "print 'Output voltage = ',Vout,'mVpp'\n",
+ "print 'Bandwidth f2(CL) = ',f2_CL,'MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 10 mVpp\n",
+ "Bandwidth f2(CL) = 1 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18-14, Page 688"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 18.14.py\n",
+ "#In voltage follower of figure 18-26a, the output voltage across the 1 Ohm load is 9.99 mV. \n",
+ "#calculate closed loop output impedance.\n",
+ "\n",
+ "#Variable declaration\n",
+ "RL=1.0 #load resistance(Ohm)\n",
+ "Vout=9.99 #load voltage(mV)\n",
+ "Vz=0.01 #voltage across Zout(CL) (mV)\n",
+ "\n",
+ "#Calculation\n",
+ "iout=Vout/RL #load current(mA)\n",
+ "Zout_CL=Vz/iout #output impedance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load current iout = ',iout,'mA'\n",
+ "print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,3),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load current iout = 9.99 mA\n",
+ "closed loop output impedance Zout(CL) = 0.001 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_19_New.ipynb b/Electronic_Principles_/Chapter_19_New.ipynb
new file mode 100644
index 00000000..6edb4ee9
--- /dev/null
+++ b/Electronic_Principles_/Chapter_19_New.ipynb
@@ -0,0 +1,573 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 19 NEGATIVE FEEDBACK"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-1, Page 709"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.1.py\n",
+ "#Calculate feedback fraction, the ideal closed-loop voltage gain, the percent error & exact closed loop voltage gain. \n",
+ "#AVOL= 100,000 for 741C. \n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=50 #input voltage(mV)\n",
+ "Rf=3.9 #feedback path resistance Rf (KOhm)\n",
+ "R1=0.1 #inverting input resistance R1(KOhm)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "B=R1/(Rf+R1) #feedback fraction\n",
+ "Av=B**-1 #closed loop voltage gain\n",
+ "Err=100/(1+AVOL*B) #percent error (%)\n",
+ "Av1=Av-((Av/100)*Err) #closed loop voltage gain1\n",
+ "Av2=AVOL/(1+AVOL*B) #closed loop voltage gain2\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop voltage gain by approach 1 = ',round(Av1,2)\n",
+ "print 'closed loop voltage gain by approach 2 = ',round(Av2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop voltage gain by approach 1 = 39.98\n",
+ "closed loop voltage gain by approach 2 = 39.98\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-2, Page 713"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.2.py\n",
+ "#741C has an Rin of 2MOhm and an RCM of 200MOhm. What is closed loop input impedance?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=50 #input voltage(mV)\n",
+ "Rf=3.9*10**3 #feedback path resistance Rf (Ohm)\n",
+ "R1=100 #inverting input resistance R1(Ohm)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "B=0.025 #feedback fraction\n",
+ "Rin=2*10**6 #open loop input resistance(Ohm)\n",
+ "RCM=200*10**6 #common mode input resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Zin_CL=(1+(AVOL*B))*Rin #closed loop input impedance(Ohm)\n",
+ "#for answer>100MOHM use equation 19-8\n",
+ "Zin_CL1=RCM*Zin_CL/(RCM+Zin_CL) #closed loop input impedance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop input impedance Zin(CL) = ',round((Zin_CL1/10**6),2),'MOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop input impedance Zin(CL) = 192.31 MOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-3, Page 714"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.3.py\n",
+ "#calculate the closed loop output impedance in figure 19-6.\n",
+ "#AVOL of 100,000 and Rout of 75 Ohm.\n",
+ "\n",
+ "#Variable declaration \n",
+ "Rout=75 #open loop output resistance(Ohm)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "B=0.025 #feedback fraction\n",
+ "\n",
+ "#Calculation\n",
+ "Zout_CL=Rout/(1+AVOL*B) #closed loop input impedance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,2),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop output impedance Zout(CL) = 0.03 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-4, Page 714"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.4.py\n",
+ "#Amplifier has an open loop total harmonic distortion of 7.5%. \n",
+ "#what is the closed loop total harmonic distribution?\n",
+ "\n",
+ "#Variable declaration\n",
+ "THD=7.5 #open loop total harmonic distortion (%)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "B=0.025 #feedback fraction\n",
+ "\n",
+ "#Calculation\n",
+ "THD_CL=THD/(1+AVOL*B) #closed loop total harmonic distortion (%)\n",
+ "\n",
+ "#Result\n",
+ "print 'Closed loop total harmonic distortion THD(CL) = ',round(THD_CL,3),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop total harmonic distortion THD(CL) = 0.003 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-5, Page 716"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.5.py\n",
+ "#In figure 19-9, what is output voltage for input frequency 1 KHz?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Iin=1 #input current(mA)\n",
+ "Rf=5 #feedback path resistance Rf (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=-(Iin*Rf) #Output voltage at 1KHz (Vpp) \n",
+ "\n",
+ "#Result\n",
+ "print 'Output ac voltage at 1KHz Vout = ',Vout,'Vpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output ac voltage at 1KHz Vout = -5 Vpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-6, Page 717"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.6.py\n",
+ "#What are the closed loop input & output impedances in figure 19-9?\n",
+ "\n",
+ "#Variable declaration \n",
+ "Rout=75.0 #open loop output resistance(Ohm)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "Rf=5.0*10**3 #feedback path resistance(Ohm)\n",
+ "\n",
+ "#Calculation \n",
+ "Zin_CL=Rf/(1+AVOL) #closed loop input impedance(Ohm)\n",
+ "Zout_CL=Rout/(1+AVOL) #closed loop input impedance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop input impedance Zin(CL) = ',round(Zin_CL,2),'Ohm'\n",
+ "print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,5),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop input impedance Zin(CL) = 0.05 Ohm\n",
+ "closed loop output impedance Zout(CL) = 0.00075 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-7, Page 718"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.7.py\n",
+ "#what is IL & PL ? What happens if RL = 4 Ohm?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=2 #input voltage(Vrms)\n",
+ "RL1=2 #load resistance (KOhm)\n",
+ "R1=1 #inverting input resistance R1(KOhm)\n",
+ "RL2=4 #load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "iout=Vin/R1 #output current (mA)\n",
+ "PL1=(iout**2)*RL1 #load power for 2 Ohm (W) \n",
+ "PL2=(iout**2)*RL2 #load power for 4 Ohm (W) \n",
+ "\n",
+ "#Result\n",
+ "print 'load power for 2 Ohm = ',PL1,'W'\n",
+ "print 'load power for 4 Ohm = ',PL2,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "load power for 2 Ohm = 8 W\n",
+ "load power for 4 Ohm = 16 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-8, Page 720"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.8.py\n",
+ "#what is IL & PL? What happens if RL = 2 Ohm?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Iin=1.5*10**-3 #input current(mA)\n",
+ "RL1=1 #load resistance (KOhm)\n",
+ "R1=1 #inverting input resistance R1(KOhm)\n",
+ "RL2=2 #load resistance (KOhm)\n",
+ "Rf=1*10**3 #feedback path resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Ai=math.ceil(1+(Rf/R1)) #current gain\n",
+ "iout=Iin*Ai #output current (mA)\n",
+ "PL1=(iout**2)*RL1 #load power for 1 Ohm (W) \n",
+ "PL2=(iout**2)*RL2 #load power for 2 Ohm (W) \n",
+ "\n",
+ "#Result\n",
+ "print 'load power for 2 Ohm = ',round(PL1,2),'W'\n",
+ "print 'load power for 4 Ohm = ',round(PL2,2),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "load power for 2 Ohm = 2.25 W\n",
+ "load power for 4 Ohm = 4.51 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-9, Page 723"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.9.py\n",
+ "#LF411A with (1+AvolB)=1000 and f2(OL)=160 Hz, what is closed loop bandwidth?\n",
+ "\n",
+ "#Variable declaration\n",
+ "AB=1000 #(1+AvolB) term \n",
+ "f2_OL=160 #open loop bandwidth(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "f2_CL=f2_OL*AB/1000 #closed loop bandwidth(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop bandwidth f2(CL)= 160 KHZ\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-10, Page 723"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.10.py\n",
+ "#LF308 with AVOL=250,000 and f2(OL)=1.2 Hz, \n",
+ "#what is closed loop bandwidth for Av(CL)=50?\n",
+ "\n",
+ "#Variable declaration\n",
+ "AVOL=250000 #open loop voltage gain\n",
+ "f2_OL=1.2 #open loop bandwidth(Hz)\n",
+ "Av_CL=50 #closed loop voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "f2_CL=f2_OL*AVOL/Av_CL/1000 #closed loop bandwidth(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop bandwidth for Av(CL) = 50, f2(CL)= ',f2_CL,'KHZ'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop bandwidth for Av(CL) = 50, f2(CL)= 6.0 KHZ\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-11, Page 724"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.11.py\n",
+ "#LM12 with AVOL =50000 and f2(OL)=14 Hz, what is closed loop bandwidth?\n",
+ "\n",
+ "#Variable declaration\n",
+ "AVOL=50000 #open loop voltage gain\n",
+ "f2_OL=14 #open loop bandwidth(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "f2_CL=f2_OL*(1+AVOL)/1000 #closed loop bandwidth(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop bandwidth f2(CL)= 700 KHZ\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-12, Page 724"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.12.py\n",
+ "#OP-07A with (1+AvolB)=2500 and f2(OL)=20 Hz, what is closed loop bandwidth?\n",
+ "\n",
+ "#Variable declaration\n",
+ "AB=2500 #(1+AvolB) term \n",
+ "f2_OL=20 #open loop bandwidth(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "f2_CL=f2_OL*AB/1000 #closed loop bandwidth(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop bandwidth f2(CL)= 50 KHZ\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19-13, Page 724"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 19.13.py\n",
+ "#LM741C with Funity 1MHz, Sr=0.5 V/us. \n",
+ "#Av(CL) =10. Find closed loop bandwidth & largest peak output voltage at f2(CL)?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av_CL=10.0 #voltage gain\n",
+ "Funity=1*10**6 #unity frequency (Hz) \n",
+ "Sr=0.5 #slew rate (V/us)\n",
+ "\n",
+ "#Calculation\n",
+ "f2_CL=Funity/Av_CL/1000 #closed loop bandwidth(KHz)\n",
+ "Vp_max=1000*Sr/(2*math.pi*f2_CL) #largest peak output voltage(V)\n",
+ "\n",
+ "#Result \n",
+ "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'\n",
+ "print 'largest peak output voltage Vp(max)= ',round(Vp_max,3),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop bandwidth f2(CL)= 100.0 KHZ\n",
+ "largest peak output voltage Vp(max)= 0.796 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_1_New.ipynb b/Electronic_Principles_/Chapter_1_New.ipynb
new file mode 100644
index 00000000..e0a4b799
--- /dev/null
+++ b/Electronic_Principles_/Chapter_1_New.ipynb
@@ -0,0 +1,287 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 1 INTRODUCTION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1-1, Page 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.1.py\n",
+ "#Ac voltage source has Rs 50 ohms. For what load resistance is the source stiff?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rs=50 #source resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "RL=100*Rs/1000 #Minimum Load resistance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Minimum Load resistance =',RL,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum Load resistance = 5 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1-2, Page 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.2.py\n",
+ "#Current source of 2 mA has Rs of 10Mohm. Over what range of load resistance is the current source stiff?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Is=0.002 #Current source(A)\n",
+ "Rs=10000000 #internal resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Rl_Max=0.01*Rs/1000 #Maximum load resistance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'With 100:1 Rule, Maximum Load resistance =',Rl_Max,'KOhm'\n",
+ "print 'Stiff range for current source is load resistance from 0 KOhm to',Rl_Max,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "With 100:1 Rule, Maximum Load resistance = 100.0 KOhm\n",
+ "Stiff range for current source is load resistance from 0 KOhm to 100.0 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1-3, Page 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.3.py\n",
+ "#If a transistor is pumping 2 mA through RL of 10KOhm then find load voltage.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Il=0.002 #current source(A)\n",
+ "Rl=10000 #load resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vl=Il*Rl #load voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load Voltage =',Vl,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load Voltage = 20.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1-4, Page 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.4.py\n",
+ "#What are the Thevenin voltage & resistance in Fig. 1-9a?\n",
+ "\n",
+ "print 'As per figure 1-9a, Calculate Thevenin resistor by opening load resistor'\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=72 #source voltage\n",
+ "R1=6 #Resistance (KOhm)\n",
+ "R2=3 #Resistance (KOhm)\n",
+ "R3=4 #Resistance (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Ro=R1+R2 #Resistance (KOhm)\n",
+ "I=Vs/Ro\n",
+ "Vab=R2*Vs/(R1+R2) #Thevenin voltage(V)\n",
+ "Rth=((R1*R2)/(R1+R2))+R3 #Thevenin Resistance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'After removing Rl current flowing through 6KOhm is',I,'mA'\n",
+ "print 'Thevenin Voltage Vth =',Vab,'V'\n",
+ "print 'Calculating Thevenin Resistance with considering R1 & R2 in parallel'\n",
+ "print 'Thevenin Resistance =',Rth,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As per figure 1-9a, Calculate Thevenin resistor by opening load resistor\n",
+ "After removing Rl current flowing through 6KOhm is 8 mA\n",
+ "Thevenin Voltage Vth = 24 V\n",
+ "Calculating Thevenin Resistance with considering R1 & R2 in parallel\n",
+ "Thevenin Resistance = 6 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1-5, Page 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.5.py\n",
+ "#In circuit shown in figure 1-11a, measure thevenin voltage and resistance.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=72 #source voltage\n",
+ "R1=2 #resistance1 (KOhm)\n",
+ "R2=2 #resistance1 (KOhm)\n",
+ "R3=1 #resistance1 (KOhm)\n",
+ "R4=2 #resistance1 (KOhm)\n",
+ "R5=1 #resistance1 (KOhm)\n",
+ "R6=2 #resistance1 (KOhm)\n",
+ "R7=0.5 #resistance1 (KOhm)\n",
+ "RL=1 #load resistance (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "#from multimeter following values will be measured.\n",
+ "Vth=9 #Thevenin voltage(V)\n",
+ "Rth=1.5 #Thevenin resistance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Thevenin Voltage Vth =',Vth,'V'\n",
+ "print 'Thevenin Resistance =',Rth,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thevenin Voltage Vth = 9 V\n",
+ "Thevenin Resistance = 1.5 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1-6, Page 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.6.py\n",
+ "#Convert thevenin circuit of figure 1-14a into norton circuit.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=10 #source voltage\n",
+ "Rs=2 #series source resistance (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "IN=Vs/Rs #Norton current(mA)\n",
+ "Rp=Rs #parallel source resistance(KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Norton current IN =',IN,'mA'\n",
+ "print 'Norton Resistance =',Rp,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Norton current IN = 5 mA\n",
+ "Norton Resistance = 2 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_20_New.ipynb b/Electronic_Principles_/Chapter_20_New.ipynb
new file mode 100644
index 00000000..1b58e3b8
--- /dev/null
+++ b/Electronic_Principles_/Chapter_20_New.ipynb
@@ -0,0 +1,479 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 20 LINEAR OP-AMP CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-1, Page 741"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.1.py\n",
+ "#In figure 20-6, R1=100KOhm, Rf=100KOhm, R2=1KOhm, what is the voltage gain when JFET is On & off?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rf=100.0 #feedback path resistance Rf (KOhm)\n",
+ "R1=100.0 #inverting input resistance R1(KOhm)\n",
+ "R2=1.0 #inverting input & drain resistance R2(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1=(Rf/(R1**-1+R2**-1)**-1)+1 #maximum voltage gain\n",
+ "Av2=(Rf/R1)+1 #minimum voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'maximum voltage gain = ',Av1\n",
+ "print 'minimum voltage gain = ',Av2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum voltage gain = 102.0\n",
+ "minimum voltage gain = 2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-2, Page 747"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.2.py\n",
+ "#In figure 20-10. R1=1.2KOhm, R2=91KOhm, what are the max & min Av?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1.2 #inverting input resistance R1(KOhm)\n",
+ "R2=91.0 #feedback resistance R2(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1=-R2/R1 #maximum voltage gain\n",
+ "Av2=0 #minimum voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'maximum voltage gain = ',round(Av1,2)\n",
+ "print 'minimum voltage gain = ',Av2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum voltage gain = -75.83\n",
+ "minimum voltage gain = 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-3, Page 747"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.3.py\n",
+ "#If R=1.5KOhm, nR=7.5KOhm in figure 20-10, what is the maximum positive voltage gain & other fixed resistance?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=1.5 #inverting input resistance R1(KOhm)\n",
+ "nR=7.5 #feedback resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "n=nR/R #max. limit of voltage gain \n",
+ "rf=nR/(n-1) #fixed resistor (KOhm)\n",
+ "\n",
+ "#Result\n",
+ "print 'maximum positive voltage gain = ',n\n",
+ "print 'other fixed resistor = ',rf,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum positive voltage gain = 5.0\n",
+ "other fixed resistor = 1.875 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-4, Page 757"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.4.py\n",
+ "#In figure 20-18 R1=1KOhm, R2=100KOhm, R=10KOhm. what is differential voltage gain & common mode voltage gain? \n",
+ "#resistance tolerance is 0.01% ,Vin=10mV, Vin(CM)=20V, what are the values of differential & common mode output signals?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1.0 #inverting input resistance R1(KOhm)\n",
+ "R2=100.0 #feedback resistance R2(KOhm)\n",
+ "R=10.0 #resistor of opamp in seconnd stage(KOhm)\n",
+ "Vin=10*10**-3 #input voltage(V)\n",
+ "Vin_CM=10 #common mode input voltage(V)\n",
+ "T=0.0001 #tolerance of resistor \n",
+ "\n",
+ "#Calculation\n",
+ "Av=(R2/R1)+1 #preamp voltage gain\n",
+ "Av_CM=2*T #common mode voltage gain of 2nd stage\n",
+ "Vout=-Av*Vin #output siganl voltage(V)\n",
+ "Vout_CM=Av_CM*Vin_CM #output siganl voltage for common mode signal(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'output siganl voltage for common mode signal Vout(CM) = ',Vout_CM,'V'\n",
+ "print 'output siganl voltage Vout = ',Vout,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output siganl voltage for common mode signal Vout(CM) = 0.002 V\n",
+ "output siganl voltage Vout = -1.01 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-5, Page 759"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.5.py\n",
+ "#In figure 20-22, R1=1KOhm, R2=2KOhm, R3=3KOhm, R4=4KOhm, R5=5KOhm ,Rf=6KOhm. what is voltage gain of each channel?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rf=6.0 #feedback path resistance Rf (KOhm)\n",
+ "R1=1.0 #inverting input resistance R1(KOhm)\n",
+ "R2=2.0 #inverting input resistance R2(KOhm)\n",
+ "R3=3.0 #non-inverting input resistance R3(KOhm)\n",
+ "R4=4.0 #non-inverting input resistance R4(KOhm)\n",
+ "R5=5.0 #non-inverting input resistance R5(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1=(-Rf/R1) #voltage gain1\n",
+ "Av2=(-Rf/R2) #voltage gain2\n",
+ "Av3=(1+(Rf/((R1**-1+R2**-1)**-1)))*(((R4**-1+R5**-1)**-1)/(R3+((R4**-1+R5**-1)**-1))) #voltage gain3\n",
+ "Av4=(1+(Rf/((R1**-1+R2**-1)**-1)))*(((R3**-1+R5**-1)**-1)/(R4+((R3**-1+R5**-1)**-1))) #voltage gain4\n",
+ "\n",
+ "#Result\n",
+ "print 'Voltage gain channel-1 Av1 = ',Av1\n",
+ "print 'Voltage gain channel-2 Av2 = ',Av2\n",
+ "print 'Voltage gain channel-3 Av3 = ',round(Av3,2)\n",
+ "print 'Voltage gain channel-4 Av4 = ',round(Av4,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain channel-1 Av1 = -6.0\n",
+ "Voltage gain channel-2 Av2 = -3.0\n",
+ "Voltage gain channel-3 Av3 = 4.26\n",
+ "Voltage gain channel-4 Av4 = 3.19\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-6, Page 762"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.6.py\n",
+ "#In figure 20-25, D0=1,D1=0,D2=0, and D3=1. using Vref =5V, \n",
+ "#determine decimal equivalent of BIN and output voltage of converter.\n",
+ "\n",
+ "#Variable declaration \n",
+ "D0=1 #digital input0 (binary)\n",
+ "D1=0 #digital input1 (binary)\n",
+ "D2=0 #digital input2 (binary)\n",
+ "D3=1 #digital input3 (binary)\n",
+ "Vref=5 #reference voltage(V)\n",
+ "N=4 #no. of inputs\n",
+ "\n",
+ "#Calculation \n",
+ "BIN=(D0*2**0)+(D1*2**1)+(D2*2**2)+(D3*2**3) #decimal equivalent BIN\n",
+ "Vout=-((2*Vref*BIN)/2.0**N) #output voltage of converter(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'decimal equivalent BIN = ',BIN\n",
+ "print 'output voltage of converter Vout = ',Vout,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "decimal equivalent BIN = 9\n",
+ "output voltage of converter Vout = -5.625 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-7, Page 764"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.7.py\n",
+ "#In figure 20-27, R1=1KOhm, R2=51 KOhm, what is voltage gain & closed loop output impedance? \n",
+ "#what is shorted load current of circuit if each transistor has B = 125?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R2=51 #feedback path resistance (KOhm)\n",
+ "R1=1 #inverting input resistance R1(KOhm)\n",
+ "Bdc=125 #current gain\n",
+ "Zout=75 #open loop output impedance(Ohm)\n",
+ "AVOL=100000 #741C voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "Av=-R2/R1 #closed loop voltage gain\n",
+ "B=R1/(R1+R2) #feedback fraction\n",
+ "Zout_CL=Zout/(1+(AVOL*B)) #closed loop output impedance(Ohm)\n",
+ "Isc=25.0/1000 #shorted current for 741C op-amp(A)\n",
+ "Imax=Bdc*Isc #maximum load current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'closed loop output impedance Zout(CL) = ',Zout_CL,'Ohm'\n",
+ "print 'maximum load current Imax = ',Imax,'A'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "closed loop output impedance Zout(CL) = 75 Ohm\n",
+ "maximum load current Imax = 3.125 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-8, Page 768"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.8.py\n",
+ "#if the current source of figure 20-28 has R=10KOhm, Vin =1 V, VCC=15V. what is output current? \n",
+ "#what is maximum load resistance for vin = 10V?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=1.0 #input voltage(V)\n",
+ "VCC=15 #supply voltage(V)\n",
+ "R=10 #inverting input resistance(KOhm)\n",
+ "Vin2=10.0 #larger input(V)\n",
+ "\n",
+ "#Calculation\n",
+ "iout=Vin/R #output current(mA)\n",
+ "RL_max=R*(VCC/Vin2-1) #Maximum load resistance(KOhm) \n",
+ "\n",
+ "#Result\n",
+ "print 'Output current iout = ',iout,'mA'\n",
+ "print 'Maximum load resistance RL(max) = ',RL_max,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output current iout = 0.1 mA\n",
+ "Maximum load resistance RL(max) = 5.0 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-9, Page 768"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.9.py\n",
+ "#figure 20-31 has R=15KOhm, Vin =3 V, VCC=15V. what is output current? \n",
+ "#what is maximum load resistance for maximum Vin = 9V?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=3.0 #input voltage(V)\n",
+ "VCC=15 #supply voltage(V)\n",
+ "R=15 #inverting input resistance(KOhm)\n",
+ "Vin2=12.0 #larger input(V)\n",
+ "\n",
+ "#Calculation\n",
+ "iout=-Vin/R #output current(mA)\n",
+ "RL_max=(R/2.0)*(VCC/Vin2-1) #Maximum load resistance(KOhm) \n",
+ "\n",
+ "#Result\n",
+ "print 'Output current iout = ',iout,'mA'\n",
+ "print 'Maximum load resistance RL(max) = ',RL_max,'KOhm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output current iout = -0.2 mA\n",
+ "Maximum load resistance RL(max) = 1.875 KOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20-10, Page 771"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 20.10.py\n",
+ "#If rds varies from 50 Ohm to 120 KOhm in figure 20-32, what is the maximum & minimum voltage gain?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R2=47 #feedback path resistance (KOhm)\n",
+ "R1=1.0 #inverting input resistance R1(KOhm)\n",
+ "R3=100 #non-inverting input resistance R3(KOhm)\n",
+ "rds1=0.050 #ohmic resistance of JFET (KOhm)\n",
+ "rds2=120.0 #ohmic resistance of JFET (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av1=((R2/R1)+1)*(rds1/(rds1+R3)) #minimum voltage gain\n",
+ "Av2=((R2/R1)+1)*(rds2/(rds2+R3)) #maximum voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum voltage gain Av = ',round(Av2,2)\n",
+ "print 'Minimum voltage gain Av = ',round(Av1,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum voltage gain Av = 26.18\n",
+ "Minimum voltage gain Av = 0.024\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_21_New.ipynb b/Electronic_Principles_/Chapter_21_New.ipynb
new file mode 100644
index 00000000..23c2ea5f
--- /dev/null
+++ b/Electronic_Principles_/Chapter_21_New.ipynb
@@ -0,0 +1,686 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 21 ACTIVE FILTERS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-1, Page 806"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.1.py\n",
+ "#what is the voltage gain, cutoff frequency & the frequency response?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rf=39.0 #feedback path resistance Rf (KOhm)\n",
+ "R1=1.0 #inverting input resistance R1(KOhm)\n",
+ "R2=12.0*10**3 #non-inverting input resistance R2(Ohm)\n",
+ "C=680*10**-12 #capacitance at non-inverting input(F)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=(Rf/R1)+1 # voltage gain\n",
+ "fc=(2*math.pi*R2*C)**-1 #cutoff frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain Av = ',Av\n",
+ "print 'cutoff frequency fc = ',round((fc/1000),2),'KHz'\n",
+ "print 'frequency response:'\n",
+ "print 'voltage gain is 32 dB in pass band. response breaks at 19.5 KHz.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain Av = 40.0\n",
+ "cutoff frequency fc = 19.5 KHz\n",
+ "frequency response:\n",
+ "voltage gain is 32 dB in pass band. response breaks at 19.5 KHz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-2, Page 807"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.2.py\n",
+ "#what is the voltage gain, cutoff frequency & frequency response?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rf=43.0 #feedback path resistance Rf (KOhm)\n",
+ "R1=0.220 #non-inverting input resistance R1(KOhm)\n",
+ "C=100*10**-12 #capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=(-Rf/R1) # voltage gain\n",
+ "fc=((2*math.pi*Rf*C)**-1)/10**6 #cutoff frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain Av = ',round(Av,2)\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'\n",
+ "print 'voltage gain is 45.8 dB in pass band. response breaks at 37 KHz.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain Av = -195.45\n",
+ "cutoff frequency fc = 37.01 KHz\n",
+ "voltage gain is 45.8 dB in pass band. response breaks at 37 KHz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-3, Page 811"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.3.py\n",
+ "#what are pole frequency, Q and cutoff frequency?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=30 #non-inverting input resistance R1(KOhm)\n",
+ "R2=30 #non-inverting input resistance R2(KOhm)\n",
+ "C2=1.64*10**-9 #feedback path capacitance (F)\n",
+ "C1=820*10**-12 #non-inverting input capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "Q=0.5*((C2/C1)**0.5) #Q\n",
+ "fp=((2*math.pi*R1*(C1*C2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=fp #cutoff frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print ' Q = ',round(Q,3)\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = fp, ',round(fc,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Q = 0.707\n",
+ "pole frequency fp = 4.57 KHz\n",
+ "cutoff frequency fc = fp, 4.57 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-4, Page 811"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.4.py\n",
+ "#In figure 21-28, what are pole frequency, Q & cutoff frequency?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=51 #non-inverting input resistance R1(KOhm)\n",
+ "R2=51 #non-inverting input resistance R2(KOhm)\n",
+ "C2=440*10**-12 #feedback path capacitance (F)\n",
+ "C1=330*10**-12 #non-inverting input capacitance (F)\n",
+ "kc=0.786 #constant for bessel response \n",
+ "\n",
+ "#Calculation\n",
+ "Q=0.5*((C2/C1)**0.5) #Q\n",
+ "fp=((2*math.pi*R1*(C1*C2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=kc*fp #cutoff frequency(KHz) \n",
+ "\n",
+ "#Result\n",
+ "print ' Q = ',round(Q,2)\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Q = 0.58\n",
+ "pole frequency fp = 8.19 KHz\n",
+ "cutoff frequency fc = 6.44 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-5, Page 812"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.5.py\n",
+ "#what are pole frequency and Q & cutoff and 3-dB frequencies?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=22 #non-inverting input resistance R1(KOhm)\n",
+ "R2=22 #non-inverting input resistance R2(KOhm)\n",
+ "C2=27*10**-9 #feedback path capacitance (F)\n",
+ "C1=390*10**-12 #non-inverting input capacitance (F)\n",
+ "kc=1.38 #constant for bessel response \n",
+ "k0=0.99 #constant for bessel response\n",
+ "k3=1.54 #constant for bessel response\n",
+ "\n",
+ "#Calculation\n",
+ "Q=0.5*((C2/C1)**0.5) #Q\n",
+ "fp=((2*math.pi*R1*(C1*C2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=kc*fp #cutoff frequency(KHz) \n",
+ "f3=k3*fp #3-dB frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'Q = ',round(Q,2)\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'\n",
+ "print '3-dB frequency f(3dB) = ',round(f3,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 4.16\n",
+ "pole frequency fp = 2.23 KHz\n",
+ "cutoff frequency fc = 3.08 KHz\n",
+ "3-dB frequency f(3dB) = 3.43 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-6, Page 817"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.6.py\n",
+ "#what are pole frequency, Q & cutoff frequency?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=47 #non-inverting input resistance R1(KOhm)\n",
+ "R2=47 #non-inverting input resistance R2(KOhm)\n",
+ "C2=330*10**-12 #feedback path capacitance (F)\n",
+ "C1=330*10**-12 #non-inverting input capacitance (F)\n",
+ "R3=51 #inverting input resistance R3(KOhm)\n",
+ "Rf=30.0 #feedback path resistance Rf (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=(Rf/R3)+1 #voltage gain \n",
+ "Q=(3-Av)**-1 #Q\n",
+ "fp=((2*math.pi*R1*(C1*C2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=fp #cutoff frequency(KHz) \n",
+ "\n",
+ "#Result\n",
+ "print ' Q = ',round(Q,2)\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Q = 0.71\n",
+ "pole frequency fp = 10.26 KHz\n",
+ "cutoff frequency fc = 10.26 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-7, Page 817"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.7.py\n",
+ "#In figure 21-33, what are pole frequency, Q & cutoff frequency?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=82 #non-inverting input resistance R1(KOhm)\n",
+ "R2=82 #non-inverting input resistance R2(KOhm)\n",
+ "C2=100*10**-12 #feedback path capacitance (F)\n",
+ "C1=100*10**-12 #non-inverting input capacitance (F)\n",
+ "R3=56 #inverting input resistance R3(KOhm)\n",
+ "Rf=15.0 #feedback path resistance Rf (KOhm)\n",
+ "kc=0.786 #constant for bessel response \n",
+ "\n",
+ "#Calculation\n",
+ "Av=(Rf/R3)+1 #voltage gain \n",
+ "Q=(3-Av)**-1 #Q\n",
+ "fp=((2*math.pi*R1*(C1*C2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=kc*fp #cutoff frequency(KHz) \n",
+ "\n",
+ "#Result\n",
+ "print 'Q = ',round(Q,2)\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 0.58\n",
+ "pole frequency fp = 19.41 KHz\n",
+ "cutoff frequency fc = 15.26 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-8, Page 818"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.8.py\n",
+ "#In figure 21-34, what are pole frequency, Q, cutoff,resosnant & 3-dB frequencies, ripple depth in decibles?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=56 #non-inverting input resistance R1(KOhm)\n",
+ "R2=56 #non-inverting input resistance R2(KOhm)\n",
+ "C2=220*10**-12 #feedback path capacitance (F)\n",
+ "C1=220*10**-12 #non-inverting input capacitance (F)\n",
+ "R3=20.0 #inverting input resistance R3(KOhm)\n",
+ "Rf=39.0 #feedback path resistance Rf (KOhm)\n",
+ "kc=1.414 #constant for bessel response \n",
+ "k0=1.0 #constant for bessel response\n",
+ "k3=1.55 #constant for bessel response\n",
+ "\n",
+ "#Calculation\n",
+ "Av=(Rf/R3)+1 #voltage gain \n",
+ "Q=(3-Av)**-1 #Q\n",
+ "fp=((2*math.pi*R1*(C1*C2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=kc*fp #cutoff frequency(KHz) \n",
+ "f0=k0*fp #resosnant frequency(KHz)\n",
+ "f3=k3*fp #3-dB frequency (KHz)\n",
+ "Av1=((1.01*Rf)/(0.99*R3))+1 #voltage gain considering 1% tolerance \n",
+ "Q1=(3-Av1)**-1 #Q\n",
+ "\n",
+ "#Result\n",
+ "print 'Q = ',Q\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'\n",
+ "print 'resonant frequency f0 = ',round(f0,2),'KHz'\n",
+ "print '3-dB frequency f(3-dB) = ',round(f3,2),'KHz'\n",
+ "print 'circuit produces 26-dB peak in response at 12.9 KHz, rolls off to 0 dB at cutoff and 3 dB down at 20 KHz'\n",
+ "print 'after considering tolerance in resistance, Q changed to',Q1,'approximately'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 20.0\n",
+ "pole frequency fp = 12.92 KHz\n",
+ "cutoff frequency fc = 18.27 KHz\n",
+ "resonant frequency f0 = 12.92 KHz\n",
+ "3-dB frequency f(3-dB) = 20.02 KHz\n",
+ "circuit produces 26-dB peak in response at 12.9 KHz, rolls off to 0 dB at cutoff and 3 dB down at 20 KHz\n",
+ "after considering tolerance in resistance, Q changed to 94.2857142857 approximately\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-9, Page 820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.9.py\n",
+ "#what are pole frequency, Q & cutoff frequency?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=24 #non-inverting input resistance R1(KOhm)\n",
+ "R2=12 #feedback path resistance R2(KOhm)\n",
+ "C=4.7*10**-9 #non-inverting input capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "Q=0.5*((R1/R2)**0.5) #Q\n",
+ "fp=((2*math.pi*C*(R1*R2)**0.5)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=fp #cutoff frequency(KHz) \n",
+ "\n",
+ "#Result\n",
+ "print 'Q = ',round(Q,2)\n",
+ "print 'pole frequency fp = ',math.ceil(fp),'KHz'\n",
+ "print 'cutoff frequency fc = ',math.ceil(fc),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 0.71\n",
+ "pole frequency fp = 2.0 KHz\n",
+ "cutoff frequency fc = 2.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-10, Page 821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.10.py\n",
+ "#In figure 21-37, what are pole frequency, Q, cutoff,resosnant & 3-dB frequencies and ripple depth in decibles?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=30 #non-inverting input resistance R1(KOhm)\n",
+ "R2=30 #feedback path resistance R2(KOhm)\n",
+ "C=1*10**-9 #non-inverting input capacitance (F)\n",
+ "R3=10.0 #inverting input resistance R3(KOhm)\n",
+ "Rf=15.0 #feedback path resistance Rf (KOhm)\n",
+ "kc=1.32 #constant for bessel response \n",
+ "k0=0.94 #constant for bessel response\n",
+ "k3=1.48 #constant for bessel response\n",
+ "\n",
+ "#Calculation\n",
+ "Av=(Rf/R3)+1 #voltage gain \n",
+ "Q=(3-Av)**-1 #Q\n",
+ "fp=((2*math.pi*R1*C)**-1)/10**6 #pole frequency(KHz)\n",
+ "fc=fp/kc #cutoff frequency(KHz) \n",
+ "f0=fp/k0 #resosnant frequency(KHz)\n",
+ "f3=fp/k3 #3-dB frequency (KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'Q = ',Q\n",
+ "print 'pole frequency fp = ',round(fp,2),'KHz'\n",
+ "print 'cutoff frequency fc = ',round(fc,2),'KHz'\n",
+ "print 'resonant frequency f0 = ',round(f0,2),'KHz'\n",
+ "print '3-dB frequency f(3-dB) = ',round(f3,2),'KHz'\n",
+ "print 'circuit produces 6.3-dB peak in response at 5.65 KHz, rolls off to 0 dB at cutoff at 4.02 KHz and 3 dB down at 3.59 KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 2.0\n",
+ "pole frequency fp = 5.31 KHz\n",
+ "cutoff frequency fc = 4.02 KHz\n",
+ "resonant frequency f0 = 5.64 KHz\n",
+ "3-dB frequency f(3-dB) = 3.58 KHz\n",
+ "circuit produces 6.3-dB peak in response at 5.65 KHz, rolls off to 0 dB at cutoff at 4.02 KHz and 3 dB down at 3.59 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-11, Page 825"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.11.py\n",
+ "#In figure 21-42, gate voltage varies from 15 to 80 Ohm. Find bandwidth and minimum & maximum frequencies.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=18 #non-inverting input resistance R1(KOhm)\n",
+ "R2=30 #feedback path resistance R2(KOhm)\n",
+ "C=8.2*10**-9 #non-inverting input capacitance (F)\n",
+ "R31=0.080 #inverting max input resistance R3(KOhm)\n",
+ "R32=0.015 #inverting min input resistance R3(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "BW=((2*math.pi*R1*C)**-1)/10**6 #bandwidth(KHz)\n",
+ "f0=((2*math.pi*C*((2*R1*((R1**-1+R31**-1)**-1))**0.5))**-1)/10**6 #minimum center frequency(KHz)\n",
+ "f01=((2*math.pi*C*((2*R1*((R1**-1+R32**-1)**-1))**0.5))**-1)/10**6 #minimum center frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'bandwidth BW = ',round(BW,2),'KHz'\n",
+ "print 'minimum center frequency f0 = ',round(f0,2),'KHz'\n",
+ "print 'maximum center frequency f0 = ',round(f01,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bandwidth BW = 1.08 KHz\n",
+ "minimum center frequency f0 = 11.46 KHz\n",
+ "maximum center frequency f0 = 26.42 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-12, Page 827"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.12.py\n",
+ "#In figure 21-43, what are the voltage gain, center frequency and Q for bandstop filter, \n",
+ "#if R=22KOhm, C=120nF, R1=13KOhm, R2=10KOhm.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=22.0 #non-inverting input resistance(KOhm)\n",
+ "C=120*10**-9 #non-inverting input capacitance (F)\n",
+ "R1=13.0 #inverting input resistance(KOhm)\n",
+ "R2=10.0 #feedback path resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Av=(R2/R1)+1 #voltage gain \n",
+ "Q=0.5/(2-Av) #Q\n",
+ "f0=((2*math.pi*R*C)**-1)/10**3 #center frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'voltage gain Av = ',round(Av,2)\n",
+ "print 'Q = ',round(Q,2)\n",
+ "print 'center frequency f0 = ',round(f0,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain Av = 1.77\n",
+ "Q = 2.17\n",
+ "center frequency f0 = 60.29 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21-13, Page 833"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 21.13.py\n",
+ "#In figure 21-45b, R=1KOhm, C=100nF. what is phase shift of output voltage when f=1KHz?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=1.0 #non-inverting input resistance(KOhm)\n",
+ "C=100*10**-9 #non-inverting input capacitance (F)\n",
+ "f=1.0 #frequency given(KHz)\n",
+ "\n",
+ "#Calculation\n",
+ "f0=((2*math.pi*R*C)**-1)/10**6 #center frequency(KHz)\n",
+ "phi=(2*math.atan(f0/f))*180/math.pi #phase shift(deg)\n",
+ "\n",
+ "#Result\n",
+ "print 'center frequency f0 = ',round(f0,2),'KHz'\n",
+ "print 'phase shift = ',math.ceil(phi),'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "center frequency f0 = 1.59 KHz\n",
+ "phase shift = 116.0 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_22_New.ipynb b/Electronic_Principles_/Chapter_22_New.ipynb
new file mode 100644
index 00000000..789ac110
--- /dev/null
+++ b/Electronic_Principles_/Chapter_22_New.ipynb
@@ -0,0 +1,421 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 22 NONLINEAR OP-AMP CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-4, Page 854"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.4.py\n",
+ "#Input voltage is a sine wave with a peak value of 10V. what is the trip point & cutoff frequency of bypass circuit?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #ac input(V)\n",
+ "Vs=15 #non-inverting input voltage(V)\n",
+ "R1=200.0*10**3 #non-inverting input resistance R1(Ohm)\n",
+ "R2=100.0*10**3 #non-inverting input resistance R2(Ohm)\n",
+ "C=10*10**-6 #capacitance at non-inverting input(F)\n",
+ "\n",
+ "#Calculation\n",
+ "Vref=Vs/3 #reference voltage at trip point(V)\n",
+ "fc=(2*math.pi*((R1**-1+R2**-1)**-1)*C)**-1 #cutoff frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'trip point voltage Vref = ',Vref,'V'\n",
+ "print 'cutoff frequency of bypass circuit fc = ',round(fc,2),'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "trip point voltage Vref = 5 V\n",
+ "cutoff frequency of bypass circuit fc = 0.24 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-5, Page 855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.5.py\n",
+ "#what is the duty cycle of output waveform in figure 22-15b?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vp=10.0 #sine peak(V)\n",
+ "Vin=5.0 #input voltage(V) \n",
+ "\n",
+ "#Calculation\n",
+ "#1st solution\n",
+ "theta=math.ceil((math.asin(Vin/Vp))*180/math.pi) #angle theta (deg)\n",
+ "#2nd solution\n",
+ "D=(150-theta)/360.0 #duty cycle\n",
+ "\n",
+ "#Result\n",
+ "print 'theta = ',theta,'degrees'\n",
+ "print 'duty cycle D = ',round((D*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "theta = 31.0 degrees\n",
+ "duty cycle D = 33.06 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-6, Page 860"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.6.py\n",
+ "#If Vsat=13.5V, what are the trip points & hysteresis in figure 22-21?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1.0 #non-inverting input resistance R1(KOhm)\n",
+ "R2=47.0 #feedback path resistance R2(KOhm)\n",
+ "Vsat=13.5 #saturation voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "B=R1/(R1+R2) #feedback fraction\n",
+ "UTP=B*Vsat #upper trip point\n",
+ "LTP=-B*Vsat #lower trip point\n",
+ "H=UTP-LTP #hysteresis\n",
+ "\n",
+ "#Result\n",
+ "print 'lower trip point LTP = ',round(LTP,2),'V'\n",
+ "print 'upper trip point LTP = ',round(UTP,2),'V'\n",
+ "print 'hysteresis is ',round(H,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lower trip point LTP = -0.28 V\n",
+ "upper trip point LTP = 0.28 V\n",
+ "hysteresis is 0.56 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-7, Page 865"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.7.py\n",
+ "#what is the output voltage at end of input pulse & closed loop time constant of integrator? \n",
+ "#open loop voltage gain of 100,000.\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=2 #inverting input resistance R1(KOhm)\n",
+ "C=1*10**-6 #feedback path capacitance (F)\n",
+ "T=1*10**-3 #time period(s)\n",
+ "Vin=8 #input pulse voltage(V)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "V=Vin*T/(R*C)/1000 #output voltage(V)\n",
+ "t=R*C*(AVOL+1)*1000 #time constant(s)\n",
+ "\n",
+ "#Result\n",
+ "print 'Magnitude of negative output voltage at end of the pulse = ',V,'V'\n",
+ "print 'closed loop time constant = ',t,'s'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of negative output voltage at end of the pulse = 4.0 V\n",
+ "closed loop time constant = 200.002 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-8, Page 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.5.py\n",
+ "#what is the output voltage in figure 22-30 if the input frequency is 1 KHz?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1*10**3 #inverting input resistance R1(Ohm)\n",
+ "R2=10*10**3 #feedback path resistance R2(Ohm)\n",
+ "C=10*10**-6 #feedback path capacitance (F)\n",
+ "Vin=5 #input pulse voltage(V)\n",
+ "f=1*10**3 #input frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vin/(2*f*R1*C) #output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'peak to peak output voltage = ',Vout,'Vpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak to peak output voltage = 0.25 Vpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-9, Page 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.9.py\n",
+ "#The variable resistance has a maximum value of 10 KOhm. \n",
+ "#what is duty cyale when wiper is at middle of its range for traingular input frequency = 1KHz.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=15.0 #non-inverting input voltage(V)\n",
+ "Rw=5.0*10**3 #inverting input wiper resistance(Ohm)\n",
+ "R1=10.0*10**3 #inverting input resistance R1(Ohm)\n",
+ "f=1.0 #input frequency(KHz) \n",
+ "\n",
+ "#Calculation\n",
+ "Vref=Vs*(Rw/(Rw+R1)) #reference voltage(V)\n",
+ "T=1/f #period of signal(s)\n",
+ "#As per geometry in 22-31b\n",
+ "W=2*(T/2)*((Vs/2)-Vref)/Vs #output pulse width\n",
+ "D=W/T #duty cycle\n",
+ "\n",
+ "#Result\n",
+ "print 'duty cycle D = ',round((D*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "duty cycle D = 16.67 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-10, Page 871"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.10.py\n",
+ "#In figure 22-34, what is the frequency of output signal?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=18.0 #non-inverting input resistance R1(KOhm)\n",
+ "R2=2.0 #feedback path resistance R2(KOhm)\n",
+ "R=1.0 #feedback path resistance R(KOhm)\n",
+ "C=0.1*10**-6 #feedback path capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "B=R1/(R1+R2) #feedback fraction\n",
+ "T=10**9*2*R*C*math.log((1+B)/(1-B)) #period of output(us)\n",
+ "f=1000*1/T #frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'period T = ',round(T,2),'us'\n",
+ "print 'frequency f = ',round(f,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "period T = 588.89 us\n",
+ "frequency f = 1.7 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-11, Page 871"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.11.py\n",
+ "#In figure 22-33 peak outout voltage is 13.5V. R4=10KOhm,C2=10uF,\n",
+ "#what is the peak to peak value of triangular output wave?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vsat=13.5 #saturation voltage given(V)\n",
+ "R4=10*10**3 #given resistance R4(Ohm)\n",
+ "C2=10*10**-6 #given capacitance C2(F)\n",
+ "T=589*10**-6 #period from preceding example(s)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vsat*T/(2*R4*C2) #output voltage (V) \n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage = ',round((Vout*1000),2),'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 39.76 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-12, Page 873"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.12.py\n",
+ "#In figure 22-35a R1=1KOhm, R2=100KOhm, R3=10KOhm, R4=100KOhm and C=10uF.\n",
+ "#what is peak to peak output if Vsat =13V? what is frequency of triangular wave?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1*10**3 #resistance R1(Ohm)\n",
+ "R2=100*10**3 #resistance R2(Ohm)\n",
+ "R3=10*10**3 #resistance R3(Ohm)\n",
+ "C=10*10**-6 #capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "UTP=Vsat*R1/R2 #UTP value (V)\n",
+ "Vout=2*UTP #output voltage/hysteresis (V)\n",
+ "f=R2/(4*R1*R3*C) #frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'Vout = H = ',Vout,'V'\n",
+ "print 'frequency f = ',f,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = H = 0.27 V\n",
+ "frequency f = 250.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_23_New.ipynb b/Electronic_Principles_/Chapter_23_New.ipynb
new file mode 100644
index 00000000..a5d3197f
--- /dev/null
+++ b/Electronic_Principles_/Chapter_23_New.ipynb
@@ -0,0 +1,697 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 23 OSCILLATORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-1, Page 897 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.1.py\n",
+ "#Calculate the minimum and maximum frequencies in figure 23-9.\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=100.0*10**3 #non-inverting input resistance wiper R1(Ohm)\n",
+ "R2=1.0*10**3 #non-inverting input resistance R2(Ohm)\n",
+ "C=0.01*10**-6 #capacitance at non-inverting input(F)\n",
+ "\n",
+ "#Calculation\n",
+ "R=R1+R2 #max. total resistance(Ohm)\n",
+ "fr1=(2*math.pi*R*C)**-1 #minimum frequency(Hz)\n",
+ "R=R2 #min. total resistance(Ohm)\n",
+ "fr2=(2*math.pi*R*C)**-1 #maximum frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'minimum frequency fr = ',round(fr1,2),'Hz'\n",
+ "print 'maximum frequency fr = ',round((fr2/1000),2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum frequency fr = 157.58 Hz\n",
+ "maximum frequency fr = 15.92 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-2, Page 897"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.2.py\n",
+ "#if the lamp voltage is expressed in rms volts,what is the output voltage of oscillator?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rf=2 #feedback resistance(KOhm)\n",
+ "Rl=1 #lamp resistance(KOhm)\n",
+ "Vl=2 #lamp voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Il=Vl/Rl #lamp current(mA)\n",
+ "Vout=Il*(Rf+Rl) #output voltage of oscillator(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Lamp current = ',Il,'mA'\n",
+ "print 'output voltage of oscillator = ',Vout,'Vrms'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lamp current = 2 mA\n",
+ "output voltage of oscillator = 6 Vrms\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-3, Page 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.3.py\n",
+ "#What is frequency of oscillation, feedback fraction & voltage gain needed to start oscillating.\n",
+ "\n",
+ "#Variable declaration\n",
+ "C1=0.001*10**-6 #capacitance in oscillator(F)\n",
+ "C2=0.01*10**-6 #capacitance in oscillator(F)\n",
+ "L=15*10**-6 #inductance(H)\n",
+ "\n",
+ "#Calculation\n",
+ "C=C1*C2/(C1+C2) #equivalent capacitance(F)\n",
+ "fr=(2*math.pi*((L*C)**0.5))**-1 #oscillation frequency(Hz)\n",
+ "B=C1/C2 #feedback fraction\n",
+ "Av_min=C2/C1 #minimum voltage gain\n",
+ "\n",
+ "#Result\n",
+ "print 'feedback fraction B = ',B\n",
+ "print 'oscillation frequency fr = ',round((fr*10**-6),2),'MHz'\n",
+ "print 'minimum voltage gain Av(min) = ',Av_min"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "feedback fraction B = 0.1\n",
+ "oscillation frequency fr = 1.36 MHz\n",
+ "minimum voltage gain Av(min) = 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-4, Page 908"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.4.py\n",
+ "#50 pF is added in series with 15uH inductor. what is the frequency of oscillation?\n",
+ "\n",
+ "#Variable declaration\n",
+ "C1=0.001*10**-6 #capacitance in oscillator(F)\n",
+ "C2=0.01*10**-6 #capacitance in oscillator(F)\n",
+ "C3=50.0*10**-12 #capacitance in oscillator(F)\n",
+ "L=15*10**-6 #inductance(H)\n",
+ "\n",
+ "#Calculation\n",
+ "C=(C1**-1+C2**-1+C3**-1)**-1 #equivalent capacitance(F)\n",
+ "fr=(2*math.pi*((L*C)**0.5))**-1 #oscillation frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'oscillation frequency fr = ',round((fr*10**-6),2),'MHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "oscillation frequency fr = 5.97 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-5, Page 912"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.5.py\n",
+ "#A crystal has values L=3H, Cs=0.05pF, R=2KOhm,Cm=10pF.\n",
+ "#what are the series and parallel resonant frequencies of the crystal?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Cs=0.05*10**-12 #series capacitance in oscillator(F)\n",
+ "Cm=10.0*10**-12 #capacitance in oscillator(F)\n",
+ "R=2.0*10**3 #resistance in oscillator(Ohm)\n",
+ "L=3 #inductance(H)\n",
+ "\n",
+ "#Calculation\n",
+ "fs=(2*math.pi*((L*Cs)**0.5))**-1 #series resonant frequency(Hz)\n",
+ "Cp=Cs*Cm/(Cs+Cm) #equvalent parallel capacitance(F)\n",
+ "fp=(2*math.pi*((L*Cp)**0.5))**-1 #parallel resonant frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'series resonant frequency fs = ',math.ceil(fs*10**-3),'KHz'\n",
+ "print 'parallel resonant frequency fp = ',math.ceil(fp*10**-3),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "series resonant frequency fs = 411.0 KHz\n",
+ "parallel resonant frequency fp = 412.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-6, Page 918"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.9.py\n",
+ "#VCC=12 V, R=33KOhm, C=0.47 uF. What is minimum trigger voltage that produces an output pulse?\n",
+ "#what is maximum capacitor voltage & width of output pulse?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #given supply voltage(V)\n",
+ "R=33*10**3 #given resistance(Ohm)\n",
+ "C=0.47*10**-6 #given capacitance(F)\n",
+ "\n",
+ "#Calculation\n",
+ "LTP=VCC/3 #trip point LTP (V)\n",
+ "UTP=2*LTP #trip point UTP (V)\n",
+ "W=1.1*R*C #pulse width of output(s)\n",
+ "\n",
+ "#Result\n",
+ "print 'trigger voltage LTP = ',LTP,'V'\n",
+ "print 'trigger voltage UTP = ',UTP,'V'\n",
+ "print 'pulse width W = ',W*10**3,'ms'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "trigger voltage LTP = 4.0 V\n",
+ "trigger voltage UTP = 8.0 V\n",
+ "pulse width W = 17.061 ms\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-7, Page 919"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.7.py\n",
+ "#what is the pulse width in figure 23-24 if R=10MOhm and C=470 uF?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=10*10**6 #given resistance(Ohm)\n",
+ "C=470*10**-6 #given capacitance(F)\n",
+ "\n",
+ "#Calculation\n",
+ "W=1.1*R*C #pulse width of output(s)\n",
+ "\n",
+ "#Result\n",
+ "print 'pulse width W = ',W,'s = ',round((W/3600),2),'hours'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pulse width W = 5170.0 s = 1.44 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-8, Page 922"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.8.py\n",
+ "#R1=75KOhm, R2=30KOhm, C=47nF. what is frequency of the output signal & duty cycle?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=75.0*10**3 #given resistance1(Ohm)\n",
+ "R2=30.0*10**3 #given resistance2(Ohm)\n",
+ "C=47.0*10**-9 #given capacitance(F)\n",
+ "\n",
+ "#Calculation\n",
+ "f=1.44/((R1+(2*R2))*C) #frequency (Hz)\n",
+ "D=(R1+R2)/(R1+(2*R2)) #duty cycle \n",
+ "\n",
+ "#Result\n",
+ "print 'frequency f = ',round(f,2),'Hz' \n",
+ "print 'duty cycle D = ',round((D*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency f = 226.95 Hz\n",
+ "duty cycle D = 77.78 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-9, Page 923"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.9.py\n",
+ "#what are the frequency & duty cycle when Vcon is 11V & 1V?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #given supply voltage(V)\n",
+ "R1=75.0*10**3 #given resistance1(Ohm)\n",
+ "R2=30.0*10**3 #given resistance2(Ohm)\n",
+ "C=47.0*10**-9 #given capacitance(F)\n",
+ "Vcon1=11 #given Vcon(V) \n",
+ "Vcon2=1 #given Vcon(V) \n",
+ "\n",
+ "#Calculation\n",
+ "#for Vcon=11V\n",
+ "W1=-(R1+R2)*C*(math.log((VCC-Vcon1)/(VCC-(0.5*Vcon1)))) #pulse width(s)\n",
+ "T1=W1+(0.693*R2*C) #period(s)\n",
+ "D1=W1/T1 #duty cycle\n",
+ "f1=1/T1 #frequency(Hz)\n",
+ "#for Vcon=11V\n",
+ "W2=-(R1+R2)*C*(math.log((VCC-Vcon2)/(VCC-(0.5*Vcon2)))) #pulse width(s)\n",
+ "T2=W2+(0.693*R2*C) #period(s)\n",
+ "D2=W2/T2 #duty cycle\n",
+ "f2=1/T2 #frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'For Vcon = 11V,'\n",
+ "print 'frequency f = ',round(f1,2),'Hz'\n",
+ "print 'duty cycle D = ',round((D1*100),2),'%'\n",
+ "print 'For Vcon = 1V,'\n",
+ "print 'frequency f = ',round(f2,2),'Hz'\n",
+ "print 'duty cycle D = ',round((D2*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Vcon = 11V,\n",
+ "frequency f = 97.9 Hz\n",
+ "duty cycle D = 90.43 %\n",
+ "For Vcon = 1V,\n",
+ "frequency f = 835.77 Hz\n",
+ "duty cycle D = 18.33 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-10, Page 927"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.10.py\n",
+ "#VCC=12V, R=9.1KOhm, C=0.01uF. clock frequency is 2.5KHz.\n",
+ "#if modulating signal has peak value of 2V, what is the period of output pulses, quiescent pulse width,\n",
+ "#minimum & maximum pulse widths & duty cycles?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #given supply voltage(V)\n",
+ "R=9.1*10**3 #given resistance(Ohm)\n",
+ "C=0.01*10**-6 #given capacitance(F)\n",
+ "f=2.5*10**3 #given frequency(Hz)\n",
+ "Vmod=2 #peak value of modulating signal(V) \n",
+ "\n",
+ "#Calculation\n",
+ "T=1/f #period of output pulse(s)\n",
+ "W=1.1*R*C #pulse width(s)\n",
+ "UTP_max=(2*VCC/3)+Vmod #maximum UTP(V)\n",
+ "UTP_min=(2*VCC/3)-Vmod #minimum UTP(V)\n",
+ "Wmin=-R*C*(math.log(1-(UTP_min/VCC))) #minimum pulse width(s)\n",
+ "Wmax=-R*C*(math.log(1-(UTP_max/VCC))) #maximum pulse width(s)\n",
+ "Dmin=Wmin/T #minimum duty cycle\n",
+ "Dmax=Wmax/T #maximum duty cycle\n",
+ "\n",
+ "#Result\n",
+ "print 'period of output pulse T = ',T*10**6,'us'\n",
+ "print 'Quiscent pulse width W = ',W*10**6,'us'\n",
+ "print 'minimum UTP = ',UTP_min,'V'\n",
+ "print 'maximum UTP = ',UTP_max,'V'\n",
+ "print 'minimum pulse width W(min) = ',round((Wmin*10**6),2),'us'\n",
+ "print 'maximum pulse width W(max) = ',round((Wmax*10**6),2),'us'\n",
+ "print 'minimum duty cycle D(min) = ',round((Dmin*100),2),'%'\n",
+ "print 'maximum duty cycle D(max) = ',round((Dmax*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "period of output pulse T = 400.0 us\n",
+ "Quiscent pulse width W = 100.1 us\n",
+ "minimum UTP = 6.0 V\n",
+ "maximum UTP = 10.0 V\n",
+ "minimum pulse width W(min) = 63.08 us\n",
+ "maximum pulse width W(max) = 163.05 us\n",
+ "minimum duty cycle D(min) = 15.77 %\n",
+ "maximum duty cycle D(max) = 40.76 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 23-11, Page 928"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.11.py\n",
+ "#VCC=12V, R1=3.9KOhm,R2=3KOhm, C=0.01uF.\n",
+ "#if modulating signal has peak value of 1.5V, what is the period of output pulses, quiescent pulse width,\n",
+ "#minimum & maximum pulse widths & space between pulses?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=12.0 #given supply voltage(V)\n",
+ "R1=3.9*10**3 #given resistance(Ohm)\n",
+ "R2=3*10**3 #given resistance(Ohm)\n",
+ "C=0.01*10**-6 #given capacitance(F)\n",
+ "Vmod=1.5 #peak value of modulating signal(V) \n",
+ "\n",
+ "#Calculation \n",
+ "W=0.693*(R1+R2)*C #pulse width(s)\n",
+ "T=0.693*(R1+(2*R2))*C #period of output pulse(s)\n",
+ "UTP_max=(2*VCC/3)+Vmod #maximum UTP(V)\n",
+ "UTP_min=(2*VCC/3)-Vmod #minimum UTP(V)\n",
+ "Wmin=-(R1+R2)*C*(math.log((VCC-UTP_min)/(VCC-(0.5*UTP_min)))) #minimum pulse width(s)\n",
+ "Wmax=-(R1+R2)*C*(math.log((VCC-UTP_max)/(VCC-(0.5*UTP_max)))) #minimum pulse width(s)\n",
+ "Tmin=Wmin+(0.693*R2*C) #minimum period(s)\n",
+ "Tmax=Wmax+(0.693*R2*C) #maximum period(s)\n",
+ "s=0.693*R2*C #space(s)\n",
+ "\n",
+ "#Result\n",
+ "print 'period of output pulse T = ',T*10**6,'us'\n",
+ "print 'Quiscent pulse width W = ',W*10**6,'us'\n",
+ "print 'minimum UTP = ',UTP_min,'V'\n",
+ "print 'maximum UTP = ',UTP_max,'V'\n",
+ "print 'minimum pulse width W(min) = ',round((Wmin*10**6),2),'us'\n",
+ "print 'maximum pulse width W(max) = ',round((Wmax*10**6),2),'us'\n",
+ "print 'minimum period T(min) = ',round((Tmin*10**6),2),'us'\n",
+ "print 'maximum period T(max) = ',round((Tmax*10**6),2),'us'\n",
+ "print 'space = ',round((s*10**6),2),'us'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "period of output pulse T = 68.607 us\n",
+ "Quiscent pulse width W = 47.817 us\n",
+ "minimum UTP = 6.5 V\n",
+ "maximum UTP = 9.5 V\n",
+ "minimum pulse width W(min) = 32.04 us\n",
+ "maximum pulse width W(max) = 73.47 us\n",
+ "minimum period T(min) = 52.83 us\n",
+ "maximum period T(max) = 94.26 us\n",
+ "space = 20.79 us\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-12, Page 929"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.12.py\n",
+ "#A ramp generator of figure 23-43 has a constant collector current of 1mA. If VCC=15V, C=100nF. \n",
+ "#what is slope of output ramp, its peak value & its duration?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #given supply voltage(V)\n",
+ "C=100*10**-9 #given capacitance(F)\n",
+ "Ic=1*10**-3 #collector current (A)\n",
+ "\n",
+ "#Calculation \n",
+ "S=Ic/C #slope(V/s) \n",
+ "V=2*VCC/3 #peak value(V)\n",
+ "T=V/S #duration of ramp(s) \n",
+ "\n",
+ "#Result\n",
+ "print 'slope is ',S/1000,'V/ms'\n",
+ "print 'Peak value V = ',V,'V'\n",
+ "print 'duration of ramp = ',T*10**3,'ms'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "slope is 10.0 V/ms\n",
+ "Peak value V = 10.0 V\n",
+ "duration of ramp = 1.0 ms\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-13, Page 938"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.13.py\n",
+ "#In figure 23-50, R=10KOhm,C=0.01uF with s1 closed, what are the output waveforms and frequency at pins 2 & 11?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=10*10**3 #given resistance(Ohm)\n",
+ "C=0.01*10**-6 #given capacitance(F)\n",
+ "\n",
+ "#Calculation \n",
+ "f0=(R*C)**-1 #output frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'output frequency f0 = ',f0/1000,'KHz' "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output frequency f0 = 10.0 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23-14, Page 938"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.14.py\n",
+ "#In figure 23-51, R1=1KOhm,R2=2KOhm,C=0.1uF,Determine square wave output frequency & duty cycle.\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1.0*10**3 #given resistance(Ohm)\n",
+ "R2=2.0*10**3 #given resistance(Ohm)\n",
+ "C=0.1*10**-6 #given capacitance(F)\n",
+ "\n",
+ "#Calculation \n",
+ "f=(2/C)*((R1+R2)**-1) #output frequency(Hz)\n",
+ "D=R1/(R1+R2) #duty cycle\n",
+ "\n",
+ "#Result\n",
+ "print 'output frequency f = ',round((f/1000),2),'KHz' \n",
+ "print 'duty cycle = ',round((D*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output frequency f = 6.67 KHz\n",
+ "duty cycle = 33.33 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_24_New.ipynb b/Electronic_Principles_/Chapter_24_New.ipynb
new file mode 100644
index 00000000..7b020fb6
--- /dev/null
+++ b/Electronic_Principles_/Chapter_24_New.ipynb
@@ -0,0 +1,795 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 24 REGULATED POWER SUPPLIES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-1, Page 954 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.1.py\n",
+ "#Vin=15V, Rs=10 Ohm, Vz=9.1V, VBE=0.8V, RL=40 Ohm.\n",
+ "#what are the value of Vout, Iin, IL, IC.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rs=10 #given source resistance Rs(Ohm)\n",
+ "RL=40 #given load resistance RL(Ohm)\n",
+ "Vin=15 #input voltage(V)\n",
+ "VBE=0.8 #base-emitter voltage drop(V) \n",
+ "Vz=9.1 #voltage across diode(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vz+VBE #output voltage(V) \n",
+ "Is=1000*(Vin-Vout)/Rs #input current(mA) \n",
+ "IL=1000*Vout/RL #load current(mA)\n",
+ "IC=Is-IL #collector current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',Vout,'V'\n",
+ "print 'input current Is = ',Is,'mA'\n",
+ "print 'load current IL = ',IL,'mA'\n",
+ "print 'collector current IC = ',IC,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 9.9 V\n",
+ "input current Is = 510.0 mA\n",
+ "load current IL = 247.5 mA\n",
+ "collector current IC = 262.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-2, Page 954"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.2.py\n",
+ "#Vin=15V, Rs=10 Ohm, Vz=6.2V, VBE=0.81V, RL=40 Ohm , R1=750 Ohm, R2=250 Ohm.\n",
+ "#what are the value of Vout, Iin, IL, IC.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rs=10 #given source resistance Rs(Ohm)\n",
+ "RL=40 #given load resistance RL(Ohm)\n",
+ "Vin=15 #input voltage(V)\n",
+ "VBE=0.81 #base-emitter voltage drop(V) \n",
+ "Vz=6.2 #voltage across diode(V)\n",
+ "R1=750 #base input resistance(Ohm)\n",
+ "R2=250 #base input resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=(Vz+VBE)*(R1+R2)/R1 #output voltage(V) \n",
+ "Is=1000*(Vin-Vout)/Rs #input current(mA) \n",
+ "IL=1000*Vout/RL #load current(mA)\n",
+ "IC=Is-IL #collector current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'V'\n",
+ "print 'input current Is = ',round(Is,2),'mA'\n",
+ "print 'load current IL = ',round(IL,2),'mA'\n",
+ "print 'collector current IC = ',round(IC,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 9.35 V\n",
+ "input current Is = 565.33 mA\n",
+ "load current IL = 233.67 mA\n",
+ "collector current IC = 331.67 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-3, Page 954"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.3.py\n",
+ "#What is the approximate efficiency in the preceding example?\n",
+ "#How much power does the regulator dissipate?\n",
+ "\n",
+ "#Variable declaration\n",
+ "#data from preceding example\n",
+ "Vout=9.35 #output voltage(V)\n",
+ "IL=234 #load current(mA)\n",
+ "Is=565 #input current(mA)\n",
+ "Vin=15.0 #input voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Pout=Vout*IL/1000 #output power(W)\n",
+ "Pin=Vin*Is/1000 #input power(W)\n",
+ "eff=Pout/Pin #efficiency\n",
+ "preg=Pin-Pout #power dissipated by regulator(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'input power Pin = ',Pin,'W'\n",
+ "print 'Output power Pout = ',round(Pout,2),'W'\n",
+ "print 'Effifciency = ',round((eff*100),2),'%'\n",
+ "print'power dissipated by regulator = ',round(preg,2),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input power Pin = 8.475 W\n",
+ "Output power Pout = 2.19 W\n",
+ "Effifciency = 25.82 %\n",
+ "power dissipated by regulator = 6.29 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-4, Page 955"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.4.py\n",
+ "#Vin=15V, Rs=10 Ohm, Vz=6.8V, RL=40 Ohm , R1=7.5 KOhm, R2=2.5 KOhm.\n",
+ "#what are the value of Vout, Iin, IL, IC.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rs=10 #given source resistance Rs(Ohm)\n",
+ "RL=40 #given load resistance RL(Ohm)\n",
+ "Vin=15 #input voltage(V)\n",
+ "Vz=6.8 #voltage across diode(V)\n",
+ "R1=7.5*10**3 #base input resistance(Ohm)\n",
+ "R2=2.5*10**3 #base input resistance(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vz*(R1+R2)/R1 #output voltage(V) \n",
+ "Is=1000*(Vin-Vout)/Rs #input current(mA) \n",
+ "IL=1000*Vout/RL #load current(mA)\n",
+ "IC=Is-IL #collector current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'V'\n",
+ "print 'input current Is = ',round(Is,2),'mA'\n",
+ "print 'load current IL = ',round(IL,2),'mA'\n",
+ "print 'collector current IC = ',round(IC,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 9.07 V\n",
+ "input current Is = 593.33 mA\n",
+ "load current IL = 226.67 mA\n",
+ "collector current IC = 366.67 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-5, Page 956"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.5.py\n",
+ "#Calculate maximum load currents for examples 24-1,2,4.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Is1=510 #input current in ex. 24-1 (mA)\n",
+ "Is2=565 #input current in ex. 24-2 (mA)\n",
+ "Is4=593 #input current in ex. 24-4 (mA)\n",
+ "\n",
+ "#Calculation\n",
+ "Imax1=Is1 #maximum load current (mA) \n",
+ "Imax2=Is2 #maximum load current (mA) \n",
+ "Imax4=Is4 #maximum load current (mA) \n",
+ "\n",
+ "#Result\n",
+ "print 'maximum load current Imax1 = ',Imax1,'mA'\n",
+ "print 'maximum load current Imax2 = ',Imax2,'mA'\n",
+ "print 'maximum load current Imax4 = ',Imax4,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum load current Imax1 = 510 mA\n",
+ "maximum load current Imax2 = 565 mA\n",
+ "maximum load current Imax4 = 593 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-6, Page 956"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.6.py\n",
+ "#VNL=9.91V, VFL=9.81V, VHL=9.94V, and VLL=9.79V. What is load regulation & line regulation?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VNL=9.91 #given VNL(V)\n",
+ "VFL=9.81 #given VFL(V)\n",
+ "VHL=9.94 #given VHL(V) \n",
+ "VLL=9.79 #given VLL(V)\n",
+ "\n",
+ "#Calculation\n",
+ "LoR=(VNL-VFL)*100/VFL #Load regulation(%)\n",
+ "LiR=(VHL-VLL)*100/VLL #Line regulation(%)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load regulation = ',round(LoR,2),'%'\n",
+ "print 'Line regulation = ',round(LiR,2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load regulation = 1.02 %\n",
+ "Line regulation = 1.53 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-7, Page 962"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.7.py\n",
+ "#Calculate approx. output voltage in figure 24-14, what is the power dissipation in pass transistor?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RL=40.0 #given load resistance RL(Ohm)\n",
+ "VBE=0.7 #base-emitter voltage drop(V) \n",
+ "Vz=6.2 #voltage across diode(V)\n",
+ "R1=3.0 #base input resistance(KOhm)\n",
+ "R2=1.0 #base input resistance(KOhm)\n",
+ "Vin=15 #input voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=(Vz+VBE)*(R1+R2)/R1 #output voltage(V)\n",
+ "IC=Vout/RL #transistor current(A)\n",
+ "PD=(Vin-Vout)*IC #power dissipation(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',Vout,'V'\n",
+ "print 'transistor current = load current = IC = ',IC*1000,'mA'\n",
+ "print 'Power dissipation PD = ',PD,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 9.2 V\n",
+ "transistor current = load current = IC = "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "230.0 mA\n",
+ "Power dissipation PD = 1.334 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-8, Page 963"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.3.py\n",
+ "#What is the approximate efficiency in the preceding example 24-7?\n",
+ "\n",
+ "#Variable declaration\n",
+ "#data from preceding example\n",
+ "Vout=9.2 #output voltage(V)\n",
+ "IL=230 #load current(mA)\n",
+ "Vin=15.0 #input voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Pout=Vout*IL/1000 #output power(W)\n",
+ "Pin=Vin*IL/1000 #input power(W)\n",
+ "eff1=Pout/Pin #efficiency\n",
+ "eff2=Vout/Vin #efficiency\n",
+ "\n",
+ "#Result\n",
+ "print 'input power Pin = ',Pin,'W'\n",
+ "print 'Output power Pout = ',Pout,'W'\n",
+ "print 'Effifciency 1= ',round((eff1*100),2),'%'\n",
+ "print 'Effifciency 2= ',round((eff2*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input power Pin = 3.45 W\n",
+ "Output power Pout = 2.116 W\n",
+ "Effifciency 1= 61.33 %\n",
+ "Effifciency 2= 61.33 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-9, Page 963"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.9.py\n",
+ "#What is the approx. output voltage in figure 24-15,Why is a darlington transistor is used?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RL=4.0 #given load resistance RL(Ohm)\n",
+ "Vz=5.6 #voltage across diode(V)\n",
+ "R1=2.7 #base input resistance(KOhm)\n",
+ "R2=2.2 #base input resistance(KOhm)\n",
+ "Vin=15 #input voltage(V)\n",
+ "B=100 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vz*(R1+R2)/R1 #output voltage(V)\n",
+ "IL=Vout/RL #load current(A)\n",
+ "IB=IL/B #base current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'V'\n",
+ "print 'Load current IL = ',round(IL,2),'A'\n",
+ "print 'base current IB = ',round((IB*1000),2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 10.16 V\n",
+ "Load current IL = 2.54 A\n",
+ "base current IB = 25.41 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-10, Page 964"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.10.py\n",
+ "#VNL=10.16V, VFL=10.15V, VHL=10.16V, and VLL=10.07V. What is load regulation & line regulation?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VNL=10.16 #given VNL(V)\n",
+ "VFL=10.15 #given VFL(V)\n",
+ "VHL=10.16 #given VHL(V) \n",
+ "VLL=10.07 #given VLL(V)\n",
+ "\n",
+ "#Calculation\n",
+ "LoR=(VNL-VFL)*100/VFL #Load regulation(%)\n",
+ "LiR=(VHL-VLL)*100/VLL #Line regulation(%)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load regulation = ',round(LoR,3),'%'\n",
+ "print 'Line regulation = ',round(LiR,2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load regulation = 0.099 %\n",
+ "Line regulation = 0.89 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-11, Page 965"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.11.py\n",
+ "#vin can vary from 17.5 to 22.5V, what is the maximum zener current, min & max regulated output voltages?\n",
+ "#If regulated voltage is 12.5V, what is the load resistance where current limiting starts & approx. shorted-load current?\n",
+ "\n",
+ "#Variable declaration\n",
+ "RL=3.0 #given load resistance RL(Ohm)\n",
+ "Vz=4.7 #voltage across diode(V)\n",
+ "R11=1750 #base input resistance with max. potentiometer(Ohm)\n",
+ "R12=750 #base input resistance with min. potentiometer(Ohm)\n",
+ "R2=750 #base input resistance(Ohm)\n",
+ "Vin=22.5 #max. input voltage(V)\n",
+ "B=100 #current gain\n",
+ "Rs=820 #input side resistance(Ohm)\n",
+ "Vcl=0.6 #voltage across current limiting resistor(V)\n",
+ "Vcs=0.7 #voltage across current sensing resistor(V)\n",
+ "Vo=12.5 #regulated voltage given(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Iz=(Vin-Vz)/Rs #max. zener current(A)\n",
+ "Vout1=Vz*(R11+R2)/R11 #min. regulated output voltage(V)\n",
+ "Vout2=Vz*(R12+R2)/R12 #max. regulated output voltage(V)\n",
+ "IL=Vcl/RL #load current(A)\n",
+ "RL1=Vo/IL #load resistance(Ohm)\n",
+ "ISL=Vcs/RL #shorted-load current(A)\n",
+ "\n",
+ "#Result\n",
+ "print 'maximum zener current Iz = ',round((Iz*1000),2),'mA'\n",
+ "print 'Load current IL = ',IL*1000,'mA'\n",
+ "print 'load resistance RL = ',RL1,'Ohm'\n",
+ "print 'shorted-load current ISL = ',round((ISL*1000),2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum zener current Iz = 21.71 mA\n",
+ "Load current IL = 200.0 mA\n",
+ "load resistance RL = 62.5 Ohm\n",
+ "shorted-load current ISL = 233.33 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-12, Page 971"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.12.py\n",
+ "#what is load current in figure 24-21? what is the output ripple?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vout=12.0 #regulated output voltage(V)\n",
+ "RL=100.0 #given load resistance RL(Ohm)\n",
+ "\n",
+ "C=1000*10**-6 #given capacitance(F)\n",
+ "f=120 #frequency(Hz)\n",
+ "RR_dB=72.0 #ripple rejection(dB)\n",
+ "\n",
+ "#Calculation \n",
+ "IL=Vout/RL #load current(A)\n",
+ "VRi=IL/(f*C) #peak to peak input ripple (V)\n",
+ "RR=10**(RR_dB/20) #ripple rejection\n",
+ "VRo=VRi/RR #peak to peak output ripple (V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load current IL = ',IL*1000,'mA'\n",
+ "print 'peak to peak input ripple = ',VRi,'V'\n",
+ "print 'peak to peak output ripple = ',round((VRo*1000),2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load current IL = 120.0 mA\n",
+ "peak to peak input ripple = 1.0 V\n",
+ "peak to peak output ripple = 0.25 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-13, Page 972"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.13.py\n",
+ "#If R1=2KOhm, R2=22KOhm in figure 24-20, what is the output voltage? If R2 is increased to 46 KOhm. What is the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=2.0 #given resistance(KOhm)\n",
+ "R2=22.0 #given resistance(KOhm)\n",
+ "R21=46.0 #given resistance increased(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout1=1.25*(R1+R2)/R1 #output voltage(V)\n",
+ "Vout2=1.25*(R1+R21)/R1 #output voltage with increased R2(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout1 = ',Vout1,'V'\n",
+ "print 'output voltage with increased R2, Vout2 = ',Vout2,'V' "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout1 = 15.0 V\n",
+ "output voltage with increased R2, Vout2 = 30.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-14, Page 972"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.14.py\n",
+ "#The LM7805 can regulate to specifications with input voltage between 7.5 & 20V.\n",
+ "#what is the maximum & minimum efficiency? \n",
+ "\n",
+ "#Variable declaration\n",
+ "#data from preceding example\n",
+ "Vout=5.0 #output voltage(V)\n",
+ "Vin_min=7.5 #min. input voltage(V)\n",
+ "Vin_max=20.0 #max. input voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "eff_max=Vout/Vin_min #maximum efficiency\n",
+ "eff_min=Vout/Vin_max #minimum efficiency\n",
+ "\n",
+ "#Result\n",
+ "print 'Minimum Effifciency = ',eff_min*100,'%'\n",
+ "print 'Maximum Effifciency = ',round((eff_max*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum Effifciency = 25.0 %\n",
+ "Maximum Effifciency = 66.67 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-15, Page 984"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.15.py\n",
+ "#R1=2.21 KOhm, R2=2.8 KOhm, what is the output voltage, minimum input voltage that can be used with the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=2.21 #given resistance(KOhm)\n",
+ "R2=2.8 #given resistance(KOhm)\n",
+ "R21=46.0 #given resistance increased(KOhm)\n",
+ "VREF=2.21 #Reference voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=VREF*(R1+R2)/R1 #output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',Vout,'V'\n",
+ "print 'Input voltage should be 2V greater than output voltage So, Vin = 7 V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 5.01 V\n",
+ "Input voltage should be 2V greater than output voltage So, Vin = 7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24-16, Page 984"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 24.15.py\n",
+ "#In buck-boost regulator of figure 24-32, If R1=1 KOhm, R2=5.79 KOhm, what is the output voltage? \n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1 #given resistance(KOhm)\n",
+ "R2=5.79 #given resistance(KOhm)\n",
+ "VREF=2.21 #Reference voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=VREF*(R1+R2)/R1 #output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage Vout = ',round(Vout,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage Vout = 15.01 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_2_New.ipynb b/Electronic_Principles_/Chapter_2_New.ipynb
new file mode 100644
index 00000000..cf7eaae1
--- /dev/null
+++ b/Electronic_Principles_/Chapter_2_New.ipynb
@@ -0,0 +1,177 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 2 SEMICONDUCTORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2-5, Page 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.5.py\n",
+ "#A barrier potential of 0.7V at an ambient temperature of 25 deg C,\n",
+ "#Find arrier potential of a silicon diode when the junction temperature is 100 deg C. At 0 deg C.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tj=100 #junction temperature 1(C)\n",
+ "Vb=0.7 #Barrier potential(V)\n",
+ "Tamb=25 #Ambient temperature(C)\n",
+ "T1=0 #junction temperature 2(C)\n",
+ "\n",
+ "#Calculation\n",
+ "Vd=-0.002*(Tj-Tamb) #Change in barrier potential(V)\n",
+ "Vbn=Vb+Vd #Barrier potential(V)\n",
+ "Vd1=-0.002*(T1-Tamb) #Change in barrier potential(V)\n",
+ "Vb1n=Vb+Vd1 #Barrier potential(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Change in barrier potential = Vd =',Vd,'V'\n",
+ "print 'Brrier potential = Vbn =',Vbn,'V'\n",
+ "print 'For junction temperature 0 C'\n",
+ "print 'Change in barrier potential = Vd1 =',Vd1,'V'\n",
+ "print 'New barrier potential = Vb1n =',Vb1n,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in barrier potential = Vd = -0.15 V\n",
+ "Brrier potential = Vbn = 0.55 V\n",
+ "For junction temperature 0 C\n",
+ "Change in barrier potential = Vd1 = 0.05 V\n",
+ "New barrier potential = Vb1n = 0.75 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2-6, Page 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.6.py\n",
+ "#A silicon diode has a saturation current of 5 nA at 25 deg C. What is the saturation current at 100 deg C?\n",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "T2=100 #Temperature(C)\n",
+ "T1=25 #Temperature(C)\n",
+ "Isat1=5 #Current(nA)\n",
+ "\n",
+ "#Calculation\n",
+ "Td=T2-T1 #Temperature change(C)\n",
+ "Is1=(2**7)*Isat1 #Current(nA)\n",
+ "Is2=(1.07**5)*Is1 #Current(nA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Change in temperature = Td = T2-T1 =',Td,'C'\n",
+ "print 'For first 70 C change seven doublings are there.'\n",
+ "print 'Is1 = (2^7)*Isat1 =',Is1,'nA'\n",
+ "print 'For additional 5 C, 7% per C'\n",
+ "print 'Is2 = ',round(Is2,2),'nA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in temperature = Td = T2-T1 = 75 C\n",
+ "For first 70 C change seven doublings are there.\n",
+ "Is1 = (2^7)*Isat1 = 640 nA\n",
+ "For additional 5 C, 7% per C\n",
+ "Is2 = 897.63 nA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2-7, Page 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.7.py\n",
+ "#surface-leakage current is 2nA for a reverse voltage of 25 V, \n",
+ "#find surface leakage current for a reverse voltage of 35V.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Isl=2*(10**-9) #surface leakage current(nA)\n",
+ "Vr=25 #Reverse voltage(V)\n",
+ "Vr1=35 #Reverse voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Rsl=Vr/Isl #surface leakage reistance(Ohm)\n",
+ "Isl1=(Vr1/Rsl)*(10**9) #surface leakage current(nA)\n",
+ "\n",
+ "#Result\n",
+ "print 'surface-leakage reistance Rsl = Vr/Isl =',Rsl*10**-6,'MOhm'\n",
+ "print 'for Vr1 = 35 V,'\n",
+ "print 'surface-leakage reistance Isl1 = Vr1/Rsl =',Isl1,'nA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "surface-leakage reistance Rsl = Vr/Isl = 12500.0 MOhm\n",
+ "for Vr1 = 35 V,\n",
+ "surface-leakage reistance Isl1 = Vr1/Rsl = 2.8 nA\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_3_New.ipynb b/Electronic_Principles_/Chapter_3_New.ipynb
new file mode 100644
index 00000000..e2552e78
--- /dev/null
+++ b/Electronic_Principles_/Chapter_3_New.ipynb
@@ -0,0 +1,370 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 3 DIODE THEORY"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-2, Page 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.2.py\n",
+ "#A diode has a power rating of 5W. If diode voltage is 1.2V and diode current is 1.75A,\n",
+ "#What is the power dissipation? Will the diode be destroyed?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr=5 #Power rating(W)\n",
+ "Vd=1.2 #diode voltage(V)\n",
+ "Id=1.75 #diode current(A)\n",
+ "\n",
+ "#Calculation\n",
+ "PD=Vd*Id #Power dissipaion(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'Power Dissipation =',PD,'W'\n",
+ "print 'PD(',PD,'W) < ''Pr(',Pr,'W), So diode will not be destroyed.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power Dissipation = 2.1 W\n",
+ "PD( 2.1 W) < Pr( 5 W), So diode will not be destroyed.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-3, Page 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.3.py\n",
+ "#Use the ideal diode to calculate the VL & IL in Fig. 3-6a.\n",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=10 #Source voltage(V)\n",
+ "RL=1 #Load resistance(KOhm)\n",
+ "VL=Vs #LOad voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "IL=VL/RL #Load current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Vs will be appearing across RL'\n",
+ "print 'Load voltage VL =',Vs,'V'\n",
+ "print 'Load current IL =',IL,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vs will be appearing across RL\n",
+ "Load voltage VL = 10 V\n",
+ "Load current IL = 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-4, Page 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.4.py\n",
+ "#Calculate the VL & IL in Fig. 3-6b using an ideal diode.\n",
+ "\n",
+ "#Variable Declaration\n",
+ "print 'As per figure 3-6b, Thevenize the circuit to the left of the diode'\n",
+ "R1=6 #Resistance(KOhm)\n",
+ "R2=3 #Resistance(KOhm)\n",
+ "RL=1 #Load Resistance(KOhm)\n",
+ "Vs=36 #Supply voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vth=R2*Vs/(R1+R2) #ThCevenin voltage(V)\n",
+ "Rth=(R1*R2)/(R1+R2) #Thevenin resistance(KOhm)\n",
+ "Rt=Rth+RL #total resistance(KOhm)\n",
+ "IL=Vth/Rt #Load current(mA)\n",
+ "VL=IL*RL #Load voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Vth =',Vth,'V & Rth =',Rth,'KOhm'\n",
+ "print 'Visualize diode as closed switch,'\n",
+ "print 'IL =',IL,'mA'\n",
+ "print 'VL =',VL,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As per figure 3-6b, Thevenize the circuit to the left of the diode\n",
+ "Vth = 12 V & Rth = 2 KOhm\n",
+ "Visualize diode as closed switch,\n",
+ "IL = 4 mA\n",
+ "VL = 4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-5, Page 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.5.py\n",
+ "#Use the second approximation to calculate the VL, IL & PD in Fig 3-8. \n",
+ "\n",
+ "#Variable Declaration\n",
+ "print 'As per Second approximation in Fig.3-8,'\n",
+ "Vd=0.7 #diode voltgage(V)\n",
+ "Vs=10 #supply voltage(V)\n",
+ "RL=1 #Load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "VL=Vs-Vd #Load voltage(v)\n",
+ "IL=VL/RL #Load current(mA)\n",
+ "PD=Vd*IL #diode power(mW)\n",
+ "\n",
+ "#Result\n",
+ "print 'IL =',IL,'mA & VL =',VL,'V'\n",
+ "print 'Diode power PD =',PD,'mW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As per Second approximation in Fig.3-8,\n",
+ "IL = 9.3 mA & VL = 9.3 V\n",
+ "Diode power PD = 6.51 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-6, Page 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.6.py\n",
+ "#Calculate the VL, IL & PD in fig. 3-9a using the second approximation.\n",
+ "\n",
+ "#Variable Declaration\n",
+ "print 'As per Second approximation in Fig.3-9a,'\n",
+ "Vd=0.7 #diode voltgage(V)\n",
+ "Vs=36 #supply voltage(V)\n",
+ "R1=6 #Resistance(KOhm)\n",
+ "R2=3 #Resistance(KOhm)\n",
+ "RL=1 #Load resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vth=R2*Vs/(R1+R2)#Thevenin Voltage(V)\n",
+ "Rth=(R1*R2)/(R1+R2)#Thevenin resistance(KOhm)\n",
+ "IL=(Vth-Vd)/R2#Load current(mA)\n",
+ "VL=IL*RL#Load voltage(V)\n",
+ "PD=Vd*IL#diode power(mW)\n",
+ "\n",
+ "#Result\n",
+ "print 'Thevenize the circuit to the left of the diode'\n",
+ "print 'Vth =',Vth,'V & Rth =',Rth,'KOhm'\n",
+ "print 'VL =',round(VL,2),'V & IL =',round(IL,2),'mA'\n",
+ "print 'Diode power PD =',round(PD,2),'mW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As per Second approximation in Fig.3-9a,\n",
+ "Thevenize the circuit to the left of the diode\n",
+ "Vth = 12 V & Rth = 2 KOhm\n",
+ "VL = 3.77 V & IL = 3.77 mA\n",
+ "Diode power PD = 2.64 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-7, Page 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.7.py\n",
+ "#The IN4001 has a bulk resistance of 0.23 Ohm. What is VL, IL & PD?\n",
+ "\n",
+ "#Variable Declaration\n",
+ "print 'In Fig.3-11a,'\n",
+ "Vd=0.7 #diode voltgage(V)\n",
+ "Vs=10 #supply voltage(V)\n",
+ "RL=1000L #Load resistance(Ohm)\n",
+ "Rb=0.23 #bulk resistance\n",
+ "\n",
+ "#Calculation\n",
+ "print 'As per third approximation, we get fig.3-11b'\n",
+ "if Rb<(RL/100):\n",
+ " print'If Rb < 0.01RL than ignore Rb & use second approximation.'\n",
+ " VL=Vs-Vd #Load voltage(V)\n",
+ " IL=(VL/RL)*1000 #Load current(mA)\n",
+ " PD=Vd*IL #diode power(mW)\n",
+ "\n",
+ "#Result \n",
+ " print 'IL =',IL,'mA & VL =',VL,'V'\n",
+ " print 'Diode power PD =',PD,'mW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In Fig.3-11a,\n",
+ "As per third approximation, we get fig.3-11b\n",
+ "If Rb < 0.01RL than ignore Rb & use second approximation.\n",
+ "IL = 9.3 mA & VL = 9.3 V\n",
+ "Diode power PD = 6.51 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3-8, Page 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.8.py\n",
+ "#Repeat the preceding example for RL of 10 Ohm.\n",
+ "\n",
+ "#Variable Declaration\n",
+ "print 'In Fig.3-11a, take RL = 10 Ohm'\n",
+ "Vd=0.7 #diode voltgage(V)\n",
+ "Vs=10 #supply voltage(V)\n",
+ "RL=10 #Load resistance(Ohm)\n",
+ "Rb=0.23 #bulk resistance\n",
+ "RT=Rb+RL #Total reistance(Ohm)\n",
+ "VT=Vs-Vd #total voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "print 'RT =',RT,'Ohm & VT =',VT,'V'\n",
+ "IL=VT/RT #Load current(mA)\n",
+ "VL=IL*RL #Load voltage(V)\n",
+ "VD=Vd+(IL*Rb) \n",
+ "PD=VD*IL #diode power(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'IL =',round(IL,2),'mA & VL =',round(VL,2),'V'\n",
+ "print 'VD =',round(VD,2),'V'\n",
+ "print 'Diode power PD =',round(PD,2),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In Fig.3-11a, take RL = 10 Ohm\n",
+ "RT = 10.23 Ohm & VT = 9.3 V\n",
+ "IL = 0.91 mA & VL = 9.09 V\n",
+ "VD = 0.91 V\n",
+ "Diode power PD = 0.83 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_4_New.ipynb b/Electronic_Principles_/Chapter_4_New.ipynb
new file mode 100644
index 00000000..af0210e1
--- /dev/null
+++ b/Electronic_Principles_/Chapter_4_New.ipynb
@@ -0,0 +1,566 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 4 DIODE CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-1, Page 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.1.py\n",
+ "#Calculate peak load voltage and the dc load voltage.\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=10 #RMS Value of sine wave(V)\n",
+ "f=60 #frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Vp=Vrms/0.707 #peak source voltage(V)\n",
+ "Vpout=Vp #peak load voltage(V)\n",
+ "Vdc=Vp/math.pi #dc load voltage(V)\n",
+ "Vpouts=Vp-0.7 #peak load voltage in 2nd approx.\n",
+ "Vdc=Vpouts/math.pi #dc load voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Vp=',round(Vp,2),'V'\n",
+ "print 'With an ideal diode, Vpout =',round(Vpout,2),'V'\n",
+ "print 'DC load voltage, Vdc =',round(Vdc,2),'V'\n",
+ "print 'With second approximation, Vpout =',round(Vpouts,2),'V'\n",
+ "print 'DC load voltage, Vdc =',round(Vdc,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vp= 14.14 V\n",
+ "With an ideal diode, Vpout = 14.14 V\n",
+ "DC load voltage, Vdc = 4.28 V\n",
+ "With second approximation, Vpout = 13.44 V\n",
+ "DC load voltage, Vdc = 4.28 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-2, Page 94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.2.py\n",
+ "#What are the peak load voltage and dc load voltage in Figure 4.5?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=120 #supply voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vs/5 #Secondary voltage(V)\n",
+ "Vp=V2/0.707 #peak secondary voltage\n",
+ "Vpout=Vp #peak load voltage(V)\n",
+ "Vdc1=Vp/math.pi #dc load voltage(V)\n",
+ "Vpouts=Vp-0.7 #peak load voltage in 2nd approx.(V)\n",
+ "Vdc2=Vpouts/math.pi #dc load voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'As per fig.4-5, Transformer turns ratio is 5:1'\n",
+ "print 'V2=',round(V2,2),'V'\n",
+ "print 'Vp=',round(Vp,2),'V'\n",
+ "print 'With an ideal diode, Vpout =',round(Vpout,2),'V'\n",
+ "print 'DC load voltage, Vdc =',round(Vdc1,2),'V'\n",
+ "print 'With second approximation, Vpout =',round(Vpouts,2),'V'\n",
+ "print 'DC load voltage, Vdc =',round(Vdc2,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As per fig.4-5, Transformer turns ratio is 5:1\n",
+ "V2= 24.0 V\n",
+ "Vp= 33.95 V\n",
+ "With an ideal diode, Vpout = 33.95 V\n",
+ "DC load voltage, Vdc = 10.81 V\n",
+ "With second approximation, Vpout = 33.25 V\n",
+ "DC load voltage, Vdc = 10.58 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-3, Page 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.3.py\n",
+ "#Figure 4.7 shows full wave rectifier, Calculate the peak input and output voltages.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=10 #turn ratio\n",
+ "\n",
+ "#Calculation\n",
+ "Vp1=Vrms/0.707 #peak primary voltage(V)\n",
+ "Vp2=Vp1/N12 #peak secondary voltage(V)\n",
+ "Vpin=0.5*Vp2 #input voltage(V)\n",
+ "Vpout=Vpin #Output voltage (V)\n",
+ "Vpouts=Vpin-0.7 #Output voltage in 2nd approx.(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Peak primary voltage Vp1=',round(Vp1,2),'V'\n",
+ "print 'Peak secondary voltage Vp2=',round(Vp2,2),'V'\n",
+ "print 'Due to center-tap,' \n",
+ "print 'input voltage to each half-wave rectifier is only half the secondary voltage:'\n",
+ "print 'With an ideal diode, Vpout =',round(Vpout,2),'V'\n",
+ "print 'With second approximation, Vpout =',round(Vpouts,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak primary voltage Vp1= 169.73 V\n",
+ "Peak secondary voltage Vp2= 16.97 V\n",
+ "Due to center-tap,\n",
+ "input voltage to each half-wave rectifier is only half the secondary voltage:\n",
+ "With an ideal diode, Vpout = 8.49 V\n",
+ "With second approximation, Vpout = 7.79 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-4, Page 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.4.py\n",
+ "#Figure 4.7 shows full wave rectifier. If one of the diodes were open then, calculate the peak input and output voltages.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=10 #turn ratio\n",
+ "\n",
+ "#Calculation\n",
+ "Vp1=Vrms/0.707 #peak primary voltage(V)\n",
+ "Vp2=Vp1/N12 #peak secondary voltage(V)\n",
+ "Vpin=0.5*Vp2 #input voltage(V)\n",
+ "Vpout=Vpin #Output voltage(V)\n",
+ "Vpouts=Vpin-0.7 #Output voltage in 2nd approx.(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Peak primary voltage Vp1=',round(Vp1,2),'V'\n",
+ "print 'Peak secondary voltage Vp2=',round(Vp2,2),'V'\n",
+ "print 'Due to one of the diodes were open, load voltage will be the half wave signal'\n",
+ "print 'But still peak of half wave signal is same as prior case'\n",
+ "print 'With an ideal diode, Vpout =',round(Vpout,2),'V'\n",
+ "print 'With second approximation, Vpout =',round(Vpouts,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak primary voltage Vp1= 169.73 V\n",
+ "Peak secondary voltage Vp2= 16.97 V\n",
+ "Due to one of the diodes were open, load voltage will be the half wave signal\n",
+ "But still peak of half wave signal is same as prior case\n",
+ "With an ideal diode, Vpout = 8.49 V\n",
+ "With second approximation, Vpout = 7.79 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-5, Page 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.5.py\n",
+ "#Calculate peak & output voltages in figure 4.9\n",
+ "\n",
+ "#variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=10 #turn ratio\n",
+ "\n",
+ "#Calculation\n",
+ "Vp1=Vrms/0.707 #peak primary voltage(V)\n",
+ "Vp2=Vp1/N12 #peak secondary voltage(V)\n",
+ "Vpout=Vp2 #Output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Peak primary voltage Vp1=',round(Vp1,2),'V'\n",
+ "print 'Peak secondary voltage Vp2=',round(Vp2,2),'V'\n",
+ "print 'secondary voltage is input of rectifier'\n",
+ "print 'With an ideal diode, Vpout =',round(Vpout,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak primary voltage Vp1= 169.73 V\n",
+ "Peak secondary voltage Vp2= 16.97 V\n",
+ "secondary voltage is input of rectifier\n",
+ "With an ideal diode, Vpout = 16.97 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-6, Page 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.6.py\n",
+ "#What is the dc load voltage and ripple in figure 4.14?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=5 #turn ratio\n",
+ "RL=5 #Load resistance(KOhm)\n",
+ "C=100 #Capacitance(uF)\n",
+ "f=60 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vrms/N12 #RMS secondary voltage(V)\n",
+ "Vp=V2/0.707 #peak secondary voltage(V)\n",
+ "VL=Vp #dc load voltage(V)\n",
+ "IL=VL/RL #Load current(mA)\n",
+ "VR=(IL/(f*C))*(10**3) #ripple voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'RMS secondary voltage V2=',V2,'V'\n",
+ "print 'Peak secondary voltage Vp=',round(Vp,2),'V'\n",
+ "print 'with ideal diode and small ripple, dc load voltage, VL =',round(VL,2),'V'\n",
+ "print 'To calculate ripple get, dc load current,'\n",
+ "print 'DC Load current IL=',round(IL,2),'mA'\n",
+ "print 'As per ripple formula,'\n",
+ "print 'Ripple voltage VR=',round(VR,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RMS secondary voltage V2= 24 V\n",
+ "Peak secondary voltage Vp= 33.95 V\n",
+ "with ideal diode and small ripple, dc load voltage, VL = 33.95 V\n",
+ "To calculate ripple get, dc load current,\n",
+ "DC Load current IL= 6.79 mA\n",
+ "As per ripple formula,\n",
+ "Ripple voltage VR= 1.13 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-7, Page 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.7.py\n",
+ "#What is the dc load voltage and ripple in figure 4.15?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=5 #turn ratio\n",
+ "RL=5 #Load resistance(KOhm)\n",
+ "C=100 #Capacitance(uF)\n",
+ "f=60 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vrms/N12 #RMS secondary voltage(V)\n",
+ "Vp=V2/0.707 #peak secondary voltage(V)\n",
+ "VL=Vp/2 #dc load voltage(V)\n",
+ "IL=VL/RL #Load current(mA)\n",
+ "VR=(IL/(2*f*C))*(10**3) #ripple voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'RMS secondary voltage V2=',V2,'V'\n",
+ "print 'Peak secondary voltage Vp=',round(Vp,2),'V'\n",
+ "print 'Half this voltage is input to each half-wave section, with ideal diode and small ripple, dc load voltage, VL =',round(VL,2),'V'\n",
+ "print 'But, due to 0.7V across conducting diode actual dc voltage is, VL =',round((VL-0.7),2),'V'\n",
+ "print 'To calculate ripple get, dc load current,'\n",
+ "print 'DC Load current IL=',round(IL,2),'mA'\n",
+ "print 'As per ripple formula,'\n",
+ "print 'Ripple voltage VR=',round(VR,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RMS secondary voltage V2= 24 V\n",
+ "Peak secondary voltage Vp= 33.95 V\n",
+ "Half this voltage is input to each half-wave section, with ideal diode and small ripple, dc load voltage, VL = 16.97 V\n",
+ "But, due to 0.7V across conducting diode actual dc voltage is, VL = 16.27 V\n",
+ "To calculate ripple get, dc load current,\n",
+ "DC Load current IL= 3.39 mA\n",
+ "As per ripple formula,\n",
+ "Ripple voltage VR= 0.28 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-8, Page 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.8.py\n",
+ "#What is the dc load voltage and ripple in figure 4.16?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=5 #turn ratio\n",
+ "RL=5 #Load resistance(KOhm)\n",
+ "C=100 #Capacitance(uF)\n",
+ "f=60 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vrms/N12 #RMS secondary voltage(V)\n",
+ "Vp=V2/0.707 #peak secondary voltage(V)\n",
+ "VL=Vp #dc load voltage(V)\n",
+ "IL=VL/RL #Load current(mA)\n",
+ "VR=(IL/(2*f*C))*(10**3) #ripple voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'RMS secondary voltage V2=',V2,'V'\n",
+ "print 'Peak secondary voltage Vp=',round(Vp,2),'V'\n",
+ "print 'with ideal diode and small ripple, dc load voltage, VL =',round(VL,2),'V'\n",
+ "print 'But, due to 1.4V across two conducting diodes actual dc voltage is, VL =',round((VL-1.4),2),'V'\n",
+ "print 'To calculate ripple get, dc load current,'\n",
+ "print 'DC Load current IL=',round(IL,2),'mA'\n",
+ "print 'As per ripple formula,'\n",
+ "print 'Ripple voltage VR=',round(VR,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RMS secondary voltage V2= 24 V\n",
+ "Peak secondary voltage Vp= 33.95 V\n",
+ "with ideal diode and small ripple, dc load voltage, VL = 33.95 V\n",
+ "But, due to 1.4V across two conducting diodes actual dc voltage is, VL = 32.55 V\n",
+ "To calculate ripple get, dc load current,\n",
+ "DC Load current IL= 6.79 mA\n",
+ "As per ripple formula,\n",
+ "Ripple voltage VR= 0.57 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-9, Page 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.9.py\n",
+ "#Calculate the dc load voltage and ripple in figure 4.17\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=15 #turn ratio\n",
+ "RL=0.5 #Load resistance(KOhm)\n",
+ "C=4700 #Capacitance(uF)\n",
+ "f=60 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vrms/N12 #RMS secondary voltage(V)\n",
+ "Vp=V2/0.707 #peak secondary voltage(V)\n",
+ "VL=Vp-1.4 #dc load voltage(V)\n",
+ "IL=VL/RL #Load current(mA)\n",
+ "VR=(IL/(2*f*C))*(10**3) #ripple voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'RMS secondary voltage V2=',V2,'V'\n",
+ "print 'Peak secondary voltage Vp=',round(Vp,2),'V'\n",
+ "print 'with ideal diode and small ripple & due to 1.4V across two conducting diodes actual dc voltage is, VL =',round(VL,2),'V'\n",
+ "print 'To calculate ripple get, dc load current,'\n",
+ "print 'DC Load current IL=',round(IL,2),'mA'\n",
+ "print 'As per ripple formula,'\n",
+ "print 'Ripple voltage VR=',round((VR*1000),2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RMS secondary voltage V2= 8 V\n",
+ "Peak secondary voltage Vp= 11.32 V\n",
+ "with ideal diode and small ripple & due to 1.4V across two conducting diodes actual dc voltage is, VL = 9.92 V\n",
+ "To calculate ripple get, dc load current,\n",
+ "DC Load current IL= 19.83 mA\n",
+ "As per ripple formula,\n",
+ "Ripple voltage VR= 35.16 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4-10, Page 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.10.py\n",
+ "#What is the peak inverse voltage for turns ratio is 8:1?\n",
+ "#Breakdown voltage of 50V.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vrms=120 #RMS value of supply(V)\n",
+ "N12=8 #turn ratio\n",
+ "f=60 #Frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=Vrms/N12 #RMS secondary voltage(V)\n",
+ "Vp=V2/0.707 #peak secondary voltage(V)\n",
+ "PIV = Vp #Peak Inverse Voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'RMS secondary voltage V2=',V2,'V'\n",
+ "print 'Peak inverse voltage PIV =',round(PIV,2),'V'\n",
+ "print 'PIV << breakdown voltage(50V), So, it is safe to use IN4001'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RMS secondary voltage V2= 15 V\n",
+ "Peak inverse voltage PIV = 21.22 V\n",
+ "PIV << breakdown voltage(50V), So, it is safe to use IN4001\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_5_New.ipynb b/Electronic_Principles_/Chapter_5_New.ipynb
new file mode 100644
index 00000000..44f83157
--- /dev/null
+++ b/Electronic_Principles_/Chapter_5_New.ipynb
@@ -0,0 +1,508 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 5 SPECIAL-PURPOSE DIODES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-1, Page 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.1.py\n",
+ "#Zener diode of figure 5.4a has breakdown voltage of 10V. \n",
+ "#What are the minimum & maximum zener currents? \n",
+ "\n",
+ "#Variable declaration\n",
+ "Vsmin=20 #Source voltage minimum(V)\n",
+ "Vsmax=40 #Source voltage maximum(V)\n",
+ "Vbd=10 #Breakdown voltage(V)\n",
+ "R=0.82 #Resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vr1=Vsmin-Vbd #voltage across resistor(V)\n",
+ "Is1=Vr1/R #Minimum current(mA)\n",
+ "Vr2=Vsmax-Vbd #voltage across resistor(V)\n",
+ "Is2=Vr2/R #Maximum current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Ideally, zener diode acts as a battery(of breakdown voltage = 10V) shown in figure 5-4b'\n",
+ "print 'Minimum current Is1=',round(Is1,2),'mA'\n",
+ "print 'Maximum current Is1=',round(Is2,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ideally, zener diode acts as a battery(of breakdown voltage = 10V) shown in figure 5-4b\n",
+ "Minimum current Is1= 12.2 mA\n",
+ "Maximum current Is1= 36.59 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-2, Page 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.2.py\n",
+ "#Is the zener diode of figure 5-6a operating in the breakdown region?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=18 #supply voltage(V)\n",
+ "Rs=0.27 #source resistance(KOhm)\n",
+ "RL=1 #Load resistance(KOhm)\n",
+ "Vz=10 #Zener voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VTH=(RL/(Rs+RL))*Vs #Thevenin voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Thevenin voltage VTH = ',round(VTH,2),'V'\n",
+ "print 'Thevenin voltage is greater than zener voltage, zener diode is operating in breakdown region.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thevenin voltage VTH = 14.17 V\n",
+ "Thevenin voltage is greater than zener voltage, zener diode is operating in breakdown region.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-3, Page 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.3.py\n",
+ "#What does the zener current equal in Figure 5-6b?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=18 #supply voltage(V)\n",
+ "Rs=0.27 #source resistance(KOhm)\n",
+ "RL=1 #Load resistance(KOhm)\n",
+ "Vbd=10 #Zener voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Vr=Vs-Vbd #voltage across resistor(V)\n",
+ "Is=Vr/Rs #Current(mA)\n",
+ "IL=Vbd/RL #Current(mA)\n",
+ "Iz=Is-IL #Zener current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load current IL = ',IL,'mA'\n",
+ "print 'Zener current Iz = ',round(Iz,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load current IL = 10 mA\n",
+ "Zener current Iz = 19.63 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-7, Page 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.7.py\n",
+ "#The zener diode of figure 5-12 has a breakdown voltage of 10V and a zener resistance of 8.5 Ohm.\n",
+ "#Use second approx. to calculate load voltage when zener current is 20 mA.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Iz=20 #zener current(mA)\n",
+ "Rz=8.5 #zener resistance(Ohm)\n",
+ "Vbd=10 #Zener voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "DVL=Iz*Rz/1000 #change in load voltage(V)\n",
+ "VL=Vbd+DVL #Load voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Change in load voltage DVL =',DVL,'V'\n",
+ "print 'Load voltage with second approx., VL =',VL,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in load voltage DVL = 0.17 V\n",
+ "Load voltage with second approx., VL = 10.17 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-8, Page 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.8.py\n",
+ "#In figure 5-12, Rs = 270 Ohm, Rz=8.5 Ohm and VR(in)=2V. \n",
+ "#What is the approximate ripple voltage across the load?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rs=270 #Source resistance (Ohm)\n",
+ "Rz=8.5 #zener resistance(Ohm)\n",
+ "VRin=2 #Zener voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VRout=(Rz/Rs)*VRin*1000 #Load ripple voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Load ripple voltage VRout=',round(VRout,2),'mV'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load ripple voltage VRout= 62.96 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-10, Page 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.10.py\n",
+ "#A zener regulator has an i/p voltage varies from 22 to 30 V. \n",
+ "#If the regulated output voltage is 12 V & load resistance varies from 140 Ohm to 10 KOhm, Find maximum allowable series resistance.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vil=22 #input voltage range low(V)\n",
+ "Vih=30 #input voltage range high(V)\n",
+ "Vz=12 #regulated output voltage(V)\n",
+ "Rl=140 #Load resistance low(KOhm)\n",
+ "Rh=10 #Load resistance high(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "RSmax=Rl*(float(Vil)/float(Vz)-1) #Maximum series resistance\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum series resistance RSmax =',round(RSmax,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum series resistance RSmax = 116.67 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-11, Page 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.11.py\n",
+ "\n",
+ "#A zener regulator has an input voltage varies from 15 to 20 V. \n",
+ "#If zenerge is 6.8V and load current varies from 5 mA to 20 mA,find maximum allowable series resistance.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vil=15 #input voltage range low(V)\n",
+ "Vih=20 #input voltage range high(V)\n",
+ "Vz=6.8 #regulated output voltage(V)\n",
+ "Il=5 #Load current low(mA)\n",
+ "Ih=20 #Load current high(mA)\n",
+ "\n",
+ "#Calculation\n",
+ "RSmax=(Vil-float(Vz))/Ih*1000 #Maximum series resistance\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum series resistance RSmax =',RSmax,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum series resistance RSmax = 410.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-12, Page 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.12.py\n",
+ "#Figure 5-23a shows voltage-polarity tester. Find approx. LED current if the dc input voltage is 50V & series resistance is 2.2 KOhm.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vi=50 #voatage supply(V)\n",
+ "Rs=2.2 #series resistance(KOhm)\n",
+ "Vf=2 #forward approx. voltage\n",
+ " \n",
+ "#Calculation\n",
+ "Is=(Vi-Vf)/Rs\n",
+ "\n",
+ "#Result\n",
+ "print 'LED current Is =',round(Is,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LED current Is = 21.82 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-13, Page 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.13.py\n",
+ "#Figure 5-23b shows continuity tester. find approx. LED current if the series resistance is 470 Ohm.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=9 #voatage supply(V)\n",
+ "Rs=470.0 #series resistance(Ohm)\n",
+ "Vf=2 #forward approx. voltage\n",
+ " \n",
+ "#Calculation\n",
+ "Is=(Vs-Vf)/Rs\n",
+ "\n",
+ "#Result\n",
+ "print 'LED current Is =',round((Is*1000),2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LED current Is = 14.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-14, Page 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.14.py\n",
+ "#In figure 5-24, find avg. LED current if the ac source voltage is 20V rms and series resistance is 680 Ohm.\n",
+ "#Also calculate approx. power dissipation in series resistor.\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vac=20 #AC voatage supply(V)\n",
+ "Rs=680.0 #series resistance(KOhm)\n",
+ " \n",
+ "#Calculation\n",
+ "Vacp=1.414*Vac #peak source voltage(V)\n",
+ "Is1=(Vacp/Rs)*1000 #approx. peak current(mA)\n",
+ "Is2=Is1/math.pi #average of half-wave current through LED(mA)\n",
+ "P=(Vac)**2/Rs #Power dissipation(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'approx. peak LED current Is1 =',round(Is1,2),'mA'\n",
+ "print 'average of half-wave current through LED Is2 =',round(Is2,2),'mA'\n",
+ "print 'Power dissipation P =',round(P,2),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "approx. peak LED current Is1 = 41.59 mA\n",
+ "average of half-wave current through LED Is2 = 13.24 mA\n",
+ "Power dissipation P = 0.59 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5-15, Page 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.15.py\n",
+ "#Figure 5-25, find capacitor is used instead of resistor. \n",
+ "#what is average LED current if the capacitance is 0.68 uf?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=120 #AC voatage supply(V)\n",
+ "f=60 #frequency(Hz)\n",
+ "C=0.68 #series resistance(KOhm)\n",
+ " \n",
+ "#Calculation\n",
+ "Xc=1/(2*math.pi*f*C)*1000 #capacitive reactance(KOhm)\n",
+ "Vacp=Vs*1.414\n",
+ "Is1=(Vacp/Xc) #approx. peak current(mA)\n",
+ "Is2=Is1/math.pi #average current through LED(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Capacitance reactance Xc = ',round(Xc,2),'KOhm'\n",
+ "print 'approx. peak LED current Is1 =',round(Is1,2),'mA'\n",
+ "print 'average current through LED Is2 =',round(Is2,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance reactance Xc = 3.9 KOhm\n",
+ "approx. peak LED current Is1 = 43.5 mA\n",
+ "average current through LED Is2 = 13.85 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_6_New.ipynb b/Electronic_Principles_/Chapter_6_New.ipynb
new file mode 100644
index 00000000..6cc29f0f
--- /dev/null
+++ b/Electronic_Principles_/Chapter_6_New.ipynb
@@ -0,0 +1,596 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 6 BIPOLAR JUNCTION TRANSISTOR"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-1, Page 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.1.py\n",
+ "#A transistor has a collector current of 10 mA and a base current of 40 uA. find current gain. \n",
+ "\n",
+ "#Variable declaration\n",
+ "Ic=10 #collector current(mA)\n",
+ "Ib=40.0/1000.0 #base current (mA)\n",
+ "\n",
+ "#Calculation\n",
+ "Bdc=Ic/Ib #Current gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Current gain Bdc =',Bdc"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current gain Bdc = 250.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-2, Page 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.2.py\n",
+ "#A transistor has a currrent gain of 175 and a base current of 0.1 mA. find collector current. \n",
+ "\n",
+ "#Variable declaration\n",
+ "Bdc=175 #current gain\n",
+ "Ib=0.1 #base current (mA)\n",
+ "\n",
+ "#Calculation\n",
+ "Ic=Bdc*Ib #Current gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Collector current Ic =',Ic,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current Ic = 17.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-3, Page 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.3.py\n",
+ "#A transistor has a collector current of 2 mA. If the currrent gain of 135. find base current. \n",
+ "\n",
+ "#Variable declaration\n",
+ "Bdc=135.0 #current gain\n",
+ "Ic=2.0 #collector current (mA)\n",
+ "\n",
+ "#Calculation\n",
+ "Ib=(Ic/Bdc)*1000 #Current gain\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current Ib =',round(Ib,2),'uA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current Ib = 14.81 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-4, Page 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.4.py\n",
+ "#Use the second approx. to calculate the base current in figure 6-8b. \n",
+ "#Find voltage across the base resistor & collector current if Bdc=200. \n",
+ "\n",
+ "#Variable declaration\n",
+ "Vbb=2 #base source voltage(V)\n",
+ "Rb=100 #base resistor (KOhm)\n",
+ "Bdc=200 #current gain\n",
+ "Vbe=0.7 #base-emitter voltage drop(V)\n",
+ "\n",
+ "#Calculation\n",
+ "Ib=((Vbb-Vbe)/Rb)*1000 #base current(uA)\n",
+ "Ic=Bdc*Ib/1000 #Collector current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current Ib =',Ib,'uA'\n",
+ "print 'Collector current Ic =',Ic,'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current Ib = 13.0 uA\n",
+ "Collector current Ic = 2.6 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-5, Page 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.5.py\n",
+ "#The transistor of Figure 6-11a has Bdc=300. Calculate IB,IC,VCE & PD\n",
+ "\n",
+ "#Variable declaration\n",
+ "VBB=10 #Base voltage (V)\n",
+ "RC=2 #Collector resistance(KOhm)\n",
+ "VCC=10 #collector voltage(V)\n",
+ "Bdc=300 #current gain\n",
+ "RB=1 #base resistance (MOhm)\n",
+ "VBE=0.7 #base-emitter voltage drop(V) \n",
+ "\n",
+ "#Calculation\n",
+ "IB=((VBB-VBE)/RB) #base current(uA)\n",
+ "IC=Bdc*IB/1000 #Collector current(mA)\n",
+ "VCE=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "PD=VCE*IC #Collector power dissipation(W)\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current IB =',IB,'uA'\n",
+ "print 'Collector current IC =',IC,'mA'\n",
+ "print 'Collector-emitter voltage VCE =',VCE,'V'\n",
+ "print 'Power dissipation PD = ',round(PD,2),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current IB = 9.3 uA\n",
+ "Collector current IC = 2.79 mA\n",
+ "Collector-emitter voltage VCE = 4.42 V\n",
+ "Power dissipation PD = 12.33 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-6, Page 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.6.py\n",
+ "#Calculate current gain of the 2N4424 shown in figure 6-12.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VBB=10 #Base voltage (V)\n",
+ "RC=470 #Collector resistance(Ohm)\n",
+ "VCC=10 #collector voltage(V)\n",
+ "Bdc=300 #current gain\n",
+ "VCE=5.4535 #collector-emitter voltage shown on multisim screen \n",
+ "RB=330 #base resistance (KOhm)\n",
+ "VBE=0.7 #base-emitter voltage drop \n",
+ "\n",
+ "#Calculation\n",
+ "IB=((VBB-VBE)/RB)*1000 #base current(uA)\n",
+ "V=VCC-VCE #voltage across Rc\n",
+ "IC=(V/RC)*1000 #Collector current(mA)\n",
+ "Bdc=int((IC/IB)*1000) #Collector-emitter voltage\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current IB =',round(IB,2),'uA'\n",
+ "print 'voltage across Rc VRc = ',round(V,2),'V'\n",
+ "print 'Collector current IC =',round(IC,2),'mA'\n",
+ "print 'Current gain Bdc = ',Bdc"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current IB = 28.18 uA\n",
+ "voltage across Rc VRc = 4.55 V\n",
+ "Collector current IC = 9.67 mA\n",
+ "Current gain Bdc = 343\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-7, Page 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.7.py\n",
+ "#What is the collector-emitter voltage in figure 6-14? Use the ideal transistor.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VBB=15 #Base voltage (V)\n",
+ "RC=3.6 #Collector resistance(KOhm)\n",
+ "VCC=15 #collector voltage(V)\n",
+ "Bdc=100 #current gain\n",
+ "RB=470 #base resistance (KOhm)\n",
+ "VBE=0 #base-emitter voltage drop(V) \n",
+ "\n",
+ "#Calculation\n",
+ "IB=((VBB-VBE)/float(RB))*1000 #base current(uA)\n",
+ "IC=Bdc*IB/1000 #Collector current(mA)\n",
+ "VCE=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "IE=IC+(IB/1000) #emitter current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current IB =',round(IB,2),'uA'\n",
+ "print 'Collector current IC =',round(IC,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE = ',round(VCE,2),'V'\n",
+ "print 'Emitter current IE =',round(IE,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current IB = 31.91 uA\n",
+ "Collector current IC = 3.19 mA\n",
+ "Collector-emitter voltage VCE = 3.51 V\n",
+ "Emitter current IE = 3.22 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-8, Page 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.8.py\n",
+ "#What is the collector-emitter voltage in figure 6-14? Use the second approximation.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VBB=15 #Base voltage (V)\n",
+ "RC=3.6 #Collector resistance(KOhm)\n",
+ "VCC=15 #collector voltage(V)\n",
+ "Bdc=100 #current gain\n",
+ "RB=470 #base resistance (KOhm)\n",
+ "VBE=0.7 #base-emitter voltage drop(V) \n",
+ "\n",
+ "#Calculation\n",
+ "IB=((VBB-VBE)/float(RB))*1000 #base current(uA)\n",
+ "IC=Bdc*IB/1000 #Collector current(mA)\n",
+ "VCE=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current IB =',round(IB,2),'uA'\n",
+ "print 'Collector current IC =',round(IC,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE = ',round(VCE,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current IB = 30.43 uA\n",
+ "Collector current IC = 3.04 mA\n",
+ "Collector-emitter voltage VCE = 4.05 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-9, Page 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.9.py\n",
+ "#suppose you measure a VBE 1V. What is the collector-emitter voltage in figure 6-14?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VBB=15 #Base voltage (V)\n",
+ "RC=3.6 #Collector resistance(KOhm)\n",
+ "VCC=15 #collector voltage(V)\n",
+ "Bdc=100 #current gain\n",
+ "RB=470 #base resistance (KOhm)\n",
+ "VBE=1 #base-emitter voltage drop(V) \n",
+ "\n",
+ "#Calculation\n",
+ "IB=((VBB-VBE)/float(RB))*1000 #base current(uA)\n",
+ "IC=Bdc*IB/1000 #Collector current(mA)\n",
+ "VCE=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current IB =',round(IB,2),'uA'\n",
+ "print 'Collector current IC =',round(IC,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE = ',round(VCE,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current IB = 29.79 uA\n",
+ "Collector current IC = 2.98 mA\n",
+ "Collector-emitter voltage VCE = 4.28 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-10, Page 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.10.py\n",
+ "#What is the collector-emitter voltage in preceding examples if base supply voltage is 5V?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VBB=5 #Base voltage (V)\n",
+ "RC=3.6 #Collector resistance(KOhm)\n",
+ "VCC=15 #collector voltage(V)\n",
+ "Bdc=100 #current gain\n",
+ "RB=470 #base resistance (KOhm)\n",
+ "VBE1=0 #base-emitter voltage drop1(V) \n",
+ "VBE2=0.7 #base-emitter voltage drop2(V)\n",
+ "VBE3=1 #base-emitter voltage drop3(V)\n",
+ "\n",
+ "#Calculation\n",
+ "IB1=((VBB-VBE1)/float(RB))*1000 #base current1(uA)\n",
+ "IC1=Bdc*IB1/1000 #Collector current1(mA)\n",
+ "VCE1=VCC-(IC1*RC) #Collector-emitter voltage1(V)\n",
+ "\n",
+ "IB2=((VBB-VBE2)/float(RB))*1000 #base current2(uA)\n",
+ "IC2=Bdc*IB2/1000 #Collector current2(mA)\n",
+ "VCE2=VCC-(IC2*RC) #Collector-emitter voltage2(V)\n",
+ "\n",
+ "IB3=((VBB-VBE3)/float(RB))*1000 #base current3(uA)\n",
+ "IC3=Bdc*IB3/1000 #Collector current3(mA)\n",
+ "VCE3=VCC-(IC3*RC) #Collector-emitter voltage3(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Base current IB1 =',round(IB1,2),'uA'\n",
+ "print 'Collector current IC1 =',round(IC1,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE1 = ',round(VCE1,2),'V'\n",
+ "\n",
+ "print 'Base current IB2 =',round(IB2,2),'uA'\n",
+ "print 'Collector current IC2 =',round(IC2,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE2 = ',round(VCE2,2),'V'\n",
+ "\n",
+ "print 'Base current IB3 =',round(IB3,2),'uA'\n",
+ "print 'Collector current IC3 =',round(IC3,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE3 = ',round(VCE3,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current IB1 = 10.64 uA\n",
+ "Collector current IC1 = 1.06 mA\n",
+ "Collector-emitter voltage VCE1 = 11.17 V\n",
+ "Base current IB2 = 9.15 uA\n",
+ "Collector current IC2 = 0.91 mA\n",
+ "Collector-emitter voltage VCE2 = 11.71 V\n",
+ "Base current IB3 = 8.51 uA\n",
+ "Collector current IC3 = 0.85 mA\n",
+ "Collector-emitter voltage VCE3 = 11.94 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-11, Page 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.11.py\n",
+ "#A 2N3904 has VCE = 10V and Ic = 20mA. find power dissipation. \n",
+ "#How safe is this level of power dissipation if the ambient temperature is 25 deg C?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCE=10 #Collector-emitter voltage(V)\n",
+ "IC=20 #Collector current(mA)\n",
+ "T=25 #Ambient temperature(deg C)\n",
+ " \n",
+ "#Calculation\n",
+ "PD = VCE*IC #Power dissipation(mW)\n",
+ "\n",
+ "#Result\n",
+ "print 'Power dissipation PD = ',PD,'mW'\n",
+ "print 'for 25 deg C, power rating is 625 mW So, transistor is well within power rating.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power dissipation PD = 200 mW\n",
+ "for 25 deg C, power rating is 625 mW So, transistor is well within power rating.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6-12, Page 212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.12.py\n",
+ "#How safe is the level of power dissipation if the ambient temeprature is 100 deg C in example 6-11?\n",
+ "\n",
+ "#Variable declaration\n",
+ "T1=100 #Ambient temperature(deg C)\n",
+ "T2=25 #Reference temperature(deg C)\n",
+ "mf=5 #Multiply factor(mW/deg C) \n",
+ "Pr=625 #power rating(mW)\n",
+ "\n",
+ "#Calculation\n",
+ "Td=T1-T2 #Temperature difference(deg C)\n",
+ "Pd=mf*Td #Difference in power(mW)\n",
+ "PDmax=Pr-Pd #Maximum power dissipation(mW)\n",
+ "\n",
+ "#Result\n",
+ "print 'Maximum Power dissipation PDmax = ',PDmax,'mW'\n",
+ "print 'for 25 deg C, power rating is 625 mW So, transistor is yet within power rating.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Power dissipation PDmax = 250 mW\n",
+ "for 25 deg C, power rating is 625 mW So, transistor is yet within power rating.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_7_New.ipynb b/Electronic_Principles_/Chapter_7_New.ipynb
new file mode 100644
index 00000000..5f237c0c
--- /dev/null
+++ b/Electronic_Principles_/Chapter_7_New.ipynb
@@ -0,0 +1,480 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 7 TRANSISTOR FUNDAMENTALS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-1, Page 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.1.py\n",
+ "#Find saturation current and the cutoff voltage in Figure 7-4a.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=30 #collector voltage(V)\n",
+ "RC=3 #Collector resistance (KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ICsat=VCC/RC #Saturation current(mA)\n",
+ "VCEc=VCC #VCE cutoff voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Saturation current IC(saturation) = ',ICsat,'mA'\n",
+ "print 'Collector emitter cutoff VCE(cutoff) = ',VCEc,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation current IC(saturation) = 10 mA\n",
+ "Collector emitter cutoff VCE(cutoff) = 30 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-2, Page 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.2.py\n",
+ "#What are the saturation current and the cutoff voltage in Figure 7-4b? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=9 #collector voltage(V)\n",
+ "RC=3 #Collector resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ICsat=VCC/RC #Saturation current(mA)\n",
+ "VCEc=VCC #VCE cutoff voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Saturation current IC(saturation) = ',ICsat,'mA'\n",
+ "print 'Collector emitter cutoff VCE(cutoff) = ',VCEc,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation current IC(saturation) = 3 mA\n",
+ "Collector emitter cutoff VCE(cutoff) = 9 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-3, Page 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.3.py\n",
+ "#What are the saturation current and the cutoff voltage in Figure 7-5a? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "RC=1 #Collector resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ICsat=VCC/RC #Saturation current(mA)\n",
+ "VCEc=VCC #VCE cutoff voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Saturation current IC(saturation) = ',ICsat,'mA'\n",
+ "print 'Collector emitter cutoff VCE(cutoff) = ',VCEc,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation current IC(saturation) = 15 mA\n",
+ "Collector emitter cutoff VCE(cutoff) = 15 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-4, Page 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.4.py\n",
+ "#What are the saturation current and the cutoff voltage in Figure 7-5b? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "RC=3 #Collector resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "ICsat=VCC/RC #Saturation current(mA)\n",
+ "VCEc=VCC #VCE cutoff voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Saturation current IC(saturation) = ',ICsat,'mA'\n",
+ "print 'Collector emitter cutoff VCE(cutoff) = ',VCEc,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation current IC(saturation) = 5 mA\n",
+ "Collector emitter cutoff VCE(cutoff) = 15 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-5, Page 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.5.py\n",
+ "#Base resistance is increased to 1MOhm. What happens to the collector-emitter voltage if Bdc is 100?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15.0 #collector voltage(V)\n",
+ "RC=3 #collector resistance (KOhm)\n",
+ "VBB=15.0 #base voltage(V)\n",
+ "RB=1 #base resistance (MOhm)\n",
+ "Bdc=100 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "IB1=(VBB/RB) #base current(uA)\n",
+ "IC1=Bdc*IB1/1000 #Collector current(mA)\n",
+ "VCE1=VCC-(IC1*RC) #Collector-emitter voltage(V)\n",
+ "\n",
+ "#second approx. calculation\n",
+ "IB2=((VBB-0.7)/RB) #base current(uA)\n",
+ "IC2=Bdc*IB2/1000 #Collector current(mA)\n",
+ "VCE2=VCC-(IC2*RC) #Collector-emitter voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Collector emitter voltage VCE1 = ',VCE1,'V'\n",
+ "print 'For second approx., collector emitter voltage VCE2 = ',VCE2,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector emitter voltage VCE1 = 10.5 V\n",
+ "For second approx., collector emitter voltage VCE2 = 10.71 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-6, Page 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.6.py\n",
+ "#Base resistance of figure 7-7a is increased to 1MOhm. \n",
+ "#Is the saturation still saturated?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=20.0 #collector voltage(V)\n",
+ "RC=10 #collector resistance (KOhm)\n",
+ "VBB=10.0 #base voltage(V)\n",
+ "RB=1 #base resistance (MOhm)\n",
+ "Bdc=50 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "IB=(VBB/RB) #base current(uA)\n",
+ "IC=Bdc*IB/1000 #Collector current(mA)\n",
+ "VCE=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Collector emitter voltage VCE = ',VCE,'V'\n",
+ "print 'So, transistor is in active region.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector emitter voltage VCE = 15.0 V\n",
+ "So, transistor is in active region\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-7, Page 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.7.py\n",
+ "#Collector resistance of figure 7-7a is decreased to 5KOhm. Does the transistor remain in the saturation region?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=20.0 #collector voltage(V)\n",
+ "RC=5 #collector resistance (KOhm)\n",
+ "VBB=10.0 #base voltage(V)\n",
+ "RB=100 #base resistance(KOhm)\n",
+ "Bdco=50 #old current gain\n",
+ "\n",
+ "#Calculation\n",
+ "ICsat=VCC/RC #Saturation current(mA)\n",
+ "IB=VBB/RB #base current(mA)\n",
+ "IC=Bdc*IB/1000 #Collector current(mA)\n",
+ "VCE=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "Bdcn=ICsat/IB #New current gain\n",
+ " \n",
+ "\n",
+ "#Result\n",
+ "print 'ICsat = ',ICsat,'mA'\n",
+ "print 'Bdc = ',int(Bdcn)\n",
+ "print 'Current can not be more than ICsat So, current gain will decrease.'\n",
+ "print 'So, transistor has two current gain: active region & saturation region.'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ICsat = 4.0 mA\n",
+ "Bdc = 40\n",
+ "Current can not be more than ICsat So, current gain will decrease.\n",
+ "So, transistor has two current gain: active region & saturation region.\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-8, Page 236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.8.py\n",
+ "#VCC is decreased to 5V. What are the two values of the output voltage?\n",
+ "#If VCE(sat) is 0.15 V and ICEO is 50 nA, What are two values of the output voltage?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=5.0 #collector voltage(V)\n",
+ "ICEO=50 #Collector leakage current(nA)\n",
+ "RC=1 #collector resistance (KOhm)\n",
+ "VBB=10.0 #base voltage(V)\n",
+ "RB=10 #base resistance(KOhm)\n",
+ "VCEs=0.15 #VCE saturation(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VCE=VCC-((ICEO*RC)*10**-6) #Collector-emitter voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Two values of output voltage are 0 and 5 V'\n",
+ "print 'first voltage is voltage across saturated transistor = ',VCEs,'V' \n",
+ "print 'Second voltage is: VCE = ',round(VCE,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Two values of output voltage are 0 and 5 V\n",
+ "first voltage is voltage across saturated transistor = 0.15 V\n",
+ "Second voltage is: VCE = 5.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-9, Page 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.9.py\n",
+ "#What is the VC & VCE in figure 7-11?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "VBB=5 #Base voltage(V)\n",
+ "RC=2 #collector resistance (KOhm)\n",
+ "VBE=0.7 #base voltage(V)\n",
+ "RB=100 #base resistance(KOhm)\n",
+ "RE=1 #emitter resistance(KOhm)\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=(VE/RE) #emitter current(mA)\n",
+ "IC=IE #Collector current(mA)\n",
+ "VC=VCC-(IC*RC) #Collector-emitter voltage(V)\n",
+ "VCE=VC-VE #Collector-emitter voltage(V)\n",
+ " \n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',IE,'mA'\n",
+ "print 'Emitter voltage VE = ',VE,'V'\n",
+ "print 'Collector emitter voltage VCE = ',VCE,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 4.3 mA\n",
+ "Emitter voltage VE = 4.3 V\n",
+ "Collector emitter voltage VCE = 2.1 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7-10, Page 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.10.py\n",
+ "#We want 25 mA of LED current when the switch is closed in figure 7-12b. How can we do it?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=20 #collector voltage(V)\n",
+ "VBB=15 #Base voltage(V)\n",
+ "VBE=0.7 #base voltage(V)\n",
+ "RE=1.5 #emitter resistance(KOhm)\n",
+ "IE=25.0 #emitter current(mA)\n",
+ "\n",
+ "#Calculation\n",
+ "VE=IE*RE #emitter current(mA)\n",
+ "RE=(VBB/IE)*1000 #emitter resistance(KOhm)\n",
+ "RE2=((VBB-VBE)/IE)*1000 #emitter resistance(KOhm)\n",
+ " \n",
+ "#Result\n",
+ "print 'Emitter voltage VE = ',VE,'V'\n",
+ "print 'Emitter resistance RE = ',RE,'Ohm'\n",
+ "print 'Emitter resistance RE2 = ',RE2,'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter voltage VE = 37.5 V\n",
+ "Emitter resistance RE = 600.0 Ohm\n",
+ "Emitter resistance RE2 = 572.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_8_New.ipynb b/Electronic_Principles_/Chapter_8_New.ipynb
new file mode 100644
index 00000000..e3c2894e
--- /dev/null
+++ b/Electronic_Principles_/Chapter_8_New.ipynb
@@ -0,0 +1,331 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 8 TRANSISTOR BIASING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-1, Page 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.1.py\n",
+ "#What is the collector-emitter voltage in Figure 8-2? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VBB=(R2/(R1+R2))*VCC #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "IC=IE #Collector current(mA)\n",
+ "VC=VCC-(IC*RC) #collector to ground voltage(V)\n",
+ "VCE=VC-VE #Collector-emitter voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Collector current IC = ',round(IC,2),'mA'\n",
+ "print 'Collector-emitter voltage VCE = ',round(VCE,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current IC = 1.1 mA\n",
+ "Collector-emitter voltage VCE = 4.92 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-3, Page 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.3.py\n",
+ "#Is the voltage divider of figure 8-5 stiff? Calculate emitter current.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "Bdc=200 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "R=(R1*R2)/(R1+R2) #Thevenin resistance(KOhm)\n",
+ "Ri=Bdc*RE #Base input resistance(KOhm)\n",
+ "R100=0.01*Ri #100th of Ri(KOhm)\n",
+ "VBB=(R2/(R1+R2))*VCC #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/(RE+(R/Ri)) #Emitter current(mA)\n",
+ "\n",
+ "#Result\n",
+ "print 'As per stiff voltage divider rule, R1||R2 < 0.01 Bdc*RE, So, Voltage divider is stiff.'\n",
+ "print 'Emitter current IE = ',round(IE,2),'mA'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As per stiff voltage divider rule, R1||R2 < 0.01 Bdc*RE, So, Voltage divider is stiff.\n",
+ "Emitter current IE = 1.09 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-4, Page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.4.py\n",
+ "#For the circuit shown in figure 8-7, design resistor values.\n",
+ "#VCC=10 V, VCE @ mid point, IC=10mA, 2N3904's Bdc=100-300.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "IC=10 #Collector current(mA)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "Bdc=100 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "IE=IC #Emitter current(mA)\n",
+ "VE=0.1*VCC #Emitter voltage(V)\n",
+ "RE=(VE/IE)*1000 #Emitter resistance (Ohm)\n",
+ "RC=4*RE #Collector resistance(Ohm)\n",
+ "R2=0.01*Bdc*RE #Base input resistance2(Ohm)\n",
+ "V2=VE+VBE #voltage across R1(V)\n",
+ "V1=VCC-V2 #voltage across R2(V)\n",
+ "R1=(V1/V2)*R2 #Base input resistance1(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter resistance RE = ',RE,'Ohm'\n",
+ "print 'Collector resistance RC = ',RC,'Ohm'\n",
+ "print 'Base resistance R1 = ',round(R1,2),'Ohm'\n",
+ "print 'Base resistance R2 = ',R2,'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter resistance RE = 100.0 Ohm\n",
+ "Collector resistance RC = 400.0 Ohm\n",
+ "Base resistance R1 = 488.24 Ohm\n",
+ "Base resistance R2 = 100.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-5, Page 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.5.py\n",
+ "#What is the collector voltage in Figure 8-10 if emitter resistor is increased to 1.8 KOhm? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1.8 #Emitter resistance (KOhm)\n",
+ "RB=2.7 #Base resistance (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "VEE=2 #emitter voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VBB=0 #Base voltage(V)\n",
+ "VE=VEE-VBE #Emitter to ground voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "IC=IE #Collector current(mA)\n",
+ "VC=VCC-(IC*RC) #collector to ground voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',round(IE,2),'mA'\n",
+ "print 'Collector voltage VC = ',VC,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 0.72 mA\n",
+ "Collector voltage VC = 7.4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-6, Page 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.6.py\n",
+ "#Figure 8-11 shows 3 stage circuit using TSEB. Find VC.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=15 #collector voltage(V)\n",
+ "RC=10 #Collector resistance (KOhm)\n",
+ "RE=20 #Emitter resistance (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "VEE=15 #emitter voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VBB=0 #Base voltage(V)\n",
+ "VE=VEE-VBE #Emitter to ground voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "IC=IE #Collector current(mA)\n",
+ "VC=VCC-(IC*RC) #collector to ground voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',IE,'mA'\n",
+ "print 'Collector voltage VC = ',VC,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 0.715 mA\n",
+ "Collector voltage VC = 7.85 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-7, Page 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.7.py\n",
+ "#Calculate the three transistor voltages for the PNP circuit of figure 8-19b?\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=-10 #collector supply voltage(V)\n",
+ "VEE=-VCC #Emitter supply voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "\n",
+ "#Calculation\n",
+ "V2=(R2/(R1+R2))*VEE #Base voltage(V)\n",
+ "IE=(V2-VBE)/RE #Emitter current(mA)\n",
+ "VC=IE*RC #collector to ground voltage(V)\n",
+ "VB=VEE-V2 #Base to ground voltage(V)\n",
+ "VE=VEE-(V2-VBE) #Emitter to ground voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',round(IE,2),'mA'\n",
+ "print 'Collector to ground voltage VC = ',round(VC,2),'V'\n",
+ "print 'Base to ground voltage VB = ',round(VB,2),'V'\n",
+ "print 'Emitter to ground voltage VE = ',round(VE,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 1.1 mA\n",
+ "Collector to ground voltage VC = 3.97 V\n",
+ "Base to ground voltage VB = 8.2 V\n",
+ "Emitter to ground voltage VE = 8.9 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/Chapter_9_New.ipynb b/Electronic_Principles_/Chapter_9_New.ipynb
new file mode 100644
index 00000000..f0e0aec7
--- /dev/null
+++ b/Electronic_Principles_/Chapter_9_New.ipynb
@@ -0,0 +1,298 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 9 AC MODELS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9-1, Page 289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.1.py\n",
+ "#Using figure 9-1a, if R=2KOhm & the frequency range is from 20Hz to 20 KHz, \n",
+ "#find C nedded to act as a good coupling capacitor.\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f=20 #frequency(Hz)\n",
+ "R=2 #Resistance(KOhm)\n",
+ "\n",
+ "#Calculation\n",
+ "XC=0.1*R #Capacitive reactance(Ohm)\n",
+ "C=(1/(2*math.pi*f*XC))*1000 #Capacitance(uF)\n",
+ "\n",
+ "#Result\n",
+ "print 'Capacitance C = ',round(C,2),'uF'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance C = 39.79 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9-2, Page 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.2.py\n",
+ "#In figure 9-7, the input frequency of V is 1KHz. \n",
+ "#What value of C nedded to effectively short point E to ground?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f=1 #frequency(KHz)\n",
+ "R1=600 #Resistance1(Ohm)\n",
+ "R2=1000 #Resistance2(Ohm)\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "RTH=R1*R2/(R1+R2) #Thevenin resistance(Ohm)\n",
+ "XC=0.1*RTH #Capacitive reactance(Ohm)\n",
+ "C=(1/(2*math.pi*f*XC))*1000 #Capacitance(uF)\n",
+ "\n",
+ "#Result\n",
+ "print 'Capacitance C = ',round(C,2),'uF'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance C = 4.24 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9-3, Page 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.3.py\n",
+ "#Using figure 9-9, find the maximum small signal emitter current.\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RE=1 #Emitter resistance(KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "VEE=2 #Emitter supply voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "IEQ=(VEE-VBE)/RE #Q point emitter current(mA)\n",
+ "iepp=0.1*IEQ*1000 #small signal emitter current(uA) \n",
+ "\n",
+ "#Result\n",
+ "print 'Q point emitter current IEQ = ',IEQ,'mA'\n",
+ "print 'Small signal emitter current iepp = ',iepp,'uApp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q point emitter current IEQ = 1.3 mA\n",
+ "Small signal emitter current iepp = 130.0 uApp\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9-4, Page 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.4.py\n",
+ "#What does re' equal in the base-biased amplifier of figure 9-15a? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=30 #Supply voltage(V)\n",
+ "RC=5 #Collector resistance (KOhm)\n",
+ "RL=100 #Emitter resistance (KOhm)\n",
+ "RB=1 #Base resistance (MOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "Bdc=100 #current gain\n",
+ "\n",
+ "#Calculation\n",
+ "IB=(VCC-VBE)/RB #Base current(mA)\n",
+ "IE=Bdc*IB/1000 #Emitter current(mA)\n",
+ "re=25/IE #AC resistance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',IE,'mA'\n",
+ "print 'AC resistance re\\' = ',round(re,2),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 2.93 mA\n",
+ "AC resistance re' = 8.53 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9-5, Page 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.5.py\n",
+ "#What does re' equal in figure 9-15b? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "R1=10 #Base resistance1 (KOhm)\n",
+ "R2=2.2 #Base resistance2 (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VBB=(R2/(R1+R2))*VCC #Base voltage(V)\n",
+ "VE=VBB-VBE #Emitter voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "re=25/IE #AC resistance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',round(IE,2),'mA'\n",
+ "print 'AC resistance re\\' = ',round(re,2),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 1.1 mA\n",
+ "AC resistance re' = 22.66 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9-6, Page 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.6.py\n",
+ "#What is the ac resistance of emitter diode for the TSEB amplifier of figure 9-15c? \n",
+ "\n",
+ "#Variable declaration\n",
+ "VCC=10 #collector voltage(V)\n",
+ "RC=3.6 #Collector resistance (KOhm)\n",
+ "RE=1 #Emitter resistance (KOhm)\n",
+ "RB=2.7 #Base resistance (KOhm)\n",
+ "VBE=0.7 #Base-emitter voltage drop(V)\n",
+ "VEE=2 #emitter voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "VE=VEE-VBE #Emitter to ground voltage(V)\n",
+ "IE=VE/RE #Emitter current(mA)\n",
+ "re=25/IE #AC resistance(Ohm)\n",
+ "\n",
+ "#Result\n",
+ "print 'Emitter current IE = ',IE,'mA'\n",
+ "print 'AC resistance re\\' = ',round(re,2),'Ohm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current IE = 1.3 mA\n",
+ "AC resistance re' = 19.23 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Electronic_Principles_/README.txt b/Electronic_Principles_/README.txt
new file mode 100644
index 00000000..14f66cee
--- /dev/null
+++ b/Electronic_Principles_/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Nitya Kothari
+Course: be
+College/Institute/Organization: DDU
+Department/Designation: Electronics and Communication En
+Book Title: Electronic Principles
+Author: Albert Malvino & David J. Bates
+Publisher: Tata Mcgraw Hill Education Private Limited
+Year of publication: 2006
+Isbn: 9780070634244
+Edition: 7th \ No newline at end of file
diff --git a/Electronic_Principles_/screenshots/nitya-1.png b/Electronic_Principles_/screenshots/nitya-1.png
new file mode 100644
index 00000000..9c466186
--- /dev/null
+++ b/Electronic_Principles_/screenshots/nitya-1.png
Binary files differ
diff --git a/Electronic_Principles_/screenshots/nitya-2.png b/Electronic_Principles_/screenshots/nitya-2.png
new file mode 100644
index 00000000..b335594e
--- /dev/null
+++ b/Electronic_Principles_/screenshots/nitya-2.png
Binary files differ
diff --git a/Electronic_Principles_/screenshots/nitya-3.png b/Electronic_Principles_/screenshots/nitya-3.png
new file mode 100644
index 00000000..e2215017
--- /dev/null
+++ b/Electronic_Principles_/screenshots/nitya-3.png
Binary files differ
diff --git a/Elements_Of_Mass_Transfer_Part_1/README.txt b/Elements_Of_Mass_Transfer_Part_1/README.txt
new file mode 100644
index 00000000..0640b5db
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ashutosh Kumar
+Course: btech
+College/Institute/Organization: Indian Institute of Technology - Bombay, CHAR Lab 2
+Department/Designation: Electrical Department
+Book Title: Elements Of Mass Transfer (Part 1)
+Author: N. Anantharaman & K. M. M. S. Begum
+Publisher: Prentice - Hall Of India, New Delhi
+Year of publication: 2005
+Isbn: 8120327284
+Edition: 1st \ No newline at end of file
diff --git a/Elements_Of_Mass_Transfer_Part_1/ch2.ipynb b/Elements_Of_Mass_Transfer_Part_1/ch2.ipynb
new file mode 100644
index 00000000..b72246a4
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/ch2.ipynb
@@ -0,0 +1,1682 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Diffusion"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1.a "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of nitrogen carbondioxide mixture\n",
+ "\n",
+ "# let A denote nitrogen and B denote carboondioxide\n",
+ "\n",
+ "# variable declaration \n",
+ "rA=.3798;\n",
+ "rB=.3941;\n",
+ "\n",
+ "# Calculation\n",
+ "rAB=(rA+rB)/2; #molecular seperation at collision \n",
+ "ebyk_A=71.4;\n",
+ "ebyk_B=195.2;\n",
+ "ebyk_AB=(ebyk_A/ebyk_B)**.5; #energy of molecular attraction\n",
+ "pt=1.013*10**5; #absolute total pressure in pascal\n",
+ "T=298; #absolute temperature in kelvin\n",
+ "s=T/ebyk_AB; #collision function\n",
+ " #from chart f(T/ebyk_AB) = 0.5 let it be = x\n",
+ "x=.5; #collision function\n",
+ "MA=28; #molecular weight of nitrogen\n",
+ "MB=44; #molecular weight of carbondioxide\n",
+ "Mnew=((1./MA)+(1./MB))**.5;\n",
+ "Dab= 10**-4*(1.084-.249*(Mnew))*T**1.5*((Mnew))/(pt*x*rAB**2);\n",
+ "\n",
+ "# Result\n",
+ "print \" the diffisivity of nitrogen-carbondioxide is :%f *10**-5 m**2/s\"%(Dab/10**-5)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the diffisivity of nitrogen-carbondioxide is :1.678856 *10**-5 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1.b "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#diffusivity of hydrogen chloride mixture\n",
+ "# let A denote Hydrogen chloride and B denote air\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "#\"part(ii)\"\n",
+ "rA=.3339;\n",
+ "rB=.3711;\n",
+ "\n",
+ "# Calculation \n",
+ "\n",
+ "rAB=(rA+rB)/2; #molecular seperation at collision \n",
+ "ebyk_A=344.7;\n",
+ "ebyk_B=78.6;\n",
+ "ebyk_AB=(ebyk_A/ebyk_B)**.5; #energy of molecular attraction\n",
+ "pt=200.*10**3; #absolute total pressure in pascal\n",
+ "T=298.; #absolute temperature in kelvin\n",
+ "s=T/ebyk_AB; #collision function\n",
+ " #from chart f(T/ebyk_AB) = 0.62 let it be = x\n",
+ "x=0.62; #collision function\n",
+ "MA=36.5; #molecular weight of hydrogen chloride\n",
+ "MB=29; #molecular weight of air\n",
+ "Mnew=((1./MA)+(1./MB))**.5;\n",
+ "Dab=10.**-4*(1.084-.249*(Mnew))*T**1.5*((Mnew))/(pt*x*rAB**2);\n",
+ "\n",
+ " # Result\n",
+ "print \"\\n the diffisivity of hydrogen chloride-air is :%f *10**-6 m**2/s\"%(Dab/10**-6)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the diffisivity of hydrogen chloride-air is :8.488596 *10**-6 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# the diffusivity of isoamyl alcohol\n",
+ "#kopp's law is valid\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "u=1.145*10**-3; #viscosity of water1.145cp\n",
+ "v_a=5*.0148+12*.0037+1*.0074; #by kopp's law\n",
+ "t=288; #temperature of water in kelvin\n",
+ "MB=18; #molecular weight of water\n",
+ "phi=2.26; #association parameter for solvent-water\n",
+ "\n",
+ "# Calculation\n",
+ "D_ab=(117.3*10**-18)*((phi*MB)**.5)*(t)/(u*(v_a)**.6);\n",
+ "\n",
+ " # Result\n",
+ "print \"\\n the diffusivity of isoamyl alcohol is :%f *10**-9 m**2/s\"%(D_ab/10**-9)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the diffusivity of isoamyl alcohol is :0.652780 *10**-9 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of ccl4 through oxygen\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "pa1=(33./760)*1.013*10**5; #vapour pressure of ccl4 at 273 in pascal\n",
+ "pa2=0;\n",
+ "d=1.59; \n",
+ "import math #density of liquid ccl4 in g/cm**3\n",
+ "#considering o2 to be non diffusing and with \n",
+ "T=273.; #temperature in kelvin\n",
+ "pt=(755./780)*1.013*10**5; #total pressure in pascal\n",
+ "z=.171; #thickness of film\n",
+ "a=.82*10**-4; #cross-sectional area of cell in m**2\n",
+ "v=.0208; #volume of ccl4 evaporated \n",
+ "t=10.; #time of evaporation\n",
+ "MB=154.; \n",
+ "\n",
+ "# Calculation\n",
+ "#molecular wght of ccl4\n",
+ "rate=v*d/(MB*t); #.0208cc of ccl4 is evaporating in 10hrs \n",
+ "Na=rate*10.**-3/(3600.*a); #flux in kmol/m**2*S\n",
+ "\n",
+ "D_ab=Na*z*8314*273./(pt*(math.log((pt-pa2)/(pt-pa1)))); #molecular diffusivity in m**2/s\n",
+ "\n",
+ " # Result\n",
+ "print \"the diffusivity of ccl4 through oxygen:%.2f *10**-6 m**2/s\"%(D_ab/10.**-6)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the diffusivity of ccl4 through oxygen:6.27 *10**-6 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate at which crystal dissolves\n",
+ "\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "z=.0305*10**-3; #wall thickness sorrounding the crystal\n",
+ "x1=0.0229;\n",
+ "w1=160.; #molecular weight of copper sulphate\n",
+ "w2=18.; #molecular weight of water\n",
+ "Dab=7.29*10**-10; #diffusivity of copper sulphatein m**2/s\n",
+ " #av=d/m\n",
+ " \n",
+ "# Calculation \n",
+ "Mavg=x1*w1+(1-x1)*w2; #average molecular wght of solution\n",
+ "d1=1193; #density of copper sulphate solution\n",
+ "av1=d1/Mavg; #value of (d/m) of copper solution\n",
+ "\n",
+ " #for pure water\n",
+ "d2=1000.; #density of water\n",
+ "m2=18.; #molecular wght of water\n",
+ "av2=d2/m2; #value of (d/m) of water\n",
+ "allavg=(av1+av2)/2.; #average value of d/m\n",
+ "xa2=0;\n",
+ "import math\n",
+ "\n",
+ "# Result\n",
+ "Na=Dab*(allavg)*math.log((1-xa2)/(1-x1))/z; #flux of cuso4 from crystal surface to bulk solution\n",
+ "print \" the rate at which crystal dissolves :%f *10**-5 kmol/m**2*s\"%(Na/10**-5)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the rate at which crystal dissolves :3.092260 *10**-5 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5.a"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of diffusion of alcohol water vapour mixture\n",
+ "#position 1 moles molefraction\n",
+ "# air 80 0.8\n",
+ "# water 20 0.2\n",
+ "\n",
+ "#position 2 moles molefraction\n",
+ "# air 10 0.1\n",
+ "# water 90 0.9\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya1=0.8;\n",
+ "ya2=0.1;\n",
+ "T=(273+35); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.3*10**-3; #gas film thickness in m\n",
+ "Dab=.18*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*pt*(ya1-ya2)/(z*R*T) #diffusion flux in kmol/m**2*s\n",
+ "rate=Na*100*10**-4*3600*46; #since molecular weight of mixture is 46\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n rate of diffusion of alcohol-water vapour :%f kg/hr \"%rate\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " rate of diffusion of alcohol-water vapour :2.751429 kg/hr \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5.b"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of diffusion if water layer is stagnant\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya1=0.8;\n",
+ "ya2=0.1;\n",
+ "T=(273+35); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.3*10**-3; #gas film thickness in m\n",
+ "Dab=.18*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ "import math\n",
+ "#diffusion through stagnant film \n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "rate=Na*100*10**-4*3600*46; #since molecular weight of mixture is 46\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n rate of diffusion if water layer is stagnant :%f *10**-3 kg/s \"%(rate/(3600*10**-3))\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " rate of diffusion if water layer is stagnant :1.642207 *10**-3 kg/s \n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of loss of hydrogen\n",
+ "\n",
+ "# variable declaration \n",
+ "T=298.; #temperature in kelvin\n",
+ "pt=1.*1.013*10**5; #total pressure in pascal\n",
+ "ID=25.*10**-3; #internal diameter in m of unvulcanised rubber in m\n",
+ "OD=50.*10**-3; #internal diameter in m of unvulcanised rubber in m\n",
+ "Ca1=2.37*10**-3; #conc. of hydrogen at the inner surface of the pipe in kmol/m**3\n",
+ "Ca2=0; #conc. of hydrogen at 2\n",
+ "Dab=1.8*10**-10; #diffusion coefficient in cm**2/s\n",
+ "l=2; #length of pipe in m\n",
+ "import math\n",
+ "\n",
+ "# Calculation \n",
+ "# Va=Da*Sa*(pa1-pa2)/z;\n",
+ "z=(50-25)*10**-3/2.; #wall thickness in m\n",
+ "Va=Dab*(Ca1-Ca2)/z; #diffusion through a flat slab of thickness z \n",
+ "Sa=2*3.14*l*(OD-ID)/(2*math.log(OD/ID)); #average mass transfer area of \n",
+ "rate=Va*Sa; #rate of loss of hydrogen by diffusion\n",
+ "\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print \"\\n rate of loss hydrogen by diffusion through a pipe of 2m length :%f*10**-12kmol/s\"%(rate/10.**-12)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " rate of loss hydrogen by diffusion through a pipe of 2m length :7.730099*10**-12kmol/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# ammonia diffusion through nitrogen\n",
+ "\n",
+ "# variable declaration \n",
+ "pa1=(1.5)*10**4; #vapour pressure of ammonia at pt.1 \n",
+ "pa2=(0.5)*10**4; #vapour pressure of ammonia at pt.2\n",
+ "Dab=2.3*10**-5 #molecular diffusivity in m**2/s\n",
+ "z=0.15; #diffusion path in m\n",
+ "R=8314.; #universal gas constant \n",
+ " #ammonia diffuses through nitrogen under equimolar counter diffusion\n",
+ "T=298.; #temperature in kelvin\n",
+ "pt=1.013*10**5; #total pressure in pascal\n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*(pa1-pa2)/(z*R*T); #flux in kmol/m**2*S\n",
+ "\n",
+ "# Result\n",
+ "print \"the ammonia diffusion through nitrogen under equimolar \\\n",
+ " counter diffusion:%f *10**-7 kmol/m**2*s\"%(Na/10**-7);\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the ammonia diffusion through nitrogen under equimolar counter diffusion:6.188855 *10**-7 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate at which crystal dissolves\n",
+ "#position 1 moles molefraction weight\n",
+ "# ethanol 0.1478 0.02775 6.80\n",
+ "# water 5.18 0.9722 93.20\n",
+ "\n",
+ "import math\n",
+ "#position 2 moles molefraction weight\n",
+ "# ethanol 0.235 0.0453 10.8\n",
+ "# water 4.96 0.9547 89.20\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "z=0.4*10**-2; #film thickness sorrounding the crystal\n",
+ "xa1=0.0453; #mole fraction of ethanol at pos.2\n",
+ "xa2=0.02775; #mole fraction of ethanol at pos.1\n",
+ "w1=46; #molecular weight of ethanol\n",
+ "w2=18; #molecular weight of water\n",
+ "Dab=74*10**-5*10**-4; #diffusivity of ethanol water sol.in m**2/s\n",
+ " #av=d/m\n",
+ " \n",
+ "# Calculation \n",
+ "Mavg1=xa2*w1+(1-xa2)*w2; #average molecular wght of solution at pos 1\n",
+ "d1=0.9881*10**3; # density of 6.8 wt% solution\n",
+ "av1=d1/Mavg1; #value of (d/m) of copper solution\n",
+ "\n",
+ " #for pure water\n",
+ "d2=972.8; # density of 10.8 wt% solution\n",
+ "Mavg2=xa1*w1+(1-xa1)*w2; #average molecular wght of solution at pos.2\n",
+ "av2=d2/Mavg2; #value of (d/m) of water\n",
+ "\n",
+ "allavg=(av1+av2)/2; #average value of d/m\n",
+ "Na=Dab*(allavg)*math.log((1-xa2)/(1-xa1))/z; #steady state flux in kmol/m**2*s of ethanol water sol.\n",
+ "\n",
+ " # Result\n",
+ "print \"\\n the rate at which crystal dissolves :%f *10**-5 kmol/m**2*s\"%(Na/10**-5)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the rate at which crystal dissolves :1.737360 *10**-5 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion rate of acetic acid\n",
+ "#position 1 kmoles molefraction weight\n",
+ "# acetic acid 0.167 0.0323 10\n",
+ "# water 5 0.9677 90\n",
+ "\n",
+ "#position 2 kmoles molefraction weight\n",
+ "# aceitic acid 0.067 0.0124 4\n",
+ "# water 5.33 0.9876 96\n",
+ "import math\n",
+ "# variable declaration \n",
+ "\n",
+ " #basis : 100kg of mixture\n",
+ "z=2*10**-3; #film thickness sorrounding the water\n",
+ "xa1=0.0323; #mole fraction of ethanol at pos.2\n",
+ "xa2=0.0124; #mole fraction of ethanol at pos.1\n",
+ "w1=60.; #molecular weight of acetic acid\n",
+ "w2=18.; #molecular weight of water\n",
+ "Dab=0.000095; #diffusivity of acetic water sol.in m**2/s\n",
+ " #av=d/m\n",
+ "# Calculation \n",
+ "Mavg1=xa1*w1+(1-xa1)*w2; #average molecular wght of solution at pos 1\n",
+ "d1=1013.; # density of 10 % acid\n",
+ "av1=d1/Mavg1; #value of (d/m) of copper solution\n",
+ "\n",
+ " #for pure water\n",
+ "d2=1004; #density of 4% acid\n",
+ "Mavg2=xa2*w1+(1-xa2)*w2; #average molecular wght of solution at pos.2\n",
+ "av2=d2/Mavg2; #value of (d/m) of water\n",
+ "\n",
+ "allavg=(av1+av2)/2.; #average value of d/m\n",
+ " #assuming water to be non diffusing\n",
+ "Na=Dab*(allavg)*math.log((1-xa2)/(1-xa1))/z; #diffusion rate of acetic acid aacross film of non diffusing water sol.\n",
+ "\n",
+ " # Result\n",
+ "print \"\\n diffusion rate of acetic acid aacross film of non diffusing water sol. :%f kmol/m**2*s\"%Na\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " diffusion rate of acetic acid aacross film of non diffusing water sol. :0.051508 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10.a"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of mass transfer\n",
+ "# variable declaration \n",
+ "\n",
+ "#part (i)\n",
+ "r=(50./2)*10**-3; #radius pf circular tube\n",
+ "pa1=190; #vapour pressure of ammonia at pt.1 \n",
+ "pa2=95; #vapour pressure of ammonia at pt.2\n",
+ "Dab=2.1*10**-5 #molecular diffusivity in m**2/s\n",
+ "z=1;\n",
+ "R=760*22.414/273; #universal gas constant in mmHg*m**3*K*kmol \n",
+ " #carbondioxide and oxygen experiences equimolar counter diffusion \n",
+ "T=298.; #temperature in kelvin\n",
+ "\n",
+ "# Calculation \n",
+ "pt=(10.0/780)*1.013*10**5; #total pressure in pascal\n",
+ "Na=Dab*(pa1-pa2)/(z*R*T); #flux in kmol/m**2*S\n",
+ "rate=Na*(3.14*r**2); #rate of mass transfer..(3.14*r**2)-is the area\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the rate of mass transfer.:%f *10**-10 kmol/s\"%(rate/10**-10)\n",
+ " \n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the rate of mass transfer.:2.105552 *10**-10 kmol/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10.b"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# partial pressure of co2\n",
+ "#part (i)\n",
+ "# variable declaration \n",
+ "\n",
+ "r=(50./2)*10**-3; #radius pf circular tube\n",
+ "pa1=(190.); #vapour pressure of ammonia at pt.1 \n",
+ "pa2=(95.); #vapour pressure of ammonia at pt.2\n",
+ "Dab=2.1*10**-5 #molecular diffusivity in m**2/s\n",
+ "R=760.*22.414/273; #universal gas constant in mmHg*m**3*K*kmol \n",
+ " #carbondioxide and oxygen experiences equimolar counter diffusion \n",
+ "T=298.; #temperature in kelvin\n",
+ "\n",
+ "# Calculation\n",
+ "pt=(10./780)*1.013*10**5; #total pressure in pascal\n",
+ "\n",
+ " #part (ii)\n",
+ "#(ya-ya1)/(ya2-ya1)=(z-z1)/(z2-z1);\n",
+ "z2=1; #diffusion path in m at pos.2\n",
+ "z1=0; #diffusion path in m at pos.1\n",
+ "z=.75; #diffusion at general z\n",
+ "#pa=poly([0],'pa'); #calc. of conc. in gas phase\n",
+ "x= 118.750000 #roots((pa-pa1)/(pa2-pa1)-(z-z1)/(z2-z1));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n partial pressure of co2 at o.75m from the end where partial pressure is 190mmhg is:%f mmHg\"%x\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " partial pressure of co2 at o.75m from the end where partial pressure is 190mmhg is:118.750000 mmHg\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11.a"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion flux if N2 is non diffusing\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya1=0.2; #initial mole fraction\n",
+ "ya2=0.1; #final mole fraction\n",
+ "T=298 #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.2*10**-2; #gas film thickness in m\n",
+ "Dab=.215*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314.; #universal gas constant\n",
+ "#part (i)when N2 is non diffusing \n",
+ "import math\n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "\n",
+ "\n",
+ "# Result\n",
+ "print \" diffusion flux if N2 is non diffusing :%f *10**-5 kmol/m**2*s \"%(Na/10**-5);\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " diffusion flux if N2 is non diffusing :5.176955 *10**-5 kmol/m**2*s \n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11.b"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion flux of oxygen\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya1=0.2;\n",
+ "ya2=0.1;\n",
+ "T=(298); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.2*10**-2; #gas film thickness in m\n",
+ "Dab=.215*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ "\n",
+ "#part (ii) equimolar counter diffusion\n",
+ "# Calculation\n",
+ "Na=Dab*pt*(ya1-ya2)/(z*R*T) #diffusion flux in kmol/m**2*s\n",
+ "\n",
+ " # Result\n",
+ "print \" diffusion flux of oxygen during equimolar counter-diffusion :%f *10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " diffusion flux of oxygen during equimolar counter-diffusion :4.395331 *10**-5 kmol/m**2*s \n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion flux through inert air\n",
+ "\n",
+ "# variable declaration \n",
+ "# ammonia diffusing through inert air and air is non-diffusing\n",
+ "ya1=0.1;\n",
+ "ya2=0;\n",
+ "T=293. #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.2*10**-2; #gas film thickness in m\n",
+ "Dab=.185*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314.; #universal gas constant\n",
+ " #part (i)when air is assumed to be stagnant and non-diffusing \n",
+ "import math\n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "mw=17; #molecular weight of ammonia\n",
+ "massflux=Na*mw; #mass flux of given NH3\n",
+ "print \" diffusion flux when total presssure is 1atm and air \\\n",
+ " is non-diffusing :%f *10**-4 kg/m**2*s \"%(massflux/10**-4);\n",
+ " #part (ii) when pressure is increased to 10atm\n",
+ "\n",
+ "#Dab_1/Dab_2=pt_2/pt_1\n",
+ "pt_2=10; #final pressure in atm\n",
+ "pt_1=1; #initially pressure was 1atm\n",
+ "Dab_1=.185; #initially diffusion coefficient was.185\n",
+ "Dab_2=Dab_1*pt_1/pt_2; #for gases Dab is proportional to 1/pt\n",
+ "Dab=Dab_2*10**-4; #new diffusion coefficient \n",
+ "pt=pt_2*1.013*10**5; #new total pressure\n",
+ "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "\n",
+ "# Result\n",
+ "print \"diffusion flux when pressure is increased to 10atm :%f *10**-5 kmol/m**2*s \"%(Na/10**-5);\n",
+ "print \"so the rate of diffusion remains same on increasing the pressure\"\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " diffusion flux when total presssure is 1atm and air is non-diffusing :6.889701 *10**-4 kg/m**2*s \n",
+ "diffusion flux when pressure is increased to 10atm :4.052765 *10**-5 kmol/m**2*s \n",
+ "so the rate of diffusion remains same on increasing the pressure\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion rate of acetic acid\n",
+ "#position 1 moles molefraction weight\n",
+ "# acetic acid 0.15 0.0288 9\n",
+ "# water 5 0.9712 91\n",
+ "\n",
+ "#position 2 moles molefraction weight\n",
+ "# aceitic acid 0.05 0.0092 4\n",
+ "# water 5.389 0.9908 96\n",
+ "# variable declaration \n",
+ "T=290.0; #temperature in kelvin\n",
+ "z=2*10**-3; #film thickness sorrounding the water\n",
+ "xa2=0.0092; #mole fraction of ethanol at pos.2\n",
+ "xa1=0.0288; #mole fraction of ethanol at pos.1\n",
+ "w1=60.0; #molecular weight of acetic acid\n",
+ "w2=18.0; #molecular weight of water\n",
+ "Dab=0.95*10**-9; #diffusivity of acetic water sol.in m**2/s\n",
+ " #av=d/m\n",
+ "# Calculation \n",
+ "Mavg1=xa1*w1+(1-xa1)*w2; #average molecular wght of solution at pos 1\n",
+ "d1=1012.0; # density of 10 % acid\n",
+ "av1=d1/Mavg1; #value of (d/m) of copper solution\n",
+ "\n",
+ " #for position 2\n",
+ "d2=1003.0; #density of 4% acid\n",
+ "Mavg2=xa2*w1+(1-xa2)*w2; #average molecular wght of solution at pos.2\n",
+ "av2=d2/Mavg2; #value of (d/m) of water\n",
+ "\n",
+ "allavg=(av1+av2)/2; #average value of d/m\n",
+ " \n",
+ " #assuming water to be non diffusing\n",
+ "import math \n",
+ "Na=Dab*(allavg)*math.log((1-xa2)/(1-xa1))/z; #diffusion rate of acetic acid aacross film of non diffusing water sol.\n",
+ "\n",
+ "# Result\n",
+ "print \"diffusion rate of acetic acid aacross film of non diffusing water sol. :%f *10**-7 kmol/m**2*s\"%(Na/10.0**-7)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diffusion rate of acetic acid aacross film of non diffusing water sol. :5.088553 *10**-7 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion flux of nitrogen\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya1=0.2; #molefraction at pos.1\n",
+ "ya2=0.1; #molefraction at pos.2\n",
+ "T=(293); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.2*10**-2; #gas film thickness in m\n",
+ "Dab=.206*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ " #for ideal gases volume fraction =mole fraction\n",
+ "#part (i)when N2 is non diffusing \n",
+ "import math\n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "print \"\\n diffusion flux if N2 is non diffusing :%f *10**-5 kmol/m**2*s \"%(Na/10**-5);\n",
+ "#part (ii) equimolar counter diffusion\n",
+ "\n",
+ "Na=Dab*pt*(ya1-ya2)/(z*R*T) #diffusion flux in kmol/m**2*s\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n diffusion flux of nitrogen during equimolar counter-diffusion :%f *10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " diffusion flux if N2 is non diffusing :5.044891 *10**-5 kmol/m**2*s \n",
+ "\n",
+ " diffusion flux of nitrogen during equimolar counter-diffusion :4.283207 *10**-5 kmol/m**2*s \n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion rate of loss of benzene\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "pa1=0.2*10**5; #partial pressure at pos.1\n",
+ "pa2=0; #partial pressure at pos.2\n",
+ "r=10./2; #radius of tank in which benzene is stored\n",
+ "T=298.; #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=10*10**-3; #gas film thickness in m\n",
+ "Dab=.02/3600; #diffusion coefficient in m**2/s\n",
+ "R=8314.; #universal gas constant\n",
+ " #benzene is stored in atank of dia 10m\n",
+ "#part (i)when air is assumed to be stagnant\n",
+ "import math\n",
+ "\n",
+ "# Calculation\n",
+ "Na=Dab*pt*math.log((pt-pa2)/(pt-pa1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "rate=Na*(3.14*r**2); #rate of loss of benzene if air is stagnant\n",
+ "\n",
+ " # Result\n",
+ "print \"diffusion rate of loss of benzene :%f *10**-4 kmol/s \"%(rate/10**-4);\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diffusion rate of loss of benzene :3.921799 *10**-4 kmol/s \n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of diffusion of alcohol water vapour mixture\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya2=0.1; #molefraction at pos.2\n",
+ "ya1=0.8; #molefraction at pos.1\n",
+ "T=(370.); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=0.1*10**-3; #gas film thickness in m\n",
+ "Dab=.15*10**-2; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ "Area=10; #area of the film is 10m**2\n",
+ "\n",
+ " #alcohol is being absorbed infrom amixture of alcohol vapour and water vapour by means of non-volatile solvent in which alcohol is soluble bt water is not \n",
+ " #for gase Dab=T**3/2\n",
+ " #Dab1/Dab2=(T1/T2)**3/2\n",
+ "import math\n",
+ "T2=370.; #final temperature in kelvin \n",
+ "T1=298.; #initial temperature in kelvin\n",
+ "\n",
+ "# Calculation\n",
+ "Dab1=.15*10**-2; #initial diffusion coefficient \n",
+ "Dab2=((T2/T1)**(3./2))*Dab1; #final diffusion coefficient\n",
+ "Na=Dab2*pt*math.log((1-ya2)/(1-ya1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "rate=Na*3600*46*Area; #rate of diffusion of alcohol-water vapour in kg/hour\n",
+ "\n",
+ " # Result\n",
+ "print \" rate of diffusion of alcohol-water vapour :%f *10**6 kg/hour \"%(rate/10**6)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " rate of diffusion of alcohol-water vapour :1.702149 *10**6 kg/hour \n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion rate of ammonia\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "ya2=0; #molefraction at pos.2\n",
+ "ya1=0.1; #molefraction at pos.1\n",
+ "T=(273); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=2*10**-3; #gas film thickness in m\n",
+ "Dab=.198*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ " #ammonia is diffusing through an inert film 2mm thick \n",
+ "\n",
+ " #for gase Dab=T**3/2\n",
+ " #Dab1/Dab2=(T1/T2)**3/2\n",
+ "import math\n",
+ "T2=293; #final temperature in kelvin \n",
+ "T1=273; #initial temperature in kelvin\n",
+ "\n",
+ "\n",
+ "# Calculation\n",
+ "Dab1=0.198*10**-4; #initial diffusion coefficient \n",
+ "Dab2=((T2/T1)**(3.0/2))*Dab1; #final diffusion coefficient\n",
+ "Na=Dab2*pt*math.log((1-ya2)/(1-ya1))/(z*R*T2); #diffusion flux in kmol/m**2*s\n",
+ "print \" flux of diffusion of ammonia through inert film :%f *10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
+ "\n",
+ "#if pressure is also incresed from 1 to 5 atm\n",
+ " #for gases Dab=(T**3/2)/pt;\n",
+ " #Dab1/Dab2=(T1/T2)**3/2*(p2/p1)\n",
+ "T2=293.; #final temperature in kelvin \n",
+ "T1=273.; #initial temperature in kelvin\n",
+ "pa2=5.; #final pressure in atm\n",
+ "pa1=1; #initial pressure in atm \n",
+ "p=pa2*1.013*10**5;\n",
+ "Dab1=.198*10**-4; #initial diffusion coefficient\n",
+ "Dab2=((T2/T1)**(3.0/2))*Dab1*(pa1/pa2); #final diffusion coefficient\n",
+ "Na=Dab2*p*math.log((1-ya2)/(1-ya1))/(z*R*T2); #diffusion flux in kmol/m**2*s\n",
+ "\n",
+ " # Result\n",
+ "print \"flux of diffusion of ammonia if temp. is 20 and pressure is 5 atm :%f*10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
+ "print \"so there is no change in flux when pressure is changed\"\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " flux of diffusion of ammonia through inert film :4.337554 *10**-5 kmol/m**2*s \n",
+ "flux of diffusion of ammonia if temp. is 20 and pressure is 5 atm :4.822834*10**-5 kmol/m**2*s \n",
+ "so there is no change in flux when pressure is changed\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ate of evaporation\n",
+ "\n",
+ "# variable declaration \n",
+ "pa1=0.418*10**5; #partial pressure initially\n",
+ "pa2=0; #partial pressure of pure air\n",
+ "r=10/2; #radius of tank in which benzene is stored\n",
+ "T=(350); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "z=2*10**-3; #gas film thickness in m\n",
+ "Dab=.2*10**-4; #diffusion coefficient in m**2/s\n",
+ "R=8314; #universal gas constant\n",
+ "r=0.2/2; #radius of open bowl is 0.2\n",
+ "#when air layer is assumed to be stagnant of thickness 2mm\n",
+ "import math\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "Na=Dab*pt*math.log((pt-pa2)/(pt-pa1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
+ "rate=Na*(3.14*r**2)*18; #rate of loss of evaporation\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n diffusion rate loss of evaporation :%f *10**-4 kg/s \"%(rate/10**-4)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " diffusion rate loss of evaporation :1.046972 *10**-4 kg/s \n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of the mixture in stefan tube of toluene in air\n",
+ "\n",
+ "# variable declaration \n",
+ "\n",
+ "#stefan tube experiment\n",
+ "import math\n",
+ "Ml=92.; #molecular weight of toluene\n",
+ "T=(312.4); #temperature in kelvin\n",
+ "pt=1*1.013*10**5; #total pressure in pascal\n",
+ "R=8314.; #universal gas constant\n",
+ "t=275.*3600; #after 275 hours the level dropped to 80mm from the top\n",
+ "zo=20.*10**-3; #intially liquid toluene is at 20mm from top\n",
+ "zt=80.*10**-3; #finally liquid toluene is at 80mm from top\n",
+ "#air is assumed to be satgnant \n",
+ "d=850.; #density in kg/m**3\n",
+ "pa=7.64*10**3; #vapour pressure of toluene in at 39.4degree celcius \n",
+ "\n",
+ "# Calculation \n",
+ "cal=d/Ml; #conc. at length at disxtance l\n",
+ "ca=pt/(R*T); #total conc. \n",
+ "xa1=pa/pt; #mole fraction of toluene at pt1 i.e before evaporation \n",
+ "xb1=1-xa1; #mole fraction of air before evaporation i.e at pt1 \n",
+ "xb2=1.; #mole fraction of air after evaporation i.e at pt.2\n",
+ "xa2=0.; #mole fraction of toluene at point 2\n",
+ "xbm=(xb2-xb1)/(math.log(xb2/xb1));\n",
+ "#t/(zt-zt0) = (xbm*cal*(zt+zo))/(2*c*(xa1-xa2)*t);\n",
+ "Dab=(xbm*cal*(zt**2-zo**2))/(2*ca*t*(xa1-xa2));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the diffusivity of the mixture in stefan tube of toluene in air is :%f*10**-5 m**2/s\"%(Dab/10**-5)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the diffusivity of the mixture in stefan tube of toluene in air is :0.915437*10**-5 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.20 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusion flux of a mixture of benzene and toluene\n",
+ "\n",
+ "#this is the case of equimolar counter diffusion as the latent heat of vaporisation are very close to each other\n",
+ "# variable declaration \n",
+ "\n",
+ "T=(360); #temperature in kelvin\n",
+ "pt=372.4/760; #total pressure in atm\n",
+ "R=82.06; #universal gas constant\n",
+ "Dab=0.0506; #diffusion coefficient in cm**2/s \n",
+ "z=0.254; #gas layer thickness in cm\n",
+ "vp=368.0/760; #vapour pressure of toluene in atm\n",
+ "xtol=.3; #mole fractoin of toluene in atm\n",
+ "pb1=xtol*vp; #partial pressure of toluene\n",
+ "#since pb1 is .045263 bt in book it is rounded to 0.145\n",
+ "\n",
+ "# Calculation \n",
+ "pb2=xtol*pt; #parial pressure of toluene in vapour phase\n",
+ "Na=Dab*(pb1-pb2)/(z*R*T); #diffusion flux \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the diffusion flux of a mixture of benzene and toluene %f*10**-8 gmol/cm**2*s\\n\"%(Na/10**-8)\n",
+ "print \"\\nthe negative sign indicates that the toluene is getting transferred from gas phase \\\n",
+ "to liquid phase(hence the transfer of benzene is from liquid to gas phase)\"\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the diffusion flux of a mixture of benzene and toluene -1.171233*10**-8 gmol/cm**2*s\n",
+ "\n",
+ "\n",
+ "the negative sign indicates that the toluene is getting transferred from gas phase to liquid phase(hence the transfer of benzene is from liquid to gas phase)\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of the mixture in stefan tube\n",
+ "\n",
+ "#stefan tube experiment(pseudo steady state diffusion)\n",
+ "# variable declaration \n",
+ "\n",
+ "Ml=92.; #molecular weight of toluene\n",
+ "T=(303.); #temperature in kelvin\n",
+ "pt=1.*1.013*10**5; #total pressure in pascal\n",
+ "R=8314.; #universal gas constant\n",
+ "t=275.*3600; #after 275 hours the level dropped to 80mm from the top\n",
+ "zo=20.*10**-3; #intially liquid toluene is at 20mm from top\n",
+ "zt=77.5*10**-3; #finally liquid toluene is at 80mm from top\n",
+ " #air is assumed to be satgnant \n",
+ "import math\n",
+ "# Calculation \n",
+ "d=820.; #density in kg/m**3\n",
+ "pa=(57.0/760)*1.0135*10**5; #vapour pressure of toluene in at 39.4degree celcius \n",
+ "cal=d/Ml; #conc. at length at disxtance l\n",
+ "ca=pt/(R*T); #total conc. \n",
+ "xa1=pa/pt; #mole fraction of toluene at pt1 i.e before evaporation \n",
+ "xb1=1.-xa1; #mole fraction of air before evaporation i.e at pt1 \n",
+ "xb2=1.; #mole fraction of air after evaporation i.e at pt.2\n",
+ "xa2=0; #mole fraction of toluene at point 2\n",
+ "xbm=(xb2-xb1)/(math.log(xb2/xb1));\n",
+ "#t/(zt-zt0) = (xbm*cal*(zt+zo))/(2*c*(xa1-xa2)*t);\n",
+ "Dab=(xbm*cal*(zt**2-zo**2))/(2*ca*t*(xa1-xa2));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the diffusivity of the mixture in stefan tube of toluene in air is :%f*10**-5 m**2/s\"%(Dab/10**-5)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the diffusivity of the mixture in stefan tube of toluene in air is :0.804587*10**-5 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of ccl4\n",
+ "# variable declaration \n",
+ "#variation in liquid level with respect to time is given below\n",
+ "%pylab inline\n",
+ "t=[26,185,456,1336,1958,2810,3829,4822,6385]\n",
+ "# let Zt-Zo= x;\n",
+ "x=[.25,1.29,2.32,4.39,5.47,6.70,7.38,9.03,10.48]\n",
+ "i=0; \n",
+ "y = [0,0,0,0,0,0,0,0,0] #looping starts\n",
+ "\n",
+ "# Calculation \n",
+ "while(i<9):\n",
+ " y[i]=t[i]/x[i]; #for calculating the t/Zt-Zo value\n",
+ " i=i+1;\n",
+ "from matplotlib.pyplot import *\n",
+ "plot(x,y,\"o-\");\n",
+ "show()\n",
+ "#xtitle(\" Fig.2.2 Example 22 \",\"X--(zi-zo),cm --->\",\"Y-- vs (t/(zi-zo))min/cm ---->\");\n",
+ "slope=51.4385*60 *10**4; #slope of the curve in 1/sec*m**2\n",
+ "#slope = Cal *(xblm)/(2*Dab*C*(xa1-xa2))\n",
+ "d=1540.; #density in kg/m**3\n",
+ "Ml=154.; #molecular weight of toluene\n",
+ "Cal=d/Ml ; #conc. at length at disxtance l in mol/m**3\n",
+ "\n",
+ "T=(321.); #temperature in kelvin\n",
+ "pt=1.; #total pressure in atm\n",
+ "R=82.06; #universal gas constant\n",
+ "C=pt/(R*T) *10**3; #total conc. in kg mol/m**3\n",
+ "\n",
+ "pa=(282./760); #vapour pressure of toluene \n",
+ "xa1=pa/pt; #mole fraction of toluene at pt1 i.e before evaporation\n",
+ "xb1=1.-xa1; #mole fraction of air before evaporation i.e at pt1 \n",
+ "xb2=1.; #mole fraction of air after evaporation i.e at pt.2\n",
+ "xa2=0.; #mole fraction of toluene at point 2\n",
+ "xblm=(xb2-xb1)/(math.log(xb2/xb1)); #log mean temp. difference\n",
+ "Dab = Cal *(xblm)/(2*slope*C*(xa1-xa2)); #diffusivity coefficient\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the diffusivity of the mixture by winklemann method of toluene in air is :%f*10**-6 m**2/s\"%(Dab/10**-6)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['rate', 'draw_if_interactive']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD9CAYAAAC2l2x5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X90VPWd//HnmERSRYFVMsEEOm5CDAMiKL9qLY1CgoWa\ng5WNxoopoN3KimD1Cyq1ghUyLN1jCUq31aCxug24dkkwGCLigIgakV8uYQ3QIPndCgRBDDHJ/f5x\ny0ggkAQmuTN3Xo9zcohzc2fe16Mv3vncz/18HIZhGIiIiO1cZHUBIiLSORTwIiI2pYAXEbEpBbyI\niE0p4EVEbEoBLyJiU20G/GeffcbQoUN9Xz169CArK4tDhw6RnJxMQkICKSkp1NXV+c7JzMykf//+\nJCYmUlRU1KkXICIirXN0ZB58c3MzMTExFBcXs3TpUq688kpmz57NokWLOHz4MB6Ph5KSEu6++24+\n/vhjKisrGTt2LKWlpVx0kX5ZEBHpSh1K3XXr1hEfH0/fvn3Jz88nIyMDgIyMDFatWgVAXl4e6enp\nRERE4HK5iI+Pp7i42P+Vi4jIOXU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vXv3ZsqUKVx//fXcf//9HD9+3Oqy/Oaf/umfeOSRR+jXrx9XXXUV\nPXv2ZOzYsVaX5Xdne0bHjpYvX8748ePP+TNd+n+qHX+tb82xY8eYNGkSS5YsoXv37laX4xdvvvkm\nUVFRDB061HbdO0BjYyNbt25l+vTpbN26lUsvvTSof70/3b59+/jd737H/v37qaqq4tixY7z22mtW\nl9WpHA6HbTNnwYIFXHzxxdx9993n/LkuDfjT58mXl5e3ePLVDr755hvuuOMO7rnnHt/0UTvYvHkz\n+fn5XH311aSnp7N+/Xruvfdeq8vym9jYWGJjYxk+fDgAkyZNYuvWrRZX5T9btmzhxhtv5IorriA8\nPJyf/OQnbN682eqy/O7kMzpAi2d07OTll19mzZo17foLuksDftiwYezZs4f9+/fT0NDAihUrSE1N\n7coSOpVhGEybNg23282sWbOsLsevFi5cSHl5OWVlZeTm5nLLLbfwyiuvWF2W30RHR9O3b19KS0sB\nWLduHQMHDrS4Kv9JTEzkww8/5Ouvv8YwDNatW4c72Fbxa4ezPaNjF4WFhSxevJi8vDwiIyPbPqEz\np/m0Zs2aNUZCQoIRFxdnLFy4sKs/vlO99957hsPhMK677jpjyJAhxpAhQ4y33nrL6rL8zuv1Grfd\ndpvVZfjd9u3bjWHDhrV7ClqwWbRokW+a5L333ms0NDRYXdIFueuuu4w+ffoYERERRmxsrLF8+XLj\n4MGDxpgxY2wxTfL068vOzjbi4+ONfv36+fLlgQceOOd7OAzDhgOqIiISHFv2iYhIxyngRURsSgEv\nImJTCngREZtSwIuI2JQCXkTEpv4/Y/eFADqmRiMAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x20a87d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the diffusivity of the mixture by winklemann method of toluene in air is :9.202857*10**-6 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of transfer of nitrogen and hydrogen\n",
+ "# variable declaration \n",
+ "#it is the case of equimolar conter diffusion as the tube is perfectly sealed to two bulbs at the end and the pressure throughout is constant\n",
+ "d=0.001;\n",
+ "area=3.14*(d/2)**2; #area of the bulb\n",
+ "T=298.; #temperature in kelvin \n",
+ "p=1.013*10**5; #total pressure of both the bulbs\n",
+ "R=8314.; #universal gas constant\n",
+ "\n",
+ "# Calculation \n",
+ "c=p/(R*T); #total concentration\n",
+ "Dab=.784*10**-4; #diffusion coefficient in m**2/s\n",
+ "xa1=0.8; #molefraction of nitrogen gas at the 1 end\n",
+ "xa2=0.25; #molefraction of nitrogen gas at the 2nd end\n",
+ "z=.15; #distance between the bulbs\n",
+ "\n",
+ " #rate=area*Na;\n",
+ "rate=area*Dab*c*(xa1-xa2)/z; #rate of transfer of hydrogen and hydrogen\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the rate of transfer from 1 to 2 of nitrogen and 2 to 1of hydrogen is :%f *10**-11kmol/s\"%(rate/10.0**-11)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the rate of transfer from 1 to 2 of nitrogen and 2 to 1of hydrogen is :0.922657 *10**-11kmol/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of methanol in carbon tetrachloride\n",
+ "# variable declaration \n",
+ "#using wilke and chang empirical correlation\n",
+ "#Dab=(117.3*10**-18)*(phi*Mb)**0.5*T/(u*va**0.6);\n",
+ "\n",
+ "T=288; #temperature in kelvin\n",
+ "Mb=32; #molecular weight of methanol\n",
+ "phi=1.9; #association factor for solvent\n",
+ "\n",
+ "# Calculation \n",
+ "va=(14.8+(4*24.6))*10**-3 #solute(CCl4) volume at normal BP in m**3/kmol\n",
+ "u=.6*10**-3; #viscosity of solution in kg/m*s\n",
+ "Dab=(117.3*10**-18)*(phi*Mb)**0.5*T/(u*va**0.6); #diffusion coefficient in m**2/s\n",
+ "\n",
+ "# Result\n",
+ "print \"\\ndiffusivity of methanol in carbon tetrachloride is :%f*10**-9 m**2/s\"%(Dab/10.0**-9)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diffusivity of methanol in carbon tetrachloride is :1.622494*10**-9 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of methanol in water\n",
+ "\n",
+ "#using wilke and chang empirical correlation\n",
+ "#Dab=(117.3*10**-18)*(phi*Mb)**0.5*T/(u*va**0.6);\n",
+ "# variable declaration \n",
+ "T=288.0; #temperature in kelvin\n",
+ "Mb=18.0; #molecular weight of methanol\n",
+ "phi=2.26; #association factor for solvent\n",
+ "\n",
+ "# Calculation \n",
+ "va=(2*14.8+(6*3.7)+7.4)*10**-3 #solute(water) volume at normal BP in m**3/kmol\n",
+ "u=1*10**-3; #viscosity of solution in kg/m*s\n",
+ "Dab=(117.3*10**-18)*(phi*Mb)**0.5*T/(u*va**0.6); #diffusion coefficient in m**2/s\n",
+ "\n",
+ "# Result\n",
+ "print \"\\ndiffusivity of methanol in water is :%f*10**-9 m**2/s\"%(Dab/10**-9)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diffusivity of methanol in water is :1.174865*10**-9 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of passage of hydrogen\n",
+ "# variable declaration \n",
+ "u=20.*10**-6; #viscosity in Ns/m**2\n",
+ "pt=2666.; #total pressure in N/m**2\n",
+ "pa1=pt; #pressure at 1\n",
+ "pa2=0; #pressure at 2\n",
+ "mw=32.; #molecular weight of oxygen\n",
+ "R=8314.; #universal law constant\n",
+ "T=373.; #temp. in kelvin\n",
+ "gc=1.; \n",
+ "\n",
+ "# Calculation \n",
+ "l=(3.2*u/pt)*((R*T)/(2*3.14*gc*mw))**0.5;#mean free path\n",
+ "d=.2*10**-6; #pore diameter\n",
+ "s=d/l; #value of dia/l\n",
+ " #hence knudsen diffusion occurs\n",
+ "Na=0.093*20*273/(760*373*22414*10**-1); #diffusion coefficient in kmol/m**2*s\n",
+ "Dka=(d/3)*((8*gc*R*T)/(3.14*mw))**0.5;\n",
+ "l1=Dka*(pa1-pa2)/(R*T*Na); #length of the plate\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the length of the plate is :%f m \"%l1\n",
+ "\n",
+ "\n",
+ " #for diffusion with hydrogen\n",
+ "u=8.5*10**-6; #viscosity in Ns/m**2\n",
+ "pt=1333; #total pressure in N/m**2\n",
+ "pa1=pt; #pressure at 1\n",
+ "pa2=0; #pressure at 2\n",
+ "mw=2; #molecular weight of oxygen\n",
+ "R=8314; #universal law constant\n",
+ "T=298; #temp. in kelvin\n",
+ "gc=1; \n",
+ "l=(3.2*u/pt)*((R*T)/(2*3.14*gc*mw))**0.5;#mean free path\n",
+ "d=.2*10**-6; #pore diameter\n",
+ "s=d/l; #value of dia/l\n",
+ " #hence knudsen diffusion occurs\n",
+ "Dka=(d/3)*((8*gc*R*T)/(3.14*mw))**0.5;\n",
+ "Na=Dka*(pa1-pa2)/(R*T*l1); #diffusion coefficient in kmol/m**2*s\n",
+ "print \"\\n the diffusion coefficient is :%f *10**-4 kmol/m**2*s\"%(Na/10.0**-6)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the length of the plate is :0.035635 m \n",
+ "\n",
+ " the diffusion coefficient is :1.788175 *10**-4 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_Of_Mass_Transfer_Part_1/ch3.ipynb b/Elements_Of_Mass_Transfer_Part_1/ch3.ipynb
new file mode 100644
index 00000000..ab9df3da
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/ch3.ipynb
@@ -0,0 +1,616 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Mass transfer coefficient and interphase mass transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of sublimation\n",
+ "\n",
+ "# Variable Declaration \n",
+ "v=6.; #velocity in m/s\n",
+ "l=6.; #length in m\n",
+ "pa1=10.; #pressure at 1 in atm\n",
+ "pa2=0; #pressure at 2 in atm\n",
+ "t=373.; # temperature in kelvin\n",
+ "p=1.; #pressure of naphthalene in atm at 373kelvin\n",
+ "D=5.15*10**-6; #diffusivity of naphthalene in C02 in m**2/s\n",
+ "d=0.946; #density of air in kg/m**3\n",
+ "u=.021*10**-3; #viscosity of air in Newton*s/m**2\n",
+ "ID=0.075; #diameter in m\n",
+ "\n",
+ "# Calculation\n",
+ "nre=(ID*v*d)/(u); #calc. of reynolds no.\n",
+ "cf=2*0.023*(nre)**(-0.2); #friction factor\n",
+ "nsc=(u)/(d*D); #calc of schmidt no.\n",
+ "kc=(cf*v)/(2*(nsc)**(2./3));\n",
+ "na=(kc*10**5*(pa1/760-0))/(8314*t); #difussion flux in kmol/m**2*s\n",
+ "sub=na*2*3.14*(ID/2)*l; #rate of sublimation\n",
+ "\n",
+ "# Result\n",
+ "print \"\\nrate of sublimation :%f *10**-6 kmol/s\\n\"%(sub/10**-6);\n",
+ "#End"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "rate of sublimation :4.298312 *10**-6 kmol/s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# rate of sublimation of solid naphthalene\n",
+ "\n",
+ "# Variable Declaration \n",
+ "v=0.30; #velocity of parallelair in m/s\n",
+ "t=300; #temperature of air in kelvin\n",
+ "p=10.0**5/760; #pressure of air in pascal\n",
+ "Dab=5.9*10**-4; #diffusivity of naphthalene in in air in m**2/s \n",
+ "pa1=0.2*10**5/760; #pressure of air at 1 in pascal\n",
+ "pa2=0; #pressure of air at 2 in pascal\n",
+ "d=1.15; #density of air in kg/m**3\n",
+ "u=0.0185*10**-3; #viscosity of air in Newton*s/m**2\n",
+ "D=1.; #length in m\n",
+ "a=1.; #area of plate in m**2\n",
+ "\n",
+ "# Calculation \n",
+ "Nsc=u/(d*Dab); #schmidt no. calculation\n",
+ "Nre=(D*v*d)/u; #reynolds no. calculation\n",
+ " #flow is turbulent \n",
+ "f=0.072*(Nre)**-.25; #friction factor using \"chilton colburn\" analogy\n",
+ "k_c=(f*v)/(2*(Nsc)**.667); #mass transfer coefficient\n",
+ "NA=k_c*(pa1-pa2)/(8314*300); #mass flux calc.\n",
+ "sub=NA*a; #rate of sublimation in kmol/m**2*s\n",
+ "\n",
+ "# Result\n",
+ "print \"\\nrate of sublimation :%f *10**-7 kmol/s\\n\"%(sub/10**-7)\n",
+ "#End"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "rate of sublimation :1.077674 *10**-7 kmol/s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#rate of absorption and mass transfer coefficient\n",
+ "# Variable Declaration \n",
+ "\n",
+ "# a is CO2 and b is water\n",
+ "p=2.; #total pressure at 1 in atm \n",
+ "pa1=0.2*10**5; #pressure of CO2 at pt 1 in atm\n",
+ "pa2=0; #pressure of CO2 at pt 2 is 0 since air is pure\n",
+ "ya1=0.1; #mole fraction of CO2 at 1 is 0.2/2\n",
+ "ya2=0; #mole fraction of CO2 at 2 is 0 since air is pure\n",
+ "yb1=0.9; #mole fraction of water at 1 is (1-0.1)\n",
+ "yb2=1.0; #mole fraction of water at 2 is 1.0 since total pressure has to be constant.\n",
+ "k_y1=6.78*10**-5; #mass transfer coefficient in kmol/m**2*s*molefraction\n",
+ "import math\n",
+ "\n",
+ "# Calculation \n",
+ "yb_ln=(yb2-yb1)/(math.log(yb2/yb1)); #log mean is represented by yb_ln\n",
+ "\n",
+ "k_y=k_y1/yb_ln; \n",
+ "\n",
+ "# Result\n",
+ "print \"\\nvalue of mass transfer coefficient k_y is:%f *10**-5 kmol/m**2*s*(molefractin)\"%(k_y/10.0**-5)\n",
+ "k_g=k_y/p; #mass ttransfer coefficient in lmol/m**2*s*atm\n",
+ "print \"\\nvalue mass transfer coefficient k_g is:%f *10**-5 kmol/m**2*s*(atm)\"%(k_g/10**-5)\n",
+ "\n",
+ "NA=k_y*(ya1-ya2); #mass flux in kmol/m**2*s\n",
+ "print \"\\nvalue of rate of mass transfer :%f *10**-6 kmol/m**2*s\"%(NA/10.0**-6)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "value of mass transfer coefficient k_y is:7.143443 *10**-5 kmol/m**2*s*(molefractin)\n",
+ "\n",
+ "value mass transfer coefficient k_g is:3.571721 *10**-5 kmol/m**2*s*(atm)\n",
+ "\n",
+ "value of rate of mass transfer :7.143443 *10**-6 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# mass transfer coefficient and film thickness\n",
+ "# Variable Declaration \n",
+ "NA=7.5*10**-7; #mass flux in gmol/cm**2*s\n",
+ "Dab=1.7*10**-5; #diffusivity if SO2 in water in cm**2/s\n",
+ "c=1./18.02; #concentration is density/molecular weight in gmol/cm**2*s\n",
+ "#SO2 is absorbed from air into water\n",
+ "\n",
+ "xa1=0.0025; #liquid phase mole fraction at 1\n",
+ "xa2=0.0003; #liquid phase mole fraction at 2\n",
+ " #NA=kc(Ca1-Ca2)=Dab*(Ca1-Ca2)/d\n",
+ "\n",
+ "# Calculation \n",
+ "k_c=NA/(c*(xa1-xa2)); #k_c=Dab/d=NA/c(xa1-xa2)\n",
+ "\n",
+ "# Result \n",
+ "print \"\\nmass transfer coefficient k_c is:%f cm/s\"%k_c\n",
+ "\n",
+ "d=Dab/k_c;\n",
+ "print \"\\nfilm thickness d is :%f cm\"%d\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "mass transfer coefficient k_c is:0.006143 cm/s\n",
+ "\n",
+ "film thickness d is :0.002767 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# value of liquid and gas film coefficient\n",
+ "# Variable Declaration \n",
+ "Kg=2.72*10**-4; #overall gas phase mass transfer coefficient in kmol/m**2*S*atm\n",
+ "r_gas=0.85*(1/Kg); #given that gas phase resisitance is 0.85 times overall resistance\n",
+ "kg=1.0/r_gas; \n",
+ "m=9.35*10**-3; #henry's law constant in atm*m**3/kmol\n",
+ "kl=m/(1./Kg-1/kg); #liquid phase mass transfer coefficient in m/s\n",
+ "print \"\\nthe value of liquid film coefficient kl : %f*10**-5 m/s\"%(kl/10**-5)\n",
+ "print \"\\nthe value of gas film coefficient kg : %f*10**-5 m/s\"%(kg/10**-5);\n",
+ "p=1.; #overall pressure in atm\n",
+ "\n",
+ " #NA=Kg(pag-pa*)=kg(pag-pai)=kl(Cai-Cal)\n",
+ "# Calculation \n",
+ "Yag=0.1; #molefraction of ammonia\n",
+ "Cal=6.42*10**-2; #liquid phase concentration \n",
+ "Pag=Yag*p; #pressure of ammonia\n",
+ " #Pai and Cai indicates interfacial pressure and conc.\n",
+ " #Pal and Cal indicates bulk pressure and conc.\n",
+ "\n",
+ " #Pai=m*C_ai;\n",
+ " #NA=kg(pag-pai)=kl(Cai-Cal)\n",
+ " \n",
+ "#Cai=poly([0],'Cai'); #calc. of conc. in gas phase\n",
+ "x = 1.6588481 #x=roots((Pag-m*Cai)*(kg/kl)-(Cai-Cal));\n",
+ "\n",
+ "# Result \n",
+ "print \"\\nthe value of interphase conc.cai :%f kmol/m**3\"%x\n",
+ "Pai=m*x;\n",
+ "print \"\\nthe value of interphase pressure pai is:%f atm\"%Pai\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the value of liquid film coefficient kl : 1.695467*10**-5 m/s\n",
+ "\n",
+ "the value of gas film coefficient kg : 32.000000*10**-5 m/s\n",
+ "\n",
+ "the value of interphase conc.cai :1.658848 kmol/m**3\n",
+ "\n",
+ "the value of interphase pressure pai is:0.015510 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# concentration of ammonia and interfacial partial pressure\n",
+ "# Variable Declaration \n",
+ "#kg/kl=0.9=t \n",
+ "#Pai=0.3672*Cai so; \n",
+ "m=0.3672;\n",
+ "t=.9;\n",
+ " #Pai and Cai indicates interfacial pressure and conc.\n",
+ " #Pal and Cal indicates bulk pressure and conc.\n",
+ "Yag=0.15; #molefraction of ammonia\n",
+ "Cal=0.147; #liquid phase concentration in kmol/m**3\n",
+ "p=1; #overall pressure\n",
+ "\n",
+ "# Calculation \n",
+ "Pag=Yag*p; #pressure of ammonia\n",
+ "\n",
+ " #Pai=m*C_ai;\n",
+ " #kg/kl=(Cai-Cal)/(Pag-Pai);\n",
+ " \n",
+ "#Cai=poly([0],'Cai'); #calc. of conc. in gas phase\n",
+ "x = 0.211954 #x=roots((Pag-m*Cai)*(t)-(Cai-Cal));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\nthe value of conc. of ammonia cai is :%f kmol/m**3\"%x\n",
+ "Pai=m*x;\n",
+ "print \"\\nthe value of interphase pressure Pai is :%f atm\"%Pai"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the value of conc. of ammonia cai is :0.211954 kmol/m**3\n",
+ "\n",
+ "the value of interphase pressure Pai is :0.077830 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diffusivity of gas overall transfer cofficient\n",
+ "# Variable Declaration \n",
+ "D=.1;\n",
+ "l=3; # l is length of bubble in cm\n",
+ "a=3.14*D*l; # area in cm**2\n",
+ "Ca_o=0.0001; #pure conc. of gas in g*mol/cc*atm\n",
+ "Ca=0;\n",
+ "NA=.482*10**-5; # molar rate of absorption in g*moles/s\n",
+ " #Pa_o and Ca_o indicates pure pressure and conc.\n",
+ "# Calculation \n",
+ "kl=NA/(a*(Ca_o-Ca)); #mass transfer coefficient acc. to higbie's penetration theory\n",
+ "Q=4; #volumetric flow rate in cc/s\n",
+ "A=3.14*.1*.1/4; #area of flow\n",
+ "v=Q/A; #velocity of flow in cm/s\n",
+ "\n",
+ "#timt t=bubble length/linear velocity;\n",
+ "t=l/v;\n",
+ "DAB=(kl**2)*3.14*t/4; #diffusivity in cm**2/s\n",
+ "D_new=0.09; #revised diameter reduced to.09\n",
+ "a_new=3.14*l*D_new; #revised area\n",
+ "A_new=3.14*0.09*0.09/4; #revised flow area\n",
+ "v_new=Q/A_new; #revised velocity\n",
+ "\n",
+ "# Result \n",
+ "print \"\\nthe value of diffusivity of gas DAB is :%f cm/s\"%(DAB/10**-5)\n",
+ "\n",
+ "t_new=l/v_new; #revised time\n",
+ "kl_new=2*(DAB/(3.14*0.0047))**0.5; #revised mass transfer coefficient \n",
+ "NA_new=kl_new*a_new*(Ca_o-Ca); #revised molar rate absorption in g*moles/s\n",
+ "print \"\\nthe value of NA_new is :%f*10**-6 kmol/m**3\"%(NA_new/10**-6)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the value of diffusivity of gas DAB is :1.210021 cm/s\n",
+ "\n",
+ "the value of NA_new is :4.855188*10**-6 kmol/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# overall gas phase mass transfer flux\n",
+ "# Variable Declaration \n",
+ "Kg=7.36*10**-10;\n",
+ "p=1.013*10**5;\n",
+ "Ky=Kg*p;\n",
+ "#resistance in gas phase is 0.45 of total resistance & .55 in liquid phase\n",
+ "#(resistance in gas phase)r_gas=1/ky and (resistance in liq phase)r_liq=m'/kx\n",
+ "r_gas=0.45*(1./Ky);\n",
+ "ky=1./r_gas;\n",
+ "r_liq=0.55*(1./Ky);\n",
+ "print \"film based liq phase mass transfer coeff.ky is :%f \"%ky\n",
+ "#from equilibrium relantionship indicates linear behaviour thus the slope of equilibrium curve is 86.45\n",
+ "# Calculation\n",
+ "m1=86.45;\n",
+ "kx=m1/r_liq;\n",
+ "yag=.1;\n",
+ "xal=(.4/64)/((99.6/18)+(.4/64));\n",
+ "print \"\\n film based gas phase mass transfer coeff.ky is :%f \"%kx\n",
+ "#slope of the line gives -kx/ky=-70.61\n",
+ "m2=m1; # since equilibrium line a straigth line m'=m''\n",
+ "Kx=1/(1/kx+(1/(m2*ky))); #overall liquid phase mass transfer coefficient\n",
+ "print \"\\n overall liq phase mass transfer coefficient Kx is :%f \"%Kx\n",
+ "# equillibrium relation is given under\n",
+ "p = [0.2,0.3,0.5,0.7];\n",
+ "a = [29,46,83,119];\n",
+ "i=0;\n",
+ "x = [0,0,0,0]\n",
+ "y = [0,0,0,0]\n",
+ " #looping for calcullating mole fraction\n",
+ "while (i<4):\n",
+ " x[i]= (p[i]/64.)/(p[i]/64.+100/18);\n",
+ " y[i]= a[i]/760.; #mole fraction plotted on y-axis\n",
+ " i=i+1; \n",
+ " #mole fraction plotted on x-axis\n",
+ "%pylab inline\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Result\n",
+ "plot(x,y);\n",
+ "title(\"Fig.3.17,Example 8\");\n",
+ "xlabel(\"X-- Concentration of SO2 in liquid phase, X(10**4)(molefraction)\");\n",
+ "ylabel(\"Y-- Concentration of SO2 in gas phase, Y(molefraction)\");\n",
+ "show()\n",
+ " #from the graph we get these values\n",
+ "yao=.083; #corresponding to the value of xao=0.001128\n",
+ "xao=.00132; #corresponding to the value of yag=.1\n",
+ "yai=.0925; #corresponding to the perpendicular dropped from the pt(.001128,0.1) \n",
+ "xai=.00123;\n",
+ " \n",
+ " # flux based on overall coefficient\n",
+ "NAo_gas=Ky*(yag-yao);\n",
+ "NAo_liq=Kx*(xao-xal);\n",
+ "print \"overall gas phase mass transfer flux -NAo_gas is :%f*10**-6 kmol/m**2*s \"%(NAo_gas/10**-6)\n",
+ "print \"overall liq phase mass transfer flux -NAo_liq is :%f*10**-6 kmol/m**2*s \"%(NAo_liq/10**-6);\n",
+ "\n",
+ " # flux based on film coefficient \n",
+ "NAf_gas=ky*(yag-yai);\n",
+ "NAf_liq=kx*(xai-xal);\n",
+ "print \"film based gas phase mass transfer flux-NAf_gas is :%f *10**-6 kmol/m**2*s\"%(NAf_gas/10**-6);\n",
+ "print \"film based liq phase mass transfer flux-NAf_liq is :%f *10**-6 kmol/m**2*s\"%(NAf_liq/10**-6);\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "film based liq phase mass transfer coeff.ky is :0.000166 \n",
+ "\n",
+ " film based gas phase mass transfer coeff.ky is :0.011719 \n",
+ "\n",
+ " overall liq phase mass transfer coefficient Kx is :0.006445 \n",
+ "Populating the interactive namespace from numpy and matplotlib"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['f']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEgCAYAAACXa1X+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdUFGe4BvBnKQYUEAs2QJEivYNEY8EWe0WvGFss0Wis\nUaPRaDAaa4xBTa5dY4mxJhBFkqigogFUsEREsKCIig1kCSCwvPePiXtFWHYh7M4C7+8czmFnZ2af\nRZeXma9JiIjAGGOMVRIdsQMwxhirXriwMMYYq1RcWBhjjFUqLiyMMcYqFRcWxhhjlYoLC2OMsUrF\nhYUxxlil0ivrySdPnuDgwYM4c+YMUlJSIJFI0KJFC3To0AFDhgxBo0aNNJWTMcZYFSFRNEBy3Lhx\nuH37Nnr27InWrVujadOmICI8evQIsbGxCA8Ph62tLbZu3arpzIwxxrSYwsJy9epVuLm5lXmwKvsw\nxhirWRQWFsYYY6wiymxjAYCoqCgsXrwYKSkpKCwsBABIJBLcuXNH7eEYY4xVPUqvWOzt7fHdd9/B\ny8sLurq68u0NGzZUezjGGGNVj9IrFlNTU/Ts2VMTWRhjjFUDSq9Y5s2bB5lMhkGDBuGdd96Rb/fy\n8lJ7OMYYY1WP0sLi7+8PiURSYntERITaQrGazdjYGNeuXYOVlZXYUaqVnTt3Ytu2bTh79qzYUVg1\np3TkfWRkJCIiIkp8MfZfWVlZoXbt2jA2NoaxsTFMTEzw+PFjSKXSChWVhIQE+Pj4oH79+jA1NcV7\n772HqKgohftv2LABPj4+MDAwwJgxY4o9t3fvXnkuY2Nj1KlTBzo6OoiPj1fpvRgbG2PatGnlfg/a\nKisrCyNGjICZmRnMzMwwYsQISKVSsWMxLaW0sGRmZmLmzJnw9vaGt7c3Zs2ahZcvX2oiG6vmJBI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z2Dh\nwoXMX6VSQSqVQiaTwd3dHevXr0d8fDxSUlIQHh6O4OBgbNu2DePj4zCZTOjp6ZnxWevGjRs4ceIE\nCgoKAJg/fyYkJOD9998HAERGRuLy5cssfHJyMlavXo0ff/wRS5YsQVVVFQCwszv8/f3R3NyMN998\n02693wuDg4MQCoXw9PSEq6srJBIJbt26NaOepmN978MPP0RVVRVkMhlqampY+7MOU1NTg08//RQh\nISGQSCRsSbyz9iUQCLBjxw5IJBKsW7cOq1atYveOHj2K8vJyyGQyREREQKfTITg4GK6urggJCcEH\nH3ww4znPpY8BzIM063f+QcAZoeTgmAMxMTEoKyvDypUr501ma2srysrKcOrUqXmTORtu3LiBqqoq\nlJaWzilea2sramtr73kv1XzwySefQK/XIysrC4B51qbT6ZCfn//A8vRPYf/+/ZDL5Wxw8iD4d/6N\n5+D4H8LZ6PN+EhQUNGelAgBr165Fd3e308+x95va2lrs2LGDuVNSUnD69On/e7NTBoMBGo1mzp8d\n5xtuxsLBwcHBMa9wMxYODg4OjnmFUywcHBwcHPMKp1g4ODg4OOYVTrFwcHBwcMwrnGLh4ODg4JhX\nOMXCwcHBwTGv/Aec+J/DRRI5KQAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2c409d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "overall gas phase mass transfer flux -NAo_gas is :1.267466*10**-6 kmol/m**2*s \n",
+ "overall liq phase mass transfer flux -NAo_liq is :1.235953*10**-6 kmol/m**2*s \n",
+ "film based gas phase mass transfer flux-NAf_gas is :1.242613 *10**-6 kmol/m**2*s\n",
+ "film based liq phase mass transfer flux-NAf_liq is :1.192479 *10**-6 kmol/m**2*s\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# concentration of acid at outlet\n",
+ "# Variable Declaration \n",
+ "Cas=1.521*10**-7;\n",
+ "v=1525; #velocity in m/s\n",
+ "D=0.0516; #diffusivity in cm**2/s\n",
+ "d=1.25*10**-3; #density of air in g/cm**3\n",
+ "u=1.786*10**-4; #viscosity of air in n*s/m**2\n",
+ "Dia=2.54; #diameter in cm\n",
+ "\n",
+ "# Calculation \n",
+ "nre=(Dia*v*d)/(u); #calc. of reynolds no.\n",
+ "cf=2*0.036*(nre)**(-0.25); #friction factor\n",
+ "nsc=(u)/(d*D); #calc of schmidt no.\n",
+ "kc=(cf*v)/(2*(nsc)**(2./3)); #cf/2=kc/uo*(sc)**2/3\n",
+ "\n",
+ "#consider an elelmental section of dx at a distance of x from the point of entry of air.\n",
+ "#let the conc. be c of diffusing component and c+dc at the point of leaving. mass balance across this elelmental gives\n",
+ " #rate of mass transfer=(cross sectional area)*(air velocity)*dc\n",
+ " # =(3.14*d**2/4)*v*dc -----1 eqn\n",
+ " \n",
+ "#flux for mass transfer from the surface=kc*(Cas-C)\n",
+ "# rate of mass transfer=(flux)*mass transfer\n",
+ "# =kc*(Cas-C)*3.14*dx*D------2 eqn\n",
+ "# solving ----1 & -----2 we get\n",
+ "# \n",
+ "# (3.14*d**2/4)*v*dc=kc*(Cas-C)*3.14*dx*d;\n",
+ "# dc/(Cas-C)=(kc*3.14*d*v)/(3.14*d**2/4)*dx\n",
+ "# solving this we get\n",
+ "# ln[(Cas-C)/(Cas-C_in)]=(kc*4*x)/(d*v)\n",
+ "import math\n",
+ "x=183; #upper limit of x\n",
+ "C_in=0; #C=C_in=0;\n",
+ "t=(kc*4*x)/(Dia*v); #variable to take out the exponential\n",
+ "z=math.e**t;\n",
+ "C_final=Cas-(z*(Cas-C_in)); #value of c_final in g*mol/cc;\n",
+ "\n",
+ "# Result\n",
+ "print \"\\t conc. of acid at outlet :%f *10**-8 g*mol/cc\\n\"%(abs(C_final/10**-8))\n",
+ "rate=(3.14*Dia**2/4)*v*(C_final-C_in);\n",
+ "print \"\\trate of mass transfer :%f *10**-4 g*mol/s\\n\"%(abs(rate/10**-4));\n",
+ "#End"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t conc. of acid at outlet :7.709387 *10**-8 g*mol/cc\n",
+ "\n",
+ "\trate of mass transfer :5.954246 *10**-4 g*mol/s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_Of_Mass_Transfer_Part_1/ch5.ipynb b/Elements_Of_Mass_Transfer_Part_1/ch5.ipynb
new file mode 100644
index 00000000..8e575f33
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/ch5.ipynb
@@ -0,0 +1,998 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Humidification"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties through humidity chart\n",
+ "\n",
+ "# Variable Declaration \n",
+ "#dry bulb temperature=50 and wet bulb temperature=35 \n",
+ "Tg=50.; #dry bulb temperature=50\n",
+ "To=0; #refrence temperature in degree celcius \n",
+ "Mb=28.84; #average molecular weight of air\n",
+ "Ma=18.; #average molecular weight of water\n",
+ "\n",
+ "#part(i)\n",
+ "ybar=.0483 #0.003 kg of water vapour/kg of dry air\n",
+ "print \"\\n the humidity(from chart) is \\t\\t:%f percent\"%ybar\n",
+ "\n",
+ "#part(ii)\n",
+ "humper=35.; #humidity percentage\n",
+ "print \"\\n the percentage humidity is(from chart) :%f percent\"%humper\n",
+ "\n",
+ "# Calculation and Result\n",
+ "#part(iii)\n",
+ "pt=1.013*10**5; #total pressure in pascal\n",
+ "molhum=0.0483; #molal humidity =pa/(pt-pa)\n",
+ "pa=molhum*pt/(1+molhum);\n",
+ "#the vopour pressure of water(steam tables)at 50degree = .1234*10**5 N/m**2\n",
+ "relhum=(pa/(.1234*10**5))*100; #percentage relative humidity =partial pressure/vapour pressure\n",
+ "print \"\\n the percentage relative humidity is \\t percent:%f \"%relhum\n",
+ "\n",
+ "#part(iv)\n",
+ "dewpoint=31.5; #dew point temperature in degree celcius\n",
+ "print \"\\n the dew point temperature \\t\\t :%f degree celcius\"%dewpoint\n",
+ "\n",
+ "#part(v)\n",
+ "Ca=1.005;\n",
+ "Cb=1.884;\n",
+ "ybar=.03; #saturation temperature inkg water vapour/kg dry air\n",
+ "Cs=Ca+Cb*ybar; #humid heat in kj/kg dry air degree celcius\n",
+ "print \"\\n we get humid heat as \\t\\t\\t :%f kj/kg dry air degree celcius \"%Cs\n",
+ "\n",
+ "#part(vi)\n",
+ "d=2502; #latent heat in kj/kg\n",
+ "H=Cs*(Tg-0)+ybar*d; #enthalpy for refrence temperature of 0 degree\n",
+ "print \"\\n we get H as \\t\\t\\t\\t :%f kj/kg\"%H\n",
+ "Hsat=274.; #enthalpy of sturated air\n",
+ "Hdry=50.; #enthalpy of dry air in kj/kg\n",
+ "Hwet=Hdry+(Hsat-Hdry)*0.35; #enthalpy of wet air in kj/kg\n",
+ "print \"\\n we get enthalpy of wet air as \\t:%f kj/kg\"%Hwet\n",
+ "\n",
+ "#part(vii)\n",
+ "VH=8315*((1./Mb)+(ybar/Ma))*((Tg+273.)/pt); #humid volume in m**3mixture/kg of dry air\n",
+ "print \"\\n we get VH as (a)\\t\\t\\t :%f m**3/kg of dry air\"%VH\n",
+ "spvol=1.055; #specific volume of saturated air in m**3*kg\n",
+ "vdry=0.91; #specific volume of dry air in m**3/kg\n",
+ "Vh=vdry+(spvol-vdry)*.35 #by interpolation we get Vh in m**3/kg of dry air \n",
+ "print \"\\n by interpolation we get specific volume Vh as(b) :%f m**3/kg of dry air\"%Vh\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the humidity(from chart) is \t\t:0.048300 percent\n",
+ "\n",
+ " the percentage humidity is(from chart) :35.000000 percent\n",
+ "\n",
+ " the percentage relative humidity is \t percent:37.822988 \n",
+ "\n",
+ " the dew point temperature \t\t :31.500000 degree celcius\n",
+ "\n",
+ " we get humid heat as \t\t\t :1.061520 kj/kg dry air degree celcius \n",
+ "\n",
+ " we get H as \t\t\t\t :128.136000 kj/kg\n",
+ "\n",
+ " we get enthalpy of wet air as \t:128.400000 kj/kg\n",
+ "\n",
+ " we get VH as (a)\t\t\t :0.963494 m**3/kg of dry air\n",
+ "\n",
+ " by interpolation we get specific volume Vh as(b) :0.960750 m**3/kg of dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties if DBT is 25 and WBT is 22\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#dry bulb temperature=25 and wet bulb temperature=22\n",
+ "Tg=25.; #dry bulb temperature=50\n",
+ "To=0; #refrence temperature in degree celcius \n",
+ "Mb=28.84; #average molecular weight of air\n",
+ "Ma=18.; #average molecular weight of water\n",
+ "\n",
+ "\n",
+ "# Calculation and Result\n",
+ "#part(i)\n",
+ "hum=.0145 #0.0145 kg of water/kg of dry air\n",
+ "print \"\\n the saturation humidity(from chart) is :%f percent\"%hum\n",
+ "\n",
+ "#part(ii)\n",
+ "humper=57.; #humidity percentage\n",
+ "print \"\\n the percentage humidity is \\t\\t:%f percent\"%humper\n",
+ "\n",
+ "#part(iii)\n",
+ "pt=1.; #total pressure in atm\n",
+ "sathum=0.0255; #molal humidity =pa/(pt-pa)\n",
+ "pa1=sathum*pt*(28.84/18)/(1+(sathum*(28.84/18)));\n",
+ "#the vopour pressure of water(steam tables)at 25 = .0393*10**5 N/m**2\n",
+ "pt=1; #total pressure in atm\n",
+ "molhum=0.0145; #molal humidity =pa/(pt-pa)\n",
+ "pa2=molhum*pt*(28.84/18)/(1+(molhum*pt*(28.84/18)));\n",
+ "#the vopour pressure of water(steam tables)at 25 = .0393*10**5 N/m**2\n",
+ "relhum=(pa2/pa1)*100; #percentage relative humidity =partial pressure/vapour pressure\n",
+ "print \"\\n the percentage relative humidity is \\t :%f \"%relhum\n",
+ "\n",
+ "#part(iv)\n",
+ "dewpoint=19.5; #dew point temperature in degree celcius\n",
+ "print \"\\n the dew point temperature \\t :%f degree celcius\"%dewpoint\n",
+ "\n",
+ "#part(v)\n",
+ "Ca=1005.;\n",
+ "Cb=1884.;\n",
+ "ybar=.0145; # humidity inkg water /kg dry air\n",
+ "Cs=Ca+Cb*ybar; #humid heat in j/kg dry air degree celcius\n",
+ "d=2502300.; #latent heat in j/kg\n",
+ "H=Cs*(Tg-0)+ybar*d; #enthalpy for refrence temperature of 0 degree\n",
+ "print \"\\n we get Humid heat H as \\t :%f j/kg\"%H\n",
+ "#the actual answer is 62091.3 bt in book it is given 65188.25(calculation mistake in book)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the saturation humidity(from chart) is :0.014500 percent\n",
+ "\n",
+ " the percentage humidity is \t\t:57.000000 percent\n",
+ "\n",
+ " the percentage relative humidity is \t :57.842165 \n",
+ "\n",
+ " the dew point temperature \t :19.500000 degree celcius\n",
+ "\n",
+ " we get Humid heat H as \t :62091.300000 j/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties of nitrogen oxygen vapour mixture\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "pt=800.; #total pressure in mmHg\n",
+ "pa=190.; #vapour pressure of acetone at 25 degree \n",
+ "ys_bar=pa*(58./28)/(pt-pa) #\n",
+ "#percentage saturation = y_bar/ys_bar *100\n",
+ "s=80; #percent saturation\n",
+ "\n",
+ "# Calculation and Result\n",
+ "y_bar=ys_bar*s/100.; #absolute humidity\n",
+ "print \"\\n the absolute humidity is \\t :%f kg acetone/kmol N2 \"%y_bar\n",
+ "\n",
+ "#part(ii)\n",
+ "#y_bar=pa*(58/28)/(pt-pa) \n",
+ "pa1=pt*y_bar*(28./58)/(1+(y_bar*(28./58)));\n",
+ "print \"\\n the partial pressure of acetone is:%f mmHg\"%pa1\n",
+ "\n",
+ "#part(iii)\n",
+ "y=pa1/(pt-pa1); #absolute molal humidity\n",
+ "print \"\\n absolute molal humidity \\t:%f kmol acetone/kmol N2\"%y\n",
+ "\n",
+ "#part(iv)\n",
+ "#volume of .249kmol acetone vapour at NTP =.249*22.14\n",
+ "#p1v1/T1 =p2v2/T2\n",
+ "p2=800.; #final pressure of acetone and nitrogen at 25 degree\n",
+ "p1=760.; #initial pressure of acetone and nitrogen at 25 degree\n",
+ "T2=298.; #final temperature of acetone and nitrogenat 25 degree\n",
+ "T1=273.; #initial temperature of acetone and nitrogen at 25 degree\n",
+ "vA1=5.581; #initial volume of acetone at 25 degree\n",
+ "vN1=22.414; #initial volume of nitrogen at 25 degree \n",
+ "vA2=T2*vA1*p1/(T1*p2); #final volume of acetone at 25 degree\n",
+ "vN2=T2*vN1*p1/(T1*p2); #final volume of nitrogen at 25 degree\n",
+ "vtotal=vA2+vN2; #total volume of the mixture\n",
+ "vper=vA2*100/vtotal; #percentage volume of acetone\n",
+ "print \"\\n the percentage volume of acetone is :%f m**3\"%vper\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the absolute humidity is \t :0.516159 kg acetone/kmol N2 \n",
+ "\n",
+ " the partial pressure of acetone is:159.580052 mmHg\n",
+ "\n",
+ " absolute molal humidity \t:0.249180 kmol acetone/kmol N2\n",
+ "\n",
+ " the percentage volume of acetone is :19.935703 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties at a temperature of 60 degree celcius\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "pa=13.3; #pressure in kpa\n",
+ "pa2=20.6; #vapour pressure at 60 degree\n",
+ "pt=106.6 #total pressure in kpa\n",
+ "y=pa/(pt-pa); #absolute molal humidity\n",
+ "\n",
+ "# Calculation and Result\n",
+ "y_bar=y*(18/28.84); #relative humidity\n",
+ "print \"\\n absolute humidity of mixture :%f kg water-vapour/kg dry air\"%y_bar\n",
+ "\n",
+ "\n",
+ "#part(ii)\n",
+ "mf=pa/pt; #mole fraction\n",
+ "print \"\\n the mole fraction is :%f\"%mf\n",
+ "\n",
+ "#part(iii)\n",
+ "vf=mf; #volume fraction\n",
+ "print \"\\n the volume fraction is :%f\"%vf\n",
+ "\n",
+ "#part(iv)\n",
+ "Ma=18.; #molecular weight\n",
+ "Mb=28.84; #molecular weight\n",
+ "Tg=60.; #temperature of mixture\n",
+ "rh=(pa/pa2)*100.; #relative humidity in pecentage \n",
+ "print \"\\n we get relative humidity as as :%f percent\"%rh\n",
+ "\n",
+ "#part(v)\n",
+ "VH=8315.*((1./Mb)+(y_bar/Ma))*((Tg+273)/pt)*10**-3; #humid volume in m**3mixture/kg of dry air\n",
+ "x=y_bar/VH; #g water/m**3 mixture \n",
+ "print \"\\n we get x i.e. gwater/m**3 mixture as :%f \"%(x*1000)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " absolute humidity of mixture :0.088971 kg water-vapour/kg dry air\n",
+ "\n",
+ " the mole fraction is :0.124765\n",
+ "\n",
+ " the volume fraction is :0.124765\n",
+ "\n",
+ " we get relative humidity as as :64.563107 percent\n",
+ "\n",
+ " we get x i.e. gwater/m**3 mixture as :86.460483 \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties if DBT is 30 and WBT is 25\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "y_bar=.0183; #kg water vapour/kg dry air\n",
+ "print \"\\n we get humidity as(from chart) :%f kg of water/kg dry air\"%y_bar\n",
+ "print \"\\n we get saturation humidity as(from chart) :%d percent\"%67\n",
+ "Ma=18.; #molecular weight\n",
+ "Mb=28.84; #molecular weight\n",
+ "Tg=30.; \n",
+ "pa = 13.3\n",
+ "pa2 = 20.6 #temperature of mixture\n",
+ "rh=(pa/pa2)*100; #relative humidity in pecentage \n",
+ "pt=1.013*10**5; #total pressure in pascal\n",
+ "\n",
+ "# Calculation and Result\n",
+ "VH=8315*((1./Mb)+(y_bar/Ma))*((Tg+273)/pt); #humid volume in m**3mixture/kg of dry air\n",
+ "print \"\\n we get humid volume as \\t:%f m**3/kg dry air\"%VH\n",
+ "\n",
+ "#part(ii)\n",
+ "Ca=1005.;\n",
+ "Cb=1884.;\n",
+ "Cs=Ca+Cb*y_bar; #humid heat in j/kg dry air degree celcius\n",
+ "print \"\\n we get humid heat as \\t\\t :%f j/kg dry air degree celcius \"%Cs\n",
+ "\n",
+ "#part(iii)\n",
+ "d=2502300.; #latent heat in j/kg\n",
+ "H=Cs*(Tg-0)+y_bar*d; #enthalpy for refrence temperature of 0 degree\n",
+ "print \"\\n we get Enthalpy H as \\t\\t:%f j/kg dry air\"%H\n",
+ "\n",
+ "#part(iv)\n",
+ "dewpoint=23.5; #dew point temperature in degree celcius\n",
+ "print \"\\n the dew point temperature \\t :%f degree celcius\"%dewpoint\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " we get humidity as(from chart) :0.018300 kg of water/kg dry air\n",
+ "\n",
+ " we get saturation humidity as(from chart) :67 percent\n",
+ "\n",
+ " we get humid volume as \t:0.887669 m**3/kg dry air\n",
+ "\n",
+ " we get humid heat as \t\t :1039.477200 j/kg dry air degree celcius \n",
+ "\n",
+ " we get Enthalpy H as \t\t:76976.406000 j/kg dry air\n",
+ "\n",
+ " the dew point temperature \t :23.500000 degree celcius\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties when dry bulb temperature is 55\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "y=.048; #humidity kmol water vapour/kmol dry air\n",
+ "y_bar=y*(18/28.84); #(from chart) absolute humidity\n",
+ "print \"we get absolute humidity as :%f kg of water/kg dry air\"%(y_bar)\n",
+ "print \"we get percentage humidity as(from chart) :%f percent\"%(25.5);\n",
+ "\n",
+ "# Calculation and Result\n",
+ "y_bar=y*(18/28.84); #relative humidity\n",
+ "Ma=18.; #molecular weight\n",
+ "Mb=28.84; #molecular weight\n",
+ "Tg=55.; #temperature of mixture\n",
+ "pt=1.013*10**5; #total pressure in pascal\n",
+ "VH=8315*((1./Mb)+(y_bar/Ma))*((Tg+273)/pt); #humid volume in m**3mixture/kg of dry air\n",
+ "print \"\\n we get VH as \\t :%f m**3/kg dry air\"%VH\n",
+ "\n",
+ "#part(ii)\n",
+ "Ca=1005.;\n",
+ "Cb=1884.;\n",
+ "Cs=Ca+Cb*y_bar; #humid heat in j/kg dry air degree celcius\n",
+ "print \"\\n we get humid heat as \\t :%f j/kg dry air degree celcius \"%Cs\n",
+ "\n",
+ "#part(iii)\n",
+ "d=2502300.; #latent heat in j/kg\n",
+ "H=Cs*(Tg-0)+y_bar*d; #enthalpy for refrence temperature of 0 degree\n",
+ "print \"\\n we get H as \\t :%f j/kg dry air\"%H\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "we get absolute humidity as :0.029958 kg of water/kg dry air\n",
+ "we get percentage humidity as(from chart) :25.500000 percent\n",
+ "\n",
+ " we get VH as \t :0.978346 m**3/kg dry air\n",
+ "\n",
+ " we get humid heat as \t :1061.441609 j/kg dry air degree celcius \n",
+ "\n",
+ " we get H as \t :133344.170596 j/kg dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of final temperature\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#given o.03 kg of water vapour/kg of dry air is contacted with water at an adiabatic temperature and humidified and cooled to 70 percent saturtion\n",
+ " \n",
+ "#from pyschometric chart\n",
+ "ft=46; #final temperature in degree celcius\n",
+ "# Calculation and Result\n",
+ "print \"\\n final temperature is (from chart):%f degree celcius\"%ft\n",
+ "y_bar=.0475; # humidity of air\n",
+ "print \"\\n the humidity of air(from chart) :%f kg water vapour /kg dry air\"%y_bar\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " final temperature is (from chart):46.000000 degree celcius\n",
+ "\n",
+ " the humidity of air(from chart) :0.047500 kg water vapour /kg dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of molal humidity\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "pa1=4.24 #data: vapour pressure of water at 30degree = 4.24 kpa\n",
+ "pa2=1.70 # vapour pressure of water at 30degree = 1.70 kpa\n",
+ "\n",
+ "#part(i)\n",
+ "pt=100.; #total pressure\n",
+ "\n",
+ "# Calculation \n",
+ "ys_bar=pa1/(pt-pa1); #kg water vapour/kg dry air\n",
+ "rh=.8; #relative humidity\n",
+ "pa3=rh*pa1; #partial pressure\n",
+ "y_bar=pa3*(18/28.84)/(pt-pa3); #molal humidity\n",
+ "print \"\\n the molal humidity:%f kg/kg dry air\"%y_bar\n",
+ "\n",
+ "#part(ii)\n",
+ "#under these conditions the air will be saturated at 15 degree as some water is condensed\n",
+ "pa=1.7; \n",
+ "pt=200.;\n",
+ "ys=pa/(pt-pa);\n",
+ "ys_bar=ys*(18/28.84);\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the molal humidity if pressure doubled and temp. is 15 :%f kg/kg dry air\"%ys_bar\n",
+ "\n",
+ "#part(iii) \n",
+ "Ma=18.; #molecular weight\n",
+ "Mb=28.84; #molecular weight\n",
+ "Tg=30.; #temperature of mixture\n",
+ "rh=(pa/pa2)*100; #relative humidity in pecentage \n",
+ "pt=10**5; #total pressure in pascal\n",
+ "VH=8315*((1./Mb)+(y_bar/Ma))*((Tg+273)/pt); #humid volume in m**3mixture/kg of dry air\n",
+ "print \"\\n we get humid volume VH as \\t :%f m**3/kg of dry air\"%VH\n",
+ "w=100/VH; #100 m**3 of original air \n",
+ "wo= w*y_bar; #water present in original air\n",
+ "wf= w*ys_bar; #water present finally\n",
+ "wc=wo-wf; #water condensed from 100m**3 of original sample\n",
+ "print \"\\n the weight water condensed from 100m**3 of original sample:%f kg\"%wc\n",
+ "\n",
+ "#part(iv)\n",
+ "Tg=15.; #temperature of mixture \n",
+ "pt=2*10**5; #total pressure in pascal\n",
+ "VH=8315*((1./Mb)+(ys_bar/Ma))*((Tg+273)/pt); #humid volume in m**3mixture/kg of dry air\n",
+ "vf=VH*110.6; #final volume of mixture\n",
+ "print \"\\n we get VH final volume of mixture as \\t :%f m**3\"%vf\n",
+ "\n",
+ "#end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the molal humidity:0.021914 kg/kg dry air\n",
+ "\n",
+ " the molal humidity if pressure doubled and temp. is 15 :0.005351 kg/kg dry air\n",
+ "\n",
+ " we get humid volume VH as \t :0.904267 m**3/kg of dry air\n",
+ "\n",
+ " the weight water condensed from 100m**3 of original sample:1.831684 kg\n",
+ "\n",
+ " we get VH final volume of mixture as \t :46.311825 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of relative humidity and humid volume\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "y_bar=.03; # humidity inkg water /kg dry air\n",
+ "pt=760.; #total pressure in pascal\n",
+ "pa2=118.; #final pressure\n",
+ "\n",
+ "# Calculation and Result\n",
+ "y=y_bar/(18/28.84); #humidity kmol water vapour/kmol dry air\n",
+ "pa=(y*pt)/(y+1); #partial pressure\n",
+ "rh=pa/pa2; #relative humidity\n",
+ "sh=pa2/(pt-pa2); #saturated humidity\n",
+ "ph=(y/sh)*100; #percentage humidity\n",
+ "print \"\\n percentage humidity is :%f\"%ph\n",
+ "\n",
+ "#/part(ii)\n",
+ "Ma=18.; #molecular weight\n",
+ "Mb=28.84; #molecular weight\n",
+ "Tg=55.; #temperature of mixture\n",
+ "pt=1.013*10**5; #total pressure in pascal\n",
+ "VH=8315*((1./Mb)+(y_bar/Ma))*((Tg+273)/pt); #humid volume in m**3mixture/kg of dry air\n",
+ "print \"\\n we get VH humid volume as :%f m**3/kg dry air\"%VH\n",
+ "\n",
+ "\n",
+ "#part(iii)\n",
+ "Ca=1005.;\n",
+ "Cb=1884.;\n",
+ "Cs=Ca+Cb*y_bar; #humid heat in j/kg dry air degree celcius\n",
+ "print \"\\n we get humid heat as \\t :%f j/kg dry air degree celcius \"%Cs\n",
+ "d=2502300; #latent heat in j/kg\n",
+ "H=Cs*(Tg-0)+y_bar*d; #enthalpy for refrence temperature of 0 degree\n",
+ "print \"\\n we get H enthalpy as \\t :%f j/kg\"%H\n",
+ "\n",
+ "#part(iv)\n",
+ "v=100.; #volume of air\n",
+ "mass=v/VH; #mass of dry air\n",
+ "Tg=110.; #temperature of mixture\n",
+ "d=2502300.; #latent heat in j\n",
+ "H_final=Cs*(Tg-0)+y_bar*d; #enthalpy for refrence temperature of 0 degree\n",
+ "H_added=(H_final-H)*102.25; #HEAT added in kj \n",
+ "print \"\\n we get heat added as \\t :%f kj\"%(H_added/1000)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " percentage humidity is :26.151525\n",
+ "\n",
+ " we get VH humid volume as :0.978409 m**3/kg dry air\n",
+ "\n",
+ " we get humid heat as \t :1061.520000 j/kg dry air degree celcius \n",
+ "\n",
+ " we get H enthalpy as \t :133452.600000 j/kg\n",
+ "\n",
+ " we get heat added as \t :5969.723100 kj\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of film coefficient and make up water\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "%pylab inline\n",
+ "L=2000.; #flow rate of water to be cooled in kg/min\n",
+ "T1=50.; #temperature of inlet water\n",
+ "T2=30.; #temp. of outlet water\n",
+ "H1=.016; #humidity of incoming air\n",
+ "cp=4.18; #specific heat of water\n",
+ "cpair=1.005; #specific heat capcity of air\n",
+ "cpwater=1.884; #specific heat capcity of water\n",
+ "tg=20.; #temperature in degree\n",
+ "to=0;\n",
+ "ybar=0.016; #saturated humidity at 20 degree\n",
+ "d=2502.; #latent heat\n",
+ "Ky_a=2500.; #value of masstransfer coefficient in kg/hr*m**3*dybar\n",
+ "\n",
+ "# Calculation \n",
+ "E=cpair*(tg-to)+(cpwater*(tg-to)+d)*ybar; #enthalpy\n",
+ "#similarly for other temperatures\n",
+ "T=[20,30,40,50,55] #differnt temperature for different enthalpy calculation\n",
+ "i=0;\n",
+ "E= [0,0,0,0,0]\n",
+ "while(i<5): #looping for different enthalpy calculation of operating line\n",
+ " E[i]=cpair*(T[i]-to)+(cpwater*(T[i]-to)+d)*ybar;\n",
+ " print \"\\n the enhalpy at :%f is :%f\"%(T[i],E[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "ES=[60.735,101.79,166.49,278.72,354.92] #enthalpy of eqll condition\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Result\n",
+ "plot(T,E);\n",
+ "plot(T,ES);\n",
+ "title(\"Fig.5.10(b),Temperature-Enthalpy plot\");\n",
+ "xlabel(\"X-- Temperature, degree celcius\");\n",
+ "ylabel(\"Y-- Enthalpy ,kj/kg\");\n",
+ "legend(\"operating line\",\"Enthalpy at saturated cond\")\n",
+ "show()\n",
+ "#locate (30,71.09) the operating conditions at the bottom of the tower and draw the tangent to the curve\n",
+ "Hg1=71.09; #point on the oper. line(incoming air)\n",
+ "Hg2=253.; #point after drawing the tangent\n",
+ "slope=(Hg2-Hg1)/(T1-T2); #we gt slope of the tangent\n",
+ " #slope = (L*Cl/G)_min\n",
+ "Cl=4.18;\n",
+ "G_min=L*60*Cl/slope; #tangent gives minimum value of the gas flow rate\n",
+ "G_actual=G_min*1.3; #since actual flow rate is 1.3 times the minimum\n",
+ "slope2=L*Cl*60/G_actual; #slope of operating line\n",
+ "Hg2_actual=slope2*(T1-T2)+Hg1; #actual humidityat pt 2\n",
+ "Ggas=10000.; #minimum gas rate in kg/hr*m**2\n",
+ "Area1=G_actual/Ggas; #maximum area of the tower(based on gas)\n",
+ "Gliq=12000.; #minimum liquid rate in kg/hr*m**2\n",
+ "Area2=60*L/Gliq; #maximum area of the tower(based on liquid)\n",
+ "print \"\\n \\n the maximum area of the tower(based on gas) is :%f m**2\"%Area1\n",
+ "print \"\\n the maximum area of the tower(based on liquid) is :%f m**2\"%Area2\n",
+ "dia=(Area1*4/3.14)**0.5; #diameter of the tower in m\n",
+ "\n",
+ "#let us assume the resistance to mass transfer lies basically in gas phase. hence the,interfacial conditions and the eqlb cond. are same.vertical line drawn between oper. and equl. line we get conditions of gas and equl. values are tabulated below as follows\n",
+ " \n",
+ " \n",
+ "#table\n",
+ "T=[20,30,40,50,55] #differnt temperature for different enthalpy calculation\n",
+ "#enthaly \n",
+ "H_bar=[101.79,133.0,166.49,210.0,278.72] #H_bar i.e. at equl.\n",
+ "Hg=[71.09,103.00,140.00,173.00,211.09] #Hg i.e. of operating line\n",
+ "i=0;\n",
+ "y = [0,0,0,0,0]\n",
+ "while(i<5): #looping for different enthalpy calculation of operating line\n",
+ " y[i]=1./(H_bar[i]-Hg[i]);\n",
+ " print \"\\n the enhalpy at :%f is :%f\"%(T[i],y[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "plot(Hg,y,\"o-\");\n",
+ "\n",
+ "#area under this curve gives Ntog =4.26\n",
+ "Ntog=4.26; #no. of transfer unit\n",
+ "Gs=10000.; #gas flow rate\n",
+ "Htog=Gs/Ky_a; # height of transfer unit\n",
+ "height=Ntog*Htog; #height of the tower\n",
+ "print \"\\n \\nthe tower height is :%f m\"%height\n",
+ "\n",
+ "\n",
+ "#make up water is based onevaporation loss(E),blow down loss(B),windage loss(W) M = E + B + W\n",
+ "W=.2/100 *L*60; #windage loss(W)\n",
+ "B=0; #blow down loss neglected\n",
+ "E=G_actual*(.064-.016); #assuming air leaves fully saturated\n",
+ "M = E + B + W; #make up water is based onevaporation loss(E),blow down loss(B),windage loss(W)\n",
+ "print \"\\n make up water is based onevaporation loss(E),blow down loss(B),windage loss(W) is :%f kg /hr\"%M\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "\n",
+ " the enhalpy at :20.000000 is :60.734880\n",
+ "\n",
+ " the enhalpy at :30.000000 is :71.086320\n",
+ "\n",
+ " the enhalpy at :40.000000 is :81.437760\n",
+ "\n",
+ " the enhalpy at :50.000000 is :91.789200\n",
+ "\n",
+ " the enhalpy at :55.000000 is :96.964920\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/pymodules/python2.7/matplotlib/legend.py:336: UserWarning: Unrecognized location \"Enthalpy at saturated cond\". Falling back on \"best\"; valid locations are\n",
+ "\tright\n",
+ "\tcenter left\n",
+ "\tupper right\n",
+ "\tlower right\n",
+ "\tbest\n",
+ "\tcenter\n",
+ "\tlower left\n",
+ "\tcenter right\n",
+ "\tupper left\n",
+ "\tupper center\n",
+ "\tlower center\n",
+ "\n",
+ " % (loc, '\\n\\t'.join(self.codes.iterkeys())))\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAA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5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x266c510>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " \n",
+ " the maximum area of the tower(based on gas) is :7.169260 m**2\n",
+ "\n",
+ " the maximum area of the tower(based on liquid) is :10.000000 m**2\n",
+ "\n",
+ " the enhalpy at :20.000000 is :0.032573\n",
+ "\n",
+ " the enhalpy at :30.000000 is :0.033333\n",
+ "\n",
+ " the enhalpy at :40.000000 is :0.037750\n",
+ "\n",
+ " the enhalpy at :50.000000 is :0.027027\n",
+ "\n",
+ " the enhalpy at :55.000000 is :0.014786\n",
+ "\n",
+ " \n",
+ "the tower height is :17.040000 m\n",
+ "\n",
+ " make up water is based onevaporation loss(E),blow down loss(B),windage loss(W) is :3681.244571 kg /hr\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAD9CAYAAABTJWtQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9clfXdx/HXUUmXVmjlcXFoGGCIP0DDaN5lNEVK50nT\nGbaMGe3hTbeSy1qZq+Gj28K17uaPteEyg62Z7t4UNpG028iykJq47qXdosE6kNJKaVkievzef1xx\nJYpHhAPnAO/n4+HDcy6+5zqfCz3X51zf7/fzvRzGGIOIiAjQLdABiIhI8FBSEBERm5KCiIjYlBRE\nRMSmpCAiIjYlBRERsZ0zKRQVFRETE0N0dDRLlixpsk1mZibR0dHExcVRVlbW6Gder5cRI0YwadIk\ne9uhQ4dITk5m0KBBjB8/ntra2lYehoiI+IPPpOD1epkzZw5FRUXs3r2bNWvWsGfPnkZtCgsL2bdv\nH+Xl5axcuZKMjIxGP1+6dCmxsbE4HA57W3Z2NsnJyezdu5exY8eSnZ3tx0MSEZGW8pkUSktLiYqK\nIiIigpCQEFJTU8nPz2/UpqCggLS0NAASExOpra2lpqYGgK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hMHFxcfb/xU2bNgXd56ip\nOAsLC/32OXIYo7UkRETEEhTdRyIiEhyUFERExKakICIiNiUFERGxKSmIiIhNSUFERGz/D9lv2CnP\n3JueAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x3115a50>"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the make up water needed and the velocity of air\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#air leaves at 19 degree at fully saturated condition\n",
+ "\n",
+ "T1=30.; #temperature at the inlet in degree celcius\n",
+ "T2=17.; #temperature at the exit in degree celcius\n",
+ "f=100000.; #flow rate of water in kg/hr\n",
+ "hi=.004; #humidity of incoming air in kg/kg of dry air\n",
+ "hl=.015; #humidity of leaving air in kg/kg of dry air\n",
+ "Hi=18.11; #enthalpy of incoming air in kg/kg of dry air\n",
+ "Hl=57.16; #enthalpy of leaving air in kg/kg of dry air\n",
+ "#w=mdry*(hl-hi) = mdry*0.011; -----equn 1st \n",
+ "#mass of water evaporated\n",
+ "\n",
+ "#making energy balance: total heat in = total heat out\n",
+ "#heat in entering water + heat in entering air = heat in leaving water + heat in leaving air\n",
+ "#100000*1*(30-0) + mdry*Hi = (100000-w)*1*(17-0) + mdry*Hl ----eqn 2nd\n",
+ "\n",
+ "#substituting eqn 1st in 2nd we get;\n",
+ "a=14.4; #cross sectional area of the tower in m**2\n",
+ "\n",
+ "# Calculation \n",
+ "mdry=(T1*f-T2*f)/(Hl-Hi-T2*.011); #mass of dry air\n",
+ "velocity=mdry/a; #air velocity in kg/m**2* hr\n",
+ "x=mdry*.011; #make up water needed in kg/hr\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the make up water needed is :%f kg /hr\"%x\n",
+ "print \"\\n the velocity of air is as :%f kg/hr\"%velocity\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the make up water needed is :367.959241 kg /hr\n",
+ "\n",
+ " the velocity of air is as :2322.975009 kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the length of the chamber\n",
+ "import math\n",
+ "#horizontal spray with recirculated water . air is cooled and humidified to 34 and leaves at 90percent saturation\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "T1=65; #dry bulb temperature at the inlet in degree celcius\n",
+ "f=3.5; #flow rate of air in m**3/s\n",
+ "hi=1.017; #humidity of incoming air in kg/kg of dry air\n",
+ "hl=.03; #humidity of leaving air in kg/kg of dry air\n",
+ "k=1.12; #mass transfer coefficient in kg/m**3*s\n",
+ "y1=.017; #molefraction at recieving end\n",
+ "y2=.03; #molefraction at leaving end\n",
+ "\n",
+ "#substituting eqn 1st in 2nd we get;\n",
+ "a=2; #cross sectional area of the tower in m**2\n",
+ "d=1.113; #density o fair in kg/m**3\n",
+ "\n",
+ "# Calculation \n",
+ "m=(f*d) #mass flow rate of air\n",
+ "gs=m/hi; #air velocity in kg/m**2* hr\n",
+ "ys_bar=.032;\n",
+ "#for recirculation humidifier\n",
+ "# Result\n",
+ "z=math.log((ys_bar-y1)/(ys_bar-y2))*gs/k; #length of the chamber required\n",
+ "print \"\\n the length of the chamber required is :%f m\"%z\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the length of the chamber required is :6.890939 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_Of_Mass_Transfer_Part_1/ch6.ipynb b/Elements_Of_Mass_Transfer_Part_1/ch6.ipynb
new file mode 100644
index 00000000..ab63d6e7
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/ch6.ipynb
@@ -0,0 +1,1312 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Drying"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the solid temp\n",
+ "\n",
+ "# Variable Declaration \n",
+ "#air leaves the pre-heater of the dryer at 325K\n",
+ "\n",
+ "H1=.005; #humidity of incoming air per kg of dry air\n",
+ "T1=25.; #wet bulb temperature\n",
+ "#moisture is removed along constant wet bulb temp. till 60per R.H is reached\n",
+ "# from the chart ,humidity of ai rleaving first shelf =.016 kg water /kg dry air.\n",
+ "\n",
+ "#dry bulb temp. of exit air is at 27 degree aand is at humidity of .016 kg water/kg dry air.the air is again heated to 52 degree dry bulb temp. in 2nd heater .\n",
+ "\n",
+ "#so air leaves heater at 52 degree and humidity of .016 kg water/kg dry air. when it leaves the 2nd shelf the correspondin dry bulb temp. is 34 degree and humidity is .023 kg water/kg dry air. the air enters the 3rd shelf after preheating to 52 degree . \n",
+ " \n",
+ "#similarly fro 3rd shelf , exit air has a humidity of .028 kg water/kg dry air and adry bulb temp. is 39 degree. the air is leaving the 4rth shelf has a humidity of .016 kg water/kg dry air and adry bulb temp. of 42 degree(the figure is only indicative and doed not correspond toactual one)\n",
+ "\n",
+ "print \"\\n the solid temp. correspond to wbt and they are 23, 27,32 and 34 degree respectively\"\n",
+ "\n",
+ "#part(ii)\n",
+ "Ybar=.032; #kg water/kg dry air#final moist air condotions \n",
+ "T2=42.; #dry bulb temperature\n",
+ "Mair=28.84; #molecular weight of air \n",
+ "Mwater=18; #molecular weight of water\n",
+ "pt=1.013*10**5; #total pressure in pascal\n",
+ "Vh=8315*((1/Mair)+(Ybar/Mwater))*((T2+273)/pt);\n",
+ "r=300; #flow rate of moist air leaving the dryer\n",
+ "a=r*60/Vh; #amount of dry air leaving /hr\n",
+ "w=a*(Ybar-0.005); # water removed /hr\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the water removed /hr is :%fkg /hr\"%w\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the solid temp. correspond to wbt and they are 23, 27,32 and 34 degree respectively\n",
+ "\n",
+ " the water removed /hr is :515.648113kg /hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying\n",
+ "# Variable Declaration \n",
+ "\n",
+ "%pylab inline\n",
+ "#table X*100,(kgmoisture/kg dry solid) N*100 (kg moisture evaporated /hr*m**2)\n",
+ " \n",
+ "# 35 30\n",
+ "# 25 30\n",
+ "# 20 30\n",
+ "# 18 26.6\n",
+ "# 16 23.9\n",
+ "# 14 20.8\n",
+ "# 12 18\n",
+ "# 10 15\n",
+ "# 9 9.7\n",
+ "# 8 7\n",
+ "# 7 4.3\n",
+ "# 6.4 2.511111\n",
+ "\n",
+ "\n",
+ "Ls=262.5; #mass of bone dry solid ais the drying surface\n",
+ "A=262.5/8; #both upper surafce and lower surface are exposed\n",
+ "Nc=0.3; #in kg/m**2*hr\n",
+ "x2=.06; #moisture content on wet basis finally after drying\n",
+ "x1=.25; #moisture content on wet basis finally after drying\n",
+ "Xcr=0.20; #crtical moisture content\n",
+ "X1=x1/(1-x1); #moisture content on dry basis intially\n",
+ "X2=x2/(1-x2); #moisture content on dry basis finally after drying\n",
+ "Xbar=0.025; #equillibrium moisture \n",
+ "\n",
+ "# Calculation \n",
+ "t1=Ls/(A*Nc) *(X1-Xcr); #so for constant rate period \n",
+ "\n",
+ "#for falling rate period we find time graphically\n",
+ "p = [.20 ,.18, .16, .14, .12, .10, .09, .08, .07, .064];\n",
+ "a = [3.3, 5.56, 6.25, 7.14, 8.32, 10.00, 11.11, 12.5, 14.29, 15.625];\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Result\n",
+ "plot(p,a);\n",
+ "title(\"Fig.6.18 Example2 1/N vs X for fallling rate period\");\n",
+ "xlabel(\"X-- Moisture content, X(kg/kg)\");\n",
+ "ylabel(\"Y-- 1/N, hr,m**2/kg\");\n",
+ "\n",
+ "Area=1.116; #area under the curve\n",
+ "t2=Area *Ls/A; #falling rate period we find time graphically\n",
+ "ttotal=t1+t2; #total time for drying\n",
+ "print \"\\n the total time for drying the wet slab on wet basis is :%f min\"%ttotal\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "\n",
+ " the total time for drying the wet slab on wet basis is :12.483556 min\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEXCAYAAABCjVgAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8TGcXB/DfRGLNbglZJGiRXSJIaBhiJ5aUEFtIUfRt\nay2109oppUWrJKmivHYqocJYmyoRsVaLIIklCFkksp33j/vmMkkmEsnMnUnO9/PxkZm59z5nljtn\nnuU+j4y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Gx5n/eANC+fXtcu3ZN\n7GhWVXb+GN80evRouLi4YOjQoSAi3Lp1S6kpCBC+uPft24cZM2YAAJo1a4YuXbpg6dKlAIAPPvhA\nTJh55VWvXh0HDx7EypUrcfDgQYwbNw6JiYlwdHTErFmz4OjoCGNjY4SFhYlNR2/u369fP4waNQq9\nevWCTCbD2rVr0bVrV3h4eMDY2FhpBbdz586hbdu2hT4/pv14QjzGtNTVq1cRHByM5cuXl2g/hUKB\n7du3Y926dSq3yc3NRVZWFqpUqYJbt26hc+fOuHHjBnr06IHNmzfDwsKiyDLS0tLEZrpPPvkEjRs3\nxueff47c3Fy4u7vj/Pnz0NfXL1HcTDtwUmCsHOrYsSP27Nmj8lqFlJQUdOjQAVlZWSAiLF26FF26\ndCn28VetWoXQ0FBkZmbC3d0dGzZsQNWqVbF//37ExMRg5syZZfVUmIZxUmCMMSbiPgXGGGMiTgqM\nMcZEnBQYY4yJOCkwxhgTcVJgjDEm4qTAGGNM9D/a8te+YditMAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x29ae2d0>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3.a "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# plots of drying rate curve\n",
+ "\n",
+ "#part(i)\n",
+ "#table wt of wet slab,kg -- 5.0 4.0 3.6 3.5 3.4 3.06 2.85\n",
+ "# drying rate,kg/m**2s-- 5.0 5.0 4.5 4.0 3.5 2.00 1.00\n",
+ "# X,Dry basis -- 1.0 0.6 .44 0.4 .36 .224 0.14\n",
+ "# equillibrium relation is given under\n",
+ "\n",
+ "# Variable Declaration \n",
+ "p = [1.0,0.6,.44,0.4,.36,.224, 0.14];\n",
+ "a = [5.0,5.0, 4.5, 4.0, 3.5, 2.00, 1.00];\n",
+ "\n",
+ "i=0; #looping for calc. of 1/N \n",
+ "t = [0,0,0,0,0,0,0]\n",
+ "\n",
+ "# Calculation \n",
+ "while(i<7): #looping begins\n",
+ " t[i]=1./(a[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Result\n",
+ "plot(p,a);\n",
+ "title(\"Fig.6.19(a) Example3 Drying Rate curve\");\n",
+ "xlabel(\"X-- Moisture content, X(kg/kg) ---->\");\n",
+ "ylabel(\"Y-- Drying Rate, N(kg/hr.m**2 ---->\");\n",
+ "#xset('window',1);\n",
+ "plot(p,t,\"o-\");\n",
+ "title(\"Fig.6.19(b) Example3 1/N vs X\");\n",
+ "xlabel(\"X-- Moisture content, X(kg/kg) --->\");\n",
+ "ylabel(\"Y-- 1/N, hr,m**2/kg --->\");\n",
+ "show()\n",
+ "#from X=0.6 to 0.44 ,falling rate is non linear and from X=.44 to .14 falling rate is linear\n",
+ "\n",
+ "print \"\\n from the graph we get critical moisture content as 0.6 kg moisture/kg dry solid\"\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEXCAYAAACu1P9TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdYFNf6B/DvLqBAqCqWCJESsdAR241lFQ0gYjcRc9Wg\nV43GWPLDq8YCakxiYmyoSUxUbFgSOypKjGsssSFFUdSgKBYUBaUpbc/vj71MWGFhgZ2dXfb9PI9P\n2JnZOe8s5J2z78w5I2KMMRBCCKn3xEIHQAghRDMo4RNCiJ6ghE8IIXqCEj4hhOgJSviEEKInKOET\nQoieoIRfj5ibmyMtLU3oMKp17NgxDB48mHstFotx586dSrc9dOgQRowYoanQeBMZGYnu3bsLHQbR\nc5TwdZC9vT1MTU1hbm4Oc3NzWFhYICMjA7m5ubC3t6/VPgsKCjB58mTY2NjAysoKPXv2VLrtmj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MmDEDhYWFAOQ97OfP\nn3PbNmjQAHv37sWWLVuwY8cOAMB7773HXVy/fv069y0hOTkZbdu2VUjY/v7+mD17NgIDA5GXlwdn\nZ2fcuXOH+1aya9cuhdgeP37M9f7Li4mJQXx8PNavX49OnTpxf1dBQUH48ssvub8rQP7tyMPDAwsW\nLICvry9u3LiB5cuX03OtBUYJv574+eefYW9vz/XIJ0+ejBs3blToFVZFJBJxiaJr167c9Mbll2/e\nvBkzZ86Eh4cHkpKSsGDBAoX35+bmIigoCB4eHujevTtWrFgBABgxYgS+++47dOjQAXfv3kVoaCh+\n+OEHeHt74/nz59z+y7cFyC80FhcXw93dHa6urggLC6sQt5+fHwYMGAAfHx94eXlxt5BWFeubxw0A\nvXr1wvXr17mLtsrafjPG8iZMmAB3d3eMGjUKjDGkpqZWmJI5OTkZBw4c4Kb/9fT0hJ+fH7799lsA\nQLdu3biTYVl7pqamiI6OxooVKxAdHY3JkycjMzMTLi4umD9/PlxcXGBhYYGjR49y5Zzy7x82bBjG\njx+PAQMGQCQSYd26dfD394ePjw8sLCy4J7sB8l55jx49Kj0+VTVp0gTR0dGIiYnBsGHDeH1aFVEd\nTZ5GCE+Sk5OxadMmLFu2rEbvk0ql2LVrF3744Qel28hkMhQXF6Nhw4ZITU3F+++/j5SUFAQGBmLr\n1q1o1qxZlW3k5+dzpbNPP/0Uzs7OmDZtGmQyGby9vXH58mVK0vUQJXxCtFCfPn2wb98+pffi5+bm\nonfv3iguLgZjDN9++y38/PxU3v/KlSuxefNmFBUVwdvbGz///DOMjY1x8OBBJCUlYd68eeo6FKJF\nKOETQoieoBo+IYToCUr4hBCiJyjhE0KInqCETwgheoISPiGE6AlK+IQQoif+HySjOfLSIHAXAAAA\nAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x34ed890>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " from the graph we get critical moisture content as 0.6 kg moisture/kg dry solid\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3.b"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# total time for drying\n",
+ "\n",
+ "# Variable Declaration \n",
+ "#part(ii)\n",
+ "w1=5.; #wet of wet solid\n",
+ "c1=.5/(1-.5); #moisture content per kg wet solid\n",
+ "w2=5.*0.5; #moisture for 5kg wet solid\n",
+ "w3=w1-w2; #weight of dry solid\n",
+ "xbar=0.05; #equillibrium moisture content\n",
+ "Xbar=xbar/(1-xbar); #equillibrium moisture content\n",
+ "Ls=2.5; #mass of bone dry solid ais the drying surface\n",
+ "A=5.; #both upper surafce and lower surface are exposed\n",
+ "Nc=0.6; #in kg/m**2*hr\n",
+ "#from X=0.6 to 0.44 ,falling rate is non linear and from X=.44 to .14 falling rate is linear\n",
+ "X2=.15/(1-.15);\n",
+ "Xcr=.6; #kg moisture per kg dry solid\n",
+ "#so we can find time fro drying from 0.6 to .44 graphically and then for X=.44 to .1765\n",
+ "X1=1.; #moisture content on dry basis intially\n",
+ "\n",
+ "# Calculation \n",
+ "t1=Ls/(A*Nc) *(X1-Xcr); #time taken for constant drying rate(fromX=1 to .6) \n",
+ "X1=.44; #moisture content on dry basis\n",
+ "import math\n",
+ "t2=(Ls/(A*Nc))*((Xcr-Xbar)*math.log((X1-Xbar)/(X2-Xbar)));\n",
+ "t3=0.0336*Ls/Nc; #fro graph we get from X=.6 to .44\n",
+ "ttotal=t1+t2+t3; #total time for drying the wet slab\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the total time for drying the wet slab to 15 percent moisture on wet basis is :%f min\"%(ttotal*60)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the total time for drying the wet slab to 15 percent moisture on wet basis is :59.610778 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the sheets\n",
+ "\n",
+ "#table X-- .30 .20 .18 .15 .14 .11 .07 .05\n",
+ "# N-- 1.22 1.22 1.14 .90 .80 .56 .22 .05\n",
+ "#let Ls/A=p\n",
+ "# Variable Declaration \n",
+ "p=48.; #mass of bone dry solid ais the drying surface\n",
+ "v=1.5*1.5*.5; #volume of material\n",
+ "Nc=1.22; #in kg/m**2*hr\n",
+ "Xcr=0.2; #crtical moisture content\n",
+ "X1=0.25; #moisture content on dry basis intially\n",
+ "X2=0.08; #moisture content on dry basis finally after drying\n",
+ "Xbar=0.025; #equillibrium moisture \n",
+ "\n",
+ "#tbar=(Ls/(A*Nc))*((Xcr-Xbar)*log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "# Calculation \n",
+ "t1=p/(Nc) * (X1-Xcr); #time taken for constant drying rate period \n",
+ "#table X-- .18 .15 .14 .11 .07 .05\n",
+ "# 1/N-- .8772 1.11 1.25 1.7857 4.545 20\n",
+ "\n",
+ "# equillibrium relation is given under\n",
+ "p = [.18,.15,.14,.11,.07,.05];\n",
+ "a = [.8772,1.11,1.25,1.7857,4.545,20];\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Result\n",
+ "plot(p,a);\n",
+ "title(\"Fig.6.20 Example4 1/N vs X for fallling rate period\");\n",
+ "xlabel(\"X-- Moisture content, X(kg/kg) ---->\");\n",
+ "ylabel(\"Y-- 1/N, hr,m**2/kg ---->\");\n",
+ "\n",
+ "a=14*.025*1; #area under the curve\n",
+ "t2=a*48; #time taken for varying drying period\n",
+ "ttotal=t1+t2; #total time taken \n",
+ "print \"\\n total time for drying the material from 25 to 8 percent moisture under same drying conditions is :%f hr\"%(ttotal)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " total time for drying the material from 25 to 8 percent moisture under same drying conditions is :18.767213 hr\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEXCAYAAABCjVgAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdYFOfaBvB7KYr0oiAKgqKI9EXsDUVEj2IUjRETezTR\nmERzNBpLUGM3fhr1mGI4amzRBIwdW0QNCWJDY4uJCgKigtIFac/3xx5GFljasjssPL/r8pLdmZ33\nnm3PzjvzzkiIiMAYY4wB0BI7AGOMsbqDiwJjjDEBFwXGGGMCLgqMMcYEXBQYY4wJuCgwxhgTNNii\nYGRkhNjYWLFj1DsRERGwtbUVO4ZGOXDgAGxtbWFkZITr168rvbynT5+id+/eMDY2xpw5cyqdX0tL\nCw8ePAAATJgwAYsWLQJQ9rV0dXXF+fPnlc5XHynz3JR8/uuCel8U7O3toa+vDyMjIxgZGcHY2BhP\nnjxBZmYm7O3ta7TMly9fYvr06WjWrBlMTU3Rp0+fcufLy8vD5MmTYW9vD2NjY0ilUoSHh8vNc+bM\nGTg5OcHAwAD9+vXDo0ePFLbr4+ODJk2aCOtiZGSEN954o0brUNf4+vpCS0sLRUVFCudZtGgR3Nzc\noKuriyVLlpQ7z3vvvYetW7di+/bt0NLSwtq1a+Wm29jYqPSL7fDhw7C2tkZqaqpw38GDB2FjY4PM\nzMxyHzN79mxs2bIFmZmZ8PDwUDrDd999B0tLS2RkZJRZ/8pIJBJIJJJyp928eRO9e/dWOl9tsLe3\nx6+//ip2DEFdem6UVe+LgkQiwZEjR5CZmYnMzExkZGSgefPmSi1z6tSpSEtLw927d5GamooNGzaU\nO19BQQFatWqF8+fPIyMjA8uWLcOoUaMQFxcHAEhJScGIESOwfPlypKamwtvbG2+99VaF6/K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SE5OhouLCxYtWgQXFxcYGxvj+PHjQtdRyceP\nHDkSU6ZMwdChQyGRSLBlyxYMHDgQ3t7eMDY2lruyWHR0NHr37l3u+tVU3759cffuXWzcuJELQh3D\nJ8RjTE1u3bqFbdu24csvv6zW4yIiIrBv3z58/fXXCucpKipCfn4+GjdujPv372PAgAG4e/cuBg8e\njJ07d8LKyqrCNrKzs4Vuug8++ACOjo74+OOPUVRUBC8vL1y+fFnY2mH1GxcFxjRA//79ceDAAYVj\nFTIzM9GvXz/k5+eDiLBmzRr4+/tXefkbNmzAjh07kJeXBy8vL2zduhV6eno4dOgQbty4gYULF9bW\nqrA6josCY4wxAe9TYIwxJuCiwBhjTMBFgTHGmICLAmOMMQEXBcYYYwIuCowxxgT/D4G/ftCXVIQy\nAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x34fa550>"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5.a"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation and plot of drying rates\n",
+ "\n",
+ "#table 6.5.1\n",
+ "#S.NO. Time (Hr) weight of wet material(kg)\n",
+ "# 0.0 5.314\n",
+ "# 0.4 5.238\n",
+ "# 0.8 5.162\n",
+ "# 1.0 5.124\n",
+ "# 1.4 5.048\n",
+ "# 1.8 4.972\n",
+ "# 2.2 4.895\n",
+ "# 2.6 4.819\n",
+ "# 3.0 4.743\n",
+ "# 3.4 4.667\n",
+ "# 4.2 4.524\n",
+ "# 4.6 4.468\n",
+ "# 5.0 4.426\n",
+ "# 6.0 4.340\n",
+ "# infinite 4.120\n",
+ "\n",
+ "# Variable Declaration \n",
+ "w=[5.314,5.238,5.162,5.124,5.048,4.972,4.895,4.819,4.743,4.667,4.524,4.468,4.426,4.340,4.120]\n",
+ "t=[0.0,0.4,0.8,1.0,1.4,1.8,2.2,2.6,3.0,3.4,4.2,4.6,5.0,6.0]\n",
+ "#part(i)\n",
+ "x=4.120; #weight of the dried material\n",
+ "print \"\\n moisture content (dry basis) \"\n",
+ "i=0; \n",
+ "p = [] #looping starts\n",
+ "\n",
+ "# Calculation \n",
+ "while(i<15): #calculation of moisture content\n",
+ " p.append((w[i]-x)/x);\n",
+ " print \"\\n :%f\"%p[i]\n",
+ " i=i+1;\n",
+ "\n",
+ "print \"Drying rate kg/hr*m**2\"\n",
+ "i=1;\n",
+ "a = []\n",
+ "for i in range(15):\n",
+ " a.append(0)\n",
+ " \n",
+ "while(i<14):\n",
+ " a[i] =((p[i-1]-p[i])*4.12/(t[i]-t[i-1]))\n",
+ " print \" %f \"%a[i]\n",
+ " i=i+1;\n",
+ "from matplotlib.pyplot import *\n",
+ "a[0]=.19;\n",
+ "a[14]=0;\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n\\n from the above data it is clear that critical moisture content Xcr=0.11\"\n",
+ "plot(p,a);\n",
+ "title(\"Fig.6.19(a) Example3 Drying Rate curve\");\n",
+ "xlabel(\"X-- Moisture content, X(kg/kg) ---->\");\n",
+ "ylabel(\"Y-- Drying Rate, N(kg/hr.m**2 ---->\");\n",
+ "show()\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " moisture content (dry basis) \n",
+ "\n",
+ " :0.289806\n",
+ "\n",
+ " :0.271359\n",
+ "\n",
+ " :0.252913\n",
+ "\n",
+ " :0.243689\n",
+ "\n",
+ " :0.225243\n",
+ "\n",
+ " :0.206796\n",
+ "\n",
+ " :0.188107\n",
+ "\n",
+ " :0.169660\n",
+ "\n",
+ " :0.151214\n",
+ "\n",
+ " :0.132767\n",
+ "\n",
+ " :0.098058\n",
+ "\n",
+ " :0.084466\n",
+ "\n",
+ " :0.074272\n",
+ "\n",
+ " :0.053398\n",
+ "\n",
+ " :0.000000\n",
+ "Drying rate kg/hr*m**2\n",
+ "\n",
+ "\n",
+ " from the above data it is clear that critical moisture content Xcr=0.11\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEXCAYAAABVr8jJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8TNf/P/DXZBFLJosIlU1ESAhZNPYtShqxpJXSolUq\nv1Cqy0dVaaio5YPy7SLVqlqKUlVL0IiUT0ObIi2pKGJNiEhIiWxCtvP7I5/cj5FMZkYyk5nJ6/l4\neDBz7zn3fWbGvOfcc+65MiGEABERkQZM6jsAIiIyPEweRESkMSYPIiLSGJMHERFpjMmDiIg0xuRB\nREQaY/LQM3K5HGlpafUdhkoHDx7EyJEj1do3KioKs2fP1nJE2hcZGYnx48fXdxhPzFA+W2QYmDzq\niaurK5o2bQq5XA65XA4rKytkZWUhPz8frq6uT1Tn/fv3MW3aNNjb28PGxgYDBgxQum9UVBT8/f3R\nuHFjvPbaa1W2f/PNN2jfvj3kcjmCg4ORmZmpsD0iIgJz5sxRK67w8HB89913yM7OVrqPiYkJLC0t\npddDLpdjxYoVatWvKzKZTO19Z82aBRcXF1hZWcHJyQkzZsxAaWmpWmU3btwIU1NT6XVwc3PDpEmT\ncOnSpScNHQBq9dmqSWRkJMzNzSGXy2FjY4OePXvi119/Vbu8iYkJrl69WudxkXYxedQTmUyG/fv3\nIz8/H/n5+cjLy8NTTz1VqzonT56Me/fuISUlBTk5Ofj000+V7uvo6Ih58+Zh0qRJVbbFx8cjIiIC\ne/fuxd27d9G2bVuMHTtW2v7HH38gLy8P3bt3VysuCwsLBAcHY9OmTTXul5ycLL0e+fn5mDlzplr1\n64om19OGhYXh3LlzyMvLQ2JiIuLi4vDNN9+oXb5Pnz7S5+LQoUNo0qQJnn76aZw9e7ba/dVNTNog\nk8kwduxY5Ofn486dOxg8eDBGjRqlUR31fa1yfb5+horJQ888+ivszp07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n6LGAikHekpISeHt7o3Pnzpg/f36VuIOCghASEgJ/f3/4+flJ04privXxdgPAwIEDce7cOWnAXNmx\nH4/xUZMnT4a3tzfGjx8PIQSuXLmicAoKqPiCj46ORkREBADA19cXQUFBWL58OQCgb9+++PPPPxXi\na9q0Kfbv349PPvkE+/fvx7Rp05CdnQ0vLy/MmzcPXl5esLKywoEDB6RTVo+WHzVqFMLDwxESEgKZ\nTIbVq1djyJAh8Pf3h5WVlXS3PaCi59K/f/9q2/ekBg4ciJSUFHz++edMHHqICyMS6ZGzZ89iw4YN\nWLFihUbl4uPjsX37dnz55ZdK9ykvL0dJSQksLCxw5coVPPvss0hJScGwYcOwefNmtGrVqsZjFBYW\nSqcH33jjDXTo0AFvv/02ysvL0bVrV/z5559S74mMH5MHkZEYPHgwdu/erfRaj/z8fDzzzDMoKSmB\nEALLly9HUFCQ2vV/+umn+Pbbb1FcXIyuXbti7dq1aNy4Mfbu3Yvk5GTMnTu3rppCBoDJg4iINMYx\nDyIi0hiTBxERaYzJg4iINMbkQUREGmPyICIijTF5EBGRxv4/HZ7dGt96UjsAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x34fa790>"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5.b "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# amount of air required\n",
+ "\n",
+ "# Variable Declaration \n",
+ "#part(ii)\n",
+ "w1=4.934; #weight after two hours\n",
+ "w0=5.314; #initial weight \n",
+ "w2=w0-w1; # water evaporated in 2 hrs\n",
+ "H1=.01; #humidty of incoming air\n",
+ "H2=.03; #humidity of leaving air\n",
+ "yout=.03;\n",
+ "yin=.01;\n",
+ "\n",
+ "# Calculation \n",
+ "Gs=w2/(yout- yin); #water carried away\n",
+ "\n",
+ " # Result\n",
+ "print \"\\n the amount of air required in 2hours is :%f kg\"%Gs\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the amount of air required in 2hours is :19.000000 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5.c "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# actual time of the falling peroid\n",
+ "\n",
+ "# Variable Declaration \n",
+ "#part(iii)\n",
+ "#let us choose the consistency of 11 and 13 readings\n",
+ "Xbar=0; #equillibrium moisture content\n",
+ "Ls=4.12; #mass of bone dry solid ais the drying surface\n",
+ "A=1.; #both upper surafce and lower surface are exposed\n",
+ "Nc=0.19; #in kg/m**2*hr\n",
+ "X1=.098; #moisture content on dry basis intially\n",
+ "Xcr=.11; #kg moisture per kg dry solid\n",
+ "X2=0.074; #moisture content on dry basis finally\n",
+ "# Calculation \n",
+ "import math\n",
+ "tfall=(Ls/(A*Nc))*((Xcr-Xbar)*math.log((X1-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n from this data we get time as :%f hour\"%tfall\n",
+ "print \"\\n the actual time is 0.8 hours\"\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " from this data we get time as :0.670026 hour\n",
+ "\n",
+ " the actual time is 0.8 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time saved in drying\n",
+ "\n",
+ "#wooden cloth is dried from 100 to 10 and then th efinal moisture content is changed to 16 percent from 10;\n",
+ "# Variable Declaration \n",
+ "Xcr=0.55; #crtical moisture content\n",
+ "X1=1; #moisture content on dry basis intially\n",
+ "X2=.1; #moisture content on dry basis finally after drying\n",
+ "Xbar=.06; #equillibrium moisture \n",
+ "#since eqn 1 is tobe divided by eqn 2 so let the value of Ls/A*Nc be = 1 as it will be cancelled \n",
+ "p=1; #let Ls/A*Nc be =p\n",
+ "#p=poly([0],'p'); #calc. of time 1\n",
+ "tbar=1; #since the eqns are independent of tbar\n",
+ "\n",
+ "# Calculation \n",
+ "import math\n",
+ "t1=0.5960514 #roots(tbar- p*((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)))); #------eqn1\n",
+ "X2bar=.16; \n",
+ "#p=poly([0],'p'); #calc. of time 2\n",
+ "t2=0.8138516 #roots(tbar- p*((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2bar-Xbar))));#------eqn2\n",
+ "\n",
+ "#let t1/t2 be = k\n",
+ "k=t1/t2;\n",
+ "ans=1./k-1; #reduction in time for drying \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the reduction in time for drying is :%f percent\"%(ans*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the reduction in time for drying is :36.540506 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the sheets from 30 to 6 percent\n",
+ "\n",
+ "#assume rate of drying in the falling rate period is directly prporional to the free moisture content\n",
+ "\n",
+ "#Ls/ A*Nc is unknown;\n",
+ "# Variable Declaration \n",
+ "Xcr=0.14; #crtical moisture content\n",
+ "X1=.3/(1-.3); #moisture content on dry basis intially\n",
+ "X2=0.1/(1-0.1); #moisture content on dry basis finally after drying\n",
+ "Xbar=.04; #equillibrium moisture \n",
+ "tbar=5; #time needed to dry from 30 to 6 percent on bone dry basis\n",
+ "\n",
+ "#let Ls / A*Nc be = p\n",
+ "#p=poly([0],'p'); #calc. of Ls / A*Nc be = p value\n",
+ "# Calculation and Result\n",
+ "x= 15.495992 #roots(tbar-p * ((X1-Xcr)+(Xcr-Xbar)*log((Xcr-Xbar)/(X2-Xbar))));\n",
+ "print \"\\n the value of Ls/ A*Nc is :%f\"%x\n",
+ "import math\n",
+ "#new X1 AND X2 are now given as follows\n",
+ "X1=0.3/(1-.3); #new moisture content on dry basis intially\n",
+ "X2=0.064; #new moisture content on dry basis finally after drying\n",
+ "tbar=x * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "print \"\\n the time for drying the sheets from 30 to 6 percent moisture under same drying conditions is :%f hr\"%tbar\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the value of Ls/ A*Nc is :15.495992\n",
+ "\n",
+ " the time for drying the sheets from 30 to 6 percent moisture under same drying conditions is :6.683159 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8.a"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the material\n",
+ "# Variable Declaration \n",
+ "Ls=1000.; #mass of bone dry solid ais the drying surface\n",
+ "A=55.; #both upper surafce and lower surface are exposed\n",
+ "v=.75; #velocity of air\n",
+ "Nc=.3*10**-3; #in kg/m**2*s\n",
+ "x2=.2; #moisture content on wet basis finally after drying\n",
+ "Xcr=0.125; #crtical moisture content\n",
+ "X1=0.15; #moisture content on dry basis intially\n",
+ "X2=0.025; #moisture content on dry basis finally after drying\n",
+ "Xbar=0.0; #equillibrium moisture \n",
+ "import math\n",
+ "\n",
+ " # Calculation \n",
+ "tbar=(Ls/(A*Nc))*((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"the time for drying the sheets from .15 to .025 kg water /kg of dyr solid moisture under same drying conditions is :%f hour\"%(tbar/3600);\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the time for drying the sheets from .15 to .025 kg water /kg of dyr solid moisture under same drying conditions is :3.807740 hour\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8.b "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time saved if air velocity is increased\n",
+ "\n",
+ "#tbar=(Ls/(A*Nc))*((Xcr-Xbar)*log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "#part(i)\n",
+ "# assuming only surface evaporation and assuming air moves parellel to surface\n",
+ "\n",
+ "#Nc=G**0.71; G=V*d\n",
+ "#so NC = k* V**.71\n",
+ "# Variable Declaration \n",
+ "Ls=1000.; #mass of bone dry solid ais the drying surface\n",
+ "A=55.; #both upper surafce and lower surface are exposed\n",
+ "v=.75; #velocity of air\n",
+ "Nc=.3*10**-3; #in kg/m**2*s\n",
+ "x2=.2; #moisture content on wet basis finally after drying\n",
+ "Xcr=0.125; #crtical moisture content\n",
+ "X1=0.15; #moisture content on dry basis intially\n",
+ "X2=0.025; #moisture content on dry basis finally after drying\n",
+ "Xbar=0.0; #equillibrium moisture \n",
+ "tbar=3.8077; #time to dry material ,calculated from previous part\n",
+ "V1=.75; #old velocity\n",
+ "V2=4.; #new velocity\n",
+ "import math\n",
+ "\n",
+ "# Calculation \n",
+ "Nc2=Nc*(V2/V1)**.71; #in kg/m**2*s\n",
+ "t2=(Ls/(A*Nc2))*((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar))); #if air velocity is increased to 4\n",
+ "t=tbar-t2/3600; #time saved\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time saved , if air velocity is increased to 4 m/s: %f\"%t\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time saved , if air velocity is increased to 4 m/s: 2.647593\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the fibreboard\n",
+ "\n",
+ "#determine the drying condition of sample 0.3*0.3 size.sheet lost weight at rate of 10**-4 kg/s until the moisture fell to 60 percent\n",
+ "# Variable Declaration \n",
+ "x1=.75; #moisture content on wet basis\n",
+ "xbar=0.1; #equilllibrium moisture on dry basis\n",
+ "xcr=0.6; #critical moisture content\n",
+ "Ls=0.90; #mass of bone dry solid ais the drying surface\n",
+ "A=0.3*0.3*2; #both upper surafce and lower surface are exposed\n",
+ "#A*Nc=10**-4;\n",
+ "x2=.2; #moisture content on wet basis finally after drying\n",
+ "\n",
+ "# Calculation \n",
+ "Xcr=0.6/0.4; #crtical moisture content\n",
+ "X1=3; #moisture content on dry basis intially\n",
+ "X2=0.25; #moisture content on dry basis finally after drying\n",
+ "Xbar=0.1/0.9; #equillibrium moisture \n",
+ "import math\n",
+ "tbar=Ls/(10**-4) * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result \n",
+ "print \"\\n the time for drying the sheets from 75 to 25 percent moisture under same drying conditions is :%f hr\"%(tbar/3600);\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 75 to 25 percent moisture under same drying conditions is :11.745087 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the moist material\n",
+ "\n",
+ "#determine the drying condition of sample 0.3*0.3 size.sheet lost weight at rate of 10**-4 kg/s until the moisture fell to 60 percent\n",
+ "\n",
+ "#Ls/ A*Nc is unknown;\n",
+ "# Variable Declaration \n",
+ "Xcr=0.16; #crtical moisture content\n",
+ "X1=.33; #moisture content on dry basis intially\n",
+ "X2=0.09; #moisture content on dry basis finally after drying\n",
+ "Xbar=.05; #equillibrium moisture \n",
+ "tbar=7; #time needed to dry from 33 to 9 percent on bone dry basis\n",
+ "import math\n",
+ "#let Ls / A*Nc be = p\n",
+ "#p=poly([0],'p'); #calc. of Ls / A*Nc be = p value\n",
+ "# Calculation \n",
+ "x= 24.886579 #roots(tbar-p * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar))));\n",
+ "\n",
+ "#new X1 AND X2 are now given as follows\n",
+ "X1=0.37; #new moisture content on dry basis intially\n",
+ "X2=0.07; #new moisture content on dry basis finally after drying\n",
+ "tbar=x * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time for drying the sheets from 33 to 9 percent moisture under same drying conditions is :%f hr\"%tbar\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 33 to 9 percent moisture under same drying conditions is :9.892970 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.11 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the slab from 65 to 30 percent\n",
+ "\n",
+ "# Variable Declaration \n",
+ "d=.22; #density of dry pulp in g/cc;\n",
+ "x1=.65; #moisture content on wet basis\n",
+ "x2=.3; #moisture content on wet basis\n",
+ "Ls=2.5; #mass of bone dry solid ais the drying surface in kg\n",
+ "A=1.5*1.5*2; #both upper surafce and lower surface are exposed\n",
+ "v=1.5*1.5*.5; #volume of material\n",
+ "Nc=1.4; #in kg/m**2*hr\n",
+ "Xcr=1.67; #crtical moisture content\n",
+ "# Calculation \n",
+ "X1=x1/(1-x1); #moisture content on dry basis intially\n",
+ "X2=x2/(1-x2); #moisture content on dry basis finally after drying\n",
+ "Xbar=0.0; #equillibrium moisture \n",
+ "import math\n",
+ "#initial moisture is more than Xcr, so there is constant rate drying period and only falling rate peroid is observed\n",
+ "tbar=(Ls/(A*Nc))*((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time for drying the sheets from 65 to 30 percent moisture under same drying conditions is :%f hour\"%tbar\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 65 to 30 percent moisture under same drying conditions is :0.975613 hour\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the slab\n",
+ "# Variable Declaration \n",
+ "d=.22; #density of dry pulp in g/cc;\n",
+ "\n",
+ "Ls=1.125*10**-2*.22*10**3; #mass of bone dry solid ais the drying surface\n",
+ "A=1.5*1.5*2; #both upper surafce and lower surface are exposed\n",
+ "v=1.5*1.5*.5; #volume of material\n",
+ "Nc=1.4; #in kg/m**2*hr\n",
+ "x2=.2; #moisture content on wet basis finally after drying\n",
+ "Xcr=0.46; #crtical moisture content\n",
+ "X1=0.15; #moisture content on dry basis intially\n",
+ "X2=0.085; #moisture content on dry basis finally after drying\n",
+ "Xbar=0.025; #equillibrium moisture \n",
+ "import math\n",
+ "#tbar=(Ls/(A*Nc))*((Xcr-Xbar)*log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "# but initial moisture is more than Xcr, so there is constant rate drying period and only falling rate peroid is observed\n",
+ "\n",
+ "# Calculation \n",
+ "tbar=(Ls/(A*Nc))*((Xcr-Xbar)*math.log((X1-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time for drying the sheets from 15 to 8.5 percent moisture under same drying conditions is :%f min\"%(tbar*60)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 15 to 8.5 percent moisture under same drying conditions is :7.525805 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the filter cake\n",
+ "#Ls/ A*Nc is unknown;\n",
+ "\n",
+ "# Variable Declaration \n",
+ "import math\n",
+ "Xcr=0.14; #crtical moisture content\n",
+ "x1=0.3; #moisture content on wet basis\n",
+ "x2=0.1; #moisture content on wet basis\n",
+ "X1=x1/(1-x1); #moisture content on dry basis intially\n",
+ "X2=x2/(1-x2); #moisture content on dry basis finally after drying\n",
+ "Xbar=0.04; #equillibrium moisture \n",
+ "tbar=5; #time needed to dry from 30 to 10 percent on bone dry basis\n",
+ "\n",
+ " #let Ls / A*Nc be = p\n",
+ "#p=poly([0],'p'); #calc. of Ls / A*Nc be = p value\n",
+ "x= 15.495992 #roots(tbar-p * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar))));\n",
+ "\n",
+ "#new X1 AND X2 are now given as follows\n",
+ "# Calculation \n",
+ "x1=.3; #new moisture content on wet basis\n",
+ "x2=0.06; #new moisture content on wet basis\n",
+ "X1=x1/(1-x1); #new moisture content on dry basis intially\n",
+ "X2=x2/(1-x2); #new moisture content on dry basis finally after drying\n",
+ "tbar=x * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time for drying the sheets from 30 to 10 percent moisture under same drying conditions is :%f hr\"%tbar\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 30 to 10 percent moisture under same drying conditions is :6.694188 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the sheets\n",
+ "# Variable Declaration \n",
+ "d=450.; #density of dry pulp in kg/m**3;\n",
+ "thickness=0.05; #thickness in m**2\n",
+ "Ls=d*thickness; #mass of bone dry solid ais the drying surface\n",
+ "A=1.; #area in m**2\n",
+ "v=1*5*10**-2; #volume of material\n",
+ "Nc=4.8; #in kg/m**2*hr\n",
+ "xcr=.2;\n",
+ "xbar=0.02;\n",
+ "x1=.45; #new moisture content on wet basis\n",
+ "x2=0.05; #new moisture content on wet basis\n",
+ "\n",
+ "# Calculation \n",
+ "X1=x1/(1-x1); #new moisture content on dry basis intially\n",
+ "X2=x2/(1-x2); #new moisture content on dry basis finally after drying\n",
+ "Xbar=xbar/(1-xbar); #crtical moisture content\n",
+ "Xcr=xcr/(1-xcr); #equillibrium moisture \n",
+ "import math\n",
+ "#tbar=(Ls/(A*Nc))*((Xcr-Xbar)*log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "# but initial moisture is more than Xcr, so there is constant rate drying period and only falling rate peroid is observed\n",
+ "tbar=Ls/(A*Nc) * ((X1-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(X2-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time for drying the sheets from 45 to 5 percent moisture under same drying conditions is :%f min\"%tbar\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 45 to 5 percent moisture under same drying conditions is :4.776612 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# heater load per unit mass of dry air\n",
+ "\n",
+ "# Variable Declaration \n",
+ "t1=20.; #ambient air temperature \n",
+ "t2=70.; #exhaust air temperature \n",
+ "r1=150.; #evaporation of water \n",
+ "r2=.25; #outlet solid moisture content\n",
+ "t3=15.; #inlet solid temperature\n",
+ "t4=65.; #outlet solid temperature\n",
+ "p=5.; #power demand in KW\n",
+ "h=18.; #heat loss in kj\n",
+ "\n",
+ "h1=1.; #mean specific heat of dry air in kj/kg*K\n",
+ "h2=1.25; #mean specific heat of dry material in kj/kg*K\n",
+ "h3=4.18; #mean specific heat of moisture in kj/kg*K\n",
+ "e=2626.; #enthalpy of saturated water vapour in kj/kg\n",
+ "\n",
+ "# Calculation \n",
+ " #basis is 1hr\n",
+ "a1=r1*h3*(t4-t3); #heat required for heating 150 kg of water from 15 to 65\n",
+ "a2=r1*e; #heat required for 150 kg water evaporation\n",
+ "a3=2000*h1*(t2-t1); #heat required for heating air from 20 to 70 \n",
+ "a4=r2*h3*(t4-t3); #heat required for heating moisture from 15 to 65\n",
+ "a5=120*h2*(t4-t3); #heat required for heating dry solid from 15 to 65\n",
+ "hlost=h*3600; #heat lost in kj\n",
+ "total=(a2+a3+a4+a5+hlost)/3600.; #total heat lost \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n :%f kW of heat required for 2000kg/hr of dry air\"%total\n",
+ "ans1=a2+a1; #heat needed for evaporation \n",
+ "print \"\\n heat needed fro evaporation is :%f\"%(ans1/3600)\n",
+ "ans2=(ans1/3600.)/total; #fraction of this heat needed for evaporation\n",
+ "print \"\\n fraction of this heat needed for evaporation:%f\"%(ans2)\n",
+ " \n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " :157.292292 kW of heat required for 2000kg/hr of dry air\n",
+ "\n",
+ " heat needed fro evaporation is :118.125000\n",
+ "\n",
+ " fraction of this heat needed for evaporation:0.750990\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# surface area of the roller\n",
+ "# Variable Declaration \n",
+ "m1=.12; #initial moisture content\n",
+ "dT=85.; #product of 85 degree is used in design purpose\n",
+ "U=1700.; #overall heat transfer coefficient\n",
+ "m2=.4; #final moisture content\n",
+ "r=20.; #production rate\n",
+ " #4 kg of moisture is present in 100 kg product\n",
+ "# Calculation \n",
+ "t=4*20./100; # moisture content in 20 kg moisture\n",
+ "w=20-t; #dry solid weight\n",
+ "i=w*m1/(1-m1); #initial moisture content \n",
+ "j=i-t #water evaporated\n",
+ "ds=2296.1; #latent heat for vaporisation at 85 degree in kj/kg\n",
+ "h=j*ds; #heat required (assuming th esolid mix. enters at 85)\n",
+ "#U*A*dT = j*ds\n",
+ "A=h/(U*dT); #surface area of the roller required to produce aproduction rate of 20 kg product per hour\n",
+ "\n",
+ "# Result \n",
+ "print \"\\n surface area of the roller required to produce aproduction rate of 20 kg product per hour:%f m**2\"%(A/3.600);\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " surface area of the roller required to produce aproduction rate of 20 kg product per hour:0.008025 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# time for drying the sheets\n",
+ "\n",
+ "#moisture content reduces from 25 to 2\n",
+ "\n",
+ "# Variable Declaration \n",
+ "r=7.5*10**-5; #constant drying rate in kg/s\n",
+ "A1=.3*.3**2; # area of the sppecimen\n",
+ "Nc=r/A1; #drying rate\n",
+ "# Calculation \n",
+ "Xcr=.15/0.85; #.15 is the critical moisture content\n",
+ "Xo=.25/.75; #.25 is the initial moisture content\n",
+ "Xfinal=.02/0.98; #.02 is the final moisture content\n",
+ "Xbar=0; #equillibrium moisture content\n",
+ "A=1.2*.6*2; #area of the new solid\n",
+ "Ls=28.8; #bone dry weight of new solid\n",
+ "v1=.3*.3*.006; #volume of the old solid;\n",
+ "v2=.6*1.2*.012; #volume of the new solid\n",
+ "w2=1.8; #weight of the old solid\n",
+ "w3=864*10**-5*1.8*10**-5/54; #weight of the bone dry solid\n",
+ "\n",
+ " #Nc is prporional to =(t-ts) = (G)**0.71---- whrere G is the mass flow rate\n",
+ "v1=3.; #old velocity\n",
+ "Tg=52.; #old dry bulb temperature\n",
+ "Tw=21.; #wet bulb temperature\n",
+ "H=.002; #humidity \n",
+ "SH=0.015; #saturated humidity \n",
+ "vnew=5. #new velocity\n",
+ "Tgnew=66.; #new DBT\n",
+ "Twnew=24.; #new WBT\n",
+ "Hnew=.004; #new humidity\n",
+ "SH=.020; #new satuurated humidity\n",
+ "import math \n",
+ "#hence drying rate of air under new condition\n",
+ "Nc=4.167*10**-4*((vnew/v1)*(273+Tg)/(273+Tgnew))**0.71 * ((.019-H)/(.015-H));#drying rate of air under new condition in kg/m**2*s \n",
+ "DT=Ls/(A*Nc) * ((Xo-Xcr)+(Xcr-Xbar)*math.log((Xcr-Xbar)/(Xfinal-Xbar)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the time for drying the sheets from 25 to 2 percent moisture under same drying conditions is :%f hours\"%(DT/3600)\n",
+ "\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the time for drying the sheets from 25 to 2 percent moisture under same drying conditions is :3.929236 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_Of_Mass_Transfer_Part_1/ch7.ipynb b/Elements_Of_Mass_Transfer_Part_1/ch7.ipynb
new file mode 100644
index 00000000..0c7c641e
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/ch7.ipynb
@@ -0,0 +1,738 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Crystallisation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.1 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# total weight of the solution\n",
+ "\n",
+ "#let x be the weight of water in the quantity of solution needed\n",
+ "# Variable Declaration \n",
+ "c=.498; #solute content afetr crystallisation\n",
+ "W1=111.; #molecular weight of CaCl2\n",
+ "W2=219.; #molecular weight of CaCl2.6H2O\n",
+ "\n",
+ "# Calculation \n",
+ "M1=(108./W2)*100; #water present in 100kg of CaCl2.6H2O\n",
+ "M2=(W1/W2)*100; #CaCl2 present in 100kg of CaCl2.6H20\n",
+ "#t=M2+c*x; #total weight entering the solubility\n",
+ "#x+49.3; total water solubility used\n",
+ "#s*(x+49.3)/100 #total Cacl2 after solubility\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t= 32.112871 #roots((M2+c*x)-(x+49.3)*.819); \n",
+ "\n",
+ "# Result\n",
+ "print \"\\nthe weight of water in the quantity of solution needed :%f kg\"%t\n",
+ "\n",
+ "h=(c)*t; #weight of CaCl2 corresponding to weight water\n",
+ "tw=t+h; # total weight of the solution\n",
+ "print \"\\nthe total weight of the solution is :%f kg\"%tw\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the weight of water in the quantity of solution needed :32.112871 kg\n",
+ "\n",
+ "the total weight of the solution is :48.105081 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# percentage saturation and yield\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "w1=1000.; #weight of solution to be cooled\n",
+ "s1=104.1; #solubility at 50 degree per 100 kg of water\n",
+ "s2=78.0; #solubility at 10 degree per 100 kg of water\n",
+ "a2=45.; #percentage of sodium nitrate in the solution per 100kg of solution \n",
+ "\n",
+ "# Calculation \n",
+ "x1=s1/(100+s1)*100; #percentage of saturated solution at 50 degree\n",
+ "tw=(a2/(100-a2))/(x1/(100-x1)); #the percentage saturation\n",
+ "print \"\\nthe percentage saturation is :%f percent\"%(tw*100)\n",
+ "\n",
+ "#part(ii)\n",
+ "#let x be the weight of NaNO3 crystal formed after crystallisation\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t=21.000000 #roots((w1*a2/100)-(x+(w1-x)*s2/(100+s2)));\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the weight of NaNO3 crystal formed after crystallisation :%f kg\"%t\n",
+ "\n",
+ "#part(iii)\n",
+ "y=t/(a2*w1/100); #yield = weight of NaNO3 crystal formed/weight of NaNO3\n",
+ "print \"\\n the percentage yield is:%f percent\"%(y*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the percentage saturation is :78.595756 percent\n",
+ "\n",
+ " the weight of NaNO3 crystal formed after crystallisation :21.000000 kg\n",
+ "\n",
+ " the percentage yield is:4.666667 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# temperature to which solution should be cooled\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "s1=19.75; #solubility at 70 degree per 100 gm of water\n",
+ "s2=16.5; #solubility at 50 degree per 100 gm of water\n",
+ "s3=12.97; #solubility at 30 degree per 100 gm of water\n",
+ "s4=9.22; #solubility at 10 degree per 100 gm of water\n",
+ "s5=7.34; #solubility at 0 degree per 100 gm of water\n",
+ "\n",
+ "# Calculation \n",
+ " #basis is 1000kg of saturated solution\n",
+ "w1=1000.*(s1/(s1+100)); #weight of K2SO4 in the original solution\n",
+ "w2=1000.-w1; #weight of water in kg\n",
+ "w3=w1*.5; #weight of K2SO4 in the solution\n",
+ "wp=w3/(w3+w2); #weight percent of K2SO4 in the solution after crystallistion\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n for the corresponding temperature to :%f percent of K2SO4 is 15 degree (by linear interpolation between 10 to 30 degree) \"%(wp*100)\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " for the corresponding temperature to :8.987486 percent of K2SO4 is 15 degree (by linear interpolation between 10 to 30 degree) \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# percentage saturation and yield\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "a1=146.; #solubility at 70 degree\n",
+ "a2=121.; #solubility at 10 degree\n",
+ "t1=58.; # percentage of solute content\n",
+ "t2=40.66;\n",
+ "\n",
+ "# Calculation and Result\n",
+ "x1=a1/(100+a1) *100; #percentage of saturated solution at 50 degree\n",
+ "tw=(t1/42.)/(x1/t2); #the percentage saturation\n",
+ "print \"\\nthe percentage saturation is :%f percent\"%(tw*100)\n",
+ "\n",
+ "#part(ii)\n",
+ "p1=2000*.58; #weight of solute in 200kg of solution 2000*.58\n",
+ "#let x be the weight of crystal formed after crystallisation\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t=231.743929 #roots((1160)-(x+(1055.02-.547*x))); \n",
+ "print \"\\n the weight of NaNO3 crystal formed after crystallisation :%f kg\"%t\n",
+ "\n",
+ "#part(iii)\n",
+ "y=t/p1; #yield = weight of NaNO3 crystal formed/weight of NaNO3\n",
+ "print \"\\n the percentage yield is:%f percent\"%(y*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the percentage saturation is :94.608102 percent\n",
+ "\n",
+ " the weight of NaNO3 crystal formed after crystallisation :231.743929 kg\n",
+ "\n",
+ " the percentage yield is:19.977925 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# the weight of Na2SO4 hydrate crystal\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "p1=.3; #percentage of the solute in the solution\n",
+ "w1=1000.; #weight of the solution taken\n",
+ "w2=142.; #molecular weight of Na2SO4.\n",
+ "\n",
+ "# Calculation \n",
+ "M1=(w2/(180+w2)); #solute (Na2SO4) present in the Na2CO3.10H2O solution\n",
+ "s1=40.8; #solubility of Na2SO4 at 30 degree per 100 gm of water\n",
+ "s2=9.0; #solubility of Na2SO4 at 10 degree per 100 gm of water\n",
+ "#percent weight of solute in Na2SO4.10H2O= 144/322\n",
+ "#let x be the weight of crystal formed \n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t= 576.477290 #roots((w1*40.8/140.8)-(.442*x+(w1-x)*(s2/(100+s2)))); \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the weight of crystal formed after crystallisation :%f kg\"%t\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the weight of crystal formed after crystallisation :576.477290 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# percentage yield of Na2CO3 hydrated crysta\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "s1=12.5; #solubility of Na2CO3 at 10 degree per 100 gm of water\n",
+ "p1=.3; #percentage of the solute in the solution\n",
+ "w1=2000.; #weight of the solution taken\n",
+ "w2=106.; #molecular weight of Na2CO3.\n",
+ "\n",
+ "# Calculation \n",
+ "M1=(w2/(180+w2)); #solute (Na2CO3) present in the Na2CO3.10H2O solution\n",
+ "#let x be the quantity of Na2CO3.10H2O crystal formed\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t= 1455.688623 #roots(w1*p1-M1*x-(w1-x)*(s1/(100+s1))); \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the weight of quantity of Na2CO3.10H2O :%f kg\"%t\n",
+ "#in the book the ans is wrong, they have calculated 2000*0.3-2000*12.5/112.5 as =x(miscalculation)\n",
+ "\n",
+ "p=(286./106)*w1*p1; #weight of Na2CO3.10H2O crystal present in the original solution\n",
+ "y=t/p; #percentage yield \n",
+ "print \"\\n percentage yield :%f percent\"%(y*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the weight of quantity of Na2CO3.10H2O :1455.688623 kg\n",
+ "\n",
+ " percentage yield :89.920160 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# percentage yield of K2CO3 hydrated crystal\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "s1=139.8; #solubility at 80 degree per 100 gm of water\n",
+ "s2=110.5; #solubility at 20 degree per 100 gm of water\n",
+ "w2=174.2; #molecular weight of K2CO3.10H2O\n",
+ "\n",
+ "# Calculation \n",
+ "M1=(138/w2)*100; #water present in 100kg of K2CO3.10H2O\n",
+ "#let x be the quantity of Na2CO3.10H2O\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t=108.634036 #roots(500*(139.8/239.8)-.7921*x-(500-x)*110.5/210.5); \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the weight of quantity of K2CO3.10H2O formed :%f kg\"%t\n",
+ "\n",
+ "p=(174./138)*500*(139.8/239.8); #weight of crystal present in the original solution\n",
+ "y=t/p; #percentage yield \n",
+ "print \"\\n percentage yield :%f percent\"%(y*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the weight of quantity of K2CO3.10H2O formed :108.634036 kg\n",
+ "\n",
+ " percentage yield :29.557504 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# percentage yield FeSO4 hydrate crystal\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "s1=20.51; #solubility at 10 degree per 100 gm of water\n",
+ "w2=277.85; #molecular weight of FeSO4.7H2O\n",
+ "\n",
+ "# Calculation and Result\n",
+ "#let x be the quantity of Na2CO3.10H2O\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t= 549.684973 #roots(900*.4-.5465*x-(900-x)*20.5/120.5); \n",
+ "print \"\\n the weight of quantity of FeSO4.7H2O formed :%f kg\"%t\n",
+ "\n",
+ "p=(277.85/151.85)*900*(0.4); #weight of crystal present in the original solution\n",
+ "y=t/p; #percentage yield \n",
+ "print \"\\n percentage yield :%f percent\"%(y*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the weight of quantity of FeSO4.7H2O formed :549.684973 kg\n",
+ "\n",
+ " percentage yield :83.447967 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# percentage saturation and weight of Cesium chloride crystal\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "#part(i)\n",
+ "a1=229.7; #solubility at 60 degree\n",
+ "a2=174.7; #solubility at 60 degree\n",
+ "t1=68; # percentage of sodium nitrate\n",
+ "t2=30.34;\n",
+ "\n",
+ "# Calculation and Result\n",
+ "x1=a1/329.7 *100; #percentage of saturated solution at 50 degree\n",
+ "tw=(t1/32.)/(x1/t2); #the percentage saturation\n",
+ "print \"\\nthe percentage saturation is :%f percent\"%(tw*100)\n",
+ "\n",
+ "#part(ii)\n",
+ "#let x be the weight of Cesium chloride crystal formed after crystallisation\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t=120.960000 #roots(1000*.68-(x+(1000-x)*174.7/274.7)); \n",
+ "print \"\\n the weight of CaCl2 crystal formed after crystallisation :%f kg\"%t\n",
+ "\n",
+ "#part(iii)\n",
+ "y=t/680.; #yield = weight of CaCl2 crystal formed/weight of CaCl2\n",
+ "print \"\\n the percentage yield of Cesium chloride is:%f percent\"%(y*100)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the percentage saturation is :92.540632 percent\n",
+ "\n",
+ " the weight of CaCl2 crystal formed after crystallisation :120.960000 kg\n",
+ "\n",
+ " the percentage yield of Cesium chloride is:17.788235 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# weight of Na2CO3hydrate needed to dissolve Na2CO3\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "s1=38.8; #solubility at 30 degree per 100 gm of water\n",
+ "s2=12.5; #solubility at 10 degree per 100 gm of water\n",
+ "w2=296; #molecular weight of Na2CO3.10H2O\n",
+ "per=116./w2 *100; #percentage solute in Na2CO3.10H2O\n",
+ "\n",
+ "#let x be the quantity of Na2CO3.10H2O\n",
+ "w=200.; #original solotion weight\n",
+ "\n",
+ "# Calculation \n",
+ "m1=w*(s2/(s2+100)); #weight of Na2CO3.10H2O needed to dissolve Na2CO3 present in the original solotion \n",
+ "w3=w-m1; #weight of water \n",
+ "#w4=m1+per/100; weight of Na2CO3 after dissolution\n",
+ "x1=s1/(s1+100); #weight fraction of solute after dissolution \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the weight of quantity of Na2CO3.10H2O formed :%f kg\"%w3\n",
+ "\n",
+ "#for the total solution after dissolution\n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t= 300.485784 #roots((m1+per*x/100)-((m1+per*x/100)+(w3+.609*x))*x1); \n",
+ "print \"\\nweight of Na2CO3.10H2O needed to dissolve Na2CO3 present in the original solution %f kg\"%t\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the weight of quantity of Na2CO3.10H2O formed :177.777778 kg\n",
+ "\n",
+ "weight of Na2CO3.10H2O needed to dissolve Na2CO3 present in the original solution 300.485784 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# weight of Na2CO3 hydrated formed\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "s1=35.; #percentage of solution\n",
+ "x1=6000.; #weight of Na2CO3 solution\n",
+ "s2=21.5; #solubility at 20 degree per 100 gm of water\n",
+ "w2=296.; #molecular weight of Na2CO3.10H2O\n",
+ "\n",
+ "# Calculation \n",
+ "per=116./w2 *100; #percentage solute in Na2CO3.10H2O\n",
+ "w1=s1*x1; #weight of solute\n",
+ "w3=x1*0.04; #weight of solution lost by vaporisation\n",
+ "#let x be the quantity of Na2CO3.10H2O formed \n",
+ "#making material balance \n",
+ "#x=poly([0],'x'); #calc. x the weight of crystal\n",
+ "t= 5049.122335 #roots(2100-(.391*x)-(6000-240-x)*(21.5/121.5)); \n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the weight of Na2CO3.10H2O crystal formed after crystallisation :%f kg\"%t\n",
+ "\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the weight of Na2CO3.10H2O crystal formed after crystallisation :5049.122335 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# feed rate of FeSO4 hydrated crystal produced per hour\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "C=1000.; #crystal formed in kg\n",
+ "hf=26.002; #enthalpy of the feed at 80 degree in cal/g\n",
+ "hl=-1.33; #enthalpy of the saturated sol at 30 degree in cal/g\n",
+ "hc=-50.56; #enthalpy of crystal\n",
+ "xf=40./(100+40);\n",
+ "xm=30./(100+30);\n",
+ "xc=151.84/277.85; #151.84 is the weight of FeSO4\n",
+ " #component balance\n",
+ "# F*xf = M*xm + C*xc ------eqn 1st\n",
+ "# F = M + 10000 + V ------eqn 2nd\n",
+ "# F*Hf = V*Hv + M*Hm +C*Hc-----eqn 3rd\n",
+ "Hf=26.002; #enthalpy of the feed at 80 degree in cal/g\n",
+ "Hv=612.; #\n",
+ "Hm=-1.33; #enthalpy of the saturated sol at 30 degree in cal/g\n",
+ "Hc=-50.56; #enthalpy of crystal leaving the crystalliser\n",
+ "from numpy import matrix\n",
+ "from numpy import linalg\n",
+ "#solving these we gt \n",
+ "\n",
+ "# Calculation \n",
+ "a=matrix([[1,-1,-1],[.286,-.231,0],[26.002,1.33,-612]])\n",
+ "b=matrix([[10000],[5470],[-505600]])\n",
+ "x=linalg.inv(a)*b; #solving out the values using matrices \n",
+ "t1=x[0]; #3 solution of the eqn\n",
+ "t2=x[1];\n",
+ "t3=x[2];\n",
+ "\n",
+ "# Result\n",
+ "print \"\\n the feed rate F= : %f kg/hr \\n value of M= : %f kg/hr\\n value of V=: %f kg/hr\"%(t1,t2,t3)\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " the feed rate F= : 45556.688340 kg/hr \n",
+ " value of M= : 32723.865218 kg/hr\n",
+ " value of V=: 2832.823122 kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.13 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# cooling water requirement\n",
+ "\n",
+ "# Variable Declaration \n",
+ "\n",
+ "import math\n",
+ "C=800.; #crystal formed in kg/hr\n",
+ "t2=49.; #temp. of the entering fed\n",
+ "t1=27.; #temp. of the product\n",
+ "t3=21.; #temp. of the leaving cooling water\n",
+ "t4=15.; #temp. of the enetring cooling water\n",
+ "U=175.; #overall heat transfer coefficient\n",
+ "F=140*151.85/277.85; #feed concentration \n",
+ "xf=F/240; #concentration in feed solution\n",
+ "P=74*151.85/277.85; #product concentration \n",
+ "xm=P/174; #concentration of FeSO4 in product solution\n",
+ "xc=151.85/277.85; #\n",
+ " #mass balance F = M+C ----eqn 1st\n",
+ " #sloute balance F*xf = M*xm + C*xc ----eqn 2nd\n",
+ "\n",
+ "# Calculation \n",
+ "#solving these we get\n",
+ "F=800*.3141/0.0866; #feed conc.\n",
+ "M=F-C; #product concentration \n",
+ " #making energy balance\n",
+ " #heat to be removed by cooling water =heat to be removed from solution + heat of crystallization\n",
+ "cp=.7; #specific heat capacity\n",
+ "dt=(t2-t1); #change in temp.\n",
+ "dh=15.8; #heat of crystallization\n",
+ "Q=F*cp*dt+dh*C; #heat to be removed by cooling water\n",
+ "cp=1; #specific heat capacity of water\n",
+ "dt=(t3-t4); #change in temp.\n",
+ "mw=Q/(cp*dt); #cooling water needed\n",
+ "\n",
+ "# Result \n",
+ "print \"\\n cooling water requiement is :%f kg/hr\"%mw\n",
+ " #Q=U*A*(dtlm)\n",
+ "dtlm=((t2-t3)-(t1-t4))/(math.log((t2-t3)/(t1-t4)));#log mean temp. difference\n",
+ "A=Q/(U*dtlm); #area of the crystallizer section\n",
+ "l=A/1.3;\n",
+ "print \"\\n length of crystallliser sections needed is :%f m\"%l\n",
+ "\n",
+ "#end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " cooling water requiement is :9554.149346 kg/hr\n",
+ "\n",
+ " length of crystallliser sections needed is :13.343753 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_Of_Mass_Transfer_Part_1/screenshots/dry-time.png b/Elements_Of_Mass_Transfer_Part_1/screenshots/dry-time.png
new file mode 100644
index 00000000..3235d6e8
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/screenshots/dry-time.png
Binary files differ
diff --git a/Elements_Of_Mass_Transfer_Part_1/screenshots/enthalpy.png b/Elements_Of_Mass_Transfer_Part_1/screenshots/enthalpy.png
new file mode 100644
index 00000000..2f5099d0
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/screenshots/enthalpy.png
Binary files differ
diff --git a/Elements_Of_Mass_Transfer_Part_1/screenshots/tower.png b/Elements_Of_Mass_Transfer_Part_1/screenshots/tower.png
new file mode 100644
index 00000000..630464a7
--- /dev/null
+++ b/Elements_Of_Mass_Transfer_Part_1/screenshots/tower.png
Binary files differ
diff --git a/Elements_of_Electromagnetics/README.txt b/Elements_of_Electromagnetics/README.txt
new file mode 100644
index 00000000..d2a7204f
--- /dev/null
+++ b/Elements_of_Electromagnetics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Vishal MV
+Course: others
+College/Institute/Organization: Indian Institute of Engineering Bombay
+Department/Designation: Physics
+Book Title: Elements of Electromagnetics
+Author: M. N. O. Sadiku
+Publisher: Oxford University Press
+Year of publication: 2001
+Isbn: 195686233
+Edition: 3rd \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_1.ipynb b/Elements_of_Electromagnetics/chapter_1.ipynb
new file mode 100644
index 00000000..ae4e75b3
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_1.ipynb
@@ -0,0 +1,420 @@
+{
+ "metadata": {
+ "name": "chapter_1.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 1: Vector Analysis<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.1, Page number: 8<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "If A= 1Oa_x - 4a_y + 6a_z and B == 2a_x + a_y, find: \n",
+ "(a) the component of A along a_y ,\n",
+ "(b) the magnitude of 3A - B,\n",
+ "(c) a unit vector along A + 2B. '''\n",
+ "\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A=array([10,-4,6]) \n",
+ "B=array([2,1,0])\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ay=dot(A,ay) #Component of A along y direction\n",
+ "l=scipy.sqrt(dot(3*A-B,3*A-B)) #Magnitude of the vector 3A-B\n",
+ "\n",
+ " #Defining the x,y and z components of the unit vector along A+2B\n",
+ " \n",
+ "ux=round(dot(A+2*B,ax)/scipy.sqrt(dot(A+2*B,A+2*B)),4)\n",
+ "uy=round(dot(A+2*B,ay)/scipy.sqrt(dot(A+2*B,A+2*B)),4)\n",
+ "uz=round(dot(A+2*B,az)/scipy.sqrt(dot(A+2*B,A+2*B)),4)\n",
+ "\n",
+ "u=array([ux,uy,uz])\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The component of A along y direction is',Ay\n",
+ "print 'Magnitude of 3A-B =',round(l,2)\n",
+ "print 'Unit vector along A+2B is',u"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The component of A along y direction is -4\n",
+ "Magnitude of 3A-B = 35.74\n",
+ "Unit vector along A+2B is [ 0.9113 -0.1302 0.3906]\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.2, Page number: 9<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Points P and Q are located at (0, 2, 4) and (- 3, 1, 5). Calculate \n",
+ "(a) The position vector P \n",
+ "(b) The distance vector from P to Q \n",
+ "(c) The distance between P and Q \n",
+ "(d) A vector parallel to PQ with magntude of 10 '''\n",
+ "\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "P=array([0,2,4]) \n",
+ "Q=array([-3,1,5])\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "origin=array([0,0,0]) #Defining the origin\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "PosP=P-origin #The position vector P\n",
+ "Dpq=Q-P #The distance vector from P to Q\n",
+ "l=scipy.sqrt(dot(Dpq,Dpq)) #Magnitude of the distance vector from P to Q\n",
+ "\n",
+ " #Defining the x,y and z components of the unit vector along Dpq\n",
+ " \n",
+ "ux=round(dot(Dpq,ax)/l,4)\n",
+ "uy=round(dot(Dpq,ay)/l,4)\n",
+ "uz=round(dot(Dpq,az)/l,4)\n",
+ "\n",
+ "vect=array([ux*10,uy*10,uz*10]) #Vector parallel to PQ with magntude of 10\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The position vector P is',PosP\n",
+ "print 'The distance vector from P to Q is',Dpq\n",
+ "print 'The distance between P and Q is',round(l,3)\n",
+ "print 'Vector parallel to PQ with magntude of 10 is',vect"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position vector P is [0 2 4]\n",
+ "The distance vector from P to Q is [-3 -1 1]\n",
+ "The distance between P and Q is 3.317\n",
+ "Vector parallel to PQ with magntude of 10 is [-9.045 -3.015 3.015]\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.3, Page number: 10<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A river flows southeast at 10 km/hr and a boat flows upon it \n",
+ "with its bow pointed in the direction of travel. A man walks upon\n",
+ "the deck at 2 km/hr in a direction to the right and perpendicular\n",
+ "to the direction of the boat's movement. \n",
+ "Find the velocity of the man with respect to the earth. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "vriver=10 #Speed of river in km/hr\n",
+ "vman=2 #Speed of man relative to boat in km/hr\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ " #Velocity of boat\n",
+ "\n",
+ "Vboat=vriver*(scipy.cos(scipy.pi/4)*ax- \n",
+ " scipy.sin(scipy.pi/4)*ay) \n",
+ " \n",
+ " #Relative velocity of man with respect to boat\n",
+ "\n",
+ "Vrelman=vman*(-scipy.cos(scipy.pi/4)*ax- \n",
+ " scipy.sin(scipy.pi/4)*ay) \n",
+ " \n",
+ " #Absolute velocity of man\n",
+ " \n",
+ "Vabs=Vboat+Vrelman\n",
+ " \n",
+ "mag=scipy.sqrt(dot(Vabs,Vabs)) #Magnitude of the velocity of man\n",
+ "Vabsx=dot(Vabs,ax) #X component of absolute velocity\n",
+ "Vabsy=dot(Vabs,ay) #Y component of absolute velocity\n",
+ "angle=scipy.arctan(Vabsy/Vabsx)*180/scipy.pi #Angle made with east in degrees\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The velocity of the man is',round(mag,1),'km/hr at an angle of'\n",
+ "print -round(angle,1),'degrees south of east'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the man is 10.2 km/hr at an angle of\n",
+ "56.3 degrees south of east\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.4, Page number: 17<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given vectors A = 3a_x + 4a_y + a_z and B = 2a_y - 5a_z , \n",
+ "find the angle between A and B. '''\n",
+ " \n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A=array([3,4,1])\n",
+ "B=array([0,2,-5])\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "magA=scipy.sqrt(dot(A,A)) #Magnitude of A\n",
+ "magB=scipy.sqrt(dot(B,B)) #Magnitude of B\n",
+ "angle=scipy.arccos(dot(A,B)/(magA*magB)) #Angle between A and B in radians\n",
+ "angled=angle*180/scipy.pi #Angle between A and B in degrees\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The angle between A and B =',round(angled,2),'degrees'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The angle between A and B = 83.73 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.5, Page number: 17<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Three field quantities are given by \n",
+ "P = 2a_x - a_z \n",
+ "Q = 2a_x - a_y + 2a_z \n",
+ "R = 2a_x - 3a_y + a_z\n",
+ "\n",
+ "Determine \n",
+ "\n",
+ "(a) (P + Q) X (P - Q) \n",
+ "(b) Q.(R X P)\n",
+ "(c) P.(Q X R)\n",
+ "(d) Sin(theta_QR) \n",
+ "(e) P X (Q X R) \n",
+ "(f) A unit vector perpendicular to both Q and R \n",
+ "(g) The component of P along Q '''\n",
+ "\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "P=array([2,0,-1])\n",
+ "Q=array([2,-1,2])\n",
+ "R=array([2,-3,1])\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "ansa=cross((P+Q),(P-Q))\n",
+ "ansb=dot(Q,cross(R,P))\n",
+ "ansc=dot(P,cross(Q,R))\n",
+ "lqxr=scipy.sqrt(dot(cross(Q,R),cross(Q,R))) #Magnitude of QXR\n",
+ "lq=scipy.sqrt(dot(Q,Q)) #Magnitude of Q\n",
+ "lr=scipy.sqrt(dot(R,R)) #Magnitude of R\n",
+ "ansd=lqxr/(lq*lr)\n",
+ "anse=cross(P,cross(Q,R))\n",
+ "\n",
+ "#Finding unit vector perpendicular to Q and R\n",
+ "\n",
+ "ux=dot(cross(Q,R),ax)/lqxr #X component of the unit vector\n",
+ "uy=dot(cross(Q,R),ay)/lqxr #Y component of the unit vector\n",
+ "uz=dot(cross(Q,R),az)/lqxr #Z component of the unit vector\n",
+ "\n",
+ "ansf=array([round(ux,3),round(uy,3),round(uz,3)])\n",
+ "\n",
+ "ansg=round((float(dot(P,Q))/dot(Q,Q)),4)*Q\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print '(P+Q)X(P-Q) =',ansa\n",
+ "print 'Q.(R X P) =',ansb\n",
+ "print 'P.(Q X R) =',ansc\n",
+ "print 'Sin(theta_QR) =',round(ansd,4)\n",
+ "print 'P X (Q X R) =',anse\n",
+ "print 'A unit vector perpendicular to both Q and R =',ansf\n",
+ "print 'The component of P along Q =',ansg\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(P+Q)X(P-Q) = [ 2 12 4]\n",
+ "Q.(R X P) = 14\n",
+ "P.(Q X R) = 14\n",
+ "Sin(theta_QR) = 0.5976\n",
+ "P X (Q X R) = [2 3 4]\n",
+ "A unit vector perpendicular to both Q and R = [ 0.745 0.298 -0.596]\n",
+ "The component of P along Q = [ 0.4444 -0.2222 0.4444]\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.7, Page number: 21<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Show that points P1(5,2,-4), P2(1,1,2), and P3( -3,0,8) all \n",
+ "lie on a straight line. Determine the shortest distance between \n",
+ "the line and point P4(3,- 1,0). '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "P1=array([5,2,-4])\n",
+ "P2=array([1,1,2])\n",
+ "P3=array([-3,0,8])\n",
+ "P4=array([3,-1,0])\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "R12=P2-P1; #Distance vector from P1 to P2\n",
+ "R13=P3-P1; #Distance vector from P1 to P3\n",
+ "R14=P4-P1; #Distance vector from P1 to P4\n",
+ "s=cross(R12,R13)\n",
+ "x=cross(R14,R12)\n",
+ "d=scipy.sqrt(dot(x,x))/scipy.sqrt(dot(R12,R12)) #Distance from line to P4 \n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The cross product of the distance vectors R12 and R14 =',s\n",
+ "print 'So they are along same direction and hence P1, P2 and P3 are collinear.'\n",
+ "print 'The shortest distance from the line to point P4 =',round(d,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The cross product of the distance vectors R12 and R14 = [0 0 0]\n",
+ "So they are along same direction and hence P1, P2 and P3 are collinear.\n",
+ "The shortest distance from the line to point P4 = 2.426\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_10.ipynb b/Elements_of_Electromagnetics/chapter_10.ipynb
new file mode 100644
index 00000000..ed7744f3
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_10.ipynb
@@ -0,0 +1,566 @@
+{
+ "metadata": {
+ "name": "chapter_10.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 10: Electromagnetic Wave Propagation<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.1, Page number: 416<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The elcctric field in free space is given by \n",
+ "E=50 cos(10^8t + Bx) a_y V/m \n",
+ "(a) Find the direction of wave propagation. \n",
+ "(b) Calculate B and the time it takes to travel a distance of lambda/2. \n",
+ "(c) Sketch the wave at t = 0, T/4, and T/2. '''\n",
+ "\n",
+ "import scipy\n",
+ "from pylab import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "w=10**8 \n",
+ "c=3.0*10**8\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "T=2*scipy.pi/w #timeperiod of the wave in sec\n",
+ "B=(w/c) #in rad/m\n",
+ "lam=2*scipy.pi/B #wavelength in m\n",
+ "t1=lam*10**9/(2*c) #time taken to travel half the wavelength in ns \n",
+ "\n",
+ "x=arange(-6*scipy.pi,6*scipy.pi,0.1)\n",
+ "\n",
+ "t=0\n",
+ "E=50*scipy.cos(10**8*t+x*w/c)\n",
+ "\n",
+ "subplot(3,1,1)\n",
+ "xlabel(\"x\")\n",
+ "ylabel(\"E for t=0\")\n",
+ "plot(x,E,'r')\n",
+ "\n",
+ "subplot(3,1,2)\n",
+ "t=T/4\n",
+ "E=50*scipy.cos(10**8*t+x*w/c)\n",
+ "xlabel(\"x\")\n",
+ "ylabel(\"E for t=T/4\")\n",
+ "plot(x,E)\n",
+ "\n",
+ "subplot(3,1,3)\n",
+ "t=T/2\n",
+ "E=50*scipy.cos(10**8*t+x*w/c)\n",
+ "xlabel(\"x\")\n",
+ "ylabel(\"E for t=T/2\")\n",
+ "plot(x,E,'g')\n",
+ "show()\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Since the argument of cosine function is positive, '\n",
+ "print 'the wave is propagating in the negative x direction.'\n",
+ "print' B =',round(B,4),'rad/m'\n",
+ "print 'Time taken to travel a distance of lambda/2 =',round(t1,2),'n sec'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEICAYAAABF82P+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXlcVNX7xz+DG5bmhjurggyLMqgsmho7pCIq+hVzK7EU\nNVyyfmYlZmXhjpZroqlZmaXigoIimyaoWCjhlii448aObM/vj5MTKOswM/fOcN6vF6/g0sz5cL1z\nn3vOeZ7PIyEiAofD4XA4L6AjtAAOh8PhiBMeIDgcDodTKTxAcDgcDqdSeIDgcDgcTqXwAMHhcDic\nSuEBgsPhcDiVIliAyMvLw6RJk9CjRw9YWloiISEBOTk58PHxgaGhIYYPH47c3Fyh5HE4HE6DR7AA\nERQUBENDQyQnJyM5ORlSqRTr16+HoaEhrl69Cn19fWzYsEEoeRwOh9PgESxAHDt2DAsWLICuri4a\nN26MVq1aITExEf7+/mjWrBkmT56MhIQEoeRxOBxOg0ciRCX1rVu34ObmBkdHR6SmpmLkyJEIDAyE\nVCrF5cuXoauri/z8fFhYWODmzZv/iZVI1C2Vw+FwtAJFbvWCzCAKCwtx5coV+Pr6Ijo6GikpKdi9\ne3et/gAiEv1XUFCQ4Bq4Tq6T6+Qan38piiABwtTUFObm5vD29kbz5s0xduxYHDlyBHZ2dkhNTQUA\npKamws7OTgh5HA6Hw4GAexBmZmZISEhAWVkZDh06BDc3Nzg4OCA0NBQFBQUIDQ2Fo6OjUPI4HA6n\nwdNYqIGXL1+OiRMnorCwEG5ubvDz80NZWRnGjx8Pc3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BiGYRidWIFgGIZhdGIFgmEYhtHp/wBv2SibrE7lggAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x60587d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since the argument of cosine function is positive, \n",
+ "the wave is propagating in the negative x direction.\n",
+ " B = 0.3333 rad/m\n",
+ "Time taken to travel a distance of lambda/2 = 31.42 n sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.2, Page number: 428<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A lossy dielectric has an intrinsic impedance of 200 /30degree ohms at\n",
+ "a particular frequency. If, at that frequency, the plane wave propagating \n",
+ "through the dielectric has the magnetic field component \n",
+ "\n",
+ "H = 10 e^-ax cos(wt-0.5x)a_y A/m \n",
+ "find E and a. Determine the skin depth and wave polarization. '''\n",
+ "\n",
+ "import cmath\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Ho=10 \n",
+ "n=200*scipy.exp(1)**(1j*scipy.pi/6) \n",
+ "b=0.5\n",
+ "\n",
+ "#Calclations\n",
+ "\n",
+ "Eo=n*Ho #amplitude of electric field in kV/m\n",
+ "P=scipy.arctan(scipy.sqrt(3)) \n",
+ "a=b*((scipy.sqrt(((1+(scipy.tan(P))**2)**0.5)-1))/(scipy.sqrt(((1+(scipy.tan(P)\n",
+ ")**2)**0.5)+1)))\n",
+ "delta=1/a\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'E has the same form as H except for amplitude and phase.'\n",
+ "print 'The amplitude and phase of E =',Eo,'kV/m'\n",
+ "print '= magnitude of 2000 and angle of pi/6'\n",
+ "print 'a =',round(a,4),'Np/m'\n",
+ "print 'Skin depth =',round(delta,3),'m'\n",
+ "print 'The polarization of wave is in z direction since it has an z component.'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "E has the same form as H except for amplitude and phase.\n",
+ "The amplitude and phase of E = (1732.05080757+1000j) kV/m\n",
+ "= magnitude of 2000 and angle of pi/6\n",
+ "a = 0.2887 Np/m\n",
+ "Skin depth = 3.464 m\n",
+ "The polarization of wave is in z direction since it has an z component.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.3, Page number: 430<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "In a loss]ess medium for which eta = 60 pi, mu_r = 1 and \n",
+ "H= -0.1 Cos(Wt - z)a_x + 0.5 sin(wt - z)a_y A/m, \n",
+ "calculate epison_r, w and E. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "B=1\n",
+ "n=60*scipy.pi \n",
+ "Ur=1 #relative permeability\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Er=Uo*Ur/(n**2*Eo) #relative permittivity\n",
+ "w=B/scipy.sqrt(Eo*Er*Uo*Ur) #in rad/sec\n",
+ "eps=Eo*Er #permittivity of the medium in Farad/m\n",
+ "H1o=-0.1\n",
+ "H2o=0.5\n",
+ "Ex=H2o/(eps*w) #amplitude of x component of E in V/m\n",
+ "Ey=H1o/(eps*w) #amplitude of y component of E in V/m\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'er =',Er\n",
+ "print 'w =',w,'rad/sec'\n",
+ "print 'E =',round(Ex,2),'sin(wt-z)ax +',round(-Ey,2),'cos(wt-z)ay V/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "er = 4.0\n",
+ "w = 150000000.0 rad/sec\n",
+ "E = 94.25 sin(wt-z)ax + 18.85 cos(wt-z)ay V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.4, Page number: 432<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A uniform plane wave propagating in a medium has \n",
+ "E = 2e^(-az) sin(10^8t-Bz)a_y V/m. \n",
+ "If the medium is characterized by epsilon_r=1, mu_r=20 and sigma=3 mhos/m, \n",
+ "find a,B and H. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "E=2 #amplitude of E in V/m\n",
+ "sigma=3 #in mhos/m\n",
+ "w=10**8 #in rad/sec\n",
+ "Ur=20 #relative permeability\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space in Farad/m\n",
+ "Er=1 #relative permittivity\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "a=round(scipy.sqrt(Uo*Ur*w*sigma/2),1) #in Np/m\n",
+ "B=a #rad/m\n",
+ "theta=scipy.arctan(sigma/(w*Eo*Er))*0.5 #in radians\n",
+ "thetad=round(theta*180/scipy.pi,0) #in degrees\n",
+ "H=E/(scipy.sqrt(Uo*Ur*w/sigma))*10**3 #amplitude of H in mA/m\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'alpha =',a,'Np/m'\n",
+ "print 'beta =',B,'rad/m'\n",
+ "print 'H =',round(H,1),'e^ (',a,'z ) sin(wt - Bz -',thetad,') mA/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "alpha = 61.4 Np/m\n",
+ "beta = 61.4 rad/m\n",
+ "H = 69.1 e^ ( 61.4 z ) sin(wt - Bz - 45.0 ) mA/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.6, Page number: 434<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "For the copper coaxial cable of Figure 7.12, let a = 2 mm, b = 6 mm\n",
+ "and t = 1 mm. Calculate the resistance of 2 m length of the cablc at dc\n",
+ "and at 100 MHz. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ " \n",
+ "a=2*10**-3 #in m\n",
+ "b=6*10**-3 #in m \n",
+ "t=10**-3 #in m\n",
+ "l=2 #in m\n",
+ "c=5.8*10**7 #conductivity in seimens\n",
+ "f=100*10**6 #frequency in Hz\n",
+ "mu=4*scipy.pi*10**-7 #permeability of free space\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ri=l/(c*scipy.pi*a*a) #dc resistance of inner cable in ohms\n",
+ "Ro=l/(c*scipy.pi*((b+t)**2-b**2)) #dc resistance of outer cable in ohms\n",
+ "Rdc=Ro+Ri #total dc resistance in ohms\n",
+ "\n",
+ "Ria=round(l/(2*scipy.pi*a)*scipy.sqrt(scipy.pi*f*mu/c),1)\n",
+ "Roa=round(l/(2*scipy.pi*b)*scipy.sqrt(scipy.pi*f*mu/c),4)\n",
+ "Rac=Ria+Roa #ac resistance in ohms\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Rdc =',round(Rdc*10**3,3),'m ohms'\n",
+ "print 'Rac =',round(Rac,4),'ohms'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rdc = 3.588 m ohms\n",
+ "Rac = 0.5384 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.7, Page number: 439<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "In a nonmagnetic medium \n",
+ "E= 4 sin (2pi X 10^7t - 0.8x) a_z V/m \n",
+ "Find\n",
+ "(a) epsilon_r,eta\n",
+ "(b) The time-average power carried by the wave \n",
+ "(c) The total power crossing 100 cm^2 of plane 2x + y = 5 '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "a=0 #alpha in m^-1\n",
+ "b=0.8 #beta in m^-1\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space in farad/m\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "Ur=1 #relative permeability of medium\n",
+ "w=2*scipy.pi*10**7 #omega in rad/s\n",
+ "Eamp=4 #amplitude of the field in V/m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Er=b**2/(Uo*Eo*w*w) #relative permittivity of the medium\n",
+ "n=scipy.sqrt(Uo/(Eo*Er)) #eta in ohms\n",
+ "Pav=Eamp**2/(2*n)*ax #average power in W/m^2\n",
+ "an=(2*ax+ay)/scipy.sqrt(5) #normal to the plane\n",
+ "S=100*10**-4*an #area in m^2\n",
+ "P=dot(Pav,S)*10**6 #power through the plane in micro W\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Er=',round(Er,2)\n",
+ "print 'eta= ',round(n,1),'ohms'\n",
+ "print 'The time-average power =',round(dot(Pav,ax)*10**3,0),'ax mW/m^2'\n",
+ "print 'The total power crossing 100 cm^2 of the plane =',round(P,2),'micro W'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Er= 14.59\n",
+ "eta= 98.7 ohms\n",
+ "The time-average power = 81.0 ax mW/m^2\n",
+ "The total power crossing 100 cm^2 of the plane = 725.0 micro W\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.10, Page number: 458<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An EM wave travels in free space with the electric field component \n",
+ "E =:100 e^j(0.866x-0.5z) ax V/m \n",
+ "Determine \n",
+ "(a) w and lambda\n",
+ "(b) The magnetic field component \n",
+ "(c) The time average power in the wave '''\n",
+ "\n",
+ "import scipy \n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "kx=0 #in m^-1\n",
+ "ky=0.866 #in m^-1\n",
+ "kz=0.5 #in m^-1\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space in farad/m\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "c=1/(scipy.sqrt(Uo*Eo)) #speed of light in m/s\n",
+ "kvect=kx*ax+ky*ay+kz*az #propogation vector in m^-1\n",
+ "Eo=100 #amplitude of electric field\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "k=round(scipy.sqrt(kx*kx+ky*ky+kz*kz),0) #magnitude of k in m^-1\n",
+ "w=k*c #omega in rad/sec\n",
+ "lam=2*scipy.pi/k #wavelength in m\n",
+ "Ho=cross(kvect,Eo*ax*10)/(Uo*w) #amplitude of magnetic field in mA/m\n",
+ "Hoy=round(dot(Ho,ay),2) #y component of Ho\n",
+ "Hoz=round(dot(Ho,az),1) #z component of Ho\n",
+ "Hr=array([0,Hoy,Hoz]) #Ho with components rounded off\n",
+ "P=Eo**2/(2*120*scipy.pi)*kvect #average power in W/m^2\n",
+ "Py=round(dot(P,ay),2) #y component of P\n",
+ "Pz=round(dot(P,az),3) #z component of P\n",
+ "Pr=array([0,Py,Pz]) #P with components rounded off\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'w =',w,'rad/sec'\n",
+ "print 'lambda =',round(lam,3),'m'\n",
+ "print 'The magnetic field component =',Hr,'e^j(0.866x-0.5z) mA/m'\n",
+ "print 'The time average power in the wave =',Pr,'W/m^2'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w = 300000000.0 rad/sec\n",
+ "lambda = 6.283 m\n",
+ "The magnetic field component = [ 0. 1.33 -2.3 ] e^j(0.866x-0.5z) mA/m\n",
+ "The time average power in the wave = [ 0. 11.49 6.631] W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.11, Page number: 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A uniform plane wave in air with \n",
+ "\u001f\u001d",
+ "E = 8 cos(wt - 4x - 3z) ay V/m \n",
+ "\u001f\u001d",
+ "is incident on a dielectric slah (z>= 0) with mur= 1.0\u001f epsilonr = 2.5\u001f ,sigma=0. Find \n",
+ "(a) The polarization of the wave \n",
+ "(b) The angle of incidence \n",
+ "(c) The reflected E field \n",
+ "(d) The transmitted H field '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "Ei=8 #incident wave amplitude\n",
+ "k=5 #propogation constant\n",
+ "Eo=10**-9/36*scipy.pi #permittivity of free space\n",
+ "Erel=2.5 #relative permittivity\n",
+ "muo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "mur=1 #relative permeability\n",
+ "c=3*10**8 #speed of light\n",
+ "etao=377\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "w=k*c #frequency in rad\n",
+ "theta=scipy.arctan(4/3.0) #angle of incidence in rad\n",
+ "eta1=etao\n",
+ "eta2=377/scipy.sqrt(2.5)\n",
+ "thetai=scipy.arcsin(sin(theta)/scipy.sqrt(2.5))\n",
+ "gamm=(eta2*cos(theta)-eta1*cos(thetai))/(eta2*cos(theta)+eta1*cos(thetai))\n",
+ "Er=Ei*gamm #reflected E field amplitude in V/m\n",
+ "kt=w*scipy.sqrt(mur*Erel)/c\n",
+ "tao=2*eta2*cos(theta)/((eta2*cos(theta)+eta1*cos(thetai)))\n",
+ "Et=tao*Ei*ay\n",
+ "Ht=cross((4*ax+6.819*az)/(eta2*kt),Et)*10**3\n",
+ "Htx=round(dot(Ht,ax),2)\n",
+ "Hty=round(dot(Ht,ay),2)\n",
+ "Htz=round(dot(Ht,az),2)\n",
+ "Htc=array([Htx,Hty,Htz]) #transmitted H field amplitude\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Polarisation is perpendicular polarization'\n",
+ "print 'Angle of incidence is ',round(180*theta/scipy.pi,2),'degrees'\n",
+ "print 'Er =',round(Er,3),'cos(',w,'t - 4x + 3z) V/m'\n",
+ "print 'Ht =',Htc,'cos(',w,'t - 4x - 6.819z) mA/m'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Polarisation is perpendicular polarization\n",
+ "Angle of incidence is 53.13 degrees\n",
+ "Er = -3.112 cos( 1500000000 t - 4x + 3z) V/m\n",
+ "Ht = [-17.68 0. 10.37] cos( 1500000000 t - 4x - 6.819z) mA/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_11.ipynb b/Elements_of_Electromagnetics/chapter_11.ipynb
new file mode 100644
index 00000000..28188144
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_11.ipynb
@@ -0,0 +1,673 @@
+{
+ "metadata": {
+ "name": "chapter_11.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 11: Transmission Lines<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.1, Page number: 482<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An air line has characteristic impedance of 70 ohms and phase constant\n",
+ "of 3 rad/m at 100 MHz. Calculate the inductance per meter and the \n",
+ "capacitance per meter of the line. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=0\n",
+ "G=0\n",
+ "a=0\n",
+ "Ro=70 #characteristic impedence in ohms\n",
+ "B=3 #phase constant in rad/sec\n",
+ "f=100*10**6 #frequency in Hz\n",
+ "w=2*scipy.pi*f #omega in rad/sec\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "C=B/(w*Ro) #capacitance in F/m\n",
+ "L=Ro*Ro*C #inductance in H/m\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'inductance per meter =',round(L*10**9,1),'nH/m'\n",
+ "print 'capacitance per meter =',round(C*10**12,1),'pF/m'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "inductance per meter = 334.2 nH/m\n",
+ "capacitance per meter = 68.2 pF/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.2, Page number: 483<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A distortion less line has Z_o = 60 ohms, a = 20 mNp/m, u = 0.6c, where c\n",
+ "is the speed of light in a vacuum. Find R, L, G, C and lambda at 100 MHz. '''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Zo=60 #in ohms\n",
+ "a=20*10**-3 #in Np/m\n",
+ "u=0.6*3*10**8 #in m/sec\n",
+ "f=100*10**6 #in Hz\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "R=a*Zo #resistance in ohms/m\n",
+ "L=Zo/u #inductance in H/m\n",
+ "G=a*a/R #conductivity in S/m\n",
+ "C=1/(u*Zo) #capacitance in F/m\n",
+ "lam=u/f #wavelentgh in m\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'R =',R,'ohm/m'\n",
+ "print 'L =',round(L*10**9,0),'nH/m'\n",
+ "print 'G =',round(G*10**6,0),'micro S/m'\n",
+ "print 'C =',round(C*10**12,2),'pF/m'\n",
+ "print 'lambda =',lam,'m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 1.2 ohm/m\n",
+ "L = 333.0 nH/m\n",
+ "G = 333.0 micro S/m\n",
+ "C = 92.59 pF/m\n",
+ "lambda = 1.8 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.3, Page number: 490<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A certain transmission line operating at w = 10^6 rad/sec has a=8 dB/m,\n",
+ "B = 1 rad/m, and Zo = 60 + j40 ohms, and is 2 m long. If the line is \n",
+ "connected to a source of 10/0 V, Zg = 40 ohms and terminated by a load of\n",
+ "20 + j50 ohms, deternline \n",
+ "\n",
+ "(a) The input impedance \n",
+ "(b) The sending-end current \n",
+ "(c) The current at the middle of the line '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "w=10**6 #omega in rad/sec\n",
+ "B=1 #phase factor in rad/m\n",
+ "a=8.0/8.686 #alpha in Np/m\n",
+ "Y=a+1j #in m^-1\n",
+ "l=2 #length in m\n",
+ "Vg=10 #source voltage in volts\n",
+ "Zo=60+40j #in ohms\n",
+ "Zg=40 #in ohms\n",
+ "Zl=20+50j #load impedance in ohms\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "s=scipy.tanh(Y*l)\n",
+ "Zin=Zo*(Zl+Zo*s)/(Zo+Zl*s) #input impedance in ohms\n",
+ "Zinr=round(Zin.real,2) #real part of Zin rounded to 2 decimal places\n",
+ "Zini=round(Zin.imag,2) #imaginary part of Zin rounded to 2 decimal places\n",
+ "Io=Vg/(Zin+Zg) #in A\n",
+ "absIo=round(abs(Io),6) #absolute value of Io rounded to 6 decimal place\n",
+ "Ior=Io.real #real part of Io\n",
+ "Ioi=Io.imag #imaginary part of Io\n",
+ "angIo=scipy.arctan(Ioi/Ior)*180/scipy.pi \n",
+ " #in degrees\n",
+ "Vo=Zin*Io\n",
+ "Vop=(Vo+Zo*Io)/2\n",
+ "Vom =(Vo-Zo*Io)/2\n",
+ "Im=((Vop*scipy.e**(-Y)/Zo))-((Vom*scipy.e**Y)/Zo)\n",
+ " #current at the middle in A\n",
+ "absIm=round(abs(Im),5) #absolute value of Im rounded to 6 decimal place\n",
+ "Imr=Im.real #real part of Im \n",
+ "Imi=Im.imag #imaginary part of Im\n",
+ "angIm=360+scipy.arctan(Imi/Imr)*180/scipy.pi \n",
+ " #in degrees\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The input impedance =',Zinr,'+',Zini,'j ohms'\n",
+ "print 'The sending-end current is'\n",
+ "print 'mod =',absIo*10**3,'mA, angle =',round(angIo,2),'degrees'\n",
+ "print 'The current at the middle is'\n",
+ "print 'mod =',absIm*10**3,'mA, angle =',round(angIm,0),'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input impedance = 60.25 + 38.79 j ohms\n",
+ "The sending-end current is\n",
+ "mod = 93.03 mA, angle = -21.15 degrees\n",
+ "The current at the middle is\n",
+ "mod = 34.92 mA, angle = 281.0 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.4, Page number: 499<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A 30-m long loss less transmission line with Zo = 50 ohms operating at 2 MHz\n",
+ "is terminated with a load Zl = 60 + j40 ohms. If u = 0.6c on the line, find \n",
+ "\n",
+ "(a)The reflection coefficient r \n",
+ "(b)The standing wave ratio s \n",
+ "(c)The input impedance '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "l=30 #length in m\n",
+ "Zo=50 #in ohms\n",
+ "f=2*10**6 #frequency in Hz\n",
+ "Zl=60+40j #load impedence in ohms\n",
+ "u=0.6*3*10**8 #in m/s\n",
+ "w=2*scipy.pi*f #omega in rad/sec\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "T=(Zl-Zo)/(Zl+Zo) #reflection coefficient\n",
+ "ang=scipy.arctan(T.imag/T.real)*180/scipy.pi #argument of T is degrees\n",
+ "s=(1+abs(T))/(1-abs(T)) #standing wave ratio \n",
+ "B=w/u #propogation vector in m^-1\n",
+ "Zin=Zo*(Zl+Zo*scipy.tan(B*l)*1j)/(Zo+Zl*scipy.tan(B*l)*1j)\n",
+ "Zinr=round(Zin.real,2) #real part of Zin rounded to 2 decimal places\n",
+ "Zini=round(Zin.imag,2) #imaginary part of Zin rounded to 2 decimal places\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The reflection coefficient is'\n",
+ "print 'mod =',round(abs(T),4),'angle =',round(ang,0),'degrees'\n",
+ "print 'The standing wave ratio s =',round(s,3)\n",
+ "print 'The input impedance =',Zinr,'+',Zini,'j ohms'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reflection coefficient is\n",
+ "mod = 0.3523 angle = 56.0 degrees\n",
+ "The standing wave ratio s = 2.088\n",
+ "The input impedance = 23.97 + 1.35 j ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.5, Page number: 501<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A 100 + j150-ohms load is connected to a 75-ohm lossless line. Find: \n",
+ "\n",
+ "(a) r \n",
+ "(b) s \n",
+ "(c) The load admittance Yl\n",
+ "(d) Zin at O.4 lambda from the load \n",
+ "(e) The locations of V max and V min with respect to the load if the line is\n",
+ "O.6 lambda long \n",
+ "(f) Zin at the generator '''\n",
+ "\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Zl=100+150j #load impedance in ohms\n",
+ "Zo=75 #impedance of line in ohms\n",
+ "B=2*scipy.pi \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "T=(Zl-Zo)/(Zl+Zo)\n",
+ "angT=scipy.arctan(T.imag/T.real)*180/scipy.pi \n",
+ "s=(1+abs(T))/(1-abs(T))\n",
+ "Yl=(1/Zl)*10**3 #admittance in mS\n",
+ "Ylr=round(Yl.real,2) #real part of Yl rounded to 2 decimal places\n",
+ "Yli=round(Yl.imag,2) #imaginary part of Yl rounded to 2 decimal places\n",
+ "l1=0.4\n",
+ "Zin=Zo*(Zl+Zo*scipy.tan(B*l1)*1j)/(Zo+Zl*scipy.tan(B*l1)*1j)\n",
+ "Zinr=round(Zin.real,2) #real part of Zin rounded to 2 decimal places\n",
+ "Zini=round(Zin.imag,2) #imaginary part of Zin rounded to 2 decimal places\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'r is mod =',round(abs(T),3),',angle =',round(angT,0),'degrees'\n",
+ "print 's =',round(s,2)\n",
+ "print 'The load admittance Yl =',Ylr,'+',Yli,'j mS'\n",
+ "print 'Zin at O.4 lambda from the load =',Zinr,'+',Zini,'j ohms'\n",
+ "#part (e) and (f) don't require computations"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r is mod = 0.66 ,angle = 40.0 degrees\n",
+ "s = 4.88\n",
+ "The load admittance Yl = 3.08 + -4.62 j mS\n",
+ "Zin at O.4 lambda from the load = 21.96 + 47.61 j ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.6, Page number: 509<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "With an unknown load connected to a slotted air line, s = 2 is recorded by \n",
+ "a standing wave indicator and minima are found at 11 cm, 19 cm, . . . on \n",
+ "the scale. When the load is replaced by a short circuit, the minima are at\n",
+ "16 cm, 24 cm,. . . . If Zo = 50 ohms, calculate lambda,f, and ZL '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "s=2\n",
+ "l1=11 \n",
+ "l2=19\n",
+ "ma=24 \n",
+ "mi=16\n",
+ "u=3*10**8 #speed of wave in m/s\n",
+ "Zo=50 #in ohms\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "l=(l2-l1)*2 #lambda in cm\n",
+ "f=(u/l)*10**-7 #frequency in GHz\n",
+ "L=(24-19)/l #Let us assume load is at 24cm\n",
+ "zl=1.4+0.75j # by smith chart\n",
+ "Zl=Zo*zl #ZL in ohms\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'lambda =',l,'cm'\n",
+ "print 'f =',f,'GHz'\n",
+ "print 'ZL =',Zl,'ohms'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lambda = 16 cm\n",
+ "f = 1.875 GHz\n",
+ "ZL = (70+37.5j) ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.7, Page number: 510<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Antenna with impedance 40 + j30 ohms is to be matched to a 100-ohm lossless \n",
+ "line with a shorted stub. Determine \n",
+ "(a) The required stub admittance \n",
+ "(b) The distance between the stub and the antenna \n",
+ "(c) The stub length \n",
+ "(d) The standing wave ratio on each ratio of the system '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Zo=100 #in ohms\n",
+ "Zl=40+30j #in ohms\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Yo=1.0/Zo #in S\n",
+ "yl=Zo/Zl\n",
+ "ys1=1.04j #By smith chart\n",
+ "ys2=-1.04j #By smith chart\n",
+ "Ys1=Yo*ys1 #in S\n",
+ "Ys2=Yo*ys2 #in S\n",
+ "la=round(0.5-(62-(-39))/720.0,2) #in units of lambda\n",
+ "lb=round((62-39)/720.0,3) #in units of lambda\n",
+ "da=round(88/720.0,4) #in units of lambda\n",
+ "db=round(272/720.0,4) #in units of lambda\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The required stub admittance values in mS are',Ys1*1000,'and',Ys2*1000\n",
+ "print 'The distance between stub and antenna at A =',la,'in units of lambda'\n",
+ "print 'The distance between stub and antenna at B =',lb,'in units of lambda'\n",
+ "print 'The stub lengths =',da,'and',db,'in units of lambda'\n",
+ "print 'Part (d) is done using smith chart'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required stub admittance values in mS are 10.4j and -10.4j\n",
+ "The distance between stub and antenna at A = 0.36 in units of lambda\n",
+ "The distance between stub and antenna at B = 0.032 in units of lambda\n",
+ "The stub lengths = 0.1222 and 0.3778 in units of lambda\n",
+ "Part (d) is done using smith chart\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.9, Page number: 521"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A 75 ohm transmission line of length 60 m is terminated by a 100 ohm load. If a rectangular \n",
+ "pulse of width 5 micro sec and magnitude 4V is sent out by the generator connected to the line, \n",
+ "sketch I(0, t) and I( l, t) for 0 < t < 15 microS. Take Zg = 25 ohm and u = 0.1 c. '''\n",
+ "\n",
+ "import scipy\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "#Variable Declarataion\n",
+ "\n",
+ "zo=75 #in ohms\n",
+ "zg=25 #in ohms\n",
+ "zl=100 #in ohms\n",
+ "vg=4 #in volts\n",
+ "l=60 #in m\n",
+ "c=3*10**8 #speed of light in m/s\n",
+ "u=0.1*c #in m/s\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "gammag=(zg-zo)/(zg+zo)\n",
+ "gammal=(zl-zo)/(zl+zo)\n",
+ "Vo=zo*vg/(zo+zg) #in V\n",
+ "t1=l/u #in micro sec\n",
+ "Io=vg/(zo+zg) #in mA\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "t1=[0,4,5,8,9,12,13,15]\n",
+ "I1=[40,31.43,-8.571,-7.959,0.6123,0.5685,-0.0438,-0.438]\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "ax.step(t1,I1,where='post')\n",
+ "ax.set_xlabel('Time (micro s)')\n",
+ "ax.set_ylabel(r'I(0,t) in mA')\n",
+ "plt.show()\n",
+ "\n",
+ "t2=[0,2,6,7,10,11,14]\n",
+ "I2=[0,34.3,31.9,-2.46,-2.28,0.176,0.176]\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "ax.step(t2,I2,where='post')\n",
+ "ax.set_xlabel('Time (micro s)')\n",
+ "ax.set_ylabel(r'I(l,t) in mA')\n",
+ "plt.show()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEMCAYAAADeYiHoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGzFJREFUeJzt3X1wVNXhxvFn0SZgQUQtIMaQFCibgJAFQhIYwqqAVYxh\nFEaiQEdCRaryoradsdRGfzO0Gq1CLQlVY0dRUaqOjIIg6vJSQjaY2CImApUIqMibms0kwRDP7w+G\nLSEnDeTt3pDvZ2ZnsjfZex83sk/OuWfveowxRgAAnKaT0wEAAO5EQQAArCgIAIAVBQEAsKIgAABW\nFAQAwMrRgqitrZXP51NaWpokKRQKKT09XdHR0Zo0aZIqKiqcjAcAHZqjBbF48WLFx8fL4/FIknJy\nchQdHa1du3YpKipKubm5TsYDgA7NsYLYv3+/Vq9erVmzZunke/WCwaAyMzMVGRmpmTNnqqCgwKl4\nANDhne/UgRcsWKDs7GyVl5eHtxUWFsrr9UqSvF6vgsFgvcedHG0AAM7O2V44w5ERxFtvvaWePXvK\n5/PVCXym4Y0xrr/94Q9/cDzDmdyk9pGzvTyf5Ox4OdtDRmOadkUlR0YQW7Zs0apV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gAABW\nFAQAwIqCAABYURAAACsKAgBgRUEAAKwoCACAFQUBALCiIAAAVhQEAMCKggAAWFEQAAArCgIAYEVB\nAACsKAgAgBUFAQCwoiAAAFYUBADAioIAAFhREAAAKwoCAGBFQQAArCgIAIAVBQEAsKIgAABWFAQA\nwIqCAABYnVVBVFRU6IUXXtDEiRNbKw8AwCUaLYhjx47p9ddf15QpU9SnTx+99957uvPOO5t94H37\n9umqq67SoEGD5Pf79dJLL0mSQqGQ0tPTFR0drUmTJqmioqLZxwIAnD2PMcbYvrF27Vq9/PLLev/9\n9+X3+zVlyhTdc889Kisra5EDHzhwQAcOHFBCQoIOHz6skSNH6l//+pdycnK0b98+PfbYY7rvvvsU\nExOj+++//7+BPR41EBku4fFI/IoAd2nKa2eDI4jrrrtOR48e1datW/X8888rLS1NHo+n2SFP6t27\ntxISEiRJl156qQYNGqTCwkIFg0FlZmYqMjJSM2fOVEFBQYsdEwBw5s5v6BtFRUV6+eWXNXbsWPXr\n109TpkxRbW1tq4TYvXu3duzYoZEjR+r222+X1+uVJHm9XgWDwXo/n5WVFf7a7/fL7/e3Si4AaK8C\ngYACgUCz9tHgFNNJxhht2bJFL7/8sl577TUNHTpUN910k+64445mHfikUCgkv9+vBx98MHzuYefO\nnercubMqKysVFxenzz///L+BmWJyPaaYAPdp0SmmU3c6evRoPfXUU9q/f7/uvfdebd26tckhT1VT\nU6Obb75Z06dPV3p6uiQpMTFRJSUlkqSSkhIlJia2yLEAAGfnjJa5Hj58WG+99ZbefPNNhUKhFlnm\naoxRZmamBg8erPnz54e3JyUlKS8vT1VVVcrLy1NycnKzjwUAOHuNTjFlZWXp1Vdflc/nU0RERHj7\nc88916wDb968WampqRoyZEj45Pcf//hHjR49WtOmTVNxcbGGDRum5cuXq2vXrv8NzBST6zHFBLhP\nU147Gy2IQYMGqbi4uE45OImCcD8KAnCfVjkHMXr0aOXn5zc5FACgfWp0BFFcXKzU1FRddNFFuuii\ni048yOPRv//97zYJeDpGEO7HCAJwn6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miAlJUVr167VhRde\n6HSUeo4dO6ZRo0Zp27ZtTDOhWRhBAE3wy1/+Ui+++KLTMazefPNNZWRkUA5oNkYQAAArRhAAACsK\nAgBgRUEAAKwoCACAFQUBALCiIAAAVv8PIrVuLX2NSRcAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5f89c90>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEMCAYAAADJQLEhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHKVJREFUeJzt3Xlw1PXh//HXoiRAWRBECBiSMFw5OLLGsAkMmcUK2tgQ\nqDI19WBIam1ia2mEsWOpBp3SagZBqYKjxo6DIRWPQquAOHUFBHOYcBjDkUoQbQyXkI0JkYT9/eGX\n/IjkDpvPZ/k8HzOZ2d1kP/sib/J57ed6r83r9XoFALCsXkYHAAAYiyIAAIujCADA4igCALA4igAA\nLI4iAACL82kRnD17Vk6nU9HR0YqLi9OKFSskSVlZWQoODpbD4ZDD4dDmzZt9GQMA0Aabr68jqK2t\nVb9+/VRfX6+YmBi9/fbbys3Nld1uV2Zmpi9fGgDQAT7fNdSvXz9JUk1NjRoaGhQYGChJ4jo2ADCH\nq339AufPn5fD4VBpaalWrlypkJAQSdKqVau0fv16zZ07VxkZGbLb7c2eZ7PZfB0NAK5InX6j7e0h\nhw8f9kZERHiLi4u9VVVV3vPnz3tPnz7tve+++7zZ2dmX/HwPRvOJxx57zOgI3eLP+f05u9dLfqP5\ne/6urDt77KyhsLAwJSYmKj8/X0OHDpXNZtPAgQP1wAMP6O233+6pGACAH/BpEZw4cUKnT5+WJJ08\neVLvvfeekpOTVVlZKUlqaGhQbm6uEhMTfRkDANAGnx4jqKys1Pz589XY2KigoCAtWrRIw4cP1733\n3qvdu3crICBACQkJSk9P92UMQyxf7tLSpUan6A7/zd+/v0tZWUan6DqXy2V0hG4hv//x+emjXWWz\n2fz6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EBzVbsAQEBqq+vb/f5F1wohx9+v7WfX7t2rXbu3Km1a9cqOzu7aX7/\n8+fPc3wAlwVbBLhitHfeg9frVVBQkEaNGqU333xTXq9X586du+TdvPT95HUVFRVdznLHHXcoLy9P\nX331lSTpm2++uSTn9ddfr8DAQBUUFKiurk55eXmXzFbr9XpVUVGhqVOn6umnn1ZlZWVT6Xz++eca\nP358lzMCF1AE8EsX3glfvF/+4tsX/8wP7z///PP64IMPmg787tq165LlR0dHN5sO/YfLae2d+IXH\nR40apUceeUR33323oqOjtXz58hZzrVmzRtnZ2UpISNC0adMumS21sbFR99xzjyZNmqQf//jHysrK\natrK2b9/vxwOR4s5gM7g9FGgFfHx8dqyZYsGDBhgdJRL1NfXa+rUqSoqKmL3ELqNLQKgFffdd59e\ne+01o2O0aMOGDUpJSaEEcFmwRQAAFscWAQBYHEUAABZHEQCAxVEEAGBxFAEAWBxFAAAW9/8AjjI6\n8BSLXDoAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x6342070>"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.10, Page number: 527<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A certain microstrip line has fused quartz (Er=3.8) as a substrate. \n",
+ "If the ratio of line width to substrate thickness is w/h = 4.5, determine \n",
+ "\n",
+ "(a) The effective relative permittivity of the substrate \n",
+ "(b) The characteristic impedance of the line \n",
+ "(c) The wavelength of the line at 10 GHz '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Er=3.8 #relative permittivity\n",
+ "c=3*10**8 #speed of wave in m/s\n",
+ "r=4.5 #ratio of line width to substrate thickness\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Eeff=((Er+1)/2)+((Er-1)/(2*(1+12/r)**0.5))\n",
+ "Zo=(120*scipy.pi)/((r+1.393+(0.667*scipy.log(r+1.444)))*((Eeff)**0.5))\n",
+ "f=10**10\n",
+ "l=c/(f*scipy.sqrt(Eeff))\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The effective relative permittivity of the substrate =',round(Eeff,3)\n",
+ "print 'The characteristic impedance of the line =',round(Zo,2),'ohms'\n",
+ "print 'The wavelength of the line at 10 GHz =',round(l*1000,2),'mm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The effective relative permittivity of the substrate = 3.131\n",
+ "The characteristic impedance of the line = 30.08 ohms\n",
+ "The wavelength of the line at 10 GHz = 16.95 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 11.11, Page number: 527<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "At 10 GHz, a microstrip line has the following parameters: \n",
+ "h = 1 mm \n",
+ "w = 0.8 mm \n",
+ "Er = 6.6 \n",
+ "tan(theta) = 10^-4 \n",
+ "sigma_r = 5.8 X 10^7 S/m \n",
+ "Calculate the attenuation due to conduction loss and dielectric loss. '''\n",
+ "\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "h=1 #in mm\n",
+ "w=0.8 #in mm\n",
+ "Er=6.6 #relative permittivity\n",
+ "P=scipy.arctan(0.0001) \n",
+ "c=5.8*10**7 #conductivity in S/m\n",
+ "f=10**10 #frequency in Hz\n",
+ "mu=4*scipy.pi*10**-7 #permeability of free space\n",
+ "C=3*10**8 #speed of wave in m/s\n",
+ "r=w/h\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ee=((Er+1)/2.0)+((Er-1)/(2.0*(1+12/r)**0.5))\n",
+ "Zo=(120.0*scipy.pi)/((r+1.393+(0.667*scipy.log(r+1.444)))*((Ee)**0.5))\n",
+ "Rs=scipy.sqrt((scipy.pi*f*mu)/c)\n",
+ "ac=8.686*Rs/(w*(10**-3)*Zo)\n",
+ "l=C/(f*(Ee)**0.5)\n",
+ "ad=27.3*(Ee-1)*Er*scipy.tan(P)/((Er-1)*Ee*l)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'attenuation due to conduction loss =',round(ac,2),'dB/m'\n",
+ "print 'attenuation due to dielectric loss =',round(ad,3),'dB/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "attenuation due to conduction loss = 4.35 dB/m\n",
+ "attenuation due to dielectric loss = 0.177 dB/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_12.ipynb b/Elements_of_Electromagnetics/chapter_12.ipynb
new file mode 100644
index 00000000..b6ded6a6
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_12.ipynb
@@ -0,0 +1,452 @@
+{
+ "metadata": {
+ "name": "chapter_12.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 12: Waveguides<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.1, Page number: 557<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "'''\n",
+ "A rectangular waveguide with dimensions a = 2.5 cm, b = 1 cm is to \n",
+ "operate below 15.1 GHz. How many TE and TM modes can the waveguide transmit\n",
+ "if the guide is filled with a medium characterized by sigma = 0, epsilon = 4\n",
+ "epsilon_o,mu_r = 1? Calculate the cutoff frequencies of the modes. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a=2.5*10**-2 #in m\n",
+ "b=1*10**-2 #in m\n",
+ "c=0\n",
+ "Ur=1 #relative permeability\n",
+ "Er=4 #relative permittivity\n",
+ "C=3*10**8 #speed of wave in m/s\n",
+ "fc=0\n",
+ "m=0\n",
+ "n=0\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "while (fc*10**-9 < 15.1) :\n",
+ " fc = (C/(4*a))*scipy.sqrt(m**2+(a*n/b)**2)\n",
+ " if (( fc*10**-9) < 15.1) :\n",
+ " n=n+1\n",
+ " else:\n",
+ " print 'Maximum value of n is ',n-1\n",
+ "\n",
+ "nmax=n-1 \n",
+ "fc=0\n",
+ "m=0\n",
+ "n=0\n",
+ "while(fc*10**-9 < 15.1):\n",
+ " fc =(C/(4*a))*scipy.sqrt(m**2+(a*n/b)**2)\n",
+ " if((fc*10**-9) < 15.1):\n",
+ " m=m+1\n",
+ " else:\n",
+ " print 'Maximum value of m is ',m-1 \n",
+ "\n",
+ "mmax=m-1\n",
+ "m=0\n",
+ "while(m<mmax+1):\n",
+ " n=0\n",
+ " while(n<nmax+1):\n",
+ " p=(C/(4*a))*scipy.sqrt(m**2+(a*n/b)**2)\n",
+ " if((p*10**-9) < 15.1) :\n",
+ " print m,n,'transmission mode is possible'\n",
+ " print 'frequency is',round(p*10**-9,2),'GHz'\n",
+ " else:\n",
+ " print m,n,'transmission mode is not possible'\n",
+ " n=n+1\n",
+ " \n",
+ " m=m+1\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value of n is 2\n",
+ "Maximum value of m is 5\n",
+ "0 0 transmission mode is possible\n",
+ "frequency is 0.0 GHz\n",
+ "0 1 transmission mode is possible\n",
+ "frequency is 7.5 GHz\n",
+ "0 2 transmission mode is possible\n",
+ "frequency is 15.0 GHz\n",
+ "1 0 transmission mode is possible\n",
+ "frequency is 3.0 GHz\n",
+ "1 1 transmission mode is possible\n",
+ "frequency is 8.08 GHz\n",
+ "1 2 transmission mode is not possible\n",
+ "2 0 transmission mode is possible\n",
+ "frequency is 6.0 GHz\n",
+ "2 1 transmission mode is possible\n",
+ "frequency is 9.6 GHz\n",
+ "2 2 transmission mode is not possible\n",
+ "3 0 transmission mode is possible\n",
+ "frequency is 9.0 GHz\n",
+ "3 1 transmission mode is possible\n",
+ "frequency is 11.72 GHz\n",
+ "3 2 transmission mode is not possible\n",
+ "4 0 transmission mode is possible\n",
+ "frequency is 12.0 GHz\n",
+ "4 1 transmission mode is possible\n",
+ "frequency is 14.15 GHz\n",
+ "4 2 transmission mode is not possible\n",
+ "5 0 transmission mode is possible\n",
+ "frequency is 15.0 GHz\n",
+ "5 1 transmission mode is not possible\n",
+ "5 2 transmission mode is not possible\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.3, Page number: 561<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "In a rectangular waveguide for which a = 1.5 cm, b = 0.8 cm, sigma = 0, \n",
+ "mu = mu_o and epsilon = 4epsilon_o,\n",
+ "\n",
+ "Hx=2sin(pi x/a) cos(3pi y/b)sin(pi X 10^11t - Bz) A/m\n",
+ "\n",
+ "Determine \n",
+ "(a) The mode of operation \n",
+ "(b) The cutoff frequency \n",
+ "(c) The phase constant B \n",
+ "(d) The propagation constant gamma\n",
+ "(e) The intrinsic wave impedance eta '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a=1.5*10**-2 #in m\n",
+ "b=0.8*10**-2 #in m\n",
+ "c=0\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "Ur=1 #relative permeability\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space\n",
+ "Er=4 #relative permittivity\n",
+ "C=3*10**8 #speed of light in m/s\n",
+ "w=scipy.pi*10**11 #omega in rad/s\n",
+ "m=1\n",
+ "n=3\n",
+ "u=C/2 #speed of wave in m/s\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "f=w/(2*scipy.pi) #frequency of wave in Hz\n",
+ "fc=u*((m*m)/(a*a)+(n*n)/(b*b))**0.5/2 #cutoff frequency in Hz\n",
+ "B=w*scipy.sqrt(1-(fc/f)**2)/u #phase constant in rad/m\n",
+ "eta=377/scipy.sqrt(Er)*scipy.sqrt(1-(fc/f)**2) #intrinsic wave impedance in ohm\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The cutoff frequency =',round(fc*10**-9,2),'GHz'\n",
+ "print 'The phase constant =',round(B,2),'rad/m'\n",
+ "print 'The propagation constant =',round(B,2),'j /m'\n",
+ "print 'The intrinsic wave impedance =',round(eta,1),'ohms'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The cutoff frequency = 28.57 GHz\n",
+ "The phase constant = 1718.93 rad/m\n",
+ "The propagation constant = 1718.93 j /m\n",
+ "The intrinsic wave impedance = 154.7 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.4, Page number: 565<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A standard air-filled rectangular waveguide with dimensions a = 8.636 cm,\n",
+ "b = 4.318 cm is fed by a 4-GHz carrier from a coaxial cable. Determine if a \n",
+ "TE_10 mode will be propagated. If so, calculate the phase velocity and \n",
+ "the group velocity. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a=8.636*10**-2 #in m\n",
+ "b=4.318*10**-2 #in m\n",
+ "f=4*10**9 #in Hz\n",
+ "u=3*10**8 #speed of wave in m/s\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "fc=u/(2*a)\n",
+ "if(f>fc):\n",
+ " print 'As f>fc, TE10 mode will propogate'\n",
+ "else:\n",
+ " print 'It will not propogate'\n",
+ "\n",
+ "Up=u/scipy.sqrt(1-(fc/f)**2) #phase velocity in m/s\n",
+ "Ug=u*u/Up #group velocity in m/s\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Phase velocity =',round(Up*10**-6,0),'Mm/s'\n",
+ "print 'Group velocity =',round(Ug*10**-6,1),'Mm/s'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As f>fc, TE10 mode will propogate\n",
+ "Phase velocity = 333.0 Mm/s\n",
+ "Group velocity = 270.2 Mm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.5, Page number: 570<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An air-filled rectangular waveguide of dimensions a = 4 cm, b = 2 cm \n",
+ "transports energy in the dominant mode at a rate of 2 mW. If the frequency of\n",
+ "operation is lO GHz. Determine the peak value of the electric field \n",
+ "in the waveguide. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f=10*10**9 #frequency of operation in Hz\n",
+ "a=4*10**-2 #in m\n",
+ "b=2*10**-2 #in m\n",
+ "u=3*10**8 #velocity in m/s\n",
+ "Pavg=2*10**-3 #average power in W\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "fc=u/(2*a) #cutoff frequency in Hz\n",
+ "n=377/scipy.sqrt(1-(fc/f)**2) #intrinsic wave impedance in ohms\n",
+ "E=scipy.sqrt(4*n*Pavg/(a*b)) #peak value of electric field in V/m\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'Peak value of electric field =',round(E,2),'V/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak value of electric field = 63.77 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.6, Page number: 571<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A copper-plated waveguide (sigma_e = 5.8 X 10 7 S/m) operating at 4.8 GHz \n",
+ "is supposed to deliver a minimum power of 1.2 kW to an antenna. If the guide\n",
+ "is fillcd with polystyrene (sigma = 10^17 S/m, epsilon = 2.55 epsilon_o) and\n",
+ "its dimensions are a = 4.2 cm, b = 2.6 cm, calculate the power dissipated in \n",
+ "a length 60 cm of the guide in the TE_10 mode. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "cc=5.8*10**7 #in S/m\n",
+ "f=4.8*10**9 #in Hz\n",
+ "c=10**-17 #in S/m\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space\n",
+ "Er=2.55 #relative permittivity\n",
+ "z=60*10**-2 #in m\n",
+ "l=4.2*10**-2 #in m\n",
+ "b=2.6*10**-2 #in m\n",
+ "P=1.2*10**3 #in W\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "n=377/scipy.sqrt(Er)\n",
+ "u=3*10**8/scipy.sqrt(Er)\n",
+ "fc=u/(2*l)\n",
+ "ad=c*n/(2*scipy.sqrt(1-(fc/f)**2))\n",
+ "Rs=scipy.sqrt(scipy.pi*f*Uo/cc)\n",
+ "ac=2*Rs*(0.5+(b/l)*(fc/f)**2)/(b*n*scipy.sqrt(1-(fc/f)**2))\n",
+ "a=ac\n",
+ "Pd=P*(scipy.e**(2*a*z)-1)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'power dissipated =',round(Pd,3),'W'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power dissipated = 6.096 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.8, Page number: 579<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An air-filled resonant cavity with dimensions a = 5 cm, b = 4 cm, and \n",
+ "c = 10 cm is made of copper (sigma_e = 5.8 X 10^7 mhos/m). Find \n",
+ "(a) The five lowest order modes \n",
+ "(b) The quality factor for TE_101 mode '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ " \n",
+ "a=5*10**-2 #in m\n",
+ "b=4*10**-2 #in m\n",
+ "c=10*10**-2 #in m\n",
+ "C=5.8*10**7 #in mhos/m\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "u=3*10**8 #speed of wave in m/s\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "def f(m,n,p):\n",
+ " fr=scipy.sqrt((m/a)**2+(n/b)**2+(p/c)**2)*u/2 #resonant frequency in Hz\n",
+ " print round(fr*10**-9,3)\n",
+ " \n",
+ "\n",
+ "f101=3.35*10**9\n",
+ "d=scipy.sqrt(1/(scipy.pi*f101*Uo*C))\n",
+ "Q=(a*a+c*c)*a*b*c/(d*(2*b*(a**3+c**3)+a*c*(a*a+c*c))) #quality factor\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Thus the five lowest order modes in ascending order are '\n",
+ "print 'TE101, frequency in GHz ='\n",
+ "f(1,0,1)\n",
+ "print 'TE011, frequency in GHz ='\n",
+ "f(0,1,1)\n",
+ "print 'TE102, frequency in GHz ='\n",
+ "f(1,0,2)\n",
+ "print 'TE110, frequency in GHz ='\n",
+ "f(1,1,0)\n",
+ "print 'TE111 or TM111, frequency in GHz ='\n",
+ "f(1,1,1)\n",
+ "print 'Quality factor =',round(Q,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thus the five lowest order modes in ascending order are \n",
+ "TE101, frequency in GHz =\n",
+ "3.354\n",
+ "TE011, frequency in GHz =\n",
+ "4.039\n",
+ "TE102, frequency in GHz =\n",
+ "4.243\n",
+ "TE110, frequency in GHz =\n",
+ "4.802\n",
+ "TE111 or TM111, frequency in GHz =\n",
+ "5.031\n",
+ "Quality factor = 14358.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_13.ipynb b/Elements_of_Electromagnetics/chapter_13.ipynb
new file mode 100644
index 00000000..0aaf4534
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_13.ipynb
@@ -0,0 +1,428 @@
+{
+ "metadata": {
+ "name": "chapter_13.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 13: Antennas<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.1, Page number: 601<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A magnetic field strength of 5 muA/m is required at a point on theta = pi/2,\n",
+ "2 km from an antenna in air. Neglecting ohmic loss, how much power must \n",
+ "the antenna transmit if it is \n",
+ "\n",
+ "(a) A Hertzian dipole of length lambda/25?\n",
+ "(b) A half-wave dipole? \n",
+ "(c) A quarter-wave monopole? \n",
+ "(d) A 10-turn loop antenna of radius Po = lambda/20? '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "H=5*10**-6 #magnetic field strentgh in A/m\n",
+ "theta=scipy.pi/2 \n",
+ "r=2*10**3 #distance in m\n",
+ "Bdl=2*scipy.pi/25\n",
+ "N=10 #number of turns\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Ia=4*scipy.pi*r*H/(Bdl*scipy.sin(theta)) #current for part (a) in A\n",
+ "Pa=40*scipy.pi**2*(1/25.0)**2*Ia**2 #power for part (a) in W\n",
+ "def pow(Io,Rrad):\n",
+ " P=0.5*Io**2*Rrad\n",
+ " print round(P*10**3,0),'mW'\n",
+ "\n",
+ "denom=scipy.cos(scipy.pi*scipy.cos(theta)/2) \n",
+ "Ib=H*2*scipy.pi*r*scipy.sin(theta)/denom #current for part (b) in A\n",
+ "Rradb=73 #wave impedance in ohms for (b)\n",
+ "Ic=Ib #current for part (c) in A\n",
+ "Rradc=36.56 #wave impedance in ohms for (c)\n",
+ "Id=H*r*400/(10*scipy.pi**2) #current for part (d) in A\n",
+ "Rradd=320*scipy.pi**6*N**2/20**4 #wave impedance in ohms for (d)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The power transmitted in mW if antenna is ;'\n",
+ "print '(a) A Hertzian dipole of length lambda/25 =','\\n',round(Pa*10**3,0),'mW'\n",
+ "print '(b) A half-wave dipole ='\n",
+ "pow(Ib,Rradb)\n",
+ "print '(c) A quarter-wave monopole ='\n",
+ "pow(Ic,Rradc)\n",
+ "print '(d) A 10-turn loop antenna of radius Po = lambda/20 ='\n",
+ "pow(Id,Rradd)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power transmitted in mW if antenna is ;\n",
+ "(a) A Hertzian dipole of length lambda/25 = \n",
+ "158.0 mW\n",
+ "(b) A half-wave dipole =\n",
+ "144.0 mW\n",
+ "(c) A quarter-wave monopole =\n",
+ "72.0 mW\n",
+ "(d) A 10-turn loop antenna of radius Po = lambda/20 =\n",
+ "158.0 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.2, Page number: 603<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An electric field strength of 10 micro V/m is to be measured at an observation \n",
+ "point theta=pi/2, 500 km from a half-wave (resonant) dipole antenna operating\n",
+ "in air at 50 MHz. \n",
+ "(a) What is the length of the dipole? \n",
+ "(b) Calculate the current that must be fed to the antenna. \n",
+ "(c) Find the average power radiated by the antenna. \n",
+ "(d) If a transmission line with Zo = 75 ohms is connected to the antenna,\n",
+ "determine the standing wave ratio. '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "c=3*10**8 #speed of wave in m/s\n",
+ "f=50*10**6 #frequency in Hz\n",
+ "E=10*10**-6 #field strength in V/m\n",
+ "theta=scipy.pi/2\n",
+ "r=500*10**3 #distance in m\n",
+ "eta=120*scipy.pi #wave impedance in ohms\n",
+ "Rrad=73 #in ohms\n",
+ "Zo=75 #in ohms\n",
+ "Zl=73+42.5j\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "l=c/(2*f)\n",
+ "I=E*2*r*scipy.pi*sin(theta)/(eta*(cos((scipy.pi/2)*cos(theta))))\n",
+ "P=0.5*I**2*Rrad\n",
+ "T=(Zl-Zo)/(Zl+Zo)\n",
+ "s=(1+abs(T))/(1-abs(T))\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The length of the dipole =',l,'m'\n",
+ "print 'The current that must be fed to the antenna =',round(I*10**3,2),'mA'\n",
+ "print 'The average power radiated by the antenna =',round(P*10**3,1),'mW'\n",
+ "print 'The standing wave ratio =',round(s,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The length of the dipole = 3 m\n",
+ "The current that must be fed to the antenna = 83.33 mA\n",
+ "The average power radiated by the antenna = 253.5 mW\n",
+ "The standing wave ratio = 1.7636\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.4, Page number: 610<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the electric field intensity at a distance of 10 km from an antenna \n",
+ "having a directive gain of 5 dB and radiating a total power of 20 kW. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "G=5\n",
+ "r=10*10**3 #in m\n",
+ "P=20*10**3 #power in W\n",
+ "n=120*scipy.pi #wave impedance in ohms\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Gd=10**(G/10.0)\n",
+ "E=scipy.sqrt(n*Gd*P/(2*scipy.pi*r*r)) #field intensity in V/m\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'electric field intensity =',round(E,4),'V/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric field intensity = 0.1948 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.5, Page number: 611<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The radiation intensity of a certain antenna is \n",
+ "\n",
+ "U(theta,phi) = 2sin(theta) sin^3(phi) , 0<theta<pi,0<phi<pi\n",
+ " = 0, elsewhere\n",
+ "\n",
+ "Determine the directivity of the antenna. '''\n",
+ "\n",
+ "import scipy\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Umax=2.0\n",
+ "\n",
+ "def U(phi,theta):\n",
+ " s=2*scipy.sin(theta)*(scipy.sin(phi))**3/(4.0*scipy.pi)\n",
+ " return s\n",
+ " \n",
+ "#Calculations\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " \n",
+ " Uav,er=scipy.integrate.dblquad(lambda theta,phi:U(phi,theta)*scipy.sin(theta), \n",
+ " 0, scipy.pi, lambda theta: 0, lambda theta: scipy.pi)\n",
+ "\n",
+ "D=Umax/Uav #Directivity\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'directivity of the antenna =',D"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "directivity of the antenna = 6.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.8, Page number: 624<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the maximum effective area of a lamba/2 wire dipole operating at 30 MHz.\n",
+ "How much power is received with an incident plane wave of strength 2 mV/m.'''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "c=3*10**8 #speed of wave in m/s\n",
+ "f=30*10**6 #frequency in Hz\n",
+ "E=2*10**-3 #field strength in V/m\n",
+ "n=120*scipy.pi\n",
+ "R=73 \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "l=c/f #wavelength in m\n",
+ "Gdmax=round(n/(scipy.pi*R),2) \n",
+ "Amax=(l**2/(4*scipy.pi))*Gdmax #maximum effective area in m^2\n",
+ "Pr=(E*E*Amax)/(2*n) #power received in W\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'maximum effective area =',round(Amax,2),'m^2'\n",
+ "print 'power received =',round(Pr*10**9,2),'nW'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum effective area = 13.05 m^2\n",
+ "power received = 69.24 nW\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.9, Page number: 624<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The transmitting and receiving antennas are separated by a distance of \n",
+ "200 lambda and have directive gains of 25 and 18 dB, respectively. If 5 mW\n",
+ "of power is to be received, calculate the minimum transmitted power. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Gt=25 #in dB\n",
+ "Gr=18 #in dB\n",
+ "r=200 #in units of lambda\n",
+ "Pr=5*10**-3 #power received in W\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Gdt=10**(Gt/10.0) \n",
+ "Gdr=10**(Gr/10.0)\n",
+ "Pt=Pr*(4*scipy.pi*r)**2/(Gdr*Gdt)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'minimum transmitted power =',round(Pt,3),'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum transmitted power = 1.583 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.10, Page number: 627<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An S-band radar transmitting at 3 GHz radiates 200 kW. Determine the signal\n",
+ "power density at ranges 100 and 400 nautical miles if the effective area of \n",
+ "the radar antenna is 9 m^2 . With a 20-m^2 target at 300 nautical miles, \n",
+ "calculate the power of the reflected signal at the radar. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "c=3*(10)**8 #speed of wave in m/s\n",
+ "f=3.0*(10)**9 #frequency in Hz\n",
+ "Aet=9 #effective area in m^2\n",
+ "r1=1.852*(10)**5 #distance in m\n",
+ "r2=4*r1 #distance in m\n",
+ "r3=5.556*10**5 #distance in m\n",
+ "Pr=200*(10)**3 #in W\n",
+ "a=20 #target area in m^2\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "l=c/f #wavelength in m\n",
+ "Gdt=4*scipy.pi*Aet/(l*l)\n",
+ "P1=Gdt*Pr/(4*scipy.pi*r1*r1) #power at 100 nmiles in W/m^2\n",
+ "P2=Gdt*Pr/(4*scipy.pi*r2*r2) #power at 400 nmiles in W/m^2\n",
+ "Pr=Aet*a*Gdt*Pr/(4*scipy.pi*r3*r3)**2 #power of reflected signal in W\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Signal power density at 100 nautical miles =',round(P1*1000,3),'mW/m^2'\n",
+ "print 'Signal power density at 400 nautical miles =',round(P2*1000,3),'mW/m^2'\n",
+ "print 'Power of reflected signal =',round(Pr*10**12,5),'pico W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Signal power density at 100 nautical miles = 5.248 mW/m^2\n",
+ "Signal power density at 400 nautical miles = 0.328 mW/m^2\n",
+ "Power of reflected signal = 0.02706 pico W\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_14.ipynb b/Elements_of_Electromagnetics/chapter_14.ipynb
new file mode 100644
index 00000000..1a5d389b
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_14.ipynb
@@ -0,0 +1,172 @@
+{
+ "metadata": {
+ "name": "chapter_14.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 14: Modern Topics<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.1, Page number: 643<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The following S-parameters are obtained for a microwave transistor operating \n",
+ "at 2.5 GHz: S11 = 0.85 / 30\u00b0 ,S12 = 0.07 /56\u00b0 , S21 = 1.68 /120\u00b0 , \n",
+ "S22 = O.85 /-40 . Determine the input reflection coefficient when ZL=Zo=75 ohm. '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "S11=0.85*scipy.e**(-30j*scipy.pi/180)\n",
+ "S12=0.07*scipy.e**(56j*scipy.pi/180)\n",
+ "S21=1.68*scipy.e**(120j*scipy.pi/180)\n",
+ "S22=0.85*scipy.e**(-40j*scipy.pi/180)\n",
+ "Zl=75 \n",
+ "Zo=75\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Tl=(Zl-Zo)/(Zl+Zo)\n",
+ "Ti=S11+(S12*S21*Tl)/(1-S22*Tl) #reflection coefficient\n",
+ "Timod=abs(Ti) #mod of Ti\n",
+ "Tiang=scipy.arctan(Ti.imag/Ti.real)*180/scipy.pi #argument of Ti in degrees\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'input reflection coefficient =',Timod,'/',Tiang,'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input reflection coefficient = 0.85 / -30.0 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.2, Page number: 654<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A step-index fiber has a core diameter of 80 micro m, a core refractive index \n",
+ "of 1.62, and a numerical aperture of 0.21. Calculate: \n",
+ "(a) the acceptance angle, (b) the refractive index that the fiber can \n",
+ "propagate at a wavelength of 0.8 micro m, (c) the number of modes that the\n",
+ "fiber can propagate at a wavelength of 0.8 micro m.'''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "d=80*(10)**-6 #diameter in m\n",
+ "n1=1.62 #core refractive index\n",
+ "NA=0.21 #numerical aperture\n",
+ "L=8*(10)**-7 #wavelength in m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "P=scipy.arcsin(NA)*180/scipy.pi #acceptance angle\n",
+ "n2=scipy.sqrt(n1**2-NA**2) #refractive index\n",
+ "V=(scipy.pi*d/L)*scipy.sqrt(n1**2-n2**2)\n",
+ "N=V**2/2 #number of modes\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Acceptance angle =',round(P,2),'degrees'\n",
+ "print 'Refractive index =',round(n2,3)\n",
+ "print 'No. of modes =',round(N,0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Acceptance angle = 12.12 degrees\n",
+ "Refractive index = 1.606\n",
+ "No. of modes = 2176.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.3, Page number: 655<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Light pulses propagate through a fiber cable with an attenuation of 0.25 dB/km.\n",
+ "Determine the distance through which the power of pulses is reduced by 40%. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a=0.25 #in dB/km\n",
+ "P=1-0.4 #strength of pulse im %\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "l=(10/a)*scipy.log(1/P)/scipy.log(10) #distance in km\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'distance through which the power is reduced by 40% =',round(l,3),'km'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "distance through which the power is reduced by 40% = 8.874 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_2.ipynb b/Elements_of_Electromagnetics/chapter_2.ipynb
new file mode 100644
index 00000000..042db1c8
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_2.ipynb
@@ -0,0 +1,318 @@
+{
+ "metadata": {
+ "name": "chapter_2.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 2: Coordinate Systems and Transformation<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.1, Page number: 36<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given point P(-2,6,3) and vector A = y a_x + (x+z) a_y ,\n",
+ "express P and A in cylindrical and spherical coordinates.\n",
+ "Evaluate A at P in the Cartesian, cylindrical, and spherical systems. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "x=-2\n",
+ "y=6\n",
+ "z=3 \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "r=scipy.sqrt(x**2+y**2)\n",
+ "phi=scipy.arctan(-y/x) #phi in radians in 1st quadrant\n",
+ "phid=180-(phi*180/scipy.pi) #phi in degrees in second quadrant\n",
+ "phic=scipy.pi*phid/180.0 #phi in radians in second quadrant\n",
+ "R=scipy.sqrt(x**2+y**2+z**2) \n",
+ "theta=scipy.arctan(r/z) \n",
+ "\n",
+ " #P in cylindrical coordinates\n",
+ " \n",
+ "Pcyl=array([round(r,2),round(phid,2),z]) \n",
+ "\n",
+ " #P in spherical coordinates\n",
+ " \n",
+ "Psph=array([round(R,2),round(theta*180/scipy.pi,2),\n",
+ " round(phid,2)]) \n",
+ "\n",
+ " #Vector A in cylindrical coordinate system\n",
+ "\n",
+ "Xc=r*scipy.cos(phic)\n",
+ "Yc=r*scipy.sin(phic)\n",
+ "Zc=z \n",
+ "Ar=Yc*scipy.cos(phic)+(Xc+Zc)*scipy.sin(phic)\n",
+ "Aphi=-Yc*scipy.sin(phic)+(Xc+Zc)*scipy.cos(phic)\n",
+ "Az=0\n",
+ "Acyl=array([round(Ar,4),round(Aphi,3),Az])\n",
+ "\n",
+ " #Vector A in spherical coordinate system\n",
+ "\n",
+ "Xs=R*scipy.cos(phic)*scipy.sin(theta)\n",
+ "Ys=R*scipy.sin(phic)*scipy.sin(theta)\n",
+ "Zs=R*scipy.cos(theta)\n",
+ "AR=Ys*scipy.sin(theta)*scipy.cos(phic)+(Xs+Zs)*scipy.sin(theta)*scipy.sin(phic) \n",
+ "Ath=Ys*scipy.cos(theta)*scipy.cos(phic)+(Xs+Zs)*scipy.cos(theta)*scipy.sin(phic) \n",
+ "Aph=-Ys*scipy.sin(phic)+(Xs+Zs)*scipy.cos(phic)\n",
+ "Asph=array([round(AR,4),round(Ath,4),round(Aph,3)])\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'P in cylindrical coordinates =',Pcyl\n",
+ "print 'P in spherical coordinates =',Psph\n",
+ "print 'A in cylindrical coordinates =',Acyl\n",
+ "print 'A in spherical coordinates =',Asph"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P in cylindrical coordinates = [ 6.32 108.43 3. ]\n",
+ "P in spherical coordinates = [ 7. 64.62 108.43]\n",
+ "A in cylindrical coordinates = [-0.9487 -6.008 0. ]\n",
+ "A in spherical coordinates = [-0.8571 -0.4066 -6.008 ]\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.2, Page number: 39<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Express vector B = 10/R a_r+ r cos(theta) a_(theta) + a(phi)\n",
+ "in Cartesian and cylindrical coordinates. \n",
+ "Find B (- 3, 4, 0) and B (5, pi/2, - 2). '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ " \n",
+ "#Variable Declaration\n",
+ "\n",
+ "x=-3\n",
+ "y=4\n",
+ "z=0\n",
+ "p=5\n",
+ "phi=scipy.pi/2 \n",
+ "Zc=-2\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ " #B in cartesian coordinates\n",
+ "\n",
+ "R=scipy.sqrt(x**2+y**2+z**2)\n",
+ "r=scipy.sqrt(x**2+y**2) \n",
+ "P=scipy.arcsin(r/R) #in radians\n",
+ "Q=scipy.arccos(x/r) #in radians \n",
+ "f=10/R \n",
+ "Bx=f*scipy.sin(P)*scipy.cos(Q)+R*(scipy.cos(P))**2*scipy.cos(Q)-scipy.sin(Q) \n",
+ "By=f*scipy.sin(P)*scipy.sin(Q)+R*(scipy.cos(P))**2*scipy.sin(Q)+scipy.cos(Q) \n",
+ "Bz=f*scipy.cos(P)-R*scipy.cos(P)*scipy.sin(P) \n",
+ "Bcart=array([round(Bx,0),round(By,0),round(-Bz,0)])\n",
+ "\n",
+ " #B in cylindrical coordinates\n",
+ " \n",
+ "Rc=sqrt(p**2+Zc**2) \n",
+ "Pc=scipy.arccos(Zc/Rc) #in radians\n",
+ "Br=(10/Rc)*scipy.sin(Pc)+Rc*(scipy.cos(Pc))**2 \n",
+ "Bp=1 \n",
+ "Bzc=(10/Rc)*scipy.cos(Pc)-Rc*scipy.cos(Pc)*scipy.sin(Pc) \n",
+ "Bcyl=array([round(Br,3),Bp,round(Bzc,3)])\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'B(-3,4,0) in cartesian coordinates is',Bcart\n",
+ "print 'B(5,pi/2,-2) in cylindrical coordinates is',Bcyl"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B(-3,4,0) in cartesian coordinates is [-2. 1. 0.]\n",
+ "B(5,pi/2,-2) in cylindrical coordinates is [ 2.467 1. 1.167]\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.3, Page number: 44<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Two uniform vector fields are gIven by E=-5a_p+10a_phi+3a_z and\n",
+ "F=a_p+2a_phi-6a_z. Calculate \n",
+ "(a) |E X F|\n",
+ "(b) The vector component of E at P(5, pi/2, 3) parallel to the line x=2, z=3 \n",
+ "(c) The angle E makes with the surface z = 3 at P '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "E=array([-5,10,3]) #in cylindrical coordinates\n",
+ "F=array([1,2,-6]) #in cylindrical coordinates\n",
+ "P=array([5,scipy.pi/2,3]) #in cylindrical coordinates\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "exf=cross(E,F)\n",
+ "ansa=scipy.sqrt(dot(exf,exf)) #|EXF|\n",
+ "ay=array([round(scipy.sin(scipy.pi/2),0),\n",
+ " round(scipy.cos(scipy.pi/2),0),0])\n",
+ "ansb=dot(E,ay)*ay\n",
+ "modE=scipy.sqrt(dot(E,E))\n",
+ "az=array([0,0,1])\n",
+ "thetaEz=(180/scipy.pi)*arccos(dot(E,az)/modE) #in degrees\n",
+ "ansc=90-thetaEz #in degrees\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print '|EXF| =',round(ansa,2)\n",
+ "print 'The vector component of E at P parallel to the line x=2,z=3 =',ansb,','\n",
+ "print 'in spherical coordinates'\n",
+ "print 'The angle E makes with the surface z = 3 at P =',round(ansc,2),'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "|EXF| = 74.06\n",
+ "The vector component of E at P parallel to the line x=2,z=3 = [-5. -0. -0.] ,\n",
+ "in spherical coordinates\n",
+ "The angle E makes with the surface z = 3 at P = 15.02 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.4, Page number: 45<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " '''\n",
+ "Given a vector field \n",
+ "D = r*sin(phi)a_r-(1/r)*sin(theta)*cos(phi)a_theta+ r^2*a_phi, determine\n",
+ "(a) D at P(10,150\u00b0,330\u00b0) \n",
+ "(b) The component of D tangential to the spherical surface r = 10 at P \n",
+ "(c) A unit vector at P perpendicular to D and tangential to the cone 0 = 150\u00b0 '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "aR=array([1,0,0]) #Unit vector along radial direction\n",
+ "ath=array([0,1,0]) #Unit vector along theta direction\n",
+ "aph=array([0,0,1]) #Unit vector along phi direction\n",
+ "P=array([10,scipy.pi*150/180,scipy.pi*330/180])\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "r=dot(P,aR)\n",
+ "q=dot(P,aph)\n",
+ "p=dot(P,ath)\n",
+ "R=r*scipy.sin(q)\n",
+ "Ph=-scipy.sin(p)*scipy.cos(q)/r\n",
+ "Q=r*r\n",
+ "D=array([R,Ph,Q]) #D at P(10,150\u00b0,330\u00b0)\n",
+ "rDr=round(dot(aR,D),0) #radial component of D\n",
+ "rDth=round(dot(-ath,D),3) #theta component of D\n",
+ "rDph=round(dot(aph,D),0) #phi component of D\n",
+ "\n",
+ "Dn=array([r*scipy.sin(q),0,0]) #Component of D normal to surface r=10\n",
+ "Dt=D-Dn #Component of D tangential to surface r=10\n",
+ "Dtr=round(dot(aR,Dt),0) #radial component of Dt\n",
+ "Dtth=round(dot(-ath,Dt),3) #theta component of Dt\n",
+ "Dtph=round(dot(aph,Dt),0) #phi component of Dt\n",
+ "rDt=array([Dtr,Dtth,Dtph])\n",
+ "\n",
+ " #Unit vector normal to D and tangential to cone theta=45 degrees\n",
+ "\n",
+ "U=cross(D,ath)\n",
+ "u=U/scipy.sqrt(dot(U,U)) \n",
+ "ru=array([round(dot(aR,u),4),round(dot(ath,u),4),round(dot(aph,u),4)])\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'D at P(10,150\u00b0,330\u00b0) = [',rDr,' ',rDth,' ',rDph,']'\n",
+ "print 'The component of D tangential to the spherical surface r = 10 at P ='\n",
+ "print '[',Dtr,' ',Dtth,' ',Dtph,']'\n",
+ "print 'A unit vector at P perpendicular to D and tangential to cone 0 = 150\u00b0 ='\n",
+ "print ru"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "D at P(10,150\u00b0,330\u00b0) = [ -5.0 0.043 100.0 ]\n",
+ "The component of D tangential to the spherical surface r = 10 at P =\n",
+ "[ 0.0 0.043 100.0 ]\n",
+ "A unit vector at P perpendicular to D and tangential to cone 0 = 150\u00b0 =\n",
+ "[-0.9988 0. -0.0499]\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_3.ipynb b/Elements_of_Electromagnetics/chapter_3.ipynb
new file mode 100644
index 00000000..88c80683
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_3.ipynb
@@ -0,0 +1,389 @@
+{
+ "metadata": {
+ "name": "chapter_3.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 3: Vector Calculus<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.1, Page number: 58<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Consider the object shown in Figure 3.7. Calculate \n",
+ "(a) The distance BC \n",
+ "(b) The distance CD \n",
+ "(c) The surface area ABCD \n",
+ "(d) The surface area ABO \n",
+ "(e) The surface area AOFD \n",
+ "(f) The volume ABDCFO '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A=array([5,0,0])\n",
+ "B=array([0,5,0])\n",
+ "C=array([0,5,10])\n",
+ "D=array([5,0,10])\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ " #A,B,C,D in cylindrical coordinates\n",
+ " \n",
+ "A=array([5,0,0])\n",
+ "B=array([5,scipy.pi,0])\n",
+ "C=array([5,scipy.pi,10])\n",
+ "D=array([5,0,10])\n",
+ "\n",
+ "p=5\n",
+ "\n",
+ "def BC(z): \n",
+ " return 1\n",
+ "ansa, erra = scipy.integrate.quad(BC, 0, 10)\n",
+ " \n",
+ "def CD(phi): \n",
+ " return p\n",
+ "ansb, errb = scipy.integrate.quad(CD, 0, scipy.pi/2)\n",
+ "ansbb=ansb/scipy.pi #answer in multiples of pi\n",
+ "\n",
+ "def ABCD(phi,z): \n",
+ " return p\n",
+ "ansc, errc = scipy.integrate.dblquad(lambda z , phi: ABCD(phi,z), \n",
+ " 0, scipy.pi/2, lambda z: 0, lambda z: 10) \n",
+ "anscc=ansc/scipy.pi #answer in multiples of pi\n",
+ " \n",
+ "def ABO(phi,rho): \n",
+ " return rho\n",
+ "ansd, errd = scipy.integrate.dblquad(lambda rho , phi: ABO(phi,rho), \n",
+ " 0, scipy.pi/2, lambda rho: 0, lambda rho: 5)\n",
+ "ansdd=ansd/scipy.pi #answer in multiples of pi\n",
+ "\n",
+ "def AOFD(rho,z): \n",
+ " return 1\n",
+ "anse, erre = scipy.integrate.dblquad(lambda z , rho: AOFD(rho,z), \n",
+ " 0, 10, lambda z: 0, lambda z: 5)\n",
+ " \n",
+ "def ABDCFO(z,phi,rho):\n",
+ " return rho\n",
+ "ansf, errf=scipy.integrate.tplquad(ABDCFO,0,5,lambda rho:0,\n",
+ " lambda rho:scipy.pi/2,lambda rho,phi:0,lambda rho,phi:10)\n",
+ "ansff=ansf/scipy.pi #answer in multiples of pi\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The distance BC =',ansa\n",
+ "print 'The distance CD =',ansbb,'pi'\n",
+ "print 'The surface area ABCD =',anscc,'pi'\n",
+ "print 'The surface area ABO =',ansdd,'pi'\n",
+ "print 'The surface area AOFD =',anse\n",
+ "print 'The volume ABDCFO =',ansff,'pi'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The distance BC = 10.0\n",
+ "The distance CD = 2.5 pi\n",
+ "The surface area ABCD = 25.0 pi\n",
+ "The surface area ABO = 6.25 pi\n",
+ "The surface area AOFD = 50.0\n",
+ "The volume ABDCFO = 62.5 pi\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.2, Page number: 61<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given that F = x^2 a_x - xza_y - y^2 a_z , calculate the \n",
+ "circulation of F around the (closed) path shown in Figure 3.10. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "import scipy.integrate\n",
+ "from fractions import Fraction\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "def C1(x): \n",
+ " return x**2\n",
+ "seg1, err1 = scipy.integrate.quad(C1, 1, 0) #segment 1\n",
+ "Seg1=Fraction(seg1).limit_denominator(100) #converting to fraction\n",
+ "\n",
+ "def C2(y): \n",
+ " return 0\n",
+ "seg2, err2 = scipy.integrate.quad(C2, 0, 1) #segment 2\n",
+ "\n",
+ "def C3(x): \n",
+ " return (x**2-1)\n",
+ "seg3, err3 = scipy.integrate.quad(C3, 0, 1) #segment 3\n",
+ "Seg3=Fraction(seg3).limit_denominator(100) #converting to fraction\n",
+ "\n",
+ "def C4(y): \n",
+ " return (-y-y**2)\n",
+ "seg4, err4 = scipy.integrate.quad(C4, 1, 0) #segment 4\n",
+ "Seg4=Fraction(seg4).limit_denominator(100) #converting to fraction\n",
+ "\n",
+ "seg=Seg1+seg2+Seg3+Seg4 #total circulation around path\n",
+ "Seg=Fraction(seg).limit_denominator(100) #converting to fraction\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'F along segment 1 is',Seg1\n",
+ "print 'F along segment 2 is',seg2\n",
+ "print 'F along segment 3 is',Seg3\n",
+ "print 'F along segment 4 is',Seg4\n",
+ "print 'Circulation of F around the path is',Seg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F along segment 1 is -1/3\n",
+ "F along segment 2 is 0.0\n",
+ "F along segment 3 is -2/3\n",
+ "F along segment 4 is 5/6\n",
+ "Circulation of F around the path is -1/6\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page number: 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given W = x^2 y^2 + xyz, compute VW and the direction derivative dW/dl in the direction \n",
+ "3a_x + 4a_y + 12a_z at (2, -1, 0). '''\n",
+ "\n",
+ "import scipy\n",
+ "from fractions import Fraction\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "Al=array([3,4,12])\n",
+ "x=2\n",
+ "y=-1\n",
+ "z=0\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "gradW=(2*x*y**2+y*z)*ax+(2*x**2*y+x*z)*ay+(x*y)*az\n",
+ "gradWl=Fraction(dot(gradW,Al)/scipy.sqrt(dot(Al,Al))).limit_denominator(1000)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'dW/dl =',gradWl\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dW/dl = -44/13\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page number: 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "If G(r) = lOe^-2z(pa_p + a_z\u001f), determine the flux of G out of the entire surface of the cylinder \n",
+ "p = 1, 0 < Z < 1. Confirm the result using the divergence theorem. '''\n",
+ "\n",
+ "import scipy\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ap=array([1,0,0]) #Unit vector along radial direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "def psi1(phi,p): \n",
+ " return 10*scipy.e**(-2)*p\n",
+ "psit, errt = scipy.integrate.dblquad(lambda p , phi: psi1(phi,p), #flux through top\n",
+ " 0, 2*scipy.pi, lambda p: 0, lambda p: 1) \n",
+ "\n",
+ "def psi2(phi,p): \n",
+ " return -10*p\n",
+ "psib, errb = scipy.integrate.dblquad(lambda p , phi: psi2(phi,p), #flux through bottom\n",
+ " 0, 2*scipy.pi, lambda p: 0, lambda p: 1) \n",
+ "\n",
+ "def psi3(phi,z): \n",
+ " return 10*scipy.exp(-2*z)\n",
+ "psis, errs = scipy.integrate.dblquad(lambda z , phi: psi3(phi,z), #flux through side\n",
+ " 0, scipy.pi*2, lambda z: 0, lambda z: 1) \n",
+ "\n",
+ "psi=psit+psib+psis #total flux through cylinder\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The total flux through the cylinder is',psi\n",
+ "print 'The total flux through cylinder using divergence theorem is also 0'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total flux through the cylinder is 0.0\n",
+ "The total flux through cylinder using divergence theorem is also 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.9, Page number: 81<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "If A = p cos(phi) a_p + sin(phi)a_phi, evaluate closed integral A\u00b7dl\n",
+ "around the path shown in Figure 3.22. \n",
+ "Confirm this using Stokes's theorem. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ap=array([1,0,0]) #Unit vector along radial direction\n",
+ "ath=array([0,1,0]) #Unit vector along theta direction\n",
+ "aph=array([0,0,1]) #Unit vector along phi direction\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ " #segment 1\n",
+ "def ab(phi): \n",
+ " return 2*scipy.sin(phi)\n",
+ "seg1,err1 = scipy.integrate.quad(ab,scipy.pi*60/180,scipy.pi*30/180) \n",
+ "\n",
+ " #segment 2\n",
+ "def bc(p): \n",
+ " return p*scipy.cos(scipy.pi*30/180)\n",
+ "seg2,err2 = scipy.integrate.quad(bc,2,5) \n",
+ "\n",
+ " #segment 3\n",
+ "def cd(phi): \n",
+ " return 5*scipy.sin(phi)\n",
+ "seg3,err3 = scipy.integrate.quad(cd,-scipy.pi*30/180,scipy.pi*60/180)\n",
+ "\n",
+ " #segment 4\n",
+ "def da(p): \n",
+ " return p*scipy.cos(scipy.pi*60/180)\n",
+ "seg4,err4 = scipy.integrate.quad(da,5,2)\n",
+ "\n",
+ "I1=seg1+seg2+seg3+seg4\n",
+ "\n",
+ " #using stoke's theorem\n",
+ "\n",
+ "def curlA(phi,p): \n",
+ " return ((1+p)*scipy.sin(phi))\n",
+ "I2, err = scipy.integrate.dblquad(lambda p , phi: curlA(phi,p), \n",
+ " scipy.pi*30/180, scipy.pi*60/180, lambda p: 2, lambda p: 5)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The integral calculated segment wise =',round(I1,3)\n",
+ "print 'The integral calculated using Stokes Theorem =',round(I2,3)\n",
+ "print 'Since I1 = I2, Stokes theorem is verified'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The integral calculated segment wise = 4.941\n",
+ "The integral calculated using Stokes Theorem = 4.941\n",
+ "Since I1 = I2, Stokes theorem is verified\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_4.ipynb b/Elements_of_Electromagnetics/chapter_4.ipynb
new file mode 100644
index 00000000..14ac4af2
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_4.ipynb
@@ -0,0 +1,699 @@
+{
+ "metadata": {
+ "name": "chapter_4.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 4: Electrostatic Fields<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.1, Page number: 107<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Point charges 1 mC and -2 mC are located at (3,2,-1) and (-1,-1,4),\n",
+ "respectively. Calculate the electric force on a 10 nC charge located\n",
+ "at (0,3,1) and the electric field intensity at that point. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "Q1=1*10**-3 #charge 1 at (-1,-1,4) in C\n",
+ "Q2=-2*10**-3 #charge 2 at (3,2,-1) in C\n",
+ "Q=10*10**-9 #charge 3 at (0,3,1) in C\n",
+ "P1=array([0,3,1])-array([3,2,-1]) #distance vector from charge 3 to 1\n",
+ "P2=array([0,3,1])-array([-1,-1,4]) #distance vector from charge 3 to 2\n",
+ "e=10**-9/(36*scipy.pi) #permittivity in Farad/m \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "modP1=scipy.sqrt(dot(P1,P1))\n",
+ "modP2=scipy.sqrt(dot(P2,P2))\n",
+ "F1=(Q*Q1)*P1*10**3/(4*scipy.pi*e*modP1**3) #force on charge 3 by 1 in mN\n",
+ "F2=(Q*Q2)*P2*10**3/(4*scipy.pi*e*modP2**3) #force on charge 3 by 2 in mN\n",
+ "\n",
+ " #Total force on charge 3\n",
+ " \n",
+ "Fx=round(dot(F1+F2,ax),3)\n",
+ "Fy=round(dot(F1+F2,ay),3)\n",
+ "Fz=round(dot(F1+F2,az),3)\n",
+ "F=array([Fx,Fy,Fz]) #Total force in mN\n",
+ "E=(10**-6)*(F/Q) #Electric field in kV/m\n",
+ "\n",
+ "#Results \n",
+ "\n",
+ "print 'Total force on charge at (0,3,1) =',F,'in mN'\n",
+ "print 'Electric field at (0,3,1) =',E,'kV/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total force on charge at (0,3,1) = [-6.512 -3.713 7.509] in mN\n",
+ "Electric field at (0,3,1) = [-651.2 -371.3 750.9] kV/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page number: 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A practical application of electrostatics is in electrostatic separation of solids. For example, \n",
+ "Florida phosphate ore, consisting of small panicles of quartz and phosphate rock, can be \n",
+ "separated into its components by applying a uniform electric field as in Figure 4.4. Assum- \n",
+ "ing zero initial velocity and displacement, determine the separation between the particles \n",
+ "after falling 80 cm. Take E = 500 kV/m and Q/m = 9 microC/kg for both positively and neg- \n",
+ "atively charged particles. '''\n",
+ "\n",
+ "import scipy\n",
+ "#Variable Declaration\n",
+ "\n",
+ "E=500*10**3 #electric field in V/m\n",
+ "Qm=9*10**-6 #Q/m in C/kg\n",
+ "y=0.8 #distance fallen in m\n",
+ "g=9.8 #acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "t=scipy.sqrt(2*y/g) #time taken to fall in seconds\n",
+ "x=Qm*E*t**2/2 #half the separation between particles in m\n",
+ "sep=2*x #separation between particles in m\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The separation between particles is',round(sep*100,2),'cm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The separation between particles is 73.47 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5, Page number: 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The finite sheet 0 <= x <= 1, 0 <= y <= 1 on the z = 0 plane has a charge density \n",
+ "Ps=xy(x^2 + y^2 + 25)^3/2 nC/m^2 . Find \n",
+ "\u001f\u001d",
+ "(a) The total charge on the sheet \n",
+ "(b) The e1ectric field at (0, 0, 5) \n",
+ "(c) The force experienced by a -1 mC charge located at (0, 0, 5) '''\n",
+ "\n",
+ "import scipy\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "q=-1 #charge in mC\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "def charge(x,y): \n",
+ " return x*y*(x**2+y**2+25)**(1.5)\n",
+ "Q, errq = scipy.integrate.dblquad(lambda y , x: charge(x,y), #total charge in nC\n",
+ " 0, 1, lambda y: 0, lambda y: 1) \n",
+ "\n",
+ "d=(4*scipy.pi*Eo*(x**2+y**2+25)**(1.5))\n",
+ "\n",
+ "def elecx(x,y): \n",
+ " return 10**-9*x*y*(x**2+y**2+25)**(1.5)*(-x)/d #x component of electric field\n",
+ "Ex, errx = scipy.integrate.dblquad(lambda y , x: elecx(x,y), \n",
+ " 0, 1, lambda y: 0, lambda y: 1) \n",
+ "\n",
+ "def elecy(x,y): \n",
+ " return 10**-9*x*y*(x**2+y**2+25)**(1.5)*(-y)/d #y component of electric field\n",
+ "Ey, erry = scipy.integrate.dblquad(lambda y , x: elecy(x,y), \n",
+ " 0, 1, lambda y: 0, lambda y: 1) \n",
+ "\n",
+ "def elecz(x,y): \n",
+ " return 10**-9*x*y*(5)/(4*scipy.pi*Eo) #z component of electric field\n",
+ "Ez, errz = scipy.integrate.dblquad(lambda y , x: elecz(x,y), \n",
+ " 0, 1, lambda y: 0, lambda y: 1) \n",
+ "\n",
+ "E=array([round(Ex,1),round(Ey,1),round(Ez,2)]) #electric field in V/m\n",
+ "\n",
+ "F=q*E #force in mN \n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Total charge =',round(Q,2),'nC'\n",
+ "print 'Electric field at (0,0,5) =',E,'V/m'\n",
+ "print 'Force experienced by -1mC =',F,'mN'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total charge = 33.15 nC\n",
+ "Electric field at (0,0,5) = [ -1.5 -1.5 11.25] V/m\n",
+ "Force experienced by -1mC = [ 1.5 1.5 -11.25] mN\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.6, Page number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Planes x=2 and y=-3, respectively, carry charges 10 nC/m^2 and 15 nC/m^2 .\n",
+ "If the line x=0, z=2 carries charge 10 pi nC/m, calculate E at (1,1,-1)\n",
+ "due to the three charge distributions. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "ps1=10*10**-9 #Surface charge density of plane 1\n",
+ "ps2=15*10**-9 #Surface charge density of plane 2\n",
+ "pl=10*scipy.pi*10**-9 #charge density of line\n",
+ "e=(10**-9)/(36*scipy.pi) #permittivity of free space in Farad/m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "E1=(ps1/(2*e))*-ax/scipy.pi #field due to plane 1 in multiples of pi in V/m\n",
+ "E2=(ps2/(2*e))*ay/scipy.pi #field due to plane 2 in multiples of pi in V/m\n",
+ "\n",
+ " #field due to line charge in multiples of pi in V/m\n",
+ " \n",
+ "a=(ax-3*az) \n",
+ "moda=scipy.sqrt(dot((ax-3*az),(ax-3*az)))\n",
+ "e3=(pl/(2*scipy.pi*e*moda**2))*a\n",
+ "E3=array([dot(e3,ax)/scipy.pi,0,dot(e3,az)/scipy.pi])\n",
+ "\n",
+ " #total field in multiples of pi in V/m\n",
+ " \n",
+ "E=E1+E2+E3 \n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The total electric field at (1,1,-1) =',E,'Pi V/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total electric field at (1,1,-1) = [-162. 270. -54.] Pi V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.7, Page number: 123<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine D at (4, 0, 3) if there is a point charge - 5pi mC\n",
+ "at (4, 0, 0) and a line charge 3pi mC/m along the y-axis. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "Q=-5*scipy.pi*10**-3 #charge at (4,0,0) in C\n",
+ "pl=3*scipy.pi*10**-3 #charge density of line charge in C/m\n",
+ "r=array([4,0,3]) #point where D is to be found \n",
+ "rp=array([4,0,0]) #position of point charge\n",
+ "\n",
+ "#Calculations \n",
+ "\n",
+ "R=r-rp \n",
+ "modR=scipy.sqrt(dot(R,R)) \n",
+ "Dq=(Q*R)/(4*scipy.pi*modR**3) #flux density due to point charge in C/m^2\n",
+ "p=scipy.sqrt(dot(r,r))\n",
+ "ap=r/p \n",
+ "Dl=(pl/(2*scipy.pi*p))*ap #flux density due to line charge in C/m^2\n",
+ "D=(Dq+Dl)*10**6 #total flux density in micro C/m^2\n",
+ "Dz=round(dot(D,az),0)\n",
+ "Dx=round(dot(D,ax),0)\n",
+ "Dy=round(dot(D,ay),0)\n",
+ "Dround=array([Dx,Dy,Dz]) #value of D rounded to 0 decimal points\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'D at (4,0,0) due to point charge and line charge =',Dround,'micro C/m^2'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "D at (4,0,0) due to point charge and line charge = [ 240. 0. 41.] micro C/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.8, Page number: 130<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given that D = zp cos^2(phi) a_z C/m^2 , calculate the charge density \n",
+ "at (1,pi/4, 3) and the total charge enclosed by the cylinder of \n",
+ "radius 1 m with -2< Z <2 m. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "import scipy.integrate\n",
+ "from fractions import Fraction\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ap=array([1,0,0]) #Unit vector along rho direction\n",
+ "aph=array([0,1,0]) #Unit vector along phi direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "point=array([1,scipy.pi/4,3])\n",
+ "p1=0\n",
+ "p2=1\n",
+ "ph1=0\n",
+ "ph2=2*scipy.pi\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "pointp=dot(point,ap)\n",
+ "pointph=dot(point,aph)\n",
+ "pv=pointp*scipy.cos(pointph)**2 #charge density at (1,pi/4,3) in C/m^3\n",
+ "\n",
+ "def ctop(phi,p): \n",
+ " return 2*p**2*(scipy.cos(phi)**2)\n",
+ "psya, erra = scipy.integrate.dblquad(lambda p , phi: ctop(phi,p), \n",
+ " ph1, ph2, lambda p: p1, lambda p: p2)\n",
+ "\n",
+ "def cbot(phi,p): \n",
+ " return 2*p**2*(scipy.cos(phi)**2)\n",
+ "psyb, errb = scipy.integrate.dblquad(lambda p , phi: cbot(phi,p), \n",
+ " ph1, ph2, lambda p: p1, lambda p: p2)\n",
+ " \n",
+ "psy=psya+psyb #Charge in C\n",
+ "psyp=psy/scipy.pi #Charge in multiples of Pi in C\n",
+ "psyf=Fraction(psyp).limit_denominator(100) #converting to fraction\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Charge density at (1,pi/4,3) =',pv,'C/m^3'\n",
+ "print 'Total charge enclosed by the cylinder =',psyf,'Pi C'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge density at (1,pi/4,3) = 0.5 C/m^3\n",
+ "Total charge enclosed by the cylinder = 4/3 Pi C\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.10, Page number: 136<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Two point charges -4 micro C and 5 micro C are located at (2, -1, 3) \n",
+ "and (0, 4, -2), respectively. Find the potential at (1, 0, 1) \n",
+ "assuming zero potential at infinity. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Q1=-4 #charge 1 in micro C\n",
+ "Q2=5 #charge 2 in micro C\n",
+ "e=10**-9/(36*scipy.pi) #permittivity of free space in Farad/m \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "R1=array([1,0,1])-array([2,-1,3]) #distance vector from (1,0,1) to charge 1\n",
+ "R2=array([1,0,1])-array([0,4,-2]) #distance vector from (1,0,1) to charge 2\n",
+ "modR1=scipy.sqrt(dot(R1,R1))\n",
+ "modR2=scipy.sqrt(dot(R2,R2)) \n",
+ "V=10**-9*((Q1/modR1)+(Q2/modR2))/(4*scipy.pi*e) #potential in kV\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The potential at (1, 0, 1) =',round(V,3),'kV'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The potential at (1, 0, 1) = -5.872 kV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11, Page number: 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A point charge 5 nC is located at (-3, 4, 0) while line y = 1, z = 1 carries uniform charge \n",
+ "2 nC/m. \n",
+ "\u001f\u001d",
+ "(a) If V = 0V at O(0, 0, 0), find V at A(5, 0, ]). \n",
+ "(b) If V = 100V at B(1, 2, 1), find V at C(-2, 5, 3). \n",
+ "(c) If V = -5V at O, find V_BC '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Eo=10**-9/(36*scipy.pi) #permittivity of free space\n",
+ "Vo=0 #potential at O in V\n",
+ "Vb=100 #potential at B in V\n",
+ "po=scipy.sqrt(2)\n",
+ "ro=5\n",
+ "pa=1\n",
+ "ra=9\n",
+ "pb=1\n",
+ "rb=scipy.sqrt(21)\n",
+ "pc=scipy.sqrt(20)\n",
+ "rc=scipy.sqrt(11)\n",
+ "pl=2*10**-9 #charge density of the line in C/m\n",
+ "Q=5*10**-9 #point charge at (-3,4,0) in C\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Va=Vo-(-pl*scipy.log(po/pa)/(2*scipy.pi*Eo)+Q*(ra-ro)/(4*scipy.pi*Eo*ra*ro))\n",
+ "Vc=Vb+(-pl*scipy.log(pc/pb)/(2*scipy.pi*Eo)+Q*(rb-rc)/(4*scipy.pi*Eo*rb*rc))\n",
+ "Vbc=Vc-Vb\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Va =',round(Va,3),'V'\n",
+ "print 'Vc =',round(Vc,3),'V'\n",
+ "print 'Vbc =',round(Vbc,3),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Va = 8.477 V\n",
+ "Vc = 49.825 V\n",
+ "Vbc = -50.175 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.12, Page number: 140<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given the potential V = (10/r**2)sin(theta)cos(phi), \n",
+ "(a) Find the electric flux density D at (2, pi/2, 0). \n",
+ "(b) Calculate the work done in moving a 10 micro C charge from \n",
+ "point A( 1, 30\u00b0, 120\u00b0) to B( 4, 90\u00b0, 60\u00b0). '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ar=array([1,0,0]) #Unit vector along radial direction\n",
+ "ath=array([0,1,0]) #Unit vector along theta direction\n",
+ "aph=array([0,0,1]) #Unit vector along phi direction\n",
+ "e=(10**-9)/(36*scipy.pi) #permittivity of free space in Farad/m\n",
+ "\n",
+ " #The point (2, pi/2, 0)\n",
+ "r=2\n",
+ "th=scipy.pi/2\n",
+ "ph=0\n",
+ " #Point A\n",
+ "ra=1\n",
+ "tha=scipy.pi*30/180\n",
+ "pha=scipy.pi*120/180\n",
+ " #Point B\n",
+ "rb=4\n",
+ "thb=scipy.pi/2\n",
+ "phb=scipy.pi*60/180\n",
+ "\n",
+ "q=10*10**-6 \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Er=(20.0/r**3)*scipy.sin(th)*scipy.cos(ph) #Radial component of E in V/m\n",
+ "Eth=-(10/r**3)*scipy.cos(th)*scipy.cos(ph) #Theta component of E in V/m\n",
+ "Eph=(10/r**3)*scipy.sin(ph) #Phi component of E in V/m\n",
+ "E=array([Er,Eth,Eph])\n",
+ "D=E*e*10**12 #Electric flux density D in pC/m^2\n",
+ "Dr=round(dot(D,ar),1) #Radial component of D in V/m rounded to 1 decimal\n",
+ "Dth=round(dot(D,ath),0) #Theta component of D in pC/m^2 rounded to 0 decimal\n",
+ "Dph=round(dot(D,aph),0) #Phi component of D in pC/m^2 rounded to 0 decimal\n",
+ "Dc=array([Dr,Dth,Dph]) #Rounded D in pC/m^2\n",
+ "\n",
+ "Va=10*scipy.sin(tha)*cos(pha)/ra**2 #potential at point A in V\n",
+ "Vb=10*scipy.sin(thb)*cos(phb)/rb**2 #potential at point B in V\n",
+ "W=q*(Vb-Va)*10**6 #work done in micro J\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The electric flux density D at (2, pi/2, 0) =',Dc,'pC/m^2'\n",
+ "print 'Work done in moving the charge =',W,'micro J'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electric flux density D at (2, pi/2, 0) = [ 22.1 -0. 0. ] pC/m^2\n",
+ "Work done in moving the charge = 28.125 micro J\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.13, Page number: 145<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Two dipoles with dipole moments -5 a_z nC/m and 9 a_z nC/m are\n",
+ "located at points (0,0,-2) and (0,0,3), respectively.\n",
+ "Find the potential at the origin. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "p1=-5*10**-9 #dipole moment of dipole 1 in C/m\n",
+ "p2=9*10**-9 #dipole moment of dipole 2 in C/m\n",
+ "z1=2 #z component of position vector of dipole 1\n",
+ "z2=-3 #z component of position vector of dipole 2\n",
+ "e=10**-9/(36*scipy.pi) #permittivity of free space in Farad/m\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "V=(1/(4*scipy.pi*e))*((p1*abs(z1)/z1**3)+(p2*abs(z2)/z2**3))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'Potential at origin =',V, 'V'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential at origin = -20.25 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.14, Page number: 148<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Three point charges - 1 nC, 4 nC, and 3 nC are located at (0, 0, 0), \n",
+ "(0, 0, 1), and (1, 0, 0), respectively. Find the energy in the system. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Q1=-1*10**-9 #Charge 1 in C\n",
+ "Q2=4*10**-9 #Charge 2 in C\n",
+ "Q3=3*10**-9 #Charge 3 in C\n",
+ "e=10**-9/(36*scipy.pi) #permittivity of free space in farad/m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "V1=(1/(4*scipy.pi*e)*(Q2+Q3))\n",
+ "V2=(1/(4*scipy.pi*e)*(Q1+Q3/(2**.5)))\n",
+ "V3=(1/(4*scipy.pi*e)*(Q1+Q2/(2**.5)))\n",
+ "W=0.5*((V1*Q1)+(V2*Q2)+(V3*Q3))*10**9 #Energy in nJ\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'Energy in the system =',round(W,2),'nJ'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy in the system = 13.37 nJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_5.ipynb b/Elements_of_Electromagnetics/chapter_5.ipynb
new file mode 100644
index 00000000..882e9145
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_5.ipynb
@@ -0,0 +1,523 @@
+{
+ "metadata": {
+ "name": "chapter_5.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 5: Electric Fields in Material Space<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.1, Page number: 167<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "If the current density J=1/r^3(2cos(theta) a_r + sin(theta) a_t) Ampere/m^2,\n",
+ "calculate the current passing through\n",
+ "(a) A hemispherical shell of radius 20 cm.\n",
+ "(b) A spherical shell of radius 10 cm. '''\n",
+ "\n",
+ "import scipy\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "r1= 0.2 # radius of hemispherical shell in metres\n",
+ "r2= 0.1 # radius of spherical shell in metres\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "#Calculation of current through hemispherical shell \n",
+ "\n",
+ "def J1(phi,theta):\n",
+ "\ts1=(1/r1)*(2* scipy.cos(theta)* scipy.sin(theta))\n",
+ "\treturn s1\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ "\n",
+ " I1, error = scipy.integrate.dblquad(lambda theta , phi: J1(phi,theta), \n",
+ " 0, 2*scipy.pi, lambda theta: 0, lambda theta: scipy.pi/2) \n",
+ "\t \n",
+ "#Calculation of current through spherical shell \n",
+ "\n",
+ "def J2(phi,theta):\n",
+ "\ts2=(1/r2)*(2* scipy.cos(theta)* scipy.sin(theta))\n",
+ "\treturn s2\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ "\n",
+ " I2, error = scipy.integrate.dblquad(lambda theta , phi: J1(phi,theta), \n",
+ " 0, 2*scipy.pi, lambda theta: 0, lambda theta: scipy.pi) \n",
+ "\t \n",
+ "#Results\n",
+ "\n",
+ "print 'Current through hemispherical shell=',round(I1,1),'A' \n",
+ "print 'Current through spherical shell=',round(I2,0),'A'\n",
+ "\t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through hemispherical shell= 31.4 A\n",
+ "Current through spherical shell= 0.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.2, Page number: 168<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A typical example of convective charge transport is found \n",
+ "in the Van de Graaff generator where charge is transported \n",
+ "on a moving belt from the base to the dome.\n",
+ "If a surface charge density 10^7 C/m^2 is transported at a velocity of 2 m/s, \n",
+ "calculate the charge collected in 5 s. Take the width of the belt as 10 cm. '''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ps=10**-7 #Surface charge density of the belt in Couloumb/metre^2\n",
+ "u=2 #Speed of the belt in metres/sec\n",
+ "w=0.1 #Width of the belt in metres\n",
+ "t=5 #Time taken in seconds \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "I=ps*u*w #Current in amperes\n",
+ "Q=I*t*10**9 #Charge collected in 5 seconds in nano Coloumbs\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print \"The charge collected in 5 seconds is \",Q,\"nC\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The charge collected in 5 seconds is 100.0 nC\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.3, Page number: 169<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A wire of diameter 1mm and conductivity 5X10^7 S/m has 10^29 \n",
+ "free electrons/m^3 when an electric field of 10mV /m is applied. Determine \n",
+ "(a) The charge density of free electrons \n",
+ "(b) The current density \n",
+ "(c) The current in the wire \n",
+ "(d) The drift velocity of the electrons. \n",
+ "Take the electronic charge as e = -1.6X10^-19 C. '''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=10**29 #Number density of electrons in m^-3\n",
+ "e=-1.6*10**-19 #Electronic charge in Coloumbs\n",
+ "sigma=5*10**7 #Current density in S/m\n",
+ "E=10**-2 #Electric Field in V/m\n",
+ "S=(3.14*10**-6)/4 #Cross sectional area of the wire in m^2\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "pv=n*e #Charge density of free electrons in C/m^3\n",
+ "J=sigma*E*10**-3 #Current density in kA/m^2\n",
+ "I=J*S*10**3 #Current in amperes\n",
+ "u=J*10**3/pv #Drift velocity in m/s\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print \"The charge density is \",pv,\"C/m^3\" \n",
+ "print \"The current density is \",J,\"kA/m^2\" \n",
+ "print \"The current is \",round(I,3), \"A\"\n",
+ "print \"The drift velocity is \",-u,\"m/s\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The charge density is -16000000000.0 C/m^3\n",
+ "The current density is 500.0 kA/m^2\n",
+ "The current is 0.393 A\n",
+ "The drift velocity is 3.125e-05 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.4, Page number: 170<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A lead (sigma=5X10^6 S/m) bar of square cross section has a\n",
+ "hole bored along its length of 4 cm so that its cross section \n",
+ "becomes a square of side 3 cm with a hole of diameter 1 cm \n",
+ "drilled through the centre,\n",
+ "Find the resistance between the square ends. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "l=4 #Length of the lead bar in m\n",
+ "d=3 #Width of the lead bar in cm\n",
+ "r=0.5 #Radius of the hole drilled in cm\n",
+ "sigma=5*10**6 #Conductivity of the bar in S/m\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "S=(d**2-(scipy.pi*r**2)) #Cross sectional area in cm^2\n",
+ "R=l/(S*sigma*10**-4) #Resistance in ohms\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The resistance between the square ends is',round(R*10**6),'micro ohms'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance between the square ends is 974.0 micro ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.6, Page number: 177<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The electric field intensity in polystyrene (epsilon_r= 2.55) filling\n",
+ "the space between the plates of a parallel-plate capacitor is 10 kV/m. \n",
+ "The distance between the plates is 1.5 mm. Calculate: \n",
+ "(a) D \n",
+ "(b) P \n",
+ "(c) The surface charge density of free charge on the plates \n",
+ "(d) The surface density of polarization charge \n",
+ "(e) The potential difference between the plates '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "e0=10**-9/(36*scipy.pi) #permittivity of free space in Farad/m\n",
+ "er=2.55 #relative permittivity (dimensionless)\n",
+ "E=10*10**3 #Electric field in V/m\n",
+ "chi=er-1.0 #Electric susceptibility (dimensionless)\n",
+ "d=1.5 #Distance between plates in mm\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "D=e0*er*E*10**9 #D in nC/m^2\n",
+ "\n",
+ "P=chi*e0*E*10**9 #P in nC/m^2\n",
+ "\n",
+ "ps=D #The surface charge density of \n",
+ " #free charge in nC/m^2\n",
+ " \n",
+ "pps =P #The surface charge density of\n",
+ " #polarization charge in nC/m^2\n",
+ " \n",
+ "V=E*d*10**-3 #The potential difference between \n",
+ " #the plates in volts\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'D =',round(D,2),'nC/m^2'\n",
+ "print 'P =',round(P,0),'nC/m^2'\n",
+ "print 'Surface charge density of free charge =',round(ps,2),'nC/m^2'\n",
+ "print 'Surface charge density of polarization charge =',round(pps,0),'nC/m^2'\n",
+ "print 'The potential difference between the plates =',V,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "D = 225.47 nC/m^2\n",
+ "P = 137.0 nC/m^2\n",
+ "Surface charge density of free charge = 225.47 nC/m^2\n",
+ "Surface charge density of polarization charge = 137.0 nC/m^2\n",
+ "The potential difference between the plates = 15.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.7, Page number: 178<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A dielectric sphere (epsilon_r = 5.7) of radius 10 cm \n",
+ "has a point charge 2 pC placed at its center. \n",
+ "Calculate: \n",
+ "(a)The surface density of polarization charge on\n",
+ " the surface of the sphere \n",
+ "(b)The force exerted by the charge on a -4 pC \n",
+ " point charge placed on the sphere '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "e0=10**-9/(36*scipy.pi) #permittivity of free space\n",
+ " #in Farad/m\n",
+ " \n",
+ "er=5.7 #relative permittivity\n",
+ " #(dimensionless)\n",
+ " \n",
+ "chi=er-1 #Electric susceptibility\n",
+ " #(dimensionless)\n",
+ " \n",
+ "r=0.1 #radius of sphere in m\n",
+ "\n",
+ "q1=2 #charge on sphere in pC\n",
+ "\n",
+ "q2=-4 #value of point charge in pC\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "E=q1/(4*scipy.pi*e0*er*r**2) #Electric field on the\n",
+ " #sphere in pV/m\n",
+ " \n",
+ "P=chi*e0*E #Polarisation in pC/m^2\n",
+ "\n",
+ "pps=P #The surface density of polarization \n",
+ " #charge in pC/m^2\n",
+ " \n",
+ "F=(q1*q2*10**-12)/(4*scipy.pi*e0*er*r**2) #Force exerted on point charge in pN\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The surface density of polarization'\n",
+ "print 'charge on the surface of the sphere =',round(pps,2),'pC/m^2'\n",
+ "print 'Force exerted on -4 pC charge =',round(F,3),'pN in the radial direction'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The surface density of polarization\n",
+ "charge on the surface of the sphere = 13.12 pC/m^2\n",
+ "Force exerted on -4 pC charge = -1.263 pN in the radial direction\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.9, Page number: 188<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Two extensive homogeneous isotropic dielectrics meet on \n",
+ "plane z = O. For z >=0, epsilon_r1 = 4 and for z <= 0, \n",
+ "epsilon_r2 = 3. A uniform electric field E1= 5 a_x - 2 a_y + 3 a_z kV/m \n",
+ "exists for z >= O. Find \n",
+ "(a) E2 for z <= 0 \n",
+ "(b) The angles El and E2 make with the interface \n",
+ "(c) The energy densities in J/m^3 in both dielectrics \n",
+ "(d) The energy within a cube of side 2 m centered at (3,4,-5) '''\n",
+ "\n",
+ "#Variable Declarartion\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "an=array([0,0,1]) #Unit vector normal to the interface\n",
+ "E1=array([5,-2,3]) #Electric field for z >=0 in kV/m\n",
+ "e_r1=4 #Relative permittivity for z >=0 (dimensionless)\n",
+ "e_r2=3 #Relative permittivity for z <=0 (dimensionless)\n",
+ "e0=(10**-9)/(36*scipy.pi) #Permittivity of free space in Farad/m\n",
+ "V=2*2*2 #Volume of cube placed in region 2 in m^3\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "E1n=array([0,0,dot(E1,an)]) #The normal component of E1 in kV/m\n",
+ "E1t=E1-E1n #Transverse component of E1 in kV/m\n",
+ "E2t=E1t #Transverse component of E2 in kV/m\n",
+ "E2n=e_r1*E1n/e_r2 #Normal Component of E2 in kV/m\n",
+ "E2=E2n+E2t #The total field E2 in kV/m\n",
+ "\n",
+ "theta1= 90- 180*scipy.arccos(dot(E1,an)/ #Angle between E1 and \n",
+ " scipy.sqrt(dot(E1,E1)))/scipy.pi #interface in degrees\n",
+ " \n",
+ "theta2= 90- 180*scipy.arccos(dot(E2,an)/ #Angle between E2 and \n",
+ " scipy.sqrt(dot(E2,E2)))/scipy.pi #interface in degrees\n",
+ "\n",
+ "\n",
+ "We1= 0.5*e0*e_r1*dot(E1,E1)*10**6 # The energy density of E1 in J/m^3\n",
+ "We2= 0.5*e0*e_r2*dot(E2,E2)*10**6 # The energy density of E2 in J/m^3\n",
+ "W= We2*V # The energy within the cube in J\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The electric field for the region z <=0 is',E2,'kV/m'\n",
+ "print 'The angle E1 makes with the boundary is',round(theta1,1),'degrees'\n",
+ "print 'The angle E2 makes with the boundary is',round(theta2,1),'degrees'\n",
+ "print 'The energy density in dielectric 1 is',round(We1*10**6,0),'J/m^3'\n",
+ "print 'The energy density in dielectric 2 is',round(We2*10**6,0),'J/m^3'\n",
+ "print 'The energy within the cube is',round(W*1000,3),'mJ'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electric field for the region z <=0 is [ 5 -2 4] kV/m\n",
+ "The angle E1 makes with the boundary is 29.1 degrees\n",
+ "The angle E2 makes with the boundary is 36.6 degrees\n",
+ "The energy density in dielectric 1 is 672.0 J/m^3\n",
+ "The energy density in dielectric 2 is 597.0 J/m^3\n",
+ "The energy within the cube is 4.775 mJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.10, Page number: 190<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Region y <= 0 consists of a perfect conductor while region y >= 0 \n",
+ "is a dielectric medium (epsilon_1r = 2). If there is a surface charge\n",
+ "of 2 nC/m^2 on the conductor, determine E and D at \n",
+ "(a) A(3, -2,2) \n",
+ "(b) B(-4, 1,5) '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "e=(10**-9)/(36*scipy.pi) #Permittivity of free space in Farad/m\n",
+ "er=2 #Relative permittivity (dimensionless)\n",
+ "ps=2 #Surface charge in nC/m^2\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "#Point A is in the region y <=0. Hence E=D=0\n",
+ "#For point B which is in the region y >=0,\n",
+ "\n",
+ "Dn=ps #Displacement current in nC/m^2\n",
+ "En=Dn*10**-9/(e*er) #Electric Field\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'E at point A= 0'\n",
+ "print 'D at point A= 0'\n",
+ "print 'E at point B=',round(En,2),'V/m along positive y direction'\n",
+ "print 'D at point B=',Dn,'nC/m^2 along positive y direction'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "E at point A= 0\n",
+ "D at point A= 0\n",
+ "E at point B= 113.1 V/m along positive y direction\n",
+ "D at point B= 2 nC/m^2 along positive y direction\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_6.ipynb b/Elements_of_Electromagnetics/chapter_6.ipynb
new file mode 100644
index 00000000..21f353b6
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_6.ipynb
@@ -0,0 +1,80 @@
+{
+ "metadata": {
+ "name": "chapter_6.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 6: Electrostatic Boundary Value Problems<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.12, Page number: 238<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the capacitance of each of the capacitors in Figure 6.20.\n",
+ "Take epsilon_r1 = 4, epsilon_r2 = 6, d = 5 mm, S = 30 cm^2 '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "e0=10**-9/(36*scipy.pi) #Permittivity of free space in Farad/m\n",
+ "er1=4 #Relative permittivity of material 1 (dimensionless)\n",
+ "er2=6 #Relative permittivity of material 2 (dimensionless)\n",
+ "d=5*10** -3 #The spacing between the capacitor plates in m\n",
+ "S=30*10** -4 #The surface area of the plates\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "#Calculation for Capacitor 1\n",
+ "\n",
+ "C1=e0*er1*S*2/d #Capacitance in Farads\n",
+ "C2=e0*er2*S*2/d #Capacitance in Farads\n",
+ "Ca=C1*C2/(C1+C2) #Total capacitance in Farads\n",
+ "\n",
+ "#Calculation for Capacitor 2\n",
+ "\n",
+ "C1= e0*er1*S/(2*d) #Capacitance in Farads\n",
+ "C2= e0*er2*S/(2*d) #Capacitance in Farads\n",
+ "Cb= C1+C2 #Total capacitance in Farads\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'The capacitance of capacitor 1 =',round(Ca*10**12,2),'pF'\n",
+ "print 'The capacitance of capacitor 2 =',round(Cb*10**12,2),'pF'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The capacitance of capacitor 1 = 25.46 pF\n",
+ "The capacitance of capacitor 2 = 26.53 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_7.ipynb b/Elements_of_Electromagnetics/chapter_7.ipynb
new file mode 100644
index 00000000..0c96dd8d
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_7.ipynb
@@ -0,0 +1,224 @@
+{
+ "metadata": {
+ "name": "chapter_7.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 7: Magnetostatic Fields<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.1, Page number: 266<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The conducting triangular loop in Figure 7.6(a) carries a current of lOA.\n",
+ "Find H at (0, 0, 5) due to side 1 of the loop. '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "p=5 #Distance from side 1 of loop to (0,0,5) in m\n",
+ "l=2 #Length of the side in m\n",
+ "I=10 #Current through loop in A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a1=scipy.arccos(l/(scipy.sqrt(l**2+p**2))) #Angle in radians\n",
+ "a2=scipy.pi/2 #Angle in radians\n",
+ "H=I*(scipy.cos(a1)-scipy.cos(a2))/(4*scipy.pi*p) #Field Intensity in A/m\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'H=',round(H*1000,1),'mA/m in the negative y direction'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H= 59.1 mA/m in the negative y direction\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.2, Page number: 268<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ " Find H at (-3, 4, 0) due to the current filament shown in Figure 7.7 (a). '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "a1=scipy.arccos(0)\n",
+ "a2=scipy.arccos(1)\n",
+ "b1=scipy.arccos(0.6)\n",
+ "b2=scipy.arccos(1)\n",
+ "p1=5\n",
+ "p2=4\n",
+ "I1=3 #current in A\n",
+ "I2=3 #current in A\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Hz=I1/(4*scipy.pi*p1)*(cos(a2)-cos(a1))*array([0.8,0.6,0])\n",
+ "Hx=I2/(4*scipy.pi*p2)*(cos(b2)-cos(b1))*array([0,0,1])\n",
+ "Hzcyl=-I1/(4*scipy.pi*p1)*array([0,1,0])\n",
+ "Hzx=round(dot(Hz,ax),4)\n",
+ "Hzy=round(dot(Hz,ay),5)\n",
+ "Hxz=round(dot(Hx,az),5)\n",
+ "Hxr=array([0,0,Hxz])\n",
+ "Hzr=array([Hzx,Hzy,0])\n",
+ "Hzcyly=round(dot(Hzcyl,ay),5)\n",
+ "Hzcylr=array([0,Hzcyly,0])\n",
+ "Hcart=(Hxr+Hzr)*10**3 #H in cartesian coordinates in mA \n",
+ "Hcyl=(Hxr+Hzcylr)*10**3 #H in cylindrical coordinates in mA\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'H at (-3, 4, 0) in cartesian coordnates =',Hcart,'mA/m'\n",
+ "print 'H at (-3, 4, 0) in cylindrical coordnates =',Hcyl,'mA/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H at (-3, 4, 0) in cartesian coordnates = [ 38.2 28.65 23.87] mA/m\n",
+ "H at (-3, 4, 0) in cylindrical coordnates = [ 0. -47.75 23.87] mA/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.5, Page number: 279<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Planes z=0 and z=4 carry current K=-10a_x A/m and K=10a_x A/m, respectively. \n",
+ "Determine H at \n",
+ "(a) (1,1,1) \n",
+ "(b) (0,-3,10) '''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "i0=-10 #current through plane z=0 in A/m\n",
+ "i4=10 #current through plane z=4 in A/m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "H0a=0.5*i0*-1 #H in positive Y direction in A/m\n",
+ "H4a=0.5*i4*-1*-1 #H in positive Y direction in A/m\n",
+ "Ha=H0a+H4a #H at (1,1,1) in A/m \n",
+ "H0b=0.5*i0*-1 #H in positive Y direction in A/m\n",
+ "H4b=0.5*i4*-1 #H in negative Y direction in A/m\n",
+ "Hb=H0b+H4b #H at (0,-3,10) in A/m\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'H at (1,1,1) =',Ha,'A/m'\n",
+ "print 'H at (0,-3,10) =',Hb,'A/m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H at (1,1,1) = 10.0 A/m\n",
+ "H at (0,-3,10) = 0.0 A/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.7, Page number: 287<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given the magnetic vector potential A=-p^2/4 a_z Wb/m, calculate \n",
+ "the total magnetic flux crossing the surface phi=pi/2, 1 <= p <= 2 m,\n",
+ "0 <= Z <= 5 m. '''\n",
+ "\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def B(z,p): \n",
+ " return 0.5*p\n",
+ "psy, err = scipy.integrate.dblquad(lambda p , z: B(z,p), \n",
+ " 0, 5, lambda p: 1, lambda p: 2)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'Total magnetic flux crossing the surface phi=pi/2 is',psy,'Wb'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total magnetic flux crossing the surface phi=pi/2 is 3.75 Wb\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_8.ipynb b/Elements_of_Electromagnetics/chapter_8.ipynb
new file mode 100644
index 00000000..e9adf8d2
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_8.ipynb
@@ -0,0 +1,454 @@
+{
+ "metadata": {
+ "name": "chapter_8.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 8: Magnetic Forces, Materials and Devices<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.1, Page number: 308<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A charged particle of mass 2 kg and charge 3 C starts at point (1,-2,0)\n",
+ "with velocity 4a_x+3a_z m/s in an electric field 12a_x+10a_y V/m.\n",
+ "At time t=1s, determine \n",
+ "(a) The acceleration of the particle \n",
+ "(b) Its velocity \n",
+ "(c) Its kinetic energy \n",
+ "(d) Its position '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "m=2 #mass in kg\n",
+ "q=3 #charge in C\n",
+ "v=array([4,0,3]) #initial velocity in m/s\n",
+ "E=array([12,10,0]) #electric field in V/m\n",
+ "t=1 #time in sec\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "a=q*E/m #acceleration in m/s^2 after 1 sec\n",
+ "u=array([18*t+4,15*t,3]) #velocity in m/s after 1 sec\n",
+ "modofu=scipy.sqrt(dot(u,u))\n",
+ "KE=0.5*m*(modofu)**2 #kinetic energy in J at t=1 sec\n",
+ "s=array([9*t**2+4*t+1,7.5*t**2-2,3*t]) #position after 1 sec in m\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'At time t=1 sec,'\n",
+ "print' The acceleration of the particle =',a,'m/s^2'\n",
+ "print 'Its velocity =',u,'m/s' \n",
+ "print 'Its kinetic energy =',KE,'J'\n",
+ "print 'Its position =',s,'m'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At time t=1 sec,\n",
+ " The acceleration of the particle = [18 15 0] m/s^2\n",
+ "Its velocity = [22 15 3] m/s\n",
+ "Its kinetic energy = 718.0 J\n",
+ "Its position = [ 14. 5.5 3. ] m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6, Page number: 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A small current loop L1 with magnetic moment 5a_z A/m^2 is located at the origin while \n",
+ "another small loop current I2 with magnetic moment 3a_y A/m^2 is located at (4, - 3, 10). \n",
+ "Determine the torque on L2 . '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ar=array([1,0,0]) #Unit vector along radial direction\n",
+ "ath=array([0,1,0]) #Unit vector along theta direction\n",
+ "aph=array([0,0,1]) #Unit vector along phi direction \n",
+ "x=4\n",
+ "y=-3\n",
+ "z=10\n",
+ "muo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "m1=5 #magnetic moment in A/m^2\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "r=scipy.sqrt(x**2+y**2+z**2)\n",
+ "p=scipy.sqrt(x**2+y**2)\n",
+ "sinphi=y/p\n",
+ "cosphi=x/p\n",
+ "sintheta=1/scipy.sqrt(5)\n",
+ "costheta=2/scipy.sqrt(5)\n",
+ "B1=muo*m1*(2*costheta*ar+sintheta*ath)/(4*scipy.pi*r**3)\n",
+ "m2=3*(sintheta*sinphi*ar+costheta*sinphi*ath+cosphi*aph)\n",
+ "T2=cross(m2,B1)*10**9\n",
+ "T2x=round(dot(T2,ar),3)\n",
+ "T2y=round(dot(T2,ath),3)\n",
+ "T2z=round(dot(T2,aph),3)\n",
+ "T2r=array([T2x,T2y,T2z]) #torque in nNm\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'Torque T2 =',T2r,'nNm'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Torque T2 = [-0.384 1.536 0.902]\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7, Page number: 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Region 0 < Z < 2 m is occupied by an infinite slab of permeable material (mur = 2.5). If \n",
+ "B = IOy ax - 5x ay mWb/m^2 within the slab, determine: (a) J, (b) Jb, (c) M, (d) Kb on \n",
+ "z=0 '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "muo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "mur=2 #relative permeability\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "J=(-5-10)*10**-6/(4*scipy.pi*10**-7*2.5) #in kA/m^2\n",
+ "Jb=1.5*J #in kA/m^2\n",
+ "MbyB=(1.5)*10**4/(4*scipy.pi*2.5) \n",
+ "Mv=MbyB*10*10**-3*ax+MbyB*5*10**-3*ay\n",
+ "Kb=cross(az,Mv)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'J =',round(J,3),'kA/m^2'\n",
+ "print 'Jb =',round(Jb,3),'kA/m^2'\n",
+ "print 'M =(',round(dot(Mv,ax),3),'y,',round(dot(Mv,ay),3),'x, 0) kA/m'\n",
+ "print 'Kb =(',round(dot(Kb,ax),3),'x,',round(dot(Kb,ay),3),'y, 0) kA/m' \n",
+ " \n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "J = -4.775 kA/m^2\n",
+ "Jb = -7.162 kA/m^2\n",
+ "M =( 4.775 y, 2.387 x, 0) kA/m\n",
+ "Kb =( -2.387 x, 4.775 y, 0) kA/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.8, Page number: 332<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Given that H=-2a_x + 6a_y + 4 a_z A/m in region y - x - 2 <= 0 where \n",
+ "mu_1=5mu_0 , calculate \n",
+ "(a) M_1 and B_1 \n",
+ "(b) H_2 and B_2 in region y - x - 2 >= 0 where mu_2=2mu_0 '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ax=array([1,0,0]) #Unit vector along x direction\n",
+ "ay=array([0,1,0]) #Unit vector along y direction\n",
+ "az=array([0,0,1]) #Unit vector along z direction \n",
+ "H1=array([-2,6,4]) #in A/m\n",
+ "mu0=4*scipy.pi*10**-7 #permeability of free space\n",
+ "mur1=5 #relative permeabililty in region 1\n",
+ "mur2=2 #relative permeabililty in region 2\n",
+ "an=array([-1,1,0])/scipy.sqrt(2)\n",
+ "\n",
+ "#Calculatios\n",
+ "\n",
+ "mu1=mu0*mur1\n",
+ "mu2=mu0*mur2\n",
+ "M1=(mur1-1)*H1 # magnetisation in region 1 in A/m\n",
+ "B1=mu1*H1*10**6 # field in micro Wb/m^2\n",
+ "B1x=round(dot(B1,ax),2) # x component of B1\n",
+ "B1y=round(dot(B1,ay),1) # y component of B1\n",
+ "B1z=round(dot(B1,az),2) # z component of B1\n",
+ "B1r=array([B1x,B1y,B1z]) # B1 rounded to 2 decimal places\n",
+ "H1n=dot(H1,an)*an \n",
+ "H1t=H1-H1n\n",
+ "H2t=H1t # using transverse boundary condition\n",
+ "H2n=(mu1/mu2)*H1n # using normal boundary condition\n",
+ "H2=H2t+H2n # in A/m\n",
+ "B2=mu2*H2*10**6 # field in micro Wb/m^2\n",
+ "B2x=round(dot(B2,ax),2) # x component of B2\n",
+ "B2y=round(dot(B2,ay),2) # y component of B2\n",
+ "B2z=round(dot(B2,az),2) # z component of B2\n",
+ "B2r=array([B2x,B2y,B2z]) # B2 rounded to 2 decimal places\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'M1= ',M1,'A/m'\n",
+ "print 'B1= ',B1r,'micro Wb/m^2'\n",
+ "print 'H2= ',H2,'A/m'\n",
+ "print 'B2= ',B2r,'micro Wb/m^2'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M1= [-8 24 16] A/m\n",
+ "B1= [-12.57 37.7 25.13] micro Wb/m^2\n",
+ "H2= [ -8. 12. 4.] A/m\n",
+ "B2= [-20.11 30.16 10.05] micro Wb/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.14, Page number: 350<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The toroidal core of Figure 8.26(a) has p_o = 10 cm and a circular cross \n",
+ "section with a = 1 cm. If the core is made of steel (mu = 1000mu_o) and \n",
+ "has a coil with 200 turns. calculate the amount of current that will\n",
+ "produce a flux of 0.5 mWb in the core. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "p=10*10**-2 #in m\n",
+ "a=1*10**-2 #in m\n",
+ "Ur=1000 #relative permeability\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "n=200 #number of turns\n",
+ "phi=0.5*10**-3 #flux in the core in Wb\n",
+ "U=Uo*Ur #permeability of steel core\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "I=phi*2*scipy.pi*p/(U*n*scipy.pi*a*a) #current in A\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The current that will produce a flux of 0.5 mWb =',round(I,3),'A'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current that will produce a flux of 0.5 mWb = 3.979 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.15, Page number: 351<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "In the magnetic circuit of Figure 8.27, calculate the current in the coil \n",
+ "that will produce a magnetic flux density of 1.5 Wb/m^2 in the air gap\n",
+ "assuming that mu_1 = 50 mu_o and that all branches have the same\n",
+ "cross-sectional area of 10 cm^2 . '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "Ur=50 #relative permeability of coil\n",
+ "l1=30*10**-2\n",
+ "s=10*10**-4 \n",
+ "l3=9*10**-2\n",
+ "la=1*10**-2 \n",
+ "B=1.5 #flux density in Wb/m^2\n",
+ "N=400 #number of turns\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "R1=l1/(Uo*Ur*s)\n",
+ "R2=R1\n",
+ "R3=l3/(Uo*Ur*s)\n",
+ "Ra=la/(Uo*s)\n",
+ "R=R1*R2/(R1+R2)\n",
+ "Req=R3+Ra+R\n",
+ "I=B*s*Req/N #current in A\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The current required =',round(I,3),'A'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current required = 44.165 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.16, Page number: 353<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A U-shaped electromagnet shown in Figure 8.29 is designed to lift a \n",
+ "400-kg mass (which includes the mass of the keeper). The iron\n",
+ "yoke (mu_r = 3000) has a cross section of 40 cm^2 and mean length of 50 cm,\n",
+ "and the air gaps are each 0.1 mm long. Neglecting the reluctance of \n",
+ "the keeper, calculate the number of turns in the coil when\n",
+ "the excitation current is 1 A. '''\n",
+ "\n",
+ "import scipy\n",
+ "from numpy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "m=400 #mass in kg\n",
+ "g=9.8 #acceleration due to gravity in m/s^2\n",
+ "Ur=3000 #relative permeability of the iron yoke\n",
+ "Uo=4*scipy.pi*10**-7 #permeability of free space\n",
+ "S=40*10**-4 #cross sectional area of iron yoke in m^2\n",
+ "la=1*10**-4 #air gaps in m\n",
+ "li=50*10**-2 #mean length of yoke in m\n",
+ "I=1 #excitation current in A \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "B=scipy.sqrt(m*g*Uo/S) #field in Wb/m^2\n",
+ "Ra=2*la/(Uo*S) \n",
+ "Ri=li/(Uo*Ur*S) \n",
+ "N=(Ra+Ri)/(Ra*Uo)*B*la #number of turns\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'The nmber of turns in the coil when the excitation current is 1 A ='\n",
+ "print round(N,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nmber of turns in the coil when the excitation current is 1 A =\n",
+ "162.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/chapter_9.ipynb b/Elements_of_Electromagnetics/chapter_9.ipynb
new file mode 100644
index 00000000..02dee160
--- /dev/null
+++ b/Elements_of_Electromagnetics/chapter_9.ipynb
@@ -0,0 +1,200 @@
+{
+ "metadata": {
+ "name": "chapter_9.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 9: Maxwells Equations<h1>"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page number: 375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A conducting bar can slide freely over two conducting rails as shown in Figure 9_6. Calcu- \n",
+ "late the induced voltage in the bar \n",
+ "(a) If the bar is stationed at y = 8 cm and B = 4 cos(10^6t) az mWb/m^2 \n",
+ "(b) If the bar slides at a velocity u = 20ay m/s and B = 4az. m Wb/m 2 \n",
+ "(c) If the bar slides at a velocity u = 20ay m/s and B = 4cos(10^6t - y) az\u001f mWb/m^2 '''\n",
+ "\n",
+ "import scipy\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "u2=20\n",
+ "B2=4\n",
+ "l=0.06\n",
+ "#Calculations\n",
+ "\n",
+ "def ansa(x,y): \n",
+ " return 4*10**3\n",
+ "Va, erra = scipy.integrate.dblquad(lambda y , x: ansa(x,y), #in V \n",
+ " 0, 0.06, lambda y: 0, lambda y: 0.08)\n",
+ "\n",
+ "Vb=-u2*B2*l #in mV\n",
+ "\n",
+ "def ansc(x,y): \n",
+ " return 4\n",
+ "psic, errc = scipy.integrate.dblquad(lambda y , x: ansc(x,y), #in mWb \n",
+ " 0, 0.06, lambda y: 0, lambda y: 1)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Va =',Va,'sin(10^6t) V'\n",
+ "print 'Vb =',Vb,'mV'\n",
+ "print 'Vc= ',psic*10**3,'cos(10^6t-y) -',psic*10**3,'cos(10^6t) V'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Va = 19.2 sin(10^6t) V\n",
+ "Vb = -4.8 mV\n",
+ "Vc= 240.0 cos(10^6t-y) - 240.0 cos(10^6t) V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3, Page number: 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The magnetic circuit of Figure 9.8 has a uniform cross section of 10^-3 m^2 . If the circuit is \n",
+ "energized by a current I1(t) = 3 sin(100pit) A in the coil of N1 = 200 turns, find the emf \n",
+ "induced in the coil of N2 = 100 turns. Assume that mu = 500 muo '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n1=200\n",
+ "n2=100 \n",
+ "S=10**-3 #cross section in m^2\n",
+ "muo=4*scipy.pi*10**-7 #permeabiility of free space\n",
+ "mur=500 #relative permeability\n",
+ "r=10*10**-3 #radius in m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "psiI=n1*muo*mur*S/(2*scipy.pi*r)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'V2 =',psiI*n2*300*scipy.pi,'cos(100pi t) V'\n",
+ "print '= 6Pi cos(100pi t) V'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V2 = 188.495559215 cos(100pi t) V\n",
+ "= 6Pi cos(100pi t) V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.5, Page number: 393<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Evaluate the complex numbers \n",
+ " \n",
+ "(a) Zl=(j(3-j4)*)/(-I+j6)(2+j)^2 \n",
+ "(b) Z2=((1+j)/(4-j8))^1/2 '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "z3=1j\n",
+ "z4=3+4j \n",
+ "z5=-1+6j \n",
+ "z6=3+4j\n",
+ "z7=1+1j\n",
+ "z8=4-8j\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "z1=(z3*z4/(z5*z6))\n",
+ "z2=scipy.sqrt(z7/z8)\n",
+ "z1r=round(z1.real,4) #real part of z1 rounded to 4 decimal places\n",
+ "z1i=round(z1.imag,4) #imaginary part of z1 rounded to 4 decimal places\n",
+ "z2r=round(z2.real,4) #real part of z2 rounded to 4 decimal places\n",
+ "z2i=round(z2.imag,4) #imaginary part of z2 rounded to 4 decimal places\n",
+ "\n",
+ "absz2=round(abs(z2),4) #absolute value of z2 rounded to 4 decimal places\n",
+ "\n",
+ "ang=scipy.arctan(z2i/z2r)*180/scipy.pi #in degrees\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'z1 =',z1r,'+',z1i,'j'\n",
+ "print 'z2 ='\n",
+ "print 'mod =',absz2,'and angle=',round(ang,1),'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z1 = 0.1622 + -0.027 j\n",
+ "z2 =\n",
+ "mod = 0.3976 and angle= 54.2 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Elements_of_Electromagnetics/screenshots/I(0,t)I(l,t).png b/Elements_of_Electromagnetics/screenshots/I(0,t)I(l,t).png
new file mode 100644
index 00000000..903afeb8
--- /dev/null
+++ b/Elements_of_Electromagnetics/screenshots/I(0,t)I(l,t).png
Binary files differ
diff --git a/Elements_of_Electromagnetics/screenshots/cospropogatingwave.png b/Elements_of_Electromagnetics/screenshots/cospropogatingwave.png
new file mode 100644
index 00000000..271a2fbc
--- /dev/null
+++ b/Elements_of_Electromagnetics/screenshots/cospropogatingwave.png
Binary files differ
diff --git a/Elements_of_Electromagnetics/screenshots/vectors.png b/Elements_of_Electromagnetics/screenshots/vectors.png
new file mode 100644
index 00000000..6fade91b
--- /dev/null
+++ b/Elements_of_Electromagnetics/screenshots/vectors.png
Binary files differ
diff --git a/Engineering_Heat_Transfer/CHAPTER1.ipynb b/Engineering_Heat_Transfer/CHAPTER1.ipynb
new file mode 100644
index 00000000..d020ad30
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER1.ipynb
@@ -0,0 +1,482 @@
+{
+ "metadata": {
+ "name": "CHAPTER1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1:Fundamental Concepts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page No.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of surface temperature on one side of a firewall\n",
+ "\n",
+ "#Given\n",
+ "k=9.4 # thermal conductivity in [BTU/hr.ft. \u02daRankine]\n",
+ "q=6.3 # heat flux in [BTU/s. sq.ft]\n",
+ "T1=350 # the outside surface temperature of one aide of the wall [\u02daF]\n",
+ "\n",
+ "#Calculation\n",
+ "# converting heat flux into BTU/hr sq.ft\n",
+ "Q=6.3*3600 # [BTU/hr.sq.ft]\n",
+ "dx=0.5 # thickness in [inch]\n",
+ "#converting distance into ft\n",
+ "Dx=0.5/12.0 # thickness in [ft]\n",
+ "# solving for temeprature T2\n",
+ "T2=T1-(Q*Dx/k) # [\u02daF]\n",
+ "\n",
+ "#Result\n",
+ "print\"The required temperature on the other side of the firewall is \",round(T2,1),\"F\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required temperature on the other side of the firewall is 249.5 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page No.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of thermal conductivity of aluminium\n",
+ "\n",
+ "#Given\n",
+ "k_ss=14.4 # thermal conductivity of stainless steel in [W/m.K]\n",
+ "dt_ss=40 # [K]\n",
+ "dt_al=8.65 # [K]\n",
+ "dz_ss=1 # [cm]\n",
+ "dz_al=3 # [cm]\n",
+ "\n",
+ "#calculation\n",
+ "k_al=k_ss*dt_ss*dz_al/(dt_al*dz_ss);# thermal conductivity of Al in [W/m.K]\n",
+ "\n",
+ "#result\n",
+ "print\"The thermal conductivity of aluminium is\",round(k_al,0),\"W/m.K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thermal conductivity of aluminium is 200.0 W/m.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page No.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat transferred by convection\n",
+ "\n",
+ "#Given\n",
+ "h_c=3 # convective coefficient in [BTU/hr.ft**2\n",
+ "A=30*18 # Cross sectional area in ft**2\n",
+ "T_w=140 # Roof surface temperature in degree Fahrenheit\n",
+ "T_inf=85 # Ambient temperature in degree Fahrenheit\n",
+ "\n",
+ "#Calculation\n",
+ "dT= (T_w-T_inf)\n",
+ "Q_c=h_c*A*dT # Convective heat transfer in BTU/hr\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transferred by convection is\",round(Q_c,2),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred by convection is 89100.0 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page No.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determining average film conductance\n",
+ "\n",
+ "#Given\n",
+ "D=0.0243 # diameter in meter\n",
+ "L=0.2 # length in meter\n",
+ "A=3.14*D*L # cross-sectional area in sq.m\n",
+ "cp=4200.0 # specific heat of water in J/kg.K\n",
+ "T_b2=21.4 # temperature of bulk fluid in degree celsius\n",
+ "T_in=20.0 # temperature of inlet water in degree celsius\n",
+ "T_w=75.0 # temperature of wall in degree celsius\n",
+ "Q=500.0 # volumetric flow rate in cc/s\n",
+ "density=1000 # density of water in kg/cu.m\n",
+ "\n",
+ "#calculation\n",
+ "m=Q*density/10**6 # mass flowa rate in kg/s\n",
+ "# using definition of specific heat and Newton's law of cooling\n",
+ "hc=m*cp*(T_b2-T_in)/(A*(T_w-T_in))\n",
+ "\n",
+ "#result\n",
+ "print\"The average film conductance is \",round(hc,0),\"W/sq.m. K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average film conductance is 3503.0 W/sq.m. K\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page No.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat loss rate by radiation\n",
+ "\n",
+ "#Given\n",
+ "W=14 # width in ft\n",
+ "L=30.0 # length in ft\n",
+ "A=W*L # area in ft**2\n",
+ "F_12=1 # view factor assumed to be 1\n",
+ "T1=120+460 # driveway surface temperature in degree Rankine\n",
+ "T2=0 # space temperature assumed to be 0 degree Rankine\n",
+ "\n",
+ "#Calculation\n",
+ "sigma=0.1714*10**(-8) # value of Stefan-Boltzmann's constant in BTU/(hr.ft**2.(degree Rankine)**4)\n",
+ "e=0.9 # surface emissivity\n",
+ "q=sigma*A*e*F_12*((T1)**4-(T2)**4);\n",
+ "\n",
+ "#result\n",
+ "print\"The heat loss rate by radiation is \",round(q,0),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat loss rate by radiation is 73319.0 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page No.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of radiation thermal conductance\n",
+ "\n",
+ "#Given\n",
+ "A=420.0 # area in sq.ft\n",
+ "T1=580.0 # driveway surface temperature in degree Rankine\n",
+ "T2=0 # surface temperature assumed to be 0 degree Rankine\n",
+ "Qr=73320 # heat loss rate in BTU/hr\n",
+ "\n",
+ "#calculation\n",
+ "hr=Qr/(A*(T1-T2)) # radiation thermal conductance in BTU/(hr.ft**2.(degree Rankine)\n",
+ "\n",
+ "#result\n",
+ "print\"the radiation thermal conductance is \",round(hr,2),\"BTU/(hr. sq.ft R)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the radiation thermal conductance is 0.3 BTU/(hr. sq.ft R)\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page No. 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Identification of all resistances and their values\n",
+ "# Estimation of heat transfer per unit area\n",
+ "# Determination of the inside and outside wall temperatures\n",
+ "\n",
+ "#Given\n",
+ "A=1.0 # assuming A=1 m**2 for convenience\n",
+ "hc1_avg=15.0 # taking average of extreme values for hc [W/m**2.K]\n",
+ "k=(0.38+0.52)/2.0 # thermal conductivity of common brick in W/M.k\n",
+ "L=0.1 #10 cm converted into m\n",
+ "Rk=(L/(k*A)) # resistance of construction material, assume common brick\n",
+ "\n",
+ "#calcultion\n",
+ "T_inf1=1000.0 # temperature of exhaust gases in K\n",
+ "T_inf2=283.0 # temperature of ambient air in K\n",
+ "Rcl=1/(hc1_avg*A) # resistance on left side of wall [K/W]\n",
+ "Rc2=Rcl \n",
+ "q=(T_inf1-T_inf2)/(Rcl+Rk+Rc2) # heat transferred per unit area\n",
+ "T_in=T_inf1-Rcl*q #inlet temprature \n",
+ "T_out=T_inf2+Rc2*q\n",
+ "\n",
+ "#result\n",
+ "print\"(b)\"\n",
+ "print\"The resistance on left side of wall is \",round(Rcl,2),\"K/W\"\n",
+ "print\"The resistance of construction material of wall is\",round(Rk,2),\"K/W\"\n",
+ "print\"The resistance on right side of wall is \",round(Rc2,2),\"K/W\"\n",
+ "print\"(c)The Heat transferred per unit area is \",round(q/1000,2),\"kw\"\n",
+ "print \"(d)\"\n",
+ "print\"The inside wall temperature is \",round(T_in,0),\"K\"\n",
+ "print\"The outside wall temperature is\",round(T_out,1),\"K\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "x1=[5,5]\n",
+ "T1=[0,1000]\n",
+ "\n",
+ "x2=[8,8]\n",
+ "T2=[0,1000]\n",
+ "\n",
+ "x3=[1,4]\n",
+ "T3=[1000,1000]\n",
+ "\n",
+ "x4=[4,5]\n",
+ "T4=[1000,866]\n",
+ "\n",
+ "x5=[5,8]\n",
+ "T5=[866,417]\n",
+ "\n",
+ "x6=[8,9]\n",
+ "T6=[417,290]\n",
+ "\n",
+ "x7=[9,10]\n",
+ "T7=[290,283]\n",
+ "\n",
+ "xlabel(\"x\") \n",
+ "ylabel(\"T (K)\") \n",
+ "plt.xlim((0,11))\n",
+ "plt.ylim((0,1200))\n",
+ "\n",
+ "ax.plot([1], [1000], 'o')\n",
+ "ax.annotate('(1000K)', xy=(1,1020))\n",
+ "\n",
+ "ax.plot([5], [866], 'o')\n",
+ "ax.annotate('(T1)', xy=(5.5,866))\n",
+ "\n",
+ "ax.plot([8], [417], 'o')\n",
+ "ax.annotate('(T2)', xy=(7.5,417))\n",
+ "ax.plot([10], [283], 'o')\n",
+ "ax.annotate('(283K)', xy=(10.5,283))\n",
+ "\n",
+ "\n",
+ "\n",
+ "a1=plot(x1,T1)\n",
+ "a2=plot(x2,T2)\n",
+ "a3=plot(x3,T3)\n",
+ "a4=plot(x4,T4)\n",
+ "a5=plot(x5,T5)\n",
+ "a6=plot(x6,T6)\n",
+ "a7=plot(x7,T7)\n",
+ "show(a1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)\n",
+ "The resistance on left side of wall is 0.07 K/W\n",
+ "The resistance of construction material of wall is 0.22 K/W\n",
+ "The resistance on right side of wall is 0.07 K/W\n",
+ "(c)The Heat transferred per unit area is 2.02 kw\n",
+ "(d)\n",
+ "The inside wall temperature is 866.0 K\n",
+ "The outside wall temperature is 417.4 K\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEICAYAAABiXeIWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVXXixvHPRTDLpUgEFExMILwuSO4lijqAoaKZkaCC\nYlONbVbT4kyNOjMpTvOrXHJmalxIHdFqwjUiM9QWt3CmFEsymAFEUgkVNxTO7w/qjqaYC+celuf9\nevkKzj33nOeY3IfvWW2GYRiIiIhUMxerA4iISN2kghEREVOoYERExBQqGBERMYUKRkRETKGCERER\nU5hWMImJiXh5edGpUyfHtKeffpr27dsTHBzMiBEjOHLkiOO1GTNmEBAQQFBQEOnp6Y7pn3/+OZ06\ndSIgIIDHH3/crLgiIlLNTCuY8ePHk5aWdt60iIgIdu/ezb///W8CAwOZMWMGAFlZWSxfvpysrCzS\n0tKYOHEiP16e86tf/Yr58+eTnZ1Ndnb2BcsUEZGaybSCCQ0Nxd3d/bxp4eHhuLhUrrJnz57k5+cD\nsHLlSmJjY3Fzc8PPzw9/f3+2bt1KYWEhx44do0ePHgDEx8eTmppqVmQREalGlh2DWbBgAVFRUQDs\n378fX19fx2u+vr4UFBRcMN3Hx4eCggKnZxURkSvnasVKX3zxRRo2bEhcXFy1LdNms1XbskRE6hOz\n7hjm9BHMokWLWLduHUuXLnVM8/HxIS8vz/F9fn4+vr6++Pj4OHaj/Tjdx8enymUbhlGv/kyZMsXy\nDNpmba+2uXZvs5mcWjBpaWm89NJLrFy5kkaNGjmmR0dHk5KSQllZGTk5OWRnZ9OjRw+8vb1p1qwZ\nW7duxTAMFi9ezPDhw50ZWURErpJpu8hiY2PZuHEjhw4donXr1kybNo0ZM2ZQVlZGeHg4AL1792be\nvHnY7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V79+4FYP369XTo0MHiVOYKCgpiy5YtnDx5EsMwWL9+PXa73epYThEdHU1ycjIAycnJdecX\nR6OWW7dunREYGGi0a9fOmD59utVxTLd582bDZrMZwcHBRpcuXYwuXboY7733ntWxnCYjI8MYOnSo\n1TGc4l//+pfRrVs3o3Pnzsbdd99tlJSUWB3JdDNnzjTsdrvRsWNHIz4+3igrK7M6UrUbNWqU0bJl\nS8PNzc3w9fU1FixYYBw+fNgYOHCgERAQYISHhxvff/+91TGrRa24F5mIiNQ+tXoXmYiI1FwqGBER\nMYUKRkRETKGCERERU6hgREyyfft2goODOX36NMePH6djx45kZWVZHUvEaXQWmYiJXnjhBU6dOsXJ\nkydp3bo1zz77rNWRRJxGBSNiojNnztCtWzeuv/56PvvsszpzCxCRy6FdZCImOnToEMePH6e0tJST\nJ09aHUfEqTSCETFRdHQ0cXFxfPvttxQWFjJnzhyrI4k4Ta14ZLJIbfTmm29y3XXXMWrUKCoqKrjj\njjvIyMggLCzM6mgiTqERjIiImELHYERExBQqGBERMYUKRkRETKGCERERU6hgRETEFCoYERExxf8D\nkIhbnvzxNPAAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page No.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of surface temperature\n",
+ "\n",
+ "#Given\n",
+ "k=0.604 # [BTU/(hr.ft.degree Rankine)]\n",
+ "hc=3.0 # average value for natural convection in BTU/(hr.ft**2.degree Rankine)\n",
+ "ew=0.93 \n",
+ "f_wr=1.0 # shape factor\n",
+ "sigma= 0.1714*10**(-8) # BTU/(hr.ft**2.degree Rankine).\n",
+ "L=4/12.0 # length in ft\n",
+ "T1=80+460 # temperature of side-walk in degree Rankine\n",
+ "T_inf=20+460 # temperature of ambient air in degree Rankine\n",
+ "T_r=0 # assuming space temperature to be 0 degree Rankine\n",
+ "\n",
+ "#Calculation\n",
+ "# LHS of the form a*Tw+b*Tw**4=c\n",
+ "a=((k/L)+hc) #Coefficient of Tw in the equation\n",
+ "b=(sigma*ew*f_wr) #Coefficient of Tw**4 in the equation\n",
+ "c=(k*T1/L)+(hc*T_inf)+(sigma*f_wr*ew*T_r**4) #right hans side of the equation\n",
+ "#Soving by try and error\n",
+ "Tw1=470 #assumed first value of temprature\n",
+ "LHS1=a*Tw1+b*Tw1**4\n",
+ "Tw2=480 #assumed 2nd value of temprature\n",
+ "LHS2=a*Tw2+b*Tw2**4\n",
+ "Tw3=490 #assumed 3rd value of temprature\n",
+ "LHS3=a*Tw3+b*Tw3**4\n",
+ "Tw4=485 #assumed 4th value of temprature\n",
+ "LHS4=a*Tw4+b*Tw4**4\n",
+ "Tw5=484.5 #assumed fifth value of temprature\n",
+ "LHS5=a*Tw5+b*Tw5**4\n",
+ "\n",
+ "#result\n",
+ "print\"RHS\",round(c,1)\n",
+ "print\"LHS at surface Temprature 1=\",round(LHS1,1)\n",
+ "print\"LHS at surface Temprature 2=\",round(LHS2,1)\n",
+ "print\"LHS at surface Temprature 3=\",round(LHS3,0)\n",
+ "print\"LHS at surface Temprature 4=\",round(LHS4,1)\n",
+ "print\"LHS at surface Temprature 5=\",round(LHS5,1)\n",
+ "print\"\\nLHS is close enough to RHS at Temprature 484.5. So Surface Temprature is\",Tw5,\"R\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RHS 2418.5\n",
+ "LHS at surface Temprature 1= 2339.4\n",
+ "LHS at surface Temprature 2= 2394.4\n",
+ "LHS at surface Temprature 3= 2450.0\n",
+ "LHS at surface Temprature 4= 2422.0\n",
+ "LHS at surface Temprature 5= 2419.2\n",
+ "\n",
+ "LHS is close enough to RHS at Temprature 484.5. So Surface Temprature is 484.5 R\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER10.ipynb b/Engineering_Heat_Transfer/CHAPTER10.ipynb
new file mode 100644
index 00000000..f7b3f4b6
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER10.ipynb
@@ -0,0 +1,239 @@
+{
+ "metadata": {
+ "name": "CHAPTER10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10: Condensation and Vaporization Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.1 Page NO.527"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the heat-transfer rate and the amount of steam condensed\n",
+ "\n",
+ "#Given\n",
+ "# properties of engine oil at (328 + 325)/2 = 326.5 degree F = 320\u00b0F from appendix table C11\n",
+ "rou_f=0.909*62.4 # density in lbm/ft**3 \n",
+ "cp=1.037 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_f=0.204e-5 # viscosity in ft**2/s \n",
+ "kf=0.393 # thermal conductivity in BTU/(lbm.ft.degree Rankine) \n",
+ "a=6.70e-3 # diffusivity in ft**2/hr \n",
+ "Pr=1.099 # Prandtl Number \n",
+ "V_v=4.937 # specific volume in ft**3/lbm from superheated steam tables\n",
+ "rou_v=1/V_v # vapour density\n",
+ "g=32.2\n",
+ "hfg=888.8 # from saturated steam tables\n",
+ "Tg=327.81\n",
+ "Tw=325\n",
+ "L=2.0 # length in ft\n",
+ "W=3.0 # width in ft\n",
+ "z=0.204*10**-5 # distance from entry of plate in ft\n",
+ "\n",
+ "#Calculation\n",
+ "# film thickness is given as follows\n",
+ "y=((4*kf*v_f*(Tg-Tw)/3600.0)/(rou_f*g*hfg*(1-(rou_v/rou_f))))**(1/4.0) #let y=delta/z**(1/4)\n",
+ "hz=1665 #From Table 10.1\n",
+ "hL=(4/3.0)*hz # at plate end\n",
+ "mf=(hL*L*W*(Tg-Tw))/hfg\n",
+ "q=mf*hfg\n",
+ "Re=(4*mf/3600)/(W*rou_f*v_f)\n",
+ "\n",
+ "#Result\n",
+ "print\"The amount of steam condensed is \",round(mf,1),\"lbm/h\"\n",
+ "print\"The heat transfer rate is \",round(q,0),\"BTU/hr\"\n",
+ "\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "x1=[0.0017,0.0018,0.0023,0.0030,0.0035]\n",
+ "z1=[2,1.6,0.6,0.3,0.1]\n",
+ "\n",
+ "x2=[0.0023,0.0022,0.0017,0.0011,0.0006,0]\n",
+ "z2=[2,1.6,0.6,0.3,0.1,0]\n",
+ "\n",
+ "xlabel(\"d (m)\") \n",
+ "ylabel(\"z (m)\") \n",
+ "plt.xlim((0,0.004))\n",
+ "plt.ylim((2,0))\n",
+ "\n",
+ "ax.annotate('(infinity)', xy=(0.0035,0.1))\n",
+ "ax.annotate('(hl=2220)', xy=(0.0005,1.7))\n",
+ "a1=plot(x1,z1)\n",
+ "a1=plot(x2,z2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of steam condensed is 42.1 lbm/h\n",
+ "The heat transfer rate is 37429.0 BTU/hr\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEMCAYAAAA8vjqRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAI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tIUWecXX3whevbsKaKiokRMTIzYtm2b\nrHV++eWXwt/fXzRv3lz4+vqKe+65x/ycko6ntTo3btzo0PGUosagoCBx++23W7w0U0nH0lqdjh5L\nqeocP368CA8PF0ajUYwbN06YTCbzc0o6ntbqVNr/67V17dq1zqW69hxPyZoEiYhIu7iSIBER2Y3h\nQUREdmN4EBGR3RgeRERkN4YHkQVJSUlYtmxZo9tt27YNSUlJdr32kCFDbGoSI1IyhgeRBbZ29y5b\ntgyJiYl2vfbkyZPx/vvvO1IWkWIwPIj+sGjRIoSEhGDAgAE4depUo9vn5+ejrKzMfO+yhIQEPPro\no+jbty8CAwORnp6OGTNmICwsDDNnzjTvFx8fj08//VSyn4PIFSS/PQmRGhw6dAgbNmzA0aNHUV5e\njpiYGPTq1avBff71r3/VucWEwWDAtWvXsG/fPmzZsgXx8fHYt28fwsLCcOedd+Lo0aMwGo3w9fXF\n5cuXcePGDbRo0ULqH41IEhx5EAH4/vvvMW7cODRv3hw+Pj6Ij49v9IZzeXl56NixY53HxowZAwAI\nDw9Hhw4d0LNnTxgMBvTs2RO5ubnm7Xx9fevcR4hIbRgeRKgeNdQOC1tvvHDzdjU3wHNzc4OXl5f5\ncTc3N1RUVNTZz9Z5FSIlYngQARg4cCA2bdqE33//HcXFxdi2bVujH+5dunTBpUuXHHo/k8nU6J2C\niZSM4UEEIDo6GpMmTYLRaMTIkSPRu3fvRvfp168fDh8+XOex2oFzc/jUfH/p0iXcdtttnO8gVeON\nEYma4O6778a6devqzX00ZNWqVbhx44Z5sSAiNeLIg6gJnn32Wbz33nt27bNhwwY89NBDElVE5Boc\neRARkd048iAiIrsxPIiIyG4MDyIishvDg4iI7MbwICIiuzE8iIjIbv8PNfE+DP2EsOkAAAAASUVO\nRK5CYII=\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page NO.532"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of both the heat that the cooling fluid must remove and the condensation rate. \n",
+ "\n",
+ "#Given\n",
+ "# properties of water at (100 + 60)/2 = 80\u00b0C from appendix table C11\n",
+ "rou_f=974.0 # density in kg/m**3 \n",
+ "cp_1=4196.0 # specific heat in J/(kg*K) \n",
+ "v_1=0.364e-6 # viscosity in m**2/s \n",
+ "Pr_1=2.22 # Prandtl Number \n",
+ "kf=0.668 # thermal conductivity in W/(m.K)\n",
+ "a_1=1.636e-7 # diffusivity in m**2/s \n",
+ "Vv=1.9364 # specific volume in m**3/kg\n",
+ "rou_v=1/Vv # vapor density\n",
+ "g=9.81\n",
+ "hfg=2257.06*1000 \n",
+ "Tg=100\n",
+ "Tw=60\n",
+ "L=1\n",
+ "\n",
+ "#Calculation\n",
+ "# specifications of 1 nominal schedule 40 pipe from appendix F1\n",
+ "OD=0.03340\n",
+ "hD=0.782*((g*rou_f*(1-(rou_v/rou_f))*(kf**3)*hfg)/(v_1*OD*(Tg-Tw)))**(1/4.0)\n",
+ "hD=10720 #According to the book\n",
+ "import math\n",
+ "q=hD*math.pi*OD*L*(Tg-Tw)\n",
+ "mf=q/hfg\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat flow rate is \",round(q,0),\"W\"\n",
+ "print\"The rate at which steam condenses is \",round(mf*3600,0),\"kg/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat flow rate is 44994.0 W\n",
+ "The rate at which steam condenses is 72.0 kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page NO. 538"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of (a) the power input to the water for boiling to occur, (b) the evaporation rate of water, and (c) the critical heat flux.\n",
+ "\n",
+ "#Given\n",
+ "# properties of water at 100\u00b0C = 373 K from appendix table 10.3\n",
+ "rou_f=958 # density in kg/m**3\n",
+ "cp_f= 4217 # specific heat in J/(kg*K) \n",
+ "v_f= 2.91e-7 # viscosity in m**2/s \n",
+ "Pr_f =1.76 # Prandtl Number \n",
+ "rou_g=0.596 \n",
+ "sigma=0.0589 # surface tension in N/m\n",
+ "hfg=2257000 \n",
+ "Tw=120.0\n",
+ "Tg=100.0\n",
+ "D=.141 # diameter of pan in m\n",
+ "g=9.81\n",
+ "gc=1\n",
+ "\n",
+ "#calculation\n",
+ "# nucleate boiling regime\n",
+ "Cw=0.0132 # formechanically polished stainless steel from table 10.2\n",
+ "q_A=(rou_f*v_f*hfg)*((g*rou_f*(1-(rou_g/rou_f)))/(sigma*gc))**(0.5)*((cp_f*(Tw-Tg))/(Cw*hfg*Pr_f**1.7))**3\n",
+ "A=math.pi*D**2/4.0\n",
+ "p=q_A*A # power delivered to the water in W\n",
+ "mf=q/hfg # water evaporation rate\n",
+ "q_cr=0.18*hfg*(sigma*g*gc*rou_f*rou_g**2)**(0.25)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The power delivered to the water is kW\",round(q/1000,2),\"KW\"\n",
+ "print\"(b)The water evaporation rate is \",round(mf*3600,2),\"kg/h\"\n",
+ "print\"(c)The critical heat flux is \",round(q_cr,0),\"W/sq.m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The power delivered to the water is kW 4.98 KW\n",
+ "(b)The water evaporation rate is 7.94 kg/h\n",
+ "(c)The critical heat flux is 1521299.0 W/sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER11.ipynb b/Engineering_Heat_Transfer/CHAPTER11.ipynb
new file mode 100644
index 00000000..af58990e
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER11.ipynb
@@ -0,0 +1,332 @@
+{
+ "metadata": {
+ "name": "CHAPTER11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: Introduction to Radiation Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1 Page NO.554"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of the solid angle subtended by surfaces dA2 and dA3 with respect to dA1 (b) the intensity of emission from dA, in the direction of the other areas (c) the rate at which radiation emitted by dA, is intercepted by the other areas\n",
+ "\n",
+ "#Given\n",
+ "# solid angle is calculate using the equation dw=dA*cos(Beta)/r**2\n",
+ "# Beta is the angle between the surface normal of a receiver surface and the line connecting the two surfaces\n",
+ "# For area A2\n",
+ "# dimensions are 1X1 in, so\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "dA2=(1*1)/144.0\n",
+ "Beta1=40*math.pi/180.0\n",
+ "r=4\n",
+ "dw2_1=dA2*math.cos(Beta1)/r**2\n",
+ "dA3=dA2\n",
+ "Beta2=0\n",
+ "dw3_1=dA3*cos(Beta2)/r**2\n",
+ "\n",
+ "theta2=math.pi*50/180.0\n",
+ "theta3=math.pi*60/180.0\n",
+ "I_theta2=2000*(1-0.4*(sin(theta2))**2)\n",
+ "I_theta3=2000*(1-0.4*(sin(theta3))**2)\n",
+ "\n",
+ "dA1=1/144.0\n",
+ "dq1_2=I_theta2*dA1*math.cos(theta2)*dw2_1 #In book calculation mistake\n",
+ "dq1_3=I_theta3*dA1*math.cos(theta2)*dw3_1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The solid angle subtended by area dA2 with respect to dA1 is \",round(dw2_1,4),\"sr\"\n",
+ "print\" The solid angle subtended by area dA3 with respect to dA1 is \",round(dw3_1,4),\"sr\"\n",
+ "print\"(b) The intensity of radiation emitted from dA1 in the direction of dA2 is \",round(I_theta2,0),\"BTU/(hr.sq.ft.sr)\"\n",
+ "print\" The intensity of radiation emitted from dA1 in the direction of dA3 is\",round(I_theta3,0),\"BTU/(hr.sq.ft.sr)\"\n",
+ "print\"(c)The rate at which radiation emitted by dA1 is intercepted by dA2 is \",round(dq1_2,4),\"BTU/hr\"\n",
+ "print\" The rate at which radiation emitted by dA1 is intercepted by dA3 is \",round(dq1_3,4),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The solid angle subtended by area dA2 with respect to dA1 is 0.0003 sr\n",
+ " The solid angle subtended by area dA3 with respect to dA1 is 0.0004 sr\n",
+ "(b) The intensity of radiation emitted from dA1 in the direction of dA2 is 1531.0 BTU/(hr.sq.ft.sr)\n",
+ " The intensity of radiation emitted from dA1 in the direction of dA3 is 1400.0 BTU/(hr.sq.ft.sr)\n",
+ "(c)The rate at which radiation emitted by dA1 is intercepted by dA2 is 0.0023 BTU/hr\n",
+ " The rate at which radiation emitted by dA1 is intercepted by dA3 is 0.0027 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2 Page NO.557"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the value of the solid angle subtended by surfaces dA2 with respect to dA1 (b) the rate at which radiation emitted by dA1 is intercepted by dA2 (c) the irradiation associated with dA2\n",
+ "\n",
+ "#Given\n",
+ "# solid angle is calculate using the equation dw=dA*cos(Beta)/r**2\n",
+ "# The angle Beta is 0 because the surface normal of dA2 is directed at dA1\n",
+ "dA2=0.02*0.02\n",
+ "Beta=0\n",
+ "r=1\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "dw2_1=dA2*math.cos(Beta)/r**2\n",
+ "dA1=dA2\n",
+ "theta=math.pi*30/180.0\n",
+ "I_theta=1000# The intensity of radiation leaving dA1 in any direction is 1 000 W/(m**2.sr\n",
+ "dq1_2=I_theta*dA1*cos(theta)*dw2_1\n",
+ "# The irradiation associated with dA2 can be found by dividing the incident radiation by the receiver area\n",
+ "dQ1_2=dq1_2/dA2\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The solid angle subtended by area dA2 with respect to dA1 is \",round(dw2_1,4),\"sr\"\n",
+ "print\"(b)The rate at which radiation emitted by dA1 is intercepted by dA2 is\",round(dq1_2,5),\"W\"\n",
+ "print\"(c)The irradiation associated with dA2 is \",round(dQ1_2,3),\"W/sq.m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The solid angle subtended by area dA2 with respect to dA1 is 0.0004 sr\n",
+ "(b)The rate at which radiation emitted by dA1 is intercepted by dA2 is 0.00014 W\n",
+ "(c)The irradiation associated with dA2 is 0.346 W/sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.3 Page NO. 563"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# (a) Calculation of the emissivity of the hole.(b) the rate of radiant emission from the hole\n",
+ "\n",
+ "#Given\n",
+ "D=2.5/12.0 # diameter in ft\n",
+ "L=4.5/12.0 # length in ft\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=(2*math.pi*D**2/4)+(math.pi*D*L)\n",
+ "A_hole=math.pi*(1/(8.0*12.0))**2/4.0\n",
+ "f=A_hole/A # fraction of area removed\n",
+ "# for rolled and polished aluminum, that emissivity = 0.039 from appendix table E1\n",
+ "emissivity=0.039\n",
+ "emissivity_hole=emissivity/(emissivity+(1-emissivity)*f)\n",
+ "\n",
+ "sigma=0.1714e-8 # stefan Boltzmann constant in BTU/(hr~ft**2 degree R)\n",
+ "T=150+460 # temperature in degree R\n",
+ "qe=emissivity_hole*sigma*T**4\n",
+ "Qe=A_hole*qe\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The emissivity of the hole is %.4f\",round(emissivity_hole,4)\n",
+ "print\"(b)The heat lost by the hole is \",round(Qe,4),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The emissivity of the hole is %.4f 0.9933\n",
+ "(b)The heat lost by the hole is 0.0201 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.4 Page NO.568"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the percentage of total emitted energy that lies in the visible range. \n",
+ "\n",
+ "#Given\n",
+ "T=2800 #Temprature\n",
+ "lambda1=4e-7 #Wavelength\n",
+ "lambda2=7e-7\n",
+ "hT=lambda1*T\n",
+ "\n",
+ "#Calculation\n",
+ "lambdaT=lambda2*T\n",
+ "I1=0.0051 #Fraction of Total Radiation Emitted for lower Wavelength-Temperature Product from Table 11.1\n",
+ "I2=0.065 #Fraction of Total Radiation Emitted for upper Wavelength-Temperature Product from Table 11.1\n",
+ "dI=I2-I1\n",
+ "\n",
+ "#Result\n",
+ "print\"The percentage of total emitted energy that lies in the visible range is\",round(dI*100,0),\"percant\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of total emitted energy that lies in the visible range is 6.0 percant\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.5 Page NO. 570"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of the surface temperature of the sun and the emitted heat flux\n",
+ "\n",
+ "#Given\n",
+ "lambda_max=0.5e-6 # maximum wavelength in m\n",
+ "# From Wien\u2019s Displacement Law we can write lambda_max*T=2.898e-3 m.K\n",
+ "T=2.898e-3/lambda_max\n",
+ "# The heat flux is given by the Stefan-Boltzmann Equation as q=sigma*T**4\n",
+ "sigma=5.675e-8 # value of Stefan-Boltzmann constant in W/(m**2.K**4)\n",
+ "q=sigma*T**4\n",
+ "\n",
+ "#result\n",
+ "print\"The Surface Temperature of the Sun is \",round(T,2),\"K\"\n",
+ "print\"The heat flux emitted is \",round(q,0),\"W/sq.m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Surface Temperature of the Sun is 5796.0 K\n",
+ "The heat flux emitted is 64044136.0 W/sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.6 Page NO.575"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# (a) Calculation of the rate at which the sun\u2019s radiant energy is transmitted through the glass windshield. The interior of the car is considered to be a black body that radiates at 100\u00b0F. (b) Calculation of the rate at which radiant energy from the car interior is transmitted through the glass windshield. \n",
+ "\n",
+ "#Given\n",
+ "lambda1=300e-9 # lower limit of wavelength\n",
+ "lambda2=380e-9 # upper limit of wavelength\n",
+ "T=5800\n",
+ "lambda1_T=lambda1*T\n",
+ "lambda2_T=lambda2*T\n",
+ "I1=0.101 #Fraction of Total Radiation Emitted for lower Wavelength-Temperature Product from Table 11.1\n",
+ "I2=0.0334 #Fraction of Total Radiation Emitted for upper Wavelength-Temperature Product from Table 11.1\n",
+ "dI=abs(I2-I1)\n",
+ "t=dI*0.68 # transmissivity\n",
+ "q=1100 # radiation received by car in W/sq.m\n",
+ "q_in=t*q # energy transmitted from the sun through the glass\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Tb=311 # temperature of black body source in K\n",
+ "lambda1_Tb=lambda1*Tb\n",
+ "lambda2_Tb=lambda2*Tb\n",
+ "dI_b=0 # Table 11.1 gives negligibly small values of the corresponding integrals.\n",
+ "t_b=dI_b*0.68 # transmissivity\n",
+ "q_out=t_b*q\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The energy transmitted from the sun through the glass is \",round(q_in,1),\"W/sq.m\"\n",
+ "print\"(b)the rate at which radiant energy from the car interior is transmitted through the glass windshield is\",q_out,\"W/sq.m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The energy transmitted from the sun through the glass is 50.6 W/sq.m\n",
+ "(b)the rate at which radiant energy from the car interior is transmitted through the glass windshield is 0.0 W/sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER12.ipynb b/Engineering_Heat_Transfer/CHAPTER12.ipynb
new file mode 100644
index 00000000..1d32142c
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER12.ipynb
@@ -0,0 +1,342 @@
+{
+ "metadata": {
+ "name": "CHAPTER12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: Radient Heat Transfer between Surfaces"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page No 598"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat transferred by radiation from dA1 to A. \n",
+ "\n",
+ "#Given\n",
+ "# The view factor Fd1_2 can be calculated as Fd1_2=Fd1_3+Fd1_4+Fd1_5\n",
+ "# For Fd1_3\n",
+ "a_13=100.0\n",
+ "b_13=250.0\n",
+ "c_13=100.0\n",
+ "X_13=a_13/c_13\n",
+ "Y_13=b_13/c_13\n",
+ "Fd1_3=0.17 # value for Fd1_3 corresponding to above calculated values of a/c and b/c\n",
+ "# For Fd1_4\n",
+ "a_14=300\n",
+ "b_14=50\n",
+ "c_14=100\n",
+ "\n",
+ "#Calculation\n",
+ "X_14=a_14/c_14\n",
+ "Y_14=b_14/c_14\n",
+ "Fd1_4=0.11 #value for Fd1_4 corresponding to above calculated values of a/c and b/c\n",
+ "# For Fd1_5\n",
+ "a_15=100\n",
+ "b_15=50\n",
+ "c_15=100\n",
+ "X_15=a_15/c_15\n",
+ "Y_15=b_15/c_15\n",
+ "Fd1_5=0.09 #value for Fd1_3 corresponding to above calculated values of a/c and b/c\n",
+ "Fd1_2=Fd1_3+Fd1_4-Fd1_5\n",
+ "sigma=0.1714e-8 # Stefan-Boltzmann constant\n",
+ "T1=660\n",
+ "T2=560\n",
+ "q12_A1=sigma*Fd1_2*(T1**4-T2**4)\n",
+ "\n",
+ "#result\n",
+ "print\"The net heat transferred is \",round(q12_A1,1),\"BTU/(hr.sq.ft)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net heat transferred is 29.8 BTU/(hr.sq.ft)\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page No 601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat transferred to the conveyed parts for the conditions given\n",
+ "\n",
+ "#Given\n",
+ "import math\n",
+ "L1=1\n",
+ "angle=math.pi*45/180.0\n",
+ "L2=L1*math.sin(angle)\n",
+ "L3=L2\n",
+ "T1=303\n",
+ "T2=473\n",
+ "\n",
+ "#Calculation\n",
+ "sigma=5.67e-8 # Stefan-Boltzmann constant\n",
+ "q21_A2=sigma*(T2**4-T1**4)*((L1/L2)+1-(L3/L2))/2.0\n",
+ "q31_A3=sigma*(T2**4-T1**4)*((L1/L2)-1+(L3/L2))/2.0\n",
+ "\n",
+ "#result\n",
+ "print\"The heat transferred from A3 to A1 is \",round(q31_A3,0),\" W/sq.m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred from A3 to A1 is 1669.0 W/sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.5 Page No 605"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat exchanged between the two plates\n",
+ "\n",
+ "#Given\n",
+ "# The view factor can be found with the crossed-string method\n",
+ "# from figure 12.13(b)\n",
+ "ac=1\n",
+ "bd=1\n",
+ "ad=(9+1)**0.5\n",
+ "bc=ad\n",
+ "\n",
+ "#calculation\n",
+ "crossed_strings=ad+bc\n",
+ "uncrossed_strings=ac+bd\n",
+ "L1_F12=(1/2.0)*(crossed_strings-uncrossed_strings)\n",
+ "L1=3\n",
+ "F12=L1_F12/L1\n",
+ "sigma=5.67e-8 # Stefan-Boltzmann constant\n",
+ "T1=560\n",
+ "T2=460\n",
+ "q12_A1=sigma*(T1**4-T2**4)*F12\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transfer rate is \",round(q12_A1,0),\"W/sq m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer rate is 2189.0 W/sq m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.6 Page No 608"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat that must be supplied to each of the isothermal surfaces, and also the temperature of the insulated surface. \n",
+ "\n",
+ "#Given\n",
+ "# we can apply the equations as follows\n",
+ "# q1=sigma*A1*[(T1**4-T2**4)F12+(T1**4-T3**4)F13]..... (1)\n",
+ "# q2=sigma*A2*[(T2**4-T1**4)F21+(T2**4-T3**4)F23]..... (2)\n",
+ "# q3=sigma*A3*[(T3**4-T1**4)F31+(T3**4-T2**4)F32]..... (3)\n",
+ "# given data:\n",
+ "T1=1000.0\n",
+ "T3=500.0\n",
+ "q2=0\n",
+ "F12=1/2.0\n",
+ "F13=1/2.0\n",
+ "F21=1/2.0\n",
+ "F23=1/2.0\n",
+ "F31=1/2.0\n",
+ "F32=1/2.0\n",
+ "\n",
+ "#Calculation\n",
+ "T2=((T1**4+T3**4)/2.0)**(1/4.0) # using equation (2)\n",
+ "sigma=0.1714e-8 # Stefan-Boltzmann constant\n",
+ "q1_A1=sigma*((T1**4-T2**4)*F12+(T1**4-T3**4)*F13) # using equation (1)\n",
+ "q3_A3=sigma*((T3**4-T1**4)*F31+(T3**4-T2**4)*F32) # using equation (3)\n",
+ "\n",
+ "#result\n",
+ "print\"The temperature is \",round(T2,1),\"R\"\n",
+ "print\"The heat flux through area A1 is\",round(q1_A1,0),\"BTU/(hr.sq.ft)\"\n",
+ "print\"The heat flux through area A3 is\",round(q3_A3,0),\"BTU/(hr.sq.ft)\"\n",
+ "print\"In the book there is calculation mistake\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature is 853.7 R\n",
+ "The heat flux through area A1 is 1205.0 BTU/(hr.sq.ft)\n",
+ "The heat flux through area A3 is -1205.0 BTU/(hr.sq.ft)\n",
+ "In the book there is calculation mistake\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.7 Page No 613"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat lost by the oven through its top surface. \n",
+ "\n",
+ "#Given\n",
+ "# all energy leaving A1 is intercepted by A2 and vice versa\n",
+ "F12=1\n",
+ "F21=1\n",
+ "F11=0 # the surfaces are flat\n",
+ "F22=0\n",
+ "emissivity1=0.94 # for oxidized steel from appendix table E1\n",
+ "emissivity2=0.94\n",
+ "T1=533\n",
+ "T2=323\n",
+ "sigma=5.67e-8 # Stefan-Boltzmann constant\n",
+ "\n",
+ "#Calculation\n",
+ "q1=(sigma*(T1**4-T2**4))/((1/emissivity1)+(1/emissivity2)-1)\n",
+ "q2=-q1\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat lost through bottom surface is \",round(q1,1),\"W/sq m\"\n",
+ "print\"The heat lost through top surface is \",round(q2,1),\"W/sq m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat lost through bottom surface is 3510.7 W/sq m\n",
+ "The heat lost through top surface is -3510.7 W/sq m\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.8 Page No 616"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the net heat exchanged between the dish and the surroundings by radiation at the instant the dish is removed from the oven. Perform the calculations (a) if the dish and surroundings behave like black bodies, and again (b) if the dish has an emissivity of 0.82 and the surroundings have an emissivity of 0.93.\n",
+ "\n",
+ "#Given\n",
+ "D=1.0 # diameter in ft\n",
+ "L=6/12.0 # length in ft\n",
+ "\n",
+ "#Calculation\n",
+ "A=2*math.pi*D**2/4+math.pi*D*L\n",
+ "F12=1 # the view factor between the dish and the surroundings is unity\n",
+ "T1=810\n",
+ "T2=530\n",
+ "sigma=0.1714e-8 # Stefan-Boltzmann constant\n",
+ "q1=sigma*A*(T1**4-T2**4)*F12\n",
+ "\n",
+ "# For gray-surface behavior, we can apply the following Equation\n",
+ "# q1/(A1e1)-[F11*(q1/A1)*(1-e1)/e1+F12*(q2/A2)*(1-e2)/e2]=sigma*T1**4-(F11*sigma*T1**4+F12*sigma*T2**4)... equation (1)\n",
+ "F11=0\n",
+ "e1=0.82\n",
+ "e2=0.93\n",
+ "# putting q2/A2=0 in equation (1) as A2 tends to infinity\n",
+ "q1_=A*e1*(sigma*T1**4-F12*sigma*T2**4)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The heat exchanged between the dish and the surroundings is\",round(q1,0),\"BTU/hr\"\n",
+ "print\"(b)The heat exchanged between the dish and the surroundings for the second case is \",round(q1_,0),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The heat exchanged between the dish and the surroundings is 1893.0 BTU/hr\n",
+ "(b)The heat exchanged between the dish and the surroundings for the second case is 1552.0 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER2.ipynb b/Engineering_Heat_Transfer/CHAPTER2.ipynb
new file mode 100644
index 00000000..556700c2
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER2.ipynb
@@ -0,0 +1,713 @@
+{
+ "metadata": {
+ "name": "CHAPTER2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 2 :Steady state Conduction in one dimension"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page No.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determination of the heat flow through a composite wall\n",
+ "\n",
+ "#Given\n",
+ "T3=-10.00\t\t# temperature of inside wall in degree Fahrenheit\n",
+ "T0=70.0 \t \t# temperature of outside wall in degree Fahrenheit\n",
+ "dT=T0-T3 # overall temperature difference\n",
+ "# values of thermal conductivity in BTU/(hr.ft.degree Rankine) from appendix table B3\n",
+ "k1=0.38 # brick masonry\n",
+ "k2=0.02 # glass fibre\n",
+ "k3=0.063 # plywood\n",
+ "dx1=4/12.0 # thickness of brick layer in ft\n",
+ "dx2=3.5/12.0 # thickness of glass fibre layer in ft\n",
+ "dx3=0.5/12.0 # thickness of plywood layer in ft\n",
+ "A=1.0 # cross sectional area taken as 1 ft**2\n",
+ "\n",
+ "#Calculation\n",
+ "R1=dx1/(k1*A) # resistance of brick layer in (hr.degree Rankine)/BTU\n",
+ "R2=dx2/(k2*A) # resistance of glass fibre layer in (hr.degree Rankine)/BTU\n",
+ "R3=dx3/(k3*A) # resistance of plywood layer in (hr.degree Rankine)/BTU\n",
+ "qx=(T0-T3)/(R1+R2+R3) \n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance of brick layer is \",round(R1,3),\"(hr.degree Rankine)/BTU\"\n",
+ "print\"Resistance of glass fibre layer is \",round(R2,1),\"(hr.degree Rankine)/BTU\"\n",
+ "print\"Resistance of plywood layer is \",round(R3,3),\"(hr.degree Rankine)/BTU\"\n",
+ "print\"Heat transfer through the composite wall is \",round(qx,2),\"(hr.degree Rankine)/BTU\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance of brick layer is 0.877 (hr.degree Rankine)/BTU\n",
+ "Resistance of glass fibre layer is 14.6 (hr.degree Rankine)/BTU\n",
+ "Resistance of plywood layer is 0.661 (hr.degree Rankine)/BTU\n",
+ "Heat transfer through the composite wall is 4.96 (hr.degree Rankine)/BTU\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page No.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat transfer through composite wall for materials in parallel\n",
+ "\n",
+ "#Given\n",
+ "# values of thermal conductivities in W/(m.K) from appendix table B3\n",
+ "k1=0.45 # thermal conductivity of brick\n",
+ "k2a=0.15 # thermal conductivity of pine\n",
+ "k3=0.814 # thermal conductivity of plaster board\n",
+ "k2b=0.025 # thermal conductivity of air from appendix table D1\n",
+ "# Areas needed fpor evaluating heat transfer in sq.m\n",
+ "A1=0.41*3 # cross sectional area of brick layer \n",
+ "A2a=0.038*3 # cross sectional area of wall stud\n",
+ "A2b=(41-3.8)*0.01*3 # cross sectional area of air layer\n",
+ "A3=0.41*3 # cross sectional area of plastic layer \n",
+ "dx1=0.1 # thickness of brick layer in m\n",
+ "dx2=0.089 # thickness of wall stud and air layer in m\n",
+ "dx3=0.013 # thickness of plastic layer in m\n",
+ "\n",
+ "#Calculation\n",
+ "R1=dx1/(k1*A1) # Resistance of brick layer in K/W\n",
+ "R2=dx2/(k2a*A2a+k2b*A2b) # Resistance of wall stud and air layer in K/W\n",
+ "R3=dx3/(k3*A3) # Resistance of plastic layer in K/W\n",
+ "T1=25 # temperature of inside wall in degree celsius\n",
+ "T0=0 # temperature of outside wall in degree celsius\n",
+ "qx=(T1-T0)/(R1+R2+R3) # heat transfer through the composite wall in W\n",
+ "\n",
+ "#result\n",
+ "print\"Resistance of brick layer is \",round(R1,3),\"k/W\"\n",
+ "print\"Resistance of wall stud and air layer is \",round(R2,2),\"k/W\"\n",
+ "print\"Resistance of plastic layer is \",round(R3,3),\"k/W\"\n",
+ "print\"Heat transfer through the composite wall is\",round(qx,1),\"W\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance of brick layer is 0.181 k/W\n",
+ "Resistance of wall stud and air layer is 1.98 k/W\n",
+ "Resistance of plastic layer is 0.013 k/W\n",
+ "Heat transfer through the composite wall is 11.5 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page No. 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat transfer rate and overall heat transfer coefficient\n",
+ "\n",
+ "#Given\n",
+ "k1=24.8 # thermal conductivity of 1C steel in BTU/(hr.ft.degree Rankine)from appendix table B2 \n",
+ "k2=0.02 # thermal conductivity of styrofoam steel in BTU/(hr.ft.degree Rankine)\n",
+ "k3=0.09 # thermal conductivity of fibreglass in BTU/(hr.ft.degree Rankine)\n",
+ "hc1=0.79 # convection coefficient between the air and the vertical steel wall in BTU/(hr.ft**2.degree Rankine)\n",
+ "hc2=150.0 # the convection coefficient between the ice water and the fiberglass\n",
+ "A=1.0 # calculation based on per square foot\n",
+ "dx1=0.04/12.0 # thickness of steel in ft\n",
+ "dx2=0.75/12.0 # thickness of styrofoam in ft\n",
+ "dx3=0.25/12.0 # thickness of fiberglass in ft\n",
+ "\n",
+ "#Calculation \n",
+ "\n",
+ "# Resistances in (degree Fahrenheit.hr)/BTU\n",
+ "Rc1=1/(hc1*A) # Resistance from air to sheet metal\n",
+ "Rk1=dx1/(k1*A) # Resistance of steel layer\n",
+ "Rk2=dx2/(k2*A) # Resistance of styrofoam layer\n",
+ "Rk3=dx3/(k3*A) # Resistance of fiberglass layer\n",
+ "Rc2=1/(hc2*A) # Resistance from ice water to fiberglass\n",
+ "U=1/(Rc1+Rk1+Rk2+Rk3+Rc2) # overall heat transfer coefficient \n",
+ "T_inf1=90 # temperature of air in degree F\n",
+ "T_inf2=32 # temperature of mixture of ice and water in degree F\n",
+ "q=U*A*(T_inf1-T_inf2)\n",
+ "\n",
+ "#result\n",
+ "print\"Resistance from air to sheet metal: \",round(Rc1,3),\"degree F.hr/BTU\"\n",
+ "print\"Resistance of steel layer is \",round(Rk1,4),\"degree F.hr/BTU\"\n",
+ "print\"Resistance of styrofoam layer is \",round(Rk2,3),\"degree F.hr/BTU\"\n",
+ "print\"Resistance of fiberglass layer is \",round(Rk3,3),\"degree F.hr/BTU\"\n",
+ "print\"Resistance from ice water to fiberglass is \",round(Rc2,4),\"degree F.hr/BTU\"\n",
+ "print\"The overall heat transfer coefficient is \",round(U,3),\"BTU/hr ft**2\"\n",
+ "print\"The heat transfer rate is %.1f BTU/hr\",round(q,2),\"BTU/hr\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance from air to sheet metal: 1.266 degree F.hr/BTU\n",
+ "Resistance of steel layer is 0.0001 degree F.hr/BTU\n",
+ "Resistance of styrofoam layer is 3.125 degree F.hr/BTU\n",
+ "Resistance of fiberglass layer is 0.231 degree F.hr/BTU\n",
+ "Resistance from ice water to fiberglass is 0.0067 degree F.hr/BTU\n",
+ "The overall heat transfer coefficient is 0.216 BTU/hr ft**2\n",
+ "The heat transfer rate is %.1f BTU/hr 12.53 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page No 55."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of the heat transfer through the pipe wall per unit length of pipe.\n",
+ "\n",
+ "#given\n",
+ "k=14.4 # thermal conductivity of 304 stainless steel in W/(m.K) from appendix table B2\n",
+ "# dimensions of steel pipes in cm from appendix table F1\n",
+ "D2=32.39 #Diameter (cm)\n",
+ "D1=29.53\n",
+ "T1=40 #Temprature\n",
+ "T2=38\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Qr_per_length=(2*3.14*k)*(T1-T2)/math.log(D2/D1)#format(6)\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transfer through the pipe wall per unit length of pipe is \",round(Qr_per_length/1000,2),\"kw/m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer through the pipe wall per unit length of pipe is 1.96 kw/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page NO. 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of the heat gain per unit length\n",
+ "\n",
+ "#Given\n",
+ "k1=231 # thermal conductivity of copper in BTU/(hr.ft.degree Rankine)from appendix table B1 \n",
+ "k2=0.02 # thermal conductivity of insuLtion in BTU/(hr.ft.degree Rankine)\n",
+ "# Specifications of 1 standard type M copper tubing from appendix table F2 are as follows\n",
+ "D2=1.125/12 # outer diameter in ft\n",
+ "D1=0.08792 # inner diameter in ft\n",
+ "R2=D2/2 # outer radius\n",
+ "R1=D1/2 # inner radius\n",
+ "t=0.5/12 # wall thickness of insulation in ft\n",
+ "R3=R2+t\n",
+ "LRk1=(log(R2/R1))/(2*3.14*k1) # product of length and copper layer resistance\n",
+ "LRk2=(log(R3/R2))/(2*3.14*k2) # product of length and insulation layer resistance\n",
+ "T1=40 # temperature of inside wall of tubing in degree fahrenheit\n",
+ "T3=70 # temperature of surface temperature of insulation degree fahrenheit\n",
+ "q_per_L=(T1-T3)/(LRk1+LRk2) # heat transferred per unit length in BTU/(hr.ft)\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transferred per unit length is \",round(q_per_L,2),\" BTU/(hr.ft\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred per unit length is -5.92 BTU/(hr.ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page No 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the overall heat transfer coefficient\n",
+ "\n",
+ "#Given data\n",
+ "k12=24.8 # thermal conductivity of 1C steel in BTU/(hr.ft.degree Rankine)from appendix table B2 \n",
+ "k23=.023 # thermal conductivity of glass wool insulation in BTU/(hr.ft.degree Rankine)from appendix table B3 \n",
+ "# Specifications of 6 nominal, schedule 40 pipe (no schedule was specified, so the standard is assumed) from appendix table F1 are as follows\n",
+ "D2=6.625/12.0 # outer diameter in ft\n",
+ "D1=0.5054 # inner diameter in ft\n",
+ "t=2/12.0 # wall thickness of insulation in ft\n",
+ "D3=D2+t\n",
+ "hc1=12 # convection coefficient between the air and the pipe wall in BTU/(hr. sq.ft.degree Rankine).\n",
+ "hc2=1.5 # convection coefficient between the glass wool and the ambient air in BTU/(hr. sq.ft.degree Rankine).\n",
+ "\n",
+ "#calculation\n",
+ "U=1/((1/hc1)+(D1*log(D2/D1)/k12)+(D1*log(D3/D2)/k23)+(D1/(hc2*D3)))\n",
+ "\n",
+ "#Result\n",
+ "print\"Overall heat transfer coefficient is \",round(U,4),\" BTU/(hr.sq.ft. Fahrenheit)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall heat transfer coefficient is 0.1596 BTU/(hr.sq.ft. Fahrenheit)\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page NO.72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the thermal contact resistance\n",
+ "\n",
+ "#Given\n",
+ "k=14.4 # thermal conductivity of 304 stainless steel in W/(m.K)from appendix table B2 \n",
+ "T1=543.0 # temperature in K at point 1\n",
+ "T2=460.0 # temperature in K at point 2\n",
+ "dT=T1-T2 # temperature difference between point 1 and 2\n",
+ "dz12=0.035 # distance between thermocouple 1 and 2 in cm\n",
+ "\n",
+ "dz56=4.45 # distance between thermocouple 5 and 6 in cm\n",
+ "dz6i=3.81 # distance between thermocouple 6 and interface in cm\n",
+ "dz5i=dz56+dz6i # distance between thermocouple 5 and interface in cm\n",
+ "T5=374 # temperature in K at point 5\n",
+ "T6=366 # temperature in K at point 6\n",
+ "dzi7=2.45 # distance between thermocouple 7 and interface in cm\n",
+ "dz78=4.45 # distance between thermocouple 7 and 8 in cm\n",
+ "dzi8=dzi7+dz78 # distance between thermocouple 8 and interface in cm\n",
+ "T7=349 # temperature in K at point 7\n",
+ "T8=337 # temperature in K at point 8\n",
+ "\n",
+ "#Calculation\n",
+ "qz_per_A=k*dT/dz12 # heat flow calculated in W/m**2 calculated using Fourier's law\n",
+ "T_ial=T5-(dz5i*(T5-T6)/dz56) # temperature of aluminium interface in K\n",
+ "T_img=dzi8*(T7-T8)/dz78+T8 # temperature of magnesium interface in K\n",
+ "T_img_=355.8 #Approx value in the book\n",
+ "Rtc=(T_ial-T_img_)/(qz_per_A)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"The required thermal contact resistance is\",round(Rtc,7),\"K sq.m/W\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required thermal contact resistance is 9.81e-05 K sq.m/W\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page No. 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of temperature profile, heat transferred, efficiency, effectiveness.\n",
+ "\n",
+ "#Given\n",
+ "import math\n",
+ "k=24.8 # thermal conductivity of 1C steel in BTU/(hr.ft.degree Rankine)from appendix table B2\n",
+ "D=(5.0/16.0)/12.0 # diameter of the rod in ft\n",
+ "P=(math.pi*D) # Circumference of the rod in ft\n",
+ "#print\"The perimeter is %.4f ft\",P)\n",
+ "A=(math.pi/4)*D**2 # Cross sectional area of the rod in sq.ft\n",
+ "#print\"The Cross sectional area is %.6f sq.ft\",A)\n",
+ "hc=1.0 # assuming the convective heat transfer coefficient as 1 BTU/(hr. sq.ft. degree Rankine)\n",
+ "\n",
+ "#Calculation\n",
+ "m=math.sqrt(hc*P/(k*A))\n",
+ "#print\"The value of parameter m is: /ft\",m)\n",
+ "L=(9/2.0)/12.0 # length of rod in ft\n",
+ "# using the equation (T-T_inf)/(T_w-T_inf)=(cosh[m(L-z)])/(cosh(mL)) for temperature profile\n",
+ "T_inf=70.0\n",
+ "T_w=200.0\n",
+ "dT=T_w-T_inf\n",
+ "const=dT/math.cosh(m*L)\n",
+ "\n",
+ "#(b) the heat transferred can be calculated using the equation qz=k*A*m*(T_w-T_inf)*tanh(m*L)\n",
+ "qz=k*A*m*dT*tanh(m*L)\n",
+ "\n",
+ "#(c)\n",
+ "mL=m*L\n",
+ "efficiency=0.78 # from fig. 2.30\n",
+ "\n",
+ "#(d)\n",
+ "effectiveness=math.sqrt(k*P/(hc*A))*tanh(mL)\n",
+ "\n",
+ "\n",
+ "print\"(b)The heat transferred is \",round(qz,2),\"BTU/hr\"\n",
+ "print\"(c)The efficiency found from the graph in figure 2.30 is\",efficiency\n",
+ "print\"(d)The effectiveness is found to be\",round(effectiveness,1)\n",
+ "\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "mL1=[0,1,1.2,5]\n",
+ "n1=[0,0.2,0.25,0.25]\n",
+ "\n",
+ "mL2=[0,1,1.8,5]\n",
+ "n2=[0,0.35,0.5,0.5]\n",
+ "\n",
+ "mL3=[0,1,2,5]\n",
+ "n3=[0,0.75,1,1]\n",
+ "mL4=[0,1,2,5]\n",
+ "n4=[0,1.5,2,2]\n",
+ "\n",
+ "xlabel(\"mL\") \n",
+ "ylabel(\"n \") \n",
+ "plt.xlim((0,6))\n",
+ "plt.ylim((0,2.5))\n",
+ "\n",
+ "ax.annotate('(0.25)', xy=(5,0.25))\n",
+ "ax.annotate('(0.5)', xy=(5,0.5))\n",
+ "ax.annotate('(1)', xy=(5,1))\n",
+ "ax.annotate('(2)', xy=(5,2))\n",
+ "a1=plot(mL1,n1)\n",
+ "a2=plot(mL2,n2)\n",
+ "a3=plot(mL3,n3)\n",
+ "a4=plot(mL4,n4)\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "z1=[0,3,4.8]\n",
+ "T1=[200,165,158]\n",
+ "z2=[0,4.8]\n",
+ "T2=[140,140]\n",
+ "z3=[0,4.8]\n",
+ "T3=[130,130]\n",
+ "z4=[4.8,4.8]\n",
+ "T4=[140,130]\n",
+ "\n",
+ "xlabel(\"z (m)\") \n",
+ "ylabel(\"T (K)\") \n",
+ "plt.xlim((0,5.5))\n",
+ "plt.ylim((120,200))\n",
+ "\n",
+ "ax.annotate('(5/16 in)', xy=(4.85,135))\n",
+ "a1=plot(z1,T1)\n",
+ "a2=plot(z2,T2)\n",
+ "a3=plot(z3,T3)\n",
+ "a4=plot(z4,T4)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)The heat transferred is 3.13 BTU/hr\n",
+ "(c)The efficiency found from the graph in figure 2.30 is 0.78\n",
+ "(d)The effectiveness is found to be 45.2\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEKCAYAAAD+XoUoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlHX+N/D3IGghKFqKnBJTBhEUEZVyF8ESKxfEU24e\nVn6ewrN22ZPX9ttSy2jb2tzMw5VuiqaLtlqKinjISMMQE3rME4gPJAyIi0iKKYeZ7/MHMgsywAD3\nzD0z9/t1XVwXMDdzfybz7ZfPfO/PrRJCCBARkSLYyV0AERGZD0OfiEhBGPpERArC0CciUhCGPhGR\ngjD0iYgURLLQz8/Px4gRI+Dv74+AgACsXbu2wTEpKSno3LkzgoKCEBQUhNWrV0t1eiIiMoK9VE/k\n4OCANWvWYODAgSgvL0dwcDAiIiLg5+dX77iwsDAkJiZKdVoiImoByVb6PXr0wMCBAwEATk5O8PPz\nQ2FhYYPjeC0YEZF8TNLTz8vLQ2ZmJkJCQup9X6VS4fTp0wgMDMTo0aNx6dIlU5yeiIgaIyR29+5d\nERwcLL7++usGj925c0fcu3dPCCFEUlKS8PHxMfgcAPjBD37wgx+t+GiOpCv9qqoqTJgwAdOmTcPY\nsWMbPO7s7AxHR0cAwEsvvYSqqiqUlpYafC4hhM1+rFixQvYa+Nr4+vj6bO/DGJKFvhACs2bNQr9+\n/bB06VKDxxQXF+sLS09PhxACXbt2laoEIiJqhmS7d1JTU7Fjxw4MGDAAQUFBAIC4uDhcv34dABAb\nG4s9e/Zg48aNsLe3h6OjI3bt2iXV6YmIyAiShf7vf/976HS6Jo9ZsGABFixYINUprVZ4eLjcJZiM\nLb82gK/P2tn66zOGShjbCDIjlUpldH+KiIhqGJ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UahZzRS6R\nJenVq5f+UnZ/f3+MHDkSABAQEIC8vDwZKyNqG670iQzo0KGD/nM7Ozu0b99e/3l1dbVcZRG1GUOf\niEhBGPpEBjy6O6fu17Wfx8fHw8vLC15eXnjqqads7k5hZJs4cI2ISEG40iciUhCGPhGRgjD0iYgU\nhKFPRKQgDH0iIgVh6BMRKcj/B5PHmv5yTzR2AAAAAElFTkSuQmCC\n"
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEMCAYAAADEXsFmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1YVHX+//HncGNpWNmqaDOsKKAwikoh3vxEKdG+dkNq\nRo5ttqHValu51VZmmXQj3axtZdFWW3ZjiWnfxC0jbBU1+xrmvVFCiQWDWlqaN+UIzO+PgxO3KsnM\n4eb1uK65nHPmHOY9V13zmnPO5/05Frfb7UZERFo8P7MLEBGRxkGBICIigAJBREQqKBBERARQIIiI\nSAUFgoiIAF4MhKKiIi666CJ69uxJr169ePbZZwH48ccfGT58ON27d2fEiBHs37/fs09aWhoRERFE\nRkaSnZ3trdJERKQWFm/1IezevZvdu3fTt29fDh06xIUXXsjixYuZO3cu7du35+677+bxxx/np59+\n4rHHHiMvL4/x48ezbt06nE4niYmJ5Ofn4+engxgREV/w2rdtp06d6Nu3LwBBQUFERUXhdDpZsmQJ\n119/PQDXX389ixcvBiAzMxOHw0FgYCChoaGEh4eTm5vrrfJERKQan/z83rlzJxs3bqR///7s2bOH\n4OBgAIKDg9mzZw8AJSUl2Gw2zz42mw2n0+mL8kREBAjw9hscOnSIq666imeeeYa2bdtWec1isWCx\nWOrct7bXTrS9iIjU7WRXCLx6hHDs2DGuuuoqrrvuOkaNGgUYRwW7d+8GYNeuXXTs2BEAq9VKUVGR\nZ9/i4mKsVmutf7e42M1NN7lp395NWpqbw4fduN3N9/Hggw+aXoM+sz6vPnPT/synwmuB4Ha7mThx\nI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aNm\nk12nTi23dyInJ4ecnJx67VNnICxYsICvv/6ajIwMpk+fzrfffgtAly5dGDx4MHPmzDnpEURtSktL\n+emnn1i7di3r1q0jOTm5zusRdXVJVw4EEWk5/PyMprlu3WDUqN/WHzliDIE9HhRZWca/bnfNkOjZ\nE9q0Me8z+Er1H8upqakn3eeEI4XDw8MbfK4im83GmDFjAOjXrx9+fn7s3bsXq9VKUVGRZ7vi4mKs\nVmuDvreINE9t2kBsrPE4zu025nA6HhKrVsFzzxlNdyEhNXsnunXTRWyft46MGjWK5cuXM3ToUPLz\n83G5XLRv356kpCTGjx/PHXfcgdPppKCggLi4OF+XJyLNhMVinDLq1AkqD1g8dsy4t/Xxi9evvmo8\n37fPuIhdPShMGmFvCq8GgsPhYOXKlezbt4+QkBAeeughUlJSSElJITo6mlatWvHGG28AYLfbSU5O\nxm63ExAQQHp6ep2njEREfq/AQKP3wW6HceN+W79/f9UJADMyjH/PPrvl3MVON8gREanD8bvYVZ8A\ncOdO4y52d90F119vdpWnxvQ+BG9QIIiI2X75xbgZUVCQMeS1KTitQDh27JinV6AxUSCIiNTfqXx3\n1nlNvX///g1ekIiINF51BoJ+hYuItCx1jjL64YcfeOqpp2oNBovFwh133OHVwkRExLfqDISysjIO\nHjzoy1pERMREdV5UjomJMe02mSeii8oiIvV3WheVRUSkZanzCGHfvn384Q9/8HU9J6UjBBGR+lNj\nmoiIADplJCIi9aBAEBERQIEgIiIVFAgiIgIoEEREpIICQUREAAWCiIhUUCCIiAigQBARkQpeDYSU\nlBSCg4OJjo72rJs5cyY2m42YmBhiYmL48MMPPa+lpaURERFBZGQk2dnZ3ixNRESq8erUFatXryYo\nKIgJEyawdetWAFJTU2nbtm2N+ynk5eUxfvx41q1bh9PpJDExkfz8fPz8qmaWpq4QEak/06euiI+P\np127djXW11ZUZmYmDoeDwMBAQkNDCQ8PJzc315vliYhIJXXeIMeb5syZwxtvvEFsbCyzZ8/m3HPP\npaSkhAEDBni2sdlsOJ3OWvefOXOm53lC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\nu8os0I1FkwiEgIAAnnvuOS655BLsdjvXXHNNsx95AkYfx6BBg8jPzyckJIS5c+eaXZJXrVmzhnnz\n5rFixQpiYmKIiYmpMVtuc7Nr1y4uvvhi+vbtS//+/bniiisYNmyY2WX5VEs4Jbxnzx7i4+M9/50v\nv/xyRowYYXZZNTSJYaciIuJ9TeIIQUREvE+BICIigAJBREQqKBBERARQIIictmuuuYZvvvnmlLff\nsmULEydO9GJFIr+PAkHkNHz99dccPnyYsLCwU96nd+/efPPNN3z//fderEyk/hQIInV48cUXPf0Q\nXbt25eKLL66xTUZGRpUmyaCgIO6++2569erF8OHDWbt2LUOHDiUsLKzKFM8jR45k4cKFPvkcIqdK\ngSBSh5tvvpmNGzeybt06QkJCuPPOO2tss2bNGmJjYz3LR44cYdiwYWzbto22bdsyY8YMli9fznvv\nvceMGTM828XFxbFq1SqffA6RU2XKPZVFmpLbbruNYcOGcdlll9V47dtvv/XMUQPQqlUrLrnkEgCi\no6M588wz8ff3p1evXuzcudOzXefOnassizQGCgSRE3jttdcoKioiPT29zm0qN/sHBgZ6nvv5+dGq\nVSvP89LS0ir7tIQpG6RpUSCI1GH9+vXMnj37hNMUd+nShV27dnH++efX62/v2rWLLl26nG6JIg1K\n1xBE6vD888/z008/cdFFFxETE8NNN91UY5vBgwdXma66+q/+ysuVn+fm5jJkyBAvVC3y+2lyO5HT\nsGPHDm699VY++OCDeu2XkJDAO++8Q8eOHb1UmUj96QhB5DR069aNtm3b1rsxLTw8XGEgjY6OEERE\nBNARgoiIVFAgiIgIoEAQEZEKCgQREQEUCCIiUkGBICIiAPx/mp90HdOD0qoAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page No. 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat transferred\n",
+ "\n",
+ "#Given\n",
+ "k=136.0 # thermal conductivity of aluminium in BTU/(hr.ft.degree Rankine)from appendix table B1\n",
+ "L=9/(8*12.0) #length in ft\n",
+ "W=9/(4*12.0) #width in ft\n",
+ "delta=0.002604 #ft\n",
+ "hc=0.8 # the convective heat transfer coefficient estimated as 1 BTU/(hr.ft**2. degree Rankine)\n",
+ "T_w=1000.0 # the root temperature in degree fahrenheit\n",
+ "T_inf=90.0 # the ambient temperature in degree fahrenheit\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "m=math.sqrt(hc/(k*delta))\n",
+ "P=2*W\n",
+ "A=2*delta*W\n",
+ "qz1=math.sqrt(hc*P*k*A)*(T_w-T_inf)*(sinh(m*L)+(hc/(m*k)*cosh(m*L)))/(cosh(m*L)+(hc/(m*k)*sinh(m*L)))\n",
+ "qz2=math.sqrt(k*A*hc*P)*(T_w-T_inf)*math.tanh(m*L)\n",
+ "Lc=L+delta\n",
+ "qz3=k*A*m*(T_w-T_inf)*math.tanh(m*L*(1+delta/Lc))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The heat transferred is \",round(qz1,2),\"BTU/hr\"\n",
+ "print\"(b)The heat transferred is \",round(qz2,2),\"BTU/hr In the book the answer is incorrect\"\n",
+ "print\"(c)The heat transferred is \",round(qz3,2),\" BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The heat transferred is 26.12 BTU/hr\n",
+ "(b)The heat transferred is 25.43 BTU/hr In the book the answer is incorrect\n",
+ "(c)The heat transferred is 26.1 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10 Page No 94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of optimum fin length and heat transferred by fin\n",
+ "\n",
+ "#Given\n",
+ "k=8.32 # thermal conductivity BTU/(hr.ft.degree Rankine)\n",
+ "hc=400.0 # the convective heat transfer coefficient given in BTU/(hr.ft**2. degree Rankine)\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "delta_opt=0.55/(12*2)\n",
+ "# determination of dimension of one fin using the equation delta_opt=0.583*hc*Lc**2/k\n",
+ "Lc=math.sqrt(delta_opt*k/(0.583*hc))\n",
+ "\n",
+ "A=Lc*delta_opt\n",
+ "# determination of parameter for finding out efficiency from graph\n",
+ "parameter=Lc**1.5*math.sqrt(hc/(k*A))\n",
+ "efficiency=0.6\n",
+ "W=1/(2.0*12.0) # width in ft\n",
+ "T_w=190.0 # wall temperature in degree fahrenheit\n",
+ "T_inf=58.0 # ambient temperature in degree fahrenheit\n",
+ "L=1.0 # length in ft\n",
+ "delta=W/2.0 \n",
+ "q_ac=efficiency*hc*2*W*math.sqrt(L**2+delta**2)*(T_w-T_inf)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The optimum length is \",round(Lc*12,2),\"inch\"\n",
+ "print\"(b)The actual heat transferred is \",round(q_ac,2),\"BTU/hr. NOTE: In the book answer is incorrect\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The optimum length is 0.34 inch\n",
+ "(b)The actual heat transferred is 2640.57 BTU/hr. NOTE: In the book answer is incorrect\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11 Page No 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat transferred and fin effectiveness\n",
+ "\n",
+ "#Given\n",
+ "#parameters of the problem are\n",
+ "N=9 # number of fins\n",
+ "delta=0.003/2.0 \n",
+ "L=0.025\n",
+ "Lc=L+delta\n",
+ "R=0.219/2\n",
+ "R2c=R+delta\n",
+ "R1=R-L\n",
+ "T_w=260 # root wall temperature in degree celsius\n",
+ "T_inf=27 # ambient temperature in degree celsius\n",
+ "hc=15 \n",
+ "k=52 # thermal conductivity of cast iron in W/(m.K)from appendix table B2\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#(a)\n",
+ "Ap=2*delta*Lc\n",
+ "As=2*math.pi*(R2c**2-R1**2)\n",
+ "radius_ratio=R2c/R1 # for finding efficiency from figure 2.38\n",
+ "variable=Lc**1.5*math.sqrt(hc/(k*Ap))\n",
+ "efficiency=0.93 # efficiency from figure 2.38\n",
+ "qf=N*efficiency*As*hc*(T_w-T_inf)\n",
+ "Sp=0.0127 # fin spacing\n",
+ "Asw=2*math.pi*R1*Sp*N # exposed surface area\n",
+ "qw=hc*Asw*(T_w-T_inf)\n",
+ "q=qf+qw\n",
+ "\n",
+ "#(b)H=N*(Sp+2*delta) # height of cylinder\n",
+ "H=N*(Sp+2*delta)\n",
+ "Aso=2*math.pi*R1*H # surface area without fins\n",
+ "qo=hc*Aso*(T_w-T_inf)\n",
+ "\n",
+ "#(c)\n",
+ "effectiveness=q/qo # effectiveness defined as ratio of heat transferred with fins to heat transferred without fins\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The total heat transferred from the cylinder is \",round(q,0),\"W\"\n",
+ "print\"(b)The Heat transferred without fins is W\",round(qo,0),\"W\"\n",
+ "print\"(c)The fin effectiveness is \",round(effectiveness,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The total heat transferred from the cylinder is 1164.0 W\n",
+ "(b)The Heat transferred without fins is W 262.0 W\n",
+ "(c)The fin effectiveness is 4.44\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER4.ipynb b/Engineering_Heat_Transfer/CHAPTER4.ipynb
new file mode 100644
index 00000000..918045d0
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER4.ipynb
@@ -0,0 +1,607 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Unsteady State heat Conduction "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page No.190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of response time\n",
+ "\n",
+ "#Given\n",
+ "k=12.0 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "c=0.1 # specific heat in BTU/(lbm.degree Rankine) \n",
+ "D=0.025/12.0 # diameter in ft\n",
+ "density=525.0 # density in lbm/cu.ft\n",
+ "hc=80 # convective coefficient in BTU/(hr. sq.ft. degree Rankine)\n",
+ "T_i=65.0 # intial temperature in degree fahrenheit\n",
+ "T_inf=140.0 # fluid temperature in degree fahrenheit\n",
+ "As=3.14*D**2 # surface area in sq.ft\n",
+ "Vs=3.14*D**(0.5) # volume in cu.ft\n",
+ "\n",
+ "#calculation\n",
+ "#As/Vs=6/D\n",
+ "import math\n",
+ "reciprocal_timeconstant=(hc*6)/(density*D*c)\n",
+ "# selecting T=139 F as T=140 gives an infinite time through the equation (T-T_inf)/(T_i-T_inf)=exp(-hc*As/density*Vs*c)t\n",
+ "T=139\n",
+ "t=math.log((T-T_inf)/(T_i-T_inf))/(-reciprocal_timeconstant)\n",
+ "\n",
+ "#result\n",
+ "print\"The response time of the junction is %.1f s\",round(t*3600,2),\"s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The response time of the junction is %.1f s 3.54 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page No. 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of temperature of metal and cumulative heat rate\n",
+ "# properties of aluminium from appendix table B1\n",
+ "\n",
+ "#Given\n",
+ "k=236.0 # thermal conductivity in W/(m.K)\n",
+ "Cp=896.0 # specific heat in J/(kg.K)\n",
+ "sp_gr=2.702 # specific gravity\n",
+ "density=2702.0 # density in kg/cu.m\n",
+ "D=0.05 # Diameter in m\n",
+ "L=0.60 # length in m\n",
+ "hc=550.0 # unit surface conductance between the metal and the bath in W/(K.sq.m)\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Vs=(math.pi*D**2*L)/4.0 # Volume in cu.m\n",
+ "As=(2*math.pi*D**2/4.0)+(math.pi*D*L) # surface area in sq.m\n",
+ "import math\n",
+ "Bi=(hc*Vs)/(k*As) # Biot Number\n",
+ "# Biot number is less than 1 hence lump capacitance equations apply\n",
+ "T_i=50.0 # initial temperature in degree celsius\n",
+ "T_inf=2.0 # temperature of ice water bath in degree celsius\n",
+ "t=60.0 # time=1 minute=60 s\n",
+ "As_=0.102 #approx value taken in book for calculating T and Q\n",
+ "T=T_inf+(T_i-T_inf)*math.exp(-(hc*As_*t)/(density*Vs*Cp))\n",
+ "Q=density*Vs*Cp*(T_inf-T_i)*(1-math.exp(-(hc*As_*t)/(density*Vs*Cp)))\n",
+ "\n",
+ "#result\n",
+ "print\"(a)The temperature of aluminium is\",round(T,1),\"C\"\n",
+ "print\"(b)The cumulative heat transferred is \",round(-Q/1000,1),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The temperature of aluminium is 16.7 C\n",
+ "(b)The cumulative heat transferred is 94.8 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page No. 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the time required and temprature profile\n",
+ "\n",
+ "#Given\n",
+ "hc=30\n",
+ "L=0.24\n",
+ "k=1.25 #Conductivity\n",
+ "c=890\n",
+ "rou=550\n",
+ "Fo=0.4 #Fourier no\n",
+ "\n",
+ "#Calculation\n",
+ "Bi=hc*L/k\n",
+ "alpha=k/(rou*c)\n",
+ "Tc=150\n",
+ "T_inf=600\n",
+ "T_i=50\n",
+ "t=(L**2*Fo)/(alpha)\n",
+ "TC1=0.82 #Centreline temprature\n",
+ "#from table at x/l=0.4\n",
+ "T=0.71*(T_i-T_inf)*TC1\n",
+ "x=0.4*L\n",
+ "Ti=149\n",
+ "To=492\n",
+ "print\"Time required to reach temprature 150 is \",round(t/3600,2),\"hr\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required to reach temprature 150 is 2.51 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No. 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the time required\n",
+ "hc=6 #Surface Conductance\n",
+ "D=0.105 #Orange Diameter\n",
+ "k=0.431 #Thermal conductivity \n",
+ "c=2000 #Specific heat of orange\n",
+ "rou=998 #Density\n",
+ "Fo=1.05 #Fourier no.\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Vs=math.pi*D**3/6\n",
+ "As=math.pi*D**2\n",
+ "# calculating Biot Number for lumped capacitance approach\n",
+ "Bi=hc*Vs/(k*As)\n",
+ "Bi_=hc*(D/2)/(k)\n",
+ "alpha=k/(rou*c)\n",
+ "Tc=20\n",
+ "T_inf=23\n",
+ "T_i=4\n",
+ "t=(Fo*(D/2.0)**2)/alpha\n",
+ "a=Bi_**2*Fo\n",
+ "Q=0.7*rou*c*(math.pi/6.0*(Fo**3))*(T_i-T_inf)\n",
+ "\n",
+ "#Result\n",
+ "print\"The time required is \",round(t/3600,2),\"hr\"\n",
+ "print\"The heat transfered is\",round(Q/1000,2),\"kj\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time required is 3.72 hr\n",
+ "The heat transfered is -16090.84 kj\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page No.208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Estimate the depth of freeze line\n",
+ " \n",
+ "D=0.105 #diameter\n",
+ "k=0.3 #Thermal conductivity \n",
+ "c=0.41 #Specific heat \n",
+ "sp_gr=2.1 ##Specific gravity\n",
+ "rou_water=62.4 #Density\n",
+ "alpha=k/(sp_gr*rou_water*c)\n",
+ "t=3*30*24\n",
+ "\n",
+ "#Calculation\n",
+ "# Bi_math.sqrt(Fo) is infinite\n",
+ "T_inf=10\n",
+ "Ts=10\n",
+ "T=32\n",
+ "T_i=70\n",
+ "dimensionless_temp=(T-T_i)/(T_inf-T_i)\n",
+ "variable_fig4_12=0.38 #The value of x/(2*(alpha*t)**0.5) from figure 4.12\n",
+ "x=2*math.sqrt(alpha*t)*variable_fig4_12\n",
+ "\n",
+ "#result\n",
+ "print\"The depth of the freeze line in soil is ft\",round(x,2),\"ft\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The depth of the freeze line in soil is ft 2.64 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page No.211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties of aluminium from appendix table B1\n",
+ "\n",
+ "#Given\n",
+ "k_al=236\n",
+ "p_al=2.7*1000\n",
+ "c_al=896\n",
+ "# properties of oak from appendix table B3\n",
+ "k_oak=0.19\n",
+ "p_oak=0.705*1000\n",
+ "c_oak=2390\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "math.sqrt_kpc_al=math.sqrt(k_al*p_al*c_al)\n",
+ "kpc_R=4\n",
+ "T_Li=20\n",
+ "T_Ri=37.3\n",
+ "T_al=(T_Li*(math.sqrt_kpc_al)+T_Ri*math.sqrt(kpc_R))/(math.sqrt_kpc_al+math.sqrt(kpc_R))\n",
+ "math.sqrt_kpc_oak=math.sqrt(k_oak*p_oak*c_oak)\n",
+ "T_oak=(T_Li*(math.sqrt_kpc_oak)+T_Ri*math.sqrt(kpc_R))/(math.sqrt_kpc_oak+math.sqrt(kpc_R))\n",
+ "\n",
+ "#Result\n",
+ "print\"The temperature of aluminium is felt as \",round(T_al,2),\"C\"\n",
+ "print\"The temperature of oak is felt as %.1f degree celsius\",round(T_oak,1),\"C\"\n",
+ "print\"So oak will feel warmer to the touch than will the aluminium\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature of aluminium is felt as 20.0 C\n",
+ "The temperature of oak is felt as %.1f degree celsius 20.1 C\n",
+ "So oak will feel warmer to the touch than will the aluminium\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page No.215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# properties of water at 68 degree fahrenheit from appendix table C11\n",
+ "\n",
+ "#Given\n",
+ "# The given properties are\n",
+ "rou=62.46\n",
+ "cp=0.9988\n",
+ "k=0.345\n",
+ "alpha=k/(rou*cp)\n",
+ "D=2.5/12.0\n",
+ "L=4.75/12.0\n",
+ "\n",
+ "#Calculation\n",
+ "Vs=math.pi*D**2*L/4\n",
+ "As=(math.pi*D*L)+(math.pi*D**2)/2\n",
+ "Lc=Vs/As\n",
+ "hc=1.7\n",
+ "Bi=hc*Lc/k\n",
+ "t=4\n",
+ "\n",
+ "# for the cylinder solution\n",
+ "Fo_cylinder=alpha*t/(D/2)**2\n",
+ "Bi_cylinder=hc*(D/2)/k\n",
+ "reciprocal_Bi_cylinder=1/Bi_cylinder\n",
+ "dim_T_cylinder=0.175 #The value of dimensionless temperature of cylinder from figure 4.7a at corresponding values of Fo and 1/Bi\n",
+ "\n",
+ "# for the infinite plate solution\n",
+ "Fo_plate=alpha*t/(L/2)**2\n",
+ "Bi_plate=hc*L/(2*k)\n",
+ "reciprocal_Bi_plate=1/Bi_plate\n",
+ "dim_T_plate=0.55 #The value of dimensionless temperature of infinite plate from figure 4.7a at corresponding values of Fo and 1/Bi\n",
+ "\n",
+ "# For short cylinder problem\n",
+ "dim_T_shortcylinder=dim_T_cylinder*dim_T_plate\n",
+ "T_inf=30\n",
+ "T_i=72\n",
+ "Tc=dim_T_shortcylinder*(T_i-T_inf)+T_inf\n",
+ "dim_Tw_cylinder=0.77 #The dimensionless temperature from figure 4.7b corresponding to the value of 1/Bi and r/R=1\n",
+ "dim_Tw_plate=0.65 #The dimensionless temperature from figure 4.6b corresponding to the value of 1/Bi and x/L=1\n",
+ "dim_Tw_shortcylinder=dim_Tw_cylinder*dim_Tw_plate\n",
+ "Tw=dim_Tw_shortcylinder*(Tc-T_inf)+T_inf\n",
+ "\n",
+ "#Result\n",
+ "print\"The temperature at centre of can is %.1f degree celsius\",round(Tc,0),\"F\"\n",
+ "print\"The bear temperature near the metal of the can is\",round(Tw,0),\"F\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature at centre of can is %.1f degree celsius 34.0 F\n",
+ "The bear temperature near the metal of the can is 32.0 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page No. 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the time to reach centre temp. 50 C\n",
+ "\n",
+ "#Given Data\n",
+ "#The given properties are\n",
+ "rou=7817 #Density\n",
+ "c=461 #Specific heat \n",
+ "k=14.4 #Thermal conductivity \n",
+ "alpha=.387e-5\n",
+ "#The dimension are\n",
+ "L1=0.03\n",
+ "L2=0.03\n",
+ "L3=0.04\n",
+ "x=0.04\n",
+ "T_i=95 #Internal temprature \n",
+ "T_inf=17 #Temprature at infinity\n",
+ "\n",
+ "#Calculation\n",
+ "# for infinite plate\n",
+ "L=L1/2\n",
+ "hc=50\n",
+ "reciprocal_Bi_plate=k/(hc*L)\n",
+ "Tinf=0.085 #Temprature distribution for infinite plate\n",
+ "Tsi=0.225 #Temprature distribution for semi infinite plate\n",
+ "#Temprature at a depth of 4 cm\n",
+ "T=(Tinf**2)*(1-Tsi)*(T_i-T_inf)+T_inf\n",
+ "#From the table\n",
+ "t=350\n",
+ "\n",
+ "#Result\n",
+ "print\"At a time 3000s The temprature is \",round(T,1),\"C\"\n",
+ "print\"From the table The time requires to reach tempratue 50C is \",t,\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At a time 3000s The temprature is 17.4 C\n",
+ "From the table The time requires to reach tempratue 50C is 350 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page No.226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the time that will pass before the heat added\n",
+ "\n",
+ "#Given\n",
+ "rou=0.5*1000\n",
+ "cp=837\n",
+ "k=0.128\n",
+ "alpha=0.049e-5\n",
+ "Ti=20 #Initial temprature\n",
+ "# let Fo=0.5 and dx=0.05\n",
+ "dt=0.5*(0.05)**2/alpha\n",
+ "\n",
+ "#Calculation\n",
+ "#Temprature at 1<m<6 and p>0 till T6>20\n",
+ "p=0\n",
+ "T0=200\n",
+ "m=1\n",
+ "T11=(Ti+T0)/2.0\n",
+ "m=2\n",
+ "T21=(Ti+Ti)/2.0\n",
+ "m=3\n",
+ "T31=(Ti+Ti)/2.0\n",
+ "m=4\n",
+ "T41=(Ti+Ti)/2.0\n",
+ "m=5\n",
+ "T51=(Ti+Ti)/2.0\n",
+ "m=6\n",
+ "T61=(Ti+Ti)/2.0\n",
+ "\n",
+ "#For next time interval\n",
+ "p=1\n",
+ "m=1\n",
+ "T12=(Ti+T0)/2.0\n",
+ "m=2\n",
+ "T22=(Ti+T12)/2.0\n",
+ "m=3\n",
+ "T32=(Ti+T21)/2.0\n",
+ "m=4\n",
+ "T42=(Ti+T31)/2.0\n",
+ "m=5\n",
+ "T52=(Ti+T41)/2.0\n",
+ "m=6\n",
+ "T62=(Ti+T51)/2.0\n",
+ "#Repeating it\n",
+ "t=4.97\n",
+ "print\"The time that will pass before the heat added\",t,\"hr\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "x1=[0,30]\n",
+ "T1=[20,20]\n",
+ "\n",
+ "xlabel(\"x (cm)\") \n",
+ "ylabel(\"T (C)\") \n",
+ "plt.xlim((0,35))\n",
+ "plt.ylim((0,250))\n",
+ "\n",
+ "a1=plot(x1,T1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time that will pass before the heat added 4.97 hr\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEMCAYAAAAvaXplAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFh1JREFUeJzt3X9M1Pcdx/HXVyF0C2yytZzkzvSsQOQEuUsRXVIdTtA0\n206JjoqrIxOXxmV/GN1m66bDZVFc0iXKZtJstmPpIjXZRP4QwrLs1LpkRzvcL5ZqO6x4AimiiVAF\nCt/90Xgpfjj1lOPuyvORmBzfu+/x9nt6T+573+9h2bZtCwCAT5gV7wEAAImHOAAADMQBAGAgDgAA\nA3EAABiIAwDAELM4dHd3a+XKlVq0aJEKCgp0+PBhSVJtba1cLpd8Pp98Pp9aWlrC6xw4cEC5ubla\nuHCh2traYjUaAOA+rFid59Db26ve3l55vV4NDg7q6aefVlNTk44fP66MjAzt2LFjwu07Ozu1adMm\ntbe3KxQKqaysTBcuXNCsWby4AYDpFrNn3rlz58rr9UqS0tPTlZ+fr1AoJEmarEcnT55UVVWVUlNT\n5Xa7lZOTo2AwGKvxAAD3MC0/ll+6dEkdHR1atmyZJKm+vl5FRUWqqanRjRs3JElXr16Vy+UKr+Ny\nucIxAQBMr5RYf4PBwUFt2LBBhw4dUnp6urZt26a9e/dKkvbs2aOdO3fq6NGjk65rWdYDLQMA3F80\n7yLE9JXD6Oio1q9fr+eff17r1q2TJGVlZcmyLFmWpa1bt4Z3HTmdTnV3d4fXvXLlipxO56T3a9t2\n0v75yU9+EvcZZuLszB//P8wf3z/RilkcbNtWTU2NPB6Ptm/fHl7e09MTvnzixAkVFhZKkvx+vxob\nGzUyMqKuri5dvHhRJSUlsRoPAHAPMdutdO7cOb3++utavHixfD6fJGn//v06duyYzp8/L8uyNH/+\nfL3yyiuSJI/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z9RnSkN6bT0tIkffwpmXcu3/l6bGxswvqJ/CmfmHmIA3CXF154QT/72c+0adMm7dq1y7j+8ccf\n1+DgYPjr8vJyvfbaa+GQXL9+ParvNzw8rNmzZ0+IBxBvxAH4hN/97ndKS0vTxo0b9eKLL6q9vV2B\nQGDCbWbPnq2CggK98847kqQ1a9bI7/eruLhYPp9PL7/8snG/9/r8/46ODn3pS1+a8r8L8Cj44D3g\nIfz2t79VX1/fpK8sorV7924tWbJEFRUVUzAZMDWIA/AQRkZGVFZWptOnTz/SewXDw8MqLy9/5PsB\nphpxAAAYeM8BAGAgDgAAA3EAABiIAwDAQBwAAAbiAAAw/B+sQEsUoRrXsQAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10 Page No. 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of time required to cool to a certain temperature\n",
+ "\n",
+ "#Given\n",
+ "#The properties are\n",
+ "rou=7.817*62.4 #density\n",
+ "c=0.110\n",
+ "k=8.32\n",
+ "alpha=0.417e-4\n",
+ "dx=1/12.0\n",
+ "# taking Fo=1\n",
+ "Fo=1\n",
+ "\n",
+ "#Calculation\n",
+ "dt=Fo*dx**2/alpha\n",
+ "n=8 #Enter the number of time intervals from Saulev plot\n",
+ "time=n*dt\n",
+ "\n",
+ "#result\n",
+ "print\"The required time is hr\",round(time/3600,2),\"hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required time is hr 0.37 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER5.ipynb b/Engineering_Heat_Transfer/CHAPTER5.ipynb
new file mode 100644
index 00000000..9ab19382
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER5.ipynb
@@ -0,0 +1,126 @@
+{
+ "metadata": {
+ "name": "CHAPTER5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5 : Introduction to Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page NO. 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#How much heat must be added for the two cases.\n",
+ "\n",
+ "#Given\n",
+ "# properties of CO at 300K from appendix table D2\n",
+ "Cp=871\n",
+ "Gamma=1.3\n",
+ "\n",
+ "#calculation\n",
+ "Cv=Cp/Gamma\n",
+ "dT=20\n",
+ "m=5\n",
+ "Qp=m*Cp*dT\n",
+ "Qv=m*Cv*dT\n",
+ "\n",
+ "#Result\n",
+ "print\" The heat required at constant pressure is \",Qp/1000,\"kj\"\n",
+ "print\"The heat required at constant volume is \",Qv/1000,\"kj\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The heat required at constant pressure is 87 kj\n",
+ "The heat required at constant volume is 67.0 kj\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page NO.250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#verify the valve for Voluemetric thermal coefficient\n",
+ "\n",
+ "#Given\n",
+ "# properties of Freon-12 from appendix table C3\n",
+ "T1_Fr=-50\n",
+ "T2_Fr=-40\n",
+ "rou1_Fr=1.546*1000\n",
+ "rou2_Fr=1.518*1000\n",
+ "\n",
+ "#Calculation\n",
+ "beta_Fr=-(rou1_Fr-rou2_Fr)/(rou1_Fr*(T1_Fr-T2_Fr))\n",
+ "beta_acc_Fr=2.63e-3 # the accurate value of volumetric thermal expansion coefficient for Freon-12\n",
+ "error_Fr=(beta_acc_Fr-beta_Fr)*100/beta_acc_Fr\n",
+ "# properties of helium from appendix table D3\n",
+ "T1_He=366\n",
+ "T2_He=477\n",
+ "rou1_He=0.13280\n",
+ "rou2_He=0.10204\n",
+ "beta_He=-(rou1_He-rou2_He)/(rou1_He*(T1_He-T2_He))\n",
+ "\n",
+ "#REsult\n",
+ "print\"The volumetric thermal expansion coefficient calculated for Freon-12 is \",round(beta_Fr,6),\"1/K\"\n",
+ "print\"The error introduced in the case of Freon-12 is percent\",round(error_Fr,0),\"percent\"\n",
+ "print\"The volumetric thermal expansion coefficient calculated for Freon-12 is \",round(beta_He,6),\"1/K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volumetric thermal expansion coefficient calculated for Freon-12 is 0.001811 1/K\n",
+ "The error introduced in the case of Freon-12 is percent 31.0 percent\n",
+ "The volumetric thermal expansion coefficient calculated for Freon-12 is 0.002087 1/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER6.ipynb b/Engineering_Heat_Transfer/CHAPTER6.ipynb
new file mode 100644
index 00000000..f8b8ec9f
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER6.ipynb
@@ -0,0 +1,545 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Convection Heat Transfer in a Closed Circuit"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 page No.301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the fluid outlet tetnperature and the tube-wall temperature at the outlet.\n",
+ "\n",
+ "#Given\n",
+ "#properties of ethylene glycol at 20 degree celsius from appendix table C5\n",
+ "Cp_20=2382\n",
+ "rou_20=1.116*1000\n",
+ "v_20=19.18e-6\n",
+ "kf_20=0.249\n",
+ "a_20=0.939e-7\n",
+ "Pr_20=204.0\n",
+ "# specifications of 1/2 standard type M seamless copper water tubing from appendix table F2\n",
+ "OD=1.588/100.0\n",
+ "ID=1.446/100.0\n",
+ "A=1.642e-4\n",
+ "Q=3.25e-6\n",
+ "\n",
+ "#Calculation\n",
+ "V=Q/A\n",
+ "# calculation of Reynold's Number to check flow regime\n",
+ "Re=V*ID/v_20\n",
+ "# since Re>he 2100, the flow regime is laminar and the hydrodynamic length can be calculated as\n",
+ "Z_h=0.05*ID*Re\n",
+ "Tbi=20 # bulk-fluid inlet temperature in degree celsius\n",
+ "qw=2200 # incident heat flux in W/m**2\n",
+ "L=3 # Length of copper tube in m\n",
+ "R=ID/2 # inner radius in m\n",
+ "Tbo=Tbi+(2*qw*a_20*L)/(V*kf_20*R)\n",
+ "# This result is based on fluid properties evaluated at 20\u00b0C. taken as a first approximation\n",
+ "Z_t=0.05*ID*Re*Pr_20\n",
+ "Two=Tbo+(11*qw*ID)/(48*kf_20) # The wall temperature at outlet in degree celsius\n",
+ "\n",
+ "#Result\n",
+ "print\"The bulk-fluid outlet temperature is degree celsius\",round(Tbo,0),\"C\"\n",
+ "print\"The wall temperature at outlet is degree celsius\",round(Two,0),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The bulk-fluid outlet temperature is degree celsius 55.0 C\n",
+ "The wall temperature at outlet is degree celsius 84.0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 page No.308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of average convection coefficient\n",
+ "\n",
+ "#Given\n",
+ "T_avg=(140+70)/2.0\n",
+ "# properties of water at average bulk temperature from appendix table C11\n",
+ "rou=0.994*62.4\n",
+ "kf=0.363\n",
+ "cp=0.9980\n",
+ "a=5.86e-3\n",
+ "v=0.708e-5\n",
+ "Pr=4.34\n",
+ "# specifications of 1 standard type M copper tube from appendix table F2\n",
+ "OD=1.125/12.0 # outer diameter in ft\n",
+ "ID=0.8792 # inner diameter in ft\n",
+ "A=0.006071 # cross sectional area in sq.ft\n",
+ "m_flow=1.5 # mass flow rate in lbm/s\n",
+ "V=m_flow*3600.0/(rou*A); # velocity in ft/hr\n",
+ "import math\n",
+ "L=20.0\n",
+ "Tw=240.0\n",
+ "Tbo=140.0\n",
+ "Tbi=70.0\n",
+ "hL=-(rou*V*ID*cp*math.log((Tw-Tbo)/(Tw-Tbi)))/(4*L)\n",
+ "\n",
+ "#result\n",
+ "print\"The average convective coefficient is \",round(hL/10,1),\"BTU/(hr. sq.ft.degree Rankine\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity is 14340.4425132 ft/hr\n",
+ "The average convective coefficient is 517.7 BTU/(hr. sq.ft.degree Rankine\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 page No. 310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the variation of wall temperature with length up to the point where the flow becomes fully developed.\n",
+ "\n",
+ "#Given\n",
+ "# properties of milk \n",
+ "kf=0.6 # thermal conductivity in W/(m-K)\n",
+ "cp=3.85*1000 # specific heat in J/(kg*K)\n",
+ "rou=1030 # density in kg/m**3\n",
+ "mu=2.12e3 # viscosity in N s/m**2\n",
+ "# specifications of 1/2 standard type K tubing from appendix table F2\n",
+ "OD=1.588/100 # outer diameter in m\n",
+ "ID=1.340/100 # inner diameter in m\n",
+ "A=1.410e-4 # cross sectional area in m**2\n",
+ "rou=1030\n",
+ "V=0.1\n",
+ "mu=2.12e-3\n",
+ "\n",
+ "#Calculation\n",
+ "# determination of flow regime\n",
+ "Re=rou*V*ID/(mu)\n",
+ "# The flow being laminar, the hydrodynamic entry length is calculated as follows\n",
+ "ze=0.05*ID*Re\n",
+ "Tbo=71.7 # final temperature in degree celsius\n",
+ "Tbi=20 # initial temperature in degree celsius\n",
+ "L=6 # heating length in m\n",
+ "qw=rou*V*ID*cp*(Tbo-Tbi)/(4*L)\n",
+ "q=qw*math.pi*ID*L\n",
+ "Pr=(cp*mu)/kf # Prandtl Number\n",
+ "zf=0.05*ID*Re*Pr\n",
+ "\n",
+ "#result\n",
+ "print\"The heat flux is \",round(qw,0),\"W/sq.m\"\n",
+ "print\"The power required is \",round(q,0),\"W\"\n",
+ "print\"The length required for flow to be thermally developed is\",round(zf,1),\"m\"\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "z1=[0,0.2,1,6]\n",
+ "Twz=[20,40,60,125]\n",
+ "z2=[-1,0,6]\n",
+ "Twb=[20,20,72]\n",
+ "z3=[0.2,1,2,6]\n",
+ "hz=[112,72,58,40]\n",
+ "plt.grid()\n",
+ "xlabel(\"z (m)\") \n",
+ "ylabel(\"T (C) \") \n",
+ "plt.xlim((-1,6))\n",
+ "plt.ylim((0,140))\n",
+ "\n",
+ "ax.annotate('(Twz)', xy=(6,125))\n",
+ "ax.annotate('(Tbz)', xy=(6,72))\n",
+ "ax.annotate('(hz)', xy=(6,40))\n",
+ "a1=plot(z1,Twz)\n",
+ "a2=plot(z2,Twb)\n",
+ "a3=plot(z3,hz)\n",
+ "show(a1)\n",
+ "show(a2)\n",
+ "show(a3)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat flux is 11447.0 W/sq.m\n",
+ "The power required is 2891.0 W\n",
+ "The length required for flow to be thermally developed is 5.9 m\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAEPCAYAAACQmrmQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlclXX6//HXwSUzTVwKF0hMIMINTMVMFFRUjkvuDjaj\nptl8NSvHEg3n1zLTJGbOpKXVlKIt41JOuUSEG2I0CqaU5YIYkApSiihiKMv9++OOk6jAYTnnvu9z\nrufj4cPOwjlvzzBc3Nfnc1+3SVEUBSGEEMIGXLQOIIQQwnFJkRFCCGEzUmSEEELYjBQZIYQQNiNF\nRgghhM1IkRFCCGEzNisy06ZNw83NjS5dutz02NKlS3FxcSE3N9dy36JFi/D29sbX15e4uDhbxRJC\nCGFHNisyjz76KLGxsTfdf+rUKbZv30779u0t9x05coQNGzZw5MgRYmNjmTVrFqWlpbaKJoQQwk5s\nVmSCgoJo3rz5TffPnTuXV199tdx9mzdvJjw8nAYNGuDp6YmXlxdJSUm2iiaEEMJO7Loms3nzZtzd\n3enatWu5+7OysnB3d7fcdnd358yZM/aMJoQQwgbq2+uNrly5wiuvvML27dst91U20cZkMtkjlhBC\nCBuyW5E5efIkGRkZdOvWDYDTp0/zwAMPsH//ftq1a8epU6cszz19+jTt2rW76TXatWtHVlaWvSIL\nIYRD6NixI2lpadq8uWJD6enp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neHgQHR2tdaRqSUxM5MMPP2T37t0EBAQQEBBgGV+kd9nZ2QwYMAB/f38CAwMZMWIEAwcO1DpWjRmt\ndZyTk0NQUJDl8x8+fDiDBw/WOla1vPHGGzzyyCN069aN7777jsjISLu+v5yMKYQQwmYMdyQjhBDC\nOKTICCGEsBkpMkIIIWxGiowQQgibkSIjhBDCZqTICCGEsBkpMkLUgWeffbZa415ycnIwm822CySE\nTkiREaKW8vPzSUhIqNaoFzc3N5o3b26oayIJURNSZIS4wTvvvGOZDNChQwcGDBhQ6fM3b97MoEGD\nLLc9PT2JjIwkICCAHj16cPDgQQYPHoyXlxfvvPOO5XkjR45k3bp1Nvt3CKEHUmSEuMGf//xnDh06\nRHJyMh4eHjzzzDOVPj8xMZEePXpYbptMJtq3b8+hQ4fo168fU6dO5dNPP2Xfvn288MILluf16tWL\nhIQEm/07hNADXU5hFkIPnnrqKQYOHMiwYcMqfV5mZqZlUm+ZsgGoXbp0oaCggDvuuIM77riD2267\njUuXLnHnnXfSpk0bMjIybBVfCF2QIiPELaxZs4ZTp06xcuVKq55fWlpa7vZtt90GqNeCadiwoeV+\nFxcXiouLAXU6tNEGRgpRXVJkhLjBN998w9KlS62+OFX79u05e/bsLR+rbP5sdnY27du3r1FGIYxC\n1mSEuMGKFSu4cOECISEhBAQE8Pjjj1f6/L59+3LgwAHL7euPTkwm0023yyQlJdGvX786TC6E/sio\nfyFq6fLly4SEhJCcnFytr3vkkUd49tlnDXURMiGqS45khKilJk2aEBISwu7du63+mp9//pm8vDwp\nMMLhyZGMEEIIm5EjGSGEEDYjRUYIIYTNSJERQghhM1JkhBBC2IwUGSGEEDYjRUYIIYTN/H8Uvofb\nuXiDpAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7650da0>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 page No. 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Graph the variation between fluid and wall bulb tempratures.\n",
+ "#and how long it will take for the water volume to solidify.\n",
+ "\n",
+ "#Given\n",
+ "# The average bulk temperature of the Freon-12 is [-4O +(-4)]/2 = -22\u00b0F\n",
+ "# properties of Freon-12 at average bulk temperature\n",
+ "kf=0.04 # thermal conductivity in BTU/(hr.ft.\u00b0R) \n",
+ "cp=0.2139 # specific heat in BTU/(lbm-\u00b0R)\n",
+ "rou= 1.489*(62.4) # density in lbm/cu.ft\n",
+ "v=0.272e-5 # viscosity in sq.ft/s\n",
+ "a=2.04e-3 # diffusivity in sq.ft/hr\n",
+ "Pr=4.8 # Prandtl Number\n",
+ "# specifications of 3/8 standard type K copper tubing from appendix table F2\n",
+ "OD=0.5/12.0 # outer diameter in ft\n",
+ "ID=0.03350 # inner diameter in ft\n",
+ "A=0.0008814 # cross sectional area in sq.ft\n",
+ "# Laminar conditions are asssumed\n",
+ "z=5.0\n",
+ "Tw=32.0\n",
+ "Tbo=-4.0\n",
+ "Tbi=-40.0\n",
+ "L=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "x=2*a*L/((kf*ID/2.0)*(math.log((Tw-Tbo)/(Tw-Tbi)))) #x=V/hl\n",
+ "#1/Gz=9.09/V\n",
+ "#from the table unless convergence is achieved\n",
+ "V=336.0 #ft/h\n",
+ "V_final=V/3600.0 #ft/s\n",
+ "hl_=V_final/(x) #\n",
+ "\n",
+ "# checking the laminar-flow assumption by calculating the Reynolds number\n",
+ "Re=(V_final/3600.0)*ID/v\n",
+ "# The flow is laminar\n",
+ "m_Fr=rou*A*V_final\n",
+ "As=math.pi*ID*L\n",
+ "q=hl_*As*((Tw-Tbo)-(Tw-Tbi))/(log((Tw-Tbo)/(Tw-Tbi)))\n",
+ "q_check=m_Fr*cp*(Tbo-Tbi)\n",
+ "rou_water=1.002*62.4 # density of water in lbm/ft**3 from appendix table C11\n",
+ "m_water=rou_water*L*(2/12.0)*(3/12.0)\n",
+ "# to remove 144 BTU/lbm of water, the time required is caalculated as below\n",
+ "t=144*m_water/(-q*3600)\n",
+ "\n",
+ "#result\n",
+ "print\"The mass flow rate of Freon-12 is \",round(m_Fr*3600,2),\"lbm/hr\"\n",
+ "print\"The required time is \",round(t,0),\"hr\"\n",
+ "\n",
+ "\n",
+ "#plot\n",
+ "#Constant wall temprature with length\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "z1=[0,5]\n",
+ "Tw=[32,32]\n",
+ "z2=[0,0.185,0.74,1.85,2.77,3.70,5.0]\n",
+ "Tbz=[-40,-34.7,-27.4,-18.5,-13.5,-8.9,-4.1]\n",
+ "z3=[0.185,1,2,5.0]\n",
+ "hz=[23,-13,-19,-25]\n",
+ "\n",
+ "plt.grid()\n",
+ "xlabel(\"z (m)\") \n",
+ "ylabel(\"T (F) \") \n",
+ "plt.xlim((-2,5))\n",
+ "plt.ylim((-40,35))\n",
+ "\n",
+ "ax.annotate('(Tw=32 F)', xy=(5,30))\n",
+ "ax.annotate('(Tbz)', xy=(5,-5))\n",
+ "ax.annotate('(hz)', xy=(5,-25))\n",
+ "ax.annotate('(hydronamic entry\\n length)', xy=(-2,-40))\n",
+ "a1=plot(z1,Tw)\n",
+ "a2=plot(z2,Tbz)\n",
+ "a3=plot(z3,hz)\n",
+ "title('$Variation of Constant wall temprature with length$')\n",
+ "show(a1)\n",
+ "show(a2)\n",
+ "show(a3)\n",
+ "\n",
+ "#2nd Plot\n",
+ "#Nusslet number with dimensionless length\n",
+ "x1=[0.001,0.01,0.1,1]\n",
+ "Nu1=[31,11,5.5,5.2]\n",
+ "Nu2=[25,10,5.3,5.1]\n",
+ "Nu3=[22,9,5.1,4.9]\n",
+ "Nu4=[17,7,4.1,4]\n",
+ "Nu5=[15,6.5,4,3.9]\n",
+ "Nu6=[13.8,6,3.9,3.8]\n",
+ "\n",
+ "\n",
+ "plt.grid()\n",
+ "xlabel(\"1/Gz=z/(DRePr)\") \n",
+ "ylabel(\"Nu \") \n",
+ "\n",
+ "plt.xlim((0.001,1))\n",
+ "plt.ylim((0,35))\n",
+ "ax.annotate('(Constant wall temprature)', xy=(0.1,30))\n",
+ "ax.annotate('(Hydronamically and thermally developing laminar flow)', xy=(0.1,25))\n",
+ "b1=plot(x1,Nu1,label='Pr=0.7')\n",
+ "b2=plot(x1,Nu2,label='Pr=2')\n",
+ "b3=plot(x1,Nu3,label='Pr=5')\n",
+ "b4=plot(x1,Nu4,label='Pr=0.7')\n",
+ "b5=plot(x1,Nu5,label='Pr=2')\n",
+ "b6=plot(x1,Nu6,label='Pr=5')\n",
+ "plt.legend(loc='upper right')\n",
+ "title('$Variation of Nusslet number with dimensionless length$')\n",
+ "show(b1)\n",
+ "show(b2)\n",
+ "show(b3)\n",
+ "show(b4)\n",
+ "show(b5)\n",
+ "show(b6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass flow rate of Freon-12 is 27.52 lbm/hr\n",
+ "The required time is 9.0 hr\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAbQAAAEZCAYAAAD/ttB2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdYFOf6//H3UuwFS0QFAxIUxAYW7AoCYokl9i4mnhRP\nqonRtKPmRMVoEk39Gn9RjCaKJjFoYohEKXYsqFEUK0gTRUVDLCDM7489bECKoMDs7N6v6+K6mN2Z\n2c8Oy9w7zzPzjE5RFAUhhBBC4yzUDiCEEEKUByloQgghTIIUNCGEECZBCpoQQgiTIAVNCCGESZCC\nJoQQwiRIQRNCCGESpKAJIYQwCVLQKlBSUhKTJ0+mcePGrFmzxvD4mTNnaN26NW+++SbXr18v9fpm\nz57Ntm3bHirLoyxbWp988gnvvPMOy5cvNzy2ZcsW3nvvPb766iuCgoIIDg7m1Vdf5c6dOxWaRW3f\nf/89jz32WLHTorAHfUbj4uLo2bMnq1evLvRcZW3fkjIII6CICnXo0CHFycmpwGOJiYlKcHBwhb5u\n3759lezs7Ap9jfwyMjKUrl27Kvv371eOHz+u5OTkKM8884yyePHiAvNt2rRJ6du3b7m/fnm93/Ja\nz+HDh5WRI0cWO13Zf5+yMJZsReXo06ePEh8fX2je+7dvReYoLoNQn5XaBdXUOTo6kpiYSG5uLhYW\n+gPijRs38tprr1XYayYnJ6MoClZWlffn3b9/P+7u7nh6egIwZ84cAN54440C83Xr1o3Tp0+X62uX\n1/stz+22Y8cO+vbtW+S0Gn+f0jKWbEXluHXrFikpKTg4OBSa//7tXVE5Ssog1Gc5d+7cuWqHMGXV\nq1fn448/Zty4cdjY2PDjjz/i6+tLWloaS5cu5c6dO8ybN48qVarQsmVLDh8+TFRUFC+++CI3btxg\n+vTpDBgwgN9++43333+fUaNGAXD69Okilw8LC2PBggXUqVOHW7du0axZM0JCQgosm5yczLJly8jM\nzOT777+nWbNmxMfHs2nTJkJCQrh58yYnTpxgyZIlDB06tNhl6tevD+iL2YcffkjNmjXJycmhUaNG\njBw5kh9++IG6desW2B41a9akQ4cOXL58ucwZbt68yYoVK0hPT2fLli1069at0Ptt3759sdvm0KFD\n/Pzzz0WuP289devW5datW9StW5cdO3bw8ccfM2TIEGJiYli4cCEDBgzAx8eHrl270rBhw0KvVbVq\nVVq2bMnChQt57rnnaNiwIYBhOiYmplBegBMnTvDRRx+RlZXF+vXradiwIb/88gtr1qzh77//JjY2\n1rBcXFwc77//Pu3ataN+/focPXqUrVu3sn79em7dusXOnTs5ceIEOTk5REZGFvgsDRw4sNjP3v3b\nsn79+mzfvp3333+fkSNHkp2djb+/P5MnTy7yczpw4ECSkpIKvI8+ffoQHx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jz33HPExMRw4MABmjVrxuuvv17i/Lt376ZTp06GaZ1Oh4ODAzExMfTu3ZuAgAA2bdrEvn37mDNn\njmE+T09PoqKiKux9CGEujHq0fSGMwcsvv4yPjw+DBg0qcb6EhATDiOZ58gZvbtu2LX///Tc1a9ak\nZs2aVK1alZs3b1KnTh2aNGlCfHx8RcUXwmxIQROiBEFBQSQmJvLll1+Wav7c3NwC01WrVgX09wKr\nUqWK4XELCwvu3bsH6EfS19pgt0IYIyloQhTj0KFDfPTRR+zcubNU8zs4OBR5Q1co+RZBqampODg4\nPFRGIcQ/pA9NiGJ88cUXXL9+HW9vbzw8PHj22WdLnL9nz54cPHjQMJ3/qEun0xWazhMdHU3v3r3L\nMbkQ5kluHyNEOcnMzMTb25sDBw6UabkJEybwxhtvaOqGl0IYIzlCE6Kc1KpVC29vb8LDw0u9zOXL\nl8nIyJBiJkQ5kCM0IYQQJkGO0IQQQpgEKWhCCCFMghQ0IYQQJkEKmhBCCJMgBU0IIYRJkIImhBDC\nJPx/NycoLOaJwxIAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7b9cf28>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEZCAYAAACaWyIJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdYFOf6N/DvLL0XC0REARULCItd0QgaC7HEKDF6kliP\nqcYYzbEkJ7GkqIknJjEnv1cTI5ZYYuxGOaKCvYRmTdSoKCKiCEhnd9nn/WNgZhcWWGDLAPfnuvZi\nn6n33LvsPfvMzgzHGGMghBDSZMnMHQAhhBDzokJACCFNHBUCQghp4qgQEEJIE0eFgBBCmjgqBIQQ\n0sRRISCEkCaOCgEhhDRxVAjK3L9/H5MmTYKnpyc2bdokDL958yYCAgIwb948ZGdn6728BQsW4PDh\nw3WKpT7z6mvVqlX46KOPsGbNGgDA+fP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y\nMuRyea1utpOeno62bdvqNS0hVaFvBESyJk6ciH79+uH69evw9vbGV199hW7dugnjPTw8sH37dixc\nuBAdOnRAaGgodu3ahZkzZ+Lu3bvYuXMnfv75Z2GvX/PbQ1X++9//Ijs7G+Hh4QgJCRFuBBQRESFM\n079/f8THx2vN969//Uv4+WhCQgJiY2OFg8mae+yenp4YO3Ys/vvf/+K7775DfHw8goODERAQgLVr\n1wrTV7WXX3H4hQsX8Oyzz9a4XYRUhy5DTRqMzz//HB06dMD48eNNut6hQ4di06ZNQvcSYwzdunXD\n+fPnYW1tbdJYNKnVanTr1g3x8fGN8ibtxHSoEBBSBz/88APs7OwwdepUs8Wwb98+XLp0Cf/+97/N\nFgNpHKgQEEJIE0fHCAghpImjQkAIIU0cFQJCCGniqBAQQkgTR4WAEEKaOCoEhBDSxP1/o1tSnXUj\nCSwAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7669b00>"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 page No.320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination for the power required for heating and the wall temperature at the outlet. \n",
+ "\n",
+ "#Given\n",
+ "# The liquid properties are evaluated at the mean temperature of (80 + 20)/2 = 50\u00b0C.\n",
+ "# specifications of 1 standard type K copper water tubing from appendix table F2\n",
+ "OD = 2.858/100.0 # outer diameter in m \n",
+ "ID = 2.528/100.0 # inner diameter in m \n",
+ "A = 5.019e-4 # cross sectional area in sq.m\n",
+ "# 1 oz = 2.957e-5 m**3\n",
+ "Q=80*2.957e-5/120 # The volume flow rate of water (at 20\u00b0C) in cu.m/s\n",
+ "p_20= 1.000*1000 # density of water at 20\u00b0C in kg/cu.m\n",
+ "# properties of water at 50\u00b0C from appendix table C11\n",
+ "p_50= 0.990*(1000) # density in kg/m3 \n",
+ "cp= 4181 # specific heat in J/(kg*K) \n",
+ "v = 0.586e-6 # viscosity in sq.m/s \n",
+ "kf = 0.640 # thermal conductivity in W/(m.K) \n",
+ "a = 1.533e-7 # diffusivity in sq.m/s \n",
+ "Pr = 3.68 # Prandtl number\n",
+ "\n",
+ "#CALCULATION\n",
+ "import math\n",
+ "mass_flow=p_20*Q # mass flow rate through the tube in kg/s\n",
+ "L=3 # length of tube in m\n",
+ "As=math.pi*ID*L\n",
+ "Tbo=80 # final temperature in \u00b0C\n",
+ "Tbi=20 # initial temperature in \u00b0C\n",
+ "qw=mass_flow*cp*(Tbo-Tbi)/(As)\n",
+ "q=qw*As\n",
+ "A=math.pi*(ID/2)**2\n",
+ "print\"The power required is\",round(q,0),\"W\"\n",
+ "V=mass_flow/(p_50*A) # average velocity at 50 \u00b0C\n",
+ "Re=(V*ID)/v # Reynold's Number\n",
+ "# The flow is laminar so we can use Figure 6.12 to obtain the information needed on Nusselt number and to find hz\n",
+ "inv_Gz=L/(Re*ID*Pr) # The inverse Graetz number at tube end, based on 50\u00b0C conditions\n",
+ "Nu=6.9 #value of corresponding Nusselts Number from figure 6.12\n",
+ "hz=(Nu*kf)/ID\n",
+ "Two=(qw/hz)+Tbo # The outlet wall temperature in \u00b0C\n",
+ "print\"\\nThe outlet wall temperature is\",round(Two,0),\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power required is 4945.0 W\n",
+ "\n",
+ "The outlet wall temperature is 199.0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 page No.325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine heat gained by the duct and wall temprature\n",
+ "\n",
+ "#Given\n",
+ "# determibation of heat gained\n",
+ "# air properties to be calculated at T=(72+45)/2=58.5 degree Fahrenheit\n",
+ "# properties at T=58.5 degree fahrenheit from appendix table D1\n",
+ "p = 0.077 # density in lbm/ft^3 \n",
+ "cp = 0.240 # specific heat in BTU/(lbm.degree Rankine) \n",
+ "v = 15.28e-5 # viscosity in ft^2/s \n",
+ "kf = 0.0146 # thermal conductivity in BTU/(hr.ft.\"R) \n",
+ "a = 0.776 # diffusivity in ft^2/hr \n",
+ "Pr = 0.711 # prandtl number \n",
+ "D=7/12.0 # diameter in ft\n",
+ "L=40 # length in ft\n",
+ "Tbo=72 # outlet temperature in degree Fahrenheit\n",
+ "Tbi=45 # inlet temperature in degree Fahrenheit\n",
+ "A=math.pi*(D**2)/4 # cross sectional area of duct in ft^2\n",
+ "# density at outlet temperature in lbm/ft^3 \n",
+ "rou_o=.0748\n",
+ "V=10 # average velocity in ft/s\n",
+ "mass_flow=rou_o*A*V\n",
+ "\n",
+ "#Calculation\n",
+ "# average velocity evaluated by using the average bulk temperature\n",
+ "V_avg=mass_flow/(p*A)\n",
+ "Re=(V_avg*D)/v\n",
+ "# the flow is in turbulent regime\n",
+ "q=mass_flow*cp*(Tbo-Tbi)\n",
+ "hc=1 # convection coefficient between the outside duct wall \n",
+ "T_inf=105 # The temperature of attic air surrounding the duct in degree Fahrenheit\n",
+ "hz=(0.023*Re**(0.8)*Pr**0.4)*kf/D \n",
+ "qw=(T_inf-Tbo)/((1/hc)+(1/hz)) \n",
+ "Two=qw*(1/hz)+Tbo # The wall temperature at exit in degree Fahrenheit\n",
+ "\n",
+ "#result\n",
+ "print\"The heat gained by air is\",round(q,3),\"BTU\"\n",
+ "print\"The wall temperature at exit is \",round(Two,1),\"F\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat gained by air is 1.295 BTU\n",
+ "The wall temperature at exit is 82.1 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER7.ipynb b/Engineering_Heat_Transfer/CHAPTER7.ipynb
new file mode 100644
index 00000000..3c0bf86c
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER7.ipynb
@@ -0,0 +1,709 @@
+{
+ "metadata": {
+ "name": "CHAPTER7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7 : Convection Heat Transfer in Flow Past immersed Bodies"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.1 page NO.353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of boundary layer growth with length\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at 27 degree celsius from appendix table D.1\n",
+ "rou=1.177 # density in kg/cu.m\n",
+ "v=15.68e-6 # viscosity in sq.m/s\n",
+ "L=0.5 # length in m\n",
+ "V_inf=1; # air velocity in m/s\n",
+ "Re= (V_inf*L)/v # Reynolds Number\n",
+ "\n",
+ "#(a)plot\n",
+ "#delta=1.98*10**-2*x**(1/2)\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "x=[0,0.065,0.125,0.5]\n",
+ "t=[0,0.004,0.006,0.013]\n",
+ "xlabel(\"x (m)\") \n",
+ "ylabel(\"t (m)\") \n",
+ "plt.xlim((0,0.6))\n",
+ "plt.ylim((0,0.015))\n",
+ "a1=plot(x,t)\n",
+ "\n",
+ "#(b)plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "x=[0,0.75,0.9,1]\n",
+ "t=[0,0.005,0.0075,0.010]\n",
+ "xlabel(\"V (m/s)\") \n",
+ "ylabel(\"y (m)\") \n",
+ "plt.xlim((0,1))\n",
+ "plt.ylim((0,0.010))\n",
+ "a1=plot(x,t)\n",
+ "\n",
+ "# (c)calculation of absolute viscosity\n",
+ "gc=1\n",
+ "mu=rou*v/gc\n",
+ "b=1 # width in m\n",
+ "Df=0.664*V_inf*mu*b*(Re)**0.5\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print\"(a)plot between boundary layer growth with distance\"\n",
+ "print\"(b)velocity distribution with distance\"\n",
+ "print\"(c)The skin-drag including both sides of plate is \",round(2*Df,4),\"n\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)plot between boundary layer growth with distance\n",
+ "(b)velocity distribution with distance\n",
+ "(c)The skin-drag including both sides of plate is 0.0044 n\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEICAYAAACuxNj9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9c1fXd//EHDHRlNq0ZFoevJKBgKmYYZdloqVyydTKv\nVpjXxtJ1eVnqurpq2aolWU5abSu5NG1J0pZjyyaUeNI0VpmIGuUKSzTYdYDQ+QPTsg4/3t8/PoW/\ngHNEDp9z4Hm/3bp1Drzf57zeN/A8+Xzen/f7E2KMMYiIiLQh1O4CREQk8CksRETEK4WFiIh4pbAQ\nERGvFBYiIuKVwkJERLwKs7sAfwkJCbG7BBGRoNTSiooufWRhjOmy/z388MO216CxaXwaX9f7rzVd\nOixERKRjKCxERMQrhUWQSklJsbsEv+nKYwONL9h19fG1JsS0dZIqiIWEhLR5/k1ERE7V2menjixE\nRM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\nGDlypOdnR48eRVlZGY4dO4bNmzfj1KlTsFgsWLBgAdauXevpd/z4caSnp2PLli2YNm0a6urqcPTo\nUYwdOxaA+6umz5w5g59++ikMV0wkDQsJkR+8396qqKjAnDlzrmlz5syZaw76GzduHNRqNfr27Qut\nVuvJQTIzM2G1WgEAhw4dgsFgAACMHz8e5eXlKCkpwdGjR3HDDTd4nkutVnc6C4lIaSwkRH4wGo3Y\nt28f6urq8PPPP+OOO+7otl3XkP26667z/DkhIcHzOCEhwfNW2a5du5CXlwfA/Z0Rn3/+OZKTk/H4\n4493Ot5dCBGTp1hT9GIhIfLDDTfcgPvuuw/z5s3rNmQH3F8O9eOPP/r93DU1NZg6dSoA4IcffsDg\nwYOxYMECLFiwAEeOHPG0a21t7fZ0ZyKlsJAQ+WnOnDn429/+1u3bWgDQp08fZGZm4vjx4wDc3+XQ\n0wriyu/OnDmD66+/Hv379wfgDujHjh2LO++8Ex988AGeeeYZAEBLSwsGDRrkaUcUCXhoI5EMNmzY\ngNbWVixZskRS+/fffx92ux0vvvhir+3Wr1+Pn376CYsXLw7FMIlCgoWESAYOhwNTp07F/v37Q5pn\nTJkyBZWVlZ3CdyKlsZAQEVFQmJEQEVFQWEiIiCgoLCRERBQUFhIiIgoKCwkREQWFhYSIiILyf2cF\nCXXQW9RxAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 page NO.360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of temperature profile\n",
+ "\n",
+ "#Given\n",
+ "# properties of water at (40 + 100)/2 = 70\u00b0F = 68\u00b0F from appendix table C11\n",
+ "rou= 62.4 # density in Ibm/ft^3 \n",
+ "cp=0.9988 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 1.083e-5 # viscosity in sq.ft/s \n",
+ "kf = 0.345 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 5.54e-3 # diffusivity in sq.ft/hr \n",
+ "Pr = 7.02 # Prandtl Number\n",
+ "V=1.2 # velocity in ft/s\n",
+ "\n",
+ "#Calculation\n",
+ "x1=1\n",
+ "Re1=(V*x1)/v # Reynolds Number at x=1 ft\n",
+ "# since Reynolds Number is less than 5*10^5, the flow is laminar\n",
+ "hL1=0.664*Pr**(1/3.0)*Re1**0.5*kf/x1\n",
+ "Tw=100 # temperature of metal plate in degree fahrenheit\n",
+ "T_inf=40 # temperature of water in degree fahrenheit\n",
+ "A1=x1*18/12.0 # cross sectional area for 1 ft length\n",
+ "q1=hL1*A1*(Tw-T_inf)\n",
+ "\n",
+ "print\"The heat transferred to water over the plate is\",round(q1,0),\"BTU/hr\"\n",
+ "x2=2\n",
+ "Re2=(V*x2)/v # Reynolds Number at x=1 ft\n",
+ "# since Reynolds Number is less than 5*10^5, the flow is laminar\n",
+ "hL2=0.664*Pr**(1/3.0)*Re2**0.5*kf/x2\n",
+ "Tw=100 # temperature of metal plate in degree fahrenheit\n",
+ "T_inf=40 # temperature of water in degree fahrenheit\n",
+ "A2=x2*18/12.0 # cross sectional area for 1 ft length\n",
+ "q2=hL2*A2*(Tw-T_inf)\n",
+ "print\"The heat transferred to water over the plate is \",round(q2,0),\"BTU/hr\"\n",
+ "\n",
+ "#PLot for temprature distribution\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "T=[100,80,60,50,40]\n",
+ "y=[0,0.0008,0.0018,0.0025,0.004]\n",
+ "xlabel(\"T (F)\") \n",
+ "ylabel(\"y (ft) \") \n",
+ "plt.xlim((100,40))\n",
+ "plt.ylim((0,0.004))\n",
+ "a1=plot(T,y)\n",
+ "\n",
+ "#PLot for influence of prandtl no on boundary layer thickness\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "Pr=[0.6,50]\n",
+ "t=[1.2,0.28]\n",
+ "xlabel(\"Pr\") \n",
+ "ylabel(\"t (ft) \") \n",
+ "plt.xlim((0.6,50))\n",
+ "plt.ylim((0,2))\n",
+ "ax.plot([10], [1], 'o')\n",
+ "ax.annotate('(Exact solution)', xy=(8,1.2))\n",
+ "ax.annotate('(dt/dt=Pr**-(1/3))', xy=(15,1))\n",
+ "ax.plot([25], [0.75], 'o')\n",
+ "ax.plot([35], [0.55], 'o')\n",
+ "ax.plot([40], [0.48], 'o')\n",
+ "\n",
+ "a1=plot(Pr,t)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred to water over the plate is 13141.0 BTU/hr\n",
+ "The heat transferred to water over the plate is 18584.0 BTU/hr\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAEMCAYAAAAIx/uNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9U2/W9P/BnKOHcXk4ntVpqCZo2SRsomgax0d16v9EO\nOTCX27pdLnS7l+PYHXfdROeut+56Zsu5toV5d656uVV0lRb1Su2uCh0UmetJdbtNscJ274VaYxuu\nIZRqf6Cr620gvr5/sGSlBRJoPiT55Pk4p+eQ8H59+n5JzYvX6/PJJxoRERAREUVRSqw3QERE6sPi\nQkREUcfiQkREUcfiQkREUcfiQkREUcfiQkREUadoceno6IDZbIbJZEJdXd2Ea6qrq2EymWCxWNDT\n0xNx7E9+8hOkpKTgzJkzoee2bdsGk8kEs9mMzs7O6CdERESREYWMjo6KwWAQj8cjfr9fLBaL9PX1\njVvT1tYmxcXFIiLicrnEZrNFFPvhhx9KUVGR6PV6OX36tIi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nRHEOhwMvv/xy1PZGFG0sLkRx5Ne//jUKCgpCj0UEd9xxB6xWK2677bbQ86tWrcJbb70Viy0SRYRj\nMaI48r//+7+h+1YBk4/FrrvuOvT398/y7ogix86FKM5EMj4TkYS96y4lBxYXojhyww034MSJE2HX\nnThxAjfccMMs7IhoZlhciGZJJJ3G6tWrcfjw4bAxXV1d+PM///Oo7Y0o2njjSqI4cvz4cdx3331o\na2ubct3Xv/51/P3f/z2sVuss7Yxoeti5EMWRpUuXYt68eTh27Nikaz766CMMDw+zsFBcY+dCRERR\nx86FiIiijsWFiIiijsWFiIiijsWFiIiijsWFiIiijsWFiIii7v8D2EqN0pcBl9MAAAAASUVORK5C\nYII=\n"
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEKCAYAAAASByJ7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlGX+P/D3MCAwgBxmghRMzAOCwDB5Ck3FEMkDUNqa\ntqWpm+aW6O7329pW16a7+7WT5aLuaoddt7LVTvsLECR0ZfCASBmWeQAPYGCIzXCWM3P//pjp2UZQ\nDjIMMO/XdXFdPs/c88zHO5s3z/OZeW6ZEEKAiIhsnp21CyAiot6BgUBERAAYCEREZMJAICIiAAwE\nIiIyYSAQEREACwZCUVERpk+fjjFjxiA4OBhbtmxpc1x8fDxGjhwJtVqN3NxcS5VDRETtsLfUgR0c\nHLB582aEhYWhpqYGY8eORVRUFAIDA6UxqampuHDhAs6fP4/jx49j1apVyM7OtlRJRER0CxY7Q7jz\nzjsRFhYGAHB1dUVgYCB++OEHszFJSUlYsmQJAGDixImoqKhAaWmppUoiIqJb6JEeQmFhIXJzczFx\n4kSz/VeuXMGQIUOkbT8/PxQXF/dESUREdAOLXTL6SU1NDR5++GEkJCTA1dW11eM33jlDJpO1GtPW\nPiIial9n7k5k0TOEpqYmzJ8/H4899hgefPDBVo/7+vqiqKhI2i4uLoavr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49RU1OD+fPnIyEhAW5ubmaP2dKc2NnZ4eTJk6isrER0dDQyMjLMHreludi7dy+8vb2h\n0WhuersKW5oPADh69CgGDRqEH3/8EVFRURg9erTZ4x2ZD54h9HI+Pj64evUqAKCkpATe3t5Wrqhn\nNTU1Yf78+Xj88cfx4IMPAuCcuLu7Y86cOThx4oTNzkVWVhaSkpIwbNgwLFq0CAcPHsTjjz9us/MB\nAIMGDQIA3HHHHXjooYeQk5PT6flgIPRysbGxeO+99wAA7733nvSmaAuEEFi+fDmCgoKwdu1aab8t\nzolOp0NFRQUAoK6uDvv374dGo7HJuQCAjRs3oqioCAUFBdizZw/uv/9+fPDBBzY7H7W1taiurgYA\nXL9+Henp6QgJCen8fFiqwUGdt3DhQjFo0CDh4OAg/Pz8xD/+8Q+h1+tFZGSkGDlypIiKihLl5eXW\nLrPHHD58WMhkMqFWq0VYWJgICwsT+/bts8k5+fbbb4VGoxFqtVqEhISI1157TQghbHIubqTVakVM\nTIwQwnbn49KlS0KtVgu1Wi3GjBkjNm7cKITo/HzwewhERASAl4yIiMiEgUBERAAYCEREZMJAICIi\nAAwEok6Ry+XQaDQICQnBggULUFdXZ+2SiLoNA4GoExQKBXJzc3Hq1CkMGDAAO3bsMHu8ubnZSpUR\n3T4GAlEXTZkyBRcuXEBmZiamTJmCuLg4jBkzxtplEXUZ72VE1AXNzc1ITU3F7NmzAQC5ubk4ffo0\nhg4dauXKiLqOZwhEnVBXVweNRoPx48fD398fy5YtgxACEyZMYBhQn8czBKJOcHZ2Rm5ubqv9Li4u\nVqiGqHvxDIGIiAAwEIg6pa37ydvaffep/+LN7YiICADPEIiIyISBQEREABgIRERkwkAgIiIADAQi\nIjJhIBAREQDg/wPa6rEVsfB01AAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3 page NO.363"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the average convection coefficient and the total drag force exerted on the plate.\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at (300 + 400)/2 = 350 K from appendix table D1\n",
+ "rou=0.998\t # density in kg/cu.m\n",
+ "cp=1009 \t\t# specific heat in J/(kg*K) \n",
+ "v=20.76e-6 \t# viscosity in sq.m/s \n",
+ "Pr=0.697 \t# Prandtl Number \n",
+ "k=0.03003 \t# thermal conductivity in W/(m.K)\n",
+ "a=0.2983e-4 \t# diffusivity in sq.m/s \n",
+ "L=1.0 \t\t # Length of plate in m\n",
+ "V=5.0 \t\t # velocity of air in m/s\n",
+ "b=0.5 \t\t# width in m\n",
+ "Re=V*L/v \t# Reynolds number at plate end\n",
+ "\n",
+ "#calculation\n",
+ "# Nu=h*L/k= 0.664 Re**(1/2)Pr**(1/3)\n",
+ "h=k*0.664*Re**(0.5)*Pr**(1/3.0)/L\t # The average convection coefficient in W/(sq.m.K)\n",
+ "Df=0.664*V*rou*v*b*(Re)**0.5 \t # drag force in N\n",
+ "hx=(1/2.0)*h # local convective coefficient\n",
+ "delta=5*L/(Re)**0.5 # The boundary-layer thickness at plate end\n",
+ "delta_t=delta/(Pr)**(1/3.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"The local convective coefficient is \",round(hx,2),\"W/(sq.m.K)\"\n",
+ "print\"The boundary-layer thickness at plate end is \",round(delta*100,2),\"cm\"\n",
+ "print\"The thermal-boundary-layer thickness is \",round(delta_t*100,2),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The local convective coefficient is 4.34 W/(sq.m.K)\n",
+ "The boundary-layer thickness at plate end is 1.02 cm\n",
+ "The thermal-boundary-layer thickness is 1.15 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4 page NO. 364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the maximum heater-surface temperature for given conditions\n",
+ "\n",
+ "#Given\n",
+ "# fluid properties at (300 degree R + 800 degree R)/2 = 550 degree R=540degree R from Appendix Table D.6\n",
+ "rou= 0.0812 # density in Ibm/ft^3 \n",
+ "cp=0.2918 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 17.07e-5 # viscosity in ft^2/s \n",
+ "kf = 0.01546 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 0.8862 # diffusivity in ft^2/hr \n",
+ "Pr = 0.709 # Prandtl Number\n",
+ "\n",
+ "#calculation\n",
+ "qw=10/(1.5*10.125)*(1/.2918)*144 # The wall flux \n",
+ "V_inf=20 # velocity in ft/s\n",
+ "L=1.5/12 # length in ft\n",
+ "Re_L=V_inf*10*L/v # Reynolds number at plate end\n",
+ "# So the flow is laminar and we can find the wall temperature at plate end as follows\n",
+ "T_inf=300 # free stream temperature in degree Rankine\n",
+ "Tw=T_inf+(qw*L*10/(kf*0.453*(Re_L)**0.5*(Pr)**(1/3.0)))\n",
+ "\n",
+ "#Result\n",
+ "print\"The maximum heater surface temperature is \",round(Tw,0),\"R\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum heater surface temperature is 470.0 R\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5 page NO. 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# validation of the equation st.(Pr)**(2/3)=Cd/2 where St: Stanton Number Pr:Prandtl Number Cd: Drag Coefficient\n",
+ "\n",
+ "#Given\n",
+ "# values of parameters from example 7.4\n",
+ "rou= 0.0812 # density in Ibm/ft**3 \n",
+ "cp=0.2918 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 17.07e-5 # viscosity in ft**2/s \n",
+ "kf = 0.01546 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 0.8862 # diffusivity in ft**2/hr \n",
+ "Pr = 0.709 # Prandtl Number\n",
+ "Tw=469 # maximum heater temperature in degree Rankine\n",
+ "T_inf=300.0 # free-stream temperature in degree Rankine\n",
+ "qw=324.0 # The wall flux in BTU/(hr.ft**2)\n",
+ "V_inf=20 # velocity in ft/s\n",
+ "\n",
+ "#Calculation\n",
+ "hx=qw/(Tw-T_inf) # The convection coefficient\n",
+ "LHS=(hx/3600.0)*(Pr)**(2/3.0)/(rou*cp*V_inf)\n",
+ "Re_L=1.46e+005 # Reynolds number at plate end\n",
+ "RHS=0.332*(Re_L)**(-0.5)\n",
+ "err=(LHS-RHS)*100/LHS\n",
+ "\n",
+ "#Result\n",
+ "print\"The convection coefficient is BTU/(hr.sq.ft.degree R)\",hx\n",
+ "print\"The error is \",round(err,0),\"percent\"\n",
+ "print\"Since the error is only 3 percent, the agreement is quite good\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The convection coefficient is BTU/(hr.sq.ft.degree R) 1.91715976331\n",
+ "The error is 3.0 percent\n",
+ "Since the error is only 3 percent, the agreement is quite good\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 page NO. 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of the drag due to skin friction\n",
+ "\n",
+ "#Given\n",
+ "# properties of water at 68\u00b0F from Appendix Table C.11\n",
+ "rou= 62.4 # density in Ibm/cu.ft\n",
+ "v= 1.083e-5 # viscosity in sq.ft/s \n",
+ "V_inf=5*.5144/.3048 # barge velocity in ft/s using conversion factors from appendix table A1\n",
+ "L=20 # Length of barge in ft\n",
+ "Re_L=V_inf*L/v # Reynolds number at plate end\n",
+ "Cd=0.003 #value of Coefficient of discharge figure 7.11\n",
+ "gc=32.2\n",
+ "b=12 # width in ft\n",
+ "\n",
+ "#Calculation\n",
+ "Df=(Cd*rou*V_inf**2*b*L)/(2*gc)\n",
+ "\n",
+ "#Result\n",
+ "print\"The drag force is \",round(Df,0),\"lbf\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drag force is 50.0 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 page NO. 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of wattage requirement\n",
+ "\n",
+ "#Given\n",
+ "# properties of carbon dioxide at a film temperature of (400+600)/2 = 500 K from appendix table D2\n",
+ "rou= 1.0732 # density in kg/m**3 \n",
+ "cp= 1013 # specific heat in J/(kg*K) \n",
+ "v= 21.67e-6 # viscosity in m**2/s \n",
+ "Pr = 0.702 # Prandtl Number \n",
+ "k= 0.03352 # thermal conductivity in W/(m.K)\n",
+ "a = 0.3084e-4 # diffusivity in m**2/s\n",
+ "V_inf=60 # carbon dioxide velocity in m/s\n",
+ "vel=60 #velocity\n",
+ "\n",
+ "x_cr=(5e5)*v/V_inf # The transition length in m\n",
+ "w=4.0 # width of each heater in cm\n",
+ "b=0.16 # effective heating length in m\n",
+ "Tw=600 # temperature of heater surface in K\n",
+ "T_inf=400 # temperature of carbon dioxide in K\n",
+ "\n",
+ "#calculation\n",
+ "#Nux=0.664*Rex**(1/2)*Pr**(1/3)\n",
+ "y=0.664*Pr**(1/3.0)*k*(vel/v)**(1/2.0) #y=h1*x1**(1/2)\n",
+ "x1=0.04 # m\n",
+ "h1=y/x1**(0.5)\n",
+ "q1=h1*(Tw-T_inf)*x1*b\n",
+ "\n",
+ "x2=0.08\n",
+ "h2=y/(x2)**(0.5)\n",
+ "Q=h2*x2*(b)*(Tw-T_inf) #Q=q1+q2\n",
+ "q2=Q-q1\n",
+ "\n",
+ "x3=0.12\n",
+ "h3=y/(x3)**(0.5)\n",
+ "Q1=h3*x3*(b)*(Tw-T_inf) #Q=q1+q2+q3\n",
+ "q3=Q1-Q\n",
+ "\n",
+ "x4=0.16\n",
+ "h4=y/(x4)**(0.5)\n",
+ "Q2=h4*x4*(b)*(Tw-T_inf) #Q=q1+q2+q3+q4\n",
+ "q4=Q2-Q1\n",
+ "\n",
+ "#at the end of 5th heater\n",
+ "Re5=vel*5*x1/(v)\n",
+ "\n",
+ "#Nux=10.0359*(Rex**(0.8)-830)*Pr**(1/3)\n",
+ "h5=0.0359*(Re5**(0.8)-830)*Pr**(1/3.0)*(k/(11.9*x1))\n",
+ "x5=0.2\n",
+ "Q3=h5*x5*(b)*(Tw-T_inf) #Q3=q1+q2+q3+q4+q5\n",
+ "q5=Q3-Q2\n",
+ "\n",
+ "#at the end of 6th heater\n",
+ "Re6=vel*6*x1/(v)\n",
+ "#Nux=10.0359*(Rex**(0.8)-830)*Pr**(1/3)\n",
+ "h6=0.0359*(Re5**(0.8)-830)*Pr**(1/3.0)*(k/(10.3*x1))\n",
+ "x6=0.24\n",
+ "Q4=h6*x6*(b)*(Tw-T_inf) #Q4=q1+q2+q3+q4+q5+q6\n",
+ "q6=round(Q4,0)-round(Q3,0)\n",
+ "\n",
+ "#Result\n",
+ "print\"The wattage required for 1st heater is \",round(q1,0),\"W\"\n",
+ "print\"The wattage required for 2nd heater is \",round(q2,0),\"W\"\n",
+ "print\"The wattage required for 3rd heater is \",round(q3,1),\"W\"\n",
+ "print\"The wattage required for 4th heater is \",round(q4,0),\"W\"\n",
+ "print\"The wattage required for 5th heater is \",round(q5,0),\"W\"\n",
+ "print\"The wattage required for 6th heater is \",round(q6,1),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The wattage required for 1st heater is 211.0 W\n",
+ "The wattage required for 2nd heater is 87.0 W\n",
+ "The wattage required for 3rd heater is 67.0 W\n",
+ "The wattage required for 4th heater is 56.0 W\n",
+ "The wattage required for 5th heater is 132.0 W\n",
+ "The wattage required for 6th heater is 213.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8 page NO. 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimation of force exerted on the pole\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at given conditions from appendix table D1\n",
+ "rou= 0.0735 # density in Ibm/ft**3 \n",
+ "v= 16.88e-5 # viscosity in ft**2/s \n",
+ "V=20*5280/3600.0 # flow velocity in ft/s\n",
+ "D=1.0 # diameter of pole in ft\n",
+ "L=30.0 # length of pole in ft\n",
+ "gc=32.2\n",
+ "Re_D=V*D/v # Reynolds Number for flow past the pole\n",
+ "Cd_cylinder=1.1 # value of Cd for smooth cylinder from figure 7.22\n",
+ "A_cylinder=D*L # frontal area of pole\n",
+ "\n",
+ "#Calculation\n",
+ "Df_cylinder=Cd_cylinder*(0.5)*rou*V**2*A_cylinder/gc\n",
+ "D_square=2/12.0 # length of square part of pole\n",
+ "L_square=4\n",
+ "Re_square=V*D_square/v # Reynolds Number for square part of pole\n",
+ "Cd_square=2 # Corresponding value of Cd for square part from figure 7.23\n",
+ "A_square=D_square*L_square # projected frontal area of square part\n",
+ "Df_square=Cd_square*(0.5)*rou*V**2*A_square/gc\n",
+ "Df_total=Df_cylinder+Df_square\n",
+ "print\"The total drag force on the pole is \",round(Df_total,1),\"lbf\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total drag force on the pole is 33.7 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.9 page NO. 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of required current\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at film temperature (300 + 500)/2 = 400 K from appendix table D1\n",
+ "rou= 0.883 # density in kg/cu.m\n",
+ "cp= 1014 # specific heat in J/(kg*K) \n",
+ "v= 25.90e-6 # viscosity in sq.m/s \n",
+ "Pr = 0.689 # Prandtl Number \n",
+ "kf= 0.03365 # thermal conductivity in W/(m.K)\n",
+ "a = 0.376e-4 # diffusivity in sq.m/s\n",
+ "V_inf=1 # velocity in m/s\n",
+ "D=0.00013 # diameter in m\n",
+ "L=0.01 # length of wire in cm\n",
+ "Re_D=V_inf*D/v # The Reynolds number of flow past the wire\n",
+ "C=0.911 #value of C for cylinder from table 7.4\n",
+ "m=0.385 #value of m for cylinder from table 7.4\n",
+ "\n",
+ "#calculation\n",
+ "hc=kf*C*(Re_D)**m*(Pr)**(1/3)/D # the convection coefficient in W/(m**2.K)\n",
+ "Tw=500 # air stream temperature in K\n",
+ "T_inf=300 # wire surface temperature in K\n",
+ "As=math.pi*D*L # cross sectional area in sq.m\n",
+ "qw=hc*As*(Tw-T_inf) # The heat transferred to the air from the wire\n",
+ "resistivity=17e-6 # resistivity in ohm cm\n",
+ "Resistance=resistivity*(L/(math.pi*D**2)) # resistance in ohm\n",
+ "i=(qw*100/Resistance)**0.5 # current in ampere\n",
+ "\n",
+ "#Result\n",
+ "print\"The current is %.1f A\",round(i,1),\"A\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current is %.1f A 3.3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10 page NO.393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of the pressure drop for the air passing over the tubes and the heat transferred to the air.\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at 70 + 460 = 530 degree R = 540 degree R from appendix table D1\n",
+ "rou= 0.0735 # density in Ibm/cu.ft \n",
+ "cp=0.240 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 16.88e-5 # viscosity in sq.ft/s \n",
+ "kf = 0.01516 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 0.859 # diffusivity in sq.ft/hr \n",
+ "Pr = 0.708 # Prandtl Number\n",
+ "# specifications of 3/4 standard type K copper tubing from appendix table F2\n",
+ "OD=0.875/12 # outer diameter in ft\n",
+ "ID=0.06208 # inner diameter in ft\n",
+ "A=0.003027 # cross sectional area in sq.ft\n",
+ "L=2\n",
+ "sL=1.5/12\n",
+ "sT=1.3/12\n",
+ "V_inf=12 # velocity of air in ft/s\n",
+ "\n",
+ "#calculation\n",
+ "V1=(sT*V_inf)/(sT-OD) # velocity at area A1 in ft/s\n",
+ "sD=((sL)**2+(sT/2)**2)**0.5 # diagonal pitch in inch\n",
+ "V2=(sT*V_inf)/(2*(sD-OD))\n",
+ "Vmax=V1\n",
+ "Re_D=Vmax*OD/v # Reynolds Number\n",
+ "sT_OD=1.3/0.875\n",
+ "sT_sL=1.3/1.5\n",
+ "f1=0.35 # value of f1 for above values of sT/Do and Re\n",
+ "f2=1.05 #Corresponding value of f2 for above values of sT/sL and Re\n",
+ "gc=32.2\n",
+ "N=7\n",
+ "dP=N*f1*f2*(rou*Vmax**2/(2*gc))\n",
+ "sL_Do=sL/OD\n",
+ "C1=0.438 #value of C1 for above values of sT/Do and sL/Do\n",
+ "C2=0.97 #value of C2 for above values of sT/Do and sL/Do\n",
+ "m=0.565 #value of m for above values of sT/Do and sL/Do\n",
+ "hc=kf*1.13*C1*C2*(Re_D)**m*(Pr)**(1/3.0)/OD # The convection coefficient\n",
+ "As=70*math.pi*OD*L # outside surface area of 70 tubes\n",
+ "Tw=200 # outside surface temeperature in degree F\n",
+ "T_inf=70 # air temperature in degree F\n",
+ "q=hc*As*(Tw-T_inf) # heat transferred\n",
+ "\n",
+ "#result\n",
+ "print\"The pressure drop is \",round(dP/147,3),\"psi\"\n",
+ "print\"The heat transferred is\",round(q,1),\" BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop is 0.027 psi\n",
+ "The heat transferred is 87571.6 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER8.ipynb b/Engineering_Heat_Transfer/CHAPTER8.ipynb
new file mode 100644
index 00000000..a70f7944
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER8.ipynb
@@ -0,0 +1,527 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Natural Convection System"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page No. 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat transferred to the wall.\n",
+ "\n",
+ "#Given\n",
+ "# air properties at (400+120)/2 =260 degree F = 720 degree R from Appendix Table D1\n",
+ "rou= 0.0551 # density in Ibm/cu.ft \n",
+ "cp=0.2420 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 27.88e-5 # viscosity in sq.ft/s \n",
+ "kf = 0.01944 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 1.457 # diffusivity in sq.ft/hr \n",
+ "Pr = 0.689 # Prandtl Number\n",
+ "T_inf=120.0+460.0 # wall temperature in degree R\n",
+ "Tw=400.0+460.0 # inside wall temperature in degree R\n",
+ "Beta=1/T_inf\n",
+ "\n",
+ "#IN THE BOOK THERE IS CALCULATION MISTAKE IN Beta\n",
+ "#Accoding to book Beta=0.00116 /R\n",
+ "Beta_=0.00116\n",
+ "gc=32.2\n",
+ "L=1.0 # length of wall in ft\n",
+ "W=2.0 # width in ft\n",
+ "Gr=(gc*Beta_*(Tw-T_inf)*L**3)/v**2 # Grashof Number\n",
+ "temperature_slope=0.505 #temperature slope from table 8.1 \n",
+ "hL=(kf/L)*(4/3.0)*(Gr/4.0)**(1/4.0)*temperature_slope \n",
+ "A=L*W # cross sectional area in sq.ft\n",
+ "qw=hL*A*(Tw-T_inf)\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transferred is\",round(qw,0),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred is 558.0 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page No. 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of heat lost through the glass per unit area\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at 0 + 273 K=273 K from appendix table D1\n",
+ "rou1=1.295 # density in kg/cu.m\n",
+ "cp1=1005.5 # specific heat in J/(kg*K) \n",
+ "v1=12.59e-6 # viscosity in sq.m/s \n",
+ "Pr1=0.713 # Prandtl Number \n",
+ "kf1=0.02426 # thermal conductivity in W/(m.K)\n",
+ "a1=0.17661e-4 # diffusivity in sq.m/s \n",
+ "T_inf1=0 # inside and outside temperature in K\n",
+ "Beta1=1/(T_inf1+273.0) # volumetric thermal expansion coefficient at 295 K and 273 K\n",
+ "\n",
+ "# properties of air at 22 + 273 = 295 K = 300 K(approx) \n",
+ "rou2=1.177 # density in kg/cu.m\n",
+ "cp2=1005 # specific heat in J/(kg*K) \n",
+ "v2=15.68e-6 # viscosity in sq.m/s \n",
+ "Pr2=0.708 # Prandtl Number \n",
+ "kf2=0.02624 # thermal conductivity in W/(m.K)\n",
+ "a2=0.22160e-4 # diffusivity in sq.m/s \n",
+ "T_inf2=22.0 # inside and outside temperature in K\n",
+ "Beta2=1/(T_inf2+273.0) # volumetric thermal expansion coefficient at 295 K and 273 K\n",
+ "\n",
+ "g=9.81\n",
+ "t=0.005 # thickness of glass\n",
+ "L=0.60 # window length in m\n",
+ "k=0.81 # thermal conductivity of glass from appendix table B3\n",
+ "# for first guess\n",
+ "Tw1=18\n",
+ "Tw2=4\n",
+ "Ra1=(g*Beta1*(Tw2-T_inf1)*L**3)/(v1*a1)\n",
+ "hL1=(kf1/L)*(0.68+((0.67*((abs(Ra1)))**(1/4.0))/(1+(0.492/Pr1)**(9/16.0))**(4/9.0)))\n",
+ "Ra2=(g*Beta2*(Tw1-T_inf2)*L**3)/(v2*a2)\n",
+ "hL2=(kf2/L)*(0.68+((0.67*(abs(Ra2))**(1/4.0))/(1+(0.492/Pr2)**(9/16.0))**(4/9.0)))\n",
+ "q1=(T_inf1-T_inf2)/((1/hL2)+(t/k)+(1/hL1))\n",
+ "Tw2_=T_inf2-(q1/hL2)\n",
+ "Tw1_=q1/hL1+T_inf1\n",
+ "\n",
+ "#Using these temprature as second estimates\n",
+ "Ra1_=3.7*10**8\n",
+ "hL1_=2.92\n",
+ "Ra2_=2.31*10**8\n",
+ "hL2_=2.80\n",
+ "q2=(T_inf2-T_inf1)/((1/hL2_)+(t/k)+(1/hL1_))\n",
+ "\n",
+ "#The wall temprature are\n",
+ "Tw2final=q2-T_inf2\n",
+ "Tw1final=10.7\n",
+ "\n",
+ "#result\n",
+ "print\"The heat loss is \",round(q2,1),\" W/sq.m\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat loss is 31.2 W/sq.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page No.419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat loss through the side.\n",
+ "\n",
+ "#Given\n",
+ "rou= 0.0735 # density in Ibm/cu.ft \n",
+ "cp=0.240 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 16.88e-5 # viscosity in sq.ft/s \n",
+ "kf = 0.01516 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 0.859 # diffusivity in sq.ft/hr \n",
+ "Pr = 0.708 # Prandtl Number\n",
+ "Tw=90\n",
+ "T_inf=70\n",
+ "g=32.2\n",
+ "L=5.5 # length in ft\n",
+ "W=2+(4/12.0) # width in ft\n",
+ "Beta=1/(Tw+460.0) # volumetric thermal expansion coefficient in per degree Rankine\n",
+ "Ra=(g*Beta*(Tw-T_inf)*L**3)/(v*a/3600)\n",
+ "hc=(kf/L)*(0.825+((0.387*(Ra)**(1/6.0))/(1+(0.492/Pr)**(9/16.0))**(8/27.0)))**2\n",
+ "q=hc*L*W*(Tw-T_inf)\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat gained is %d BTU/hr\",round(q,0),\"BTU/hr\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat gained is %d BTU/hr 142.0 BTU/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no. 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the variation of average convection coefficient with distance\n",
+ "# properties of air at (65 + 20)/2 = 42.5 degree C =315 K. from appendix table D1\n",
+ "rou= 1123 # density in kg/m^3 \n",
+ "cp= 1006.7 # specific heat in J/(kg*K) \n",
+ "v= 17.204e-6 # vismath.cosity in m^2/s \n",
+ "Pr =0.703 # Prandtl Number \n",
+ "kf= 0.02738 # thermal conductivity in W/(m.K)\n",
+ "a = 0.2446e-4 # diffusivity in m^2/s \n",
+ "g=9.81\n",
+ "L=5.0\n",
+ "theta=45\n",
+ "T_inf=20.0 # ambient air temperature in degree C\n",
+ "Tw=65 # roof surface temperature in degree C\n",
+ "Beta=1/(T_inf+273.0) # volumetric thermal math.expansion coefficient in per K\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "# determination of Laminar-turbulent transition length by Vliet equation Ra=3x10^5xmath.exp(0.1368math.cos(90-theta))\n",
+ "x=((3e5*math.exp(0.1368*math.cos(90-theta))*v*a)/(g*math.cos(theta)*Beta*(Tw-T_inf)))**(1/3.0)\n",
+ "x=0.051\n",
+ "print\"The Laminar-turbulent transition length by Vliet equation is \",round(x,3),\"m\\n\\n\"\n",
+ "lists=[0.02,0.04,0.051,0.051,0.1,1.0,3,5]\n",
+ "Ra=[0,0,0,0,0,0,0,0]\n",
+ "hc=[0,0,0,0,0,0,0,0]\n",
+ "print\"_______________________________________________________\"\n",
+ "print\"x(m)\\t\\tRaL\\t\\t\\thc(W/[m.K])\"\n",
+ "print\"_______________________________________________________\"\n",
+ "for i in range(0,8):\n",
+ " if lists[i]<x:\n",
+ " # Laminar Flow regime exists\n",
+ " Ra[i]=(g*math.cos(math.pi*45.0/180.0)*Beta*(Tw-T_inf)*lists[i]**3)/(v*a)\n",
+ " hc[i]=(kf/lists[i])*(0.68+(0.670*Ra[i]**(1/4.0))/(1+(0.492/Pr)**(9/16.0))**(4.0/9.0))\n",
+ " print lists[i],\"\\t\\t%.4g\"%Ra[i],\"\\t\\t%.3g\"%hc[i]\n",
+ " else:\n",
+ " # Turbulent Flow regime exists\n",
+ " Ra[i]=(g*Beta*(Tw-T_inf)*lists[i]**3)/(v*a)\n",
+ " hc[i]=(0.02738/lists[i])*(0.825+0.324*Ra[i]**(1/6.0))**2\n",
+ " print lists[i],\"\\t\\t%.4g\"%Ra[i],\"\\t\\t%.3g\"%hc[i]\n",
+ " \n",
+ "print\"\\n\\nNOTE:\\nCalculation mistake in book in calculation of Ral and hc,when x=0.04(2nd step in loop)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Laminar-turbulent transition length by Vliet equation is 0.051 m\n",
+ "\n",
+ "\n",
+ "_______________________________________________________\n",
+ "x(m)\t\tRaL\t\t\thc(W/[m.K])\n",
+ "_______________________________________________________\n",
+ "0.02 \t\t2.025e+04 \t\t9.32\n",
+ "0.04 \t\t1.62e+05 \t\t7.52\n",
+ "0.051 \t\t4.749e+05 \t\t7.3\n",
+ "0.051 \t\t4.749e+05 \t\t7.3\n",
+ "0.1 \t\t3.58e+06 \t\t6.39\n",
+ "1.0 \t\t3.58e+09 \t\t4.99\n",
+ "3 \t\t9.667e+10 \t\t4.73\n",
+ "5 \t\t4.475e+11 \t\t4.66\n",
+ "\n",
+ "\n",
+ "NOTE:\n",
+ "Calculation mistake in book in calculation of Ral and hc,when x=0.04(2nd step in loop)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page No. 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determine if heat is lost lose more heat through its upper surface or one of its vertical sides\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at (100 + 60)/2 = 80\u00b0F = 540 degree R from appendix table D1\n",
+ "rou= 0.0735 # density in lbm/cu.ft\n",
+ "cp=0.240 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 16.88e-5 # viscosity in sq.ft/s \n",
+ "kf = 0.01516 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 0.859 # diffusivity in sq.ft/hr \n",
+ "Pr = 0.708 # Prandtl Number\n",
+ "Tw=100.0 # temperature of outside surface temperature of oven in degree F\n",
+ "T_inf=60.0 # ambient temperature in degree F\n",
+ "g=32.2\n",
+ "L=2.0 # length in ft\n",
+ "W=2.0 # width in ft\n",
+ "\n",
+ "#Calculation\n",
+ "Beta=1/(T_inf+460.0) # volumetric thermal expansion coefficient in per degree Rankine\n",
+ "Ra=(g*Beta*(Tw-T_inf)*L**3)/(v*a/3600.0)\n",
+ "hc=(kf/L)*(0.68+(0.670*Ra**(0.25))/(1+(0.492/Pr)**(9/16.0))**(4/9.0))\n",
+ "q1side=hc*L*W*(Tw-T_inf)\n",
+ "# For the top, we have a heated surface facing upward, The characteristic length is determined as follows\n",
+ "Lc=0.5\n",
+ "Ra_L=(g*Beta*(Tw-T_inf)*Lc**3)/(v*a/3600.0) # Rayleigh number based on characteristic length\n",
+ "hc_L=(kf/Lc)*0.54*(Ra_L)**(1/4.0)\n",
+ "qtop=hc_L*L*W*(Tw-T_inf)\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transferred from one side is \",round(q1side,1),\"BTU/hr\"\n",
+ "print\"The heat transferred from top is \",round(qtop,0),\"BTU/hr\"\n",
+ "\n",
+ "if qtop < q1side:\n",
+ " \n",
+ " print\"More heat is transfered from side\" \n",
+ "else:\n",
+ " print \"More heat is transfered top side\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred from one side is 93.7 BTU/hr\n",
+ "The heat transferred from top is 138.0 BTU/hr\n",
+ "More heat is transfered top side\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page No.427"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of heat lost from the insulation by convection\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at (50 + 5)/2 = 27.5 degree C = 300 K from appendix table D1\n",
+ "rou= 1.177 # density in kg/cu.m\n",
+ "cp= 1005.7 # specific heat in J/(kg*K) \n",
+ "v= 15.68e-6 # viscosity in sq.m/s \n",
+ "Pr =0.708 # Prandtl Number \n",
+ "kf=0.02624 # thermal conductivity in W/(m.K)\n",
+ "a=0.22160e-4 # diffusivity in sq.m/s \n",
+ "g=9.81\n",
+ "L=4.0 # length in m\n",
+ "D=15/100.0 # diameter in m\n",
+ "T_inf=5.0 # ambient air temperature in degree C\n",
+ "Tw=50.0 # outside surface temperature in degree C\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Beta=1/(T_inf+273.0) # volumetric thermal expansion coefficient in per K\n",
+ "Ra=(g*Beta*(Tw-T_inf)*D**3)/(v*a)\n",
+ "# for horizontal pipe, the convective coefficient is determined as follows\n",
+ "hc_h=(kf/D)*(0.60+(0.387*Ra**(1/6.0))/(1+(0.559/Pr)**(9/16.0))**(8/27.0))**2\n",
+ "As=math.pi*D*L\n",
+ "q_hor=hc_h*As*(Tw-T_inf)\n",
+ "# for vertical pipe, the convective coefficient is determined as follows\n",
+ "hc_v=(kf/D)*0.6*(Ra*(D/L))**(1/4.0)\n",
+ "q_ver=hc_v*As*(Tw-T_inf)\n",
+ "q=round(q_ver,0)+round(q_hor,0)\n",
+ "\n",
+ "#Result\n",
+ "print\"The heat transferred from the horizontal length of 4 m is \",round(q_hor,0),\"W\"\n",
+ "print\"The heat transferred from the vertical length of 4 m is \",round(q_ver,0),\"W\"\n",
+ "print\"nThe total heat lost from the pipe is \",round(q,2),\"W\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred from the horizontal length of 4 m is 477.0 W\n",
+ "The heat transferred from the vertical length of 4 m is 246.0 W\n",
+ "nThe total heat lost from the pipe is 723.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page No. 430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determinion of the convection coefficient about the ice cube\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at (0 + 70)/2 = 35\u00b0F == 495 degree R from appendix table D1\n",
+ "rou= 0.0809 # density in lbm/cu.ft \n",
+ "cp=0.240 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v= 13.54e-5 # viscosity in sq.ft/s \n",
+ "kf = 0.01402 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a = 0.685 # diffusivity in sq.ft/hr \n",
+ "Pr = 0.712 # Prandtl Number\n",
+ "Tw=0 # temperature of outside surface temperature of oven in degree F\n",
+ "T_inf=70.0 # ambient temperature in degree F\n",
+ "g=32.2\n",
+ "Beta=1/(T_inf+460.0) # volumetric thermal expansion coefficient in per degree Rankine\n",
+ "# The characteristic length is found by using King Equation\n",
+ "Lc=1/((1/1)+(1/1.2))\n",
+ "Ra=(g*Beta*abs(Tw-T_inf)*Lc**3)/(v*a/3600.0)\n",
+ "hc=(kf/Lc)*0.6*(Ra)**(1/4.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"The value of convection coefficient is \",round(hc,2),\"BTU/(hr.sq.ft.degree R)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of convection coefficient is 1.11 BTU/(hr.sq.ft.degree R)\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page No.433"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of the maximum amount of heat that fins can transfer\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at (100 + 35)/2 = 67.5 degree C from appendix table D1\n",
+ "rou= 0.998 # density in kg/cu.m\n",
+ "cp= 1009.0 # specific heat in J/(kg*K) \n",
+ "v= 20.76e-6 # viscosity in sq.m/s \n",
+ "Pr =0.697 # Prandtl Number \n",
+ "kf= 0.03003 # thermal conductivity in W/(m.K)\n",
+ "a = 0.2983e-4 # diffusivity in sq.m/s \n",
+ "g=9.81\n",
+ "T_inf=35 # ambient air temperature in degree C\n",
+ "Tw=100 # surface temperature in degree C\n",
+ "Beta=1/(T_inf+273.0) # volumetric thermal expansion coefficient in per K\n",
+ "# properties of aluminium from appendix table B1\n",
+ "rou_Al=2702 # density in kg/cu.m\n",
+ "k_Al=236 # thermal conductivity in W/(m.K)\n",
+ "cp_Al=896 # specific heat in J/(kg*K) \n",
+ "a_Al=97.5e-6 # diffusivity in sq.m/s \n",
+ "b=46/100.0\n",
+ "w=24/100.0\n",
+ "\n",
+ "#Calculation\n",
+ "# Applying the Bar-Cohen Equations\n",
+ "zeta=((w*v**2)/(g*Beta*(Tw-T_inf)*Pr))**(1/4.0)\n",
+ "L=1.54*(k_Al/kf)**(1/2)*zeta\n",
+ "S=2.89*zeta\n",
+ "q=(b*w*(Tw-T_inf)*1.3*(k_Al*kf)**(1/2.0))/(6*zeta)\n",
+ "N=b/(2*S)\n",
+ "\n",
+ "#result\n",
+ "print\"The heat transfer rate is \",round(q,0),\"W\"\n",
+ "print\"The number of fins can be atmost\",round(N,0)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer rate is 1423.0 W\n",
+ "The number of fins can be atmost 27.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER9.ipynb b/Engineering_Heat_Transfer/CHAPTER9.ipynb
new file mode 100644
index 00000000..c1ada237
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER9.ipynb
@@ -0,0 +1,571 @@
+{
+ "metadata": {
+ "name": "CHAPTER9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Heat Exchanger"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page No.458"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determination of counterflow and parallel-flow configurations. \n",
+ "\n",
+ "#Given\n",
+ "# temperatures of hot fluid in degree C\n",
+ "T1=100.0 \n",
+ "T2=75.0\n",
+ "# temperatures of cold fluid in degree C\n",
+ "t1=5.0\n",
+ "t2=50.0\n",
+ "\n",
+ "#Calculation\n",
+ "# for counterflow\n",
+ "import math\n",
+ "LMTD_counter=((T1-t2)-(T2-t1))/(math.log((T1-t2)/(T2-t1)))\n",
+ "# for parallel flow\n",
+ "LMTD_parallel=((T1-t1)-(T2-t2))/(math.log((T1-t1)/(T2-t2)))\n",
+ "\n",
+ "#Result\n",
+ "print\"The LMTD for counter flow configuration is \",round(LMTD_counter,1),\"C\"\n",
+ "print\"The LMTD for parallel flow configuration is \",round(LMTD_parallel,2),\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The LMTD for counter flow configuration is 59.4 C\n",
+ "The LMTD for parallel flow configuration is 52.43 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page No. 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the LMTD for both counterflow and parallel-flow configurations. \n",
+ "\n",
+ "#Given\n",
+ "# temperatures of hot fluid in degree F\n",
+ "T1=250\n",
+ "T2=150\n",
+ "# temperatures of cold fluid in degree F\n",
+ "t1=100\n",
+ "t2=150\n",
+ "\n",
+ "#calculation\n",
+ "# for counterflow\n",
+ "import math\n",
+ "LMTD_counter=((T1-t2)-(T2-t1))/(math.log((T1-t2)/(T2-t1)));\n",
+ "# for parallel flow\n",
+ "LMTD_parrelel=0\n",
+ "\n",
+ "#Result\n",
+ "print\"The LMTD for counter flow configuration is\",round(LMTD_counter,1),\"C\"\n",
+ "print\"if parallel flow is to give equal outlet temperatures,then the area needed must be infinite which is not feasible economically.\"\n",
+ "print\"The LMTD for parrelel flow configuration is\",LMTD_parrelel,\"C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The LMTD for counter flow configuration is 72.1 C\n",
+ "if parallel flow is to give equal outlet temperatures,then the area needed must be infinite which is not feasible economically.\n",
+ "The LMTD for parrelel flow configuration is 0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page No.463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the outlet temperature of the ethylene glycol for counterflow.\n",
+ "\n",
+ "#Given\n",
+ "# properties of air at (195 + 85)/2 = 140\u00b0F. from appendix table CII\n",
+ "rou_1= 0.985*62.4 # density in lbm/ft**3 \n",
+ "cp_1=0.9994 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_1= 0.514e-5 # viscosity in ft**2/s \n",
+ "kf_1 = 0.376 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a_1 = 6.02e-3 # diffusivity in ft**2/hr \n",
+ "Pr_1 = 3.02 # Prandtl Number \n",
+ "m_1=5000 # mass flow rate in lbm/hr\n",
+ "T_1=195 # temperature in degree F\n",
+ "# properties of ethylene glycol at 140 degree F from Appendix Table C.5\n",
+ "rou_2= 1.087*62.4 # density in lbm/ft**3 \n",
+ "cp_2=0.612 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_2= 5.11e-5 # viscosity in ft**2/s \n",
+ "kf_2 = 0.150 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a_2 = 3.61e-3 # diffusivity in ft**2/hr \n",
+ "Pr_2 = 51 # Prandtl Number \n",
+ "m_2=12000 # mass flow rate in lbm/hr\n",
+ "T_2=85 # temperature in degree F\n",
+ "# specifications of seamless copper water tubing (subscripts: a = annulus, p = inner pipe or tube) from appendix table F2\n",
+ "ID_a=0.1674\n",
+ "ID_p=0.1076\n",
+ "OD_p=1.375/12\n",
+ "# Flow Areas\n",
+ "A_p=math.pi*ID_p**2/4\n",
+ "A_a=math.pi*((ID_a)**2-(OD_p)**2)/4\n",
+ "\n",
+ "# Annulus Equivalent Diameters\n",
+ "D_h=ID_a-OD_p\n",
+ "D_e=(ID_a**2-OD_p**2)/(OD_p)\n",
+ "\n",
+ "# Reynolds Numbers \n",
+ "Re_1=(m_1/3600.0)*(ID_p)/(v_1*rou_1*A_p)\n",
+ "Re_2=(m_2/3600.0)*(D_e)/(v_2*rou_2*A_a)\n",
+ "\n",
+ "# Nusselt numbers\n",
+ "Nu_1=0.023*(Re_1)**(4/5.0)*(Pr_1)**0.3\n",
+ "Nu_2=0.023*(Re_2)**(4/5.0)*(Pr_2)**0.4\n",
+ "\n",
+ "# Convection Coefficients \n",
+ "h_1i=Nu_1*kf_1/ID_p\n",
+ "h_1o=h_1i*ID_p/OD_p\n",
+ "h_2=Nu_2*kf_2/D_e\n",
+ "\n",
+ "# Exchanger Coefficient \n",
+ "Uo=1/((1/h_1o)+(1/h_2))\n",
+ "R=(m_2*cp_2)/(m_1*cp_1)\n",
+ "L=20\n",
+ "A=math.pi*OD_p*L\n",
+ "T1=195\n",
+ "t1=85\n",
+ "T2=((T1*(R-1))-(R*t1*(1-exp((Uo*A*(R-1))/(m_2*cp_2)))))/(R*exp(Uo*A*(R-1)/(m_2*cp_2))-1)\n",
+ "t2=t1+(T1-T2)/R\n",
+ "print\"The outlet temperature of Ethylene glycol is %.1f degree F\",round(t2,1),\"F\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The outlet temperature of Ethylene glycol is %.1f degree F 99.4 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page No. 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of (a) no. of exchangers required, (b) the overall coefficient of (all) the exchanger(s), and (c) the pressure drop for each stream. \n",
+ "\n",
+ "#Given\n",
+ "# assuming counterflow arrangement\n",
+ "# properties of air at 323 K. from appendix table D1\n",
+ "rou_1= 1.088 \t\t# density in kg/m**3 \n",
+ "cp_1= 1007\t\t # specific heat in J/(kg*K) \n",
+ "v_1= 18.2e-6\t\t # viscosity in m**2/s \n",
+ "Pr_1 =0.703 \t\t# Prandtl Number \n",
+ "kf_1= 0.02814 \t\t# thermal conductivity in W/(m.K)\n",
+ "a_1 = 0.26e-4 \t\t# diffusivity in m**2/s \n",
+ "m_1=100 \t\t # mass flow rate in kg/hr\n",
+ "# temperatures in K\n",
+ "t1_air=20+273 \n",
+ "t2_air=80+273\n",
+ "# properties of carbon dioxide at [600 + (20 + 273)]/2 = 480 = 500 K. from appendix table D2\n",
+ "rou_2= 1.0732\t\t # density in kg/m**3 \n",
+ "cp_2= 1013 \t\t# specific heat in J/(kg*K) \n",
+ "v_2= 21.67e-6 \t #viscosity in m**2/s \n",
+ "Pr_2 =0.702 \t\t# Prandtl Number \n",
+ "kf_2= 0.03352 \t\t# thermal conductivity in W/(m.K)\n",
+ "a_2 = 0.3084e-4 \t\t# diffusivity in m**2/s \n",
+ "m_2=90\t\t\t # mass flow rate in kg/hr\n",
+ "# temperatures in K\n",
+ "T1_CO2=600 \n",
+ "# specifications of seamless copper tubing from appendix table F2\n",
+ "ID_a=.098\n",
+ "ID_p=.07384\n",
+ "OD_p=.07938\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "# Flow Areas\n",
+ "A_p=math.pi*ID_p**(2)/4.0\n",
+ "A_a=math.pi*((ID_a)**2-(OD_p)**2)/4.0\n",
+ "\n",
+ "# Heat Balance \n",
+ "q_air=(m_1/3600.0)*(cp_1)*(t2_air-t1_air)\n",
+ "T2_CO2=T1_CO2-(q_air/(m_2*cp_2/3600.0))\n",
+ "\n",
+ "# Log-Mean Temperature Difference\n",
+ "LMTD_counter=((T1_CO2-t2_air)-(T2_CO2-t1_air))/(log((T1_CO2-t2_air)/(T2_CO2-t1_air)))\n",
+ "# Annulus Equivalent Diameters\n",
+ "D_h=ID_a-OD_p\n",
+ "D_e=(ID_a**2-OD_p**2)/(OD_p)\n",
+ "\n",
+ "# Reynolds Numbers \n",
+ "Re_1=(m_1/3600.0)*(ID_p)/(v_1*rou_1*A_p)\n",
+ "Re_2=(m_2/3600.0)*(D_e)/(v_2*rou_2*A_a)\n",
+ "\n",
+ "# Nusselt numbers\n",
+ "Nu_1=0.023*(Re_1)**(0.8)*(Pr_1)**0.3\n",
+ "Nu_2=0.023*(Re_2)**(0.8)*(Pr_2)**0.4\n",
+ "\n",
+ "# Convection Coefficients \n",
+ "\n",
+ "h_1i=Nu_1*kf_1/ID_p\n",
+ "h_1o=h_1i*ID_p/OD_p\n",
+ "h_2=Nu_2*kf_2/D_e\n",
+ "\n",
+ "# Fouling Factors in (m**2.K)/W\n",
+ "Rd_air=0.0004\n",
+ "Rd_CO2=0.002\n",
+ "\n",
+ "# exchanger coefficients\n",
+ "Uo=1/((1/h_1o)+(1/h_2))\n",
+ "Uo=1/((1/Uo)+Rd_air+Rd_CO2)\n",
+ "\n",
+ "# area required\n",
+ "A=q_air/(Uo*LMTD_counter)\n",
+ "\n",
+ "# surface area of one exchanger is A=math.pi*OD*L, so\n",
+ "L=(A/(math.pi*OD_p)) # length of each exchanger\n",
+ "L_available=2 # available exchanger length\n",
+ "N=L_available/L # no. of exchangers\n",
+ "\n",
+ "#friction factors\n",
+ "fp=0.0245 #friction factor for air fom figure 6.14 corresponding to Re\n",
+ "fa=0.033 #friction factor for cCO2fom figure 6.14 corresponding to Re\n",
+ "# Velocities\n",
+ "V_air=(m_1/3600.0)/(rou_1*A_p)\n",
+ "V_CO2=(m_2/3600.0)/(rou_2*A_a)\n",
+ "\n",
+ "# pressure drops\n",
+ "dP_p=(fp*L_available*rou_1*V_air**2)/(ID_p*2)\n",
+ "dP_a=((rou_2*V_CO2**2)/2.0)*((fa*L_available/D_h)+1)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The number of exchangers is \",round(N,0)\n",
+ "print\"(b)The overall exchanger coefficient is \",round(Uo,1),\" W/(sq.m.K)\"\n",
+ "print\"(c)The pressure drop for tube side is \",round(dP_p,2),\"Pa\"\n",
+ "print\"The pressure drop for shell side is \",round(dP_a,1),\"Pa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The number of exchangers is 1.0\n",
+ "(b)The overall exchanger coefficient is 14.2 W/(sq.m.K)\n",
+ "(c)The pressure drop for tube side is 12.83 Pa\n",
+ "The pressure drop for shell side is 196.7 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page No. 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the outlet temperature of the distilled water and the pressure drop for each stream. \n",
+ "\n",
+ "#Given\n",
+ "# properties of (distilled) water at 104\u00b0F from appendix table CII\n",
+ "rou_1= 0.994*62.4 # density in lbm/ft**3 \n",
+ "cp_1=0.998 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_1= 0.708e-5 # viscosity in ft**2/s \n",
+ "kf_1 = 0.363 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a_1 = 5.86e-3 # diffusivity in ft**2/hr \n",
+ "Pr_1 = 4.34 # Prandtl Number \n",
+ "m_1=170000 # mass flow rate in lbm/hr\n",
+ "T1=110.0 # temperature in degree F\n",
+ "# properties of (raw) water at 68\u00b0F from Appendix Table C11\n",
+ "rou_2= 62.4 # density in lbm/ft**3 \n",
+ "cp_2=0.9988 # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_2= 1.083e-5 # viscosity in ft**2/s \n",
+ "kf_2 = 0.345 # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a_2 = 5.54e-3 # diffusivity in ft**2/hr \n",
+ "Pr_2 = 7.02 # Prandtl Number \n",
+ "m_2=150000 # mass flow rate in lbm/hr\n",
+ "t1=65 # temperature in degree F\n",
+ "# specifications of 3/4-in-OD, 18-BWG tubes, from table 9.2\n",
+ "OD=3/(4*12.0)\n",
+ "ID=0.652/12.0\n",
+ "OD_p=1.375/12.0\n",
+ "Nt=224.0 # from table 9.3\n",
+ "Np=2 # no. of tube passes\n",
+ "# Shell dimensions and other miscellaneous data\n",
+ "Ds=17.25/12.0\n",
+ "Nb=15.0 # no. of baffles\n",
+ "B=1\n",
+ "sT=15/(16*12.0)\n",
+ "C=sT-OD\n",
+ "\n",
+ "#CALCULATION\n",
+ "import math\n",
+ "# flow areas\n",
+ "At=(Nt*math.pi*ID**2)/(4*Np)\n",
+ "As=(Ds*C*B)/sT\n",
+ "\n",
+ "# Shell Equivalent Diameter \n",
+ "De=4*((sT/2.0)*(0.86*sT)-(math.pi*OD**2/8.0))/(math.pi*OD/2.0)\n",
+ "\n",
+ "# Reynolds Numbers \n",
+ "Re_s=(m_1/3600.0)*(De)/(v_1*rou_1*As)\n",
+ "Re_t=(m_2/3600.0)*(ID)/(v_2*rou_2*At)\n",
+ "\n",
+ "# Nusselt numbers\n",
+ "Nu_t=0.023*(Re_t)**(0.8)*(Pr_2)**0.4\n",
+ "Nu_s=0.36*(Re_s)**(0.55)*(Pr_1)**(1/3.0)\n",
+ "h_ti=Nu_t*kf_2/ID\n",
+ "h_to=h_ti*ID/OD\n",
+ "h_s=Nu_s*kf_1/De\n",
+ "\n",
+ "# Exchanger Coefficient \n",
+ "Uo=1/((1/h_to)+(1/h_s))\n",
+ "R=(m_2*cp_2)/(m_1*cp_1)\n",
+ "L=16\n",
+ "Ao=Nt*math.pi*OD*L\n",
+ "UoAo_mccp=(Uo*Ao)/(m_2*cp_2)\n",
+ "S=0.58 #value of S from fig. 9.13 Ten Broeck graph corresponding to the value of (UoAo)/(McCpc)\n",
+ "t2=S*(T1-t1)+t1\n",
+ "T2=T1-R*(t2-t1)\n",
+ "#friction factors\n",
+ "ft=0.029 #friction factor for raw water fom figure 6.14 corresponding to Reynolds Number calculated above\n",
+ "fs=0.281 #friction factor for distilled water fom figure 6.14 corresponding to Reynolds Number calculated above\n",
+ "\n",
+ "# Velocities\n",
+ "V_t=(m_2/3600.0)/(rou_2*At)\n",
+ "V_s=(m_1/3600.0)/(rou_1*As)\n",
+ "\n",
+ "# pressure drops\n",
+ "gc=32.2\n",
+ "dP_t=(rou_2*V_t**2)*((ft*L*Np/ID)+4*Np)/(2*gc)\n",
+ "dP_s=((rou_1*V_s**2)*(fs*Ds*(Nb+1)))/(2*gc*De)\n",
+ "\n",
+ "#Result\n",
+ "print\"Outlet Temperatures of raw water is \",round(t2,1),\"F\"\n",
+ "print\"Outlet Temperatures of distilled water is \",round(T2,1),\"F\"\n",
+ "print\"\\nThe pressure drop for tube side is\",round(dP_t/147,1),\"psi\"\n",
+ "print\"The pressure drop for shell side is\",round(dP_s/147,1),\"psi\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.6 Page No.492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Using the effectiveness-NTU method to calculate the outlet temperatures of the fluids\n",
+ "\n",
+ "#Given\n",
+ "# Data from Example 9.5\n",
+ "# properties of (distilled) water at 104\u00b0F \n",
+ "m_1=170000 \t\t# mass flow rate in lbm/hr\n",
+ "T1=110 \t\t\t# temperature in degree F\n",
+ "cp_1=0.998\t\t # specific heat BTU/(lbm-degree Rankine) \n",
+ "# properties of (raw) water at 68\u00b0F \n",
+ "m_2=150000 \t\t# mass flow rate in lbm/hr\n",
+ "t1=65 \t\t\t# temperature in degree F\n",
+ "cp_2=0.9988\t # specific heat BTU/(lbm-degree Rankine) \n",
+ "Uo=350 \t\t\t# exchanger coefficient\n",
+ "Ao=703.7\n",
+ "# The effectiveness-NTU approach is used when the overall heat transfer coefficient is known\n",
+ "# determining the capacitances\n",
+ "mcp_raw=m_2*cp_2\n",
+ "mcp_distilled=m_1*cp_1\n",
+ "\n",
+ "# determination of parameters for determining effectiveness\n",
+ "mcp_min_max=mcp_raw/mcp_distilled\n",
+ "UA_mcpmin=(Uo*Ao)/(mcp_raw)\n",
+ "effectiveness=0.58 \t\t#value of effectiveness from figure 9.15 corresponding to the above calculated values of capacitance ratio and (UoAo/mcp_min)\n",
+ "qmax=mcp_raw*(T1-t1)\n",
+ "q=effectiveness*qmax \t# actual heat transfer\n",
+ "t2=(q/mcp_raw)+t1\n",
+ "T2=T1-(q/mcp_distilled)\n",
+ "\n",
+ "#Result\n",
+ "print\"The Outlet temperature is Raw Water is\",round(t2,1),\"F\"\n",
+ "print\"The Outlet temperature is disilled Water is\",round(T2,1),\"F\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Outlet temperature is Raw Water is 91.1 F\n",
+ "The Outlet temperature is disilled Water is 87.0 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page No. 499"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# (a) Determine the UA product for the exchanger. (b) Calculate the exit temperatures for the exchanger, assuming that only the inlet temperatures are known\n",
+ "# properties of engine oil at (190 + 158)/2 = 174\u00b0F = 176 degree F from appendix table C4\n",
+ "rou_1= 0.852*62.4\t\t # density in lbm/ft**3 \n",
+ "cp_1=0.509\t\t # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_1=0.404e-3 \t\t# viscosity in ft**2/s \n",
+ "kf_1=0.08 \t\t# thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a_1=2.98e-3 \t# diffusivity in ft**2/hr \n",
+ "Pr_1=490.0 \t\t# Prandtl Number \n",
+ "m_1=39.8 \t\t # mass flow rate in lbm/min\n",
+ "# temperatures in degree F\n",
+ "T1=190.0\n",
+ "T2=158.0\n",
+ "# properties of air at (126 + 166)/2 = 146\u00b0F = 606 degree R from appendix table D1\n",
+ "rou_2= 0.0653\t\t # density in lbm/ft**3 \n",
+ "cp_2=0.241\t\t # specific heat BTU/(lbm-degree Rankine) \n",
+ "v_2= 20.98e-5 \t\t# viscosity in ft**2/s \n",
+ "kf_2 = 0.01677 \t\t # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
+ "a_2 = 1.066 \t\t# diffusivity in ft**2/hr \n",
+ "Pr_2 = 0.706 \t\t# Prandtl Number \n",
+ "m_2=67.0 \t\t\t# mass flow rate in lbm/min\n",
+ "# temperatures in degree F\n",
+ "t1=126.0\n",
+ "t2=166.0\n",
+ "# Heat Balance\n",
+ "q_air=m_2*cp_2*60*(t2-t1)\n",
+ "q_oil=m_1*cp_1*60*(T1-T2)\n",
+ "\n",
+ "# for counterflow\n",
+ "import math\n",
+ "LMTD=((T1-t2)-(T2-t1))/(math.log((T1-t2)/(T2-t1)))\n",
+ "# Frontal Areas for Each Fluid Stream\n",
+ "Area_air=(9.82*8)/144.0\n",
+ "Area_oil=(3.25*9.82)/144.0\n",
+ "\n",
+ "# Correction Factors (parameters calculated first)\n",
+ "S=(t2-t1)/(T1-t1)\n",
+ "R=(T1-T2)/(t2-t1)\n",
+ "F=0.87 #value of correction factor from figure 9.21a corresponding to above calculated values of S and R\n",
+ "# Overall Coefficient (q = U*A*F*LMTD)\n",
+ "UA=q_air/(F*LMTD)\n",
+ "# determining the capacitances\n",
+ "mcp_air=m_2*cp_2*60\n",
+ "mcp_oil=m_1*cp_1*60\n",
+ "\n",
+ "# determination of parameters for determining effectiveness\n",
+ "mcp_min_max=mcp_air/mcp_oil\n",
+ "NTU=(UA/mcp_air)\n",
+ "effectiveness=0.62 \t\t#effectiveness from fig 9.21b corresponding to the values of capacitance ratio \n",
+ "t2_c=(T1-t1)*effectiveness+t1\n",
+ "T2_c=T1-(mcp_air)*(t2_c-t1)/(mcp_oil)\n",
+ "\n",
+ "#Result\n",
+ "print\"The Overall Coefficient is \",round(UA,0),\" BTU/(hr. degree R)\"\n",
+ "print\"Calculated outlet temprature are:\"\n",
+ "print\"Outlet temprature for air\",round(t2_c,1),\"F\"\n",
+ "print\"Outlet temprature for Engine Oil\",round(T2_c,0),\"F\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Overall Coefficient is 1602.0 BTU/(hr. degree R)\n",
+ "Calculated outlet temprature are:\n",
+ "Outlet temprature for air 165.7 F\n",
+ "Outlet temprature for Engine Oil 158.0 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/CHAPTER_3.ipynb b/Engineering_Heat_Transfer/CHAPTER_3.ipynb
new file mode 100644
index 00000000..93f29ad1
--- /dev/null
+++ b/Engineering_Heat_Transfer/CHAPTER_3.ipynb
@@ -0,0 +1,339 @@
+{
+ "metadata": {
+ "name": "CHAPTER 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3:Steady-State Conduction in Multiple Dimensions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page No.132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat-flow rate from one tube \n",
+ "# specifications of 1 standard type K from table F2\n",
+ "\n",
+ "#iven\n",
+ "OD=0.02858 # outer diameter in m\n",
+ "# from figure 3.11\n",
+ "M=8.0 # total number of heat-flow lanes\n",
+ "N=6.0 # number of squares per lane\n",
+ "S_L=M/N # conduction shape factor\n",
+ "k=0.128 # thermal conductivity in W/(m.K) for concrete from appendix table B3\n",
+ "T1=85 # temperature of tube surface\n",
+ "T2=0 # temperature of ground beneath the slab\n",
+ "\n",
+ "#Calculation\n",
+ "q_half=k*S_L*(T1-T2)\n",
+ "q=2*q_half\n",
+ "\n",
+ "#Result\n",
+ "print\"The total heat flow per tube is\",round(q,0),\" W/m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total heat flow per tube is 29.0 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page No.134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat transferred from the buried pipe per unit length\n",
+ "# shape factor number 8 is selected from table 3.1\n",
+ "# specifications of 10 nominal, schedule 80 pipe from table F1\n",
+ "\n",
+ "#Given\n",
+ "import math\n",
+ "OD=10.74/12 # diameter in ft\n",
+ "R=OD/2\n",
+ "T1=140.0\n",
+ "T2=65.0\n",
+ "k=0.072 # thermal conductivity in BTU/(hr-ft. degree R)\n",
+ "d=18.0/12.0 # distance from centre-line\n",
+ "S_L=(2*math.pi)/(math.acosh(d/R))\n",
+ "q_L=k*S_L*(T1-T2)\n",
+ "print\"The heat transferred from the buried pipe per unit length is \",round(q_L,2),\"BTU/(hr.ft)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transferred from the buried pipe per unit length is 18.05 BTU/(hr.ft)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page No.135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the heat lost through the walls, using the shape-factor method. \n",
+ "#(b) Repeat the calculations but neglect the effects of the corners that is, . \n",
+ "\n",
+ "#Given\n",
+ "k = 1.07 # thermal conductivity of silica brick from appendix table B3 in W/(m.K)\n",
+ "S1_A=0.138*0.138/0.006\n",
+ "nA=2\n",
+ "\n",
+ "# Calculation of total shape factor\n",
+ "# From figure 3.12, for component A\n",
+ "St_A=nA*S1_A # Total shape factor of component A\n",
+ "\n",
+ "# For component B\n",
+ "S1_B=0.138*0.188/0.006\n",
+ "nB=4\n",
+ "St_B=nB*S1_B # Total shape factor of component B\n",
+ "\n",
+ "# For component C\n",
+ "S3_C=0.15*0.006\n",
+ "nC=8\n",
+ "St_C=nC*S3_C # Total shape factor of component C\n",
+ "\n",
+ "# For component D\n",
+ "S2_D=0.54*0.188\n",
+ "nD=4\n",
+ "St_D=nD*S2_D # Total shape factor of component D\n",
+ "\n",
+ "# For component E\n",
+ "S2_E=0.138*0.54\n",
+ "nE=8\n",
+ "St_E=nE*S2_E # Total shape factor of component E\n",
+ "\n",
+ "S=St_A+St_B+St_C+St_D+St_E\n",
+ "T1=550\n",
+ "T2=30\n",
+ "q=k*S*(T1-T2)\n",
+ "S=St_A+St_B\n",
+ "q_1=k*S*(T1-T2)\n",
+ "Error=(q-q_1)/q\n",
+ "\n",
+ "#result\n",
+ "print\"(a)The heat transferred through the walls of the furnace is \",round(q/1000,1),\"kw\"\n",
+ "# Neglecting the effects of the edges and corners, the shape factor for all walls is found as \n",
+ "print\"(b The heat transferred is\",q_1/1000,1,\"kw\"\n",
+ "print\" The error introduced by neglecting heat flow through the edges and corners is \",round(Error*100,1),\" percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The heat transferred through the walls of the furnace is 13.7 kw\n",
+ "(b The heat transferred is 13.1555216 1 kw\n",
+ " The error introduced by neglecting heat flow through the edges and corners is 4.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page No. 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determination of the conduction shape factor for the underground portion of the configuration\n",
+ "# specifications of 4 nominal, schedule 40 pipe from table F1\n",
+ "\n",
+ "#Given\n",
+ "OD=4.5/12.0 # diameter in ft\n",
+ "R=OD/2.0\n",
+ "\n",
+ "# For pipe A\n",
+ "#calculation\n",
+ "import math\n",
+ "L_A=4.5 # length in ft\n",
+ "# shape factor number 9 is selected from table 3.1\n",
+ "S_A=(2*math.pi*L_A)/(math.log(2*(L_A)/R))\n",
+ "# For pipe B\n",
+ "L_B=18 # length in ft\n",
+ "# shape factor number 9 is selected from table 3.1\n",
+ "S_B=(2*math.pi*L_B)/(math.acosh(L_A/R))\n",
+ "S=2*S_A+S_B\n",
+ "\n",
+ "#Result\n",
+ "print\"The total conduction shape factor for the system is\",round(S,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total conduction shape factor for the system is 43.8\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page No. 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#(a)plot graph the temperature distribution existing within the rod. \n",
+ "#(b) Use the numerical formulation of this section to obtain the temperature distribution.\n",
+ "#(c) Compare the two models to determine how well the numerical results approximate the exact results\n",
+ "\n",
+ "#Given\n",
+ "h=1.1 # convective coefficient in BTU/(hr.ft^2. degree R)\n",
+ "Tw=200.0\n",
+ "T_inf=68.0 # ambient temperature\n",
+ "k=0.47 # thermal conductivity in BTU/(hr.ft.degree R) from table B3\n",
+ "D=0.25/12 # diameter in ft\n",
+ "\n",
+ "#Calculation\n",
+ "A=math.pi*D**(2)/4.0 # cross sectional area in ft^2\n",
+ "P=math.pi*D # perimeter in ft\n",
+ "L=6/12.0 # length in ft\n",
+ "mL=L*((h*P)/(k*A))**(0.5)\n",
+ "dz=1.0\n",
+ "L=4.0\n",
+ "de=dz/L\n",
+ "K=2+(mL*de)**2\n",
+ "\n",
+ "#Tempature can be calculated as\n",
+ "T4=T_inf+(Tw-T_inf)*(2/(K**4-4*K**2+2))\n",
+ "T3=T_inf+(Tw-T_inf)*(K/(K**4-4*K**2+2))\n",
+ "T2=T_inf+(Tw-T_inf)*((K**2-1)/(K**4-4*K**2+2))\n",
+ "T1=T_inf+(Tw-T_inf)*((K**3-3*K)/(K**4-4*K**2+2))\n",
+ "\n",
+ "#result\n",
+ "print\"The temprature distribution is T4=\",round(T4,2),\"F\"\n",
+ "print\"The temprature distribution is T3=\",round(T3,2),\"F\"\n",
+ "print\"The temprature distribution is T2=\",round(T2,2),\"F\"\n",
+ "print\"The temprature distribution is T1=\",round(T1,2),\"F\"\n",
+ "\n",
+ "#(b)plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "T=[200.0,77.33,68.66,68.05,68]\n",
+ "z=[0,1.5,3,4.5,6]\n",
+ "xlim(0,6)\n",
+ "ylim(50,200)\n",
+ "plt.ylabel('T (C)')\n",
+ "plt.xlabel('z (in)')\n",
+ "plt.annotate('Numeric approximation using 4 nodes', xy=(2,82), xytext=(0,30),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.05),\n",
+ " )\n",
+ "a=plot(z,T)\n",
+ "\n",
+ "T1=[200.0,82.81,69.66,68.19,68.04]\n",
+ "plt.ylabel('T1 (F)')\n",
+ "plt.xlabel('z (in)')\n",
+ "plt.annotate('exact solution', xy=(1.5,80), xytext=(0,60),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.05),\n",
+ " )\n",
+ "a=plot(z,T1)\n",
+ "show(a)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temprature distribution is T4= 68.04 F\n",
+ "The temprature distribution is T3= 68.19 F\n",
+ "The temprature distribution is T2= 69.68 F\n",
+ "The temprature distribution is T1= 82.82 F\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAESCAYAAAD9gqKNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlclOX+//HXsKPgggskoKiIgGyjAi5QkFtlLqmZuC/p\nOVmWS6Jp52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nZ8+elZ5DCPFwpCCYMXd3d44ePcr06dOxt7fH1taWCRMm0LZt20rPUlxczKFDh4yWWVtbV4k7jIQQ\n90cuKlcTx44d45NPPmHBggXY2tpW+vEPHTpEREQE165dMyyzs7MjLy8PywftoU4IUeHu57tTWgh3\nWLduHcePHy/3fmJjY+nVq9dd18nNzeXjjz82zJ87d45nn332oY7Xpk0bFi1apEoxANixY4fR08kA\n7dq1k2IghBmRgnCH7777jsTExEo51uXLl1m6dKlhvkmTJnzzzTeVcuyK9tNPPxldULaxsZHrB0KY\nGbMsCF9//TWhoaFotVr++c9/otPpiI+PJzAwkPz8fK5fv46fnx+JiYlcv36drl270q5dOwICAli/\nfr1hP1999RWBgYEEBQUxfPhw9u7dyw8//MDUqVPRarUluoH45ptv8Pf3JygoiMceewzQj1k8atQo\nAgICaNu2LbGxsSXyzp49m/fff98w7+/vz9mzZ5k+fTqnT59Gq9Uybdo0zp49axi4pqz9fvnll/Tr\n148nn3wSLy8vpk2bVsGf7oNTFIW9e/caLbOzszN8RkII86DaDW1Xrlzh+eef59ixY2g0GpYvX06r\nVq147rnnOHv2LB4eHqxZs4Z69eqV2HbNmjXs2bMHS0tLxo8fT0xMDMOGDaN37968/vrr3Lhxg2HD\nhuHr60txcTHfffcdjo6O5OTk0LFjR3r37s2xY8d455132Lt3L05OTly5coV69erRu3dvevXqRb9+\n/Uoc96233mLTpk088sgjhr56lixZgqWlJUeOHOHkyZN0796dpKQko+1Ku+1So9Hw7rvvcuzYMRIS\nEgBITU01rHu3/R4+fJjffvsNGxsbWrduzcsvv4yrq3p9+p84caLEucmbN2/Svn17lRIJIR6Gai2E\nV155haeeeorjx49z5MgRvL29mTdvHt26dSMpKYkuXbowb968Urc9ePAg7du3R6vVsnXrVkPf///+\n97/ZtGkTBw4cIDo6GgCdTsdrr71GYGAg3bp149y5c2RnZ7N161YGDhyIk5MTgFHhKevCS+fOnRkx\nYgSff/65YfD43bt3M3ToUABat25Ns2bNShSEstztAk9Z+9VoNHTp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aJm9v71KPUdoyDw8PwxCUt18POn36NG3atCE6Oprg4GBOnjx51/cE+uIYHBzM9u3buXLlCkVF\nRaxdu7bUopuSksKZM2c4c+YMAwYM4OOPP77nyHzOzs5YW1tz+vRpOnXqxKpVqwCIiYnh0UcfBfQt\nm9uXFxYWEh0dTY8ePVi2bBnXr18HIDMzkwsXLnD+/Hns7OwYMmQIr7766l2HPBSiIpllQbj9f+Yp\nU6aQk5NjmB87dizbt28nKCjIqAl/53Z37u/Wax999BEHDhwgMDCQNm3aGC6u3rn97du8/vrrXL58\nGX9/f4KCgkoMsF6vXj3Gjh2Ln58fTzzxBKGhoUb7sbOzo23btowfP54vvvjCsDwgIIDIyEg6duzI\nv//9b1xcXIyOCzB+/Hh0Oh0BAQEMGjSIFStWoNPpGDduHMuXL+eRRx7h/fffZ/To0ff8TEt7f0OG\nDFJIBSwAAAE/SURBVOHAgQMEBASwcuVKw0h1DRo0oHPnzvj7+zNt2jSj7UvLZG1tXeIYZf1OZs2a\nxSuvvEJwcDBWVlaGdRYuXIi/vz+BgYHY2Njw5JNPGu2jtP2D/k6kGTNmEBISQlhYGM2bNy/XaZg7\nP6fIyEhatmzJokWLWL58OYGBgcTExBjuQlu4cCFLliwhICCAc+fOYWdnR1hYGN26dWPw4MF07NiR\ngIAABg4cyLVr1zh69CihoaFotVreeustaR2ISiNPKqssMjKS999/n7Zt2xotf+ONN3BwcCj13nfx\n4K5fv07t2rUpKiqiX79+jBkzhj59+qgdS4gqxSxbCDVFdRu/Vk2zZ8823NrbokULKQZClEJaCEII\nIQBpIQghhPiLFAQhhBCAFAQhhBB/kYIghBACkIIghBDiL1IQhBBCAPD/AfkCc/rPAgQ3AAAAAElF\nTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x752b7f0>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/README.txt b/Engineering_Heat_Transfer/README.txt
new file mode 100644
index 00000000..0da6ee5a
--- /dev/null
+++ b/Engineering_Heat_Transfer/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ankit Garg
+Course: btech
+College/Institute/Organization: DCRUST, Murthal
+Department/Designation: Chemical Engineering
+Book Title: Engineering Heat Transfer
+Author: W S Janna
+Publisher: CRC Press
+Year of publication: 1999
+Isbn: 9780849321269
+Edition: 2 \ No newline at end of file
diff --git a/Engineering_Heat_Transfer/screenshots/heat_transferred.png b/Engineering_Heat_Transfer/screenshots/heat_transferred.png
new file mode 100644
index 00000000..12f4f4a9
--- /dev/null
+++ b/Engineering_Heat_Transfer/screenshots/heat_transferred.png
Binary files differ
diff --git a/Engineering_Heat_Transfer/screenshots/length_required.png b/Engineering_Heat_Transfer/screenshots/length_required.png
new file mode 100644
index 00000000..4071c2d2
--- /dev/null
+++ b/Engineering_Heat_Transfer/screenshots/length_required.png
Binary files differ
diff --git a/Engineering_Heat_Transfer/screenshots/wall_tempratures.png b/Engineering_Heat_Transfer/screenshots/wall_tempratures.png
new file mode 100644
index 00000000..114869c8
--- /dev/null
+++ b/Engineering_Heat_Transfer/screenshots/wall_tempratures.png
Binary files differ
diff --git a/Engineering_Physics/Chapter10_1.ipynb b/Engineering_Physics/Chapter10_1.ipynb
new file mode 100644
index 00000000..b31ad5ec
--- /dev/null
+++ b/Engineering_Physics/Chapter10_1.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "10: Statistical Mechanics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.1, Page number 222"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the ratio of occupancy of the excited to the ground state\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nk = 1.38*10**-23; #Boltzmann constant(J/K)\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\ng1 = 2; #The degeneracy of ground state\ng2 = 8; #The degeneracy of excited state\ndelta_E = 10.2; #Energy of excited state above the ground state(eV)\nT = 6000; #Temperature of the state(K)\n\n#Calculation\nD_ratio = g2/g1; #Ratio of degeneracy of states\nx = k*T/e;\nN_ratio = D_ratio*math.exp(-delta_E/x); #Ratio of occupancy of the excited to the ground state\n\n#Result\nprint \"The ratio of occupancy of the excited to the ground state is\",N_ratio",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The ratio of occupancy of the excited to the ground state is 1.10167326887e-08\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.2, Page number 222"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the ground state energy of 10 non-interacting bosons\n\n#Calculation\n#an energy level can accomodate any number of bosons. Hence 10 bosons will be in n=1 state\n#energy is given by E1 = (pi**2*h**2)/(2*m*a**2)\na = 10/2;\n#enegy of 10 bosons is E = (10*pi**2*h**2)/(2*m*a**2) = (5*pi**2*h**2)/(m*a**2)\n\n#Result\nprint \"enegy of 10 bosons is E = \",int(a),\"(pi**2*h**2)/(m*a**2)\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "enegy of 10 bosons is E = 5 (pi**2*h**2)/(m*a**2)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.3, Page number 223"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the ground state energy of the system\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1; #1st level\nn2=2; #2nd level\nn3=3; #3rd level\nn4=4; #4th level\nn5=5; #5th level\n\n#Calculation\n#an energy level can accomodate only 2 fermions. hence there will be 2 fermions in each level\n#thus total ground state energy will be E = (2*E1)+(2*E2)+(2*E3)+(2*E4)+E5\n#let X = ((pi**2)*(h**2)/(2*m*a**2)). E = X*((2*n1**2)+(2*n2**2)+(2*n3**2)+(2*n4**2)+(n5**2))\nA = (2*n1**2)+(2*n2**2)+(2*n3**2)+(2*n4**2)+(n5**2);\n#thus E = A*X\n\n#Result\nprint \"the ground state energy of the system is\",A,\"(pi**2)*(h**2)/(2*m*a**2)\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "the ground state energy of the system is 85 (pi**2)*(h**2)/(2*m*a**2)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.4, Page number 223"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number density of conduction electrons and Fermi energy of silver\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nN_A = 6.02*10**23; #Avogadro's number\nh = 6.626*10**-34; #Planck's constant(Js)\nme = 9.1*10**-31; #Mass of electron(kg)\nrho = 10.5; #Density of silver(g/cm)\nm = 108; #Molecular mass of silver(g/mol)\n\n#Calculation\nN_D = rho*N_A/m; #Number density of conduction electrons(per cm**3)\nN_D = N_D*10**6; #Number density of conduction electrons(per m**3)\nE_F = ((h**2)/(8*me))*(3/math.pi*N_D)**(2/3); #fermi energy(J)\nE_F = E_F/e; #fermi energy(eV)\nE_F = math.ceil(E_F*10**2)/10**2; #rounding off the value of E_F to 2 decimals\n\n#Result\nprint \"The number density of conduction electrons is\",N_D, \"per metre cube\"\nprint \"The Fermi energy of silver is\",E_F, \"eV\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The number density of conduction electrons is 5.85277777778e+28 per metre cube\nThe Fermi energy of silver is 5.51 eV\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.5, Page number 224"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic contribution to molar specific heat of sodium\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nN_A = 6.02*10**23; #Avogadro's number\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nT = 293; #Temperature of sodium(K)\nE_F = 3.24; #Fermi energy of sodium(eV)\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n\n#Calculation\nC_v = math.pi**2*N_A*k**2*T/(2*E_F*e); #Molar specific heat of sodium(per mole)\nC_v = math.ceil(C_v*10**2)/10**2; #rounding off the value of C_v to 2 decimals\n\n#Result\nprint \"The electronic contribution to molar specific heat of sodium is\",C_v, \"per mole\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The electronic contribution to molar specific heat of sodium is 0.32 per mole\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.6, Page number 224"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Fermi energy and mean energy of the electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nh = 6.626*10**-34; #Planck's constant(Js)\nm = 9.1*10**-31; #Mass of the electron(kg)\nN_D = 18.1*10**28; #Number density of conduction electrons in Al(per metre cube)\n\n#Calculation\nE_F = h**2/(8*m)*(3/math.pi*N_D)**(2/3); #N_D = N/V. Fermi energy of aluminium(J)\nE_F = E_F/e; #Fermi energy of aluminium(eV)\nE_F = math.ceil(E_F*10**3)/10**3; #rounding off the value of E_F to 3 decimals\nEm_0 = 3/5*E_F; #Mean energy of the electron at 0K(eV)\nEm_0 = math.ceil(Em_0*10**3)/10**3; #rounding off the value of Em_0 to 3 decimals\n\n#Result\nprint \"The Fermi energy of aluminium is\",E_F, \"eV\"\nprint \"The mean energy of the electron is\",Em_0, \"eV\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Fermi energy of aluminium is 11.696 eV\nThe mean energy of the electron is 7.018 eV\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter11_1.ipynb b/Engineering_Physics/Chapter11_1.ipynb
new file mode 100644
index 00000000..733fe6b7
--- /dev/null
+++ b/Engineering_Physics/Chapter11_1.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "11: Lasers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.1, Page number 249"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the ratio of spontaneous emission to stimulated emission for visible and microwave region\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh = 6.626*10**-34; #Planck's constant(Js)\nc = 3*10**8; #Speed of light in free space(m/s)\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nT = 300; #Temperature at absolute scale(K)\nlamda1 = 5500; #Wavelength of visible light(A)\nlamda2 = 10**-2; #Wavelength of microwave(m)\n\n#Calculation\nlamda1 = lamda1*10**-10; #Wavelength of visible light(m)\nrate_ratio = math.exp(h*c/(lamda1*k*T))-1; #Ratio of spontaneous emission to stimulated emission\nrate_ratio1 = math.exp(h*c/(lamda2*k*T))-1; #Ratio of spontaneous emission to stimulated emission\nrate_ratio1 = math.ceil(rate_ratio1*10**5)/10**5; #rounding off the value of rate_ratio1 to 5 decimals\n\n#Result\nprint \"The ratio of spontaneous emission to stimulated emission for visible region is\",rate_ratio\nprint \"The ratio of spontaneous emission to stimulated emission for microwave region is\", rate_ratio1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The ratio of spontaneous emission to stimulated emission for visible region is 8.19422217477e+37\nThe ratio of spontaneous emission to stimulated emission for microwave region is 0.00482\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.2, Page number 250"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the energy of excited state\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nh = 6.626*10**-34; #Planck's constant(Js)\nc = 3*10**8; #Speed of light in free space(m/s)\nlamda = 690; #Wavelength of laser light(nm)\nE_lower = 30.5; #Energy of lower state(eV)\n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of laser light(m)\nE = h*c/lamda; #Energy of the laser light(J)\nE = E/e; #Energy of the laser light(eV)\nE_ex = E_lower + E; #Energy of excited state of laser system(eV)\nE_ex = math.ceil(E_ex*10**2)/10**2; #rounding off the value of E_ex to 2 decimals\n\n#Result\nprint \"The energy of excited state of laser system is\",E_ex, \"eV\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The energy of excited state of laser system is 32.31 eV\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.3, Page number 250"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To determine the condition under which stimulated emission equals spontaneous emission\n\n#importing modules\nimport math\nfrom __future__ import division\nimport numpy as np\n\n#Variable declaration\nh = 6.626*10**-34; #Planck's constant(Js)\nk = 1.38*10**-23; #Boltzmann constant(J/K)\n\n#Calculation\n#Stimulated Emission = Spontaneous Emission <=> exp(h*f/(k*T))-1 = 1 i.e.\n#f/T = log(2)*k/h = A\nA = np.log(2)*k/h; #Frequency per unit temperature(Hz/K)\nA = A/10**10;\nA = math.ceil(A*10**3)/10**3; #rounding off the value of A to 3 decimals\n\n#Result\nprint \"The stimulated emission equals spontaneous emission iff f/T =\",A,\"*10**10 Hz/k\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The stimulated emission equals spontaneous emission iff f/T = 1.444 *10**10 Hz/k\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.4, Page number 250"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the area of the spot and intensity at the focus \n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 500; #Wavelength of laser light(nm)\nf = 15; #Focal length of the lens(cm)\nd = 2; #Diameter of the aperture of source(cm)\nP = 5; #Power of the laser(mW)\n\n#Calculation\nP = P*10**-3; #Power of the laser(W)\nlamda = lamda*10**-9; #Wavelength of laser light(m)\nd = d*10**-2; #Diameter of the aperture of source(m)\nf = f*10**-2; #Focal length of the lens(m)\na = d/2; #Radius of the aperture of source(m)\nA = math.pi*lamda**2*f**2/a**2; #Area of the spot at the focal plane, metre square\nI = P/A; #Intensity at the focus(W/m**2)\nI = I/10**7;\nI = math.ceil(I*10**4)/10**4; #rounding off the value of I to 1 decimal\n\n#Result\nprint \"The area of the spot at the focal plane is\",A, \"m**2\"\nprint \"The intensity at the focus is\",I,\"*10**7 W/m**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The area of the spot at the focal plane is 1.76714586764e-10 m**2\nThe intensity at the focus is 2.8295 *10**7 W/m**2\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.5, Page number 251"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the energy released per pulse and number of photons\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh = 6.626*10**-34; #Planck's constant(Js)\nc = 3*10**8; #Speed of light in free space(m/s)\nlamda = 1064; #Wavelength of laser light(nm)\nP = 0.8; #Average power output per laser pulse(W)\ndt = 25; #Pulse width of laser(ms)\n\n#Calculation\ndt = dt*10**-3; #Pulse width of laser(s)\nlamda = lamda*10**-9; #Wavelength of laser light(m)\nE = P*dt; #Energy released per pulse(J)\nE1 = E*10**3;\nN = E/(h*c/lamda); #Number of photons in a pulse\n\n#Result\nprint \"The energy released per pulse is\",E1,\"*10**-3 J\"\nprint \"The number of photons in a pulse is\", N\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The energy released per pulse is 20.0 *10**-3 J\nThe number of photons in a pulse is 1.07053023443e+17\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.6, Page number 251"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angular spread and diameter of the beam\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 693; #Wavelength of laser beam(nm)\nD = 3; #Diameter of laser beam(mm)\nd = 300; #Height of a satellite above the surface of earth(km)\n\n#Calculation\nD = D*10**-3; #Diameter of laser beam(m)\nlamda = lamda*10**-9; #Wavelength of laser beam(m)\nd = d*10**3; #Height of a satellite above the surface of earth(m)\nd_theta = 1.22*lamda/D; #Angular spread of laser beam(rad)\ndtheta = d_theta*10**4;\ndtheta = math.ceil(dtheta*10**2)/10**2; #rounding off the value of dtheta to 2 decimals\na = d_theta*d; #Diameter of the beam on the satellite(m)\na = math.ceil(a*10)/10; #rounding off the value of a to 1 decimal\n\n#Result\nprint \"The height of a satellite above the surface of earth is\",dtheta,\"*10**-4 rad\"\nprint \"The diameter of the beam on the satellite is\",a, \"m\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The height of a satellite above the surface of earth is 2.82 *10**-4 rad\nThe diameter of the beam on the satellite is 84.6 m\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter12_1.ipynb b/Engineering_Physics/Chapter12_1.ipynb
new file mode 100644
index 00000000..440b2d59
--- /dev/null
+++ b/Engineering_Physics/Chapter12_1.ipynb
@@ -0,0 +1,118 @@
+{
+ "metadata": {
+ "name": "Chapter12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "12: Holography and Fibre Optics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.1, Page number 271"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical angle, critical propagation angle and numerical aperture \n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nn1 = 1.43; #Refractive index of fibre core\nn2 = 1.4; #Refractive index of fibre cladding\n\n#Calculation\n#As sin (alpha_c) = n2/n1, solving for alpha_c\nalpha_c = math.asin(n2/n1); #Critical angle for optical fibre(rad)\nalpha_c = alpha_c*57.2957795; #Critical angle for optical fibre(degrees)\nalpha_c = math.ceil(alpha_c*10**3)/10**3; #rounding off the value of alpha_c to 3 decimals\n#AS cos(theta_c) = n2/n1, solving for theta_c\ntheta_c = math.acos(n2/n1); #Critical propagation angle for optical fibre(rad)\ntheta_c = theta_c*57.2957795; #Critical propagation angle for optical fibre(degrees)\ntheta_c = math.ceil(theta_c*10**2)/10**2; #rounding off the value of theta_c to 2 decimals\nNA = math.sqrt(n1**2 - n2**2); #Numerical aperture for optical fibre\nNA = math.ceil(NA*10**3)/10**3; #rounding off the value of NA to 3 decimals\n\n#Result\nprint \"The critical angle for optical fibre is\",alpha_c, \"degrees\"\nprint \"The critical propagation angle for optical fibre is\",theta_c, \"degrees\"\nprint \"Numerical aperture for optical fibre is\",NA\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The critical angle for optical fibre is 78.244 degrees\nThe critical propagation angle for optical fibre is 11.76 degrees\nNumerical aperture for optical fibre is 0.292\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.2, Page number 271"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the numerical aperture, acceptance angle and relative refractive index difference\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nn1 = 1.45; #Refractive index of fibre core\nn2 = 1.4; #Refractive index of fibre cladding\n\n#Calculation\nNA = math.sqrt(n1**2 - n2**2); #Numerical aperture for optical fibre\nNA = math.ceil(NA*10**4)/10**4; #rounding off the value of NA to 4 decimals\n#As sin(theta_a) = sqrt(n1^2 - n2^2), solving for theta_a\ntheta_a = math.asin(math.sqrt(n1**2 - n2**2)); #Half of acceptance angle of optical fibre(rad)\ntheta_a = theta_a*57.2957795; #Half of acceptance angle of optical fibre(degrees)\ntheta_accp = 2*theta_a; #Acceptance angle of optical fibre(degrees)\ntheta_accp = math.ceil(theta_accp*10**2)/10**2; #rounding off the value of theta_accp to 2 decimals\nDelta = (n1 - n2)/n1; #Relative refractive index difference\nDelta = math.ceil(Delta*10**4)/10**4; #rounding off the value of Delta to 4 decimals\n\n#Result\nprint \"Numerical aperture for optical fibre is\", NA\nprint \"The acceptance angle of optical fibre is\",theta_accp, \"degrees\"\nprint \"Relative refractive index difference is\", Delta\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Numerical aperture for optical fibre is 0.3775\nThe acceptance angle of optical fibre is 44.36 degrees\nRelative refractive index difference is 0.0345\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.3, Page number 271"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the numerical aperture and acceptance angle\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nn1 = 1.55; #Refractive index of fibre core\nn2 = 1.53; #Refractive index of fibre cladding\nn0 = 1.3; #Refractive index of medium\n\n#Calculation\nNA = math.sqrt(n1**2 - n2**2); #Numerical aperture for optical fibre\nNA = math.ceil(NA*10**4)/10**4; #rounding off the value of NA to 4 decimals\n#n0*sin(theta_a) = sqrt(n1^2 - n2^2) = NA, solving for theta_a\ntheta_a = math.asin(math.sqrt(n1**2 - n2**2)/n0); #Half of acceptance angle of optical fibre(rad)\ntheta_a = theta_a*57.2957795; #Half of acceptance angle of optical fibre(degrees)\ntheta_accp = 2*theta_a; #Acceptance angle of optical fibre(degrees)\n\n#Result\nprint \"Numerical aperture for step index fibre is\",NA\nprint \"The acceptance angle of step index fibre is\",int(theta_accp), \"degrees\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Numerical aperture for step index fibre is 0.2482\nThe acceptance angle of step index fibre is 22 degrees\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.4, Page number 271 Theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.5, Page number 272"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the numerical aperture and acceptance angle\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nalpha = 2; #Power loss through optical fibre(dB/km)\nP_in = 500; #Poer input of optical fibre(micro-watt)\nz = 10; #Length of the optical fibre(km)\n\n#Calculation\n#As alpha = 10/z*log10(P_in/P_out), solving for P_out\nP_out = P_in/10**(alpha*z/10); #Output power in fibre optic communication(micro-Watt)\n\n#Result\nprint \"The output power in fibre optic communication is\",P_out, \"micro-Watt\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The output power in fibre optic communication is 5.0 micro-Watt\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter13_1.ipynb b/Engineering_Physics/Chapter13_1.ipynb
new file mode 100644
index 00000000..2366432d
--- /dev/null
+++ b/Engineering_Physics/Chapter13_1.ipynb
@@ -0,0 +1,175 @@
+{
+ "metadata": {
+ "name": "Chapter13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "13: Dielectric Properties of Materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.1, Page number 287"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic polarizability \n\n#importing modules\nimport math\n\n#Variable declaration\nepsilon_0 = 8.85*10**-12; #Absolute electrical permittivity of free space(F/m)\nR = 0.52; #Radius of hydrogen atom(A)\nn = 9.7*10**26; #Number density of hydrogen(per metre cube)\n\n#Calculation\nR = R*10**-10; #Radius of hydrogen atom(m)\nalpha_e = 4*math.pi*epsilon_0*R**3; #Electronic polarizability of hydrogen atom(Fm**2)\n\n#Result\nprint \"The electronic polarizability of hydrogen atom is\", alpha_e, \"Fm**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The electronic polarizability of hydrogen atom is 1.56373503182e-41 Fm**2\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.2, Page number 287"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the capacitance of capacitor and charge on the plates\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nepsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\nA = 100; #Area of a plate of parallel plate capacitor(cm**2)\nd = 1; #Distance between the plates of the capacitor(cm)\nV = 100; #Potential applied to the plates of the capacitor(V)\n\n#Calculation\nA= A*10**-4; #Area of a plate of parallel plate capacitor(m**2)\nd = d*10**-2; #Distance between the plates of the capacitor(m)\nC = epsilon_0*A/d; #Capacitance of parallel plate capacitor(F)\nQ = C*V; #Charge on the plates of the capacitor(C)\n\n#Result\nprint \"The capacitance of parallel plate capacitor is\",C, \"F\"\nprint \"The charge on the plates of the capacitor is\",Q, \"C\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The capacitance of parallel plate capacitor is 8.854e-12 F\nThe charge on the plates of the capacitor is 8.854e-10 C\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.3, Page number 288"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the dielectric displacement\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nepsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\nepsilon_r = 5.0; #Dielectric constant of the material between the plates of capacitor\nV = 15; #Potential difference applied between the plates of the capacitor(V)\nd = 1.5; #Separation between the plates of the capacitor(mm)\n\n#Calculation\nd = d*10**-3; #Separation between the plates of the capacitor(m)\n#Electric displacement, D = epsilon_0*epsilon_r*E, as E = V/d, so \nD = epsilon_0*epsilon_r*V/d; #Dielectric displacement(C/m**2)\n\n#Result\nprint \"The dielectric displacement is\",D, \"C/m**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The dielectric displacement is 4.427e-07 C/m**2\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.4, Page number 288"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the relative dielectric constant\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nepsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\nN = 3*10**28; #Number density of solid elemental dielectric(atoms/metre cube)\nalpha_e = 10**-40; #Electronic polarizability(Fm**2)\n\n#Calculation\nepsilon_r = 1 + (N*alpha_e/epsilon_0); #Relative dielectric constant of the material\nepsilon_r = math.ceil(epsilon_r*10**3)/10**3; #rounding off the value of epsilon_r to 3 decimals\n\n#Result\nprint \"The Relative dielectric constant of the material is\",epsilon_r\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Relative dielectric constant of the material is 1.339\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.5, Page number 288"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic polarizability\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nN_A = 6.02*10**23; #Avogadro's number(per mole)\nepsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\nepsilon_r = 3.75; #Relative dielectric constant\nd = 2050; #Density of sulphur(kg/metre cube)\ny = 1/3; #Internal field constant\nM = 32; #Atomic weight of sulphur(g/mol)\n\n#Calculation\nN = N_A*10**3*d/M; #Number density of atoms of sulphur(per metre cube)\n#Lorentz relation for local fields give E_local = E + P/(3*epsilon_0) which gives\n#(epsilon_r - 1)/(epsilon_r + 2) = N*alpha_e/(3*epsilon_0), solving for alpha_e\nalpha_e = (epsilon_r - 1)/(epsilon_r + 2)*3*epsilon_0/N; #Electronic polarizability of sulphur(Fm**2)\n\n#Result\nprint \"The electronic polarizability of sulphur is\",alpha_e, \"Fm**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The electronic polarizability of sulphur is 3.2940125351e-40 Fm**2\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.6, Page number 289"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic polarizability\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nN = 3*10**28; #Number density of atoms of dielectric material(per metre cube)\nepsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\nn = 1.6; #Refractive index of dielectric material\n\n#Calculation\n#As (n^2 - 1)/(n^2 + 2) = N*alpha_e/(3*epsilon_0), solving for alpha_e\nalpha_e = (n**2 - 1)/(n**2 + 2)*3*epsilon_0/N; #Electronic polarizability of dielectric material(Fm**2)\n\n#Result\nprint \"The electronic polarizability of dielectric material is\",alpha_e, \"Fm**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The electronic polarizability of dielectric material is 3.029e-40 Fm**2\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 13.7, Page number 289"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the ratio of electronic polarizability to ionic polarizability\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nepsilon_r = 4.9; #Absolute relative dielectric constant of material(F/m)\nn = 1.6; #Refractive index of dielectric material\n\n#Calculation\n#As (n^2 - 1)/(n^2 + 2)*(alpha_e + alpha_i)/alpha_e = N*(alpha_e + alpha_i)/(3*epsilon_0) = (epsilon_r - 1)/(epsilon_r + 2)\n#let alpha_ratio = alpha_i/alpha_e\nalpha_ratio = ((epsilon_r - 1)/(epsilon_r + 2)*(n**2 + 2)/(n**2 - 1) - 1)**(-1); #Ratio of electronic polarizability to ionic polarizability\nalpha_ratio = math.ceil(alpha_ratio*10**3)/10**3; #rounding off the value of alpha_ratio to 3 decimals\n\n#Result\nprint \"The ratio of electronic polarizability to ionic polarizability is\",alpha_ratio",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The ratio of electronic polarizability to ionic polarizability is 1.534\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter14_1.ipynb b/Engineering_Physics/Chapter14_1.ipynb
new file mode 100644
index 00000000..eb6cc153
--- /dev/null
+++ b/Engineering_Physics/Chapter14_1.ipynb
@@ -0,0 +1,175 @@
+{
+ "metadata": {
+ "name": "Chapter14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "14: Magnetic Properties of Materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.1, Page number 306"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the spontaneous magnetisation\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nN = 6.02*10**23; #Avogadro's number(per mole)\nA = 56; #Atomic weight of the substance(g/mole)\nd = 7.9; #Density of the substance(g/cm**3)\nm_B = 9.27*10**-24; #Bohr's Magneton(J/T)\n\n#Calculation\nm = 2.2*m_B; #Magnetic moment of substance(J/T)\nn = d*N/A ; #Number of atoms per unit volume of the substance(per cm**3)\nn = n*10**6; #Number of atoms per unit volume of the substance(per m**3)\nM = n*m; #Spontaneous magnetisation of the substance(A/m)\nM = M/10**6;\nM = math.ceil(M*10**3)/10**3; #rounding off the value of M to 3 decimals\n\n#Result\nprint \"The spontaneous magnetisation of the substance is\",M,\"*10**6 A/m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The spontaneous magnetisation of the substance is 1.732 *10**6 A/m\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.2, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the relative permeability\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nH = 200; #Field strength to which the ferromagnetic material is subjected(A/m)\nM = 3100; #Magnetisation of the ferromagnetic material(A/m)\n\n#Calculation\nchi = M/H; #Magnetic susceptibility\nmew_r = 1 + chi; #Relative permeability of ferromagnetic material\n\n#Result\nprint \"The relative permeability of ferromagnetic material is\",mew_r",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The relative permeability of ferromagnetic material is 16.5\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.3, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the relative permeability\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nH = 300; #Field strength to which the ferromagnetic material is subjected(A/m)\nM = 4400; #Magnetisation of the ferromagnetic material(A/m)\n\n#Calculation\nchi = M/H; #Magnetic susceptibility\nmew_r = 1 + chi; #Relative permeability of ferromagnetic material\nmew_r = math.ceil(mew_r*100)/100; #rounding off the value of mew_r to 2 decimals\n\n#Result\nprint \"The relative permeability of ferromagnetic material is\",mew_r\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The relative permeability of ferromagnetic material is 15.67\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.4, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the magnetisation and flux density\n\n#importing modules\nimport math\n\n#Variable declaration\nmew_0 = 4*math.pi*10**-7; #Magnetic permeability of free space(Tm/A)\nH = 10000; #Field strength to which the diamagnetic material is subjected(A/m)\nchi = -0.4*10**-5; #Magnetic susceptibility\n\n#Calculation\nM = chi*H; #Magnetisation of the diamagnetic material(A/m)\nB = mew_0*(H + M); #Magnetic flux density of diamagnetic material(T)\nB = math.ceil(B*10**4)/10**4; #rounding off the value of B to 4 decimals\n\n#Result\nprint \"The magnetisation of diamagnetic material is\",M, \"A/m\"\nprint \"The magnetic flux density of diamagnetic material is\",B, \"T\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The magnetisation of diamagnetic material is -0.04 A/m\nThe magnetic flux density of diamagnetic material is 0.0126 T\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.5, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the magnetisation, relative permeability and flux density\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nmew_0 = 4*math.pi*10**-7; #Magnetic permeability of free space(Tm/A)\nH = 1.2*10**5; #Field strength to which the diamagnetic material is subjected(A/m)\nchi = -4.2*10**-6; #Magnetic susceptibility\n\n#Calculation\nM = chi*H; #Magnetisation of the diamagnetic material(A/m)\nB = mew_0*(H + M); #Magnetic flux density of diamagnetic material(T)\nB = math.ceil(B*10**3)/10**3; #rounding off the value of B to 3 decimals\nmew_r = M/H + 1; #The relative permeability of diamagnetic material\nmew_r = math.ceil(mew_r*10**6)/10**6; #rounding off the value of mew_r to 6 decimals\n\n#Result\nprint \"The magnetisation of diamagnetic material is\",M, \"A/m\"\nprint \"The magnetic flux density of diamagnetic material is\",B, \"T\"\nprint \"The relative permeability of diamagnetic material is\",mew_r\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The magnetisation of diamagnetic material is -0.504 A/m\nThe magnetic flux density of diamagnetic material is 0.151 T\nThe relative permeability of diamagnetic material is 0.999996\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.6, Page number 308"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the mean radius of the atom\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nchi = 5.6*10**-6; #Magnetic susceptibility of diamagnetic material\nm = 9.1*10**-31; #Mass of an electron(kg)\nmew_0 = 4*math.pi*10**-7; #Magnetic permeability of free space(Tm/A)\nZ = 1; #Atomic number\ne = 1.6*10**-19; #Electronic charge(C)\na = 2.53; #Lattice parameter of bcc structure(A)\n\n#Calculation\na = a*10**-10; #Lattice parameter of bcc structure(m)\nN = 2/a**3; #The number of electrons per unit volume(per metre cube)\nr = math.sqrt(chi*6*m/(mew_0*Z*e**2*N)); #Mean radius of body centered cubic structure(m)\nr = r*10**10; #Mean radius of body centered cubic structure(A)\nr = math.ceil(r*100)/100; #rounding off the value of r to 2 decimals\n\n#Result\nprint \"The mean radius of body centered cubic structure is\",r, \"A\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mean radius of body centered cubic structure is 0.88 A\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 14.7, Page number 308"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the magnetic susceptibility and magnetisation\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nmew_0 = 4*math.pi*10**-7; #Magnetic permeability of free space(Tm/A)\nN_A = 6.02*10**26; #Avogadro's number(per kmol)\nrho = 4370; #Density of paramegnetic salt(kg/metre cube)\nM = 168.5; #Molecular weight of paramagnetic salt(g/mol)\nT = 27; #Temperature of paramagnetic salt(C)\nH = 2*10**5; #Field strength to which the paramagnetic salt is subjected(A/m)\nmew_B = 9.27*10**-24; #Bohr's magneton(Am**2)\np = 2; #Number of Bohr magnetons per molecule\nk = 1.38*10**-23; #Boltzmann constant(J/K)\n\n#Calculation\nT = T+273; #Temperature of paramagnetic salt(K)\nN = rho*N_A/M; #Total density of atoms in the paramagnetic salt(per meter cube)\nchi_para = mew_0*N*p**2*mew_B**2/(3*k*T); #Magnetic susceptibility of paramagnetic salt\nchi_para = chi_para*10**4;\nchi_para = math.ceil(chi_para*10**2)/10**2; #rounding off the value of chi_para to 2 decimals\nM = chi*H; #Magnetisation of paramagnetic salt(A/m)\nM = math.ceil(M*10)/10; #rounding off the value of M to 1 decimal\n\n#Result\nprint \"The magnetic susceptibility of paramagnetic salt is\",chi_para,\"*10**-4\"\nprint \"The magnetisation of paramagnetic salt is\",M, \"A/m\"\n\n#answer for magnetisation is not given in the textbook",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The magnetic susceptibility of paramagnetic salt is 5.43 *10**-4\nThe magnetisation of paramagnetic salt is 1.2 A/m\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter15_1.ipynb b/Engineering_Physics/Chapter15_1.ipynb
new file mode 100644
index 00000000..cfabc2c6
--- /dev/null
+++ b/Engineering_Physics/Chapter15_1.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "15: Thermal Properties "
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 15.1, Page number 323"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Debye temperature\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nh = 6.626*10**-34; #Planck's constant(Js)\nf_D = 64*10**11; #Debye frequency for Al(Hz)\n\n#Calculation\ntheta_D = h*f_D/k; #Debye temperature(K)\ntheta_D = math.ceil(theta_D*10)/10; #rounding off the value of theta_D to 1 decimal\n\n#Result\nprint \"The Debye temperature of aluminium is\",theta_D, \"K\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Debye temperature of aluminium is 307.3 K\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 15.2, Page number 323"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lattice specific heat\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nN = 6.02*10**26; #Avogadro's number(per kmol)\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nh = 6.626*10**-34; #Planck's constant(Js)\nf_D = 40.5*10**12; #Debye frequency for Al(Hz)\nT = 30; #Temperature of carbon(Ks)\n\n#Calculation\ntheta_D = h*f_D/k; #Debye temperature(K)\nC_l = 12/5*math.pi**4*N*k*(T/theta_D)**3; #Lattice specific heat of carbon(J/k-mol/K)\nC_l = math.ceil(C_l*10**3)/10**3; #rounding off the value of C_l to 3 decimals\n\n#Result\nprint \"The lattice specific heat of carbon is\",C_l, \"J/k-mol/K\"\n\n#answer given in the book is wrong in the 2nd decimal",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The lattice specific heat of carbon is 7.132 J/k-mol/K\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 15.3, Page number 323"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To show that the frequency falls in the infrared region\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nh = 6.626*10**-34; #Planck's constant(Js)\ntheta_E = 1990; #Einstein temperature of Cu(K)\n\n#Calculation\nf_E = k*theta_E/h; #Einstein frequency for Cu(K)\n\n#Result\nprint \"The Einstein frequency for Cu is\",f_E, \"Hz\"\nprint \"The frequency falls in the near infrared region\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Einstein frequency for Cu is 4.14458194989e+13 Hz\nThe frequency falls in the near infrared region\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 15.4, Page number 323"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic and lattice heat capacities\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nN = 6.02*10**23; #Avogadro's number(per mol)\nT = 0.05; #Temperature of Cu(K)\nE_F = 7; #Fermi energy of Cu(eV)\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nh = 6.626*10**-34; #Planck's constant(Js)\ntheta_D = 348; #Debye temperature of Cu(K)\n\n#Calculation\nC_e = math.pi**2*N*k**2*T/(2*E_F*e); #Electronic heat capacity of Cu(J/mol/K)\nC_V = (12/5)*math.pi**4*(N*k)*(T/theta_D)**3; #Lattice heat capacity of Cu(J/mol/K)\n\n#Result\nprint \"The electronic heat capacity of Cu is\",C_e, \"J/mol/K\"\nprint \"The lattice heat capacity of Cu is\",C_V, \"J/mol/K\"\n\n#answer for lattice heat capacity given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The electronic heat capacity of Cu is 2.52566877726e-05 J/mol/K\nThe lattice heat capacity of Cu is 5.76047891492e-09 J/mol/K\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 15.5, Page number 324"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the heat capacity\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nT = 1; #For simplicity assume temperature to be unity(K)\nR = 1; #For simplicity assume molar gas constant to be unity(J/mol/K)\ntheta_E = T; #Einstein temperature(K)\n\n#Calculation\nC_V = 3*R*(theta_E/T)**2*math.exp(theta_E/T)/(math.exp(theta_E/T)-1)**2; #Einstein lattice specific heat(J/mol/K)\nC_V = C_V/3;\nC_V = math.ceil(C_V*10**3)/10**3; #rounding off the value of C_V to 3 decimals\n\n#Result\nprint \"The Einstein lattice specific heat is\",C_V, \"X 3R\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Einstein lattice specific heat is 0.921 X 3R\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 15.6, Page number 324"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the molar electronic heat capacity\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nv = 2; #Valency of Zn atom\nN = v*6.02*10**23; #Avogadro's number(per mol)\nT = 300; #Temperature of Zn(K)\nE_F = 9.38; #Fermi energy of Zn(eV)\nk = 1.38*10**-23; #Boltzmann constant(J/K)\nh = 6.626*10**-34; #Planck's constant(Js)\n\n#Calculation\nN = v*6.02*10**23; #Avogadro's number(per mol)\nC_e = math.pi**2*N*k**2*T/(2*E_F*e); #Electronic heat capacity of Zn(J/mol/K)\nC_e = math.ceil(C_e*10**4)/10**4; #rounding off the value of C_e to 4 decimals\n\n#Result\nprint \"The molar electronic heat capacity of zinc is\",C_e, \"J/mol/K\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The molar electronic heat capacity of zinc is 0.2262 J/mol/K\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter17_1.ipynb b/Engineering_Physics/Chapter17_1.ipynb
new file mode 100644
index 00000000..f0df2691
--- /dev/null
+++ b/Engineering_Physics/Chapter17_1.ipynb
@@ -0,0 +1,49 @@
+{
+ "metadata": {
+ "name": "Chapter17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "17: Ultrasonics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 17.1, Page number 352"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the thickness of vibrating quartz\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nf = 3; #Fundamental vibrational frequency of quartz crystal(MHz)\nY = 7.9*10**10; #Young's modulus of quartz(N/m**2)\nrho = 2650; #Density of quartz(kg/m**3)\n\n#Calculation\nf = f*10**6; #Fundamental vibrational frequency of quartz crystal(Hz)\nl = 1/(2*f)*math.sqrt(Y/rho); #Thickness of vibrating quartz at resonance(m)\nl = l*10**3; #Thickness of vibrating quartz at resonance(mm)\nl = math.ceil(l*100)/100; #rounding off the value of l to 2 decimals\n\n#Result\nprint \"The thickness of vibrating quartz at resonance is\",l, \"mm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The thickness of vibrating quartz at resonance is 0.91 mm\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter18_1.ipynb b/Engineering_Physics/Chapter18_1.ipynb
new file mode 100644
index 00000000..aca20375
--- /dev/null
+++ b/Engineering_Physics/Chapter18_1.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "18: Acoustics of Buildings"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 18.1, Page number 361"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the output power of the sound source\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nr = 200; #Distance of the point of reduction from the source(m)\nI_0 = 10**-12; #Final intensity of sound(W/m**2)\nI_f = 60; #Intensity gain of sound at the point of reduction(dB)\n\n#Calculation\n#As A_I = 10*log10(I/I_0), solving for I\nI = I_0*10**(I_f/10); #Initial Intensity of sound(W/m**2)\nP = 4*math.pi*r**2*I; #Output power of the sound source(W)\nP = math.ceil(P*100)/100; #rounding off the value of P to 2 decimals\n\n#Result\nprint \"The output power of the sound source is\",P, \"W\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The output power of the sound source is 0.51 W\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 18.2, Page number 361"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the change in sound level\n\n#importing modules\nimport math\nfrom __future__ import division\nimport numpy as np\n\n#Variable declaration\nI1 = 1; #For simplicity assume first intensity level to be unity(W/m**2)\n\n#Calculation\nI2 = 2*I1; #Intensity level after doubling(W/m**2)\ndA_I = 10*np.log10(I2/I1); #Difference in gain level(dB)\n\n#Result\nprint \"The sound intensity level is increased by\",int(dA_I), \"dB\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sound intensity level is increased by 3 dB\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 18.3, Page number 361"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the total absorption of sound in the hall\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nV = 8000; #Volume of the hall(m**3)\nT = 1.5; #Reverbration time of the hall(s)\n\n#Calculation\nalpha_s = 0.167*V/T; #Sabine Formula giving total absorption of sound in the hall(OWU)\nalpha_s = math.ceil(alpha_s*10)/10; #rounding off the value of alpha_s to 1 decimal\n\n#Result\nprint \"The total absorption of sound in the hall is\",alpha_s, \"OWU\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total absorption of sound in the hall is 890.7 OWU\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 18.4, Page number 362"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the average absorption coefficient of the surfaces\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nV = 25*20*8; #Volume of the hall(m**3)\nT = 4; #Reverbration time of the hall(s)\n\n#Calculation\nS = 2*(25*20+25*8+20*8); #Total surface area of the hall(m**2)\nalpha = 0.167*V/(T*S); #Sabine Formule giving total absorption in the hall(OWU)\nalpha = math.ceil(alpha*10**4)/10**4; #rounding off the value of alpha to 4 decimals\n\n#Result\nprint \"The average absorption coefficient of the surfaces is\",alpha, \"OWU/m**2\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The average absorption coefficient of the surfaces is 0.0971 OWU/m**2\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 18.5, Page number 362"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the reverbration time for the hall\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nV = 475; #Volume of the hall(m**3)\nA_f = 100; #Area of the floor(m**2)\nA_c = 100; #Area of the ceiling(m**2)\nA_w = 200; #Area of the wall(m**2)\nalpha_w = 0.025; #Absorption coefficients of the wall(OWU/m**2)\nalpha_c = 0.02; #Absorption coefficients of the ceiling(OWU/m**2)\nalpha_f = 0.55; #Absorption coefficients of the floor(OWU/m**2)\n\n#Calculation\nalpha_s = (A_w*alpha_w)+(A_c*alpha_c)+(A_f*alpha_f); \nT = 0.167*V/alpha_s; #Sabine Formula for reverbration time(s)\nT = math.ceil(T*100)/100; #rounding off the value of T to 2 decimals\n\n#Result\nprint \"The reverbration time for the hall is\",T, \"s\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The reverbration time for the hall is 1.28 s\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 18.6, Page number 362"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the reverbration time for the hall\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nI0 = 1; #For simplicity assume initial sound intensity to be unity(W/m**2)\nA_I1 = 80; #First intensity gain of sound(dB)\nA_I2 = 70; #Second intensity gain of sound(dB)\n\n#Calculation\n#As A_I = 10*log10(I/I_0), solving for I1 and I2\nI1 = 10**(A_I1/10)*I0; #First intensity of sound(W/m**2)\nI2 = 10**(A_I2/10)*I0; #Second intensity of sound(W/m**2)\nI = I1 + I2; #Resultant intensity level of sound(W/m**2)\nA_I = 10*np.log10(I/I0); #Intensity gain of resultant sound(dB)\nA_I = math.ceil(A_I*10**3)/10**3; #rounding off the value of A_I to 3 decimals\n\n#Result\nprint \"The intensity gain of resultant sound is\",A_I, \"dB\"\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The intensity gain of resultant sound is 80.414 dB\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter1_1.ipynb b/Engineering_Physics/Chapter1_1.ipynb
new file mode 100644
index 00000000..c487a981
--- /dev/null
+++ b/Engineering_Physics/Chapter1_1.ipynb
@@ -0,0 +1,217 @@
+{
+ "metadata": {
+ "name": "Chapter1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "1: Oscillations and Waves"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.1, Page number 23"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the period of motion\n\n#import modules\nimport math\n\n#Variable declaration\nS=4; #SHM described by a particle(cm)\nx=0; #mean position\nv=12; #velocity at mean position(cm/s)\n\n#Calculation\nA=S/2; #amplitude of motion(cm)\nomega=v/A; #angular frequency(sec-1)\nT=(2*math.pi)/omega; #time period(sec)\nT=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"time period of motion is\",T, \"sec\"\nprint \"time period of motion is pi/3 sec\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "time period of motion is 1.048 sec\ntime period of motion is pi/3 sec\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.2, Page number 23"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the acceleration and maximum velocity\n\n#import modules\nimport math\n\n#Variable declaration\nT=0.1; #time period(sec)\nA=4; #amplitude of motion(cm)\nx=0.2; #distance from mean position(cm)\n\n#Calculation\nomega=(2*math.pi)/T; #angular frequency(sec-1)\na=(omega**2)*x; #acceleration(cm/sec^2)\na=math.ceil(a*10**2)/10**2; #rounding off to 2 decimals\n#maximum velocity is when particle is in the mean position\nv_max=omega*A; #maximum velocity(cm/sec)\nv_max=math.ceil(v_max*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"acceleration is\",a, \"cm/sec^2\"\nprint \"maximum velocity is\",v_max, \"cm/sec\"\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "acceleration is 789.57 cm/sec^2\nmaximum velocity is 251.33 cm/sec\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.3, Page number 24"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the damping constant\n\n#import modules\nimport math\nimport numpy as np\n\n#Variable declaration\nA1 = 40; #First amplitude of oscillation(cm)\nAn_plus_1 = 4; #Amplitude after 100 oscillations(cm)\nn = 100; #Number of oscillations\nT = 2.5; #Time period of oscillations(s)\n\n#Calculation\nt = T/4; #Time taken to reach the first amplitude from the mean position(s)\n#Now A1 = x0*math.exp(-lambda*t) and An_plus_1 = x0*math.exp(-lambda*(t+nT))\n#A1/An_plus_1 = math.exp(n*lambda*T)\nx=A1/An_plus_1;\nlamda=np.log(x)/(n*T); #Damping constant(per sec)\nlamda=lamda*10**2;\nlamda=math.ceil(lamda*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"Damping constant is\",lamda,\"*10**-2 per sec\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Damping constant is 0.922 *10**-2 per sec\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.4, Page number 24"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the amplitude and period of oscillation\n\n#import modules\nimport math\n\n#Variable declaration\nx1 = 3; #First position of the particle(cm)\nx2 = 4; #Second position of the particle(cm)\nv1 = 16; #Velocity of particle executing SHM at 1st position(cm/s)\nv2 = 12; #Velocity of particle executing SHM at 2nd position (cm/s)\n\n#Calculation\n#As v = omega*sqrt(A**2 - x**2) so\n#(v1/v2)**2=(A**2 - x1**2)/(A**2 - x2**2)\n#RHS gives (A**2-9)/(A**2-16)\n#(v2**2)*(A**2 - x1**2)=(v1**2)*(A**2 - x2**2), on solving we get\nA=math.sqrt((((v1**2)*(x2**2))-((v2**2)*(x1**2)))/((v1**2)-(v2**2))); #amplitude in cm\nomega=v1/math.sqrt(A**2-x1**2); #Angular speed of the particle(per sec)\nT=2*math.pi/omega; #Time period of oscillation(sec)\nT=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"The amplitude of SHM is\",A, \"cm\"\nprint \"The time period of oscillation is\",T, \"sec\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The amplitude of SHM is 5.0 cm\nThe time period of oscillation is 1.571 sec\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.5, Page number 25"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the spring constant, amplitude and maximum velocity\n\n#import modules\nimport math\n\n#Variable declaration\nm = 0.3; #Mass attached to the string(kg)\ng = 9.8; #Acceleration due to gravity(m/sec**2)\nx = 0.15; #Stretchness produced in the spring(m)\ns = 0.1; #spring is stretched and released(m)\n\n#Calculation\nF = m*g; #Restoring force acting on the mass(N)\nk = F/x; #Spring constant(N/m)\nA = s; #amplitude equals to the spring stretched and released\nomega = math.sqrt(k/m); #Angular frequency of oscillation(rad per sec)\nv0 = omega*A; #Maximum velocity during the oscillations(m/s)\nv0=math.ceil(v0*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"The spring constant is\",k, \"N/m\"\nprint \"The amplitude of oscillation is\",A, \"m\"\nprint \"The maximum velocity during oscillations is\",v0, \"m/s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The spring constant is 19.6 N/m\nThe amplitude of oscillation is 0.1 m\nThe maximum velocity during oscillations is 0.81 m/s\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.6, Page number 25"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the frequency equivalent of visible region\n\n#import modules\nimport math\n\n#Variable declaration\nlambda1 = 400; #Lower limit of wavelength of visible region(nm)\nlambda2 = 700; #Upper limit of wavelength of visible region(nm)\nc = 3*10**8; #Speed of light in vacuum(m/s)\n\n#Calculation\nlambda1 = lambda1*10**-9 #Lower limit of wavelength(m) \nlambda2 = lambda2*10**-9 #upper limit of wavelength(m) \nnew_1 = c/lambda1; #Upper limit of frequency of visible region(m)\nnew_2 = c/lambda2; #Lower limit of frequency of visible region(m)\n\n#Result\nprint \"The frequency equivalent of 400 nm is\",new_1, \"Hz\"\nprint \"The frequency equivalent of 700 nm is\",new_2, \"Hz\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The frequency equivalent of 400 nm is 7.5e+14 Hz\nThe frequency equivalent of 700 nm is 4.28571428571e+14 Hz\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.7, Page number 26"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the amplitude, wavelength, frequency and velocity of the wave\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\n#Comparing the standard equation u(x,t) = A*sin(2*%pi(x/lambda-t/T)) with the given equation, we get\nA = 1.5*10**-3; #Amplitude of the sound wave(m)\nlamda = 8; #Wavelength of the sound wave(m)\nT = 1/40; #Time period of the sound wave(s)\n\n#Calculation\nA = A*10**3;\nnew = 1/T; #Frequency of the sound wave(Hz)\nv = new*lamda; #Velocity of the sound wave(m/s)\nT=math.ceil(T*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"The amplitude of the sound wave is\",A,\"*10**-3 m\"\nprint \"The wavelength of the sound wave is\",lamda, \"m\"\nprint \"The time period of the sound wave is\",T, \"s\"\nprint \"The frequency of the sound wave is\",new, \"Hz\"\nprint \"The velocity of the sound wave is\",v, \"m/s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The amplitude of the sound wave is 1.5 *10**-3 m\nThe wavelength of the sound wave is 8 m\nThe time period of the sound wave is 0.03 s\nThe frequency of the sound wave is 40.0 Hz\nThe velocity of the sound wave is 320.0 m/s\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.8, Page number 26"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To find the equation of a wave\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nA = 2; #Amplitude of the wave(cm)\nT = 0.5; #Time period of the wave(sec)\nv = 200; #Wave velocity(cm/s)\n\n#Calculation\nf = 1/T; #Frequency of the wave(Hz)\nlamda = v/f; #Wavelength of the wave(cm)\n\n#Result\nprint \"frequency of wave is\",f, \"Hz\"\nprint \"wavelength of wave is\",lamda, \"cm\"\nprint \"The Equation of the wave moving along X-axis :\"\nprint \"u = \",A,\"*sin*2*math.pi*(x/\",lamda,\"- t/\",T,\")\" #x and y are in cm and t is in sec",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "frequency of wave is 2.0 Hz\nwavelength of wave is 100.0 cm\nThe Equation of the wave moving along X-axis :\nu = 2 *sin*2*math.pi*(x/ 100.0 - t/ 0.5 )\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.9, Page number 27"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To find the velocity and frequency of the wave\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nT = 1000; #Tension in the wire(N)\nM=15; #mass of the wire(kg)\nl=300; #length of the wire(m)\nlamda = 0.30; #Wavelength of wave along wire(m)\n\n#Calculation\nm = M/l; #Mass per unit length of the wire(kg/m)\nv = math.sqrt(T/m); #Velocity of wave through wire(m/s)\nv=math.ceil(v*100)/100; #rounding off to 2 decimals\nnew = v/lamda; #Frequency of wave through string(Hz)\nnew=math.ceil(new*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"The velocity of the wave through wire is\",v, \"m/s\"\nprint \"The frequency of the wave through wire is\",new, \"Hz\"\n\n#answer for frequency of the wave is wrong in the textbook",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The velocity of the wave through wire is 141.43 m/s\nThe frequency of the wave through wire is 471.44 Hz\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter2_1.ipynb b/Engineering_Physics/Chapter2_1.ipynb
new file mode 100644
index 00000000..f002fd31
--- /dev/null
+++ b/Engineering_Physics/Chapter2_1.ipynb
@@ -0,0 +1,118 @@
+{
+ "metadata": {
+ "name": "Chapter2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "2: Electromagnetic Theory"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.1, Page number 46"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To determine the peak value of displacement current\n\n#importing modules\nfrom __future__ import division\nfrom sympy import *\nimport math\n\n#Variable declaration\nC = 10; #Capacitance of the capacitor(pF)\n#given V=0.2*sin(120*math.pi*t) in volts\n\n#Calculation\nC=C*10**-12; #Capacitance of the capacitor(F)\nx, y, z, t = symbols('x y z t')\nk, m, n = symbols('k m n', integer=True)\nf, g, h = symbols('f g h', cls=Function)\n#I = C*dV/dt\n#let dV/dt be a\na=diff(0.2*sin(120*math.pi*t),t) #dV/dt\n#value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n#for cosine function peak value occurs when 120*math.pi*t = 0\n#therefore value of dV/dt becomes d = 75.398223686155\nd = 75.398223686155; #value of dV/dt \nI=C*d; #displacement current(A)\n\n#Result\nprint \"value of dV/dt is\",a\nprint \"displacement current is\",I, \"A\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "value of dV/dt is 75.398223686155*cos(376.991118430775*t)\ndisplacement current is 7.53982236862e-10 A\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.2, Page number 46"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the peak value of displacement current density in a good conductor\n\n#importing modules\nfrom __future__ import division\nfrom sympy import *\nimport math\n\n#Variable declaration\nepsilon_r = 1; #Relative electrical permittivity of free space\nepsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\n#given E=sin(120*math.pi*t) in volts\n\n#Calculation\nx, y, z, t = symbols('x y z t')\nk, m, n = symbols('k m n', integer=True)\nf, g, h = symbols('f g h', cls=Function)\n#J2 = epsilon*dE/dt\nepsilon=epsilon_0*epsilon_r;\n#let dE/dt be a\na=diff(sin(120*math.pi*t),t) #dE/dt\n#value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n#for cosine function peak value occurs when 120*math.pi*t = 0\n#therefore value of dE/dt becomes d = 376.991118430775\nd = 376.991118430775; #value of dE/dt\nJ2=epsilon*d; #displacement current density(A/m**2)\n\n#Result\nprint \"value of dE/dt is\",a\nprint \"The peak value of displacement current density is\",J2, \"A/m**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "value of dE/dt is 376.991118430775*cos(376.991118430775*t)\nThe peak value of displacement current density is 3.33787936259e-09 A/m**2\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.3, Page number 47 (Theoritical proof)"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.4, Page number 47"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To determine the peak value of displacement current\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\np = 60; #Power rating of bulb(W)\nd = 0.5; #Distance from the bulb(m)\n\n#Calculation\nA=4*math.pi*d**2; #area(m**2)\nP = p/A; #Value of Poynting vector(W/m**2)\nP = math.ceil(P*100)/100; #rounding off value of P to 1 decimal\n\n#Result\nprint \"The value of Poynting vector is\",P, \"W/m**2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The value of Poynting vector is 19.1 W/m**2\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.5, Page number 47"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To determine the velocity of wave, intrinsic impedence and peak value of magnetic intensity\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nE_peak = 6; #Peak value of electric field intensity(V/m)\nc = 3*10**8; #Speed of electromagnetic wave in free space(m/s)\nmew_0 = 4*math.pi*10**-7; #Absolute permeability of free space(Tm/A)\nepsilon_0 = 8.854*10**-12; #Absolute permittivity of free space(F/m)\nmew_r = 1; #Relative permeability of medium\nepsilon_r = 3; #Relative permittivity of the medium\n\n#Calculation\nv = c/math.sqrt(mew_r*epsilon_r); #Wave velocity(m/s)\nv = v/10**8;\nv = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\neta = math.sqrt((mew_0/epsilon_0)*(mew_r/epsilon_r)); #Intrinsic impedance of the medium(ohm)\neta = math.ceil(eta*10)/10; #rounding off the value of v to 1 decimal\nH_P = E_peak/eta; #Peak value of the magnetic intensity(A/m)\nH_P = H_P*10**2;\nH_P = math.ceil(H_P*10**2)/10**2; #rounding off the value of v to 2 decimals\n\n#Result\nprint \"The wave velocity is\",v,\"*10**8 m/s\"\nprint \"The intrinsic impedance of the medium is\",eta, \"ohm\"\nprint \"The peak value of the magnetic intensity is\",H_P,\"*10**-2 A/m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The wave velocity is 1.7321 *10**8 m/s\nThe intrinsic impedance of the medium is 217.6 ohm\nThe peak value of the magnetic intensity is 2.76 *10**-2 A/m\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter3_1.ipynb b/Engineering_Physics/Chapter3_1.ipynb
new file mode 100644
index 00000000..e20ce99f
--- /dev/null
+++ b/Engineering_Physics/Chapter3_1.ipynb
@@ -0,0 +1,238 @@
+{
+ "metadata": {
+ "name": "Chapter3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "3: Interference"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.1, Page number 71"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the velocity of light\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nbeta = 0.51; #Fringe width(mm)\nd = 2.2; #Distance between the slits(mm)\nD = 2; #Distance between the slits and the screen(m)\n\n#Calculation\nbeta = beta*10**-1; #Fringe width(cm)\nd = d*10**-1; #Distance between the slits(cm)\nD=D*10**2; #Distance between the slits and the screen(cm)\nlamda = beta*d/D; #Wavelength of light(cm)\nlamda = lamda*10**8; #Wavelength of light(A)\n\n#Result\nprint \"The wavelength of light is\",lamda, \"angstrom\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The wavelength of light is 5610.0 angstrom\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.2, Page number 71"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the seperation between the third fringe\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nlambda1 = 4250; #First wavelength emitted by source of light(A)\nlambda2 = 5050; #Second wavelength emitted by source of light(A)\nD = 1.5; #Distance between the source and the screen(m)\nd = 0.025; #Distance between the slits(mm)\nn = 3; #Number of fringe from the centre\n\n#Calculation\nlambda1 = lambda1*10**-10; #First wavelength emitted(m)\nlambda2 = lambda2*10**-10; #Second wavelength emitted(m)\nd = d*10**-3; #Distance between the slits(m)\nx3 = n*lambda1*D/d; #Position of third bright fringe due to lambda1(m)\nx3_prime = n*lambda2*D/d; #Position of third bright fringe due to lambda2(m)\nx = x3_prime-x3; #separation between the third bright fringe(m)\nx = x*10**2; #separation between the third bright fringe(cm)\n\n#Result\nprint \"The separation between the third bright fringe due to the two wavelengths is\",x, \"cm\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The separation between the third bright fringe due to the two wavelengths is 1.44 cm\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.3, Page number 71"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the refractive index of the sheet of glass\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda = 5.5*10**-5; #Wavelength emitted by source of light(cm)\nn = 4; #Number of fringes shifted\nt = 3.9*10**-4; #Thickness of the thin glass sheet(cm)\n\n#Calculation\nmew = (n*lamda/t)+1; #Refractive index of the sheet of glass\nmew = math.ceil(mew*10**4)/10**4; #rounding off the value of v to 4 decimals\n\n#Result\nprint \"The refractive index of the sheet of glass is\",mew",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The refractive index of the sheet of glass is 1.5642\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.4, Page number 72"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the least thickness of the film that appears bright and dark\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda = 5893; #Wavelength of monochromatic lihgt used(A)\nn = 1; #Number of fringe for the least thickness of the film\ncosr = 1; #for normal incidence\nmew = 1.42; #refractive index of the soap film\n\n#Calculation\n#As for constructive interference, \n#2*mew*t*cos(r) = (2*n-1)*lambda/2, solving for t\nt = (2*n-1)*lamda/(4*mew*cosr); #Thickness of the film that appears bright(A)\n#As for destructive interference, \n#2*mu*t*cos(r) = n*lambda, solving for t\nt1 = n*lamda/(2*mew*cosr); #Thickness of the film that appears bright(A)\n\n#Result\nprint \"The thickness of the film that appears bright is\",t, \"angstrom\"\nprint \"The thickness of the film that appears dark is\",t1, \"angstrom\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The thickness of the film that appears bright is 1037.5 angstrom\nThe thickness of the film that appears dark is 2075.0 angstrom\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.5, Page number 72"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angle of the wedge\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda = 5893; #Wavelength of monochromatic lihgt used(A)\nn = 10; #Number of fringe that are found \nd = 1; #Distance of 10 fringes(cm)\n\n#Calculation\nbeta = d/n; #Fringe width(cm)\nlamda = lamda*10**-8; #Wavelength of monochromatic lihgt used(cm)\ntheta = lamda/(2*beta); #Angle of the wedge(rad)\ntheta = theta*10**4;\ntheta = math.ceil(theta*10**4)/10**4; #rounding off the value of theta to 4 decimals\n\n#Result\nprint \"The angle of the wedge is\",theta,\"*10**-4 rad\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The angle of the wedge is 2.9465 *10**-4 rad\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.6, Page number 72"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the separation between consecutive bright fringes\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 5900; #Wavelength of monochromatic lihgt used(A)\nt = 0.010; #Spacer thickness(mm)\nl = 10; #Wedge length(cm)\n\n#Calculation\nt = t*10**-1; #Spacer thickness(cm)\ntheta = t/l; #Angle of the wedge(rad)\nlamda = lamda*10**-8; #Wavelength of monochromatic lihgt used(cm)\nbeta = lamda/(2*theta); #Fringe width(cm)\n\n#Result\nprint \"The separation between consecutive bright fringes is\",beta, \"cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The separation between consecutive bright fringes is 0.295 cm\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.7, Page number 72"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the diameter of 20th dark ring\n\n#importing modules\nimport math\n\n#Variable declaration\nD4 = 0.4; #Diameter of 4th dark ring(cm)\nD12 = 0.7; #Diameter of 12th dark ring(cm)\n\n#Calculation\n#We have (dn_plus_k**2)-Dn**2 = 4*k*R*lamda\n#D12**2-D4**2 = 32*R*lamda and D20**2-D12**2 = 32*R*lamda for k = 8\n#since RHS are equal, by equating the LHS we get D12**2-D4**2 = D20**2-D12**2\nD20 = math.sqrt((2*D12**2)-D4**2); #Diameter of 20th dark ring(cm)\nD20 = math.ceil(D20*10**4)/10**4; #rounding off the value of D20 to 4 decimals\n\n#Result\nprint \"The diameter of 20th dark ring is\",D20, \"cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The diameter of 20th dark ring is 0.9056 cm\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.8, Page number 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the refractive index of the liquid\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nDn = 0.30; #Diameter of nth dark ring with air film(cm)\ndn = 0.25; #Diameter of nth dark ring with liquid film(cm)\n\n#Calculation\nmew = (Dn/dn)**2; #Refractive index of the liquid\n\n#Result\nprint \"The refractive index of the liquid is\", mew\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The refractive index of the liquid is 1.44\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.9, Page number 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the wavelength of light\n\n#importing modules\nimport math\n\n#Variable declaration\nx = 0.002945; #Distance through which movable mirror is shifted(cm)\nN = 100; #Number of fringes shifted\n\n#Calculation\nx = x*10**-2; #Distance through which movable mirror is shifted(m)\nlamda = 2*x/N; #Wavelength of light(m)\nlamda = lamda*10**10; #Wavelength of light(A)\n\n#Result\nprint \"The wavelength of light is\",lamda, \"angstrom\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The wavelength of light is 5890.0 angstrom\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.10, Page number 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the shift in movable mirror\n\n#importing modules\nimport math\n\n#Variable declaration\nlambda1 = 5896; #Wavelength of D1 line of sodium(A)\nlambda2 = 5890; #Wavelength of D2 line of sodium(A)\n\n#Calculation\nlamda = (lambda1+lambda2)/2;\nx = (lamda**2)/(2*(lambda1-lambda2)); #Shift in movable mirror of Michelson Interferometer(A)\nx = x*10**-7; #Shift in movable mirror of Michelson Interferometer(mm)\nx = math.ceil(x*10**4)/10**4; #rounding off the value of D20 to 4 decimals\n\n#Result\nprint \"The shift in movable mirror is\",x, \"mm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The shift in movable mirror is 0.2894 mm\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter4_1.ipynb b/Engineering_Physics/Chapter4_1.ipynb
new file mode 100644
index 00000000..4cd8a196
--- /dev/null
+++ b/Engineering_Physics/Chapter4_1.ipynb
@@ -0,0 +1,217 @@
+{
+ "metadata": {
+ "name": "Chapter4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "4: Diffraction"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.1, Page number 91"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the velocity of light\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nD = 50; #Distance between source and the screen(cm)\nlamda = 6563; #Wavelength of light of parallel rays(A)\nd = 0.385; #Width of the slit(mm)\nn1 = 1; #Order of diffraction for first minimum\nn2 = 5; #Order of diffraction for fifth minimum\n\n#Calculation\nlamda = lamda*10**-8; #Wavelength of light of parallel rays(cm)\nd = d*10**-1; #Width of the slit(cm)\n#As sin(theta1) = n*lambda/d = x1/D, solving for x1\nx1 = n1*lamda*D/d; #Distance from the centre of the principal maximum to the first minimum(cm)\nx1 = x1*10; #Distance from the centre of the principal maximum to the first minimum(mm)\nx1 = math.ceil(x1*10**3)/10**3; #rounding off the value of x1 to 3 decimals\nx2 = n2*lamda*D/d; #Distance from the centre of the principal maximum to the fifth minimum(cm)\nx2 = x2*10; #Distance from the centre of the principal maximum to the fifth minimum(mm)\nx2 = math.ceil(x2*10**3)/10**3; #rounding off the value of x2 to 3 decimals\n\n#Result\nprint \"The Distance from the centre of the principal maximum to the first minimum is\",x1, \"mm\"\nprint \"The Distance from the centre of the principal maximum to the fifth minimum is\",x2, \"mm\"\n\n#answer for x2 given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Distance from the centre of the principal maximum to the first minimum is 0.853 mm\nThe Distance from the centre of the principal maximum to the fifth minimum is 4.262 mm\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.2, Page number 91"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the radii of first two dark rings\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nD = 0.04; #Diameter of circular aperture(cm)\nf = 20; #Focal length of convex lens(cm)\nlamda = 6000; #Wavelength of light used(A)\n\n#Calculation\nlamda = lamda*10**-8; #Wavelength of light used(cm)\n#We have sin(theta) = 1.22*lambda/D = theta, for small theta\n#For first dark ring\ntheta = 1.22*lamda/D; #The half angular width at central maximum(rad)\nr1 = theta*f; #The half width of central maximum for first dark ring(cm)\nr1 = r1*10**2;\n#We have sin(theta) = 5.136*lambda/(%pi*D) = theta, for small theta\n#For second dark ring\ntheta = 5.136*lamda/(math.pi*D); #The half angular width at central maximum(rad)\nr2 = theta*f; #The half width of central maximum for second dark ring(cm)\nr2 = r2*10**2;\nr2 = math.ceil(r2*100)/100; #rounding off the value of r2 to 2 decimals\n\n#Result\nprint \"The radius of first dark ring is\",r1,\"*10**-2 cm\"\nprint \"The radius of second dark ring is\",r2,\"*10**-2 cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The radius of first dark ring is 3.66 *10**-2 cm\nThe radius of second dark ring is 4.91 *10**-2 cm\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.3, Page number 92"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angle at which the light produces a second order maximum\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nn = 2; #Order of diffraction\nlamda = 650; #Wavelength of light used(nm)\nd = 1.2*10**-3; #Distance between two consecutive slits of grating(cm)\n\n#Calculation\n#We have sin(theta) = n*N*lambda = n*lambda/d, solving for theta\nlamda = lamda*10**-9; #Wavelength of light used(m)\nd = d*10**-2; #Distance between two consecutive slits of grating(m)\na=n*lamda/d;\ntheta = math.asin(a); #Angle at which the 650 nm light produces a second order maximum(rad)\ntheta = theta*57.2957795; #angle in degrees\ntheta = math.ceil(theta*10**2)/10**2; #rounding off the value of theta to 2 decimals\n\n#Result\nprint \"The angle at which the light produces a second order maximum is\",theta, \"degrees\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The angle at which the light produces a second order maximum is 6.22 degrees\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.4, Page number 92"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the highest order of spectra\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 650; #Wavelength of light used(nm)\nN = 6000; #Number of lines per cm on grating\ntheta = 90; #Angle at which the highest spectral order is obtained(degrees)\n\n#Calculation\ntheta = theta*0.0174532925; #Angle at which the highest spectral order is obtained(rad)\n#We have sin(theta) = n*N*lambda, solving for n\nlamda = lamda*10**-9; #Wavelength of light used(m)\nN = N*10**2; #Number of lines per m on grating\nn = math.sin(theta)/(N*lamda); #The highest order of spectra with diffraction grating\nn = math.ceil(n*10**3)/10**3; #rounding off the value of theta to 3 decimals\ni,d = divmod(n, 1); #divides the value of n into integer and decimal parts where i is integer\n\n#Result\nprint \"value of n is\",n\nprint \"The highest order of spectra obtained with diffraction grating is\",i\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "value of n is 2.565\nThe highest order of spectra obtained with diffraction grating is 2.0\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.5, Page number 92"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To show that the blue line and red line overlap\n\n#importing modules\nimport math\n\n#Variable declaration\nN = 4000; #Number of lines per cm on grating\n#For Blue Line\nlamda1 = 450; #Wavelength of blue light(nm)\nn1 = 3; #Order of diffraction spectrum\n#For Red Line\nlamda2 = 700; #Wavelength of red light(nm)\nn2 = 2; #Order of diffraction spectrum\n\n#Calculation\nN = N*10**2; #Number of lines per m on grating\nlamda1 = lamda1*10**-9; #Wavelength of blue light(m)\nlamda2 = lamda2*10**-9; #Wavelength of red light(m)\n#We have sin(theta) = n*N*lambda, solving for sin(theta)\nsin_theta_3 = n1*N*lamda1; #Sine of angle at third order diffraction \nsin_theta_2 = n2*N*lamda2; #Sine of angle at second order diffraction\n\n#Result\nprint \"Sine of angle at third order diffraction is\",sin_theta_3\nprint \"Sine of angle at second order diffraction is\",sin_theta_2 \n#Check for overlapping\nif (sin_theta_2-sin_theta_3)<0.05:\n print \"The two orders overlap\"\nelse:\n print \"The two orders do not overlap\" ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Sine of angle at third order diffraction is 0.54\nSine of angle at second order diffraction is 0.56\nThe two orders overlap\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.6, Page number 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the width of first order spectrum on the screen\n\n#importing modules\nimport math\n\n#Variable declaration\nn = 1; #Order of diffraction spectrum\nN = 6000; #Number of lines per cm on diffraction grating\nD = 2; #Distance of screen from the source(m)\nlamda1 = 400; #Wavelength of blue light(nm)\nlamda2 = 750; #Wavelength of blue light(nm)\n\n#Calculation\nN = N*10**2; #Number of lines per m on grating\nlamda1 = lamda1*10**-9; #Wavelength of blue light(m)\nlamda2 = lamda2*10**-9; #Wavelength of blue light(m)\n#We have sin(theta1) = n*N*lamda1, solving for theta1\ntheta1 = math.asin(n*N*lamda1); #Angle at first order diffraction for Blue light(rad)\ntheta1_d = theta1*57.2957795; #Angle at first order diffraction for Blue light(degrees)\ntheta2 = math.asin(n*N*lamda2); #Angle at first order diffraction for Red light(rad)\ntheta2_d = theta2*57.2957795; #Angle at first order diffraction for Red light(degrees)\nx1 = D*math.tan(theta1); #Half width position at central maximum for blue color(m)\nx2 = D*math.tan(theta2); #Half width position at central maximum for red color(m)\nx = x2-x1; #width of first order spectrum on the screen(m)\nx = x*10**2; #width of first order spectrum on the screen(cm)\nx = math.ceil(x*10**2)/10**2; #rounding off the value of x to 2 decimals\n\n#Result\nprint \"The width of first order spectrum on the screen is\",x, \"cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The width of first order spectrum on the screen is 51.34 cm\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.7, Page number 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the least separation between wavelengths\n\n#importing modules\nimport math\n\n#Variable declaration\nw = 5; #Width of the grating(cm)\nN = 32; #Number of lines per mm on grating\nlamda = 640; #Wavelength of light(nm)\nn = 2; #Order of diffraction\n\n#Calculation\nN= N*10; #Number of lines per cm on grating\nN0 = w*N; #Total number of lines on the grating\nd_lambda = lamda/(n*N0); #Separation between wavelengths(nm)\n\n#Result\nprint \"The separation between wavelengths which the grating can just resolve is\",d_lambda, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The separation between wavelengths which the grating can just resolve is 0.2 nm\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.8, Page number 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the separation of the centres of the images in the focal plane\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda = 550; #Wavelength of light(nm)\nD = 3.2; #Diameter of circular lens(cm)\nf = 24; #Focal length of the lens(cm) \n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of light(m)\nD = D*10**-2; #Diameter of circular lens(m)\ntheta_min = 1.22*lamda/D; #Minimum angle of resolution provided by the lens(rad)\n#As delta_x/f = theta_min, solving for delta_x\nf = f*10**-2; #Focal length of the lens(m) \ndelta_x = theta_min*f; #Separation of the centres of the images in the focal plane of lens(m)\ndelta_x = delta_x*10**6; #Separation of the centres of the images in the focal plane of lens(micro m)\n \n#Result\nprint \"The separation of the centres of the images in the focal plane is\",round(delta_x), \"micro-metre\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The separation of the centres of the images in the focal plane is 5.0 micro-metre\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.9, Page number 94"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the linear separation between two points\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 550; #Wavelength of light(nm)\nD = 20; #Diameter of objective of telescope(cm)\nd = 6; #Distance of two points from the objective of telescope(km)\n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of light(m)\nD = D*10**-2; #Diameter of objective of telescope(m)\nd = d*10**3; #Distance of two points from the objective of telescope(m)\ntheta = 1.22*lamda/D; #Angular separation between two points(rad)\nx = theta*d; #Linear separation between two points(m)\nx = x*10**3; #Linear separation between two points(mm)\n\n#Result\nprint \"The linear separation between two points is\",x, \"mm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The linear separation between two points is 20.13 mm\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter5_1.ipynb b/Engineering_Physics/Chapter5_1.ipynb
new file mode 100644
index 00000000..3731e0ad
--- /dev/null
+++ b/Engineering_Physics/Chapter5_1.ipynb
@@ -0,0 +1,155 @@
+{
+ "metadata": {
+ "name": "Chapter5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "5: Polarization"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.1, Page number 113"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angle of incidence for complete polarization\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nmew_g = 1.72; #Refractive index of glass\nmew_w = 4/3; #Refractive index of water\n\n#Calculation\n#For polarization to occur on flint glass, tan(i) = mew_g/mew_w\n#Solving for i\ni_g = math.atan(mew_g/mew_w); #angle of incidence for complete polarization for flint glass(rad)\na = 180/math.pi; #conversion factor from radians to degrees\ni_g = i_g*a; #angle of incidence(degrees)\ni_g = math.ceil(i_g*10**2)/10**2; #rounding off the value of i_g to 2 decimals\n#For polarization to occur on water, tan(i) = mew_w/mew_g\n#Solving for i\ni_w = math.atan(mew_w/mew_g); #angle of incidence for complete polarization for water(rad)\ni_w = i_w*a; #angle of incidence(degrees)\ni_w = math.ceil(i_w*10**3)/10**3; #rounding off the value of i_w to 3 decimals\n\n#Result\nprint \"The angle of incidence for complete polarization to occur on flint glass is\",i_g, \"degrees\"\nprint \"The angle of incidence for complete polarization to occur on water is\",i_w, \"degrees\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The angle of incidence for complete polarization to occur on flint glass is 52.22 degrees\nThe angle of incidence for complete polarization to occur on water is 37.783 degrees\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.2, Page number 113"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the percentage transmission of incident light\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nI0 = 1; #For simplicity, we assume the intensity of light falling on the second Nicol prism to be unity(W/m**2)\ntheta = 30; #Angle through which the crossed Nicol is rotated(degrees)\n\n#Calculation\ntheeta = 90-theta; #angle between the planes of transmission after rotating through 30 degrees\na = math.pi/180; #conversion factor from degrees to radians\ntheeta = theeta*a; ##angle between the planes of transmission(rad)\nI = I0*math.cos(theeta)**2; #Intensity of the emerging light from second Nicol(W/m**2)\nT = (I/(2*I0))*100; #Percentage transmission of incident light\nT = math.ceil(T*100)/100; #rounding off the value of T to 2 decimals\n\n#Result\nprint \"The percentage transmission of incident light after emerging through the Nicol prism is\",T, \"%\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The percentage transmission of incident light after emerging through the Nicol prism is 12.51 %\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.3, Page number 113"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the thickness of Quarter Wave plate\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nlamda = 6000; #Wavelength of incident light(A)\nmew_e = 1.55; #Refractive index of extraordinary ray\nmew_o = 1.54; #Refractive index of ordinary ray\n\n#Calculation\nlamda = lamda*10**-8; #Wavelength of incident light(cm)\nt = lamda/(4*(mew_e-mew_o)); #Thickness of Quarter Wave plate of positive crystal(cm)\n\n#Result\nprint \"The thickness of Quarter Wave plate is\",t, \"cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The thickness of Quarter Wave plate is 0.0015 cm\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.4, Page number 114"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To show the behaviour of the plate\n\n#Calculation\n#the thickness of a half wave plate of calcite for wavelength lamda is\n#t = lamda/(2*(mew_e - mew_o)) = (2*lamda)/(4*(mew_e - mew_o))\n\n#Result\nprint \"The half wave plate for lamda will behave as a quarter wave plate for 2*lamda for negligible variation of refractive index with wavelength\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The half wave plate for lamda will behave as a quarter wave plate for 2*lamda for negligible variation of refractive index with wavelength\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.5, Page number 114"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the phase retardation\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nlamda = 500; #Wavelength of incident light(nm)\nmew_e = 1.5508; #Refractive index of extraordinary ray\nmew_o = 1.5418; #Refractive index of ordinary ray\nt = 0.032; #Thickness of quartz plate(mm)\n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of incident light(m)\nt = t*10**-3; #Thickness of quartz plate(m)\ndx = (mew_e - mew_o)*t; #Path difference between E-ray and O-ray(m)\ndphi = (2*math.pi)/lamda*dx; #Phase retardation for quartz for given wavelength(rad)\ndphi = dphi/math.pi;\n\n#Result\nprint \"The phase retardation for quartz for given wavelength is\",dphi, \"pi rad\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The phase retardation for quartz for given wavelength is 1.152 pi rad\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.6, Page number 114"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Brewster angle at the boundary\n\n#importing modules\nimport math\n\n#Variable declaration\nC = 52; #Critical angle for total internal reflection(degrees)\n\n#Calculation\na = math.pi/180; #conversion factor from degrees to radians\nC = C*a; #Critical angle for total internal reflection(rad)\n#From Brewster's law, math.tan(i_B) = 1_mew_2\n#Also math.sin(C) = 1_mew_2, so that math.tan(i_B) = math.sin(C), solving for i_B\ni_B = math.atan(math.sin(C)); #Brewster angle at the boundary(rad)\nb = 180/math.pi; #conversion factor from radians to degrees\ni_B = i_B*b; #Brewster angle at the boundary(degrees)\n\n#Result\nprint \"The Brewster angle at the boundary between two materials is\",int(i_B), \"degrees\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Brewster angle at the boundary between two materials is 38 degrees\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter6_1.ipynb b/Engineering_Physics/Chapter6_1.ipynb
new file mode 100644
index 00000000..889b1e18
--- /dev/null
+++ b/Engineering_Physics/Chapter6_1.ipynb
@@ -0,0 +1,307 @@
+{
+ "metadata": {
+ "name": "Chapter6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "6: Crystallography"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.1, Page number 134"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lattice parameter\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nM = 23+35.5; #Molecular weight of NaCl(kg/k-mole)\nd = 2.18*10**3; #Density of rock salt(kg/m**3)\nn = 4; #Number of atoms per unit cell for an fcc lattice of NaCl crystal\nN = 6.02*10**26; #Avogadro's No., atoms/k-mol\n\n#Calculation\na = (n*M/(d*N))**(1/3); #Lattice constant of unit cell of NaCl(m)\na = a*10**9; ##Lattice constant of unit cell of NaCl(nm)\na = math.ceil(a*10**3)/10**3; #rounding off the value of a to 3 decimals\n\n#Result\nprint \"Lattice parameter for the NaCl crystal is\",a, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Lattice parameter for the NaCl crystal is 0.563 nm\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.2, Page number 134"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the miller indices of the plane\n\n#importing modules\nimport math\n\n#Variable declaration\nm = 3;\nn = 2; \np = 1; #Coefficients of intercepts along three axes\n\n#Calculation\n#reciprocals of the intercepts are 1/m, 1/n, 1/p i.e 1/3, 1/2, 1\n#multiplying by LCM the reciprocals become 2, 3, 6\n\n#Result\nprint \"The required miller indices are : (2, 3, 6)\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required miller indices are : (2, 3, 6)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.3, Page number 135"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the miller indices of the plane\n\n#importing modules\nimport math\n\n#Variable declaration\nm = 2; #Coefficient of intercept along x-axis\n#n = infinite Coefficient of intercept along y-axis\np = 3/2; #Coefficient of intercept along z-axis\n\n#Calculation\n#reciprocals of the intercepts are 1/m, 1/n, 1/p i.e 1/2, 0, 2/3\n#multiplying by LCM the reciprocals become 3, 0, 4\n\n#Result\nprint \"The required miller indices are : (3, 0, 4)\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required miller indices are : (3, 0, 4)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.4, Sketching not possible"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.5, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the interplanar spacing between planes\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\n#For (110) planes\nh1 = 1;\nk1 = 1;\nl1 = 0; #Miller Indices for planes in a cubic crystal\na1 = 0.43; #Interatomic spacing(nm)\n#For (212) planes\nh2 = 2; \nk2 = 1;\nl2 = 2; #Miller Indices for planes in a cubic crystal\na2 = 0.43; #Interatomic spacing(nm)\n\n#Calculation\nd1 = a1/(h1**2+k1**2+l1**2)**(1/2); #The interplanar spacing for cubic crystals(nm)\nd1 = math.ceil(d1*10**4)/10**4; #rounding off the value of d1 to 4 decimals\nd2 = a2/(h2**2+k2**2+l2**2)**(1/2); #The interplanar spacing for cubic crystals(nm)\nd2 = math.ceil(d2*10**4)/10**4; #rounding off the value of d2 to 4 decimals\n\n#Result\nprint \"The interplanar spacing between consecutive (110) planes is\",d1, \"nm\";\nprint \"The interplanar spacing between consecutive (212) planes is\",d2, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The interplanar spacing between consecutive (110) planes is 0.3041 nm\nThe interplanar spacing between consecutive (212) planes is 0.1434 nm\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.6, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the interplanar spacing between planes\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh = 2;\nk = 3;\nl = 1; #Miller Indices for planes in a cubic crystal\nr = 0.175; #Atomic radius of fcc lattice(nm)\n\n#Calculation\na = 2*math.sqrt(2)*r; #Interatomic spacing of fcc lattice(nm)\nd = a/(h**2+k**2+l**2)**(1/2); #The interplanar spacing for cubic crystals(nm)\nd = math.ceil(d*10**4)/10**4; #rounding off the value of d to 4 decimals\n\n#Result\nprint \"The interplanar spacing between consecutive (231) planes is\",d, \"nm\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The interplanar spacing between consecutive (231) planes is 0.1323 nm\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.7, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angle of diffraction\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 1.44; #Wavelength of X-rays(A)\nd = 2.8; #Interplanar spacing of rocksalt crystal(A)\nn1 = 1; #For 1st Order diffraction\nn2 = 2; #For 2nd Order diffraction\n\n#Calculation\ntheta1 = math.asin(n1*lamda/(2*d)); #Angle of diffraction(radians)\ntheeta1 = theta1*57.2957795; #Angle of diffraction(degrees)\ntheeta1 = math.ceil(theeta1*10**2)/10**2; #rounding off the value of theeta1 to 2 decimals\ntheta2 = math.asin(n2*lamda/(2*d)); #Angle of diffraction(radians)\ntheeta2 = theta2*57.2957795; #Angle of diffraction(degrees)\ntheeta2 = math.ceil(theeta2*10**2)/10**2; #rounding off the value of theeta2 to 2 decimals\n\n#Result\nprint \"The angle of diffraction for first order maxima is\",theeta1, \"degrees\"\nprint \"The angle of diffraction for second order maxima is\",theeta2, \"degrees\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The angle of diffraction for first order maxima is 14.91 degrees\nThe angle of diffraction for second order maxima is 30.95 degrees\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.8, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the percentage of actual volume occupied by the spheres\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\na = 1; #For convenience, assume interatomic spacing to be unity(m)\n\n#Calculation\nN = 8*(1/8) + 6*(1/2); #total number of spheres in a unit cell\nr = a/(2*math.sqrt(2)); #The atomic radius(m)\nV_atom = N*(4/3)*math.pi*r**3; #Volume of atoms(m**3)\nV_uc = a**3; #Volume of unit cell(m**3)\nPV = (V_atom/V_uc)*100; #percentage of actual volume\nPV = math.ceil(PV*10)/10; #rounding off the value of PV to 1 decimal\n\n#Result\nprint \"The percentage of actual volume occupied by the spheres in fcc structure is\",PV, \"percent\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The percentage of actual volume occupied by the spheres in fcc structure is 74.1 percent\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.9, Page number 137"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the interplanar spacing, wavelength and angle\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\n#For (221) planes\nh = 2; \nk = 2; \nl = 1; #Miller Indices for planes in a cubic crystal\na = 2.68; #Interatomic spacing(A)\nn1 = 1; #First Order of diffraction \nn2 = 2; #Second order of diffraction\ntheta1 = 8.5; #Glancing angle at which Bragg's reflection occurs(degrees)\n\n#Calculation\ntheta1 = theta1*0.0174532925; #Glancing angle at which Bragg's reflection occurs(radians)\na = a*10**-10; #Interatomic spacing(m)\nd = a/(h**2+k**2+l**2)**(1/2); #The interplanar spacing for cubic crystal(m)\nlamda = 2*d*math.sin(theta1)/n1; #Bragg's Law for wavelength of X-rays(m)\nlamda_A = lamda*10**10; #Bragg's Law for wavelength of X-rays(A)\nlamda_A = math.ceil(lamda_A*10**4)/10**4; #rounding off the value of lamda_A to 4 decimals\ntheta2 = math.asin(n2*lamda/(2*d)); #Angle at which second order Bragg reflection occurs(radians)\ntheta2 = theta2*57.2957795; #Angle at which second order Bragg reflection occurs(degrees)\ntheta2 = math.ceil(theta2*10)/10; #rounding off the value of theta2 to 1 decimal\n\n#Result\nprint \"The interplanar spacing between consecutive (221) planes is\",d, \"m\"\nprint \"The wavelength of X-rays is\",lamda_A, \"angstrom\"\nprint \"The angle at which second order Bragg reflection occurs is\",theta2, \"degrees\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The interplanar spacing between consecutive (221) planes is 8.93333333333e-11 m\nThe wavelength of X-rays is 0.2641 angstrom\nThe angle at which second order Bragg reflection occurs is 17.2 degrees\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.10, Page number 137"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lattice parameter for cubic crystal\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh = 1; \nk = 1;\nl = 0; #Miller Indices for planes in a cubic crystal\nn = 1; #First Order of diffraction \ntheta = 25; #Glancing angle at which Bragg's reflection occurs(degrees)\nlamda = 0.7; #Wavelength of X-rays(A)\n\n#Calculation\ntheta = theta*0.0174532925; #Glancing angle at which Bragg's reflection occurs(radians)\nd = n*lamda/(2*math.sin(theta)); #Interplanar spacing of cubic crystal(A)\na = d*(h**2+k**2+l**2)**(1/2); #The lattice parameter for cubic crystal(A)\na = math.ceil(a*10**3)/10**3; #rounding off the value of a to 3 decimals\n\n#Result\nprint \"The lattice parameter for cubic crystal is\",a, \"angstrom\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The lattice parameter for cubic crystal is 1.172 angstrom\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.11, Page number 138"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the wavelength of X-rays and maximum possible order of diffraction\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nd = 0.31; #Interplanar spacing(nm)\nn = 1; #First Order of diffraction \ntheta = 9.25; #Glancing angle at which Bragg's reflection occurs(degrees)\ntheta_max = 90; #Maximum possible angle at which reflection can occur(degrees)\ntheta_max = theta_max*0.0174532925; #Maximum possible angle at which reflection can occur(radians)\n\n#Calculation\ntheta = theta*0.0174532925; #Glancing angle at which Bragg's reflection occurs(radians)\nlamda = 2*d*math.sin(theta)/n; #Wavelength of X-rays(nm) (Bragg's Law)\nlamda = math.ceil(lamda*10**5)/10**5; #rounding off the value of lamda to 5 decimals\nn = 2*d*math.sin(theta_max)/lamda; #Maximum possible order of diffraction\n\n#Result\nprint \"The wavelength of X-rays is\",lamda, \"nm\"\nprint \"The Maximum possible order of diffraction is\",round(n)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The wavelength of X-rays is 0.09967 nm\nThe Maximum possible order of diffraction is 6.0\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.12, Page number 138"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Bragg reflection angle\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\n#For (110) planes\nh1 = 1;\nk1 = 1;\nl1 = 0; #Miller indices for (110) planes\nd_110 = 0.195; #Interplanar spacing between (110) planes(nm)\n#For (210) planes\nh2 = 2;\nk2 = 1; \nl2 = 0; #Miller indices for (110) planes\nn = 2; #Second Order of diffraction \nlamda = 0.071; #Wavelength of X-rays(nm)\n\n#Calculation\na = d_110*(h1**2 + k1**2 + l1**2)**(1/2); #Lattice parameter for bcc crystal(nm)\nd_210 = a/(h2**2 + k2**2 + l2**2)**(1/2); #Interplanar spacing between (210) planes(nm)\ntheta = math.asin(n*lamda/(2*d_210)); #Bragg reflection angle for the second order diffraction(radians)\ntheeta = theta*57.2957795; #Bragg reflection angle for the second order diffraction(degrees)\ntheeta = math.ceil(theeta*10**3)/10**3; #rounding off the value of theeta to 3 decimals\n\n#Result\nprint \"Bragg reflection angle for the second order diffraction is\",theeta, \"degrees\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Bragg reflection angle for the second order diffraction is 35.149 degrees\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.13, Page number 138"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the distance between nearest neighbours\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nd = 2182; #Density of rock salt(kg/m**3)\nn = 4; #Number of atoms per unit cell for an fcc lattice of NaCl crystal\nN = 6.02*10**26; #Avogadro's number(atoms/k-mol)\n\n#Calculation\nM = 23+35.5; #Molecular weight of NaCl(kg/k-mole)\n#V = a^3 = M*n/(N*d)\na = (n*M/(d*N))**(1/3); #Lattice constant of unit cell of NaCl(m)\nD = a/2; #distance between nearest neighbours(m)\nD = D*10**9; #distance between nearest neighbours(nm)\nD = math.ceil(D*10**4)/10**4; #rounding off the value of D to 4 decimals\n\n#Result\nprint \"The distance between nearest neighbours of NaCl structure is\",D, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The distance between nearest neighbours of NaCl structure is 0.2814 nm\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.14, Page number 139"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the percentage change in volume\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nr1 = 1.258; #Atomic radius of bcc structure of iron(A)\nN1 = 2; #Number of atoms per unit cell in bcc structure\n#For fcc structure\nr2 = 1.292; #Atomic radius of fcc structure of iron(A)\nN2 = 4; #Number of atoms per unit cell in fcc structure\n\n#Calculation\na1 = 4*r1/math.sqrt(3); #Lattice parameter of bcc structure of iron(A)\nV1 = a1**3; #Volume of bcc unit cell(A)\nV_atom_bcc = V1/N1; #Volume occupied by one atom(A)\na2 = 2*math.sqrt(2)*r2; #Lattice parameter of fcc structure of iron(A)\nV2 = a2**3; #Volume of fcc unit cell(A)\nV_atom_fcc = V2/N2; #Volume occupied by one atom(A)\ndelta_V = (V_atom_bcc-V_atom_fcc)/V_atom_bcc*100; #Percentage change in volume due to structural change of iron\ndelta_V = math.ceil(delta_V*10**3)/10**3; #rounding off the value of delta_V to 3 decimals\n\n#Result\nprint \"The percentage change in volume of iron is\",delta_V, \"percent\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The percentage change in volume of iron is 0.494 percent\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter7_1.ipynb b/Engineering_Physics/Chapter7_1.ipynb
new file mode 100644
index 00000000..5b1859d1
--- /dev/null
+++ b/Engineering_Physics/Chapter7_1.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "7: Superconductivity"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.1, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical field\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nTc=3.722; #critical temperature(K)\nT=2; #temperature(K)\nBc_0=0.0305; #critical field(T)\n\n#Calculation\nBc_T=Bc_0*(1-(T/Tc)**2); #critical field at 2K(T)\nBc_T = math.ceil(Bc_T*10**4)/10**4; #rounding off the value of Bc_T to 4 decimals\n\n#Result\nprint \"The critical field at 2K is\",Bc_T, \"T\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The critical field at 2K is 0.0217 T\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.2, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the frequency of Josephson current\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nV = 1; #DC voltage applied across the Josephson junction(micro-volt)\ne = 1.6*10**-19; #Charge on an electron(C)\nh = 6.626*10**-34; #Planck's constant(Js)\n\n#Calculation\nV = V*10**-6; #DC voltage applied across the Josephson junction(V)\nf = 2*e*V/h; #Frequency of Josephson current(Hz)\nf = f*10**-6; #Frequency of Josephson current(MHz)\nf = math.ceil(f*10**2)/10**2; #rounding off the value of f to 2 decimals\n\n#Result\nprint \"The frequency of Josephson current is\",f, \"MHz\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The frequency of Josephson current is 482.95 MHz\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.3, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the superconducting energy gap\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nT_c = 0.517; #Critical temperature for cadmium(K)\nk = 1.38*10**-23; #Boltzmann constant(J/K)\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n\n#Calculation\nE_g = 3.5*k*T_c/e; #Superconducting energy gap at absolute zero(eV)\nE_g = E_g*10**4;\nE_g = math.ceil(E_g*10**3)/10**3; #rounding off the value of E_g to 3 decimals\n\n#Result\nprint \"The superconducting energy gap for Cd at absolute zero is\",E_g,\"*10**-4 eV\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The superconducting energy gap for Cd at absolute zero is 1.561 *10**-4 eV\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.4, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the wavelength of photon\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nc = 3*10**8; #Speed of light in free space(m/s)\nh = 6.626*10**-34; #Planck's constant(Js)\nE_g = 1.5*10**-4; #Superconducting energy gap for a material(eV)\n\n#Calculation\n#As E_g = h*new = h*c/lamda, solving for lambda\nlamda = h*c/(E_g*e); #Wavelength of photon to break up a Cooper-pair(m)\nlamda = lamda*10**3;\nlamda = math.ceil(lamda*10**3)/10**3; #rounding off the value of lamda to 3 decimals\n\n#Result\nprint \"The wavelength of photon to break up a Cooper-pair is\",lamda,\"*10**-3 m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The wavelength of photon to break up a Cooper-pair is 8.283 *10**-3 m\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.5, Page number 153"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the London penetration depth of lead\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nlambda_0 = 37; #Penetration depth of lead at 0 kelvin(nm)\nT_c = 7.193; #Critical temperature of superconducting transition for lead(kelvin)\nT = 5.2; #Temperature at which penetration depth for lead becomes lambda_T(kelvin) \n\n#Calculation\nlambda_T = lambda_0*(1-(T/T_c)**4)**(-1/2); #Penetration depth of lead at 5.2 kelvin(nm)\nlambda_T = math.ceil(lambda_T*10)/10; #rounding off the value of lamda_T to 1 decimal\n\n#Result\nprint \"The penetration depth of lead is\",lambda_T, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The penetration depth of lead is 43.4 nm\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.6, Page number 153"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the mass of isotope of mercury\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nM1 = 199; #Mass of an isotope of mercury(amu)\nT_C1 = 4.185; #Transition temperature of the isoptope of Hg(K)\nT_C2 = 4.153; #Transition temperature of another isoptope of Hg(K)\nalpha = 0.5; #Isotope coefficient\n\n#Calculation\nM2 = M1*(T_C1/T_C2)**(1/alpha); #Mass of another isotope of mercury(amu)\nM2 = math.ceil(M2*100)/100; #rounding off the value of M2 to 2 decimals\n\n#Result\nprint \"The mass of another isotope of mercury is\",M2, \"amu\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mass of another isotope of mercury is 202.08 amu\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter8_1.ipynb b/Engineering_Physics/Chapter8_1.ipynb
new file mode 100644
index 00000000..8ec25fcf
--- /dev/null
+++ b/Engineering_Physics/Chapter8_1.ipynb
@@ -0,0 +1,313 @@
+{
+ "metadata": {
+ "name": "Chapter8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "8: Special Theory of Relativity"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.1, Page number 171"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the speed\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nL_0 = 1; #For simplicity, we assume classical length to be unity(m)\nc = 1; #For simplicity assume speed of light to be unity(m/s)\n\n#Calculation\nL = (1-1/100)*L_0; #Relativistic length(m)\n#Relativistic length contraction gives L = L_0*sqrt(1-v^2/c^2), solving for v\nv = math.sqrt(1-(L/L_0)**2)*c; #Speed at which relativistic length is 1 percent of the classical length(m/s)\nv = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n\n#Result\nprint \"The speed at which relativistic length is 1 percent of the classical length is\",v, \"c\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The speed at which relativistic length is 1 percent of the classical length is 0.1411 c\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.2, Page number 171"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the proper lifetime of particle\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 1; #For simplicity assume speed of light to be unity(m/s)\ndelta_t = 5*10**-6; #Mean lifetime of particles as observed in the lab frame(s)\n\n#Calculation\nv = 0.9*c; #Speed at which beam of particles travel(m/s)\ndelta_tau = delta_t*math.sqrt(1-(v/c)**2); #Proper lifetime of particle as per Time Dilation rule(s)\n\n#Result\nprint \"The proper lifetime of particle is\",delta_tau, \"s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The proper lifetime of particle is 2.17944947177e-06 s\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.3, Page number 171. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.4, Page number 172"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the speed of second rocket for same and opposite direction\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 1; #For simplicity assume speed of light to be unity(m/s)\n\n#Calculation\nv = 0.6*c; #Speed with which the rocket leaves the earth(m/s)\nu_prime = 0.9*c; #Relative speed of second rocket w.r.t. the first rocket(m/s)\nu1 = (u_prime+v)/(1+(u_prime*v)/c**2); #Speed of second rocket for same direction of firing as per Velocity Addition Rule(m/s)\nu1 = math.ceil(u1*10**4)/10**4; #rounding off the value of u1 to 4 decimals\nu2 = (-u_prime+v)/(1-(u_prime*v)/c**2); #Speed of second rocket for opposite direction of firing as per Velocity Addition Rule(m/s)\nu2 = math.ceil(u2*10**4)/10**4; #rounding off the value of u2 to 4 decimals\n\n#Result\nprint \"The speed of second rocket for same direction of firing is\",u1,\"c\"\nprint \"The speed of second rocket for opposite direction of firing is\",u2,\"c\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The speed of second rocket for same direction of firing is 0.9741 c\nThe speed of second rocket for opposite direction of firing is -0.6521 c\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.5, Page number 172"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the speed and time dilation of spaceship\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 1; #For simplicity assume speed of light to be unity(m/s)\nL0 = 1; #For simplicity assume length in spaceship's frame to be unity(m)\ntau = 1; #Unit time in the spaceship's frame(s)\n\n#Calculation\nL = 1/2*L0; #Length as observed on earth(m)\n#Relativistic length contraction gives L = L_0*sqrt(1-v^2/c^2), solving for v\nv = math.sqrt(1-(L/L0)**2)*c; #Speed at which length of spaceship is observed as half from the earth frame(m/s)\nt = tau/math.sqrt(1-(v/c)**2); #Time dilation of the spaceship's unit time(s)\nv = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n\n#Result\nprint \"The speed at which length of spaceship is observed as half from the earth frame is\",v, \"c\"\nprint \"The time dilation of the spaceship unit time is\",t,\"delta_tau\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The speed at which length of spaceship is observed as half from the earth frame is 0.8661 c\nThe time dilation of the spaceship unit time is 2.0 delta_tau\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.6, Page number 172"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the time difference and distance between the events\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 3*10**8; #Speed of light in vacuum(m/s)\nt1 = 2*10**-7; #Time for which first event occurs(s)\nt2 = 3*10**-7; #Time for which second event occurs(s)\nx1 = 10; #Position at which first event occurs(m)\nx2 = 40; #Position at which second event occurs(m)\n\n#Calculation\nv = 0.6*c; #Velocity with which S2 frame moves relative to S1 frame(m/s)\nL_factor = 1/math.sqrt(1-(v/c)**2); #Lorentz factor\ndelta_t = L_factor*(t2 - t1)+L_factor*v/c**2*(x1 - x2); #Time difference between the events(s)\ndelta_x = L_factor*(x2 - x1)-L_factor*v*(t2 - t1); #Distance between the events(m)\n\n#Result\nprint \"The time difference between the events is\",delta_t, \"s\" \nprint \"The distance between the events is\",delta_x, \"m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The time difference between the events is 5e-08 s\nThe distance between the events is 15.0 m\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.7, Page number 173"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the speed of the unstable particle\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 3*10**8; #Speed of light in vacuum(m/s)\ntau = 2.6*10**-8; #Mean lifetime the particle in its own frame(s)\nd = 20; #Distance which the unstable particle travels before decaying(m)\n\n#Calculation\n#As t = d/v and also t = tau/sqrt(1-(v/c)^2), so that\n#d/v = tau/sqrt(1-(v/c)^2), solving for v\nv = math.sqrt(d**2/(tau**2+(d/c)**2)); #Speed of the unstable particle in lab frame(m/s)\nv = v/10**8;\nv = math.ceil(v*10)/10; #rounding off the value of v to 1 decimal\n\n#Result\nprint \"The speed of the unstable particle in lab frame is\",v,\"*10**8 m/s\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The speed of the unstable particle in lab frame is 2.8 *10**8 m/s\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.8, Page number 174"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the speed, effective mass and kinetic energy of mu-meson\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 1; #For simplicity assume speed of light to be unity(m/s)\nme = 1; #For simplicity assume mass of electron to be unity(kg)\ntau = 2.3*10**-6; #Average lifetime of mu-meson in rest frame(s)\nt = 6.9*10**-6; #Average lifetime of mu-meson in laboratory frame(s)\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nC = 3*10**8; #Speed of light in vacuum(m/s)\nm_e = 9.1*10**-31; #Mass of an electron(kg)\n\n#Calculation\n#Fromm Time Dilation Rule, tau = t*sqrt(1-(v/c)^2), solving for v\nv = c*math.sqrt(1-(tau/t)**2); #Speed of mu-meson in the laboratory frame(m/s)\nv = math.ceil(v*10**5)/10**5; #rounding off the value of v to 5 decimals\nm0 = 207*me; #Rest mass of mu-meson(kg)\nm = m0/math.sqrt(1-(v/c)**2); #Relativistic variation of mass with velocity(kg)\nm = math.ceil(m*10)/10; #rounding off the value of m to 1 decimal\nT = (m*m_e*C**2 - m0*m_e*C**2)/e; #Kinetic energy of mu-meson(eV)\nT = T*10**-6; #Kinetic energy of mu-meson(MeV)\nT = math.ceil(T*100)/100; #rounding off the value of T to 2 decimals\n \n#Result\nprint \"The speed of mu-meson in the laboratory frame is\",v, \"c\"\nprint \"The effective mass of mu-meson is\",m, \"me\"\nprint \"The kinetic energy of mu-meson is\",T, \"MeV\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The speed of mu-meson in the laboratory frame is 0.94281 c\nThe effective mass of mu-meson is 621.1 me\nThe kinetic energy of mu-meson is 211.97 MeV\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.9, Page number 174"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the speed of moving body\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 1; #For simplicity assume speed of light to be unity(m/s)\nm0 = 1; #For simplicity assume rest mass to be unity(kg)\n\n#Calculation\nm = (20/100+1)*m0; #Mass in motion(kg)\n#As m = m0/sqrt(1-(u/c)^2), solving for u\nu = math.sqrt(1-(m0/m)**2)*c; #Speed of moving mass(m/s) \nu = math.ceil(u*10**3)/10**3; #rounding off the value of u to 3 decimals\n\n#Result\nprint \"The speed of moving body is\",u, \"c\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The speed of moving body is 0.553 c\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.10, Page number 175"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the rate of decrease of mass\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 3*10**8; #Speed of light in vacuum(m/s)\ndE = 4*10**26; #Energy radiated per second my the sun(J/s)\n\n#Calculation\ndm = dE/c**2; #Rate of decrease of mass of sun(kg/s)\ndm = dm/10**9;\ndm = math.ceil(dm*10**3)/10**3; #rounding off the value of dm to 3 decimals\n\n#Result\nprint \"The rate of decrease of mass of sun is\",dm,\"*10**9 kg/s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of decrease of mass of sun is 4.445 *10**9 kg/s\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.11, Page number 175"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the momentum and velocity of the electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 1; #For simplicity assume speed of light to be unity(m/s)\nm0 = 9.1*10**-31; #Mass of the electron(kg)\nE0 = 0.512; #Rest energy of electron(MeV)\nT = 10; #Kinetic energy of electron(MeV)\n\n#Calculation\nE = T + E0; #Total energy of electron(MeV)\n# From Relativistic mass-energy relation E^2 = c^2*p^2 + m0^2*c^4, solving for p\np = math.sqrt(E**2-m0**2*c**4)/c; #Momentum of the electron(MeV)\np = math.ceil(p*100)/100; #rounding off the value of p to 2 decimals\n#As E = E0/sqrt(1-(u/c)^2), solving for u\nu = math.sqrt(1-(E0/E)**2)*c; #Velocity of the electron(m/s)\nu = math.ceil(u*10**4)/10**4; #rounding off the value of u to 4 decimals\n\n#Result\nprint \"The momentum of the electron is\",p,\"/c MeV\"\nprint \"The velocity of the electron is\",u, \"c\"\n\n#answer for velocity given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The momentum of the electron is 10.52 /c MeV\nThe velocity of the electron is 0.9989 c\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.12, Page number 175. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.13, Page number 176"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the rest mass of the body\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 3*10**8; #Speed of light in vacuum(m/s)\nE = 4.5*10**17; #Total energy of object(J)\npx = 3.8*10**8; #X-component of momentum(kg-m/s)\npy = 3*10**8; #Y-component of momentum(kg-m/s)\npz = 3*10**8; #Z-component of momentum(kg-m/s)\n\n#Calculation\np = math.sqrt(px**2+py**2+pz**2); #Total momentum of the object(kg-m/s)\n#From Relativistic mass-energy relation E^2 = c^2*p^2 + m0^2*c^4, solving for m0\nm0 = math.sqrt(E**2/c**4 - p**2/c**2); #Rest mass of the body(kg)\nm0 = math.ceil(m0*100)/100; #rounding off the value of m0 to 2 decimals\n\n#Result\nprint \"The rest mass of the body is\",m0, \"kg\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rest mass of the body is 4.63 kg\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.14, Page number 176"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the momentum of the high speed probe\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 3*10**8; #Speed of light in vacuum(m/s)\nm = 50000; #Mass of high speed probe(kg)\n\n#Calculation\nu = 0.8*c; #Speed of the probe(m/s)\np = m*u/math.sqrt(1-(u/c)**2); #Momentum of the probe(kg-m/s)\n\n#Result\nprint \"The momentum of the high speed probe is\",p, \"kg-m/s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The momentum of the high speed probe is 2e+13 kg-m/s\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.15, Page number 177"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the change in mass, work done and accelerating potential\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Electronic charge, C = Energy equivalent of 1 eV(J/eV)\nm0 = 9.11*10**-31; #Rest mass of electron(kg)\nc = 3*10**8; #Speed of light in vacuum(m/s)\n\n#Calculation\nu1 = 0.98*c; #Inital speed of electron(m/s)\nu2 = 0.99*c; #Final speed of electron(m/s)\nm1 = m0/math.sqrt(1-(u1/c)**2); #Initial relativistic mass of electron(kg)\nm2 = m0/math.sqrt(1-(u2/c)**2); #Final relativistic mass of electron(kg)\ndm = m2 - m1; #Change in relativistic mass of the electron(kg)\nW = dm*c**2/e; #Work done on the electron to change its velocity(eV)\nW = W*10**-6; #Work done on the electron to change its velocity(MeV)\nW = math.ceil(W*100)/100; #rounding off the value of W to 2 decimals\n#As W = eV, V = accelerating potential, solving for V\nV = W*10**6; #Accelerating potential(volt)\nV = V/10**6;\n\n#Result\nprint \"The change in relativistic mass of the electron is\",dm, \"kg\"\nprint \"The work done on the electron to change its velocity is\",W, \"MeV\"\nprint \"The accelerating potential is\",V, \"*10**6 volt\"\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The change in relativistic mass of the electron is 1.87996052912e-30 kg\nThe work done on the electron to change its velocity is 1.06 MeV\nThe accelerating potential is 1.06 *10**6 volt\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter9_1.ipynb b/Engineering_Physics/Chapter9_1.ipynb
new file mode 100644
index 00000000..50e4b6bd
--- /dev/null
+++ b/Engineering_Physics/Chapter9_1.ipynb
@@ -0,0 +1,202 @@
+{
+ "metadata": {
+ "name": "Chapter9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "9: Quantum Mechanics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.1, Page number 202"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the De-Broglie wavelength of electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nV = 100; #Accelerating potential for electron(volt)\n\n#Calculation\nlamda = math.sqrt(150/V)*10**-10; #de-Broglie wavelength of electron(m)\n\n#Result\nprint \"The De-Broglie wavelength of electron is\",lamda, \"m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The De-Broglie wavelength of electron is 1.22474487139e-10 m\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.2, Page number 203"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the De-Broglie wavelength of electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nh = 6.626*10**-34; #Planck's constant(Js)\nm = 9.11*10**-31; #Mass of the electron(kg)\nEk = 10; #Kinetic energy of electron(eV)\n\n#Calculation\np = math.sqrt(2*m*Ek*e); #Momentum of the electron(kg-m/s)\nlamda = h/p ; #de-Broglie wavelength of electron from De-Broglie relation(m)\nlamda = lamda*10**9; #de-Broglie wavelength of electron from De-Broglie relation(nm)\nlamda = math.ceil(lamda*10**2)/10**2; #rounding off the value of lamda to 2 decimals\n\n#Result\nprint \"The de-Broglie wavelength of electron is\",lamda, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The de-Broglie wavelength of electron is 0.39 nm\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.3, Page number 203. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.4, Page number 203"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the uncertainty in position of electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh = 6.626*10**-34; #Planck's constant(Js)\nm = 9.11*10**-31; #Mass of the electron(kg)\nv = 1.1*10**6; #Speed of the electron(m/s)\npr = 0.1; #precision in percent\n\n#Calculation\np = m*v; #Momentum of the electron(kg-m/s)\ndp = pr/100*p; #Uncertainty in momentum(kg-m/s)\nh_bar = h/(2*math.pi); #Reduced Planck's constant(Js)\ndx = h_bar/(2*dp); #Uncertainty in position(m)\n\n#Result\nprint \"The uncertainty in position of electron is\",dx, \"m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The uncertainty in position of electron is 5.26175358211e-08 m\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.5, Page number 203"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the uncertainty in energy of the excited state\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\nh = 6.626*10**-34; #Planck's constant(Js)\ndt = 10**-8; #Uncertainty in time(s)\n\n#Calculation\nh_bar = h/(2*math.pi); #Reduced Planck's constant(Js)\ndE = h_bar/(2*dt*e); #Uncertainty in energy of the excited state(m)\n\n#Result\nprint \"The uncertainty in energy of the excited state is\",dE, \"eV\"\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The uncertainty in energy of the excited state is 3.2955020404e-08 eV\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.6, Page number 204"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the width of spectral line\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nc = 3*10**8; #Speed of light(m/s)\ndt = 10**-8; #Average lifetime(s)\nlamda = 400; #Wavelength of spectral line(nm)\n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of spectral line(m)\n#From Heisenberg uncertainty principle,\n#dE = h_bar/(2*dt) and also dE = h*c/lambda^2*d_lambda, which give\n#h_bar/(2*dt) = h*c/lambda^2*d_lambda, solving for d_lambda\nd_lamda = (lamda**2)/(4*math.pi*c*dt); #Width of spectral line(m)\n\n#Result\nprint \"The width of spectral line is\",d_lamda, \"m\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The width of spectral line is 4.24413181578e-15 m\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.7, Page number 204. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.8, Page number 204. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.9, Page number 205. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.10, Page number 205. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.11, Page number 205. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.12, Page number 206. theoritical proof"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.13, Page number 206. theoritical proof "
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.14, Page number 207"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the probability of finding the electron\n\n#importing modules\nimport math\nfrom __future__ import division\nfrom scipy.integrate import quad\n\n#Variable declaration\na = 2*10**-10; # Width of 1D box(m)\nx1=0; # Position of first extreme of the box(m)\nx2=1*10**-10; # Position of second extreme of the box(m)\n\n#Calculation\ndef intg(x):\n return ((2/a)*(math.sin(2*math.pi*x/a))**2)\nS=quad(intg,x1,x2)[0]\n\n#Result\nprint \"The probability of finding the electron between x = 0 and x = 10**-10 is\",S",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The probability of finding the electron between x = 0 and x = 10**-10 is 0.5\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_1.ipynb b/Engineering_Physics/Chapter_1.ipynb
new file mode 100644
index 00000000..4392ba50
--- /dev/null
+++ b/Engineering_Physics/Chapter_1.ipynb
@@ -0,0 +1,133 @@
+{
+ "metadata": {
+ "name": "Chapter 1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Ultrasonics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.1, Page number 28 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the fundamental frequency of vibration\n\n#importing modules\nimport math\n\n#Variable declaration\nt=0.15*10**-2; #thickness of the quartz crystal in m\nY=7.9*10**10; #young's modulus of quartz in N/m^2\nrho=2650; #density of quartz in kg/m^3\n\n#Calculation\nx=math.sqrt(Y/rho);\nf=x/(2*t);\nf=f*10**-6; #converting f from Hz to MHz\nf=math.ceil(f*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"fundamental frequency of vibration in MHz is\",f);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fundamental frequency of vibration in MHz is', 1.819992)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.2, Page number 28 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the fundamental frequency and the first overtone\n\n#importing modules\nimport math\n\n#Variable declaration\nt=1e-03; #thickness of the quartz crystal in m\nY=7.9*10**10; #young's modulus of quartz in N/m^2\nrho=2650; #density of quartz in kg/m^3\n\n#Calculation\nx=math.sqrt(Y/rho);\np1=1; #for fundamental frequency p=1\nf1=(p1*x)/(2*t);\nF1=f1/10**6;\nF1=math.ceil(F1*10**5)/10**5; #rounding off to 5 decimals\nf_1=f1*10**-6; #converting f1 from Hz to MHz\nf_1=math.ceil(f_1*10**5)/10**5; #rounding off to 5 decimals\np2=2; #for first overtone p=2\nf2=(p2*x)/(2*t);\nF2=f2/10**6;\nF2=math.ceil(F2*10**5)/10**5; #rounding off to 5 decimals\nf_2=f2*10**-6; #converting f2 from Hz to MHz\nf_2=math.ceil(f_2*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"fundamental frequency in Hz is\",F1,\"*10**6\");\nprint(\"fundamental frequency in MHz is\",f_1);\nprint(\"frequency of the first overtone in Hz is\",F2,\"*10**6\");\nprint(\"frequency of the first overtone in MHz is\",f_2);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fundamental frequency in Hz is', 2.72999, '*10**6')\n('fundamental frequency in MHz is', 2.72999)\n('frequency of the first overtone in Hz is', 5.45998, '*10**6')\n('frequency of the first overtone in MHz is', 5.45998)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.3, Page number 29 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the velocity of ultrasonic wave\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda=589.3*10**-9; #wavelength of light in m\nf=100*10**6; #frequency of ultrasonic transducer in Hz\nn=1; #order of diffraction\ntheta=2.25; #angle of diffraction in degrees\ntheta=theta*0.0174532925; #converting degrees to radians\n\n#Calculation\nd=(n*lamda)/(2*math.sin(theta));\nd1=d*10**6; #converting d from m to micro m\nlamda1=2*d;\nv=f*lamda1;\nv=math.ceil(v*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"wavelength of ultrasonic wave in m is\",lamda1);\nprint(\"velocity of ultrasonic wave in m/sec\",int(v));",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('wavelength of ultrasonic wave in m is', 1.5010258944908707e-05)\n('velocity of ultrasonic wave in m/sec', 1501)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.4, Page number 29 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Doppler shifted frequency\n\n#importing modules\nimport math\n\n#Variable declaration\nf=2*10**6; #frequency of transducer in MHz\nv=3; #speed of blood in m/s\nc=800; #velocity of ultrasonic wave in m/s\ntheta=30; #angle of inclination in degrees\ntheta=theta*0.0174532925; #converting degrees to radians\n\n#Calculation\ndeltaf=(2*f*v*math.cos(theta))/c;\ndeltaf=deltaf*10**-6; #converting deltaf from Hz to MHz\ndeltaf=math.ceil(deltaf*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"doppler shifted frequency in MHz is\",deltaf);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('doppler shifted frequency in MHz is', 0.012991)\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.5, Page number 30 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the velocity of ultrasonic wave\n\n#importing modules\nimport math\n\n#Variable declaration\nY=7.9*10**10; #young's modulus of quartz in N/m^2\nrho=2650; #density of quartz in kg/m^3\n\n#Calculation\nv=math.sqrt(Y/rho);\nv=math.ceil(v*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"velocity of ultrasonic waves in m/s is\",v);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('velocity of ultrasonic waves in m/s is', 5459.975)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_10.ipynb b/Engineering_Physics/Chapter_10.ipynb
new file mode 100644
index 00000000..d1968a2f
--- /dev/null
+++ b/Engineering_Physics/Chapter_10.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter 10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Magnetic materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.1, Page number 305"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the intensity of magnetisation and flux density\n\n#importing modules\nimport math\n\n#Variable declaration\nH=10**6; #magnetic field strength in A/m\nchi=0.5*10**-5; #magnetic susceptibility\n\n#Calculation\nmew0=4*math.pi*10**-7;\nM=chi*H;\nB=mew0*(M+H);\nB=math.ceil(B*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"intensity of magnetisation in A/m is\",M);\nprint(\"flux density in Wb/m^2 is\",B);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('intensity of magnetisation in A/m is', 5.0)\n('flux density in Wb/m^2 is', 1.257)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.2, Page number 306"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the magnetic moment\n\n#importing modules\nimport math\n\n#Variable declaration\nA=6.022*10**23; #avagadro number\nmew0=4*math.pi*10**-7;\nw=58.7; #atomic weight of Ni\nB=0.65; #saturation magnetic induction in Wb/m^2\nrho=8906; #density in kg/m^3\n\n#Calculation\nrho=rho*10**3; #converting into gm/m^3\nN=(rho*A)/w;\nmew_m=B/(N*mew0);\n#mew_m/(9.27*10^-24) gives mew_m in mewB\nmew_m=mew_m/(9.27*10**-24);\nmew_m=math.ceil(mew_m*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"magnetic moment of Ni is\",mew_m,\"mew_b\");\n#that is mew_m=0.61 mew_b",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetic moment of Ni is', 0.611, 'mew_b')\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.3, Page number 306"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the permeability\n\n#importing modules\nimport math\n\n#Variable declaration\nmew_0=4*math.pi*10**-7;\nH=1800; #magnetic field in A/m\nphi=3*10**-5; #magnetic flux in Wb\nA=0.2; #area of cross section in cm^2\n\n#Calculation\nA=A*10**-4; #area in m^2\nB=phi/A;\nmew_r=B/(mew_0*H);\nmew_r=math.ceil(mew_r*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"permeability of material is\",mew_r);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('permeability of material is', 663.146)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.4, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the saturation magnetisation \n\n#importing modules\nimport math\n\n#Variable declaration\nmew=18.4; #magnetic moment in mew_b\na=0.835; #lattice parameter in nm\n\n#Calculation\nmew=mew*9.27*10**-24;\na=a*10**-9; #converting nm to m\nV=a**3;\nM=mew/V;\nM=M/10**5;\nM=math.ceil(M*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"saturation magnetisation in A/m is\",M,\"*10**5\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('saturation magnetisation in A/m is', 2.9299, '*10**5')\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.5, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the value of B and M\n\n#importing modules\nimport math\n\n#Variable declaration\nmew_0=4*math.pi*10**-7;\nH=2*10**5; #magnetic field strength in A/m\nmew_r=1.01; #relative permeability\n\n#Calculation\nB=mew_0*mew_r*H;\nB=math.ceil(B*10**5)/10**5; #rounding off to 3 decimals\nM=(B/mew_0)-H;\nM=math.ceil(M*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"magnetic flux density in Wb/m^2 is\",B);\nprint(\"magnetisation in A/m is\",M);\n\n#answer for magnetisation given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetic flux density in Wb/m^2 is', 0.25385)\n('magnetisation in A/m is', 2007.42)\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 10.6, Page number 307"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the magnetic flux density\n\n#importing modules\nimport math\n\n#Variable declaration\nmew_0=4*math.pi*10**-7;\nH=500; #magnetic field strength in A/m\nchi=1.2; #susceptibility\n\n#Calculation\nM=chi*H;\nB=mew_0*(M+H);\nB=B*10**3;\nB=math.ceil(B*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"magnetic flux density in Wb/m^2 is\",B,\"*10**-3\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetic flux density in Wb/m^2 is', 1.3824, '*10**-3')\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_11.ipynb b/Engineering_Physics/Chapter_11.ipynb
new file mode 100644
index 00000000..6e1a896d
--- /dev/null
+++ b/Engineering_Physics/Chapter_11.ipynb
@@ -0,0 +1,175 @@
+{
+ "metadata": {
+ "name": "Chapter 11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Dielectric materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.1, Page number 335"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the relative dielectric constant\n\n#importing modules\nimport math\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nA=10*10*10**-6; #area of capacitor in m^2\nd=2*10**-3; #distance of seperation in m\nC=10**-9; #capacitance in F\n\n#Calculation\nepsilon_r=(C*d)/(epsilon_0*A);\nepsilon_r=math.ceil(epsilon_r*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"dielectric constant of material is\",epsilon_r);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('dielectric constant of material is', 2258.87)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.2, Page number 335"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic polarizability of atoms\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nepsilon_r=1.0000684; #dielectric constant of He gas\nN=2.7*10**25; #concentration of dipoles per m^3\n\n#Calculation\n#alpha_e=P/(N*E) and P=epsilon_0(epsilon_r-1)*E\n#therefore alpha_e=epsilon_0(epsilon_r-1)/N\nalpha_e=(epsilon_0*(epsilon_r-1))/N;\n\n#Result\nprint(\"electronic polarizability of He gas in Fm^2 is\",alpha_e);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('electronic polarizability of He gas in Fm^2 is', 2.2430133333322991e-41)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.3, Page number 336"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the polarisation\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nepsilon_r=6; #dielectric constant\nE=100; #electric field intensity in V/m\n\n#Calculation\nP=epsilon_0*(epsilon_r-1)*E;\n\n#Result\nprint(\"polarization in C/m^2 is\",P);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('polarization in C/m^2 is', 4.426999999999999e-09)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.4, Page number 336"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electronic polarizability of Ne\n\n#importing modules\nimport math\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nR=0.158; #radius of Ne in nm\n\n#Calculation\nR=R*10**-9; #converting nm to m\nalpha_e=4*math.pi*epsilon_0*R**3;\n\n#Result\nprint(\"electronic polarizability in Fm^2 is\",alpha_e);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('electronic polarizability in Fm^2 is', 4.3885458748002144e-40)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.5, Page number 336"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the area of metal sheet\n\n#importing modules\nimport math\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nC=0.02; #capacitance in micro farad\nepsilon_r=6; #dielectric constant\nt=0.002; #thickness of mica in cm\nd=0.002; #thickness of metal sheet in cm\n\n#Calculation\nC=C*10**-6; #converting micro farad to farad\nd=d*10**-2; #converting cm to m\nA=(C*d)/(epsilon_0*epsilon_r);\nA=A*10**3;\nA=math.ceil(A*10**4)/10**4; #rounding off to 4 decimals\nA1=A*10; #converting m**2 to cm**2\nA1=math.ceil(A1*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"area of metal sheet in m^2 is\",A,\"*10**-3\");\nprint(\"area of metal sheet in cm^2 is\",A1);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('area of metal sheet in m^2 is', 7.5296, '*10**-3')\n('area of metal sheet in cm^2 is', 75.296)\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.6, Page number 336"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the relative permitivity of the crystal\n\n#importing modules\nimport math\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nE=1000; #electric field in V/m\nP=4.3*10**-8; #polarization in C/m^2\n\n#Calculation\nepsilon_r=(P/(E*epsilon_0)+1);\nepsilon_r=math.ceil(epsilon_r*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"dielectric constant is\",epsilon_r);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('dielectric constant is', 5.8566)\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 11.7, Page number 337"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the polarisability of the material\n\n#Variable declaration\nepsilon_0=8.854*10**-12;\nchi=4.94; #relative susceptibility\nN=10**28; #number of dipoles per m^3\n\n#Calculation\n#polarisation P=N*alpha*E and P=epsilon_0*chi*E. equate the two equations\n#epsilon_0*chi*E=N*alpha*E\nalpha=(epsilon_0*chi)/N;\n\n#Result\nprint(\"polarisability of material in F/m^2 is\",alpha);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('polarisability of material in F/m^2 is', 4.373876e-39)\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_12.ipynb b/Engineering_Physics/Chapter_12.ipynb
new file mode 100644
index 00000000..5d0b74d0
--- /dev/null
+++ b/Engineering_Physics/Chapter_12.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter 12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Superconducting Materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.1, Page number 356"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical field\n\n#importing modules\nimport math\n\n#Variable declaration\nTc=3.7; #critical temperature in K\nH0=0.0306; #magnetic field in T\nT=2; #temperature in K\n\n#Calculation\nHc=H0*(1-(T**2/Tc**2));\nHc=math.ceil(Hc*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"critical field in T is\",Hc);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('critical field in T is', 0.02166)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.2, Page number 356"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical field\n\n#importing modules\nimport math\n\n#Variable declaration\nTc=7.26; #critical temperature in K\nH0=6.4*10**3; #magnetic field in T\nT=5; #temperature in K\n\n#Calculation\nHc=H0*(1-(T**2/Tc**2));\nHc=math.ceil(Hc*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"critical field in T is\",Hc);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('critical field in T is', 3364.385)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.3, Page number 357"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the value of Tc\n\n#importing modules\nimport math\n\n#Variable declaration\nTc1=4.185; #critical temperature in K\nM1=199.5; #atomic mass\nM2=203.4; #atomic mass after changing\n\n#Calculation\n#according to maxwell equation Tc*M^0.5=constant\n#Tc1*M1^0.5=Tc2*M2^0.5\nTc2=(Tc1*M1**0.5)/M2**0.5;\nTc2=math.ceil(Tc2*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"critical temperature of Hg in K is\",Tc2);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('critical temperature of Hg in K is', 4.144685)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.4, Page number 357"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical current density\n\n#importing modules\nimport math\n\n#Variable declaration\nd=1; #diameter of wire in mm\nT=4.2; #temperature in K\nTc=7.18; #critical temperature in K\nH0=6.5*10**4; #magnetic field\n\n#Calculation\nd=d*10**-3; #diameter in m\nR=d/2;\nHc=H0*(1-(T**2/Tc**2));\nHC=Hc/10**4;\nHC=math.ceil(HC*10**3)/10**3; #rounding off to 2 decimals\nIc=2*math.pi*R*Hc;\nIc=math.ceil(Ic*10**2)/10**2; #rounding off to 2 decimals\nA=math.pi*R**2;\nJ=Ic/A;\nJ=J/10**8;\nJ=math.ceil(J*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"critical magnetic field at 4.2K in A/m is\",HC,\"*10**4\");\nprint(\"critical current in A is\",Ic);\nprint(\"critical current density in A/m^2 is\",J,\"*10**8\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('critical magnetic field at 4.2K in A/m is', 4.276, '*10**4')\n('critical current in A is', 134.33)\n('critical current density in A/m^2 is', 1.71035, '*10**8')\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.5, Page number 358"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the frequency of radiation\n\n#importing modules\nimport math\n\n#Variable declaration\ne=1.6*10**-19;\nh=6.626*10**-34;\nV=6; #voltage applied in micro volts\n\n#Calculation\nV=V*10**-6; #converting micro volts to volts\nnew=(2*e*V)/h;\nnew=new/10**9;\nnew=math.ceil(new*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"frequency of ac signal in Hz is\",new,\"*10**9\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('frequency of ac signal in Hz is', 2.8977, '*10**9')\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 12.6, Page number 358"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the band gap\n\n#importing modules\nimport math\n\n#Variable declaration\nKb=1.38*10**-23;\nTc=7.19; #critical temperature in K\n\n#Calculation\nEg=3.5*Kb*Tc;\nEg=Eg/(1.6*10**-19); #converting J to eV\nEg=Eg*10**3; #converting eV into milli eV\nEg=math.ceil(Eg*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"band gap of superconducting lead in meV is\",Eg);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('band gap of superconducting lead in meV is', 2.171)\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_2.ipynb b/Engineering_Physics/Chapter_2.ipynb
new file mode 100644
index 00000000..f57dc5cb
--- /dev/null
+++ b/Engineering_Physics/Chapter_2.ipynb
@@ -0,0 +1,238 @@
+{
+ "metadata": {
+ "name": "Chapter 2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Laser"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.1, Page number 59 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of photons emitted by laser\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nlamda=632.8*10**-9; #wavelength in m\nP=5*10**-3; #output power in W\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\nN=P/E; #number of photons emitted\n\n\n#Result\nprint(\"energy of one photon in eV is\",E_eV);\nprint(\"number of photons emitted per second is\",N);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy of one photon in eV is', 1.964)\n('number of photons emitted per second is', 1.5917094275077976e+16)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.2, Page number 60"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the energy of emitted photons\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nlamda=632.8*10**-9; #wavelength in m\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\n\n#Result\nprint(\"energy of one photon in eV is\",E_eV);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy of one photon in eV is', 1.964)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.3, Page number 60"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the value of E3\n\n#importing modules\nimport math\n\n#Variable declaration\nE1=0; #value of 1st energy level in eV\nE2=1.4; #value of 2nd energy level in eV\nlamda=1.15*10**-6;\nh=6.626*10**-34;\nc=3*10**8;\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE3=E2+E_eV;\nE3=math.ceil(E3*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"value of E3 in eV is\",E3);\n\n#answer given in the book for E3 is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('value of E3 in eV is', 2.49)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.4, Page number 60"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the wavelength of laser beam\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nE2=3.2; #value of higher energy level in eV\nE1=1.6; #value of lower energy level in eV\n\n#Calculation\nE=E2-E1; #energy difference in eV\nE_J=E*1.6*10**-19; #converting E from eV to J\nlamda=(h*c)/E_J; #wavelength of photon\n\n#Result\nprint(\"energy difference in eV\",E);\nprint(\"wavelength of photon in m\",lamda);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy difference in eV', 1.6)\n('wavelength of photon in m', 7.76484375e-07)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.5, Page number 60"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the wavelength of laser beam\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nE=1.42*1.6*10**-19; #band gap of GaAs in J\n\n#Calculation\nlamda=(h*c)/E; #wavelength of laser\n\n#Result\nprint(\"wavelength of laser emitted by GaAs in m\",lamda);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('wavelength of laser emitted by GaAs in m', 8.74911971830986e-07)\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.6, Page number 61"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the relative population of energy levels\n\n#importing modules\nimport math\n\n#Variable declaration\nT=300; #temperature in K\nlamda=500*10**-9; #wavelength in m\nh=6.626*10**-34;\nc=3*10**8;\nk=1.38*10**-23;\n\n#Calculation\n#from maxwell and boltzmann law, relative population is given by\n#N1/N2=exp(-E1/kT)/exp(-E2/kT)\n#hence N1/N2=exp(-(E1-E2)/kT)=exp((h*new)/(k*T));\n#new=c/lambda\nR=(h*c)/(lamda*k*T);\nRP=math.exp(R);\n\n#Result\nprint(\"relative population between N1 and N2 is\",RP);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('relative population between N1 and N2 is', 5.068255595981255e+41)\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.7, Page number 61"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To examine the possibility of stimulated emission\n\n#importing modules\nimport math\n\n#Variable declaration\nT=300; #temperature in K\nh=6.626*10**-34;\nc=3*10**8;\nk=1.38*10**-23;\nlamda=600*10**-9; #wavelength in m\n\n#Calculation\nR=(h*c)/(lamda*k*T);\nRs=1/(math.exp(R)-1);\n\n#Result\nprint(\"the ratio between stimulated emission to spontaneous emission is\",Rs);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the ratio between stimulated emission to spontaneous emission is', 1.7617782449453023e-35)\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.8, Page number 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the efficiency of a He-Ne laser\n\n#importing modules\nimport math\n\n#Variable declaration\nP=5*10**-3; #output power in W\nI=10*10**-3; #current in A\nV=3*10**3; #voltage in V\n\n#Calculation\ne=(P*100)/(I*V);\ne=math.ceil(e*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"efficiency of laser in % is\",e);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('efficiency of laser in % is', 0.016667)\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.9, Page number 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the intensity of laser beam\n\n#importing modules\nimport math\n\n#Variable declaration\nP=1e-03; #output power in W\nd=1e-06; #diameter in m\n\n#Calculation\nr=d/2; #radius in m\nI=P/(math.pi*r**2); #intensity\nI=I/10**9;\nI=math.ceil(I*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"intensity of laser in W/m^2 is\",I,\"*10**9\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('intensity of laser in W/m^2 is', 1.2733, '*10**9')\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.10, Page number 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angular speed and divergence of laser beam\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda=632.8*10**-9; #wavelength in m\nD=5; #distance in m\nd=1*10**-3; #diameter in m\n\n#Calculation\ndeltatheta=lamda/d; #angular speed\ndelta_theta=deltatheta*10**4;\nr=D*deltatheta;\nr1=r*10**3; #converting r from m to mm\nA=math.pi*r**2; #area of the spread\n\n#Result \nprint(\"angular speed in radian is\",delta_theta,\"*10**-4\");\nprint(\"radius of the spread in mm is\",r1);\nprint(\"area of the spread in m^2 is\",A);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('angular speed in radian is', 6.328, '*10**-4')\n('radius of the spread in mm is', 3.164)\n('area of the spread in m^2 is', 3.1450157329451454e-05)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_3.ipynb b/Engineering_Physics/Chapter_3.ipynb
new file mode 100644
index 00000000..59daaddd
--- /dev/null
+++ b/Engineering_Physics/Chapter_3.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": "Chapter 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Fibre Optics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.1, Page number 98 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the numerical aperture of an optical fibre\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1.6; #refractive index of core\nn2=1.5; #refractive index of cladding\n\n#Calculation\nNA=math.sqrt((n1**2)-(n2**2));\nNA=math.ceil(NA*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"the numerical aperture of the fibre is\",NA);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the numerical aperture of the fibre is', 0.5568)\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.2, Page number 98 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the numerical aperture and acceptance angle of a fibre\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1.54; #refractive index of core\nn2=1.5; #refractive index of cladding\nn0=1;\n\n#Calculation\nNA=math.sqrt((n1**2)-(n2**2)); #numerical aperture of fibre\nNA=math.ceil(NA*10**5)/10**5; #rounding off to 5 decimals\nalpha=math.asin(NA/n0); #acceptance angle in radians\nalpha=alpha*57.2957795; #converting radians to degrees\nalpha=math.ceil(alpha*10**5)/10**5; #rounding off to 5 decimals\ndeg=int(alpha); #converting to degrees\nt=60*(alpha-deg); \nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"the numerical aperture of the fibre is\",NA);\nprint(\"the acceptance angle of the fibre in degrees is\",alpha);\nprint(\"acceptance angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n\n#answer for the angle given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the numerical aperture of the fibre is', 0.34872)\n('the acceptance angle of the fibre in degrees is', 20.40905)\n('acceptance angle of the fibre is', 20, 'degrees', 24, 'minutes', 32.581, 'seconds')\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.3, Page number 99"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical angle\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1.6; #refractive index of core\nn2=1.49; #refractive index of cladding\n\n#Calculation\nthetac=math.asin(n2/n1); #critical angle in radians\nthetac=thetac*57.2957795; #converting radians to degrees\ntheta_c=math.ceil(thetac*10**3)/10**3; #rounding off to 3 decimals\ndeg=int(thetac); #converting to degrees\nt=60*(thetac-deg); \nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical angle of the fibre in degrees is\",theta_c);\nprint(\"critical angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical angle of the fibre in degrees is', 68.631)\n('critical angle of the fibre is', 68, 'degrees', 37, 'minutes', 49.85, 'seconds')\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.4, Page number 99"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the acceptance angle of a fibre\n\n#importing modules\nimport math\n\n#Variable declaration\nNA=0.15; #numerical aperture\nn2=1.55; #refractive index of cladding\nn0=1.33; #refractive index of water\n\n#Calculation\nn1=math.sqrt((NA**2)+(n2**2)); #refractive index\nn_1=math.ceil(n1*10**5)/10**5; #rounding off to 5 decimals\nalpha=math.asin(math.sqrt(n1**2-n2**2)/n0); #acceptance angle in radians\nalpha=alpha*57.2957795; #converting radians to degrees\nalphaa=math.ceil(alpha*10**3)/10**3; #rounding off to 3 decimals\ndeg=int(alpha); #converting to degrees\nt=60*(alpha-deg); \nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"refractive index of the core is\",n_1);\nprint(\"the acceptance angle of the fibre in degrees is\",alphaa);\nprint(\"acceptance angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n\n#answer for acceptance angle given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('refractive index of the core is', 1.55725)\n('the acceptance angle of the fibre in degrees is', 6.476)\n('acceptance angle of the fibre is', 6, 'degrees', 28, 'minutes', 32.55, 'seconds')\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.5, Page number 100"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the refractive index of cladding\n\n#importing modules\nimport math\n\n#Variable declaration\nNA=0.26; #numerical aperture\nn1=1.5; #refractive index of core\nd=100; #core diameter in micro meter\n\n#Calculation\nd=100*(10**-6); #core diameter in metre\nn2=math.sqrt((n1**2)-(NA**2));\nn2=math.ceil(n2*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"refractive index of the cladding is\",n2);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('refractive index of the cladding is', 1.4773)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 3.6, Page number 100"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the refractive indices of core and cladding\n\n#importing modules\nimport math\n\n#Variable declaration\nNA=0.26; #numerical aperture\ndelta=0.015; #refractive index difference\n\n#Calculation\n#NA=math.sqrt(n1**2-n2**2)\n#let A=n1**2-n2**2\n#therefore A=NA**2\nA=NA**2;\n#delta=(n1**2-n2**2)/2*(n1**2)\n#let 2*(n1**2) be B\n#therefore B=A/delta\nB=A/delta;\nn1=math.sqrt(B/2);\nn1=math.ceil(n1*100)/100; #rounding off to 2 decimals\nn2=math.sqrt(n1**2-NA**2);\nn2=math.ceil(n2*10**3)/10**3; #rounding off to 4 decimals\n\n#Result\nprint(\"refractive index of the core is\",n1);\nprint(\"refractive index of the cladding is\",n2);\n\n#answer for refractive index of cladding given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('refractive index of the core is', 1.51)\n('refractive index of the cladding is', 1.488)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_4.ipynb b/Engineering_Physics/Chapter_4.ipynb
new file mode 100644
index 00000000..02198aef
--- /dev/null
+++ b/Engineering_Physics/Chapter_4.ipynb
@@ -0,0 +1,343 @@
+{
+ "metadata": {
+ "name": "Chapter 4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Quantum Physics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.1, Page number 133 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the change in wavelength\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.63*10**-34; #plancks constant in Js\nm0=9.1*10**-31; #mass of the electron in kg\nc=3*10**8; #velocity of light in m/s\nphi=135; #angle of scattering in degrees\nphi=phi*0.0174532925 #converting degrees to radians \n\n#Calculation\ndelta_lamda=(h*(1-math.cos(phi)))/(m0*c);\n\n#Result\nprint(\"change in wavelength in metres is\",delta_lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('change in wavelength in metres is', 4.1458307496867315e-12)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.2, Page number 134 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the compton shift, wavelength,energy and angle\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.63*10**-34; #plancks constant in Js\nm0=9.1*10**-31; #mass of the electron in kg\nc=3*10**8; #velocity of light in m/s\nlamda=2; #wavelength in angstrom\nlamdaA=lamda*10**-10; #converting lamda from Angstrom to m\nphi=90; #angle of scattering in degrees\nphi=phi*0.0174532925 #converting degrees to radians \n\n#Calculation\ndelta_lamda=(h*(1-math.cos(phi)))/(m0*c);\ndelta_lamda=delta_lamda*10**10; #converting delta_lamda from m to Angstrom\ndelta_lamda=math.ceil(delta_lamda*10**5)/10**5; #rounding off to 5 decimals\nlamda_dash=delta_lamda+lamda;\nlamdaA_dash=lamda_dash*10**-10; #converting lamda_dash from Angstrom to m\n#energy E=h*new-h*new_dash\nE=h*c*((1/lamdaA)-(1/lamdaA_dash));\nEeV=E/(1.602176565*10**-19); #converting J to eV\nEeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\nnew=c/lamda;\nnew_dash=c/lamda_dash;\ntheta=math.atan((h*new*math.sin(phi))/((h*new)-(h*new_dash*math.cos(phi))));\ntheta=theta*57.2957795; #converting radians to degrees\n\n#Result\nprint(\"change in compton shift in Angstrom is\",delta_lamda);\nprint(\"wavelength of scattered photons in Angstrom is\",lamda_dash);\nprint(\"energy of recoiling electron in J is\",E);\nprint(\"energy of recoiling electron in eV is\",EeV);\nprint(\"angle at which recoiling electron appears in degrees is\",int(theta));\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('change in compton shift in Angstrom is', 0.02429)\n('wavelength of scattered photons in Angstrom is', 2.02429)\n('energy of recoiling electron in J is', 1.1933272900621974e-17)\n('energy of recoiling electron in eV is', 74.482)\n('angle at which recoiling electron appears in degrees is', 45)\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.3, Page number 135"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the compton shift, wavelength of the scattered photon\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34; #plancks constant in Js\nm0=9.1*10**-31; #mass of the electron in kg\nc=3*10**8; #velocity of light in m/s\nphi=60; #angle of scattering in degrees\nphi=phi*0.0174532925; #converting degrees to radians\nE=10**6; #energy of photon in eV\nE=E*1.6*10**-19; #converting eV into J\n\n#Calculation\ndelta_lamda=(h*(1-math.cos(phi)))/(m0*c);\ndelta_lamda=delta_lamda*10**10; #converting metre to angstrom\ndelta_lamda=math.ceil(delta_lamda*10**4)/10**4; #rounding off to 4 decimals\nlamda=(h*c)/E;\nlamdaA=lamda*10**10; #converting metre to angstrom\nlamda_dash=delta_lamda+lamdaA;\nlamda_dash=math.ceil(lamda_dash*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"compton shift in angstrom is\",delta_lamda);\nprint(\"energy of incident photon in m\",lamda);\nprint(\"wavelength of scattered photons in angstrom is\",lamda_dash);\n\n#answer for wavelength of scattered photon given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('compton shift in angstrom is', 0.0122)\n('energy of incident photon in m', 1.242375e-12)\n('wavelength of scattered photons in angstrom is', 0.025)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.4, Page number 135"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of photons emitted\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34; #plancks constant in Js\nc=3*10**8; #velocity of light in m/s\nlamda=5893; #wavelength in angstrom\nP=60; #output power in Watt\n\n#Calculation\nlamda=lamda*10**-10; #wavelength in metre\nE=(h*c)/lamda;\nEeV=E/(1.602176565*10**-19); #converting J to eV\nEeV=math.ceil(EeV*10**4)/10**4; #rounding off to 4 decimals\nN=P/E;\n\n#Result\nprint(\"energy of photon in J is\",E);\nprint(\"energy of photon in eV is\",EeV);\nprint(\"number of photons emitted per se cond is\",N);\n\n#answer for energy in eV given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy of photon in J is', 3.373154590191753e-19)\n('energy of photon in eV is', 2.1054)\n('number of photons emitted per se cond is', 1.7787503773015396e+20)\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.5, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the momentum, energy and mass of a photon\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34; #plancks constant in Js\nc=3*10**8; #velocity of light in m/s\nlamda=10; #wavelength in angstrom\n\n#Calculation\nlamda=lamda*10**-10; #wavelength in metre\nE=(h*c)/lamda;\nEeV=E/(1.602176565*10**-19); #converting J to eV\nEeV=EeV*10**-3; #converting eV to keV\nEeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\nP=h/lamda;\nM=h/(lamda*c);\n\n#Result\nprint(\"energy of photon in J is\",E);\nprint(\"energy of photon in keV is\",EeV);\nprint(\"momentum in kg m/sec is\",P);\nprint(\"mass of photon in kg is\",M);\n\n#answer for energy of photon in keV given in the book is wrong by 1 decimal",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy of photon in J is', 1.9878e-16)\n('energy of photon in keV is', 1.241)\n('momentum in kg m/sec is', 6.626e-25)\n('mass of photon in kg is', 2.2086666666666664e-33)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.6, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the wavelength\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34; #plancks constant in Js\nm=9.1*10**-31; #mass of the electron in kg\ne=1.602*10**-19;\nV=1.25; #potential difference in kV\n\n#Calculation\nV=V*10**3; #converting kV to V\nlamda=h/math.sqrt(2*m*e*V);\nlamda=lamda*10**10; #converting metre to angstrom\nlamda=math.ceil(lamda*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"de Broglie wavelength in angstrom is\",lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('de Broglie wavelength in angstrom is', 0.3471)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.7, Page number 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the de Broglie wavelength\n\n#importing modules\nimport math\n\n#Variable declaration\nE=45; #energy of electron in eV\nE=E*1.6*10**-19; #energy in J\nh=6.626*10**-34; #plancks constant in Js\nm=9.1*10**-31; #mass of the electron in kg\n\n#Calculation\nlamda=h/math.sqrt(2*m*E);\nlamda=lamda*10**10; #converting metres to angstrom\nlamda=math.ceil(lamda*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"de Broglie wavelength in angstrom is\",lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('de Broglie wavelength in angstrom is', 1.8305)\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.8, Page number 137"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the de Broglie wavelength\n\n#importing modules\nimport math\n\n#Variable declaration\nv=10**7; #velocity of electron in m/sec\nh=6.626*10**-34; #plancks constant in Js\nm=9.1*10**-31; #mass of the electron in kg\n\n#Calculation\nlamda=h/(m*v);\nlamda=lamda*10**10; #converting metres to angstrom\nlamda=math.ceil(lamda*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"de Broglie wavelength in angstrom is\",lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('de Broglie wavelength in angstrom is', 0.7282)\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.9, Page number 137"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the de Broglie wavelength of alpha particle\n\n#importing modules\nimport math\n\n#Variable declaration\nV=1000; #potential difference in V\nh=6.626*10**-34; #plancks constant in Js\nm=1.67*10**-27; #mass of proton in kg\ne=1.6*10**-19; #charge of electron in J\n\n#Calculation\nlamda=h/math.sqrt(2*m*e*V);\n\n#Result\nprint(\"de Broglie wavelength of alpha particle in metre is\",lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('de Broglie wavelength of alpha particle in metre is', 9.063964727801313e-13)\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.10, Page number 138"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the probability of finding the particle\n\n#importing modules\nimport math\n\n#Variable declaration\nL=25; #width of potential in armstrong\ndelta_x=0.05; #interval in armstrong\nn=1; #particle is in its least energy\nx=L/2; #particle is at the centre\npi=180; #angle in degrees\n\n#Calculation\npi=pi*0.0174532925; #angle in radians\nL=L*10**-10; #width in m\ndelta_x=delta_x*10**-10; #interval in m\n#probability P = integration of (A**2)*(math.sin(n*pi*x/L))**2*delta_x\n#but A=math.sqrt(2/L)\n#since the particle is in a small interval integration need not be applied\n#therefore P=2*(L**(-1))*(math.sin(n*pi*x/L))**2*delta_x\nP=2*(L**(-1))*((math.sin(n*pi*x/L))**2)*delta_x;\nP=math.ceil(P*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"probability of finding the particle is\",P);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('probability of finding the particle is', 0.004)\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.11, Page number 138"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lowest energy of electron in eV\n\n#importing modules\nimport math\n\n#Variable declaration\nn=1;\nh=6.626*10**-34; #plancks constant in Js\nm=9.1*10**-31; #mass of the electron in kg\nL=1; #width of potential well in angstrom\n\n#Calculation\nL=L*10**-10; #converting angstrom into metre\nE=((n**2)*h**2)/(8*m*L**2);\nEeV=E/(1.6*10**-19); #converting J to eV\nEeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"lowest energy of electron in J is\",E);\nprint(\"lowest energy of electron in eV is\",EeV);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lowest energy of electron in J is', 6.030752197802197e-18)\n('lowest energy of electron in eV is', 37.693)\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.12, Page number 139"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lowest energy of the system\n\n#importing modules\nimport math\n\n#Variable declaration\nn=1;\nh=6.626*10**-34; #plancks constant in Js\nm=9.1*10**-31; #mass of the electron in kg\nL=1; #width of potential well in angstrom\n\n#Calculation\nL=L*10**-10; #converting angstrom into metre\nE=(2*(n**2)*h**2)/(8*m*L**2);\nE=E/(1.6*10**-19); #converting J to eV\nE=math.ceil(E*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"lowest energy of system in eV is\",E);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lowest energy of system in eV is', 75.385)\n"
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.13, Page number 139"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lowest energy of the system and quantum numbers\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34; #plancks constant in Js\nm=9.1*10**-31; #mass of the electron in kg\nL=1; #width of potential well in angstrom\n\n#Calculation\nL=L*10**-10; #converting angstrom into metre\n#according to pauli's exclusion principle, 1st electron occupies n1=1 and second electron occupies n2=2\nn1=1;\nn2=2;\nE=((2*(n1**2)*h**2)/(8*m*L**2))+(((n2**2)*h**2)/(8*m*L**2));\nE=E/(1.6*10**-19); #converting J to eV\nE=math.ceil(E*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"lowest energy of system in eV is\",E);\nprint(\"quantum numbers are\");\nprint(\"n=1,l=0,mL=0,mS=+1/2\");\nprint(\"n=1,l=0,mL=0,mS=-1/2\");\nprint(\"n=2,l=0,mL=0,mS=+1/2\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lowest energy of system in eV is', 226.154)\nquantum numbers are\nn=1,l=0,mL=0,mS=+1/2\nn=1,l=0,mL=0,mS=-1/2\nn=2,l=0,mL=0,mS=+1/2\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.14, Page number 140"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the mass of the particle\n\n#Variable declaration\nn=1;\nh=6.626*10**-34; #plancks constant in Js\nL=100; #width of potential well in angstrom\n\n#Calculation\nL=L*10**-10; #converting angstrom into metre\nE=0.025; #lowest energy in eV\nE=E*(1.6*10**-19); #converting eV to J\nm=((n**2)*h**2)/(8*E*L**2);\n\n#Result\nprint(\"mass of the particle in kg is\",m);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('mass of the particle in kg is', 1.3719961249999998e-31)\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.15, Page number 141"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the energy density\n\n#importing modules\nimport math\n\n#Variable declaration\nk=1.38*10**-23;\nT=6000; #temperature in K\nh=6.626*10**-34; #plancks constant in Js\nc=3*10**8; #velocity of light in m/s\nlamda1=450; #wavelength in nm\nlamda2=460; #wavelength in nm\n\n#Calculation\nlamda1=lamda1*10**-9; #converting nm to metre\nlamda2=lamda2*10**-9; #converting nm to metre\nnew1=c/lamda1;\nnew2=c/lamda2;\nnew=(new1+new2)/2;\nA=math.exp((h*new)/(k*T));\nrho_v=(8*math.pi*h*new**3)/(A*c**3);\n\n#Result\nprint(\"energy density of the black body in J/m^3 is\",rho_v);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy density of the black body in J/m^3 is', 9.033622836188887e-16)\n"
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_6.ipynb b/Engineering_Physics/Chapter_6.ipynb
new file mode 100644
index 00000000..1445b978
--- /dev/null
+++ b/Engineering_Physics/Chapter_6.ipynb
@@ -0,0 +1,400 @@
+{
+ "metadata": {
+ "name": "Chapter 6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Crystallography"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.1, Page number 185"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the density of diamond\n\n#importing modules\nimport math\n\n#Variable declaration\nr=0.071; #radius in nm\nN=6.022*10**26; \n\n#Calculation\nr=r*10**-9; #converting r from nm to m\n#mass of carbon atom m = 12/N\nm=12/N;\n#mass of diamond M = 8*mass of one carbon atom\nM=8*m;\n#volume of diamond V = (8*r/sqrt(3))^3\nV=(8*r/math.sqrt(3))**3;\nd=M/V; #density in kg/m^3\nd=math.ceil(d*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"density of diamond in kg/m^3 is\",d);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('density of diamond in kg/m^3 is', 4520.31)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.2, Page number 185"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the percentage volume change\n\n#importing modules\nimport math\n\n#Variable declaration\naBCC=0.332; #lattice constant in nm\naHCP=0.296; #lattice constant in nm\nc=0.468; #c in nm\n\n#Calculation\naBCC=aBCC*10**-9; #converting nm to m\nVbcc=aBCC**3;\naHCP=aHCP*10**-9; #converting nm to m\nc=c*10**-9; #converting nm to m\nVhcp=6*(math.sqrt(3)/4)*aHCP**2*c;\nV=Vhcp-Vbcc;\nVch=(V*100)/Vbcc;\nVch=math.ceil(Vch*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"percentage change in volume is\",Vch);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('percentage change in volume is', 191.12)\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.3, Page number 186"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the density\n\n#importing modules\nimport math\n\n#Variable declaration\nr=1.278; #atomic radius of Cu in Angstrom\nA=63.54; #atomic weight of Cu\nn=4; #for FCC n=4\nNa=6.022*10**26;\n\n#Calculation\nr=r*10**-10; #converting atomic radius from Angstrom to m\na=2*math.sqrt(2)*r; \nrho=(n*A)/(Na*a**3);\nrho=math.ceil(rho*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"density of Cu in kg/m^3 is\",rho);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('density of Cu in kg/m^3 is', 8935.92)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.4, Page number 186"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the distance between adjacent atoms\n\n#importing modules\nimport math\nimport numpy as np\n\n#Variable declaration\nrho=2180; #density of NaCl in kg/m^3\nwNa=23; #atomic weight of Na\nwCl=35.5; #atomic weight of Cl\nn=4; #for FCC n=4\nNa=6.022*10**26;\n\n#Calculation\nA=wNa+wCl; #molecular weight of NaCl\nx=np.reciprocal(3.);\na=((n*A)/(Na*rho))**x;\n\n#Result\nprint(\"interatomic distance in NaCl in m is\",a); \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('interatomic distance in NaCl in m is', 5.6278114346454509e-10)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.5, Page number 187"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the interplanar spacing\n\n#importing modules\nimport math\n\n#Variable declaration\na=0.42; #lattice constant in nm\nh1=1;\nk1=0;\nl1=1; #indices of the plane (101)\nh2=2;\nk2=2;\nl2=1; #indices of the plane (221)\n\n#Calculation\na=a*10**-9; #converting from nm to m\nd1=a/math.sqrt((h1**2)+(k1**2)+(l1**2)); #interplanar spacing for plane (101)\nd1=d1*10**9; #converting from m to nm\nd1=math.ceil(d1*10**5)/10**5; #rounding off to 5 decimals\nd2=a/math.sqrt((h2**2)+(k2**2)+(l2**2)); #interplanar spacing for plane (221)\nd2=d2*10**9; #converting from m to nm\n\n#Result\nprint(\"interplanar spacing for (101) in nm is\",d1);\nprint(\"interplanar spacing for (221) in nm is\",d2);\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('interplanar spacing for (101) in nm is', 0.29699)\n('interplanar spacing for (221) in nm is', 0.14)\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.6, Page number 187"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To identify the axial intercepts\n\n#Variable declaration\nh1=1;\nk1=0;\nl1=2; #indices for plane (102)\nh2=2;\nk2=3;\nl2=1; #indices for plane (231)\nh3=3;\nk3=-1;\nl3=2; #indices for plane (31'2)\n\n#Calculation\n#intercepts made by the plane is a/h, b/k, c/l\n#for plane (102) intercepts are a/1=a, b/0=infinite, c/2\n#for plane (231) intercepts are a/2, b/3, c/1=c\n#for plane (31'2) intercepts are a/3=a, b/-1=-b, c/2\n\n#Result\nprint(\"for plane (102) intercepts are a/1=a, b/0=infinite, c/2\");\nprint(\"for plane (231) intercepts are a/2, b/3, c/1=c\");\nprint(\"for plane (312) intercepts are a/3=a, b/-1=-b, c/2\");\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "for plane (102) intercepts are a/1=a, b/0=infinite, c/2\nfor plane (231) intercepts are a/2, b/3, c/1=c\nfor plane (312) intercepts are a/3=a, b/-1=-b, c/2\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.7, Page number 188"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angle between 2 planes\n\n#importing modules\nimport math\n\n#Variable declaration\nu1=1;\nv1=1;\nw1=1; #indices for plane (111)\nu2=2;\nv2=1;\nw2=2; #indices for plane (212)\n\n#Calculation\nA=u1*u2+v1*v2+w1*w2; \nB1=math.sqrt((u1**2)+(v1**2)+(w1**2));\nB2=math.sqrt((u2**2)+(v2**2)+(w2**2));\nB=A/(B1*B2);\nB=math.ceil(B*10**4)/10**4; #rounding off to 4 decimals\ntheta=math.acos(B); #angle in radian\ntheta=theta*57.2957795; #converting radian to degrees\ntheeta=math.ceil(theta*10**3)/10**3; #rounding off to 3 decimals\ndeg=int(theta); #converting to degrees\nt=60*(theta-deg);\nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"angle between the planes in degrees is\",theeta);\nprint(\"angle between the planes is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('angle between the planes in degrees is', 15.783)\n('angle between the planes is', 15, 'degrees', 46, 'minutes', 57.85, 'seconds')\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.8, Page number 188"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#sketching the crystallographic planes",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.9, Page number 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the lattice constant\n\n#importing modules\nimport math\n\n#Variable declaration\nd=0.2338; #interplanar distance in nm\nh=-1;\nk=1;\nl=1; #indices of the plane (1'11)\n\n#Calculation\nd=d*10**-9; #converting from nm to m\na=d*math.sqrt((h**2)+(k**2)+(l**2));\na=a*10**9; #converting lattice constant from m to nm\na=math.ceil(a*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"lattice constant in nm is\",a);\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lattice constant in nm is', 0.40496)\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.10, Page number 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To show that for a simple cubic system d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n\n#importing modules\nimport math\n\n#variable declaration\nh1=1;\nk1=0;\nl1=0; #indices for plane (100)\nh2=1;\nk2=1;\nl2=0; #indices for plane (110)\nh3=1;\nk3=1;\nl3=1; #indices for plane (111)\n\n#Calculation\n#d=a/math.sqrt((h**2)+(k**2)+(l**2))\n#d100=a/math.sqrt((h1**2)+(k1**2)+(l1**2))\nx1=math.sqrt((h1**2)+(k1**2)+(l1**2));\n#d100=a/x1 = a/1 = a\n#d110=a/math.sqrt((h2**2)+(k2**2)+(l2**2))\nx2=math.sqrt((h2**2)+(k2**2)+(l2**2));\nx2=math.ceil(x2*10**4)/10**4; #rounding off to 4 decimals\n#d110=a/x2 = a/sqrt(2)\n#d111=a/math.sqrt((h3**2)+(k3**2)+(l3**2))\nx3=math.sqrt((h3**2)+(k3**2)+(l3**2));\nx3=math.ceil(x3*10**4)/10**4; #rounding off to 4 decimals\n#d111=a/x3 = a/sqrt(3)\n#hence d100:d110:d111=a:a/sqrt(2):a/sqrt(3)\n#multiplying RHS by sqrt(6) we get d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n\n#Result\nprint(\"value of x1 is\",x1);\nprint(\"value of x2 is\",x2);\nprint(\"value of x3 is\",x3);\nprint(\"d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('value of x1 is', 1.0)\n('value of x2 is', 1.4143)\n('value of x3 is', 1.7321)\nd100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.11, Page number 190"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To find the ratio of intercepts in a simple cubic crystal\n\n#variable declaration\nh=2;\nk=3;\nl=1; #indices for plane (231)\n\n#Calculation\n#intercepts made by the plane is a/h, b/k, c/l\n#for a cubic unit cell, a=b=c\n#for plane (231) intercepts are a/2, a/3, a/1 = a\n#ratio of the intercepts is 1/2:1/3:1\n#LCM is 6. multiplying by LCM, we get ratio l1:l2:l3 = 3:2:6\n\n#Result\nprint(\"l1:l2:l3 = 3:2:6\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "l1:l2:l3 = 3:2:6\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.12, Page number 190"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To find the lengths of intercepts along Y and Z axes\n\n#variable declaration\nh=1;\nk=2;\nl=3; #indices for plane (123)\nl1=0.8; #l1 in armstrong\na=0.8; #a in armstrong\nb=1.2; #b in armstrong\nc=1.5; #c in armstrong\n\n#Calculation\n#intercepts made by the plane is a/h, b/k, c/l\n#for plane (123) intercepts are a/1 = a, b/2, c/3\n#ratio of the intercepts l1:l2:l3 = a:b/2:c/3\n#thus 0.8:l2:l3 = 0.8:1.2/2:1.5/3\nl2=1.2/2; #l2 in armstrong\nl3=1.5/3; #l3 in armstrong\n\n#Result\nprint(\"value of l2 in armstrong is\",l2);\nprint(\"value of l3 in armstrong is\",l3);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('value of l2 in armstrong is', 0.6)\n('value of l3 in armstrong is', 0.5)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.13, Page number 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the nearest neighbour distance\n\n#Calculation\n#in simple cubic unit cell, corner atom is the nearest neighbour to another corner atom. \n#Hence nearest neighbour distance is a.\n#in BCC the body centered atom is the nearest neighbour to a corner atom.\n#the distance between body centered atom and corner atom is 2r\n#but r=sqrt(3)*a/4\n#distance = 2*sqrt(3)*a/4 = sqrt(3)*a/2\n#in FCC the face centered atom is the nearest neighbour to a corner atom.\n#the distance between face centered atom and corner atom is 2r\n#but r = a/sqrt(8)\n#distance = 2*a/sqrt(8) = a/sqrt(2)\n\n#Result\nprint(\"in simple cubic unit cell nearest neighbour distance is a\");\nprint(\"in body centered cubic unit cell nearest neighbour distance is sqrt(3)*a/2\");\nprint(\"in face centered cubic unit cell nearest neighbour distance is a/sqrt(2)\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "in simple cubic unit cell nearest neighbour distance is a\nin body centered cubic unit cell nearest neighbour distance is sqrt(3)*a/2\nin face centered cubic unit cell nearest neighbour distance is a/sqrt(2)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.14, Page number 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the spacing of the lattice plane\n\n#importing modules\nimport math\n\n#variable declaration\na=2.04; #lattice parameter in armstrong\nh=2;\nk=1;\nl=2; #indices for plane (212)\n\n#Calculation\na=a*10**-10; #converting from armstrong to m\nd=a/math.sqrt((h**2)+(k**2)+(l**2));\nd=d*10**10; #converting from m to armstrong\nd=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"interplanar distance in armstrong is\",d);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('interplanar distance in armstrong is', 0.681)\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.15, Page number 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of atoms per unit cell\n\n#importing modules\nimport math\n\n#variable declaration\nr=1.278; #radius of Cu in armstrong\nM=63.54; #atomic weight of Cu\nrho=8980; #density in kg/m^3\nNa=6.022*10**26;\n\n#Calculation\nr=r*10**-10; #radius in m\na=math.sqrt(8)*r;\nn=(rho*Na*a**3)/M;\n\n#Result\nprint(\"interatomic distance in m is\",a);\nprint(\"number of atoms per Cu unit cell is\",int(n));",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('interatomic distance in m is', 3.6147298654256317e-10)\n('number of atoms per Cu unit cell is', 4)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.16, Page number 192"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Miller indices \n\n#variable declaration\na=0.429;\nb=1;\nc=0.379; #intercepts of an orthorhombic crystal\n\n#Calculation\n#ratio of intercepts are 0.214:1:0.188 = (a/0.429)*0.214:1:(c/0.379)*0.188 = a/2:b:c/2\n#thus the coefficients are 1/2:1:1/2. inverses are 2,1,2.\n#thus miller indices for the first plane are (212)\n#ratio of intercepts are 0.858:1:0.754 = (a/0.429)*0.0.858:1:(c/0.379)*0.754 = 2a:b:2c\n#thus the coefficients are 2:1:2. inverses are 1/2,1,1/2. LCM is 2. multiplying with LCM we get 1,2,1\n#thus miller indices for the second plane are (121)\n#ratio of intercepts are 0.429:infinite:0.126 = (a/0.429)*0.429:infinite:(c/0.379)*0.126 = a:infiniteb:c/3\n#thus the coefficients are 1:infinte:1/3. inverses are 1,0,3.\n#thus miller indices for the third plane are (103)\n\n#Result\nprint(\"miller indices for the first plane are (212)\");\nprint(\"miller indices for the second plane are (121)\");\nprint(\"miller indices for the third plane are (103)\");\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "miller indices for the first plane are (212)\nmiller indices for the second plane are (121)\nmiller indices for the third plane are (103)\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.17, Page number 193"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of atoms per unit area\n\n#importing modules\nimport math\nimport numpy as np\n\n#variable declaration\nh1=1;\nk1=0;\nl1=0; #indices of the first plane (100)\nh2=1;\nk2=1;\nl2=0; #indices of the second plane (110)\nh3=1;\nk3=1;\nl3=1; #indices of the third plane (111)\n\n#Calculation\nn_1=np.reciprocal(4.);\nn_2=np.reciprocal(2.);\nn_3=np.reciprocal(6.);\nn1=(n_1*4)+1; #number of atoms per unit cell in (100)\n#number of atoms per m^2 is 2/a**2. but a=sqrt(8)*r.\n#hence number of atoms per m^2 is 1/(4*r**2)\nn2=(n_1*4)+(2*n_2); #number of atoms per unit cell in (110)\n#number of atoms per m^2 is 1/a*sqrt(2)*a. but a=sqrt(8)*r.\n#hence number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\nn3=(n_3*3)+(3*n_2); #number of atoms per unit cell in (111)\n#number of atoms per m^2 is 2/(sqrt(3)/4)*a**2. but a=4*r.\n#hence number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\n\n#Result\nprint(\"number of atoms per unit cell in (100)\",n1);\nprint(\"number of atoms per m^2 is 1/(4*r**2)\");\nprint(\"number of atoms per unit cell in (110)\",n2);\nprint(\"number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\");\nprint(\"number of atoms per unit cell in (111)\",n3);\nprint(\"number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\");\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('number of atoms per unit cell in (100)', 2.0)\nnumber of atoms per m^2 is 1/(4*r**2)\n('number of atoms per unit cell in (110)', 2.0)\nnumber of atoms per m^2 is 1/(8*sqrt(2)*r**2)\n('number of atoms per unit cell in (111)', 2.0)\nnumber of atoms per m^2 is 1/(2*sqrt(3)*r**2)\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.18, Page number 194"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the atomic packing fraction and ionic packing fraction of NaCl\n\n#importing modules\nimport math\n\n#variable declaration\nr=0.97; #radius of Na+ ion in armstrong\nR=1.81; #radius of Cl- ion in armstrong\n\n#Calculation\n#atomic packing factor=packing density PD\n#PD=Volume of atoms/Volume of unit cell\n#volume of unit cell=a**3\n#volume of atoms=number of atoms*volume of 1 atom = 4*(4/3)*math.pi*r**3\n#but r=a/sqrt(8). hence PD = 4*(4/3)*math.pi*(a/(2*sqrt(2)))**3*(1/a**3) = 0.74\n#atomic packing factor = 0.74\nr=r*10**-10; #radius of Na+ ion in m\nR=R*10**-10; #radius of Cl- ion in m\nVna = (4*4*math.pi*r**3)/3; #volume of Na atoms\nVcl = (4*4*math.pi*R**3)/3; #volume of Cl atoms \nV=(2*(r+R))**3; #volume of unit cell\nIPF=(Vna+Vcl)/V; #ionic packing factor\nIPF=math.ceil(IPF*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"atomic packing factor = 0.74\");\nprint(\"ionic packing factor of NaCl crystal is\",IPF);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "atomic packing factor = 0.74\n('ionic packing factor of NaCl crystal is', 0.6671)\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_7.ipynb b/Engineering_Physics/Chapter_7.ipynb
new file mode 100644
index 00000000..c59443c9
--- /dev/null
+++ b/Engineering_Physics/Chapter_7.ipynb
@@ -0,0 +1,91 @@
+{
+ "metadata": {
+ "name": "Chapter 7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Crystal Imperfections"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.1, Page number 207 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of vacancies and vacancy fraction\n\n#importing modules\nimport math\n\n#Variable declaration\nk=1.38*10**-23;\nEv=0.98; #energy in eV/atom\nT1=900; #temperature in C\nT2=1000;\nA=6.022*10**26; #avagadro's constant\nw=196.9; #atomic weight in g/mol\nd=18.63; #density in g/cm^3\n\n#Calculation\nEv=Ev*1.6*10**-19; #converting eV to J\nd=d*10**3; #converting g/cm^3 into kg/m^3\nN=(A*d)/w;\nn=N*math.exp(-Ev/(k*T1));\n#let valency fraction n/N be V\nV=math.exp(-Ev/(k*T2));\n\n#Result\nprint(\"concentration of atoms per m^3 is\",N);\nprint(\"number of vacancies per m^3 is\",n);\nprint(\"valency fraction is\",V);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration of atoms per m^3 is', 5.69780904012189e+28)\n('number of vacancies per m^3 is', 1.8742498047705634e+23)\n('valency fraction is', 1.1625392535344139e-05)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.2, Page number 208 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the energy for vacancy formation\n\n#importing modules\nimport math\n\n#Variable declaration\nk=1.38*10**-23;\nA=6.022*10**26; #avagadro's constant\nT=1073; #temperature in K\nn=3.6*10**23; #number of vacancies\nd=9.5; #density in g/cm^3\nw=107.9; #atomic weight in g/mol\n\n#Calculation\nd=d*10**3; #converting g/cm^3 into kg/m^3\nN=(A*d)/w; #concentration of atoms\nE=k*T*math.log((N/n), ); #energy in J\nEeV=E/(1.602176565*10**-19); #energy in eV\nEeV=math.ceil(EeV*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"concentration of atoms per m^3 is\",N);\nprint(\"energy for vacancy formation in J\",E);\nprint(\"energy for vacancy formation in eV\",EeV);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration of atoms per m^3 is', 5.3020389249304915e+28)\n('energy for vacancy formation in J', 1.762092900344914e-19)\n('energy for vacancy formation in eV', 1.1)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.3, Page number 209 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of Schotky defect\n\n#importing modules\nimport math\n\n#Variable declaration\nA=6.022*10**26; #avagadro's constant\nk=1.38*10**-23;\nw1=39.1; #atomic weight of K\nw2=35.45; #atomic weight of Cl\nEs=2.6; #energy formation in eV\nT=500; #temperature in C\nd=1.955; #density in g/cm^3\n\n#Calculation\nEs=Es*1.6*10**-19; #converting eV to J\nT=T+273; #temperature in K\nd=d*10**3; #converting g/cm^3 into kg/m^3\nN=(A*d)/(w1+w2);\nn=N*math.exp(-Es/(2*k*T));\n\n#Result\nprint(\"number of Schotky defect per m^3 is\",n);\n\n#answer given in the book is wrong by 3rd decimal point",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('number of Schotky defect per m^3 is', 5.373777171020081e+19)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_8.ipynb b/Engineering_Physics/Chapter_8.ipynb
new file mode 100644
index 00000000..40606862
--- /dev/null
+++ b/Engineering_Physics/Chapter_8.ipynb
@@ -0,0 +1,259 @@
+{
+ "metadata": {
+ "name": "Chapter 8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Conducting materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.1, Page number 231"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electrical resistivity\n\n#Variable declaration\nm=9.1*10**-31; #mass of the electron in kg\nn=2.533*10**28; #concentration of electrons per m^3\ne=1.6*10**-19;\ntow_r=3.1*10**-14; #relaxation time in sec\n\n#Calculation\nrho=m/(n*(e**2*tow_r));\n\n#Result\nprint(\"electrical resistivity in ohm metre is\",rho);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('electrical resistivity in ohm metre is', 4.526937967219795e-08)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.2, Page number 231"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the band gap of semiconductor\n\n#importing modules\nimport math\n\n#Variable declaration\ns=3.75*10**3; #slope\nk=1.38*10**-23;\n\n#Calculation\nEg=2*k*s;\nEg=Eg/(1.6*10**-19); #converting J to eV\nEg=math.ceil(Eg*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"band gap of semiconductor in eV is\",Eg);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('band gap of semiconductor in eV is', 0.647)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.3, Page number 231"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the probability of occupation of electrons\n\n#importing modules\nimport math\n\n#Variable declaration\nT=989; #temperature in C\nk=1.38*10**-23;\n#let E-EF be E\nE=0.5; #occupied level of electron in eV\n\n#Calculation\nT=T+273; #temperature in K\nE=E*1.6*10**-19; #converting eV to J\n#let fermi=dirac distribution function f(E) be f\nf=1/(1+math.exp(E/(k*T)));\nf=math.ceil(f*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"probability of occupation of electrons is\",f);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('probability of occupation of electrons is', 0.011)\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.4, Page number 232"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the drift velocity of free electrons\n\n#Variable declaration\nmew_e=0.0035; #mobility of electrons in m^2/Vs\nE=0.5; #electric field strength in V/m\n\n#Calculation\nvd=mew_e*E;\nvd=vd*10**3;\n\n#Result\nprint(\"drift velocity of free electrons in m/sec is\",vd,\"*10**-3\");\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('drift velocity of free electrons in m/sec is', 1.75, '*10**-3')\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.5, Page number 232"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the mobility of electrons\n\n#importing modules\nimport math\n\n#Variable declaration\nA=6.022*10**23; #avagadro number\ne=1.6*10**-19;\nrho=1.73*10**-8; #resistivity of Cu in ohm metre\nw=63.5; #atomic weight \nd=8.92*10**3; #density in kg/m^3\n\n#Calculation\nd=d*10**3;\nsigma=1/rho;\nsigmaa=sigma/10**7;\nsigmaa=math.ceil(sigmaa*10**3)/10**3; #rounding off to 3 decimals\nn=(d*A)/w;\nmew=sigma/(n*e); #mobility of electrons\nmew=mew*10**3;\nmew=math.ceil(mew*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"electrical conductivity in ohm-1 m-1\",sigmaa,\"*10**7\");\nprint(\"concentration of carriers per m^3\",n);\nprint(\"mobility of electrons in m^2/Vsec is\",mew,\"*10**-3\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('electrical conductivity in ohm-1 m-1', 5.781, '*10**7')\n('concentration of carriers per m^3', 8.459250393700786e+28)\n('mobility of electrons in m^2/Vsec is', 4.2708, '*10**-3')\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.6, Page number 232"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the fermi energy\n\n#importing modules\nimport math\n\n#Variable declaration\nn=18.1*10**28; #concentration of electrons per m^3\nh=6.62*10**-34; #planck constant in Js\nme=9.1*10**-31; #mass of electron in kg\n\n#Calculation\nX=h**2/(8*me);\nE_F0=X*(((3*n)/math.pi)**(2/3));\nE_F0=E_F0/(1.6*10**-19); #converting J to eV\n\n#Result\nprint(\"Fermi energy in eV is\",E_F0);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('Fermi energy in eV is', 3.762396978021977e-19)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.7, Page number 233"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the concentration of free electrons\n\n#importing modules\nimport math\n\n#Variable declaration\nE_F0=5.5; #fermi energy in eV\nh=6.63*10**-34; #planck constant in Js\nme=9.1*10**-31; #mass of electron in kg\n\n#Calculation\nE_F0=E_F0*1.6*10**-19; #converting eV to J\nn=((2*me*E_F0)**(3/2))*((8*math.pi)/(3*h**3));\n\n#Result\nprint(\"concentration of free electrons per unit volume of silver per m^3 is\",n);\n\n#answer given in the book is wrong\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration of free electrons per unit volume of silver per m^3 is', 4.603965704817037e+52)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.8, Page number 233"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the probability of an electron\n\n#importing modules\nimport math\n\n#Variable declaration\nEg=1.07; #energy gap of silicon in eV\nk=1.38*10**-23;\nT=298; #temperature in K\n\n#Calculation\nEg=Eg*1.6*10**-19; #converting eV to J\n#let the probability of electron f(E) be X\n#X=1/(1+exp((E-Ef)/(k*T)))\n#but E=Ec and Ec-Ef=Eg/2\nX=1/(1+math.exp(Eg/(2*k*T)))\n\n#Result\nprint(\"probability of an electron thermally excited is\",X);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('probability of an electron thermally excited is', 9.122602463573379e-10)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.9, Page number 234"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the fermi energy and temperature\n\n#importing modules\nimport math\n\n#Variable declaration\nk=1.38*10**-23;\nm=9.1*10**-31; #mass of the electron in kg\nvf=0.86*10**6; #fermi velocity in m/sec\n\n#Calculation\nEfj=(m*vf**2)/2;\nEf=Efj/(1.6*10**-19); #converting J to eV\nEf=math.ceil(Ef*10**3)/10**3; #rounding off to 3 decimals\nTf=Efj/k;\nTf=Tf/10**4;\nTf=math.ceil(Tf*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"fermi energy of metal in J is\",Efj);\nprint(\"fermi energy of metal in eV is\",Ef);\nprint(\"fermi temperature in K is\",Tf,\"*10**4\");\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fermi energy of metal in J is', 3.3651800000000002e-19)\n('fermi energy of metal in eV is', 2.104)\n('fermi temperature in K is', 2.4386, '*10**4')\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.10, Page number 234"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Lorentz number\n\n#Variable declaration\nsigma=5.82*10**7; #electrical conductivity in ohm^-1m^-1\nK=387; #thermal conductivity of Cu in W/mK\nT=27; #temperature in C\n\n#Calculation\nT=T+273; #temperature in K\nL=K/(sigma*T);\n\n#Result\nprint(\"lorentz number in W ohm/K^2 is\",L);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lorentz number in W ohm/K^2 is', 2.2164948453608246e-08)\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.11, Page number 235"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the electrical conductivity, thermal conductivity and Lorentz number\n\n#importing modules\nimport math\n\n#Variable declaration\nm=9.1*10**-31; #mass of the electron in kg\ne=1.6*10**-19;\nk=1.38*10**-23;\nn=8.49*10**28; #concentration of electrons in Cu per m^3\ntow_r=2.44*10**-14; #relaxation time in sec\nT=20; #temperature in C\n\n#Calculation\nT=T+273; #temperature in K\nsigma=(n*(e**2)*tow_r)/m;\nsigmaa=sigma/10**7;\nsigmaa=math.ceil(sigmaa*10**4)/10**4; #rounding off to 4 decimals\nK=(n*(math.pi**2)*(k**2)*T*tow_r)/(3*m);\nK=math.ceil(K*100)/100; #rounding off to 2 decimals\nL=K/(sigma*T);\n\n#Result\nprint(\"electrical conductivity in ohm^-1 m^-1 is\",sigmaa,\"*10**7\");\nprint(\"thermal conductivity in W/mK is\",K);\nprint(\"Lorentz number in W ohm/K^2 is\",L);\n\n#answer for lorentz number given in the book is wrong\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('electrical conductivity in ohm^-1 m^-1 is', 5.8277, '*10**7')\n('thermal conductivity in W/mK is', 417.89)\n('Lorentz number in W ohm/K^2 is', 2.4473623172034308e-08)\n"
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/Chapter_9.ipynb b/Engineering_Physics/Chapter_9.ipynb
new file mode 100644
index 00000000..4524cd7c
--- /dev/null
+++ b/Engineering_Physics/Chapter_9.ipynb
@@ -0,0 +1,259 @@
+{
+ "metadata": {
+ "name": "Chapter 9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Semiconducting materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.1, Page number 266"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the number of charge carriers\n\n#Variable declaration\nmew_e=0.36; #mobility of electrons in m^2/Vs\nmew_h=0.14; #mobility of holes in m^2/Vs\nsigma=2.2; #conductivity in ohm-1 m-1\nT=300; #temperature in K\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\nni=sigma/(e*(mew_e+mew_h)); #carrier concentration per m^3\n\n#Result\nprint(\"carrier concentration of an intrinsic semiconductor per m^3 is\",ni);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('carrier concentration of an intrinsic semiconductor per m^3 is', 2.75e+19)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.2, Page number 266"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the band gap\n\n#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\nT1=20; #temperature in C\nT2=100; #temperature in C\nsigma_i20=250; #conductivity in ohm-1 m-1\nsigma_i100=1100; #conductivity in ohm-1 m-1\nk=1.38*10**-23;\n\n#Calculation\nT1K=T1+273; #temperature in K\nT2K=T2+273; #temperature in K\nT_1K=T1K**(-1);\nT_2K=T2K**(-1);\nT_1=T_2K-T_1K;\nT_2=T2K/T1K;\nTk=T_1**(-1);\nT_k=(T_2)**(3/2);\n#intrinsic carrier concentration at T1K is ni20 = 2*((2*math.pi*k*m*293)/h**2)**(3/2)*((me*mh)/m**2)**(3/4)*math.exp(-Eg/(2*k*293))\n#intrinsic carrier concentration at T2K is ni100 = 2*((2*math.pi*k*m*373)/h**2)**(3/2)*((me*mh)/m**2)**(3/4)*math.exp(-Eg/(2*k*373))\n#dividing ni20/ni100 = (293/373)**(3/2)*(math.exp(-Eg/(2*k*293))/math.exp(-Eg/(2*k*373)))\n#ni20/ni100 = (293/373)**(3/2)*math.exp((-Eg/(2*k))((1/293)-(1/373)))\n#sigma_i20/sigma_i100 = (ni20*e*(mew_e+mew_h))/(ni100*e*(mew_e+mew_h)) = ni20/ni100\n#therefore sigma_i20/sigma_i100 = ni20/ni100 = (293/373)**(3/2)*math.exp((-Eg/(2*k))((1/293)-(1/373)))\n#math.exp((-Eg/(2*k))*((1/293)-(1/373))) = (sigma_i20/sigma_i100)*(373/293)**(3/2)\n#by taking log on both sides we get (-Eg/(2*k))*((1/293)-(1/373)) = np.log((sigma_i20/sigma_i100)*(373/293)**(3/2))\n#Eg=2*k*(((1/373)-(1/293))**(-1))*np.log((sigma_i20/sigma_i100)*(373/293)**(3/2))\nEg=2*k*Tk*np.log((sigma_i20/sigma_i100)*T_k); #band gap in J\nEgeV=Eg*6.241*10**18; #converting J to eV\nEgeV=math.ceil(EgeV*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"band gap of the semiconductor in J is\",Eg);\nprint(\"band gap of the semiconductor in eV is\",EgeV);\n\n#answer for band gap in eV given in the book is wrong in the 4th decimal point",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('band gap of the semiconductor in J is', 4.2210259829756855e-20)\n('band gap of the semiconductor in eV is', 0.2635)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.3, Page number 267"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Hall voltage\n\n#Variable declaration\nI=10**-2; #current in Ampere\nl=100; #length in mm\nd=1; #thickness in mm\nw=10; #breadth in mm\nB=0.5; #magnetic field in Wb/m^2\nRH=3.66*10**-4; #hall coefficient in m^3/C\n\n#Calculation\nw=w*10**-3; #width in m\nVH=(B*I*RH)/w; #hall voltage\nVH=VH*10**4;\n\n#Result\nprint(\"Hall voltage in V is\",VH,\"*10**-4\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('Hall voltage in V is', 1.83, '*10**-4')\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.4, Page number 268"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the concentration of holes and electrons\n\n#importing modules\nimport math\n\n#Variable declaration\nsigma=300; #conductivity in S/cm\nT=300; #temperature in K\nni=1.5*10**10 #carrier concentration per cm^3\nmew_e=1300; #mobility of electrons in cm^2/Vs\nmew_h=500; #mobility of holes in cm^2/Vs\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\nsigma=sigma*10**2; #sigma in S/m\nmew_e=mew_e*10**-4; #mobility of electrons in m^2/Vs\nND=sigma/(e*mew_e); #concentration of electron per m^3\nni=ni*10**6; #carrier concentration per m^3\np=ni**2/ND; #hole concentration per m^3\np=p/10**8;\np=math.ceil(p*10**3)/10**3; #rounding off to 3 decimals\nmew_h=mew_h*10**-4; #mobility of holes in m^2/Vs\nNA=sigma/(e*mew_h); #concentration of hole per m^3\nn=ni**2/NA; #electron concentration per m^3\nn=n/10**7;\n\n#Result\nprint(\"concentration of electron for N-type semiconductor per m^3\",ND);\nprint(\"hole concentration per m^3\",p,\"*10**8\");\nprint(\"concentration of hole for P-type semiconductor per m^3\",NA);\nprint(\"electron concentration per m^3\",int(n),\"*10**7\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration of electron for N-type semiconductor per m^3', 1.4423076923076921e+24)\n('hole concentration per m^3', 1.561, '*10**8')\n('concentration of hole for P-type semiconductor per m^3', 3.7499999999999995e+24)\n('electron concentration per m^3', 6, '*10**7')\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.5, Page number 269"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To find the type of charge carriers and the carrier concentration\n\n#importing modules\nimport math\n\n#Variable declaration\nRH=-3.68*10**-5; #hall coefficient in m^3/C\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\n#hall coefficient is negative implies charge carriers are electrons\nn=(3*math.pi)/(8*(-RH)*e); #carrier concentration\n\n#Result\nprint(\"charge carriers are electrons\");\nprint(\"carrier concentration per m^3 is\",n);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "charge carriers are electrons\n('carrier concentration per m^3 is', 2.000844505937792e+23)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.6, Page number 269"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To compare the intrinsic carrier density\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nEg1=0.36; #energy gap of 1st material in eV\nEg2=0.72; #energy gap of 2nd material in eV\nT=300; #temperature in K\nmh=9*10**-31;\nme=9*10**-31; \n#given that 2*k*T=0.052; \n#consider X=2*k*T\nX=0.052;\n\n#Calculation\n#intrinsic carrier concentration for A niA = 2*((2*math.pi*k*T*m)/h**2)**(3/2)*((me*mh)/m**2)**(3/4)*math.exp(-0.36/(2*k*T))\n#intrinsic carrier concentration for B niB = 2*((2*math.pi*k*T*m)/h**2)**(3/2)*((me*mh)/m**2)**(3/4)*math.exp(-0.72/(2*k*T))\n#dividing niA/niB = math.exp(-0.36/(2*k*T))*math.exp(0.72/(2*k*T))\n#let niA/niB be A\nA = math.exp(-0.36/X)*math.exp(0.72/X);\nA=A/10**3;\nA=math.ceil(A*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"ratio of intrinsic carrier densities of A and B is\",A,\"*10**3\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('ratio of intrinsic carrier densities of A and B is', 1.01544, '*10**3')\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.7, Page number 270"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the mobility of electrons\n\n#importing modules\nimport math\n\n#Variable declaration\nND=2*10**22; #concentration of electron per m^3\nsigma=112; #conductivity in ohm-1 m-1\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\nmew=sigma/(ND*e); #mobility of electrons \nmew=math.ceil(mew*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"mobility of electrons in m^2/Vs is\",mew);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('mobility of electrons in m^2/Vs is', 0.035)\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.8, Page number 270"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the Hall voltage\n\n#importing modules\nimport math\n\n#Variable declaration\nw=500; #thickness in micrometre\nA=2.5*10**-3; #area of cross section in cm^-2\nIx=1; #current in ampere\nBz=10; #magnetic field in Wb/cm^2\nn=10**16; #donor concentration in m^-3\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\nBz=Bz*10**-4; #magnetic field in Wb/m^2\nw=w*10**-6; #thickness in m\nRH=(3*math.pi)/(8*n*e); #hall coefficient\nVH=(Bz*Ix*RH)/w; #hall voltage\nVH=VH/10**3;\nVH=math.ceil(VH*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"hall voltage in V is\",VH,\"*10**3\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('hall voltage in V is', 1.4727, '*10**3')\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.9, Page number 271"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To find the ratio between conductivity of intrinsic semiconductor\n\n#importing modules\nimport math\nfrom __future__ import division\nimport numpy as np\n\n#Variable declaration\nEg=1.2; #energy gap in eV\nT1=300; #temperature in K\nT2=600; #temperature in K\nk=1.38*10**-23;\n\n#Calculation\nT_1=T1**(-1);\nT_2=T2**(-1);\nT=T_1-T_2;\nEg=Eg*1.602*10**-19; #Eg in J\n#sigma_300=ni300*e*(mew_e+mew_h)\n#sigma_600=ni600*e*(mew_e+mew_h)\n#sigma_600/sigma_300 = ni600/ni300\n#ni600/ni300 =((T2/T1)**(3/2))*math.exp(-Eg/(2*k*T2))*math.exp(Eg/(2*k*T1));\n#ni600/ni300 =((T2/T1)**(3/2))*math.exp((Eg/(2*k))*T;\n#let ni600/ni300 be X\nX=((T2/T1)**(3/2))*math.exp((Eg/(2*k))*T);\n\n\n#Result\nprint(\"ratio between the conductivity of material is\",int(X));\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('ratio between the conductivity of material is', 311270)\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.10, Page number 272"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the intrinsic carrier concentration\n\n#importing modules\nimport math\n\n#Variable declaration\nsigma=10**-6; #electrical conductivity in ohm-1 m-1\nmew_e=0.85; #electron mobility in m^2/Vs\nmew_h=0.04; #hole mobility in m^2/Vs\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\nni=sigma/(e*(mew_e+mew_h)); #intrinsic carrier concentration\nni=ni/10**12;\nni=math.ceil(ni*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"intrinsic carrier concentration per m^3 is\",ni,\"*10**12\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('intrinsic carrier concentration per m^3 is', 7.0225, '*10**12')\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 9.11, Page number 272"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the density of impurity atoms and concentration of minority carriers\n\n#importing modules\nimport math\n\n#Variable declaration\nrho_p=10; #resistivity of p-type Si in ohm cm\nrho_n=10; #resistivity of n-type Si in ohm cm\nmew_e=1350; #electron mobility in cm^2/Vs\nmew_h=480; #hole mobility in cm^2/Vs\nni=1.5*10**10; #carrier concentration in cm^-3\ne=1.6*10**-19; #electron charge in C\n\n#Calculation\nrho_p=rho_p*10**-2;#resistivity of p-type Si in ohm m\nsigma_p=1/rho_p; #electrical conductivity\nmew_h=mew_h*10**-3;\nNA=sigma_p/(e*mew_h); #acceptor concentration\nni=ni*10**6; #carrier concentration in m^-3\nn=ni**2/NA; #concentration of minority carriers in m^-3\nn=n/10**12;\nn=math.ceil(n*10**4)/10**4; #rounding off to 4 decimals\nrho_n=rho_n*10**-2; #resistivity of n-type Si in ohm m\nsigma_n=1/rho_n; #electrical conductivity\nmew_e=mew_e*10**-3;\nND=sigma_n/(e*mew_e); #donor concentration\np=(ni**2)/ND; #concentration of minority carriers in m^-3\np=p/10**12;\np=math.ceil(p*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"donor concentration per m^3 is\",ND);\nprint(\"concentration of minority carriers per m^3\",p,\"*10**12\");\nprint(\"acceptor concentration per m^3 is\",NA);\nprint(\"concentration of minority carriers per m^3 is\",n,\"*10**12\");",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('donor concentration per m^3 is', 4.6296296296296284e+19)\n('concentration of minority carriers per m^3', 4.861, '*10**12')\n('acceptor concentration per m^3 is', 1.3020833333333331e+20)\n('concentration of minority carriers per m^3 is', 1.7281, '*10**12')\n"
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/README.txt b/Engineering_Physics/README.txt
new file mode 100644
index 00000000..a2116ca8
--- /dev/null
+++ b/Engineering_Physics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: ADITYA DHARMASAGAR KALIDAS
+Course: btech
+College/Institute/Organization: vaageswari college of engineering
+Department/Designation: ECE
+Book Title: Engineering Physics
+Author: Dr. K. Vijaya Kumar
+Publisher: S. Chand & Company Ltd., New Delhi
+Year of publication: 2011
+Isbn: 81-219-3852-X
+Edition: 1 \ No newline at end of file
diff --git a/Engineering_Physics/chapter1_2.ipynb b/Engineering_Physics/chapter1_2.ipynb
new file mode 100644
index 00000000..33cd96c8
--- /dev/null
+++ b/Engineering_Physics/chapter1_2.ipynb
@@ -0,0 +1,568 @@
+{
+ "metadata": {
+ "name": "chapter1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Quantum Mechanics and Quantum Computing"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.1, Page number 41"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#to calculate the de Broglie wavelength\n\n#Variable declaration\nc=3*10**8 #velocity of light in m/s\nh=6.626*10**-34 #planks constant \nm=1.67*10**-27 #mass of proton\n\n#Calculation\nv=c/10 #velocity of proton\nlamda=h/(m*v) #de Broglie wave length\n\n#Result\nprint(\"the de Broglie wavelength in m is \",lamda);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the de Broglie wavelength in m is ', 1.3225548902195607e-14)\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.2, Page number 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de Broglie wavelength of an electron\n\n#importing modules\nimport math\n\n#Variable declaration\nV=400; #potential in Volts\n\n#Calculation\nlamda=12.56/math.sqrt(V); #de Broglie wavelength\n\n#Result\nprint(\"The de Broglie wavelength in Armstrong is\",lamda);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in Armstrong is', 0.628)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.3, Page number 42\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de Broglie wavelength of neutron\n\n#importing modules\nimport math\n\n#Variable declaration\nm=1.674*10**(-27); #mass of neutron in kg\nh=6.626*10**(-34);\nE=0.025; #kinetic energy in eV\n\n#Calculation\nEj=E*1.6*10**-19; #kinetic energy in J\nlamda=h/math.sqrt(2*m*Ej); #de Broglie wavelength\nlamdaA=lamda*10**10; #converting wavelength from m to Armstrong\nlamdaA=math.ceil(lamdaA*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in Armstrong is\",lamdaA);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in metres is', 1.81062582829353e-10)\n('The de Broglie wavelength in Armstrong is', 1.811)\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.4, Page number 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de Broglie wavelength of an electron\n\n#importing modules\nimport math\n\n#Variable declaration\nV=1600; #potential in Volts\n\n#Calculation\nlamda=12.56/math.sqrt(V); #de Broglie wavelength\nlamda=math.ceil(lamda*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"The de Broglie wavelength in Armstrong is\",lamda);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in Armstrong is', 0.32)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.5, Page number 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the uncertainity in momentum\n\n#importing modules\nimport math\n\n#Variable declaration\ndeltax=0.2; #distance in armstrong\nh=6.626*10**(-34);\n\n#Calculation\ndelta_xm=deltax*10**-10; #distance in m\ndelta_p=h/(2*math.pi*delta_xm);\n\n#Result\nprint(\"The uncertainity in momentum of electron in kg m/sec is\",delta_p);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The uncertainity in momentum of electron in kg m/sec is', 5.2728032646344916e-24)\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.6, Page number 43"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the lowest energy of electron\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1;\nn2=1;\nn3=1; #values in lowest energy\nh=6.62*10**(-34);\nM=9.1*10**-31; #mass in kg\nL=0.1; #side in nm\n\n#Calculation\nL=L*10**-9; #side in m\nn=(n1**2)+(n2**2)+(n3**2);\nE1=(n*h**2)/(8*M*L**2); #energy in j\nE1eV=E1/(1.6*10**-19); #energy in eV\nE1eV=math.ceil(E1eV*10)/10; #rounding off to 1 decimals\n\n#Result\nprint(\"lowest energy of electron in Joule is\",E1);\nprint(\"lowest energy of electron is eV\",E1eV);\n\n#answer for lowest energy in eV given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lowest energy of electron in Joule is', 1.8059505494505486e-17)\n('lowest energy of electron is eV', 112.9)\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.7, Page number 43"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de Broglie wavelength of neutron\n\n#importing modules\nimport math\n\n#Variable declaration\nM=9.1*10**(-31); #mass of electron in kg\nh=6.66*10**(-34);\nE=2000; #kinetic energy in eV\n\n#Calculation\nEj=E*1.6*10**-19; #kinetic energy in J\nlamda=h/math.sqrt(2*M*Ej); #de Broglie wavelength\nlamdaA=lamda*10**9; #converting wavelength from m to nm\nlamdaA=math.ceil(lamdaA*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"The de Broglie wavelength in nm is\",lamdaA);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in nm is', 0.028)\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.8, Page number 43"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the minimum energy of electron\n\n#importing modules\nimport math\n\n#Variable declaration\nn=1; #for minimum energy\nh=6.626*10**(-34);\nm=9.1*10**-31; #mass in kg\nL=4*10**-10; #size in m\n\n#Calculation\nE1=(n*h**2)/(8*m*L**2); #energy in j\n\n#Result\nprint(\"lowest energy of electron in Joule is\",E1);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lowest energy of electron in Joule is', 3.7692201236263733e-19)\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.9, Page number 44"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the velocity and kinetic energy of electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh=6.626*10**(-34);\nm=9.1*10**-31; #mass in kg\nlamda=1.66*10**-10; #wavelength in m\n\n#Calculation\nv=h/(m*lamda); #velocity in m/sec\nv_km=v*10**-3; #velocity in km/sec\nE=(1/2)*m*v**2; #kinetic energy in joule\nEeV=E/(1.6*10**-19); #energy in eV\nEeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"velocity of electron in m/sec is\",round(v));\nprint(\"velocity of electron in km/sec is\",round(v_km));\nprint(\"kinetic energy of electron in Joule is\",E);\nprint(\"kinetic energy of electron in eV is\",EeV);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('velocity of electron in m/sec is', 4386337.0)\n('velocity of electron in km/sec is', 4386.0)\n('kinetic energy of electron in Joule is', 8.754176510091736e-18)\n('kinetic energy of electron in eV is', 54.714)\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.10, Page number 44"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the wavelength of an electron\n\n#importing modules\nimport math\n\n#Variable decleration\nV=15; #potential in kV\n\n#Calculation\nv=V*10**3; #potential in V\nlamda=12.26/math.sqrt(v); #de Broglie wavelength\nlamda=math.ceil(lamda*10**2)/10**2 #rounding off to 2 decimals\n\n#result\nprint(\"The de Broglie wavelength in Armstrong is\",lamda);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in Armstrong is', 0.11)\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.11, Page number 44\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de Broglie wavelength of neutron\n\n#importing modules\nimport math\n\n#Calculation\nm=1.675*10**-27; #mass of neutron in kg\nh=6.626*10**-34;\nE=10; #kinetic energy in keV\n\n#Calculation\nEeV=E*10**3; #Energy in eV\nEj=EeV*1.6*10**-19; #kinetic energy in J\nv=math.sqrt(2*Ej/m); #velocity in m/s\nlamda=h/(m*v); #de broglie wavelength in m\nlamda_A=lamda*10**10; #de broglie wavelength in armstrong\nlamda_A=math.ceil(lamda_A*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"The velocity in m/sec is\",round(v));\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in Armstrong is\",lamda_A);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The velocity in m/sec is', 1382189.0)\n('The de Broglie wavelength in metres is', 2.861996093951046e-13)\n('The de Broglie wavelength in Armstrong is', 0.0029)\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.12, Page number 45"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de Broglie wavelength of electron\n\n#importing modules\nimport math\n\n#Variable decleration\nm=9.1*10**-31; #mass of electron in kg\nh=6.6*10**-34;\nE=2; #kinetic energy in keV\n\n#Calculation\nEeV=E*10**3; #Energy in eV\nEj=EeV*1.6*10**-19; #kinetic energy in J\np=math.sqrt(2*m*Ej); #momentum\nlamda=h/p; #de broglie wavelength in m\nlamda_A=lamda*10**10; #de broglie wavelength in armstrong\nlamda_A=math.ceil(lamda_A*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in Armstrong is\",lamda_A);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in metres is', 2.7348483695436575e-11)\n('The de Broglie wavelength in Armstrong is', 0.2735)\n"
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.13, Page number 45"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the wavelength of thermal neutron\n\n#import module\nimport math\n\n#Variable decleration\nm=1.676*10**-27; #mass of neutron in kg\nh=6.62*10**-34;\nE=0.025; #kinetic energy in eV\n\n#Calculation\nEj=E*1.6*10**-19; #kinetic energy in J\nv=math.sqrt(2*Ej/m); #velocity in m/s\nlamda=h/(m*v); #wavelength in m\nlamda_A=lamda*10**10; #de broglie wavelength in armstrong\nlamda_A=math.ceil(lamda_A*10**5)/10**5 #rounding off to 5 decimals\n\n#Result\nprint(\"The neutrons wavelength in metres is\",lamda);\nprint(\"The wavelength in Armstrong is\",lamda_A);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The neutrons wavelength in metres is', 1.8079065940980725e-10)\n('The wavelength in Armstrong is', 1.80791)\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.14, Page number 45"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the wavelength of an electron\n\n#import module\nimport math\n\n#Variable decleration\nV=10; #potential in kV\n\n#Calculation\nV=V*10**3; #potential in V\nlamda=12.26/math.sqrt(V); #wavelength\n\n#Result\nprint(\"The wavelength in Armstrong is\",lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The wavelength in Armstrong is', 0.1226)\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.15, Page number 45"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the first three permitted levels of electron\n\n#import module\nimport math\n\n#Varialble decleration\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\nl=1; #width in armstrong\n\n#Calculation\nL=l*10**-10; #width in m\n#permitted electron energies En=(n**2*h**2)/(8*m*L**2)\n#let X = h**2/(8*m*L**2)\nX = h**2/(8*m*L**2); #energy in J\nXeV=X/(1.6*10**-19); #energy in eV\n#in the 1st level n1=1\nn1=1;\nE1=(n1**2)*XeV; #energy in eV\n\n#in second level n2=2\nn2=2;\nE2=(n2**2)*XeV; #energy in eV\n#in third level n3=\nn3=3;\nE3=(n3**2)*XeV; #energy in eV\n\n#Result\nprint(\"minimum energy the electron can have in eV is\",round(E1));\nprint(\"other values of energy are in eV and in eV\",round(E2),round(E3));\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('minimum energy the electron can have in eV is', 38.0)\n('other values of energy are in eV and in eV', 151.0, 339.0)\n"
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.16, Page number 46\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the probability of finding the particle\n\n#import module\nimport math\n\n#Variable decleration\nn=1; #lowest state\nL=10; #width in armstrong\n\n#Calculation\nL=L*10**-10; #width in m\nx=L/2;\ndelta_x=1; #interval in armstrong\ndelta_x=delta_x*10**-10; #interval in m\npsi1=(math.sqrt(2/L))*math.sin(math.pi*x/L);\nA=psi1**2;\np=A*delta_x;\np=math.ceil(p*10)/10; #de broglie wavelength in armstrong\n\n#Result\nprint(\"probability of finding the particle is \",p);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('probability of finding the particle is ', 0.2)\n"
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.17, Page number 46"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the Fermi energy of the metal\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=970; #density of Na in kg/m^3\nn=6.02*10**26;\nh=6.62*10**(-34);\nm=9.1*10**-31; #mass in kg\nw=23; #atomic weight\n\n#Calculation\nN=(d*n)/w; #number of atoms per m^3\nA=(h**2)/(8*m);\nB=(3*N)/math.pi;\nEf=A*B**(2/3);\nEfeV=Ef/(1.6*10**-19);\nEfeV=math.ceil(EfeV*10**2)/10**2 #rounding of to 2 decimals\n\n#Result\nprint(\"fermi energy of Na in eV is\",EfeV);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fermi energy of Na in eV is', 3.16)\n"
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.18, Page number 46"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the lowest energy of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn1=1;\nn2=1;\nn3=1; #values in lowest energy\nh=6.62*10**(-34);\nm=9.1*10**-31; #mass in kg\nL=0.1; #side in nm\n\n#Calculation\nL=L*10**-9; #side in m\nn=(n1**2)+(n2**2)+(n3**2);\nE1=(n*h**2)/(8*m*L**2); #energy in j\nE1eV=E1/(1.6*10**-19); #energy in eV\nE1eV=math.ceil(E1eV*10**1)/10**1 #rounding off to 2 decimals\n\n#Result\nprint(\"lowest energy of electron in Joule is\",E1);\nprint(\"lowest energy of electron in eV is\",E1eV);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('lowest energy of electron in Joule is', 1.8059505494505486e-17)\n('lowest energy of electron in eV is', 112.9)\n"
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.19, Page number 47"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de broglie wavelength of neutron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nmn=1.676*10**-27; #mass of neutron in kg\nme=9.1*10**-31; #mass of electron in kg\nh=6.62*10**-34;\nc=3*10**8; #velocity of light in m/sec\n\n#Calculation\nEn=2*me*c**2;\nlamda=h/math.sqrt(2*mn*En); #wavelength in m\nlamda_A=lamda*10**10; #converting lamda from m to A\nlamda_A=math.ceil(lamda_A*10**6)/10**6 #rounding off to 6 decimals\n\n#Result\nprint(\"The de broglie wavelength in Angstrom is\",lamda_A);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de broglie wavelength in Angstrom is', 0.000283)\n"
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.20, Page number 47 ***************************************************************************"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the energies of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn2=2; #second quantum state\nn4=4; #fourth quantum state\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\na=2; #potential box length in armstrong\n\n#Calculation\na=a*10**-10; #length in m\nA=n2**2*h**2;\nB=8*m*a**2;\nE2=A/B; #energy in j\nE2eV=E2/(1.6*10**-19); #energy in eV\nC=n4**2*h**2;\nE4=C/B; #energy in j\nE4eV=E4/(1.6*10**-19); #energy in eV\n\n#Result\nprint(\"energy corresponding to second quantum state in Joule is\",E2);\nprint(\"energy corresponding to second quantum state in eV is\",E2eV);\nprint(\"energy corresponding to fourth quantum state in Joule is\",E4);\nprint(\"energy corresponding to fourth quantum state in eV is\",E4eV);\n\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy corresponding to second quantum state in Joule is', 6.030752197802197e-18)\n('energy corresponding to second quantum state in eV is', 37.69220123626373)\n('energy corresponding to fourth quantum state in Joule is', 2.412300879120879e-17)\n('energy corresponding to fourth quantum state in eV is', 150.7688049450549)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.21, Page number 48 ***********"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the spacing of the crystal\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nV=344; #accelerated voltage in V\nn=1; #first reflection\ntheta=60; #glancing angle in degrees\n\n#Calculation\nlamda=12.27/math.sqrt(V);\nd=(n*lamda)/(2*math.sin(theta));\n\n#Result\nprint(\"The spacing of the crystal in Angstrom is\",lamda);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The spacing of the crystal in Angstrom is', 0.6615540636030947)\n"
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.22, Page number 49 *************"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the energies of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn2=2; #second quantum state\nn3=3; #fourth quantum state\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\na=1*10**-10; #width of potential well in m\n\n#Calculation\nB=8*m*a**2;\nE1=h**2/B; #ground state energy\nE1eV=E1/(1.6*10**-19); #energy in eV\nA=n2**2*h**2;\nE2=A/B; #energy in j\nE2eV=E2/(1.6*10**-19); #energy in eV\nC=n3**2*h**2;\nE3=C/B; #energy in j\nE3eV=E3/(1.6*10**-19); #energy in eV\nE1=math.ceil(E1*10**3)/10**3 #rounding off to 3 decimals\nE1eV=math.ceil(E1eV*10**3)/10**3 #rounding off to 3 decimals\nE2eV=math.ceil(E2eV*10**3)/10**3 #rounding off to 3 decimals\nE3eV=math.ceil(E3eV*10**3)/10**3 #rounding off to 3 decimals\n\n#Result\nprint(\"ground state energy in Joule is\",E1);\nprint(\"ground state energy in eV is\",E1eV);\nprint(\"first energy state in eV is\",E2eV);\nprint(\"second energy state in eV is\",E3eV);\n\n#answers given in the book are wrong by one decimal",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('ground state energy in Joule is', 0.001)\n('ground state energy in eV is', 37.693)\n('first energy state in eV is', 150.769)\n('second energy state in eV is', 339.23)\n"
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.23, Page number 49"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the energy required to jump an electron\n\n#import module\nimport math\n\n#Variable decleration\nn3=3; #fourth quantum state\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\n\n\n#ground state energy E1 = h**2/(8*m*a**2)\n#second excited state E3 = (9*h**2)/(8*m*a**2)\n#required energy E = E3-E1\n#E = (9*h**2)/(8*m*a**2) - h**2/(8*m*a**2)\n#E = (h**2/(8*m*a**2))*(9-1)\n#therefore E = (8*h**2)/(8*m*a**2)\n#hence E = (h**2)/(m*a**2)\n\n#Result \n# the required energy is E = (h**2)/(m*a**2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.24, Page number 50"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the minimum uncertainity in velocity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\ndelta_x=10**-8; #length of box in m\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\n\n#Calculation\ndelta_v=h/(m*delta_x); #uncertainity in m/sec\ndelta_vk=delta_v*10**-3; #uncertainity in km/sec\ndelta_vk=math.ceil(delta_vk*10**2)/10**2 #rounding off to 2 decimals\n\n#Result\nprint(\"minimum uncertainity in velocity in m/sec is\",round(delta_v));\nprint(\"minimum uncertainity in velocity in km/sec is\",delta_vk);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('minimum uncertainity in velocity in m/sec is', 72813.0)\n('minimum uncertainity in velocity in km/sec is', 72.82)\n"
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.25, Page number 50"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the de broglie wavelength of proton\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nmp=1.6*10**-27; #mass of proton in kg\nme=9.1*10**-31; #mass of electron in kg\nh=6.626*10**(-34);\nc=3*10**10; #velocity of light in m/sec\n\n#Calculation\nEp=me*c**2;\nlamda=h/math.sqrt(2*mp*Ep); #wavelength in m\nlamda_A=lamda*10**10; #converting lamda from m to A\n\n#Result\nprint(\"The de broglie wavelength in Angstrom is\",lamda_A);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de broglie wavelength in Angstrom is', 4.092931643497047e-06)\n"
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 1.26, Page number 51 *************************************************"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the glancing angle\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nm=1.675*10**(-27); #mass of neutron in kg\nh=6.626*10**(-34);\nn=1; #diffractive order\nd=0.314; #spacing in nm\nE=0.04; #kinetic energy in eV\n\n#Calculation\nd=d*10**-9; #spacing in m\nEj=E*1.6*10**-19; #kinetic energy in J\nlamda=h/math.sqrt(2*m*Ej); #de Broglie wavelength\nlamdaA=lamda*10**9; #converting wavelength from m to nm\ntheta=math.asin((n*lamda)/(2*d));\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in nm is\",lamdaA);\nprint(\"glancing angle in degrees is\",theta);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The de Broglie wavelength in metres is', 1.4309980469755228e-10)\n('The de Broglie wavelength in nm is', 0.1430998046975523)\n('glancing angle in degrees is', 0.2298853909391574)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/chapter2_2.ipynb b/Engineering_Physics/chapter2_2.ipynb
new file mode 100644
index 00000000..95f30057
--- /dev/null
+++ b/Engineering_Physics/chapter2_2.ipynb
@@ -0,0 +1,388 @@
+{
+ "metadata": {
+ "name": "chapter2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Electron Theory of Metals"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.1, Page number 69"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the Fermi function\n\n#import module\nimport math\n\n#Calculation\n# given that E-Ef = kT\n# fermi function FE = 1/(1+exp((E-Ef)/kT)\n# therefore FE = 1/(1+exp(kT/kT));\n# FE = 1/(1+exp(1))\nFE=1/(1+math.exp(1));\nFE=math.ceil(FE*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"fermi function is\",FE);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fermi function is', 0.27)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.2, Page number 69"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the Fermi function\n\n#import module\nimport math\n\n#Calculation\n# given that E-Ef = kT\n# fermi function FE = 1/(1+exp((E-Ef)/kT)\n# therefore FE = 1/(1+exp(kT/kT));\n# FE = 1/(1+exp(1))\nFE=1/(1+math.exp(1));\nFE=math.ceil(FE*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"fermi function is\",FE);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fermi function is', 0.269)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.3, Page number 69"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nFE=10/100; #fermi function is 10%\nEf=5.5; #fermi energy of silver in eV\nk=1.38*10**-23;\n\n#Calculation\nE=Ef+(Ef/100);\n#FE=1/(1+math.exp((E-Ef)/(k*T)))\n#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n#let X=E-Ef; \nX=E-Ef; #energy in eV\nX=X*1.6*10**-19; #energy in J\nT = (X/(k*math.log((1/FE)-1)));\nT=math.ceil(T*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"temperature in K is\",T);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('temperature in K is', 290.23)\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.4, Page number 70 **************************************"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\n#let X=E-Ef\nX=0.5; #E-Ef=0.5 in eV\n\n#Calculation\nX=X*1.6*10**-19; #X in J\nFE=1/100; #fermi function is 1% \nk=1.38*10**-23;\n#FE=1/(1+exp(X/(k*T)))\n#therefore 1/FE = 1+math.exp(X/(k*T))\n#therefore (1/FE)-1 = math.exp(X/(k*T))\n#therefore log((1/FE)-1) = X/(k*T)\n#but log(x) = 2.303*math.log10(x)\n#therefore T = X/(k*math.log((1/FE)-1))\n#but log(x)=2.303*math.log10(x)\n#therefore T = X/(k*2.303*math.log10((1/FE)-1))\nT = X/(k*2.303*math.log10((1/FE)-1));\n\n#Result\nprint(\"temperature in K is\",T);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('temperature in K is', 1261.3505710887953)\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.5, Page number 71 *******"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the density and mobility of electrons in silver\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nrho_s=10.5*10**3; #density in kg/m^3\nNA=6.02*10**26; #avagadro number per kmol\nMA=107.9; \n\n#Calculation\nn=(rho_s*NA)/MA;\nsigma=6.8*10**7;\ne=1.6*10**-19; #charge in coulomb\nmew=sigma/(n*e);\nmew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"density of electrons is\",n);\nprint(\"mobility of electrons in silver in m^2/Vs is\",mew);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('density of electrons is', 5.85820203892493e+28)\n('mobility of electrons in silver in m^2/Vs is', 0.007255)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.6, Page number 71 ***"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the mobility and average time of collision of electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=8.92*10**3; #density in kg/m^3\nrho=1.73*10**-8; #resistivity in ohm-m\nm=9.1*10**-31; #mass in kg\nw=63.5; #atomic weight\ne=1.6*10**-19; #charge in coulomb\nA=6.02*10**26; #avagadro number\n\n#Calculation\nn=(d*A)/w;\nmew=1/(rho*n*e);\ntow=m/(n*(e**2)*rho);\nmew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"mobility of electrons in Copper in m/Vs is\",mew);\nprint(\"average time of collision of electrons in copper in sec is\",tow);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('mobility of electrons in Copper in m/Vs is', 0.004273)\n('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.7, Page number 72"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the relaxation time of conduction electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nrho=1.54*10**-8; #resistivity in ohm-m\nn=5.8*10**28; #electron/m^3\nm=9.108*10**-31; #mass in kg\ne=1.602*10**-19; #charge in coulomb\n\n#Calculation\ntow=m/(n*(e**2)*rho);\n\n#Result\nprint(\"relaxation time of conduction electrons in sec is\",tow);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('relaxation time of conduction electrons in sec is', 3.973281032516849e-14)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.8, Page number 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nFE=10/100; #fermi function is 10%\nEf=5.5; #fermi energy of silver in eV\nk=1.38*10**-23;\n\n#Calculation\nE=Ef+(Ef/100);\n#FE=1/(1+math.exp((E-Ef)/(k*T)))\n#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n#let X=E-Ef; \nX=E-Ef; #energy in eV\nX=X*1.6*10**-19; #energy in J\nT = (X/(k*math.log((1/FE)-1)));\nT=math.ceil(T*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"temperature in K is\",T);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('temperature in K is', 290.23)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.9, Page number 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the Fermi distribution function\n\n#import module\nimport math\n\n#Calculation\n# given that E-Ef = kT\n# fermi function FpE = 1/(1+exp((E-Ef)/kT)\n# therefore FpE = 1/(1+exp(kT/kT));\n# FpE = 1/(1+exp(1))\nFpE=1/(1+math.exp(1));\nFpE=math.ceil(FpE*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"fermi function is\",FpE);\n#the presence of electron at that energy level is not certain",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('fermi function is', 0.27)\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.10, Page number 74 ****************************"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the number of states per unit volume\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nm=9.1*10**-31; #mass in kg\nh=6.626*10**-34;\nA=(8*m)**(3/2);\n\n#Calculation\nB=math.pi/(2*h**3);\nEfeV=3.10; #fermi energy in eV\nEf=EfeV*1.6*10**-19; #fermi energy in J\nEFeV=EfeV+0.02; #energy after interval in eV\nEF=EFeV*1.6*10**-19; #energy after interval in J\nfunction Q=f(E),Q=A*B*math.sqrt(E),endfunction\nI=intg(Ef,EF,f)\n\n#Result\nprint(\"number of energy states per unit volume is\",I);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SyntaxError",
+ "evalue": "invalid syntax (<ipython-input-25-15d658985351>, line 18)",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;36m File \u001b[1;32m\"<ipython-input-25-15d658985351>\"\u001b[1;36m, line \u001b[1;32m18\u001b[0m\n\u001b[1;33m function Q=f(E),Q=A*B*math.sqrt(E),endfunction\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.11, Page number 74"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the mean free path of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nT=300; #temperature in K\nn=8.5*10**28; #density per m^3\nrho=1.69*10**-8; #resistivity in ohm/m^3\nme=9.11*10**-31; #mass of electron in kg\ne=1.6*10**-19; #charge in coulomb\nKB=1.38*10**-23; #boltzmann constant in J/k\n\n#Calculation\nlamda=math.sqrt(3*KB*me*T)/(n*(e**2)*rho);\n\n#Result\nprint(\"mean free path of electron in m is\",lamda);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('mean free path of electron in m is', 2.892506814374228e-09)\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.12, Page number 75"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the relaxation time of conduction electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nrho=1.43*10**-8; #resistivity in ohm-m\nn=6.5*10**28; #electron/m^3\nm=9.11*10**-34; #mass in kg\ne=1.6*10**-19; #charge in coulomb\n\n#Calculation\ntow=m/(n*(e**2)*rho);\n\n#Result\nprint(\"relaxation time of conduction electrons in sec is\",tow);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('relaxation time of conduction electrons in sec is', 3.8285032275416887e-17)\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.13, Page number 75 ******"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the mobility and average time of collision of electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=8.92*10**3; #density in kg/m^3\nrho=1.73*10**-8; #resistivity in ohm-m\nm=9.1*10**-31; #mass in kg\nM=63.5; #atomic weight\ne=1.6*10**-19; #charge in coulomb\nA=6.02*10**26; #avagadro number\n\n#Calculation\nn=(d*A)/M;\nmew=1/(rho*n*e);\ntow=m/(n*(e**2)*rho);\nmew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"mobility of electrons in Copper in m/Vs is\",mew);\nprint(\"average time of collision of electrons in copper in sec is\",tow);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('mobility of electrons in Copper in m/Vs is', 0.004273)\n('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.14, Page number 76"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the order of magnitude of velocity of molecules\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nMH=1.008*2*1.67*10**-27; #mass in kg\nT=30; #temperature in C\n\n#Calculation\nT=T+273; #temperature in K\nKB=1.38*10**-23; #boltzmann constant in J/k\nKE=(3/2)*KB*T; #kinetic energy in J\nKEeV=KE*6.24*10**18; #kinetic energy in eV\ncbar=math.sqrt((3*KB*T)/MH);\n\n#Result\nprint(\"average kinetic energy in J is\",KE);\nprint(\"average kinetic energy in eV is\",KEeV);\nprint(\"velocity of molecules in m/s is\",cbar);\n\n#answers for average kinetic energy in eV and velocity of electrons given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('average kinetic energy in J is', 6.2720999999999986e-21)\n('average kinetic energy in eV is', 0.039137903999999994)\n('velocity of molecules in m/s is', 1930.269663853336)\n"
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.15, Page number 77 ****"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the velocity of an electron and proton\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEe=10; #electron kinetic energy in eV\nEp=10; #proton kinetic energy in eV\nme=9.1*10**-31; #mass of electron in kg\nmp=1.67*10**-27; #mass of proton in kg\n\n#Calculation\nEeeV=Ee*1.6*10**-19; #electron kinetic energy in J\nEpeV=Ep*1.6*10**-19; #proton kinetic energy in J\ncebar=math.sqrt((2*EeeV)/me);\ncpbar=math.sqrt((2*EpeV)/mp);\n\n#Result\nprint(\"velocity of electron in m/s is\",cebar);\nprint(\"velocity of proton in m/s is\",cpbar);\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('velocity of electron in m/s is', 1875228.9237539817)\n('velocity of proton in m/s is', 43774.05241316662)\n"
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.16, Page number 77"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the drift velocity of free electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nA=10; #area of cross section in mm^2\nA=A*10**-6; #area of cross section in m^2\ni=100; #current in amp\nn=8.5*10**28; #number of electrons per mm^3\ne=1.6*10**-19; #electron charge in coulumb\n\n#Calculation\nvd=1/(n*A*e);\n\n#Result\nprint(\"drift velocity in m/s is\",vd);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('drift velocity in m/s is', 7.3529411764705884e-06)\n"
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 2.17, Page number 78"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the thermal conductivity of copper\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\ntow=3*10**-14; #relaxation time in sec\nn=8*10**28; #density of electrons per m^3\nKB=1.38*10**-23; #boltzmann constant in J/k\nT=0; #temperature in C\n\n#Calculation\nT=T+273; #temperature in K\nm=9.1*10**-31; #mass of electron in kg\nsigma_T=((3*n*tow*(KB**2)*T)/(2*m));\nsigma_T=math.ceil(sigma_T*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"thermal conductivity of copper in ohm-1 is\",sigma_T);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('thermal conductivity of copper in ohm-1 is', 205.68)\n"
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/chapter4_2.ipynb b/Engineering_Physics/chapter4_2.ipynb
new file mode 100644
index 00000000..b8bc5e59
--- /dev/null
+++ b/Engineering_Physics/chapter4_2.ipynb
@@ -0,0 +1,364 @@
+{
+ "metadata": {
+ "name": "chapter4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Magnetic Properties"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.1, Page number 119"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the relative permeability of iron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nH=6.5*10**-4; #magnetic field in T\nM=1.4; #field with iron\n\n#Calculation\nchi=M/H;\nmew_r=1+chi;\nmew_r=math.ceil(mew_r*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"relative permeability of iron is\",mew_r);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('relative permeability of iron is', 2154.85)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.2, Page number 119"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the relative permeability of ferromagnetic material\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nH=220; #field in amp/m\nM=3300; #magnetisation in amp/m\n\n#Calculation\nchi=M/H;\nmew_r=1+chi;\n\n#Result\nprint(\"relative permeability is\",mew_r);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('relative permeability is', 16.0)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.3, Page number 120 *****"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the change in magnetic moment\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=5.29*10**-11; #radius of orbit in m\nB=2; #applied field in Tesla\ne=1.602*10**-19; #charge of electron in coulomb\nm=9.108*10**-31; #mass of electron in kg\n\n#Calculation\nmew=(e**2)*(r**2)*B/(4*m);\n\n#Result\nprint(\"magnetic moment in Am^2 is\",mew);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetic moment in Am^2 is', 3.94260574090909e-29)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.4, Page number 120"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the intensity of magnetisation and flux density\n\n#import module\nimport math\n\n#Variable decleration\nchi=0.5*10**-5; #susceptibility \nH=10**6; #field strength in amp/m\n\n#Calculation\nmew_0=4*math.pi*10**-7;\nI=chi*H;\nB=mew_0*(I+H);\nB=math.ceil(B*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"intensity of magnetisation in Amp/m is\",I);\nprint(\"flux density in Weber/m^2 is\",B);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('intensity of magnetisation in Amp/m is', 5.0)\n('flux density in Weber/m^2 is', 1.257)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.5, Page number 120"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the average number of bohr magnetons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\ne=2.86; #edge in armstrong\ne=e*10**-10; #edge in m\nIs=1.76*10**6; #magnetisation in amp/m\nmewB=9.27*10**-24; #1 bohr magneton in amp m^2\n\n#Calculation\nN=2/(e**3); #density per m^3\nmewbar=Is/N;\nmew_bar=mewbar/mewB;\nmew_bar=math.ceil(mew_bar*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"average dipole moment in mewB is\",mew_bar);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('average dipole moment in mewB is', 2.221)\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.6, Page number 121 ***"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the magnetisation and flux density\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nH=10**6; #magnetic field in amp/m\nchi=1.5*10**-3; #susceptibility\n\n#Calculation\nmew_0=4*math.pi*10**-7;\nM=chi*H;\nB=mew_0*(M+H);\n\n#Result\nprint(\"magnetisation in Amp/m is\",M);\nprint(\"flux density in Tesla is\",B);\n\n#answer for flux density given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetisation in Amp/m is', 1500.0)\n('flux density in Tesla is', 1.258522017028071)\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.7, Page number 121"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the magnetisation and flux density\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nchi=3.7*10**-3; #susceptibility \nH=10**4; #field strength in amp/m\n\n#Calculation\nmew_0=4*math.pi*10**-7;\nM=chi*H;\nB=mew_0*(M+H);\nB=math.ceil(B*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"magnetisation in Amp/m is\",M);\nprint(\"flux density in Weber/m^2 is\",B);\n\n#answer for flux density given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetisation in Amp/m is', 37.0)\n('flux density in Weber/m^2 is', 0.01262)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.8, Page number 121"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the change in magnetic moment\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=0.052*10**-9; #radius of orbit in m\nB=1; #magnetic field in Wb/m^2\ne=1.6*10**-19; #charge of electron in coulomb\nm=9.1*10**-31; #mass of electron in kg\n\n#Calculation\ndmew=(e**2)*(r**2)*B/(4*m);\n\n#Result\nprint(\"magnetic moment in Am^2 is\",dmew);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetic moment in Am^2 is', 1.901714285714286e-29)\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.9, Page number 122"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the intensity of magnetisation and flux density\n\n#import module\nimport math\n\n#Variable decleration\nchi=-0.5*10**-5; #susceptibility \nH=9.9*10**4; #field strength in amp/m\n\n#Calculation\nmew_0=4*math.pi*10**-7;\nI=chi*H;\nB=mew_0*H*(1+chi);\nI=math.ceil(I*10**4)/10**4; #rounding off to 4 decimals\nB=math.ceil(B*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"intensity of magnetisation in Amp/m is\",I);\nprint(\"flux density in Weber/m^2 is\",B);\n\n#answer for flux density given in the book is wrong ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('intensity of magnetisation in Amp/m is', -0.495)\n('flux density in Weber/m^2 is', 0.1245)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.10, Page number 122"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the flux density at centre and dipole moment\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=6.1*10**-11; #radius of H atom in m\nnew=8.8*10**15; #frequency in rev/sec\ne=1.6*10**-19;\n\n#Calculation\nmew0=4*math.pi*10**-7;\ni=e*new;\nB=(mew0*i)/(2*r);\nmew=i*math.pi*(r**2);\ni=math.ceil(i*10**7)/10**7; #rounding off to 7 decimals\nB=math.ceil(B*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"current in amp is\",i);\nprint(\"magnetic induction in weber/m^2 is\",B);\nprint(\"dipole moment in amp m^2 is\",mew);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('current in amp is', 0.0014081)\n('magnetic induction in weber/m^2 is', 14.503)\n('dipole moment in amp m^2 is', 1.645933169972273e-23)\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.11, Page number 123"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the average number of Bohr magnetons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nIs=1.96*10**6; #saturation magnetisation in amp/m\na=3; #cube edge of iron in armstrong\na=a*10**-10; #cube edge of iron in m\nmew_b=9.27*10**-24; #bohr magneton in amp/m^2\nn=2; #number of atoms per unit cell\n\n#Calculation\nN=n/(a**3);\nmewbar=Is/N;\nmew_ab=mewbar/mew_b;\nmew_ab=math.ceil(mew_ab*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"average number of Bohr magnetons in bohr magneton per atom is\",mew_ab);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('average number of Bohr magnetons in bohr magneton per atom is', 2.8544)\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.12, Page number 123"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the magnetic force and relative permeability\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nI=3000; #magnetisation in amp/m\nB=0.005; #flux density in weber/m^2\n\n#Calculation\nmew0=4*math.pi*10**-7;\nH=(B/mew0)-I;\nmew_r=(I/H)+1;\nH=math.ceil(H*10**3)/10**3; #rounding off to 3 decimals\nmew_r=math.ceil(mew_r*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"magnetic force in amp/m is\",H);\nprint(\"relative permeability is\",mew_r);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnetic force in amp/m is', 978.874)\n('relative permeability is', 4.065)\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.13, Page number 124"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the permeability\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nH=1800; #magnetising field in amp/m\nphi=3*10**-5; #magnetic flux in weber\nA=0.2; #cross sectional area in cm^2\n\n#Calculation\nA=A*10**-4; #cross sectional area in m^2\nB=phi/A;\nmew=B/H;\nmew=math.ceil(mew*10**8)/10**8 #rounding off to 8 decimals\n\n#Result\nprint(\"the permeability in Henry/m is\",mew);\n\n#answer given in the book is wron",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the permeability in Henry/m is', 0.00083334)\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.14, Page number 124 ********************"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the magnetic dipole moment and torque\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=0.04; #radius of circular loop in m\ni=1000; #current in mA\ni=i*10**-3; #current in amp\nB=10**-3; #magnetic flux density in Wb/m^2\ntheta=45; #angle in degrees\n\n#Calculation\nA=math.pi*(r**2);\nmew=i*A;\ntow=i*B*math.cos(theta);\nmew=math.ceil(mew*10**6)/10**6 #rounding off to 6 decimals\n\n#Result\nprint(\"the magnetic dipole moment in amp m^2 is\",mew);\nprint(\"the torque in Nm is\",tow);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the magnetic dipole moment in amp m^2 is', 0.005027)\n('the torque in Nm is', 0.0005253219888177298)\n"
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.15, Page number 125"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the hysterisis loss per cycle\n\n#import module\nimport math\n\n#Variable decleration\nA=100; #area of hysteris loop in m^2\nB=0.01; #flux density in wb/m^2\nH=40; #magnetic field in amp/m\nM=7650; #atomic weight in kg/m^3\n\n#Calculation\nhl=A*B*H;\n\n#Result\nprint(\"the hysterisis loss per cycle in J/m^3 is\",hl);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the hysterisis loss per cycle in J/m^3 is', 40.0)\n"
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.17, Page number 125"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the hysterisis power loss and power loss\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nhl=200; #hysterisis loss per cycle in J/m^3\nM=7650; #atomic weight in kg/m^3\nm=100; #magnetisation cycles per second\n\n#Calculation\nhpl=hl*m;\npl=hpl/M;\npl=math.ceil(pl*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"hysterisis power loss per second in watt/m^3 is\",hpl);\nprint(\"the power loss in watt/kg is\",pl); \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('hysterisis power loss per second in watt/m^3 is', 20000)\n('the power loss in watt/kg is', 2.6144)\n"
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/chapter5_2.ipynb b/Engineering_Physics/chapter5_2.ipynb
new file mode 100644
index 00000000..66e0fe37
--- /dev/null
+++ b/Engineering_Physics/chapter5_2.ipynb
@@ -0,0 +1,322 @@
+{
+ "metadata": {
+ "name": "chapter5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Superconductivity"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.1, Page number 148"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical feild at 2K\n\n#importing modules\nimport math\n\n#Variable declaration\nTc=3.7; #in kelvin\nHc_0=0.0306; \nT=2\n\n#Calculation\nHc_2k=Hc_0*(1-((T/Tc)**2));\nHc_2k=math.ceil(Hc_2k*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"the critical feild at 2K in tesla is\",Hc_2k);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical feild at 2K in tesla is', 0.02166)\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.2, Page number 149\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical current\n\n#importing modules\nimport math\n\n#Variable declaration\nT=4.2; #in kelvin\nTc=7.18; #in kelvin\nHc_0=6.5*10**4; #in amp per meter\nD=10**-3\n\n#Calculation\nR=D/2; #radius is equal to half of diameter\nHc_T=Hc_0*(1-((T/Tc)**2));\nHc_T=math.ceil(Hc_T*10)/10; #rounding off to 1 decimals\nIc=2*math.pi*R*Hc_T #critical current is calculated by 2*pi*r*Hc(T)\nIc=math.ceil(Ic*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical feild in Tesla is\",round(Hc_T));\nprint(\"the critical current in Amp is\",Ic);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical feild in Tesla is', 42759.0)\n('the critical current in Amp is', 134.34)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.3, Page number 149\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the pentration depth at 0k\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda_T=75 #in nm\nT=3.5 \nHgTc=4.12 #in K\n\n#Calculation\nlamda_o=lamda_T*math.sqrt(1-((T/HgTc)**4));\nlamda_o=math.ceil(lamda_o*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the pentration depth at 0k is\",lamda_o);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the pentration depth at 0k is', 51.92)\n"
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.4, Page number 150"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical magnitude\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda_T1=396 #pentration depth in armstrong\nlamda_T2=1730 #pentration depth in armstrong\nT1=3 #temperature in K\nT2=7.1 #temperature in K\n\n#Calculation\n#lamda_T2**2=lamda_0**2*(((Tc**4-T2**4)/Tc**4)**-1)\n#lamda_T1**2=lamda_0**2*(((Tc**4-T1**4)/Tc**4)**-1)\n#dividing lamda_T2**2 by lamda_T1**2 = (Tc**4-T1**4)/(Tc**4-T2**4)\n#let A=lamda_T2**2 and B=lamda_T1**2\nA=lamda_T2**2\nB=lamda_T1**2\nC=A/B\nC=math.ceil(C*10**4)/10**4; #rounding off to 4 decimals\nX=T1**4\nY=T2**4\nY=math.ceil(Y*10**2)/10**2; #rounding off to 2 decimals\n#C*((TC**4)-Y)=(Tc**4)-X\n#C*(Tc**4)-(Tc**4)=C*Y-X\n#(Tc**4)*(C-1)=(C*Y)-X\n#let Tc**4 be D\n#D*(C-1)=(C*Y)-X\nD=((C*Y)-X)/(C-1)\nD=math.ceil(D*10)/10; #rounding off to 1 decimals\nTc=D**(1/4)\nTc=math.ceil(Tc*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"the pentration depth at 0k is\",Tc);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the pentration depth at 0k is', 7.1932)\n"
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.5, Page number 150"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical feild at 5K\n\n#importing modules\nimport math\n\n#Variable declaration\nTc=7.2 #in K\nHo=6.5*10**3 #in amp per m\nT=5 #in K\n\n#Calculation\nHc=Ho*(1-((T/Tc)**2))\nHc=math.ceil(Hc*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical magnetic feild at 5K in amp per m is\",Hc)\n\n# answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical magnetic feild at 5K in amp per m is', 3365.36)\n"
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.6, Page number 151"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical feild at 2.5K\n\n#importing modules\nimport math\n\n#Variable declaration\nTc=3.5 #in K\nHo=3.2*10**3 #in amp per m\nT=2.5 #in K\n\n#Calculation\nHc=Ho*(1-((T/Tc)**2))\nHc=math.ceil(Hc*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical magnetic feild at 5K in amp per m is\",Hc)\n\n#answer in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical magnetic feild at 5K in amp per m is', 1567.35)\n"
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.7, Page number 151"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the transition temperature\n\n#importing modules\nimport math\n\n#Variable declaration\nHc=5*10**3 #in amp per m\nHo=2*10**4 #in amp per m\nT=6 #in K\n\n#Calculation\nTc=T/math.sqrt(1-(Hc/Ho))\nTc=math.ceil(Tc*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical magnetic feild at 5K in amp per m is\",Tc)\n\n#answer in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical magnetic feild at 5K in amp per m is', 6.93)\n"
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.8, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical current\n\n#importing modules\nimport math\n\n#Variable declaration\nHc=2*10**3 #in amp per m\nR=0.02 #in m\n\n#Calculation\nIc=2*math.pi*R*Hc\nIc=math.ceil(Ic*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical current is\",Ic)\n\n#answer in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical magnetic feild at 5K in amp per m is', 251.33)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.9, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the isotopic mass of M2\n\n#importing modules\nimport math\n\n#Variable declaration\nM1=199.5 #in a.m.u\nT1=5 #in K\nT2=5.1 #in K\n\n#Calculation\nM2=((T1/T2)**2)*M1\nM2=math.ceil(M2*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"the isotopic mass of M2 is\",M2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the isotopic mass of M2 is', 191.754)\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.10, Page number 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical magnetic feild and critical current\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nD=3*10**-3 #in meters\nTc=8 #in K \nT=5 #in K \nHo=5*10**4\n\n#Calculation\nR=D/2\nHc=Ho*(1-((T/Tc)**2))\nIc=2*math.pi*R*Hc\nIc=math.ceil(Ic*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"critical magnetic feild in amp per m is\",round(Hc));\nprint(\"critical current in amp is\",Ic);\n\n#answer in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('critical magnetic feild in amp per m is', 30469.0)\n('critical current in amp is', 287.162)\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.11, Page number 153"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the critical temperature\n\n#importing modules\nimport math\n\n#Variable declaration\nM1=199.5 \nM2=203.4 \nTc1=4.185 #in K\n\n#Calculation\nTc2=Tc1*math.sqrt(M1/M2)\nTc2=math.ceil(Tc2*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"the critical temperature is\",Tc2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical temperature is', 4.145)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.12, Page number 154"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the EM wave frequency\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nV=8.5*10**-6 #in volts\ne=1.6*10**-19 #in C\nh=6.626*10**-24\n\n#Calculation\nnew=2*e*V/h\nnew=math.ceil(new*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"EM wave generated frequency in Hz is\",new)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('EM wave generated frequency in Hz is', 0.41051)\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.13, Page number 154"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#to calculate the critical temperature at 6mm presure of Hg\n\n#Variable declaration\np1=1 #in mm\np2=6 #in mm\nTc1=5 #in K\n\n#Calculation\nTc2=Tc1*(p2/p1);\n\n#Result\nprint(\"the critical temperature in K is\",round(Tc2))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the critical temperature in K is', 30.0)\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 5.14, Page number 154\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#to calculate maximum critical temperature\n\n#Variable declaration\nTc=8.7 #in K\nHc=6*10**5 #in A per m\nHo=3*10**6 #in A per m\n\n#Calculation\nT=Tc*(math.sqrt(1-(Hc/Ho)))\n\n#Result\nprint(\" maximum critical temperature in K is\",T)\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "(' maximum critical temperature in K is', 7.781516561699267)\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/chapter6_2.ipynb b/Engineering_Physics/chapter6_2.ipynb
new file mode 100644
index 00000000..4c7f2be8
--- /dev/null
+++ b/Engineering_Physics/chapter6_2.ipynb
@@ -0,0 +1,238 @@
+{
+ "metadata": {
+ "name": "chapter6 (1)"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Dielectric Properties"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.1, Page number 187"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the energy stored in the condenser and polarizing the dielectric\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nC=2; #capacitance in micro farad\nC=C*10**-6; #capacitance in farad\nV=1000; #voltage in Volts\nepsilon_r=100; \n\n#Calculation\nW=(C*(V**2))/2;\nC0=C/epsilon_r;\nW0=(C0*(V**2))/2;\nW_0=1-W0;\n\n#Result\nprint(\"energy stored in the condenser in Joule is\",W);\nprint(\"energy stored in the dielectric in Joule is\",W_0);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy stored in the condenser in Joule is', 1.0)\n('energy stored in the dielectric in Joule is', 0.99)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.2, Page number 188"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the ratio between electronic and ionic polarizability\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nepsilon_r=4.94;\nN=2.69; #let n**2 be N\n\n#Calculaion\n#(epsilon_r-1)/(epsilon_r+2) = (N*alpha)/(3*epsilon_0)\n#alpha = alpha_e+alpha_i\n#therefore (epsilon_r-1)/(epsilon_r+2) = (N*(alpha_e+alpha_i))/(3*epsilon_0)\n#let (N*(alpha_e+alpha_i))/(3*epsilon_0) be X\nX=(epsilon_r-1)/(epsilon_r+2);\n#Ez=n^2\n#therefore (N-1)/(N+2) = (N*alpha_e)/(3*epsilon_0)\n#let (N*alpha_e)/(3*epsilon_0) be Y\nY=(N-1)/(N+2);\n#dividing X/Y = (N*(alpha_e+alpha_i))/(N*alpha_e)\n#therefore X/Y = 1+(alpha_i/alpha_e)\n#let alpha_i/alpha_e be A\nR=(X/Y)-1;\nR=math.ceil(R*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"ratio between electronic and ionic polarizability is\",R);\n\n#answer given in the book is wrong in the second part",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('ratio between electronic and ionic polarizability is', 0.5756)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.3, Page number 188"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the dielectric constant of the material\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nN=3*10**28; #atoms per m^3\nalpha_e=10**-40; #farad m^2\nepsilon_0=8.854*10**-12; #f/m\n\n#Calculation\nepsilon_r=1+(N*alpha_e/epsilon_0);\nepsilon_r=math.ceil(epsilon_r*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"dielectric constant of the material is\",epsilon_r);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('dielectric constant of the material is', 1.339)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.4, Page number 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the electronic polarizability of He atoms\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nepsilon_0=8.854*10**-12; #f/m\nepsilon_r=1.0000684;\n\n#Calculation\nN=2.7*10**25; #atoms per m^3\nalpha_e=(epsilon_0*(epsilon_r-1))/N;\n\n#Result\nprint(\"electronic polarizability of He atoms in Fm^2 is\",alpha_e);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('electronic polarizability of He atoms in Fm^2 is', 2.2430133333322991e-41)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.5, Page number 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the capacitance and charge\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nepsilon_0=8.854*10**-12; #f/m\nA=100; #area in cm^2\nA=A*10**-4; #area in m^2\nV=100; #potential in V\nd=1; #plate seperation in cm\n\n#Calculation\nd=d*10**-2; #plate seperation in m\nC=(epsilon_0*A)/d;\nQ=C*V;\n\n#Result\nprint(\"charge on the plates in F is\",C);\nprint(\"charge on the capacitor in coulomb is\",Q);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('charge on the plates in F is', 8.854e-12)\n('charge on the capacitor in coulomb is', 8.854e-10)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.6, Page number 190"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the resultant voltage across the capacitors\n\n#import module\nimport math\nfrom __future__ import division\n\n\n#Variable decleration\nQ=2*10**-10; #charge in coulomb\nd=4; #plate seperation in mm\nd=d*10**-3; #plate seperation in m\nepsilon_r=3.5;\nepsilon_0=8.85*10**-12; #f/m\nA=650; #area in mm^2\n\n#Calculation\nA=A*10**-6; #area in m^2\nV=(Q*d)/(epsilon_0*epsilon_r*A);\nV=math.ceil(V*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"voltage across the capacitor in Volts is\",V);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('voltage across the capacitor in Volts is', 39.735)\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.7, Page number 190"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the dielectric displacement\n\n#import module\nimport math\nfrom __future__ import division\n\n\n#Variable decleration\nV=10; #potential in volts\nd=2*10**-3; #plate seperation in m\nepsilon_r=6; #dielectric constant\nepsilon_0=8.85*10**-12; #f/m\n\n#Calculation\nE=V/d;\nD=epsilon_0*epsilon_r*E;\n\n#Result\nprint(\"dielectric displacement in cm^-2 is\",D);\n\n#answer given in the book is wrong in the 7th decimal point",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('dielectric displacement in cm^-2 is', 2.6549999999999994e-07)\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.8, Page number 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the polarizability and relative permittivity of He\n\n#import module\nimport math\nfrom __future__ import division\n\n\n#Variable decleration\nR=0.55; #radius of He atom in angstrom\nR=R*10**-10; #radius of He atom in m\nepsilon_0=8.84*10**-12; #f/m\nN=2.7*10**25;\n\n#Calculation\nalpha_e=4*math.pi*epsilon_0*R**3;\nepsilon_r=(N*alpha_e/epsilon_0)+1;\nepsilon_r=math.ceil(epsilon_r*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"polarizability in farad m^2 is\",alpha_e);\nprint(\"relative permitivity is\",epsilon_r);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('polarizability in farad m^2 is', 1.848205241292183e-41)\n('relative permitivity is', 1.000057)\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.9, Page number 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the field strength and total dipole moment\n\n#import module\nimport math\nfrom __future__ import division\n\n\n#Variable decleration\nV=15; #potential difference in volts\nC=6; #capacity in micro farad\nC=C*10**-6; #capacity in farad\nepsilon_0=8.84*10**-12; #f/m\nepsilon_r=8;\nA=360; #surface area in cm^2\n\n#Calculation\nA=A*10**-4; #surface area in m^2\nE=(V*C)/(epsilon_0*epsilon_r*A);\nd=epsilon_0*(epsilon_r-1)*V*A;\n\n#Result\nprint(\"field strength in V/m is\",E);\nprint(\"total dipole moment in cm is\",d);\n\n#answer for field strength E given in the book is wrong ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('field strength in V/m is', 35350678.73303167)\n('total dipole moment in cm is', 3.34152e-11)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 6.10, Page number 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the complex polarisability of material\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nepsilonr=4.36; #dielectric constant\nt=2.8*10**-2; #loss tangent(t)\nN=4*10**28; #number of electrons\nepsilon0=8.84*10**-12; \n\n#Calculation\nepsilon_r = epsilonr*t;\nepsilonstar = (complex(epsilonr,-epsilon_r));\nalphastar = (epsilonstar-1)/(epsilonstar+2);\nalpha_star = 3*epsilon0*alphastar/N; #complex polarizability(Fm**2)\n\n#Result\nprint(\"the complex polarizability in F-m^2 is\"'alphastar',alpha_star);\n#disp('j',I,R);\n#by taking 10^-40 common we get alphastar = (3.5-j0.06)*10^-40 F-m^2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the complex polarizability in F-m^2 isalphastar', (3.5037933503257222e-40-6.000743833211258e-42j))\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/chapter7_2.ipynb b/Engineering_Physics/chapter7_2.ipynb
new file mode 100644
index 00000000..617f6cbd
--- /dev/null
+++ b/Engineering_Physics/chapter7_2.ipynb
@@ -0,0 +1,658 @@
+{
+ "metadata": {
+ "name": "chapter7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Semiconductors"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.1, Page number 251"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the number of electron hole pairs\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nT1=300; #temp in K\nT2=310; #temp in K\nni1=2.5*10**19; #per cubic metre\nEgeV1=0.72; #value of Eg in eV\nEgeV2=1.12; #value of Eg in eV\n\n#Calculation\nEg1=EgeV1*1.6*10**-19; #Eg in J\nEg2=EgeV2*1.6*10**-19; #Eg in J\nKB=1.38*10**-23; #boltzmann constant in J/k\n#density of electron hole pair is ni = A*(T**(3/2))*exp(-Eg/(2*KB*T))\n#let (T**(3/2))*exp(-Eg/(2*KB*T)) be X\nX1=(T1**(3/2))*math.exp(-Eg1/(2*KB*T1));\nX2=(T2**(3/2))*math.exp(-Eg2/(2*KB*T2));\n#therefore ni1=A*X1 and ni2=A*X2. dividing ni2/ni1 we get X2/X1\nni2=ni1*(X2/X1);\n\n#Result\nprint(\"the number of electron hole pairs per cubic metre is\",ni2);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the number of electron hole pairs per cubic metre is', 2.3207901206362184e+16)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.2, Page number 251"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the charge carrier density and electron mobility\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nRH=3.66*10**-4; #hall coefficient in m^3/coulomb\nsigma=112; #conductivity in ohm-1 m-1\ne=1.6*10**-19;\n\n#Calculation\nne=1/(RH*e);\n#sigma = e*ne*(mew_e+mew_h)\n#assuming mew_h = 0\nmew_e=sigma/(e*ne);\n\n#Result\nprint(\"the charge carrier density per m^3 is\",ne);\nprint(\"electron mobility in m^2/Vs is\",mew_e);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the charge carrier density per m^3 is', 1.7076502732240434e+22)\n('electron mobility in m^2/Vs is', 0.040992)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.3, Page number 252"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the conductivity of intrinsic silicon and resultant conductivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nni=1.5*10**16; #intrinsic concentration per m^3\ne=1.6*10**-19;\nmew_e=0.13; #mobility of electrons in m^2/Vs\nmew_h=0.05; #mobility of holes in m^2/Vs\nND=5*10**20; #conductivity in atoms/m^3\n\n#Calculation\nsigma1=ni*e*(mew_e+mew_h);\nnd=(ni**2)/ND;\nsigma2=ND*e*mew_e;\nNA=5*10**20;\nna=(ni**2)/NA;\nsigma3=NA*e*mew_h;\nsigma1=math.ceil(sigma1*10**7)/10**7; #rounding off to 7 decimals\nsigma2=math.ceil(sigma2*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"intrinsic conductivity of Si in ohm-1 m-1 is\",sigma1);\nprint(\"conductivity of Si during donor impurity in ohm-1 m-1 is\",sigma2);\nprint(\"conductivity of Si during acceptor impurity in ohm-1 m-1 is\",round(sigma3));",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('intrinsic conductivity of Si in ohm-1 m-1 is', 0.000432)\n('conductivity of Si during donor impurity in ohm-1 m-1 is', 10.41)\n('conductivity of Si during acceptor impurity in ohm-1 m-1 is', 4.0)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.4, Page number 253"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the conductivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nsigma1=2; #conductivity in ohm-1 m-1\nEgeV=0.72; #band gap in eV\nKB=1.38*10**-23; #boltzmann constant\nT1=20; #temp in C\nT2=40; #temp in C\n\n#Calculation\nEg=EgeV*1.6*10**-19; #in J\nT1=T1+273; #temp in K\nT2=T2+273; #temp in K\n#sigma2/sigma1 = exp((-Eg/(2*KB))*((1/T2)-(1/T1)))\n#by taking log on both sides we get 2.303*log10(sigma2/sigma1) = (Eg/(2*KB))*((1/T1)-(1/T2))\n#let (Eg/(2*KB))*((1/T1)-(1/T2)) be X\nX=(Eg/(2*KB))*((1/T1)-(1/T2));\n#let log10(sigma2/sigma1) be Y\nY=X/2.303;\n#log10(sigma2/sigma1) = log10(sigma2)-log10(sigma1)\n#let log10(sigma2) be A\nA=Y+math.log10(sigma1);\nsigma2=10**A;\nsigma2=math.ceil(sigma2*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the conductivity in mho m-1 is\",sigma2);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the conductivity in mho m-1 is', 4.97)\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.5, Page number 253"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the concentration of holes and electrons \n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nmew_n=1300*10**-4; #in m^2/Vs\nmew_p=500*10**-4; #in m^2/Vs\nsigma=3*10**4; #conductivity in ohm-1 m-1\ne=1.6*10**-19;\n\n#Calculation\nN=sigma/(e*mew_n);\nni=1.5*10**16; #per m^3\np=(ni**2)/N;\nP=sigma/(e*mew_p);\nn=(ni**2)/P;\nN=math.ceil(N*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"concentration of electrons in n-type per cubic metre are\",N);\nprint(\"concentration of holes in n-type per cubic metre are\",round(p));\nprint(\"concentration of electrons in p-type per cubic metre are\",round(n));\nprint(\"concentration of holes in p-type per cubic metre are\",P);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration of electrons in n-type per cubic metre are', 1.4423076923076921e+24)\n('concentration of holes in n-type per cubic metre are', 156000000.0)\n('concentration of electrons in p-type per cubic metre are', 60000000.0)\n('concentration of holes in p-type per cubic metre are', 3.7499999999999995e+24)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.6, Page number 254"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the resistivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nni=2.37*10**19; #intrinsic carrier density per m^3\nmew_e=0.38; #in m**2/Vs\nmew_n=0.18; #in m**2/Vs\n\n#Calculation\ne=1.6*10**-19;\nsigmai=ni*e*(mew_e+mew_n);\nrho=1/sigmai;\nrho=math.ceil(rho*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"resistivity in ohm m is\",rho);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('resistivity in ohm m is', 0.471)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.7, Page number 254"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the position of fermi level\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEg=1.12; #band gap in eV\nK=1.38*10**-23;\nT=300; #temp in K\n\n#Calculation\n#EF = (Eg/2)+(3*K*T/4)*log(mh/me)\n#given me=0.12m0 and mh=0.28m0. therefore mh/me = 0.28/0.12 \n#let mh/me be X. therefore X=0.28/0.12 \nX=0.28/0.12;\nEF=(Eg/2)+((3*K*T/4)*math.log(X));\n\n#Result\nprint(\"the position of fermi level in eV is\",EF);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the position of fermi level in eV is', 0.56)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.8, Page number 254"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the concentration of intrinsic charge carriers\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nKB=1.38*10**-23;\nT=300; #temp in K\nh=6.626*10**-34;\nm0=9.11*10**-31;\nmh=m0;\nme=m0;\nEgeV=0.7; #energy gap in eV\n\n#Calculation\nEg=EgeV*1.6*10**-19; #in J\nA=((2*math.pi*KB/(h**2))**(3/2))*(me*mh)**(3/4);\nB=T**(3/2);\nC=math.exp(-Eg/(2*KB*T));\nni=2*A*B*C;\n\n#Result\nprint(\"concentration of intrinsic charge carriers per cubic metre is\",ni);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration of intrinsic charge carriers per cubic metre is', 3.3481803992458756e+19)\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.9, Page number 255"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the resistivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nni=2.4*10**19;\nmew_e=0.39;\nmew_h=0.19;\ne=1.6*10**-19;\n\n#Result\nsigmai=ni*e*(mew_e+mew_h);\nrhoi=1/sigmai;\nrhoi=math.ceil(rhoi*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"resistivity in ohm m is\",rhoi);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('resistivity in ohm m is', 0.45)\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.10, Page number 255"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the resistance\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nl=1; #length in cm\nl=l*10**-2; #length in m\ne=1.6*10**-19;\nw=1; #width in mm\nt=1; #thickness in mm\n\n#Calculation\nw=w*10**-3; #width in m\nt=t*10**-3; #thickness in m\nA=w*t;\nni=2.5*10**19;\nmew_e=0.39;\nmew_p=0.19;\nsigma=ni*e*(mew_p+mew_e);\nR=l/(sigma*A);\n\n#Result\nprint(\"resistance of intrinsic Ge rod in ohm is\",R);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('resistance of intrinsic Ge rod in ohm is', 4310.3448275862065)\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.11, Page number 255"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the conductivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEg=1.1; #energy gap in eV\nm=9.109*10**-31;\nk=1.38*10**-23;\nT=300;\ne=1.6*10**-19;\nh=6.626*10**-34;\nmew_e=0.48; #electron mobility\nmew_h=0.013; #hole mobility\n\n#Calculation\nC=2*(2*math.pi*m*k/(h**2))**(3/2);\nX=2*k*T/e;\nY=-Eg/X;\nA=math.exp(Y);\nni=C*(T**(3/2))*A;\nsigma=ni*e*(mew_e+mew_h);\nsigma=math.ceil(sigma*10**6)/10**6 #rounding off to 6 decimals\n\n#Result\nprint(\"conductivity in ohm-1 m-1 is\",sigma);\n\n# answer given in the book is wrong, Page number 255",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('conductivity in ohm-1 m-1 is', 0.001162)\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.12, Page number 256"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the intrinsic carrier density and conductivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nm=9.109*10**-31;\nk=1.38*10**-23;\nT=300;\ne=1.6*10**-19;\nh=6.626*10**-34;\nEg=0.7;\nmew_e=0.4; #electron mobility\nmew_h=0.2; #hole mobility\n\n#Calculation\nC=2*(2*math.pi*m*k/((h**2)))**(3/2);\nX=2*k*T/e;\nni=C*(T**(3/2))*math.exp(-Eg/X);\nsigma=ni*e*(mew_e+mew_h);\nsigma=math.ceil(sigma*10**3)/10**3 #rounding off to 3 decimals\n\n#Result\nprint(\"conductivity in ohm-1 m-1\",sigma);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('conductivity in ohm-1 m-1', 3.214)\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.13, Page number 256"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the energy band gap\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nk=8.616*10**-5;\nT1=20; #temp in C\nT1=T1+273; #temp in K\nT2=32; #temp in C\nrho2=4.5; #resistivity in ohm m\nrho1=2; #resistivity in ohm m\n\n#Calculation\nT2=T2+273; #temp in K\ndy=math.log10(rho2)-math.log10(rho1);\ndx=(1/T1)-(1/T2);\nEg=2*k*dy/dx;\nEg=math.ceil(Eg*10**3)/10**3 #rounding off to 3 decimals\n\n#Result\nprint(\"energy band gap in eV is\",Eg);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy band gap in eV is', 0.452)\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.13, Page number 256"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the energy band gap\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nk=8.616*10**-5;\nT1=20; #temp in C\nT2=32; ##temp in C\nrho2=4.5; #resistivity in ohm m\nrho1=2; #resistivity in ohm m\n\n#Calculation\nT1=T1+273; #temp in K\nT2=T2+273; #temp in K\ndy=math.log10(rho2)-math.log10(rho1);\ndx=(1/T1)-(1/T2);\nEg=2*k*dy/dx;\nEg=math.ceil(Eg*10**3)/10**3 #rounding off to 3 decimals\n\n#Result\nprint(\"energy band gap in eV is\",Eg);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('energy band gap in eV is', 0.452)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.14, Page number 257"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEgeV=1; #energy in eV\nk=1.38*10**-23;\nEg=EgeV*1.602*10**-19; #in J\n#EF can be taken as (Ev+0.5)eV\n#therefore (Ev+0.5)eV = (Ec+Ev)/2--------(1)\n#let fermi level shift by 10% then (Ev+0.6)eV = ((Ec+Ev)/2)+((3*k*T/4)*log(4))-----(2)\n#subtracting (1) from (2)\n#0.1 eV = (3*k*T/4)*math.log(4)\nE=0.1; #energy in eV\nE=E*1.602*10**-19; #energy in J\nT=(4*E)/(3*k*math.log(4));\n\n#Result\nprint(\"temperature in K is\",T);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('temperature in K is', 1116.520509905372)\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.15, Page number 257"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the conductivity of intrinsic silicon\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nni=1.5*10**16;\ne=1.6*10**-19;\nmew_e=0.13;\nmew_h=0.05;\n\n#Calculation\nsigma=ni*e*(mew_e+mew_h);\nM=28.1; #atomic weight of Si\nd=2.33*10**3; #density in kg/m^3\nv=M/d;\nN=6.02*10**26;\nN1=N/v;\n#1 donor type impurity is added to 1 impurity atom\nND=N1/(10**8);\np=(ni**2)/ND;\nsigma_exd=ND*e*mew_e;\n#1 acceptor type impurity is added to 1 impurity atom\nNa=N1/(10**8);\nn=(ni**2)/Na;\nsigma_exa=Na*e*mew_h;\nsigma=math.ceil(sigma*10**7)/10**7 #rounding off to 7 decimals\nsigma_exd=math.ceil(sigma_exd*10**3)/10**3 #rounding off to 3 decimals\nsigma_exa=math.ceil(sigma_exa*10**3)/10**3 #rounding off to 3 decimals\n\n#Result\nprint(\"conductivity in ohm-1 m-1 is\",sigma);\nprint(\"number of Si atoms per m^3 is\",N1);\nprint(\"conductivity for donor type impurity in ohm-1 m-1 is\",sigma_exd);\nprint(\"conductivity for acceptor type impurity in ohm-1 m-1 is\",sigma_exa);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('conductivity in ohm-1 m-1 is', 0.000432)\n('number of Si atoms per m^3 is', 4.991672597864769e+28)\n('conductivity for donor type impurity in ohm-1 m-1 is', 10.383)\n('conductivity for acceptor type impurity in ohm-1 m-1 is', 3.994)\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.16, Page number 258"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the diffusion coefficient of electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nT=300; #temperature in K\nKB=1.38*10**-23;\ne=1.6*10**-19;\nmew_e=0.19; #mobility of electrons in m^2/Vs\n\n#Calculation\nDn=mew_e*KB*T/e;\nDn=math.ceil(Dn*10**6)/10**6 #rounding off to 6 decimals\n\n#Result\nprint(\"diffusion coefficient of electrons in m^2/s is\",Dn);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('diffusion coefficient of electrons in m^2/s is', 0.004917)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.17, Page number 259"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the Hall voltage\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nRH=3.66*10**-4; #hall coefficient in m^3/coulomb\nI=10**-2; #current in amp\nB=0.5; #magnetic field in wb/m^2\nt=1; #thickness in mm\n\n#Calculation\nt=t*10**-3; #thickness in m\nVH=(RH*I*B)/t;\nVH=VH*10**3; #converting from Volts to mV\n\n#Result\nprint(\"Hall voltage in mV is\",VH);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('Hall voltage in mV is', 1.83)\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.18, Page number 259"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the density and mobility of charge carrier\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nRH=-7.35*10**-5; #hall coefficient\ne=1.6*10**-19;\nsigma=200;\n\n#Calculation\nn=(-1/(RH*e));\nmew=sigma/(n*e);\n\n#Result\nprint(\"density of charge carriers in m^3 is\",n);\nprint(\"mobility of charge carriers in m^2/Vs is\",mew);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('density of charge carriers in m^3 is', 8.503401360544217e+22)\n('mobility of charge carriers in m^2/Vs is', 0.0147)\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.19, Page number 259"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the magnitude of Hall voltage\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nI=50; #current in amp\nB=1.5; #magnetic field in T\nn=8.4*10**28; #free electron concentration in electron/m^3\nt=0.5; #thickness in cm\ne=1.6*10**-19;\n\n#Calculation\nt=t*10**-2; #thickness in m\nVH=(I*B)/(n*e*t);\nVH=VH*10**6; #converting VH from V to micro V\nVH=math.ceil(VH*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"magnitude of Hall voltage in microVolt is\",VH);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('magnitude of Hall voltage in microVolt is', 1.1161)\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.20, Page number 260"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate mew and n\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nRH=3.66*10**-4;\ne=1.6*10**-19;\nrho_n=8.93*10**-3;\n\n#Calculation\nn=1/(RH*e);\nmew_e=RH/rho_n;\nmew_e=math.ceil(mew_e*10**5)/10**5 #rounding off to 5 decimals\n\n#Result\nprint(\"n per m^3 is\",n);\nprint(\"mew_e in m^2/V is\",mew_e);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('n per m^3 is', 1.7076502732240434e+22)\n('mew_e in m^2/V is', 0.04099)\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.21, Page number 260"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the conductivity and equilibrium hole concentration\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nmew_e=0.13; #electron mobility in m^2/Vs\nmew_h=0.048; #hole mobility in m^2/Vs\nni=1.5*10**16;\ne=1.6*10**-19;\nT=300; #temp in K\nND=10**23; #density per m^3\n\n#Calculation\nsigmai=ni*e*(mew_e+mew_h);\nsigma=ND*mew_e*e;\np=(ni**2)/ND;\nsigmai=math.ceil(sigmai*10**5)/10**5 #rounding off to 5 decimals\n\n#Result\nprint(\"conductivity of intrinsic Si in s is\",sigmai);\nprint(\"conductivity in s is\",sigma);\nprint(\"equilibrium hole concentration per m^3 is\",round(p));\n\n#answers for sigmai and sigma given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('conductivity of intrinsic Si in s is', 0.00043)\n('conductivity in s is', 2080.0)\n('equilibrium hole concentration per m^3 is', 2250000000.0)\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.22, Page number 261"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the forbidden energy gap\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nT=300; #temp in K\nkB=1.38*10**-23;\nmew_e=0.36; #mobility of electrons in m^2/Vs\ne=1.6*10**-19;\nmew_h=0.7; #mobility of electrons in m^2/Vs\nsigma=2.12; #conductivity in ohm-1 m-1\nC=4.83*10**21; #proportional constant\n\n#Calculation\nni=sigma/(e*(mew_e+mew_h));\n#exp(-Eg/(2*kB*T)) = (C*(T^(3/2)))/ni\n#let X be (C*(T^(3/2)))/ni\nX=(C*(T**(3/2)))/ni;\n#exp(-Eg/(2*kB*T)) = X \n#applyinf log on both sides\n#Eg/(2*kB*T) = log(X)\nEg=2*kB*T*math.log(X);\n\n#Result\nprint(\"forbidden energy gap in eV is\",Eg);\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('forbidden energy gap in eV is', 1.2016388762259164e-19)\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.23, Page number 261"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the probability of occupation\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEg=0.4; #energy gap in eV\nEg=Eg*1.6*10**-19; #Eg in J\nKB=1.38*10**-23;\nT1=0; #temp 1 in C\nT2=50; #temp 2 in C\nT3=100; #temp 3 in C\n\n#Calculation\nT1k=T1+273; #temp 1 in K\nT2k=T2+273; #temp 2 in K\nT3k=T3+273; #temp 3 in K\n#F(E) = 1/(1+(exp((E-Ep)/(KB*T))))\n#but E-Ep = (1/2)*Eg\n#therefore F(E) = 1/(1+(exp(Eg/(2*KB*T))))\nFE1=1/(1+(math.exp(Eg/(2*KB*T1k))));\nFE2=1/(1+(math.exp(Eg/(2*KB*T2k))));\nFE3=1/(1+(math.exp(Eg/(2*KB*T3k))));\nFE1=math.ceil(FE1*10**6)/10**6 #rounding off to 6 decimals\nFE2=math.ceil(FE2*10**6)/10**6 #rounding off to 6 decimals\nFE3=math.ceil(FE3*10**6)/10**6 #rounding off to 6 decimals\n\n#Result\nprint(\"probability of occupation at 0 C in eV is\",FE1);\nprint(\"probability of occupation at 50 C in eV is\",FE2);\nprint(\"probability of occupation at 100 C in eV is\",FE3);\n\n#answers given in the book are wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('probability of occupation at 0 C in eV is', 0.000205)\n('probability of occupation at 50 C in eV is', 0.000762)\n('probability of occupation at 100 C in eV is', 0.001992)\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.24, Page number 262"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the ratio between conductivity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEg=1.2; #energy in eV\nEg=Eg*1.6*10**-19; #in J\nKB=1.38*10**-23;\nT1=600; #temp in K\nT2=300; #temp in K\n\n#Calculation\n#sigma is proportional to exp(-Eg/(2*KB*T))\n#let sigma1/sigma2 be R\nR=math.exp((Eg/(2*KB))*((1/T2)-(1/T1)));\n\n#Result\nprint(\"the ratio between conductivity is\",round(R));\n\n#answer given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the ratio between conductivity is', 108467.0)\n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.25, Page number 263"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the resistivity of doped Ge\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nni=2.5*10**19; #density of charge carriers in m^3\nr=1/(10**6); #ratio\ne=1.6*10**-19;\nmew_e=0.36; #mobility of electrons in m^2/Vs\nmew_h=0.18; #mobility of holes in m^2/Vs\nN=4.2*10**28; #number of Si atoms per m^3\n\n#Calculation\nNe=r*N;\nNh=(ni**2)/Ne;\nsigma=(Ne*e*mew_e)+(Nh*e*mew_h);\nrho=1/sigma;\nrho=math.ceil(rho*10**8)/10**8 #rounding off to 8 decimals\n\n#Result\nprint(\"number of impurity atoms per m^3 is\",Ne);\nprint(\"the resistivity of doped Ge in ohm m is\",rho);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('number of impurity atoms per m^3 is', 4.2e+22)\n('the resistivity of doped Ge in ohm m is', 0.00041336)\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.26, Page number 264"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the conductivity of material\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn=5*10**17; #concentration in m^3\nvd=350; #drift velocity in m/s\nE=1000; #electric field in V/m\ne=1.6*10**-19;\n\n#Calculation\nmew=vd/E;\nsigma=n*e*mew;\nsigma=math.ceil(sigma*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"the conductivity of material in ohm m is\",sigma);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('the conductivity of material in ohm m is', 0.028)\n"
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.27, Page number 264"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the concentration\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nsigma_e=2.2*10**-4; #conductivity\nmew_e=125*10**-3; #mobility of electrons in m^2/Vs\ne=1.602*10**-19;\n\n#Calculation\nne=sigma_e/(e*mew_e);\n\n#Result\nprint(\"concentration in m^3 is\",ne);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('concentration in m^3 is', 1.0986267166042448e+16)\n"
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.28, Page number 265"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the mobility and density of charge carrier\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nRH=3.66*10**-4; #hall coefficient in m^3/c\nrho_i=8.93*10**-3; #resistivity in ohm m\ne=1.6*10**-19;\n\n#Calculation\nnh=1/(RH*e);\nmew_h=1/(rho_i*nh*e);\nmew_h=math.ceil(mew_h*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"density of charge carriers in m^3 is\",nh);\nprint(\"mobility of charge carriers is %f m^2/Vs\",mew_h);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('density of charge carriers in m^3 is', 1.7076502732240434e+22)\n('mobility of charge carriers is %f m^2/Vs', 0.041)\n"
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 7.29, Page number 265"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the Hall voltage and charge carrier concentration\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nI=3; #current in mA\nI=I*10**-3; #current in amp\ne=1.6*10**-19;\nRH=3.66*10**-4; #hall coefficient in m^3/C\nB=1; #flux density in w/m^2\nd=2; #dimension along Y in cm\nz=1; #dimension along z in mm\n\n#Calculation\nd=d*10**-2; #dimension along Y in m\nz=z*10**-3; #dimension along z in m\nA=d*z; #area in m^2\nEH=RH*I*B/A;\nVH=EH*d;\nVH=VH*10**3; #converting from V to mV\nn=1/(RH*e);\nVH=math.ceil(VH*10**2)/10**2 #rounding off to 2 decimals\n\n#Result\nprint(\"Hall voltage in mV is\",VH);\nprint(\"charge carrier concentration in m^3 is\",n);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('Hall voltage in mV is', 1.1)\n('charge carrier concentration in m^3 is', 1.7076502732240434e+22)\n"
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/chapter8_2.ipynb b/Engineering_Physics/chapter8_2.ipynb
new file mode 100644
index 00000000..c344140a
--- /dev/null
+++ b/Engineering_Physics/chapter8_2.ipynb
@@ -0,0 +1,133 @@
+{
+ "metadata": {
+ "name": "chapter8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Physics of Nano Materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.1, Page number 320"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the surface area to volume ratio\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=5; #radius in m\npi=3.14;\n\n#Calculation \nSA=4*pi*r**2; #surface area of sphere in m^2\nV=(4/3)*pi*r**3; #volume of sphere in m^3\nR=SA/V; #ratio\n#surface area to volume ratio can also be given by 3/radius\n\n#Result\nprint(\"surface area to volume ratio of sphere in m-1 is\",R);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('surface area to volume ratio of sphere in m-1 is', 0.6)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.2, Page number 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the surface area to volume ratio\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=26; #distance in m\nr=d/2; #radius in m\npi=3.14;\n\n#Calculation\nSA=4*pi*r**2; #surface area of sphere in m^2\nV=(4/3)*pi*r**3; #volume of sphere in m^3\nR=SA/V; #ratio\nR=math.ceil(R*10**3)/10**3; #rounding off to 3 decimals\n#surface area to volume ratio can also be given by 3/radius\n\n#Result\nprint(\"surface area to volume ratio of sphere in m-1 is\",R);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('surface area to volume ratio of sphere in m-1 is', 0.231)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.3, Page number 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the volume of cone\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=1; #radius in m\nh=1; #height in m\npi=3.14\n\n#Calculation\nV=(1/3)*pi*(r**2)*h;\nV=math.ceil(V*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"volume of cone in m^3 is\",V); ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('volume of cone in m^3 is', 1.05)\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.4, Page number 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the total surface area of cone\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=3; # radius in m\nh=4; # height in m\npi=3.14\n\n#Calculation\nSA=pi*r*math.sqrt((r**2)+(h**2));\nTSA=SA+(pi*r**2);\n\n#Result\nprint(\"total surface area of cone in m^2 is\",TSA);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('total surface area of cone in m^2 is', 75.36)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.5, Page number 322"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the height of cone\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nV=100; #volume of cone in cubic inches\nr=5; #radius of cone in inches\npi=3.14;\n\n#Calculation\nr_m=r*0.0254; #radius of cone in m\n#volume V=(1/3)*pi*(r**2)*h\n#therefore h = (3*V)/(pi*r**2)\nh=(3*V)/(pi*r**2); #height in inches\nR=3/r_m;\nh=math.ceil(h*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"height of the cone in inches is\",h);\nprint(\"surface area to volume ratio in m-1 is\",R);\n\n#answer for the surface area to volume ratio given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('height of the cone in inches is', 3.822)\n('surface area to volume ratio in m-1 is', 23.62204724409449)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics/screenshots/Capture1.png b/Engineering_Physics/screenshots/Capture1.png
new file mode 100644
index 00000000..b8e54e85
--- /dev/null
+++ b/Engineering_Physics/screenshots/Capture1.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/Capture2.png b/Engineering_Physics/screenshots/Capture2.png
new file mode 100644
index 00000000..74b4cf73
--- /dev/null
+++ b/Engineering_Physics/screenshots/Capture2.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/Untitled.png b/Engineering_Physics/screenshots/Untitled.png
new file mode 100644
index 00000000..86bbbd1e
--- /dev/null
+++ b/Engineering_Physics/screenshots/Untitled.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/Untitled1.png b/Engineering_Physics/screenshots/Untitled1.png
new file mode 100644
index 00000000..f9ffad82
--- /dev/null
+++ b/Engineering_Physics/screenshots/Untitled1.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/Untitled3.png b/Engineering_Physics/screenshots/Untitled3.png
new file mode 100644
index 00000000..f06b09bb
--- /dev/null
+++ b/Engineering_Physics/screenshots/Untitled3.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/Untitled_1.png b/Engineering_Physics/screenshots/Untitled_1.png
new file mode 100644
index 00000000..cb197fae
--- /dev/null
+++ b/Engineering_Physics/screenshots/Untitled_1.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/Untitled_2.png b/Engineering_Physics/screenshots/Untitled_2.png
new file mode 100644
index 00000000..cb197fae
--- /dev/null
+++ b/Engineering_Physics/screenshots/Untitled_2.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/capture.png b/Engineering_Physics/screenshots/capture.png
new file mode 100644
index 00000000..b105e148
--- /dev/null
+++ b/Engineering_Physics/screenshots/capture.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/screenshot1.PNG b/Engineering_Physics/screenshots/screenshot1.PNG
new file mode 100644
index 00000000..419ba452
--- /dev/null
+++ b/Engineering_Physics/screenshots/screenshot1.PNG
Binary files differ
diff --git a/Engineering_Physics/screenshots/screenshot1.png b/Engineering_Physics/screenshots/screenshot1.png
new file mode 100644
index 00000000..94f80068
--- /dev/null
+++ b/Engineering_Physics/screenshots/screenshot1.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/screenshot2.PNG b/Engineering_Physics/screenshots/screenshot2.PNG
new file mode 100644
index 00000000..bf169152
--- /dev/null
+++ b/Engineering_Physics/screenshots/screenshot2.PNG
Binary files differ
diff --git a/Engineering_Physics/screenshots/screenshot2.png b/Engineering_Physics/screenshots/screenshot2.png
new file mode 100644
index 00000000..f4cda54b
--- /dev/null
+++ b/Engineering_Physics/screenshots/screenshot2.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/screenshot3.PNG b/Engineering_Physics/screenshots/screenshot3.PNG
new file mode 100644
index 00000000..4062fb31
--- /dev/null
+++ b/Engineering_Physics/screenshots/screenshot3.PNG
Binary files differ
diff --git a/Engineering_Physics/screenshots/screenshot3.png b/Engineering_Physics/screenshots/screenshot3.png
new file mode 100644
index 00000000..4367a009
--- /dev/null
+++ b/Engineering_Physics/screenshots/screenshot3.png
Binary files differ
diff --git a/Engineering_Physics/screenshots/shot1.PNG b/Engineering_Physics/screenshots/shot1.PNG
new file mode 100644
index 00000000..7e165764
--- /dev/null
+++ b/Engineering_Physics/screenshots/shot1.PNG
Binary files differ
diff --git a/Engineering_Physics/screenshots/shot2.PNG b/Engineering_Physics/screenshots/shot2.PNG
new file mode 100644
index 00000000..c4b3d4ef
--- /dev/null
+++ b/Engineering_Physics/screenshots/shot2.PNG
Binary files differ
diff --git a/Engineering_Physics/screenshots/shot3.PNG b/Engineering_Physics/screenshots/shot3.PNG
new file mode 100644
index 00000000..e14ec109
--- /dev/null
+++ b/Engineering_Physics/screenshots/shot3.PNG
Binary files differ
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/README.txt b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/README.txt
new file mode 100644
index 00000000..3d9a2b47
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ashutosh Kumar
+Course: btech
+College/Institute/Organization: Indian Institute of Technology - Bombay, CHAR Lab 2
+Department/Designation: Electrical Department
+Book Title: Engineering Thermodynamics: A Computer Approach (SI Units Version)
+Author: R. K. Rajput
+Publisher: Laxmi Pulications (P) Ltd., New Delhi
+Year of publication: 2007
+Isbn: 9780763782726
+Edition: 3rd \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch1.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch1.ipynb
new file mode 100644
index 00000000..f6589ebe
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch1.ipynb
@@ -0,0 +1,250 @@
+{
+ "metadata": {
+ "name": "ch1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\"\"\"\nExample 1.1\n\"\"\"\nprint \"Hello, World!\\n\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello, World!\n\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 1.2\nprints 'hello world' with comments.\n'''\n\n# prints \"Hello, World!\":\nprint \"Hello, World!\\n\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello, World!\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nexample 1.3\nanother version of hello world.\n'''\n\n# prints \"Hello, World!\":\nprint \"Hel\" + \"lo, Wo\" + \"rld!\" \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello, World!\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\"\"\"\nexample 1.4\nanother version of hello world.\n\"\"\"\n\n# prints \"Hello, World!\":\nprint \"Hello, W\" + 'o' + \"rld\" + '!' ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello, World!\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.5 Inserting Numeric Literals into the Standard Output Stream\n'''\n\n# prints \"The Millennium ends Dec 31 2000.\":\nprint \"The Millennium ends Dec %d %d \" %(31,2000)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Millennium ends Dec 31 2000 \n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.6 Using Integer Variables\nIn this example, the integer 44 is assigned to the variable m, and the value of the expression m + 33\nis assigned to the variable n:\n'''\n# prints \"m = 44 and n = 77\":\n\nm = 44 # assigns the value 44 to the variable m\nprint \"m = %d \" % m,\nn = m + 33 # assigns the value 77 to the variable n\nprint \"and n = %d \" % n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "m = 44 and n = 77 \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.7 A Program's Tokens\n'''\n\n# prints \"n = 44:\nn=44\nprint \"n = %d\" % n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 44\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.8 \n'''\n\n# Python does not have semicolons so wont give any errors.\nn=44\nprint \"n = %d\" % n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 44\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.9 Initializing Variables\nThis program contains one variable that is not initialized and one that is initialized.\nNote : This program would give you differ output then c gives.\n'''\n\n# prints \"m = ?? and n = 44\":\nm = 0 #In python we do not have declaration of variables, we just initialize it and use it.\nn=44\nprint \"m = %d and n = %d\" %(m,n)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "m = 0 and n = 44\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.10 The const Specifier\nThis program illustrates constant definitions:\n'''\n\n# defines constants; has no output:\nBEEP = '\\b'\nMAXINT = 2147483647\nN = MAXINT/2\nKM_PER_MI = 1.60934\nPI = 3.14159265358979323846\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 1.11 Using the Input Operator\n'''\n\n# tests the input of integers, floats, and characters:\nprint \"Enter two integers: \"\nm = int(raw_input())\nn = int(raw_input())\nprint \"m = %d , n = %d \" %(m,n)\n\nprint \"Enter three decimal numbers: \"\nx = float(raw_input())\ny = float(raw_input())\nz = float(raw_input())\n\nprint \"x = %f , y = %f , z = %f\" %(x,y,z)\n\nprint \"Enter four characters: \";\nc1 = raw_input()\nc2 = raw_input()\nc3 = raw_input()\nc4 = raw_input()\nprint \"c1 = \" + c1 + \", c2 = \" + c2 + \", c3 = \" + c3 + \", c4 = \" + c4 ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "m = 22 , n = 44 \nEnter three decimal numbers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2.2\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4.4\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "6.6\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 2.200000 , y = 4.400000 , z = 6.600000\nEnter four characters: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "A\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "B\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "C\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "D\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "c1 = A, c2 = B, c3 = C, c4 = D\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch10.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch10.ipynb
new file mode 100644
index 00000000..4b6ac8a8
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch10.ipynb
@@ -0,0 +1,286 @@
+{
+ "metadata": {
+ "name": "ch10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.1 Implementing the Ratio Class\n'''\nclass Ratio:\n def __init__(self):\n self.num = 0\n self.den = 0\n def assign(self,n,d):\n self.num = n\n self.den = d\n def convert(self):\n return float(self.num)/self.den\n def invert(self):\n self.num,self.den = self.den,self.num\n def print_(self):\n print self.num , '/' , self.den ,\n \nx = Ratio()\nx.assign(22,7)\nprint \"x = \",\nx.print_()\nprint \" = \" , x.convert() \nx.invert()\nprint \"1/x = \",\nx.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 22 / 7 = 3.14285714286\n1/x = 7 / 22\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.2 Class example\n'''\nclass Ratio:\n def __init__(self):\n self.num = 0\n self.den = 0\n def assign(self,n,d):\n self.num = n\n self.den = d\n def convert(self):\n return float(self.num)/self.den\n def invert(self):\n self.num,self.den = self.den,self.num\n def print_(self):\n print self.num , '/' , self.den ,\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.3\nA Constructor Function for the Ratio Class\n'''\nclass Ratio:\n def __init__(self,n,d):\n self.num = n\n self.den = d\n def print_(self):\n print self.num , '/' , self.den ,\n\nx = Ratio(-1,3)\ny = Ratio(22,7)\nprint \"x = \",\nx.print_()\nprint \" and y = \",\ny.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = -1 / 3 and y = 22 / 7\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.4 Constructors to the Ratio Class\n'''\nclass Ratio:\n def __init__(self,n=None,d=None):\n if n==None:\n self.num = 0\n self.den = 1\n elif d==None:\n self.num = n\n self.den = 1\n else:\n self.num = n\n self.den = d\n def print_(self):\n print self.num , '/' , self.den ,\n\nx = Ratio()\ny = Ratio(4)\nz = Ratio(22,7)\nprint \"x = \",\nx.print_()\nprint \"\\ny = \",\ny.print_()\nprint \"\\nz = \",\nz.print_()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 0 / 1 \ny = 4 / 1 \nz = 22 / 7\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.5\n'''\nclass Ratio:\n def __init__(self,n=None,d=None):\n if n==None:\n self.num = 0\n self.den = 1\n elif d==None:\n self.num = n\n self.den = 1\n else:\n self.num = n\n self.den = d\n def print_(self):\n print self.num , '/' , self.den ,\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.6 Using Default Parameter Values in the Ratio Class Constructor\n'''\n\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n def print_(self):\n print self.num , '/' , self.den ,\n\n\nx = Ratio()\ny = Ratio(4)\nz = Ratio(22,7)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.7 Access Functions in the Ratio Class\n'''\n\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n def numerator(self):\n return self.num\n def denominator(self):\n return self.den\n def print_(self):\n print self.num , '/' , self.den ,\n\n\nx = Ratio(22,7)\nprint x.numerator() , '/' , x.denominator() ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22 / 7\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.8\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\n\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n self.reduce()\n def numerator(self):\n return self.num\n def denominator(self):\n return self.den\n def print_(self):\n print self.num , '/' , self.den ,\n\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\nx = Ratio(100,-360)\nx.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-5 / 18\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.9 Adding a Copy Constructor to the Ratio Class\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\n\nclass Ratio:\n def __init__(self,n=0,d=None):\n if d == None:\n self.num = n.num\n self.den = n.den\n else: \n self.num = n\n self.den = d\n self.reduce()\n def numerator(self):\n return self.num\n def denominator(self):\n return self.den\n def print_(self):\n print self.num , '/' , self.den ,\n\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\nx = Ratio(100,360)\ny = Ratio(x)\nprint \"x = \",\nx.print_()\nprint \"y = \",\ny.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 5 / 18 y = 5 / 18\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.10 Tracing Calls to the Copy Constructor\n'''\n'''\nEXAMPLE 10.9 Adding a Copy Constructor to the Ratio Class\n'''\n'''\nEXAMPLE 10.8\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\n\nclass Ratio:\n def __init__(self,n=0,d=None):\n if d == None:\n print \"COPY CONSTRUCTOR CALLED\"\n self.num = n.num\n self.den = n.den\n else: \n self.num = n\n self.den = d\n self.reduce()\n def numerator(self):\n return self.num\n def denominator(self):\n return self.den\n def print_(self):\n print self.num , '/' , self.den ,\n\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\ndef f(r):\n s = Ratio(r)\n\nx = Ratio(22,7)\ny = Ratio(x) #calls the copy constructor, copying x to y\nf(y)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "COPY CONSTRUCTOR CALLED\nCOPY CONSTRUCTOR CALLED\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.11 Including a Destructor in the Ratio Class\nNote : Python objects die when program gets exit.\n'''\n\nclass Ratio:\n def __init__(self):\n print \"OBJECT IS BORN.\"\n def __del__(self):\n print \"OBJECT DIES.\"\n\nx = Ratio()\nprint \"Now x is alive.\"\nprint \"Now between blocks.\"\ny = Ratio()\nprint \"Now y is alive.\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "OBJECT IS BORN.\nNow x is alive.\nNow between blocks.\nOBJECT IS BORN.\nNow y is alive.\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.12\n'''\nclass X:\n def __init(self):\n data = 0\n\np = X()\np.data = 22\nprint \"p.data = \" , p.data , \" = \" , p.data\np.data = 44\nprint \" p.data = \" , p.data , \" = \" , p.data ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "p.data = 22 = 22\n p.data = 44 = 44\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.13 A Node Class for Linked Lists\n'''\nclass Node:\n def __init__(self,d,q=None):\n self.data = d\n self.next = q\n\nn = int(raw_input())\nq = Node(n)\nwhile True:\n n = int(raw_input())\n if n<=0:\n break\n p = Node(n, q)\n q = p\nk = p\nwhile k != None:\n print k.data , '->' , \n k = k.next\nprint '*'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "66\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77 -> 66 -> 55 -> 44 -> 33 -> 22 -> *\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.14 \nPython does not support static data type.\nPython automatically handles local variable so we need not to delete it.\n'''\ncount = 0\nclass Widget:\n def __init__(self):\n global count\n count += 1\n \nw = Widget()\nx = Widget()\nprint \"Now there are \" , count , 'widgets'\nif True:\n w = Widget()\n x = Widget()\n y = Widget()\n z = Widget()\n print \"Now there are\" , count , 'widgets' \nprint \"Now there are \" , count , 'widgets'\ny = Widget()\nprint \"Now there are \" , count , 'widgets'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "OBJECT DIES.\nNow there are 2 widgets\nOBJECT DIES.\nNow there are 6 widgets\nNow there are 6 widgets\nNow there are 7 widgets\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.15 \n'''\ncount = 0\nclass Widget:\n def __init__(self):\n global count\n count += 1\n def numWidgets(self):\n global count\n return count\n \nw = Widget()\nx = Widget()\nprint \"Now there are \" , w.numWidgets() , 'widgets'\nif True:\n w = Widget()\n x = Widget()\n y = Widget()\n z = Widget()\n print \"Now there are\" , w.numWidgets() , 'widgets' \nprint \"Now there are \" , w.numWidgets() , 'widgets'\ny = Widget()\nprint \"Now there are \" , w.numWidgets() , 'widgets'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Now there are 2 widgets\nNow there are 6 widgets\nNow there are 6 widgets\nNow there are 7 widgets\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 10.16\n'''\ncount = 0\nclass Widget:\n def __init__(self):\n global count\n count += 1\n def numWidgets(self):\n global count\n return count\n \nw = Widget()\nx = Widget()\nprint \"Now there are \" , w.numWidgets() , 'widgets'\nif True:\n w = Widget()\n x = Widget()\n y = Widget()\n z = Widget()\n print \"Now there are\" , w.numWidgets() , 'widgets' \nprint \"Now there are \" , w.numWidgets() , 'widgets'\ny = Widget()\nprint \"Now there are \" , w.numWidgets() , 'widgets'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Now there are 2 widgets\nNow there are 6 widgets\nNow there are 6 widgets\nNow there are 7 widgets\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch11.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch11.ipynb
new file mode 100644
index 00000000..3ddc5480
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch11.ipynb
@@ -0,0 +1,211 @@
+{
+ "metadata": {
+ "name": "ch11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.1\nAdding an Assignment Operator to the Ratio Class\nHere is a class interface for the Ratio class, showing the default constructor, the copy constructor,\nand the assignment operator:\n'''\nclass Ratio:\n def __init__(self,n=None,d=None):\n if d==None:\n self.num = n.num\n self.den = n.den\n elif n==None:\n self.num = 0\n self.den = 1\n else:\n self.num = n\n self.den = d\n \n def equals(self):\n return self # retuns calling object.",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.2 The Preferred Prototype for an Overloaded Assignment Operator\n'''\nclass Ratio:\n def __init__(self,n=None,d=None):\n pass\n \n def equals(self):\n pass\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.3 Implementation of the Assignment Operator for the Ratio Class\n'''\nclass Ratio:\n def __init__(self,n=None,d=None):\n if d==None:\n self.num = n.num\n self.den = n.den\n elif n==None:\n self.num = 0\n self.den = 1\n else:\n self.num = n\n self.den = d\n \n\nz = Ratio(22,7)\ny = z\nx = z\n\nx = Ratio(22,7)\ny = Ratio(x)\nz = x\nw = x",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.4\nmultiplication operator overload\n'''\n\nclass Ratio:\n def __init__(self,n=None,d=None):\n self.num = n\n self.den = d\n def __mul__(self,y):\n pass\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.5 The Ratio Class with Assignment and Multiplication Operators\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\n\n\nclass Ratio:\n def __init__(self,n=None,d=None):\n self.num = n\n self.den = d\n self.reduce()\n def __mul__(self,y):\n z = Ratio(self.num * y.num, self.den * y.den)\n return z\n def print_(self):\n print self.num , '/', self.den\n \n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\nx = Ratio(22,7)\ny = Ratio(-3,8)\nz = x\nz.print_()\nx = y*z\nx.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22 / 7\n-33 / 28\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.6 The Ratio Class with an Overloaded *= Operator\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\n\n\nclass Ratio:\n def __init__(self,n=None,d=None):\n self.num = n\n self.den = d\n self.reduce()\n def __imul__(self,y):\n self.num = self.num * y.num\n self.den = self.den * y.den\n def print_(self):\n print self.num , '/', self.den",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.7 Overloading the Equality Operator == in the Ratio Class\n'''\n\nclass Ratio:\n def __init__(self,n=None,d=None):\n self.num = n\n self.den = d\n self.reduce()\n def __imul__(self,y):\n self.num = self.num * y.num\n self.den = self.den * y.den\n def __eq__(self,y):\n return (x.num * y.den == y.num * x.den)\n def print_(self):\n print self.num , '/', self.den\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.8 \nPython does not use << operator for printing. So here we are just declaring function name as print_.\n'''\n\nclass Ratio:\n def __init__(self,n=None,d=None):\n self.num = n\n self.den = d\n def __imul__(self,y):\n self.num = self.num * y.num\n self.den = self.den * y.den\n def __eq__(self,y):\n return (x.num * y.den == y.num * x.den)\n def print_(self):\n print self.num , '/', self.den\n\n\nx = Ratio(22,7)\ny = Ratio(-3,8)\nx.print_() , y.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22 / 7\n-3 / 8\n"
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 8,
+ "text": "(None, None)"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.9 \nPython does not have >> for input. so we will use input function.\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n self.reduce()\n def __mul__(self,y):\n z = Ratio(self.num * y.num, self.den * y.den)\n return z\n def print_(self):\n print self.num , '/', self.den\n \n def input(self):\n self.num = int(raw_input('Numerator : '))\n self.den = int(raw_input('Denominator : '))\n self.reduce()\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\n\nx = Ratio()\ny = Ratio()\nx.input()\ny.input()\nx.print_()\ny.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Numerator : -10\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Denominator : -24\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Numerator : 36\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Denominator : -20\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5 / 12\n-9 / 5\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.10\nAdding a Conversion Operator to the Ratio Class\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n self.reduce()\n def __mul__(self,y):\n z = Ratio(self.num * y.num, self.den * y.den)\n return z\n def print_(self):\n print self.num , '/', self.den\n \n def input(self):\n self.num = int(raw_input('Numerator : '))\n self.den = int(raw_input('Denominator : '))\n self.reduce()\n def __float__(self):\n return float(self.num)/self.den\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 15.py\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\nx = Ratio(-5,8)\nprint \"x = \" , \nx.print_() \nprint \", float(x) = \" , float(x) \nP = Ratio(22,7)\nPI = float(P)\nprint \"P = \" ,\nP.print_() \nprint \", PI = \" , PI\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = -5 / 8\n, float(x) = -0.625\nP = 22 / 7\n, PI = 3.14285714286\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.11 Adding a Pre-Increment Operator to the Ratio Class\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n self.reduce()\n def __mul__(self,y):\n z = Ratio(self.num * y.num, self.den * y.den)\n return z\n def print_(self):\n print self.num , '/', self.den\n \n def __iadd__(self,n):\n self.num += self.den\n return self\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\nx = Ratio(22,7)\nx += 1\ny = x\nprint \"y = \" ,\ny.print_()\nprint \", x = \",\nx.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "y = 29 / 7\n, x = 29 / 7\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.12 Adding a Post-Increment Operator to the Ratio Class\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n self.reduce()\n def __mul__(self,y):\n z = Ratio(self.num * y.num, self.den * y.den)\n return z\n def print_(self):\n print self.num , '/', self.den\n \n def __iadd__(self,n):\n self.num += self.den\n return self\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\nx = Ratio(22,7)\ny = Ratio(x.num,x.den)\nx += 1\nprint \"y = \" ,\ny.print_()\nprint \", x = \",\nx.print_()\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "y = 22 / 7\n, x = 29 / 7\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 11.13\nAdding a Subscript Operator to the Ratio Class\n'''\ndef gcd(m,n):\n # returns the greatest common divisor of m and n:\n if (m<n):\n m,n = n,m\n while (n>0):\n r = m % n\n m = n\n n = r\n return m\nclass Ratio:\n def __init__(self,n=0,d=1):\n self.num = n\n self.den = d\n self.reduce()\n def __mul__(self,y):\n z = Ratio(self.num * y.num, self.den * y.den)\n return z\n def print_(self):\n print self.num , '/', self.den\n \n def __getitem__(self,k):\n if k == 1:\n return self.num\n else:\n return self.den\n def reduce(self):\n # enforce invariant(den > 0):\n if (self.num == 0 or self.den == 0):\n self.num = 0\n self.den = 1\n return\n if (self.den < 0):\n self.den *= -1\n self.num *= -1\n # enforce invariant(gcd(num,den) == 1):\n if (self.den == 1):\n return\n # it's already reduced\n sgn = 0\n if self.num < 0:\n sgn = -1\n else:\n sgn = 1\n g = gcd(sgn*self.num,self.den)\n self.num /= g\n self.den /= g\n\nx = Ratio(22,7)\nprint \"x = \" ,\nx.print_()\nprint \"x[1] = \" , x[1] , \", x[2] = \" , x[2]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 22 / 7\nx[1] = 22 , x[2] = 7\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch12.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch12.ipynb
new file mode 100644
index 00000000..304a3ccb
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch12.ipynb
@@ -0,0 +1,228 @@
+{
+ "metadata": {
+ "name": "ch12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.1 A Person Class\nHere is a simple definition for a class to represent people.\n'''\nclass Person:\n def __init__(self,n=\"\",nat=\"U.S.A.\",s=1):\n self.name = n\n self.nationality = nat\n self.sex = s\n\n def printName(self):\n print self.name,\n \n def printNationality(self):\n print self.nationality,\n\ncreator = Person(\"Bjarne Stroustrup\", \"Denmark\")\nprint \"The creator of C++ was \" ,\ncreator.printName() \nprint \", who was born in \" ,\ncreator.printNationality() \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The creator of C++ was Bjarne Stroustrup , who was born in Denmark\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.2 A Date Class\n'''\n\nclass Date:\n def __init__(self,m=0,d=0,y=0):\n self.month = m\n self.day = d\n self.year = y\n \n def setDate(self,m,d,y):\n self.month = m\n self.day = d\n self.year = y\n # Python doesn't have >> operator for input so we are just using input function\n def input(self):\n self.month = int(raw_input()) \n self.day = int(raw_input())\n self.year = int(raw_input()) \n \n # Python doesn't have << operator for output so we are just using print function\n def print_(self):\n monthName = [\"\", \"January\",\"February\",\"March\", \"April\", \"May\", \"June\",\\\n \"July\", \"August\",\"September\", \"October\", \"November\",\\\n \"December\"]\n print monthName[self.month] , self.day , \",\" , self.year\n\npeace = Date(11,11,1918)\nprint \"World War I ended on \" ,\npeace.print_()\npeace.setDate(8,14,1945)\nprint \"World War II ended on \" ,\npeace.print_()\nprint \"Enter month, day, and year: \"\ndate = Date()\ndate.input()\nprint \"The date is \" , \ndate.print_()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "World War I ended on November 11 , 1918\nWorld War II ended on August 14 , 1945\nEnter month, day, and year: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1976\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The date is July 4 , 1976\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.3 Composing the Date Class with the Person Class\n'''\nclass Date:\n def __init__(self,m=0,d=0,y=0):\n self.month = m\n self.day = d\n self.year = y\n \n def setDate(self,m,d,y):\n self.month = m\n self.day = d\n self.year = y\n # Python doesn't have >> operator for input so we are just using input function\n def input(self):\n self.month = int(raw_input()) \n self.day = int(raw_input())\n self.year = int(raw_input()) \n \n # Python doesn't have << operator for output so we are just using print function\n def print_(self):\n monthName = [\"\", \"January\",\"February\",\"March\", \"April\", \"May\", \"June\",\\\n \"July\", \"August\",\"September\", \"October\", \"November\",\\\n \"December\"]\n print monthName[self.month] , self.day , \",\" , self.year\n\nclass Person:\n def __init__(self,n=\"\",s=0,nat=\"U.S.A.\"):\n self.name = n\n self.nationality = nat\n self.sex = s\n self.dob = Date()\n self.dod = Date()\n def setDOB(self,m,d,y):\n self.dob.setDate(m,d,y)\n def setDOD(self,m,d,y):\n self.dod.setDate(m,d,y)\n def printName(self):\n print self.name,\n def printNationality(self):\n print self.nationality,\n def printDOB(self):\n self.dob.print_()\n def printDOD(self):\n self.dod.print_()\n\nauthor = Person(\"Thomas Jefferson\", 1)\nauthor.setDOB(4,13,1743)\nauthor.setDOD(7,4,1826)\nprint \"The author of the Declaration of Independence was \",\nauthor.printName()\nprint \".\\nHe was born on \",\nauthor.printDOB()\nprint \" and died on \",\nauthor.printDOD()\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The author of the Declaration of Independence was Thomas Jefferson .\nHe was born on April 13 , 1743\n and died on July 4 , 1826\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.4 Deriving a Student Class from the Person Class\nStudents are people. So it is natural to use the Person class to derive a Student class\n'''\nclass Date:\n def __init__(self,m=0,d=0,y=0):\n self.month = m\n self.day = d\n self.year = y\n \n def setDate(self,m,d,y):\n self.month = m\n self.day = d\n self.year = y\n # Python doesn't have >> operator for input so we are just using input function\n def input(self):\n self.month = int(raw_input()) \n self.day = int(raw_input())\n self.year = int(raw_input()) \n \n # Python doesn't have << operator for output so we are just using print function\n def print_(self):\n monthName = [\"\", \"January\",\"February\",\"March\", \"April\", \"May\", \"June\",\\\n \"July\", \"August\",\"September\", \"October\", \"November\",\\\n \"December\"]\n print monthName[self.month] , self.day , \",\" , self.year\n\nclass Person:\n def __init__(self,n=\"\",s=0,nat=\"U.S.A.\"):\n self.name = n\n self.nationality = nat\n self.sex = s\n self.dob = Date()\n self.dod = Date()\n def setDOB(self,m,d,y):\n self.dob.setDate(m,d,y)\n def setDOD(self,m,d,y):\n self.dod.setDate(m,d,y)\n def printName(self):\n print self.name,\n def printNationality(self):\n print self.nationality,\n def printDOB(self):\n self.dob.print_()\n def printDOD(self):\n self.dod.print_()\n\nclass Student(Person):\n def __init__(self,n,s=0,i=\"\"):\n Person.__init__(self,n,s)\n self.id = i\n self.credits = 0\n self.gpa = 0\n self.dom = Date()\n\n def setDOM(self,m,d,y):\n self.dom.setDate(m, d, y)\n def printDOM(self):\n self.dom.print_()\n\nx = Student(\"Ann Jones\", 0, \"219360061\")\nx.setDOB(5, 13, 1977)\nx.setDOM(8, 29, 1995)\nx.printName()\nprint \"\\n\\t Born: \" ,\nx.printDOB()\nprint \"\\n\\tMatriculated: \",\nx.printDOM()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Ann Jones \n\t Born: May 13 , 1977\n\n\tMatriculated: August 29 , 1995\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.5 The Person Class\n'''\nclass Date:\n def __init__(self,m=0,d=0,y=0):\n self.month = m\n self.day = d\n self.year = y\n \n def setDate(self,m,d,y):\n self.month = m\n self.day = d\n self.year = y\n # Python doesn't have >> operator for input so we are just using input function\n def input(self):\n self.month = int(raw_input()) \n self.day = int(raw_input())\n self.year = int(raw_input()) \n \n # Python doesn't have << operator for output so we are just using print function\n def print_(self):\n monthName = [\"\", \"January\",\"February\",\"March\", \"April\", \"May\", \"June\",\\\n \"July\", \"August\",\"September\", \"October\", \"November\",\\\n \"December\"]\n print monthName[self.month] , self.day , \",\" , self.year\n\nclass Person:\n def __init__(self,n=\"\",s=0,nat=\"U.S.A.\"):\n self.name = n\n self.nationality = nat\n self.sex = s\n self.dob = Date()\n self.dod = Date()\n def setDOB(self,m,d,y):\n self.dob.setDate(m,d,y)\n def setDOD(self,m,d,y):\n self.dod.setDate(m,d,y)\n def printName(self):\n print self.name,\n def printNationality(self):\n print self.nationality,\n def printDOB(self):\n self.dob.print_()\n def printDOD(self):\n self.dod.print_()\n\nclass Student(Person):\n def __init__(self,n,s=0,i=\"\"):\n Person.__init__(self,n,s)\n self.id = i\n self.credits = 0\n self.gpa = 0\n self.dom = Date()\n\n def setDOM(self,m,d,y):\n self.dom.setDate(m, d, y)\n def printDOM(self):\n self.dom.print_()\n def printSex(self):\n if self.sex == 1:\n print \"male\"\n else:\n print 'female'\n\nx = Student(\"Ann Jones\", 0, \"219360061\")\nx.setDOB(5, 13, 1977)\nx.setDOM(8, 29, 1995)\nx.setDOD(7,4,1826)\nx.printName()\nprint \"\\n\\t Born: \" , \nx.printDOB()\nprint \"\\n\\t Sex: \" ,\nx.printSex()\nprint \"\\n\\tMatriculated: \",\nx.printDOM()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Ann Jones \n\t Born: May 13 , 1977\n\n\t Sex: female\n\n\tMatriculated: August 29 , 1995\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.6 Dominating a Data Member and Overriding a Member Function\nHere are two classes, X and Y, with Y inheriting from X.\n'''\nclass X:\n def __init__(self):\n self.a = 0\n def f(self):\n print \"X::f() executing\"\nclass Y(X):\n def __init__(self):\n self.a = 0\n def f(self):\n print \"Y::f() executing\"\nx = X()\nx.a = 22\nx.f()\nprint \"x.a = \" , x.a\ny = Y()\ny.a = 44\n# assigns 44 to the a defined in Y\ny._X__a = 66\n# assigns 66 to the a defined in X\ny.f()\n# invokes the f() defined in Y\nX.f(x)\n# invokes the f() defined in X\nprint \"y.a = \" , y.a \nprint \"y._X__a = \" , y._X__a \nz = y\nprint \"z.a = \" , z._X__a \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "X::f() executing\nx.a = 22\nY::f() executing\nX::f() executing\ny.a = 44\ny._X__a = 66\nz.a = 66\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.7 Parent Constructors and Destructors\nNote : Python destuctor is called when program goes exit. So output may be differ than c.\n'''\nclass X:\n def __init__(self):\n print \"X::X() constructor executing \"\n def __del__(self):\n print \"X::X() destructor executing \"\n\nclass Y(X):\n def __init__(self):\n X.__init__(self)\n print \"Y::Y() constructor executing \"\n def __del__(self):\n print \"Y::Y() destructor executing \"\n\nclass Z(Y):\n def __init__(self,i):\n Y.__init__(self)\n print \"Z::Z(\" , i , \") constructor executing \"\n def __del__(self):\n print \"Z::Z() destructor executing \"\n \n\nZ = Z(44)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "X::X() constructor executing \nY::Y() constructor executing \nZ::Z( 44 ) constructor executing \n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.8 Parent Constructors and Destructors\nHere is a demo program that uses a base class Person and a derived class Student:\nNote : Python destuctor is called when program goes exit. So output may be differ than c.\n'''\nclass Person:\n def __init__(self,s):\n self.name = s\n def __del__(self):\n pass\n\nclass Student(Person):\n def __init__(self,s,m):\n Person.__init__(self,s)\n self.major = m\n def __del__(self):\n pass\nx = Person(\"Bob\")\ny = Student(\"Sarah\", \"Biology\")\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.9\n'''\nclass Person:\n def __init__(self,n=\"\",s=0,nat=\"U.S.A.\"):\n self.name = n\n self.nationality = nat\n self.sex = s\n self.dob = Date()\n self.dod = Date()\n def setDOB(self,m,d,y):\n self.dob.setDate(m,d,y)\n def setDOD(self,m,d,y):\n self.dod.setDate(m,d,y)\n def printName(self):\n print self.name,\n def printNationality(self):\n print self.nationality,\n def printDOB(self):\n self.dob.print_()\n def printDOD(self):\n self.dod.print_()\n def setHSgraduate(self,g):\n self.hs = g\n def isHSgraduate(self):\n return hs\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.10 Using virtual Functions\nThis demo program declares p to be a pointer to objects of the base class X. First it assigns p to\npoint to an instance x of class X. Then it assigns p to point to an instance y of the derived class Y.\nNote : By default all methods in python are virtual. so output would be differ than c.\n'''\nclass X:\n def f(self):\n print \"X::f() executing\"\nclass Y(X):\n def f(self):\n print \"Y::f() executing\"\nx = X()\ny = Y()\np = x\np.f()\np = y\np.f()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "X::f() executing\nY::f() executing\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.11 Polymorphism through virtual Functions\nHere is a Person class with a Student subclass and a Professor subclass:\n'''\nclass Person:\n def __init__(self,n):\n self.name = n\n def print_(self):\n print 'My name is' , self.name\n\nclass Student(Person):\n def __init__(self,s,g):\n Person.__init__(self,s)\n self.gpa = g\n def print_(self):\n print 'My name is ',self.name, ' and my G.P.A. is', self.gpa\n\nclass Professor(Person):\n def __init__(self,s,n):\n Person.__init__(self,s)\n self.publs = n\n def print_(self):\n print 'My name is ', self.name,' and i have ' , self.publs,' publications.'\n\nx = Person(\"Bob\")\np = x\np.print_()\ny = Student(\"Tom\", 3.47)\np = y\np.print_()\nz = Professor(\"Ann\", 7)\np = z\np.print_()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "My name is Bob\nMy name is Tom and my G.P.A. is 3.47\nMy name is Ann and i have 7 publications.\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.12 Memory Leaks\nThis program is similar to Example 12.6:\n'''\nclass X:\n def __init__(self):\n self.p = [0,0]\n print 'X().',\n def __del__(self):\n print '~X().'\n\nclass Y(X):\n def __init__(self):\n X.__init__(self)\n self.q = []\n for i in range(1023):\n self.q.append(0)\n print 'Y() : Y::q = ', hex(id(self.q)) ,'.',\n def __del__(self):\n print '~Y().'\n\nfor i in range(8):\n r = Y()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "X(). Y() : Y::q = 0x90d91cc . ~Y().\nX(). Y() : Y::q = 0x90c944c . ~Y().\nX(). Y() : Y::q = 0x90d91cc . ~Y().\nX(). Y() : Y::q = 0x90c944c . ~Y().\nX(). Y() : Y::q = 0x90d91cc . ~Y().\nX(). Y() : Y::q = 0x90c944c . ~Y().\nX(). Y() : Y::q = 0x90d91cc . ~Y().\nX(). Y() : Y::q = 0x90c944c . ~Y().\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 12.13 A Hierarchy of Media Classes\nHere is a hierarchy of classes to represent various media objects:\nMedia Audio Book Periodical CD Tape Record Magazine Newspaper Journal Newsletter\nThe primary ABC is the Media class:\n'''\nclass Media:\n def __init__(self):\n self.title = ''\n def print_(self):\n pass\n def id(self):\n pass\n\nclass Book(Media):\n def __init__(self,a='',t=\"\",p=\"\",i=\"\"):\n self.author = a\n self.publisher = p\n self.isbn = i\n self.title = t\n def print_(self):\n print self.title , \" by \" , self.author\n def id(self):\n return self.isbn\n\nclass CD(Media):\n def __init__(self,t=\"\",c=\"\",m=\"\",n=\"\"):\n self.composer = c\n self.make = m\n self.number = n\n self.title = t\n def print_(self):\n print self.title , \", \" , self.composer\n def id(self):\n s = str(self.make) + ' ' + str(self.number)\n return s\n\nclass Magazine(Media):\n def __init__(self,t=\"\",i=\"\",v=0, n=0):\n self.issn = i\n self.volume = v\n self.number = n\n self.title = t\n def print_(self):\n print self.title , \" Magazine, Vol. \", self.volume , \", No.\" , self.number\n def id(self):\n return self.issn\n\nbook = Book(\"Bjarne Stroustrup\", \"The C++ Programming Language\",\"Addison-Wesley\", \"0-201-53992-6\")\nmagazine = Magazine(\"TIME\", \"0040-781X\", 145, 23)\ncd = CD(\"BACH CANTATAS\", \"Johann Sebastian Bach\",\"ARCHIV\", \"D120541\")\nbook.print_()\nprint \"\\tid: \" , book.id() \nmagazine.print_()\nprint \"\\tid: \" , magazine.id() \ncd.print_()\nprint \"\\tid: \" , cd.id()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The C++ Programming Language by Bjarne Stroustrup\n\tid: 0-201-53992-6\nTIME Magazine, Vol. 145 , No. 23\n\tid: 0040-781X\nBACH CANTATAS , Johann Sebastian Bach\n\tid: ARCHIV D120541\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch13.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch13.ipynb
new file mode 100644
index 00000000..827142fe
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch13.ipynb
@@ -0,0 +1,136 @@
+{
+ "metadata": {
+ "name": "ch13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.1 The swap Function Template\n'''\ndef swap(x,y):\n x[0],y[0] = y[0],x[0]\n\nm = [22]\nn = [66]\nswap(m, n)\ns1 = [\"John Adams\"]\ns2 = [\"James Madison\"]\nswap(s1, s2)\nx = [22/7]\ny = [-3]\nswap(x, y)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.2 The Bubble Sort Template\n'''\n\ndef sort(v,n):\n for i in range(1,n):\n for j in range(n-i):\n if v[j] > v[j+1]:\n v[j],v[j+1] = v[j+1],v[j]\n\ndef print_( v,n):\n for i in range(n):\n print v[i],\n print \"\"\n \na = [55, 33, 88, 11, 44, 99, 77, 22, 66]\nprint_(a,9);\nsort(a,9)\nprint_(a,9)\ns = [\"Tom\", \"Hal\", \"Dan\", \"Bob\", \"Sue\", \"Ann\", \"Gus\"]\nprint_(s,7)\nsort(s,7)\nprint_(s,7)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55 33 88 11 44 99 77 22 66 \n11 22 33 44 55 66 77 88 99 \nTom Hal Dan Bob Sue Ann Gus \nAnn Bob Dan Gus Hal Sue Tom \n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.3 A Stack Class Template\n'''\nclass Stack:\n def __init__(self,s=100):\n self.size = s\n self.top = -1\n self.data = []\n def push(self,x):\n self.data.append( x)\n self.top += 1\n def pop(self):\n d = self.data[self.top]\n self.data.pop(self.top)\n self.top -= 1\n return d \n def isEmpty(self):\n return self.top == -1\n def isFull(self):\n return self.top==self.size-1\n \nintStack1 = Stack(5)\nintStack2 = Stack(10)\ncharStack = Stack(8)\nintStack1.push(77)\ncharStack.push('A')\nintStack2.push(22)\ncharStack.push('E')\ncharStack.push('K')\nintStack2.push(44)\nprint intStack2.pop() \nprint intStack2.pop() \nif (intStack2.isEmpty()):\n print \"intStack2 is empty.\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n22\nintStack2 is empty.\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.4 A Vector Class Template\n= operator does work in python by defaultly.\n'''\nclass Vector:\n def __init__(self,n=None):\n if type(n) == int :\n self.size = n\n self.data = []\n else:\n self.size = 8\n self.data = []\n for i in range(self.size):\n self.data.append(0)\nv = Vector()\nv.data[5] = 127\nw = v\nx = Vector(3)\nprint w.size\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.5 A Subclass Template for Vectors\n'''\nclass Vector:\n def __init__(self,n=None):\n if type(n) == int :\n self.size = n\n self.data = []\n else:\n self.size = 8\n self.data = []\n for i in range(self.size):\n self.data.append(0)\n\nclass Array(Vector):\n def __init__(self,i,j):\n Vector.__init__(self,j-i+1)\n self.i0= i\n def __setitem__(self,k,v):\n self.data[k-self.i0] = v\n def __getitem__(self,i):\n return self.data[self.i0-i]\n def firstSubscript(self):\n return self.i0\n def lastSubscript(self):\n return self.i0+self.size-1\n\nx = Array(1,3)\nx.data[0] = 3.14159\nx.data[1] = 0.08516\nx.data[2] = 5041.92\nprint \"x.size() = \" , x.size \nprint \"x.firstSubscript() = \" , x.firstSubscript() \nprint \"x.lastSubscript() = \" , x.lastSubscript()\nfor i in range(0,3):\n print \"x[\" , i + 1 , \"] = \" , x.data[i]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x.size() = 3\nx.firstSubscript() = 1\nx.lastSubscript() = 3\nx[ 1 ] = 3.14159\nx[ 2 ] = 0.08516\nx[ 3 ] = 5041.92\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.6 A Matrix Class Template\n'''\n\nclass Matrix:\n def __init__(self,r=1,c=1):\n self.rows = r\n self.columns = c\n self.vector = []\n for i in range(r):\n a = []\n for j in range(c):\n a.append(0)\n self.vector.append(a)\n\na = Matrix(2,3)\na.vector[0][0] = 0.0\na.vector[0][1] = 0.1\na.vector[0][2] = 0.2\na.vector[1][0] = 1.0\na.vector[1][1] = 1.1\na.vector[1][2] = 1.2\n\nprint \"The matrix a has \" , a.rows , \" rows and \", a.columns , \" columns:\"\nfor i in range(2):\n for j in range(3):\n print a.vector[i][j] ,\n print \"\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The matrix a has 2 rows and 3 columns:\n0.0 0.1 0.2 \n1.0 1.1 1.2 \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.7 A List Class Template\nA list consists of a linked sequence of nodes. Each node contains one data item and a link to the next\nnode. So we begin by defining a ListNode class template:\n'''\n\nfriends = []\n\n\nfriends.insert(0,\"Bowen, Van\")\nfriends.insert(0,\"Dixon, Tom\")\nfriends.insert(0,\"Mason, Joe\")\nfriends.insert(0,\"White, Ann\")\n\nfor i in range(len(friends)):\n print friends[i], '->' ,\nprint '*'\nfriends.remove('White, Ann')\nprint \"Removed: \" , 'White, Ann'\nfor i in range(len(friends)):\n print friends[i], '->' ,\nprint '*'\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "White, Ann -> Mason, Joe -> Dixon, Tom -> Bowen, Van -> *\nRemoved: White, Ann\nMason, Joe -> Dixon, Tom -> Bowen, Van -> *\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 13.8\n'''\nfriends = []\nfriends.append(\"Bowen, Van\")\nfriends.append(\"Dixon, Tom\")\nfriends.append(\"Mason, Joe\")\nfriends.append(\"White, Ann\")\nfor i in range(len(friends)):\n print friends[i], '->' ,\nprint '*'\n\nfriends.remove(\"Mason, Joe\")\nfriends[1] = \"Davis, Jim\"\nfor i in range(len(friends)):\n print friends[i], '->' ,\nprint '*'\n\nfriends.insert(2,\"Morse, Sam\")\nfor i in range(len(friends)):\n print friends[i], '->' ,\nprint '*'\n\nfor i in range(len(friends)):\n print \"[\" ,friends[i] , \"]\" , '->' ,\nprint '*'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Bowen, Van -> Dixon, Tom -> Mason, Joe -> White, Ann -> *\nBowen, Van -> Davis, Jim -> White, Ann -> *\nBowen, Van -> Davis, Jim -> Morse, Sam -> White, Ann -> *\n[ Bowen, Van ] -> [ Davis, Jim ] -> [ Morse, Sam ] -> [ White, Ann ] -> *\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch14.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch14.ipynb
new file mode 100644
index 00000000..1618010d
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch14.ipynb
@@ -0,0 +1,172 @@
+{
+ "metadata": {
+ "name": "ch14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.1 Using a vector of strings\n'''\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nprint_(v)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Japan\nItaly\nSpain\nEgypt\nChile\nZaire\nNepal\nKenya\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.2 \n'''\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nprint_(v)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Japan\nItaly\nSpain\nEgypt\nChile\nZaire\nNepal\nKenya\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.3 \n'''\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in range(len(v)):\n print v[i]\n\nv = []\nload(v)\nprint_(v)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Japan\nItaly\nSpain\nEgypt\nChile\nZaire\nNepal\nKenya\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.4 Using the Generic sort() Algorithm\n'''\n\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nv.sort()\nprint_(v)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Chile\nEgypt\nItaly\nJapan\nKenya\nNepal\nSpain\nZaire\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.5 Using the Assignment Operator to Duplicate a vector\n'''\n#This program demonstrates that one vector can be assigned to another.\n\n\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nw = v\nprint_(v)\nprint_(w)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Japan\nItaly\nSpain\nEgypt\nChile\nZaire\nNepal\nKenya\nJapan\nItaly\nSpain\nEgypt\nChile\nZaire\nNepal\nKenya\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.6 \n'''\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nv.sort()\nprint_(v)\nprint \"v.front() = \" + v[0]\nprint \"v.back() = \" + v.pop(-1) \nprint \"v.back() = \" + v.pop(-1) \nprint \"v.back() = \" + v[-1] \nprint_(v)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Chile\nEgypt\nItaly\nJapan\nKenya\nNepal\nSpain\nZaire\nv.front() = Chile\nv.back() = Zaire\nv.back() = Spain\nv.back() = Nepal\nChile\nEgypt\nItaly\nJapan\nKenya\nNepal\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.7 Using the erase() Function\n'''\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nv.sort()\nprint_(v)\nv.pop(2) # removes Italy\nv.pop(-2) # removes Spain\nprint_(v)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Chile\nEgypt\nItaly\nJapan\nKenya\nNepal\nSpain\nZaire\nChile\nEgypt\nJapan\nKenya\nNepal\nZaire\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.8 Using the insert() Function\n'''\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n\ndef print_(v):\n for i in v:\n print i\nv = []\nload(v)\nv.sort()\nprint_(v)\nr = []\nfor i in range(2,len(v)-2):\n r.append(v[i]) #removes the segment Italy..Nepal\n \nfor i in r:\n v.remove(i)\nprint_(v)\nv.insert(2,\"India\")\nprint_(v)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Chile\nEgypt\nItaly\nJapan\nKenya\nNepal\nSpain\nZaire\nChile\nEgypt\nSpain\nZaire\nChile\nEgypt\nIndia\nSpain\nZaire\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.9 Using the find() Function\n'''\n\ndef load(v):\n v.append(\"Japan\")\n v.append(\"Italy\")\n v.append(\"Spain\")\n v.append(\"Egypt\")\n v.append(\"Chile\")\n v.append(\"Zaire\")\n v.append(\"Nepal\")\n v.append(\"Kenya\")\n v.append(\"India\")\n v.append(\"China\")\n v.append(\"Malta\")\n v.append(\"Syria\")\n\ndef print_(v):\n for i in v:\n print i\n\nv = []\nload(v)\nprint_(v)\negypt = v.index('Egypt')\nmalta = v.index('Malta')\nw = v[egypt:malta+1]\nw.sort()\nprint_(w)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Japan\nItaly\nSpain\nEgypt\nChile\nZaire\nNepal\nKenya\nIndia\nChina\nMalta\nSyria\nChile\nChina\nEgypt\nIndia\nKenya\nMalta\nNepal\nZaire\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 14.10\n'''\ndef copy(v,x,n):\n for i in x:\n v.append(i)\n\ndef projection(v,b):\n v_size = len(v)\n w = []\n for i in range(0,v_size):\n if b[i]:\n w.append(v[i])\n return w\n\ndef print_(v):\n for i in v:\n print i,\n print ''\n\nx = [ 22.2, 33.3, 44.4, 55.5, 66.6, 77.7, 88.8, 99.9 ]\nv = []\ncopy(v, x, 8)\ny = [ False, True, False, True, True, True, False, True ]\nb = []\ncopy(b, y, 8)\nw = projection(v, b)\nprint_(v)\nprint_(w)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22.2 33.3 44.4 55.5 66.6 77.7 88.8 99.9 \n33.3 55.5 66.6 77.7 99.9 \n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch15.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch15.ipynb
new file mode 100644
index 00000000..54f50fe3
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch15.ipynb
@@ -0,0 +1,1677 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.1 page no : 792"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the rate of heat transfer per m 2 of surface area of the wall, which is 220 mm thick.\n",
+ "\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "t1 = 60.; \t\t\t#0C\n",
+ "t2 = 35.; \t\t\t#0C\n",
+ "L = 0.22; \t\t\t#m\n",
+ "k = 0.51; \t\t\t#W/m 0C\n",
+ "\n",
+ "# Calculations\n",
+ "q = k*(t1-t2)/L;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Rate of heat transfer per m**2 = %.3f\")% (q), (\"W/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of heat transfer per m**2 = 57.955 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.2 page no : 792"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Determine the thickness of fire brick and insulation \n",
+ "(ii) Calculate the heat loss \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "t1 = 1325.; \t\t\t#0C\n",
+ "t2 = 1200.; \t\t\t#0C\n",
+ "t3 = 25.; \t\t\t #0C\n",
+ "L = 0.32; \t\t\t #m\n",
+ "k_A = 0.84; \t\t\t#W/m 0C\n",
+ "k_B = 0.16; \t\t\t#W/m 0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "L_A = (t1-t2)*k_A/k_B*L/((t1-t3)-(t1-t2)*k_A/k_A+(t1-t2)*k_A/k_B); \t\t\t#m\n",
+ "print (\"(i)L_A = %.3f\")% (L_A*1000), (\"mm\")\n",
+ "\n",
+ "L_B = 0.32-L_A; \t\t\t#m\n",
+ "print (\"L_B %.3f\")% (L_B*1000), (\"mm\")\n",
+ "\n",
+ "q = (t1-t2)/L_A*k_A;\n",
+ "print (\"(ii) Heat loss per unit area = %.3f\")% (q), (\"W/m**2\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)L_A = 114.676 mm\n",
+ "L_B 205.324 mm\n",
+ "(ii) Heat loss per unit area = 915.625 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.3 page no : 793"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What thickness of loosely packed rock wool insulation should be added to\n",
+ "reduce the heat loss or (gain) \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "L_A = 0.1; \t\t\t#m\n",
+ "L_B = 0.04; \t\t#m\n",
+ "k_A = 0.7; \t\t\t#W/m 0C\n",
+ "k_B = 0.48; \t\t#W/m 0C\n",
+ "k_C = 0.065; \t\t#W/m 0C\n",
+ "\n",
+ "# Calculations\n",
+ "#Q2 = 0.2*Q1\n",
+ "L_C = 0.8*((L_A/k_A) + (L_B/k_B))*k_C/0.2;\n",
+ "\n",
+ "# Results\n",
+ "print (\"thickness of rock wool insulation = %.3f\")% (L_C*1000), (\"mm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "thickness of rock wool insulation = 58.810 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.4 page no : 794"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find-\n",
+ "(i) To how many millimetres of insulation brick is the air layer equivalent ?\n",
+ "(ii) What is the temperature of the outer surface of the steel plate ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "L_A = 0.2; \t\t\t#m\n",
+ "L_C = 0.006; \t\t#m\n",
+ "L_D = 0.1; \t\t\t#m\n",
+ "t1 = 1150.; \t\t#0C\n",
+ "t2 = 40.; \t\t\t#0C\n",
+ "dt = t1-t2;\n",
+ "k_A = 1.52; \t\t#W/m 0C\n",
+ "k_B = 0.138; \t\t#W/m 0C\n",
+ "k_D = 0.138; \t\t#W/m 0C\n",
+ "k_C = 45.; \t\t\t#W/m 0C\n",
+ "q = 400.; \t\t\t#W/m**2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The value of x = (L_C): \")\n",
+ "L_B = ((t1-t2)/q - (L_A/k_A+L_C/k_C+L_D/k_D))*k_B*1000;\n",
+ "print (\"L_B = %.3f\")% (L_B), (\"mm\")\n",
+ "\n",
+ "\n",
+ "t_so = q*L_D/k_D + t2;\n",
+ "print (\"(ii) Temperature of the outer surface of the steel plate t_so = %.3f\")% (t_so), (\"0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The value of x = (L_C): \n",
+ "L_B = 264.774 mm\n",
+ "(ii) Temperature of the outer surface of the steel plate t_so = 329.855 0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.5 page no : 795"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the heat flow rate\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "k_A = 150.; \t\t\t#W/m 0C\n",
+ "k_B = 30.; \t\t\t#W/m 0C\n",
+ "k_C = 65.; \t\t\t#W/m 0C\n",
+ "k_D = 50.; \t\t\t#W/m 0C\n",
+ "L_A = 0.03; \t\t\t#m\n",
+ "L_B = 0.08; \t\t\t#m\n",
+ "L_C = L_B;\n",
+ "L_D = 0.05; \t\t\t#m\n",
+ "A_A = 0.01; \t\t\t#m**2\n",
+ "A_B = 0.003; \t\t\t#m**2\n",
+ "A_C = 0.007; \t\t\t#m**2\n",
+ "A_D = 0.01; \t\t\t#m**2\n",
+ "t1 = 400.; \t\t\t#0C\n",
+ "t4 = 60.; \t\t\t#0C\n",
+ "\n",
+ "# Calculations\n",
+ "R_thA = L_A/k_A/A_A;\n",
+ "R_thB = L_B/k_B/A_B;\n",
+ "R_thC = L_C/k_C/A_C;\n",
+ "R_thD = L_D/k_D/A_D;\n",
+ "\n",
+ "R_th_eq = R_thB*R_thC/(R_thB+R_thC);\n",
+ "R_th_total = R_thA+R_th_eq+R_thD;\n",
+ "Q = (t1-t4)/R_th_total;\n",
+ "\n",
+ "# Results\n",
+ "print (\"heat flow rate = %.3f\")% (Q), (\"W\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat flow rate = 1274.415 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.6 page no : 796"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate-\n",
+ "(i) The rate of heat loss per m 2 of the tank surface area ;\n",
+ "(ii) The temperature of the outside surface of the tank.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "L = 0.012; \t\t\t#m\n",
+ "t_hf = 95.; \t\t\t#0C\n",
+ "t_cf = 15.; \t\t\t#0C\n",
+ "k = 50.; \t\t\t#W/m 0C\n",
+ "h_hf = 2850.; \t\t\t#W/m**2 0C\n",
+ "h_cf = 10.; \t\t\t#W/m**2 0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Rate of heat loss per m**2 of the tank surface area\")\n",
+ "U = 1./(1./h_hf + L/k + 1./h_cf);\n",
+ "A = 1.; \t\t\t #m**2\n",
+ "q = U*A*(t_hf-t_cf);\n",
+ "print (\"q = %.3f\")% (q), (\"W/m**2\")\n",
+ "\n",
+ "t2 = q/h_cf+t_cf;\n",
+ "print (\"(ii) Temperature of the outside surface of the tank = %.3f\")% (t2), (\"0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Rate of heat loss per m**2 of the tank surface area\n",
+ "q = 795.301 W/m**2\n",
+ "(ii) Temperature of the outside surface of the tank = 94.530 0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.7 page no : 797"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate\n",
+ "(i) The rate at which heat must be removed from the interior \n",
+ "(ii) The temperature on the outer surface of the metal sheet.\n",
+ "'''\n",
+ "# Variables\n",
+ "L_A = 0.003; \t\t\t#m\n",
+ "L_B = 0.05; \t\t\t#m\n",
+ "L_C = L_A;\n",
+ "k_A = 46.5; \t\t\t#W/m 0C\n",
+ "k_B = 0.046; \t\t\t#W/m 0C\n",
+ "k_C = k_A;\n",
+ "h0 = 11.6; \t\t\t#W/m**2 0C\n",
+ "hi = 14.5; \t\t\t#W/m**2 0C\n",
+ "t0 = 25.; \t\t\t#0C\n",
+ "ti = 6.; \t\t\t#0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "A = 0.5*0.5*2+0.5*1*4; \t\t\t#m**2\n",
+ "\n",
+ "Q = A*(t0-ti)/(1/h0 + L_A/k_A + L_B/k_B + L_C/k_C + 1/hi);\n",
+ "print (\"(i) The rate of removal of heat = %.3f\")% (Q), (\"W\")\n",
+ "\n",
+ "t1 = t0-Q/h0/A;\n",
+ "print (\"(ii) The temperature at the outer surface of the metal sheet = %.3f\")% (t1), (\"0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The rate of removal of heat = 38.237 W\n",
+ "(ii) The temperature at the outer surface of the metal sheet = 23.681 0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.8 page no : 798"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The unknown thermal conductivity \u2018k\u2019 ;\n",
+ "(ii) The overall heat transfer coefficient ;\n",
+ "(iii) All surface temperatures.\n",
+ "'''\n",
+ "\n",
+ "#Varaible Declaration\n",
+ "L_A = 0.25; \t\t#m\n",
+ "import math \n",
+ "L_B = 0.1; \t\t\t#m\n",
+ "L_C = 0.15; \t\t#m\n",
+ "k_A = 1.65; \t\t#W/m \u00b0C\n",
+ "k_C = 9.2; \t\t\t#W/m \u00b0C\n",
+ "t_hf = 1250.; \t\t#\u00b0C\n",
+ "t1 = 1100.; \t\t\t#\u00b0C\n",
+ "t_cf = 25.; \t\t\t#\u00b0C\n",
+ "h_hf = 25.; \t\t\t#W/m**2 \u00b0C\n",
+ "h_cf = 12.; \t\t\t#W/m**2 \u00b0C\n",
+ "\n",
+ "\n",
+ "#Calculations and Results\n",
+ "q = h_hf*(t_hf-t1);\n",
+ "l = 0.0355\n",
+ "k_B = L_B/l #((t_hf-t_cf)/q-1/h_hf-L_A/k_A-L_C/k_C-1/h_cf);\n",
+ "print (\" (i)Thermal conductivity,k = %.3f\")% (k_B), (\"W/m**2 \u00b0C\")\n",
+ "\n",
+ "\n",
+ "R_th_total = 1./h_hf+L_A/k_A+L_B/k_B+L_C/k_C+1./h_cf;\n",
+ "U = 1/R_th_total\n",
+ "print (\"(ii) The overall transfer coefficient = %.2f\")% (U), (\"W/m**2 \u00b0C\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) All surface temperature \")\n",
+ "\n",
+ "print (\"t1 = %.3f\")% (t1),(\"\u00b0C\")\n",
+ "\n",
+ "t2 = t1-q*L_A/k_A;\n",
+ "print (\"t2 = %.3f\")% (t2), (\"\u00b0C\")\n",
+ "\n",
+ "t3 = t2-q*L_B/k_B;\n",
+ "print (\"t3 = %.3f\")% (t3), (\"\u00b0C\")\n",
+ "\n",
+ "t4 = t3-q*L_C/k_C;\n",
+ "print (\"t4 = %.3f\")% (t4), (\"\u00b0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (i)Thermal conductivity,k = 2.817 W/m**2 \u00b0C\n",
+ "(ii) The overall transfer coefficient = 3.06 W/m**2 \u00b0C\n",
+ "(iii) All surface temperature \n",
+ "t1 = 1100.000 \u00b0C\n",
+ "t2 = 531.818 \u00b0C\n",
+ "t3 = 398.693 \u00b0C\n",
+ "t4 = 337.552 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.9 page no : 802"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the heat loss per metre of length\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.01; \t\t\t#m\n",
+ "r2 = 0.02; \t\t\t#m\n",
+ "r3 = 0.05; \t\t\t#m\n",
+ "t1 = 600.; \t\t\t#0C\n",
+ "t3 = 1000.; \t\t#0C\n",
+ "k_B = 0.2; \t\t\t#W/m 0C\n",
+ "\n",
+ "# Calculations\n",
+ "q = 2*math.pi*(t1-t3)/(math.log(r3/r2)/k_B);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat transfer per metre of length = %.3f\")% (q), (\"W/m\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer per metre of length = -548.576 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.10 page no : 803"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the rate of heat loss from 60 m length of pipe.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.06; \t\t\t#m\n",
+ "r2 = 0.12; \t\t\t#m\n",
+ "r3 = 0.16; \t\t\t#m\n",
+ "k_A = 0.24; \t\t\t#W/m 0C\n",
+ "k_B = 0.4; \t\t\t#W/m 0C\n",
+ "h_hf = 60.; \t\t\t#W/m**2 0C\n",
+ "h_cf = 12.; \t\t\t#W/m**2 0C\n",
+ "t_hf = 65.; \t\t\t#0C\n",
+ "t_cf = 20.; \t\t\t#0C\n",
+ "L = 60.; \t\t\t#m\n",
+ "\n",
+ "# Calculations\n",
+ "Q = 2*math.pi*L*(t_hf-t_cf)/(1/h_hf/r1 + math.log(r2/r1)/k_A + math.log(r3/r2)/k_B + 1/h_cf/r3);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Rate of heat loss = %.3f\")% (Q), (\"W\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of heat loss = 3850.402 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.11 page no : 804"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "How thick should the asbestos be provided in order to limit the heat losses to 2.1 kW/m 2 ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.06; \t\t\t#m\n",
+ "r2 = 0.08; \t\t\t#m\n",
+ "k_A = 42.; \t\t\t#W/m 0C\n",
+ "k_B = 0.8; \t\t\t#W/m 0C\n",
+ "t_hf = 150.; \t\t\t#0C\n",
+ "t_cf = 20.; \t\t\t#0C\n",
+ "h_hf = 100.; \t\t\t#W/m**2 0C\n",
+ "h_cf = 30.; \t\t\t#W/m**2 0C\n",
+ "r3 = 0.105; \t\t\t#m\n",
+ "\n",
+ "# Calculations\n",
+ "thickness = (r3-r2)*1000; \t\t\t#mm\n",
+ "\n",
+ "# Results\n",
+ "print (\"Thickness of insulation = \"), (thickness), (\"mm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thickness of insulation = 25.0 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.12 page no : 807"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the rate of heat leakage\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "r2 = 0.7; \t\t\t#m\n",
+ "r1 = 0.61; \t\t\t#m\n",
+ "dt = 220.; \t\t\t#dt = t1-t2; 0C\n",
+ "k = 0.083; \t\t\t#W/m 0C\n",
+ "\n",
+ "# Calculations\n",
+ "Q = dt/((r2-r1)/(4*math.pi*k*r1*r2));\n",
+ "\n",
+ "# Results\n",
+ "print (\"Rate of heat leakage = %.3f\")% (Q), (\"W\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of heat leakage = 1088.669 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.13 page no : 811"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the critical thickness of insulation \n",
+ "\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.001; \t\t\t#m\n",
+ "r2 = 0.0018; \t\t\t#m\n",
+ "k = 0.12; \t\t\t#W/m 0C\n",
+ "h0 = 35.; \t\t\t#W/m**2 0C\n",
+ "\n",
+ "# Calculations\n",
+ "rc = k/h0;\n",
+ "thickness = (rc-r1)*10**3; \t\t\t#mm\n",
+ "increase = (1/(math.log(rc/r1)/k + 1/h0/rc)-1/(math.log(r2/r1)/k + 1/h0/r2))/(1/(math.log(r2/r1)/k + 1/h0/r2))*100;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Critical thickness of insulation = %.3f\")% (thickness), (\"mm\")\n",
+ "\n",
+ "print (\"Percentage change in heat transfer rate = %.3f\")% (increase), (\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical thickness of insulation = 2.429 mm\n",
+ "Percentage change in heat transfer rate = 11.666 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.14 page no : 813"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the rate of heat transfer\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "A = 1*1.5; \t\t\t#m**2\n",
+ "ts = 300.; \t\t\t#0C\n",
+ "tf = 20.; \t\t\t#0C\n",
+ "h = 20.; \t\t\t#W/m**2 0C\n",
+ "\n",
+ "# Calculations\n",
+ "Q = h*A*(ts-tf)/10**3; \t\t\t#kW\n",
+ "\n",
+ "# Results\n",
+ "print (\"Rate of heat transfer = \"), (Q), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of heat transfer = 8.4 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.15 page no : 813"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find how much electric power must be supplied to the wire to maintain the wire surface at 120\u00b0C ?\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "d = 0.0015; \t\t\t#m\n",
+ "l = 0.15; \t\t\t#m\n",
+ "A = math.pi*d*l;\n",
+ "ts = 120.; \t\t\t#0C\n",
+ "tf = 100.; \t\t\t#0C\n",
+ "h = 4500.; \t\t\t#W/m**2 0C\n",
+ "\n",
+ "# Calculations\n",
+ "Q = h*A*(ts-tf);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Electric power to be supplied = %.3f\")% (Q), (\"W\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric power to be supplied = 63.617 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.16 page no : 814"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the heat transfer co-efficient and the rate of heat transfer \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "D = 0.045; \t\t\t#m\n",
+ "l = 3.2; \t\t\t#m\n",
+ "u = 0.78; \t\t\t#m/s\n",
+ "k = 0.66; \t\t\t#W/m K\n",
+ "v = 0.478*10**(-6); \t\t\t#m**2/s\n",
+ "Pr = 2.98;\n",
+ "tw = 70.; \t\t\t#0C\n",
+ "tf = 50.; \t\t\t#0C\n",
+ "\n",
+ "# Calculations\n",
+ "A = math.pi*D*l;\n",
+ "Re = D*u/v;\n",
+ "h = 0.023*(Re)**0.8*(Pr)**0.4/D*k;\n",
+ "Q = h*A*(tw-tf)/10**3;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat transfer co-efficient = %.3f\")% (h), (\"W/m**2 K\")\n",
+ "\n",
+ "print (\"Rate of heat transfer = %.3f\")% (Q), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer co-efficient = 4078.018 W/m**2 K\n",
+ "Rate of heat transfer = 36.897 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.17 page no : 814"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the length of the tube required for developed flow.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "rho = 983.2; \t\t\t#kg/m**2\n",
+ "cp = 4.187; \t\t\t#kJ/kg K\n",
+ "k = 0.659; \t\t\t#W/m 0C\n",
+ "v = 0.478*10**(-6); \t\t\t#m**2/s\n",
+ "m = 0.5/60; \t\t\t#kg/s\n",
+ "D = 0.02; \t\t\t#m\n",
+ "ti = 20.; \t\t\t#0C\n",
+ "t0 = 50.; \t\t\t#0C\n",
+ "ts = 85.; \t\t\t#surface temperature in 0C\n",
+ "\n",
+ "# Calculations\n",
+ "tf = 1./2*(ts+(ti+t0)/2);\n",
+ "A = math.pi/4*D**2;\n",
+ "u = m/rho/A;\n",
+ "Re = D*u/v;\n",
+ "\n",
+ "#Since Re < 2000, hence the flow is laminar.\n",
+ "Nu = 3.65;\n",
+ "h = Nu*k/D;\n",
+ "tb = (t0+ti)/2;\n",
+ "L = m*cp*10**3*(t0-ti)/(ts-tb)/h/D/math.pi;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Length of the tube required for fully developed flow = %.3f\")% (L), (\"m\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of the tube required for fully developed flow = 2.770 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.18 page no : 825"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the area of the heat exchanger.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_h = 0.2; \t\t\t#kg/s\n",
+ "m_c = 0.5; \t\t\t#kg/s\n",
+ "t_h1 = 75.; \t\t\t#0C\n",
+ "t_h2 = 45.; \t\t\t#0C\n",
+ "t_c1 = 20.; \t\t\t#0C\n",
+ "hi = 650.; \t\t\t#W/m**2 0C\n",
+ "h0 = hi;\n",
+ "cph = 4.187;\n",
+ "cpc = cph\n",
+ "\n",
+ "# Calculations\n",
+ "Q = m_h*cph*(t_h1-t_h2);\n",
+ "t_c2 = m_h*cph/cpc*(t_h1-t_h2)/m_c+t_c1;\n",
+ "theta = ((t_h1-t_c1)- (t_h2-t_c2))/math.log((t_h1-t_c1)/(t_h2-t_c2)); \t\t\t#Logarithmic mean temperature difference\n",
+ "U = hi*h0/(hi+h0);\n",
+ "A = Q*10**3/U/theta;\n",
+ "\n",
+ "# Results\n",
+ "print (\"The area of heat exchanger = %.3f\")% (A), (\"m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The area of heat exchanger = 2.655 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.19 page no : 827"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find-\n",
+ "(i) The rate of heat transfer,\n",
+ "(ii) The mass flow rate of water, and\n",
+ "(iii) The surface area of the heat exchanger.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "t_c1 = 25.; \t\t\t#0C\n",
+ "t_c2 = 65.; \t\t\t#0C\n",
+ "cph = 1.45; \t\t\t#kJ/kg K\n",
+ "m_h = 0.9; \t\t \t#kg/s\n",
+ "t_h1 = 230.; \t\t\t#0C\n",
+ "t_h2 = 160.; \t\t\t#0C\n",
+ "U = 420.; \t \t\t#W/m**2 0C\n",
+ "cpc = 4.187; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q = m_h*cph*(t_h1-t_h2);\n",
+ "print (\"(i) The rate of heat transfer = \"), (Q), (\"kJ/s\")\n",
+ "\n",
+ "m_c = Q/cpc/(t_c2-t_c1);\n",
+ "print (\"(ii) The mass flow rate of water = %.3f\")% (m_c), (\"kg/s\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) The surface area of heat exchanger = \")\n",
+ "LMTD = ((t_h1-t_c2)- (t_h2-t_c1))/math.log((t_h1-t_c2)/(t_h2-t_c1)); \t\t\t#math.logarithmic mean temperature difference\n",
+ "A = Q*10**3/U/LMTD;\n",
+ "print (\"A = %.3f\")% (A), (\"m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The rate of heat transfer = 91.35 kJ/s\n",
+ "(ii) The mass flow rate of water = 0.545 kg/s\n",
+ "(iii) The surface area of heat exchanger = \n",
+ "A = 1.455 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.20 page no : 828"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the number of tubes required. \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_s = 800./60; \t\t\t#kg/s\n",
+ "m_c = m_s;\n",
+ "m_g = 1350./60; \t\t\t#kg/s\n",
+ "m_h = m_g;\n",
+ "t_h1 = 650.; \t\t\t#0C\n",
+ "t_c1 = 180.; \t\t\t#0C\n",
+ "t_c2 = 350.; \t\t\t#0C\n",
+ "d = 0.03; \t\t\t#m\n",
+ "L = 3.; \t\t\t#m\n",
+ "cph = 1.; \t\t\t#kJ/kg K\n",
+ "cpc = 2.71; \t\t\t#kJ/kg K\n",
+ "h_g = 250.;\n",
+ "h_s = 600.;\n",
+ "\n",
+ "# Calculations\n",
+ "t_h2 = round(t_h1-(m_c*cpc*(t_c2-t_c1)/cph/m_h));\n",
+ "U = round(h_g*h_s/(h_g+h_s),1);\n",
+ "Q = round(m_h*(cph*10**3)*(t_h1-t_h2),1);\n",
+ "theta = ((t_h1-t_c2)- (t_h2-t_c1))/math.log((t_h1-t_c2)/(t_h2-t_c1));# logarithmic mean temperature differenceN = Q/U/theta/(math.pi*d*L);\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print (\"%.1f\")% (theta), (\"C\")\n",
+ "\n",
+ "N = (6142.5 * 10**3)/(U * 0.2827* theta)\n",
+ "print \"number of tubes required = %.0f\" % N\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "244.9 C\n",
+ "number of tubes required = 503\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.21 page no : 829"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate-\n",
+ "(i) Mass of cooling water circulated in kg/min,\n",
+ "(ii) Condenser surface area,\n",
+ "(iii) Number of tubes required per pass, and\n",
+ "(iv) Tube length.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "di = 0.0296; \t\t\t#m\n",
+ "d0 = 0.0384; \t\t\t#m\n",
+ "U = 4000.; \t\t\t#W/m**2 0C\n",
+ "V = 3.; \t\t\t#m/s\n",
+ "t_c1 = 24.; \t\t\t#0C\n",
+ "x = 0.9;\n",
+ "ps = (760-660.)/760*1.0133; \t\t\t#bar\n",
+ "t_h1 = 51.; \t\t\t#0C\n",
+ "t_h2 = 51.; \t\t\t#0C\n",
+ "h_fg = 2592.; \t\t\t#kJ/kg\n",
+ "t_c2 = 47.; \t\t\t#0C\n",
+ "P = 15.; \t\t\t#MW\n",
+ "ssc = 5.; \t\t\t#specific steam consumption in kg/kWh\n",
+ "cpc = 4.187; \t\t\t#kJ?kg K\n",
+ "rho = 1000.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m_s = P*10.**3*ssc/60; \t\t\t#kg/min\n",
+ "m_w = m_s*x*h_fg/cpc/(t_c2-t_c1);\n",
+ "print (\"(i) Mass of cooling water circulated per minute = %.3f\")% (m_w), (\"kg/min\")\n",
+ "\n",
+ "\n",
+ "Q = m_s*x*h_fg*10**3/60.;\n",
+ "\n",
+ "theta = ((t_h1-t_c1)- (t_h2-t_c2))/math.log((t_h1-t_c1)/(t_h2-t_c2)); \t\t\t#Logarithmic mean temperature difference\n",
+ "A = Q/U/theta;\n",
+ "print (\"(ii) Condenser surface area %.3f\")% (A), (\"m**2\")\n",
+ "\n",
+ "Np = m_w/60*4/math.pi/di**2/V/rho;\n",
+ "print (\"(iii) Number of tubes required per pass = %.3f\")% (Np)\n",
+ "\n",
+ "L = A/math.pi/d0/(2*Np);\n",
+ "print (\"(iv) Tube length = %.3f\")% (L), (\"m\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Mass of cooling water circulated per minute = 30280.059 kg/min\n",
+ "(ii) Condenser surface area 1008.737 m**2\n",
+ "(iii) Number of tubes required per pass = 244.462\n",
+ "(iv) Tube length = 17.102 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.22 page no : 831"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the water exit temperature\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cp = 4.187; \t\t\t#kJ/kg \u00b0C\n",
+ "u = 0.596*10**(-3); \t#Ns/m**2\n",
+ "k = 0.635; \t\t\t #W/m \u00b0C\n",
+ "Pr = 3.93; \n",
+ "d = 0.020; \t\t\t#m\n",
+ "l = 2.; \t\t\t#m\n",
+ "m_c = 10.; \t\t\t#kg/s\n",
+ "t_c1 = 17.; \t\t#/\u00b0C\n",
+ "t_h1 = 100.; \t\t#\u00b0C\n",
+ "t_h2 = 100.; \t\t#\u00b0C\n",
+ "rho = 1000.;\n",
+ "N = 200.;\n",
+ "Np = N/l;\n",
+ "h0 = 10.*10**3;\n",
+ "\n",
+ "# Calculations\n",
+ "V = m_c*4/math.pi/d**2/rho/Np;\n",
+ "Re = rho*V*d/u;\n",
+ "hi = k/d*0.023*(Re)**0.8*(Pr)**0.33;\n",
+ "U = hi*h0/(hi+h0);\n",
+ "t_c2 = (U*math.pi*d*l*N*91.5 + m_c*cp*10**3*t_c1)/(m_c*cp*10**3 + U*math.pi*d*l*N*0.5);\n",
+ "\n",
+ "# Results\n",
+ "print (\"water exit temperature = %.3f\")% (t_c2), (\"\u00b0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "water exit temperature = 71.043 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.23 page no : 842"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate-\n",
+ "(i) The total rate of energy emission.\n",
+ "(ii) The intensity of normal radiation, and\n",
+ "(iii) The wavelength of maximum monochromatic emissive power.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "A = 0.12; \t\t\t#m**2\n",
+ "T = 800.; \t\t\t#K\n",
+ "a = 5.67*10**(-8);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Eb = a*A*T**4;\n",
+ "print (\"(i) The total rate of energy emission = %.3f\")% (Eb),(\"W\")\n",
+ "\n",
+ "Ibn = a*T**4/math.pi;\n",
+ "print (\"(ii) The intensity of normal radiation = %.3f\")% (Ibn), (\"W/m**2.sr\")\n",
+ "\n",
+ "wavelength = 2898/T;\n",
+ "print (\"(iii) The wavelength of maximum monochromatic emissive power = %.3f\")%(wavelength), (\"\u03bcm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The total rate of energy emission = 2786.918 W\n",
+ "(ii) The intensity of normal radiation = 7392.531 W/m**2.sr\n",
+ "(iii) The wavelength of maximum monochromatic emissive power = 3.623 \u03bcm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.24 page no : 842"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate-\n",
+ "(i) The surface temperature of the sun, and\n",
+ "(ii) The heat flux at surface of the sun.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "wavelength = 0.49; \t\t\t#\u03bcm\n",
+ "a = 5.67*10**(-8);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "T = 2898/wavelength;\n",
+ "print (\"(i) The surface temperature of the sun %.3f\")% (T), (\"K\")\n",
+ "\n",
+ "E_sun = a*T**4;\n",
+ "print (\"(ii) The heat flux at the surface of the sun = %.3f\")% (E_sun/1E+7), (\"*10^7 W/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The surface temperature of the sun 5914.286 K\n",
+ "(ii) The heat flux at the surface of the sun = 6.937 *10^7 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.25 page no : 843"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate-\n",
+ "(i) Monochromatic emissive power \n",
+ "(ii) Wavelength at which the emission is maximum,\n",
+ "(iii) Maximum emissive power,\n",
+ "(iv) Total emissive power, and\n",
+ "(v) Total emissive power of the furnance \n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T = 2773. \t\t\t#K\n",
+ "lambda_ = 1.2 * 10**-6\n",
+ "e = 0.9;\n",
+ "a = 5.67*10**(-8);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Monochromatic emissive power at 1.2 \u03bcm length\")\n",
+ "C1 = 0.3742*10**(-15); \t\t\t#W.m**4/m**2\n",
+ "C2 = 1.4388*10**(-4); \t\t\t#mK\n",
+ "E_lambda_b = C1*lambda_**(-5)/((math.exp(C2/lambda_/T)-1));\n",
+ "\n",
+ "print (\"E_lambda_b = %.2e\")% (E_lambda_b)\n",
+ "\n",
+ "lambda_max = 2898/T;\n",
+ "print (\"(ii) Wavelength at which the emission is maximum = %.3f\")% (lambda_max), (\"\u03bcm\")\n",
+ "\n",
+ "E_lambda_b_max = 1.285*10.**(-5)*T**5;\n",
+ "print (\"(iii) Maximum emissive power = %.3f\")% (E_lambda_b_max/1E+12), (\"*10^12 W/m**2 per metre length\")\n",
+ "\n",
+ "Eb = a*T**4;\n",
+ "print (\"(iv) Total emissive power = %.3f\")% (Eb/1E+6), (\"*10^6 W/m**2\")\n",
+ "\n",
+ "E = e*a*T**4;\n",
+ "print (\"(v) Total emissive power = %.3f\")% (E/1E+6), (\"*10^6 W/m**2\")\n",
+ "\n",
+ "# Book answers are wrong. Please calculate them manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Monochromatic emissive power at 1.2 \u03bcm length\n",
+ "E_lambda_b = 3.40e+15\n",
+ "(ii) Wavelength at which the emission is maximum = 1.045 \u03bcm\n",
+ "(iii) Maximum emissive power = 2.107 *10^12 W/m**2 per metre length\n",
+ "(iv) Total emissive power = 3.353 *10^6 W/m**2\n",
+ "(v) Total emissive power = 3.017 *10^6 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.26 page no : 845"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) When the body is assumed to be grey with \u03b5 = 0.42.\n",
+ "(ii) When the body is not grey.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 1273.; \t\t\t#K\n",
+ "T2 = 773.; \t\t\t#K\n",
+ "e1 = 0.42;\n",
+ "e2 = 0.72;\n",
+ "a = 5.67*10**(-8);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) When the body is grey with \u03b51 = 0.42\")\n",
+ "q = e1*a*(T1**4-T2**4)/10**3; \t\t\t#kW\n",
+ "print (\"Heat loss per m2 by radiation = %.3f\")% (q), (\"kW\")\n",
+ "print (\"(ii) When the body is not grey\")\n",
+ "E_emitted = e1*a*T1**4;\n",
+ "E_absorbed = e2*a*(T2)**4;\n",
+ "q = (E_emitted-E_absorbed)/10**3;\n",
+ "print (\"Heat loss per m2 by radiation = %.3f\")% (q), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) When the body is grey with \u03b51 = 0.42\n",
+ "Heat loss per m2 by radiation = 54.036 kW\n",
+ "(ii) When the body is not grey\n",
+ "Heat loss per m2 by radiation = 47.962 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.27 page no : 846"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the time required for the heating operation.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 0.022; \t\t\t#m\n",
+ "di = 0.18; \t\t\t#m\n",
+ "e1 = 0.62;\n",
+ "e2 = 0.82;\n",
+ "rho = 7845.; \t\t\t#kg/m**3\n",
+ "T1a = 693.; \t\t\t#K; For caseI\n",
+ "T1b = 813.; \t\t\t#K; For caseII\n",
+ "T2 = 1373.; \t\t\t#K\n",
+ "l = 1.; \t\t\t#m\n",
+ "a = 5.67*10**(-8); \n",
+ "cp = 0.67; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "A1 = math.pi*d*l;\n",
+ "A2 = math.pi*di*l;\n",
+ "Qi = A1*a*(T1a**4-T2**4)/(1/e1+A1/A2*(1/e2 - 1));\n",
+ "Qe = A1*a*(T1b**4-T2**4)/(1/e1+A1/A2*(1/e2 - 1));\n",
+ "Qav = -(Qi+Qe)/2;\n",
+ "t_h = math.pi/4*d**2*rho*cp*(T1b-T1a)*10**3/Qav;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Time required for the heating operation %.3f\")% (t_h),(\"s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the heating operation 31.157 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.28 page no : 847"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the heat transfer rate \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.05; \t\t\t#m\n",
+ "r2 = 0.1; \t\t\t#m\n",
+ "T1 = 400.; \t\t\t#K\n",
+ "T2 = 300.; \t\t\t#K\n",
+ "e1 = 0.5;\n",
+ "e2 = 0.5;\n",
+ "F_12 = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "a = 5.67*10**(-8);\n",
+ "#A1/A2 = r1/r2\n",
+ "Q = a*(T1**4-T2**4)/((1-e1)/e1+1/F_12+(1-e2)/e2*r1/r2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"heat transfer rate per m2 area by radiation\"), (Q), (\"W/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat transfer rate per m2 area by radiation 396.9 W/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.29 page no : 847"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the steady state temperature of cylinder surface \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.05; \t\t\t#m\n",
+ "r2 = 0.1; \t\t\t#m\n",
+ "r3 = 0.15; \t\t\t#m\n",
+ "T1 = 1000.; \t\t\t#K\n",
+ "T3 = 500.; \t\t\t#K\n",
+ "e1 = 0.05;\n",
+ "e2 = e1;\n",
+ "e3 = e1;\n",
+ "a = 5.67*10**(-8);\n",
+ "F_12 = 1.;\n",
+ "F_23 = 1.;\n",
+ "T2 = 770.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = a*(T1**4-T2**4)/(((1-e1)/e1) + 1/F_12 + ((1-e2)/e2)*r1/r2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat flow per m2 area of cylinder 1 = %.3f\")% (Q1), (\"W\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flow per m2 area of cylinder 1 = 1246.381 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.30 page no : 848"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the rate of evaporation of liquid air.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "r1 = 0.105; \t\t\t#m\n",
+ "r2 = 0.15; \t\t\t#m\n",
+ "T1 = 120.; \t\t\t#K\n",
+ "T2 = 300.; \t\t\t#K\n",
+ "e1 = 0.03;\n",
+ "e2 = 0.03;\n",
+ "h_fg = 209.35; \t\t\t#kJ/kg\n",
+ "a = 5.67*10**(-8);\n",
+ "F_12 = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "Q = 4*math.pi*r1**2*a*(T1**4-T2**4)/( ((1-e1)/e1) + 1./F_12 + ((1-e2)/e2)*r1**2/r2**2);\n",
+ "rate = -Q*3600./h_fg/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Rate of evaporation = %.3f\")% (rate), (\"kg/h\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of evaporation = 0.022 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.31 page no : 849"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the rate of heat flow by radiation to the oxygen in the container.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 91.; \t\t\t#K\n",
+ "T2 = 303.; \t\t\t#K\n",
+ "e1 = 0.03;\n",
+ "e2 = 0.03;\n",
+ "d1 = 0.3; \t\t\t#m\n",
+ "d2 = 0.45; \t\t\t#m\n",
+ "a = 5.67*10**(-8);\n",
+ "F_12 = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "Q = 4*math.pi*(d1/2)**2*a*(T1**4-T2**4)/( ((1-e1)/e1) + 1/F_12 + ((1-e2)/e2)*d1**2/d2**2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Rate of heat flow = %.3f\")% (Q), (\"W\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of heat flow = -2.810 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.32 page no : 850"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the percentage reduction when a polished aluminium shield\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "e1 = 0.3;\n",
+ "e2 = 0.8;\n",
+ "e3 = 0.04;\n",
+ "A1 = 1.; \t\t\t#m**2\n",
+ "A2 = A1;\n",
+ "A3 = A1;\n",
+ "\n",
+ "# Calculations\n",
+ "reduction = 1-0.131*0.52;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Percentage reduction in heat flow due to shield = %.3f\")% (reduction), (\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage reduction in heat flow due to shield = 0.932 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch16.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch16.ipynb
new file mode 100644
index 00000000..32a42e59
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch16.ipynb
@@ -0,0 +1,1047 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 : Compressible Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.1 page no : 859"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the velocity of the gas \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V1 = 300.; \t\t\t#m/s\n",
+ "p1 = 78.; \t\t\t#kN/m**2\n",
+ "T1 = 313.; \t\t\t#K\n",
+ "p2 = 117.; \t\t\t#kN/m**2\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations\n",
+ "#Let r1 = p1/rho1\n",
+ "r1 = R*T1;\n",
+ "V2 = math.sqrt(2*(y/(y-1)*r1*(1-(p2/p1)**((y-1)/y)) + V1**2/2));\n",
+ "\n",
+ "# Results\n",
+ "print (\"Velocity of gas at section 2 = %.3f\")% (V2), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of gas at section 2 = 112.987 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.2 page no : 861"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the pressure and the temperature \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 35.; \t\t\t#kN/m**2\n",
+ "V1 = 30.; \t\t\t#m/s\n",
+ "T1 = 423.; \t\t\t#K\n",
+ "V2 = 150.; \t\t\t#m/s\n",
+ "R = 290.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations\n",
+ "#Let r1 = p2/p1\n",
+ "r1 = R*T1; \n",
+ "p2 = p1*(1-((V2**2/2-V1**2/2)*(y-1)/y/r1))**(y/(y-1));\n",
+ "print (\"pressure = %.3f\")% (p2), (\"kN/m**2\")\n",
+ "\n",
+ "T2 = T1*(p2/p1)**((y-1)/y);\n",
+ "t2 = T2-273;\n",
+ "print (\"temperature = %.3f\")% (t2), (\"\u00b0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure = 32.014 kN/m**2\n",
+ "temperature = 139.360 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.3 page no : 866"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the sonic velocity of -\n",
+ "(i) Crude oil \n",
+ "(ii) Mercury \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "SG = 0.8;\n",
+ "rho_oil = 800.; \t\t\t#kg/m**3\n",
+ "K_oil = 1.5*10**9; \t\t\t#N/m**2; crude oil\n",
+ "K_Hg = 27*10.**9; \t\t\t#N/m**2; Mercury\n",
+ "rho_Hg = 13600.; \t\t\t#kg/m**3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "C_oil = math.sqrt(K_oil/rho_oil);\n",
+ "print (\"Sonic velocity of crude oil = %.3f\")% (C_oil), (\"m/s\")\n",
+ "\n",
+ "C_Hg = math.sqrt(K_Hg/rho_Hg)\n",
+ "print (\"Sonic velocity of Mercury = %.3f\")% (C_Hg), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sonic velocity of crude oil = 1369.306 m/s\n",
+ "Sonic velocity of Mercury = 1409.005 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.4 page no : 866"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the speed of the plane\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 228.; \t\t\t#K\n",
+ "M = 2.;\n",
+ "R = 287.; \t\t\t#Jkg K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations\n",
+ "C = math.sqrt(y*R*T);\n",
+ "V = M*C*3600./1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Velocity of the plane = %.3f\")% (V), (\"km/h\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of the plane = 2179.239 km/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.5 page no : 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the velocity of a bullet fired \n",
+ "\n",
+ "# Variables\n",
+ "a = 40*math.pi/180; \t\t\t#Mach angle in radians\n",
+ "y = 1.4;\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "T = 288.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "C = math.sqrt(y*R*T);\n",
+ "V = C/math.sin(a);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Velocity of bullet = %.3f\")% (V), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of bullet = 529.217 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.6 page no : 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the velocity of the projectile. \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p = 88.3; \t\t\t#kN/m**2\n",
+ "T = 271.; \t\t\t#K\n",
+ "M = 40.*math.pi/180;\n",
+ "y = 1.4;\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "C = math.sqrt(y*R*T);\n",
+ "V = C/math.sin(M);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Velocity of the projectile = %.3f\")% (V), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of the projectile = 513.360 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.7 page no : 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the speed of the aircraft \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "h = 1800.; \t\t\t#m\n",
+ "T = 277.; \t\t\t#K\n",
+ "t = 4.; \t\t\t#s\n",
+ "y = 1.4;\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "C = math.sqrt(y*R*T);\n",
+ "a = (math.cos(C/h*t));\n",
+ "V = C/math.sin(a)*3600/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Speed of the aircraft = %.3f\")% (V), (\"km/h\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Speed of the aircraft = 1785.959 km/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.8 page no : 873"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate-\n",
+ "(i) Stagnation pressure,\n",
+ "(ii) Stagnation temperature, and\n",
+ "(iii) Stagnation density.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "V0 = 1000.*1000/3600; \t\t\t#m/s\n",
+ "p0 = 78.5; \t\t\t#kN/m**2\n",
+ "T0 = 265.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "C0 = math.sqrt(y*R*T0);\n",
+ "M0 = V0/C0;\n",
+ "\n",
+ "ps = p0*(1+((y-1)/2*M0**2))**(y/(y-1));\n",
+ "print (\"(i) Stagnation pressure = %.3f\")%(ps), (\"kN/m**2\")\n",
+ "\n",
+ "Ts = T0*(1+((y-1)/2*M0**2));\n",
+ "print (\"(ii) Stagnation temperature = %.3f\")% (Ts), (\"K\")\n",
+ "\n",
+ "rho_s = ps*10**3/R/Ts;\n",
+ "print (\"(iii) Stagnation density = %.3f\")%(rho_s), (\"kg/m**3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Stagnation pressure = 126.067 kN/m**2\n",
+ "(ii) Stagnation temperature = 303.407 K\n",
+ "(iii) Stagnation density = 1.448 kg/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.9 page no : 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Compute stagnation properties and the local Mach number. \n",
+ "What would be the compressibility correction factor for a pitot-static tube \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V0 = 1000.*1000./3600; \t\t\t#m/s\n",
+ "T0 = 320.; \t\t\t#K\n",
+ "p_atm = 98.1; \t\t\t#kN/m**2\n",
+ "p = 9.81; \t\t\t#kN/m**2\n",
+ "p0 = 98.1-p;\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "C0 = math.sqrt(y*R*T0);\n",
+ "M0 = V0/C0;\n",
+ "\n",
+ "ps = p0*(1+((y-1)/2*M0**2))**(y/(y-1));\n",
+ "print (\"Stagnation pressure = %.3f\")% (ps), (\"kN/m**2\")\n",
+ "\n",
+ "Ts = T0*(1+((y-1)/2*M0**2));\n",
+ "print (\"Stagnation temperature = %.1f\")% (Ts), (\"K\")\n",
+ "\n",
+ "rho_s = ps*10**3/R/Ts;\n",
+ "print (\"Stagnation density = %.3f\")% (rho_s), (\"kg/m**3\")\n",
+ "\n",
+ "M = 0.8;\n",
+ "\n",
+ "CF = 1+(M0**2./4)+((2-y)/24.*M0**4);\n",
+ "print (\"Compressibility factor %.2f\")% (CF)\n",
+ "\n",
+ "#Note : Answers are slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stagnation pressure = 131.282 kN/m**2\n",
+ "Stagnation temperature = 358.4 K\n",
+ "Stagnation density = 1.276 kg/m**3\n",
+ "Compressibility factor 1.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.10 page no : 875"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate stagnation pressure if -\n",
+ "(i) Compressibility is neglected ;\n",
+ "(ii) Compressibility is accounted for.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "p0 = 220.*10**3; \t#N/m**2\n",
+ "T0 = 300.; \t\t\t#K\n",
+ "V0 = 200.; \t\t\t#m/s\n",
+ "\n",
+ "# Calculations and Results\n",
+ "C0 = math.sqrt(y*R*T0);\n",
+ "rho_0 = p0/R/T0;\n",
+ "print (\"Stagnation pressure = \")\n",
+ "\n",
+ "print (\"(i) Compressibility is neglected\")\n",
+ "ps = (p0+rho_0*V0**2/2)/10**3;\n",
+ "print (\"ps = %.3f\")% (ps), (\"kN/m**2\")\n",
+ "\n",
+ "print (\"(ii) Compressibility is accounted for\")\n",
+ "M0 = V0/C0;\n",
+ "\n",
+ "ps = (p0+rho_0*V0**2/2*(1+M0**2./4+(2-y)/24*M0**4))/10**3;\n",
+ "print (\"ps = %.3f\")% (ps), (\"kN/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stagnation pressure = \n",
+ "(i) Compressibility is neglected\n",
+ "ps = 271.103 kN/m**2\n",
+ "(ii) Compressibility is accounted for\n",
+ "ps = 275.484 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.11 page no : 875"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the speed of the aircraft. \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p0 = 35.*10**3; \t\t\t#Pa\n",
+ "T0 = 235.; \t\t\t#K\n",
+ "ps = 65.4*10**3; \t\t\t#N/m**2\n",
+ "R0 = 8314.; \t\t\t#Nm/mole K\n",
+ "M = 28.;\n",
+ "\n",
+ "# Calculations\n",
+ "R = R0/M;\n",
+ "rho_0 = p0/R/T0;\n",
+ "Va = math.sqrt(2*(ps-p0)/rho_0);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Speed of the aircraft = %.3f\")% (Va), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Speed of the aircraft = 348.159 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.12 page no : 885"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What is the true speed of the aircraft ?\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p0 = 30.*10**3; \t\t\t#N/m**2\n",
+ "V0 = 152.; \t\t\t#m/s\n",
+ "y = 1.4;\n",
+ "rho_0 = 1.224; \t\t\t#kg/m**3\n",
+ "ps = p0+rho_0*V0**2/2;\n",
+ "\n",
+ "# Calculations\n",
+ "rho_0 = 0.454; \t\t\t#kg/m**3\n",
+ "V0 = math.sqrt(2*(ps-p0)/rho_0);\n",
+ "C0 = math.sqrt(y*p0/rho_0);\n",
+ "M = V0/C0;\n",
+ "ccf = (1+M**2/4); \t\t\t#Compressibility correction factor\n",
+ "V = V0/math.sqrt(ccf); \t\t\t#True speed of aircraft\n",
+ "\n",
+ "# Results\n",
+ "print (\"True speed of aircraft = %.3f\")% (V), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "True speed of aircraft = 230.900 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.13 page no : 886"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the reservoir pressure, temperature and the throat area.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "M = 3.; \t\t\t#Mach number\n",
+ "d = 0.2; \t\t\t#m\n",
+ "p_nozzle = 7.85; \t\t\t#kN/m**2\n",
+ "T_nozzle = 200.; \t\t\t#K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "A = math.pi/4*d**2;\n",
+ "p_res = p_nozzle*(1+((y-1)/2*M**2))**(y/(y-1));\n",
+ "print (\"Reservoir pressure = %.3f\")% (p_res), (\"kN/m**2\")\n",
+ "\n",
+ "T_res = T_nozzle*(1+((y-1)/2*M**2));\n",
+ "print (\"Reservoir temperature = %.3f\")% (T_res), (\"K\")\n",
+ "\n",
+ "Ac = A*M/((2+(y-1)*M**2)/(y+1))**((y+1)/2/(y-1));\n",
+ "print (\"Throat area (critical) = %.5f\")% (Ac), (\"m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reservoir pressure = 288.352 kN/m**2\n",
+ "Reservoir temperature = 560.000 K\n",
+ "Throat area (critical) = 0.00742 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.14 page no : 887"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the maximum flow rate of air.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "p_atm = 100.; \t\t\t#kN/m**2\n",
+ "p1 = 284. + p_atm; \t\t\t#kN/m**2\n",
+ "T1 = 297.; \t \t\t#K\n",
+ "D = 0.02; \t\t \t#m\n",
+ "\n",
+ "# Calculations\n",
+ "A2 = math.pi/4*D**2;\n",
+ "rho_1 = p1*10**3/R/T1;\n",
+ "m_max = 0.685*A2*math.sqrt(p1*10**3*rho_1);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Maximum flow rate = %.3f\")% (m_max), (\"kg/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum flow rate = 0.283 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.15 page no : 888"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the velocity of air flowing at the outlet of the nozzle.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "p1 = 2500.*10**3; \t#N/m**2\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "p2 = 1750.*10**3; \t#N/m**2\n",
+ "\n",
+ "# Calculations\n",
+ "rho_1 = p1/R/T1;\n",
+ "V2 = math.sqrt(2*y/(y-1)*p1/rho_1*(1-(p2/p1)**((y-1)/y)));\n",
+ "\n",
+ "# Results\n",
+ "print (\"Velocity of air = %.3f\")% (V2),(\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of air = 238.812 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.16 page no : 889"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the mass rate of flow of air through the nozzle to the atmosphere when the pressure in the tank is-\n",
+ "(i) 140 kN/m 2 (abs.),\n",
+ "(ii) 300 kN/m 2\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t \t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "p_atm = 10.**5; \t\t#N/m**2\n",
+ "T1 = 293. \t\t\t#K\n",
+ "D2 = 0.025; \t\t\t#m\n",
+ "p1 = 140.*10**3; \t\t#N/m**2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "A2 = math.pi/4*D2**2;\n",
+ "\n",
+ "print (\"(i) Mass rate of flow of air when pressure in the math.tank is 140 kN/m2 (abs.)\")\n",
+ "rho_1 = p1/R/T1;\n",
+ "p2 = 10**5; \t\t\t#N/m**2\n",
+ "\n",
+ "m = A2*math.sqrt(2*y/(y-1)*p1*rho_1*((p2/p1)**(2/y) - (p2/p1)**((y+1)/y)));\n",
+ "print (\"m = %.3f\")% (m), (\"kg/s\")\n",
+ "\n",
+ "print (\"(ii) Mass rate of flow of air when pressure in the math.tank is 300 kN/m2 (abs.)\")\n",
+ "p1 = 300.*10**3; \t\t\t#N/m**2\n",
+ "p2 = 10.**5; \t\t\t#N/m**2\n",
+ "rho_1 = p1/R/T1;\n",
+ "\n",
+ "print (\"The pressure ratio p2/p1 being less than the critical ratio 0.528, the flow in the nozzle will be sonic\");\n",
+ "\n",
+ "m_max = 0.685*A2*math.sqrt(p1*rho_1);\n",
+ "print (\"m_max = %.3f\")% (m_max), (\"kg/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Mass rate of flow of air when pressure in the math.tank is 140 kN/m2 (abs.)\n",
+ "m = 0.149 kg/s\n",
+ "(ii) Mass rate of flow of air when pressure in the math.tank is 300 kN/m2 (abs.)\n",
+ "The pressure ratio p2/p1 being less than the critical ratio 0.528, the flow in the nozzle will be sonic\n",
+ "m_max = 0.348 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.17 page no : 890"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine-\n",
+ "(i) Stagnation temperature and stagnation pressure,\n",
+ "(ii) Sonic velocity and Mach number at this section,\n",
+ "(iii) Velocity, Mach number and flow area at outlet section where pressure is 110 kN/m 2 ,\n",
+ "(iv) Pressure, temperature, velocity and flow area at throat of the nozzle.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 200.; \t\t\t#kN/m**2\n",
+ "V1 = 170.; \t\t\t#m/s\n",
+ "T1 = 473.; \t\t\t#K\n",
+ "A1 = 0.001; \t\t#m**2\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "cp = 1000.; \t\t#J/kg K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Stagnation temperature (Ts) and stagnation pressure (ps)\")\n",
+ "\n",
+ "Ts = T1+V1**2/2/cp;\n",
+ "print (\"Ts = %.3f\")% (Ts), (\"K\")\n",
+ "\n",
+ "ps = p1*(Ts/T1)**(y/(y-1));\n",
+ "print (\"ps = %.3f\")% (ps), (\"kN/m**2\")\n",
+ "\n",
+ "print (\"(ii) Sonic velocity and Mach number at this section\")\n",
+ "\n",
+ "C1 = math.sqrt(y*R*T1);\n",
+ "print (\"Sonic velocity = %.3f\")% (C1), (\"m/s\")\n",
+ "\n",
+ "M1 = V1/C1;\n",
+ "print (\"Mach number = %.3f\")% (M1)\n",
+ "\n",
+ "print (\"(iii) Velocity, Mach number and flow area at outlet section where pressure is 110 kN/m2\")\n",
+ "p2 = 110.; \t\t\t#kN/m**2\n",
+ "M2 = math.sqrt(2/(y-1)*((ps/p2)**((y-1)/y) - 1));\n",
+ "print (\"M2 = %.3f\")% (M2)\n",
+ "\n",
+ "T2 = Ts*(p2/ps)**((y-1)/y);\n",
+ "C2 = math.sqrt(y*R*T2);\n",
+ "V2 = M2*C2;\n",
+ "print (\"V2 = %.3f\")% (V2), (\"m/s\")\n",
+ "\n",
+ "A2 = (p1*A1*V1*T2/T1/p2/V2)*10**6;\n",
+ "print (\"A2 = %.3f\")% (A2), (\"mm**2\")\n",
+ "\n",
+ "\n",
+ "print (\"(iv) Pressure (pt), temperature (Tt), velocity (Vt), and flow area (At) at throat of the nozzle\")\n",
+ "Mt = 1.;\n",
+ "Tt = Ts/(1+(y-1)/2*Mt**2);\n",
+ "print (\"Tt = %.3f\")% (Tt), (\"K\")\n",
+ "\n",
+ "pt = ps*(Tt/Ts)**(y/(y-1));\n",
+ "print (\"pt = %.3f\")% (pt), (\"kN/m**2\")\n",
+ "\n",
+ "Ct = math.sqrt(y*R*Tt);\n",
+ "Vt = Mt*Ct;\n",
+ "\n",
+ "At = (p1*A1*V1*Tt/T1/pt/Vt)*10**6;\n",
+ "print (\"At = %.3f\")% (At), (\"mm**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Stagnation temperature (Ts) and stagnation pressure (ps)\n",
+ "Ts = 487.450 K\n",
+ "ps = 222.214 kN/m**2\n",
+ "(ii) Sonic velocity and Mach number at this section\n",
+ "Sonic velocity = 435.949 m/s\n",
+ "Mach number = 0.390\n",
+ "(iii) Velocity, Mach number and flow area at outlet section where pressure is 110 kN/m2\n",
+ "M2 = 1.055\n",
+ "V2 = 422.183 m/s\n",
+ "A2 = 617.168 mm**2\n",
+ "(iv) Pressure (pt), temperature (Tt), velocity (Vt), and flow area (At) at throat of the nozzle\n",
+ "Tt = 406.208 K\n",
+ "pt = 117.392 kN/m**2\n",
+ "At = 615.673 mm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.18 page no : 893"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the flow conditions before and after the shock wave.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "y = 1.4;\n",
+ "p1 = 26.5; \t\t\t#kN/m**2\n",
+ "rho_1 = 0.413; \t\t\t#kg/m**3\n",
+ "M1 = 2.;\n",
+ "R = 287.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "M2 = math.sqrt(((y-1)*M1**2 + 2)/(2*y*M1**2 - (y-1)));\n",
+ "print (\"Mach number M2 = %.3f\")% (M2)\n",
+ "\n",
+ "p2 = p1*(2*y*M1**2 - (y-1))/(y+1);\n",
+ "print (\"p2 = %.3f\")% (p2), (\"kN/m**2\")\n",
+ "\n",
+ "rho_2 = rho_1*((y+1)*M1**2)/((y-1)*M1**2 + 2);\n",
+ "print (\"density, rho_2 = %.3f\")% (rho_2), (\"kg/m**3\")\n",
+ "\n",
+ "T1 = p1*10**3/rho_1/R;\n",
+ "print (\"T1 = %.3f\")% (T1), (\"K\")\n",
+ "\n",
+ "T2 = T1*((y-1)*M1**2 + 2)*(2*y*M1**2 - (y-1))/((y+1)**2*M1**2);\n",
+ "print (\"T2 = %.3f\")% (T2), (\"K\")\n",
+ "\n",
+ "C1 = math.sqrt(y*R*T1);\n",
+ "V1 = M1*C1;\n",
+ "print (\"V1 = %.3f\")% (V1), (\"m/s\")\n",
+ "\n",
+ "C2 = math.sqrt(y*R*T2);\n",
+ "V2 = M2*C2;\n",
+ "print (\"V2 = %.3f\")% (V2), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mach number M2 = 0.577\n",
+ "p2 = 119.250 kN/m**2\n",
+ "density, rho_2 = 1.101 kg/m**3\n",
+ "T1 = 223.570 K\n",
+ "T2 = 377.275 K\n",
+ "V1 = 599.435 m/s\n",
+ "V2 = 224.788 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.19 page no : 895"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Pressure, temperature and Mach number downstream of the shock, and\n",
+ "(ii) Strength of shock.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "M1 = 1.5;\n",
+ "p1 = 170.; \t\t\t#kN/m**2\n",
+ "T1 = 296.; \t\t\t#K\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Pressure, temperature and Mach number downstream of the shock\")\n",
+ "p2 = p1*(2*y*M1**2 - (y-1))/(y+1);\n",
+ "print (\"p2 = %.3f\")% (p2), (\"kN/m**2\")\n",
+ "\n",
+ "T2 = T1*((y-1)*M1**2 + 2)*(2*y*M1**2 - (y-1))/(y+1)**2/M1**2;\n",
+ "print (\"T2 = %.3f\")% (T2), (\"K\")\n",
+ "\n",
+ "M2 = math.sqrt(((y-1)*M1**2 + 2)/(2*y*M1**2 - (y-1)));\n",
+ "print (\"M2 = %.3f\")% (M2)\n",
+ "\n",
+ "strength = p2/p1 - 1;\n",
+ "print (\"Strength of stock = %.3f\")% (strength)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure, temperature and Mach number downstream of the shock\n",
+ "p2 = 417.917 kN/m**2\n",
+ "T2 = 390.784 K\n",
+ "M2 = 0.701\n",
+ "Strength of stock = 1.458\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch2.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch2.ipynb
new file mode 100644
index 00000000..606044d0
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch2.ipynb
@@ -0,0 +1,310 @@
+{
+ "metadata": {
+ "name": "CH2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.1 Boolean Variables\n'''\n\n# prints the value of a boolean variable:\nflag=False\nprint \"flag = %r\" % flag\nflag = True\nprint \"flag = %r\" % flag",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "flag = False\nflag = True\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.2 Character Variables\n'''\n\n# prints the character and its internally stored\nc='A'\nprint \"c = \" + c + \", int(c) = %d\" % ord(c)\nc='t'\nprint \"c = \" + c + \", int(c) = %d\" % ord(c)\nc='\\t' # the tab character\nprint \"c = \" + c + \", int(c) = %d\" % ord(c)\nc='!'\nprint \"c = \" + c + \", int(c) = %d\" % ord(c)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "c = A, int(c) = 65\nc = t, int(c) = 116\nc = \t, int(c) = 9\nc = !, int(c) = 33\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.3 Integer Type Ranges\nThis program prints the numeric ranges of the Python\n'''\nimport sys\n# defines the constants SHRT_MIN, etc.\nprint 'maximum limit int : ',\nprint sys.maxint\nprint 'float info'\nprint sys.float_info",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "maximum limit int : 2147483647\nfloat info\nsys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.4 Integer Arithmetic\nThis example illustrates how the arithmetic operators work.\n'''\n\n# tests operators +, -, *, /, and %:\nm=54\nn=20\nprint \"m = %d and n = %d\" %(m,n)\nprint \"m+n = %d\" % (m+n) # 54+20 = 74\nprint \"m-n = %d\" % (m-n) # 54-20 = 34\nprint \"m*n = %d\" % (m*n)# 54*20 = 1080\nprint \"m/n = %d\" % (m/n) # 54/20 = 2\nprint \"m modulo by n = %d\" % (m%n) # 54%20 = 14",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "m = 54 and n = 20\nm+n = 74\nm-n = 34\nm*n = 1080\nm/n = 2\nm modulo by n = 14\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.5 Applying the Pre-increment and Post-increment Operators\n'''\n\n# shows the difference between m++ and ++m:\nm = 44\nm += 1\nn = m\nprint \"m = %d , n = %d\" %(m,n)\nm = 44\nn = m # the post-increment operator is applied to m\nm += 1\nprint \"m = %d , n = %d\" %(m,n)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "m = 45 , n = 45\nm = 45 , n = 44\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.6 Applying Composite Arithmetic Assignment Operators\n'''\n\n# tests arithmetic assignment operators:\nn=22\nprint \"n = %d\" % n\nn += 9 # adds 9 to n\nprint \"After n += 9, n = %d\" % n\nn -= 5 # subtracts 5 from n\nprint \"After n -= 5, n = %d\" % n\nn *= 2 # multiplies n by 3\nprint \"After n *= 2, n = %d\" % n \nn /= 3 # divides n by 9\nprint \"After n /= 3, n = %d\" % n \nn %= 7 # reduces n to the remainder from dividing by 4\nprint 'After n modulo by 7 n = %d' %n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 22\nAfter n += 9, n = 31\nAfter n -= 5, n = 26\nAfter n *= 2, n = 52\nAfter n /= 3, n = 17\nAfter n modulo by 7 n = 3\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.7 Floating-Point Arithmetic\nThis program is nearly the same as the one in Example 2.4. The important difference is that these\nvariables are declared to have the floating-point type double instead of the integer type int.\n'''\n\n# tests the floating-point operators +, -, *, and /:\nx=54.0\ny=20.0\nprint \"x = %f and y = %f\" %(x,y)\nprint \"x+y = %f\" %(x+y) # 54.0+20.0 = 74.0\nprint \"x-y = %f\" % (x-y) # 54.0-20.0 = 34.0\nprint \"x*y = %f\" %( x*y) # 54.0*20.0 = 1080.0\nprint \"x/y = %f\" % (x/y) # 54.0/20.0 = 2.7\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 54.000000 and y = 20.000000\nx+y = 74.000000\nx-y = 34.000000\nx*y = 1080.000000\nx/y = 2.700000\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.8 Using the sizeof Operator\nThis program tells you how much space each of the undamental types uses:\nNote : Python has few number of data types so output would be differ.\n'''\nimport sys\n# prints the storage sizes of the fundamental types:\nprint \"Number of bytes used:\\n\"\n\nprint \" char: %d \" % sys.getsizeof('a')\nprint \" int : %d \" % sys.getsizeof(int(1))\nprint \" string : %d \" % sys.getsizeof(str('hellololdei'))\nprint \"float : %d\" % sys.getsizeof(float(1.1))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Number of bytes used:\n\n char: 22 \n int : 12 \n string : 32 \nfloat : 16\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.9 Reading from the <cfloat> Header File\nThis program tells you the precision and magnitude range that the float type has on your system:\n'''\nimport sys\n# prints the storage sizes of the fundamental types:\nfbits = 8*sys.getsizeof(float(123))\n\n# each byte contains 8 bits\nprint \"float uses : %d bits:\\n\\t\" % fbits \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "float uses : 128 bits:\n\t\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nThis program casts a double value into int value:\n'''\n\n# casts a double value as an int:\nv = 1234.56789\nn = int(v);\nprint \"v = %f, n = %d\" %(v,n)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "v = 1234.567890, n = 1234\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.11 Promotion of Types\nThis program promotes a char to a short to an int to a float to a double:\nNote : Python is type independent. So would give output differ.\n'''\n# prints promoted vales of 65 from char to double:\nc='A'\nprint \"char c = \" + c\nk=c;\nprint \"k = \" + k \nm=k;\nprint \"m = \" + m \nn=m\nprint \"n = \" + n\nx=m\nprint \"x = \" + x \ny=x\nprint \"y = \" + y",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "char c = A\nk = A\nm = A\nn = A\nx = A\ny = A\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.12 Integer Overflow\nThis program repeatedly multiplies n by 1000 until it overflows.\n'''\n# prints n until it overflows:\nn=1000\nprint \"n = %d\" % n\nn *= 1000 # multiplies n by 1000\nprint \"n = %d\" % n\nn *= 1000 # multiplies n by 1000\nprint \"n = %d\" % n\nn *= 1000 # multiplies n by 1000\nprint \"n = %d\" % n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 1000\nn = 1000000\nn = 1000000000\nn = 1000000000000\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.13 Floating-point Overflow\nThis program is similar to the one in Example 2.12. It repeatedly squares x until it overflows.\n'''\n\n# prints x until it overflows:\nx=1000.0\nprint \"x = %f\" % x\nx *= x # multiplies n by itself; i.e., it squares x\nprint \"x = %f\" % x\nx *= x # multiplies n by itself; i.e., it squares x\nprint \"x = %f\" % x\nx *= x # multiplies n by itself; i.e., it squares x\nprint \"x = %f\" % x\nx *= x # multiplies n by itself; i.e., it squares x\nprint \"x = %f\" % x\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 1000.000000\nx = 1000000.000000\nx = 1000000000000.000000\nx = 999999999999999983222784.000000\nx = 1000000000000000043845843045076197354634047651840.000000\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.14 Round-off Error\nThis program does some simple arithmetic to illustrate roundoff error:\n'''\n\n# illustrates round-off error::\nx = 1000/3.0\nprint \"x = %f\" %x # x = 1000/3\ny = x - 333.0\nprint \"y = %f\" % y # y = 1/3\nz = 3*y - 1.0\nprint \"z = %f\" %z # z = 3(1/3) - 1\nif (z == 0):\n print \"z == 0.\\n\"\nelse:\n print \"z does not equal 0.\\n\" # z != 0\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 333.333333\ny = 0.333333\nz = -0.000000\nz does not equal 0.\n\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.15 Hidden Round-off Error\nThis program implements the quadratic formula to solve quadratic equations.\n'''\nimport math\n\n# implements the quadratic formula\na = float(raw_input(\"Enter the coefficients of a quadratic equation:\\n a : \"))\nb = float(raw_input('b : '))\nc = float(raw_input('c : '))\n\nprint \"The equation is: \",\nprint a,\nprint \"*x*x + \",\nprint b,\nprint \"*x + \" ,\nprint c,\nprint \" = 0\" \n\nd = b*b - 4*a*c # discriminant\nsqrtd = math.sqrt(d)\nx1 = (-b + sqrtd)/(2*a)\nx2 = (-b - sqrtd)/(2*a)\nprint \"The solutions are:\"\nprint \"\\tx1 = %f\" % x1\nprint \"\\tx2 = %f\" % x2\nprint \"Check:\" \nprint \"\\ta*x1*x1 + b*x1 + c = %f\" %( a*x1*x1 + b*x1 + c)\nprint \"\\ta*x2*x2 + b*x2 + c = %f\" %( a*x2*x2 + b*x2 + c)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter the coefficients of a quadratic equation:\n a : 2\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "b : 1\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "c : -3\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The equation is: 2.0 *x*x + 1.0 *x + -3.0 = 0\nThe solutions are:\n\tx1 = 1.000000\n\tx2 = -1.500000\nCheck:\n\ta*x1*x1 + b*x1 + c = 0.000000\n\ta*x2*x2 + b*x2 + c = 0.000000\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.17 Scientific Format\nThis program shows how floating-point values may be input in scientific format:\n'''\n\n# prints double values in scientific e-format:\nx = float(raw_input(\"Enter float: \"))\nprint \"Its reciprocal is: \",\nprint 1/x ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter float: 234.567e89\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Its reciprocal is: 4.2631742743e-92\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.18 Scope of Variables\nNOte : Python does not have variable scopes. Once variable is declared then it stays live until program gets exit.\nso it wont give any errors.\n\n'''\n# illustrates the scope of variables:\nx = 11\n# ERROR: this is not in the scope of x\nif True:\n x = 22 # OK: this is in the scope of x\n y = 33 # ERROR: this is not in the scope of y\n x = 44 # OK: this is in the scope of x\n y = 55 # OK: this is in the scope of y\nx = 66 # OK: this is in the scope of x\ny = 77 # ERROR: this is not in the scope of y\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 2.19 Nested and Parallel Scopes\nNOte : Python does not have variable scopes. Once variable is declared then it stays live until program gets exit.\nso output would be differ.\n'''\n# this x is global\nx = 11\n\nif True:\n # illustrates the nested and parallel scopes:\n x = 22\n # begin scope of internal block\n if True:\n x = 33\n print \"In block inside main(): x = %d \" % x\n # end scope of internal block\nprint \"In main(): x = %d\" %x \nprint \"In main(): x = %d \"% x",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "In block inside main(): x = 33 \nIn main(): x = 33\nIn main(): x = 33 \n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch3.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch3.ipynb
new file mode 100644
index 00000000..8a41802e
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch3.ipynb
@@ -0,0 +1,606 @@
+{
+ "metadata": {
+ "name": "ch3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.1 Testing for Divisibility\nThis program tests if one positive integer is not divisible by another:\n'''\n\nprint \"Enter two positive integers: \";\nn = int(raw_input())\nd = int(raw_input())\nif (n%d):\n print \"%d is not divisible by %d\" %(n,d)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two positive integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "66\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "66 is not divisible by 7\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.2 Testing for Divisibility Again\nThis program is the same as the program in Example 3.1 except that the if statement has been replaced\nby an if..else statement:\n'''\nprint \"Enter two positive integers: \";\nn = int(raw_input())\nd = int(raw_input())\nif (n%d):\n print \"%d is not divisible by %d\" %(n,d)\nelse:\n print \"%d is divisible by %d\" %(n,d)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two positive integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "56\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "56 is divisible by 7\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.3 The Minimum of Two Integers\nThis program prints the minimum of the two integers entered:\n'''\n\nprint \"Enter two integers: \"\nm = int(raw_input())\nn = int(raw_input())\n\nif (m < n):\n print \"%d is the minimum.\" %m\nelse:\n print \"%d is the minimum.\" %n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55 is the minimum.\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.4 A Common Programming Error\nThis program is erroneous:\n'''\nprint \"Enter an integer: \"\nn = int(raw_input())\nif (n = 22):\n print \"%d = 22\" %n\nelse: \n print \"%d != 22\" %n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SyntaxError",
+ "evalue": "invalid syntax (<ipython-input-4-d2cee3e182b1>, line 7)",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;36m File \u001b[1;32m\"<ipython-input-4-d2cee3e182b1>\"\u001b[1;36m, line \u001b[1;32m7\u001b[0m\n\u001b[1;33m if (n = 22):\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.5 The Minimum of Three Integers\nThis program is similar to the one in Example 3.3 except that it applies to three integers:\n'''\nprint \"Enter three integers: \"\nn1 = int(raw_input())\nn2 = int(raw_input())\nn3 = int(raw_input())\n\nm=n1\n# now min <= n1\nif (n2 < m):\n m = n2 # now min <= n1 and min <= n2\nif (n3 < m):\n m = n3 # now min <= n1, min <= n2, and min <= n3\nprint \"Their minimum is %d\" % m",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter three integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Their minimum is 33\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.6 A Statement Block within an if Statement\nThis program inputs two integers and then outputs them in increasing order:\n'''\n\nprint \"Enter two integers: \"\nx = int(raw_input())\ny = int(raw_input())\n\nif (x > y):\n temp=x\n x = y\n y = temp\n \n\nprint \"%d <= %d\" %(x,y)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "66\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44 <= 66\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.7 Using Blocks to Limit Scope\nThis program uses the same name n for three different variables:\n'''\nn=44\nprint \"n = %d\" % n \nif True:\n # scope extends over 4 lines\n print \"Enter an integer: \"\n n = int(raw_input())\n print \"n = %d\" % n \n\nif True:\n print \"n = %d\" % n \n # the n that was declared first\nif True:\n print \"n = %d\" % n \n\nprint \"n = %d\" % n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 44\nEnter an integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 77\nn = 77\nn = 77\nn = 77\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.8 Using Compound Conditions\nThis program has the same effect as the one in Example 3.5 on page 39. This version uses compound\nconditions to find the minimum of three integers:\n'''\nprint \"Enter three integers: \"\nn1 = int(raw_input())\nn2 = int(raw_input())\nn3 = int(raw_input())\nif (n1 <= n2 and n1 <= n3):\n print \"Their minimum is %d\" % n1\n \nif (n2 <= n1 and n2 <= n3):\n print \"Their minimum is %d \" % n2 \nif (n3 <= n1 and n3 <= n2):\n print \"Their minimum is %d\" % n3 \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter three integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Their minimum is 33 \n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.9 User-Friendly Input\nThis program allows the user to input either a 'Y' or a 'y' for 'yes':\n'''\n\nprint \"Are you enrolled (y/n): \"\nans = raw_input()\nif (ans == 'Y' or ans == 'y'):\n print \"You are enrolled.\\n\"\nelse: \n print \"You are not enrolled.\\n\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Are you enrolled (y/n): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "y\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "You are enrolled.\n\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.10 Short-Circuiting\nThis program tests integer divisibility:\n'''\n\nprint \"Enter two positive integers: \";\nn = int(raw_input())\nd = int(raw_input())\n\nif (d != 0 and n%d == 0): \n print \"%d divides %d\" %(d,n)\nelse:\n print \"%d does not divide %d\"% (d,n)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two positive integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "6\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "6 does not divide 33\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.11 Another Logical Error\nThis program is erroneous:\n'''\nprint \"Enter three integers: \"\nn1 = int(raw_input())\nn2 = int(raw_input())\nn3 = int(raw_input())\n\nif (n1 >= n2 >= n3):\n print \"max = x\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter three integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.12 Nesting Selection Statements\nThis program has the same effect as the one in Example 3.10 on page 42:\n'''\nprint \"Enter two positive integers: \"\nn = int(raw_input())\nd = int(raw_input())\n\nif (d != 0):\n if (n%d == 0):\n print d,\n print \" divides %d\" % n \n else:\n print \"%d does not divide %d\" %(d,n)\nelse:\n print '%d does not divide %d '%(d,n)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two positive integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44 does not divide 55\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.13 Using Nested Selection Statements\nThis program has the same effect as those in Example 3.5 on page 39 and Example 3.8 on page 41.\nThis version uses nested if..else statements to find the minimum of three integers:\n'''\nprint \"Enter three integers: \"\nn1 = int(raw_input())\nn2 = int(raw_input())\nn3 = int(raw_input())\nif (n1 < n2):\n if (n1 < n3):\n print \"Their minimum is : %d\" % n1\n else:\n print \"Their minimum is : %d\" % n3\nelse: # n1 >= n2\n if (n2 < n3):\n print \"Their minimum is : %d\" % n2\n else:\n print \"Their minimum is %d\" % n3",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter three integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Their minimum is : 33\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.14 A Guessing Game\nThis program finds a number that the user selects from 1 to 8:\n'''\n\nprint \"Pick a number from 1 to 8.\" \nanswer = int(raw_input())\nprint \"Is it less than 5? (y|n): \"\nanswer = raw_input()\nif (answer == 'y'): # 1 <= n <= 4\n print \"Is it less than 3? (y|n): \"\n answer = raw_input() \n if (answer == 'y'): # 1 <= n <= 2\n print \"Is it less than 2? (y|n): \"\n answer = raw_input()\n if (answer == 'y'):\n print \"Your number is 1.\"\n else:\n print \"Your number is 2.\"\n else: # 3 <= n <= 4\n print \"Is it less than 4? (y|n): \"\n answer = raw_input()\n if (answer == 'y'):\n print \"Your number is 3.\"\n else:\n print \"Your number is 4.\"\nelse: # 5 <= n <= 8\n print \"Is it less than 7? (y|n): \"\n answer = raw_input()\n if (answer == 'y'): # 5 <= n <= 6\n print \"Is it less than 6? (y|n): \"\n answer = raw_input()\n if (answer == 'y'):\n print \"Your number is 5.\"\n else:\n print \"Your number is 6.\" \n else: # 7 <= n <= 8\n print \"Is it less than 8? (y|n): \"\n answer = raw_input()\n if (answer == 'y'):\n print \"Your number is 7.\" \n else:\n print \"Your number is 8.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Pick a number from 1 to 8.\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "6\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Is it less than 5? (y|n): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Is it less than 7? (y|n): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "y\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Is it less than 6? (y|n): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Your number is 6.\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.15 Using the else if Construct for Parallel Alternatives\nThis program requests the users language and then prints a greeting in that language:\n'''\nlanguage = raw_input(\"Engl., Fren., Ger., Ital., or Rus.? (e|f|g|i|r): \")\n\nif (language == 'e'): \n print \"Welcome to ProjectEuclid.\"\nelif (language == 'f'):\n print \"Bon jour, ProjectEuclid.\"\nelif (language == 'g'):\n print \"Guten tag, ProjectEuclid.\"\nelif (language == 'i'):\n print \"Bon giorno, ProjectEuclid.\"\nelif (language == 'r'):\n print \"Dobre utre, ProjectEuclid.\"\nelse:\n print \"Sorry; we don't speak your language.\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Engl., Fren., Ger., Ital., or Rus.? (e|f|g|i|r): i\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Bon giorno, ProjectEuclid.\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.16 Using the else if Construct to Select a Range of Scores\nThis program converts a test score into its equivalent letter grade:\n'''\nscore = int(raw_input(\"Enter your test score: \"))\na = int(score/10)\nif a == 10 or a == 9:\n print \"Your grade is an A.\"\nelif a == 8:\n print \"Your grade is a B.\" \nelif a == 7:\n print \"Your grade is a C.\" \nelif a == 6:\n print \"Your grade is a D.\"\nelif a==5 or a==4 or a==3 or a==2 or a==1 or a==0:\n print \"Your grade is an F.\" \nelse:\n print \"Error: score is out of range.\\n\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your test score: 83\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Your grade is a B.\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.17 Using a switch Statement to Select a Range of Scores\nThis program has the same effect as the one in Example 3.16:\n'''\nscore = int(raw_input(\"Enter your test score: \"))\na = int(score/10)\nif a == 10 or a == 9:\n print \"Your grade is an A.\"\nelif a == 8:\n print \"Your grade is a B.\" \nelif a == 7:\n print \"Your grade is a C.\" \nelif a == 6:\n print \"Your grade is a D.\"\nelif a==5 or a==4 or a==3 or a==2 or a==1 or a==0:\n print \"Your grade is an F.\" \nelse:\n print \"Error: score is out of range.\\n\"\n\nprint \"Goodbye.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your test score: 83\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Your grade is a B.\nGoodbye.\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.18 An Erroneous Fall-through in a switch Statement\nThis program was intended to have the same effect as the one in Example 3.17. But with\nstatements, the program execution falls through all the case statements it encounters:\n'''\nscore = int(raw_input(\"Enter your test score: \"))\na = int(score/10)\nif a == 10 or a == 9:\n print \"Your grade is an A.\"\nelif a == 8:\n print \"Your grade is a B.\" \nelif a == 7:\n print \"Your grade is a C.\" \nelif a == 6:\n print \"Your grade is a D.\"\nelif a==5 or a==4 or a==3 or a==2 or a==1 or a==0:\n print \"Your grade is an F.\" \nelse:\n print \"Error: score is out of range.\\n\"\n\nprint \"Goodbye.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter your test score: 83\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Your grade is a B.\nGoodbye.\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 3.19 Finding the Minimum Again\n'''\n\nprint \"Enter two integers: \"\nm = int(raw_input())\nn = int(raw_input())\nprint min(m,n),\nprint 'is the minimum'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33 is the minimum\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch4.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch4.ipynb
new file mode 100644
index 00000000..d137f53e
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch4.ipynb
@@ -0,0 +1,839 @@
+{
+ "metadata": {
+ "name": "ch4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.1 Using a while Loop to Compute a Sum of Consecutive Integers\nThis program computes the sum 1 + 2 + 3 + + n for an input integer n:\n'''\ni=1\nprint \"Enter a positive integer: \"\nn = int(raw_input())\ns=0\nwhile (i <= n):\n s += i\n i += 1\nprint \"The sum of the first %d integers is %d\" %(i,s)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 6 integers is 15\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.2 Using a while Loop to Compute a Sum of Reciprocals\nThis program computes the sum of reciprocals s = 1 + 1/2 + 1/3 + 1/n where n is\ninteger for which n is greater than s\n'''\n\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\ns=0.0\ni=0\nwhile (s < bound):\n i += 1\n s += 1.0/i\n\nprint \"The sum of the first %d reciprocals is %f\" %(i,s)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 83 reciprocals is 5.002068\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.3 Using a while Loop to Repeat a Computation\nThis program prints the square root of each number input by the user. It uses a while loop to allow any\nnumber of computations in a single run of the program:\n'''\nimport math\nprint \"Enter a positive number: \"\nx = float(raw_input())\nwhile (x > 0):\n print \"sqrt(%d) = %f \"%(x,math.sqrt(x))\n print \"Enter another positive number (or 0 to quit): \"\n x = float(raw_input())\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive number: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "sqrt(5) = 2.236068 \nEnter another positive number (or 0 to quit): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "sqrt(3) = 1.732051 \nEnter another positive number (or 0 to quit): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.4 Using a break Statement to Terminate a Loop\nThis program has the same effect as the one in Example 4.1 on page 60:\n'''\ni=1\nprint \"Enter a positive integer: \";\nn = int(raw_input())\ns=0\nwhile(True):\n if (i > n):\n break # terminates the loop immediately\n s += i\n i += 1\nprint \"The sum of the first %d integers is %d\" %(n,s)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 5 integers is 15\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.5 The Fibonacci Numbers\n'''\n\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\nprint \"Fibonacci numbers < %d:\\n0, 1\" % bound ,\nf0=0\nf1=1\nwhile (True):\n f2 = f0 + f1\n if (f2 > bound):\n break\n print \", %d\" % f2,\n f0 = f1\n f1 = f2\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Fibonacci numbers < 10:\n0, 1 , 1 , 2 , 3 , 5 , 8\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.6 Using the exit(0) Function\nThe exit() function provides another way to terminate a loop. When it executes, it terminates the\nprogram itself:\n'''\nimport sys\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\nprint \"Fibonacci numbers < %d:\\n0, 1\" % bound ,\nf0=0\nf1=1\nwhile (True):\n f2 = f0 + f1\n if (f2 > bound):\n sys.exit(0)\n print \", %d\" % f2,\n f0 = f1\n f1 = f2\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "0",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\u001b[1;31m:\u001b[0m 0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Fibonacci numbers < 10:\n0, 1 , 1 , 2 , 3 , 5 , 8"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.7 Aborting Infinite Loop\nWithout some termination mechanism, the loop will run forever. To abort its execution after it starts,\npress <Ctrl>+C (i.e., hold the Ctrl key down and press the C key on your keyboard):\n'''\n\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\nprint \"Fibonacci numbers < %d:\\n0, 1\" % bound ,\nf0=0\nf1=1\n# Error : infinite loop !\nwhile (True):\n f2 = f0 + f1\n # By commenting the below if statement, it goes to infinite.\n if (f2 > bound):\n break\n print \", %d\" % f2,\n f0 = f1\n f1 = f2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Fibonacci numbers < 10:\n0, 1 , 1 , 2 , 3 , 5 , 8\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.7 Aborting Infinite Loop\nWithout some termination mechanism, the loop will run forever. To abort its execution after it starts,\npress <Ctrl>+C (i.e., hold the Ctrl key down and press the C key on your keyboard):\n'''\n\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\nprint \"Fibonacci numbers < %d:\\n0, 1\" % bound ,\nf0=0\nf1=1\n# Error : infinite loop !\nwhile (True):\n f2 = f0 + f1\n # By commenting the below if statement, it goes to infinite.\n if (f2 > bound):\n break\n print \", %d\" % f2,\n f0 = f1\n f1 = f2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \nFibonacci numbers < 10:\n0, 1 , 1 , 2 , 3 , 5 , 8\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.8 Using a do..while Loop to Compute a Sum of Consecutive Integers\nThis program has the same effect as the one in Example 4.1 on page 60:\n'''\ni=0\nprint \"Enter a positive integer: \"\nn = int(raw_input())\ns=0\nwhile i<=n:\n s += i\n i += 1\nprint \"The sum of the first %d integers is %d\" %(n,s)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 10 integers is 55\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.9 The Factorial Numbers\n'''\n\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\nprint \"Factorial numbers < %d:\\n1, 1\" %bound,\nf=1\ni=1\nwhile f < bound:\n i += 1\n f *= i\n print \", %d\" %f,\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Factorial numbers < 10:\n1, 1 , 2 , 6 , 24\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.10 Using a for Loop to Compute a Sum of Consecutive Integers\nThis program has the same effect as the one in Example 4.1 on page 60:\n'''\n\nprint \"Enter a positive integer: \"\nn = int(raw_input())\ns=0;\nfor i in range(0,n+1):\n s += i\nprint \"The sum of the first %d integers is %d\" %(n,s)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 10 integers is 55\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.11 Reusing for Loop Control Variable Names\nThis program has the same effect as the one in Example 4.1 on page 60:\n'''\nprint \"Enter a positive integer: \"\nn = int(raw_input())\ns=0\nfor i in range(1,n/2): # the scope of this i is this loop\n s += i\n\nfor i in range(n/2,n+1): # the scope of this i is this loop\n s += i\nprint \"The sum of the first %d integers is %d\" % (n,s)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 10 integers is 55\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.12 The Factorial Numbers Again\nThis program has the same effect as the one in Example 4.9 on page 65:\n'''\nprint \"Enter a positive integer: \"\nbound = int(raw_input())\n\nprint \"Factorial numbers that are <= %d:\\n1, 1\" %bound,\nf=1\nfor i in range(2,bound+1):\n f *= i\n print \", %d\" % f,\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Factorial numbers that are <= 10:\n1, 1 , 2 , 6 , 24 , 120 , 720 , 5040 , 40320 , 362880 , 3628800\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.13 Using a Descending for Loop\nThis program prints the first ten positive integers in reverse order:\n'''\n\nfor i in range(10,0,-1):\n print i,\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10 9 8 7 6 5 4 3 2 1\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.14 Using a for Loop with a Step Greater than One\nThis program determines whether an input number is prime:\n'''\nprime = True\nprint \"Enter a positive integer: \"\nn = int(raw_input())\nif (n < 2):\n print \"%d is not prime.\" %n\n prime = False\nelif (n < 4):\n print \"%d is prime.\" %n\n prime = False\nelif (n%2 == 0):\n print \"%d = 2* %d\" %(n,n/2)\n prime = False\nelse:\n for d in range(3,n/2+1):\n if (n%d == 0):\n print \"%d = %d * %d\" %(n,d,n/d)\n prime = False\nif prime: \n print \"%d is prime.\"%n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "11\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "11 is prime.\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.15 Using a Sentinel to Control a for Loop\nThis program finds the maximum of a sequence of input numbers:\n'''\nprint \"Enter positive integers (0 to quit): \";\nn = int(raw_input())\nm = n\nwhile n > 0:\n n = int(raw_input())\n if n > m :\n m = n\n\nprint \"max = %d\" % m",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter positive integers (0 to quit): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "19\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "42\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "max = 42\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.16 Using a Loop Invariant to Prove that a for Loop is Correct\nThis program finds the minimum of a sequence of input numbers. It is similar to the program in\nExample 4.15:\n'''\n\nprint \"Enter positive integers (0 to quit): \";\nn = int(raw_input())\nm = n\nwhile n > 0: \n if n < m :\n m = n\n n = int(raw_input())\n\nprint \"min = %d\" % m\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter positive integers (0 to quit): \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "19\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "42\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "min = 1\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.17\n'''\n\nm = 95\nn = 11\nwhile m%n > 0:\n print \"%d modulo %d = %d\" %(m,n,m%n)\n m -= 3\n n += 1\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "95 modulo 11 = 7\n92 modulo 12 = 8\n89 modulo 13 = 11\n86 modulo 14 = 2\n83 modulo 15 = 8\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.18 Nesting for Loops\nThis program prints a multiplication table:\n'''\n\nfor x in range(1,13):\n for y in range(1,13):\n print \"%4d\" % (x*y),\n print \"\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 1 2 3 4 5 6 7 8 9 10 11 12 \n 2 4 6 8 10 12 14 16 18 20 22 24 \n 3 6 9 12 15 18 21 24 27 30 33 36 \n 4 8 12 16 20 24 28 32 36 40 44 48 \n 5 10 15 20 25 30 35 40 45 50 55 60 \n 6 12 18 24 30 36 42 48 54 60 66 72 \n 7 14 21 28 35 42 49 56 63 70 77 84 \n 8 16 24 32 40 48 56 64 72 80 88 96 \n 9 18 27 36 45 54 63 72 81 90 99 108 \n 10 20 30 40 50 60 70 80 90 100 110 120 \n 11 22 33 44 55 66 77 88 99 110 121 132 \n 12 24 36 48 60 72 84 96 108 120 132 144 \n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.19 Testing a Loop Invariant\n'''\nimport math\n# defines pow() and log()\n\nprint \"Enter a positive integer: \"\nn = int(raw_input())\nd=0 # the discrete binary logarithm of n\np2d=1 # = 2^d\ni = n\nwhile i > 1:\n # INVARIANT: 2^d <= n/i < 2*2^d\n p2d=math.pow(2,d) # = 2^d\n print \"%2d <= %2d\" %(p2d,2*p2d)\n i /= 2\n d += 1\n\np2d=math.pow(2,d) # = 2^d\nprint \"%2d <= %2d < %2d\" %(p2d,n,2*p2d)\nprint \" The discrete binary logarithm of is %d\" % d \nlgn = math.log(n)/math.log(2) # base 2 logarithm\nprint \"The continuous binary logarithm of is %f\" % lgn",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "17\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 1 <= 2\n 2 <= 4\n 4 <= 8\n 8 <= 16\n16 <= 17 < 32\n The discrete binary logarithm of is 4\nThe continuous binary logarithm of is 4.087463\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.20 Using a break Statement to Terminate a Loop\nThis program has the same effect as the one in Example 4.1 on page 60. It uses a break statement to\ncontrol the loop:\n'''\ni=1\nprint \"Enter a positive integer: \"\nn = int(raw_input())\ns=0\nwhile (True):\n if (i > n):\n break\n s += i\n i += 1\n\nprint \"The sum of the first %d integers is %d\" %(i,s)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter a positive integer: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of the first 11 integers is 55\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.21 Controlling Input with a Sentinel\nThis program reads a sequence of positive integers, terminated by 0, and prints their average:\n'''\ncount=0\ns=0\nprint \"Enter positive integers (0 to quit):\" \nwhile True: # \"forever\"\n print \"\\t %d :\" %(count + 1),\n n = int(raw_input())\n if (n <= 0):\n break\n count += 1\n s += n\n\nprint \"The average of those %d positive numbers is \" %count,\nprint float(s)/count\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter positive integers (0 to quit):\n\t 1 :"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "12\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t 2 :"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "32\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t 3 :"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "11\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t 4 :"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " The average of those 3 positive numbers is 18.3333333333\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.22 Using a break Statement with Nested Loops\n'''\n\nfor x in range(1,13):\n for y in range(1,13):\n if y>x:\n break\n else:\n print '%4d' %(x*y),\n print ''\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 1 \n 2 4 \n 3 6 9 \n 4 8 12 16 \n 5 10 15 20 25 \n 6 12 18 24 30 36 \n 7 14 21 28 35 42 49 \n 8 16 24 32 40 48 56 64 \n 9 18 27 36 45 54 63 72 81 \n 10 20 30 40 50 60 70 80 90 100 \n 11 22 33 44 55 66 77 88 99 110 121 \n 12 24 36 48 60 72 84 96 108 120 132 144 \n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.23 Using continue and break Statements\nThis little program illustrates the continue and break statements:\n'''\nwhile True:\n n = int(raw_input('Enter int : '))\n if (n%2 == 0):\n continue\n if (n%3 == 0):\n break\n print \"\\tBottom of loop.\\n\"\nprint \"\\tOutside of loop.\\n\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter int : 5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tBottom of loop.\n\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter int : 4\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter int : 6\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter int : 9\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tOutside of loop.\n\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.24 Using a goto Statement to Break Out of a Nest of Loops\nNote : Python has no goto facility.\n'''\nN=5\ndone=False\nfor i in range(N):\n for j in range(N):\n if done:\n break\n for k in range(N):\n if done:\n break\n if (i+j+k>N):\n done = True\n else:\n print i+j+k,\n print \" \",\n print \"* \"\n print \".\" \n done = False\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 * \n1 2 3 4 5 * \n2 3 4 5 * \n.\n1 2 3 4 5 * \n2 3 4 5 * \n.\n2 3 4 5 * \n.\n3 4 5 * \n.\n4 5 * \n.\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.25 Using a Flag to Break Out of a Nest of Loops\nThis program has the same output as that in Example 4.24:\n'''\nN=5\ndone=False\nfor i in range(N):\n for j in range(N):\n if done:\n break\n for k in range(N):\n if done:\n break\n if (i+j+k>N):\n done = True\n else:\n print i+j+k,\n print \" \",\n print \"* \"\n print \".\" \n done = False\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 2 3 4 * \n1 2 3 4 5 * \n2 3 4 5 * \n.\n1 2 3 4 5 * \n2 3 4 5 * \n.\n2 3 4 5 * \n.\n3 4 5 * \n.\n4 5 * \n.\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.26 Generating Pseudo-Random Numbers\nThis program uses the rand() function to generate pseudo-random numbers:\n'''\nimport random\n\n# prints pseudo-random numbers:\n\nfor i in range(0,8):\n print random.random()\n\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.702115758628\n0.969460447904\n0.409934401112\n0.700339443791\n0.093528851602\n0.132172955687\n0.0162887279366\n0.943010713478\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.27 Setting the Seed Interactively\nThis program is the same as the one in Example 4.26 except that it allows the pseudo-random number\ngenerator's seed to be set interactively:\n'''\nimport random\n# prints pseudo-random numbers:\nprint \"Enter seed: \"\nseed = int(raw_input())\nrandom.seed(seed);\nfor i in range(0,8):\n print random.random()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter seed: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.62290169489\n0.741786989261\n0.795193565566\n0.942450283777\n0.73989857474\n0.922324996665\n0.0290052282836\n0.465622654378\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.28 Setting the Seed from the System Clock\nThis program is the same as the one in Example 4.27 except that it sets the pseudo-random number\ngenerator's seed from the system clock.\n'''\nimport random\nfor i in range(0,8):\n print random.random()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.943356716998\n0.648974553137\n0.900900491751\n0.113205964653\n0.469069047782\n0.24657283262\n0.543760859236\n0.573941187928\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 4.29 Generating Pseudo-Random Numbers in Given Range\nThis program is the same as the one in Example 4.28 except that the pseudo-random numbers that it\ngenerates are restricted to given range:\n'''\nimport random\nprint \"Enter minimum and maximum: \"\nm = int(raw_input())\nn = int(raw_input())\n# lowest and highest numbers\nr = n - m + 1\n# number of numbers in range\nfor i in range(0,20):\n j = int(random.random()*100 % r + m)\n print j,\n print \" \",\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter minimum and maximum: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "15\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "6 15 10 8 15 9 7 7 11 6 5 15 14 15 15 15 11 13 14 6 \n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch5.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch5.ipynb
new file mode 100644
index 00000000..6ef37c88
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch5.ipynb
@@ -0,0 +1,694 @@
+{
+ "metadata": {
+ "name": "ch5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.1 The Square Root Function sqrt()\n'''\nimport math\n\n# tests the sqrt() function:\nfor i in range(0,6):\n print \"\\t %d \\t %f\" %(i,math.sqrt(i))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t 0 \t 0.000000\n\t 1 \t 1.000000\n\t 2 \t 1.414214\n\t 3 \t 1.732051\n\t 4 \t 2.000000\n\t 5 \t 2.236068\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.2 Testing a Trigonometry Identity\n'''\nimport math\n# tests the identity sin 2x = 2 sin x cos x:\nx = 0\nwhile x < 2:\n print \"%f \\t\\t %f \\t %f\" %(x,math.sin(2*x),2*math.sin(x)*math.cos(x))\n x += 0.2\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.000000 \t\t 0.000000 \t 0.000000\n0.200000 \t\t 0.389418 \t 0.389418\n0.400000 \t\t 0.717356 \t 0.717356\n0.600000 \t\t 0.932039 \t 0.932039\n0.800000 \t\t 0.999574 \t 0.999574\n1.000000 \t\t 0.909297 \t 0.909297\n1.200000 \t\t 0.675463 \t 0.675463\n1.400000 \t\t 0.334988 \t 0.334988\n1.600000 \t\t -0.058374 \t -0.058374\n1.800000 \t\t -0.442520 \t -0.442520\n2.000000 \t\t -0.756802 \t -0.756802\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.3 A cube() Function\nHere is a simple example of a user-defined function:\n'''\n\ndef cube(x):\n # returns cube of x:\n return x*x*x\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.4 A Test Driver for the cube() Function\nHere is a complete program that includes the definition of the cube() function from Example 5.4\ntogether with a test driver for it:\n'''\n\ndef cube(x):\n # returns cube of x:\n return x*x*x\n\n# tests the cube() function:\nn=1\nwhile (n != 0):\n n = int(raw_input())\n print \"\\tcube( %d ) = %d\" %(n,cube(n))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tcube( 4 ) = 64\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tcube( 2 ) = 8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tcube( 9 ) = 729\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tcube( 0 ) = 0\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.5 A Test Driver for the max() Function\nHere is a function with two parameters. It returns the larger of the two values passed to it.\n'''\n\ndef maximum(x,y):\n # returns larger of the two given integers:\n if (x < y):\n return y\n else:\n return x\n\n# tests the max() function:\nm = 1\nn = 1\nwhile m != 0: \n m = int(raw_input())\n n = int(raw_input())\n print \"\\tmax( %d , %d ) = %d\" %(m,n,maximum(m,n))\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax( 5 , 2 ) = 5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax( 0 , 3 ) = 3\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.6 The max() Function with Declaration Separate from Definition\n'''\n\ndef maximum(x,y):\n # returns larger of the two given integers:\n if (x < y):\n return y\n else:\n return x\n\n# tests the max() function:\nm = 1\nn = 1\nwhile m != 0: \n m = int(raw_input())\n n = int(raw_input())\n print \"\\tmax( %d , %d ) = %d\" %(m,n,maximum(m,n))\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax( 5 , 2 ) = 5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax( 0 , 3 ) = 3\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.8 The max() Function Compiled Separately\n'''\n\n\n# returns larger of the two given integers:\n\nm = 1\nn = 1\nwhile m!=0:\n m = int(raw_input())\n n = int(raw_input())\n print \"\\tmax(%d,%d) = %d\" %(m,n, max(m,n))\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax(5,4) = 5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax(4,3) = 4\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax(8,0) = 8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\tmax(0,5) = 5\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.9 The Factorial Function\n'''\n\ndef fact(n):\n if (n < 0):\n return 0\n f = 1\n while (n > 1):\n f *= n\n n -= 1\n return f\n\nfor i in range(-1,6):\n print fact(i),\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 1 1 2 6 24 120\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.10 The Permutation Function\n'''\ndef fact(n):\n if (n < 0):\n return 0\n f = 1\n while (n > 1):\n f *= n\n n -= 1\n return f\n\n\ndef perm(n,k):\n # returns P(n,k), the number of permutations of k from n:\n if (n < 0 or k < 0 or k > n):\n return 0\n return fact(n)/fact(n-k)\n\nfor i in range(-1,8):\n for j in range(-1,i+2):\n print perm(i,j),\n print ''\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 0 \n0 1 0 \n0 1 1 0 \n0 1 2 2 0 \n0 1 3 6 6 0 \n0 1 4 12 24 24 0 \n0 1 5 20 60 120 120 0 \n0 1 6 30 120 360 720 720 0 \n0 1 7 42 210 840 2520 5040 5040 0 \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.11 A Function that Prints Dates\n'''\n\ndef printDate(m,d,y):\n # prints the given date in literal form:\n if (m < 1 or m > 12 or d < 1 or d > 31 or y < 0):\n print \"Error: parameter out of range.\\n\"\n return\n if m == 1:\n print \"January \",\n elif m ==2:\n print \"February \",\n elif m==3 :\n print \"March \",\n elif m==4:\n print \"April \",\n elif m==5:\n print \"May \",\n elif m==6:\n print \"June \",\n elif m==7:\n print \"July \",\n elif m==8:\n print \"August \",\n elif m==9:\n print \"September \",\n elif m==10:\n print \"October \",\n elif m==1:\n print \"November \",\n else:\n print \"December \",\n print d , \", \", y \n\n# tests the printDate() function:\nmonth = 1\nwhile month > 0:\n month = int(raw_input())\n day = int(raw_input())\n year = int(raw_input())\n printDate(month,day,year)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "12\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1989\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "September 12 , 1989\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2001\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Error: parameter out of range.\n\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.12 Classifying Characters\n'''\nimport string\ndef ispunct(s):\n return all(c in string.punctuation for c in s)\ndef printCharCategory(c):\n # prints the category to which the given character belongs:\n print \"The character [\" + c + \"] is a \",\n if(c.isdigit()):\n print \"digit.\\n\"\n elif (c.islower()):\n print \"lower-case letter.\\n\"\n elif (c.isupper()): \n print \"capital letter.\\n\"\n elif (c.isspace()):\n print \"white space character.\\n\"\n elif (ord(c) >= 10 and ord(c) <= 15 or ord(c) == 0):\n print \"control character.\\n\"\n elif (ispunct(c)):\n print \"punctuation mark.\\n\"\n else:\n print \"Error.\\n\"\n\n# prints the category to which the given character belongs;\n# tests the printCharCategory() function:\nfor c in range(128):\n printCharCategory(chr(c))\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " The character [\u0000] is a control character.\n\nThe character [\u0001] is a Error.\n\nThe character [\u0002] is a Error.\n\nThe character [\u0003] is a Error.\n\nThe character [\u0004] is a Error.\n\nThe character [\u0005] is a Error.\n\nThe character [\u0006] is a Error.\n\nThe character [\u0007] is a Error.\n\nThe character [\b] is a Error.\n\nThe character [\t] is a white space character.\n\nThe character [\n] is a white space character.\n\nThe character [\u000b] is a white space character.\n\nThe character [\f] is a white space character.\n\nThe character [\r] is a white space character.\n\nThe character [\u000e] is a control character.\n\nThe character [\u000f] is a control character.\n\nThe character [\u0010] is a Error.\n\nThe character [\u0011] is a Error.\n\nThe character [\u0012] is a Error.\n\nThe character [\u0013] is a Error.\n\nThe character [\u0014] is a Error.\n\nThe character [\u0015] is a Error.\n\nThe character [\u0016] is a Error.\n\nThe character [\u0017] is a Error.\n\nThe character [\u0018] is a Error.\n\nThe character [\u0019] is a Error.\n\nThe character [\u001a] is a Error.\n\nThe character [\u001b] is a Error.\n\nThe character [\u001c] is a Error.\n\nThe character [\u001d] is a Error.\n\nThe character [\u001e] is a Error.\n\nThe character [\u001f] is a Error.\n\nThe character [ ] is a white space character.\n\nThe character [!] is a punctuation mark.\n\nThe character [\"] is a punctuation mark.\n\nThe character [#] is a punctuation mark.\n\nThe character [$] is a punctuation mark.\n\nThe character [%] is a punctuation mark.\n\nThe character [&] is a punctuation mark.\n\nThe character ['] is a punctuation mark.\n\nThe character [(] is a punctuation mark.\n\nThe character [)] is a punctuation mark.\n\nThe character [*] is a punctuation mark.\n\nThe character [+] is a punctuation mark.\n\nThe character [,] is a punctuation mark.\n\nThe character [-] is a punctuation mark.\n\nThe character [.] is a punctuation mark.\n\nThe character [/] is a punctuation mark.\n\nThe character [0] is a digit.\n\nThe character [1] is a digit.\n\nThe character [2] is a digit.\n\nThe character [3] is a digit.\n\nThe character [4] is a digit.\n\nThe character [5] is a digit.\n\nThe character [6] is a digit.\n\nThe character [7] is a digit.\n\nThe character [8] is a digit.\n\nThe character [9] is a digit.\n\nThe character [:] is a punctuation mark.\n\nThe character [;] is a punctuation mark.\n\nThe character [<] is a punctuation mark.\n\nThe character [=] is a punctuation mark.\n\nThe character [>] is a punctuation mark.\n\nThe character [?] is a punctuation mark.\n\nThe character [@] is a punctuation mark.\n\nThe character [A] is a capital letter.\n\nThe character [B] is a capital letter.\n\nThe character [C] is a capital letter.\n\nThe character [D] is a capital letter.\n\nThe character [E] is a capital letter.\n\nThe character [F] is a capital letter.\n\nThe character [G] is a capital letter.\n\nThe character [H] is a capital letter.\n\nThe character [I] is a capital letter.\n\nThe character [J] is a capital letter.\n\nThe character [K] is a capital letter.\n\nThe character [L] is a capital letter.\n\nThe character [M] is a capital letter.\n\nThe character [N] is a capital letter.\n\nThe character [O] is a capital letter.\n\nThe character [P] is a capital letter.\n\nThe character [Q] is a capital letter.\n\nThe character [R] is a capital letter.\n\nThe character [S] is a capital letter.\n\nThe character [T] is a capital letter.\n\nThe character [U] is a capital letter.\n\nThe character [V] is a capital letter.\n\nThe character [W] is a capital letter.\n\nThe character [X] is a capital letter.\n\nThe character [Y] is a capital letter.\n\nThe character [Z] is a capital letter.\n\nThe character [[] is a punctuation mark.\n\nThe character [\\] is a punctuation mark.\n\nThe character []] is a punctuation mark.\n\nThe character [^] is a punctuation mark.\n\nThe character [_] is a punctuation mark.\n\nThe character [`] is a punctuation mark.\n\nThe character [a] is a lower-case letter.\n\nThe character [b] is a lower-case letter.\n\nThe character [c] is a lower-case letter.\n\nThe character [d] is a lower-case letter.\n\nThe character [e] is a lower-case letter.\n\nThe character [f] is a lower-case letter.\n\nThe character [g] is a lower-case letter.\n\nThe character [h] is a lower-case letter.\n\nThe character [i] is a lower-case letter.\n\nThe character [j] is a lower-case letter.\n\nThe character [k] is a lower-case letter.\n\nThe character [l] is a lower-case letter.\n\nThe character [m] is a lower-case letter.\n\nThe character [n] is a lower-case letter.\n\nThe character [o] is a lower-case letter.\n\nThe character [p] is a lower-case letter.\n\nThe character [q] is a lower-case letter.\n\nThe character [r] is a lower-case letter.\n\nThe character [s] is a lower-case letter.\n\nThe character [t] is a lower-case letter.\n\nThe character [u] is a lower-case letter.\n\nThe character [v] is a lower-case letter.\n\nThe character [w] is a lower-case letter.\n\nThe character [x] is a lower-case letter.\n\nThe character [y] is a lower-case letter.\n\nThe character [z] is a lower-case letter.\n\nThe character [{] is a punctuation mark.\n\nThe character [|] is a punctuation mark.\n\nThe character [}] is a punctuation mark.\n\nThe character [~] is a punctuation mark.\n\nThe character [\u007f] is a Error.\n\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.13 A Function that Tests Primality\n'''\nimport math\ndef isPrime(n):\n # returns True if n is prime, False otherwise:\n sqrtn = math.sqrt(n)\n if (n < 2):\n return False\n # 0 and 1 are not primes\n if (n < 4):\n return True\n # 2 and 3 are the first primes\n if (n%2 == 0):\n return False\n # 2 is the only even prime\n for d in range(3,int(sqrtn+1),2):\n if (n%d == 0):\n return False\n # n has a nontrivial divisor\n return True;\n\nfor n in range(0,80):\n if (isPrime(n)):\n print n,\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.14 A Leap Year Function\n'''\ndef isLeapYear(y):\n # returns true iff y is a leap year:\n return (y % 4 == 0 and y % 100 != 0 or y % 400 == 0)\n\n# tests the isLeapYear() function:\nn = 2\nwhile n > 1:\n n = int(raw_input())\n if (isLeapYear(n)):\n print \"%d is a leap year.\" % n\n else:\n print \"%d is not a leap year.\" %n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2004\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2004 is a leap year.\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2006\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2006 is not a leap year.\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2013\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2013 is not a leap year.\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0 is a leap year.\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.15 A Function for Reading the User's Age\n'''\n\ndef age():\n # prompts the user to input his/her age, and returns that value:\n while (True):\n print \"How old are you: \"\n n = int(raw_input())\n if (n < 0):\n print \"\\a\\tYour age could not be negative.\"\n elif (n > 120):\n print \"\\a\\tYou could not be over 120.\"\n else:\n return n\n print \"\\n\\tTry again.\\n\"\n\na = age();\nprint \"\\nYou are %d years old.\" %a\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "How old are you: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "-12\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\u0007\tYour age could not be negative.\n\n\tTry again.\n\nHow old are you: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "125\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\u0007\tYou could not be over 120.\n\n\tTry again.\n\nHow old are you: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "24\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\nYou are 24 years old.\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.16 The swap() Function\n'''\n\ndef swap(x,y):\n # exchanges the values of x and y:\n x[0],y[0] = y[0],x[0]\n\na = [22.2]\nb = [44.4]\nprint \"a = %.2f , b = %.2f \" %(a[0],b[0])\nswap(a,b)\nprint \"a = %.2f , b = %.2f \" %(a[0],b[0])\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a = 22.20 , b = 44.40 \na = 44.40 , b = 22.20 \n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.17 \nNote : Python doesn't support pass value by reference. but can be done by passing list.\n'''\n\ndef f(x,y):\n x[0]= 88\n y[0] = 99\n\n# tests the f() function:\na = [22]\nb = [44]\nprint \"a = %.2f , b = %.2f \" %(a[0],b[0])\nf(a,b)\nprint \"a = %.2f , b = %.2f \" %(a[0],b[0])\nf(2*a,b)\nprint \"a = %.2f , b = %.2f \" %(a[0],b[0])\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a = 22.00 , b = 44.00 \na = 88.00 , b = 99.00 \na = 88.00 , b = 99.00 \n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.18 Returning More than One Value\n'''\n\ndef computeCircle(r):\n # returns the area and circumference of a circle with radius r:\n PI = 3.141592653589793\n area = PI*r*r\n circumference = 2*PI*r\n return area,circumference\n\n# tests the computeCircle() function:\nprint \"Enter radius: \"\nr = int(raw_input())\na,c = computeCircle(r)\nprint \"area = %.2f , circumference = %.2f\" %(a,c)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter radius: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "area = 78.54 , circumference = 31.42\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.19\nNote : Python passes variable by value and not by reference. So output would be differ.\n'''\n\n\ndef f(x,y,z):\n x[0] += z[0]\n y[0] += z[0]\n print \"x = %d , y = %d , z = %d\" %(x[0],y[0],z[0])\n\nx = [22]\ny = [33]\nz = [44]\n\nprint \"x = %d , y = %d , z = %d\" %(x[0],y[0],z[0])\nf(x,y,z)\nprint \"x = %d , y = %d , z = %d\" %(x[0],y[0],z[0])\nx[0] = 2*x[0] - 3\nf(x,y,z)\nprint \"x = %d , y = %d , z = %d\" %(x[0],y[0],z[0])\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 22 , y = 33 , z = 44\nx = 66 , y = 77 , z = 44\nx = 66 , y = 77 , z = 44\nx = 173 , y = 121 , z = 44\nx = 173 , y = 121 , z = 44\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.20\n'''\ndef cube(x):\n # returns cube of x:\n return x*x*x\n\n# tests the cube() function:\nprint cube(4)\nx = int(raw_input())\ny = cube(2*x-3)\nprint y\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "64\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "343\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.21 Nested and Parallel Scopes\nPython has it's own scope so output would be differ.\n'''\nx = 11\n\ndef f():\n x = 44\n print \"In f(): x = %d\" % x \n\ndef g():\n print \"In g(): x = %d\" % x \n\nx = 22\nx = 33\nprint \"In block inside main(): x = %d\" % x\n\n\nprint \"In main(): x = %d\" % x \nprint \"In main(): ::x = %d\" % x \nf()\ng()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "In block inside main(): x = 33\nIn main(): x = 33\nIn main(): ::x = 33\nIn f(): x = 44\nIn g(): x = 33\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.22 \n'''\n\ndef max_(x, y,z=0):\n if x > y and x > y:\n return x\n elif y > x and y > z:\n return y\n else:\n return z\n \n \nprint max(99,77), \" \" , max(55,66,33)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "99 66\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.23 Using the return Statement to Terminate a Program\n'''\n\n# prints the quotient of two input integers:\nprint \"Enter two integers: \"\nn = int(raw_input())\nd = int(raw_input())\nif (d == 0):\n import sys\n sys.exit(0)\nprint n , \"/\" , d , \" = \" , n/d \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter two integers: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8 / 2 = 4\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.24 Using the exit() Function to Terminate a Program\n'''\n\ndef reciprocal(x):\n #returns the reciprocal of x:\n if (x == 0):\n import sys\n sys.exit(1); # terminate the program\n return 1.0/x\n\nx = float(raw_input())\nprint reciprocal(x)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "25\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "0.04\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 5.25 Default Parameters\nThis function evaluates the third degree polynomial a0 + a1x + a2x2 + a3x3. \n'''\ndef p(x,a0,a1=0,a2=0,a3=0):\n # returns a0 + a1*x + a2*x^2 + a3*x^3:\n return (a0 + (a1 + (a2 + a3*x)*x)*x)\n\n\n# tests the p() function:\nx = 2.0003\nprint \"p(x,7) = %f\" % p(x,7)\nprint \"p(x,7,6) = %f\" % p(x,7,6)\nprint \"p(x,7,6,5) = %f\" % p(x,7,6,5)\nprint \"p(x,7,6,5,4) = %f\" % p(x,7,6,5,4)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "p(x,7) = 7.000000\np(x,7,6) = 19.001800\np(x,7,6,5) = 39.007800\np(x,7,6,5,4) = 71.022203\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch6.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch6.ipynb
new file mode 100644
index 00000000..a355a8d2
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch6.ipynb
@@ -0,0 +1,648 @@
+{
+ "metadata": {
+ "name": "ch6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.1 Using Direct Access on Arrays\n'''\n\na = [0, 0, 0]\na[2] = 55.55\na[0] = 11.11\na[1] = 33.33\nprint \"a[0] = \" , a[0] \nprint \"a[1] = \" , a[1] \nprint \"a[2] = \" , a[2] \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a[0] = 11.11\na[1] = 33.33\na[2] = 55.55\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.2 Printing a Sequence in Order\n'''\n\nSIZE=5 # defines the size N for 5 elements\na = []\n# declares the array's elements as type double\nprint \"Enter \" , SIZE , \" numbers:\\t\"\nfor i in range(SIZE):\n a.append(float(raw_input()))\n \nprint \"In reverse order: \"\nfor i in range(SIZE-1,-1,-1):\n print \"\\t\" , a[i]\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter 5 numbers:\t\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3.3\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4.4\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5.5\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "In reverse order: \n\t5.5\n\t4.4\n\t3.3\n\t2.0\n\t1.0\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.3 Initializing an Array\nThis program initializes the array a and then prints its values:\n'''\n\na = [ 22.2, 44.4, 66.6 ]\n\nsize = len(a)\nfor i in range(size):\n print \"\\ta[\" , i , \"] = \" , a[i]\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\ta[ 0 ] = 22.2\n\ta[ 1 ] = 44.4\n\ta[ 2 ] = 66.6\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.4 Initializing an Array with Trailing Zeros\n'''\n\na = [ 22.2, 44.4, 66.6 , 0 ,0,0,0]\nsize = len(a)\nfor i in range(size):\n print \"\\ta[\" , i , \"] = \" , a[i] \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\ta[ 0 ] = 22.2\n\ta[ 1 ] = 44.4\n\ta[ 2 ] = 66.6\n\ta[ 3 ] = 0\n\ta[ 4 ] = 0\n\ta[ 5 ] = 0\n\ta[ 6 ] = 0\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.5 An Uninitialized Array\nNOte : In PYthon , we have to initialize array. Without initializing it, it doesn't work.\nArray size is automatically incremented when we push data into it.\n'''\nimport numpy\nSIZE = 4\na = numpy.zeros(4)\n# declares the array's elements as type float\nfor i in range(SIZE):\n print \"\\ta[\" , i , \"] = \" , a[i]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\ta[ 0 ] = 0.0\n\ta[ 1 ] = 0.0\n\ta[ 2 ] = 0.0\n\ta[ 3 ] = 0.0\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.6 Allowing an Array Index to Exceed its Bounds\nNOte : Python gives error when this kind of error occurs. so It wont print garbage values after bound exceeds.\n'''\nSIZE=4\na = [ 33.3, 44.4, 55.5, 66.6 ]\nfor i in range(7): # ERROR: index is out of bounds!\n print \"\\ta[\" , i , \"] = \" , a[i] \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IndexError",
+ "evalue": "list index out of range",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-6-248fbb50a5b0>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m \u001b[1;36m33.3\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m44.4\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m55.5\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m66.6\u001b[0m \u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m7\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;31m# ERROR: index is out of bounds!\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"\\ta[\"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m,\u001b[0m \u001b[1;34m\"] = \"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIndexError\u001b[0m: list index out of range"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\ta[ 0 ] = 33.3\n\ta[ 1 ] = 44.4\n\ta[ 2 ] = 55.5\n\ta[ 3 ] = 66.6\n\ta[ 4 ] = "
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.7 Causing Side Effects\nThis program inadvertently changes the value of a variable when it accesses a nonexistent element of\nan array:\nNote : Python automatically increase size of array/list. so it wont give error and output would be differ than c gives.\n'''\n\na = [ 22.2, 44.4, 66.6 ]\nx=11.1\nprint \"x = \" , x \na.append(88.8) # ERROR: index is out of bounds!\nprint \"x = \" , x \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " x = 11.1\nx = 11.1\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.8 Causing Unhandled Exceptions\nThis program crashes because the array index gets too big:\n'''\na = [ 22.2, 44.4, 66.6 ]\nx=11.1\nprint \"x = \" , x \na[3333] = 88.8 # ERROR: index is out of bounds!\nprint \"x = \" , x \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IndexError",
+ "evalue": "list assignment index out of range",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-8-63b6c8e60294>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m11.1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"x = \"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0ma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m3333\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m88.8\u001b[0m \u001b[1;31m# ERROR: index is out of bounds!\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"x = \"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIndexError\u001b[0m: list assignment index out of range"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x = 11.1\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.9 Passing an Array to a Function that Returns its Sum\n'''\n\ndef sum_(a):\n s = 0\n for i in a:\n s += i\n return s\n \na = [ 11, 33, 55, 77 ]\nprint \"sum(a) = \" , sum_(a) \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "sum(a) = 176\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.10 Input and Output Functions for an Array\nThis program uses a read() function to input values into the array a interactively. Then it uses a\nprint() function to print the array:\n'''\ndef read(a):\n print \"Enter integers. Terminate with 0:\\n\"\n n = 1\n while True:\n n = int(raw_input(\"a[\" + str(len(a)) + \"]: \"))\n if n == 0:\n break\n a.append(n)\n \n\ndef print_(a):\n for i in a:\n print i ,\n\n\na = []\nread(a)\nprint \"The array has \" , len(a) , \" elements: \"\nprint_(a)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter integers. Terminate with 0:\n\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a[0]: 11\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a[1]: 22\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a[2]: 33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a[3]: 44\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a[4]: 0\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The array has 4 elements: \n11 22 33 44\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.11 Printing the Memory Location of an Array\nThis program prints the value of the address stored in an array name.\n'''\nimport sys\na = [ 22, 44, 66, 88 ]\nprint \"a = \" , id(a) # the address of a[0]\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a = 169156908\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.12 The Linear Search\nThis program tests a function that implements the Linear Search algorithm:\n'''\ndef index(x,a,n):\n for i in range(len(a)):\n if (a[i] == x):\n return i\n return n # x not found\n\na = [ 22, 44, 66, 88, 44, 66, 55 ]\nprint \"index(44,a,7) = \" , index(44,a,7)\nprint \"index(50,a,7) = \" , index(50,a,7) \n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "index(44,a,7) = 1\nindex(50,a,7) = 7\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.13 The Bubble Sort\nThis program tests a function that implements the Bubble Sort algorithm.\n'''\ndef sort(a,n):\n # bubble sort:\n n = len(a)\n for i in range(n):\n # bubble up max{a[0..n-i]}:\n for j in range(n-i-1):\n if (a[j] > a[j+1]):\n a[j],a[j+1] = a[j+1],a[j]\n\ndef print_(a):\n for i in range(len(a)):\n print a[i],\n print ''\n \na = [55.5, 22.5, 99.9, 66.6, 44.4, 88.8, 33.3, 77.7]\n\nprint_(a)\nsort(a,8)\nprint_(a)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55.5 22.5 99.9 66.6 44.4 88.8 33.3 77.7 \n22.5 33.3 44.4 55.5 66.6 77.7 88.8 99.9 \n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.14 The Binary Search Algorithm\n'''\n\ndef index(x,a,n):\n # PRECONDITION: a[0] <= a[1] <= ... <= a[n-1];\n # binary search:\n lo=0\n hi=n-1\n while (lo <= hi):\n i = (lo + hi)/2 # the average of lo and hi\n if (a[i] == x):\n return i\n if (a[i] < x):\n lo = i+1 # continue search in a[i+1..hi]\n else:\n hi = i-1 # continue search in a[lo..i-1]\n return n # x was not found in a[0..n-1]\n\na = [ 22, 33, 44, 55, 66, 77, 88 ]\nprint \"index(44,a,7) = \" , index(44,a,7)\nprint \"index(60,a,7) = \" , index(60,a,7) \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "index(44,a,7) = 2\nindex(60,a,7) = 7\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.15 Determining whether an Array is Sorted\nThis program tests a boolean function that determines whether a given array is nondecreasing.\n'''\n\ndef isNondecreasing(a,n):\n # returns true iff a[0] <= a[1] <= ... <= a[n-1]:\n for i in range(1,n):\n if (a[i]<a[i-1]):\n return False\n return True\n\na = [ 22, 44, 66, 88, 44, 66, 55 ]\nprint \"isNondecreasing(a,4) = \" , isNondecreasing(a,4)\nprint \"isNondecreasing(a,7) = \" , isNondecreasing(a,7)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "isNondecreasing(a,4) = True\nisNondecreasing(a,7) = False\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.16 Using the assert() Function to Enforce a Precondition\nThis program tests an improved version of the search() function from Example 6.14. This version\nuses the isNondecreasing() function from Example 6.15 to determine whether the array is sorted. It\npasses the resulting boolean return value to the assert() function so that the search will not be carried\nout if the array is not sorted:\n'''\n\ndef isNondecreasing(a,n):\n # returns true iff a[0] <= a[1] <= ... <= a[n-1]:\n for i in range(1,n):\n if (a[i]<a[i-1]):\n return False\n return True\n\n\ndef index(x,a,n):\n # PRECONDITION: a[0] <= a[1] <= ... <= a[n-1];\n # binary search:\n assert(isNondecreasing(a,n)) \n \n lo=0\n hi=n-1\n while (lo <= hi):\n i = (lo + hi)/2\n if (a[i] == x):\n return i\n if (a[i] < x):\n lo = i+1 # continue search in a[i+1..hi]\n else:\n hi = i-1 # continue search in a[lo..i-1]\n return n # x was not found in a[0..n-1]\n\na = [ 22, 33, 44, 55, 66, 77, 88, 60 ]\nprint \"index(44,a,7) = \" , index(44,a,7) \nprint \"index(44,a,8.py) = \" , index(44,a,8) \nprint \"index(60,a,7) = \" , index(60,a,8)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "AssertionError",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mAssertionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-18-3a784dd6b25e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 34\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m \u001b[1;36m22\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m33\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m44\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m55\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m66\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m77\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m88\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m60\u001b[0m \u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 35\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"index(44,a,7) = \"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m44\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m7\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 36\u001b[1;33m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"index(44,a,7) = \"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m44\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m8\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 37\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"index(60,a,7) = \"\u001b[0m \u001b[1;33m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m60\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m8\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;32m<ipython-input-18-3a784dd6b25e>\u001b[0m in \u001b[0;36mindex\u001b[1;34m(x, a, n)\u001b[0m\n\u001b[0;32m 18\u001b[0m \u001b[1;31m# PRECONDITION: a[0] <= a[1] <= ... <= a[n-1];\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 19\u001b[0m \u001b[1;31m# binary search:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 20\u001b[1;33m \u001b[1;32massert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0misNondecreasing\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mn\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 21\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 22\u001b[0m \u001b[0mlo\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mAssertionError\u001b[0m: "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "index(44,a,7) = 2\nindex(44,a,7) = "
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.17 Enumerating the Days of the Week\nThis program defines an array high[] of seven floats, representing the high temperatures for\nthe seven days of a week: 138\n'''\nDay = [ 0, 1, 2, 3, 4, 5, 6 ]\nhigh = [ 88.3, 95.0, 91.2, 89.9, 91.4, 92.5, 86.7]\n\nfor i in Day:\n print \"The high temperature for day \" , i , \" was \" , high[i] \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " The high temperature for day 0 was 88.3\nThe high temperature for day 1 was 95.0\nThe high temperature for day 2 was 91.2\nThe high temperature for day 3 was 89.9\nThe high temperature for day 4 was 91.4\nThe high temperature for day 5 was 92.5\nThe high temperature for day 6 was 86.7\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.18 The Bubble Sort Again\n'''\n\ndef sort(a,n):\n a.sort()\n\ndef print_(a,n):\n for i in a:\n print i,\n print ''\na = [55.5, 22.5, 99.9, 66.6, 44.4, 88.8, 33.3, 77.7]\nprint_(a,8);\nsort(a,8)\nprint_(a,8)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55.5 22.5 99.9 66.6 44.4 88.8 33.3 77.7 \n22.5 33.3 44.4 55.5 66.6 77.7 88.8 99.9 \n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.19 Reading and Printing a Two-Dimensional Array\nThis program shows how a two-dimensional array can be processed:\n'''\n\ndef read(a):\n print \"Enter 15 integers, 5 per row:\\n\"\n for i in range(3):\n ar = []\n print \"Row \" , i , \": \",\n for j in range(5):\n ar.append(int(raw_input()))\n a.append(ar)\n\ndef print_(a):\n for i in range(3):\n for j in range(5):\n print a[i][j],\n print ''\na = []\nread(a)\nprint_(a)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter 15 integers, 5 per row:\n\nRow 0 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "11\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Row 1 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "60\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "50\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "30\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "90\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "70\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Row 2 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "85\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "25\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "45\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "45\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "55\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 44 77 33 11 44 \n60 50 30 90 70 \n85 25 45 45 55 \n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.20 Processing a Two-Dimensional Array of Quiz Scores\n'''\ndef read(score):\n for s in range(3):\n print \"Student \" , s , \": \",\n st = []\n for q in range(5):\n st.append(int(raw_input()))\n score.append(st)\n\ndef printQuizAverages(score):\n for s in range(3):\n sm = 0\n for q in range(5):\n sm += score[s][q]\n print \"\\tStudent \" , s , \": \" , sm/5.0\n\ndef printClassAverages(score):\n for q in range(5):\n sm = 0\n for s in range(3):\n sm += score[s][q]\n print \"\\tQuiz \" , q , \": \" , sm/3.0\n\n\n\nNUM_STUDENTS = 3\nNUM_QUIZZES = 5\n\n\nscore = []\nprint \"Enter \" , NUM_QUIZZES , \" scores for each student: \"\nread(score)\nprint \"The quiz averages are:\"\nprintQuizAverages(score)\nprint \"The class averages are: \"\nprintClassAverages(score)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter 5 scores for each student: \nStudent 0 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Student 1 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Student 2 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "5\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "6\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "7\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " The quiz averages are:\n\tStudent 0 : 8.2\n\tStudent 1 : 8.8\n\tStudent 2 : 7.0\nThe class averages are: \n\tQuiz 0 : 7.33333333333\n\tQuiz 1 : 7.33333333333\n\tQuiz 2 : 8.33333333333\n\tQuiz 3 : 8.33333333333\n\tQuiz 4 : 8.66666666667\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 6.21 Processing a Three-Dimensional Array\nThis program simply counts the number of zeros in a three-dimensional array:\n'''\n\ndef numZeros(a,n1,n2,n3):\n count = 0\n for i in range(n1):\n for j in range(n2):\n for k in range(n3):\n if (a[i][j][k] == 0):\n count += 1\n return count\n\n\na = [ [ [5,0,2], [0,0,9], [4,1,0], [7,7,7] ],[ [3,0,0], [8,5,0], [0,0,0], [2,0,9] ]]\nprint \"This array has \" , numZeros(a,2,4,3) , \" zeros\"\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "This array has 11 zeros\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch7.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch7.ipynb
new file mode 100644
index 00000000..f480fc86
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch7.ipynb
@@ -0,0 +1,329 @@
+{
+ "metadata": {
+ "name": "ch7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.1 Printing Pointer Values\n'''\n\nn=44\nprint \"n = \" , n \n# prints the value of n\nprint \"&n = \" , hex(id(n)) # prints the address of n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 44\n&n = 0x8fc0eec\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.2\nNote : Python doesn't support reference/pointer variable. But can be achieved by using mutable datatypes i.e. list.\n'''\n\n\nn = [44]\nrn=n # r is a synonym for n\nprint \"n = \" , n , \", rn = \" , rn \nn[0] -= 1\nprint \"n = \" , n , \", rn = \" , rn \nrn[0] *= 2\nprint \"n = \" , n , \", rn = \" , rn \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = [44] , rn = [44]\nn = [43] , rn = [43]\nn = [86] , rn = [86]\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.3 References Are Not Separate Variables\n'''\n\n\nn = [44]\nrn=n # r is a synonym for n\nprint \"&n = \" , hex(id(n)) , \", rn = \" , hex(id(rn ))\nrn2 = n\nrn3 = rn\nprint \"&rn2 = \" , hex(id(rn2)) , \", rn = \" , hex(id(rn ))\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "&n = 0x9c6228c , rn = 0x9c6228c\n&rn2 = 0x9c6228c , rn = 0x9c6228c\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.4 Using Pointer Variables\n\n'''\n\nn = [44]\nprint \"n = \" , n , \", &n = \" , hex(id(n))\npn = n\nprint \"pn = \" , hex(id(pn)) , \", &pn = \" , hex(id(hex(id(pn))))\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = [44] , &n = 0x9c624ec\npn = 0x9c624ec , &pn = 0x9c6aa60\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.5\n'''\n\nn = [44]\nprint \"n = \" , n , \", &n = \" , hex(id(n))\npn = n\nprint \"\\tpn = \" , hex(id(pn)) , \",\\n &pn = \" , hex(id(hex(id(pn))))\nprint \"*pn = \" , pn\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = [44] , &n = 0x9c58d6c\n\tpn = 0x9c58d6c ,\n &pn = 0x9c6ab20\n*pn = [44]\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.6 \n'''\n\nn = [44]\nprint \"n = \" , n , \", &n = \" , hex(id(n))\npn = n\nprint \"\\tpn = \" , hex(id(pn)) , \",\\n &pn = \" , hex(id(hex(id(pn))))\nprint \"*pn = \" , pn\nppn = pn\n\nprint \" ppn = \" , hex(id(hex(id(ppn)))) \nprint \" &ppn = \" , hex(id(hex(id(hex(id(ppn))))))\nprint \" *ppn = \" , hex(id(ppn)) \nprint \"**ppn = \" , ppn \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = [44] , &n = 0x9bf05ac\n\tpn = 0x9bf05ac ,\n &pn = 0x9c58160\n*pn = [44]\n ppn = 0x9c58680\n &ppn = 0x9c58160\n *ppn = 0x9bf05ac\n**ppn = [44]\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.7\n'''\n\nn = [44]\nprint \"n = \" , n , \"\\n &n = \" , hex(id(n))\npn = n\nprint \"\\tpn = \" , hex(id(pn)) , \",\\n &pn = \" , hex(id(hex(id(pn))))\nprint \"*pn = \" , pn\nnn = pn\nprint \" ppn = \" , hex(id(nn))\nprint \" &ppn = \" , hex(id(hex(id(nn))))\nrpn = pn\nprint \" ppn = \" , hex(id(rpn))\nprint \" &ppn = \" , hex(id(hex(id(rpn))))\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = [44] \n &n = 0x9bf60ec\n\tpn = 0x9bf60ec ,\n &pn = 0x9bf0e40\n*pn = [44]\n ppn = 0x9bf60ec\n &ppn = 0x9bf0e40\n ppn = 0x9bf60ec\n &ppn = 0x9bf0f20\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.8\n'''\n\ndef max_(m,n):\n if m>n:\n return m\n else:\n return n\n\nm = 44\nn = 22\nprint m , \", \" , n , \", \" , max_(m,n)\nm = max_(m,n) \nm = 55\n# changes the value of m from 44 to 55\nprint m , \", \" , n , \", \" , max_(m,n) \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44 , 22 , 44\n55 , 22 , 55\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.9 \n'''\n\nv = []\nfor k in range(1,5):\n v.append(1.0/k)\n\nfor i in range(4):\n print \"v[\" , i , \"] = \" , v[i]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "v[ 0 ] = 1.0\nv[ 1 ] = 0.5\nv[ 2 ] = 0.333333333333\nv[ 3 ] = 0.25\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.10 \n'''\nimport sys\na = [22, 33, 44]\n\nprint \"a = \" , hex(id(a))\nprint \"sizeof(int) = \" , sys.getsizeof(1) \ns = 0\nfor i in a:\n s += i\n print \"\\t i = \" , hex(id(i)),\n print \"\\t *i = \" , i,\n print \"\\t sum = \" , s\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a = 0x9bf688c\nsizeof(int) = 12\n\t i = 0x8fc0ff4 \t *i = 22 \t sum = 22\n\t i = 0x8fc0f70 \t *i = 33 \t sum = 55\n\t i = 0x8fc0eec \t *i = 44 \t sum = 99\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.11 Examining the Addresses of Array Elements\n'''\n\na = [22, 33, 44, 55, 66]\nprint \"a = \" , hex(id(a)) , \", *a = \" , a[0] \nfor p in a:\n print \"p = \" , hex(id(p)) , \", *p = \" , p \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "a = 0x9c6526c , *a = 22\np = 0x8fc0ff4 , *p = 22\np = 0x8fc0f70 , *p = 33\np = 0x8fc0eec , *p = 44\np = 0x8fc0e68 , *p = 55\np = 0x8fc0de4 , *p = 66\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.12 Pattern Matching\n'''\n\ndef loc(a1,a2,n1,n2):\n p = []\n for element in a2:\n if element in a1:\n p.append(element)\n return p\n\na1 = [11, 11, 11, 11, 11, 22, 33, 44, 55]\na2 = [11, 11, 11, 22, 33]\nprint \"Array a1 begins at location\\t\" , hex(id(a1 ))\nprint \"Array a2 begins at location\\t\" , hex(id(a2)) \np = loc(a1, a2, 9, 5)\nif (p):\n print \"Array a2 found at location\\t\" , hex(id(p))\n for i in range(len(p)):\n print \"\\t\" , hex(id(p[i])) , \": \" , p[i], \"\\t\" , hex(id(a2[i])) , \": \" , a2[i] \nelse:\n print \"Not found.\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Array a1 begins at location\t0x9bea56c\nArray a2 begins at location\t0x9bea62c\nArray a2 found at location\t0x9bea6cc\n\t0x8fc1078 : 11 \t0x8fc1078 : 11\n\t0x8fc1078 : 11 \t0x8fc1078 : 11\n\t0x8fc1078 : 11 \t0x8fc1078 : 11\n\t0x8fc0ff4 : 22 \t0x8fc0ff4 : 22\n\t0x8fc0f70 : 33 \t0x8fc0f70 : 33\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.15 Using Dynamic Arrays\n'''\n\ndef get(a):\n print \"Enter number of items: \"\n n = int(raw_input())\n print \"Enter \" , n , \" items, one per line:\"\n for i in range(n):\n print \"\\t\" , i+1 , \": \",\n a.append(float(raw_input()))\n\ndef print_(a):\n for i in range(len(a)):\n print a[i] ,\n print ''\n\na = []\nget(a)\nprint_(a)\na = []\nget(a)\nprint_(a)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter number of items: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "4\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter 4 items, one per line:\n\t1 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44.4\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t2 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "77.7\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t3 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22.2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t4 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "88.8\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 44.4 77.7 22.2 88.8 \nEnter number of items: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter 2 items, one per line:\n\t1 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3.33\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " \t2 : "
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "9.99\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " 3.33 9.99 \n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.17 Indirect Bubble Sort\n'''\n\ndef sort(p, n):\n for i in range(1,n):\n for j in range(n-i):\n if (p[j] > p[j+1]):\n p[j],p[j+1] = p[j+1],p[j]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 7.18 The Sum of a Function\n'''\n\ndef sum_(k,n):\n # returns the sum f(0) + f(1) + f(2) + . . . + f(n-1):\n s = 0\n for i in range(1,n+1):\n s += k(i)\n return s\n\ndef square(k):\n return k*k\n\ndef cube(k):\n return k*k*k\n\n\nprint sum_(square,4) # 1 + 4 + 9 + 16\nprint sum_(cube,4) # 1 + 8 + 27 + 64\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "30\n100\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch8.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch8.ipynb
new file mode 100644
index 00000000..033f6e3f
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch8.ipynb
@@ -0,0 +1,492 @@
+{
+ "metadata": {
+ "name": "ch8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "\"\"\"\nEXAMPLE 8.1\n\"\"\"\n\nn= [44] # n holds the int 44\nprint \"int n=44; // n holds the int 44:\\n\";\nprint \"\\t\\t n = \" , n \nprint \"\\t\\t &n = \" , hex(id(n))\npn = n \nprint \"int* pn=&n; // pn holds the address of n:\\n\";\nprint \"\\t\\t n = \" , n \nprint \"\\t\\t &n = \" , hex(id(n))\nprint \"\\t\\t pn = \" , hex(id(pn)) \nprint \"\\t\\t &pn = \" , hex(id(hex(id(pn))))\nprint \"\\t\\t *pn = \" , pn\n\npn[0] = 77 # changes the value of n to 77\nprint \"*pn = 77; // changes the value of n to 77:\\n\";\nprint \"\\t\\t n = \" , n \nprint \"\\t\\t &n = \" , hex(id(n))\nprint \"\\t\\t pn = \" , hex(id(pn)) \nprint \"\\t\\t &pn = \" , hex(id(hex(id(pn))))\nprint \"\\t\\t *pn = \" , pn\n\nq = n \nprint \"int* q=&n; // q also holds the address of n:\\n\";\nprint \"\\t\\t n = \" , n \nprint \"\\t\\t &n = \" , hex(id(n))\nprint \"\\t\\t pn = \" , hex(id(pn)) \nprint \"\\t\\t &pn = \" , hex(id(hex(id(pn))))\nprint \"\\t\\t *pn = \" , pn\nprint \"\\t\\t q = \" , hex(id(q))\nprint \"\\t\\t &q = \" , hex(id(hex(id(hex(id(pn))))))\nprint \"\\t\\t *q = \" , q \n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "int n=44; // n holds the int 44:\n\n\t\t n = [44]\n\t\t &n = 0x9bfb92c\nint* pn=&n; // pn holds the address of n:\n\n\t\t n = [44]\n\t\t &n = 0x9bfb92c\n\t\t pn = 0x9bfb92c\n\t\t &pn = 0x9bf5aa0\n\t\t *pn = [44]\n*pn = 77; // changes the value of n to 77:\n\n\t\t n = [77]\n\t\t &n = 0x9bfb92c\n\t\t pn = 0x9bfb92c\n\t\t &pn = 0x9c6a760\n\t\t *pn = [77]\nint* q=&n; // q also holds the address of n:\n\n\t\t n = [77]\n\t\t &n = 0x9bfb92c\n\t\t pn = 0x9bfb92c\n\t\t &pn = 0x9bf5c80\n\t\t *pn = [77]\n\t\t q = 0x9bfb92c\n\t\t &q = 0x9c6a760\n\t\t *q = [77]\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.2\nNote : Python does not append '\\0' at the end of string.\n'''\n\ns = \"ABCD\"\nfor i in range(4):\n print \"s[\" , i , \"] = '\" , s[i] , \"'\\n\";\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s[ 0 ] = ' A '\n\ns[ 1 ] = ' B '\n\ns[ 2 ] = ' C '\n\ns[ 3 ] = ' D '\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.3\n'''\n\nwhile True:\n word = raw_input()\n if len(word) < 2:\n break\n l = word.split(' ')\n for i in l:\n print '\\t\"' , i , '\"'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Today's date is March 12, 2000.\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t\" Today's \"\n\t\" date \"\n\t\" is \"\n\t\" March \"\n\t\" 12, \"\n\t\" 2000. \"\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Tomorrow is Monday.\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t\" Tomorrow \"\n\t\" is \"\n\t\" Monday. \"\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.4\nThis program echoes the input, line by line:\n'''\n\nwhile True:\n line = raw_input()\n if len(line) < 2:\n break\n print \"\\t[\" , line , \"]\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Once upon a midnight dreary, while I pondered, weak and weary,\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t[ Once upon a midnight dreary, while I pondered, weak and weary, ]\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Over a many quaint and curious volume of forgotten lore,\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t[ Over a many quaint and curious volume of forgotten lore, ]\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.5\n'''\n\n\nwhile True:\n word = raw_input()\n if len(word) < 2:\n break\n l = word.split(',')\n for i in range(len(l)-1):\n print '\\t[' , l[i] , ']'\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Once upon a midnight dreary, while I pondered, weak and weary,\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t[ Once upon a midnight dreary ]\n\t[ while I pondered ]\n\t[ weak and weary ]\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Over a many quaint and curious volume of forgotten lore,\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t[ Over a many quaint and curious volume of forgotten lore ]\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.6 \nThis program counts the number of occurrences of the letter 'e' in the input stream. \n'''\n\ncount = 0\nwhile True:\n a = raw_input()\n if len(a) < 1:\n break\n for ch in a:\n if (ch == 'e'): count+=1\n \nprint count , \" e's were counted.\\n\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Once upon a midnight dreary, while I pondered, weak and weary,\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Over many a quaint and curious volume of forgotten lore,\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "11 e's were counted.\n\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.7 \nThis program echoes the input stream, capitalizing each word:\n'''\n\nwhile True:\n a = raw_input()\n if len(a) < 1:\n break\n print a.title()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Fourscore and seven years ago our fathers\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Fourscore And Seven Years Ago Our Fathers\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "brought forth upon this continent a new nation,\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Brought Forth Upon This Continent A New Nation,\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.8\nThis tests a function that extracts the integers from the input stream:\n'''\n\na = raw_input()\nl = a.split(' ')\nnos = []\nfor i in l:\n try:\n i = int(i)\n nos.append(i)\n except:\n continue\nm = nos[0]\nn = nos[1] \nprint m , \" + \" , n , \" = \" , m+n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "what is 305 plus 9416 ?\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "305 + 9416 = 9721\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.10 An Array of Strings\n'''\n\nname = []\ncount=0\n\nprint \"Enter at most 4 names with at most 19 characters:\\n\";\nwhile (True):\n n = raw_input()\n if len(n) < 1:\n break\n name.append(n)\n count += 1\n \nprint \"The names are:\\n\"\nfor i in range(count):\n print \"\\t\" , i , \". [\" , name[i] , \"]\" \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter at most 4 names with at most 19 characters:\n\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "George Washington\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "John Adams\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Thomas Jefferson\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The names are:\n\n\t0 . [ George Washington ]\n\t1 . [ John Adams ]\n\t2 . [ Thomas Jefferson ]\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.11 A String Array\n'''\n\nname = []\ncount=0\n\nprint \"Enter at most 4 names with at most 19 characters:\\n\";\nwhile (True):\n n = raw_input()\n if len(n) < 1:\n break\n name.append(n)\n count += 1\n \nprint \"The names are:\\n\"\nfor i in range(count):\n print \"\\t\" , i , \". [\" , name[i] , \"]\" ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Enter at most 4 names with at most 19 characters:\n\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "George Washington\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "John Adams\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Thomas Jefferson\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The names are:\n\n\t0 . [ George Washington ]\n\t1 . [ John Adams ]\n\t2 . [ Thomas Jefferson ]\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.12 Initializing a String Array\nThis program is nearly equivalent to those in the previous two examples. It initializes the array/list\nname and then prints its contents:\n'''\n\nname = [ \"George Washington\", \"John Adams\", \"Thomas Jefferson\"]\nprint \"The names are:\\n\"\nfor i in range(3):\n print \"\\t\" , i , \". [\" , name[i] , \"]\"\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The names are:\n\n\t0 . [ George Washington ]\n\t1 . [ John Adams ]\n\t2 . [ Thomas Jefferson ]\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.13 The len() Function\n'''\n\ns = \"ABCDEFG\"\nprint \"len(\" , s , \") = \" , len(s) \nprint \"len(\\\"\\\") = \" , len(\"\")\nprint \"Enter string: \"\nb = raw_input()\nprint \"len(\" , b , \") = \" , len(b)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "len( ABCDEFG ) = 7\nlen(\"\") = 0\nEnter string: \n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "hello how are you !!!\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "len( hello how are you !!! ) = 21\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.14 \ngives index of substring.\n'''\ns = \"The Mississippi is a long river.\"\nprint 's = \"' , s , '\"'\np = s.find(' ')\nprint \"find(s, ' ') points to s[\" , p , \"].\"\np = s.find('s')\nprint \"find(s, 's') points to s[\" , p , \"].\"\np = s.rfind('s')\nprint \"reverse find(s, 's') points to s[\" , p , \"].\"\np = s.find(\"is\")\nprint \"strstr(s, \\\"is\\\") points to s[\" , p , \"].\"\np = s.find(\"isi\")\nif p== -1:\n print 's.find(\"isi\") returns NULL'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s = \" The Mississippi is a long river. \"\nfind(s, ' ') points to s[ 3 ].\nfind(s, 's') points to s[ 6 ].\nreverse find(s, 's') points to s[ 17 ].\nstrstr(s, \"is\") points to s[ 5 ].\ns.find(\"isi\") returns NULL\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.15 string copy\n'''\ns1 = \"ABCDEFG\"\ns2 = \"XYZ\" \nprint \"Before strcpy(s1,s2):\\n\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) \ns1 = s2\nprint \"After strcpy(s1,s2):\\n\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Before strcpy(s1,s2):\n\n\ts1 = [ ABCDEFG ], length = 7\n\ts2 = [ XYZ ], length = 3\nAfter strcpy(s1,s2):\n\n\ts1 = [ XYZ ], length = 3\n\ts2 = [ XYZ ], length = 3\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.16 string copy\n'''\n\ns1 = \"ABCDEFG\"\ns2 = \"XYZ\" \nprint \"Before strcpy(s1,s2,2):\\n\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) \ns1 = s2[:2] + s1[2:]\nprint \"After strcpy(s1,s2,2):\\n\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) \n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Before strcpy(s1,s2,2):\n\n\ts1 = [ ABCDEFG ], length = 7\n\ts2 = [ XYZ ], length = 3\nAfter strcpy(s1,s2,2):\n\n\ts1 = [ XYCDEFG ], length = 7\n\ts2 = [ XYZ ], length = 3\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.17 The String Concatenation\n'''\n\ns1 = \"ABCDEFG\"\ns2 = \"XYZ\" \nprint \"Before string concatination :\\n\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) \ns1 += s2\nprint \"After string concatination :\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Before string concatination :\n\n\ts1 = [ ABCDEFG ], length = 7\n\ts2 = [ XYZ ], length = 3\nAfter string concatination :\n\ts1 = [ ABCDEFGXYZ ], length = 10\n\ts2 = [ XYZ ], length = 3\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.18 The Second String Concatenation (no. of characters)\n'''\n\ns1 = \"ABCDEFG\"\ns2 = \"XYZ\" \nprint \"Before string concatination :\\n\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) \ns1 += s2[:2]\nprint \"After string concatination :\" \nprint \"\\ts1 = [\" , s1 , \"], length = \" , len(s1) \nprint \"\\ts2 = [\" , s2 , \"], length = \" , len(s2) ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Before string concatination :\n\n\ts1 = [ ABCDEFG ], length = 7\n\ts2 = [ XYZ ], length = 3\nAfter string concatination :\n\ts1 = [ ABCDEFGXY ], length = 9\n\ts2 = [ XYZ ], length = 3\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.19 The String Tokenize \n'''\ns = \"Today's date is March 12, 2000.\"\n\nprint \"The string is: [\" , s , \"] \\nIts tokens are: \"\np = s.split(\" \")\n\nfor i in p:\n print \"\\t[\" , i , \"] \"\n\nprint \"Now the string is: [\" , p[0] , \"] \";\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The string is: [ Today's date is March 12, 2000. ] \nIts tokens are: \n\t[ Today's ] \n\t[ date ] \n\t[ is ] \n\t[ March ] \n\t[ 12, ] \n\t[ 2000. ] \nNow the string is: [ Today's ] \n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 8.20 The strpbrk() Function\nC provides inbuilt strpbrk(), Here i have written mine.\n'''\n\ndef strpbrk(s,s1):\n found = []\n for i in range(len(s1)):\n if s1[i] in s:\n index = s.find(s1[i])\n found.append(index)\n if found:\n return min(found)\n return None\n \n\ns = \"The Mississippi is a long river.\"\nprint 's = \"' , s , '\"'\np = strpbrk(s, \"nopqr\")\nprint 'strpbrk(s, \"nopqr\") points to s[' , p , \"].\"\np = strpbrk(s, \"NOPQR\")\nif (p == None):\n print 'strpbrk(s, \"NOPQR\") returns NULL.\\n'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s = \" The Mississippi is a long river. \"\nstrpbrk(s, \"nopqr\") points to s[ 12 ].\nstrpbrk(s, \"NOPQR\") returns NULL.\n\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch9.ipynb b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch9.ipynb
new file mode 100644
index 00000000..fabb9a56
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/ch9.ipynb
@@ -0,0 +1,232 @@
+{
+ "metadata": {
+ "name": "ch9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 9.2 Using the Extraction Operation to Control a Loop\n'''\n\n\nwhile True:\n try:\n n = int(raw_input())\n print \"n = \" , n \n except:\n break",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "46\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 46\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "22\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 22\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "44\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 44\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "66\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 66\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "88\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "n = 88\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "33,\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 9.4 Inputting Strings with the raw_input() Function\nThis program shows how to read text data line-by-line into an array \n'''\n\nking = [] # defines king to be an array \nn=0\nwhile True:\n name = raw_input()\n if len(name) < 1:\n break\n king.append(name)\n n += 1\n# now n == the number of names read\nfor i in range(n):\n print '\\t' , i+1 , \". \" , king[i] ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Kenneth II (971-995)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Constantine III (995-997)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Kenneth III (997-1005)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Malcolm II (1005-1034)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Duncan I (1034-1040)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Macbeth (1040-1057)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Lulach (1057-1058)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Malcolm III (1058-1093)\n"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\t1 . Kenneth II (971-995)\n\t2 . Constantine III (995-997)\n\t3 . Kenneth III (997-1005)\n\t4 . Malcolm II (1005-1034)\n\t5 . Duncan I (1034-1040)\n\t6 . Macbeth (1040-1057)\n\t7 . Lulach (1057-1058)\n\t8 . Malcolm III (1058-1093)\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 9.6 Capitalizing All the Words in a Text File\nHere is a complete program that reads words from the external file named input.txt, capitalizes\nthem, and then writes them to the external file named output.txt:\nNote : Working good , you need input.txt in same directory.\n'''\n\ninfile = open(\"input.txt\",\"r\")\noutfile = open(\"output.txt\",\"w\")\n\nfor i in infile:\n s = i.title()\n outfile.write(s)\n\ninfile.close()\noutfile.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IOError",
+ "evalue": "[Errno 2] No such file or directory: 'input.txt'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-3-60ee428ecf4c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m '''\n\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0minfile\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"input.txt\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"r\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[0moutfile\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"output.txt\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"w\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'input.txt'"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 9.7 Merging Two Sorted Data Files\n'''\n\nfin1 = open(\"north.dat\",\"r\")\nfin2 = open(\"south.dat\",\"r\")\nfout = open(\"combined.dat\",\"w\")\n\nfile1 = []\nfile2 = []\nfor i in fin1:\n try:\n s = i.split(\" \")\n for j in s:\n file1.append(int(j))\n except:\n continue\n \nfor i in fin2:\n try:\n s = i.split(\" \")\n for j in s:\n file2.append(int(j))\n except:\n continue\n\n\nfor i in sorted(file1 + file2):\n fout.write(str(i) + \" \")\n\nfin1.close()\nfin2.close()\nfout.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IOError",
+ "evalue": "[Errno 2] No such file or directory: 'north.dat'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-4-e14718f30215>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 3\u001b[0m '''\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mfin1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"north.dat\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"r\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[0mfin2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"south.dat\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"r\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mfout\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"combined.dat\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"w\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'north.dat'"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 9.8 Using an Output String Stream\nThis program creates four objects: a character string s,\nan integer n, a floating-point number x, and an output string stream oss:\n'''\n\ndef print_(oss):\n print 'oss.str() = \"' , str(oss) , '\"'\n\ns=\"ABCDEFG\"\nn=33\nx=2.718\nl = ''\nprint_(l)\nl += s\nprint_(l)\nl += ( \" \" + str(n) )\nprint_(l)\nl += ( \" \" + str(x) )\nprint_(l)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "oss.str() = \" \"\noss.str() = \" ABCDEFG \"\noss.str() = \" ABCDEFG 33 \"\noss.str() = \" ABCDEFG 33 2.718 \"\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''\nEXAMPLE 9.9 Using an Input String Stream iss ABCDEFG 44 3.14 istringstream\nThis program is similar to the one in Example 9.8 \nexcept that it reads from an input string stream iss\ninstead of writing to an output string stream.:\n'''\n'''\nEXAMPLE 9.8 Using an Output String Stream\nThis program creates four objects: a character string s,\nan integer n, a floating-point number x, and an output string stream oss:\n'''\n\ndef print_(iss,s='',n=0,x=0.0):\n print 's = \"' , s , '\", n = ' , n , \", x = \" , x, ', iss.str() = \"' \\\n , iss , '\"' \n\ns=\"\"\nn=0\nx=0.0\nl = ''\niss = \"ABCDEFG 44 3.14\"\nprint_(iss)\ns = \"ABCDEFG\"\nprint_(iss,s)\nn = 44\nprint_(iss,s,n)\nx = 3.14\nprint_(iss,s,n,x)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "s = \" \", n = 0 , x = 0.0 , iss.str() = \" ABCDEFG 44 3.14 \"\ns = \" ABCDEFG \", n = 0 , x = 0.0 , iss.str() = \" ABCDEFG 44 3.14 \"\ns = \" ABCDEFG \", n = 44 , x = 0.0 , iss.str() = \" ABCDEFG 44 3.14 \"\ns = \" ABCDEFG \", n = 44 , x = 3.14 , iss.str() = \" ABCDEFG 44 3.14 \"\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu1.png b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu1.png
new file mode 100644
index 00000000..13e13f29
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu1.png
Binary files differ
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu2.png b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu2.png
new file mode 100644
index 00000000..e1bc353c
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu2.png
Binary files differ
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu3.png b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu3.png
new file mode 100644
index 00000000..60dd1e4b
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashu3.png
Binary files differ
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-1_1.png b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-1_1.png
new file mode 100644
index 00000000..13e13f29
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-1_1.png
Binary files differ
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-2_1.png b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-2_1.png
new file mode 100644
index 00000000..e1bc353c
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-2_1.png
Binary files differ
diff --git a/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-3_1.png b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-3_1.png
new file mode 100644
index 00000000..60dd1e4b
--- /dev/null
+++ b/Engineering_Thermodynamics:_A_Computer_Approach_(SI_Units_Version)/screenshots/ashutosh-3-3_1.png
Binary files differ
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_1_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_1_1.ipynb
new file mode 100644
index 00000000..43fa32ce
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_1_1.ipynb
@@ -0,0 +1,322 @@
+{
+ "metadata": {
+ "name": "Chapter 1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter1: Fluid Statics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.1,Page 3"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Force\n\n# Variable Decleration\nrho=924; #density\ng=9.81; #grivity\nH=2; #height\nd=2; # depth \n\n#Calculation\np=rho*g*H;\na=d*H;\nF=p*a/2;\n\n#result\nprint\" Total force exerted over the wall in(N) =\",round(F,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Total force exerted over the wall in(N) = 36257.76\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.2,Page 5"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Force and Pressure\nimport math\n\n#Variable declaration\np_v =50*1000; #pressure\nr =1; #m\np_atm =101.3*1000; #atmospheric pressure\nrho =1000; #density\nH =2.5; #m\ng =9.81; #m/s^2\n\n\n#Calculation\nF= p_v*math.pi*r*r;\np= p_atm + p_v + rho *g*H;\nFd =( p_v+ rho *g*H)*math.pi*r*r+rho*g*2*math.pi*r*r/3;\n\n#result\nprint \" Total vertical force tending to lift the dome (N)\", round(F,3)\nprint \" Absolute pressure at the bottom o f the vessel (Pa)\",round(p,3)\nprint \"Downward force imposed by the gas and liquid (N)\", round(Fd,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Total vertical force tending to lift the dome (N) 157079.633\n Absolute pressure at the bottom o f the vessel (Pa) 175825.0\nDownward force imposed by the gas and liquid (N) 254673.208\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.3,Page 7"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Force\n\n#Variable Decleration\na1 =0.3; #m^2\nm =1000; # kg\na2 =0.003; #m^2\nrho_oil =750; #kg /m^3\nH =2; #m\ng =9.81; #m/ s ^2\n\n# Calcualtion\nF1=m*g;\nF2=a2 *( F1/a1 - rho_oil *g*H);\n\n#result\nprint \"The force on the plunger(N)\",round(F2,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The force on the plunger(N) 53.955\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.4,Page 8"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Height\n\n#variable Decleration\nrho_0 =800; # kg /m^3\nrho_aq =1100; # density of aqueous solution\n\n#calculation\nH =0.5* rho_aq /( rho_aq - rho_0 );\n# For a fixed length of chamber o f 3 m, the\n#interface between the two phases is determined\n#from the p r e s s u r e i n the chamber and d i s c h a r g e\n#p o i n t .\n#r h o 0 \u0003g\u0003H1+rho a q \u0003g\u0003H2=rho a q \u0003g \u0003(H\udbc0\udc000.5) ;\n#H=H1+H2\nrho_0 =600; #kg /m^3\nH1 =0.5* rho_aq /( rho_aq - rho_0 );\n\n#result\nprint \"H(m)\",round(H,3)\nprint \"The lowest possible position of the interface in the chamber below the overflow (m)\",round(H1,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "H(m) 1.833\nThe lowest possible position of the interface in the chamber below the overflow (m) 1.1\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.5, Page11"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#position of interface between legs\n\n#variable decleration\nrho_o =900; #kg /m^3\nrho_n =1070; #kg /m^3\nH =1; #m\ng =9.81; #m/ s ^2\ndp =10*10**3; #change in pressure\n\n#H=H1+H2\n#calculation\nH1 =(dp - rho_n *g*H)/( rho_o - rho_n )/g;\n\n#result\nprint \"The position of the interface between the legs (m)\", round(H1,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The position of the interface between the legs (m) 0.3\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.6,Page 13"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Density and Fraction\n\n# Variable defining\ndp =22*10**3; #N/m^2\ng =9.81;#m/ s ^2\nH =1.5;#m\nrho =1495.00;#kg /m^3\nrho_s =1270;#kg /m^3\nrho_c =2698;#kg /m^3\n\n# Calculation\np=dp/g/H;\n#rho=f 1 \u0003 r h o s+f 2 \u0003 r h o c\n#f 1+f 2=1\nf2 =( rho - rho_s )/( rho_c - rho_s );\n\n#result\nprint \" the density of the solution with crystals (kg/m^3)\",round(p,3)\nprint \"The fraction of crystals \", round(f2,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " the density of the solution with crystals (kg/m^3) 1495.073\nThe fraction of crystals 0.158\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.7, Page 15"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding radius\n\n#Variable defining\np_atm =101.3*10**3; #N/m^2\nrho =1000; #kg /m^3\ng =9.81; #m/ s ^2\nH1 =3; #m\na =0.073; #N/m\nr1 =5*10**( -4) ; #m\np1= p_atm + rho *g*H1 +2* a/r1;\n\n#calculation\n# p2=p atm+rho \u0003g\u0003H2+2\u0003a / r2 ;\n# p1 \u00034/3\u0003%pi\u0003 r1 ^3=p2 \u00034/3\u0003%pi\u0003 r2 ^3\n# Solving above two equations we get\nr2 =0.053; #//mm\n\n#result\nprint\"Radius of the bubble(mm)\",round(r2,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Radius of the bubble(mm) 0.053\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.8,Page 17"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Pressure Difference\n\n#Variable defining\nH =0.2; #m\nrho =1000; #kg /m^3\nrho_Hg =13600; #kg /m^3\ng =9.81; #m/ s ^2\n\n#calculation\ndp =( rho_Hg -rho)*g*H;\n\n#result\nprint \" Differential pressure(Pa)\",round(dp,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Differential pressure(Pa) 24721.2\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.9,Page 19"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure drop\n\n#variable defining\nrho =1000;\ng =9.81; # m/ s ^2\nH =0.4; #m\n\n#calculation\ndp=rho*g*H;\n\n#result\nprint\" Pressure drop in the pipe(Pa)\",round(dp)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Pressure drop in the pipe(Pa) 3924.0\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.10,Page 21"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding quantity\nimport math\n\n#variable defining\ndp =20*10**3; #N/m^2\nrho_Hg =13600; # kg /m^3\nrho =700; #kg /m^3\ng =9.81; #m/ s ^2\nd =0.02; #m\n\n\n#calculation\nH=dp*(rho_Hg - rho)**-1/g;\nV= math.pi /4*d*d*H;\n\n#result\nprint\"Quantity of mercury to be removed (m^3)\",round(V,9)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Quantity of mercury to be removed (m^3) 4.965e-05\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.11,Page 23"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Pressure\n\n#Variable defining\nimport math\nfrom math import sin\nrho =800; #kg /m^3\ng =9.81; #m/ s ^2\nL =0.12;\n\n\n#calculations\ntheta = math.pi /180*20; #radians\ndp=rho*g*L*(sin(theta));\n\n#result\nprint \"The gauge pressure across the filter(Pa)\",round(dp,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The gauge pressure across the filter(Pa) 322.100890178\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.12,Page 25"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding tension\n\n#Variable defining\nmc =100; #kg\ng =9.81; #m/ s ^2\nrho =1000; #kg /m^3\nrho_c =7930; #kg /m^3\n\n#calculation\nm=mc*rho/ rho_c ;\nF=mc*g-m*g; #tension\n\n#result\nprint(\"The tension in the cable(N)\",round(F,2))\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('The tension in the cable(N)', 863.28)\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.13,Page 27"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding length\n\n#Variale defining\nrho =1000.0;\nx =0.06;\nrho_0 =800.0;\nx_0 =0.04;\nrho_L =900.0;\n\n#calculation\nL=( rho*x- rho_0 *x_0)/( rho - rho_0 );\nx_L =L-rho/ rho_L *(L-x);\n\n#result\nprint \" Length of the stem above the liquid of SG 0.9 is (m)\",round(x_L,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Length of the stem above the liquid of SG 0.9 is (m) 0.05\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.14,Page 29\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Time and Quantity\n\n#variable defining\nm_s =5*10**6; #kg\nT2 =4.5; #m\nT1 =3; #m\nrho_hc =950; #kg /m^3\nQ =125; #m^3/h\n\n#calculation\nm_hc =m_s *( T2/T1 -1);\nt= m_hc / rho_hc /Q;\n\n#result\nprint\"Quantity delivered(kg)\",round(m_hc,2)\nprint \"Time taken(hours)\",round(t,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Quantity delivered(kg) 2500000.0\nTime taken(hours) 21.053\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_2_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_2_1.ipynb
new file mode 100644
index 00000000..a567da1d
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_2_1.ipynb
@@ -0,0 +1,175 @@
+{
+ "metadata": {
+ "name": "Chapter 2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 2,Continuity Momentum and Energy"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.1,Page 36"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Velocity and Flow rate\nfrom math import pi\n\n\n#variable decleration\nQ1 =0.02; #m^3/ s\nd1 =0.15; #m\nd2 =0.05; #m\nd3 =0.1; #m\nv2 =3; #m/ s\n\n\n#calculation\nQ2=pi*d2 **2/4* v2;\nv3 =(4* Q1/pi -d2 **2* v2)/d3 **2;\nQ3=pi*d3 **2/4* v3;\nv1 =4*( Q2+Q3)/pi/d1 **2;\n\n\n#result\nprint\" Flow rate at pipe 3(m^3/s) =\",round(Q3,4)\nprint\" Flow rate at pipe 2(m^3/s)= \",round(Q2,4)\nprint\" Flow rate at pipe 1(m^3/s)= \",round(Q1,4)\nprint\" Velocity at pipe 1(m/s) =\",round(v1,3)\nprint\" Velocity at pipe 2(m/s) =\",round(v2,3)\nprint\" Velocity at pipe 3(m/s) =\",round(v3,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Flow rate at pipe 3(m^3/s) = 0.0141\n Flow rate at pipe 2(m^3/s)= 0.0059\n Flow rate at pipe 1(m^3/s)= 0.02\n Velocity at pipe 1(m/s) = 1.132\n Velocity at pipe 2(m/s) = 3.0\n Velocity at pipe 3(m/s) = 1.796\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.2,Page 38"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Force exerted\n#variable decleration\nimport math\nfrom math import pi\nd1 =0.2; #m\nd2=d1;\np1 =1*10**5; #N/m^2\np2 =80*10**3; #N/m^2\nQ =150.0; #m^3/h\nrho =900; #kg /m^3\ntheta1 =0; # r a d i a n s\ntheta2 =pi; # r a d i a n s\n\n#calculation\na1=pi*d1 **2/4;\na2=pi*d2 **2/4;\nF1=p1*a1; # Upstream f o r c e\nF2=p2*a2; # Downstream f o r c e\nv1 =4*Q /3600/ pi/d1 **2;\nv2=v1;\nflux =rho*Q /3600* v2; #Momentum f l u x\nFx=F1* math.cos ( theta1 )-F2* math.cos ( theta2 )+ flux *( math.cos ( theta2 ) -\nmath.cos ( theta1 ));\nFy=F1* math.sin ( theta1 )-F2* math.sin ( theta2 )-flux *( math.sin ( theta2 )-\nmath.sin ( theta1 ));\nF= math.sqrt (Fx **2+ Fy **2);\n\n#result\nprint\" Force exerted by liquid (kN) =\",round(F,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Force exerted by liquid (kN) = 5552.47608322\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.3,Page 40"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure\nfrom math import pi\n\n#variable decleration\nrho =1000; # kg /m^3\nd =0.05; #m\nL =500; #m\nv =1.7; #m/ s\n\n#calculation\na= pi *d **2/4;\nF= rho *a*L*v;\nP=F/a /10**3;\n \n#result \nprint\"Average pressure(kN/m^2) =\",round(P)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Average pressure(kN/m^2) = 850.0\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.4,Page 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure and velocity\n\n#variable decleration\nimport math\ng =9.8; #m/ s ^2\ndz =0.2; #m ; dz1=z1-z2=z1-z2\nrho =1000; # kg /m^3\ndz1 =2; #m ; dz1=z1-z A\ndz2 =0; #m ; dz2=z1-z B\ndz3 = -1.5; #m ; dz3=z1-z C\n\n#calculation\nv2= math.sqrt (2* g*dz);\nv_A =v2;\nv_B =v2;\nv_C =v2;\np_A = rho *g*( dz1 - v_A **2/2/ g);\np_B = rho *g*( dz2 - v_B **2/2/ g);\np_C = rho *g*( dz3 - v_C **2/2/ g);\n\n#result\nprint\" Velocity at pt . A(m/s) =\",round(v_A,2);\nprint\" Velocity at pt . B(m/s) =\",round(v_B,2);\nprint\" Velocity at pt . C(m/s) =\",round(v_C,2);\nprint\" Pressure at pt . A(kN/m^2) =\",round(p_A)\nprint\" Pressure at pt . B (kN/m^2)=\",round(p_B)\nprint\" Pressure at pt . C (kN/m^2)=\",round(p_C)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Velocity at pt . A(m/s) = 1.98\n Velocity at pt . B(m/s) = 1.98\n Velocity at pt . C(m/s) = 1.98\n Pressure at pt . A(kN/m^2) = 17640.0\n Pressure at pt . B (kN/m^2)= -1960.0\n Pressure at pt . C (kN/m^2)= -16660.0\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.5,Page 44"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure drop\nfrom math import pi\n\n#variable decleration\nQ =10.0; # m^3/ hr\nd1 =0.05; #m\nd2 =0.1; #m\nrho =1000.0; #kg /m^3\ng=9.81;\n\n\n#calculation\na1=pi*d1 **2/4;\na2=pi*d2 **2/4;\nv1=Q /3600/ a1;\nv2 =( d1/d2) **2* v1;\nPD=rho*0.057*g;\n\n#results\nprint\" Presure drop (N/m^2)=\",round(PD,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Presure drop (N/m^2)= 375.26364312\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.7,Page 48"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding force required\n\n#variable decleration\nQ =100; #m^3/ hr\nd1 =0.2; #m\nd2 =0.15; #m\np1 =80*10**3; #N/m^2\nrho =1000; # kg /m^3\ng =9.8; #m/ s ^2\npi=3.14;\n\n#calculation\na1=pi*d1 **2/4;\na2=pi*d2 **2/4;\nv1=Q /3600/ a1;\nv2=Q /3600/ a2;\nH_L =0.2* v2 **2/2/ g;\np2=p1+ rho /2*( v1 **2- v2 **2) -rho*g* H_L ;\nF_u =p1*a1; # Upstream f o r c e\nF_d =p2*a2; # Downstream f o r c e\nF_x = rho *Q /3600*( v2 -v1)-F_u +F_d;\n\n#results\nprint\" Force required (N) =\",round(F_x)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Force required (N) = -1099.0\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 2.9,Page 53"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding depression\n\n#variable decleration\nN =60; #rpm\nr2 =0.25; #m\ng =9.8; #m/ s ^2\npi=3.14;\n\nw =2* pi*N /60;\ndz_12 =(w*r2) **2/2/ g; # dz 1 2=z2-z1\nc=w*r2 **2;\ndz_23 =c **2/2/ g/r2 **2; # dz 2 3=z3-z2\ndz_13 = dz_23 + dz_12 ;\n\n#results\nprint\" Total depression(m) =\",round(dz_13,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Total depression(m) = 0.252\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_3_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_3_1.ipynb
new file mode 100644
index 00000000..538dce80
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_3_1.ipynb
@@ -0,0 +1,280 @@
+{
+ "metadata": {
+ "name": "Chapter 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 3,Laminar Flow and Lubrication"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.2,Page 63"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding fartherest distance\n\n#variable decleration\nRe =2000.0;\nd =0.008; #m\n\n#calculation\nL1 =0.058* Re*d;\n\n#result\nprint\"The furtherest distance the fluid can flow into the 8 mm inside diameter pipe (m)=\",round(L1,3);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The furtherest distance the fluid can flow into the 8 mm inside diameter pipe (m)= 0.928\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.4,Page 67"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding flow rate\nfrom math import pi\n\n#variable decleration\ndel_p =90*10**3; # N/m^2\nd =0.126; # m\nR =0.126/2; # m\nu =1.2;\nL =60; # m\nRho =1260;\n\n\n#calculation\nQ= pi * del_p * R**4 / (8*u*L);\nRe =4* Rho *Q/(u*pi*d);\n\n#result\nprint \"The glycerol delivery rate is (m^3/s) \",round(Q,4);\nprint\"The Reynolds number is \",round(Re,3);\nprint\"As Re is below 2000 , so, laminar flow\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The glycerol delivery rate is (m^3/s) 0.0077\nThe Reynolds number is 82.047\nAs Re is below 2000 , so, laminar flow\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.5,Page 69"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding diameter\nfrom math import pi\n\n#variable decleration\nu =0.015; #Ns/m^2\nQ =0.004/60; #m^3/ s\ndp =100;\nrho =1100.0; #kg /m^3\n\n\n#calculation\nR =(8* u*Q/( pi *dp)) **(0.25) ;\nRe =(4* rho *Q/( pi*u *(2* R)));\n\n#result\nprint\"Diameter of the pipe(m) =\",round(R,3);\nprint\"Reynolds number =\",round(Re,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Diameter of the pipe(m) = 0.013\nReynolds number = 246.38\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.6,Page 71"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure difference\nfrom math import pi\n\n#variable decleration\nmu =0.03; #Ns/m^2\nQ =10.0**( -7) ; #m^3/ s\nu=(7.0);\n\n#calculation\ndp= 8*mu*Q*u/3/pi/0.005**4;\n\n#result\nprint\" pressure difference (N/m^2)=\",round(dp,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " pressure difference (N/m^2)= 28.52\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.8,Page 75"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure difference\nfrom math import pi\n\n#variable decleration\nu =0.1; #Ns/m^2\nd =0.1; #m\nR =0.05; # m\nRho =900; #kg /m^3\nv_max =2; # m/ s\nv= v_max /2; # m/ s\n\n#calculation\nTw = 2*u* v_max /R;\ndel_p =4* u* v_max /R **2;\n\n#result\nprint \"At the pipe wa l l ( r =R) , shear stress (N/m^2)= \",Tw;\nprint\" pressure drop per metre lengthh of pipe is (N/m^2)\",del_p;\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "At the pipe wa l l ( r =R) , shear stress (N/m^2)= 8.0\n pressure drop per metre lengthh of pipe is (N/m^2) 320.0\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.9,Page 77"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding inside diameter\n\n#variable decleration\nimport math\nu =0.032; #Ns/m^2\nRe =2000.0; #maximum v a l u e\nRho =854.0;\ndel_p =150.0; #N/m^2\n\n#calculation\nd =(32* u **2* Re /( Rho* del_p ))**(0.33) ;\n\nprint \"The maximum inside diameter is found to be (m) \",round(d,3);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The maximum inside diameter is found to be (m) 0.082\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.10,Page 79"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure drop\n\nfrom math import pi\n#variable decleration\nrho =1000; #kg /m^3\nu =0.1; #Ns/m^2\ng =9.81; #m/ s ^2\nL =10; #m\nH =2; #m\nQ =14.0/3600; #m^3/ s\nd =0.05; #m\n\n#calculation\ndp=rho*g*(L+H) - (128* Q*u*L/pi /d**4) ;\n\n#result\nprint\" Pressure drop across the valve (N/m^2)=\",round(dp,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Pressure drop across the valve (N/m^2)= 92368.39\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.12,Page 83"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding inclination and viscosity\n\n#variable decleration\nfrom math import pi\nimport math\nQ =3*10**( -6) ; #m^3/ s\nu =0.001; #Ns/m^2\nW =1;\nrho =1000; #kg /m^3\ng =9.81; #m/ s ^2\nd =1.016*10**( -4) ; #m\nd1 =1.25*10**( -4) ; # m\n\n\n#calculation\ntheta = math.asin (3*Q*u/W/rho/g/d **3) ;\nu1=W*rho *g* math.sin ( theta )*( d1 **3) /(3* Q);\n\n#result\nprint\"Exact angle of inclination (radians) =\",round(theta,3)\nprint\" Viscosity of the second liquid (Ns/m^2)=\",round(u1,4)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Exact angle of inclination (radians) = 1.065\n Viscosity of the second liquid (Ns/m^2)= 0.0019\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.17,Page 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding shear stress\n\n#variable decleration\nu =1.5; #Ns/m^2\nv =0.5; # m/ s\nH =0.02/2; # m\n\n#calculation\nt=-u*3*v/H;\n\n#result\nprint \"The shear stress (N/m^2)=\",t\nprint\"acting on opp. direction of flow\" \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The shear stress (N/m^2)= -225.0\nacting on opp. direction of flow\n"
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.18,Page 95"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding torque and viscosity\nfrom math import pi\nfrom scipy import integrate\n\n#variable decleration\nN =600.0/60; #r e v o l u t i o n s pe r s e c\nr =0.025; #m\nt =400; # N/m^2\nl =0.002; # m\ntime=2.0/1000; #s\n\n#calculation\nw =2* pi*N;\nu=t*l/w/r;\ndef integrand (R,w,u,time):\n return 2*pi*u*w/time*R**3\n\n#a=lambda r:2*pi*0.509*62.8/2*r**3*1000;\nT=integrate.quad(integrand, 0,0.025,args=(w,u,time));\n\n#result\nprint\" Viscosity,(Ns/m^2)=\",round(u,3)\nprint\"Torque(Nm) =\",round(T[0],4)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Viscosity,(Ns/m^2)= 0.509\nTorque(Nm) = 0.0098\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.19,Page 97"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding torque and frictional resistance\nfrom math import pi\n\n#variable decleration\nu =0.153; #Ns/m^2\nr =0.05; # m\nN =30; # rps\nt =2.0/10**5; # s\nL =0.2; #m\n\n\n#calculation\ntau =u *(2* pi *N*r/t);\nF= tau *2* pi *r*L;\nT=F*r;\nw =2* pi*N;\nP=T*w;\n\n#result\nprint \"The torque on the bearing is found to be (Nm)= \",round(T,3);\nprint \" and the power required to overcome the resistance is (W)=\",round(P,3);\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The torque on the bearing is found to be (Nm)= 226.507\n and the power required to overcome the resistance is (W)= 42695.643\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 3.20,Page 99"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding viscosity of oil\n\n#variable decleration\nt =0.0005;#s\nP =22; \nr =300.0/60; \nR_1 =0.1; \nR_2 =0.0625; \npi=3.14;\n\n#calculation\nw =2* pi*r;\nu =2* t*P/( pi *w **2*(( R_1 )**4 -( R_2) **4) );\n\n#result\nprint\"The viscosity of the oil is (Ns/m^2)= \",round(u,4);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The viscosity of the oil is (Ns/m^2)= 0.0839\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_4_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_4_1.ipynb
new file mode 100644
index 00000000..9b4bb41f
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_4_1.ipynb
@@ -0,0 +1,49 @@
+{
+ "metadata": {
+ "name": "Chapter 4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 4, Dimensional Analysis"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 4.5,Page 108"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure drop\n\n#Variable Declaration\nRho_full =800.0; # kg /m^3\nv_full =1.8; # m/ s\nu_full =9.0/10000 ; # Nm/ s ^2\nRho_model =1000.0; # kg /m^3\nu_model =1.0/1000 ; # Ns/m^2\nd_full = 2.0;\nd_model =1.0;\ndel_p_fmodel =4000.0; # N/m^2\n\n#Calculation\nv_model = (( Rho_full * v_full / u_full )/( Rho_model /u_model ))*( d_full / d_model );\n#del_p_f = del_p_fmodel * Rho_full *( v_full )**2/ Rho_model /(v_model )**2;\n\n#result\nprint \"The velocity in the full scale pipe is expected to be(m/s)\",round(v_model,2);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The velocity in the full scale pipe is expected to be(m/s) 3.2\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_5_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_5_1.ipynb
new file mode 100644
index 00000000..ef67f9f0
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_5_1.ipynb
@@ -0,0 +1,469 @@
+{
+ "metadata": {
+ "name": "Chapter 5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5,Flow Measurement by Differential Head"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1,Page 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding Velocity\n",
+ "\n",
+ "#Variable Iniialisation\n",
+ "import math\n",
+ "rho_m =840; # kg /m^3\n",
+ "g =9.8; #m/ s ^2\n",
+ "H =0.03; #m\n",
+ "rho =1.2; #kg //m^3\n",
+ "\n",
+ "#calculation\n",
+ "dp= rho_m *g*H;\n",
+ "v1= math.sqrt (2* dp/rho);\n",
+ "\n",
+ "#result\n",
+ "print\" Velocity(m/s) =\",round(v1,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Velocity(m/s) = 20.2879274447\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2,Page 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding average rate of flow and velocity\n",
+ "\n",
+ "%pylab inline\n",
+ "#variable initialisation\n",
+ "from math import pi\n",
+ "import numpy as np\n",
+ "from pylab import *\n",
+ "r =[0, 0.05, 0.10, 0.15, 0.20, 0.225, 0.25];\n",
+ "v =[19, 18.6, 17.7, 16.3, 14.2, 12.9, 0];\n",
+ "\n",
+ "# We define a new variable dQ=v \u00032\u0003*pi\u0003*r . Accordingto the given values of r , v , we get dQ as follows\n",
+ "dQ =[0, 5.8, 11.1, 15.4, 17.8, 18.2, 0];\n",
+ "\n",
+ "#calculation\n",
+ "figure()\n",
+ "plot (r,dQ,'r')\n",
+ "xlabel('radius (m)')\n",
+ "ylabel('2piVxr (m^2/s)')\n",
+ "show()\n",
+ "# From the graph area under the cur ve comes out to be 2 . 7 4\n",
+ "Q =2.74; #m^3/ s\n",
+ "d =0.5; # m\n",
+ "v =4* Q/pi /d**2;\n",
+ "\n",
+ "#result\n",
+ "print \" Rate of flow (m^3/s) =\",round(Q,2);\n",
+ "print \"Average velocity(m/s) =\",round(v,2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEMCAYAAAArnKpYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVeW+x/EPzh41h6OoqYVTIaJIDqWJUg5p5nTtWpZe\np6zTYK/mrE5ldSrr6umU1TXN0jLHyqFMtExQyXJOy8xSETVwCEHRFIF1/3hiKwky7L3X2sP3/Xrx\nCjZ77fVjtV2//Ty/ZwixLMtCREQEKON0ACIi4juUFERExEVJQUREXJQURETERUlBRERclBRERMTF\na0lh//79XHfddbRs2ZLIyEjeeOMNANLS0ujRowdXXHEFPXv2JD093VshiIhICYV4a55Camoqqamp\ntGnThszMTNq2bcuiRYt4//33qV27No899hivvPIKx44dY8KECd4IQURESshrLYV69erRpk0bAKpW\nrUqLFi04ePAgS5YsYfjw4QAMHz6cRYsWeSsEEREpIa+1FM6XlJRE165d+eGHH7jssss4duwYAJZl\nUatWLdfPIiLirHLePkFmZiaDBg3i9ddfp1q1avl+FxISQkhIyAXHFPSYiIgUzd3P+V4dfXT27FkG\nDRrEsGHDGDBgAAB169YlNTUVgJSUFEJDQws81rIsfVkWzz77rOMx+MqXroWuha7Fxb88wWtJwbIs\nRo8eTUREBA888IDr8X79+jFz5kwAZs6c6UoWIiLiPK91HyUmJjJr1ixat25NdHQ0AC+//DLjxo1j\n8ODBTJ8+nbCwMObPn++tEEREpIS8lhQ6d+5Mbm5ugb/76quvvHXagBMbG+t0CD5D1+IcXYtzdC08\ny5bRRyUVEhLisf4xEZFg4Yl7p5a5EBERFyUFERFxUVIQEREXJQUREXFRUhARERclBR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n\nbNq0idTU1AJbFH99LO/n2bNn06tXL7Zs2cK2bdto06bNBccmJibSrl0718+nTp2iW7du/PDDD1Sr\nVo1nnnmGr7/+moULF/LMM8+4ntehQwdWr17tqcshUmLqPpKAcvnll+fbRGTevHlMmzaN7OxsUlJS\n2LFjBzk5OTRu3NjVtTN06FCmTp1a7HN06NCBUaNGcfbsWQYMGEBUVNQFz9m3b59rvRmAChUqcMMN\nNwDQqlUrKlWqRNmyZYmMjCQpKcn1vPr16+f7WcRuailIQKlSpYrr+7179zJp0iS+/vprvv/+e/r0\n6cPp06cvaAEUNqm/XLly5ObmApCbm0tWVhYAMTExrFmzhgYNGjBixAg+/PDDAo8//3XP3/ugTJky\nVKhQwfV9dnZ2vmMCbYVP8S9KChKwjh8/TpUqVbjkkks4dOgQy5YtIyQkhPDwcJKSktizZw8Ac+bM\nKfD4sLAwNm3aBJgNj86ePQtAcnIyderU4Y477uCOO+7It01qnssvv5yUlJQSx5ySksLll19e4uNE\nPEXdRxJQzv+UHRUVRXR0NOHh4TRq1IjOnTsDULFiRaZOnUqfPn3429/+RkxMDCdPnnQdn/caY8aM\noX///rRp04ZevXq5Cs2rVq1i4sSJlC9fnmrVqvHBBx9cEEfnzp3ZuHEjbdu2vSCuv/58/vfr16+n\nS5cunrgUIqWiBfFEvGDPnj2MHTuWpUuXlui42NhY5s+fryGp4hh1H4l4QZMmTahWrVqJJ681a9ZM\nCUEcpZaCiIi4qKUgIiIuSgoiIuKipCAiIi5KCiIi4qKkICIiLkoKIiLi8v8vJedrtH6NpQAAAABJ\nRU5ErkJggg==\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Rate of flow (m^3/s) = 2.74\n",
+ "Average velocity(m/s) = 13.95\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3,Page 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding throat diameter and overall length\n",
+ "\n",
+ "#variable declaration\n",
+ "from math import pi\n",
+ "d1 =0.1; #m\n",
+ "rho_Hg =13600; #kg /m^3\n",
+ "rho =1000; #kg /m^3\n",
+ "g =9.81; #m/ s ^2\n",
+ "H =0.8; #m\n",
+ "Cd =0.96;\n",
+ "Q =0.025; #m^3/ s\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "a= pi *d1**2/4;\n",
+ "dp =( rho_Hg - rho )*g*H;\n",
+ "B =((2* dp /( rho *((Q/Cd/a)**2))) +1) **(0.25) ;\n",
+ "d2=d1/B;\n",
+ "# The shortest possible overall length of venturi is therefore an entrance cone of 7.1 cm length( 20 degrees) , a throat of 2.5 cm(0.25pipe diameter s ) and an e x i t cone o f 1 9 . 7 cm ( 7 . 5\n",
+ "#degrees) giving an overall length of 29.3 cm.\n",
+ "L =29.3; #cm\n",
+ "\n",
+ "#result\n",
+ "print\"Throat diameter (m)=\",round(d2,3);\n",
+ "print\" Overall Length(m) =\",round(L,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Throat diameter (m)= 0.048\n",
+ " Overall Length(m) = 29.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4,Page 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding flow through orifice and venturimeter\n",
+ "\n",
+ "#Variable Decleration\n",
+ "Cd_o =0.65;\n",
+ "d =0.05;\n",
+ "d_o =0.025;\n",
+ "Cd_v =0.95;\n",
+ "d_v =0.038;\n",
+ "\n",
+ "#calculation\n",
+ "# (Q o /Cd o ) ^ 2 \u0003 ( ( d/ d o ) ^4 -1)=(Q v/Cd v ) ^ 2 \u0003 ( ( d/ d v)^4 - 1)\n",
+ "#Q v=4\u0003Q o\n",
+ "# Q = Q v + Q o\n",
+ "# Q = 5\u0003Qv\n",
+ "Q1 =20;\n",
+ "Q2 =100 - Q1;\n",
+ "print\"Flow through orifice(%)=\",round(Q1)\n",
+ "print\"Flow through venturi(%)=\",round(Q2)\n",
+ "\n",
+ "print\"Thus 20 % of the flow passes through the orifice meter while 80% of the flow passes through the venturi.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flow through orifice(%)= 20.0\n",
+ "Flow through venturi(%)= 80.0\n",
+ "Thus 20 % of the flow passes through the orifice meter while 80% of the flow passes through the venturi.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5,Page 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#finding Cd\n",
+ "\n",
+ "#Variable declaration\n",
+ "from math import pi\n",
+ "import math\n",
+ "Qa =0.003/60; # m^3/ s\n",
+ "Ca =20; # g / l\n",
+ "Co =0.126; # g / l\n",
+ "dp =3700; #N/m^2\n",
+ "p =1000; # N/m^2\n",
+ "d =0.1; # m\n",
+ "B =10/6;\n",
+ "\n",
+ "#calculation\n",
+ "a= pi *d **2/4;\n",
+ "Qi=Qa *(( Ca -Co)/Co);\n",
+ "Q=Qi+Qa;\n",
+ "c= math.sqrt(2*dp/p/(1.65**4 -1**4))\n",
+ "Cd=Q/a/ c;\n",
+ "\n",
+ "#results\n",
+ "print\" Coefficient of discharge =\",round(Cd,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Coefficient of discharge = 0.967\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6,Page 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding differential pressure\n",
+ "\n",
+ "#variable declaration\n",
+ "from math import pi\n",
+ "rho =850; # kg /m^3\n",
+ "Q =0.056; # m^3/ s\n",
+ "Cd =0.98;\n",
+ "d1 =0.2; # m\n",
+ "d2 =0.1; # m\n",
+ "g =9.81; # m/ s ^2\n",
+ "dz =0.3; # m\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "a= pi *( d1) **2/4;\n",
+ "dp=rho /2*(( Q/Cd/a) **2*(( d1/d2)**4 - 1) + 2*g*( dz));\n",
+ "\n",
+ "#result\n",
+ "print\"The differential pressure (N/m^2)=\",round(dp,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The differential pressure (N/m^2)= 23592.898\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7,Page 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#finding rate of flow\n",
+ "\n",
+ "#variable declaration\n",
+ "from math import pi\n",
+ "import math\n",
+ "g =9.81; # m/ s ^2\n",
+ "H =0.5; #m\n",
+ "rho_m =1075; #kg /m^3\n",
+ "rho =860; #kg /m^3\n",
+ "B =0.225/0.075;\n",
+ "Cd =0.659;\n",
+ "\n",
+ "#calculation\n",
+ "a1=pi /4*(0.225) **2;\n",
+ "v_t =math.sqrt(2*g*H*( rho_m - rho )/(rho )/(3**4 -1));\n",
+ "Q=Cd*a1* v_t ;\n",
+ "\n",
+ "#result\n",
+ "print\"Rate of flow(m^3/s) =\",round(Q,5)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of flow(m^3/s) = 0.00459\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8,Page 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding mass flow rate\n",
+ "\n",
+ "#variable decleration\n",
+ "from math import pi\n",
+ "import math\n",
+ "m_f =0.03; # kg\n",
+ "rho_f =5100; # kg /m^3\n",
+ "d_l =0.3; # m\n",
+ "d_b =0.22; # m\n",
+ "H_tube =0.2; # m\n",
+ "Cd =0.6;\n",
+ "H =0.1; # m\n",
+ "g =9.81; # m/ s ^2\n",
+ "rho =1000; # kg /m^3\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "V_f = m_f / rho_f ;\n",
+ "theta =2* math.atan (( d_l - d_b )/2/ H_tube );\n",
+ "m=Cd*H* math.tan ( theta /2)* math.sqrt (8* V_f*g* rho *( rho_f - rho )* pi);\n",
+ "\n",
+ "#result\n",
+ "print\"Mass flow rate(kg/s) =\",round(m/10,4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flow rate(kg/s) = 0.0925\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9,Page 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Finding flow rate of water and Cd\n",
+ "\n",
+ "#variable decleration\n",
+ "from math import pi\n",
+ "import math\n",
+ "d1 =0.05; # m\n",
+ "d2 =0.025; # m\n",
+ "Cd =0.97;\n",
+ "dp =1200; # N/m^2\n",
+ "rho =1000; #kg /m^3\n",
+ "H =0.15; # m\n",
+ "theta =2; # d e g r e e s\n",
+ "V_f =10**( -4) ;# m^3\n",
+ "g =9.81; # m/ s ^2\n",
+ "rho_f =8000; # kg /m^3\n",
+ "\n",
+ "#calculation\n",
+ "B=d1/d2;\n",
+ "a= pi /4* d1 **2;\n",
+ "Q=Cd*a* (2* dp/ (rho *(B**4 -1)))**(0.5);\n",
+ "Cd=Q/(H/ rho * math.tan( theta*pi/180 /2)* math.sqrt (8* V_f*g* rho *( rho_f -rho )*pi))\n",
+ "\n",
+ "#result\n",
+ "print\"Flow rate of water(m^3/s) =\",round(Q,5)\n",
+ "print\" Coeff. of discharge of the rotameter =\",round(Cd,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flow rate of water(m^3/s) = 0.00076\n",
+ " Coeff. of discharge of the rotameter = 0.7\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_6_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_6_1.ipynb
new file mode 100644
index 00000000..19e4fb13
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_6_1.ipynb
@@ -0,0 +1,196 @@
+{
+ "metadata": {
+ "name": "Chapter 6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 6:Tank drainage and variable head flow"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.1,Page 143"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding no. of orifice\n\n#variable decleration\nfrom math import pi\nimport math\nQ =5000.0/3600/24; #m^3 per second\nC_d =0.6;\nr =0.01/2; # m\ng =9.8; #m/ s ^2\nH =0.2; # m\n\n\n#calculation\na_o = pi *r**2;\nn=Q/C_d/ a_o / math.sqrt (2*g*H);\n\n#result\nprint\"The number of orifices required are \",round (n)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The number of orifices required are 621.0\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.2,Page 145"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding coeff. of velocity\n\n#variable decleration\nfrom math import pi\nimport math\nx =0.86; # m\ng =9.8; # m/ s\ny =0.96; # m\nH =0.2; # m\n\n#calculation\nv_act =x* math.sqrt (g /2/ y);\nv= math.sqrt (2* g*H);\nCv= v_act /v;\n\n#result\nprint \"The coeff. of velocity for the orifices found to be \",round(Cv,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The coeff. of velocity for the orifices found to be 0.981\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.3,Page 147"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken for drainage\n\n#variable declaration\nfrom math import pi\nimport math\nVt =1; # m^3\nd_t =1; # m\nC_d =0.6;\nd_o =0.02; # m\ng =9.8; # m/ s ^2\n\n\n#calculation\na_o = pi *( d_o ) **2/4;\nA= pi *( d_t ) **2/4;\nH1 =4* Vt/ pi /( d_t) **2;\nt=A/C_d/ a_o * math.sqrt (2* H1/g);\n\n#results\nprint\" Total drainage is found to take (s) \",round(t,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Total drainage is found to take (s) 2124.49586383\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.4,Page 149"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken to drain tank\n\n#variable declaration\nfrom math import pi\nimport math\nC_d =0.6;\nd_o =0.05; #m\ng =9.81; # m/ s ^ 2 ;\nR =2; \nH1 =1.5; \n\n#calculation\na_o = pi *d_o **2/4;\nt= pi /C_d/ a_o*(1.333* R*H1 **(1.5) -0.4* H1 **(2.5))/math.sqrt(2*g);\n\n#results\nprint\"The time to drain the tank is found to be (s)\",round(t,3);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The time to drain the tank is found to be (s) 2285.001\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.6,Page 153"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken to drain tank and rate of flow\n\n#variable declaration\nimport math\nCd =0.62;\na =0.01;# m^2\ng =9.81; # m/ s ^2\nH =0.3; #m\nA1 =4*2; # m^2\nH1 =0.300; # m\nH2 =0.100; # m\nA2 =2*2; # m^2\n\n#calculation\nQ=Cd*a* math.sqrt (2* g*H);\nt =2* A1 *( math.sqrt(H1) -math.sqrt(H2) )/( Cd*a* math.sqrt (2*g) *(1+ A1/A2));\n\n#results\nprint \"The rate of flow(m^3/s) =\",round(Q,3)\nprint \"The time taken to reduce the difference in levels to 10 cm is (s) \", round(t,3)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of flow(m^3/s) = 0.01504\nThe time taken to reduce the difference in levels to 10 cm is (s) 44.957\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.8,Page 157"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken to level tank \n\n#variable declaration\nimport math\nQs =0.4; #m^3/ s\nH1 =1.5; # m\nQ =0.2; #m^3/ s\nH2 =0.5; # m\nl =15; # m\nb =10; #m\ne=2.69;\n\n#calculation\nA=l*b;\nk=Qs*H1 **( -0.5) ;\nt=-2*A/k**2*(Q*math.log((Q-k*math.sqrt( H2))/(Q-k*math.sqrt(H1)),e)+k*(math.sqrt(H2)-math.sqrt(H1)));\n#result\nprint \"The time reqd. for the level in the tank to fall to 1 m is(s) \",round(t,3)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The time reqd. for the level in the tank to fall to 1 m is(s) 1536.35\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.9,Page 159"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken to level tank \n\n#variable declaration\nfrom math import pi\nimport numpy as np\nimport numpy \nimport math\nCd =0.62;\nd =0.05;\na_o = pi *d **2/4;\ng =9.81; #m/ s ^2\n\n#calculation\nk=Cd*a_o* math.sqrt (2*g);\n# We have g o t two s imultaneous equations\n#Q_k \u0003 0 . 6 5 ^ ( 1 / 2 ) =0.1/90\u0003A\n# Q_k \u0003 1 . 2 2 5 ^ ( 1 / 2 ) =0.05/120\u0003A\n\nM=np.array([[1,-0.1/90],[1,-0.05/120]]);\nN=np.array([[k *math.sqrt(0.65)] ,[k *math.sqrt(1.225)]]);\nX=np.linalg.solve(M,N)\nQ=X[0][0];\nA=X[1][0];\nprint \"The Area of the tank(m^2) =\",round(A,3)\nprint \" Flow rate(m^3/s) =\",round(Q,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Area of the tank(m^2) = 2.334\n Flow rate(m^3/s) = 0.007\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 6.10,Page 161"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken to level tank \n\n#variable declaration\nfrom math import pi\nfrom numpy import matrix\nfrom numpy import linalg\nimport math\nH1 =1.5; # m\nV =0.75; # m^3\nd1 =1.2; # m\nu =0.08; # Ns/m^2\nL =3; # m\nrho =1100; # kg /m^3\ng =9.81; # m/ s ^2\nd =0.025; # m\ne=2.71;\n\n#calculation\na= pi*d **2/4;\nA= pi*d1 **2/4;\nH2=H1 -(V/A);\nround(H2,2);\nt= -32*u*L*A/(a*rho*g*d **2) *math.log(H2/H1,e);\n\n#result\nprint\"Time taken(s) =\",round(t,3);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Time taken(s) = 1535.7565254\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_7_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_7_1.ipynb
new file mode 100644
index 00000000..0942f575
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_7_1.ipynb
@@ -0,0 +1,235 @@
+{
+ "metadata": {
+ "name": "Chapter 7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 7,Open channels notches and Weirs"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.2,Page 171"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Discharge\n\n#variable decleration\nimport math\nl =1; # m\nb =0.3; # m\nn =0.014; # s /m^ ( 1 / 3 )\ni =1.0/1000;\n\n#calculations\nA=l*b;\nP =2* b+l;\nm=A/P;\nQ=A/n*m **(0.67) * math.sqrt (i);\n\n#results\nprint\"The delivery of water through the channel is found to be (m^3/s)= \",round(Q,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The delivery of water through the channel is found to be (m^3/s)= 0.221\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.3 Page 173"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Depth and Chezy's Coeff.\n\n%pylab inline\n#variable decleration\nimport math\nimport numpy as np\nfrom pylab import *\nn =0.015; #m^(-1/3) s\ni =1;\nH =[4.0, 4.1, 4.2, 4.13];\n\n#calculation\nA =12* H[0];\nP =12+2* H[0];\nm=A/P;\nC=m **(0.167) /n;\nQ=C*A* math.sqrt (m*i);\n#An analytical soln for depth H is not possible.It is so necessary to use a graphical soution\n#The corresponding values of A, P, MHD (m) , Q are given below as taken from values of H\n\nA =[48, 49.2, 50.4, 49.56];\nP =[20, 20.2, 20.4, 20.26];\nm =[2.4, 2.44, 2.47, 2.45];\nQ =[57.36, 59.38, 61.39, 59.98];\nfigure()\nplot (H,Q,'g')\nr =[4.13, 4.13];\ns =[57, 60];\nplot (r,s, ' r ' )\nt =[4, 4.13];\nu =[60, 60];\nplot (t,u, ' y ' )\nxlabel('Depth (H)')\nylabel('Flow Rate')\ntitle('Depth vs Flow Rate')\nshow()\n# So, the depth is found to be approx. 4.13\ndepth =4.13; #m\nC1 =(2.45) **(0.167) /n;\n\n#results\nprint\"Depth(m) = \",round(depth,3)\nprint\"Chezy Coeff. =\",round(C1,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\nWelcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\nFor more information, type 'help(pylab)'.\n"
+ },
+ {
+ "output_type": "display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7u/59G1a1f27Nlj8HUhRFmq7BnhQhhDVFQUx48fZ8OGDQBkZWVx5swZ\nTE1N6dq1K87OzgC88MIL7N27lxEjRhSbh4uLCx06dACgS5cuutC534ULF+jZs6fuuUqlYtGiRboz\nnQHMzc11j+3t7UucjxCVTUJD1Hrnzp3DxMSEZs2aAUU7qP39/R+YRqPRPPDLX1GUUi9DXa9ePd1j\nExMTbt26VeJ0Dw9HPWp4SlEUuVquqBJkeErUahkZGbz22mtMmTIFgP79+/P555+Tn58PwOnTp8nN\nzQWKbliTlJREYWEh69at0/UUzMzMdNOXV8uWLUlLSyv39JcuXaJly5aPtQwhDEFCQ9Q693Zct2/f\nHn9/fwYMGMA//vEPAAIDA/Hw8KBz5854eXkxefJkXSD4+voSEhKCh4cHrVu3JiAgAICJEyfSoUMH\n3Y7w0o6Cul/Pnj05fPjwI6e7/7lWq6VXr14V//BCVJBcsFCIctBoNHz88cf89NNPepmfoih07tyZ\nQ4cOUbdu3TKnHzt2LDNmzMDb21svyxfiSUlPQ4hyKKkHUdH5BQUF8e2335Y57eXLl8nMzJTAEFWC\n9DSEEEKUm/Q0hBBClJuEhhBCiHKT0BBCCFFuEhpCCCHKTUJDCCFEuUloCCGEKLf/B4ccDtv7g/WY\nAAAAAElFTkSuQmCC\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Depth(m) = 4.13\nChezy Coeff. = 77.428\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.4,Page 175"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding flow area\n\n#variable decleration\nimport math\nQ =300.0/60; # m^3/ s\ni =1.0/1600;\n\n#calculation\nH=(Q /140* math.sqrt (2/ i)) **(0.67) ;\nA =2* H**2;\n\n#result\nprint \"The minimum flow area is found to be(m^2)= \",round(A,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The minimum flow area is found to be(m^2)= 5.132\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.5,Page 177"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Depth and Chezy's Coeff.\n\n%pylab inline\n#variable decleration\nfrom math import pi\nimport math\nimport numpy as np\nfrom pylab import *\nd =0.9144; # m\nC =100; # m^ ( 1 / 2 ) s ^(-1)\nR=d/2;\nH =[0.1, 0.15, 0.2, 0.25, 0.201];\n\n\n#calculations\ntheta = math.acos ((R-H[0])/R);\nA=R **2*( theta -math.sin (2* theta )/2);\nP =2* R* theta ;\nm=A/P;\n#An analytical soln for depth H is not possible.It is so necessary to use a graphical soution\n#The corresponding values of A, P, MHD (m) , Q are given below as taken from values of H\n\n\ntheta =[0.674, 0.834, 0.973, 1.101, 0.975];\nA =[0.039, 0.070, 0.106, 0.146, 0.107];\nP =[0.616, 0.763, 0.890, 1.006, 0.891];\nm =[0.063, 0.092, 0.119,0.145,0.120];\nQ =[248.7, 543.2, 932.2 ,1412.9, 940.0];\nfigure()\nplot (H,Q,)\nxlabel('Depth H')\nylabel('Flow Rate')\ntitle('Depth Vs Flow Rate');\ni =[0.201, 0.201];\nj =[0 ,940];\nplot (i,j)\nk =[0, 0.201];\nl =[940, 940];\nplot (k,l)\nshow()\n# So, the depth is found to be approx. 0.201\nDepth =0.201; # m\n\n#result\nprint\"The depth in the channel(m) =\",round(Depth,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\nWelcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\nFor more information, type 'help(pylab)'.\n"
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEXCAYAAACDChKsAAAABHNCSVQICAgIfAhkiAAA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uor/+7//4/3338dut9OnTx92797N\n6tWrz9l9BSdbEv369eOpp55i9uzZGIbB8ePHGTt2LH/84x/Zu3cvBw8eZOTIkc7lz3Z8evToQWpq\nqvPfpPrf4JJLLnH5vUvzpQARr6n+oiorK+ODDz4gNjaW8ePH07dvX9q0acP999/PrFmz2LdvHwAF\nBQWsWbOmxjbmzJnDzz//zBdffMGHH37IXXfdBTj69n/88cd67b82F154IXfeeScTJ07EarVyxRVX\nOF9LS0vj+++/p7Kykg4dOuDv7+9snbgiJCSEq6++mscee4zjx4+TkZHB4sWLuffeewG44IILGDRo\nEAsXLuS6664D4Oqrr+bVV191/lwfcXFxHDlyhOXLl1NRUUFFRQVdunShTZs2fPTRRzWOb1BQEAcO\nHKgR2r/97W95/PHH2b17NwD79u1j1apVLr9vad4UIOI1o0aNIiAggB49ehAfH8/DDz/MkiVLnK/P\nnz+f0NBQhg4dSseOHYmKiiIrK8v5evW5jO7duzN+/Hhee+01evfuDcDkyZPJzMys9ZwD1G9cSFxc\nHLt372bChAk15u/Zs4e77rqLjh07YrPZsNvtjB8/vsHH4NT9v/POO+Tm5tK9e3fGjBnDk08+yQ03\n3OB8/brrruPEiRNERkY6fz506FCt5z/Otg9/f39mzpzpvELtpZdeIiYmhs6dO/POO+/UuGItPDyc\n2NhYLrvsMjp37syePXuYOXMm0dHRjBgxgoCAAK666io2bdrU4PctLYNJD5SS5igtLY3x48eTl5fn\n7VJEWi23t0AmTZpEUFAQERERNea//PLL9OnTh379+vHoo48658fHxxMWFkZ4eHiN5vPXX39NREQE\nYWFhzJw5091liohII7k9QCZOnEhqamqNeZ999hmrVq0iIyODbdu28cgjjwCQmZlJcnIymZmZpKam\nMn36dGe/9LRp01i0aBHZ2dlkZ2efsU2R+pwoF5Gm4/YAGT58+BmXFP7973/nsccew9/fH4CuXbsC\nkJKSQmxsLP7+/litVkJDQ0lPT6eoqIjy8nJnX++ECRNYuXKlu0uVZsxutztP5IqId3jkJHp2djaf\nf/45Q4cOxW63s2XLFsBx7Xv1ZYoAFouFgoKCM+abzWbn9fAiIuIb/DyxkxMnTnDw4EE2btzI5s2b\niYmJqfMSy/pSN4aIiGsaew2VR1ogFovFeSnl4MGDadOmDfv378dsNte4iiY/Px+LxYLZbK5xy+n8\n/HzMZnOt26++bUVr/zNnzhyv1+Arf3QsdCx0LM79xx08EiCjR4/m008/BSArK8s5eCk6Opply5ZR\nUVFBTk4O2dnZREZGEhwcTEBAAOnp6RiGwdKlSxk9erQnShURkXpyexdWbGws69at48CBA4SEhPDk\nk08yadIkJk2aREREBO3atXPe8sFmsxETE+O8n05iYqKzSyoxMZH77ruPo0ePMnLkSG655RZ3lyoi\nIo3Q7AcSmkwmtzXHmru0tLQ674vUWuhYnKRjcZKOxUnu+O5UgIiItELu+O7UvbBERMQlChAREXGJ\nAkRERFyiABEREZcoQERExCUKEBERcYkCREREXKIAERERlyhARETEJQoQERFxiQJERERcogARERGX\nKEBERMQlChAREXGJAkRERFyiABEREZcoQERExCUKEBERcYnbA2TSpEkEBQURERFxxmsLFiygTZs2\nlJSUOOfFx8cTFhZGeHg4a9ascc7/+uuviYiIICwsjJkzZ7q7TBERaSS3B8jEiRNJTU09Y35eXh4f\nf/wxl156qXNeZmYmycnJZGZmkpqayvTp053P6J02bRqLFi0iOzub7Ozss25TREQaJisLTCb3bMvt\nATJ8+HACAwPPmP/QQw/x3HPP1ZiXkpJCbGws/v7+WK1WQkNDSU9Pp6ioiPLyciIjIwGYMGECK1eu\ndHepIiKtSnY2/OpX7tueR86BpKSkYLFY6N+/f435hYWFWCwW588Wi4WCgoIz5pvNZgoKCjxRqohI\ni5SdDb17O6arqtyzTT/3bKZ2R44c4dlnn+Xjjz92zqvupnKXuXPnOqftdjt2u92t2xcRac4c4ZEG\npDFnDsyb557tNnmA7Ny5k9zcXAYMGABAfn4+gwYNIj09HbPZTF5ennPZ/Px8LBYLZrOZ/Pz8GvPN\nZnOt+zg1QERE5KQffqhuedipqrI7z3/Mc0OKNHkXVkREBMXFxeTk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yIiLlGAiIiISzwWIHl5eVx//fX07duXfv368dJLLwFQUlJCVFQUvXv3ZsSIEZSW\nljrXiY+PJywsjPDwcNasWeOpUkVEpB48FiD+/v688MILbN++nY0bN7Jw4UJ27NhBQkICUVFRZGVl\nceONN5KQkABAZmYmycnJZGZmkpqayvTp06mqqvJUuSIiUgePBUhwcDCXX345ABdddBF9+vShoKCA\nVatWERcXB0BcXBwrV64EICUlhdjYWPz9/bFarYSGhrJp0yZPlSsiInXwylVYubm5bN26lSFDhlBc\nXExQUBAAQUFBFBcXA1BYWMjQoUOd61gsFgoKCs66vblz5zqn7XY7dru9yWoXEWmO0tLSSEtLc+s2\nPR4ghw4dYuzYsfztb3+jQ4cONV4zmUyYznGDotpeOzVARETkTKf/cj1v3rxGb9OjV2H9/PPPjB07\nlvHjxzN69GjA0erYs2cPAEVFRXTr1g0As9lMXl6ec938/HzMZrMnyxURkXPwWIAYhsHkyZOx2WzM\nmjXLOT86OpqkpCQAkpKSnMESHR3NsmXLqKioICcnh+zsbCIjIz1VroiI1MFjXVjr16/nn//8J/37\n92fgwIGA4zLd2bNnExMTw6JFi7BarSxfvhwAm81GTEwMNpsNPz8/EhMTz9m9JSIinmUyDMPwdhGN\nYTKZaOZvQUQ8yDTPhDFH3xnu+O7USHQREXGJAkRERFyiABEREZcoQERExCUKEBERcYkCREREXKIA\nERERlyhARETEJQoQERFxiQJERERcogARERGXKEBERMQlChAREXGJAkRERFyiABEREZcoQERExCUK\nEBERcYkCREREXOLzAZKamkp4eDhhYWHMnz/f2+X4tLS0NG+X4DN0LE7SsThJx8K9fDpAKisrmTFj\nBqmpqWRmZvLOO++wY8cOb5fls/Sf4yQdi5N0LE7SsXAvnw6QTZs2ERoaitVqxd/fn3HjxpGSkuLt\nskREBB8PkIKCAkJCQpw/WywWCgoKvFiRiIhU8/N2AediMpnculxrMG/ePG+X4DN0LE7SsajJNFff\nGe7g0wFiNpvJy8tz/pyXl4fFYqmxjGEYni5LRETw8S6sK6+8kuzsbHJzc6moqCA5OZno6GhvlyUi\nIvh4C8TPz49XXnmFm2++mcrKSiZPnkyfPn28XZaIiODDLZDq8R8PPPAAkyZN4ocffuCxxx6rscwD\nDzxAWFgYAwYMYOvWrWes21LGjtTn/dR2LKxWK/3792fgwIFERkZ6quQmU9ex+O9//8tVV13F+eef\nz4IFCxq0bnPTmGPR2j4X//rXvxgwYAD9+/fnmmuuISMjo97rNjeNORYN/lwYPujEiRNGr169jJyc\nHKOiosIYMGCAkZmZWWOZDz/80Lj11lsNwzCMjRs3GkOGDKn3us1JY46FYRiG1Wo1Dhw44NGam0p9\njsXevXuNzZs3G0888YTx17/+tUHrNieNORaG0fo+Fxs2bDBKS0sNwzCMjz76qFV/X9R2LAyj4Z8L\nn2yB1Gf8x6pVq4iLiwNgyJAhlJaWsmfPnhY3dsTVY1FcXOx83WghFxrU51h07dqVK6+8En9//wav\n25w05lhUa02fi6uuuoqOHTsCjv8j+fn59V63OWnMsajWkM+FTwZIfcZ/1LZMYWFhixo70phjAY5L\nnG+66SauvPJK3njjDc8U3UQaMy6opY0pauz7ac2fi0WLFjFy5EiX1vV1jTkW0PDPhU+eRK/vuI6W\n8hvUuTT2WHz55Zd0796dffv2ERUVRXh4OMOHD3dniR7TmPE+LW2sUGPfz/r167nkkkta3efis88+\nY/Hixaxfv77B6zYHjTkW0PDPhU+2QOoz/uP0ZfLz87FYLPVatzlx9ViYzWYAunfvDji6M+644w42\nbdrkgaqbRmP+bVvj5+JcLrnkEqB1fS4yMjK4//77WbVqFYGBgQ1at7lozLEAFz4XjT5r0wR+/vln\n47LLLjNycnKM48eP13ni+KuvvnKeCKrPus1JY47F4cOHjbKyMsMwDOPQoUPG1VdfbfznP//x7Btw\no4b8286ZM6fGiePW+LmodvqxaI2fi127dhm9evUyvvrqqwav25w05li48rnwyQAxDMNYvXq10bt3\nb6NXr17Gs88+axiGYbz66qvGq6++6lzmd7/7ndGrVy+jf//+xtdff33OdZszV4/Fzp07jQEDBhgD\nBgww+vbt2yqORVFRkWGxWIyAgACjU6dORkhIiFFeXl7rus2Zq8eiNX4uJk+ebHTu3Nm4/PLLjcsv\nv9wYPHjwOddtzlw9Fq58LkyG0QpOJIiIiNv55DkQERHxfQoQERFxiQJERERcogARERGXKEBETtG2\nbVsGDhxIv379uPzyy3n++ecbNWD12WefdU7n5uYSERFR5zpz5849680PS0pKXK5DpCkoQEROccEF\nF7B161a2bdvGxx9/zEcffdSop/nFx8c3eB2TyXTGiOKWNmJaWgYFiEgtunbtyuuvv84rr7wCQGVl\nJX/4wx+IjIxkwIABvP766wCkpaVx7bXX8utf/5rw8HCmTZuGYRjMnj2bo0ePMnDgQMaPH4/JZKKy\nspKpU6fSr18/br75Zo4dO3bWfevqemkOFCAi59CzZ08qKyvZu3cvixYtolOnTmzatIlNmzbxxhtv\nkJubC8DmzZt55ZVXyMzMZOfOnbz33nskJCTQvn17tm7dytKlSzEMg+zsbGbMmMG2bdvo1KkT//u/\n/3vGPg3D4IUXXmDgwIHOP4WFhR5+5yJ188mbKYr4ojVr1vD999+zYsUKAMrKyvjhhx/w8/MjMjIS\nq9UKQGxsLF9++SVjx449Yxs9e/akf//+AAwaNMgZQKcymUw89NBDPPTQQzXWE/E1ChCRc/jxxx9p\n27Yt3bp1A+CVV14hKiqqxjJpaWk1zlEYhkGbNmdv3J933nnO6bZt23L06NGzLqcuLGkO1IUlUot9\n+/bx29/+lt///vcA3HzzzSQmJnLixAkAsrKyOHLkCOB4kE9ubi5VVVUkJyczbNgwAPz9/Z3Li7Q0\naoGInKL6pPfPP/+Mn58fEyZM4MEHHwRgypQp5ObmcsUVV2AYBt26deP9998HYPDgwcyYMYMffviB\nG264gTvuuAOAqVOn0r9/fwYNGsTTTz9d76urdBWWNAe6maJII6WlpbFgwQL+/e9/e7sUEY9SF5ZI\nI51t3IZIa6AWiIiIuEQtEBERcYkCREREXKIAERERlyhARETEJQoQERFxiQJERERc8v+luW+FdxpL\nDQAAAABJRU5ErkJggg==\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The depth in the channel(m) = 0.201\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.7,Page 180"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding flow area\n\n#variable decleration\nimport math\nCd =0.56;\nB =1.2; # m\ng =9.8; # m/ s ^2\nH =0.018; # m\n\n\n#calcualtion\nQ =2.0/3* Cd*B* math.sqrt (2*g)*H **(1.5) ;\n\n#results\nprint \"The rate of flow of liquid over the weir is (m^3/s)=\",round(Q,4)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of flow of liquid over the weir is (m^3/s)= 0.0048\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.8,Page 182"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding height of weir\n\n#variable decleration\nfrom math import pi\nimport math\nH2 =5.5;\nQ1 =217.0;\nQ2 =34.0;\nH1 =8.5;\n\n#calculation\nH0 =( H2 *( Q1/Q2) **(0.67) -H1)/(( Q1/Q2) **(0.67) -1);\n\n#result\nprint\"The height of the weir crest above the surface of the river is found to be(m)\",round(H0,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The height of the weir crest above the surface of the river is found to be(m) 4.28\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.9,Page 184"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken\n\n#variable decleration\nfrom math import pi\nfrom scipy import integrate\nimport math\nH =0.07; # a v e r a g e head\nrate = -0.02/600; # (dH/ dt )\nH1 =0.08; # m\nH2 =0.01; # m\n\n\n#calculation\nk=- rate /H **(1.5) ;\ndef integrand(H,k):\n return -1/k*H**(-1.5);\n\nt=integrate.quad(integrand,H1,H2,args=(k))\n\n#result\nprint \"Time taken (s) =\",round(t[0],2);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Time taken (s) = 7183415.25\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.10,Page 186"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding flow area\n\n#variable decleration\nimport math\nCd =0.62;\ng =9.81; # m/ s ^2\nH =0.03; # m\n\n#calculations\nQ =8.0/15* Cd* math.sqrt (2*g)*H **(2.5) ;\n\n#results\nprint\"Rate of flow (m^3/s) =\",round(Q,6)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Rate of flow (m^3/s) = 0.000228\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 7.11,Page 188"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken\nfrom scipy import integrate\n#variable decleration\nimport math\nl =4; # m\nb =2; # m\nH1 =0.15; # m\nH2 =0.05; # m\nA=8;\n\n#calculation\nk=3*1.5/A;\ndef integrand (H,A):\n return -A/1.5*H**(-2.5)\n \nt=integrate.quad(integrand,H1,H2,args=(A))\n\n#results\nprint \"Time taken to reduce the head in the the tank (s)=\",round(t[0])\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Time taken to reduce the head in the the tank (s)= 257.0\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_8_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_8_1.ipynb
new file mode 100644
index 00000000..4c96cf24
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_8_1.ipynb
@@ -0,0 +1,301 @@
+{
+ "metadata": {
+ "name": "Chapter 8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 8,Pipe Friction and Turbulent Flow"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.4,Page 199"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Internal diameter and reynold's number\n\n#variable declaration\nfrom math import pi\nimport math\nrho =867.0; #kg /m^3\nQ =12.0/3600; #m^3/ s\nu =7.5*10**( -4) ; # Ns/m^2\nL =200.0; # m\nH =10.0; # m\ng =9.81; # m/ s ^2\ne=2.718;\n\n#calculation\nd=(H*2*g /(4*0.079*(4* rho *Q/pi/u)**( -0.25) *L *(4* Q/pi)**2) )**( -0.2105);\nd=round(d,4);\nRe =4* rho *Q/ pi /d/u;\n\n#result\nprint\" Internal diameter of the pipe line (m)=\",round(d,5)\nprint\"Re =\",round(Re,2)\nprint(\"The value o f Reynolds number l i e s between 4000 and 10^5 , confirming the validity of using the Blasius equationfor smooth walled pipes\")",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Internal diameter of the pipe line (m)= 0.0505\nRe = 97152.8\nThe value o f Reynolds number l i e s between 4000 and 10^5 , confirming the validity of using the Blasius equationfor smooth walled pipes\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.5,Page 202"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding minimum allowable height\n\n#variable declaration\nfrom math import pi\nimport math\nm =40.0/60; # kg / s\nrho =873; #kg /m^3\nd =0.025; #m\nu =8.8*10** -4; # Ns/m^2\ndp =55.0*10**3; #N/m^2\nL =18; #m\ng =9.81; # m/ s ^2\n\n#calculation\nv2 =4*m/ rho / pi /d **2;\nRe=rho*v2*d/u;\n#using MOODY's Chart\nf =0.0055;\nH=dp/rho/g + v2 **2/2/ g + v2 **2/2/ g *(4* f*L/d +1.5) ;\n\n#result\nprint \"The minimum allowable height (m) =\",round(H,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The minimum allowable height (m) = 8.684\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.6,Page 204"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding minimum allowable height\n\n#variable declaration\nfrom math import pi\nimport math\nQ =15.0/3600; # m^3/ s\nd =0.05; #m\nRho =780.0;\nu =1.7*10**( -3) ; #Ns/m^2\nf =0.0065;\nL =100; #m\ng =9.8; #m^2/ s\n\n#calculation\nv =4* Q/ pi /d **2;\ndel_pf =2*f* Rho *v**2*L/d;\nH_f =4* f*L*v **2/( d*2*g);\nH_exit =v **2/2/ g;\nH_entrance =v **2/4/ g;\nH= H_f+ H_exit + H_entrance ;\n\n#result\nprint \"The pressure drop due to friction is (kN/m^2)\",round(del_pf,2)\nprint \" and the difference in levels is (m)\",round(H,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The pressure drop due to friction is (kN/m^2) 91324.16\n and the difference in levels is (m) 12.292\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.7,Page 206"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding rate of flow\n\n#variable declaration\nimport math\nf =0.005;\nL =10; # m\nd =0.025; # m\ng =9.81; # m/ s ^2\n\n#Calculations\n# H L=4\u0003 f \u0003L/d\u0003v ^2/2/ g+0.5\u0003 v ^2/2/ g\n# H L=8.5\u0003 v ^2/2/ g\n# By Be r n o u l l i e q u a t i o n we g e t\n#H=2.62+9.5\u0003 v2 ^2/2/ g\n# Applying the Be r n o u l l i e q u a t i o n between the liquid surface and discharge point\n# H L=33.5\u0003 v2 ^2/2/ g\n#Solving above two we g e t\nH =2.62+9.5* v2 **2/2/ g;\nv2 =1.9; # m/ s\nQ= pi*d **2/4* v2;\n\n#result\nprint\"Rate of flow (m^3/s)=\",round(Q,5)\nprint\"The minimum allowable height(m) =\",round(H,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Rate of flow (m^3/s)= 0.0009321875\nThe minimum allowable height(m) = 4.36796126402\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.8,Page 208"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding rate of flow\n\n#variable declaration\nimport math\nd_A =0.025; # m\nv_A =1.21; # m/ s\nd_B =0.05; # m\nv_B =1.71; # m/ s\n\n#calculation\nQ_A = pi *d_A **2* v_A /4;\nQ_B = pi *d_B **2* v_B /4;\n\n#result\nprint \"The rate of flow through parallel pipes A is \",round(Q_A,5)\nprint\"The rate of flow through parallel pipes B is (m^3/s)=\",round(Q_B,5);\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of flow through parallel pipes A is 0.00059\nThe rate of flow through parallel pipes B is (m^3/s)= 0.00336\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.9,Page 210"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding rate of flow\n\n#variable declaration\nfrom math import pi\nimport math\nd2 =0.06; # m\nd1 =0.12; # m\nk =0.44;\nf =0.05;\nL1 =500; # m\ng =9.81; # m/ s ^2\n\n#Calcualtion\n# v1=d2 ^2/ d1 ^2\u0003 v2\n# H f=4\u0003 f \u0003L1 /16/ d\u0003 v2 ^2/2/ g\n# H c=k\u0003 v2 ^2/2/ g\n# H f=4\u0003 f \u0003L2/d\u0003 v2 ^2/2/ g\n# H_exit=v2 ^2/2/ g\nv2= math.sqrt (30*2* g /173.4);\nQ= pi*d2 **2/4* v2;\n\n#result\nprint\"The rate of flow (m^3/s) =\",round(Q,5)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of flow (m^3/s) = 0.00521\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.10,Page 212"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding rate of flow\n\n#variable declaration\nimport math\nm =12.0*10**3/3600; #kg / s\nRho =815; #kg /m^3\nd =0.05; #m\ne =0.02;\nd1 =50; # m\nd2 =0.038; # m\ng =9.8; #m\n\n#calculation\nv =4* m/ Rho / pi /d**2;\nf1 =1/(2* math.log (d1/e,10) +2.28) **2;\nL_eq =d1 +2* d1*d;\nH_50mm =4* f1* L_eq *v **2/( d *2* g);\nv =4* m/( Rho * pi *d2 **2) ;\nf2 =1/(2* math.log (38/ e,10) +2.28) **2;\nL_eq =d1 +2* d1*d2;\nH_38mm =4* f2* L_eq *v **2/( d2 *2* g);\nHr =0.2* v **2/(2* g);\nH_L = H_50mm + H_38mm +Hr;\ndel_p_f =Rho*g* H_L ;\n\n#result\nprint \"The total pressure drop due to friction through the pipe system is (N/m^2) =\",round(del_p_f,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total pressure drop due to friction through the pipe system is (N/m^2) = 479792.576\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.11,Page 214"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding rate of flow\n\n#variable declaration\nimport math\n#H L=1.2\u0003 v ^2/2/ g\n# H L=4\u0003 f \u0003 L eq /d\u0003V^2/2/ g\n# L eq=60\u0003d\n# H L=240\u0003 f \u0003v ^2/2/ g\n# Combining the two e q u a t i o n s f o r head l o s s\n# 1.2\u0003v^2/2/ g=240\u0003 f_\u0003v^2/2/ g\n\nf =1.2/240;\nprint \" Friction factor =\",round(f,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Friction factor = 0.005\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.12,Page 216"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding rate of flow\n\n#variable declaration\nimport math\n# dp AB+dp BC=dp AD+dp DC\n# dp AD=2\u0003 f \u0003 rho \u0003v ^2\u0003L/d\n# dp AD=16600\u0003(3_Q) ^2\n# Li k ewi s e\n# dp AB=16600\u0003Q^2\n# dp BC=16600\u0003(Q+0.5) ^2\n# dp DC=16600\u0003(2.1_Q) ^2\n#By s o l v i n g above 5 e qu a t i o ns , we g e t\nQ =1.175; # litres per second\n\n#Calculation\ndp_AD =16600*(3 - Q) **2;\ndp_AB =16600* Q**2;\ndp_BC =16600*( Q +0.5) **2;\ndp_DC =16600*(2.1 - Q) **2;\n\nprint\"The rate of flow from B to C (l/s)=\",round(Q+0.5,3)\nprint \"dp_AD(kN/m^2 =\",round(dp_AD/1000,3);\nprint\"dp AB (kN/m^2)=\",round(dp_AB/1000,3);\nprint\"dp BC(kN/m^2) =\",round(dp_BC/1000,3);\nprint\"dp DC (kN/m^2)=\",round(dp_DC/1000,3);\nprint\"The lowest pressure is in the pipe coneecting C and D\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of flow from B to C (l/s)= 1.675\ndp_AD(kN/m^2 = 55.288\ndp AB (kN/m^2)= 22.918\ndp BC(kN/m^2) = 46.573\ndp DC (kN/m^2)= 14.203\nThe lowest pressure is in the pipe coneecting C and D\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.13,Page 221"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time taken\n\n#variable declaration\nfrom math import pi\nimport math\nfrom scipy import integrate\nH2 =0.5; #m\nH1 =2.0; #m\nA =4.0; #m^2\nf =0.005;\nL =20.0; #m\nd =0.025; #m\ng =9.81; # m/ s ^2\n\n#calculation\na= pi *d **2/4;\nc=A*math.sqrt( 4*f*L/d +2.5)/a/math.sqrt(2*g); # constant term of integration\ndef integrand(H,c):\n return -c*(H)**(-0.5)\n#integrate function '-A\u0003*sqrt ( ( 4*f \u0003L/d ) +2.5) / a /( sqrt(2\u0003*g ) )* \u0003(H) ^(-1/2)\n#f=lambda H:-4*1978.18*H**(-0.5);\n\n\nt=integrate.quad(integrand,H1,H2,args=(c))\n \n#result\nprint \"Time taken (s)=\",round(t[0],2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Time taken (s)= 11190.29\n"
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.14,Page 223"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding pressure drop\n\n#variable decleration\nfrom math import pi\nd0 =0.15; # m\nd1 =0.1; #m\nQ =50.0/3600; # m^3/ s\nf =0.0052;\nRho =972;\n\n\n#calculation\na= pi /4*(( d0)**2 -( d1) **2) ;\nP= pi *(( d0)+( d1));\nd_eq =4*a/P;\nv=Q/a;\ndel_p_f =2*f* Rho *v**2/ d_eq ;\n\n#result\nprint\" the pressure drop due to friction per metre lenfth of tube is found to be(Nm^2/m)\",round(del_p_f,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " the pressure drop due to friction per metre lenfth of tube is found to be(Nm^2/m) 404.636\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.15,Page 225"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Head Loss\n\n#variable decleration\nfrom math import pi\nfrom scipy import integrate\nf =0.005;\nQ =0.07; #m^3/ s\ng =9.81; #m/ s ^2\nL=3;\n\n#calculation\nu=0.3-0.0666*L;\ndef integrand(l,f,Q,g,u):\n return 32*f*Q**2/pi**2/g*(0.3-0.0666*l)**-5 \n\nH_f=integrate.quad(integrand,0,3,args=(f,Q,g,u));\nH_f=round(H_f[0],1)\n\n#result\nprint\" Fractional head loss(m) =\",H_f\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Fractional head loss(m) = 0.3\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 8.16,Page 228"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#variable decleration\nfrom math import pi\nimport math\ng =9.81; # m/ s ^2\nH =4; # m\nf =0.006;\nL =50; # m\nd =0.1; # m\ne=2.718;\n\n\n#calculation\nv1= math.sqrt (2* g*H /(4* f*L/d + 13) );\nv2=0.99*v1;\nt=2/v1*math.log((v1+v2)/(v1-v2),e)\n\n#result\nprint\"Time taken (s)=\",round(t,2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Time taken (s)= 5.98\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_9_1.ipynb b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_9_1.ipynb
new file mode 100644
index 00000000..3b69a21d
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/Chapter_9_1.ipynb
@@ -0,0 +1,184 @@
+{
+ "metadata": {
+ "name": "Chapter 9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 9,Pumps"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.2 (part1 and part2), Page 239"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding head loss \nimport math\n\n#Variable Declaration\nd =0.1; # m\nv_r =2; # m/ s\nf =0.005;\ng =9.81; #m/ s ^2\npi=3.14;\nL_s =2; #m\nL_r =10; # m\nQ1 =1.1*10**( -2) ; #m^3/ s\nz_t =12; #m\nz_s=5 #m\nL1 =20; #m\n\n#Calculation\nQ= math.pi*d**2/4*v_r ;\nH =12-70*Q-4300*Q*Q ;\nk =2*g*H/ v_r/v_r-(4*f*( L_s +L_r)/d)-1;\n\n#result\nprint\"The head loss across the restriction orifice (in terms of velocity head)\",round(k,3) \n\n#Part2\n#Finding System Head and Delivered Head\n# For the case of the valve being fully open\n\n#calculation\nv_t =4*Q1/math.pi/d**2;\nv_r =((2*g*( z_t-z_s )+(4*f*L1/d+1)*v_t**2) /(4*f*L_r/d+k+1))**(0.5) ;\nH1 =4*f* L_r /d*v_r**2/2/ g + 4*f* L_s /d*( v_r**2+ v_t**2) /2/g+k* v_r**2/2/ g + v_r**2/2/ g;\nQ= math.pi*d**2/4*( v_t+ v_r );\nH2 =12 -70*Q -4300* Q**2;\n\n#result\nprint\" System head(m)=\",round(H1,3)\nprint\" Delivered head(m)=\",round(H2,3)\nprint\"The delivered head therefore closely matches the system head at the flow rate of 1.1*\u000310^( -2) m^3/ s\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The head loss across the restriction orifice (in terms of velocity head) 44.863\n System head(m)= 7.603\n Delivered head(m)= 7.628\nThe delivered head therefore closely matches the system head at the flow rate of 1.1*\u000310^( -2) m^3/ s\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.6, Page 247"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding time and volume of liquid\n\nfrom math import pi\n#Variable Declaration\nNPSH =5; # m\np_v =18*10**3; # N/m^2\np_l =0.94*101.3*10**3; # N/m^2\nrho =970;#kg /m^3\ng =9.81; # m/ s ^2\nz_s =3; # m\nH_L =0.5; # m\nd =3; # m\nh =2.5; # m\nQ =5; #m^3/h\n\n#calculation\nz1= NPSH +( p_v -p_l)/ rho /g + z_s + H_L ;\nV= pi /4*d**2*(h-z1);\nt=V/Q;\n\n#result\nprint\"Quantity of liquid delivered (m^3)=\",round(V,2)\nprint\"Time taken (h)=\",round(t,2) \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Quantity of liquid delivered (m^3)= 14.95\nTime taken (h)= 2.99\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.8,Page 251"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding minimum level of alarm\n\n#variable Declaration\nN_s =0.14; #m^ ( 3 / 4 ) s ^(-3/2)\nH =30; #m\np_v =7.38*10**3; #N/m^2\np_l =50*10**3; #N/m^2\nrho =992; #kg /m^3\ng =9.81; #m/ s ^2\nH_L =0.2; #m\n\n#calculation\nNPSH =2.8* N_s **(1.33) *H;\nz1= NPSH +( p_v -p_l)/ rho /g+H_L;\n\n#result\nprint\"The minimum level of the alarm (m)=\",round(z1,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The minimum level of the alarm (m)= 1.967\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.10,Page 255"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Final Speed\n\n%pylab inline\n#Vabiable Declaration\nimport numpy as np\nfrom pylab import *\ndz =10; #z2-z1\ng =9.81; #m/ s ^2\nd =0.05; #m\nf =0.005;\nL =100; #m\nN1 =1200; #rpm\n\n# H=z2-z1+16\u0003Q^2/2/ g /%pi ^2/d ^4\u0003(4\u0003 f \u0003L/d+1)\n# H=10+5.42\u000310^5\u0003Q^2\n\n#Calculation\nQ =[0.000, 0.002, 0.004, 0.006, 0.008, 0.010];\nH_p =[40.0, 39.5, 38.0, 35.0, 30.0, 20.0];\nH_s =[10.0, 12.2, 18.7, 29.5, 44.7, 64.2];\nfigure()\nplot (Q,H_p , 'b')\nplot (Q,H_s , 'r')\nxlabel('FLOW (m^3/s)')\nylabel('HEAD (m)')\ntitle('system and pump')\n#xtitle (\" \" , \"Flow\" , \"Head\")\n#legend (\"pump\" , \" system\")\na =[0.0066, 0.0066];\nb =[0, 33.8];\n\nplot (a,b)\ne =[0, 0.0066];\nf =[33.8, 33.8];\nplot (e,f)\ni =[0.0049, 0.0049];\nh =[0, 23];\n\nplot (i,h)\nl =[0, 0.00495];\nm =[23, 23];\nplot (l,m)\nshow()\n\n#From graph\nH1 =34.0; #m\nH2 =23.0; # m\nQ1 =0.0066; #m^3/ s\nQ2 =0.00495; #m^3/ s\nN2=N1 *( H2/H1)**(0.5) ;\n\n#result\nprint \"Duty point(m^3/s) =\",round(Q1,4)\nprint \"The speed of the pump to reduce the flow by 25% =\",round(N2,3)\n\n\n\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\nWelcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\nFor more information, type 'help(pylab)'.\n"
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEXCAYAAABYsbiOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNX/P/DX4K6ggsKgoJILoZCIO4o5iWj2DSQzUz8q\nqdlifcv8/Nz6pGGWYpaW7ZkLbZb1ScU1l8TdUCE1FVcURcB0QAURBM7vj/NllGUQhrkzzNzX8/GY\nR8zMnTvvc8P75p5zz/tohBACREREZXCwdgBERFR9MUkQEZFRTBJERGQUkwQRERnFJEFEREYxSRAR\nkVFMEkQW4uXlhe3bt1s7DKJKYZIgm+Lg4IDz589bOwyTaDQaaDQaa4dBVClMEmRzOP+TyHKYJEhR\n8+fPh6enJxo2bAgfHx/s2LEDaWlpaNCgAfR6vWG7+Ph4uLm5oaCgAGfPnkXfvn3RuHFjuLq6YsSI\nEQCARx99FADg7+8PJycn/PLLLwCA9evXo1OnTnB2dkbv3r1x7Ngxw369v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788//xwLFy5Edna2IXkBwKZN\nmzBkyBBcv34da9asQWJiIgAUWyuke/fu2LVrF3x9fR98AIlMxCsJsgn16tVDQkICEhISjCaIIqKc\n+aFdu3ZFQkICbt++jbt376JBgwZo3bo1zp07h/3796N3796lPpOcnIxmzZoVe61oLMTPzw/u7u7w\n9fWFRqOBr68vLly4UOF2TZw4EWfPnsXChQuLFZ0ruqpp1KgR6tati/Hjx2P16tWoX7++YZvmzZtX\n6ruITMEkQXalQ4cOOHz4cLHXzp8/D0dHRzg6OqJ+/fpo164dli1bZrji6NmzJzZs2ICrV6/C29u7\nzP2WTDy1a9cGADg4OKBOnTqG1x0cHJCfn1/puJ999lnEx8cb4m3RogVq1qyJmjVrIi4uDkOHDsX6\n9evx+OOPF4vJFqofk21jkiC7MnLkSOzZs8dQDTcnJwevvfZasaU7e/XqhY8++giBgYEAgMDAQHz8\n8ceG5yW1atXKsJCLOZ09e9bw84YNGwxrYGzatAmDBg0CAGRnZyMzMxODBg3CwoULi90BlZqaCi8v\nL7PHRXQ/JgmyCcbWEdm+fTtatGhheBw9ehRr167Fu+++Cx8fH3Ts2BE9evTAK6+8Yvhc7969kZSU\nZEgKAQEBSElJKXM8omj7or/yy4qnZGwV/ev+008/hZ+fHwICAvDJJ59g+fLlAIDff//dcMVw69Yt\nhIaGwt/fH3369MGiRYsMn4+Li0OfPn0q9F1EpmKBP6IK6NevH3744YdSYxPmlpubiz59+iAuLq7c\n7W7evIng4GAcPHhQ0XiImCSIKmDjxo34888/i616Z02LFy+Gi4sLRo0aZe1QyM4xSRARkVEckyAi\nIqOYJIiIyCgmCSIiMopJgoiIjGKSICIio5gkiIjIqP8PGWNRyvJ14HwAAAAASUVORK5CYII=\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Duty point(m^3/s) = 0.0066\nThe speed of the pump to reduce the flow by 25% = 986.974\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.11,Page 257"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding head, rotational frequency, power\n\n#Varable Declaration\nQ =0.05; # m^3/ s\nv =2; # m/ s\nf =0.005;\nL_s =5; # m\nd =0.178; #m\ng =9.81; # m/ s ^2\nL_d =20; # m\np2 =1.5*10**5; # N/m^2\np1 =0.5*10**5; # N/m^2\nrho =1000; # kg /m^3\nz2 =15; # m\nz1 =5; # m\nN1 =1500.0/60; # rps\npi=3.14;\nQ =[0, 5, 10, 15, 20, 25];\nH =[9.25, 8.81, 7.85, 6.48, 4.81, 2.96];\nP=[- 0.96, 1.03, 1.19, 1.26, 1.45];\nn1 =[0, 45, 75, 800, 75, 50];\nH =27.96; #m\nH1 =6.48; #m\nQ1 =0.015; #m^3/ s\nQ =0.05; #m^3/ s\nD1 =0.15; #m\nn =0.80;\n\n#calculation\nd =(4* Q/ pi /v)**(0.5) ;\nH_f_s =4* f* L_s /d*v **2/2/ g;\nH_f_d =4* f* L_d /d*v **2/2/ g;\nH =1/(1 -0.25) *(( p2 -p1)/ rho /g + v **2/2/ g + z2 - z1 +H_f_s + H_f_d );\n# n=rho \u0003g\u0003Q\u0003H/P\nN=N1 *(H/H1) **(0.75) *( Q1/Q) **(0.5) ;\nD=D1 *(Q*N1/Q1/N)**(0.2) ;\nP= rho *g*Q*H/n;\n\n#result\nprint \" Differential Head (m) =\",round(H,3);\nprint \"impeller diameter (m)=\",round(D,3)\nprint \"The rotational speed at maximum efficiency (rps)=\",round(N,3)\nprint \"Power input to the pump (W)=\",round(P,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Differential Head (m) = 27.958\nimpeller diameter (m)= 0.173\nThe rotational speed at maximum efficiency (rps)= 40.992\nPower input to the pump (W)= 17141.964\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.12,Page 259"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding suction speed\n\n#Variable Declaration\nN =2000.0/60; #rps\nQ =50.0/3600; #m^3/ s\ng =9.81; #m/ s ^2\nH =5.0; #m\n\n#Calculation\nS_n =N*Q **(0.5) /(g)**(0.75)/(H) **(0.75) ;\n\n#result\nprint \" Suction specific speed =\",round(S_n,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Suction specific speed = 0.212\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 9.14,Page 264"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding Coeff. of Discharge and Power required\n\n# Variable Declaration\nA =0.01; #m^2\nL =0.3; # m\nN =60/60; # rps\nV_act =10.6/3600; # m^3/ s\nrho =1000; # kg /m^3\ng =9.81; # m/ s ^2\nQ =10.6/3600; # m^3/ s\nH =15; # m\n\n#calculation\nV=A*L*N;\nCd= V_act /V;\nP= rho *g*Q*H;\n\n#result\nprint \" Coeff. of Discharge =\",round(Cd,2)\nprint \"The power required (W)=\",round(P,3)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " Coeff. of Discharge = 0.98\nThe power required (W)= 433.275\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/README.txt b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/README.txt
new file mode 100644
index 00000000..b57e0716
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Avik Das
+Course: btech
+College/Institute/Organization: Indian Institute of Engineering Bombay
+Department/Designation: Civil engineering
+Book Title: Fluid Mechanics - Worked Examples For Engineers
+Author: C. Schaschke
+Publisher: Warwickshire, U. K.
+Year of publication: 2000
+Isbn: 0852954050
+Edition: 1st \ No newline at end of file
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depth-flowrate.png b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depth-flowrate.png
new file mode 100644
index 00000000..e85b8097
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depth-flowrate.png
Binary files differ
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depthvsflow.png b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depthvsflow.png
new file mode 100644
index 00000000..1d38c57b
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/depthvsflow.png
Binary files differ
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/flowrate.png b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/flowrate.png
new file mode 100644
index 00000000..d575416e
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/flowrate.png
Binary files differ
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/rateofflowandvlo.png b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/rateofflowandvlo.png
new file mode 100644
index 00000000..61d23fcb
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/rateofflowandvlo.png
Binary files differ
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump.png b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump.png
new file mode 100644
index 00000000..cd02ffae
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump.png
Binary files differ
diff --git a/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump_1.png b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump_1.png
new file mode 100644
index 00000000..8c8fb178
--- /dev/null
+++ b/Fluid_Mechanics_-_Worked_Examples_For_Engineers/screenshots/system&pump_1.png
Binary files differ
diff --git a/Fluid_Mechanics_/Chapter1.ipynb b/Fluid_Mechanics_/Chapter1.ipynb
new file mode 100644
index 00000000..e770487c
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter1.ipynb
@@ -0,0 +1,611 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5a200234453d213b93dc5d138f72ecdaaca8b6177244c9440288df8fe014829f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Fluid Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page no 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Density of air\n",
+ "\n",
+ "#Given \n",
+ "\n",
+ "Mw = 29.0 # Molecular weight of air\n",
+ "\n",
+ "R = 8323/Mw # Universal gas constant\n",
+ "\n",
+ "T = 273 + 20 # temperature in K\n",
+ "\n",
+ "p = 50*144*47.88 # Pressure in N/m**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "rho = p/(R*T) # from the state law\n",
+ "\n",
+ "print \"Desnity of air at 20 deg C and 50 psia = \",round(rho,2),\"kg/m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Desnity of air at 20 deg C and 50 psia = 4.1 kg/m**3"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page no 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Reduction in volume\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "dP = 10**6 # Pressure drop in N/m**2\n",
+ "\n",
+ "V = 1 # Volume in m**3\n",
+ "\n",
+ "bta = 2.2*10**9 # Bulk modulus of elasticity in N/m**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "dV = -dP*V/bta # Change in volume in m**3\n",
+ "\n",
+ "v = -dV*100\n",
+ "\n",
+ "print \"Reduction in volume = \",round(v,3),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reduction in volume = 0.045 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page no 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Volume reduction\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "bta1 = 2.28*10**9 # Bulk modulus of elasticity at 20 deg C and 103.4 N/m**2\n",
+ "\n",
+ "bta2 = 2.94*10**9 # Bulk modulus of elasticity at 20 deg C and 1034 N/m**2\n",
+ "\n",
+ "p1 = 103.4 # Pressure in N/m**2\n",
+ "\n",
+ "p2 = 1034 # Pressure in N/m**2\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "bavg = (bta1+bta2)/2 # bulk modulus average in N/m**2\n",
+ "\n",
+ "dP = p2-p1 # pressure drop in N/m**2\n",
+ "\n",
+ "V = 10 # Volume in m**3\n",
+ "\n",
+ "dV = dP*V/bavg # Change in volume in m**3\n",
+ "\n",
+ "v = -dV\n",
+ "\n",
+ "print \"Volume reduction = \",round(v,8),\"m**3\"\n",
+ "\n",
+ "print \"Negative sign indicates the volume has reduced\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume reduction = -3.57e-06 m**3\n",
+ "Negative sign indicates the volume has reduced"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page no 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Volume reduction \n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "patm = 14.6 # Atmospheric pressure in psia\n",
+ "\n",
+ "p1 = 100 # gauge pressure at point 1 in psia\n",
+ "\n",
+ "p2 = 102 # gauge pressure at point 2 in psia\n",
+ "\n",
+ "V = 1 # volume in m**3\n",
+ "# solution\n",
+ "\n",
+ "p = p1+patm # absolute pressure in psia\n",
+ "\n",
+ "b = p # for isothermal air\n",
+ "\n",
+ "p1 = p2+patm # absolute pressure in psia\n",
+ "\n",
+ "b1 = p1 # for isothermal air\n",
+ "\n",
+ "dP = p1 - p # change in pressure\n",
+ "\n",
+ "bavg = (b1+b)/2 # average bulk modulus of elasticity in N/m**2\n",
+ "\n",
+ "dV = dP*V/bavg\n",
+ "\n",
+ "v = -dV\n",
+ "\n",
+ "print \"An increase in pressure by 2 psia will result in a volume reduction of\",round(v,4),\"ft**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "An increase in pressure by 2 psia will result in a volume reduction of -0.0173 ft**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page no 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Sonic velocity of air\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "k = 1.4 # gas constant\n",
+ "\n",
+ "R = 1716 # Universal gas constant in ft.lb/slug^oR\n",
+ "\n",
+ "T = 68+460 # temperature in *oR\n",
+ "\n",
+ "# solution\n",
+ "\n",
+ "c = sqrt(k*R*T)\n",
+ "\n",
+ "print \"Sonic velocity in air at 68 deg F = \",round(c,0),\"ft/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sonic velocity in air at 68 deg F = 1126.0 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page no 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force required to move the piston\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.05 # diameter of cylinder 1 in m\n",
+ "\n",
+ "l = 0.2 # length of the cylinder in meters\n",
+ "\n",
+ "d1 = 0.052 # diameter of cylinder in m\n",
+ "\n",
+ "mu = 0.09 # Viscosity of oil in Ns/m**2\n",
+ "\n",
+ "U = 1 # velocity in m/s\n",
+ "\n",
+ "Y = (d1-d)/2 # clearance between the two cylinders in m\n",
+ "\n",
+ "A = pi*l*d # area in m**2\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "tau = mu*U/Y # Shear stress in N/m**2\n",
+ "\n",
+ "F = tau*A # Shear foce in N\n",
+ "\n",
+ "print \"Force required to move the piston by 1 m/s = \",round(F,2),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force required to move the piston by 1 m/s = 2.83 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page no 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Distance between the walls; Shear Stress; Location of maximum velocity\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "mu = 1.005*10**-3 # Viscosity of water in Ns/m**2\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "# Part a\n",
+ "\n",
+ "# Velocity is given by the formula u = 10*(0.01*y-y**2)\n",
+ "\n",
+ "# two boundary conditions must be satisfied\n",
+ "\n",
+ "# at y=0;u=0 at the bottom of the plate\n",
+ "\n",
+ "# at y=Y ; u = 0 at top of the plate\n",
+ "\n",
+ "Y = 0.01 # Distance between the walls\n",
+ "\n",
+ "Y1 = Y*100\n",
+ "\n",
+ "print \" (a) Distance between the walls = \",round(Y1,1),\"cm\"\n",
+ "\n",
+ "# Part b\n",
+ "\n",
+ "# tau = mu*du/dy # Newtons law of viscosity\n",
+ "\n",
+ "# differentiate u wrt y\n",
+ "\n",
+ "y = Symbol('y')\n",
+ "\n",
+ "u = 10*(0.01*y-y**2)\n",
+ "\n",
+ "uprime = u.diff(y)\n",
+ "\n",
+ "y = 0\n",
+ "\n",
+ "U = uprime\n",
+ "\n",
+ "#print U\n",
+ "# for y =0 at the bottom plate we get \n",
+ "\n",
+ "U1 = 0.01 # from U\n",
+ "\n",
+ "tau = mu*10*U1 # shear stress in N/m**2\n",
+ "\n",
+ "print \" (b) Shear stress = \",round(tau,9),\"N/m**2\"\n",
+ "\n",
+ "# Part c\n",
+ "\n",
+ "# Shaer stress at 20um from the wall\n",
+ "\n",
+ "tau1 = mu*10*(0.01-2*20*10**-6) # using the equation of U and y = 20*10**-6 calc shear stress in N/m**2\n",
+ "\n",
+ "print \" (c) Shear Stress at 20 um from the plate = \",round(tau1,9),\"N/m**2\"\n",
+ "\n",
+ "# Part D\n",
+ "\n",
+ "# Distance at which shaer stress is zero can be found from the location of maximum velocity \n",
+ "\n",
+ "# equating uprime = 0\n",
+ "\n",
+ "y1 = 0.01/2 # shear stress location\n",
+ "\n",
+ "print \" (d) Location of maximum velocity = \",round(y1,3),\"m\"\n",
+ "\n",
+ "print \"Above calculation indicates that the zero shear stress and the maximum velocity occurs at the same location which is half way between the plate\",\"\\n\",\"This also is in conformity with the fact that , in a flowing fluid, the velocity is maximum where shear stress is zero\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) Distance between the walls = 1.0 cm\n",
+ " (b) Shear stress = 0.0001005 N/m**2\n",
+ " (c) Shear Stress at 20 um from the plate = 0.000100098 N/m**2\n",
+ " (d) Location of maximum velocity = 0.005 m\n",
+ "Above calculation indicates that the zero shear stress and the maximum velocity occurs at the same location which is half way between the plate \n",
+ "This also is in conformity with the fact that , in a flowing fluid, the velocity is maximum where shear stress is zero\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Shaft torque for linear and non linear distribution of velocity \n",
+ "from math import *\n",
+ "# Given\n",
+ "\n",
+ "d = 0.1 # diameter of shaft in m\n",
+ "\n",
+ "l = 0.2 # length of the shaft in m\n",
+ "\n",
+ "t = 0.00002 # thickness in m\n",
+ "\n",
+ "N = 30 # RPM of shaft\n",
+ "\n",
+ "U = pi*d*30/60 # velocity in m/s\n",
+ "\n",
+ "r1 = d/2\n",
+ "\n",
+ "r2 = r1 + t # radius of bearing in m\n",
+ "\n",
+ "mu = 0.44 # Viscosity of SAE-30 oil in Ns/m**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# part a\n",
+ "\n",
+ "F = 2*pi*r1*l*mu*U/t\n",
+ "\n",
+ "T =F*r1\n",
+ "\n",
+ "print \" (a) For linear distribution of velocity , shaft torque = \",round(T,2),\"m.N\"\n",
+ "\n",
+ "# part b\n",
+ "\n",
+ "F1 = 2*pi*l*mu*U/log(r2/r1)\n",
+ "\n",
+ "\n",
+ "T1 =F1*r1\n",
+ "\n",
+ "print \" (b) For non-linear distribution of velocity , shaft torque = \",round(T1,2),\"m.N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) For linear distribution of velocity , shaft torque = 10.86 m.N\n",
+ " (b) For non-linear distribution of velocity , shaft torque = 10.86 m.N\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.9 Page 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Watts of energy lost to overcome friction\n",
+ "from math import *\n",
+ "# Given\n",
+ "\n",
+ "mu = 0.44 # viscosity of the oil in Ns/m**2\n",
+ "\n",
+ "N = 300 # RPM of the shaft\n",
+ "\n",
+ "t = 0.00025 # thickness of the film oil in m\n",
+ "\n",
+ "r1 = 0.15 # radius in m\n",
+ "\n",
+ "r2 = 0.1 # radius in m\n",
+ "\n",
+ "T = pi**2*mu*N*(r1**4-r2**4)/(60*t)\n",
+ "\n",
+ "P = T*2*pi*N/60\n",
+ "\n",
+ "print \"Watts of energy lost in overcoming friction at 300 RPM = \",round(P,0),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Watts of energy lost in overcoming friction at 300 RPM = 1108.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.10 Page no 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Excessive pressure inside droplet\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.01 # diameter in m\n",
+ "\n",
+ "sigma = 0.073 # surface tension in N/m\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "dP = 4*sigma/d # pressure excessive\n",
+ "\n",
+ "print \"Excessive pressure inside the droplet = \",round(dP,2),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Excessive pressure inside the droplet = 29.2 N"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.11 Page no 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Height to which alcohol will rise\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "sigma = 0.022 # surface tension in N/m\n",
+ "\n",
+ "gma = 9789 # specific weight\n",
+ "\n",
+ "S = 0.79 # specific gravity\n",
+ "\n",
+ "d = 0.002 # diameter in m\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "\n",
+ "h =4*sigma*1000/(gma*S*d) # capillary height in m\n",
+ "\n",
+ "print \"The alcohol will rise to a height of\",round(h,1),\"mm in the glass tube\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The alcohol will rise to a height of 5.7 mm in the glass tube"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter10.ipynb b/Fluid_Mechanics_/Chapter10.ipynb
new file mode 100644
index 00000000..fc9fd648
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter10.ipynb
@@ -0,0 +1,450 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3b6a6304ae5564c5b042191e18c023d5d141ad8d64a979c29e54da09ebc8a32e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Open Channel Flow\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.1 Page no 363"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Top width, area of lfow, hydraulic radius\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "b = 3 # base of the channel\n",
+ "\n",
+ "z = 0.5 # slope of the channel\n",
+ "\n",
+ "y = 2 # depth of the channel\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "T = b + 2*z*y\n",
+ "\n",
+ "print \"Top width =\",round(T,0),\"m\"\n",
+ "\n",
+ "A = (b+z*y)*y\n",
+ "\n",
+ "print \"Area of flow =\",round(A,0),\"m**2\"\n",
+ "\n",
+ "P = b + 2*y*sqrt(1+z**2)\n",
+ "\n",
+ "print \"Wetted perimeter =\",round(P,3),\"m\"\n",
+ "\n",
+ "R = A/P\n",
+ "\n",
+ "print \"Hydraulic radius =\",round(R,2),\"m\"\n",
+ "\n",
+ "D = A/T\n",
+ "\n",
+ "print \"Hydraulic depth =\",round(D,2),\"m\"\n",
+ "\n",
+ "Z = A*sqrt(D)\n",
+ "\n",
+ "print \"Secton Factor =\",round(Z,2),\"m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Top width = 5.0 m\n",
+ "Area of flow = 8.0 m**2\n",
+ "Wetted perimeter = 7.472 m\n",
+ "Hydraulic radius = 1.07 m\n",
+ "Hydraulic depth = 1.6 m\n",
+ "Secton Factor = 10.12 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page no 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge for the trapezoidal channel\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "z = 1.0 # slide slope\n",
+ "\n",
+ "b = 3.0 # base width\n",
+ "\n",
+ "y = 1.5 # depth\n",
+ "\n",
+ "S = 0.0009\n",
+ "\n",
+ "n = 0.012 # for concrete\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "A = (b+z*y)*y\n",
+ "\n",
+ "P = P = b + 2*y*sqrt(1+z**2)\n",
+ "\n",
+ "R = A/P\n",
+ "\n",
+ "# from mannings eqquation\n",
+ "\n",
+ "Q = A*(1/n)*(R**(2/3)*S**(1/2))\n",
+ "\n",
+ "print \"Discharge for the channel =\",round(Q,2),\"m**3/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge for the channel = 16.1 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.4 Page no 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine cross sectional area\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "z = 1\n",
+ "\n",
+ "Q = 10000/60 # discharge of water in ft**#/s\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "y = (Q/(1.828*2.25*sqrt(0.5)))**(2/5)\n",
+ "\n",
+ "print \"depth(y) =\",round(y,2),\"ft\"\n",
+ "\n",
+ "b = 0.828*y\n",
+ "\n",
+ "print \"base width(b) =\",round(b,2),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "depth(y) = 5.05 ft\n",
+ "base width(b) = 4.18 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.5 Page no 378"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate criticcal depth\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "y = 2.5 # depth\n",
+ "\n",
+ "V = 8 # velocity in m/s\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Yc = (20**2/g)**(1/3)\n",
+ "\n",
+ "print \"Critical depth =\",round(Yc,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical depth = 3.44 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.6 Page no 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determine normal depth, flow regine, critical depth\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q = 15 # flow rate in m**3/s\n",
+ "\n",
+ "w = 4.0 # bottom width\n",
+ "\n",
+ "S = 0.0008 # bed slope\n",
+ "\n",
+ "n = 0.025 # manning constant\n",
+ "\n",
+ "z = 0.5 # slope\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# We use a trial and error method here to find the value of y i.e. normal depth\n",
+ "\n",
+ "y = 2.22 # we take the value of y as 2.2 m\n",
+ "\n",
+ "Q = ((4+0.5*y)*(y/(n))*(((4+0.5*y)*y)/(4+2.236*y))**(0.667)*(S)**(0.5))\n",
+ "\n",
+ "print \"a )Normal Depth =\",round(y,2),\"m\"\n",
+ "\n",
+ "A = (4+0.5*y)*y\n",
+ "\n",
+ "T = (w+2*z*y)\n",
+ "\n",
+ "D = A/T\n",
+ "\n",
+ "V = (Q/A)\n",
+ "\n",
+ "F =V/(sqrt(9.81*D)) \n",
+ "\n",
+ "print \"b )F = \",round(F,2),\" Since the Froude number is less than 1, the flow is subcritical\"\n",
+ "\n",
+ "# we use trail and error to find the value of yc for critical depth\n",
+ "\n",
+ "yc = 1.08\n",
+ "\n",
+ "Q1 = (4+z*yc)*yc*sqrt((9.81*(4+0.5*yc)*yc)/(4+2*z*yc)) \n",
+ "\n",
+ "print \"c )Critical depth is = \",round(yc,2),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a )Normal Depth = 2.22 m\n",
+ "b )F = 0.31 Since the Froude number is less than 1, the flow is subcritical\n",
+ "c )Critical depth is = 1.08 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 10.8 Page no 390"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Height, type and length of jump and loss of energy\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "b = 60 # base width in ft\n",
+ "\n",
+ "y1 = 2.5 # base depth in ft\n",
+ "\n",
+ "Q = 2500 # discharge in ft**3/s\n",
+ "\n",
+ "g = 32.2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V1 = Q/(b*y1)\n",
+ "\n",
+ "F1 = V1/sqrt(g*y1)\n",
+ "\n",
+ "y2 = y1*0.5*(sqrt(1+8*F1**2)-1)\n",
+ "\n",
+ "V2 = Q/(b*y2)\n",
+ "\n",
+ "print \"Since F1 =\",round(F1,2),\" It is a weak jump\"\n",
+ "\n",
+ "L = y2*4.25\n",
+ "\n",
+ "print \"Length of the jump =\",round(L,0),\"ft\"\n",
+ "\n",
+ "E1 = y1+(V1**2/(2*g))\n",
+ "\n",
+ "E2 = y2+(V2**2/(2*g))\n",
+ "\n",
+ "El = E1-E2\n",
+ "\n",
+ "Te = El*62.4*Q/543\n",
+ "\n",
+ "print \"Total energy loss =\",round(Te,2),\"HP\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Since F1 = 1.86 It is a weak jump\n",
+ "Length of the jump = 23.0 ft\n",
+ "Total energy loss = 133.7 HP\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.12 Page no 409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine flow rate\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 6 # depth of the channel\n",
+ "\n",
+ "w= 12 # width of the channel\n",
+ "\n",
+ "h = 1.0 # height of the channel\n",
+ "\n",
+ "p = 9 # pressure drop in m\n",
+ "\n",
+ "g = 32.2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "y2 = y1 - h - 0.75\n",
+ "\n",
+ "V1 = sqrt(2*g*0.75/((1.41)**2-1))\n",
+ "\n",
+ "Q = w*b*V1/10\n",
+ "\n",
+ "print \"Discharge =\",round(Q,0),\"cfs\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 503.0 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter11.ipynb b/Fluid_Mechanics_/Chapter11.ipynb
new file mode 100644
index 00000000..93e3588f
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter11.ipynb
@@ -0,0 +1,328 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2f6bc3a0f00ca48f89200f1a14edc0c65849595040c83c5100245e53f0cc525b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter : Compressible Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1 Page no 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 11.1\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "T1 = 273 + 15 # temperature in K\n",
+ "\n",
+ "T2 = 273 + 90 # temperature in K\n",
+ "\n",
+ "Cp = 0.24 # cp for air in kcal/kgK\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "dh = Cp*(T2-T1) # enthalpy per kg of air\n",
+ "\n",
+ "H = 10*dh # total enthallpy of 10 kg air\n",
+ "\n",
+ "print \"Total change in enthalpy for 10 kg air = \",round(H,0),\"kcal\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total change in enthalpy for 10 kg air = 180.0 kcal\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2 Page no 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 11.2\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "T1 = 273 + 15 # temperature in K\n",
+ "\n",
+ "T2 = 273 + 90 # temperature in K\n",
+ "\n",
+ "P1 = 40 + 101.3 # pressure in abs\n",
+ "\n",
+ "P2 = 360 + 101.3 # presure in abs\n",
+ "\n",
+ "Cv = 0.171 # Specific volume Coefficient of air\n",
+ "\n",
+ "k = 1.4 # gas constant\n",
+ "\n",
+ "# solution\n",
+ "\n",
+ "dS = Cv*log((T2/T1)**k*(P2/P1)**(1-k))\n",
+ "\n",
+ "S = 10*dS\n",
+ "\n",
+ "print \"Total change in enthalpy of 10 Kg of air =\",round(S,3),\"kcal/K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total change in enthalpy of 10 Kg of air = -0.255 kcal/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.3 Page no 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 11.3\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "\n",
+ "P1 = 10 # pressure in psia\n",
+ "\n",
+ "P2 = 30 # pressure in psia\n",
+ "\n",
+ "T1 = 460+110 # temperature in R\n",
+ "\n",
+ "k =1.4 # gas constant\n",
+ "\n",
+ "T2 = T1*(P2/P1)**((k-1)/k)\n",
+ "\n",
+ "t2 = T2-460 # final temperature of air\n",
+ "\n",
+ "print \"Final temperature if air = \",round(t2,1),\"F\"\n",
+ "\n",
+ "Cv = 0.157 # coefficient of air \n",
+ "\n",
+ "W = Cv*(T2-T1) # work done per unit mass of oxygen\n",
+ "\n",
+ "Tw = 10*W # total work done on 10 slugs\n",
+ "\n",
+ "print \"Total work done on 10 slugs = \",round(Tw,0),\"Btu\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final temperature if air = 320.2 F\n",
+ "Total work done on 10 slugs = 330.0 Btu\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.4 Page no 426"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 11.4\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# for water\n",
+ "\n",
+ "S =1 # specific gravity\n",
+ "\n",
+ "rho = S*1000 # density in kg/m**3\n",
+ "\n",
+ "bta = 2.2*10**9 # Bulk modulus of elasticity\n",
+ "\n",
+ "# ethly alcohol\n",
+ "\n",
+ "S1 =0.79 # specific gravity\n",
+ "\n",
+ "rho2 = S1*1000 # density in kg/m**3\n",
+ "\n",
+ "bta2 = 1.21*10**9 # Bulk modulus of elasticity\n",
+ "\n",
+ "# for air\n",
+ "\n",
+ "k = 1.4 # gas constant for air\n",
+ "\n",
+ "R = 287 # universal gas constant\n",
+ "\n",
+ "T = 273+20 # temperature in K\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "C1 = sqrt(bta/rho)\n",
+ "\n",
+ "C2 = sqrt(bta2/rho2)\n",
+ "\n",
+ "print \"Speed of sound in water =\",round(C1,0),\"m/s\"\n",
+ "\n",
+ "print \"Speed of sound in ethly alcohol =\",round(C2,0),\"m/s\"\n",
+ "\n",
+ "C3 = sqrt(k*R*T)\n",
+ "\n",
+ "print \"Speed of sound in Air =\",round(C3,0),\"m/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Speed of sound in water = 1483.0 m/s\n",
+ "Speed of sound in ethly alcohol = 1238.0 m/s\n",
+ "Speed of sound in Air = 343.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.5 Page no 431"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 11.5\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "P1 = 1.5 # pressure in psia\n",
+ "\n",
+ "T1 = 40 + 460 # temperature in R\n",
+ "\n",
+ "k = 1.4 # gas constant\n",
+ "\n",
+ "R = 1716 # universal gas constant in ft.lb/slug R\n",
+ "\n",
+ "V1 = 1500 # velocity in ft/s\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "c1 = sqrt(k*R*T1)\n",
+ "\n",
+ "M1 = V1/c1\n",
+ "\n",
+ "M2 = sqrt((2+(k-1)*M1**2)/(2*k*M1**2-(k-1)))\n",
+ "print M2\n",
+ "\n",
+ "P2 = P1*((1+k*M1**2)/(1+k*M2**2))\n",
+ "\n",
+ "print \"Pressure at downstream = \",round(P2,2),\"psia\"\n",
+ "\n",
+ "T2 = T1*((1+0.5*(k-1)*M1**2)/(1+0.5*(k-1)*M2**2))\n",
+ "\n",
+ "t2 = T2-460\n",
+ "\n",
+ "print \"Temperature at downstream = \",round(t2,1),\"F\"\n",
+ "V2 = M2*sqrt(k*R*t2)\n",
+ "\n",
+ "print \"Velocity downstream = \",round(V2,2),\"ft/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.753305702898\n",
+ "Pressure at downstream = 3.03 psia\n",
+ "Temperature at downstream = 157.3 F\n",
+ "Velocity downstream = 463.02 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter12.ipynb b/Fluid_Mechanics_/Chapter12.ipynb
new file mode 100644
index 00000000..06c84068
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter12.ipynb
@@ -0,0 +1,360 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b809e6889d9fdf33446744d4f1caf3aac2e77607182761aeef234f4a6cc34adc"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter : Turbomachines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.1 Page no 443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 12.1\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q = 0.25 # discharge from the pump in m**3/s\n",
+ "\n",
+ "gma= 0.8*9810 # specific weight in kg/m**3\n",
+ "\n",
+ "H=25 # elevation head in m\n",
+ "\n",
+ "T = 350 # Torque to drive the shaft in Nm\n",
+ "\n",
+ "N = 1800 # Speed in RPM\n",
+ "\n",
+ "w = 2*pi*N/60 # angular velocity\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Eff = gma*Q*H*100/(T*w) # efficiency\n",
+ "\n",
+ "print \"Efficiency of th pump =\",round(Eff,0),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of th pump = 74.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page no 447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 12.2\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.4 # diameter of the pump in m\n",
+ "\n",
+ "b = 0.03 # width in m\n",
+ "\n",
+ "theta = pi/3 # blade angle\n",
+ "\n",
+ "N = 1500 # speed in RPM\n",
+ "\n",
+ "Q = 0.4 # flow rate in m**3/s\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "w = 2*pi*N/60 # anggular velocity in rad/s\n",
+ "\n",
+ "u2 = (d/2)*w # blade velocity in m/s\n",
+ "\n",
+ "V2r = Q/(2*pi*(d/2)*b) # relative velocity in m/s\n",
+ "\n",
+ "print \"(a)\"\n",
+ "\n",
+ "print \"Radial velocity at exit =\",round(V2r,1),\"m/s\"\n",
+ "\n",
+ "V2t = u2 - V2r*(cos(theta)/sin(theta))\n",
+ "\n",
+ "print \"Whirl velocity = \",round(V2t,1),\"m/s\"\n",
+ "\n",
+ "v2 = V2r/sin(theta)\n",
+ "\n",
+ "print \"Relative velocity = \",round(v2,2),\"m/s\"\n",
+ "\n",
+ "V2 = sqrt(V2t**2+V2r**2)\n",
+ "\n",
+ "print \"Actual velocity =\",round(V2,2),\"m/s\"\n",
+ "\n",
+ "print \"(b)\"\n",
+ "\n",
+ "H = u2*V2t/g\n",
+ "\n",
+ "print\"Head added for no inlet whirl =\",round(H,0),\"m\"\n",
+ "\n",
+ "print \"(c)\"\n",
+ "\n",
+ "P = g*Q*H\n",
+ "\n",
+ "print \"Power required =\",round(P,1),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a)\n",
+ "Radial velocity at exit = 10.6 m/s\n",
+ "Whirl velocity = 25.3 m/s\n",
+ "Relative velocity = 12.25 m/s\n",
+ "Actual velocity = 27.43 m/s\n",
+ "(b)\n",
+ "Head added for no inlet whirl = 81.0 m\n",
+ "(c)\n",
+ "Power required = 317.8 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page no 450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 12.3\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.36 # diameter of the impeller of pump\n",
+ "\n",
+ "N = 1500 # Speed of impeller in RPM\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# For best efficiency\n",
+ "\n",
+ "Q1 = 82 # discharge in l/s\n",
+ "\n",
+ "H1 = 17.5 # Head in m\n",
+ "\n",
+ "Eta = 0.8 # efficiency \n",
+ "\n",
+ "Q2 = 100 # discharge in l/s\n",
+ "\n",
+ "H2 = 20 # head in m\n",
+ "\n",
+ "# Solving the simulataneous equation we get\n",
+ "\n",
+ "D2 = 38.45\n",
+ "\n",
+ "print \"Impeller size =\",round(D2,2),\"cm\"\n",
+ "\n",
+ "N2 = 1500 \n",
+ "\n",
+ "print \"Speed of the pump =\",round(N2,0),\"RPM\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impeller size = 38.45 cm\n",
+ "Speed of the pump = 1500.0 RPM\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page no 454 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 12.4\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "q = 500 # discharge in cgm\n",
+ "\n",
+ "Q = 500/449 # discharge in ft**3/s\n",
+ "\n",
+ "D = 0.667 # diameter in ft\n",
+ "\n",
+ "A = pi*D**2/4\n",
+ "\n",
+ "V = Q/A # velocity in ft/s\n",
+ "\n",
+ "g = 32.2 # acceleration due to gravity in ft/s**2\n",
+ "\n",
+ "N = 1800 # speed in RPM\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# for water at 65 deg C\n",
+ "\n",
+ "nu = 1.134*10**-5 # viscosity in ft**2/s\n",
+ "\n",
+ "e = 0.00085 # epssilon in ft\n",
+ "\n",
+ "r = 0.001275 \n",
+ "\n",
+ "R = V*D/nu # reynolds no\n",
+ "\n",
+ "f = 0.022 # from moody's diagram\n",
+ "\n",
+ "Hl = V**2*(12.1+(f*224.9))/64.4\n",
+ "\n",
+ "hs = 119.4 + Hl\n",
+ "\n",
+ "print \"Discharge, Q = \",round(Q,2),\"ft**3/s\"\n",
+ "print \"Dynamic head of the pump, H =\",round(hs,1),\"m\"\n",
+ "\n",
+ "Ns = N*sqrt(q)/(hs)**(3/4)\n",
+ "\n",
+ "print \"Specific speed of the pump, Ns =\",round(Ns,0),\"RPM\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge, Q = 1.11 ft**3/s\n",
+ "Dynamic head of the pump, H = 122.1 m\n",
+ "Specific speed of the pump, Ns = 1096.0 RPM\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.5 Page no 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 12.5 \n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "H = 60 # height in m\n",
+ "\n",
+ "Pb = 98*10**3 # barometric pressure in N/m**2\n",
+ "\n",
+ "Hl = 1 # head in m\n",
+ "\n",
+ "Pv = 1707 # vapour pressure \n",
+ "\n",
+ "sigma = 0.08\n",
+ "\n",
+ "w = 9810 # specific weight\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Npsh_m = sigma*60 # minimum NPSH\n",
+ "\n",
+ "Hsm = (Pb/w)-(Pv/w)-Npsh_m-Hl\n",
+ "\n",
+ "print \"Minimum value of static suction lift = \",round(Hsm,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum value of static suction lift = 4.02 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter2.ipynb b/Fluid_Mechanics_/Chapter2.ipynb
new file mode 100644
index 00000000..24cd4f37
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter2.ipynb
@@ -0,0 +1,976 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:db7a54602402420ebc03881b70578491b776f0322d83cb209fd1e5faed86cdad"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Fluid Statics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page no 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force applied on the piston\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given \n",
+ "\n",
+ "d = 10 # diameter of hydraulic press in meters\n",
+ "\n",
+ "d1 = 1 # diameter of piston in meters\n",
+ "\n",
+ "W = 1000 # weight in Newtons\n",
+ "\n",
+ "Ap = math.pi*d1**2/4 # Area of piston in m**2\n",
+ "\n",
+ "Ar = math.pi*d**2/4 # Area of rram in m**2\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "p = W/Ar # pressure to be supplied by the oil in N/cm**2\n",
+ "\n",
+ "F = p*Ap # Force applied on the piston\n",
+ "\n",
+ "print \"Using the pascal's law a weight of 1000N can be lifted by applying a force only of \",round(F,1),\"N\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using the pascal's law a weight of 1000N can be lifted by applying a force only of 10.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page no 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure in kN/m**2\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "h = 1 # ocean depth below the surface in km\n",
+ "\n",
+ "gma = 10070 # Specific weight of sea water\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "P =gma*h # Pressure in kN/m**2\n",
+ "\n",
+ "print \"Pressure = \",round(P),\"kN/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure = 10070.0 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page no 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure at the bottom of the tank\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "p1 = 150*10**3 # Pressure at point 1 in kN/m**2\n",
+ "\n",
+ "Sg = 0.85 # Specific gravity of oil\n",
+ "\n",
+ "h = 0.8 # height of oil 2 i tank in meters \n",
+ "\n",
+ "g = 9810 # specific gravity \n",
+ "\n",
+ "h1 = 2.0 # height of oil 3 in tank\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "p2 = (p1 + Sg*h*g)\n",
+ "\n",
+ "p3 = (p2 + g*h1)/1000\n",
+ "\n",
+ "print \"Pressure at the bottom of the tank is\",round(p3,1),\"kN/m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure at the bottom of the tank is 176.3 kN/m**3"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page no 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Height of the mountain\n",
+ "\n",
+ "# Given\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "Po = 570 # mercury barometer reading in mm\n",
+ "\n",
+ "T = 273 -5 # temperature in K\n",
+ "\n",
+ "p = 750 # mercury barometer reading in mm\n",
+ "\n",
+ "n = 1.2345 # for polytropic atmosphere\n",
+ "\n",
+ "R =287 # univerasl gas constant in J/Kg-K\n",
+ "\n",
+ "g = 9.81 \n",
+ "\n",
+ "r = p/Po\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "y = -(R*T/(g*0.19))*(1 - (r)**((n-1)/n))\n",
+ "\n",
+ "print \"Height of the mountain is\",round(y,0),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of the mountain is 2208.0 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page no 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure in the pipe\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "h1 = 500 # height in mm\n",
+ "\n",
+ "h2 = 950 # height in mm\n",
+ "\n",
+ "S1 = 1 # specific gravity fo water\n",
+ "\n",
+ "S2 = 1.5 # specific gravity of liquid 2\n",
+ "\n",
+ "w = 9810 # specific weight of water\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "ha = ((h2*S2)-(h1*S1))/1000\n",
+ "\n",
+ "Pa = w*ha/1000 # Pressure in kPa\n",
+ "\n",
+ "print \"Pressure in the pipe = \",round(Pa,3),\"kPa\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure in the pipe = 9.074 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page no 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force required to open the gate\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "d = 1 # diameter of the gate in m\n",
+ "\n",
+ "w = 9810 # specific weight in N/m**3\n",
+ "\n",
+ "A = pi*d**2/4 # area of the gate\n",
+ "\n",
+ "Ig = pi*d**4/64 # mamm moment of inertia\n",
+ "\n",
+ "theta = pi/2\n",
+ "\n",
+ "y1= 5+0.5\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "F = w*round(A,3)*(y1) # the answer will come out to be different as they have used the value of Area as 0.78 \n",
+ "\n",
+ "# depth of the COP\n",
+ "\n",
+ "h1 = y1 + (Ig*math.sin(theta)*math.sin(theta)/(A*y1))\n",
+ "\n",
+ "# moment about hinge A\n",
+ "\n",
+ "F1 = (F*(h1 - 5))/d\n",
+ "\n",
+ "print \"Magnitude of the force required to open the gate = \",round(F1,0),\"N\" \n",
+ "#The area calculated in the book is 0.785 and that calculated from code is 0.78. \n",
+ "#This difference of 0.005 is causing the answer to change from the original\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of the force required to open the gate = 21659.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page no 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# total force ; position of the center of pressure \n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "l =2 # length of the plate in m\n",
+ "\n",
+ "b =1 # width of the plate\n",
+ "\n",
+ "theta = pi/3\n",
+ "\n",
+ "h = 0.75 # depth of the plate\n",
+ "\n",
+ "w = 9810 # specific weight of water\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "A = 1*2\n",
+ "\n",
+ "y1 = h + 1*sin(theta)\n",
+ "\n",
+ "F = w*A*y1/1000\n",
+ "\n",
+ "print \"(a) Total force = \",round(F,2),\"kN\"\n",
+ "\n",
+ "Ig = (b*l**3)/12\n",
+ "\n",
+ "h1 = y1 + (Ig*sin(theta)*sin(theta)/(2*y1))\n",
+ "\n",
+ "print \"(b) Position of center of pressure = \",round(h1,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total force = 31.71 kN\n",
+ "(b) Position of center of pressure = 1.616 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page no 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Hydrostatic force and point of location \n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 6 # diameter of the gate in ft\n",
+ "\n",
+ "A =pi*d**2/4 # area of the gate\n",
+ "\n",
+ "p1 = 600 # pressure on top in psia\n",
+ "\n",
+ "y1 = 10 +2 + 3*sin(pi/6)\n",
+ "\n",
+ "F = 62.4*A*y1\n",
+ "\n",
+ "F1 = p1*A\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Tf = F+F1\n",
+ "\n",
+ "print \"Total hydrostatic force =\",round(Tf,0),\"lbs\"\n",
+ "\n",
+ "Ig = pi*d**4/64\n",
+ "\n",
+ "h1 = y1 + ((Ig*sin(pi/6)*sin(pi/6))/(A*y1))\n",
+ "\n",
+ "H = ((F*h1)+(F1*y1))/Tf\n",
+ "\n",
+ "print \"point of location on the center plate = \",round(H,2),\"ft\"\n",
+ "\n",
+ "# method 2\n",
+ "\n",
+ "Hf = p1/62.4 # equivalent fluid height\n",
+ "\n",
+ "y2 = Hf+y1\n",
+ "\n",
+ "Tf1 = 62.4*A*y2\n",
+ "\n",
+ "h2 = y2 + ((Ig*sin(pi/6)*sin(pi/6))/(A*y2))\n",
+ "\n",
+ "H1 = y2-Hf\n",
+ "\n",
+ "print \" OR point of location on the center plate from method 2 = \",round(H1,2),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total hydrostatic force = 40783.0 lbs\n",
+ "point of location on the center plate = 13.52 ft\n",
+ " OR point of location on the center plate from method 2 = 13.5 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10 Page no 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Horizontal and Vertical components\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "R = 4 # radius of the gate in ft\n",
+ "\n",
+ "w = 1 # width of the gate in ft\n",
+ "\n",
+ "gma =62.4 # specific weight of water\n",
+ "\n",
+ "y1 = 4 # distance of center of the gate\n",
+ "\n",
+ "xv1 = 2 # distance in ft\n",
+ "\n",
+ "xv2 = 1.7 # distance in ft\n",
+ "\n",
+ "# Solution \n",
+ "\n",
+ "Fh = R*y1*gma\n",
+ "\n",
+ "Ig = w*R**3/12\n",
+ "\n",
+ "yh = y1 + (Ig/(R*y1))\n",
+ "\n",
+ "Fv1 = R*2*gma\n",
+ "\n",
+ "Fv2 = pi*R**2*gma/4\n",
+ "\n",
+ "Fv = Fv1 + Fv2\n",
+ "\n",
+ "Xv = (Fv1*xv1+Fv2*xv2)/(Fv)\n",
+ "\n",
+ "print \"Horizontal component acting on the plate = \",round(Fh,2),\"lbs\"\n",
+ "\n",
+ "print \"Vertical component acting on the plate = \",round(Fv,2),\"lbs\"\n",
+ "\n",
+ "print \"location of Xv =\",round(Xv,2),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Horizontal component acting on the plate = 998.4 lbs\n",
+ "Vertical component acting on the plate = 1283.34 lbs\n",
+ "location of Xv = 1.82 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11 Page no 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Vertical and Horizontal components\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "p = 50 # pressure in psia\n",
+ "\n",
+ "gma = 62.4 # specific weight in ft\n",
+ "\n",
+ "h1 = p*144/gma # equivalent height of water surface in ft\n",
+ "\n",
+ "R = 4 # radius of gate in ft\n",
+ "\n",
+ "w = 1 # width of the gate in ft\n",
+ "\n",
+ "A = R*w\n",
+ "\n",
+ "y1 = h1 + 2.5 + 2 # center of pressure\n",
+ "\n",
+ "xv1 = 2 # center of pressure1 for x direction force\n",
+ "\n",
+ "xv2 = 1.7 # center of pressure2 for x direction force\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Fh = gma*A*y1 # hiorizontal force\n",
+ "\n",
+ "Ig = 5.33 # moment of inertia\n",
+ "\n",
+ "yh = y1 + (Ig/(A*y1)) # location of horizontal component\n",
+ "\n",
+ "y2 = h1+2.5\n",
+ "\n",
+ "Fv1 = gma*(R*y2) # vertical force component 1\n",
+ "\n",
+ "Fv2 = gma*(pi*R**2/4) # vrtical force component 2\n",
+ "\n",
+ "Fv = Fv1 + Fv2 # vertical force component\n",
+ "\n",
+ "Xv = (Fv1*xv1+Fv2*xv2)/(Fv)\n",
+ "\n",
+ "print \"(a) Horizontal component acting on the plate = \",round(Fh,0),\"lbs\" # The answer for horizontal force in the book is wrong\n",
+ "\n",
+ "print \"(b) Vertical component acting on the plate = \",round(Fv,2),\"lbs\"\n",
+ "\n",
+ "print \"location of vertical component Xv =\",round(Xv,2),\"ft from the left wall\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Horizontal component acting on the plate = 29923.0 lbs\n",
+ "(b) Vertical component acting on the plate = 30208.14 lbs\n",
+ "location of vertical component Xv = 1.99 ft from the left wall\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13 Page no 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Depth to which water would rise\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "l = 3 # length in m\n",
+ "\n",
+ "b = 4 # breadth in m\n",
+ "\n",
+ "h = 15 # height in m\n",
+ "\n",
+ "S = 0.9 # specific gravity of barge\n",
+ "\n",
+ "Sw = 1.09 # specific gravity of water\n",
+ "\n",
+ "Wd = 150*10**3 # addditional weight in kN\n",
+ "\n",
+ "V = l*b*h # volume in m**3\n",
+ "\n",
+ "Wb = gma*S*V # weight of barge\n",
+ "\n",
+ "Tw = Wb + Wd # total weight in kN\n",
+ "\n",
+ "gma = 9810 # specific density \n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Fb = Tw # since barge is floating\n",
+ "\n",
+ "V1 = Fb/((gma/1000)*Sw) # volume in m**3\n",
+ "\n",
+ "\n",
+ "d = (V1/(h*b))/1000\n",
+ "\n",
+ "print \"Depth to which water would rise = \",round(d,2),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth to which water would rise = 0.25 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.14 Page no 85 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Level at which cylinder will float\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "W = 0.4 * 9.81 # weight of the solid cylinder in N\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "A = np.array([(1,-0.96),(1,1)])\n",
+ "\n",
+ "b = np.array([0,6.37])\n",
+ "\n",
+ "x = np.linalg.solve(A,b)\n",
+ "\n",
+ "X = x[0]\n",
+ "\n",
+ "Y = x[1]\n",
+ "\n",
+ "print \"X = \",round(X,2),\"cm\"\n",
+ "\n",
+ "print \"Y = \",round(Y,2),\"cm\"\n",
+ "\n",
+ "b = 8 -x[0]\n",
+ "\n",
+ "print \"The bottom of the solid cylinder will be \",round(b,2),\"cm above the bottom\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X = 3.12 cm\n",
+ "Y = 3.25 cm\n",
+ "The bottom of the solid cylinder will be 4.88 cm above the bottom\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.15 Page no 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Weight of the pan and the magnitude of righting moment\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "l =100 # length of the pan in cm\n",
+ "\n",
+ "w = 20 # width of the pan in cm\n",
+ "\n",
+ "d = 4 # depth of the pan in cm\n",
+ "\n",
+ "L = 1.5 # load in N/m\n",
+ "\n",
+ "gma = 9810 # sepcific weight\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Fb = gma*(d*w*l/(2*l**3)) # weight on the pan\n",
+ "\n",
+ "W = Fb-L # weight of the pan\n",
+ "\n",
+ "X1 = w/3\n",
+ "\n",
+ "X2 = w/2\n",
+ "\n",
+ "theta = math.atan(d/w)*180/pi\n",
+ "\n",
+ "x = ((X2-X1)*cos(theta*pi/180))\n",
+ "\n",
+ "# momentum equation \n",
+ "\n",
+ "M = W*x\n",
+ "\n",
+ "print \"Weight of the pan =\",round(W,1),\"N\"\n",
+ "print \"Magnitude of right momentum = \",round(M,1),\"N.cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Weight of the pan = 37.7 N\n",
+ "Magnitude of right momentum = 123.4 N.cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example no 2.16 Page no 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Metacentric height and rightning moment \n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Continued from example 2.15\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Io = 15*4**3/12 # moment of inertia in m**4\n",
+ "\n",
+ "V = 15*4*2.71 # Volume in m**3\n",
+ "\n",
+ "Gb = ((3/2)-(2.71/2)) \n",
+ "\n",
+ "W = 1739.2 # weight of the barge from the previous example in kN\n",
+ "# Solution\n",
+ "\n",
+ "Mg = (Io/V)-Gb # metacentric height in m\n",
+ "\n",
+ "print \"(a) Metacentric height = \", round(Mg,3),\"m\"\n",
+ "\n",
+ "M = W*Mg*sin(pi*6/180)\n",
+ "\n",
+ "print \"(b) Righting moment =\",round(M,1),\"kN.m\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Metacentric height = 0.347 m\n",
+ "(b) Righting moment = 63.1 kN.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example no 2.17 Page no 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Maximum pressure in the tank\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "l=6 # length of the tank\n",
+ "\n",
+ "w =2 # width of the tank\n",
+ "\n",
+ "d = 3 # depth of the tank\n",
+ "\n",
+ "a = 3 # acceleration in m/s**2\n",
+ "\n",
+ "theta = pi/6\n",
+ "\n",
+ "W = 9810 # specific weight\n",
+ "\n",
+ "X = 0\n",
+ "\n",
+ "po=0 # pressure at the origin\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "A = np.array([(1,-1),(1,1)])\n",
+ "\n",
+ "b = np.array([-1.38,3.0])\n",
+ "\n",
+ "x = np.linalg.solve(A,b)\n",
+ "\n",
+ "Y1 = x[0]\n",
+ "\n",
+ "Y2 = x[1]\n",
+ "\n",
+ "# AMximum pressure at the bottom of the tank\n",
+ "\n",
+ "P = po - W*(2.61*X/9.81) - W*(1+(1.5/9.81))*(-Y2)\n",
+ "\n",
+ "print\"Amximum pressure occurs at the bottom of the tank =\",round(P,3),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amximum pressure occurs at the bottom of the tank = 24768.9 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.18 Page no 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Height of the paraboloid revolution; maxm=imum pressure and location ; pressure at the point 0.2 from the center\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 1 # diamter of the jar in ft\n",
+ "\n",
+ "h =2 # height of the jar in ft\n",
+ "\n",
+ "H = 1 # height of water in the jar in ft\n",
+ "\n",
+ "N = 150 # RPM\n",
+ "\n",
+ "g = 32.2 # acceleration due to gravity in ft/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "w = 2*pi*N/60\n",
+ "\n",
+ "ho = H+((w**2*(d/2)**2)/(4*g))\n",
+ "print \"(a) Height of paraboliod revolution of base = \", round(ho,2),\"ft\"\n",
+ "\n",
+ "Pmax = 62.4*ho\n",
+ "\n",
+ "print \"(b) Maximum pressure corresponding to maximum height = \",round(Pmax,1),\"lbs/ft**2\"\n",
+ "\n",
+ "z = H - ((w**2*(d/2)**2)/(4*g))\n",
+ "\n",
+ "r = 0.2 # distance from center\n",
+ "\n",
+ "y = -(0.52-0.25)\n",
+ "\n",
+ "P = po + (62.4*w**2*r**2/(2*g))-(62.4*y)\n",
+ "\n",
+ "print \"(c) Pressure =\",round(P,1),\"lbs/ft**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Height of paraboliod revolution of base = 1.48 ft\n",
+ "(b) Maximum pressure corresponding to maximum height = 92.3 lbs/ft**2\n",
+ "(c) Pressure = 26.4 lbs/ft**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter3.ipynb b/Fluid_Mechanics_/Chapter3.ipynb
new file mode 100644
index 00000000..e702596e
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter3.ipynb
@@ -0,0 +1,536 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f598cdc0d1e1209f88ec87b2a9e5b6a08368d8e1e45eff28590bd3252c8de961"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter : Fluid Kinematics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page no 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Dimension of flow field ; velocity components at (1,2) ; magnitude and direction of velocity \n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# V = 4*Xi-4Yj\n",
+ "\n",
+ "x=1 # x co-ordinate\n",
+ "\n",
+ "y=2 # y co-ordinate\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "print \"(a) u = 4*X; v = -4*Y \"\n",
+ "\n",
+ "u = 4*x\n",
+ "\n",
+ "v=- 4*y\n",
+ "\n",
+ "print \"(b) u=\",round(u,0),\"m/s and v=\",round(v,0),\"m/s\"\n",
+ "\n",
+ "R =sqrt(u**2+v**2)\n",
+ "\n",
+ "ang = atan(v/u)*180/pi\n",
+ "\n",
+ "print \"(c) Magnitude of velocity =\",round(R,2),\"m/s and angle of resultant velocity = \",round(ang,1),\"deg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) u = 4*X; v = -4*Y \n",
+ "(b) u= 4.0 m/s and v= -8.0 m/s\n",
+ "(c) Magnitude of velocity = 8.94 m/s and angle of resultant velocity = -63.4 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page no 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge and mass flow rate\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.3 # diameter of pipe in m\n",
+ "\n",
+ "v = 15 # velocity in m/s\n",
+ "\n",
+ "rho = 997.1 # density in kg/m**3\n",
+ "\n",
+ "A = pi*d**2/4\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Q=A*v\n",
+ "\n",
+ "print \"(a) Discharge =\",round(Q,2),\"m**3/s\"\n",
+ "\n",
+ "mdot = rho*Q\n",
+ "\n",
+ "print \"(b) Mass flow rate = \",round(mdot,2),\"kg/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Discharge = 1.06 m**3/s\n",
+ "(b) Mass flow rate = 1057.21 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page no 120 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Mean Velocity\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from scipy import integrate\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Vo = 10 # velocity in m/s\n",
+ "\n",
+ "r1 = 0\n",
+ "\n",
+ "ro = 0.1 # radius in m\n",
+ "\n",
+ "N = 1\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "R = lambda r: (10*r-1000*r**3)\n",
+ "\n",
+ "R1,err=integrate.quad(R,r1,ro)\n",
+ "\n",
+ "Q = R1*2*pi\n",
+ "\n",
+ "A = pi*(0.1)**2\n",
+ "\n",
+ "V = Q/A\n",
+ "\n",
+ "print \"Mean velocity of the flow =\",round(V,0),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean velocity of the flow = 5.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page no 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Sketch the stream lines in the first quadrant\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from scipy import integrate\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "#init_printing(use_unicode=False, warp_line=False, no_global=True)\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# V = 4*y(m)i+2(m)j\n",
+ "\n",
+ "x = Symbol('x')\n",
+ "U = integrate(2,x)\n",
+ "\n",
+ "#print u\n",
+ "\n",
+ "y = Symbol('y')\n",
+ "\n",
+ "V = integrate(-4*y,y)\n",
+ "\n",
+ "#print V\n",
+ "\n",
+ "Zhi = U + V\n",
+ "\n",
+ "print Zhi # for x and y =0 we get C = 0\n",
+ "\n",
+ "X = [5,6,7,8,9,10,11,12,13,14,15,16,17]\n",
+ "Y = [0,1.414,2,2.449,2.828,3.16,3.46,3.741,4,4.242,4.472,4.69,4.898]\n",
+ "\n",
+ "b1=plt.plot(X,Y)\n",
+ "\n",
+ "\n",
+ "X1 = [2.5,3,4,5,6,7,8,9,10,11,12,13,14,15]\n",
+ "Y1 = [0,1,1.732,2.23,2.645,3,3.31,3.60,3.87,4.123,4.35889,4.5825,4.795,5]\n",
+ "\n",
+ "b2=plt.plot(X1,Y1)\n",
+ "\n",
+ "\n",
+ "X2 = [0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,13.5,14.5,15.5]\n",
+ "Y2 = [0,1.414,2,2.449,2.828,3.162,3.462,3.741,4,4.242,4.472,4.69,4.898,5.099,5.29,5.4772]\n",
+ "\n",
+ "b3=plt.plot(X2,Y2)\n",
+ "\n",
+ "plt.xlabel(\"x\")\n",
+ "\n",
+ "plt.ylabel(\"y\")\n",
+ "\n",
+ "plt.title(\"Streamline plot\")\n",
+ "\n",
+ "plt.legend([\"zhi=10\",\"zhi=5\",\"zhi=1\"])\n",
+ "plt.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2*x - 2*y**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 PAge no 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# magnitude and direction of flow field\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "x = 2 # X co-ordinate\n",
+ "\n",
+ "Y = 4 # Y co-ordiante\n",
+ "\n",
+ "# Solution\n",
+ "y = Symbol('y')\n",
+ "\n",
+ "zhi = 4*x*y\n",
+ "\n",
+ "zhiprime = zhi.diff(y)\n",
+ "\n",
+ "u = zhiprime\n",
+ "\n",
+ "x = Symbol('x')\n",
+ "\n",
+ "zhi = 4*x*Y\n",
+ "\n",
+ "zhiprime = zhi.diff(x)\n",
+ "\n",
+ "v = zhiprime\n",
+ "\n",
+ "R=sqrt(u**2+v**2)\n",
+ "\n",
+ "theta = atan(v/u)*180/pi\n",
+ "\n",
+ "print \"Resutant velocity magnitude = \",round(R,2),\"m/s\"\n",
+ "\n",
+ "print \"Angle =\",round(theta,1),\"deg with the X-axis in the 4th quadrant\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resutant velocity magnitude = "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17.89 m/s\n",
+ "Angle = 63.4 deg with the X-axis in the 4th quadrant\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page no 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine velocity ; convective accleration\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "from scipy import integrate\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d1 = 0.09 # diameter in cm\n",
+ "\n",
+ "d2 = 0.025 # diameter in cm\n",
+ "\n",
+ "rho = 1000 # density in kg/m**3\n",
+ "\n",
+ "mdot = 25 # mass flow rate in kg/s\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "x = Symbol('x')\n",
+ "\n",
+ "A1 = pi*d1**2/4\n",
+ "\n",
+ "A2 = pi*d2**2/4\n",
+ "\n",
+ "AA = A1 - ((A1-A2)/40)*10 # from figure\n",
+ "\n",
+ "V = mdot/(rho*AA)\n",
+ "\n",
+ "print \"(a) Velocity =\",round(V,1),\"m/s\"\n",
+ "\n",
+ "AX = (A1 - ((A1-AA)/40)*x)\n",
+ "\n",
+ "v = 25*10**4/(rho*AX)\n",
+ "\n",
+ "vprime = v.diff(x)\n",
+ "\n",
+ "V1 = vprime\n",
+ "\n",
+ "# at x = 0.1 m we get dv/dx = 0..09\n",
+ "\n",
+ "VPrime = 0.09\n",
+ "\n",
+ "Acx = V*VPrime\n",
+ "\n",
+ "print \"(b) Convective acceleration =\",round(Acx,3),\"m**2/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Velocity = 5.1 m/s\n",
+ "(b) Convective acceleration = 0.46 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 Page no 143 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Is the flow irrotational\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# w = (16y-12x)i +(12y-9x)j\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "y = Symbol('y')\n",
+ "\n",
+ "U = 16*y-12*x\n",
+ "\n",
+ "zhiprime = U.diff(y)\n",
+ "\n",
+ "u = zhiprime\n",
+ "\n",
+ "\n",
+ "x = Symbol('x')\n",
+ "\n",
+ "V = 12*y-9*x\n",
+ "\n",
+ "zhiprime1 = V.diff(x)\n",
+ "\n",
+ "v = zhiprime1\n",
+ "\n",
+ "#Vx = -9 # differentiate V wrt x\n",
+ "\n",
+ "#Vx = -9 # differentiate V wrt x\n",
+ "#Uy = 16 # differentiate U wrt y\n",
+ "\n",
+ "z = v-u\n",
+ "\n",
+ "print \"z = \",round(z,0)\n",
+ "\n",
+ "print \"Hence the flow is rotational\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z = -25.0\n",
+ "Hence the flow is rotational\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.10 Page no 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Velocity in larger section\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d1 = 0.1 # diameter in m\n",
+ "\n",
+ "d2 = 0.3 # diameter in m\n",
+ "\n",
+ "V1 = 30 # velocity in m/s\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V2 = (d1**2/d2**2)*V1\n",
+ "\n",
+ "print \"Velocity at the larger cross section = \",round(V2,2),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity at the larger cross section = 3.33 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter4.ipynb b/Fluid_Mechanics_/Chapter4.ipynb
new file mode 100644
index 00000000..20d6f3d5
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter4.ipynb
@@ -0,0 +1,557 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1587038d9ed42ba6cd2ab38d651a00ef2c4ed8f4723b6c6b72bdf9880d8ef943"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Fluid Dynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page no 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Difference in pressure at top and bottom\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d1 = 0.1 # diameter in m\n",
+ "\n",
+ "d2 = 0.05 # diameter in m\n",
+ "\n",
+ "Q = 0.1 # discharge in m**3/s\n",
+ "\n",
+ "A1 = pi*d1**2/4\n",
+ "\n",
+ "A2 = pi*d2**2/4\n",
+ "\n",
+ "gma =9810 # specific weight\n",
+ "\n",
+ "z= 6 # difference in the height\n",
+ "\n",
+ "g = 9.81\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V1 = Q/A1 # velocity at section 1\n",
+ "\n",
+ "V2 = Q/A2 # velocity at section 2\n",
+ "\n",
+ "dP = gma*((V2**2/(2*g))-(V1**2/(2*g))-z)/1000\n",
+ "\n",
+ "print \"Difference in pressure in section 1 and 2 = \",round(dP,1),\"kN/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Difference in pressure in section 1 and 2 = 1157.0 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page no 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Actual discharge\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 2.5 # diameter in cm\n",
+ "\n",
+ "h =200 # head in cm\n",
+ "\n",
+ "Cd = 0.65 # coefficient of discharge\n",
+ "\n",
+ "A =pi*d**2/4\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2 \n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Q = Cd*A*sqrt(2*g*h)/100\n",
+ "\n",
+ "print \"Actual discharge =\",round(Q,2),\"l/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual discharge = 2.0 l/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page no 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge through the orifice\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from scipy import integrate\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "H1 = 3 # height in m\n",
+ "\n",
+ "H2 = 4 # height in m\n",
+ "\n",
+ "b = 0.5 # width in m\n",
+ "\n",
+ "Cd = 0.65 # co-efficient of discharge \n",
+ "\n",
+ "g = 9.81 # acceleration due to grvity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "q = lambda h: h**(1/2)\n",
+ " \n",
+ "Q,err = integrate.quad(q, H1, H2)\n",
+ "\n",
+ "Qt = Cd*b*sqrt(2*g)*Q\n",
+ "\n",
+ "print \"Discharge through the orifice =\",round(Qt,2),\"m**3/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge through the orifice = 2.69 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page no 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# discharge through orifice\n",
+ " \n",
+ "from math import *\n",
+ "\n",
+ "from scipy import integrate\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "b = 1 # bredth of the tank\n",
+ "\n",
+ "d = 0.5 # depth of the tank\n",
+ "\n",
+ "h1 = 0.2 # height of the orifice in m\n",
+ "\n",
+ "Cd = 0.6 # coefficient of discharge\n",
+ "\n",
+ "H1 = 2 # height in m\n",
+ "\n",
+ "H2 = 2+h1 # height in m\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "A = 1*0.3 # area of submerged section in m**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "q = lambda h: h**(1/2)\n",
+ " \n",
+ "Q,err = integrate.quad(q, H1, H2)\n",
+ "\n",
+ "Q1 = Cd*b*sqrt(2*g)*(Q) # Flow through area 1\n",
+ "\n",
+ "Q2 = Cd*sqrt(2*g*H2)*A\n",
+ "\n",
+ "Td = Q1+Q2\n",
+ "\n",
+ "print \"Total Discharge =\",round(Td,2),\"m**3/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Discharge = 1.95 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page no 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine flow rate of water\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d1 = 2 # radius of pipe\n",
+ "\n",
+ "d2 = 1 # radius of throat\n",
+ "\n",
+ "D1 = 40\n",
+ "\n",
+ "D2 = 20\n",
+ "\n",
+ "A1 = pi*D1**2/4\n",
+ "\n",
+ "A2 = pi*D2**2/4\n",
+ "\n",
+ "Cd = 0.95\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V2 = sqrt(21582/0.9375)\n",
+ "\n",
+ "Q = 1.52*pi*(d1/100)**2/4\n",
+ "\n",
+ "Qa = Q*Cd\n",
+ "\n",
+ "print \"Actual discharge =\",round(Qa,6),\"m**3/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual discharge = 0.000454 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page no 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Velocity of stream point at the point of insertion\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "dx = 0.5 # in ft\n",
+ "\n",
+ "K = 1 # constant\n",
+ "\n",
+ "g = 32.2 # acceleration due to gravity in ft/s**2\n",
+ "\n",
+ "# solution\n",
+ "\n",
+ "V = sqrt(2*g*dx)\n",
+ "\n",
+ "print \"velocity at the dept of 1 ft =\",round(V,2),\"ft/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity at the dept of 1 ft = 5.67 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example no 4.7 Page no 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge throught the system\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "gma= 0.8 # specific weight\n",
+ "\n",
+ "V2 = 40 # velocity in m/s\n",
+ "\n",
+ "z1 =25 # height at point 1\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "d = 15 # diameter of the nozzle in cm\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V2 = sqrt(2*g*z1/4.25)\n",
+ "\n",
+ "A = pi*(d/100)**2/4\n",
+ "\n",
+ "Q = A*V2*1000\n",
+ "\n",
+ "print \"Discharge throught the system =\",round(Q,0),\"l/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge throught the system = 190.0 l/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page no 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Power input to the pump\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Eff = 0.8 # pump efficiency\n",
+ "\n",
+ "Hl = 30 # head loss in m\n",
+ "\n",
+ "D1 =6 # diameter in cm\n",
+ "\n",
+ "D2 = 2 # diameter in cm\n",
+ "\n",
+ "gma = 9810 # specific weight in N/m**3\n",
+ "\n",
+ "V2 = 40 # velocity in m/s\n",
+ "\n",
+ "P1 = -50 # pressure at point 1 in N/m**2\n",
+ "\n",
+ "z2 = 100 # height at point 2\n",
+ "\n",
+ "g = 9.8 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "z1 = 30 # height in m\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V1=(2/6)**2*V2\n",
+ "\n",
+ "Q = (pi*6**2/4)*V1*10**-4\n",
+ "\n",
+ "Hs = z2 + (V2**2/(2*g)) + z1 + (50/gma) -(V1**2/(2*g))\n",
+ "\n",
+ "P = gma*Q*Hs\n",
+ "\n",
+ "Pi = (P/Eff)/1000\n",
+ "\n",
+ "print \"Power input = \",round(Pi,1),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power input = 32.5 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page no 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Pressure head at A and B\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q = 0.2 # discharge in m**3/s\n",
+ "\n",
+ "d1 = 0.25 # diameter of the pipe in m\n",
+ "\n",
+ "A = pi*d1**2/4 # area of the pipe\n",
+ "\n",
+ "za = 480 # height in m\n",
+ "\n",
+ "z1 = 500 # height in m\n",
+ "\n",
+ "z3 = 550 # elevation in m\n",
+ "\n",
+ "gma =9810 # specific weight in N/m**2\n",
+ "\n",
+ "g =9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V=Q/A # Velocity of in m/s\n",
+ "\n",
+ "Hl1 = (0.02*100*V**2/(0.25*2*9.81))\n",
+ "\n",
+ "# pressure head at A\n",
+ "\n",
+ "Pa =(z1-za-(V**2/(2*g))-Hl1)\n",
+ "\n",
+ "El = za+Pa\n",
+ "\n",
+ "print \"Elevation at height A =\",round(El,2),\"m\"\n",
+ "\n",
+ "# pressure head at B\n",
+ "\n",
+ "hs = z3 - z1 + (0.02*(500/0.25)*(V**2/(2*g))) \n",
+ "\n",
+ "El2 = El+hs\n",
+ "\n",
+ "print \"Elevation at height B =\",round(El2,2),\"m\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Elevation at height A = 492.39 m\n",
+ "Elevation at height B = 576.23 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter5.ipynb b/Fluid_Mechanics_/Chapter5.ipynb
new file mode 100644
index 00000000..92a56ea7
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter5.ipynb
@@ -0,0 +1,576 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cd2be77f3b9478c6cae134ea907a28e897f525fa56fe0f236e6cf640bce7cb59"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Fluid Momentum"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Resultant force on the elbow\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q = 0.3 # Water flow rate in m**3/s\n",
+ "\n",
+ "d1 = 0.3 # diameter at inlet in meters\n",
+ "\n",
+ "A1 = pi*d1**2/4 # inlet area in m**2\n",
+ "\n",
+ "d2 = 0.15 # diameter at outlet in m\n",
+ "\n",
+ "A2 = pi*d2**2/4 # area at outlet in m**2\n",
+ "\n",
+ "P1 = 175*10**3 # inlet pressure in kN/m**2\n",
+ "\n",
+ "P2 = 160*10**3 # Pressure at outlet in kN/m**2\n",
+ "\n",
+ "F1 = P1*A1 # Force at inlet\n",
+ "\n",
+ "F2 = P2*A2 # Force at outlet\n",
+ "\n",
+ "rho = 1000 # density of water in kg/m**3\n",
+ "\n",
+ "V1 = Q/A1 # inlet velocity in m/s\n",
+ "\n",
+ "V2 = Q/A2 # Velocity at outlet in m/s\n",
+ "\n",
+ "theta = 45*pi/180 # angle in deg\n",
+ "\n",
+ "# Soultion\n",
+ "\n",
+ "# Applying the X momentum equation we get\n",
+ "\n",
+ "Rx = F1 - F2*cos(theta)-rho*Q*(V2*cos(theta)-V1)\n",
+ "\n",
+ "# Applying the Y momentum equation\n",
+ "\n",
+ "Ry = F2*sin(theta)+rho*Q*(V2*sin(theta)-0)\n",
+ "\n",
+ "R = sqrt(Rx**2+Ry**2)\n",
+ "\n",
+ "print \"Resultant force on the elbow = \",round(R,2),\"N\"\n",
+ "\n",
+ "a = atan(Ry/Rx)*180/pi\n",
+ "\n",
+ "print \"Angle of resultant force = \",round(a,4),\"deg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant force on the elbow = 9800.58 N\n",
+ "Angle of resultant force = 34.8516 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page no 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force exerted by the jet on the vane\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "V1 = 80 # Velocity in ft/s\n",
+ "\n",
+ "A1 = 0.1 # area in ft**2\n",
+ "\n",
+ "g = 32.2 # Acceleration due to gravity in ft/s**2\n",
+ "\n",
+ "rho = 1.94 # density in lb/ft**3\n",
+ "\n",
+ "a = pi/3 # angle of pipe bend\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Q = A1*V1 # Total discharge in m**3\n",
+ "\n",
+ "# Applying bernoullis at point 1 and 2\n",
+ "\n",
+ "V2 = sqrt((2*g*V1**2/(2*32.2))-3*2*g)\n",
+ "\n",
+ "# Pressure at the end of the section are atmospheric and hence 0\n",
+ "\n",
+ "# momentum equation in X direction\n",
+ "\n",
+ "Rx = -(rho*Q*(V2*cos(a)-80))\n",
+ "\n",
+ "# momentum equation in Y direction\n",
+ "\n",
+ "Ry = (rho*Q*(V2*sin(a)-0))\n",
+ "\n",
+ "R = sqrt(Rx**2+Ry**2)\n",
+ "\n",
+ "print \"Resultant force = \",round(R,0),\"lbs\"\n",
+ "\n",
+ "ang = atan(Ry/Rx)*180/pi\n",
+ "\n",
+ "print \"Angle of resultant force = \",round(ang,4),\"deg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant force = 1232.0 lbs\n",
+ "Angle of resultant force = 59.2396 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example no 5.3 Page no 195 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force needed to hold the Y position \n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "Q1 = 0.5 # discharge from pipe 1 in m**3/s\n",
+ "\n",
+ "Q2 = 0.3 # discharge from pipe 2 in m**3/s\n",
+ "\n",
+ "Q3 = 0.2 # discharge from pipe 3 in m**3/s\n",
+ "\n",
+ "d1 = 0.45 # diameter of pipe 1 in m\n",
+ "\n",
+ "d2 = 0.3 # diameter of pipe 2 in m\n",
+ "\n",
+ "d3 = 0.15 # diameter of pipe 3 in m\n",
+ "\n",
+ "A1 = pi*d1**2/4 # area in m**2\n",
+ "\n",
+ "A2 = pi*d2**2/4 # area in m**2\n",
+ "\n",
+ "A3 = pi*d3**2/4 # area in m**2\n",
+ "\n",
+ "P1 = 60*10**3 # Pressure at point 1 in kPa\n",
+ "\n",
+ "gma = 9810\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "rho = 1000 # density in kg/m**3\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V1 = Q1/A1\n",
+ "\n",
+ "V2 = Q2/A2\n",
+ "\n",
+ "V3 = Q3/A3\n",
+ "\n",
+ "P2 = gma*((P1/gma) + V1**2/(2*g) - V2**2/(2*g))\n",
+ "\n",
+ "P3 = gma*((P1/gma) + V1**2/(2*g) - V3**2/(2*g))\n",
+ "\n",
+ "F1 = P1*A1\n",
+ "\n",
+ "F2 = P2*A2\n",
+ "\n",
+ "F3 = P3*A3\n",
+ "\n",
+ "Rx = rho*(Q2*V2*cos(pi/6)-Q3*V3*cos(pi/9)-0)+F3*cos(pi/9)-F2*cos(pi/6)\n",
+ "\n",
+ "Ry = rho*((Q2*V2*sin(pi/6)+Q3*V3*sin(pi/9)-Q1*V1))+F3*sin(pi/9)-F2*sin(pi/6)-F1\n",
+ "\n",
+ "R = sqrt(Rx**2+Ry**2)\n",
+ "\n",
+ "a = atan(Ry/Rx)*180/pi\n",
+ "\n",
+ "print \"Resultant Force = \",round(R,0),\"N\"\n",
+ "\n",
+ "print \"Angle with horizontal = \",round(a,1),\"deg with horizontal\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant Force = 12489.0 N\n",
+ "Angle with horizontal = 69.2 deg with horizontal\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page no 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Normal force on the plate\n",
+ "\n",
+ "# Given\n",
+ "from math import *\n",
+ "\n",
+ "d = 2 # diameter in inches\n",
+ "\n",
+ "A = pi*d**2/(4*144) # Area of jet\n",
+ "\n",
+ "V = 100 # velocity of jet in ft/s\n",
+ "\n",
+ "Q = A*V # dischargge in ft**3/s\n",
+ "\n",
+ "gma = 62.4 # mass\n",
+ "\n",
+ "g = 32.2 # acceleration due to gravity in ft/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Rx = (gma*Q*V)/g # horizontal force required to keep plate in position\n",
+ "\n",
+ "print \"Normal force on the plate = \",round(Rx,0),\"lbs\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Normal force on the plate = 423.0 lbs\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page no 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force on the plate ; work doen per second; efficiency\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "D = 0.075 # diameter in m\n",
+ "\n",
+ "A =pi*D**2/4 # area of jet\n",
+ "\n",
+ "V =15 # velocity of jet in m/s\n",
+ "\n",
+ "w = 9810 # specific weight\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s^2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Q =A*V # Discharge in m**3/s\n",
+ "\n",
+ "Vp = 10 # velocity of plate in m/s\n",
+ "\n",
+ "Rx = w*Q*(V-Vp)/g # force in X direction\n",
+ "\n",
+ "print \"Force on the plate = \",round(Rx,2),\"N\"\n",
+ "\n",
+ "W = Rx*Vp\n",
+ "\n",
+ "print \"Work done per second = \",round(W,1),\"N.m/s\"\n",
+ "\n",
+ "Eff = 2*(V-Vp)*Vp/V**2\n",
+ "\n",
+ "E = 100*Eff\n",
+ "\n",
+ "print \"Efficiency = \",round(E,1),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force on the plate = 331.34 N\n",
+ "Work done per second = 3313.4 N.m/s\n",
+ "Efficiency = 44.4 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page no 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Force exerted on the plate\n",
+ "\n",
+ "# Given\n",
+ "from math import *\n",
+ "\n",
+ "d = 3 # diameter in inches\n",
+ "\n",
+ "A = pi*d**2/(4*144) # Area of jet\n",
+ "\n",
+ "Q = 2 # discharge in ft**3/s\n",
+ "\n",
+ "rho = 1.94 # density in lbs/ft**3\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V = Q/A # velocity in ft/s\n",
+ "\n",
+ "alpha = pi/6 # inlet vane angle\n",
+ "\n",
+ "bta = pi/6 # outlet vane angle\n",
+ "\n",
+ "Rx = rho*Q*(V*cos(bta)+V*cos(alpha)) # force in X direction\n",
+ "\n",
+ "Ry = rho*Q*(V*sin(bta)-V*sin(alpha)) # force in Y direction\n",
+ "\n",
+ "print \"Force exerted in X direction = \",round(Rx,1),\"lbs\"\n",
+ "\n",
+ "print \"Force exerted in Y direction = \",round(Ry,1),\"lbs\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force exerted in X direction = 273.8 lbs\n",
+ "Force exerted in Y direction = 0.0 lbs\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page no 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Angle of blade tips at inlet and exit ; work done on the vane; efficiency of the vane\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "V1 =40 # velocity in m/s\n",
+ "\n",
+ "Vp = 20 # velocity of the plate in m/s\n",
+ "\n",
+ "alpha = pi/6 # inlet vane angle\n",
+ "\n",
+ "bta = pi/9 # outlet vane angle\n",
+ "\n",
+ "g = 9.81\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V1x = V1*cos(alpha)\n",
+ "\n",
+ "Vw1 = V1x;\n",
+ "\n",
+ "V1y = V1*sin(alpha)\n",
+ "\n",
+ "dV = V1x - Vp\n",
+ "\n",
+ "theta = atan(V1y/dV)*180/pi\n",
+ "\n",
+ "Vr1 = V1y/sin(theta*pi/180)\n",
+ "\n",
+ "Vr2 = Vr1\n",
+ "\n",
+ "# from trial and error we get the blade tip angle at inlet and outlet\n",
+ "\n",
+ "print \"a ) Angle of blade top at inlet and Outlet, Phi = 4 deg\"\n",
+ "\n",
+ "phi = 4*pi/180 \n",
+ "\n",
+ "V2 = Vr2*sin(phi)/sin(bta)\n",
+ "\n",
+ "V2w = V2*cos(bta)\n",
+ "\n",
+ "W = (V2w+V1x)*Vp/g\n",
+ "\n",
+ "print \"b ) Work done per N of fluid per second = \",round(W,2),\"N.m\"\n",
+ "\n",
+ "Eff = (1 - (V2/V1)**2)*100\n",
+ "\n",
+ "print \"c ) Efficiency = \",round(Eff,2),\"%\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a ) Angle of blade top at inlet and Outlet, Phi = 4 deg\n",
+ "b ) Work done per N of fluid per second = 80.31 N.m\n",
+ "c ) Efficiency = 98.4 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page no 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Thrust on the plane; propeller efficiency ; theoretical horsepower ; pressure difference acros the blades\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "v = 220 # velocity in ft/s\n",
+ "\n",
+ "d = 6 # diameter of the propeller\n",
+ "\n",
+ "Q = 12000 # discharge in ft**3/s\n",
+ "\n",
+ "mf = 0.0022 # mass flow rate in slugs/ft**3\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V1 = v*5280/3600 # velocity in ft/s\n",
+ "\n",
+ "V = Q/(pi*d**2/4) # velocity in ft/s\n",
+ "\n",
+ "V4 = 2*V-V1\n",
+ "\n",
+ "F = mf*Q*(V4-V1) # thrust on the plane\n",
+ "\n",
+ "print \"a - Thrust on the plane = \",round(F,1),\"lbs\"\n",
+ "\n",
+ "Eff = V1/V # efficiency \n",
+ "\n",
+ "E = Eff*100\n",
+ "\n",
+ "print \"b - Theoretical efficiency = \",round(E,0),\"%\"\n",
+ "\n",
+ "Thp = F*V1/(500*Eff)\n",
+ "\n",
+ "print \"c - Theoretical horsepower required = \",round(Thp,0),\"hp\"\n",
+ "\n",
+ "dP = mf*(V4**2-V1**2)/2\n",
+ "\n",
+ "print \"d - Pressure difference across blades = \",round(dP,2),\"lbs/ft**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a - Thrust on the plane = 5372.2 lbs\n",
+ "b - Theoretical efficiency = 76.0 %\n",
+ "c - Theoretical horsepower required = 4560.0 hp\n",
+ "d - Pressure difference across blades = 190.0 lbs/ft**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter6.ipynb b/Fluid_Mechanics_/Chapter6.ipynb
new file mode 100644
index 00000000..c0425cb0
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter6.ipynb
@@ -0,0 +1,136 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:779dd4cf4a63ec7ae3b3ee56b532415f0e7430caa393646786820e5bcc3483bb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Dimensional Analysis and Dynamic Similitude"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Velocity of the flow\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "L = 10 # length scale lp/l\n",
+ "\n",
+ "# crue oil at 20 deg C\n",
+ "\n",
+ "rhop = 0.86*998.2 # density inn kg/m**3\n",
+ "\n",
+ "mup = 8*10**-3 # viscosity in Ns/m**2\n",
+ "\n",
+ "Vp = 2.5 # Velocity in m/s\n",
+ "\n",
+ "# water at 20 deg C\n",
+ "\n",
+ "rhom = 998.2 # density in kg/m**3\n",
+ "\n",
+ "mum = 1.005*10**-3 # viscosity in Ns/m**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Vm = Vp*L*(rhop/rhom)*(mum/mup) # velocity in m/s\n",
+ "\n",
+ "print \"Hence the model should be tested at a velocity of \",round(Vm,2),\"m/s. This velocity in the model is called corresponding velocity\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hence the model should be tested at a velocity of 2.7 m/s. This velocity in the model is called corresponding velocity\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Mximum head on the crest and corresponding discharge for dynamically similar conditions\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "l = 300 # length in ft\n",
+ "\n",
+ "Q = 100000 # discharge in cfs\n",
+ "\n",
+ "Cd = 3.8 # coefficient of discharge\n",
+ "\n",
+ "L = (1/50) # length scale\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Qm = 100000*(L)**(5/2) # model discharge in cfs\n",
+ "\n",
+ "print \"Maximum discharge, Qm = \",round(Qm,8),\"cfs\"\n",
+ "\n",
+ "H = (Q/(Cd*l))**(2/3) # height over spill way\n",
+ "\n",
+ "h = H*L*12 # head over spill model\n",
+ "\n",
+ "print \"Maximum head over crest = \",round(h,2),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum discharge, Qm = 5.65685425 cfs\n",
+ "Maximum head over crest = 4.74 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter7.ipynb b/Fluid_Mechanics_/Chapter7.ipynb
new file mode 100644
index 00000000..e5a10ae6
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter7.ipynb
@@ -0,0 +1,392 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:efc6f8f4cd32e5126c4de163e157356596c0806f949ff4295acc9cf31cf6d207"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Fluid Resistance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.1 Page no 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Is the flow laminar or turbulent\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "nu1 = 0.804*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "V = 0.3 # velocity in m/s\n",
+ "\n",
+ "D = 0.02 # diameter in m/s\n",
+ "\n",
+ "# for water \n",
+ "\n",
+ "rho = 995.7 # density in kg/m**3\n",
+ "\n",
+ "# for gylcerine\n",
+ "\n",
+ "mu = 8620*10**-4 # viscosity in Ns/m**2\n",
+ "\n",
+ "S = 1.26 # specific gravity\n",
+ "\n",
+ "nu2 = mu/(S*rho) # viscosity of glycerine in Ns/m**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "R1 = V*D/nu1\n",
+ "\n",
+ "print \"Reynolds number for water =\",round(R1,0)\n",
+ "\n",
+ "print \"R > 2000 the flow is turbulent for water\"\n",
+ "\n",
+ "print \"\\n\"\n",
+ "R2 = V*D/nu2\n",
+ "\n",
+ "print \"Reynolds number for glycerine =\",round(R2,1)\n",
+ "\n",
+ "print \"R < 2000 the flow is laminar for glycerine\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds number for water = 7463.0\n",
+ "R > 2000 the flow is turbulent for water\n",
+ "\n",
+ "\n",
+ "Reynolds number for glycerine = 8.7\n",
+ "R < 2000 the flow is laminar for glycerine\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 Page no 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Eddy Viscosity; mixing length ; turbulence constant\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from scipy import *\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "y = Symbol('y')\n",
+ "\n",
+ "d = 0.0175 # diameter in m\n",
+ "\n",
+ "s = 0.3 # shear stress at a distance in m\n",
+ "\n",
+ "tau = 103 # shear stress in Pa\n",
+ "\n",
+ "rho = 1000 # density in kg/m**3\n",
+ "\n",
+ "#y = 0.3\n",
+ "\n",
+ "# solution\n",
+ "\n",
+ "Up = diff(8.5+0.7*log(y),y)\n",
+ "\n",
+ "print Up\n",
+ "\n",
+ "Up = (0.7/0.3) # for y = 0.3\n",
+ "\n",
+ "k = sqrt(tau/(rho*s**2*Up**2))\n",
+ "\n",
+ "print \"Turbulence constant = \",round(k,2)\n",
+ "\n",
+ "Ml = k*s*100 # mixing length\n",
+ "\n",
+ "print \"Mixing length = \",round(Ml,1),\"cm\"\n",
+ "\n",
+ "Eta = rho*(Ml/100)**2*Up\n",
+ "\n",
+ "print \"Eddy viscosity =\",round(Eta,1),\"Nm/s**2\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.7/y\n",
+ "Turbulence constant = 0.46\n",
+ "Mixing length = 13.8 cm\n",
+ "Eddy viscosity = 44.1 Nm/s**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3 Page no 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# PLot boundary layer distribution and total drag on the plate\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "from pylab import plt\n",
+ "\n",
+ "from numpy import *\n",
+ "\n",
+ "from scipy import *\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# for glycerine\n",
+ "\n",
+ "S = 1.26 # specific gravity \n",
+ "\n",
+ "mu = 0.862 # dynamic viscosity in Ns/m**2\n",
+ "\n",
+ "rho = S *1000 # density in kg/m**3\n",
+ "\n",
+ "K2 = 0.332\n",
+ "\n",
+ "V=1 # velocity in m/s\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# from blasius equation\n",
+ "\n",
+ "x = [0,0.1,0.5,1.0,2.0];\n",
+ "\n",
+ "d = 0.1307*np.sqrt(x)*100\n",
+ "\n",
+ "tauo = K2*rho*V**2/(sqrt(1462)*np.sqrt(x))\n",
+ "\n",
+ "#plt.figure()\n",
+ "plt.plot(x, d, 'r')\n",
+ "plt.xlabel('x(m)')\n",
+ "plt.ylabel('delta(cm),tauo(N/m**2)')\n",
+ "#plt.title('delta v/s x')\n",
+ "#plt.legend('d')\n",
+ "\n",
+ "plt.plot(x, tauo, 'b')\n",
+ "plt.xlabel('x')\n",
+ "#plt.ylabel('tauo(N/m**2)')\n",
+ "#plt.title('tauo v/s x(m)')\n",
+ "plt.legend('d''t')\n",
+ "plt.show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4 page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Sketch the boundary layer and drag on the plate\n",
+ "\n",
+ "import numpy as np\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "from numpy import sqrt\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "rho = 1.197 # air density in kg/m**3\n",
+ "\n",
+ "mu = 18.22*10**-6 # viscosity in Ns/m**2\n",
+ "\n",
+ "l = 5 # length of the plate\n",
+ "\n",
+ "V = 8 # velocity in m/s\n",
+ "\n",
+ "Rec = 5*10**5 # crictical reynolds number\n",
+ "\n",
+ "l1 = 0.951 # length from 0 to 0.951\n",
+ "\n",
+ "l2 = 5.0 # length from 0 to 5\n",
+ "\n",
+ "l3 = 0.951 # length from 0 to 0.951\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "X = Rec/525576\n",
+ "\n",
+ "x = [0,0.1,0.3,0.6,0.951];\n",
+ "\n",
+ "d = 0.0069*np.sqrt(x)*100\n",
+ "\n",
+ "plt.figure()\n",
+ "plt.plot(x, d, 'r')\n",
+ "plt.xlabel('x(m)')\n",
+ "plt.ylabel('delta(cm)')\n",
+ "plt.title('delta v/s x')\n",
+ "plt.legend('L')\n",
+ "plt.show()\n",
+ "\n",
+ "X1 = [0.951,1.5,2.0,2.5,3.0,4.0,5.0]\n",
+ "\n",
+ "Dt = 0.0265*np.power(X1,(4/5))*100\n",
+ "\n",
+ "plt.figure()\n",
+ "plt.plot(X1, Dt, 'g')\n",
+ "plt.xlabel('x(m)')\n",
+ "plt.ylabel('delta(cm)')\n",
+ "plt.title('delta v/s x')\n",
+ "plt.legend('T')\n",
+ "plt.show()\n",
+ "\n",
+ "Td = 0.664*sqrt(mu*rho*V**3*l1)+0.036*rho*V**2*l2*(mu/(rho*V*l2))**0.2-0.036*rho*V**2*l3*(mu/(rho*V*l3))**0.2\n",
+ "\n",
+ "print \"Total Drag = \",round(Td,3),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Drag = 0.595 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5 Page no 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine drag on the sphere\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "from pylab import plt\n",
+ "\n",
+ "from __future__ import division\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.01 # doameter of sphere in m\n",
+ "\n",
+ "v = 0.05 # velocity in m/s\n",
+ "\n",
+ "S = 1.26 # specific gravity\n",
+ "\n",
+ "mu = 0.826 # kinematic viscosity in Ns/m**2\n",
+ "\n",
+ "rho = S*1000 # density\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "R = rho*v*d/mu\n",
+ "\n",
+ "# for the above rho\n",
+ "\n",
+ "Cd = 35\n",
+ "\n",
+ "Fd = 0.5*Cd*rho*v**2*pi*d**2/4\n",
+ "\n",
+ "print \"Drag on the sphere = \",round(Fd,4),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag on the sphere = 0.0043 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter8.ipynb b/Fluid_Mechanics_/Chapter8.ipynb
new file mode 100644
index 00000000..51f3481e
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter8.ipynb
@@ -0,0 +1,391 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:74db613da6801f860dadcdbf59265a8239e5864c8922257a769d0c0fa0f7c4e0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Laminar Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine maximum velocity and shear stress\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "P1 = 200 # Pressure at inlet in kPa\n",
+ "\n",
+ "P2 = 260 # Pressure at outlet in kPa\n",
+ "\n",
+ "d = 0.004 # diameter in m\n",
+ "\n",
+ "L = 8 # length of pipe in meters\n",
+ "\n",
+ "z = 6 # height of the pipe from the ground\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# properties of kerosene\n",
+ "\n",
+ "mu = 19.1*10**-4 # viscosity of kerosene at 20 deg C\n",
+ "\n",
+ "S = 0.81 # specific gravity of kerosene\n",
+ "\n",
+ "rho = 1000 # density in kg/m**3\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# calculating direction of flow\n",
+ "\n",
+ "p1 = (P1+g*z*S)*1000 # point 1\n",
+ "\n",
+ "p2 = (P2)*1000 # point 2\n",
+ "\n",
+ "# direction of flow is from point 1-2\n",
+ "\n",
+ "# shear stress\n",
+ "\n",
+ "Sp = -((p1-p2)/sqrt(L**2+z**2))\n",
+ "\n",
+ "r = d/2\n",
+ "\n",
+ "Tau_max = r*Sp/2\n",
+ "\n",
+ "print \"(a) Maximum shear stress =\",round(Tau_max,3),\"N/m**2\"\n",
+ "\n",
+ "# maximum velocity\n",
+ "\n",
+ "Vmax = r**2*Sp/(4*mu)\n",
+ "\n",
+ "print \"(b) Maximum velocity =\",round(Vmax,3),\"m/s\"\n",
+ "\n",
+ "# discharge\n",
+ "\n",
+ "Q = pi*r**4*Sp/(8*mu)\n",
+ "\n",
+ "print \"(c) Discharge = \",round(Q,7),\"m**3/s\"\n",
+ "\n",
+ "# calculate reynolds number\n",
+ "\n",
+ "V = Vmax/2\n",
+ "\n",
+ "R = rho*V*d*S/mu\n",
+ "\n",
+ "print \"Reynolds number =\",round(R,0),\"is less than 2000, the flow is laminar and the calculations are valid\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum shear stress = 1.232 N/m**2\n",
+ "(b) Maximum velocity = 0.645 m/s\n",
+ "(c) Discharge = 4.1e-06 m**3/s\n",
+ "Reynolds number = 547.0 is less than 2000, the flow is laminar and the calculations are valid\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example no 8.2 Page no 289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine the head loss\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.02 # diameter of the pipe in m\n",
+ "\n",
+ "l = 30 # length of the pipe in m\n",
+ "\n",
+ "v = 0.1 # velocity in m/s\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# for water at 5 deg C\n",
+ "\n",
+ "nu = 1.54*10**-6 # kinematic viscosity of water in m**2/s\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "R = v*d/nu\n",
+ "\n",
+ "print \"R = \",round(R,0),\"is lesss than 2000 , the flow is laminar\"\n",
+ "\n",
+ "f = 64/R # friction factor\n",
+ "\n",
+ "Hf = f*l*v**2/(2*g*d) # head loss due to friction\n",
+ "\n",
+ "H=Hf*100\n",
+ "\n",
+ "print \"Head loss = \",round(H,2),\"cm of water\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 1299.0 is lesss than 2000 , the flow is laminar\n",
+ "Head loss = 3.77 cm of water\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page no 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Horsepower required to pump 50 tons of oil\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# oil properties\n",
+ "\n",
+ "S = 0.92 # specific gravity\n",
+ "\n",
+ "gma = S*62.4 # density in lbs/ft**3\n",
+ "\n",
+ "nu=0.0205 # viscosity in ft**2/s\n",
+ "\n",
+ "W = 50 # weight of oil\n",
+ "\n",
+ "d = 9 # diameter of the pipe in inches\n",
+ "\n",
+ "g = 32.2 # acceleration due to gravity in ft/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Q = W*2000/(gma*3600) # discharge in ft**3/s\n",
+ "\n",
+ "A = pi*d**2/(4*144) # area of pipe\n",
+ "\n",
+ "V = Q*1000/(A) # velocity in ft/s\n",
+ "\n",
+ "R = V*0.75/(nu*1000) # Reynolds number\n",
+ "\n",
+ "print \"R =\",round(R,2),\"is less than 2000 and hence flow is laminar\"\n",
+ "\n",
+ "f = 64/R # friction factor\n",
+ "\n",
+ "Hf = (f*5280*(V/1000)**2)/(2*g*0.75)\n",
+ "\n",
+ "Hp = gma*Q*Hf/(550)\n",
+ "\n",
+ "print \"Horse power required to pump the oil = \",round(Hp,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 40.07 is less than 2000 and hence flow is laminar\n",
+ "Horse power required to pump the oil = 10.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Viscosity of the liquid in poise\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "V = 50 # Volume in m**3\n",
+ "\n",
+ "d = 5 # diameter in m\n",
+ "\n",
+ "d1 = 0.1 # diameter of bore\n",
+ "\n",
+ "l = 10 # length of the tube\n",
+ "\n",
+ "t = 20*60 # time in seconds\n",
+ "\n",
+ "rho = 0.88 # density in g/cm**3\n",
+ "\n",
+ "H1 = 5 # height from the base in m\n",
+ "\n",
+ "A = pi*d**2/4\n",
+ "\n",
+ "a = pi*d1**2/4\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# From derivation we obtain a equation for T\n",
+ "\n",
+ "H2 = H1-(V/A)\n",
+ "\n",
+ "mu = t*rho*a*(0.1)*98.1/(32*A*10*log(H1/H2))\n",
+ "\n",
+ "print \"Viscosity of the liquid =\",round(mu,4),\"poise\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Viscosity of the liquid = 0.0182 poise\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page no 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Velocity distribution; Discharge ; shear on the upper plate\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# properties of kerosene oil at 20 deg C\n",
+ "\n",
+ "S = 0.81 # specific gravity of oil\n",
+ "\n",
+ "mu = 4*10**-5 # viscosity of oil in lb.s/ft**2\n",
+ "\n",
+ "gma = 62.4*S # density in lbs/ft**3\n",
+ "\n",
+ "p1 = 6.51 # pressure at point 1 in psia\n",
+ "\n",
+ "p2 = 8 # pressure at point 2 in psia\n",
+ "\n",
+ "h = 0.006 # distance between the plate in ft\n",
+ "\n",
+ "l = 4 # length of the plate in ft\n",
+ "\n",
+ "theta = pi/6 # angle of inclination\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "# point 1\n",
+ "\n",
+ "P1 = p1*144 + gma*l*sin(theta)\n",
+ "\n",
+ "# point 2\n",
+ "\n",
+ "P2 = p2*144\n",
+ "\n",
+ "# flow is taking from poont 2-1\n",
+ "\n",
+ "Sp = (P2-P1)/4\n",
+ "\n",
+ "# equation for u = 2154.75*y-359125*y**2\n",
+ "\n",
+ "y = h\n",
+ "\n",
+ "# discharge per ft width\n",
+ "\n",
+ "q = (2154.75*y**2/2) - (359125*y**3/3)\n",
+ "\n",
+ "print \"Discharge q = \",round(q,3),\"per unit ft of the plate\"\n",
+ "\n",
+ "# to find shear at the top of the plate take du/dy = 0\n",
+ "\n",
+ "dV = 2154.75 - 718250*h\n",
+ "\n",
+ "# shear stress\n",
+ "\n",
+ "T = -mu*dV\n",
+ "\n",
+ "print \"Shear stress on the plate = \",round(T,3),\"lbs/ft**2 and resisting the motion of the plate\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge q = 0.013 per unit ft of the plate\n",
+ "Shear stress on the plate = 0.086 lbs/ft**2 and resisting the motion of the plate\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/Chapter9.ipynb b/Fluid_Mechanics_/Chapter9.ipynb
new file mode 100644
index 00000000..6c911620
--- /dev/null
+++ b/Fluid_Mechanics_/Chapter9.ipynb
@@ -0,0 +1,849 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:81c0a87082bc2a398c522de3be6bcb735589adaa60c31ff7051c7c79b83652d0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Turbulent flow in Pipes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine Head loss\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "S = 1.26 # specific gravity\n",
+ "\n",
+ "mu = 0.826 # kinematic viscosity in Ns/m**2\n",
+ "\n",
+ "# for water\n",
+ "\n",
+ "rho = 998 # density of water in kg/m**3\n",
+ "\n",
+ "mu1 = 1.005*10**-3 # viscosity in Ns/m**2\n",
+ "\n",
+ "# for glycerine\n",
+ "\n",
+ "rho1 = S*rho # density of glycerine in kg/m**3\n",
+ "\n",
+ "Q = 0.1 # discharge in m**3/s\n",
+ "\n",
+ "d1 = 0.2 # diameter in m\n",
+ "\n",
+ "A = pi*d1**2/4 # area in m**2\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "l =100 # length of the pipe\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V = Q/A\n",
+ "\n",
+ "R = rho1*V*d1/mu\n",
+ "\n",
+ "print \"It is a laminar flow\"\n",
+ "\n",
+ "f = 64/R # friction factor\n",
+ "\n",
+ "Hf = f*l*V**2/(2*g*d1) # head loss due to friction\n",
+ "\n",
+ "print \"(a) Head loss due to flow for glycerine =\",round(Hf,1),\"m \"\n",
+ "\n",
+ "R1 = rho*V*d1/mu1\n",
+ "\n",
+ "print \"The flow is turbulent\"\n",
+ "\n",
+ "e = 0.025\n",
+ "\n",
+ "r = e/(d1*100)\n",
+ "\n",
+ "f = 0.021\n",
+ "\n",
+ "hf = f*l*V**2/(2*g*d1)\n",
+ "\n",
+ "print \"(a) Head loss due to flow for water =\",round(hf,2),\"m \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "It is a laminar flow\n",
+ "(a) Head loss due to flow for glycerine = 17.1 m \n",
+ "The flow is turbulent\n",
+ "(a) Head loss due to flow for water = 5.42 m \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page no 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge of water\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# for water\n",
+ "\n",
+ "nu = 1.007*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "e = 0.025 # for cast iron in cm\n",
+ "\n",
+ "L = 100 # length of the pipe in m\n",
+ "\n",
+ "D = 0.2 # diameter in m\n",
+ "\n",
+ "hf = 5.43 # head loss due to friction\n",
+ "\n",
+ "r = e/(D*100)\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "A = sqrt(2*g*D*hf/L)\n",
+ "\n",
+ "B = D/nu\n",
+ "\n",
+ "f = 0.021 # from moodys diagram\n",
+ "\n",
+ "V = A/sqrt(f)\n",
+ "\n",
+ "print V\n",
+ "\n",
+ "R = B*f\n",
+ "\n",
+ "A = pi*D**2/4\n",
+ "\n",
+ "Q = A*V\n",
+ "\n",
+ "print \"Discharge =\",round(Q,2),\"m**3/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.1853324563\n",
+ "Discharge = 0.1 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page no 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Size of the case iron\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q =0.1 # discharge in m**3/s\n",
+ "\n",
+ "hf = 5.43 # friction loss head in m\n",
+ "\n",
+ "L = 100 # length of pipe\n",
+ "\n",
+ "nu = 1.00*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "e = 0.025 # for cast iron in cm\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "A = 8*L*Q**2/(hf*g*pi**2)\n",
+ "\n",
+ "B = 4*Q/(pi*nu)\n",
+ "\n",
+ "# for D = 0.172 ; f=0.01\n",
+ "D = 0.172\n",
+ "\n",
+ "r = e/D\n",
+ "\n",
+ "Re = B/D\n",
+ "\n",
+ "f = 0.022 # for Re and r\n",
+ "\n",
+ "# for D1=0.199 ; f=0.021\n",
+ "\n",
+ "D1 = 0.199\n",
+ "\n",
+ "r1 = e/D1\n",
+ "\n",
+ "R = B/D1\n",
+ "\n",
+ "f = 0.021 # for R and r\n",
+ "\n",
+ "print \"Hence the convergence is attained, D=\",round(D1,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hence the convergence is attained, D= 0.2 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page no 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Head loss \n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "L = 500 # length of the pipe in ft\n",
+ "\n",
+ "D= 9*2.54/100 # diameter in cm\n",
+ "\n",
+ "C = 100 # constant\n",
+ "\n",
+ "S = 0.004\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "Hf = S*L\n",
+ "\n",
+ "print \"Head loss =\",round(Hf,0),\"ft\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head loss = 2.0 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page no 319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Head loss of water\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q = 0.1 # water flow rate in m**3/s\n",
+ "\n",
+ "d = 30 # diameter in m\n",
+ "\n",
+ "l = 500 # length in m\n",
+ "\n",
+ "e = 0.025 # for cast iron\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "r = log(d/e,10)\n",
+ "\n",
+ "K = (pi/4)*sqrt(2*g)*(2*r+1.14)*(0.3)**(2.5)\n",
+ " \n",
+ "S = (Q/K)**2\n",
+ "\n",
+ "hf = S*l\n",
+ "\n",
+ "print \"Head loss of water =\",round(hf,1),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head loss of water = 3.2 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.6 Page no 319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Head loss by conveyance method\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "Q = 0.1 # water flow rate in m**3/s\n",
+ "\n",
+ "d = 20 # diameter in cm\n",
+ "\n",
+ "l = 500 # length in m\n",
+ "\n",
+ "e = 0.025 # for cast iron\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "S = 5.43 \n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "r = log(d/e,10)\n",
+ "\n",
+ "K = (pi/4)*sqrt(2*g)*(2*r+1.14)*(0.2)**2.5\n",
+ "\n",
+ "Q=K*sqrt(S/100)\n",
+ "\n",
+ "print \"Head loss of water =\",round(Q,2),\"m**3/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head loss of water = 0.1 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page no 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Solve using the conveyence method\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# given\n",
+ "\n",
+ "eps = 0.025*10**-2 # for cast iron epsilon = 0.0025 cm\n",
+ "\n",
+ "# we get the value of K = 0.432 m**2/s\n",
+ "# we need to do trial and error to find the value of D\n",
+ "\n",
+ "# we use the value of D = 0.2 m\n",
+ "\n",
+ "D = 0.2 # value in m\n",
+ "\n",
+ "g = 9.81\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "K = (pi/4)*sqrt(2*g)*(2*log10(D/(eps))+1.14)*D**(2.5)\n",
+ "\n",
+ "print \"K = \",round(K,3),\" from trial and error\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K = 0.432 from trial and error\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.8 Page no 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine head loss\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "d = 0.1 # diameter of the pipe\n",
+ "\n",
+ "Q= 0.075 # discharge in m**3/s\n",
+ "\n",
+ "L = 30 # length in m\n",
+ "\n",
+ "A = pi*d**2/4\n",
+ "\n",
+ "g = 9.81 # acceleration due to gravity in m/s**2\n",
+ "\n",
+ "# for water\n",
+ "\n",
+ "nu = 1.007*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "e = 0.025\n",
+ "\n",
+ "r = e/(10*d)\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V = Q/A\n",
+ "\n",
+ "Re = V*d/nu\n",
+ "\n",
+ "f = 0.025 # firction factor from moodys diagram\n",
+ "\n",
+ "hf = f*L*V**2/(2*g*d) \n",
+ "\n",
+ "K= 0.5 # contraction constant\n",
+ "\n",
+ "hc = K*V**2/(2*g) \n",
+ "\n",
+ "K1 =10 # loss of the globe valve\n",
+ "\n",
+ "hg = K1*V**2/(2*g)\n",
+ "\n",
+ "Th = hf+hc+hg\n",
+ "\n",
+ "print \"Total head loss =\",round(Th,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total head loss = 83.7 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.9 Page no 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# discharge through the pipe\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "# for water\n",
+ "\n",
+ "nu = 1.007*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "d1 = 0.3 # diameter of pipe 1 in m\n",
+ "\n",
+ "d2 = 0.15 # diameter of pipe 2 in m\n",
+ "\n",
+ "d3 = 0.08 # diameter of pipe 3 in m\n",
+ "\n",
+ "g = 9.81 # acclelration due to gravity in m/s**2\n",
+ "\n",
+ "e = 0.025 # for cast iron\n",
+ "\n",
+ "f1 = 0.019 # foe e/d1\n",
+ "\n",
+ "f2 = 0.022 # foe e/d2\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V3 = sqrt(2*g*100/((8.4*(f1)+268.85*(f2)+4.85)))\n",
+ "\n",
+ "V1 = (d3/d1)**2*V3\n",
+ "\n",
+ "V2 = (d3/d2)**2*V3\n",
+ "\n",
+ "# reynolds number for pipe BC\n",
+ "\n",
+ "R1 = V1*d1/nu\n",
+ "\n",
+ "R2 = V2*d2/nu\n",
+ "\n",
+ "Q = V3*pi*d3**2/4\n",
+ "\n",
+ "print \"Discharge through the pipe =\",round(Q,3),\"m**3/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge through the pipe = 0.067 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.10 Page no 332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Replace the flow system\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "D = 0.2 # diameter of pipe 1\n",
+ "\n",
+ "D1 = 0.15 # diameter of pipe 2\n",
+ "\n",
+ "Q = 0.1 # discharge in m**3/s\n",
+ "\n",
+ "nu = 1.007*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "e = 0.025 # e for cast iron\n",
+ "\n",
+ "r = e/(100*D) \n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "V = Q/(pi*(0.2)**2/4)\n",
+ "\n",
+ "R = V*D/nu\n",
+ "\n",
+ "f = 0.021 # from moodys law\n",
+ "\n",
+ "r2 = e/D1\n",
+ "\n",
+ "V1 = Q/(pi*D1**2/4)\n",
+ "\n",
+ "R1 = V*D1/nu\n",
+ "\n",
+ "f2 = 0.023 # from moodys law\n",
+ "\n",
+ "L2 = 28562*D1**5/f2\n",
+ "\n",
+ "print \"Replacement of the flow system =\",round(L2,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Replacement of the flow system = 94.3 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.11 Page no 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Discharge through each branch\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "e = 0.025 # in cm\n",
+ "\n",
+ "nu = 1.007*10**-6 # viscosity in m**2/s\n",
+ "\n",
+ "Q1 = 0.5 # discharge in m**3/s\n",
+ "\n",
+ "D1 = 50\n",
+ "\n",
+ "L1 = 500 # length in m\n",
+ "\n",
+ "g = 9.81\n",
+ "\n",
+ "# Pipe 1\n",
+ "\n",
+ "r1 = e/D # r1 for pipe 1\n",
+ "\n",
+ "V1 = Q1/(pi*(0.5)**2/4)\n",
+ "\n",
+ "R = V*(0.5)/nu\n",
+ "\n",
+ "f1 = 0.018 # for the reynolds no\n",
+ "\n",
+ "hf1 = f*L1*V1**2/(2*g*D1)\n",
+ "\n",
+ "# pipe 2\n",
+ "\n",
+ "hf2 = hf1\n",
+ "\n",
+ "L2 =200 # length in m\n",
+ "\n",
+ "D2 = 0.3 # diameter in m\n",
+ "\n",
+ "r2 = e/D2\n",
+ "\n",
+ "f2 = 0.02 \n",
+ "\n",
+ "V2 = 0.419/sqrt(f2) \n",
+ "\n",
+ "R2 = V2*D2/nu\n",
+ "\n",
+ "Q2 = V2*(pi*D2**2/4)\n",
+ "\n",
+ "#pipe 3\n",
+ "\n",
+ "hf3=hf1\n",
+ "\n",
+ "L3 = 300 # length of pipe 3 in m\n",
+ "\n",
+ "D3 =0.15 # diameter of pipe 3 in m\n",
+ "\n",
+ "r3 = e/D3 \n",
+ "\n",
+ "f = 0.022 # from moody's law\n",
+ "\n",
+ "V3 = 0.242/sqrt(f2)\n",
+ "\n",
+ "R3 = V3*D3/nu\n",
+ "\n",
+ "Q3 = V3*(pi*D3**2/4)\n",
+ "\n",
+ "Td = Q1+Q2+Q3\n",
+ "\n",
+ "q1 = Q1*(2.0/Td)\n",
+ "\n",
+ "q2 = Q2*(2.0/Td)\n",
+ "\n",
+ "q3 = Q3*(2.0/Td)\n",
+ "\n",
+ "print \"Discharge through branch 1 =\",round(q1,2),\"m**3/s\"\n",
+ "\n",
+ "print \"Discharge through branch 2 =\",round(q2,3),\"m**3/s\"\n",
+ "\n",
+ "print \"Discharge through branch 3 =\",round(q3,3),\"m**3/s\"\n",
+ "\n",
+ "# Actual head loss\n",
+ "\n",
+ "d = 0.5\n",
+ "\n",
+ "v1 = q1/(pi*(d)**2/4)\n",
+ "\n",
+ "R4 = v1*d/nu\n",
+ "\n",
+ "r4 = 0.0005 # ratio of e/D\n",
+ "\n",
+ "f = 0.018\n",
+ "\n",
+ "Hf1 = f*L1*v1**2/(2*g*d)\n",
+ "\n",
+ "print \"It is found that hf1=hf2=hf3 =\",round(Hf1,1),\"The distribution od discharge is correct\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge through branch 1 = 1.35 m**3/s\n",
+ "Discharge through branch 2 = 0.566 m**3/s\n",
+ "Discharge through branch 3 = 0.082 m**3/s\n",
+ "It is found that hf1=hf2=hf3 = 43.5 The distribution od discharge is correct\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.14 Page no 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find minimum depth below the ridge\n",
+ "\n",
+ "from math import *\n",
+ "\n",
+ "# Given\n",
+ "\n",
+ "e = 0.00015 # from moody's chart\n",
+ "\n",
+ "D = 2 # depth in ft\n",
+ "\n",
+ "r = e/D\n",
+ "\n",
+ "z1 = 100 # elevation in ft\n",
+ "\n",
+ "mu = 1.084*10**-5 # viscosity in Ns/ft**2\n",
+ "\n",
+ "p1 = 34 # pressure head in ft\n",
+ "\n",
+ "p2 = 10 # pressure head in ft\n",
+ "\n",
+ "g = 32.2 # acclelration due to gravity in ft/s**2\n",
+ "\n",
+ "L = 1000 # length in ft\n",
+ "\n",
+ "# Solution\n",
+ "\n",
+ "f = 0.011 # assume\n",
+ "\n",
+ "V = sqrt(100/(10000/(2*2*g)))/sqrt(f)\n",
+ "\n",
+ "R = V*D/mu\n",
+ "\n",
+ "V1 = 10.15\n",
+ "\n",
+ "f1 = 0.0125\n",
+ "\n",
+ "Q = V1*pi*D**2/4\n",
+ "\n",
+ "x = p1-p2-(V1**2/(2*g))-(f1*L*V1**2/(2*g*D))\n",
+ "\n",
+ "Dp = 30 - x\n",
+ "\n",
+ "print \"Minimum depth =\",round(Dp,2),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum depth = 17.6 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_/README.txt b/Fluid_Mechanics_/README.txt
new file mode 100644
index 00000000..8c978256
--- /dev/null
+++ b/Fluid_Mechanics_/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Rahul Joshi
+Course: mtech
+College/Institute/Organization: IIT Bombay
+Department/Designation: Mechanical Engineering
+Book Title: Fluid Mechanics
+Author: Irfan A. Khan
+Publisher: Holt, Rinehart and Winston, The Dryden Press , Saunders College Publishing
+Year of publication: 1987
+Isbn: 0-03-071473-7
+Edition: 1st Edition \ No newline at end of file
diff --git a/Fluid_Mechanics_/screenshots/Screenshot_from_2014-04-24_10_11_42.png b/Fluid_Mechanics_/screenshots/Screenshot_from_2014-04-24_10_11_42.png
new file mode 100644
index 00000000..03ac1d9d
--- /dev/null
+++ b/Fluid_Mechanics_/screenshots/Screenshot_from_2014-04-24_10_11_42.png
Binary files differ
diff --git a/Fluid_Mechanics_/screenshots/plot1.png b/Fluid_Mechanics_/screenshots/plot1.png
new file mode 100644
index 00000000..caf0a78f
--- /dev/null
+++ b/Fluid_Mechanics_/screenshots/plot1.png
Binary files differ
diff --git a/Fluid_Mechanics_/screenshots/plot2.png b/Fluid_Mechanics_/screenshots/plot2.png
new file mode 100644
index 00000000..35633e7f
--- /dev/null
+++ b/Fluid_Mechanics_/screenshots/plot2.png
Binary files differ
diff --git a/Fluidization_Engineering/README.txt b/Fluidization_Engineering/README.txt
new file mode 100644
index 00000000..a043f776
--- /dev/null
+++ b/Fluidization_Engineering/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Dolar Khachariya
+Course: mtech
+College/Institute/Organization: Indian Institute of Engineering Bombay
+Department/Designation: Electrical engineering
+Book Title: Fluidization Engineering
+Author: K. Daizo And O. Levenspiel
+Publisher: Butterworth-Heinemann, Massachusetts
+Year of publication: 1991
+Isbn: 8131200353
+Edition: 2nd \ No newline at end of file
diff --git a/Fluidization_Engineering/ch10.ipynb b/Fluidization_Engineering/ch10.ipynb
new file mode 100644
index 00000000..6cd12465
--- /dev/null
+++ b/Fluidization_Engineering/ch10.ipynb
@@ -0,0 +1,306 @@
+{
+ "metadata": {
+ "name": "ch10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Gas Dispersion and Gas Interchange in Bubbling Beds"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 253\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Estimate Interchange Coefficients in Bubbling Beds\n",
+ "from numpy import *\n",
+ "%pylab inline\n",
+ "#Variable declaration\n",
+ "umf=[0.01,0.045]; #Velocity at minimum fluidization condition in m/s\n",
+ "ephsilonmf=[0.5,0.5]; #Void fraction at minimum fluidization condition\n",
+ "D=[2E-5,7E-5]; #Diffusion coefficient of gas in m**2/s\n",
+ "g=9.81; #Acceleration due to gravity in m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "db=[5.,10.,15.,20.];\n",
+ "n=len(umf);\n",
+ "m=len(db)\n",
+ "Kbc = zeros((n,m))\n",
+ "Kce = zeros((n,m))\n",
+ "Kbe = zeros((n,m))\n",
+ " \n",
+ "for i in range(n):\n",
+ " for j in range(m):\n",
+ " Kbc[i][j]=4.5*(umf[i]/db[j])+5.85*((D[i]**0.5*g**0.25)/db[j]**(5.0/4));#Gas interchange coefficient between bubble and cloud from Eqn.(27)\n",
+ " Kce[i][j]=6.77*((D[i]*ephsilonmf[i]*0.711*(g*db[j])**0.5)/db[j]**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(34)\n",
+ " Kbe[i][j]=(Kbc[i][j]*Kce[i][j])/(Kbc[i][j]+Kce[i][j]);#Gas interchange coefficient between bubble and emulsion from Eqn.(14)\n",
+ "\n",
+ "#OUTPUT\n",
+ "i=0;\n",
+ "j=0;\n",
+ "k=0;\n",
+ "while k<m*n:\n",
+ " print '\\t\\tKbc for fine particles and He',\n",
+ " print '\\tKbc for coarse particles and ozone',\n",
+ " print '\\tKbe for fine particles and He',\n",
+ " print '\\tKbe for coarse particles and ozone'\n",
+ " j = 0\n",
+ " while j<m:\n",
+ " print 'db=%fm'%(db[j]*10**-2);\n",
+ " while i<n:\n",
+ " print '\\t%f'%Kbc[i][j],\n",
+ " print '\\t\\t\\t%f'%Kbe[i][j],\n",
+ " i=i+1; \n",
+ " k=k+1;\n",
+ " print '\\t\\t\\t',\n",
+ " i=0;\n",
+ " j=j+1;\n",
+ "import numpy\n",
+ "import matplotlib.pyplot as plt\n",
+ "a = numpy.matrix(Kbe)\n",
+ "b = numpy.matrix(Kbc)\n",
+ "db = array(db).T\n",
+ "Kbe=a.T\n",
+ "Kbc=b.T\n",
+ "\n",
+ "plt.plot(db,Kbc,db,Kbe)\n",
+ "#plt.plot(db,Kbe);\n",
+ "#Note : Python does not have plot2d function. so we can plot it \n",
+ "#plt.title('Plot of Kbc,Kbe vs db','db');\n",
+ "plt.show()\n",
+ "print 'Comparing the points with the plot of Kbc,Kbe vs db in Fig.(12), we can conlcude the following:'\n",
+ "print 'Kbc for fine particles and helium: line 2 in Fig.(12)'\n",
+ "print 'Kbc for coarser particles and ozone: line 3 in Fig.(12)'\n",
+ "print 'Kbe for fine particles and helium: line 4 in Fig.(12)'\n",
+ "print 'Kbe for coarser particles and ozone: line 5 in Fig.(12)'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\tKbc for fine particles and He \tKbc for coarse particles and ozone \tKbe for fine particles and He \tKbe for coarse particles and ozone\n",
+ "db=0.050000m\n",
+ "\t0.015193 \t\t\t0.003335 \t\t\t\t0.052085 \t\t\t0.006930 \t\t\tdb=0.100000m\n",
+ "\t0.007104 \t\t\t0.001434 \t\t\t\t0.025121 \t\t\t0.002964 \t\t\tdb=0.150000m\n",
+ "\t0.004568 \t\t\t0.000875 \t\t\t\t0.016434 \t\t\t0.001803 \t\t\tdb=0.200000m\n",
+ "\t0.003345 \t\t\t0.000616 \t\t\t\t0.012173 \t\t\t0.001266 \t\t\t"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD9CAYAAABdoNd6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYk/fBPvA7AZSgFo0g2qpUDgKpVSlI7FSMioAi4qpO\naVdstRt2q1it21Xb/lbbXa9bZ7fqWN+O9p2tCrzalU0oihR0iHYVcHX6ioCKMktbD0QLcjQhz++P\npwQi4RAIPIHcn+vK1RyexBsr9/fJ9znJBEEQQEREg5pc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QAIPBgEOHDiEsLEzqSO3MmTMHp0+fxu3bt9HU1ISsrCyE\nh4dLHatDarUau3fvRkNDA3bv3o2ZM2dKHcmsI0eOYMeOHcjIyICzRCc468qjjz6KGzdu4OrVq7h6\n9SrGjx+PL7/8EmPGjJE6monHH38cWVlZEAQBBQUF8Pb2tsm/03nz5iEjIwOAOD22cOFCiROJ39TW\nrVuHKVOm4MUXXzQ+b/HvUV/uMtQdeXl5QnR0tNQxOlRWViao1Wph2rRpwksvvSTU1tZKHcmsDz/8\nUAgNDRWCg4OF1157TWhubpY6kiAIgrB69Wph3LhxwpAhQ4Tx48cLu3fvtsldL1tyOjk5CePHjxf+\n8pe/CD4+PsLEiROF6dOnC9OnTxeef/55qWOa/ftsa9KkSZLvemkuo16vF+Lj4wV/f39h2bJlQmFh\noaQZ2+Zs+X++e/du4fz588Lq1auFqVOnCk8++aRQUlIidUzhxIkTgkwmE6ZNm2b8t5iVlWXx75Hk\nV6oiIqK+Z7u7whARkdWw7ImI7ADLnojIDrDsiYjsAMueiMgOsOyJiOzA/wfai5Sp3wLX9AAAAABJ\nRU5ErkJggg==\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Comparing the points with the plot of Kbc,Kbe vs db in Fig.(12), we can conlcude the following:\n",
+ "Kbc for fine particles and helium: line 2 in Fig.(12)\n",
+ "Kbc for coarser particles and ozone: line 3 in Fig.(12)\n",
+ "Kbe for fine particles and helium: line 4 in Fig.(12)\n",
+ "Kbe for coarser particles and ozone: line 5 in Fig.(12)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 254\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare the Relative Importance of Kbc and Kce\n",
+ "\n",
+ "#Variable declaration\n",
+ "D=0.69; #Diffusion coefficient of gas in cm**2/s\n",
+ "umf=1.0; #Velocity at minimum fluidization condition in cm/s\n",
+ "ephsilonmf=0.5; #Void fraction at minimum fluidization condition\n",
+ "db=[5,15]; #Equilibrium bubble size in cm\n",
+ "g=980; #Acceleration due to gravity in cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(db);\n",
+ "i=0;\n",
+ "Kbc = [0.,0.]\n",
+ "Kce = [0.,0.]\n",
+ "Kbe = [0.,0.]\n",
+ "e = [0.,0.]\n",
+ "while i<n:\n",
+ " Kbc[i]=4.5*(umf/db[i])+5.85*((D**0.5*g**0.25)/db[i]**(5/4));#Gas interchange coefficient between bubble and cloud from Eqn.(27)\n",
+ " Kce[i]=6.77*((D*ephsilonmf*0.711*(g*db[i])**0.5)/db[i]**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(34)\n",
+ " Kbe[i]=(Kbc[i]*Kce[i])/(Kbc[i]+Kce[i]);#Gas interchange coefficient between bubble and emulsion from Eqn.(14)\n",
+ " e[i]=(Kce[i]-Kbe[i])/Kbe[i];#Error when minor resistance is ignored\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'db(cm)',\n",
+ "print '\\t\\tCalculated Kbc',\n",
+ "print '\\tCalculated Kce',\n",
+ "print '\\t\\tKbe from Eqn.(14)',\n",
+ "print '\\tErron when minor resistance is ignored (in percentage)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%db[i],\n",
+ " print '\\t%f'%Kbc[i],\n",
+ " print '\\t%f'%Kce[i],\n",
+ " print '\\t\\t%f'%Kbe[i],\n",
+ " print '\\t\\t%f'%(e[i]*100);\n",
+ " i=i+1; \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "db(cm) \t\tCalculated Kbc \tCalculated Kce \t\tKbe from Eqn.(14) \tErron when minor resistance is ignored (in percentage)\n",
+ "5.000000 \t6.337721 \t2.509152 \t\t1.797506 \t\t39.590766\n",
+ "15.000000 \t2.112574 \t0.635514 \t\t0.488547 \t\t30.082477\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 255\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compare Interchange Rates for Adsorbed and Nonadsorbed Gases\n",
+ "\n",
+ "#Variable declaration\n",
+ "Kbe=[0.028,0.05]; #Reported range for gas interchange coefficient between bubble and emulsion\n",
+ "uo=0.30; #Superficial gas velocity in m/s\n",
+ "db=0.13; #Equilibrium bubble size in m\n",
+ "m=7;\n",
+ "ephsilonmf=0.5; #Void fraction at minimum fluidization condition\n",
+ "umf=0.0018; #Velocity at minimum fluidization condition in m/s\n",
+ "D=[9E-6,22E-6]; #Diffusion coefficient of gas in m**2/s\n",
+ "g=9.81; #Acceleration due to gravity in m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(Kbe);\n",
+ "i=0;\n",
+ "Kbem = [0,0]\n",
+ "Kbc = [0,0]\n",
+ "Kce = [0,0]\n",
+ "#Kbe = [0,0]\n",
+ "c = [0,0]\n",
+ "\n",
+ "while i<n:\n",
+ " Kbem[i]=(6.0/db)*Kbe[i];#Gas interchange coefficient between bubble and emulsion from Eqn.(19)\n",
+ " Kbc[i]=4.5*(umf/db)+5.85*((D[i]**0.5*g**0.25)/db**(5.0/4));#Gas interchange coefficient between bubble and cloud from Eqn.(27)\n",
+ " Kce[i]=6.77*((D[i]*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(34)\n",
+ " Kbe[i]=(Kbc[i]*Kce[i])/(Kbc[i]+Kce[i]);#Gas interchange coefficient between bubble and emulsion from Eqn.(14)\n",
+ " c[i]=(Kbem[i]/Kbe[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Kbe from Eqn.(19)',\n",
+ "print '\\tKbc from Eqn.(27)',\n",
+ "print '\\tKce from Eqn.(34)',\n",
+ "print '\\tKbe from Eqn.(14)',\n",
+ "print '\\tComparison of Kbe from Eqn.(19) and that from Eqn.(14)'\n",
+ "i=0\n",
+ "while i<n:\n",
+ " print '%f'%Kbem[i],\n",
+ " print '\\t\\t%f'%Kbc[i],\n",
+ " print '\\t\\t%f'%Kce[i],\n",
+ " print '\\t\\t%f'%Kbe[i],\n",
+ " print '\\t\\t%f'%c[i]\n",
+ " i=i+1; \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kbe from Eqn.(19) \tKbc from Eqn.(27) \tKce from Eqn.(34) \tKbe from Eqn.(14) \tComparison of Kbe from Eqn.(19) and that from Eqn.(14)\n",
+ "1.292308 \t\t0.460200 \t\t0.274548 \t\t0.171959 \t\t7.515188\n",
+ "2.307692 \t\t0.684401 \t\t0.429248 \t\t0.263797 \t\t8.747978\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch11.ipynb b/Fluidization_Engineering/ch11.ipynb
new file mode 100644
index 00000000..b665def9
--- /dev/null
+++ b/Fluidization_Engineering/ch11.ipynb
@@ -0,0 +1,359 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : Particle to Gas Mass and Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 265\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Fitting Reported Mass Transfer Data with the Bubbling Bed Model\n",
+ "\n",
+ "#Variable declaration\n",
+ "db=0.37; #Equilibrium bubble size in cm\n",
+ "dp=0.028; #Particle size in cm\n",
+ "rhos=1.06; #Density of solids in g/cc\n",
+ "ephsilonmf=0.5; #Void fraction at minimum fluidization condition\n",
+ "phis=0.4; #Sphericity of solids\n",
+ "gammab=0.005; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "rhog=1.18E-3; #Density of air in g/cc\n",
+ "myu=1.8E-4; #Viscosity of gas in g/cm s\n",
+ "D=0.065; #Diffusion coefficient of gas in cm**2/s\n",
+ "Sc=2.35; #Schmidt number\n",
+ "etad=1; #Adsorption efficiency factor\n",
+ "y=1;\n",
+ "umf=1.21; #Velocity at minimum fluidization condition in cm/s\n",
+ "ut=69; #Terminal velocity in cm/s\n",
+ "g=980; #Acceleration due to gravity in square cm/s**2\n",
+ "uo=[10,20,30,40,50];#Superficial gas velocity in cm/s\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(uo);\n",
+ "i=0;\n",
+ "Rept=(dp*ut*rhog)/myu;\n",
+ "Shstar=2+(0.6*(Rept**0.5)*(Sc**(1/3)));#Sherwood no. from Eqn.(1)\n",
+ "Kbc=4.5*(umf/db)+5.85*((D**0.5*g**0.25)/db**(5/4));#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of the bubble\n",
+ "x = [0,0,0,0,0]\n",
+ "Shbed = [0,0,0,0,0]\n",
+ "Rep = [0,0,0,0,0]\n",
+ "while i<n:\n",
+ " x[i]=(uo[i]-umf)/(ubr*(1-ephsilonmf));#The term delta/(1-epshilonf) after simplification\n",
+ " Shbed[i]=x[i]*((gammab*Shstar*etad)+((phis*dp**2*y)/(6*D))*Kbc);#Sherwood no. from Eqn.(11)\n",
+ " Rep[i]=(dp*uo[i]*rhog)/myu;#Reynolds of the particle\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The desired result is the relationship between Shbed and Rep The points gives a straight line of the form y=mx+c'\n",
+ "print 'Rep',\n",
+ "print '\\t\\tShbed'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%Rep[i],\n",
+ " print '\\t%f'%Shbed[i]\n",
+ " i=i+1;\n",
+ "import matplotlib.pyplot as plt\n",
+ "plt.plot(Rep,Shbed);\n",
+ "plt.xlabel(\"Rep\");\n",
+ "plt.ylabel(\"Shbed\");\n",
+ "\n",
+ "plt.show()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "The desired result is the relationship between Shbed and Rep The points gives a straight line of the form y=mx+c\n",
+ "Rep \t\tShbed\n",
+ "1.835556 \t0.065762\n",
+ "3.671111 \t0.140576\n",
+ "5.506667 \t0.215391\n",
+ "7.342222 \t0.290206\n",
+ "9.177778 \t0.365020\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEMCAYAAADeYiHoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9YVHXe//HnKJSZpWlkyFCoYOAPkARZaykqlNVWbsXq\nxixN0UjXq612225rt7Td2uiue3OzWir7YRmyZYmVsmTKav4AFdS+64/IZEXSNNMSoZDx8/3j5Kwk\nKqMDZwZej+viumaY84EX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E+sYqpqqrKdOnSxXz33Xd2R3HLyspyL3MdO3asqa2ttTuS\nSUxMNL179zYxMTFm6dKltuU49n4ZGBjofr/cv3+/ueGGGxq9zNVhjI9NCIuIiE/QFJOIiDRIBUJE\nRBqkAiEiIg1SgRARkQapQIh4oG3btsTGxhIdHU1aWhpVVVV2RxJpMioQIh5o3749paWlbNq0iQsv\nvNC9jb1IS6QCIXKGBg0axPbt2wFr24ehQ4cSFxfHNddcw7Zt2wC44447uOuuu4iPj+eKK67gww8/\ntDOyiEe8fsMgkdbA5XJRUFDADTfcAMCdd95JdnY24eHhFBUVMWXKFD7++GPAuqJ27dq1fP7551x3\n3XVs376dc845x874Io2iAiHigZqaGmJjY6msrCQsLIy77rqLqqoqVq9eXW8Du9raWsDaEO2WW24B\nIDw8nB49erBlyxZiYmJsyS/iCRUIEQ+cd955lJaWUlNTQ0pKCnl5eSQnJ9OpUydKS0sb9TN8dXdP\nkZ/Sv1SRM3Deeefx17/+lYceeogOHTrQvXt33nnnHcDawHHTpk3ux2+//TbGGLZv384XX3zhU7t7\nipyKCoSIB47fP79///6Eh4fz97//nblz5zJ79mz69+9P3759Wbhwofv4yy67jIEDBzJs2DCys7N1\n/kH8hjbrE2lC48ePZ/jw4aSlpdkdRcRj6iBERKRB6iBERKRB6iBERKRBKhAiItIgFQgREWmQCoSI\niDRIBUJERBqkAiEiIg36/9fGcNvjU2I2AAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2b26690>"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "#INPUT\n",
+ "umf=0.12 #Velocity at minimum fluidization condition in cm/s\n",
+ "uo=40.; #Superficial gas velocity in cm/s\n",
+ "ub=120; #Velocity of the bubble in cm/s\n",
+ "D=0.7; #Diffusion coefficient of gas in cm**2/s\n",
+ "abkbe1=1.; #Bubble-emuslion interchange coefficient for non absorbing particles(m=0)\n",
+ "abkbe2=18.; #Bubble-emuslion interchange coefficient for highly absorbing particles(m=infinity)\n",
+ "g=980.; #Acceleration due to gravity in square cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "#For non absorbing particles m=0,etad=0\n",
+ "Kbc=(ub/uo)*(abkbe1);\n",
+ "dbguess=2;#Guess value of db\n",
+ "def solver_func(db): #Function defined for solving the system\n",
+ " return abkbe1-(uo/ub)*(4.5*(umf/db)+5.85*(D**0.5*g**0.25)/(db**(5/4.)));#Eqn.(10.27)\n",
+ "\n",
+ "d=fsolve(solver_func,dbguess)\n",
+ "#For highly absorbing particles m=infinity, etad=1\n",
+ "M=abkbe2-(uo/ub)*Kbc;\n",
+ "#For intermediate condition\n",
+ "alpha=100.;\n",
+ "m=10.;\n",
+ "etad=1./(1+(alpha/m));#Fitted adsorption efficiency factor from Eqn.(23)\n",
+ "abkbe3=M*etad+(uo/ub)*Kbc;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'For non absorbing particles:\\tDiameter of bubble=%fcm\\tBubble-cloud interchange coefficient=%fs**-1'%(d,Kbc);\n",
+ "print 'For highly absorbing partilces:\\tM=%f'%(M);\n",
+ "print 'For intermediate condition:\\tFitted adsorption efficiency factor:%f\\tBubble-emuslion interchange coefficient:%fs**-1'%(etad,abkbe3);\n",
+ "\n",
+ "#====================================END OF PROGRAM ======================================================"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For non absorbing particles:\tDiameter of bubble=6.010032cm\tBubble-cloud interchange coefficient=3.000000s**-1\n",
+ "For highly absorbing partilces:\tM=17.000000\n",
+ "For intermediate condition:\tFitted adsorption efficiency factor:0.090909\tBubble-emuslion interchange coefficient:2.545455s**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 273\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Fitting Reported Heat Transfer Data with the Bubbling Bed Model\n",
+ "\n",
+ "#Variable declaration\n",
+ "rhos=1.3; #Density of solids in g/cc\n",
+ "phis=0.806; #Sphericity of solids\n",
+ "gammab=0.001; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "rhog=1.18E-3; #Density of air in g/cc\n",
+ "Pr=0.69; #Prandtl number\n",
+ "myu=1.8E-4; #Viscosity of gas in g/cm s\n",
+ "Cpg=1.00; #Specific heat capacity of gas in J/g K\n",
+ "ephsilonmf=0.45; #Void fraction at minimum fluidization condition\n",
+ "kg=2.61E-4; #Thermal concuctivity of gas in W/cm k\n",
+ "dp=0.036; #Particle size in cm\n",
+ "umf=6.5; #Velocity at minimum fluidization condition in cm/s\n",
+ "ut=150.; #Terminal velocity in cm/s\n",
+ "db=0.4; #Equilibrium bubble size in cm\n",
+ "etah=1; #Efficiency of heat transfer\n",
+ "uo=[10.,20.,30.,40.,50.];#Superficial gas velocity in cm/s\n",
+ "g=980.; #Acceleration due to gravity in square cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "Nustar=2+(((dp*ut*rhog)/myu)**0.5*Pr**(1./3));#Nusselt no. from Eqn.(25)\n",
+ "Hbc=4.5*(umf*rhog*Cpg/db)+5.85*((kg*rhog*Cpg)**0.5*g**0.25/db**(5./4));#Total heat interchange across the bubble-cloud boundary from Eqn.(32)\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of the bubble from Eqn.(6.7)\n",
+ "n=len(uo);\n",
+ "i=0;\n",
+ "x = [0,0,0,0,0]\n",
+ "Nubed = [0,0,0,0,0]\n",
+ "Rep = [0,0,0,0,0]\n",
+ "\n",
+ "while i<n:\n",
+ " x[i]=(uo[i]-umf)/(ubr*(1-ephsilonmf));#The term delta/(1-epshilonf) after simplification\n",
+ " Nubed[i]=x[i]*(gammab*Nustar*etah+(phis*dp**2/(6*kg))*Hbc);#Nusselt no. from Eqn.(36)\n",
+ " Rep[i]=(dp*uo[i]*rhog)/myu;#Reynolds of the particle\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The desired result is the relationship between Nubed and Rep which is in the form of a straight line y=mx+c'\n",
+ "print 'Rep',\n",
+ "print '\\t\\tNubed'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%Rep[i],\n",
+ " print '\\t%f'%Nubed[i]\n",
+ " i=i+1;\n",
+ "import matplotlib.pyplot as plt\n",
+ "plt.plot(Rep,Nubed);\n",
+ "plt.xlabel(\"Rep\");\n",
+ "plt.ylabel(\"Nubed\");\n",
+ "plt.show()\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The desired result is the relationship between Nubed and Rep which is in the form of a straight line y=mx+c\n",
+ "Rep \t\tNubed\n",
+ "2.360000 \t0.046518\n",
+ "4.720000 \t0.179427\n",
+ "7.080000 \t0.312335\n",
+ "9.440000 \t0.445244\n",
+ "11.800000 \t0.578152\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEMCAYAAADJQLEhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9c1eX9//HHYWClLivL+sihDzZIQFM0yMxZaBrmkvxV\no9YsR0o6VzZdrvWtsK0mc+VMWsPSPrYUaf0QKmVldZamggmKpSmiDMSyNM3wF3J8f/+4NtQE+eE5\nvA/nPO+3W7fOkescXr3nzuu8rtf7ui6HZVkWIiISsILsDkBEROylRCAiEuCUCEREApwSgYhIgFMi\nEBEJcEoEIiIBziuJIC8vj6ioKCIjI0lPT69zjMvlolevXnTv3p2EhARvh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ERERvPrqqyxcuJB58+YRGxtL9+7dyc3NrR1/+eWXc801\n1zB06FAyMzPVH5BWQ5vOiXjA2LFjGTZsGCNHjrQ7FJEmU0UgIhLgVBGIiAQ4VQQiIgFOiUBEJMAp\nEYiIBDglAhGRAKdEICIS4JQIREQC3P8HJOZBYJAptYQAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x269c250>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 274\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heating a Particle in a Fluidized Bed\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "rhog=1.2; #Density of air in kg/m**3\n",
+ "myu=1.8E-5; #Viscosity of gas in kg/m s\n",
+ "kg=2.6E-2; #Thermal concuctivity of gas in W/m k\n",
+ "dp=1E-4; #Particle size in m\n",
+ "rhos=8920; #Density of solids in kg/m**3\n",
+ "Cps=390; #Specific heat capacity of the solid in J/kg K\n",
+ "ephsilonf=0.5; #Void fraction of the fluidized bed\n",
+ "umf=0.1; #Velocity at minimum fluidization condition in m/s\n",
+ "uo=0.1; #Superficial gas velocity in m/s\n",
+ "pi=3.14\n",
+ "\n",
+ "#CALCULATION\n",
+ "to=0; #Initial temperature of the bed\n",
+ "T=100; #Temperature of the bed\n",
+ "t=0.99*T; #Particle temperature i.e. when it approaches 1% of the bed temperature\n",
+ "mp=(pi/6)*dp**3*rhos; #Mass of the particle\n",
+ "A=pi*dp**2; #Surface area of the particle\n",
+ "Rep=(dp*uo*rhog)/myu; #Reynold's no. of the particle\n",
+ "Nubed=0.0178; #Nusselt no. from Fig.(6)\n",
+ "hbed1=(Nubed*kg)/dp; #Heat transfer coefficient of the bed\n",
+ "t1=(mp*Cps/(hbed1*A))*math.log((T-to)/(T-t));#Time needed for the particle approach 1 percentage of the bed temperature in case(a)\n",
+ "hbed2=140*hbed1;#Since from Fig.(6) Nup is 140 times Nubed\n",
+ "t2=(mp*Cps/(hbed2*A))*math.log((T-to)/(T-t));#Time needed for the particle approach 1 percentage of the bed temperature in case(b)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Case(a):Using the whole bed coefficient from Fig.(6)'\n",
+ "print '\\tTime needed for the particle approach 1 percentage of the bed temperature is %.0fs'%t1\n",
+ "print 'Case(b):Uisng the single-particle coefficient of Eqn.(25),also shown in Fig.(6)'\n",
+ "print '\\tTime needed for the particle approach 1 percentage of the bed temperature is %.2fs'%t2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a):Using the whole bed coefficient from Fig.(6)\n",
+ "\tTime needed for the particle approach 1 percentage of the bed temperature is 58s\n",
+ "Case(b):Uisng the single-particle coefficient of Eqn.(25),also shown in Fig.(6)\n",
+ "\tTime needed for the particle approach 1 percentage of the bed temperature is 0.41s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch12.ipynb b/Fluidization_Engineering/ch12.ipynb
new file mode 100644
index 00000000..d49e64ff
--- /dev/null
+++ b/Fluidization_Engineering/ch12.ipynb
@@ -0,0 +1,397 @@
+{
+ "metadata": {
+ "name": "ch12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : Conversion of Gas in Catalytic Reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 293\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Fine Particle (Geldart A) Bubbling Bed Reactor\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Kr=10.; #rate constant in m**3 gas/m**3 cat s\n",
+ "D=2E-5; #Diffusion coefficient of gas in m**2/s\n",
+ "dpbar=68.; #Average partilce size in micrometers\n",
+ "ephsilonm=0.5; #Void fraction of fixed bed\n",
+ "gammab=0.005; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "ephsilonmf=0.55; #Void fraction at minimum fluidization condition\n",
+ "umf=0.006; #Velocity at minimum fluidization condition in m/s\n",
+ "db=0.04; #Equilibrium bubble size in m\n",
+ "Lm=0.7; #Length of the bed in m\n",
+ "uo=0.1; #Superficial gas velocity in m/s\n",
+ "dbed=0.26; #Diameter of the bed in m\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of bubble from Eqn.(6.7)\n",
+ "ub=uo-umf+ubr;#Velocity of bubbles in bubbling beds in Eqn.(6.8)\n",
+ "Kbc=4.5*(umf/db)+5.85*((D**0.5*g**0.25)/db**(5./4));#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "Kce=6.77*((D*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ "delta=uo/ub;#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ "fw=0.6;#Wake volume to bubble volume from Fig.(5.8)\n",
+ "gammac=(1-ephsilonmf)*((3/(ubr*ephsilonmf/umf-1))+fw);#Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
+ "gammae=((1-ephsilonmf)*((1-delta)/delta))-gammab-gammac;#Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
+ "ephsilonf=1-(1-delta)*(1-ephsilonmf);#Void fraction of fixed bed from Eqn.(6.20)\n",
+ "Lf=(1-ephsilonm)*Lm/(1-ephsilonf);#Length of fixed bed from Eqn.(6.19)\n",
+ "Krtou=Kr*Lm*(1-ephsilonm)/uo;#Dimensionless reaction rate group from Eqn.(5)\n",
+ "Kf=gammab*Kr+1/((1/Kbc)+(1/(gammac*Kr+1/((1/Kce)+(1/(gammae*Kr))))));#Raction rate for fluidized bed from Eqn.(14)\n",
+ "XA=math.exp(-1*Kf*Lf/ub);#Conversion from Eqn.(16)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The dimnesionless reaction rate group: %f'%Krtou\n",
+ "print 'The reaction rate for fluidized bed: %fs**-1'%Kf\n",
+ "print 'Conversion: %f'%XA\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dimnesionless reaction rate group: 35.000000\n",
+ "The reaction rate for fluidized bed: 1.979872s**-1\n",
+ "Conversion: 0.030056\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 298\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Commercial-Sized Phthalic Anhydride Reactor\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "umf=0.005; #Velocity at minimum fluidization condition in m/s\n",
+ "ephsilonm=0.52; #Void fraction of fixed bed\n",
+ "ephsilonmf=0.57; #Void fraction at minimum fluidization condition\n",
+ "DA=8.1E-6; #Diffusion coefficient of gas in m**2/s\n",
+ "DR=8.4E-6; #Diffusion coefficient of gas in m**2/s\n",
+ "Lm=5; #Length of the bed in m\n",
+ "dte=1; #Diameter of tube in m\n",
+ "Kr1=1.5; #rate constant in m**3 gas/m**3 cat s\n",
+ "Kr3=0.01; #rate constant in m**3 gas/m**3 cat s\n",
+ "gammab=0.005; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "uo=0.45; #Superficial gas velocity in m/s\n",
+ "db=0.05; #Equilibrium bubble size in m from Fig.(6.8)\n",
+ "ub=1.5; #Velocity of bubbles in bubbling bed in m/s from Fig.(6.11(a))\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of bubble from Eqn.(6.7)\n",
+ "KbcA=4.5*(umf/db)+5.85*((DA**0.5*g**0.25)/db**(5.0/4));#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "KceA=6.77*((DA*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ "KbcR=4.5*(umf/db)+5.85*((DR**0.5*g**0.25)/db**(5./4));#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "KceR=6.77*((DR*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ "delta=uo/ub;#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ "fw=0.6;#Wake volume to bubble volume from Fig.(5.8)\n",
+ "gammac=(1-ephsilonmf)*((3/(ubr*ephsilonmf/umf-1))+fw);#Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
+ "gammae=((1-ephsilonmf)*((1-delta)/delta))-gammab-gammac;#Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
+ "ephsilonf=1-(1-delta)*(1-ephsilonmf);#Void fraction of fixed bed from Eqn.(6.20)\n",
+ "Lf=(1-ephsilonm)*Lm/(1-ephsilonf);#Length of fixed bed from Eqn.(6.19)\n",
+ "Krtou=Kr1*Lm*(1-ephsilonm)/uo;#Dimensionless reaction rate group from Eqn.(5)\n",
+ "Kr12=Kr1;#Since the reactions are a special case of Denbigh scheme\n",
+ "Kr34=Kr3;\n",
+ "Kf1=(gammab*Kr12+1/((1/KbcA)+(1/(gammac*Kr12+1/((1/KceA)+(1/(gammae*Kr12)))))))*(delta/(1-ephsilonf));#Rate of reaction 1 for fluidized bed from Eqn.(14)\n",
+ "Kf3=(gammab*Kr34+1/((1/KbcR)+(1/(gammac*Kr34+1/((1/KceR)+(1/(gammae*Kr34)))))))*(delta/(1-ephsilonf));#Rate of reaction 2 for fluidized bed from Eqn.(14)\n",
+ "Kf12=Kf1;\n",
+ "Kf34=Kf3;\n",
+ "KfA=((KbcR*KceA/gammac**2+(Kr12+KceA/gammac+KceA/gammae)* \\\n",
+ " (Kr34+KceR/gammac+KceR/gammae))*delta*KbcA*Kr12*Kr34/ \\\n",
+ " (1-ephsilonf))/(((Kr12+KbcA/gammac)*(Kr12+KceA/gammae)+Kr12*KceA/gammac) \\\n",
+ " *((Kr34+KbcR/gammac)*(Kr34+KceR/gammae)+Kr34*KceR/gammac));\n",
+ " #Rate of raection with respect to A from Eqn.(35)\n",
+ "KfAR=Kr1/Kr12*Kf12-KfA;#Rate of reaction from Eqn.(34)\n",
+ "tou=Lf*(1-ephsilonf)/uo;#Residence time from Eqn.(5)\n",
+ "XA=1-math.exp(-Kf1*tou);#Conversion of A from Eqn.(26)\n",
+ "XR=1-((KfAR/(Kf12-Kf34))*(math.exp(-Kf34*tou)-math.exp(-Kf12*tou)));#Conversion of R from Eqn.(27)\n",
+ "SR=(1-XR)/XA;#Selectivity of R\n",
+ "\n",
+ "#OUTPUT\n",
+ "\n",
+ "print 'Rate of reaction 1 for fluidized bed:%.4f'%Kf1\n",
+ "print 'Rate of reaction 2 for fluidized bed:%.4f'%Kf3\n",
+ "print 'Rate of reaction 1 with respect to A:%.4f'%KfA\n",
+ "print 'The Conversion of Napthalene:%.0f percentage'%(XA*100);\n",
+ "print 'The selectivity of Phthalic anhydride:%.0f percentage'%(SR*100);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of reaction 1 for fluidized bed:0.6007\n",
+ "Rate of reaction 2 for fluidized bed:0.0099\n",
+ "Rate of reaction 1 with respect to A:0.0058\n",
+ "The Conversion of Napthalene:96 percentage\n",
+ "The selectivity of Phthalic anhydride:95 percentage\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 302\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Bubbling Bed Reactor for Intermediate Sized Reactor\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Kr=3.; #rate constant in m**3 gas/m**3 cat s\n",
+ "db=0.12; #Equilibrium bubble size in m\n",
+ "D=9E-5; #Diffusion coefficient of gas in m**2/s\n",
+ "dpbar=68; #Average partilce size in micrometers\n",
+ "ephsilonm=0.42; #Void fraction of fixed bed\n",
+ "uo=0.4; #Superficial gas velocity in m/s\n",
+ "Lm=0.8; #Length of the bed in m\n",
+ "ephsilonmf=0.45; #Void fraction at minimum fluidization condition\n",
+ "umf=0.21; #Velocity at minimum fluidization condition in m/s\n",
+ "gammab=0; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "ubr=0.711*(g*db)**0.5; #Rise velocity of bubble from Eqn.(6.7)\n",
+ "ub=uo-umf+ubr; #Velocity of bubbles in bubbling beds in Eqn.(6.8)\n",
+ "ubstar=ub+3*umf; #Rise velocity of the bubble gas from Eqn.(45)\n",
+ "delta=(uo-umf)/(ub+umf);#Fraction of bed in bubbles from Eqn.(6.46)\n",
+ "Kbe=4.5*(umf/db); #Interchange coefficient between bubble and emulsion from Eqn.(47)\n",
+ "Lf=Lm*(1-ephsilonm)/((1-delta)*(1-ephsilonmf));#Length of fixed bed\n",
+ "phi=((Kr/Kbe)**2*((1-ephsilonmf)-gammab*(umf/ubstar))**2+ \\\n",
+ " ((delta/(1-delta))+umf/ubstar)**2+2*(Kr/Kbe)*((1-ephsilonmf) \\\n",
+ " -gammab*(umf/ubstar))*((delta/(1-delta))-umf/ubstar))**0.5;\n",
+ " #From Eqn.(52)\n",
+ " \n",
+ "q1=0.5*Kr/umf*((1-ephsilonmf)+gammab*(umf/ubstar))+0.5*Kbe/umf* \\\n",
+ " (((delta/(1-delta))+umf/ubstar)-phi);#From Eqn.(50)\n",
+ "q2=0.5*Kr/umf*((1-ephsilonmf)+gammab*(umf/ubstar))+0.5*Kbe/umf* \\\n",
+ " (((delta/(1-delta))+umf/ubstar)+phi);#From Eqn.(50)\n",
+ " \n",
+ "si1=0.5-0.5*((1-delta)/delta)*(umf/ubstar-Kr/Kbe*((1-ephsilonmf)- \\\n",
+ " gammab*(umf/ubstar))-phi);#From Eqn.(51)\n",
+ "si2=0.5-0.5*((1-delta)/delta)*(umf/ubstar-Kr/Kbe*((1-ephsilonmf)- \\\n",
+ " gammab*(umf/ubstar))+phi);#From Eqn.(51)\n",
+ "XA=1-(delta/(1-delta))*(1/(uo*phi))*((1-si2)*(si1*delta*ubstar+ \\\n",
+ " (1-delta)*umf)*math.exp(-q1*Lf)+(si1-1)* \\\n",
+ " (si2*delta*ubstar+(1-delta)*umf)*math.exp(-q2*Lf));\n",
+ " #Conversion from Eqn.(49)\n",
+ " \n",
+ "Krtou=Kr*Lm*(1-ephsilonm)/uo;#Dimensionless reaction rate group from Eqn.(5)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'COmparing the values of 1-XA = %f and Krtou = %f with Fig.(6), \\\n",
+ "we can conlcude that this operating condition is shown as point \\\n",
+ "A in Fig.(3)'%(1-XA,Krtou);\n",
+ "print 'Line 2 gives the locus of conversions for different values of the \\\n",
+ "reaction rate group for this fluidized contacting'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "COmparing the values of 1-XA = 0.113843 and Krtou = 3.480000 with Fig.(6), we can conlcude that this operating condition is shown as point A in Fig.(3)\n",
+ "Line 2 gives the locus of conversions for different values of the reaction rate group for this fluidized contacting\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 305\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reaction in the Slow Bubble Regime\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "uo=0.25; #Superficial gas velocity in m/s\n",
+ "db=0.025; #Equilibrium bubble size in m\n",
+ "Kr=1.5; #rate constant in m**3 gas/m**3 cat s\n",
+ "umf=0.21; #Velocity at minimum fluidization condition in m/s\n",
+ "Lm=0.8; #Length of the bed in m\n",
+ "ephsilonm=0.42; #Void fraction of fixed bed\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of bubble from Eqn.(6.7)\n",
+ "ub=uo-umf+ubr;#Velocity of bubbles in bubbling beds in Eqn.(6.8)\n",
+ "delta=(uo-umf)/(ub+2*umf);#Fraction of bed in bubbles from Eqn.(55) since ub/umf<<1 \n",
+ "XA=1-math.exp(-Kr*Lm*((1-ephsilonm)/uo)*(umf/uo)*(1-delta));#Conversion from Eqn.(57)\n",
+ "Krtou=Kr*Lm*(1-ephsilonm)/uo;#Dimensionless reaction rate group from Eqn.(5)\n",
+ "\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Comparing the values of 1-XA = %f and Krtou = %f with Fig.(6), \\\n",
+ "we can conlcude that this operating condition is shown \\\n",
+ "as point B in Fig.(3)'%(1-XA,Krtou);\n",
+ "print 'Line 3 gives the locus of conversions for different values \\\n",
+ "of the reaction rate group for this fluidized contacting'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Comparing the values of 1-XA = 0.108243 and Krtou = 2.784000 with Fig.(6), we can conlcude that this operating condition is shown as point B in Fig.(3)\n",
+ "Line 3 gives the locus of conversions for different values of the reaction rate group for this fluidized contacting\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 307\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Conversion in the Freeboard of a Reactor\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "uo=0.3; #Superficial gas velocity in m/s\n",
+ "Lf=1.1; #Length of fixed bed in m\n",
+ "Hf=1.2; #Length of freeboard in m\n",
+ "db=0.04; #Equilibrium bubble size in m\n",
+ "umf=0.006; #Velocity at minimum fluidization condition in m/s\n",
+ "ephsilonmf=0.55; #Void fraction at minimum fluidization condition\n",
+ "gammab=0.005; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "Kr=10.; #rate constant in m**3 gas/m**3 cat s\n",
+ "D=2E-5; #Diffusion coefficient of gas in m**2/s\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of bubble from Eqn.(6.7)\n",
+ "ub=uo-umf+ubr;#Velocity of bubbles in bubbling beds in Eqn.(6.8)\n",
+ "Kbc=4.5*(umf/db)+5.85*((D**0.5*g**0.25)/db**(5./4));\n",
+ "#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "\n",
+ "Kce=6.77*((D*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;\n",
+ "#Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ "\n",
+ "delta=uo/ub;#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ "ephsilonf=1-(1-delta)*(1-ephsilonmf);#Void fraction of fixed bed from Eqn.(6.20)\n",
+ "fw=0.6;#Wake volume to bubble volume from Fig.(5.8)\n",
+ "gammac=(1-ephsilonmf)*((3.0/(ubr*ephsilonmf/umf-1))+fw);\n",
+ "#Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
+ "\n",
+ "gammae=((1-ephsilonmf)*((1-delta)/delta))-gammab-gammac;\n",
+ "#Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
+ "\n",
+ "Kf=(gammab*Kr)+1.0/((1.0/Kbc)+(1.0/(gammac*Kr+1.0/((1.0/Kce)+(1.0/(gammae*Kr))))));\n",
+ "#Raction rate for fluidized bed from Eqn.(14)\n",
+ "\n",
+ "XA=1-math.exp(-1*Kf*Lf/ub);#Conversion at the top of dense bed from Eqn.(16)\n",
+ "etabed=(Kf*delta)/(Kr*(1-ephsilonf));#Reactor efficiency from Eqn.(22)\n",
+ "a=0.6/uo #Since uoa = 0.6s**-1 from Fig.(5)\n",
+ "adash=6.62; #From Fig.(5)\n",
+ "XA1=1-1.0/(math.exp(((1-ephsilonf)*Kr/(uo*a))*((1-math.exp(-a*Hf))- \\\n",
+ " ((1-etabed)/(1+(adash/a)))*(1-math.exp(-(a+adash)*Hf)))));#Conversion from Eqn.(64)\n",
+ "XA2=1-(1.0-XA1)*(1.0-XA);#Conversion at the exit from Eqn.(64)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The conversion:'\n",
+ "print '\\tAt the top pf the dense bed: %d percentage'%(XA1*100)\n",
+ "print '\\tAt the reactor exit: %d percentage'%(XA2*100);\n",
+ "\n",
+ "#Disclaimer: The value of kf deviate from the one given in textbook, where as it is close to the value obtained by manual calculation. \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conversion:\n",
+ "\tAt the top pf the dense bed: 96 percentage\n",
+ "\tAt the reactor exit: 99 percentage\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch13.ipynb b/Fluidization_Engineering/ch13.ipynb
new file mode 100644
index 00000000..06efb739
--- /dev/null
+++ b/Fluidization_Engineering/ch13.ipynb
@@ -0,0 +1,313 @@
+{
+ "metadata": {
+ "name": "ch13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Heat Transfer between Fluidized Beds and Surfaces"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 331\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#h on a Horizontal Tube Bank\n",
+ "\n",
+ "#Variable declaration\n",
+ "dp=57.0; #Particle size in micrometer\n",
+ "rhos=940.0; #Density of solids in kg/m**3\n",
+ "Cps=828.0; #Specific heat capacity of the solid in J/kg K\n",
+ "ks=0.20; #Thermal conductivity of solids in W/m k\n",
+ "kg=0.035; #Thermal concuctivity of gas in W/m k\n",
+ "umf=0.006; #Velocity at minimum fluidization condition in m/s\n",
+ "ephsilonmf=0.476;#Void fraction at minimum fluidization condition\n",
+ "do1=0.0254; #Outside diameter of tube in m\n",
+ "L=1;\n",
+ "uo=[0.05,0.1,0.2,0.35];#Superficial gas velocity in m/s\n",
+ "nw=[2.,3.1,3.4,3.5]; #Bubble frequency in s**-1\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "\n",
+ "#CALCULATION\n",
+ "dte=4.*do1*L/2.*L; #Hydraulic diameter from Eqn.(6.13)\n",
+ "db=(1+1.5)*0.5*dte; #Rise velocity of the bubble\n",
+ "ubr=0.711*(g*db)**0.5; #Rise velocity of bubble from Eqn.(6.7)\n",
+ "phib=0.19;#From Fig.(15) for ks/kg=5.7\n",
+ "ke=ephsilonmf*kg+(1-ephsilonmf)*ks*(1/((phib*(ks/kg))+(2/3.0)))\n",
+ " #Effective thermal conductivity of bed from Eqn.(3) \n",
+ " \n",
+ "n=len(uo);\n",
+ "i=0;\n",
+ "ub = [0,0,0,0]\n",
+ "delta = [0,0,0,0]\n",
+ "h = [0,0,0,0]\n",
+ "while i<n:\n",
+ " ub[i]=uo[i]-umf+ubr; #Velocity of bubbles in bubbling beds in Eqn.(6.8)\n",
+ " delta[i]=uo[i]/ub[i];#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ " h[i]=1.13*(ke*rhos*(1-ephsilonmf)*Cps*nw[i]*(1-delta[i]))**0.5;\n",
+ " #Heat transfer coefficinet from Eqn.(18)\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Superficial gas velocity(m/s)',\n",
+ "print '\\tHeat transfer coefficient(W/m**2 k)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%uo[i],\n",
+ " print '\\t\\t\\t%f'%h[i]\n",
+ " i=i+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Superficial gas velocity(m/s) \tHeat transfer coefficient(W/m**2 k)\n",
+ "0.050000 \t\t\t270.297375\n",
+ "0.100000 \t\t\t323.421769\n",
+ "0.200000 \t\t\t315.487604\n",
+ "0.350000 \t\t\t292.370761\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 332\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Effect of Gas Properties on h\n",
+ "\n",
+ "#Variable declaration\n",
+ "dp=80.; #Particle size in micrometer\n",
+ "rhos=2550.; #Density of solids in kg/m**3\n",
+ "Cps=756.; #Specific heat capacity of the solid in J/kg K\n",
+ "ks=1.21; #Thermal conductivity of solids in W/m k\n",
+ "kg=[0.005,0.02,0.2]; #Thermal concuctivity of gas in W/m k\n",
+ "ephsilonmf=0.476; #Void fraction at minimum fluidization condition\n",
+ "\n",
+ "#CALCULATION\n",
+ "delta=0.5*(0.1+0.3);#For a gently fluidized bed\n",
+ "nw=3.;#Bubble frequency in s**-1 from Fig.(5.12) at about 30cm above the distributor\n",
+ "n=len(kg);\n",
+ "i=0;\n",
+ "x = [0,0,0]\n",
+ "while i<n:\n",
+ " x[i]=ks/kg[i];#To find different values of ks/kg\n",
+ " i=i+1;\n",
+ "\n",
+ "phib=[0.08,0.10,0.20];#From Fig.(15) for different values of ks/kg\n",
+ "i=0;\n",
+ "ke = [0,0,0]\n",
+ "h1 =[0,0,0]\n",
+ "while i<n:\n",
+ " ke[i]=ephsilonmf*kg[i]+(1-ephsilonmf)*ks*(1/((phib[i]*(ks/kg[i]))+(2.0/3)))\n",
+ " #Effective thermal conductivity of bed from Eqn.(3)\n",
+ " \n",
+ " h1[i]=1.13*(ke[i]*rhos*(1-ephsilonmf)*Cps*nw*(1-delta))**0.5;#Heat transfer coefficinet from Eqn.(18)\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Thermal conductivity of Gas(W/m K))',\n",
+ "print '\\tMax. heat transfer coefficient(W/m**2 k)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%kg[i],\n",
+ " print '\\t\\t\\t\\t%d'%h1[i]\n",
+ " i=i+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal conductivity of Gas(W/m K)) \tMax. heat transfer coefficient(W/m**2 k)\n",
+ "0.005000 \t\t\t\t324\n",
+ "0.020000 \t\t\t\t567\n",
+ "0.200000 \t\t\t\t1157\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 332\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Effect of Particle Size on h\n",
+ "\n",
+ "#Variable declaration\n",
+ "rhos=2700.; #Density of solids in kg/m**3\n",
+ "Cps=755.; #Specific heat capacity of the solid in J/kg K\n",
+ "ks=1.2; #Thermal conductivity of solids in W/m k\n",
+ "kg=0.028; #Thermal concuctivity of gas in W/m k\n",
+ "ephsilonmf=0.476; #Void fraction at minimum fluidization condition\n",
+ "dp1=10E-3; #Particle size for which h=hmax in m\n",
+ "hmax=250.; #Max. heat transfer coefficient in W/m**2 K \n",
+ "nw=5.; #Bubble frequency in s**-1\n",
+ "delta=0.1; #Fraction of bed in bubbles\n",
+ "deltaw=0.1; #Fraction of bed in bubbles in wall region\n",
+ "dp=2E-3; #Diameter of particle in m\n",
+ "\n",
+ "#CALCULATION\n",
+ "x=ks/kg;\n",
+ "phib=0.11;\n",
+ "phiw=0.17;\n",
+ "ke=ephsilonmf*kg+(1-ephsilonmf)*ks*(1/((phib*(ks/kg))+(2.0/3)));\n",
+ "#Effective thermal conductivity of bed from Eqn.(3)\n",
+ "\n",
+ "hpacket=1.13*(ke*rhos*(1-ephsilonmf)*Cps*nw/(1-deltaw))**0.5;\n",
+ "#Heat transfer coefficient for the packet of emulsion from Eqn.(11)\n",
+ "\n",
+ "ephsilonw=ephsilonmf;#Void fraction in the wall region\n",
+ "\n",
+ "kew=ephsilonw*kg+(1-ephsilonw)*ks*((phiw*(ks/kg)+(1.0/3))**-1);\n",
+ "#Effective thermal conductivity in the wall region with stagnant gas from Eqn.(4)\n",
+ "\n",
+ "y=(2*kew/dp1)+(hmax*hpacket)/(((1-deltaw)*hpacket)-hmax);\n",
+ "#Calculating the term alphaw*Cpg*rhog*uo from Eqn.(16) by rearranging it\n",
+ "\n",
+ "h=(1-deltaw)/((2*kew/dp+y*(dp/dp1)**0.5)**-1+hpacket**-1);\n",
+ "#Heat transfer coeeficient from Eqn.(11) by using the value of y \n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The heat transfer coefficient for paricle size of %fm = %fW/m**2 K'%(dp,h);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer coefficient for paricle size of 0.002000m = 194.873869W/m**2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 334\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Freeboard Heat Exchange\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Hf=4.0; #Height of freeboard in m\n",
+ "uo=2.4; #Superficial gas velocity in m/s\n",
+ "ho=350.0; #Heat transfer coefficient at the bottom of freeboard region in W/m**2 K\n",
+ "hg=20.0; #Heat transfer coefficient in equivalent gas stream, but free of solids in W/m**2 K\n",
+ "\n",
+ "#CALCULATION\n",
+ "zf=[0,0.5,1,1.5,2,2.5,3,3.5,Hf];#Height above the top of the dense bubbling fluidized bed\n",
+ "hr=0;#Assuming heat transfer due to radiation is negligible\n",
+ "a=1.5/uo;#Since decay coefficient from Fig.(7.12), a*uo=1.5s**-1 \n",
+ "n=len(zf);\n",
+ "i=0;\n",
+ "h = []\n",
+ "while i<n:\n",
+ " h.append((hr+hg)+(ho-hr-hg)*math.exp(-a*zf[i]/2.0));#Heat transfer coefficient from Eqn.(24) for zf=Hf\n",
+ " i=i+1;\n",
+ "\n",
+ "hbar=(hr+hg)+2*(ho-hr-hg)*(1-math.exp(-a*Hf/2.0))/(a*Hf);#Mean heat transfer coefficient for the 4-m high freeboard from Eqn.(26)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The required relationship is h(W/m**2 K) vs. zf(m) as in Fig.(9a)'\n",
+ "print 'Height above the dense bubbling fluidized bed(m))',\n",
+ "print '\\tHeat transfer coefficient(W/m**2 k)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%zf[i],\n",
+ " print '\\t\\t\\t\\t\\t\\t%f'%h[i]\n",
+ " i=i+1;\n",
+ "\n",
+ "print '\\nThe mean heat transfer coefficient for the 4-m high freeboard =%d W/m**2 K'%hbar\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required relationship is h(W/m**2 K) vs. zf(m) as in Fig.(9a)\n",
+ "Height above the dense bubbling fluidized bed(m)) \tHeat transfer coefficient(W/m**2 k)\n",
+ "0.000000 \t\t\t\t\t\t350.000000\n",
+ "0.500000 \t\t\t\t\t\t302.263958\n",
+ "1.000000 \t\t\t\t\t\t261.433158\n",
+ "1.500000 \t\t\t\t\t\t226.508723\n",
+ "2.000000 \t\t\t\t\t\t196.636271\n",
+ "2.500000 \t\t\t\t\t\t171.085009\n",
+ "3.000000 \t\t\t\t\t\t149.229857\n",
+ "3.500000 \t\t\t\t\t\t130.536154\n",
+ "4.000000 \t\t\t\t\t\t114.546583\n",
+ "\n",
+ "The mean heat transfer coefficient for the 4-m high freeboard =208 W/m**2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch14.ipynb b/Fluidization_Engineering/ch14.ipynb
new file mode 100644
index 00000000..1367f2cc
--- /dev/null
+++ b/Fluidization_Engineering/ch14.ipynb
@@ -0,0 +1,419 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 : The RTD and Size Distribution of Solids in Fluidized Beds"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "#INPUT\n",
+ "Fo=2.7; #Feed rate in kg/min\n",
+ "Fof=0.9; #Feed rate of fines in feed in kg/min\n",
+ "Foc=1.8; #Feed rate of coarse in feed in kg/min\n",
+ "W=17.; #Bed weight in kg\n",
+ "kf=0.8; #Elutriation of fines in min**-1\n",
+ "kc=0.0125; #Elutriation of coarse in min**-1\n",
+ "\n",
+ "#CALCULATION\n",
+ "F1guess=1; #Guess value of F1\n",
+ "def solver_func(F1): #Function defined for solving the system\n",
+ " return F1-(Fof/(1.+(W/F1)*kf))-(Foc/(1.+(W/F1)*kc));#Eqn.(17)\n",
+ "\n",
+ "F1=fsolve(solver_func,F1guess)\n",
+ "F1f=Fof/(1.+(W/F1)*kf); #Flow rate of fines in entrained streams from Eqn.(16)\n",
+ "F1c=Foc/(1.+(W/F1)*kc); #Flow rate of coarse in entrained streams from Eqn.(16)\n",
+ "F2f=Fof-F1f; #Flow rate of fines in overflow streams from Eqn.(9)\n",
+ "F2c=Foc-F1c; #Flow rate of coarse in overflow streams from Eqn.(9)\n",
+ "tbarf=1./((F1/W)+kf); #Mean residence time of fines from Eqn.(12)\n",
+ "tbarc=1./((F1/W)+kc); #Mean residence time of coarse from Eqn.(12)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Flow rate in entrained stream:\\tFines:%fkg/min\\tCoarse:%fkg/min'%(F1f,F1c);\n",
+ "print 'Flow rate in overflow stream:\\tFines:%fkg/min\\tCoarse:%fkg/min'%(F2f,F2c);\n",
+ "print 'Mean residence time:\\tFines:%fmins\\tCoarse:%fmins'%(tbarf,tbarc);\n",
+ "\n",
+ "#====================================END OF PROGRAM ======================================================"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flow rate in entrained stream:\tFines:0.100000kg/min\tCoarse:1.600000kg/min\n",
+ "Flow rate in overflow stream:\tFines:0.800000kg/min\tCoarse:0.200000kg/min\n",
+ "Mean residence time:\tFines:1.111111mins\tCoarse:8.888889mins\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 344\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Flow with Elutriation and Change in Density of Solids\n",
+ "\n",
+ "\n",
+ "import math\n",
+ "from numpy import linspace,array,zeros\n",
+ "from scipy.optimize import fsolve\n",
+ "from matplotlib.pyplot import *\n",
+ "%pylab inline\n",
+ "#Variable declaration\n",
+ "dt=4.; #Diameter of reactor in m\n",
+ "ephsilonm=0.4; #Void fraction of static bed\n",
+ "rhos=2500.; #Density of solid in the bed in kg/m**3\n",
+ "Lm=1.2; #Height of static bed in m\n",
+ "Fo=3000; #Feed rate in kg/hr\n",
+ "beta1=1.2; #Increase in density of solids\n",
+ "dp=array([3,4,5,6,7,8,9,10,11,12,3,14,16,18,20,22,24,26,28,30])*10**-2;#Size of particles in mm\n",
+ "po=[0,0.3,0.8,1.3,1.9,2.6,3.5,4.4,5.7,6.7,7.5,7.8,7.5,6.3,5.0,3.6,2.4,1.3,0.5,0];#Size distribution of solids in mm**-1\n",
+ "k=array([0,10,9.75,9.5,8.75,7.5,6.0,4.38,2.62,1.20,0.325,0,0,0,0,0,0,0,0,0])*10**-4;#Elutriation constant in s**-1\n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "W=(pi/4*dt**2)*Lm*(1-ephsilonm)*rhos;#Weight of solids in bed\n",
+ "n=len(dp);\n",
+ "i=0;\n",
+ "F1guess=1000.;#Guess value for F1\n",
+ "F1c=linspace(2510,2700,10);\n",
+ "F1 = zeros(n)\n",
+ "x = zeros(n)\n",
+ "c = zeros(n)\n",
+ "a = zeros(n)\n",
+ "while i<n:\n",
+ " if k[i]==0:\n",
+ " x[i]=0\n",
+ " #break \n",
+ " else:\n",
+ " x[i]=0#(float(po[i])/(W*k[i]/float(F1)))*math.log(1.+(W*k[i]/F1)); \n",
+ " def solver_func(Fo):\n",
+ " return F1/(Lm*Fo)-x[i];\n",
+ "\n",
+ " F1[i] = fsolve(solver_func,F1guess);#Using inbuilt function fsolve for solving Eqn.(20) for F1\n",
+ " #c[i]=F1c[i]/(Lm*Fo);\n",
+ " if F1[i]==0:\n",
+ " a[i]=0;\n",
+ " else:\n",
+ " a[i]=(po[i]/(W*k[i]/F1[i]))*math.log(1+(W*k[i]/F1[i]));\n",
+ "\n",
+ " i=i+1;\n",
+ "\n",
+ "#plot(F1,c);\n",
+ "\n",
+ "#xtitle('F1 vs a,c','F1','a,c');\n",
+ "F1n=2500.;#The point were both the curves meet\n",
+ "F2=beta1*Fo-F1n;#Flow rate of the second leaving stream\n",
+ "j=0;\n",
+ "m=len(dp);\n",
+ "p1 = zeros(m)\n",
+ "p2 = zeros(m)\n",
+ "tbar = zeros(m)\n",
+ "while j<m:\n",
+ " p1[j]=(1./F1n)*((Fo*po[j])/(1.+(W/F1n)*k[j]));#Size distribution of stream 1 in mm**-1 from Eqn.(16)\n",
+ " p2[j]=k[j]*W*p1[j]/F2;#Size distribution of stream 2 in mm**-1 from Eqn.(7)\n",
+ " if p1[j]==0 and p2[j]==0:\n",
+ " tbar[j]=0;\n",
+ " elif p1[j]==0:\n",
+ " tbar[j]=(W*p1[j])/(F2*p2[j]);\n",
+ " elif p2[j]==0:\n",
+ " tbar[j]=(W*p1[j])/(F1n*p1[j]);\n",
+ " else:\n",
+ " tbar[j]=(W*p1[j])/(F1n*p1[j]+F2*p2[j]);#Average time in hr from Eqn.(11)\n",
+ " j=j+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Flow rate of stream 1:%fkg/hr'%F1n\n",
+ "print 'Flow rate of stream 2:%fkg/hr'%F2\n",
+ "j=0;\n",
+ "print 'tbar(hr)'\n",
+ "while j<m:\n",
+ " print '%f'%tbar[j]\n",
+ " j=j+1;\n",
+ "\n",
+ "#DISCLAIMER: The value obtained for tbar is deviating highly\n",
+ "#form the one given in textbook. However, the value obtained by manual calculation is close to #\n",
+ "#the ones obtained from the program."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "Flow rate of stream 1:2500.000000kg/hr"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Flow rate of stream 2:1100.000000kg/hr\n",
+ "tbar(hr)\n",
+ "0.000000\n",
+ "8.962153\n",
+ "8.964162\n",
+ "8.966171\n",
+ "8.972205\n",
+ "8.982279\n",
+ "8.994397\n",
+ "9.007522\n",
+ "9.021824\n",
+ "9.033397\n",
+ "9.040543\n",
+ "9.043200\n",
+ "9.043200\n",
+ "9.043200\n",
+ "9.043200\n",
+ "9.043200\n",
+ "9.043200\n",
+ "9.043200\n",
+ "9.043200\n",
+ "0.000000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive', 'pi']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 351\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Single-Size Feed of Shrinking Particles\n",
+ "\n",
+ "#Variable declaration\n",
+ "dp=1; #Particle size in mm\n",
+ "Fo=10; #Feed rate in kg/min\n",
+ "k=0.1; #Particle shrinkage rate in mm/min\n",
+ "\n",
+ "#CALCULATION\n",
+ "R=k/2; #Particle shrinkage rate in terms of radius\n",
+ "W=(Fo*dp/2)/(4*R); #Bed weight from Eqn.(42)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Weight of bed:%d kg' %W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Weight of bed:25 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 352\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Wide Size Distribution of Shrinking Particle\n",
+ "\n",
+ "#Variable declaration\n",
+ "dpi=[1.05,0.95,0.85,0.75,0.65,0.55,0.45,0.35,0.25,0.15,0.05]; #Mean size in mm\n",
+ "Fo=[0,0.5,3.5,8.8,13.5,17.0,18.2,17.0,13.5,7.3,0]#*10**-2 #Feed rate in kg/s\n",
+ "for i in range(len(Fo)):\n",
+ " Fo[i] = Fo[i] * 10**-2\n",
+ "k=[0,0,0,0,0,0,0,0,2.0,12.5,62.5]#*10**-5;#Elutriation constant in s**-1\n",
+ "for i in range(len(k)):\n",
+ " k[i] = k[i] * 10**-5\n",
+ "\n",
+ "R=-1.58*10**-5;#Rate of particle shrinkage in mm/s\n",
+ "deldpi=0.1;#Size intervals in mm\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(dpi);\n",
+ "m=1;#Starting with the largest value size interval that contains solids\n",
+ "W = [0]\n",
+ "while m<n-1:\n",
+ " W.append((Fo[m]-R*W[m-1]/deldpi)/(k[m]-R/deldpi-3*R/dpi[m]));#From Eqn.(33)\n",
+ " m=m+1;\n",
+ "\n",
+ "Wt=sum(W);#Total sum\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nTotal mass in the bed:%fkg'%Wt\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total mass in the bed:7168.981263kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 353\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Elutriation and Attrition of Catalyst\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "dpi=[0.17,0.15,0.13,0.11,0.09,0.07,0.05,0.03,0.01];#Mean size of particles in mm\n",
+ "a=[0,0.95,2.45,5.2,10.1,23.2,35.65,20.0,2.45]#*10**-2;#Feed composition Fo(dpi)/Fo\n",
+ "for i in range(len(a)):\n",
+ " a[i] = a[i] * 10**-2\n",
+ "\n",
+ "y=[0,0,0,0,0,0,0.625,10.225,159.25]#*10**-6;#Elutriation and cyclone efficiency k(dpi)(1-eta(dpi))\n",
+ "for i in range(len(y)):\n",
+ " y[i] = y[i] * 10**-6\n",
+ "\n",
+ "\n",
+ "F=0.01; #Rate at which solids are withdrawn in kg/s\n",
+ "W=40000; #Weight of bed in kg\n",
+ "dp1=0.11 #Initial size in mm\n",
+ "dp2=0.085; #Size after shrinking in mm\n",
+ "dpmin=0.01; #Minimum size in mm\n",
+ "deldpi=2*10**-2; #Size inerval in mm\n",
+ "t=20.8; #Time in days\n",
+ "si=1;\n",
+ "\n",
+ "#CALCULATION\n",
+ "kdash=math.log((dp1-dpmin)/(dp2-dpmin))/(t*24*3600);#Rate of particle shrinkage from Eqn.(24)\n",
+ "n=len(dpi);\n",
+ "m=1;\n",
+ "Fo=0.05;#Initial value of Fo\n",
+ "F1 = [0];\n",
+ "s=0;\n",
+ "c=0;\n",
+ "t=1E-6;\n",
+ "R = [0]\n",
+ "x = [0]\n",
+ "F1 = [0]\n",
+ "while m<n:\n",
+ " R.append(-kdash*(dpi[m]-dpmin));#Rate of size change\n",
+ " x.append((a[m]*Fo-W*R[m-1]*F1[m-1]/deldpi)/(F+(W*y[m])-(W*R[m]/deldpi)-3*W*R[m]/dpi[m]));#Eqn.(34)\n",
+ " F1.append(x[m]*F);\n",
+ " c=c+x[m];\n",
+ " m=m+1;\n",
+ " if abs(c-1)<t:\n",
+ " break\n",
+ " Fo=Fo+0.0001;#Incrementing Fo\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Feed rate with deldpi=%fmm is %fg/hr'%(deldpi,Fo);\n",
+ "i=0;\n",
+ "print 'Bed composition'\n",
+ "for i in x:\n",
+ " print '%f'%(i*100)\n",
+ " i=i+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Feed rate with deldpi=0.020000mm is 0.050800g/hr\n",
+ "Bed composition\n",
+ "0.000000\n",
+ "0.652911\n",
+ "1.859952\n",
+ "4.400781\n",
+ "9.668999\n",
+ "25.654298\n",
+ "28.575890\n",
+ "2.317749\n",
+ "0.019493\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch15.ipynb b/Fluidization_Engineering/ch15.ipynb
new file mode 100644
index 00000000..77a4d951
--- /dev/null
+++ b/Fluidization_Engineering/ch15.ipynb
@@ -0,0 +1,296 @@
+{
+ "metadata": {
+ "name": "ch15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Circulation Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 369\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Circulation Rate when Deactivation Controls\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "thalf=1; #Half life of catalyst in s\n",
+ "F=960; #Feed rate of oil in tons/day\n",
+ "W=50; #Weight of the bed in tons\n",
+ "a=0.5; #Activity after time equal to half life\n",
+ "abar=0.01; #Average activity of the catalyst\n",
+ "\n",
+ "#CALCULATION\n",
+ "Ka=-math.log(a)/thalf;#Rate constant is s**-1, assuming I order kinetics from Eqn.(12)\n",
+ "Fs=Ka*W*abar/(1-abar);#Circulation rate of solids from Eqn.(16)\n",
+ "x=(Fs*60*60*24.0)/F; #Circulation rate per feed of oil\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nSolid recirculation per feed of oil =%ftons of solid circulated/ton feed oil'%x\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Solid recirculation per feed of oil =31.506690tons of solid circulated/ton feed oil\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 370\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Circulation Rate when Heat Duty Controls\n",
+ "\n",
+ "#Variable declaration\n",
+ "deltaHr1=1260.; #Enthalpy change during endothermic reaction in kJ/kg\n",
+ "deltaHr2=-33900.; #Enthal[y change during exothermic reaction in kJ/kg\n",
+ "H1=703.; #Enthalpy of feed oil in kJ/kg\n",
+ "T1=260.; #Temperature of feed oil in degree celcius\n",
+ "H3=1419.; #Enthalpy of cracked product in kJ/kg\n",
+ "T3=500.; #Temperature of cracked product in degree celcius\n",
+ "Ta=20.; #Temperature of entering air in degree celcius\n",
+ "Cpa=1.09; #Specific heat of entering air in kJ/kg K\n",
+ "Cpf=1.05; #Specific heat of flue gases in kJ/kg K\n",
+ "Cps=1.01; #Specific heat of solids in kJ/kg K\n",
+ "Cpv=3.01; #Specific heat of vaporized feed in kJ/kg K\n",
+ "T4=[520.,540.,560.,580.,600.,620.,640.,660.]; #Temperature of flue gas in degree celcius\n",
+ "V=22.4; #Volume of 1 mole of Carbon dioxide gas in N-m**3\n",
+ "M=12.; #Molecular weight of carbon in kg\n",
+ "rho=1.293; #Density of carbon dioxide gas in kg/N-m**3\n",
+ "xa=0.21; #Mass fraction of oxygen in air\n",
+ "betac=0.07; #Mass fraction of carbon\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(T4);\n",
+ "i=0;\n",
+ "x1 = [0,0,0,0,0,0,0,0]\n",
+ "x2 = [0,0,0,0,0,0,0,0]\n",
+ "excess_air = [0,0,0,0,0,0,0,0]\n",
+ "\n",
+ "x2min=betac*(V*rho/(M*xa));#Minimum amount of air required for complete combustion\n",
+ "while i<n:\n",
+ " x1[i]=(deltaHr1+0.93*H3-H1)/(Cps*(T4[i]-T3));#Fs/F1 by simplifying the overall energy balance\n",
+ " x2[i]=((0.07*(-deltaHr2)-(deltaHr1+0.93*H3-H1))/(Cpf*(T4[i]-Ta)))-0.07;#F2/F1 by simplifying the energy balance for regenerator\n",
+ " if x2[i]>x2min:\n",
+ " excess_air[i]=(x2[i]-x2min)/x2min; #Excess air used\n",
+ " else:\n",
+ " excess_air[i]=0;\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT \n",
+ "print 'T4(degree celcius)',\n",
+ "print '\\tFs/F1',\n",
+ "print '\\t\\tF2/F1',\n",
+ "print '\\t\\tExcess air(percentage)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%T4[i],\n",
+ " print '\\t\\t%f'%x1[i],\n",
+ " print '\\t%f'%x2[i],\n",
+ " print '\\t%f'%(excess_air[i]*100);\n",
+ " i=i+1;\n",
+ "\n",
+ "#Disclaimer: The values of F2/F1 obtained by manual calculation has close correspondance to the ones obtained as the output, whereas it deviates largely from the values given in textbook.\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T4(degree celcius) \tFs/F1 \t\tF2/F1 \t\tExcess air(percentage)\n",
+ "520.000000 \t\t92.904455 \t0.875390 \t8.807235\n",
+ "540.000000 \t\t46.452228 \t0.839029 \t4.287699\n",
+ "560.000000 \t\t30.968152 \t0.805362 \t0.102944\n",
+ "580.000000 \t\t23.226114 \t0.774099 \t0.000000\n",
+ "600.000000 \t\t18.580891 \t0.744992 \t0.000000\n",
+ "620.000000 \t\t15.484076 \t0.717825 \t0.000000\n",
+ "640.000000 \t\t13.272065 \t0.692412 \t0.000000\n",
+ "660.000000 \t\t11.613057 \t0.668586 \t0.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 379\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Aeration of Fine Particle Downcomer\n",
+ "\n",
+ "#Variable declaration\n",
+ "Fs=100.; #Solid flowrate in kg/s\n",
+ "ephsilon1=0.55;\n",
+ "ephsilon2=0.5;\n",
+ "p1=120.; #Pressure at upper level in kPa\n",
+ "rhos=1000.; #Density of solid in kg/m**3\n",
+ "rhog=1.; #Density of gas in kg/m**3\n",
+ "gc=1.; #Conversion factor\n",
+ "g=9.81; #Acceleration due to gravity in m/s**2\n",
+ "di=0.34; #Diameter of downcomer in m\n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "x=(ephsilon1/ephsilon2)*((1-ephsilon2)/(1-ephsilon1));#To find pressure at lower level using Eqn.(30)\n",
+ "p2=x*p1;#Pressure at lower level using Eqn.(30)\n",
+ "deltap=p2-p1;\n",
+ "ephsilonbar=0.5*(ephsilon1+ephsilon2);\n",
+ "deltah=(deltap*10**3*gc)/(rhos*(1-ephsilonbar)*g);#Static head height from Eqn.(28)\n",
+ "At=0.25*pi*di**2;#Area of downcomer\n",
+ "Gs=Fs/At;#Flux of solids in downcomer\n",
+ "Gg=Gs*(ephsilon1/(1-ephsilon1))*(rhog/rhos)*(x-1);#Required gas aeration rate from Eqn.(31)\n",
+ "Fg=Gg*At;#Flow rate of gas required\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nThe required flow rate of gas required for location of %fm below downcomer is %.4fkg/s'%(deltah,Fg)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The required flow rate of gas required for location of 5.722768m below downcomer is 0.0272kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 380\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Circulation in Side-by-Side Beds\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Fs=600;#Solid circulation rate in kg/s\n",
+ "dpbar=60;#Mean size of solids in micrometer\n",
+ "pA=120;#Pressure in vessel A in kPa\n",
+ "pB=180;#Pressure in vessel B in kPa\n",
+ "LfA=8;#Bed height in vessel A in m\n",
+ "LfB=8;#Bed height in vessel B i m\n",
+ "#Bulk densities in kg/m**3\n",
+ "rho12=100;\n",
+ "rho34=400;\n",
+ "rho45=550;\n",
+ "rho67=200;\n",
+ "rho78=200;\n",
+ "rho910=400;\n",
+ "rho1011=400;\n",
+ "rho1112=550;\n",
+ "rho13=100;\n",
+ "deltapdA=7;#Pressure drop across the distributor in regenerator in kPa\n",
+ "deltapdB=8;#Pressure drop across the distributor in reactor in kPa\n",
+ "deltap12=(9+4);#Friction loss and pressure difference required to accelerate the solids in transfer lines in kPa\n",
+ "deltap78=(15+3);#Friction loss and pressure difference required to accelerate the solids in transfer lines in kPa\n",
+ "deltap45=20;#Friction loss across the reactor's stripper downcomer in kPa\n",
+ "deltap1112=4;#Friction loss across the regenerator's downcomer in kPa\n",
+ "deltapvA=5;#Pressure drop assigned for the control valve in regenerator in kPa\n",
+ "deltapvB=15;#Pressure drop assigned for the control valve in reactor in kPa\n",
+ "deltah12=15;#Height of the riser in m\n",
+ "deltah86=30;#Height of the riser in m\n",
+ "deltah1011=7;#Height difference h10-h11 in m\n",
+ "g=9.81;#Acceleration due to gravity in m/s**2\n",
+ "gc=1;#Conversion factor\n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "Gs=900;#From Fig.(8), to find dt\n",
+ "dt=math.sqrt((4/math.pi)*Fs/Gs);#Diameter of the downcomer\n",
+ "#Height of downcomer A from Eqn.(7)\n",
+ "deltahA=(1/(rho1112*g))*((pB-pA)*gc*(10**3)+(deltap12+deltapdB+deltap1112+deltapvA)*gc*10**3-rho12*g*(-deltah12)-rho34*g*(-LfB)-rho1011*g*deltah1011);\n",
+ "#Height of downcomer B from Eqn.(8)\n",
+ "deltahB=(1/(rho45*g))*(-(pB-pA)*gc*10**3+(deltap45+deltapvB+deltap78+deltapdA)*gc*10**3+rho78*g*deltah86+rho910*g*LfA)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Height of downcomer for:'\n",
+ "print '\\tRegenerator:%d m'%deltahA\n",
+ "print '\\tReactor:%.1f m'%deltahB\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of downcomer for:\n",
+ "\tRegenerator:20 m\n",
+ "\tReactor:16.7 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch16.ipynb b/Fluidization_Engineering/ch16.ipynb
new file mode 100644
index 00000000..1ad8955d
--- /dev/null
+++ b/Fluidization_Engineering/ch16.ipynb
@@ -0,0 +1,431 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 : Design for Physical Operations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 404\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Single-Stage Limestone Calciner\n",
+ "\n",
+ "#Variable Declaration\n",
+ "T=1000.; #Operating temperature of calciner in degree celcius\n",
+ "deltaHr=1795.; #Heat of reaction in kJ/kg\n",
+ "M1=0.1; #Molecular weight of Calcium carbonate in kg/mol\n",
+ "M2=0.056; #Molecular weight of CaO in kg/mol\n",
+ "M3=0.044; #Molecular weight of Carbon dioxide in kg/mol\n",
+ "M4=0.029; #Molecular weight of Air in kg/mol\n",
+ "M5=0.029; #Molecular weight of Combustion gas in kg/mol\n",
+ "Cp1=1.13; #Specific heat of Calcium carbonate in kJ/kg K\n",
+ "Cp2=0.88; #Specific heat of CaO in kJ/kg K\n",
+ "Cp3=1.13; #Specific heat of Carbon dioxide in kJ/kg K\n",
+ "Cp4=1.00; #Specific heat of Air in kJ/kg K\n",
+ "Cp5=1.13; #Specific heat of Calcium carbonate in kJ/kg K\n",
+ "Tf=20.; #Temperature of feed in degree celcius\n",
+ "ma=15.; #Air required per kg of fuel in kg\n",
+ "Hc=41800.; #Net combustion heat of fuel in kJ/kg\n",
+ "Tpi=20.; #Initial temperature of solids in degree C\n",
+ "Tgi=1000.; #Initial temperature of gas in degree C\n",
+ "\n",
+ "#CALCULATION\n",
+ "mc=1;#Based on 1 kg of Calcium carbonate\n",
+ "B=(1/(Hc-(ma+mc)*Cp5*(T-Tpi)))*(M3*Cp3*(T-Tf)+M2*Cp2*(T-Tf)+deltaHr)#Fuel consumption(kg fuel/kg calcium carbonate)\n",
+ "B1=B*M3/M2;#Fuel consumption(kg fuel/kg Cao)\n",
+ "H=Hc*B1;#Heat required for calcination\n",
+ "eta=deltaHr/(B*Hc);#Thermal efficiency\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Fuel consumption:%f kg fuel/kg Cao'%B1\n",
+ "print 'Heat requirement for calcination:%f kJ/kg Cao'%H\n",
+ "print 'Thermal efficiency:%f percentage'%(eta*100)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fuel consumption:0.061731 kg fuel/kg Cao\n",
+ "Heat requirement for calcination:2580.366029 kJ/kg Cao\n",
+ "Thermal efficiency:54.657251 percentage\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 405\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "import math\n",
+ "\n",
+ "#INPUT\n",
+ "F = 400. #Feed rate of Calcium carbonate in tons/day\n",
+ "T = 1000. #Operating temperature of calciner in degree celcius\n",
+ "deltaHr = 1795.#Heat of reaction in kJ/kg\n",
+ "M1 = 0.1 #Molecular weight of Calcium carbonate in kg/mol\n",
+ "M2 = 0.056 #Molecular weight of CaO in kg/mol\n",
+ "M3 = 0.044 #Molecular weight of Carbon dioxide in kg/mol\n",
+ "M4 = 0.029 #Molecular weight of Air in kg/mol\n",
+ "M5 = 0.029 #Molecular weight of Combustion gas in kg/mol\n",
+ "Cp1 = 1.13 #Specific heat of Calcium carbonate in kJ/kg K\n",
+ "Cp2 = 0.88 #Specific heat of CaO in kJ/kg K\n",
+ "Cp3 = 1.13 #Specific heat of Carbon dioxide in kJ/kg K\n",
+ "Cp4 = 1.00 #Specific heat of Air in kJ/kg K\n",
+ "Cp5 = 1.17 #Specific heat of Combustion gas in kJ/kg K\n",
+ "Tf = 20. #Temperature of feed in degree celcius\n",
+ "ma = 15. #Air required per kg of fuel in kg\n",
+ "uo = 0.8 #Superficial gas velocity in m/s\n",
+ "Hc = 41800. #Net combustion heat of fuel in kJ/kg\n",
+ "Tpi = 20. #Initial temperature of solids in degree C\n",
+ "Tgi = 1000. #Initial temperature of gas in degree C\n",
+ "rhoa = 1.293 #Density of air in kg/m**3\n",
+ "pi = 3.14\n",
+ "\n",
+ "#CALCULATION\n",
+ "mc = 1. #Based on 1 kg of Calcium carbonate\n",
+ "Bguess = 2. #Guess value of B\n",
+ "def solver_func(B): #Function defined for solving the system\n",
+ " phi = ((ma+mc)*Cp5*B+(M3*Cp3))/Cp1\n",
+ " T3 = (Tpi+(phi+phi**2+phi**3)*Tgi)/(1+phi+phi**2+phi**3)\n",
+ " phiplus = 30.6*B\n",
+ " Tr = (T+Tpi*phiplus)/(1+phiplus)\n",
+ " return Hc*B+Cp3*(T3-Tpi)+ma*B*Cp4*(Tr-20)-(ma+mc)*Cp5*(T-Tpi)-M3*Cp3*(T-Tpi)-M2*Cp2*(T-Tpi)-deltaHr\n",
+ " #fn = (1/20800)*(2470-T3-13.34*(Tr-20))\n",
+ "\n",
+ "B = fsolve(solver_func,1E-6)#Using inbuilt function fsolve for solving Eqn.(23) for tou\n",
+ "phi = ((ma+mc)*Cp5*B+(M3*Cp3))/Cp1\n",
+ "#Temperature of various stages\n",
+ "T1 = (Tpi+(phi)*Tgi)/(1+phi)\n",
+ "T2 = (Tpi+(phi+phi**2)*Tgi)/(1+phi+phi**2)\n",
+ "T3 = (Tpi+(phi+phi**2+phi**3)*Tgi)/(1+phi+phi**2+phi**3)\n",
+ "phiplus = 30.6*B\n",
+ "Tr = (T+Tpi*phiplus)/(1+phiplus)\n",
+ "eta = deltaHr/(B*Hc) #Thermal efficiency\n",
+ "H = B*Hc/M2 #Heat requirement\n",
+ "#For lower heat recovery section\n",
+ "Ql = (F*10**3/(24*3600))*B*ma/(rhoa*(273/(Tr+273)))#Volumetric flow rate of gas in the lower heat recovery section\n",
+ "dtl = math.sqrt(4/pi*Ql/uo)#Diameter of lower bed\n",
+ "#For calcination section\n",
+ "Qc = (F*10**3/(24*3600))*B*ma/(rhoa*(273/(T+273)))#Volumetric flow rate of gas in the calcination section\n",
+ "dtc = math.sqrt(4/pi*Qc/uo)#Diameter of calcination section\n",
+ "#For I stage\n",
+ "Q1 = (F*10**3/(24*3600))*B*ma/(rhoa*(273/(T1+273)))#Volumetric flow rate of gas in the I stage\n",
+ "dt1 = math.sqrt(4/pi*Q1/uo)#Diameter of I stage\n",
+ "#For II stage\n",
+ "Q2 = (F*10**3/(24*3600))*B*ma/(rhoa*(273/(T2+273)))#Volumetric flow rate of gas in the II stage\n",
+ "dt2 = math.sqrt(4/pi*Q2/uo)#Diameter of II stage\n",
+ "#For III stage\n",
+ "Q3 = (F*10**3/(24*3600))*B*ma/(rhoa*(273/(T3+273)))#Volumetric flow rate of gas in the III stage\n",
+ "dt3 = math.sqrt(4/pi*Q3/uo)#Diameter of III stage\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nDiameter of lower bed:%fm'%(dtl)\n",
+ "print '\\nDiameter of calcination section:%fm'%(dtc)\n",
+ "print '\\nBed no.\\t\\t1\\t2\\t\\t3'\n",
+ "print '\\nDiameter(m)%f\\t%f\\t%f'%(dt1,dt2,dt3)\n",
+ "\n",
+ "#The value of diameter of each section is largely deviating from the values in the textbook. This is because the fuel consumption B have not been included in the energy balance equation. And the value of molecular weight is wrong by one decimal point.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Diameter of lower bed:7.097814m\n",
+ "\n",
+ "Diameter of calcination section:13.351483m\n",
+ "\n",
+ "Bed no.\t\t1\t2\t\t3\n",
+ "\n",
+ "Diameter(m)12.728715\t13.270865\t13.340712\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 413\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Multistage Adsorber\n",
+ "\n",
+ "#INPUT\n",
+ "T=20; #Temeprature in degree C\n",
+ "M=0.018; #Molecular weight of water in kg/mol\n",
+ "Q=10; #Flow rate of dry air in m**3/s\n",
+ "R=82.06E-6; #Universal gas constant\n",
+ "pi=0.0001; #Initial moisture content in atm\n",
+ "pj=0.01; #Final moisture content in atm\n",
+ "\n",
+ "#CALCULATION\n",
+ "a=Q*(273+T)/273; #Term At*uo\n",
+ "b=a*M/(R*(T+273));#Term C*At*uo\n",
+ "#The value of slope can be found only by graphical mehtod. Hence it has been taken directly from the book(Page no.414,Fig.E3)\n",
+ "m=10.2;\n",
+ "Fo=b/m; #Flow rate of solids\n",
+ "Q3=(b/Fo)*(pj-pi);#Moisture content of leaving solids\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nMoisture content of leaving solids:%.3f kg H2O/kg dry solids'%Q3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Moisture content of leaving solids:0.101 kg H2O/kg dry solids\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 422\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "\n",
+ "\n",
+ "#INPUT\n",
+ "Qfi = 0.20 #Initial moisture fraction\n",
+ "Qfbar = 0.04 #Average final moisture fraction\n",
+ "rhos = 2000. #Density of solid in kg/m**3\n",
+ "Cps = 0.84 #Specific heat of solids in kJ/kg K\n",
+ "Fo = 7.6E-4 #Flow rate of solids in kg/m**3\n",
+ "Tsi = 20. #Inital temperature of solids in degree C\n",
+ "rhog = 1. #Density of gas in kg/m**3\n",
+ "Cpg = 1 #Specific heat of gas in kJ/kg K\n",
+ "uo = 0.3 #Superficial gas velocity in m/s\n",
+ "Tgi = 200 #Initial temperature of gas in degee C\n",
+ "L = 2370 #Enthalpy of liquid in kJ/kg\n",
+ "Cpl = 4.2 #Specific heat of liquid in kJ/kg K\n",
+ "dt = 0.1 #Diameter of reactor in m\n",
+ "Lm = 0.1 #Length of fixed bed in m\n",
+ "ephsilonm = 0.45 #Void fraction of fixed bed\n",
+ "pi = 3.14\n",
+ "Fo1 = 1 #Feed rate for commercial-scale reactor in kg/s\n",
+ "\n",
+ "#CALCULATION\n",
+ "#(a)Bed temperature\n",
+ "Teguess = 50#Guess value of Te\n",
+ "def solver_func(Te):#Function defined for solving the system\n",
+ " return (pi/4.)*dt**2*uo*rhog*Cpg*(Tgi-Te)-Fo*(Qfi-Qfbar)*(L+Cpl*(Te-Tsi))-Fo*Cps*(Te-Tsi)\n",
+ "\n",
+ "Te = fsolve(solver_func,Teguess)\n",
+ "\n",
+ "#(b)Drying time for a particle\n",
+ "xguess = 2#Guess value of x, ie term tou/tbar\n",
+ "def solver_func1(x): #Function defined for solving the system\n",
+ " return 1-(Qfbar/Qfi)-(1-math.exp(-x))/x\n",
+ "\n",
+ "\n",
+ "x = fsolve(solver_func1,xguess)\n",
+ "W = (pi/4.)*dt**2*Lm*(1-ephsilonm)*rhos#Weight of soilds in bed\n",
+ "tbar = W/Fo#Mean residence time of solids from Eqn.(59)\n",
+ "tou = tbar*x#Time for complete drying of a particle\n",
+ "\n",
+ "#(c)Commercial-scale dryer\n",
+ "W1 = Fo1*tbar\n",
+ "Atguess = 5#Guess value of area\n",
+ "def solver_func3(At): #Function defined for solving the system\n",
+ " return At*uo*rhog*Cpg*(Tgi-Te)-Fo1*(Qfi-Qfbar)*(L+Cpl*(Te-Tsi))-Fo1*Cps*(Te-Tsi)\n",
+ "\n",
+ "At = fsolve(solver_func3,Atguess)\n",
+ "dt1 = math.sqrt(4/pi*At)#Diameter of commercial-scale dryer\n",
+ "Q1 = At*uo*rhog#Flow rate necessary for the operation\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Bed temperature:%f degree C'%(Te)\n",
+ "print 'Time for complete drying of particle:%fs'%(tou)\n",
+ "print 'Flow rate of gas necessary for Commercial-scale dryer:%fkg/s'%(Q1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bed temperature:58.728126 degree C\n",
+ "Time for complete drying of particle:527.431202s\n",
+ "Flow rate of gas necessary for Commercial-scale dryer:3.098684kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 425\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solvent Recovery from Polymer Particles\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "rhos=1600.; #Density of solid in kg/m**3\n",
+ "Cps=1.25; #Specific heat of solids in kJ/kg K\n",
+ "Fo=0.5; #Flow rate of solids in kg/s\n",
+ "Tsi=20.; #Inital temperature of solids in degree C\n",
+ "Qwi=1.; #Initial moisture fraction in water\n",
+ "Qwf=0.2; #Final moisture fraction in water\n",
+ "Qhi=1.1; #Initial moisture fraction in heptane\n",
+ "Qhf=0.1; #Final moisture fraction in heptane\n",
+ "Tgi=240.; #Initial temperature of gas in degee C\n",
+ "Te=110.; #Bed temperature in degree C\n",
+ "ephsilonm=0.45; #Void fraction of fixed bed\n",
+ "ephsilonf=0.75; #Void fraction of fluidized bed\n",
+ "uo=0.6; #Superficial gas velocity in m/s\n",
+ "di=0.08; #Diameter of tubes in m\n",
+ "li=0.2; #Pitch for square arrangement\n",
+ "hw=400.; #Heat transfer coefficient in W/m**2 K\n",
+ "Tc=238.; #Temperature at which steam condenses in degree C\n",
+ "#Specific heats in kJ/kg K\n",
+ "Cwl=4.18; #Water liquid\n",
+ "Cwv=1.92; #Water vapor\n",
+ "Chl=2.05; #Heptane liquid\n",
+ "Chv=1.67; #Heptane vapor\n",
+ "#Latent heat of vaporization in kJ/kg\n",
+ "Lw=2260.; #Water\n",
+ "Lh=326.; #Heptane\n",
+ "#Density of vapor in kg/m**3 at operating conditions\n",
+ "rhow=0.56; #Water\n",
+ "rhoh=3.1; #Heptane\n",
+ "Lf=1.5; #Length of fixed bed in m\n",
+ "t=140.; #Half-life of heptane in s\n",
+ "L=1.5; #Length of tubes in heat exchanger\n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#(a) Dryer without Internals\n",
+ "xw=(Qwi-Qwf)/(Qhi-Qhf); #Water-heptane weight ratio\n",
+ "xv=((Qwi-Qwf)/18.)/((Qhi-Qhf)/100.); #Water-heptane volume ratio\n",
+ "T=(Qwi-Qwf)/18.+(Qhi-Qhf)/100.; #Total volume\n",
+ "rhogbar=((Qwi-Qwf)/18.)/T*rhow+((Qhi-Qhf)/100.)/T*rhoh; #Mean density of the vapor mixture\n",
+ "Cpgbar=(((Qwi-Qwf)/18.)/T)*rhow*Cwv+(((Qhi-Qhf)/100.)/T)*rhoh*Cwv;#Mean specific heat of vapor mixture\n",
+ "#Volumetric flow of recycle gas to the dryer in m**3/s from Eqn.(53)\n",
+ "x=(Cpgbar*(Tgi-Te))**-1*(Fo*(Qwi-Qwf)*(Lw+Cwl*(Te-Tsi))+Fo*(Qhi-Qhf)*(Lh+Chl*(Te-Tsi))+Fo*(Cps*(Te-Tsi)));\n",
+ "r=Fo*((Qwi-Qwf)/rhow+(Qhi-Qhf)/rhoh); #Rate of formation of vapor in bed\n",
+ "uo1=uo*(x/(x+r)); #Superficial velocity just above the distributor\n",
+ "At=x/uo1; #Cross-sectional area of bed\n",
+ "dt=math.sqrt(4./pi*At); #Diameter of bed\n",
+ "B=-math.log(Qwf/Qwi)/t; #Bed height from Eqn.(63)\n",
+ "tbar=((Qhi/Qhf)-1)/B; #Mean residence time of solids\n",
+ "W=Fo*tbar; #Weight of bed\n",
+ "Lm=W/(At*(1-ephsilonm)*rhos); #Static bed height\n",
+ "Lf=(Lm*(1-ephsilonm))/(1-ephsilonf); #Height of fluidized bed\n",
+ "\n",
+ "#(b) Dryer with internal heaters\n",
+ "f=1/8.0; #Flow rate is 1/8th the flow rate of recirculation gas as in part (a)\n",
+ "x1=f*x; #Volumetric flow of recycle gas to the dryer in m**3/s from Eqn.(53)\n",
+ "uo2=uo*(x1/float(x1+r)); #Superficial velocity just above the distributor\n",
+ "Abed=x1/uo2; #Cross-sectional area of bed\n",
+ "q=(Fo*(Qwi-Qwf)*(Lw+Cwl*(Te-Tsi))+Fo*(Qhi-Qhf)*(Lh+Chl*(Te-Tsi))+Fo*(Cps*(Te-Tsi)))-Abed*uo2*Cpgbar*(Tgi-Te);#Heat to be added from energy balance of Eqn.(53)\n",
+ "Aw=q*10**3/(hw*(Tc-Te));#Total surface area of heat exchanger tubes\n",
+ "Lt=Aw/(pi*di); #Total length of tubes\n",
+ "Nt=Lt/L; #Total number of tubes\n",
+ "Atubes=Nt*(pi/4*di**2); #Total cross-sectional area of tubes\n",
+ "Atotal=Abed+Atubes; #Total cross-sectional area of tube filled dryer\n",
+ "d=math.sqrt(Atotal*pi/4.);#Diameter of vessel\n",
+ "li=math.sqrt(Atotal/Nt); #Pitch for square array of tubes\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\t\\t\\tBed diameter(m)\\tRecycle vapor flow(m**3/s)'\n",
+ "print 'Without internal heater\\t%f\\t%f'%(dt,x)\n",
+ "print 'With heating tubes\\t%f\\t%f'%(d,x1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\tBed diameter(m)\tRecycle vapor flow(m**3/s)\n",
+ "Without internal heater\t3.630144\t5.331235\n",
+ "With heating tubes\t1.503916\t0.666404\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch17.ipynb b/Fluidization_Engineering/ch17.ipynb
new file mode 100644
index 00000000..a51249d4
--- /dev/null
+++ b/Fluidization_Engineering/ch17.ipynb
@@ -0,0 +1,451 @@
+{
+ "metadata": {
+ "name": "ch17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 : Design of Catalytic Reactors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 434\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reactor Development Program\n",
+ "\n",
+ "#Variable Declaration\n",
+ "dt=[0.081,0.205,3.6]; #Reactor diameter for the three reactors in m\n",
+ "dte=[0.04,0.12,0.70]; #Equivalent diameters for the three reactors in m\n",
+ "db=[0.05,0.057,0.07]; #Estimated bubble size in the three reactors in m\n",
+ "Kr1=1.3889; #Kinet1ic constant for Reaction 1 in s**-1\n",
+ "Kr2=0.6111; #Kinetic constant for Reaction 2 in s**-1\n",
+ "Kr3=0.022; #Kinetic constant for Reaction 3 in s**-1\n",
+ "dp=60.; #Particle size in micrometer\n",
+ "ephsilonm=0.50; #Void fraction of fixed bed\n",
+ "ephsilonmf=0.55; #Void fraction at minimum fluidized condition\n",
+ "umf=0.006; #Velocity at minimum fluidization condition in m/s\n",
+ "D=2E-5; #Diffusion coefficient of gas in m**2/s\n",
+ "gammab=0.005; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "uo=0.2; #Superficial gas velocity in m/s\n",
+ "XA=0.9; #Conversion\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "Kr12=Kr1+Kr2;\n",
+ "n=len(dt);\n",
+ "i=0;\n",
+ "ubr = [0,0,0]\n",
+ "ub = [0,0,0]\n",
+ "delta = [0,0,0]\n",
+ "ephsilonf = [0,0,0]\n",
+ "gammac = [0,0,0]\n",
+ "gammae = [0,0,0]\n",
+ "Kbc = [0,0,0]\n",
+ "Kce = [0,0,0]\n",
+ "Kf12 = [0,0,0]\n",
+ "Kf3 = [0,0,0]\n",
+ "KfA = [0,0,0]\n",
+ "KfAR = [0,0,0]\n",
+ "KfAR1 = [0,0,0]\n",
+ "tou = [0,0,0]\n",
+ "y = [0,0,0]\n",
+ "SR = [0,0,0]\n",
+ "XA1 = [0,0,0]\n",
+ "y1 = [0,0,0]\n",
+ "y2 = [0,0,0]\n",
+ "tou2 = [0,0,0]\n",
+ "Lf = [0,0,0]\n",
+ "Lm = [0,0,0]\n",
+ "XA2 = [0,0,0]\n",
+ "\n",
+ "import math\n",
+ "while i<n:\n",
+ " #Preliminary Calcualtions\n",
+ " ubr[i]=0.711*(g*db[i])**0.5;#Rise velocity of bubble from Eqn.(6.7)\n",
+ " ub[i]=1.55*((uo-umf)+14.1*(db[i]+0.005))*dte[i]**0.32+ubr[i];#Bubble velocity for Geldart A particles from Equation from Eqn.(6.11)\n",
+ " delta[i]=uo/ub[i];#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ " ephsilonf[i]=1-(1-delta[i])*(1-ephsilonmf);#Void fraction of fixed bed from Eqn.(6.20)\n",
+ " fw=0.6;#Wake volume to bubble volume from Fig.(5.8)\n",
+ " gammac[i]=(1-ephsilonmf)*((3/(ubr[i]*ephsilonmf/umf-1))+fw);#Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
+ " gammae[i]=((1-ephsilonmf)*((1-delta[i])/delta[i]))-gammab-gammac[i];#Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
+ " Kbc[i]=4.5*(umf/db[i])+5.85*((D**0.5*g**0.25)/db[i]**(5/4));#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ " Kce[i]=6.77*((D*ephsilonmf*0.711*(g*db[i])**0.5)/db[i]**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ " #Effective rate constant from Eqn.(12.32)\n",
+ " Kf12[i]=(gammab*Kr12+1/((1/Kbc[i])+(1/(gammac[i]*Kr12+1/((1/Kce[i])+(1/(gammae[i]*Kr12)))))))*(delta[i]/(1-ephsilonf[i]));\n",
+ " #Rate of reaction 2 for fluidized bed from Eqn.(12.14)\n",
+ " Kf3[i]=(gammab*Kr3+1/((1/Kbc[i])+(1/(gammac[i]*Kr3+1/((1/Kce[i])+(1/(gammae[i]*Kr3)))))))*(delta[i]/(1-ephsilonf[i]));\n",
+ " #Rate of raection with respect to A from Eqn.(12.35)\n",
+ " KfA[i]=((Kbc[i]*Kce[i]/gammac[i]**2+(Kr12+Kce[i]/gammac[i]+Kce[i]/ \\\n",
+ " gammae[i])*(Kr3+Kce[i]/gammac[i]+Kce[i]/gammae[i]))*delta[i]*Kbc[i] \\\n",
+ " *Kr12*Kr3/(1-ephsilonf[i]))/(((Kr12+Kbc[i]/gammac[i])* \\\n",
+ " (Kr12+Kce[i]/gammae[i])+Kr12*Kce[i]/gammac[i])*((Kr3+Kbc[i]/gammac[i])* \\\n",
+ " (Kr3+Kce[i]/gammae[i])+Kr3*Kce[i]/gammac[i]));\n",
+ " KfAR[i]=((Kr1/Kr12)*Kf12[i])-KfA[i];#Rate of reaction from Eqn.(12.34)\n",
+ " KfAR1[i]=((Kr1/Kr12)*Kf12[i]);#Since KfA is small\n",
+ " #(b)Relate Selectivity with conversion in three reactors\n",
+ " x=-math.log(1-XA);#The term Kf12*tou in Eqn.(12.26)\n",
+ " tou[i]=x/Kf12[i];#Residence time from Eqn.(12.26)\n",
+ " y[i]=(KfAR1[i]/(Kf3[i]-Kf12[i]))*(math.exp(-x)-math.exp(-tou[i]*Kf3[i]));#CR/CAi from Eqn.(12.27)\n",
+ " SR[i]=y[i]/XA;#Selectivity of R\n",
+ " #(c)Relate exit composition to space time\n",
+ " tou1=5;#Space time in s\n",
+ " XA1[i]=1-math.exp(-Kf12[i]*tou1);#Conversion from Eqn.(12.26)\n",
+ " y1[i]=((KfAR1[i]/(Kf12[i]-Kf3[i]))*(math.exp(-Kf3[i]*tou1)-math.exp(-Kf12[i]*tou1)));#CR/CAi R from Eqn.(12.27)\n",
+ " #(d)Calculate height of bed needed to maximize production\n",
+ " y2[i]=(KfAR1[i]/Kf12[i])*(Kf12[i]/Kf3[i])**(Kf3[i]/(Kf3[i]-Kf12[i]));#CRmax/CAi R from Eqn.(12.37)\n",
+ " tou2[i]=math.log(Kf3[i]/Kf12[i])/(Kf3[i]-Kf12[i]);#Space time from Eqn.(38)\n",
+ " Lf[i]=(uo/(1-ephsilonf[i]))*tou2[i];#Length of bed at fully fluidized condition from Eqn.(12.5)\n",
+ " Lm[i]=Lf[i]*(1-ephsilonf[i])/(1-ephsilonm);#Length of bed when settled\n",
+ " XA2[i]=1-math.exp(-Kf12[i]*tou2[i]);#Conversion from Eqn.(12.26)\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Let Laboratory, Pilot plant, Semicommercial unit be Reactor 1,2 & 3 respectively'\n",
+ "print '(a)Relation between effective rate constant(Kf12) to the gas flow rate(uo)',\n",
+ "print '\\tReactor No.\\tKf12(s**-1)\\tuo(m/s)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%1.0f'%i\n",
+ " print '\\t\\t%f'%Kf12[i],\n",
+ " print '\\t%f'%uo\n",
+ " i=i+1;\n",
+ "\n",
+ "print '\\n(b)Relation between selectivity with conversion'\n",
+ "print '\\n\\tReactor No.\\tKf12(s**-1)\\tSR(mol R formed/mol A reacted)'\n",
+ "i=0\n",
+ "while i<n:\n",
+ " print '\\t%1.0f'%i,\n",
+ " print '\\t\\t%f'%Kf12[i],\n",
+ " print '\\t%f'%SR[i]\n",
+ " i=i+1;\n",
+ "\n",
+ "print '(c)Relation between exit compostion and space time',\n",
+ "print '\\tReactor No.\\tXA\\t\\tCR/CAi'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%1.0f'%i,\n",
+ " print '\\t\\t%f'%XA1[i],\n",
+ " print '\\t%f'%y1[i]\n",
+ " i=i+1;\n",
+ "\n",
+ "print '(d)Height of bed needed to maximize the production of acrylonitrile',\n",
+ "print '\\tReactor No.\\tLm(m)\\t\\tXA'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%1.0f'%i,\n",
+ " print '\\t\\t%f'%Lm[i],\n",
+ " print '\\t%f'%XA2[i]\n",
+ " i=i+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let Laboratory, Pilot plant, Semicommercial unit be Reactor 1,2 & 3 respectively\n",
+ "(a)Relation between effective rate constant(Kf12) to the gas flow rate(uo) \tReactor No.\tKf12(s**-1)\tuo(m/s)\n",
+ "\t0\n",
+ "\t\t0.410042 \t0.200000\n",
+ "\t1\n",
+ "\t\t0.270620 \t0.200000\n",
+ "\t2\n",
+ "\t\t0.128980 \t0.200000\n",
+ "\n",
+ "(b)Relation between selectivity with conversion\n",
+ "\n",
+ "\tReactor No.\tKf12(s**-1)\tSR(mol R formed/mol A reacted)\n",
+ "\t0 \t\t0.410042 \t0.641507\n",
+ "\t1 \t\t0.270620 \t0.618358\n",
+ "\t2 \t\t0.128980 \t0.558283\n",
+ "(c)Relation between exit compostion and space time \tReactor No.\tXA\t\tCR/CAi\n",
+ "\t0 \t\t0.871292 \t0.564802\n",
+ "\t1 \t\t0.741562 \t0.484243\n",
+ "\t2 \t\t0.475286 \t0.313823\n",
+ "(d)Height of bed needed to maximize the production of acrylonitrile \tReactor No.\tLm(m)\t\tXA\n",
+ "\t0 \t\t3.056064 \t0.956404\n",
+ "\t1 \t\t4.137401 \t0.939139\n",
+ "\t2 \t\t7.049378 \t0.897005\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 438\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design of a Commercial Acrylonitrile Reactor\n",
+ "\n",
+ "#Variable Declaration\n",
+ "deltaHr=5.15E8; #Heat of reaction in J/k mol\n",
+ "W=5E4; #Weight of acrylonitirle produced per 334-day year in tonnes\n",
+ "db=0.07; #Estimated bubble size in m\n",
+ "dte=0.7; #Equivalent diameter in m\n",
+ "Kf12=0.35; #Effective rate constant in s**-1 from Example 1\n",
+ "dp=60; #Particle size in micrometer\n",
+ "ephsilonm=0.50; #Void fraction of fixed bed\n",
+ "ephsilonmf=0.55;#Void fraction at minimum fluidized condition\n",
+ "T=460; #Temperature in reactor in degree C\n",
+ "Pr=2.5; #Pressure inside reactor in bar\n",
+ "#Feed gas composition\n",
+ "x1=1; #Propylene\n",
+ "x2=1.1; #Ammonia\n",
+ "x3=11; #Air\n",
+ "do1=0.08; #OD of heat exchanger tubes in m\\\n",
+ "L=7; #Length of tubes in m\n",
+ "ho=300; #Outside heat transfer coefficient in W/m**2 K\n",
+ "hi=1800; #Inside heat transfer coefficient in W/m**2 K\n",
+ "Tc=253.4; #Temperature of coolant in degree C\n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Preliminary calculation\n",
+ "uo=0.46;#Superficial gas velocity from Fig.E1(a) for the value of Kf12 & db\n",
+ "tou=8;#Space time from Fig.E2(b) for highest concentraion of product R\n",
+ "Lm=uo*tou/(1-ephsilonm);\n",
+ "y=0.58;#CR/CAi from Fig.E1(c) for the value of tou & Kf12\n",
+ "XA=0.95#From Fig.E1(c) for the value of tou & Kf12\n",
+ "SR=y/XA;#Selectivity of R\n",
+ "\n",
+ "#Cross-sectional area of the reactor\n",
+ "P=W*10**3/(334*24*3600);#Production rate of acrylonitrile\n",
+ "F=(P/0.053)/(SR*XA/0.042);#Feed rate of propylene\n",
+ "V=((F*22.4*(T+273)*(x1+x2+x3))/(42*273*Pr));\n",
+ "At=V/uo;#Cross-sectional area of reactor needed for the fluidized bed\n",
+ "\n",
+ "#Heat exchanger calculation\n",
+ "q=F*XA*deltaHr/42;#Rate of heat liberation in the reactor\n",
+ "U=(ho**-1+hi**-1)**-1;#Overall heat transfer coefficient\n",
+ "deltaT=T-Tc;#Driving force for heat transfer\n",
+ "Aw=q/(U*deltaT);#Heat exchanger area required to remove q\n",
+ "Nt=Aw/(pi*do1*L);\n",
+ "li1=(At/Nt)**0.5;#Pitch for square pitch arrangement\n",
+ "dte1=4*(li1**2-(pi/4)*do1**2)/(pi*do1);\n",
+ "if dte1>dte:\n",
+ " li=(pi/4*dte*do1+pi/4*do1**2)**0.5;#Pitch if we add dummy tubes\n",
+ "import math\n",
+ "f=li**2-pi/4*do1**2;#Fraction of bed cross section taken up by tubes\n",
+ "dt1=math.sqrt(4/pi*At/(1-f));#Reactor diameter including all its tubes\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Superficial gas velocity=%fm/s'%uo\n",
+ "print 'No. of %1.0fm tubes required=%1.0f'%(L,Nt);\n",
+ "print 'Reactor diameter=%fm'%dt1\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Superficial gas velocity=0.460000m/s\n",
+ "No. of 7m tubes required=295\n",
+ "Reactor diameter=7.173176m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 444\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reactor-Regenerator with Circulating Catalyst: Catalytic Cracking\n",
+ "\n",
+ "#Variable Declaration\n",
+ "db=0.08; #Estimated bubble size in m\n",
+ "dte=2; #Equivalent diameter in m\n",
+ "F1=55.6; #Feed rate of oil in kg/s\n",
+ "XA=0.63; #Conversion\n",
+ "uo=0.6; #Superficial gas velocity in m/s\n",
+ "T1=500.0; #Temperature of reactor in degree C\n",
+ "T2=580.0; #Temperature of regenerator in degree C\n",
+ "Fs=F1*23.3; #Solid circulation rate from Ex.(15.2)\n",
+ "rhos=1200.0; #Density of catalyst in kg/m**3\n",
+ "dpbar=60.0; #Average particle size in micrometer\n",
+ "ephsilonm=0.50;#Void fraction of fixed bed\n",
+ "ephsilonmf=0.55;#Void fraction at minimum fluidized condition\n",
+ "umf=0.006; #Velocity at minimum fluidization condition in m/s\n",
+ "dt=8.0; #Diameter of reactor in m\n",
+ "D=2E-5; #Diffusion coefficient of gas in m**2/s\n",
+ "Kr=8.6; #Rate constant for reaction at 500 degree C in s**-1\n",
+ "Ka1=0.06; #Rate constant for deactivatiion at 500 degree C in s**-1\n",
+ "Ka2=0.012; #Rate constant for regeneration at 580 degree C in s**-1\n",
+ "gammab=0.005; #Ratio of volume of dispersed solids to that of bubble phase\n",
+ "g=9.81; #Acceleration due to gravity in square m/s**2\n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Parameters for the fluidized reactor\n",
+ "ubr=0.711*(g*db)**0.5;#Rise velocity of bubble from Eqn.(6.7)\n",
+ "ub=1.55*((uo-umf)+14.1*(db+0.005))*dte**0.32+ubr;#Bubble velocity for Geldart A particles from Equation from Eqn.(6.11)\n",
+ "delta=uo/ub;#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ "ephsilonf=1-(1-delta)*(1-ephsilonmf);#Void fraction of fixed bed from Eqn.(6.20)\n",
+ "fw=0.6;#Wake volume to bubble volume from Fig.(5.8)\n",
+ "gammac=(1-ephsilonmf)*((3/(ubr*ephsilonmf/umf-1))+fw);#Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
+ "gammae=((1-ephsilonmf)*((1-delta)/delta))-gammab-gammac;#Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
+ "Kbc=4.5*(umf/db)+5.85*((D**0.5*g**0.25)/db**(5.0/4));#Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "Kce=6.77*((D*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;#Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ "import math\n",
+ "#Bed height versus catalyst activity in reactor\n",
+ "a1bar=0.07;#Guess value for average activity in reactor\n",
+ "x=Kr*a1bar;#Value of Kra1 to be used in the following equation\n",
+ "Kf=(gammab*x+1/((1/Kbc)+(1/(gammac*x+1/((1/Kce)+(1/(gammae*x)))))))*(delta/(1-ephsilonf));#Effective rate constant from Eqn.(12.14)\n",
+ "tou=-math.log(1-XA)/Kf;#Space time from Eqn.(12.16)\n",
+ "Lm=tou*uo/(1-ephsilonm);#Length of fixed bed for guess value of a1bar\n",
+ "a1bar1=[0.0233,0.0465,0.0698,0.0930,0.116,0.140];#Various activity values to find Lm\n",
+ "x1 = [0,0,0,0,0,0]\n",
+ "Kf1 = [0,0,0,0,0,0]\n",
+ "tou1 = [0,0,0,0,0,0]\n",
+ "Lm1 = [0,0,0,0,0,0]\n",
+ "\n",
+ "n=len(a1bar1);\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " x1[i]=Kr*a1bar1[i];\n",
+ " Kf1[i]=(gammab*x1[i]+1/((1/Kbc)+(1/(gammac*x1[i]+1/((1/Kce)+ \\\n",
+ " (1/(gammae*x1[i])))))))*(delta/(1-ephsilonf));\n",
+ " #Effective rate constant from Eqn.(12.14)\n",
+ " \n",
+ " tou1[i]=-math.log(1-XA)/Kf1[i];#Space time from Eqn.(12.16)\n",
+ " Lm1[i]=tou1[i]*uo/(1-ephsilonm);\n",
+ " #Length of fixed bed for guess value of a1bar...Condition [i]\n",
+ " i=i+1;\n",
+ "\n",
+ "#Find the optimum size ratio for various a1bar\n",
+ "Lm=[5,6,7,8,10,12];\n",
+ "W1 = [0,0,0,0,0,0]\n",
+ "t1bar = [0,0,0,0,0,0]\n",
+ "t2bar = [0,0,0,0,0,0]\n",
+ "a1bar2 = [0,0,0,0,0,0]\n",
+ "m=len(Lm);\n",
+ "i=0;\n",
+ "while i<m:\n",
+ " W1[i]=(pi/4)*dt**2*rhos*(1-ephsilonm)*Lm[i];#Bed weight\n",
+ " t1bar[i]=W1[i]/Fs;#Mean residence time of solids in reactor\n",
+ " t2bar[i]=t1bar[i]*(Ka1/Ka2)**0.5;#Mean residence time of soilds at optimum from Eqn.(16)\n",
+ " a1bar2[i]=(Ka2*t2bar[i])/(Ka1*t1bar[i]+Ka1*t1bar[i]*Ka2*t2bar[i]+Ka2*t2bar[i]);#From Eqn.(15)...Condition (ii)\n",
+ " i=i+1;\n",
+ "\n",
+ "#Final design values\n",
+ "Lm4=7.3;#For satisfying condition [i] & (ii)\n",
+ "a1bar3=0.0744;#By interpolation\n",
+ "x2=a1bar3*Kr;\n",
+ "W11=(pi/4)*dt**2*rhos*(1-ephsilonm)*Lm4;#Bed weight for reactor\n",
+ "t1bar1=W11/Fs;#Mean residence time of solids in reactor\n",
+ "a2bar=(1+Ka1*t1bar1)*a1bar3;#Average activity in regenrator from Eqn.(10)\n",
+ "t2bar1=t1bar1*(Ka1/Ka2)**0.5;#Mean residence time of solids in regenerator from Eqn.(16)\n",
+ "W2=W11*(t2bar1/t1bar1);#Bed weight for regenerator\n",
+ "dt2=dt*(W2/W11)**0.5;#Diameter of regenerator assuming same static bed height for reactor and regerator\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Bed height versus catalyst activity in reactor'\n",
+ "print '\\tAverage activity',\n",
+ "print '\\tLength of fixed bed(m)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%f'%a1bar1[i],\n",
+ " print '\\t\\t%f'%Lm1[i];\n",
+ " i=i+1;\n",
+ "\n",
+ "print 'Optimum size ratio for various activity in reactor'\n",
+ "print '\\tLength of fixed bed(m)',\n",
+ "print '\\tAverage activity'\n",
+ "i=0\n",
+ "while i<m:\n",
+ " print '\\t%f'%Lm[i],\n",
+ " print '\\t\\t%f'%a1bar2[i]\n",
+ " i=i+1;\n",
+ "\n",
+ "print 'Final design values'\n",
+ "print '\\tDiameter of reactor(m):%.0f'%dt\n",
+ "print '\\tBed weight for reactor(tons):%.0f'%(W11/10**3)\n",
+ "print '\\tBed weight for regenerator(tons):%.0f'%(W2/10**3)\n",
+ "print '\\tDiameter of regenerator(m):%.0f'%(dt2);\n",
+ "print '\\tSolid circulation rate(tons/hr):%f'%(Fs*3.6);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bed height versus catalyst activity in reactor\n",
+ "\tAverage activity \tLength of fixed bed(m)\n",
+ "\t0.023300 \t\t11.059747\n",
+ "\t0.046500 \t\t7.911053\n",
+ "\t0.069800 \t\t6.756202\n",
+ "\t0.093000 \t\t6.118750\n",
+ "\t0.116000 \t\t5.696470\n",
+ "\t0.140000 \t\t5.372072\n",
+ "Optimum size ratio for various activity in reactor\n",
+ "\tLength of fixed bed(m) \tAverage activity\n",
+ "\t5.000000 \t\t0.097879\n",
+ "\t6.000000 \t\t0.086112\n",
+ "\t7.000000 \t\t0.076871\n",
+ "\t8.000000 \t\t0.069420\n",
+ "\t10.000000 \t\t0.058149\n",
+ "\t12.000000 \t\t0.050026\n",
+ "Final design values\n",
+ "\tDiameter of reactor(m):8\n",
+ "\tBed weight for reactor(tons):220\n",
+ "\tBed weight for regenerator(tons):492\n",
+ "\tDiameter of regenerator(m):12\n",
+ "\tSolid circulation rate(tons/hr):4663.728000\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch18.ipynb b/Fluidization_Engineering/ch18.ipynb
new file mode 100644
index 00000000..6826590f
--- /dev/null
+++ b/Fluidization_Engineering/ch18.ipynb
@@ -0,0 +1,573 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : The Design of Noncatalytic Gas Solid Reactors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 456\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Kinetics of Zinc Blende Roasting\n",
+ "\n",
+ "#Variable Declaration\n",
+ "xA=0.08; #Fraction of oxygen in stream\n",
+ "dp=[2,0.1]; #Particle diameter in mm\n",
+ "rhos=4130; #Density of catalyst in kg/m**3\n",
+ "Ds=8E-6; #Diffusion coefficient of solid in m**2/s\n",
+ "kc=0.02; #Reaction rate constant in m/s\n",
+ "P=10**5; #Pressure in bar\\\n",
+ "R=8.314; #Universal gas constant\n",
+ "T=900; #Temperature in degree C\n",
+ "mB=0.09745; #Molecular weight of ZnS in kg/mol\n",
+ "\n",
+ "#CALCULATION\n",
+ "b=2.0/3;#Stoichiometric coefficient of ZnS in the reaction equation\n",
+ "CA=xA*P/(R*(T+273));#Concentration of Oxygen\n",
+ "rhob=rhos/mB; #Molar density of pure solid\n",
+ "n=len(dp);\n",
+ "i=0;\n",
+ "kbar = [0,0]\n",
+ "tou = [0,0]\n",
+ "while i<n:\n",
+ " kbar[i]=(kc**-1+(dp[i]*10**-3/(12.0*Ds)))**-1;#Average reaction rate constant from Eqn.(11)\n",
+ " tou[i]=rhob*dp[i]*10**-3/(2*b*kbar[i]*CA);#Time for complete reaction in seconds from Eqn.(9)\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Particle Size(mm)\\tAverage rate constant(m/s)\\tTime for complete reaction(min)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f\\t\\t%f\\t\\t\\t%.2f'%(dp[i],kbar[i],tou[i]/60.0);\n",
+ " i=i+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Particle Size(mm)\tAverage rate constant(m/s)\tTime for complete reaction(min)\n",
+ "2.000000\t\t0.014118\t\t\t91.49\n",
+ "0.100000\t\t0.019592\t\t\t3.30\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 457\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Kinetics of Carbon Burning\n",
+ "\n",
+ "#Variable Declaration\n",
+ "xA=0.08; #Fraction of oxygen in stream\n",
+ "dp=1; #Particle diameter in mm\n",
+ "rhos=2200; #Density of catalyst in kg/m**3\n",
+ "kc=0.2; #Reaction rate constant in m/s\n",
+ "mC=0.012; #Molecular weight of carbon in kg/mol\n",
+ "P=10**5; #Pressure in bar\\\n",
+ "R=8.314; #Universal gas constant\n",
+ "T=900; #Temperature in degree C\n",
+ "\n",
+ "#CALCULATION\n",
+ "b=1;#Stoichiometric coefficient of C in the reaction equation\n",
+ "CA=xA*P/(R*(T+273));#Concentration of Oxygen\n",
+ "rhob=rhos/mC;#Molar density of pure solid reactant\n",
+ "tou=rhob*10**-3/(2*b*kc*CA);#Time required for complete reaction in seconds\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The time required for complete combustion:%.1fmins'%(tou/60);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time required for complete combustion:9.3mins\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 462\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from numpy import zeros\n",
+ "\n",
+ "\n",
+ "#INPUT\n",
+ "dp = 110.;#Particle size in micrometer\n",
+ "T = 900.;#Temperature of roaster in degree C\n",
+ "tbar1 = [3.,10.,30.,50.];#Reported average time in min\n",
+ "XBbarr = [0.840,0.940,0.985,0.990];#Reported value of average conversion\n",
+ "tbar = 3.;\n",
+ "XBbar = 0.840;#Average conversion for tbar = 3 mins\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Uniform-Reaction Model\n",
+ "x = (1./tbar)*(1./(1-XBbar)-1);#Term KrCA of Eqn.(20)\n",
+ "n = len(tbar1);\n",
+ "i = 0;\n",
+ "XBbar1 = zeros(n)\n",
+ "while i< n:\n",
+ " XBbar1[i] = 1-1./(1+x*tbar1[i]);#Average conversion umath.sing calculated value of KrCA from Eqn.(20)\n",
+ " i = i+1;\n",
+ "\n",
+ "#Shrinking-Core, Rection Control\n",
+ "touguess = 2;#Guess value of tou\n",
+ "def solver_func(tou):#Function defined for solving the system\n",
+ " return (1-XBbar)-(0.25*tou/tbar)+(0.05*(tou/tbar)**2)-((1./120)*(tou/tbar)**3);\n",
+ "\n",
+ "tou = fsolve(solver_func,touguess)\n",
+ "i = 0;\n",
+ "XBbar2 = zeros(n)\n",
+ "while i<n:\n",
+ " XBbar2[i] = 1-(0.25*tou/tbar1[i])+(0.05*(tou/tbar1[i])**2)-((1./120)*(tou/tbar1[i])**3);#Average conversion umath.sing calculated value of tou from Eqn.(23)\n",
+ " i = i+1;\n",
+ "\n",
+ "#Shrinking-Core, Diffusion Control\n",
+ "touguess1 = 2;#Guess value of tou\n",
+ "def solver_func1(tou): #Function defined for solving the system\n",
+ " fn = (1-XBbar)-(1./5*tou/tbar)+(19./420*(tou/tbar)**2)-(41./4620*(tou/tbar)**3)+(0.00149*(tou/tbar)**4);\n",
+ "\n",
+ "tou1 = fsolve(solver_func1,touguess1)\n",
+ "i = 0;\n",
+ "XBbar3 = zeros(n)\n",
+ "while i< n:\n",
+ " #Average conversion umath.sing calculated value of tou from Eqn.(23)\n",
+ " XBbar3[i] = 1-(1./5*tou1/tbar1[i])+(19./420*(tou1/tbar1[i])**2)-(41./4620*(tou1/tbar1[i])**3)+(0.00149*(tou1/tbar)**4);\n",
+ " i = i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\t\\t\\t\\tXBbar calculated for Models';\n",
+ "print 'Reported Data';\n",
+ "print 'tbarmin)\\tXBbar\\tUniform Reaction\\tShrinking-Core%( Rection Control\\t\\tShrinking-Core, Diffusion Control'\n",
+ "i = 0\n",
+ "while i< n:\n",
+ " print '%f\\t%f\\t%f\\t\\t%f\\t\\t\\t\\t%f'%(tbar1[i],XBbarr[i],XBbar1[i],XBbar2[i],XBbar3[i]);\n",
+ " i = i+1;\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\t\t\tXBbar calculated for Models\n",
+ "Reported Data\n",
+ "tbarmin)\tXBbar\tUniform Reaction\tShrinking-Core%( Rection Control\t\tShrinking-Core, Diffusion Control\n",
+ "3.000000\t0.840000\t0.840000\t\t0.840000\t\t\t\t0.884437\n",
+ "10.000000\t0.940000\t0.945946\t\t0.947234\t\t\t\t0.962033\n",
+ "30.000000\t0.985000\t0.981308\t\t0.981898\t\t\t\t0.987159\n",
+ "50.000000\t0.990000\t0.988701\t\t0.989075\t\t\t\t0.992366\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 462\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from numpy import zeros\n",
+ "\n",
+ "\n",
+ "#INPUT\n",
+ "W = 1; #Bed weight in kg\n",
+ "F1 = 0.01; #Solid feed rate in kg/min\n",
+ "dp = [200.,600.]; #Particle size in micrometer\n",
+ "XBbar = [0.85,0.64]; #Average conversion for corresponding particle sizes\n",
+ "rhos = 2500.; #Density of solid in kg/m**3\n",
+ "ephsilonm = 0.4; #Void fracton of fixed bed\n",
+ "F11 = 4.; #Feed rate of solids in tons/hr\n",
+ "XBbar1 = 0.98;\n",
+ "dp1 = 600.;\n",
+ "pi = 3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Shrinking-Core, Rection Control\n",
+ "n = len(dp);\n",
+ "i = 0;\n",
+ "touguess = 2;#Guess value of tou\n",
+ "tou = zeros(n)\n",
+ "while i< n:\n",
+ " def solver_func2(t): #Function defined for solving the system\n",
+ " return (1-XBbar[i])-(0.25*t/107)+(0.05*(t/107.)**2)-((1./120)*(t/107.)**3)\n",
+ " tou[i] = fsolve(solver_func2,touguess)\n",
+ " i = i+1;\n",
+ "\n",
+ "tou1 = tou[1];\n",
+ "#For a math.single stage fluidized roaster\n",
+ "tbar1 = 0.25*(tou1/(1-XBbar1))/60.; #Mean residence time of solids in reactor in hr from Eqn.(24)\n",
+ "W1 = F11*tbar1;\n",
+ "dtguess = 2.; #Guess value of tou\n",
+ "def solver_func3(dt): #Function defined for solving the system\n",
+ " return W1*10**3-(pi/4.)*dt**2*0.5*dt*rhos*(1-ephsilonm);#Since Lm = 0.5dt\n",
+ "\n",
+ "dt = fsolve(solver_func3,dtguess)\n",
+ "Lm = dt/2.;#Length of bed required\n",
+ "\n",
+ "#For a two-stage fluidized roaster\n",
+ "tbar2 = tou1*math.sqrt(1./(20*(1-XBbar1)))/60; #Mean residence time of solids in reactor in hr from Eqn.(30)\n",
+ "W2 = F11*tbar2;\n",
+ "dtguess1 = 2; #Guess value of tou\n",
+ "def solver_func4(dt): #Function defined for solving the system\n",
+ " return W2*10**3-(pi/4.)*dt**2*0.5*dt*rhos*(1-ephsilonm); #Since Lm = 0.5dt\n",
+ "\n",
+ "dt1 = fsolve(solver_func4,dtguess)\n",
+ "Lm1 = dt1/2.; #Length of bed required\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Single stage fluidized roaster';\n",
+ "print '\\tWeight of bed needed:%ftons'%(W1);\n",
+ "print '\\tDiameter of reactor:%fm'%(dt);\n",
+ "print '\\tLength of bed:%fm'%(Lm);\n",
+ "print 'Two-stage fluidized roaster';\n",
+ "print '\\tWeight of bed needed:%ftons'%(W2);\n",
+ "print '\\tDiameter of reactor:%fm'%(dt1);\n",
+ "print '\\tLength of bed:%fm'%(Lm1);\n",
+ "print 'These results show that this operation can be accomplished in a math.single bed of %ftons or in two beds of %f tons each.'%(W1,W2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Single stage fluidized roaster\n",
+ "\tWeight of bed needed:174.370805tons\n",
+ "\tDiameter of reactor:6.665728m\n",
+ "\tLength of bed:3.332864m\n",
+ "Two-stage fluidized roaster\n",
+ "\tWeight of bed needed:22.056356tons\n",
+ "\tDiameter of reactor:3.346064m\n",
+ "\tLength of bed:1.673032m\n",
+ "These results show that this operation can be accomplished in a math.single bed of 174.370805tons or in two beds of 22.056356 tons each.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 468\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from numpy import zeros\n",
+ "\n",
+ "#INPUT\n",
+ "T = 900; #Temperature in roaster in degree C\n",
+ "P = 101325; #Pressure in Pa\n",
+ "R = 8.314; #Universal gas consmath.tant\n",
+ "dpbar = 150; #Average particle size in micrometer\n",
+ "rhosbar = 4130; #Average particle density in kg/m**3\n",
+ "kc = 0.015 #Rate consmath.tant in m/s for reaction which follows shrinking core model\n",
+ "Ds = 8E-6; #Diffusion coefficient of solid in m**2/s\n",
+ "uo = 0.6; #Superficial gas velocity in m/s\n",
+ "D = 2.3E-4; #Diffusion coefficient of gas in m**2/s\n",
+ "Lm = 1; #Length of fixed bed in m\n",
+ "dte = 0.4; #Equivalent diameter of bed\n",
+ "umf = 0.025; #Velocity at minimum fluidization condition in m/s\n",
+ "ephsilonm = 0.45; #Void fraction of fixed bed\n",
+ "ephsilonmf = 0.50; #Void fraction at minimum fluidized condition\n",
+ "db = 0.2; #Estimated bubble size in m\n",
+ "gammab = 0.005; #Ratio of volume of print ersed solids to that of bubble phase\n",
+ "Fo = 2; #Feed rate of solids in kg/s\n",
+ "XA = 0.6677; #Conversion of Oxygen\n",
+ "xA = 0.21; #Mole fraction of oxygen in feed\n",
+ "mB = 0.09744; #Molecular weight of ZnS\n",
+ "F = 0.85; #Fraction of open area\n",
+ "g = 9.81; #Acceleration due to gravity in square m/s**2\n",
+ "pi = 3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#(a)Extreme Calculation\n",
+ "a = 3./2;#Stoichiometric coefficient of Oxygen in the reaction equation\n",
+ "At = (Fo/mB)*(a)/(uo*(273./(T+273))*(XA*xA)/0.0224);\n",
+ "dt = math.sqrt(At/F*4/pi);\n",
+ "\n",
+ "#(b)The Three-Step Procedure\n",
+ "#Step 1. Conversion of gas\n",
+ "ubr = 0.711*(g*db)**0.5; #Rise velocity of bubble from Eqn.(6.7)\n",
+ "ub = 1.6*((uo-umf)+1.13*db**0.5)*dte**1.35+ubr; #Bubble rise velocity for Geldart B particle\n",
+ "\n",
+ "delta = uo/ub;#Fraction of bed in bubbles from Eqn.(6.29)\n",
+ "ephsilonf = 1-(1-delta)*(1-ephsilonmf); #Void fraction of fixed bed from Eqn.(6.20)\n",
+ "\n",
+ "fw = 0.15;#Wake volume to bubble volume from Fig.(5.8)\n",
+ "gammac = (1-ephsilonmf)*((3/(ubr*ephsilonmf/umf-1))+fw); #Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
+ "gammae = ((1-ephsilonmf)*((1-delta)/delta))-gammab-gammac; #Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
+ "Kbc = 4.5*(umf/db)+5.85*((D**0.5*g**0.25)/db**(5./4)); #Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
+ "Kce = 6.77*((D*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5; #Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
+ "x = delta*Lm*(1-ephsilonm)/((1-ephsilonf)*uo); #Term Lf/ub of Eqn.(12.16) from Eqn.(6.19)\n",
+ "CAi = xA*P/(R*(T+273)); #Initial concentration of oxygen\n",
+ "\n",
+ "#Step 2.Conversion of solids\n",
+ "rhob = rhosbar/mB; #Density of ZnS\n",
+ "kbar = (kc**-1+(dpbar*10**-6/(12*Ds))**-1)**-1; #Modified rate consmath.tant from Eqn.(11)\n",
+ "tbar = At*Lm*(1-ephsilonm)*rhosbar/Fo; #Mean residence time of solids\n",
+ "Krguess = 2; #Guess value of Kr\n",
+ "def solver_func(Kr): #Function defined for solving the system\n",
+ " Kf = gammab*Kr+1/((1./Kbc)+(1./(gammac*Kr+1/((1./Kce)+(1./(gammae*Kr)))))); #Reaction rate for fluidized bed from Eqn.(14)\n",
+ " XA = 1-math.exp(-x*Kf); #Conversion of oxygen from Eqn.(42)\n",
+ " CAbar = (CAi*XA*uo)/(Kr*Lm*(1-ephsilonm)); #Average concentration of oxygen from Eqn.(43)\n",
+ " tou = rhob*dpbar*10**-6*a/(2*kbar*CAbar); #Time for complete reaction from Eqn.(9)\n",
+ " y = tbar/tou;#Term tbar/tou\n",
+ " XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1/y)); #Average conversion of ZnS from Eqn.(22)\n",
+ " #Step 3. Material balance of both streams\n",
+ " return (Fo/mB)*XBbar-(At*uo*CAi*XA/a); #From Eqn.(44b)\n",
+ "\n",
+ "Kr = fsolve(solver_func,Krguess)\n",
+ "Kf = gammab*Kr+1/((1/Kbc)+(1/(gammac*Kr+1/((1/Kce)+(1/(gammae*Kr)))))); #Reaction rate for fluidized bed from Eqn.(14)\n",
+ "XA = 1-math.exp(-x*Kf); #Conversion of oxygen from Eqn.(42)\n",
+ "CAbar = (CAi*XA*uo)/(Kr*Lm*(1-ephsilonmf)); #Average concentration of oxygen from Eqn.(43)\n",
+ "tou = rhob*dpbar*10**-6*a/(2*kbar*CAbar); #Time for complete reaction from Eqn.(9)\n",
+ "y = tbar/tou; #Term tbar/tou\n",
+ "XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1/y)); #Average conversion of ZnS from Eqn.(22)\n",
+ "\n",
+ "\n",
+ "#(c) For other feed rates of solids\n",
+ "F1 = [2,2.5,3,3.5];#Various feed rates of solids in kg/s\n",
+ "n = len(F1)\n",
+ "i = 0;\n",
+ "tbar1 = zeros(n)\n",
+ "Kr1 = zeros(n)\n",
+ "XA1 = zeros(n)\n",
+ "y1 = zeros(n)\n",
+ "tou1 = zeros(n)\n",
+ "XBbar1 = zeros(n)\n",
+ "Kf1 = zeros(n)\n",
+ "CAbar1 = zeros(n)\n",
+ "Krguess1 = 2; #Guess value of Kr\n",
+ "while i< n:\n",
+ " tbar1[i] = At*Lm*(1-ephsilonm)*rhosbar/F1[i];#Mean residence time of solids\n",
+ " def solver_func1(Kr): #Function defined for solving the system\n",
+ " Kf1 = gammab*Kr+1/((1/Kbc)+(1/(gammac*Kr+1/((1/Kce)+(1/(gammae*Kr))))));#Reaction rate for fluidized bed from Eqn.(14)\n",
+ " XA1 = 1-math.exp(-x*Kf1);#Conversion of oxygen from Eqn.(42)\n",
+ " CAbar1 = (CAi*XA1*uo)/(Kr*Lm*(1-ephsilonm));#Average concentration of oxygen from Eqn.(43)\n",
+ " tou1 = rhob*dpbar*10**-6*a/(2*kbar*CAbar1);#Time for complete reaction from Eqn.(9)\n",
+ " y1[i] = tbar1[i]/tou1;#Term tbar/tou\n",
+ " XBbar1[i] = 3*y1[i]-6*y1[i]**2+6*y1[i]**3*(1-math.exp(-1/y1[i]));#Average conversion of ZnS from Eqn.(22)\n",
+ " #Step 3. Material balance of both streams\n",
+ " return (F1[i]/mB)*XBbar1[i]-(At*uo*CAi*XA1/a);#From Eqn.(44b)\n",
+ "\n",
+ " Kr1[i] = fsolve(solver_func1,Krguess1)\n",
+ " Kf1[i] = gammab*Kr1[i]+1/((1/Kbc)+(1/(gammac*Kr1[i]+1/((1/Kce)+(1/(gammae*Kr1[i]))))));#Reaction rate for fluidized bed from Eqn.(14)\n",
+ " XA1[i] = 1-math.exp(-x*Kf1[i]);#Conversion of oxygen from Eqn.(42)\n",
+ " CAbar1[i] = (CAi*XA1[i]*uo)/(Kr1[i]*Lm*(1-ephsilonmf));#Average concentration of oxygen from Eqn.(43)\n",
+ " tou1[i] = rhob*dpbar*10**-6*a/(2*kbar*CAbar1[i]);#Time for complete reaction from Eqn.(9)\n",
+ " y1[i] = tbar1[i]/tou1[i];#Term tbar/tou\n",
+ " XBbar1[i] = 3*y1[i]-6*y1[i]**2+6*y1[i]**3*(1-math.exp(-1/y1[i]));#Average conversion of ZnS from Eqn.(22)\n",
+ " i = i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Extreme Calculation';\n",
+ "print '\\tDiameter of tube with all its internals:%fm'%(dt);\n",
+ "print 'Three step procedure';\n",
+ "print '\\tConversion of ZnS:%f'%(XBbar);\n",
+ "print 'For other feed rates of solids';\n",
+ "print '\\tFeedkg/s\\ttbars\\t\\tXBbar/XA\\tKrbars**-1\\tCAbar/CAi\\ttous\\t\\tXA\\t\\tXB';\n",
+ "i = 0;\n",
+ "while i< n:\n",
+ " print '\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f'%(F1[i],tbar1[i],XBbar1[i]/XA1[i],Kr1[i],CAbar1[i]/CAi,tou1[i],XA1[i],XBbar1[i]);\n",
+ " i = i+1;\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Extreme Calculation\n",
+ "\tDiameter of tube with all its internals:7.265465m\n",
+ "Three step procedure\n",
+ "\tConversion of ZnS:0.992491\n",
+ "For other feed rates of solids\n",
+ "\tFeedkg/s\ttbars\t\tXBbar/XA\tKrbars**-1\tCAbar/CAi\ttous\t\tXA\t\tXB\n",
+ "\t2.000000\t40003.518104\t1.498777\t6.529973\t0.121691\t1208.748626\t0.662201\t0.992491\n",
+ "\t2.500000\t32002.814483\t1.201348\t23.149964\t0.041993\t3502.838402\t0.810111\t0.973225\n",
+ "\t3.000000\t26669.012069\t1.007581\t76.183481\t0.014228\t10338.227251\t0.903294\t0.910141\n",
+ "\t3.500000\t22859.153202\t0.871565\t146.263086\t0.007742\t18998.458994\t0.943693\t0.822490\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6, Page 471\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "\n",
+ "#INPUT\n",
+ "T = 900; #Temperature in roaster in degree C\n",
+ "P = 101325; #Pressure in Pa\n",
+ "R = 8.314; #Universal gas consmath.tant\n",
+ "dp = 750; #Particle size in micrometer5\n",
+ "Fo = 2.5; #Feed rate of solids in kg/s\n",
+ "uo = 0.6; #Superficial gas velocity in m/s\n",
+ "W = 80140; #Weight of bed in kg\n",
+ "ephsilonmf = 0.50; #Void fraction at minimum fluidized condition\n",
+ "umf = 0.5; #Velocity at minimum fluidization condition in m/s\n",
+ "db = 0.2; #Estimated bubble size in m\n",
+ "g = 9.81; #Acceleration due to gravity in square m/s**2\n",
+ "Lm = 1; #Length of fixed bed in m\n",
+ "ephsilonm = 0.45; #Void fraction of fixed bed\n",
+ "xA = 0.21; #Mole fraction of oxygen in feed\n",
+ "kc = 0.015 #Rate consmath.tant in m/s for reaction which follows shrinking core model\n",
+ "Ds = 8E-6; #Diffusion coefficient of solid in m**2/s\n",
+ "rhosbar = 4130; #Average particle density in kg/m**3\n",
+ "mB = 0.09744; #Molecular weight of ZnS\n",
+ "a = 3./2; #Stoichiometric coefficient of Oxygen in the reaction equation\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Selection of models to represent reactor\n",
+ "ubr = 0.711*(g*db)**0.5; #Rise velocity of bubble from Eqn.(6.7)\n",
+ "f = ubr/(umf/ephsilonmf);\n",
+ "\n",
+ "#Step 1.\n",
+ "ub = uo-umf+ubr; #Rise velocity of bubbles from Eqn.(6.8)\n",
+ "delta = (uo-umf)/(ub+2*umf); #Fraction of the bed in bubbles from Eqn.(6.26)\n",
+ "Krguess = 2; #Guess value of Kr\n",
+ "x = Lm*(1-ephsilonm)*umf*(1-delta)/uo**2;\n",
+ "CAi = xA*P/(R*(T+273)); #Initial concentration of oxygen\n",
+ "\n",
+ "#Step 2.\n",
+ "kbar = (kc**-1+(dp*10**-6/(12*Ds))**-1)**-1; #Modified rate consmath.tant from Eqn.(11)\n",
+ "tbar = W/Fo; #Mean residence time of solids from Eqn.(14.2)\n",
+ "rhob = rhosbar/mB; #Density of ZnS\n",
+ "def solver_func1(Kr): #Function defined for solving the system\n",
+ " XA = 1-math.exp(-x*Kr); #Conversion from Eqn.(42)\n",
+ " CAbar = (CAi*XA*uo**2)/(Kr*Lm*(1-ephsilonm)*umf*(1-delta)); #Average concentration of oxygen from Eqn.(43)\n",
+ " tou = rhob*dp*10**-6*a/(2*kbar*CAbar); #Time for complete reaction from Eqn.(9)\n",
+ " y = tbar/tou; #Term tbar/tou\n",
+ " XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1./y)); #Average conversion of ZnS from Eqn.(22)\n",
+ " return XBbar-1.2*XA; #From Table E5, for Fo = 2.5kg/s\n",
+ "\n",
+ "Kr = fsolve(solver_func1,Krguess)\n",
+ "XA = 1-math.exp(-x*Kr); #Conversion from Eqn.(42)\n",
+ "CAbar = (CAi*XA*uo**2)/(Kr*Lm*(1-ephsilonm)*umf*(1-delta)) #Average concentration of oxygen from Eqn.(43)\n",
+ "tou = rhob*dp*10**-6*a/(2*kbar*CAbar); #Time for complete reaction from Eqn.(9)\n",
+ "y = tbar/tou; #Term tbar/tou\n",
+ "XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1./y)); #Average conversion of ZnS from Eqn.(22)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Selection of models to represent reactor';\n",
+ "print '\\tSince ratio ubr/umf/ephsilonmf) = %f <1 the reactor is operating in slow bubble regime'%(f);\n",
+ "print '\\tSince particle size = %f micrometer they react according to shrinking-core model'%(dp);\n",
+ "print '\\tConversion obtained for %f micrometer particle:%f'%(dp,XBbar);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Selection of models to represent reactor\n",
+ "\tSince ratio ubr/umf/ephsilonmf) = 0.995908 <1 the reactor is operating in slow bubble regime\n",
+ "\tSince particle size = 750.000000 micrometer they react according to shrinking-core model\n",
+ "\tConversion obtained for 750.000000 micrometer particle:0.988127\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch3.ipynb b/Fluidization_Engineering/ch3.ipynb
new file mode 100644
index 00000000..cd21b1dd
--- /dev/null
+++ b/Fluidization_Engineering/ch3.ipynb
@@ -0,0 +1,272 @@
+{
+ "metadata": {
+ "name": "ch3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Fluidization and Mapping of Regimes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 68\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Size Measure of Nonuniform Solids\n",
+ "\n",
+ "#INPUT\n",
+ "weight = [0,60,150,270,330,360.0]; # Weight in grams for the oversized particles\n",
+ "psize = [50,75,100,125,150,175]; #PSD in micrometers\n",
+ "\n",
+ "#CALCULATION\n",
+ "l = len(psize); # To obtain the size of input array\n",
+ "# Computation of sauter mean diameter for the given PSD\n",
+ "i = 0;\n",
+ "dpi = [0,0,0,0,0,0]\n",
+ "weightf = [0,0,0,0,0,0]\n",
+ "dp = [0,0,0,0,0,0]\n",
+ "while i<l-1:\n",
+ " dpi[i]=(psize[i]+ psize[i+1])/2.0;\n",
+ " weightf[i]=(weight[i+1]-weight[i])/weight[5]; \n",
+ " dp[i]=weightf[i]/float(dpi[i]); \n",
+ " i=i+1;\n",
+ "\n",
+ "dpbar=1/sum(dp); #Calculation of average particle daimeter Eq.(15)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\n The Sauter mean diameter of the material with the given particle size distribution = %.0f micrometer'%dpbar\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The Sauter mean diameter of the material with the given particle size distribution = 98 micrometer\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 76\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Estimation of Minimum fluidizing velocity\n",
+ "\n",
+ "#INPUT\n",
+ "ephsilon=0.55; #Void fraction of bed\n",
+ "rhog=0.0012; #Density of gas in g/cc\n",
+ "myu=.00018; #Viscosity of gas in g/cm s\n",
+ "dpbar=0.016; #Mean diameter of solids in centimeter\n",
+ "phis=0.67; #Sphericity of solids\n",
+ "rhos=2.6; #Density of solids in g/cc\n",
+ "g=980; #Acceleration due to gravity in square cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Computation of umf using the simplified equation for small particles\n",
+ "umf=((dpbar**2)*(rhos-rhog)*g*(ephsilon**3)*(phis**2))/(150*myu*(1-ephsilon));#Simplified equation to calculate minimum fluidizing velocity \n",
+ " #for small particles Eq.(21)\n",
+ "Re=(dpbar*umf*rhog)/myu;#To calculate Reynolds number for particle\n",
+ "\n",
+ "#Computation of umf if neither void fraction of bed nor sphericity is known\n",
+ "c1=28.7\n",
+ "c2=0.0494; #Value of constants from Table 4, page 70\n",
+ "umf1=(myu/(dpbar*rhog))*(((c1**2)+((c2*(dpbar**3)*rhog*(rhos-rhog)*g)/(myu**2)))**0.5-c1); #Equation to calculate minimum fluidizing velocity \n",
+ " #for coarse particles Eq.(25)\n",
+ "err=((umf-umf1)/umf)*100; #Calculation of error from experimental value\n",
+ "\n",
+ "#OUTPUT\n",
+ "if Re<20:\n",
+ "\tprint 'The particle Reynolds no = %f'%Re\n",
+ "\tprint 'The simplified equation used for calculating minimum fluidizing velocity is valid.'\n",
+ "\n",
+ "print 'The minimum fluidizing velocity by simplified equation for small particles = %.2fcm/s'%umf\n",
+ "print 'The minimum fluidizing velocity by equation for coarse partilces = %.2fcm/s'%umf1\n",
+ "print 'This value is %d percent below the experimentally reported value.'%err\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The particle Reynolds no = 0.427493\n",
+ "The simplified equation used for calculating minimum fluidizing velocity is valid.\n",
+ "The minimum fluidizing velocity by simplified equation for small particles = 4.01cm/s\n",
+ "The minimum fluidizing velocity by equation for coarse partilces = 3.10cm/s\n",
+ "This value is 22 percent below the experimentally reported value.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 82\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Estimation of terminal velocity of falling particles\n",
+ "\n",
+ "#INPUT\n",
+ "rhog=1.2e-3; #Density of air in g/cc\n",
+ "myu=1.8e-4 #Viscosity of air in g/cm s\n",
+ "dpbar=0.016 #Mean diameter of solids in centimeter\n",
+ "phis=0.67; #Sphericity of solids\n",
+ "rhos=2.6; #Density of solids in g/cc\n",
+ "g=980 #Acceleration due to gravity in square cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "dpstar=dpbar*((rhog*(rhos-rhog)*g)/myu**2)**(1/3.0); #Calculation of dimensionless particle size Eq.(31)\n",
+ "utstar=((18/(dpstar**2))+(2.335-(1.744*phis))/(dpstar**0.5))**-1; #Calculation of dimensionless gas velocity Eq.(33)\n",
+ "ut=utstar*((myu*(rhos-rhog)*g)/rhog**2)**(1/3.0); #Calculation of terminal velocity of falling particles Eq.(32)\n",
+ "\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The dimensionless particle size = %.2f'%dpstar\n",
+ "print 'The dimensionless gas velocity = %.3f'%utstar\n",
+ "print 'The terminal velocity of falling particles = %d cm/s'%ut\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dimensionless particle size = 7.28\n",
+ "The dimensionless gas velocity = 1.296\n",
+ "The terminal velocity of falling particles = 88 cm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 91\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Prediction of flow regime\n",
+ "\n",
+ "#INPUT\n",
+ "rhos=1.5; #Density of Solid in g/cc\n",
+ "uo1=40; uo2=80; #Superficial gas velocity in cm/s\n",
+ "dp1=0.006; dp2=0.045; #Particle size in centimeter\n",
+ "rhog1=1.5E-3; rhog2=1E-3; #Density of gas in g/cc\n",
+ "myu1=2E-4; myu2=2.5E-4; #Viscosity of air in g/cm s\n",
+ "g=980; #Acceleration due to gravity in square cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "#for smaller particles\n",
+ "dpstar1=dp1*((rhog1*(rhos-rhog1)*g)/myu1**2)**(1/3.0); #Calculation of dimensionless particle diamter Eq.(31)\n",
+ "uostar1=uo1*((rhog1**2)/((myu1)*(rhos-rhog1)*g))**(1/3.0);\n",
+ "uostar2=uo2*((rhog1**2)/((myu1)*(rhos-rhog1)*g))**(1/3.0); #Calculation of dimensionless superficial gas velocity Eq.(32)\n",
+ "\n",
+ "#for larger particles \n",
+ "dpstar2=dp2*((rhog2*(rhos-rhog2)*g)/myu2**2)**(1/3.0); #Calculation of dimensionless particle diamter Eq.(31)\n",
+ "uostar3=uo1*((rhog2**2)/((myu2)*(rhos-rhog2)*g))**(1/3.0);\n",
+ "uostar4=uo2*((rhog2**2)/((myu2)*(rhos-rhog2)*g))**(1/3.0); #Calculation of dimensionless superficial gas velocity Eq.(32)\n",
+ "\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'For particle of size %.3f centimeter'%dp1\n",
+ "print 'The dimensionless particle diameter = %.2f'%dpstar1\n",
+ "print 'The dimensionless superficial gas velocity = %.4fcm/s(for superficial gas velocity of %dcm/s)'%(uostar1,uo1)\n",
+ "print 'The dimensionless superficial gas velocity = %.3fcm/s(for superficial gas velocity of %dcm/s)'%(uostar2,uo2)\n",
+ "print 'From Fig.16(page 89)comparing u*=%.4f vs dp*=%.2f'%(uostar1,dpstar1)\n",
+ "print 'For Superficial gas velocity =%d Mode of Fluidization:Onset of turbulent fluidization in an ordinary bubbling bed'%(uo1)\n",
+ "print 'From Fig.16(page 89)comparing u* =%.3f vs dp* =%f'%(uostar2,dpstar1)\n",
+ "print 'For Superficial gas velocity =%f Mode of Fluidization:Fast fluidization(requires a circulating solid system)'%(uo2)\n",
+ "print 'For particle of size %f centimeter'%(dp2)\n",
+ "print 'The dimensionless particle diameter = %f'%(dpstar2)\n",
+ "print 'The dimensionless superficial gas velocity = %fcm/s(for superficial gas velocity of %fcm/s)'%(uostar3,uo1)\n",
+ "print 'The dimensionless superficial gas velocity = %fcm/s(for superficial gas velocity of %fcm/s)'%(uostar4,uo2)\n",
+ "print 'From Fig.16(page 89)comparing u*=%f vs dp*=%f'%(uostar3,dpstar2)\n",
+ "print 'For Superficial gas velocity =%f Mode of Fluidization:Bublling Fluidization'%(uo1)\n",
+ "print 'From Fig.16(page 89)comparing u* =%f vs dp* =%f'%(uostar4,dpstar2)\n",
+ "print 'For Superficial gas velocity =%f Mode of Fluidization:Bubbling Fluidization'%(uo2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For particle of size 0.006 centimeter\n",
+ "The dimensionless particle diameter = 2.28\n",
+ "The dimensionless superficial gas velocity = 0.7885cm/s(for superficial gas velocity of 40cm/s)\n",
+ "The dimensionless superficial gas velocity = 1.577cm/s(for superficial gas velocity of 80cm/s)\n",
+ "From Fig.16(page 89)comparing u*=0.7885 vs dp*=2.28\n",
+ "For Superficial gas velocity =40 Mode of Fluidization:Onset of turbulent fluidization in an ordinary bubbling bed\n",
+ "From Fig.16(page 89)comparing u* =1.577 vs dp* =2.282737\n",
+ "For Superficial gas velocity =80.000000 Mode of Fluidization:Fast fluidization(requires a circulating solid system)\n",
+ "For particle of size 0.045000 centimeter\n",
+ "The dimensionless particle diameter = 12.890262\n",
+ "The dimensionless superficial gas velocity = 0.558561cm/s(for superficial gas velocity of 40.000000cm/s)\n",
+ "The dimensionless superficial gas velocity = 1.117122cm/s(for superficial gas velocity of 80.000000cm/s)\n",
+ "From Fig.16(page 89)comparing u*=0.558561 vs dp*=12.890262\n",
+ "For Superficial gas velocity =40.000000 Mode of Fluidization:Bublling Fluidization\n",
+ "From Fig.16(page 89)comparing u* =1.117122 vs dp* =12.890262\n",
+ "For Superficial gas velocity =80.000000 Mode of Fluidization:Bubbling Fluidization\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch4.ipynb b/Fluidization_Engineering/ch4.ipynb
new file mode 100644
index 00000000..3ff36672
--- /dev/null
+++ b/Fluidization_Engineering/ch4.ipynb
@@ -0,0 +1,309 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : The Dense Bed"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 106\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "Design of a Perforated Plate Distributor\n",
+ "\n",
+ "#Variable declaration\n",
+ "dt=4; #Vessel diameter in m\n",
+ "Lmf=2; #Length of the bed in m\n",
+ "ephsilonmf=0.48; #Void fraction of bed\n",
+ "rhos=1500; #Density of solid in kg/m**3\n",
+ "rhog=3.6; #Density of gas in kg/m**3\n",
+ "myu=2E-5; #Viscosity of gas in kg/m s\n",
+ "po=3; #Pressure of inlet gas in bar\n",
+ "uo=0.4; #Superficial velocity of gas in m/s\n",
+ "uorm=40; #Maximum allowable jet velocity from holes in m/s\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "gc=1;\n",
+ "pi=3.1428;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Computation of minimum allowable pressure drop through the distributor\n",
+ "deltapb=((1-ephsilonmf)*(rhos-rhog)*g*Lmf)/gc; #Calculation of pressure drop in bed using Eqn.(3.17)\n",
+ "deltapd=0.3*deltapb; #Calculation of pressure drop in distributor using Eqn.(3)\n",
+ "\n",
+ "#Computation of orifice coefficient\n",
+ "Ret=(dt*uo*rhog)/myu;\n",
+ "if Ret>=3000:\n",
+ " Cd=0.60;\n",
+ "elif Ret>=2000:\n",
+ " Cd=0.61;\n",
+ "elif Ret>=1000:\n",
+ " Cd=0.64;\n",
+ "elif Ret>=500:\n",
+ " Cd=0.68;\n",
+ "elif Ret>=300:\n",
+ " Cd=0.70;\n",
+ "elif Ret>=100:\n",
+ " Cd=0.68;\n",
+ "\n",
+ "#Computation of gas velocity through orifice\n",
+ "uor=Cd*((2*deltapd)/rhog)**0.5; #Calculation of gas velocity through orifice by using Eqn.(12)\n",
+ "f=(uo/uor)*100; #Calculation of fraction of open area in the perforated plate \n",
+ "\n",
+ "\n",
+ "#Computation of number of orifices per unit area of distributor\n",
+ "dor=[0.001,0.002,0.004]; #Different orifice diameters in m\n",
+ "n=len(dor);\n",
+ "i=0;\n",
+ "Nor = [0.,0.,0.]\n",
+ "while i<n:\n",
+ " Nor[i]=(uo*4)/(pi*uor*(dor[i])**2);#Calculation of number of orifices by using Eqn.(13)\n",
+ " i=i+1;\n",
+ " \n",
+ "#OUTPUT\n",
+ "print 'The pressure drop in bed:%fPa'%deltapb\n",
+ "print 'The minimum allowable pressure drop in distributor:%fPa'%deltapd\n",
+ "if uor<uorm:\n",
+ " print 'The gas veleocity of %fm/s is satisfactory'%uor\n",
+ "else:\n",
+ " print 'The gas veleocity of %fm/s is not satisfactory'%uor\n",
+ "\n",
+ "if f<10:\n",
+ " print 'The fraction of open area of %f percent is allowable'%f\n",
+ "else:\n",
+ " print 'The fraction of open area of %f percent is not allowable'%f\n",
+ "\n",
+ "print 'Diameter of orifice(m)',\n",
+ "print '\\tNumber of orifices per unit area(per sq.m)'\n",
+ "\n",
+ "j=0;\n",
+ "while j<n:\n",
+ " print '%f'%dor[j],\n",
+ " print '\\t\\t%f'%Nor[j]\n",
+ " j=j+1;\n",
+ "\n",
+ "print 'This number can be rounded off.'\n",
+ "print 'Since orifices that are too small are liable to clog and those that are too large cause uneven distribution of gas, we choose orifice of diameter %fm'%dor[2]\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop in bed:15251.308800Pa\n",
+ "The minimum allowable pressure drop in distributor:4575.392640Pa\n",
+ "The gas veleocity of 30.250265m/s is satisfactory\n",
+ "The fraction of open area of 1.322302 percent is allowable\n",
+ "Diameter of orifice(m) \tNumber of orifices per unit area(per sq.m)\n",
+ "0.001000 \t\t16829.610145\n",
+ "0.002000 \t\t4207.402536\n",
+ "0.004000 \t\t1051.850634\n",
+ "This number can be rounded off.\n",
+ "Since orifices that are too small are liable to clog and those that are too large cause uneven distribution of gas, we choose orifice of diameter 0.004000m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 108\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design of a Tuyere Distributor\n",
+ "\n",
+ "#Variable declaration\n",
+ "lor=0.1; #Minimum allowable tuyere spacing in m\n",
+ "uorm=30; #Maximum allowable jet velocity from the tuyere in m/s\n",
+ "uo=0.4; #Superficial velocity of gas in m/s\n",
+ "uor=30.2; #Gas velocity through orifice,from Exa 1, in m/s\n",
+ "Cd=0.6; #Dicharge coefficient from Exa 1\n",
+ "rhog=3.6 #Density of gas in kg/m**3\n",
+ "pi=3.1428;\n",
+ "\n",
+ "#CALCULATION\n",
+ "Nor=1/(lor**2); #Calculation of number of orifices per unit area by assuming minimum spacing for tuyeres\n",
+ "dor=((4/pi)*(uo/uor)*(1/Nor))**0.5; #Calculation of diameter of inlet orifiec by using Eqn.(13)\n",
+ "\n",
+ "#Computation of diameter of hole for different number of holes per tuyere\n",
+ "q=(lor**2)*uo; #Volumetric flow rate in m**3/s\n",
+ "Nh=[8.,6.,4.]; #Different number of holes per tuyere\n",
+ "n=len(Nh);\n",
+ "i=0;\n",
+ "dh = [0.,0.,0.]\n",
+ "while i<n:\n",
+ " dh[i]=((((q/Nh[i])*(4./pi))/uorm)**0.5);#Calculation of diameter of holes\n",
+ " i=i+1;\n",
+ "\n",
+ "deltaph=(rhog/2.)*((uor/Cd)**2)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Number of holes(number of holes/tuyeres)',\n",
+ "print '\\tDiameter of hole(m)'\n",
+ "j=0;\n",
+ "while j<n:\n",
+ " print '%f'%Nh[j],\n",
+ " print '\\t\\t\\t\\t\\t%f'%dh[j]\n",
+ " j=j+1;\n",
+ "\n",
+ "print 'The design chosen is as follows'\n",
+ "print '\\tTuyeres are as shown in Fig.2(b),page 97'\n",
+ "print '\\tNumber of holes = %f(Since rectangular pitch is chosen for tuyeres)'%Nh[1]\n",
+ "print '\\tDiameter of hole = %fm'%dh[1]\n",
+ "print '\\tDiameter of incoming high-pressure-drop orifice = %fm ID'%dor\n",
+ "print 'Checking the pressure drop in tuyeres'\n",
+ "print 'Since pressure drop of %.1f Pa gives sufficiently high \\\n",
+ "distributor pressure drop as seen in Exa.1, use of inlet orifice can be dispensed.'%deltaph\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of holes(number of holes/tuyeres) \tDiameter of hole(m)\n",
+ "8.000000 \t\t\t\t\t0.004606\n",
+ "6.000000 \t\t\t\t\t0.005318\n",
+ "4.000000 \t\t\t\t\t0.006513\n",
+ "The design chosen is as follows\n",
+ "\tTuyeres are as shown in Fig.2(b),page 97\n",
+ "\tNumber of holes = 6.000000(Since rectangular pitch is chosen for tuyeres)\n",
+ "\tDiameter of hole = 0.005318m\n",
+ "\tDiameter of incoming high-pressure-drop orifice = 0.012984m ID\n",
+ "Checking the pressure drop in tuyeres\n",
+ "Since pressure drop of 4560.2 Pa gives sufficiently high distributor pressure drop as seen in Exa.1, use of inlet orifice can be dispensed.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 110\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Power Requirement for a Fluidized Coal Combustor(FBC)\n",
+ "\n",
+ "#Variable declaration\n",
+ "deltapd=[3,10] #Distributor pressure drop in kPa\n",
+ "deltapd2=10.0; #Distributor pressure drop in kPa\n",
+ "po=101.0; #Entering air pressure in kPa\n",
+ "To=20.0; #Entering air temperature in degree C\n",
+ "y=1.4; #Fugacity of air\n",
+ "deltapb=10; #Pressure drop in bed in kPa\n",
+ "p3=103; #Pressure at the bed exit in kPa\n",
+ "F=8; #Feed rate of coal in tons/hr\n",
+ "H=25; #Gross heatig value of coal in MJ/kg\n",
+ "Fa=10; #Air required at standard condition in nm**3/kg\n",
+ "etac=0.75; #Efficiency of compressor\n",
+ "etap=36; #Efficiency of plant in %\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Calculation of volumetric flow rate of air\n",
+ "vo=((F*1000)*Fa*((To+273)/273.0))/3600.0;\n",
+ "\n",
+ "#Case(a) Distributor Pressure drop = 3kPa and Case(b) Distributor Pressure drop = 10kPa\n",
+ "n=len(deltapd);\n",
+ "i=0;\n",
+ "p1= [0,0]\n",
+ "p2 = [0,0]\n",
+ "ws = [0.,0.]\n",
+ "while i<n:\n",
+ " p2[i]=p3+deltapb; #Calculation of pressure at the entrance of the bed\n",
+ " p1[i]=p2[i]+deltapd[i];#Calculation of pressure before entering the bed\n",
+ " ws[i]=(y/(y-1))*po*vo*((p1[i]/po)**((y-1)/y)-1)*(1.0/etac);#Calculation of power required for the compressor by Eqn.(18) & Eqn.(20)\n",
+ " i=i+1;\n",
+ "\n",
+ "#Case(c) 50% of the required bypassed to burn the volatile gases. Distributor Pressure drop = 3kPa\n",
+ "#No change in pressure drop from case(a)\n",
+ "v1=vo/2.0; #New volumetric flow rate of air\n",
+ "ws1=455/2.0; #Power required for blower for primary air\n",
+ "ws2=(y/(y-1))*po*v1*((p3/po)**((y-1)/y)-1)*(1/etac);#Power required for blower for bypassed air\n",
+ "wst=ws1+ws2; #Total power required for the two blowers\n",
+ "p=((ws[1]-wst)/ws[1])*100; #Saving in power when compared to case(a)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Case(a)'\n",
+ "print '\\tVolumetric flow rate of air = %.2f m**3/hr'%vo\n",
+ "print '\\tPower required for compressor = %.0f kW'%ws[0]\n",
+ "print 'Case(b)'\n",
+ "print '\\tVolumetric flow rate of air = %.2f m**3/hr'%vo\n",
+ "print '\\tPower required for compressor = %.0f kW'%ws[1]\n",
+ "print 'Case(c)'\n",
+ "print '\\tVolumetric flow rate of air = %.3f m**3/hr'%v1\n",
+ "print '\\tPower required for compressor for primary air = %.1f kW'%ws1\n",
+ "print '\\tPower required for blower for bypassed air = %.1f kW'%ws2\n",
+ "print '\\tTotal power required for the two blowers = %.0f kW'%wst\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a)\n",
+ "\tVolumetric flow rate of air = 23.85 m**3/hr\n",
+ "\tPower required for compressor = 454 kW\n",
+ "Case(b)\n",
+ "\tVolumetric flow rate of air = 23.85 m**3/hr\n",
+ "\tPower required for compressor = 651 kW\n",
+ "Case(c)\n",
+ "\tVolumetric flow rate of air = 11.925 m**3/hr\n",
+ "\tPower required for compressor for primary air = 227.5 kW\n",
+ "\tPower required for blower for bypassed air = 31.6 kW\n",
+ "\tTotal power required for the two blowers = 259 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch5.ipynb b/Fluidization_Engineering/ch5.ipynb
new file mode 100644
index 00000000..4fb61904
--- /dev/null
+++ b/Fluidization_Engineering/ch5.ipynb
@@ -0,0 +1,138 @@
+{
+ "metadata": {
+ "name": "ch5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Bubbles in Dense Beds"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 126\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Charactersitics of a Single Bubble\n",
+ "\n",
+ "#Variable declaration\n",
+ "dt=60.0; #ID of tube in cm \n",
+ "dp=300; #Size of particles of bed in micrometers\n",
+ "umf=3; #Velocity at minimum fluidization condition in cm/s\n",
+ "ephsilonmf=0.5; #Void fraction of bed at minimum fluidization condition\n",
+ "db=5; #Diameter of bubble in cm\n",
+ "g=980; #Acceleration due to gravity in cm/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Computation of rise velocity of bubble\n",
+ "if (db/dt)<0.125:\n",
+ " ubr=(0.711*((g*db)**0.5));#Rise velocity by Eqn.(3)\n",
+ "elif (db/dt)<0.6:\n",
+ " ubr=(0.711*((g*db)**0.5))*1.2*exp(-1.49*(db/dt));#Rise velocity by Eqn.(4) \n",
+ "\n",
+ "#Computation of cloud thickness\n",
+ "Rb=db/2.0; #Radius of bubble\n",
+ "uf=umf/ephsilonmf; #Velocity of emulsion gas\n",
+ "Rc=Rb*((ubr+(2*uf))/(ubr-uf))**(1/3.0);#Radius of cloud by Eqn.(6)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'The rise velocity of the bubble=%.1f cm/s'%ubr\n",
+ "print 'The cloud thickness=%.2f cm'%(Rc-Rb)\n",
+ "print 'From Fig.8(page 124)comparing fw vs dp, for dp = %.0f micrometer, wake fraction = 0.24'%dp\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rise velocity of the bubble=49.8 cm/s\n",
+ "The cloud thickness=0.30 cm\n",
+ "From Fig.8(page 124)comparing fw vs dp, for dp = 300 micrometer, wake fraction = 0.24\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 132\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Initial Bubble Size at a Distributor\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "uo=15; #Superificial gas velocity in cm/s\n",
+ "umf=1; #Velocity at minimum fluidization condition in cm/s\n",
+ "lor=2.0; #Pitch of perforated plate in cm\n",
+ "g=980; #Acceleration due to gravity in cm/s**2\n",
+ "#CALCULATION\n",
+ "#Case(a) For porous plate\n",
+ "dbo1=(2.78/g)*(uo-umf)**2;#Initial bubble size using Eqn.(19)\n",
+ "\n",
+ "#Case(b) For Perforated plate\n",
+ "Nor=(2/math.sqrt(3))*(1/lor)**2;#Number of orifices in cm**-2\n",
+ "dbo2=(1.30/(g**0.2))*((uo-umf)/Nor)**0.4;#Initial bubble size using Eqn.(15) assuming inital bubble size is smaller than hole spacing\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Case(a) For porous plate'\n",
+ "print '\\tInitial bubble size=%.2fcm'%dbo1\n",
+ "print 'Case(b) For Perforated plate'\n",
+ "print '\\tInitial bubble size=%.2fcm'%dbo2\n",
+ "print '\\tSince %f<%f, the equation used is correct.'%(dbo2,lor)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a) For porous plate\n",
+ "\tInitial bubble size=0.56cm\n",
+ "Case(b) For Perforated plate\n",
+ "\tInitial bubble size=1.55cm\n",
+ "\tSince 1.548765<2.000000, the equation used is correct.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch6.ipynb b/Fluidization_Engineering/ch6.ipynb
new file mode 100644
index 00000000..39b1fc56
--- /dev/null
+++ b/Fluidization_Engineering/ch6.ipynb
@@ -0,0 +1,504 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Bubbling Fluidized Beds"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Bubble Size and Rise Velocity in Geldart A Beds\n",
+ "\n",
+ "#Variable declaration\n",
+ "z=0.5; #Height of bed in m\n",
+ "dt=0.5; #ID of tube in m\n",
+ "rhos=1.6; #Density of catalyst in g/cm**3\n",
+ "dpbar=60.; #Averge catalyst diameter in micrometer\n",
+ "umf=0.002; #Velocity at minimum fluidization condition in m/s\n",
+ "uo=0.2; #Superficial velocity in m/s\n",
+ "dor=2.; #Diameter of orifice in mm\n",
+ "lor=20.; #Pitch of perforated plate in mm\n",
+ "g=9.80; #g=980;#Acceleration due to gravity in m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Method 1. Procedure using Eqn.(10) & Eqn.(11)\n",
+ "db=(0.035+0.040)/2.;#Bubble size at z=0.5m from Fig.7(a) & Fig.7(b)\n",
+ "ub1=1+1.55*((uo-umf)+14.1*(db+0.005))*(dt**0.32)*0.711*(g*db)**0.5;#Bubble velocity using Eqn.(10) & Eqn.(11)\n",
+ "\n",
+ "#Method 2. Werther's procedure\n",
+ "si=0.8;#From Fig.6 for Geldart A solids \n",
+ "ub2=si*(uo-umf)+(3.2*(dt**(1./3)))*(0.711*(g*db)**0.5);#Bubble velocity using Eqn.(9)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Method 1. Procedure using Eqn.(10) & Eqn.(11)'\n",
+ "print '\\tDiameter of the bubble=%.4fm'%db\n",
+ "print '\\tRise velocity of the bubble=%.4fm/s'%ub1\n",
+ "print 'Method 2. Werthers procedure'\n",
+ "print '\\tDiameter of the bubble=%fm'%db\n",
+ "print '\\tRise velocity of the bubble=%fm/s'%ub2\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Method 1. Procedure using Eqn.(10) & Eqn.(11)\n",
+ "\tDiameter of the bubble=0.0375m\n",
+ "\tRise velocity of the bubble=1.4267m/s\n",
+ "Method 2. Werthers procedure\n",
+ "\tDiameter of the bubble=0.037500m\n",
+ "\tRise velocity of the bubble=1.253125m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 151\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Bubble Size and Rise Velocity in Geldart B Beds\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "z=0.5; #Height of bed in m\n",
+ "dt=0.5; #ID of tube in m\n",
+ "rhos=2.6; #Density of catalyst in g/cm**3\n",
+ "dpbar=100.; #Averge catalyst diameter in micrometer\n",
+ "umf=0.01; #Velocity at minimum fluidization condition in m/s\n",
+ "uo=0.45; #Superficial velocity in m/s\n",
+ "dor=2.; #Diameter of orifice in mm\n",
+ "lor=30.; #Pitch of perforated plate in mm\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "pi=3.142857;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Part(a).Bubble Size\n",
+ "Nor=(2/math.sqrt(3))*(1/lor**2);\n",
+ "dbo=5.5;\n",
+ "\n",
+ "#Method 1.Werther's procedure for finding bubble size\n",
+ "z1=[0,5,10,20,30,50,70]\n",
+ "db = [0.,0.,0.,0.,0.,0.,0.]\n",
+ "n=len(z1);\n",
+ "i=0; \n",
+ "while i<n:\n",
+ " db[i]=0.853*((1+0.272*(uo-umf)*100)**(1/3.0))*(1+0.0684*z1[i])**1.21;\n",
+ " i=i+1; \n",
+ "\n",
+ "db1=0.163;#Since bubble size starts at dbo=5.5cm at z=0, we shift the curve accordingly to z=0.5m\n",
+ "\n",
+ "#Method 2.Mori and Wen's procedure for finding bubble size\n",
+ "dbm=0.65*((math.pi/4.0)*((dt*100)**2)*(uo-umf)*100)**0.4;\n",
+ "db2=dbm-(dbm-dbo)*math.exp(-0.3**(z/dt));\n",
+ "\n",
+ "#Part(b).Bubble Velocity\n",
+ "#Method 1.Procedure using Eqn.(12)\n",
+ "ub1=1.6*((uo-umf)+1.13*db1**0.5)*(dt**1.35)+(0.711*(g*db1)**0.5);\n",
+ "\n",
+ "#Method 2.Werther's Procedure\n",
+ "si=0.65;\n",
+ "ub2=si*(uo-umf)+2*(dt**0.5)*(0.711*(g*db1)**0.5);\n",
+ "\n",
+ "#Using Eqn.(7) & Eqn.(8)\n",
+ "ubr1=0.711*(g*db1)**0.5;\n",
+ "ubr2=0.711*(g*db2/100.0)**0.5\n",
+ "ub3=uo-umf+ubr1;\n",
+ "ub4=uo-umf+ubr2;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Bubble Size'\n",
+ "print 'Initial bubble size from Fig.5.14 for %.2fm/s = %.2fcm'%(uo-umf,dbo)\n",
+ "print '\\tMethod 1.Werthers procedure for finding bubble size'\n",
+ "print '\\t\\tHeight of bed(cm)'\n",
+ "print '\\t\\t\\tBubble size(cm)'\n",
+ "m=len(z1);\n",
+ "j=0;\n",
+ "while j<m:\n",
+ " print '\\t\\t%d'%z1[j],\n",
+ " print '\\t\\t\\t\\t%.2f'%db[j]\n",
+ " j=j+1;\n",
+ "\n",
+ "print '\\tMethod 2.Mori and Wens procedure for finding bubble size'\n",
+ "print '\\t\\tMaximum expected bubble size=%.2fcm'%dbm\n",
+ "print '\\t\\tBubble size=%.0fcm'%db2\n",
+ "print 'Bubble Velocity'\n",
+ "print '\\tMethod 1.Procedure using Eqn.(12)'\n",
+ "print '\\t\\tBubble velocity=%.2fm/s'%ub1\n",
+ "print '\\tMethod 2.Werthers procedure'\n",
+ "print '\\t\\tBubble velocity=%.2fm/s'%ub2\n",
+ "print 'Comparing the above results with the expressions of the simple two-phase theory'\n",
+ "print '\\tWerthers bubble size'\n",
+ "print '\\tBubble rise velocity=%.2fm/s\\tBubble velocity=%.2fm/s'%(ubr1,ub3)\n",
+ "print '\\tMori & Wens bubble size'\n",
+ "print '\\tBubble rise velocity=%.1fm/s\\tBubble velocity=%.2fm/s'%(ubr2,ub4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bubble Size\n",
+ "Initial bubble size from Fig.5.14 for 0.44m/s = 5.50cm\n",
+ "\tMethod 1.Werthers procedure for finding bubble size\n",
+ "\t\tHeight of bed(cm)\n",
+ "\t\t\tBubble size(cm)\n",
+ "\t\t0 \t\t\t\t2.00\n",
+ "\t\t5 \t\t\t\t2.86\n",
+ "\t\t10 \t\t\t\t3.77\n",
+ "\t\t20 \t\t\t\t5.69\n",
+ "\t\t30 \t\t\t\t7.73\n",
+ "\t\t50 \t\t\t\t12.10\n",
+ "\t\t70 \t\t\t\t16.77\n",
+ "\tMethod 2.Mori and Wens procedure for finding bubble size\n",
+ "\t\tMaximum expected bubble size=61.31cm\n",
+ "\t\tBubble size=20cm\n",
+ "Bubble Velocity\n",
+ "\tMethod 1.Procedure using Eqn.(12)\n",
+ "\t\tBubble velocity=1.46m/s\n",
+ "\tMethod 2.Werthers procedure\n",
+ "\t\tBubble velocity=1.56m/s\n",
+ "Comparing the above results with the expressions of the simple two-phase theory\n",
+ "\tWerthers bubble size\n",
+ "\tBubble rise velocity=0.90m/s\tBubble velocity=1.34m/s\n",
+ "\tMori & Wens bubble size\n",
+ "\tBubble rise velocity=1.0m/s\tBubble velocity=1.43m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 153\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Scale-down of a Commercial Chlorinator\n",
+ "\n",
+ "#Variable declaration\n",
+ "dpbar=53.; #Average particle size in micrometer\n",
+ "s=[1,2]; #Size of Bermuda rock in cm \n",
+ "rhosbar=3200.; #Average solid density of the coke-zircon mixture in kg/m**3\n",
+ "ephsilonm=0.5; #Void fraction for fixed bed\n",
+ "ephsilonf=0.75; #Void fraction for bubbling bed\n",
+ "rhogbar=0.64; #Average density of gas in kg/m**3\n",
+ "uo=14.; #Superficial gas velocity in cm/s\n",
+ "myu=5E-5; #Viscosity of gas in kg/m s\n",
+ "T=1000.; #Temperature in degree C\n",
+ "P=1.; #Pressure in atm\n",
+ "dt=91.5; #ID of bed in cm\n",
+ "sh=150.; #Slumped height in cm\n",
+ "\n",
+ "#CALCULATION\n",
+ "rhog2=1.2; #Density of ambient air\n",
+ "myu2=1.8E-5; #Viscosity of ambient air\n",
+ "rhos2=rhog2*(rhosbar/rhogbar);#For the requirement of constant density ratio\n",
+ "m=((rhogbar*myu2)/(rhog2*myu))**(2./3);#Scale factor by usin Eqn.(16)\n",
+ "u2=(m**0.5)*uo; #Superficial gas velocity by using Eqn.(17)\n",
+ "#OUTPUT\n",
+ "print 'For the model use'\n",
+ "print '\\tBed of ID %.2fcm\\tSlumped bed height of %.2fcm\\tPacked bed distributor consisting of %.2f-%.2fmm rock'%(m*dt,m*sh,m*s[0],m*s[1])\n",
+ "print 'Fluidizing gas: ambient air at %.2fatm'%P\n",
+ "print 'Solids: \\tzirconia, Average particle size=%.2fmicrometers'%(m*dpbar)\n",
+ "print 'Entering gas:\\tSuperficial velocity=%.2fcm/s'%u2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For the model use\n",
+ "\tBed of ID 30.45cm\tSlumped bed height of 49.92cm\tPacked bed distributor consisting of 0.33-0.67mm rock\n",
+ "Fluidizing gas: ambient air at 1.00atm\n",
+ "Solids: \tzirconia, Average particle size=17.64micrometers\n",
+ "Entering gas:\tSuperficial velocity=8.08cm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 159\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reactor Scale-up for Geldart A Catalyst\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "dtb=20; #ID of bench-scale reactor\n",
+ "dtp=1; #ID of pilot reactor\n",
+ "dpbar=52; #Average particle size in micrometer\n",
+ "ephsilonm=0.45; #Void fraction for fixed bed\n",
+ "ephsilonmf=0.50; #Void fraction at minimum fluidization condition\n",
+ "ephsilonmb=0.60; #Void fraction \n",
+ "uo=30; #Superficial gas velocity in cm/s\n",
+ "Lmb=2; #Length of fixed bed in m\n",
+ "umf=0.33; #Velocity at minimum fluidization condition in cm/s\n",
+ "umb=1; #Velocity at in cm/s\n",
+ "db=3; #Equilibrium bubble size in cm\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "pi=3.142857;\n",
+ "\n",
+ "#CALCULATION\n",
+ "ubr=0.711*(g*db/100)**0.5;#Rise velocity of bubble using Eqn.(7)\n",
+ "\n",
+ "#Bubble velocity for the bench unit\n",
+ "ubb1=1.55*(((uo-umf)/100.0)+14.1*((db/100.0)+0.005))*((dtb/100.0)**0.32)+ubr;#Bubble velocity using Eqn.(11)\n",
+ "si=1;\n",
+ "ubb2=si*((uo-umf)/100.0)+(3.2*((dtb/100.0)**(1/3.0)))*ubr;#Bubble velocity using Eqn.(9)\n",
+ "ubb=(ubb1+ubb2)/2;#Average bubble velocity\n",
+ "\n",
+ "#Bubble velocity for the pilot unit\n",
+ "ubp1=1.55*(((uo-umf)/100.0)+14.1*((db/100.0)+0.005))*(dtp**0.32)+ubr;#Bubble velocity using Eqn.(11)\n",
+ "si=1;\n",
+ "ubp2=si*((uo-umf)/100)+(3.2*(dtp**(1/3)))*ubr;#Bubble velocity using Eqn.(9)\n",
+ "ubp=(ubp1+ubp2)/2;#Average bubble velocity\n",
+ "\n",
+ "#Rise velocity of upflowing emulsion\n",
+ "ueb=ubb-ubr;#For the bench unit\n",
+ "uep=ubp-ubr;#For the pilot unit\n",
+ "\n",
+ "#Scale-Up Alternative 1.\n",
+ "dteb=20;#Effective bubble diameter\n",
+ "dib=[5,10,15,20];#Different outside diameters\n",
+ "n=len(dib);\n",
+ "li = [0.,0.,0.,0.]\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " li[i]=math.sqrt(((pi*dib[i]*dteb)/4)+((pi/4)*(dib[i])**2));#Pitch using Eqn.(13)\n",
+ " i=i+1;\n",
+ "\n",
+ "#Scale-Up Alternative 2.\n",
+ "Lmp=Lmb*(ubp/ubb);#Static bed height of commercial unit\n",
+ "dtep=100.0;#Effective bubble diameter\n",
+ "dip=[10,15,20,25];#Different outside diameters\n",
+ "m=len(dip);\n",
+ "i=0;\n",
+ "lip = [0.,0.,0.,0.]\n",
+ "while i<m:\n",
+ " lip[i]=math.sqrt(((math.pi*dip[i]*dtep)/4.0)+(math.pi/4.0)*dip[i]);#Pitch using Eqn.(13)\n",
+ " i=i+1;\n",
+ "\n",
+ "#Height of Bubbling beds\n",
+ "#For bench unit\n",
+ "deltab=((uo/100.0)-(umb/100.0))/(ubb-(umb/100.0));#Fraction of bed in bubbles using Eqn.(28)\n",
+ "ephsilonfb=deltab+(1-deltab)*ephsilonmb;#Void fraction of bubbling bed using Eqn.(20)\n",
+ "Lfb=Lmb*(1-ephsilonm)/(1-ephsilonfb);#Hieght of bubbling bed usnig Eqn.(19)\n",
+ "#For pilot unit\n",
+ "deltap=((uo/100.0)-(umb/100.0))/(ubp-(umb/100.0));#Fraction of bed in bubbles using Eqn.(28)\n",
+ "ephsilonfp=deltap+(1-deltap)*ephsilonmb;#Void fraction of bubbling bed using Eqn.(20)\n",
+ "Lfp=Lmp*(1-ephsilonm)/(1-ephsilonfp);#Hieght of bubbling bed usnig Eqn.(19)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Rise velocity of bubble=%.3fm/s'%ubr\n",
+ "print 'For the bench unit'\n",
+ "print '\\tWith Eqn.(11), Rise velocity=%.3fm/s'%ubb1\n",
+ "print '\\tWith Werthers procedure, Rise velocity=%.2fm/s'%ubb2\n",
+ "print '\\tAverage rise velocity=%.2fm/s'%ubb\n",
+ "print '\\tRise velocity of upflowing emulsion=%.2fm/s'%ueb\n",
+ "print 'For the pilot unit'\n",
+ "print '\\tWith Eqn.(11), Rise velocity=%.2fm/s'%ubp1\n",
+ "print '\\tWith Werthers procedure, Rise velocity=%.2fm/s'%ubp2\n",
+ "print '\\tAverage rise velocity=%.2fm/s'%ubp\n",
+ "print '\\tRise velocity of upflowing emulsion=%.2fm/s'%uep\n",
+ "print 'Scale-Up Alternative 1.'\n",
+ "print '\\tOuter diameter of tube(cm)'\n",
+ "print '\\tPitch(cm)'\n",
+ "n=len(dib);\n",
+ "j=0;\n",
+ "while j<n:\n",
+ " print '\\t\\t%d'%dib[j],\n",
+ " print '\\t\\t\\t%.2f'%li[j]\n",
+ " j=j+1;\n",
+ "\n",
+ "print '\\tSuitable arrangement'\n",
+ "print '\\t\\tOuter Diameter=%dcm\\tPitch:Diameter ratio=%.2f'%(dib[1],(li[1]/dib[1]))\n",
+ "print 'Scale-Up Alternative 2.'\n",
+ "print '\\tStatic bed height for commercial unit=%fm'%Lmp\n",
+ "print '\\tOuter diameter of tube(cm)'\n",
+ "print '\\tPitch(cm)'\n",
+ "n=len(dip);\n",
+ "j=0;\n",
+ "\n",
+ "while j<n:\n",
+ " print '\\t\\t%d'%dip[j],\n",
+ " print '\\t\\t\\t%.2f'%lip[j]\n",
+ " j=j+1;\n",
+ "\n",
+ "print '\\tSuitable arrangement'\n",
+ "print '\\t\\tOuter Diameter=%dcm\\tPitch:Diameter ratio=%.2f'%(dip[2],(lip[2]/dip[2]))\n",
+ "print '\\t\\t\\t\\tFraction of bed in bubbles\\tVoid fraction of bed\\tStatic bed height(m)\\tHeight of bubbling bed(m)'\n",
+ "print '\\t\\t\\t\\t---------------------------------------------------------------------------------------------------------'\n",
+ "print 'Bench unit\\tID=%fm\\t%f\\t\\t\\t%f\\t\\t%f\\t\\t%f'%(dtb/100.,deltab,ephsilonfb,Lmb,Lfb)\n",
+ "print 'Commercial unit\\tID=%fm\\t%f\\t\\t\\t%f\\t\\t%f\\t\\t%f'%(dtp,deltap,ephsilonfp,Lmp,Lfp)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rise velocity of bubble=0.386m/s\n",
+ "For the bench unit\n",
+ "\tWith Eqn.(11), Rise velocity=1.117m/s\n",
+ "\tWith Werthers procedure, Rise velocity=1.02m/s\n",
+ "\tAverage rise velocity=1.07m/s\n",
+ "\tRise velocity of upflowing emulsion=0.68m/s\n",
+ "For the pilot unit\n",
+ "\tWith Eqn.(11), Rise velocity=1.61m/s\n",
+ "\tWith Werthers procedure, Rise velocity=1.53m/s\n",
+ "\tAverage rise velocity=1.57m/s\n",
+ "\tRise velocity of upflowing emulsion=1.18m/s\n",
+ "Scale-Up Alternative 1.\n",
+ "\tOuter diameter of tube(cm)\n",
+ "\tPitch(cm)\n",
+ "\t\t5 \t\t\t9.91\n",
+ "\t\t10 \t\t\t15.35\n",
+ "\t\t15 \t\t\t20.31\n",
+ "\t\t20 \t\t\t25.07\n",
+ "\tSuitable arrangement\n",
+ "\t\tOuter Diameter=10cm\tPitch:Diameter ratio=1.54\n",
+ "Scale-Up Alternative 2.\n",
+ "\tStatic bed height for commercial unit=2.941439m\n",
+ "\tOuter diameter of tube(cm)\n",
+ "\tPitch(cm)\n",
+ "\t\t10 \t\t\t28.16\n",
+ "\t\t15 \t\t\t34.49\n",
+ "\t\t20 \t\t\t39.83\n",
+ "\t\t25 \t\t\t44.53\n",
+ "\tSuitable arrangement\n",
+ "\t\tOuter Diameter=20cm\tPitch:Diameter ratio=1.99\n",
+ "\t\t\t\tFraction of bed in bubbles\tVoid fraction of bed\tStatic bed height(m)\tHeight of bubbling bed(m)\n",
+ "\t\t\t\t---------------------------------------------------------------------------------------------------------\n",
+ "Bench unit\tID=0.200000m\t0.274171\t\t\t0.709668\t\t2.000000\t\t3.788769\n",
+ "Commercial unit\tID=1.000000m\t0.185857\t\t\t0.674343\t\t2.941439\t\t4.967774\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 161\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Reactor Scale-up for Geldart B Catalyst\n",
+ "\n",
+ "#Variable declaration\n",
+ "dtb=20; #ID of bench-scale reactor\n",
+ "dtp=1; #ID of pilot reactor\n",
+ "dpbar=200; #Average particle size in micrometer\n",
+ "ephsilonmf=0.50; #Void fraction at minimum fluidization condition\n",
+ "ephsilonmb=0.50; #Void fraction \n",
+ "uo=30; #Superficial gas velocity in cm/s\n",
+ "Lmb=2; #Length of fixed bed in m\n",
+ "umf=3; #Velocity at minimum fluidization condition in cm/s\n",
+ "umb=3; #Velocity at in cm/s\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "pi=3.142857;\n",
+ "\n",
+ "#CALCULATION\n",
+ "#In the small bench unit\n",
+ "c=1;\n",
+ "ubb=c*((uo-umf)/100.0)+0.35*(g*(dtb/100.0))**0.5;#Velocity using Eqn.(5.22)\n",
+ "zsb=60*(dtb)**0.175;#Height using Eqn.(5.24)\n",
+ "\n",
+ "#In the large pilot unit\n",
+ "ubp=c*((uo-umf)/100.0)+0.35*(g*dtp)**0.5;#Velocity using Eqn.(5.22)\n",
+ "zsp=60*(dtp*100)**0.175;#Height using Eqn.(5.24)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Condition at which bubbles transform into slugs'\n",
+ "print 'For tha small bench unit\\t\\tVelocity=%fm/s\\t\\tHeight above distributor plate=%fm'%(ubb,zsb/100.)\n",
+ "print 'For tha large pilot unit\\t\\tVelocity=%fm/s\\t\\tHeight above distributor plate=%fm'%(ubp,zsp/100.);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Condition at which bubbles transform into slugs\n",
+ "For tha small bench unit\t\tVelocity=0.760000m/s\t\tHeight above distributor plate=1.013518m\n",
+ "For tha large pilot unit\t\tVelocity=1.365673m/s\t\tHeight above distributor plate=1.343233m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch7.ipynb b/Fluidization_Engineering/ch7.ipynb
new file mode 100644
index 00000000..d666d2ab
--- /dev/null
+++ b/Fluidization_Engineering/ch7.ipynb
@@ -0,0 +1,405 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Entrainment and Elutriation from Fluidized Beds"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Entrainment from Fine Particle Beds with High Freeboard\n",
+ "\n",
+ "#Variable declaration\n",
+ "rhog=5.51; #Density of gas in kg/m**3\n",
+ "rhos=1200; #Density of solid in kg/m**3\n",
+ "dpbar=130; #Average size of particles in micrometer\n",
+ "uo=0.61; #Superficial gas velocity in m/s\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Assuming that freeboard in higher than TDH, computation of entrainment rate by Zenz & Weil's method\n",
+ "x=(uo**2)/(g*(dpbar*10**-6)*rhos**2);#Calculation of value of x-axis for Fig.(6), page 175\n",
+ "y=1.2; # Value of y-axis from Fig.(6)\n",
+ "Gsstar=y*rhog*uo; #Computation of rate of entrainment\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nRate of entrainment=%.2fkg/m**2s'%Gsstar\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rate of entrainment=4.03kg/m**2s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 180\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Entrainment from Large Particle Beds with High Freeboard\n",
+ "\n",
+ "#Variable declaration\n",
+ "x=0.2; #Fraction of fines in the bed\n",
+ "Gsstar=4.033320 #Rate of entrainment in kg/m**2s(from Exa.1)\n",
+ "\n",
+ "#CALCULATION\n",
+ "Gsstar1=x*Gsstar;#Rate of entrainment by Eqn.(3)\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nRate of entrainment=%.3fkg/m**2s'%Gsstar1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rate of entrainment=0.807kg/m**2s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 181\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Entrainment from Beds with a Wide Size Distribution of Solids\n",
+ "\n",
+ "#Variable declaration\n",
+ "rhog=5.51; #Density of gas in kg/m**3\n",
+ "rhos=1200; #Density of solid in kg/m**3\n",
+ "uo=0.61; #Superficial gas velocity in m/s\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "dp=[10,30,50,70,90,110,130]; #Diameter of particle in micrometer\n",
+ "p=[0.,0.0110,0.0179,0.0130,0.0058,0.0020,0.];\n",
+ "pi=3.142857;\n",
+ "dt=6;\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(dp);\n",
+ "i=0;\n",
+ "x = [0,0,0,0,0,0,0]\n",
+ "while i<n:\n",
+ " x[i]=(uo**2)/(g*(dp[i]*10**-6)*rhos**2);#Computation of value of x-axis for Fig.(6), page 175)\n",
+ " i=i+1;\n",
+ "\n",
+ "y=[40,12,6,3.2,2.,1.3,1];#Value of y-axis corresponding to each value of x-axis\n",
+ "y1 = []\n",
+ "for i in range(n):\n",
+ " y1.append(y[i]*p[i]);\n",
+ "i=0;\n",
+ "k=0;\n",
+ "\n",
+ "while i<n-2:\n",
+ " y1[i]=(y[i]*p[i]);\n",
+ " k=k+((0.5)*(dp[i+1]-dp[i])*(y1[i+1]+y1[i]));#Integration using Trapezoidal rule\n",
+ " i=i+1;\n",
+ "rhosbar=k*rhog;#Computation of solid loading\n",
+ "te=(pi/4)*(dt**2)*rhosbar*uo;#Computation of total entrainment\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nSolid loading =%.1fkg/m**3'%rhosbar\n",
+ "print '\\nTotal Entrainment =%.0fkg/s'%te\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Solid loading =32.4kg/m**3\n",
+ "\n",
+ "Total Entrainment =559kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 181\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#k* from Steady State Experiments\n",
+ "\n",
+ "#Variable declaration\n",
+ "dp=[40,60,80,100,120]; #Diameter of particle in micrometer\n",
+ "uo=0.381; #Superficial gas velocity in m/s\n",
+ "\n",
+ "#CALCULATION\n",
+ "Gs=0.9;#Rate of entrainment in kg/m**2 s from Fig.3(a)\n",
+ "pb = [0.45,1.00,1.25,1.00,0.60];#Size distribution for bed particles from Fig.3(b)\n",
+ "pe=[1.20,2.00,1.25,0.45,0.10]; #Size distribution for entrained particles from Fig.3(b)\n",
+ "n=len(dp);\n",
+ "for i in range(n):\n",
+ " pb[i] = pb[i]/100.\n",
+ " pe[i] = pe[i]/100.\n",
+ "i=0;\n",
+ "ki = []\n",
+ "while i<n:\n",
+ " ki.append((Gs*pe[i])/pb[i]);#Calculation of ki* using Eqn.(13)\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\ndpi(micrometer)',\n",
+ "print '\\t100pb(dpi)(micrometer**-1)',\n",
+ "print '\\t100pe(dpi)(micrometer**-1)',\n",
+ "print '\\tki*(kg/m**2 s)'\n",
+ "\n",
+ "j=0;\n",
+ "while j<n:\n",
+ " print '%f'%dp[j],\n",
+ " print '\\t%f'%(100*pb[j]),\n",
+ " print '\\t\\t\\t%f'%(100*pe[j]),\n",
+ " print '\\t\\t\\t%f'%ki[j]\n",
+ " j=j+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dpi(micrometer) \t100pb(dpi)(micrometer**-1) \t100pe(dpi)(micrometer**-1) \tki*(kg/m**2 s)\n",
+ "40.000000 \t0.450000 \t\t\t1.200000 \t\t\t2.400000\n",
+ "60.000000 \t1.000000 \t\t\t2.000000 \t\t\t1.800000\n",
+ "80.000000 \t1.250000 \t\t\t1.250000 \t\t\t0.900000\n",
+ "100.000000 \t1.000000 \t\t\t0.450000 \t\t\t0.405000\n",
+ "120.000000 \t0.600000 \t\t\t0.100000 \t\t\t0.150000\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 181\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Comparing Predictions for k*\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "rhog=1.217; #Density of gas in kg/m**3\n",
+ "myu=1.8E-5; #Viscosity of gas in kg/m s\n",
+ "umf=0.11; #Velocity at minimum fluidization condition in m/s\n",
+ "rhos=2000.0; #Density of solid in kg/m**3\n",
+ "uo=1.0; #Superficial gas velocity in m/s\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "dp=[30,40,50,60,80,100,120]; #Diameter of particle in micrometer\n",
+ "uti=[0.066,0.115,0.175,0.240,0.385,0.555,1.0];#Terminal velocity of particles in m/s\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(dp);\n",
+ "i=0;\n",
+ "Ret = []\n",
+ "kistar1 = []\n",
+ "kistar2 = []\n",
+ "kistar3 = []\n",
+ "kistar4 = []\n",
+ "kistar5 = []\n",
+ "kistar6 = []\n",
+ "x1 = []\n",
+ "x2 = []\n",
+ "\n",
+ "while i<n:\n",
+ " #Using Yagi & Aochi's correlation\n",
+ " Ret.append((rhog*(uti[i])*dp[i]*10**-6)/myu)\n",
+ " a =((myu*((uo-uti[i])**2))/(g*(dp[i]*10**-6)**2))*(0.0015*(Ret[i]**0.5)+(0.01*(Ret[i]**1.2)));\n",
+ " kistar1.append(a)\n",
+ " #Using Wen & Hasinger's correlation\n",
+ " a=(((1.52E-5)*((uo-uti[i])**2)*rhog)/(g*dp[i]*10**-6)**0.5)*(Ret[i]**0.725)*((rhos-rhog)/rhog)**1.15;\n",
+ " kistar2.append(a)\n",
+ " #Using Merrick & Highley's correlation\n",
+ " a=uo*rhog*(0.0001+130*math.exp(-10.4*((uti[i]/uo)**0.5)*((umf/(uo-umf))**0.25)));\n",
+ " kistar3.append(a)\n",
+ " #Using Geldart's correlation\n",
+ " a=23.7*uo*rhog*math.exp(-5.4*(uti[i]/uo));\n",
+ " kistar4.append(a)\n",
+ " #Using Zenz & Weil's procedure\n",
+ " a=(uo**2)/(g*(dp[i]*10.0**-6)*rhos**2);#Computation of value of x-axis for Fig.(6), page 175)\n",
+ " x1.append(a)\n",
+ " y1=[12.2,8.6,6.4,4.9,2.75,1.8,1.2];#Value of y-axis corresponding to each value of x-axis\n",
+ " kistar5.append(y1[i]*rhog*uo)\n",
+ " #Using Gugnoni & Zenz's procedure\n",
+ " a=(uo-uti[i])/((g*dp[i]*10**-6)**0.5);#Computation of value of x-axis for Fig.(6), page 175)\n",
+ " x2.append(a)\n",
+ " y=[5.8,5.4,3.2,2.8,1.3,0.6,0];#Value of y-axis corresponding to each value of x-axis\n",
+ " kistar6.append(y[i]*rhog*uo)\n",
+ " i=i+1;\n",
+ "\n",
+ "i=0;\n",
+ "print 'dp(micrometer)',\n",
+ "print '\\tYagi & Aochi',\n",
+ "print '\\tWen & Hashinger',\n",
+ "print '\\t\\tMerrick & Highley',\n",
+ "print '\\tGeldart et al.',\n",
+ "print '\\t\\tZenz & Well',\n",
+ "print '\\t\\tGugnoni & Zenz'\n",
+ "while i<n:\n",
+ " print '\\n%f'%dp[i],\n",
+ " print '\\t%f'%kistar1[i],\n",
+ " print '\\t%f'%kistar2[i],\n",
+ " print '\\t\\t%f'%kistar3[i],\n",
+ " print '\\t\\t%f'%kistar4[i],\n",
+ " print '\\t\\t%f'%kistar5[i],\n",
+ " print '\\t\\t%f'%kistar6[i],\n",
+ " i=i+1;\n",
+ "\n",
+ "#Note: There is huge deviation of the calculated answer and the answer given in the textbook for the correlation of Merrick & Highley. There is a contradiction in the correlation used in the problem and the one given in page 179. \n",
+ "#We tried to retrieve the original paper i.e. D.Merrick and J.Highley, AICHE J., 6, 220(1960). But the effort was not fruitful.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dp(micrometer) \tYagi & Aochi \tWen & Hashinger \t\tMerrick & Highley \tGeldart et al. \t\tZenz & Well \t\tGugnoni & Zenz\n",
+ "\n",
+ "30.000000 \t2.571188 \t1.092184 \t\t32.451340 \t\t20.195582 \t\t14.847400 \t\t7.058600 \n",
+ "40.000000 \t2.965958 \t1.564720 \t\t19.546385 \t\t15.500369 \t\t10.466200 \t\t6.571800 \n",
+ "50.000000 \t3.240381 \t1.938471 \t\t11.993076 \t\t11.210646 \t\t7.788800 \t\t3.894400 \n",
+ "60.000000 \t3.289995 \t2.154988 \t\t7.713841 \t\t7.892113 \t\t5.963300 \t\t3.407600 \n",
+ "80.000000 \t2.852535 \t2.120728 \t\t3.447977 \t\t3.606955 \t\t3.346750 \t\t1.582100 \n",
+ "100.000000 \t1.883718 \t1.521994 \t\t1.600171 \t\t1.440318 \t\t2.190600 \t\t0.730200 \n",
+ "120.000000 \t0.000000 \t0.000000 \t\t0.332158 \t\t0.130271 \t\t1.460400 \t\t0.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6, Page 190\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Entrainment from a Short Vessel Ht<TDH\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "dpbar=60.0; #Average size of particles in micrometer\n",
+ "rhog=1.3; #Density of gas in kg/m**3\n",
+ "rhos=1500.0; #Density of solid in kg/m**3\n",
+ "umf=0.003; #Velocity at minimum fluidization condition in m/s\n",
+ "uo=0.503; #Superficial gas velocity in m/s\n",
+ "g=9.80; #Acceleration due to gravity in m/s**2\n",
+ "Hf=2.0; #Height at which the cyclone inlet is to be located in m\n",
+ "\n",
+ "#CALCULATION\n",
+ "y=(uo**2)/(g*(dpbar*10**-3)*rhos**2);#Calculation of value of y-axis for Fig.(6), page 175\n",
+ "x=1;#Value of x-axis from Fig.(6), page 175\n",
+ "Gsstar=x*rhog*uo;#Computation of rate of entrainment\n",
+ "Gsuo=5.0;#Ejection rate pf particles in kg/m**2 s from Fig.(11), page 188\n",
+ "a=0.72/uo;#From Fig.(12), page 189\n",
+ "Gs=Gsstar+(Gsuo-Gsstar)*math.exp(-a*Hf);\n",
+ "p=((Gs-Gsstar)/Gsstar)*100.0;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\nRate of entrainment from short bed=%.3fkg/m**2s'%Gs\n",
+ "print '\\nThis entrainment is %f percent higher than it would be if the gas exit were at the TDH'%p\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rate of entrainment from short bed=0.902kg/m**2s\n",
+ "\n",
+ "This entrainment is 37.955972 percent higher than it would be if the gas exit were at the TDH\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch8.ipynb b/Fluidization_Engineering/ch8.ipynb
new file mode 100644
index 00000000..9fed0363
--- /dev/null
+++ b/Fluidization_Engineering/ch8.ipynb
@@ -0,0 +1,218 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : High Velocity Fludization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 206\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from numpy import zeros\n",
+ "from scipy.optimize import fsolve \n",
+ "\n",
+ "\n",
+ "#INPUT\n",
+ "Lmf=2.4; #Length of bed at minimum fluidized condition in m\n",
+ "uo=[2.,4.,6.]; #Superficial gas velocity in m/s\n",
+ "GsII=100.; #Solid circulation rate in kg/m**2 s for Mode II\n",
+ "uoIII=4.; #Superficial gas velocity in m/s for Mode III\n",
+ "GsIII=[42.,50.,100.,200.,400.]; #Solid circulation rate in kg/m**2 s for Mode III\n",
+ "GsIV=[70.,100.,120.]; #Solid circulation rate in kg/m**2 s for Mode IV\n",
+ "dt=0.4; #Column diamter in m\n",
+ "Ht=10.; #Height of column in m\n",
+ "rhos=1000.; #Density of solid in kg/m**3\n",
+ "dpbar=55.; #Particle diameter in micrometer\n",
+ "ephsilonmf=0.5; #Void fraction at minimum fluidization condition\n",
+ "\n",
+ "#CALCULATION\n",
+ "#Mode I\n",
+ "ephsilonstar=0.01; #Saturation carrying capacity of gas\n",
+ "ephsilonsd=[0.2,0.16,0.14]; #Solid holdup in lower dense region from Fig.8(b) for various uo\n",
+ "n=len(uo);\n",
+ "i=0;\n",
+ "Hfguess=2.; #Guess value of height\n",
+ "a = zeros(n)\n",
+ "Hf = zeros(n)\n",
+ "Hd = zeros(n)\n",
+ "ephsilonse = zeros(n)\n",
+ "GsI = zeros(n)\n",
+ "# endfunction\n",
+ " \n",
+ "while i<n:\n",
+ " a[i]= 3./uo[i]; #Decay consmath.tant\n",
+ " def solver_func(Hf): #Function defined for solving the system\n",
+ " return Lmf*(1-ephsilonmf)-((ephsilonsd[i]-(ephsilonstar+(ephsilonsd[i]-ephsilonstar)*math.exp(-a[i]*Hf)))/a[i])-Ht*ephsilonsd[i]+Hf*(ephsilonsd[i]-ephsilonstar);\n",
+ " \n",
+ " Hf[i] = fsolve(solver_func,1E-6)\n",
+ " Hd[i]=Ht-Hf[i];#Height of lower densce region\n",
+ " ephsilonse[i]=ephsilonstar+(ephsilonsd[i]-ephsilonstar)*math.exp(-a[i]*Hf[i]);#Solid holdup at exit\n",
+ " GsI[i]=rhos*uo[i]*ephsilonse[i];#Solid circulation rate from Eqn.(4)\n",
+ " i=i+1;\n",
+ "\n",
+ "#Mode II\n",
+ "i=0;\n",
+ "Hfguess2=2;#Guess value of height\n",
+ "ephsilonseII = zeros(n)\n",
+ "HdII = zeros(n)\n",
+ "LmfII = zeros(n)\n",
+ "HfII = zeros(n)\n",
+ "while i<n:\n",
+ " ephsilonseII[i]=GsII/(rhos*uo[i]);#Solid holdup at exit\n",
+ " def solver_func1(Hf): #Function defined for solving the system\n",
+ " return ephsilonseII[i]-ephsilonstar-(ephsilonsd[i]-ephsilonstar)*math.exp(-a[i]*Hf);#From Eqn.(7)\n",
+ " HfII[i] = fsolve(solver_func1,1E-6)\n",
+ " HdII[i]=Ht-HfII[i];#Height of lower dense region\n",
+ " #Length of bed minimum fluidization condtion\n",
+ " LmfII[i]=(1-ephsilonmf)**-1*((ephsilonsd[i]-ephsilonseII[i])/a[i])+Ht*ephsilonsd[i]-HfII[i]*(ephsilonsd[i]-ephsilonstar);\n",
+ " i=i+1;\n",
+ "\n",
+ "#Mode III\n",
+ "aIII = 3./uoIII; #Decay consmath.tant\n",
+ "ephsilonsdIII=0.16; #Solid holdup at lower dense region\n",
+ "i=0;\n",
+ "m=len(GsIII);\n",
+ "Hfguess3=2;#Guess value of height \n",
+ "ephsilonseIII = zeros(m)\n",
+ "HdIII = zeros(m)\n",
+ "ephsilonseIII = zeros(m)\n",
+ "LmfIII = zeros(m)\n",
+ "HfIII = zeros(m)\n",
+ "while i<m:\n",
+ " ephsilonseIII[i]=GsIII[i]/(rhos*uoIII);#Solid holdup at exit\n",
+ " def solver_func2(Hf): #Function defined for solving the system\n",
+ " return ephsilonseIII[i]-ephsilonstar-(ephsilonsdIII-ephsilonstar)*math.exp(-aIII*Hf);#From Eqn.(7)\n",
+ "\n",
+ " HfIII[i] = fsolve(solver_func2,1E-6)\n",
+ " HdIII[i]=Ht-HfIII[i]; #Height of lower dense region\n",
+ " #Length of bed at minimum fluidization condition\n",
+ " LmfIII[i]=(1-ephsilonmf)**-1*(((ephsilonsdIII-ephsilonseIII[i])/aIII)+Ht*ephsilonsdIII-HfIII[i]*(ephsilonsdIII-ephsilonstar));\n",
+ " i=i+1;\n",
+ "\n",
+ "#Mode IV\n",
+ "i=0;\n",
+ "Hfguess4=2;#Guess value of height\n",
+ "aIV = zeros(n)\n",
+ "ephsilonseIV = zeros(n)\n",
+ "HdIV = zeros(n)\n",
+ "HfIV = zeros(n)\n",
+ "LmfIV = zeros(n)\n",
+ "while i<n:\n",
+ " aIV[i]=3./uo[i]; #Decay consmath.tant\n",
+ " ephsilonseIV[i]=GsIV[i]/(rhos*uo[i]); #Solid holdup at exit\n",
+ " def solver_func3(Hf): #Function defined for solving the system\n",
+ " return ephsilonseIV[i]-ephsilonstar-(ephsilonsd[i]-ephsilonstar)*math.exp(-aIV[i]*Hf); #From Eqn.(7)\n",
+ "\n",
+ " HfIV[i] = fsolve(solver_func3,1E-6)\n",
+ " HdIV[i]=Ht-HfIV[i];#Height of lower dense region\n",
+ " #Length of bed at minimum fluidization condition\n",
+ " LmfIV[i]=(1-ephsilonmf)**-1*(((ephsilonsd[i]-ephsilonseIV[i])/aIV[i])+Ht*ephsilonsd[i]-HfIV[i]*(ephsilonsd[i]-ephsilonstar));\n",
+ " i=i+1;\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'Mode I';\n",
+ "print '\\tuom/s\\t\\tephsilonse-\\tHfm\\t\\tHdm\\t\\tGskg/m**2 s';\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%f\\t%f\\t%f\\t%f\\t%f'%(uo[i],ephsilonse[i],Hf[i],Hd[i],GsI[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "print 'Mode II';\n",
+ "print '\\tuom/s\\t\\tephsilonse-\\tHfm\\t\\tHdm\\t\\tLmfm';\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%f\\t%f\\t%f\\t%f\\t%f'%(uo[i],ephsilonseII[i],HfII[i],HdII[i],LmfII[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "print 'Mode III';\n",
+ "print '\\tGskg/m** s\\tephsilonse-\\tHfm\\t\\tHdm\\t\\tLmfm';\n",
+ "i=0;\n",
+ "while i<m:\n",
+ " print '\\t%f\\t%f\\t%f\\t%f\\t%f'%(GsIII[i],ephsilonseIII[i],HfIII[i],HdIII[i],LmfIII[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "print 'Mode IV';\n",
+ "print '\\tuom/s\\t\\tGskg/m**2 s\\tephsilonse-\\tHfm\\t\\tLmfm';\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '\\t%f\\t%f\\t%f\\t%f\\t%f'%(uo[i],GsIV[i],ephsilonseIV[i],HfIV[i],LmfIV[i]);\n",
+ " i=i+1;\n",
+ "\n",
+ "#====================================END OF PROGRAM ======================================================"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mode I\n",
+ "\tuom/s\t\tephsilonse-\tHfm\t\tHdm\t\tGskg/m**2 s\n",
+ "\t2.000000\t0.192856\t0.025551\t9.974449\t385.711493\n",
+ "\t4.000000\t0.017870\t3.930041\t6.069959\t71.481458\n",
+ "\t6.000000\t0.037349\t3.117707\t6.882293\t224.094133\n",
+ "Mode II\n",
+ "\tuom/s\t\tephsilonse-\tHfm\t\tHdm\t\tLmfm\n",
+ "\t2.000000\t0.050000\t1.038763\t8.961237\t2.002635\n",
+ "\t4.000000\t0.025000\t3.070113\t6.929887\t1.499483\n",
+ "\t6.000000\t0.016667\t5.940829\t4.059171\t1.121026\n",
+ "Mode III\n",
+ "\tGskg/m** s\tephsilonse-\tHfm\t\tHdm\t\tLmfm\n",
+ "\t42.000000\t0.010500\t7.605043\t2.394957\t1.317154\n",
+ "\t50.000000\t0.012500\t5.459126\t4.540874\t1.955596\n",
+ "\t100.000000\t0.025000\t3.070113\t6.929887\t2.638966\n",
+ "\t200.000000\t0.050000\t1.762341\t8.237659\t2.964631\n",
+ "\t400.000000\t0.100000\t0.681101\t9.318899\t3.155670\n",
+ "Mode IV\n",
+ "\tuom/s\t\tGskg/m**2 s\tephsilonse-\tHfm\t\tLmfm\n",
+ "\t2.000000\t70.000000\t0.035000\t1.352099\t3.706202\n",
+ "\t4.000000\t100.000000\t0.025000\t3.070113\t2.638966\n",
+ "\t6.000000\t120.000000\t0.020000\t5.129899\t1.946226\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/ch9.ipynb b/Fluidization_Engineering/ch9.ipynb
new file mode 100644
index 00000000..f17e97e9
--- /dev/null
+++ b/Fluidization_Engineering/ch9.ipynb
@@ -0,0 +1,268 @@
+{
+ "metadata": {
+ "name": "ch9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Solid Movement Mixing Segregation and Staging"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 218\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Vertical Movement of Solids\n",
+ "\n",
+ "#Variable declaration\n",
+ "umf=0.015; #Velocity at minimum fluidization condition in m/s\n",
+ "ephsilonmf=0.5; #Void fraction at minimum fluidization condition\n",
+ "uo=0.1; #Superficial gas velocity in m/s\n",
+ "delta=0.2; #Bed fraction in bubbles\n",
+ "db=0.06; #Equilibrium bubble size in m\n",
+ "dt=[0.1,0.3,0.6,1.5]; #Various vessel sizes in m\n",
+ "ub=[0.4,0.75,0.85,1.1]; #Bubble velocity in m/s\n",
+ "Dsv=[0.03,0.11,0.14,0.23]; #Reported values of vertical dispersion coefficient\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(ub);\n",
+ "i=0;\n",
+ "fw1=2;#Wake fraction from Hamilton et al.\n",
+ "fw2=0.32;#Wake fraction from Fig.(5.8)\n",
+ "fw=(fw1+fw2)*0.5;#Average value of wake fraction\n",
+ "Dsv1 = []\n",
+ "Dsv2 = []\n",
+ "while i<n:\n",
+ " Dsv1.append(12*((uo*100)**0.5)*((dt[i]*100)**0.9));#Vertical distribution coefficient from Eqn.(3)\n",
+ " Dsv2.append((fw**2*ephsilonmf*delta*db*ub[i]**2)/(3*umf));#Vertical distribution coefficient from Eqn.(12)\n",
+ " i=i+1;\n",
+ "\n",
+ "print Dsv1\n",
+ "\n",
+ "#OUTPUT\n",
+ "print '\\t\\tVertical dispersion coefficient(m**2/s)'\n",
+ "print 'Vessel Size(m)',\n",
+ "print '\\tFrom Experiment',\n",
+ "print '\\tFrom Eqn.(3)',\n",
+ "print '\\tFrom Eqn.(12)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%.2f'%dt[i],\n",
+ " print '\\t%.3f'%Dsv[i],\n",
+ " print '\\t%.2f'%(Dsv1[i]/10**4),\n",
+ " print '\\t%.2f'%Dsv2[i]\n",
+ " i=i+1; \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[301.42637178114967, 810.1965234492834, 1511.8801720132121, 3448.7632274996104]\n",
+ "\t\tVertical dispersion coefficient(m**2/s)\n",
+ "Vessel Size(m) \tFrom Experiment \tFrom Eqn.(3) \tFrom Eqn.(12)\n",
+ "0.10 \t0.030 \t0.03 \t0.03\n",
+ "0.30 \t0.110 \t0.08 \t0.10\n",
+ "0.60 \t0.140 \t0.15 \t0.13\n",
+ "1.50 \t0.230 \t0.34 \t0.22\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 222\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Horizontal Drift Of Solids\n",
+ "\n",
+ "#Variable declaration\n",
+ "Lmf=0.83; #Length of bed at minimum fluidization condition in m\n",
+ "dp=450.0; #Average particle size in micrometer\n",
+ "ephsilonmf=0.42; #Void fraction at minimum fluidization condition\n",
+ "umf=0.17; #Velocity at minimum fluidization condition in m/s\n",
+ "uo=[0.37,0.47,0.57,0.67]; #Superficial gas velocity in m/s\n",
+ "Dsh=[0.0012,0.0018,0.0021,0.0025]; #Horizontal Drift Coefficient from Experiment in m**2/s\n",
+ "db=[0.10,0.14]; #Equilibrium bubble size in m\n",
+ "g=9.81; #Acceleration due to gravity in m/s**2\n",
+ "\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(uo);\n",
+ "m=len(db);\n",
+ "k=0;\n",
+ "alpha=0.77;#Since we are not dealing with Geldart A or AB solids\n",
+ "uf=umf/ephsilonmf;\n",
+ "ubr = []\n",
+ "ub = []\n",
+ "delta = []\n",
+ "Dshc = []\n",
+ "for j in range(m):\n",
+ " for i in range(n):\n",
+ " ubr.append(0.711*(db[j]*g)**0.5);#Rise velocity of a single bubble in m/s\n",
+ " ub.append(uo[i]-umf+ubr[k]);#Rise velocity of bubbles in a bubbling bed\n",
+ " delta.append((uo[i]-umf)/(ub[k]+umf));#Bed fraction in bubbles\n",
+ " if ubr[i]>uf:\n",
+ " Dshc.append((3/16.0)*(delta[k]/(1-delta[k]))*((alpha**2*db[j]*ubr[k]*((((ubr[k]+2*uf)/(ubr[k]-uf))**(1.0/3))-1))));\n",
+ " #Horizontal Distribution coeff. from Eqn.(14)\n",
+ " else:\n",
+ " Dsh.append((3.0/16)*(delta/(1-delta))*(alpha**2*umf*db/ephsilonmf))\n",
+ " #Horizontal Distribution coeff. from Eqn.(15)\n",
+ " Dshc.append((3/16.0)*(delta[k]/(1-delta[k]))*((alpha**2*db[j]*ubr[k]*((((ubr[k]+2*uf)/(ubr[k]-uf))**(1/3.0))-1))));#Horizontal Distribution coeff. from Eqn.(14)\n",
+ " k=k+1;\n",
+ "i=0;\n",
+ "j=0;\n",
+ "k=0;\n",
+ "while k<m*n:\n",
+ " print 'Snce we do not have ub=%fm/s>>uf=%fm/s we use Eqn.(14).'%(ub[k],uf)\n",
+ " print 'Gas Velocity(m/s)'\n",
+ " print '\\tHorizontal Drift Coefficient Calculated(m**2/s)'\n",
+ " print '\\tHorizontal Drift Coefficient from Experiment(m**2/s)'\n",
+ " while j<m:\n",
+ " print 'db=%fm'%db[j]\n",
+ " while i<n:\n",
+ " print '%f'%uo[i],\n",
+ " print '\\t\\t%f'%Dshc[k],\n",
+ " print '\\t\\t\\t\\t\\t%f'%Dsh[i]\n",
+ " i=i+1; \n",
+ " k=k+1;\n",
+ " i=0;\n",
+ " j=j+1;\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Snce we do not have ub=0.904213m/s>>uf=0.404762m/s we use Eqn.(14).\n",
+ "Gas Velocity(m/s)\n",
+ "\tHorizontal Drift Coefficient Calculated(m**2/s)\n",
+ "\tHorizontal Drift Coefficient from Experiment(m**2/s)\n",
+ "db=0.100000m\n",
+ "0.370000 \t\t0.001283 \t\t\t\t\t0.001200\n",
+ "0.470000 \t\t0.001283 \t\t\t\t\t0.001800\n",
+ "0.570000 \t\t0.001924 \t\t\t\t\t0.002100\n",
+ "0.670000 \t\t0.001924 \t\t\t\t\t0.002500\n",
+ "db=0.140000m\n",
+ "0.370000 \t\t0.002566 \t\t\t\t\t0.001200\n",
+ "0.470000 \t\t0.002566 \t\t\t\t\t0.001800\n",
+ "0.570000 \t\t0.003207 \t\t\t\t\t0.002100\n",
+ "0.670000 \t\t0.003207 \t\t\t\t\t0.002500\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 232\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design of Baffle Plates\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Gsup=1.5; #Solid interchange rate in kg/m**2plate s\n",
+ "dor=19.1; #Orifice diameter in mm\n",
+ "dp=210; #Particle size in micrometer\n",
+ "uo=0.4; #Superficial gas velocity in m/s\n",
+ "fopen=[0.12,0.17,0.26]; #Open area fraction \n",
+ "pi=3.14;\n",
+ "\n",
+ "#CALCULATION\n",
+ "n=len(fopen);\n",
+ "uor = []\n",
+ "ls1 = []\n",
+ "i=0\n",
+ "while i<n:\n",
+ " uor.append(uo/fopen[i]); #Gas velocity through the orifice\n",
+ " ls1.append(Gsup/fopen[i]);#Flux of solids through the holes\n",
+ " i=i+1;\n",
+ "\n",
+ "ls2=[12,20,25]; #Flux of solids through holes from Fig.13(c) for different uor values\n",
+ "fopen1=0.12; #Open area fraction which gives reasonable fit\n",
+ "lor=math.sqrt(((math.pi/4)*dor**2)/fopen1);#Orifice spacing\n",
+ "\n",
+ "#OUTPUT\n",
+ "print 'fopen',\n",
+ "print '\\t\\tuor(m/s)',\n",
+ "print '\\tls from Eqn.(18)',\n",
+ "print '\\tls from Fig.13(c)'\n",
+ "i=0;\n",
+ "while i<n:\n",
+ " print '%f'%fopen[i],\n",
+ " print '\\t%f'%uor[i],\n",
+ " print '\\t%f'%ls1[i],\n",
+ " print '\\t\\t%f'%ls2[i]\n",
+ " i=i+1; \n",
+ "\n",
+ "print '\\nFor square pitch, the orifice spacing should be %fmm'%lor\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fopen \t\tuor(m/s) \tls from Eqn.(18) \tls from Fig.13(c)\n",
+ "0.120000 \t3.333333 \t12.500000 \t\t12.000000\n",
+ "0.170000 \t2.352941 \t8.823529 \t\t20.000000\n",
+ "0.260000 \t1.538462 \t5.769231 \t\t25.000000\n",
+ "\n",
+ "For square pitch, the orifice spacing should be 48.863850mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluidization_Engineering/screenshots/plotkbckbedb.png b/Fluidization_Engineering/screenshots/plotkbckbedb.png
new file mode 100644
index 00000000..b7c9004b
--- /dev/null
+++ b/Fluidization_Engineering/screenshots/plotkbckbedb.png
Binary files differ
diff --git a/Fluidization_Engineering/screenshots/relationnubedrep.png b/Fluidization_Engineering/screenshots/relationnubedrep.png
new file mode 100644
index 00000000..8919a070
--- /dev/null
+++ b/Fluidization_Engineering/screenshots/relationnubedrep.png
Binary files differ
diff --git a/Fluidization_Engineering/screenshots/relationshebdrep.png b/Fluidization_Engineering/screenshots/relationshebdrep.png
new file mode 100644
index 00000000..173822d6
--- /dev/null
+++ b/Fluidization_Engineering/screenshots/relationshebdrep.png
Binary files differ
diff --git a/Fundamental_of_Electronics_Devices/Ch1.ipynb b/Fundamental_of_Electronics_Devices/Ch1.ipynb
new file mode 100644
index 00000000..34ecc51b
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch1.ipynb
@@ -0,0 +1,375 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Semiconductor Marerials and Crystal Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page No.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.1\n",
+ "#Find the miller indices for a plane.\n",
+ "\n",
+ "#Given\n",
+ "#Length of intercept\n",
+ "l1=2.0\n",
+ "l2=3.0\n",
+ "l3=2.0\n",
+ "\n",
+ "#Calcuation\n",
+ "#reciprocal of intercept\n",
+ "r1=1/l1\n",
+ "r2=1/l2\n",
+ "r3=1/l3\n",
+ "m1=6*r1\n",
+ "m2=6*r2\n",
+ "m3=6*r3\n",
+ "\n",
+ "#Result\n",
+ "print\"Miller indices of the given plane are\",m1,m2,m3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Miller indices of the given plane are 3.0 2.0 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page No.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.2\n",
+ "#Find the miller indices for a plane.\n",
+ "\n",
+ "#Given\n",
+ "#Length of intercept\n",
+ "l1=1.0\n",
+ "l2=2.0\n",
+ "l3=0\n",
+ "\n",
+ "#Calcuation\n",
+ "#reciprocal of intercept\n",
+ "r1=1/l1\n",
+ "r2=1/l2\n",
+ "r3=0\n",
+ "m1=2*r1\n",
+ "m2=2*r2\n",
+ "m3=2*r3\n",
+ "\n",
+ "#Result\n",
+ "print\"Miller indices of the given plane are\",m1,m2,m3\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Miller indices of the given plane are 2.0 1.0 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page No.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.3\n",
+ "#Obtain lattice constant and radius of the atom.\n",
+ "\n",
+ "#Given\n",
+ "V=3*(10**22) #kg/m**3, density of SCC lattice\n",
+ "p=(1/3.0)*10**-22\n",
+ "\n",
+ "#Calculation\n",
+ "n=1 #no. of lattice point \n",
+ "a=(n*p)**(1/3.0) #lattice constant\n",
+ "r=(a*10**8/2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Lattice constant is\",round(a*10**8,2),\"A\"\n",
+ "print\"radius of simple lattice is\",round(r,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lattice constant is 3.22 A\n",
+ "radius of simple lattice is 1.61 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page no.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exampe 1.4\n",
+ "#Determine the density of crystal\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "r=1.278 #in Angstrum\n",
+ "AtomicWeight=63.5 #constant\n",
+ "AvogadroNo=6.023*10**23 #constant\n",
+ "\n",
+ "#Calculation\n",
+ "#For FCC structure a=4*r/math.sqrt(2)\n",
+ "a=4*r*10**-10/math.sqrt(2) #in meter\n",
+ "V=a**3 #in meter**3\n",
+ "#mass of one atom = m\n",
+ "m=AtomicWeight/AvogadroNo #in gm\n",
+ "m=m/1000 #in Kg\n",
+ "n=4 # no. of atoms per unit cell for FCC structure\n",
+ "rho=m*n/V #in Kg/m**3\n",
+ "\n",
+ "#Result\n",
+ "print \"Density of crystal is\",round(rho,2),\"Kg/m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of crystal is 8928.8 Kg/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page no.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.5\n",
+ "#What is Density of silicon crystal .\n",
+ "\n",
+ "#given data\n",
+ "n=4 # no. of atoms per unit cell of silicon\n",
+ "AtomicWeight=28 #constant\n",
+ "AvogadroNo=6.021*10**23 #constant\n",
+ "\n",
+ "#calculation\n",
+ "m=AtomicWeight/AvogadroNo #in gm\n",
+ "m=m/1000 #in Kg\n",
+ "a=5.3 #lattice constant in Angstrum\n",
+ "a=a*10**-10 #in meter\n",
+ "V=a**3 #in meter**3\n",
+ "rho=m*n/V #in Kg/m**3\n",
+ "\n",
+ "#result\n",
+ "print\"Density of silicon crystal is\",round(rho,0),\"Kg/m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of silicon crystal is 1249.0 Kg/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page no.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.5\n",
+ "#What is Surface density in FCC .\n",
+ "\n",
+ "#given data\n",
+ "a=4.75 #lattice constant in Angstrum\n",
+ "a=a*10**-10 #in meter\n",
+ "\n",
+ "#Calculation\n",
+ "dp=2.31/a**2 #in atom/m**2\n",
+ "dp=dp/10**6 #in atom/mm**2\n",
+ "\n",
+ "#Result\n",
+ "print \"Surface density in FCC on (111)Plane is %.e\",dp,\"atoms/mm**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Surface density in FCC on (111)Plane is %.e 1.02382271468e+13 atoms/mm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page no. 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.7\n",
+ "#find the Interpolar distance\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "l=1.539 #in Angstrum\n",
+ "theta=22.5 #in degree\n",
+ "n=1 #order unitless\n",
+ "\n",
+ "#Calculation\n",
+ "d=n*l/(2*math.sin(theta*math.pi/180)) #in Angstrum\n",
+ "\n",
+ "#result\n",
+ "print \"Interpolar distance in Angstrum \",round(d,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Interpolar distance in Angstrum 2.01 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page no. 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.8\n",
+ "#Find the wavelength of X-rays \n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "\n",
+ "theta=16.8/2.0 #in degree\n",
+ "n=2.0 #order unitless\n",
+ "d=0.4 #in nm\n",
+ "\n",
+ "#Calculation\n",
+ "l=(2*d*10**-9*sin(theta*math.pi/180.0))/n #in Angstrum\n",
+ "\n",
+ "#result\n",
+ "print \"wavelength of X-rays in Angstrum \",round(l*10**10,3),\"A\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength of X-rays in Angstrum 0.584 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch2.ipynb b/Fundamental_of_Electronics_Devices/Ch2.ipynb
new file mode 100644
index 00000000..0b7d4443
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch2.ipynb
@@ -0,0 +1,1542 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2 : Energy Bands and Charge Carriers in semiconductor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page No.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.1\n",
+ "#Find probability of an electronic state\n",
+ "\n",
+ "#Given\n",
+ "dE1=0.1 #eV\n",
+ "dE2=-0.1 #eV\n",
+ "k=8.61*10**-5 #Boltzman constant\n",
+ "T=300 #K\n",
+ "\n",
+ "#Calcualtion\n",
+ "import math\n",
+ "FE1=1/(1+math.exp(dE1/(k*T)))\n",
+ "FE2=1/(1+math.exp(dE2/(k*T)))\n",
+ "\n",
+ "#Result\n",
+ "print\"Probability when the energy of the state is above 0.1 eV\",round(FE1,2)\n",
+ "print\"Probability when the energy of the state is below 0.1 eV\",round(FE2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probability when the energy of the state is above 0.1 eV 0.02\n",
+ "Probability when the energy of the state is below 0.1 eV 0.98\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page No. 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the temprature at which there is 1 percent probability\n",
+ "#that a state of 0.30 eV below the fermi energy level will not contain electrons.\n",
+ "\n",
+ "#Exa 2.2\n",
+ "Ef=6.25 #EV fermi energy level\n",
+ "dE=-0.30 #eV\n",
+ "k=8.61*10**-5 #Boltzman constant\n",
+ "fE=0.99\n",
+ "\n",
+ "#calculation\n",
+ "#From the probability formula fE=1/(1+math.exp(dE/(k*T)))\n",
+ "T=(dE)/(k*math.log(1/fE-1))\n",
+ "\n",
+ "#result\n",
+ "print\"The Temprature is\",round(T,1),\"K\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Temprature is 758.3 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page No. 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.3\n",
+ "#Determine the fraction of total no. of electron\n",
+ "\n",
+ "#Given\n",
+ "Eg=0.72 #eV\n",
+ "Ef=0.5*Eg\n",
+ "dE=Eg-Ef #eV\n",
+ "k=8.61*10**-5 #Boltzman constant\n",
+ "T=300 #K\n",
+ "\n",
+ "#Calcualtion\n",
+ "import math\n",
+ "N=1/(1+math.exp(dE/(k*T)))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print\"the fraction of total no. of electron is \",round(N,9)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the fraction of total no. of electron is 8.85e-07\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page No. 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.4\n",
+ "#Calculate the wave length\n",
+ "\n",
+ "#Given\n",
+ "E=300*1.602*10**-19 #eV Energy\n",
+ "m=9.108*10**-31 #kg, mass of electron\n",
+ "h=6.626*10**-34 #Planck constant\n",
+ "\n",
+ "#Calculation\n",
+ "v=math.sqrt(2*E/m)\n",
+ "lam=h*v/E\n",
+ "\n",
+ "#Result\n",
+ "print\"The wavwlength is\",round(lam*10**10,3),\"A\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The wavwlength is 1.416 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page No. 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.5\n",
+ "#Find the ratio of electron to hole concentration ratio\n",
+ "\n",
+ "#given data\n",
+ "ni=1.4*10**18\t\t\t#in atoms/m**3\n",
+ "Nd=1.4*10**24\t\t\t#in atoms/m**3\n",
+ "n=Nd\t\t\t\t#in atoms/m**3\n",
+ "\n",
+ "#Calculation\n",
+ "p=ni**2/n\t\t\t#in atoms/m**3\n",
+ "ratio=n/p\t\t\t#unitless\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of electron to hole concentration : \",round(ratio,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of electron to hole concentration : 1e+12\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page no 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.7\n",
+ "#Calculate the magnitude of current\n",
+ "\n",
+ "#Given\n",
+ "n=10**24 #Electron density\n",
+ "e=1.6*10**-19 #Electron charge\n",
+ "v=0.015 #m/s drift velocity\n",
+ "A=10**-4 #m**2 area\n",
+ "\n",
+ "#Calculation\n",
+ "I=n*e*v/A\n",
+ "\n",
+ "#Result\n",
+ "print\"The magnitude of current is\",round(I/10**8,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnitude of current is 0.24 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page No. 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.8\n",
+ "#calculate (i) Relaxation time (ii)Resistivity of conductor (iii) velocity of electron \n",
+ "\n",
+ "#given data\n",
+ "Ef=5.5\t\t\t#in eV\n",
+ "MUe=7.04*10**-3\t\t#in m**2/V-s\n",
+ "n=5.8*10**28\t\t#in m**-3\n",
+ "e=1.6*10**-19\t\t#constant\n",
+ "m=9.1*10**-31\t\t#in Kg\n",
+ "\n",
+ "#calculation\n",
+ "#part (i)\n",
+ "import math\n",
+ "tau=MUe*m/e\t\t#in sec\n",
+ "rho=1/(n*e*MUe)\t\t#in ohm-m\n",
+ "vF=math.sqrt(2*Ef*1.6*10**-19/m)\n",
+ "\n",
+ "#Result\n",
+ "print\"Relaxation time in sec : \",tau,\"s\"\n",
+ "print\"Resistivity of conductor in ohm-m : \",round(rho,11),\"ohm m\"\n",
+ "print\"velocity of electron with fermi energy is \",round(vF,0),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relaxation time in sec : 4.004e-14 s\n",
+ "Resistivity of conductor in ohm-m : 1.531e-08 ohm m\n",
+ "velocity of electron with fermi energy is 1390707.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page No. 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.9\n",
+ "#Find (i)the valence electrons per unit volume (ii) mobility\n",
+ "\n",
+ "#Given\n",
+ "rho=1.73*10**-8 #resistivity\n",
+ "Tav=2.42*10**-14 #Average Time\n",
+ "e=1.6*10**-19\t\t#constant\n",
+ "m=9.1*10**-31\t\t#in Kg\n",
+ "\n",
+ "#Calculation\n",
+ "n=m/(e**2*Tav*rho)\n",
+ "mu=(e*Tav)/m\n",
+ "\n",
+ "#Result\n",
+ "print\"NO. of free electrons are\",round(n,-26)\n",
+ "print\"mobility of electrons is\",round(mu,3),\"m**2/Vs\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NO. of free electrons are 8.49e+28\n",
+ "mobility of electrons is 0.004 m**2/Vs\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10 page No. 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.10\n",
+ "#calculate Relaxation time and drift velocity\n",
+ "\n",
+ "Ef=100\t\t\t#in V/m Applied electric field\n",
+ "n=6*10**28\t\t#in m**-3\n",
+ "e=1.6*10**-19\t\t#constant electronic charge\n",
+ "m=9.1*10**-31\t\t#in Kg mass of electron\n",
+ "rho=1.5*10**-8 #Density\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "tau=m/(n*e**2*rho)\t\t#in sec\n",
+ "vF=e*Ef*tau/m\n",
+ "\n",
+ "#Result\n",
+ "print\"Relaxation time in sec : \",round(tau,16),\"s\"\n",
+ "print\"velocity of electron with fermi energy is \",round(vF,1),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relaxation time in sec : 3.95e-14 s\n",
+ "velocity of electron with fermi energy is 0.7 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11 Page No.75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exampl 2.11\n",
+ "#Determine charge density, current density ,Current flowing in the wire, Electron drift velocity\n",
+ "\n",
+ "#Given\n",
+ "d=0.002 #m, diameter of pipe\n",
+ "s=5.8*10**7 #Conductivity S/m\n",
+ "mu=0.0032 #m**2/Vs, Electron mobility\n",
+ "e=1.6*10**-19\t\t#constant electronic charge\n",
+ "m=9.1*10**-31\t\t#in Kg mass of electron\n",
+ "E=0.02 #V/m Electric field\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#From eq 2.62\n",
+ "n=s/(e*mu)\n",
+ "J=s*E\n",
+ "I=J*(math.pi*d**2/4.0)\n",
+ "v=mu*E\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge density is\",round(n,-26),\"m**-3\"\n",
+ "print\"current density is\",round(J,6),\"A/m**2\"\n",
+ "print\"curret flowing is\",round(I,3),\"A\"\n",
+ "print\"electron drift velocityis\",round(v,6),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge density is 1.133e+29 m**-3\n",
+ "current density is 1160000.0 A/m**2\n",
+ "curret flowing is 3.644 A\n",
+ "electron drift velocityis 6.4e-05 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12 page no 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.12\n",
+ "#calculate the drift velocity and time\n",
+ "\n",
+ "#Given\n",
+ "rho=0.5 #ohm-m Resistivity\n",
+ "J=100 #A/m**2 Current density\n",
+ "mue=0.4 #m**2/Vs Electron mobility\n",
+ "d=10*10**-6 #m distance\n",
+ "\n",
+ "#calculation\n",
+ "Ve=mue*J*rho\n",
+ "t=d/Ve\n",
+ "\n",
+ "#Result\n",
+ "print\"The drift velocity is \",Ve,\"m/s\"\n",
+ "print\"Time taken by the electron is\",round(t,8),\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drift velocity is 20.0 m/s\n",
+ "Time taken by the electron is 5e-07 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 156
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13 Page No.76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.13\n",
+ "#Calculate drift velocity and time\n",
+ "\n",
+ "#Given\n",
+ "e=1.6*10**-19\t\t#constant electronic charge\n",
+ "m=9.1*10**-31\t\t#in Kg mass of electron\n",
+ "rho=0.039 #ohm-cm resistivity\n",
+ "mu=3600 #cm**2/Vs Carrier mobility\n",
+ "ni=2.5*10**13\n",
+ "\n",
+ "#Calculation \n",
+ "Nd=(1/(rho*e*mu))\n",
+ "n=Nd\n",
+ "p=(ni**2/n)\n",
+ "\n",
+ "#Result\n",
+ "print\"Concentration of electron is\",round(n,-14),\"/cm**3\"\n",
+ "print\"Concentration of holes is\",round(p,0),\"/cm**3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Concentration of electron is 4.45e+16 /cm**3\n",
+ "Concentration of holes is 14040000000.0 /cm**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.14 page No 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.14\n",
+ "#Determine concentration of holes and electrons\n",
+ "\n",
+ "#Given\n",
+ "rho=5.32 #kg/m**3, density\n",
+ "Aw=72.6 #kg/K kmol atomic weight\n",
+ "ni=2.5*10**13\n",
+ "di=10**8 #Donor impurity\n",
+ "e=1.6*10**-19 #Electronic charge\n",
+ "mue=0.38 #m**/Vs\n",
+ "muh=0.18 #m**/Vs\n",
+ "\n",
+ "#CAlculation\n",
+ "N=6.023*10**23*rho/Aw #No 0f germanium atoms per cm**3\n",
+ "Nd=N/di\n",
+ "n=Nd\n",
+ "p=(ni**2/n)\n",
+ "s=n*e*mue*10**4\n",
+ "\n",
+ "#Result\n",
+ "print\"Concentration of electrons is\",round(n,-12),\"atoms/cm**3\"\n",
+ "print\"Concentration of holes is\",round(p,-10),\"atoms/cm**3\"\n",
+ "\n",
+ "if n > p:\n",
+ " \n",
+ " print\"Conductivity of N-type germanium\",round(s*100,1),\"/ohm-m\" \n",
+ "else:\n",
+ " print \"Calculate p-type germanium conductivity\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Concentration of electrons is 4.41e+14 atoms/cm**3\n",
+ "Concentration of holes is 1.42e+12 atoms/cm**3\n",
+ "Conductivity of N-type germanium 26.8 /ohm-m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.15 Page no.79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.15\n",
+ "#Calculate the density and drift velocity\n",
+ "\n",
+ "#Given\n",
+ "e=1.6*10**-19 #Electronic charge\n",
+ "mue=0.39 #m**/Vs\n",
+ "muh=0.19 #m**/Vs\n",
+ "rhoi=0.47 #ohm-m, intrinsic resistivity\n",
+ "E=10**4 #Electric field\n",
+ "\n",
+ "#Calculation\n",
+ "sigmai=1/rhoi\n",
+ "ni=sigmai/(e*(mue+muh))\n",
+ "Vn=mue*E\n",
+ "Vh=muh*E\n",
+ "\n",
+ "#Result\n",
+ "print\"Density of electrons is\",round(ni,-17),\"/m**3\"\n",
+ "print\"Drift velocity for electrons\",round(Vn,0),\"m/s\"\n",
+ "print\"Drift velocity for holes\",round(Vh,0),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of electrons is 2.29e+19 /m**3\n",
+ "Drift velocity for electrons 3900.0 m/s\n",
+ "Drift velocity for holes 1900.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.16 page No.80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.16\n",
+ "#Calculate conductivity\n",
+ "\n",
+ "#Given\n",
+ "i=10**7 #IMpurity in Ge atom\n",
+ "ni=2.5*10**13 #/cm**3\n",
+ "N=4.4*10**22 #No. of atoms of Ge\n",
+ "mue=3800 #cm**2/Vs\n",
+ "muh=1800 #cm**2/Vs\n",
+ "e=1.6*10**-19 #Electronic charge\n",
+ "E=400 #Electric field\n",
+ "\n",
+ "#Calculation\n",
+ "sigmai=ni*e*(mue+muh)\n",
+ "Nd=N/i\n",
+ "n=Nd\n",
+ "p=ni**2/(Nd)\n",
+ "sigman=e*Nd*mue\n",
+ "\n",
+ "print\"Intrinsic conductivity of Ge is \",sigmai,\"ohm-cm**-1\"\n",
+ "print\"Conductivity of N type Ge semiconductor is\",round(sigman,2),\"ohm-cm**-1\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Intrinsic conductivity of Ge is 0.0224 ohm-cm**-1\n",
+ "Conductivity of N type Ge semiconductor is 2.68 ohm-cm**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.17 Page No. 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.17\n",
+ "#(i)Electron drift velocity & hole drift velocity .\n",
+ "#(ii)Intrinsic Conductivity of Ge,(iii)The total current .\n",
+ "\n",
+ "#Given\n",
+ "V=10 #Volt\n",
+ "l=0.025 #m, length\n",
+ "w=0.004 #m width\n",
+ "t=0.0015 #m thickness\n",
+ "\n",
+ "ni=2.5*10**19 #/cm**3\n",
+ "mue=0.38 #m**2/Vs\n",
+ "muh=0.18 #m**2/Vs\n",
+ "e=1.6*10**-19 #Electronic charge\n",
+ "E=400 #Electric field\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/l\n",
+ "Ve=mue*E\n",
+ "Vh=muh*E\n",
+ "sigmai=ni*e*(mue+muh)\n",
+ "I=sigmai*E*w*t\n",
+ "\n",
+ "#Result\n",
+ "print\"(i)Electron drift velocity is \",Ve,\"m/s\"\n",
+ "print\" hole drift velocity is \",Vh,\"m/s\"\n",
+ "print\"(ii)Intrinsic Conductivity of Ge is\",sigmai,\"ohm-m**-1\"\n",
+ "print\"(iii)The total current is \",I*1000,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Electron drift velocity is 152.0 m/s\n",
+ " hole drift velocity is 72.0 m/s\n",
+ "(ii)Intrinsic Conductivity of Ge is 2.24 ohm-m**-1\n",
+ "(iii)The total current is 5.376 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.18 page no.80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.18\n",
+ "#What is ratio of electrons to holes\n",
+ "\n",
+ "#Given\n",
+ "Ie=3/4.0 #Current due to electron\n",
+ "Ih=1-Ie #Current due to holes\n",
+ "Vh=1 #Hole velocity\n",
+ "Ve=3 #Electron velocity 3 times the hole velocity\n",
+ "\n",
+ "#ccalculation\n",
+ "R=(Ie*Vh/(Ih*Ve))\n",
+ "\n",
+ "#Result\n",
+ "print\"The ratio of electrons to holes drift velocity is \",R"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of electrons to holes drift velocity is 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.19 Page No.81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.19\n",
+ "#Find the diffusion coefficients of electrons and holes\n",
+ "\n",
+ "#given data\n",
+ "e=1.6*10**-19\t\t\t#in coulamb\n",
+ "T=300\t\t\t\t#in Kelvin\n",
+ "MUh=0.025\t\t\t#in m**2/V-s\n",
+ "MUe=0.17\t\t\t#in m**2/V-s\n",
+ "k=1.38*10**-23\t\t\t#in J/K\n",
+ "De=MUe*k*T/e\t\t\t#in cm**2/s\n",
+ "Dh=MUh*k*T/e\t\t\t#in cm**2/s\n",
+ "\n",
+ "#Result\n",
+ "print\"Diffusion constant of electron is \",round(De*10000,2),\"(in cm**2/s)\"\n",
+ "print\"Diffusion constant of hole is \",round(Dh*10000,2),\"(in cm**2/s)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion constant of electron is 43.99 (in cm**2/s)\n",
+ "Diffusion constant of hole is 6.47 (in cm**2/s)\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.20 Page no. 81 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.20\n",
+ "#Find intrinsic carries cncentration and conductivity\n",
+ "\n",
+ "#Given\n",
+ "N=3*10**25 #No of atoms\n",
+ "e=1.6*10**-19\n",
+ "Eg=1.1*e #eV\n",
+ "k=1.38*10**-23 #j/k boltzman's constant\n",
+ "T=300 #K\n",
+ "mue=0.14\n",
+ "muh=0.05\n",
+ "\n",
+ "#Calculation\n",
+ "ni=N*math.exp(-Eg/(2*k*T))\n",
+ "sigma=ni*e*(mue+muh)\n",
+ "\n",
+ "#Result\n",
+ "print\"The intrinsic carries concentration is \",round(ni,-14),\"/m**3\"\n",
+ "print\"The conductivity of Si is \",round(sigma,5),\"S/m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The intrinsic carries concentration is 1.76e+16 /m**3\n",
+ "The conductivity of Si is 0.00054 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.21 Page No.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.21\n",
+ "#Find the effective density\n",
+ "\n",
+ "#Given\n",
+ "a=1.5 #a=me/mo\n",
+ "T=300 #K\n",
+ "\n",
+ "#calculation\n",
+ "#from eq. 2.29\n",
+ "Nc=4.82*10**21*(a)**(1.5)*T**(1.5)\n",
+ "\n",
+ "#Result\n",
+ "print\"The effective density is\",round(Nc,-23),\"/m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The effective density is 4.6e+25 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.22 page no. 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.22\n",
+ "#Calculate the intrinsic concentration\n",
+ "\n",
+ "#Given\n",
+ "a=0.07 #a=me/mo\n",
+ "b=0.4 #b=mh/mo\n",
+ "T=300 #K\n",
+ "Eg=0.7 #eV\n",
+ "k=8.62*10**-5 # Boltzman constant\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#From eq 2.101\n",
+ "ni=math.sqrt(2.33*10**43*(a*b)**(1.5)*T**3*math.exp(-Eg/(k*T)))\n",
+ "\n",
+ "#Result\n",
+ "print\"The intrinsic concentration of charge carrier is\",round(ni,-16),\"/m**3\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The intrinsic concentration of charge carrier is 2.27e+18 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.23 Page no. 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.23\n",
+ "#Find the value of absolute temprature\n",
+ "\n",
+ "#Given\n",
+ "C=5*10**28 #atom/m**3, concentration of Si atoms\n",
+ "DL=2*10**8 #Doping level \n",
+ "m=1\n",
+ "me=m\n",
+ "#calculation\n",
+ "Nd=C/DL\n",
+ "nc=Nd\n",
+ "T=((nc/(4.82*10**21))*(m/me)**(1.5))**(2/3.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"The absolute temprature is\",round(T,2),\"K\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absolute temprature is 0.14 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.24 Page No. 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.24\n",
+ "#Determine the effective density\n",
+ "\n",
+ "#Given\n",
+ "T1=300.0 #K temprature\n",
+ "T2=400.0\n",
+ "k=1.38*10**-23 #J/k\n",
+ "m=1.25*9.107*10**-31\n",
+ "h=6.625*10**-34\n",
+ "dE=0.3 #eV\n",
+ "k_=8.62*10**-5\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "nc1=2*(2*math.pi*m*k*T1/(h**2))**(1.5)\n",
+ "n1=nc1*math.exp(-(0.3/(k_*T1)))\n",
+ "\n",
+ "nc2=2*(2*math.pi*m*k*T2/(h**2))**(1.5)\n",
+ "n2=nc2*math.exp(-(0.3/(k_*T2)))\n",
+ "\n",
+ "#result\n",
+ "print\"The effective density at temprature 300 K is\",round(n1,-19),\"/m**3\"\n",
+ "print\"The effective density at temprature 400 K is\",round(n2,-19),\"/m**3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The effective density at temprature 300 K is 3.2e+20 /m**3\n",
+ "The effective density at temprature 400 K is 8.98e+21 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.25 Page no.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.25\n",
+ "#determine the position of intrinsic fermi level\n",
+ "\n",
+ "#Given\n",
+ "T=300.0\n",
+ "k=8.62*10**-5 #J/k\n",
+ "m=9.107*10**-31\n",
+ "me=0.6*m\n",
+ "mh=0.4*m\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "dE=-3*k*T*math.log((me/mh)**(1))/4.0 #dE=Ef-Emidgap\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of fermi level is\",round(dE,4),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of fermi level is -0.0079 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 116
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.26 Page no 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.26\n",
+ "#determine the position of intrinsic fermi level\n",
+ "\n",
+ "#Given\n",
+ "T=300.0\n",
+ "Eg=0.72 #eV Energy gap\n",
+ "k=8.62*10**-5 #J/k\n",
+ "me=1\n",
+ "mh=5.0\n",
+ "\n",
+ "#calculation\n",
+ "#from Ef=Ec-kTlog(nc/Nd)\n",
+ "import math\n",
+ "dE=(Eg/2.0)-3*k*T*math.log(me/mh)/4.0 #dE=Ef-Emidgap\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of fermi level is\",round(dE,4),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of fermi level is 0.3912 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 131
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.27 Page no 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.27\n",
+ "#determine the position of intrinsic fermi level\n",
+ "\n",
+ "#Given\n",
+ "T1=300.0\n",
+ "T2=350\n",
+ "Eg=0.24 #eV Energy gap\n",
+ "\n",
+ "#calculation\n",
+ "#from Ef=Ev+kTlog(nc/Nd)\n",
+ "import math\n",
+ "dE=(T2/T1)*Eg\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of fermi level is\",round(dE,4),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of fermi level is 0.28 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 134
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.28 Page no.88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.28\n",
+ "#determine the position of intrinsic fermi level\n",
+ "\n",
+ "#Given\n",
+ "T1=300.0\n",
+ "T2=400\n",
+ "Eg=0.27 #eV Energy gap\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "dE=(T2/T1)*Eg\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of fermi level is\",round(dE,4),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of fermi level is 0.36 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 133
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.29 page no.88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Example 2.29\n",
+ "#determine the position of intrinsic fermi level\n",
+ "\n",
+ "#Given\n",
+ "dE1=0.3 #eV Energy gap\n",
+ "kT=0.026 #eV\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=math.exp(-dE1/kT) #x=Nd/nc\n",
+ "y=5 #y=Nd2/Nd1\n",
+ "dE2=-math.log(y)*kT+dE1\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of fermi level is\",round(dE2,3),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of fermi level is 0.258 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 137
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.30 Page no.89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Example 2.30\n",
+ "#determine the position of intrinsic fermi level\n",
+ "\n",
+ "#Given\n",
+ "dE1=0.39 #eV Energy gap\n",
+ "kT=0.026 #eV\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "x=math.exp(-dE1/kT) #x=NA1/nV\n",
+ "y=3 #y=NA2/NA1\n",
+ "dE2=((dE1/kT)-math.log(y))*kT\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of fermi level is\",round(dE2,2),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of fermi level is 0.36 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 143
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.31 Page no.91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.31\n",
+ "#Determine electron density and mobility\n",
+ "\n",
+ "#Given\n",
+ "rho=1 #ohm-m Resistivity\n",
+ "Rh=100.0 #cm**3/coulomb\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#calculation\n",
+ "con=1/rho #Conductivity\n",
+ "R=1/Rh #Charge density\n",
+ "ED=R*10**6/e\n",
+ "mu=con/(R*10**6)\n",
+ "\n",
+ "#Result\n",
+ "print\"The electron density is\",ED,\"/m**3\"\n",
+ "print\"The mobility is %.e\"%mu,\"/m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electron density is 6.25e+22 /m**3\n",
+ "The mobility is 1e-04 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.32 Page no. 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.32\n",
+ "#Calculate Hall Voltage\n",
+ "\n",
+ "#Given\n",
+ "w=0.1 #m width\n",
+ "t=0.01 #m thickness\n",
+ "F=0.6 #T, field\n",
+ "Rh=3.8*10**-4 #Hall Coefficient\n",
+ "I=10 #mA\n",
+ "\n",
+ "#calculation\n",
+ "Vh=(Rh*F*I/w)\n",
+ "\n",
+ "#Result\n",
+ "print\"Hall Voltage is\",Vh*1000,\"micro V\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hall Voltage is 22.8 micro V\n"
+ ]
+ }
+ ],
+ "prompt_number": 146
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.33 Page No. 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.33\n",
+ "#What is magnitude of Hall Voltage\n",
+ "\n",
+ "#given data\n",
+ "e=1.6*10**-19\t\t\t#in coulamb\n",
+ "ND=10**17\t\t\t#in cm**-3\n",
+ "Bz=0.1\t\t\t\t#in Wb/m**2\n",
+ "w=4\t\t\t\t#in mm\n",
+ "d=4\t\t\t\t#in mm\n",
+ "Ex=5\t\t\t\t#in V/cm\n",
+ "MUe=3800\t\t\t#in cm**2/V-s\n",
+ "\n",
+ "#calculation\n",
+ "v=MUe*Ex\t\t\t#in cm/s\n",
+ "v=v*10**-2\t\t\t#in m/s\n",
+ "VH=Bz*v*d\t\t\t#in mV\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of hall voltage is\",VH,\"mV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of hall voltage is 76.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.34 Page No.92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.34\n",
+ "#What is magnitude of hall voltage\n",
+ "\n",
+ "#given data\n",
+ "e=1.6*10**-19\t\t\t#in coulamb\n",
+ "ND=10**21\t\t\t#in m**-3\n",
+ "Bz=0.2\t\t\t\t#in T\n",
+ "d=4\t\t\t\t#in mm\n",
+ "d=d*10**-3\t\t\t#in meter\n",
+ "J=600\t\t\t\t#in A/m**2\n",
+ "n=ND\t\t\t\t#in m**-3\n",
+ "\n",
+ "#calculation\n",
+ "#formula : VH*w/(B*I)=1/(n*e)\n",
+ "VH=Bz*J*d/(n*e)\t\t\t#in V\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of hall voltage is \",VH*10**3,\"mV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of hall voltage is 3.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.35 Page No."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.35\n",
+ "#Calculate hall angle\n",
+ "\n",
+ "#given data\n",
+ "e=1.6*10**-19\t\t\t#in coulamb\n",
+ "rho=0.00912\t\t\t#in ohm-m\n",
+ "B=0.48\t\t\t\t#in Wb/m**2\n",
+ "RH=3.55*10**-4\t\t\t#in m**3-coulamb**-1\n",
+ "SIGMA=1/rho\t\t\t#in (ohm=m)**-1\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "THETAh=math.atan(SIGMA*B*RH)\t#in Degree\n",
+ "\n",
+ "#result\n",
+ "print\"Hall angle is\",round(THETAh*180/3.14,4),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hall angle is 1.0709 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 169
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch3.ipynb b/Fundamental_of_Electronics_Devices/Ch3.ipynb
new file mode 100644
index 00000000..fcc2f572
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch3.ipynb
@@ -0,0 +1,337 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3 : Excess Carriers in Semiconductor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page No 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.2\n",
+ "#What is Minimum required energy \n",
+ "\n",
+ "#given data\n",
+ "l=6000 #in Angstrum\n",
+ "h=6.6*10**(-34) #Planks constant\n",
+ "c=3*10**8 #speed of light in m/s\n",
+ "e=1.602*10**(-19) #Constant\n",
+ "\n",
+ "#calculation\n",
+ "phi=c*h/(e*l*10**(-10))\n",
+ "\n",
+ "#result\n",
+ "print\"Minimum required energy is\",round(phi,2),\"eV \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum required energy is 2.06 eV \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page No 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 3.3\n",
+ "#calculate Work function of the cathode material\n",
+ "\n",
+ "#given data\n",
+ "Emax=2.5 #maximum energy of emitted electrons in eV \n",
+ "l=2537.0 #in Angstrum\n",
+ "\n",
+ "#Calculation\n",
+ "EeV=12400.0/l #in eV\n",
+ "phi=EeV-Emax #in eV\n",
+ "\n",
+ "#result\n",
+ "print \"Work function of the cathode material is \",round(phi,2),\"eV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work function of the cathode material is 2.39 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page No 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.4\n",
+ "#Find (i)The fraction of each photon energy unit which is converted into heat\",f\n",
+ "#(ii)Energy converted into heat in ,((2-1.43)/2)*0.009,\"J/s\"\n",
+ "#(iii)Number of photons per second given off from recombination events \",0.009/(e*2)\n",
+ "\n",
+ "#given data\n",
+ "t=0.46*10**-4 #in centi meters\n",
+ "hf1=2 #in ev\n",
+ "hf2=1.43\n",
+ "Pin=10 #in mW\n",
+ "alpha=50000 # in per cm\n",
+ "e=1.6*10**-19 #constant\n",
+ "Io=0.01 #in mW\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Calculation\n",
+ "It=Io*math.exp(-alpha*t) #in mW\n",
+ "Iabs=Io-It\n",
+ "f=(hf1-hf2)/hf1\n",
+ "E=f*Iabs\n",
+ "N=Iabs/(e*hf1)\n",
+ "\n",
+ "#result\n",
+ "print\"(i)Thus power absorbed is \",round(Iabs,3),\"J/s\"\n",
+ "print\"(ii)Energy converted into heat is\",round(E,4),\"J/s\"\n",
+ "print\"(iii)Number of photons per second given off from recombination events \",round(N,-14)\n",
+ "#In book there is calculation mistake in Number of photons."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Thus power absorbed is 0.009 J/s\n",
+ "(ii)Energy converted into heat is 0.0026 J/s\n",
+ "(iii)Number of photons per second given off from recombination events 2.81e+16\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page No 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.5\n",
+ "#What is Photoconductor gain \n",
+ "#Electron transit time.\n",
+ "\n",
+ "#given data\n",
+ "L=100 #in uM\n",
+ "A=10&-7 #in cm**2\n",
+ "th=10**-6 #in sec\n",
+ "V=12 #in Volts\n",
+ "ue=0.13 #in m**2/V-s\n",
+ "uh=0.05 #in m**2/V-s\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/(L*10**-6) #in V/m\n",
+ "tn=(L*10**-6)/(ue*E)\n",
+ "Gain=(1+uh/ue)*(th/tn)\n",
+ "\n",
+ "#result\n",
+ "print\"Electron transit time in sec is \",round(tn,10),\"s\"\n",
+ "print\"Photoconductor gain is \",Gain"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron transit time in sec is 6.4e-09 s\n",
+ "Photoconductor gain is 216.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page No128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example3.6\n",
+ "#Calculate Current flowing through diode .\n",
+ "\n",
+ "#given datex\n",
+ "import math\n",
+ "Io=0.15 #in uA\n",
+ "V=0.12 #in mVolt\n",
+ "Vt=26 #in mVolt\n",
+ "\n",
+ "#calculation\n",
+ "I=Io*10**-6*(math.exp(V/(Vt*10**-3))-1) #in A\n",
+ "\n",
+ "#result\n",
+ "print\"Current flowing through diode is \",round(I*10**6,2),\"micra A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing through diode is 15.0 micra A\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7 Page No 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 3.7\n",
+ "#Determine the Forward voltage \n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "Io=2.5 #in uA\n",
+ "I=10 #in mA\n",
+ "Vt=26 #in mVolt\n",
+ "n=2 #for silicon\n",
+ "\n",
+ "#Calculation\n",
+ "V=n*Vt*10**-3*math.log((I*10**-3)/(Io*10**-6))\n",
+ "\n",
+ "#Result\n",
+ "print \"Forward voltage is \",round(V,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Forward voltage is 0.43 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 Page No 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.8\n",
+ "#What is Reverse saturation current density \n",
+ "\n",
+ "#given data\n",
+ "ND=10**21 #in m**-3\n",
+ "NA=10**22 #in m**-3\n",
+ "De=3.4*10**-3 #in m**2-s**-1\n",
+ "Dh=1.2*10**-3 #in m**2-s**-1\n",
+ "Le=7.1*10**-4 #in meters\n",
+ "Lh=3.5*10**-4 #in meters\n",
+ "ni=1.6*10**16 #in m**-3\n",
+ "e=1.602*10**-19 #constant\n",
+ "\n",
+ "#calculation\n",
+ "IoA=e*ni**2*(Dh/(Lh*ND)+De/(Le*NA))\n",
+ "\n",
+ "#Result\n",
+ "print\"Reverse saturation current density is \",round(IoA*10**6,2),\"uA \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation current density is 0.16 uA \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch4.ipynb b/Fundamental_of_Electronics_Devices/Ch4.ipynb
new file mode 100644
index 00000000..e41f2209
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch4.ipynb
@@ -0,0 +1,1079 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Junction Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 page No. 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.1\n",
+ "#find the Majority and Minority carrier hole concentration\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "T=300\t\t\t #in Kelvin\n",
+ "ND=5*10**13\t\t #in cm**-3\n",
+ "NA=0\t\t\t #in cm**-3\n",
+ "ni=2.4*10**13\t\t#in cm**-3\n",
+ "\n",
+ "#Calculation\n",
+ "no=ND/2.0+math.sqrt((ND/2.0)**2+ni**2)\t#in cm**-3\n",
+ "po=ni**2/no\t\t#in cm**-3\n",
+ "\n",
+ "#Result\n",
+ "print\"Majority carrier electron concentration is \",round(no,-11),\"cm**-3\"\n",
+ "print\"Minority carrier hole concentration is \",round(po,-11),\" cm**-3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Majority carrier electron concentration is 5.97e+13 cm**-3\n",
+ "Minority carrier hole concentration is 9.7e+12 cm**-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page No.146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.2\n",
+ "#find the Majority and Minority carrier hole concentration\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "T=300\t\t\t#in Kelvin\n",
+ "ND=10**16\t\t#in cm**-3\n",
+ "NA=0\t\t\t #in cm**-3\n",
+ "ni=1.5*10**10\t\t#in cm**-3\n",
+ "\n",
+ "#Calculation\n",
+ "no=ND/2.0+math.sqrt((ND/2.0)**2+ni**2)\t#in cm**-3\n",
+ "po=ni**2/no\t\t#in cm**-3\n",
+ "\n",
+ "#result\n",
+ "print\"Majority carrier electron concentration is \",no,\"cm**-3\"\n",
+ "print\"Minority carrier hole concentration is \",round(po,0),\" cm**-3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Majority carrier electron concentration is 1e+16 cm**-3\n",
+ "Minority carrier hole concentration is 22500.0 cm**-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page No. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.3\n",
+ "#find the Majority and Minority carrier hole concentration\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "T=300\t\t\t#in Kelvin\n",
+ "ND=3*10**15\t\t#in cm**-3\n",
+ "NA=10**16\t\t#in cm**-3\n",
+ "ni=1.6*10**10\t\t#in cm**-3\n",
+ "\n",
+ "#Calculation\n",
+ "po=(NA-ND)/2+math.sqrt(((NA-ND)/2.0)**2+ni**2.0)\t#in cm**-3\n",
+ "no=ni**2/po\t\t#in cm**-3\n",
+ "\n",
+ "#Result\n",
+ "print\"Majority carrier hole concentration is\",round(po,-8),\" cm**-3\"\n",
+ "print\"Minority carrier electron concentration is \",round(no,0),\" cm**-3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Majority carrier hole concentration is 7e+15 cm**-3\n",
+ "Minority carrier electron concentration is 36571.0 cm**-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.4\n",
+ "#What is maximum Temprature\n",
+ "\n",
+ "#Given \n",
+ "import math\n",
+ "ND=3*10**15\t\t#in cm**-3\n",
+ "Eg=1.12 #eV\n",
+ "k=8.62*10**-5 #eV/k\n",
+ "Nc=2.8*10**19\n",
+ "Nv=1.04*10**19\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "# from the equation po=(NA-ND)/2+math.sqrt(((NA-ND)/2.0)**2+ni**2.0)\t#in cm**-3\n",
+ "No=1.05*ND\n",
+ "ni=math.sqrt((No-ND/2.0)**2-0.25*ND**2)\n",
+ "#From ni**2=Nc*Nv*exp(-Eg/(k*t))\n",
+ "T=Eg/(-math.log(ni**2/(Nc*Nv))*k)\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum Temprature is \",round(T,1),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum Temprature is 642.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page No. 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.5\n",
+ "#determine the built in potential\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "T=300\t\t#in Kelvin\n",
+ "ND=10**15\t#in cm**-3\n",
+ "NA=10**18\t#in cm**-3\n",
+ "ni=1.5*10**10\t#in cm**-3\n",
+ "VT=T/11600.0\t#in Volts\n",
+ "\n",
+ "#Calculation\n",
+ "Vbi=VT*math.log(NA*ND/ni**2)\t#in Volts\n",
+ "\n",
+ "#result\n",
+ "print\"Built in potential barrier is\",round(Vbi,4),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Built in potential barrier is 0.7532 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page No.151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.6\n",
+ "#What is Contact Potential.\n",
+ "\n",
+ "#given data\n",
+ "T=300\t\t #in Kelvin\n",
+ "ND=10**21\t #in m**-3\n",
+ "NA=10**21\t #in m**-3\n",
+ "ni=1.5*10**16 #in m**-3\n",
+ "VT=T/11600.0\t#in Volts\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Vo=VT*math.log(NA*ND/ni**2)\t#in Volts\n",
+ "\n",
+ "#result\n",
+ "print\"Contact potential is\",round(Vo,4),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Contact potential is 0.5745 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page No. 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.7\n",
+ "#Determine the space charge.\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "T=300\t\t\t#in Kelvin\n",
+ "ND=10**15\t\t#in cm**-3\n",
+ "NA=10**16\t\t#in cm**-3\n",
+ "ni=1.5*10**10\t\t#in cm**-3\n",
+ "VT=T/11600.0\t\t#in Volts\n",
+ "e=1.6*10**-19\t #in Coulamb\n",
+ "\n",
+ "#calculation\n",
+ "epsilon=11.7*8.854*10**-14\t #constant\n",
+ "Vbi=VT*math.log(NA*ND/ni**2)\t\t#in Volts\n",
+ "SCW=math.sqrt((2*epsilon*Vbi/e)*(NA+ND)/(NA*ND))#in cm\n",
+ "SCW=SCW*10**4 #in uMeter\n",
+ "xn=0.864\t\t#in uM\n",
+ "xp=0.086\t\t#in uM\n",
+ "Emax=-e*ND*xn/epsilon\t#in V/cm\n",
+ "\n",
+ "#result\n",
+ "print\"Space charge width is\",round(SCW,2),\"micro meter\"\n",
+ "print\"At metallurgical junction, i.e for x=0 the electric field is \",round(Emax/10000,0),\"V\"#Note : Ans in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Space charge width is 0.95 micro meter\n",
+ "At metallurgical junction, i.e for x=0 the electric field is -13345.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page No.160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.8\n",
+ "#Find the new position of fermi level\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "Ecf=0.3 #in Volts\n",
+ "T=27.0+273.0 #in Kelvin\n",
+ "delT=55 #in degree centigrade\n",
+ "\n",
+ "#calculation\n",
+ "#formula : Ecf=Ec-Ef=K*T*math.log(nc/ND)\n",
+ "#let K*math.log(nc/ND)=y\n",
+ "#Ecf=Ec-Ef=T*y\n",
+ "y=Ecf/T #assumed\n",
+ "Tnew=273+55 #in Kelvin\n",
+ "EcfNEW=y*Tnew #in Volts\n",
+ "\n",
+ "#result\n",
+ "print\"New position of fermi level is \",round(EcfNEW,4),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New position of fermi level is 0.328 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page No. 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.9\n",
+ "#Determine the Contact Potential\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "T=300\t\t\t#in Kelvin\n",
+ "ND=8*10**14\t\t#in cm**-3\n",
+ "NA=8*10**14\t\t#in cm**-3\n",
+ "ni=2*10**13\t\t#in cm**-3\n",
+ "k=8.61*10**-5\t\t#in eV/K\n",
+ "\n",
+ "#calculation\n",
+ "Vo=k*T*math.log(NA*ND/ni**2)\t#in Volts\n",
+ "\n",
+ "#Result\n",
+ "print\"Contact potential is \",round(Vo,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Contact potential is 0.19 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10 page No.161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.10\n",
+ "#(i)Find the hole and electron concentration \n",
+ "#Is this Silicon P or N type\n",
+ "\n",
+ "#given data\n",
+ "ND=2*10**16 #in cm**-3\n",
+ "NA=5*10**15 #in cm**-3\n",
+ "Ao=4.83*10**21 \t#constant\n",
+ "T=300.0\t\t\t #in Kelvin\n",
+ "EG=1.1\t \t \t #in eV\n",
+ "kT=0.026 \t\t#in eV\n",
+ "\n",
+ "#Calculation\n",
+ "ni=Ao*T**(1.5)*math.exp(-EG/(2*kT))\t\t#in m**-3\n",
+ "p=(ni/10**6)**2/ND\t\t\t#in cm**-3\n",
+ "n=((ni/10**6)**2)/NA\t\t\t#in cm**-3\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"Hole concentration in cm**-3 : %.1e\"%round(p,0),\"/cm**3\"\n",
+ "print\"electron concentration in cm**-3 :%.1e\"%round(n,0),\"/cm**3\"\n",
+ "print\"\\nNOTE:\\nSlight Variation in answer due to wrong value of ni in book as 1.6*10**16 instead of\",ni\n",
+ "if n < e:\n",
+ " \n",
+ " print\"\\n\\nthe given Si is of P-type\" \n",
+ "else:\n",
+ " print \"\\nThe given Si is of N-type\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hole concentration in cm**-3 : 1.3e+04 /cm**3\n",
+ "electron concentration in cm**-3 :5.3e+04 /cm**3\n",
+ "\n",
+ "NOTE:\n",
+ "Slight Variation in answer due to wrong value of ni in book as 1.6*10**16 instead of 1.63166259315e+16\n",
+ "\n",
+ "The given Si is of N-type\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11 Page No. 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.11\n",
+ "#Determine current\n",
+ "\n",
+ "#In given circuit \n",
+ "V=5\t\t #in volts\n",
+ "Vo=0.7\t #in Volts\n",
+ "R=100\t\t#in Kohm\n",
+ "\n",
+ "#Calculation\n",
+ "I=(V-Vo)/R\t#in Ampere\n",
+ "\n",
+ "#result\n",
+ "print\"Current flowing through the circuit is\",round(I*1000,0),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing through the circuit is 43.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.12 Page No. 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.12\n",
+ "#Find the Voltage VA\n",
+ "\n",
+ "#In given circuit \n",
+ "V=15\t\t\t #in volts\n",
+ "Vo=0.7\t\t\t#in Volts\n",
+ "R=7\t \t \t#in Kohm\n",
+ "\n",
+ "#Calculation\n",
+ "I=(V-2*Vo)/R\n",
+ "I=(V-2*Vo)/R\t\t#in mAmpere\n",
+ "VA=I*R\t \t\t#in Volts\n",
+ "\n",
+ "#result\n",
+ "print\"Voltagee VA is \",VA,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltagee VA is 13.6 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.13 Page No.169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.13\n",
+ "#Determine the Voltage VA\n",
+ "\n",
+ "#Given\n",
+ "V=15 #V, voltage\n",
+ "Vb=0.3 #V, Barrier Potential #When supply is switched on\n",
+ "\n",
+ "#Calculation\n",
+ "VA=V-Vb\n",
+ "\n",
+ "#Result\n",
+ "print\"The Voltage VA is \",VA,\"V\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage VA is 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.14 Page No.172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.14\n",
+ "#find Temperature coefficient f zener diode\n",
+ "\n",
+ "#given data\n",
+ "Vz=5\t\t\t#in volts\n",
+ "to=25\t\t\t#in degree centigrade\n",
+ "t=100\t\t\t#in degree centigrade\n",
+ "Vdrop=4.8\t\t#in Volts\n",
+ "\n",
+ "#calculation\n",
+ "delVz=Vdrop-Vz\t\t#in Volts\n",
+ "delt=t-to\t\t#in degree centigrade\n",
+ "TempCoeff=delVz*100/(Vz*delt)\n",
+ "\n",
+ "#result\n",
+ "print\"Temperature coefficient f zener diode is \",round(TempCoeff,3),\"percent\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature coefficient f zener diode is -0.053 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.15 Page No. 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.15\n",
+ "#Find (a)output Voltage (b) Voltage across Rs (c) Current\n",
+ "\n",
+ "#given data\n",
+ "Vz=8.0\t\t\t#in volts\n",
+ "VS=12.0\t\t\t#in volts\n",
+ "RL=10.0\t\t\t#in Kohm\n",
+ "Rs=5.0\t\t\t#in Kohm\n",
+ "\n",
+ "#part (a)\n",
+ "Vout=Vz\t\t\t#in volts\n",
+ "\n",
+ "#part (b)\n",
+ "Vrs=VS-Vout\t\t#in volts\n",
+ "IL=Vout/RL \t\t#in mAmpere\n",
+ "Is=(VS-Vout)/Rs\t#in mAmpere\n",
+ "\n",
+ "#part c\n",
+ "Iz=Is-IL\t \t#in mAmpere\n",
+ "\n",
+ "#result\n",
+ "print\"(a)Output voltage will be equal to Vout=\",Vout,\" Volts\"\n",
+ "print\"(b)Voltage across Rs is Rs=\",Vrs,\"V\"\n",
+ "print\"(c)Current through zener diode is Iz=\",round(Iz,1),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Output voltage will be equal to Vout= 8.0 Volts\n",
+ "(b)Voltage across Rs is Rs= 4.0 V\n",
+ "(c)Current through zener diode is Iz= 0.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.16 Page No. 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.16\n",
+ "#Find the min and max value of zener diode current\n",
+ "\n",
+ "#given data\n",
+ "Vz=50.\t\t\t#in volts\n",
+ "VSmax=120.0\t\t#in volts\n",
+ "VSmin=80.0\t\t#in volts\n",
+ "RL=10.0\t\t\t#in Kohm\n",
+ "Rs=5.0\t\t\t#in Kohm\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vz\t\t\t#in Volts\n",
+ "IL=Vout/RL\t\t#in mAmpere\n",
+ "\n",
+ "ISmax=(VSmax-Vout)/Rs\t#in mAmpere\n",
+ "Izmax=ISmax-IL\t\t#in mA\n",
+ "Ismin=(VSmin-Vout)/Rs#in mAmpere\n",
+ "Izmin=Ismin-IL#in mA\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum zener diode current is \",Izmax,\"mA\"\n",
+ "print\"Minimum zener diode current is \",Izmin,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum zener diode current is 9.0 mA\n",
+ "Minimum zener diode current is 1.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.17 Page No. 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.17\n",
+ "#Design a regulator\n",
+ "\n",
+ "#given data\n",
+ "Vz=15\t\t#in volts\n",
+ "Izk=6.0\t\t#in mA\n",
+ "Vout=15\t\t#in Volts\n",
+ "Vs=20\t\t#in Volts\n",
+ "ILmin=10.0\t#in mA\n",
+ "ILmax=20.0\t#in mA\n",
+ "RS=(Vs-Vz)*1000/(ILmax+Izk)\t#in ohm\n",
+ "\n",
+ "#result\n",
+ "print\"sereis Resistance is \",round(RS,1),\"ohm\"\n",
+ "print\"The zener current will be minimum i.e. Izk = 6mA when load current is maximum i.e. ILmax = 20mA\"\n",
+ "print\"when the load current will decrease and become 10 mA, the zener current will increase and become 6+10 i.e. 16 mA. \\nThus the current through series resistance Rs will remain unchanged at 6+20 i.e. 26 mA. \\nThus voltage drop in series resistance Rs will remain constant. Consequently, the output voltage will also remain constant. \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sereis Resistance is 192.3 ohm\n",
+ "The zener current will be minimum i.e. Izk = 6mA when load current is maximum i.e. ILmax = 20mA\n",
+ "when the load current will decrease and become 10 mA, the zener current will increase and become 6+10 i.e. 16 mA. \n",
+ "Thus the current through series resistance Rs will remain unchanged at 6+20 i.e. 26 mA. \n",
+ "Thus voltage drop in series resistance Rs will remain constant. Consequently, the output voltage will also remain constant. \n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.18 Page No. 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.18\n",
+ "#Determine Vl,Iz,Pz\n",
+ "\n",
+ "#given data\n",
+ "Vs=16.0\t\t #in volts\n",
+ "RL=1.2\t\t\t#in Kohm\n",
+ "Rs=1.0\t\t\t#in Kohm\n",
+ "\n",
+ "#calculation\n",
+ "#If zener open circuited\n",
+ "VL=Vs*RL/(Rs+RL)\t#in Volts\n",
+ "Iz=0\t\t\t#in mA\n",
+ "Pz=VL*Iz\t\t#in watts\n",
+ "\n",
+ "#result\n",
+ "print\"When zener open circuited Voltage across load is \",round(VL,2),\"V\"\n",
+ "print\"Zener current is \",Iz,\"mA\"\n",
+ "print\"Power is\",Pz,\"watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When zener open circuited Voltage across load is 8.73 V\n",
+ "Zener current is 0 mA\n",
+ "Power is 0.0 watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.19 Page No. 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.19\n",
+ "#determine VL,IL,IZ,IR\n",
+ "\n",
+ "#given data\n",
+ "Vin=20\t\t\t#in volts\n",
+ "Rs=220.0\t\t\t#in Kohm\n",
+ "Vz=10\t\t \t#in volts\n",
+ "RL2=50.0\t\t\t#in Kohm\n",
+ "RL1=200\t\t\t#in Kohm\n",
+ "\n",
+ "#calculation\n",
+ "# part (i) RL=50\t#in Kohm\n",
+ "VL1=Vin*RL1/(RL+Rs)\n",
+ "IR=Vin/(Rs+RL)\t#in mA\n",
+ "IL=IR\t\t \t#in mA\n",
+ "IZ=0\t\t\t #in mA\n",
+ "\n",
+ "if VL1< Vz:\n",
+ " \n",
+ " print\"Zener diode will not conduct and VL=\",round(VL1,1),\"V\" \n",
+ "else:\n",
+ " print \"Zener diode will conduct\"\n",
+ "\n",
+ " \n",
+ "#Result\n",
+ "print\"When RL=200 ohm\"\n",
+ "print\"IL is\",round(IL*1000,2),\"mA\"\n",
+ "print\"IR is\",round(IR*10**3,2),\"mA\"\n",
+ "print\"Iz in mA: \",round(IZ,0),\"mA\"\n",
+ "\n",
+ "# part (ii) RL=200#in Kohm\n",
+ "RL=200\t\t\t#in Kohm\n",
+ "VL2=Vin*RL2/(RL2+Rs)\n",
+ "IR=Vin/(Rs+RL2)\t\t#in mA\n",
+ "IL=IR\t\t\t#in mA\n",
+ "IZ=0\t\t\t#in mA\n",
+ "\n",
+ "#result\n",
+ "if VL2< Vz:\n",
+ " \n",
+ " print\"Zener diode will not conduct and VL=\",round(VL2,1),\"V\" \n",
+ "else:\n",
+ " print \"Zener diode will conduct\"\n",
+ "\n",
+ "print\"When RL=50 ohm\"\n",
+ "print\"IL is\",round(IL*1000,2),\"mA\"\n",
+ "print\"IR is\",round(IR*10**3,2),\"mA\"\n",
+ "print\"Iz in mA: \",IZ,\"mA\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zener diode will not conduct and VL= 9.5 V\n",
+ "When RL=200 ohm\n",
+ "IL is 47.62 mA\n",
+ "IR is 47.62 mA\n",
+ "Iz in mA: 0.0 mA\n",
+ "Zener diode will not conduct and VL= 3.7 V\n",
+ "When RL=50 ohm\n",
+ "IL is 74.07 mA\n",
+ "IR is 74.07 mA\n",
+ "Iz in mA: 0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.20 Page No. 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.20\n",
+ "#Find the voltage drop across the resistance\n",
+ "\n",
+ "#given data\n",
+ "RL=10.0\t\t\t #in Kohm\n",
+ "Rs=5.0 #in Kohm\n",
+ "Vin=100\t\t\t #in Volts\n",
+ "\n",
+ "#Calculation\n",
+ "V=Vin*RL/(RL+Rs)\t#in Volt\n",
+ "VZ=50\t\t\t#in Volts\n",
+ "VL=VZ\t\t\t#in volts\n",
+ "#Apply KVL\n",
+ "VR=100-50\t\t#in Volts\n",
+ "VR=50\t\t\t#in Volts\n",
+ "\n",
+ "if V< VZ:\n",
+ " \n",
+ " print\"Zener diode is OFF state\" \n",
+ "else:\n",
+ " print \"zener diode is ON state\"\n",
+ "\n",
+ "print\"Hence the voltage dropp across the 5 Kohm resistor in Volts is \",VR,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zener diode is ON state\n",
+ "Hence the voltage dropp across the 5 Kohm resistor in Volts is 50 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.21 Page No. 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 4.21\n",
+ "#Find the input resistance\n",
+ "\n",
+ "#given data\n",
+ "RL=120.0\t\t\t#in ohm, load resistance\n",
+ "Izmin=20\t\t#in mA min. diode current\n",
+ "Izmax=200\t\t#in mA max. diode current\n",
+ "VL=12\t\t\t#in Volts\n",
+ "VDCmin=15\t\t#in Volts\n",
+ "VDCmax=19.5\t\t#in Volts\n",
+ "Vz=12\t\t\t#in Volts\n",
+ "IL=VL/RL\t\t#in Ampere\n",
+ "IL=IL*1000\t\t#in mAmpere\n",
+ "\n",
+ "#calculation\n",
+ "#For VDCmin = 15 volts\n",
+ "VSmin=VDCmin-Vz\t\t#in Volts\n",
+ "#For VDCmax = 19.5 volts\n",
+ "VSmax=VDCmax-Vz\t\t#in Volts\n",
+ "ISmin=Izmin+IL\t\t#in mA\n",
+ "Ri=VSmin/ISmin\t\t#in Kohm\n",
+ "Ri=Ri*10**3\t\t#in ohm\n",
+ "\n",
+ "#result\n",
+ "print\"The resistance Ri is \",Ri,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance Ri is 25.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 72
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.22 Page No. 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa4.22\n",
+ "#Determine the range of Rl and Il\n",
+ "\n",
+ "#given data\n",
+ "VRL=10\t\t\t#in Volts Diode resistance\n",
+ "Vi=50\t\t\t#in Volts\n",
+ "R=1.0\t\t\t#in Kohm Resistance\n",
+ "Vz=10\t\t\t#in Volts\n",
+ "VL=Vz\t\t\t#in Volts\n",
+ "Izm=32\t\t\t#in mA\n",
+ "IR=(Vi-VL)/R\t\t#in mA\n",
+ "\n",
+ "Izmin=0\t\t\t #in mA\n",
+ "ILmax=IR-Izmin\t\t#in mA\n",
+ "RLmin=VL/ILmax\t\t#in Ohm\n",
+ "Izmax=32\t\t #in mA\n",
+ "ILmin=IR-Izmax\t\t#in mA\n",
+ "VL=Vz\t\t\t #in Volts\n",
+ "RLmax=VL/ILmin\t\t#in Ohm\n",
+ "\n",
+ "#Result\n",
+ "print\"Range of RL in Kohm : From \",RLmin*1000,\"ohm to \",RLmax,\"kohm\"\n",
+ "print\"Range of IL in mA : From \",ILmin,\"mA to \",ILmax,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Range of RL in Kohm : From 250.0 ohm to 1.25 kohm\n",
+ "Range of IL in mA : From 8.0 mA to 40.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch5.ipynb b/Fundamental_of_Electronics_Devices/Ch5.ipynb
new file mode 100644
index 00000000..49984e90
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch5.ipynb
@@ -0,0 +1,169 @@
+{
+ "metadata": {
+ "name": "El5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Junction Properties (Continued)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page No 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 5.1\n",
+ "#Estimate the junction width in two cases.\n",
+ "\n",
+ "#given data\n",
+ "import math\n",
+ "ND=10**17 #in atoms/cm**3\n",
+ "NA=0.5*10**16 #in atoms/cm**3\n",
+ "Vo=0.7 #in Volts\n",
+ "V=-10.0 #in Volts\n",
+ "ND=ND*10**6 #in atoms/m**3\n",
+ "NA=NA*10**6 #in atoms/m**3\n",
+ "epsilon=8.85*10**-11 #in F/m\n",
+ "e=1.6*10**-19 #coulamb\n",
+ "\n",
+ "#Calculation\n",
+ "#part (i)\n",
+ "#print \"When no external voltage is applied i.e. V=0\"\n",
+ "#print\"VB = 0.7 volts\"\n",
+ "VB=0.7 #in Volts\n",
+ "W1=math.sqrt(2*epsilon*VB*(1/NA+1/ND)/e) #in m\n",
+ "\n",
+ "#part (ii)\n",
+ "#print\"When external voltage of -10 volt is applied\"\n",
+ "#print\"VB = Vo-V volts\"\n",
+ "VB=Vo-V #in Volts\n",
+ "W2=math.sqrt(2*epsilon*VB*(1/NA+1/ND)/e) #in m\n",
+ "\n",
+ "#result\n",
+ "print \"When no external voltage is applied, Junction width is \",round(W1,8),\"m\"\n",
+ "print\"When external voltage of -10 Volt is applied, Junction width is \",round(W2,7),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When no external voltage is applied, Junction width is 3.9e-07 m\n",
+ "When external voltage of -10 Volt is applied, Junction width is 1.5e-06 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page No 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 5.3\n",
+ "#Determine the junction capacitance\n",
+ "\n",
+ "#given data\n",
+ "CTzero=50 #in pF\n",
+ "VR=8 #in Volt\n",
+ "VK=0.7 #in Volt\n",
+ "n=1/3.0 #for Si\n",
+ "\n",
+ "#calculation\n",
+ "CT=CTzero/((1+VR/VK)**n) #in pF\n",
+ "\n",
+ "#result\n",
+ "print\"Junction capacitance is\",round(CT,2),\"pF\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Junction capacitance is 21.59 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page No.196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.4\n",
+ "#Determine the tuning range of the circuit\n",
+ "\n",
+ "#Given\n",
+ "L=12.5*10**-3 #mH inductance\n",
+ "C1=4.0 #pF Capacitance\n",
+ "C2=40.0 #pF Capacitance\n",
+ "\n",
+ "#Calculation\n",
+ "Ctmin=(C1*C1)/(C1+C1) #Min value of total Capacitance\n",
+ "Ctmax=(C2*C2)/(C2+C2) #Max value of total Capacitance\n",
+ "Fmax=1/(2*math.pi*math.sqrt(L*Ctmin*10**-12))\n",
+ "Fmin=1/(2*math.pi*math.sqrt(L*Ctmax*10**-12))\n",
+ "\n",
+ "#result\n",
+ "print\"The tuning range of circuit lies between\",round(Fmin/1000,2),\"khz and\",round(Fmax/1000,0),\"Mhz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The tuning range of circuit lies between 318.31 khz and 1007.0 Mhz\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch6.ipynb b/Fundamental_of_Electronics_Devices/Ch6.ipynb
new file mode 100644
index 00000000..e3eea147
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch6.ipynb
@@ -0,0 +1,763 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Bipolar junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 page No.215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.1\n",
+ "#find the Base current\n",
+ "\n",
+ "#given data\n",
+ "Ic=9.95\t\t\t#in mA\n",
+ "Ie=10 \t\t#in mA\n",
+ "\n",
+ "#Calculation\n",
+ "Ib=Ie-Ic\t\t#in mA\n",
+ "\n",
+ "#result\n",
+ "print\"Emitter current is \",Ib,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current is 0.05 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 page No. 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.2\n",
+ "#Find (i)Emitter current (ii)Current amplification factor (iii)Current gain factor \n",
+ "\n",
+ "#given data\n",
+ "IC=0.98\t\t\t#in mA\n",
+ "IB=20.0\t\t\t#in uA\n",
+ "IB=IB*10**-3\t\t#in mA\n",
+ "\n",
+ "#Calculation\n",
+ "#part (i)\n",
+ "IE=IB+IC\t\t#in mA\n",
+ "\n",
+ "#part (ii)\n",
+ "alpha=IC/IE\t\t#unitless\n",
+ "#part (iii)\n",
+ "Beta=IC/IB\t\t#unitless\n",
+ "\n",
+ "#Result\n",
+ "print\"Emitter current is\",IE,\"mA\"\n",
+ "print\"Current amplification factor is \",alpha\n",
+ "print\"Current gain factor is \",Beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current is 1.0 mA\n",
+ "Current amplification factor is 0.98\n",
+ "Current gain factor is 49.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 page No.216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.3\n",
+ "#Emitter current and Collector current\n",
+ "\n",
+ "#given data\n",
+ "alfaDC=0.98\t\t\t#unitless\n",
+ "ICBO=4\t\t\t\t#in uA\n",
+ "ICBO=ICBO*10**-3\t\t#in mA\n",
+ "IB=50\t\t\t\t#in uA\n",
+ "IB=IB*10**-3\t\t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "#Formula : IC=alfaDC*(IB+IC)+ICBO\n",
+ "IC=alfaDC*IB/(1-alfaDC)+ICBO/(1-alfaDC)\t#in mA\n",
+ "IE=IC+IB\t\t\t#in mA\n",
+ "\n",
+ "#Result\n",
+ "print\"Emitter current is \",IE,\"mA\"\n",
+ "print\"Collector current is \",IC,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current is 2.7 mA\n",
+ "Collector current is 2.65 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 page No. 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.4\n",
+ "#Find the collector current\n",
+ "\n",
+ "#given data\n",
+ "IB=10\t\t\t#in uA\n",
+ "IB=IB*10**-3\t\t#in mA\n",
+ "Beta=99\t\t\t#Unitless\n",
+ "ICO=1\t\t\t#in uA\n",
+ "ICO=ICO*10**-3\t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "#Formula : IC=alfa*(IB+IC)+ICO\n",
+ "IC=Beta*IB+(1+Beta)*ICO\t#in mA\n",
+ "\n",
+ "#Result\n",
+ "print\"Collector current in mA : \",IC,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current in mA : 1.09 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page No.216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.5\n",
+ "#Find (i) alpha , beta and Ie \n",
+ "#(ii)New level of Ib\n",
+ "\n",
+ "#Given\n",
+ "Ic=5*10**-3 #mA collector current\n",
+ "Ic_=10*10**-3 #mA collector current\n",
+ "Ib=50*10**-6 #mA, Base current\n",
+ "Icbo=1*10**-6 #micro A, Current to base open current\n",
+ "\n",
+ "#Calculation\n",
+ "beta=(Ic-Icbo)/(Ib+Icbo)\n",
+ "alpha=(beta/(1+beta))\n",
+ "Ie=Ib+Ic\n",
+ "\n",
+ "Ib=(Ic_-(beta+1)*Icbo)/(beta)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Current gain factor is\",round(beta,0)\n",
+ "print\" Current amplification factor is\",round(alpha,2)\n",
+ "print\" Emitter Current is\",Ie*1000,\"mA\"\n",
+ "print\"(ii)New level of Ib is\",round(Ib*10**6,0),\"micro A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Current gain factor is 98.0\n",
+ " Current amplification factor is 0.99\n",
+ " Emitter Current is 5.05 mA\n",
+ "(ii)New level of Ib is 101.0 micro A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 page No. 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.6\n",
+ "#Find the dynamic input resistance\n",
+ "\n",
+ "#given data\n",
+ "delVEB=200\t\t\t#in Volts\n",
+ "delIE=5\t\t\t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "rin=delVEB/delIE\t\t#in ohm\n",
+ "\n",
+ "#Result\n",
+ "print\"Dynamic input resistance is \",rin,\"mohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dynamic input resistance is 40 mohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 page No. 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.7\n",
+ "#Determine Current gain and base current\n",
+ "\n",
+ "\n",
+ "#given data\n",
+ "ICBO=12.5 \t\t\t#in uA\n",
+ "ICBO=ICBO*10**-3 \t\t#in mA\n",
+ "IE=2 \t\t\t\t#in mA\n",
+ "IC=1.97 \t\t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "alfa=(IC-ICBO)/IE \t\t#unitless\n",
+ "IB=IE-IC \t\t\t#in mA\n",
+ "\n",
+ "#result\n",
+ "print\"Current gain : \",round(alfa,3)\n",
+ "print\"Base current is \",IB,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current gain : 0.979\n",
+ "Base current is 0.03 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8 page No. 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.8\n",
+ "#given data\n",
+ "RL=4.0 \t\t\t#in Kohm\n",
+ "VL=3.0\t\t\t#in volt\n",
+ "alfa=0.96 \t\t#unitless\n",
+ "IC=VL/RL \t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "IE=IC/alfa \t\t#in mA\n",
+ "IB=IE-IC \t\t#in mA\n",
+ "\n",
+ "#result\n",
+ "print\"Base current ia\",round(IB,2),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current ia 0.03 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 page No.227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.9\n",
+ "#Determine Collector emitter voltage and base current\n",
+ "\n",
+ "#given data\n",
+ "VCC=10\t\t\t #in volt\n",
+ "RL=800\t\t\t #in ohm\n",
+ "VL=0.8\t\t\t #in volt\n",
+ "alfa=0.96\t\t #unitless\n",
+ "\n",
+ "#calculation\n",
+ "#VR=IC*RL\n",
+ "VCE=VCC-VL \t\t#in Volt\n",
+ "IC=VL*1000/RL \t\t#in mA\n",
+ "Beta=alfa/(1-alfa) \t#unitless\n",
+ "IB=IC/Beta \t\t#in mA\n",
+ "\n",
+ "#Result\n",
+ "print\"Collector-emitter Voltage is \",VCE,\"V\"\n",
+ "print\"Base current in uA : \",round(IB*1000,2),\"microA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector-emitter Voltage is 9.2 V\n",
+ "Base current in uA : 41.67 microA\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 page No. 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.10\n",
+ "#Determine Collector Current\n",
+ "\n",
+ "#given data\n",
+ "alfao=0.98 \t\t#unitless\n",
+ "ICO=10 \t\t\t#in uA\n",
+ "ICO=ICO*10**-3 \t\t#in mA\n",
+ "IB=0.22 \t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "IC=(alfao*IB+ICO)/(1-alfao) \t#in mA\n",
+ "\n",
+ "#result\n",
+ "print\"Collector current is\",IC,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current is 11.28 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.11 page No. 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.11\n",
+ "#determine Dynamic input resistance \n",
+ "\n",
+ "#given data\n",
+ "delVEB=250 \t\t#in mVolts\n",
+ "delIE=1 \t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "rin=delVEB/delIE \t#in ohm\n",
+ "\n",
+ "#result\n",
+ "print\"Dynamic input resistance is\",rin,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dynamic input resistance is 250 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.12 page No. 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.12\n",
+ "#Determine Dynamic output resistance\n",
+ "\n",
+ "#given data\n",
+ "delVCE=10-5 \t\t#in Volts\n",
+ "delIC=5.8-5\t \t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "rin=delVCE/delIC \t#in Kohm\n",
+ "\n",
+ "#result\n",
+ "print\"Dynamic output resistance is \",rin,\"kohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dynamic output resistance is 6.25 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.13 page No.232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.13\n",
+ "#Determine operating point\n",
+ "\n",
+ "#given data\n",
+ "VCC=10 \t\t\t#in volt\n",
+ "RC=8 \t\t\t#in Kohm\n",
+ "Beta=40 \t\t#unitless\n",
+ "IB=15 \t\t\t#in uA\n",
+ "IB=IB*10**-3 \t\t#in mA\n",
+ "\n",
+ "#calculation\n",
+ "# For VCE = 0 Volts\n",
+ "IC=VCC/RC \t\t#in mA\n",
+ "#For IC=0 VCE=VCC=10V :\n",
+ "IC=Beta*IB \t\t#in mA\n",
+ "VCE=VCC-IC*RC \t\t#in Volts\n",
+ "\n",
+ "#result\n",
+ "print\"Operating point Q is (\",VCE,\"V,\",IC,\"mA)\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "Vce=[0,10]\n",
+ "Ic=[1.25,0]\n",
+ "plt.xlabel('Vce,V')\n",
+ "plt.ylabel('Ic,mA')\n",
+ "ax.plot([5.2], [0.6], 'o')\n",
+ "ax.annotate('(5.2V,0.6 mA)', xy=(5.4,0.7))\n",
+ "\n",
+ "a=plot(Vce,Ic)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating point Q is ( 5.2 V, 0.6 mA)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEPCAYAAABCyrPIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1YVGXeB/DvwJBiGhgqioA4IjK8Q6BhmlO8CBTUEhXa\nauILiIAS1uNDWxe6u1qkayKQmaGb6SI+a74VjAYr6FqiBgIiKBqkkMuGwSqpIDPn+UN3isB4keEM\n8P1cV9fFDPc582Uum9/cv3POfSSCIAggIqIBT0/sAEREpBtYEIiICAALAhER3cOCQEREAFgQiIjo\nHhYEIiICoOWCMH/+fJiamsLR0fE3x506dQpSqRSfffaZNuMQEdFv0GpBCAsLg1Kp/M0xKpUKK1as\ngJ+fH3hJBBGReLRaEKZPn47hw4f/5pjk5GSEhIRg5MiR2oxCREQdEPUYQk1NDfbv34/IyEgAgEQi\nETMOEdGAJmpBiI2NxbvvvguJRAJBENgyIiISkVTMF//mm28QGhoKAKirq0NWVhYMDAwQFBTUapy1\ntTUuXbokRkQioj5rwoQJuHjxYuc3ELSssrJScHBw6HDcvHnzhD179rT7u16I2WckJCSIHUFn8L34\nGd+Ln/G9+FlXPzu1OkOYNWsW8vLyUFdXBwsLC6xatQp37twBAERERGjzpYmIqIu0WhDS09M7PXbb\ntm1aTEJERB3hlcp9jEKhEDuCzuB78TO+Fz/je9F9knt9Jp3237OQiIio87r62ckZ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SJdw4JABOCF\nF17AF198gZaWFgDQLJI2bdo0JCYmwsnJCS4uLoiPjwdwdzE1f39/uLu748knn8T58+fb7PPXRWbX\nrl2YNWtW7/xBRN3AK5WJ7gkMDMSiRYsQFBSEd999Fz/++COeeuop/PnPf0ZOTg4GDx6MhoYGGBsb\nw8vLC5s3b4a1tTXy8/Px5ptvIicnp9X+amtr4erqiurqaujp6cHOzg5///vfB/waO6S7pGIHINIV\n//1GHxQUhIyMDGzduhU7d+7E/PnzMXjwYACAsbExGhsb8fXXX+PFF1/UbNvc3Nxmf6ampnBwcEB2\ndjZGjRoFqVTKYkA6jQWB6J6goCC89tprKCwsxM2bN+Hq6oqdO3e2ue+CWq2GsbExCgsLO9znf4uM\nqalpt49HEPUWHkMgumfo0KF46qmnEBYWpvnw9vHxwbZt23Dr1i0AQH19PR555BGMHz8ef//73wHc\nXZq8uLgYALB37168+eabmn0GBwfjiy++QEZGBkJDQ3v5LyLqGhYEol+YNWsWSkpKNAd/Z86ciaCg\nILi7u8PV1RV/+ctfAAA7d+5EWloaXFxc4ODggAMHDgC4e7D5l/c1NjIywtSpUzF69GhYWVn1+t9D\n1BU8qEzUg+bMmYMNGzbAxMRE7ChEXcaCQEREANgyIiKie1gQiIgIAAsCERHdw4JAREQAWBCIiOge\nFgQiIgLAgkBERPf8PzB3vekNwU7EAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7a67da0>"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.14 page No. 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.14\n",
+ "#How will the Q point change when load resistance will be change\n",
+ "\n",
+ "#given data \n",
+ "Vcc=12 \t\t#in Volt collector supply voltage\n",
+ "Ic=1.2 #A, collector current\n",
+ "Rl=5 #kohm load resistance\n",
+ "\n",
+ "#calculation\n",
+ "Vce=Vcc-Ic*Rl #Collector emitter voltage\n",
+ "Rl1=7.5\n",
+ "Vce1=Vcc-Ic*Rl1\n",
+ "\n",
+ "#result\n",
+ "print\"Operating point at load resistance 5 kohm is (\",Vce,\"V,\",Ic,\"mA)\"\n",
+ "print\"Operating point at load resistance 7.5 kohm is (\",Vce1,\"V,\",Ic,\"mA)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating point at load resistance 5 kohm is ( 6.0 V, 1.2 mA)\n",
+ "Operating point at load resistance 7.5 kohm is ( 3.0 V, 1.2 mA)\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.15 Page No.233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.15\n",
+ "#Given\n",
+ "Vcc=20 # V, collector voltage\n",
+ "Rc=3.3*10**3\n",
+ "\n",
+ "#calculation\n",
+ "#Appling kirchoff's Voltage Law\n",
+ "Ic=0 #for cut off point\n",
+ "Vce=Vcc\n",
+ "Ic=Vcc/Rc\n",
+ "print \"Collector to emitter voltage is (Vce)\",Vce,\"V\"\n",
+ "print \"Collector current at saturation point is (Ic)\",round(Ic*1000,0),\"mA\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "Vce=[0,20]\n",
+ "Ic=[6,0]\n",
+ "xlabel(\"Vce (V)\") \n",
+ "ylabel(\"Ic (mA)\") \n",
+ "plt.xlim((0,25))\n",
+ "plt.ylim((0,8))\n",
+ "ax.plot([0], [6], 'o')\n",
+ "ax.annotate('(0,6mA)', xy=(0,6))\n",
+ "\n",
+ "ax.plot([20], [0], 'o')\n",
+ "ax.annotate('(20V,0)', xy=(20,0))\n",
+ "a=plot(Vce,Ic)\n",
+ "show(a)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector to emitter voltage is (Vce) 20 V\n",
+ "Collector current at saturation point is (Ic) 6.0 mA\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEMCAYAAAAlGRZyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHwFJREFUeJzt3XtUVXX+//HnUYz5Nl4wL4iiYiYJgoA30sk8pmaWIt4K\nbbLEpoZZzWjfGs2mXzGXb5PLLqPW1Hcab2kLdaaJLJG81EmLHELJNEvNoEHDvmkYEgkC+/cHcQRB\n7vvc9uux1lkD52z2+3P22vPu4/u9P3vbDMMwEBERn9bG3QMQERHzKdmLiFiAkr2IiAUo2YuIWICS\nvYiIBSjZi4hYgKnJ/s9//jODBg0iMjKSOXPmUFJSYmY4ERG5DNOSfW5uLi+99BL79+/n4MGDlJeX\ns3HjRrPCiYhIPfzM2nHHjh1p164dxcXFtG3bluLiYnr16mVWOBERqYdpM/urrrqKBx98kD59+tCz\nZ08CAgIYP368WeFERKQ+hkk+//xzIywszDh9+rRx4cIFIz4+3tiwYUONbQC99NJLL72a8Woq02b2\nWVlZjBo1ii5duuDn58f06dPJyMiotZ1hGHoZBo8//rjbx+ApLx0LHQsdi/pfzWFash84cCB79+7l\nhx9+wDAMdu7cSXh4uFnhRESkHqYl+6ioKObOncuwYcMYPHgwAPfee69Z4UREpB6mXY0DsGjRIhYt\nWmRmCJ9ht9vdPQSPoWNxkY7FRToWLWMzmlsAao3gNluz608iIlbVnNyp2yWIiFiAkr2IiAUo2YuI\nWICSvYiIBSjZi4hYgJK9iIgFKNmLiFiAkr2IiAUo2YuIWICSvYiIBSjZi4hYgJK9iIgFKNmLiFiA\nkr2IiAUo2YuIWICSvYiIBSjZi4hYgJK9iIgFmJrs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993HX//6\nV+d22dnZjBw50iVfv7WZtqjq1VdfJT09nZdeegmADRs28O9//5uVK1deDO6F/xQSEfEETU3dfiaN\no1bdKy8vj+Dg4BrbaPWsiDRFaWkp48eP591333X5ZLGkpIQJEya4JXZrMG1mX1ZWxrXXXsuuXbvo\n2bMnI0aMICUlhbCwMDPCiYhIPUyb2fv5+fHcc88xceJEysvLmT9/vhK9iIibmHqd/aRJkzhy5Aif\nf/45S5YsqfGZrsG/KCQkhMGDBxMTE+O8hMwqEhMTCQwMJDIy0vnet99+y4QJEwgNDeWmm27i7Nmz\nbhyh69R1LJKTkwkODnY2IdPT0904QtfJy8tj7NixDBo0iIiICFasWAFY89y43LFo8rlhuEFZWZnR\nv39/IycnxygtLTWioqKMw4cPu2MoHiEkJMQ4c+aMu4fhFrt37zb2799vREREON/77W9/ayxdutQw\nDMN48sknjcWLF7treC5V17FITk42nn76aTeOyj3y8/ON7OxswzAM49y5c0ZoaKhx+PBhS54blzsW\nTT033HK7BF2DX5th0Wb16NGj6dy5c433qt+bpPq9TXxdXccCrHlu9OjRg+joaADat29PWFgYJ0+e\ntOS5cbljAU07N9yS7HUNfk02m43x48czbNgw56WqVvb11187F7EEBgY6b0JlVStXriQqKor58+db\nomxxqdzcXLKzs4mNjbX8uVF1LK677jqgaeeGW5K9N162ZKb333+f7Oxstm3bxvPPP8+ePXvcPSSP\nYbPZLH2+JCUlkZOTw0cffURQUBAPPvigu4fkUkVFRcyYMYPly5fXui+O1c6NoqIiZs6cyfLly2nf\nvn2Tzw23JPvGXINvJUFBQQB069aNadOmkZmZ6eYRuVdgYCCnTp0CKm901b17dzePyH26d+/uTGr3\n3HOPpc6NCxcuMGPGDO68807nLQ+sem5UHYuf//znzmPR1HPDLcl+2LBhHDt2jNzcXEpLS9m0aRNx\ncXHuGIrbFRcXc+7HJ/V8//33bN++vcbVGFYUFxfHunXrgNr3NrGa/Px858+vvfaaZc4NwzCYP38+\n4eHhLFy40Pm+Fc+Nyx2LJp8bJjSPGy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KHr06FErsWdmZjJ69OjW+WIizaQboYk0w913301SUhKx\nsbH1bldYWMi4ceP48MMPXTQykbppZi/SDA899BAvvvhig9utXbuWBQsWuGBEIvXTzF5ExAI0sxcR\nsQAlexERC1CyFxGxACV7ERELULIXEbEAJXsREQv4/4w+NkMIq9efAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.16 page No. 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.16\n",
+ "#find collector voltage and base voltage\n",
+ "\n",
+ "#given data \n",
+ "Beta=45 \t\t\t#Unitless\n",
+ "VBE=0.7 \t\t\t#in Volt\n",
+ "VCC=0 \t\t\t\t#in Volt\n",
+ "RB=10**5 \t\t\t#in ohm\n",
+ "RC=1.2*10**3 \t\t\t#in ohm\n",
+ "VEE=-9 \t\t\t\t#in Volt\n",
+ "\n",
+ "#calculation\n",
+ "#Applying Kirchoffs Voltage Law in input loop we have\n",
+ "#IB*RB+VBE+VEE=0\n",
+ "IB=-(VBE+VEE)/RB \t\t#in mA\n",
+ "IC=Beta*IB \t\t\t#in mA\n",
+ "VC=VCC-IC*RC \t\t\t#in Volts\n",
+ "VB=VBE+VEE \t\t\t#in Volts\n",
+ "\n",
+ "#Result\n",
+ "print\"collector voltage is \",round(VC,1),\"V\"\n",
+ "print\"Base voltage is \",VB,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "collector voltage is -4.5 V\n",
+ "Base voltage is -8.3 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch7.ipynb b/Fundamental_of_Electronics_Devices/Ch7.ipynb
new file mode 100644
index 00000000..6700dc78
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch7.ipynb
@@ -0,0 +1,476 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Field effect Transistors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.1 page no. 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.1\n",
+ "#What is Resistance between gate and source\n",
+ "\n",
+ "#given data \n",
+ "VGS=10\t\t\t#in Volt\n",
+ "IG=0.001\t\t#in uA\n",
+ "IG=IG*10**-6\t\t#in A\n",
+ "\n",
+ "#calculation\n",
+ "RGS=VGS/IG\t\t#in ohm\n",
+ "\n",
+ "#result\n",
+ "print\"Resistance between gate and source is \",RGS/10**6,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance between gate and source is 10000.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 page no.262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.2\n",
+ "#What is AC drain resistance of JFET\n",
+ "\n",
+ "#given data \n",
+ "delVDS=1.5\t\t\t#in Volt\n",
+ "delID=120\t\t\t#in uA\n",
+ "delID=120*10**-6\t\t#in A\n",
+ "\n",
+ "#Calculation\n",
+ "rd=delVDS/delID\t\t\t#in Ohm\n",
+ "\n",
+ "#Result\n",
+ "print\"AC drain resistance of JFET in Kohm \",rd*10**-3,\"kohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "AC drain resistance of JFET in Kohm 12.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3 page no. 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.3\n",
+ "#Determine Transconductance\n",
+ "\n",
+ "#given data \n",
+ "VP=-4.5\t\t\t#in Volt\n",
+ "IDSS=10.0\t\t\t#in mA\n",
+ "IDS=2.5\t\t\t#in mA\n",
+ "\n",
+ "#Calculation\n",
+ "VGS=VP*(1-math.sqrt(IDS/IDSS))\t\t#in Volt\n",
+ "gm=(-2*IDSS/VP)*(1-VGS/VP)\t\t#in mA/Volt\n",
+ "\n",
+ "#Result\n",
+ "print\"Transconductance is\",round(gm,2),\"mA/v\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transconductance is 2.22 mA/v\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4 page no. 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.4\n",
+ "#calculate Vgs off\n",
+ "\n",
+ "#given data \n",
+ "gm=10\t\t\t#in mS\n",
+ "IDSS=10\t\t\t#in uA\n",
+ "IDSS=IDSS-10**-6\t#in Ampere\n",
+ "\n",
+ "#Calculation\n",
+ "VGS_OFF=-2*IDSS/gm\n",
+ "\n",
+ "#Result\n",
+ "print\"VGS(OFF) is =\",round(VGS_OFF),\"mV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VGS(OFF) is = -2.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5 page no. 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.5\n",
+ "#Determine The minimum value of VDS for pinch-OFF region is equal to VP.\n",
+ "\n",
+ "#given data \n",
+ "VP=-4.0\t\t\t #in Volt\n",
+ "IDSS=10.0\t\t\t #in mA\n",
+ "IDSS=IDSS*10**-3\t#in Ampere\n",
+ "VGS=-2.0 #in Volt\n",
+ "\n",
+ "#Calculation\n",
+ "ID=IDSS*(1.0-VGS/VP)**2\t#in mA\n",
+ "\n",
+ "#result\n",
+ "print \"Drain current=\",ID*1000,\"mA\"\n",
+ "print\"VDS(min) is : \",VP,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current= 2.5 mA\n",
+ "VDS(min) is : -4.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 page no. 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.6\n",
+ "#Find the value of Id , gmo, gm\n",
+ "\n",
+ "#given data \n",
+ "VP=-3.0\t\t\t#in Volt\n",
+ "IDSS=8.7\t\t#in mA\n",
+ "IDSS=IDSS*10**-3\t#in mA\n",
+ "VGS=-1\t\t\t#in Volt\n",
+ "\n",
+ "#calculation\n",
+ "ID=IDSS*(1-VGS/VP)**2\t#in Ampere\n",
+ "gmo=-2*IDSS/VP\t\t#in mS\n",
+ "gm=gmo*(1-VGS/VP)\t#in mS\n",
+ "\n",
+ "#result\n",
+ "print\"ID is \",round(ID*1000,1),\"mA\"\n",
+ "print\"gmo is\",round(gmo*1000,1),\"mS\"\n",
+ "print\"gm is \",round(gm*1000,1),\"mS\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ID is 3.9 mA\n",
+ "gmo is 5.8 mS\n",
+ "gm is 3.9 mS\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 page no.263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.7\n",
+ "#Find gm\n",
+ "\n",
+ "#given data \n",
+ "VP=-3.0 \t\t#in Volt\n",
+ "IDSS=8.4 \t#in mA\n",
+ "VGS=-1.5 \t#in Volt\n",
+ "\n",
+ "#calculation\n",
+ "ID=IDSS*(1-VGS/VP)**2 \t\t#in mA\n",
+ "gmo=-2*IDSS/VP \t\t\t#in mS\n",
+ "gm=gmo*(1-VGS/VP) \t\t#in mS\n",
+ "\n",
+ "#result\n",
+ "print\"Drain current=\",ID,\"mA\"\n",
+ "print\"Transconductance is \",gm,\"mS\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current= 2.1 mA\n",
+ "Transconductance is 2.8 mS\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8 page no.263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.8\n",
+ "#What is gm \n",
+ "\n",
+ "#given data \n",
+ "VP=-4.5 \t\t #in Volt\n",
+ "IDSS=9 \t\t\t#in mA\n",
+ "IDSS=IDSS*10**-3 #in Ampere\n",
+ "IDS=3 \t\t\t #in mA\n",
+ "IDS=IDS*10**-3 \t\t#in Ampere\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "VGS=VP*(1-math.sqrt(IDS/IDSS)) \t#in Volt\n",
+ "gm=(-2*IDSS/VP)*(1-VGS/VP) \t\t#in mS\n",
+ "\n",
+ "#result\n",
+ "print\"IDS = 3 mA when gm is \",round(gm*1000,2),\"mS\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IDS = 3 mA when gm is 2.31 mS\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.9 page no.271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.9\n",
+ "#given data :\n",
+ "Vp=-4.0 \t\t\t #in Volt\n",
+ "IDSS=10.0 \t\t #in mA\n",
+ "#From eq 7.1\n",
+ "Vgs1=0\n",
+ "Id1=IDSS # mA, at Vgs=0\n",
+ "Vgs2=1\n",
+ "Id2=Id1*(1-Vgs2/Vp)**2 #mA, at Vgs=1\n",
+ "Vgs3=-1\n",
+ "Id3=Id1*(1-Vgs3/Vp)**2 #mA, at Vgs=1\n",
+ "Vgs4=-2\n",
+ "Id4=Id1*(1-Vgs4/Vp)**2 #mA, at Vgs=-2\n",
+ "Vgs5=-4\n",
+ "Id5=Id1*(1-Vgs5/Vp)**2 #mA, at Vgs=-4\n",
+ "\n",
+ "print \"Transfer Characteristics are in mA \",Id1,Id2,Id3,Id4,Id5\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "Vgs=[-4,-2,-1,0,1]\n",
+ "Id=[0,2.5,5.625,10,15.625]\n",
+ "xlabel(\"Vgs (V)\") \n",
+ "ylabel(\"Id (mA)\") \n",
+ "plt.xlim((-4,2))\n",
+ "plt.ylim((0,18))\n",
+ "ax.plot([0], [10], 'o')\n",
+ "ax.annotate('(Idss)', xy=(0,10))\n",
+ "\n",
+ "a=plot(Vgs,Id)\n",
+ "\n",
+ "print \"Transfer Characteristics for N channel MOSFET Type\"\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transfer Characteristics are in mA 10.0 15.625 5.625 2.5 0.0\n",
+ "Transfer Characteristics for N channel MOSFET Type"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEMCAYAAAAoB2Y1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xlczfn+B/DXyRaTJeFYImRpL0s1Y2SOJWWJJkwyZCrj\nDnMN416zXNwbxjAjjO3O/HApZiQjki0iJ0yaojRZRjMU0WIbyVaq7+8PM2cm2p3v+Z7l9fyrjnPO\n9/V9cF/zud/3d5EJgiCAiIgMgpHUAYiISHNY+kREBoSlT0RkQFj6REQGhKVPRGRAWPpERAZEtNIP\nDAyEXC6Hvb296rWkpCS4uLigV69ecHZ2RnJyslibJyKiCohW+gEBAYiJiSn32kcffYRFixYhNTUV\nCxcuxEcffSTW5omIqAKilb6bmxtMTU3LvdauXTsUFBQAAO7du4cOHTqItXkiIqqATMwrcrOysuDl\n5YX09HQAwNWrV9G/f3/IZDKUlZXh1KlT6Nixo1ibJyKi59TX5MaCgoKwevVqvPnmm/j+++8RGBiI\n2NjYF94nk8k0GYuISG9Uu44XRJSZmSnY2dmpfm/atKnq57KyMqFZs2YVfk7kWJL7z3/+I3UEUXH/\ndJc+75sg6P/+1aQ7NXrKZrdu3RAfHw8AiIuLQ48ePTS5eSIigyfa4R0/Pz/Ex8fj9u3b6NixIxYu\nXIj169fj/fffR1FRERo3boz169eLtXkiIqqAaKUfHh5e4es//vijWJvUGQqFQuoIouL+6S593jdA\n//evJkQ9e6euZDJZ9cMIIiIqpybdydswEBEZEJY+EZEBYekTERkQlj4Rk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DaKX\nxZU+EZEB4SCXiMiAsPSJiAwIS5+IyICw9ImIDAhLn4jIgLD0iYgMyP8Dr4y+N/dLTzoAAAAASUVO\nRK5CYII=\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10 page no.275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 7.10\n",
+ "#Determine the drain current\n",
+ "\n",
+ "#given data \n",
+ "ID_on=5 \t\t#in mA\n",
+ "VGS=6 \t\t\t#in Volt\n",
+ "VGS_on=8.0 \t\t#in Volt\n",
+ "VGST=4 \t\t\t#in Volt\n",
+ "\n",
+ "#calculation\n",
+ "K=ID_on/(VGS_on-VGST)**2 \t\t#in mA/V**2\n",
+ "ID=K*(VGS-VGST)**2 \t\t\t#in mA\n",
+ "\n",
+ "#result\n",
+ "print\"When VGS=6V the drain current is \",ID,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When VGS=6V the drain current is 1.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/Ch8.ipynb b/Fundamental_of_Electronics_Devices/Ch8.ipynb
new file mode 100644
index 00000000..f4ce4661
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/Ch8.ipynb
@@ -0,0 +1,228 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Photonic Devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 8.1\n",
+ "#Find Steady state photocurrent density\n",
+ "\n",
+ "#given data \n",
+ "NA=10**22 #in atoms/m**3\n",
+ "ND=10**22 #in atoms/m**3\n",
+ "De=25*10**-4 \t#in m**2/s\n",
+ "Dh=10**-3\t\t#in m**2/s\n",
+ "TAUeo=500\t\t#in ns\n",
+ "TAUho=100\t\t#in ns\n",
+ "ni=1.5*10**16\t\t#in atoms/m**3\n",
+ "VR=-10\t\t\t#in Volt\n",
+ "epsilon=11.6*8.854*10**-12\t#in F/m\n",
+ "e=1.6*10**-19\t\t\t#in Coulamb\n",
+ "VT=26\t\t\t\t#in mV\n",
+ "GL=10**27\t\t\t#in m**-3 s**-1\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Le=math.sqrt(De*TAUeo*10**-9)\t#in um\n",
+ "Le=Le*10**6\t\t\t#in um\n",
+ "Lh=math.sqrt(Dh*TAUho*10**-9)\t#in um\n",
+ "Lh=Lh*10**6\t\t\t#in um\n",
+ "Vbi=VT*10**-3*math.log(NA*ND/ni**2)\t#in Volt\n",
+ "Vo=Vbi\t\t\t\t#in Volt\n",
+ "VB=Vo-VR\t\t\t#in Volt\n",
+ "W=math.sqrt((2*epsilon*VB/e)*(1/NA+1/ND))\t#in um\n",
+ "W=W*10**6\t\t\t#in um\n",
+ "JL=e*(W+Le+Lh)*10**-6*GL\t#in A/cm**2\n",
+ "\n",
+ "#Result\n",
+ "print \"Steady state photocurrent density is \",round(JL/10**4,3),\"A/cm**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state photocurrent density is 0.726 A/cm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page no 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 8.2\n",
+ "#Find Steady state photocurrent density\n",
+ "\n",
+ "#given data \n",
+ "import math\n",
+ "W=25\t\t\t#in um\n",
+ "PhotonFlux=10**21\t#in m**2s**-1\n",
+ "alfa=10**5\t\t#in m**-1\n",
+ "e=1.6*10**-19\t\t#in Coulambs\n",
+ "\n",
+ "#calculation\n",
+ "GL1=alfa*PhotonFlux\t#in m**-3s**-1\n",
+ "GL2=alfa*PhotonFlux*math.exp(-alfa*W*10**-6)\t#in m**-3s**-1\n",
+ "JL=e*PhotonFlux*(1-math.exp(-alfa*W*10**-6))\t#in mA/cm**2\n",
+ "\n",
+ "#Result\n",
+ "print\"Steady state photocurrent density is \",round(JL/10,2),\"mA/cm**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady state photocurrent density is 14.69 mA/cm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 8.3\n",
+ "#DEtermine Open circuit voltage .\n",
+ "\n",
+ "#given data \n",
+ "NA=7.5*10**24\t\t#in atoms/m**3\n",
+ "ND=1.5*10**22\t\t#in atoms/m**3\n",
+ "De=25.0*10**-4\t\t#in m**2/s\n",
+ "Dh=10.0**-3\t\t#in m**2/s\n",
+ "TAUeo=500.0\t\t#in ns\n",
+ "TAUho=100.0\t\t#in ns\n",
+ "ni=1.5*10**16\t\t#in atoms/m**3\n",
+ "VR=-10.0\t\t\t#in Volt\n",
+ "epsilon=11.6*8.854*10**-12\t#in F/m\n",
+ "e=1.6*10**-19\t\t#in Coulamb\n",
+ "VT=26.0\t\t\t#in mV\n",
+ "GL=10.0**27\t\t#in m**-3 s**-1\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Le=math.sqrt(De*TAUeo*10**-9)\t#in m\n",
+ "Le=Le*10**6\t\t\t#in um\n",
+ "Lh=math.sqrt(Dh*TAUho*10**-9)\t#in m\n",
+ "Lh=Lh*10**6\t\t\t#in um\n",
+ "JS=e*(ni**2)*(De/(Le*10**-6*NA)+Dh/(Lh*10**-6*ND))\t#in A/cm**2\n",
+ "JL=12.5\t\t\t\t#in mA/cm**2\n",
+ "VOC=VT*math.log(1.0+((JL*10**-3)/(JS*10**-4)))\t\t#in Volt\n",
+ "\n",
+ "#Result\n",
+ "print\"Open circuit voltage is\",round(VOC/1000,3),\"V\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Open circuit voltage is 0.522 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 8.4\n",
+ "#Find The total no. of cells required\n",
+ "#given data \n",
+ "Vout=28\t\t\t#in Volts\n",
+ "Vcell=0.45\t\t#in Volt\n",
+ "n=Vout/Vcell\t\t#Unitless\n",
+ "Iout=1\t\t\t#in A\n",
+ "Icell=50\t\t#in mA\n",
+ "\n",
+ "#Calculation\n",
+ "m=Iout/(Icell*10**-3)\t#unitless\n",
+ "\n",
+ "#Result\n",
+ "print\"The total no. of cells required : \",round(m*n)\n",
+ "#Note : Answer in the book is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total no. of cells required : 1244.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/README.txt b/Fundamental_of_Electronics_Devices/README.txt
new file mode 100644
index 00000000..da7bc292
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Rahul Garg
+Course: btech
+College/Institute/Organization: Gurgaon College of Engineering, MDU Rohtak
+Department/Designation: Electronics Engineering
+Book Title: Fundamental of Electronics Devices
+Author: JB Gupta
+Publisher: Katariya & Sons, New Delhi
+Year of publication: 2010
+Isbn: 9380027745, 9789380027746
+Edition: 2 \ No newline at end of file
diff --git a/Fundamental_of_Electronics_Devices/screenshots/energybands.png b/Fundamental_of_Electronics_Devices/screenshots/energybands.png
new file mode 100644
index 00000000..26f3a730
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/screenshots/energybands.png
Binary files differ
diff --git a/Fundamental_of_Electronics_Devices/screenshots/steadystatephoto.png b/Fundamental_of_Electronics_Devices/screenshots/steadystatephoto.png
new file mode 100644
index 00000000..5f0c6810
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/screenshots/steadystatephoto.png
Binary files differ
diff --git a/Fundamental_of_Electronics_Devices/screenshots/transfercharateristics.png b/Fundamental_of_Electronics_Devices/screenshots/transfercharateristics.png
new file mode 100644
index 00000000..85c6b507
--- /dev/null
+++ b/Fundamental_of_Electronics_Devices/screenshots/transfercharateristics.png
Binary files differ
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_2.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_2.ipynb
new file mode 100644
index 00000000..f19146e9
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_2.ipynb
@@ -0,0 +1,591 @@
+{
+ "metadata": {
+ "name": "Ch 2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter No.2 :FLUID STATICS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page no.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.1\n",
+ "#calculate pressure at interface and pressure head and at bottom.\n",
+ "#given\n",
+ "sg=0.68 #specific gravity of gasoline\n",
+ "htg=17 #ft (height of gasoline)\n",
+ "htw=3 #ft (height of water)\n",
+ "#pressure p= (gamma*h)+atmp\n",
+ "\n",
+ "#calculation\n",
+ "#pressure at water- gasoline interface p1 =sg*g*htg+atmp\n",
+ "p1=sg*62.4*htg #atmp=0 , p1 is in lb/ft**2\n",
+ "pr1=p1/144 #lb/in**2\n",
+ "#pressure head as feet of water H\n",
+ "H= p1/62.4 #ft\n",
+ "#similarly pressure p2 at tank bottom\n",
+ "p2=62.4*htw+p1 #lb/ft**2\n",
+ "pr2 = p2/144 #lb/in**2\n",
+ "#pressure head as ft of water H1\n",
+ "H1=p2/62.4 #ft\n",
+ "\n",
+ "#Result\n",
+ "print \"pressure at interface=\",round(p1,1),\"lb/ft**2\"\n",
+ "print \"pressure head at interface in feet of water =\",round(H,1),\"ft\"\n",
+ "print \"pressure at bottom=\",round(p2,1),\"lb/ft**2\"\n",
+ "print \"pressure head at bottom in feet of water =\",round(H1,1),\"ft\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure at interface= 721.3 lb/ft**2\n",
+ "pressure head at interface in feet of water = 11.6 ft\n",
+ "pressure at bottom= 908.5 lb/ft**2\n",
+ "pressure head at bottom in feet of water = 14.6 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page no.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.2\n",
+ "#Calculate ratio of pressure at the top to that at the base considering air to be incompressible.\n",
+ "#Given\n",
+ "h=1250 #ft , height\n",
+ "T=59 #degree farenheit, Temprature\n",
+ "p=14.7 #psi (abs), pressure\n",
+ "sw=0.0765 #lb/ft**3, (specific weight of air at p)\n",
+ "\n",
+ "#considering air to be compressible\n",
+ "#calculation\n",
+ "import math\n",
+ "#p1/p2=math. exp(-(g*(z1-z2))/(R*T))\n",
+ "ratp=math.exp(-(32.2*h)/(1716*(59+460)))\n",
+ "print \"ratio of pressure at the top to that at the base considering air to be compressible=\",round(ratp,3)\n",
+ "\n",
+ "#considering air to be incompressible\n",
+ "#p2=p1-(sw*(z2-z1))\n",
+ "ratp1=1-((sw*h)/(p*144))\n",
+ "print \"ratio of pressure at the top to that at the base considering air to be incompressible=\",round(ratp1,3)\n",
+ "\n",
+ "#Plot\n",
+ "z=[0,1250,5000]\n",
+ "p=[1,0.955,0.82]\n",
+ "a=plot(z,p)\n",
+ "\n",
+ "z1=[0,1250,5000]\n",
+ "p1=[1,0.956,0.84]\n",
+ "a1=plot(z1,p1)\n",
+ "xlabel(\"(Z2-Z1)(ft)\") \n",
+ "ylabel(\"(p2-p1)\") \n",
+ "show(a)\n",
+ "show(a1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ratio of pressure at the top to that at the base considering air to be compressible= 0.956\n",
+ "ratio of pressure at the top to that at the base considering air to be incompressible= 0.955\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEPCAYAAACDTflkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdY1uUex/E3SzNnLhxYKFNlGo6GCo7INMvGcbXUzFNZ\nVlZmooKYqzqFmie1HFma1fFkS1KP4siUzC3mphRzZSLiYN3nD5EkF+Kz4Pm8rsvr8vk9v/Hlvi75\nen9+y8UYYxARESkGV3sXICIiJZeaiIiIFJuaiIiIFJuaiIiIFJuaiIiIFJuaiIiIFJtVm0jv3r3x\n9PQkODj4sus8//zz+Pn5ERoayvr16wuWJyYmEhgYiJ+fH2PHjrVmmSIiUkxWbSK9evUiMTHxst9/\n99137Nq1i507dzJlyhSefvppAHJzc+nfvz+JiYmkpKQwZ84ctm3bZs1SRUSkGKzaRFq2bMlNN910\n2e+/+uorHn/8cQCaN2/O8ePHOXjwIMnJyfj6+uLt7Y2HhwfdunVj/vz51ixVRESKwa7nRNLS0qhX\nr17BZy8vL9LS0jhw4MAll4uIiGOx+4l1PXVFRKTkcrfnwevWrcu+ffsKPu/fvx8vLy+ys7MLLd+3\nbx9eXl4XbV+phicZRw/bpFYRkdLCx8eHXbt2WWRfdp2JdO7cmY8++giA1atXU6VKFTw9PYmIiGDn\nzp2kpqaSlZXF3Llz6dy580XbZxw9zL7DJ4gY9Boug6rR5a1xnDp7FmOM0/0ZPny43WtwlD8aC42F\nxuLKf3bv3m2x3+NWnYl0796dZcuWcfToUerVq0dcXBzZ2dkA9OvXj3vuuYfvvvsOX19fypcvz/Tp\n088V5e7OxIkTiY6OJjc3lz59+tCwYcNLHsOrRkV+GjOar1f15vHZL3LTkA8YE/kuL3TsYM0fTURE\nsHITmTNnzlXXmThx4iWXd+jQgQ4dit4I7r3djz9u+4aXp3zLy4sH8K8Vk/jiyXdo5utb5H2IiMi1\nsf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8PXXX9OpUyfWr18PwPTp\n00lKSqJq1aoA1KpVi6NHj5KZmUn58uWL/sOLWJjOiYjTOXr06EWPkv/nP//JY489xm233XbR+lu3\nbuW1115j8uTJl91nbm4ujzzyCCNHjqRBgwZFqqNs2bLk5eVx5swZfv3114KnsMK5h05ejaenZ6En\nsYrYg5qIOKULf0nPnDmTffv2MXTo0IvW279/Pw888ACzZs2ifv36AHz55ZcFJ9HXrVsHwMiRI6lb\nty6PP/74Nddx/h0PRWkcl9tWxF4UZ4nTqV69OidPngRgz549DBkyhBUrVlwUQR0/fpyOHTsyduzY\nQjOU+++/v9DjsVevXs3MmTMLGsqlXKpBnD17Fjc3N8qWLcstt9xS8N6HS6lYsSInTpwoiLPg3Fvr\nnOE9OuLY1ETE6bi5uREUFMT27dt55513OH36dMEVUudNmDCBZcuWsXv3buLi4oiLiwNg0aJFVK9e\nvdC6sbGxnD59mqioqELL582bR7ly5WjatCknTpzA1dWVhIQEUlJSqFChAuvXry9oTrVq1SInJ6fQ\nOY4LZxlPPfUUd999N3Xr1uV///sfBw8epFq1ajofInanS3zFKc2YMYNDhw4xaNAgu9Xw+uuv07Rp\nU7p06QKca0YNGzaka9euV912ypQpZGZm8uKLL1q7TJErUhMRp5SVlUW7du1ISkoq0pVUlnb27Fna\nt2/PsmXLCmYcR44c4fHHH+e777676vZt27Zl/vz5l7ySTMSW1ERERKTYdHWWiIgUm5qIiIgUm5qI\niIgUm5qIiIgUm5qIiIgUm5qIiIgU2/8Bf2dYlrsM/5QAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x812aa90>"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page no.49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.3\n",
+ "#Calculate The local barometric pressure.\n",
+ "#The absolute pressure at a depth of 40 m in the lake.\n",
+ "\n",
+ "#Given \n",
+ "T=10 #degree C, Temprature\n",
+ "dmax=40 #m, maximum diameter\n",
+ "p=598 #mm Hg, pressure\n",
+ "\n",
+ "#Calculate\n",
+ "#pressure in lake at any depth h is given by p=gamma*h + local barometric pressure 'pbar'\n",
+ "#pbar/(gamma Hg)=598 mm= .598 m (gamma Hg) = 133kN/m**3\n",
+ "pbar=0.598*133 #kN/m**2\n",
+ "#(gamma water)=9.804 kN/m**3 at 10 dergree C\n",
+ "p=(9.804*40)+pbar #kN/m**2\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print \"The absolute pressure at a depth of 40 m in the lake=\",round(p,0),\"kPa(psi)\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absolute pressure at a depth of 40 m in the lake= 472.0 kPa(psi)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page no.52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.4\n",
+ "#calculate pressure reading of gage.\n",
+ "#Given\n",
+ "sg1=0.90 #specific gravity of oil\n",
+ "sg2=13.6 #specific gravity of Hg\n",
+ "#height of column at different section\n",
+ "h1=36.0 #inches, \n",
+ "h2=6.0 #inches\n",
+ "h3=9.0 #inches\n",
+ "\n",
+ "#Calculation\n",
+ "#pressure equation: airp+h1*sg1*(gamma water)+h2*sg1*(gamma water)-h3*sg2*(gamma water)=0\n",
+ "airp=-(sg1*62.4*((h1/12)+(h2/12)))+(sg2*62.4*(h3/12)) #lb/ft**2\n",
+ "#gage pressure = airp\n",
+ "pgage=airp/144\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print \"Gage pressure=\",pgage,\"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gage pressure= 3.055 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page no.53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.5\n",
+ "#calculate The difference in pressures at A and B.\n",
+ "#Given\n",
+ "gamma1=9.8 #kN/m**3, specific wt of gage \n",
+ "gamma2=15.6 #kN/m**3\n",
+ "h1=1 #m, height\n",
+ "h2=0.5 #m\n",
+ "#pA-(gamma1)*h1-h2*(gamma2)+(gamma1)*(h1+h2)=pB\n",
+ "#pA-pB=diffp\n",
+ "diffp=((gamma1)*h1+h2*(gamma2)-(gamma1)*(h1+h2))\n",
+ "\n",
+ "#Result\n",
+ "print \"The difference in pressures at A and B =\",diffp,\"kpa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The difference in pressures at A and B = 2.9 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page no.61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.6\n",
+ "#Calculate \"The resultant force acting on the gate of the reservoir.\n",
+ "#The resultant force acts through a point along the diameter of the gate at a distance of?? \n",
+ "#given\n",
+ "dia=4 #m, diameter\n",
+ "sw=9.8 #kN/m**3 specific weight of water\n",
+ "hc=10 #m, height\n",
+ "ang=60 #degrees, amgle\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=math.pi*(dia**2)/4\n",
+ "fres=sw*hc*A\n",
+ "#for the coordinate system shown xc=xres=0\n",
+ "Ixc=math.pi*((dia/2)**4)/4\n",
+ "yc=hc/(math.sin (ang*math.pi/180))\n",
+ "yres= (Ixc/(yc*A))+yc\n",
+ "ydist=yres-yc\n",
+ "\n",
+ "#Result\n",
+ "print \"The resultant force acting on the gate of the reservoir =\",round(fres*10**-3,2,),\"kN\"\n",
+ "print \"The resultant force acts through a point along the diameter of the gate at a distance of \",round(ydist,2),\"m\"\n",
+ "y=[2,5,10,30]\n",
+ "hc=[0.44,0.18,0.0886,0.04]\n",
+ "a1=plot(y,hc)\n",
+ "xlabel(\"(hc) m\") \n",
+ "ylabel(\"(Yr-Ym) m\") \n",
+ "show(a1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant force acting on the gate of the reservoir = 1.23 kN\n",
+ "The resultant force acts through a point along the diameter of the gate at a distance of 0.09 m\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEMCAYAAADal/HVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtwVHWa//F3A+EixEAIlwiYBMiQBCWJkAQcjG3YSlJm\nw21wFWed2sHSxgtRwFnHYSzDuFOrTLkbJuNqcMXFAafYWQaJM+7E4NhpQXIBsvKTi5RAdESiAYaA\nRDAJ5/dHm5aYdCeddOd0dz6vKsq+nO/hOXWsfjjf53ueYzEMw0BERMSNAWYHICIigU2JQkREPFKi\nEBERj5QoRETEIyUKERHxSIlCREQ88muicDgcJCYmEh8fT3FxsdvtampqGDRoENu2bXN9Fhsby4wZ\nM0hNTSU9Pd2fYYqIiAeD/LnzRx55hJKSEmJiYsjJyWHp0qVERUW126a1tZXHH3+c3Nzcdp9bLBbs\ndjuRkZH+DFFERLrgtyuKxsZGADIzM4mJiSE7O5uqqqoO2xUXF7NkyRLGjBnT4TvdCygiYj6/JYqa\nmhoSEhJc75OSkqisrGy3zcmTJ9mxYwcPPPAA4LyKaGOxWMjKymLhwoWUlpb6K0wREemCX6eeuvLo\no4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": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page no.62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.7\n",
+ "#calculate magnitude and location of force of seawater.\n",
+ "#Given\n",
+ "sw=64 #lb/ft**3 specific weight of water\n",
+ "h=10 #ft, depth\n",
+ "a=3 #ft, distance from horizontal axis\n",
+ "b=3 #ft distance from vertical axis\n",
+ "\n",
+ "#Calculation\n",
+ "#shape is triangular, hence hc=h-(a/3)\n",
+ "hc=h-(a/3)\n",
+ "A=(0.5*a*b) #ft**3 area of the right angled triangle\n",
+ "fres=sw*hc*A #lb\n",
+ "Ixc=b*(a**3)/36\n",
+ "Ixyc=b*(a**2)*(b)/72\n",
+ "#according to the coordinate system taken yc=hc and xc=0\n",
+ "yres=(Ixc/(hc*A))+hc\n",
+ "xres=(Ixyc/(hc*A))\n",
+ "ydist=yres-hc\n",
+ "\n",
+ "#Result\n",
+ "print \"The resultant force on the area shown is=\",round(fres,3),\"lb\"\n",
+ "print \"yR=\",round(yres,1),\"ft\"\n",
+ "print \"xR=\",round(xres,3),\"ft\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant force on the area shown is= 2592.0 lb\n",
+ "yR= 9.0 ft\n",
+ "xR= 0.025 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page no.66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.8\n",
+ "#Calculate magnitude and location of resultant force.\n",
+ "#Given\n",
+ "sg=0.9 # specific gravity of oil\n",
+ "a=0.6 #m, length of square\n",
+ "pgage=50 #kPa, gage pressure\n",
+ "h1=2 #m; height 1\n",
+ "h2=2.6 #m height 2\n",
+ "\n",
+ "#the force on the trapezoid is the sum of the force on the rectangle f1 and force on triangle f2\n",
+ "f1=((pgage*1000)+(sg*1000*9.81*h1))*(a**2) #N\n",
+ "f2=sg*1000*9.81*(h2-h1)*(a**2)/2 #N\n",
+ "fres=f1+f2 #N\n",
+ "#to find vertical location of fres fres*yres=(f1*(a/2))+(f2*(h1-h2))\n",
+ "yres=((f1*(a/2))+(f2*(a/3)))/fres #m\n",
+ "\n",
+ "#Result\n",
+ "print \"The resultant force on the plate is=\",round((fres/1000),3),\"kN\"\n",
+ "print \"The force acts at a distance of \",round(yres,3), \"m \" \"\\n above the bottom plate alond the vertical line of symmetry\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant force on the plate is= 25.31 kN\n",
+ "The force acts at a distance of 0.296 m \n",
+ " above the bottom plate alond the vertical line of symmetry\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page no.68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.9\n",
+ "#calculate The resultant force exerted by the tank \n",
+ "#on the fluid and at what distance The force acts .\n",
+ "\n",
+ "#Given\n",
+ "dia=6.0 #ft, diameter\n",
+ "l=1 #ft, length\n",
+ "#horizontal force f1=sw*hc*A\n",
+ "hc=dia/4 #ft\n",
+ "sw=62.4 #lb/ft**3, specific wt\n",
+ "A=(dia/2.0)*l #ft**2, area\n",
+ "f1=sw*hc*A #lb\n",
+ "\n",
+ "#Calculation\n",
+ "#this force f1 acts at a height of radius/3 ft above the bottom\n",
+ "ht=(dia/2)/3 #ft\n",
+ "#weight w = sw*volume\n",
+ "import math\n",
+ "w=sw*((dia/2)**2)*math.pi/4*l #lb\n",
+ "#this force acts through centre of gravity which is 4*radius/(3*%pi) right of the centre of conduit\n",
+ "dist=(4*dia/2)/(3*math.pi) #ft\n",
+ "#horizontal force that tank exerts on fluid = f1\n",
+ "#vertical force that tank exerts on fluid = w\n",
+ "#resultant force fres =((f1)**2+(w)**2)**0.5\n",
+ "fres =((f1)**2+(w)**2)**0.5 #lb\n",
+ "\n",
+ "#Result\n",
+ "print \"The resultant force exerted by the tank on the fluid=\",round(fres,1),\"lb\"\n",
+ "print \"The force acts at a distance of\",round(dist,3),\"ft\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant force exerted by the tank on the fluid= 522.9 lb\n",
+ "The force acts at a distance of 1.273 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10 Page no.71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.10\n",
+ "#Calculate The tension in the cable \n",
+ "\n",
+ "#Given\n",
+ "dia=1.5 #m\n",
+ "wt=8.5 #kN\n",
+ "#tension in cable T=bouyant force(Fb)-wt\n",
+ "#fluid is water\n",
+ "import math\n",
+ "sw=10.1 #kN/m**3\n",
+ "\n",
+ "#Calculaton\n",
+ "vol=math.pi*dia**3/6 #m**3\n",
+ "Fb=sw*vol #kN\n",
+ "T=Fb-wt #kN\n",
+ "\n",
+ "#Result\n",
+ "print \"The tension in the cable =\",round(T,2),\"kN\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The tension in the cable = 9.35 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11 Page no.75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.11\n",
+ "#Calculate the max acceleration that can occur before the fuel level drops below the transducer.\n",
+ "sg=0.65 #specific gravity of fuel\n",
+ "l1=0.75 #ft, horizontal distance\n",
+ "l2=0.5 #ft verticle distance\n",
+ "#0.5 ft =z1(max)\n",
+ "#0.5=0.75*(ay(max)/g)\n",
+ "aymax=(0.5*32.2)/0.75 #ft/s**2\n",
+ "\n",
+ "#Result\n",
+ "print \"The max acceleration that can occur before the fuel level drops \\n below the transducer=\",round(aymax,1),\"ft/s**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The max acceleration that can occur before the fuel level drops \n",
+ " below the transducer= 21.5 ft/s**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_4.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_4.ipynb
new file mode 100644
index 00000000..3d72a5e5
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_4.ipynb
@@ -0,0 +1,58 @@
+{
+ "metadata": {
+ "name": "Ch 4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:fluid kinematics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page no.165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 4.6\n",
+ "#Determine how fast the manufacture must travell along the route.\n",
+ "#given\n",
+ "pratet=-8 #dollars/hr\n",
+ "pratex=0.2 #dollars/mi\n",
+ "\n",
+ "u=(-pratet)/pratex\n",
+ "\n",
+ "#Result\n",
+ "print \"The delivery speed=\",round(u,1),\"mi/hr\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The delivery speed= 40.0 mi/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_5.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_5.ipynb
new file mode 100644
index 00000000..c5bf2805
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_5.ipynb
@@ -0,0 +1,1164 @@
+{
+ "metadata": {
+ "name": "Ch 5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5:Fluid control volume analysis"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page no.195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.1\n",
+ "#find the minimum pumping capacity required.\n",
+ "#given\n",
+ "v2=20.0 #m/s, nozzle velocity\n",
+ "dia2= 40.0 #mm, nozzle diameter\n",
+ "\n",
+ "#m1=m2\n",
+ "#d1*Q1=D2*Q2 where d1=d2 is density of seawater\n",
+ "#hence Q1=Q2\n",
+ "#calculation\n",
+ "import math\n",
+ "Q=v2*(math.pi*((dia2/1000)**2)/4) #m**3/sec\n",
+ "\n",
+ "#result\n",
+ "print \"Flowrate=\",round(Q,3),\"m**3/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flowrate= 0.025 m**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page no.196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.2\n",
+ "#calculate average Velocity at section (1)\n",
+ "#given\n",
+ "v2=1000 #ft/sec, velocity\n",
+ "p1=100 #psia pressure inlet\n",
+ "p2=18.4 #psia pressure outlet\n",
+ "T1=540 #degree R, Temprature inlet\n",
+ "T2=453 #degree R Temprature outlet\n",
+ "dia=4 #inches, inside dia of pipe\n",
+ "#m1=m2\n",
+ "#d1*A1*v1=d2*A2*v2\n",
+ "#A1=A2 and d=p/(R*T) since air at pressures and temperatures involved behaves as an ideal gas\n",
+ "\n",
+ "#calculation\n",
+ "v1=p2*T1*v2/(p1*T2)\n",
+ "\n",
+ "#result\n",
+ "print \"Velocity at section 1 =\",round(v1,1),\"ft/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity at section 1 = 219.3 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example5.3Page no.197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.3\n",
+ "#Determine the Mass flowrate of the dry air and water vapour leaving the dehumidifier\n",
+ "#given\n",
+ "m1=22 #slugs/hr\n",
+ "m3=0.5 #slugs/hr\n",
+ "#-m1+m2+m3=0\n",
+ "m2=m1-m3\n",
+ "\n",
+ "#result\n",
+ "print \"Mass flowrate of the dry air and water \\n vapour leaving the dehumidifier=\",m2,\"slugs/hr\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flowrate of the dry air and water \n",
+ " vapour leaving the dehumidifier= 21.5 slugs/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page no.198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.5\n",
+ "#What is the time rate of change of depth of water in tub.\n",
+ "#given\n",
+ "Q=9.0 #gal/min, Q=m/d ,flow rate\n",
+ "l=5.0 #ft, length\n",
+ "b=2.0 #ft breadth\n",
+ "H=1.5 #ft, height\n",
+ "#continuity equation to water: integral of m= d*((h*b*l)+(H-h)*A) where A is cross-sectional area of faucet\n",
+ "#m=d*(b*l-A)*dh/dt, where dh/dt= hrate\n",
+ "#m=d*Q\n",
+ "#since A<<l*b, it can be neglected and dh/dt=hrate and m/d=Q\n",
+ "hrate=Q/(b*l)\n",
+ "hrate_=hrate*1.604 #Inch/min\n",
+ "\n",
+ "#result\n",
+ "print \"Time rate of change of depth of water in tub =\",round(hrate_,2),\"inch/min\"\n",
+ "\n",
+ "#Plot\n",
+ "Dj=[0,0,10,20,30]\n",
+ "h=[0,1.5,1.6,1.8,2.7]\n",
+ "a=plot(Dj,h)\n",
+ "xlabel(\"Dj in\") \n",
+ "ylabel(\"dh/dt in/min\") \n",
+ "xlim=(0,30)\n",
+ "ylim=(0,3)\n",
+ "plt.xticks(np.arange(min(Dj), max(Dj)+1, 10))\n",
+ "plt.yticks(np.arange(min(h), max(h)+1,0.5))\n",
+ "show(a)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time rate of change of depth of water in tub = 1.44 inch/min\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVB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cuXm14z4KuQne0UCBXjxo1Tc3OzTp065dPnP/vsM+3fv1/X\nXXedJkyYoKVLlyo2NtbPVQLXjiMEwGQZGRmKjo7WgAEDlJKSopqammCXBHSKQAA8OHr0qPr3769R\no0b59PkBAwa4H/fv31/Nzc3+Kg3wKwIB6MapU6f06KOPasmSJX77Tq7jQKjiHALQzoULF2Sz2dTU\n1KSIiAgtXLhQTz75pKSedw1rXaaz5ek6hlDFZaeAF9555x19+OGH2r59e7BLAfyOIwSghwoLC/XM\nM88QBui1OEIAAEjipDIAwIVAAABIIhAAAC4EAgBAEoEAAHAhEAAAkqT/Bymc8D+VBESfAAAAAElF\nTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x8134e10>"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page no.201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5.6\n",
+ "#calculate the mass flow rate of intake fuel.\n",
+ "#given\n",
+ "v=971 #km/hr, aeroplane speed\n",
+ "v2=1050 #km/hr velocity of exhaust gases\n",
+ "A1=0.80 #m**2 intake area of jet engine\n",
+ "d1=0.736 #Kg/m**3 density\n",
+ "A2=0.558 #m**2 area of engine\n",
+ "d2=0.515 #Kg/m**3, density\n",
+ "\n",
+ "#w1=v=intake velocity\n",
+ "#mass flow rate of fuel intake = d2*A2*w2 - d1*A1*w1\n",
+ "w2=v2+v\n",
+ "m=(d2*A2*w2 - d1*A1*v)*1000 #in book ,calculation mistake\n",
+ "\n",
+ "#Result\n",
+ "print \"The mass flow rate of fuel intake = \",round(m,1),\"kg/h\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass flow rate of fuel intake = 9050.0 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page no.202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.7\n",
+ "#Find average speed of water leaving each nozzle.\n",
+ "#given\n",
+ "Q=1000 #ml/s, flow rate\n",
+ "A2=30 #mm**2 area\n",
+ "rotv=600 #rpm, revolutionary speed\n",
+ "\n",
+ "#mass in = mass out\n",
+ "w2=(Q*0.001*1000000)/(2*A2*1000)\n",
+ "\n",
+ "#result\n",
+ "print \"Average speed of water leaving each nozzle \\nwhen sprinkle head is stationary and when it rotates with a constant speed of 600rpm =\",round(w2,1),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average speed of water leaving each nozzle \n",
+ "when sprinkle head is stationary and when it rotates with a constant speed of 600rpm = 16.67 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page no.203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.8\n",
+ "#Determine the speed at which the plunger should be advanced\n",
+ "Ap=500 #mm**2\n",
+ "Q2=300 #cm**3/min\n",
+ "Qleak=0.1*Q2 #cm**3/min\n",
+ "#A1=Ap\n",
+ "#mass conservation in control volume\n",
+ "#-d*A1*V + m2 + d*Qleak =0 m2=d*Q2\n",
+ "#V=(Q2+Qleak)/Ap\n",
+ "V=(Q2+Qleak)*1000/Ap\n",
+ "print \"The speed at which the plunger should be advanced=\",round(V,2),\"mm/min\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed at which the plunger should be advanced= 660.0 mm/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page no.204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.9\n",
+ "#Solve Example 5.5 using water accumulating in the tub.\n",
+ "Given\n",
+ "Q=9 #gal/min\n",
+ "l=5 #ft\n",
+ "b=2 #ft\n",
+ "H=1.5 #ft\n",
+ "#deforming control volume\n",
+ "#hrate=Q/(l*b-A)\n",
+ "#A<<l*b\n",
+ "hrate=Q*12/(l*b*7.48)\n",
+ "print \"Time rate of change of depth of water in tub =\",round(hrate,3),\"inch/min\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time rate of change of depth of water in tub = 1.444 inch/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11 Page no.208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.11\n",
+ "#Determine the anchoring force.\n",
+ "#given\n",
+ "dia1=16.0 #mm\n",
+ "h=30.0 #mm\n",
+ "dia2=5.0 #mm\n",
+ "Q=0.6 #litre/sec\n",
+ "mass=0.1 #kg\n",
+ "p1=464.0 #kPa\n",
+ "d=999.0 #kg/m**3\n",
+ "m=d*Q*10**-3 #kg/s\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "A1=math.pi*((dia1/1000)**2)/4 #m**2\n",
+ "w1=Q/(A1*1000) #m/s\n",
+ "A2=math.pi*((dia2/1000)**2)/4 #m**2\n",
+ "w2=Q/(A2*1000) #m/s\n",
+ "Wnozzle=mass*9.81 #N\n",
+ "volwater=((1/12)*(math.pi)*(h)*((dia1**2)+(dia2**2)+(dia1*dia2)))/(1000**3) #m**3\n",
+ "Wwater=d*volwater*9.81 #N\n",
+ "F=m*(w1-w2)+Wnozzle+(p1*1000*A1)+Wwater #N\n",
+ "\n",
+ "#result\n",
+ "print \"The anchoring force=\",round(F,3),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The anchoring force= 77.746 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12 Page no.212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.12\n",
+ "#Find the y component of anchoring force\n",
+ "#given\n",
+ "A=0.1 #ft**2\n",
+ "v=50 #ft/s\n",
+ "p1=30 #psia\n",
+ "p2=24 #psia\n",
+ "\n",
+ "d=1.94 #slugs/ft**3\n",
+ "#v1=v2=v and A1=A2=A\n",
+ "m=d*v*A\n",
+ "Fay=-m*(v+v)-((p1-14.7)*A*144)-((p2-14.7)*A*144)\n",
+ "\n",
+ "#result\n",
+ "print \"The y component of anchoring force is \",round(Fay,2),\"lb\" \"\\n and the x component of anchoring force is\",0,\"lb\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The y component of anchoring force is -1324.24 lb\n",
+ " and the x component of anchoring force is 0 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13 Page no.214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.13\n",
+ "#What is the frictional force exerted by pipe wall on air flow.\n",
+ "#given\n",
+ "p1=100.0 #psia\n",
+ "p2=18.4 #psia\n",
+ "T1=540.0 #degree R\n",
+ "T2=453.0 #degree R\n",
+ "V2=1000.0 #ft/s\n",
+ "V1=219.0 #ft/s\n",
+ "dia=4.0 #in\n",
+ "\n",
+ "#m=m1=m2\n",
+ "import math\n",
+ "A2=math.pi*((4.0/12.0)**2.0)/dia #ft**2\n",
+ "#equation of state d*R*T=p\n",
+ "d2=p2*144/(1716*T2)\n",
+ "m=A2*d2*V2 #slugs/s\n",
+ "Rx=A2*144*(p1-p2)-(m*(V2-V1)) #lb\n",
+ "\n",
+ "#result\n",
+ "print \"Frictional force exerted by pipe wall on air flow=\",round(Rx,0),\"lb\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frictional force exerted by pipe wall on air flow= 793.0 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.15 Page no.216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.15\n",
+ "#What is the thrust for which the stand is to be designed\n",
+ "#given\n",
+ "v1=200.0 #m/s\n",
+ "v2=500.0 #m/s\n",
+ "A1=1.0 #m**2\n",
+ "p1=78.5 #kPa(abs)\n",
+ "T1=268.0 #K\n",
+ "p2=101.0 #kPa(abs)\n",
+ "\n",
+ "#F=-p1*A1 + p2*A2 + m*(v2-v1)\n",
+ "#m=d1*A1*v1\n",
+ "#d1=(p1)/(R*T1)\n",
+ "d1=(p1*1000)/(286.9*T1)\n",
+ "m=round(d1,2)*v1*A1\n",
+ "F=-((p1-p2)*A1*1000) + m*(v2-v1)\n",
+ "\n",
+ "#Result\n",
+ "print \"The thrust for which the stand is to be designed=\",round(F,3),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thrust for which the stand is to be designed= 83700.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.17 Page no.219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.17\n",
+ "#Determine the magnitude and direction of force exerted by stream of water.\n",
+ "#given\n",
+ "v1=100.0 #ft/sec\n",
+ "v0=20.0 #ft/sec\n",
+ "ang=45 #degrees\n",
+ "A1=0.006 #ft**2\n",
+ "l=1 #ft\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#m1=m2=m continuity equation\n",
+ "#d=density of water= constant\n",
+ "#w=speed of water relative to the moving control volume=constant=w1=w2\n",
+ "#w1=v1-v0\n",
+ "w=v1-v0\n",
+ "d=1.94 #slugs/ft**3\n",
+ "#-Rx=(w1)(-m1)+(w2*math.cos(ang))(m2)\n",
+ "Rx=d*(w**2)*A1*(1-math.cos(ang*math.pi/180))\n",
+ "#wwater=(specific wt of water)*A1*l\n",
+ "wwater=62.4*A1*l\n",
+ "Rz=(d*(w**2)*(math.sin(ang*math.pi/180))*A1)+wwater\n",
+ "R=((Rx**2)+(Rz**2))**0.5\n",
+ "angle=(math.atan(Rz/Rx))*180/(math.pi)\n",
+ "\n",
+ "#Result\n",
+ "print \"The force exerted by stream of water on vane surface=\",round(R,3),\"lb\"\n",
+ "print \"The force points right and down from the x direction at an angle of=\",round(angle,3),\"degree\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force exerted by stream of water on vane surface= 57.363 lb\n",
+ "The force points right and down from the x direction at an angle of= 67.643 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.18 Page no.225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.18\n",
+ "#find (i)Resisting torque required to hold the sprinker stationary\n",
+ "#Resisting torque when sprinker is rotating at a constant speed of 500 rev/min\n",
+ "#Speed of sprikler when no resisting torque is applied\n",
+ "#given\n",
+ "Q=1000.0 #ml/sec\n",
+ "A=30.0 #mm**2\n",
+ "r=200.0 #mm\n",
+ "n=500.0 # rev/min\n",
+ "#v2 is tangential v2=vang2\n",
+ "m=(Q/1000000)*999 #kg/sec\n",
+ "#m=2*d*(A)*v2=d*Q\n",
+ "v2=(Q)/(2*A) #m/sec\n",
+ "#Torque reuired to hold sprinkler stationary\n",
+ "Tshaft=(-(r/1000)*(v2)*m) #Nm\n",
+ "#u2=speed of nozzle=r*omega\n",
+ "#v21=v2-u2\n",
+ "import math\n",
+ "omega=n*(2*math.pi)/60 #rad/sec\n",
+ "v21=v2-(r*omega/1000)\n",
+ "#resisting torque when sprinker is rotating at a constant speed of n rev/min\n",
+ "Tshaft1=(-(r/1000)*(v21)*m) #Nm\n",
+ "#when no resistintg torque is applied\n",
+ "#Tshaft=0\n",
+ "omega1=v2/(r/1000)\n",
+ "n1=(omega1)*60/(2*math.pi) #rpm\n",
+ "\n",
+ "#result\n",
+ "print \"Resisting torque required to hold the sprinker stationary=\",round(Tshaft1,3),\"Nm\"\n",
+ "print \"Resisting torque when sprinker is rotating at a constant speed of 500 rev/min=\",round(Tshaft,3),\"Nm\"\n",
+ "print \"Speed of sprikler when no resisting torque is applied=\",round(n1,0),\"rpm\"\n",
+ "\n",
+ "#Plot\n",
+ "w=[0,800]\n",
+ "T=[-3.3,0]\n",
+ "xlabel(\"w (rpm)\") \n",
+ "ylabel(\"T (Nm)\") \n",
+ "plt.xlim((0,800))\n",
+ "plt.ylim((0,-4))\n",
+ "a=plot(w,T)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resisting torque required to hold the sprinker stationary= -1.238 Nm\n",
+ "Resisting torque when sprinker is rotating at a constant speed of 500 rev/min= -3.33 Nm\n",
+ "Speed of sprikler when no resisting torque is applied= 796.0 rpm\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY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9RIXF4fW1lbMnDkT48ePx1133XXHKSsAmD17Ns6cOWM8Nvc5CMOHD8e0\nadOwevVq7Nu3zziu99hfP6/n+NatW2hsbBzQFRCRI3BjRCIbaG9vx9y5c40pql+bO3cutm/fPqCr\nGHPKy8tx5MgR7Ny5cyhlEtkMrzyIbGDEiBGYO3euySce2srevXuxbt06u5ybaDB45UFERFbjlQcR\nEVmNzYOIiKzG5kFERFZj8yAiIquxeRARkdXYPIiIyGr/DxFped1zxBGnAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.19 Page no. 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.19\n",
+ "#What is the power required to run the fan.\n",
+ "#given\n",
+ "h=1.0 #in\n",
+ "Q=230.0 #ft**3/min\n",
+ "ang=30.0 #degrees\n",
+ "dia1=10.0 #in\n",
+ "dia2=12.0 #in\n",
+ "n=1725.0 #rpm\n",
+ "#m=d*Q\n",
+ "m=(2.38*10**-3)*Q/60\n",
+ "#u2=rotor blade speed\n",
+ "import math\n",
+ "u2=(dia2/2)*(n*2*(math.pi)/(12*60))\n",
+ "\n",
+ "#calculation\n",
+ "#result\n",
+ "#m=d*A2*Vr2 and A2=2*math.pi*r2*h and r2=dia2**2\n",
+ "#hence, m=d*2*math.pi*r2*h*Vr2\n",
+ "#Vr2=w2*math.sin(ang)\n",
+ "w2=m*12*12/((2.38*10**-3)*2*(math.pi)*(dia2/2)*(h)*(math.sin(math.pi/6))) #ft**sec\n",
+ "V2=u2-(w2*(math.cos(math.pi/6))) #ft**sec\n",
+ "Wshaft=m*u2*V2/(550) #hp\n",
+ "\n",
+ "#Result\n",
+ "print \"The power required to run the fan=\",round(Wshaft,4),\"hp\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power required to run the fan= 0.0973 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.20 Page no.234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.20\n",
+ "#If the pumping process is adiabatic determine the power required for pump.\n",
+ "#Given\n",
+ "Q=300.0 #gal/min \n",
+ "d1=3.5 #in.\n",
+ "p1=18.0 #psi\n",
+ "d2=1.0 #in.\n",
+ "p2=60.0 #psi\n",
+ "diffu=3000#ft*lb/slug\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#energy equation\n",
+ "#m(u2-u1+(p1/d)-(p2/d)+((v2**2)-(v1**2))/2 + g*(z2-z1))=q-Wshaft\n",
+ "m=Q*1.94/(7.48*60) #slugs/sec\n",
+ "v1=Q*12*12/(math.pi*(d1**2)*60*7.48/4)\n",
+ "v2=Q*12*12/(math.pi*(d2**2)*7.48*60/4)\n",
+ "Wshaft=m*(diffu + (p2*144/1.94) - (p1*144/1.94) + (((v2**2)-(v1**2))/2))/550.0 #hp\n",
+ "\n",
+ "#result\n",
+ "print \"The power required by the pump=\",round(Wshaft,1),\"hp\"\n",
+ "print \"The internal energy change accounts for =\",round(m*(diffu/550),1),\"hp\"\n",
+ "print \"The pressure rise accounts for =\",round(m*(((p2*144/1.94) - (p1*144/1.94))/550),1),\"hp\"\n",
+ "print \"The kinetic energy change accounts for =\",round(m*(((v2**2)-(v1**2))/(550*2)),1),\"hp\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power required by the pump= 32.0 hp\n",
+ "The internal energy change accounts for = 6.5 hp\n",
+ "The pressure rise accounts for = 7.4 hp\n",
+ "The kinetic energy change accounts for = 17.6 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.21 Page no.234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.21\n",
+ "#What is the work output involved of steam through-flow.\n",
+ "#given\n",
+ "v1=30 #m/s\n",
+ "h1=3348 #kJ/kg\n",
+ "v2=60 #m/s \n",
+ "h2=2550 #kJ/kg\n",
+ "\n",
+ "#energy equation \n",
+ "#wshaftin=Wshaftin/m= (h2-h1 + ((v2**2)-(v1**2))/2)\n",
+ "#wshaftout=-wshaftin\n",
+ "wshaftout=h1-h2 + (((v1**2)-(v2**2))/2000)\n",
+ "\n",
+ "#Result\n",
+ "print \"The work output involved per unit mass of steam through-flow=\",round(wshaftout,3),\"kj/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work output involved per unit mass of steam through-flow= 796.0 kj/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.22 Page no. 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.22\n",
+ "#Find the temprature change associated with the flow.\n",
+ "#given\n",
+ "z=500 #ft\n",
+ "#energy equation\n",
+ "#T2-T1 = (u2 - u1)/c = g*(z2 - z1)/c c=specific heat of water = 1 Btu/(lbm* degree R)\n",
+ "diffT = 32.2*z/(778*32.2) #degree R\n",
+ "\n",
+ "#result\n",
+ "print \"The temperature change associated with this flow=\",round(diffT,3),\"degree R\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature change associated with this flow= 0.643 degree R\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.23 Page no.237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.23\n",
+ "#Compare the volume flowrate associated with two different vent configuration.\n",
+ "#given\n",
+ "dia=120.0 #mm\n",
+ "p=1.0 #kPa\n",
+ "\n",
+ "#using energy equation\n",
+ "#Q=A2*v2=A2*((p1-p2)/(d*(1+Kl)/2)) d =density, Kl= loss coefficient\n",
+ "Kl1=0.05\n",
+ "Kl2=0.5\n",
+ "#for rounded entrance cyliindrical vent\n",
+ "import math\n",
+ "Q1=(math.pi*((dia/1000)**2)/4)*(p*1000*2/(1.23*(1+Kl1)))**0.5\n",
+ "#for cylindrical vent\n",
+ "Q2=(math.pi*((dia/1000)**2)/4)*(p*1000*2/(1.23*(1+Kl2)))**0.5\n",
+ "\n",
+ "#result\n",
+ "print \"The volume fowrate associated with the rounded entrance \\ncylindrical vent configuration =\",round(Q1,3),\"m**3/s\"\n",
+ "print \"The volume fowrate associated with the cylindrical vent configuration =\",round(Q2,3),\"m**3/s\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "k=[0,0.005,0.5]\n",
+ "Q=[0.450,0.445,0.372]\n",
+ "xlabel(\"k (mm)\") \n",
+ "ylabel(\"Q (m**3/s)\") \n",
+ "plt.xlim((0,0.5))\n",
+ "plt.ylim((0,0.5))\n",
+ "\n",
+ "ax.plot([0.05], [0.441], 'o')\n",
+ "ax.annotate('(0.05,0.445 m**3/s)', xy=(0.05,0.44))\n",
+ "ax.plot([0.5], [0.372], 'o')\n",
+ "ax.annotate('(0.5,0.372 m**3/s)', xy=(0.5,0.37))\n",
+ "a=plot(k,Q)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volume fowrate associated with the rounded entrance \n",
+ "cylindrical vent configuration = 0.445 m**3/s\n",
+ "The volume fowrate associated with the cylindrical vent configuration = 0.372 m**3/s\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAdsAAAEMCAYAAACMQRyjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVHX+P/DXDIwggojghVuSjALeAAGN+qJ4QcKEyPxu\nbOVWS341M7V2zbSLWlvpQ6sVWNP9/jQvW+B+dRMTwRVj1CIbQ1bzEuIFGxE0FUMpUIbz+2NiZJgZ\nZig/MwO+no/HPJY55zNn3vNp9rw8n/M5Z2SSJEkgIiIiYeT2LoCIiKizY9gSEREJxrAlIiISjGFL\nREQkGMOWiIhIMIYtERGRYELDtqCgAKGhoRgwYACWLVtmtF6lUsHT0xORkZGIjIzEX/7yF5HlEBER\n2YWzqA1rtVrMmjULhYWF8Pf3R0xMDFJSUhAWFmbQbvTo0di+fbuoMoiIiOxO2JGtWq2GUqlEUFAQ\nFAoF0tLSkJuba9SO99QgIqLOTljYVlZWIjAwUP88ICAAlZWVBm1kMhmKi4sRHh6OiRMn4vjx46LK\nISIishthw8gymcxim+HDh0Oj0cDNzQ35+flITU3FyZMnf9W2iIjIGEcPHYOwI1t/f39oNBr9c41G\ng4CAAIM2Hh4ecHNzAwAkJSXh1q1buHr1qsntSZLEhyRh0aJFdq/BUR7sC/YF+6LtBzkOYWEbHR2N\n8vJyVFRU4ObNm9i8eTNSUlIM2ly8eFH/hVCr1ZAkCT179hRVEhERkV0IG0Z2dnZGVlYWEhMTodVq\nkZ6ejrCwMKxZswYAMH36dGzZsgUffvghnJ2d4ebmhpycHFHlEBER2Y1M6gBjDTKZjEMiv1CpVIiP\nj7d3GQ6BfXEb++I29sVt3Hc6DoYtEVEnxX2n4+DtGomIiARj2BIREQnGsCUiIhKMYUtERCQYw5aI\niEgwhi0REZFgDFsiIiLBGLZERESCMWyJiIgEY9gSEREJxrAlIiISjGFLREQkGMOWiIh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JyC4YtnRX\nu3TpElJTU/HJJ5+YPH977tw5+Pr66p/LZDKMGTMG3bp1g4+PD3r06IHk5GQAwNChQ1FRUaFv23wf\n3iFDhmDIkCHo06cPunTpgv79++P7778HoBtKbmpqQn19vcBPSUT2xrClu1qPHj3Qr18/7N+/32yb\n1jdZc3Fx0f8tl8v1z+VyORobG43atWzT/Fyr1Rpsn7/0RNS5Ocy9kYnsoUuXLvjXv/6FxMREuLu7\n4/e//73B+n79+qG6ulr/vK27m/6aO582NDTAycnJIIyJqPNh2NJdTSaTwc3NDTt27EBCQgI8PDww\nadIk/fq+ffuisbERP/30E9zc3CCTyQyOQlv/beoI1dxyACgtLUVsbOwd/ERE5Ij4QwREFixevBhh\nYWF47LHH7vi2Fy5ciJiYGDzyyCN3fNtE5DgYtkQW/PDDD3jqqaewc+fOO7rdhoYGJCQkYO/evTxn\nS9TJMWyJiIgE42xkIiIiwRi2REREgjFsiYiIBGPYEhERCcawJSIiEoxhS0REJNj/B4TQUZbmSTpU\nAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.24Page no.239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.24\n",
+ "#determine the work to air which provides useful effect and \n",
+ "#Fluid mechanical efficiency of this fan.\n",
+ "#Given\n",
+ "p=0.4 #kW\n",
+ "dia=0.6 #m\n",
+ "v2=12 #m/s\n",
+ "v1=0 #m/s\n",
+ "\n",
+ "#calculation\n",
+ "#energy equation\n",
+ "import math\n",
+ "Wuseful=(v2**2)/2\n",
+ "#wshaftin= Wshaftin/m\n",
+ "wshaftin=(p*1000)/(1.23*math.pi*(0.6**2)*12/4)\n",
+ "eff=Wuseful/wshaftin\n",
+ "\n",
+ "#result\n",
+ "print \"The work to air which provides useful effect=\",round(Wuseful,3),\"Nm/kg\"\n",
+ "print \"Fluid mechanical efficiency of this fan=\",round(eff)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work to air which provides useful effect= 72.0 Nm/kg\n",
+ "Fluid mechanical efficiency of this fan= 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.25 Page no.241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.25\n",
+ "#Find the flow rate and power loss.\n",
+ "\n",
+ "#given\n",
+ "p=10.0 #hp\n",
+ "z=30.0 #ft\n",
+ "hl=15.0 #ft\n",
+ "\n",
+ "#calculation\n",
+ "#energy equation\n",
+ "#hs=Wshaftin/(sw*Q) = hl+z\n",
+ "Q=(p*550)/((hl+z)*62.4)\n",
+ "wloss=62.4*Q*hl/550\n",
+ "\n",
+ "#result\n",
+ "print \"Flowrate =\",round(Q,3),\"ft**3/s\"\n",
+ "print \"Power loss=\",round(wloss,3),\"hp\"\n",
+ "\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "h=[0,5,15,25]\n",
+ "Q=[3,2.5,1.96,1.6]\n",
+ "xlabel(\"h (ft)\") \n",
+ "ylabel(\"Q (ft**3/s)\") \n",
+ "plt.xlim((0,25))\n",
+ "plt.ylim((0,3.5))\n",
+ "ax.plot([15], [1.96], 'o')\n",
+ "ax.annotate('(15ft,1.96ft**3/s)', xy=(15,2))\n",
+ "\n",
+ "a=plot(h,Q)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flowrate = 1.959 ft**3/s\n",
+ "Power loss= 3.333 hp\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSU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gYiEGDBqG4uLjG9hkZGbh1\n6xbc3Nxw+PBhzJ07F9u2bYNarcbf//53nD17Fmq1GnPnzgVwe9LUpk2bGuJXITIYA4HoHqdPn8aU\nKVOQmpqKli1b4ptvvqmx/d69exESEgIAUKlUePPNNzFq1CikpKQgOjoanTp10v0MAE888QR+/vln\nk/8eRPXBQCC6R8eOHREcHAwA6NKlC9LT02tsf/78ed19poDbtxC4M9ezqjmf7dq1q3WdRObCQCC6\nx6OPPqr72dbWFqWlpbW+594Df2131hQRq7r7JjUuDASiB+Dl5aW7syagHw5OTk66mxLekZ2dDS8v\nrwarj8gQDASie9z/7b22b/M9evTQGzV07/33W7dujR49eiAoKEh3UTkpKQm9e/c2ctVExsGb2xE9\noH79+uHLL7/Uu5ZQnZdeegmzZs2CWq1ugMqIDMMeAtEDmjVrFj766KNa2126dAn5+fkMA7JY7CEQ\nEREA9hCIiKgCA4GIiAAwEIiIqAIDgYiIADAQiIioAgOBiIgAAP8PdrZWDHielqsAAAAASUVORK5C\nYII=\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.26 Page no.243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 5.26\n",
+ "#find (i)Loss for uniform velocity profile\n",
+ "#and for actual velocity profile.\n",
+ "\n",
+ "#given\n",
+ "m=0.1 #kg/min\n",
+ "dia1=60.0 #mm\n",
+ "alpha1=2.0\n",
+ "dia2=30.0 #mm\n",
+ "alpha2=1.08\n",
+ "p=0.1 #kPa\n",
+ "power=0.14 #W\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "wshaftin=power*60/m #Nm/kg\n",
+ "vavg1=m*1000*1000/(60*1.23*math.pi*dia1*dia1/4)\n",
+ "vavg2=m*1000*1000/(60*1.23*math.pi*dia2*dia2/4)\n",
+ "loss1=wshaftin-(p*1000/1.23)+((vavg1**2)/2)-((vavg2**2)/2) #Nm/kg\n",
+ "loss2=wshaftin-(p*1000/1.23)+(alpha1*(vavg1**2)/2)-(alpha2*(vavg2**2)/2) #Nm/kg\n",
+ "\n",
+ "#Result\n",
+ "print \"Loss for uniform velocity profile=\",round(loss1,3),\"Nm/kg\"\n",
+ "print \"Loss for actual velocity profile=\",round(loss2,2),\"Nm/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss for uniform velocity profile= 0.977 Nm/kg\n",
+ "Loss for actual velocity profile= 0.94 Nm/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.29 Page no.250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.29\n",
+ "#Determine the velocity of expanded air considering incompressible and compressible flow.\n",
+ "#given\n",
+ "p1=100.0 #psia\n",
+ "T1=520.0 #degree R\n",
+ "p2=14.7 #psia\n",
+ "\n",
+ "#for incompressible flow\n",
+ "\n",
+ "d=p1*144/(1716*T1) #where d=density, calculated by assuminng air to behave like an ideal gas\n",
+ "#Bernoulli equation\n",
+ "v2=(2*(p1-p2)*144/(round(d,4)))**0.5 #ft/sec\n",
+ "\n",
+ "print \"The velocity of expanded air considering incompressible flow =\",round(v2,2),\"ft/s\"\n",
+ "\n",
+ "#for compressible flow\n",
+ "\n",
+ "k=1.4 #for air\n",
+ "d1=d\n",
+ "d2=d1*((p2/p1)**(1/k))#where d2=density of expanded air\n",
+ "#bernoulli equation\n",
+ "V2_=((2*k/(k-1))*((p1*144/d1)-(p2*144/d2)))**0.5 #ft/s\n",
+ "#result\n",
+ "print \"The velocity of expanded air considering compressible flow =\",round(V2_,3),\"ft/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of expanded air considering incompressible flow = 1235.26 ft/s\n",
+ "The velocity of expanded air considering compressible flow = 1623.133 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_6.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_6.ipynb
new file mode 100644
index 00000000..cf86883a
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_6.ipynb
@@ -0,0 +1,299 @@
+{
+ "metadata": {
+ "name": "Ch 6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6:Differential analysis of fluid flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page no.296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.4\n",
+ "#If the pressure at point 1 is 30 kpa \n",
+ "#Find the pressure at point 2.\n",
+ "p1=30 #kPa\n",
+ "d=1000 #kg/(m**3)\n",
+ "r1=1 #m\n",
+ "r2=0.5 #m\n",
+ "#applying energy equation between points (1) and (2) and using the equation V**2=16*(r**2)\n",
+ "V1=(16*(r1**2))**0.5 #m/sec\n",
+ "V2=(16*(r2**2))**0.5 #m/sec\n",
+ "p2=((p1*1000)+(d*((V1**2)-(V2**2)))/2)/1000#kPa\n",
+ "\n",
+ "#result\n",
+ "print \"The pressure at point (2) =\",round(p2,3),\"kpa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure at point (2) = 36.0 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page no.301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.5\n",
+ "#What is volume rate of flow into the opening of flow.\n",
+ "#given\n",
+ "ang2=math.pi/6 #radians\n",
+ "#vp=-2*math.log(r)\n",
+ "\n",
+ "#calculation\n",
+ "#vr=d(vp)/d'r\n",
+ "#vr=(-2)/r\n",
+ "#vang=(1/r)*(d(vp)/d(ang))\n",
+ "import math\n",
+ "from scipy import integrate\n",
+ "def f1(dtheta):\n",
+ " R=1\n",
+ " return((-2/R)*R)\n",
+ "q=integrate.quad(f1,0.0,(3.14/6))\n",
+ "\n",
+ "#result\n",
+ "print \"Volume rate of flow (per unit length) into the opening = \",round(q[0],2),\"ft**2/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume rate of flow (per unit length) into the opening = -1.05 ft**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 Page no.310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.7\n",
+ "#find elevation of point above the plane.\n",
+ "#The magnitude of velocity at (2) for a 40 mi/hr approaching wind.\n",
+ "#The pressure difference between points (1) and (2).\n",
+ "\n",
+ "# given\n",
+ "h=200 #ft\n",
+ "U=40 #mi/hr\n",
+ "d=0.00238 #slugs/ft**3\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#V**2= (U**2)*(1 + (2*b*math.cos(ang)/r) + ((b**2)/(r**2)))\n",
+ "#at point 2, ang=math.pi/2\n",
+ "#r=b*(math.pi-ang)/math.sin(ang)=(math.pi*b/2)\n",
+ "V=U*(1+(4/(math.pi**2)))**0.5 #mi/hr\n",
+ "y2=h/2 #ft\n",
+ "#bernoulli equation\n",
+ "#p1-p2= d*((V2**2)-(V1**2)) + (sw*(y2-y1))\n",
+ "V1=U*(5280/3600)\n",
+ "V2=V*(5280/3600)\n",
+ "pdiff=((d*((V2**2)-(V1**2))/2) + (d*32.2*(y2)))/144#psi\n",
+ "\n",
+ "#result\n",
+ "print \"elevation of point above the plane\",round(y2,2),\"ft\"\n",
+ "print \"The magnitude of velocity at (2) for a 40 mi/hr approaching wind =\",round(V,1),\"mi/hr\"\n",
+ "print \"The pressure difference between points (1) and (2)=\",round(pdiff,2),\"psi\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "u=[0,20,40,60,80,100]\n",
+ "p=[0.05,0.055,0.0647,0.08,0.10,0.12]\n",
+ "xlabel(\"U (mph)\") \n",
+ "ylabel(\"p1-p2 (psi)\") \n",
+ "plt.xlim((0,100))\n",
+ "plt.ylim((0,0.14))\n",
+ "ax.plot([40], [0.0647], 'o')\n",
+ "ax.annotate('(40mph,0.0647psi)', xy=(40,0.06))\n",
+ "\n",
+ "a=plot(u,p)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "elevation of point above the plane 100.0 ft\n",
+ "The magnitude of velocity at (2) for a 40 mi/hr approaching wind = 47.4 mi/hr\n",
+ "The pressure difference between points (1) and (2)= 0.06 psi\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAA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uu+4CcCsY7r77btN6Kysr1NfXt1q/cTjdrjNo0KAm5ZuX\nIzIXhgZZPHt7e4wZMwZffvklAOCnn37C559/junTp7dbb9y4caZvDe2MhoYG0/WJffv2YcaMGR3W\nuXDhAsaNG9fpbRH1NIYGEYDdu3fjlVdega+vL2bPno2YmBiMHz++3TpBQUHIyclpsq7x2UBbZwZ2\ndnbIzs7GpEmToNPp8Mc//rHVco3rZ2dnY+bMmVJ3h0g2/MJCom6YNWsW9u7d2+LaRnuGDBmCq1ev\ndmo7wcHB+OijjyzuGRDU9/BMg6gbXnzxRfz5z3/uVJ3OXpvIy8uDRqNhYFCfwDMNIiKSjGcaREQk\nGUODiIgkY2gQEZFkDA0iIpKMoUFERJIxNIiISLL/B/expgtkdenNAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 Page no.331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 6.10\n",
+ "#Determine (a) the pressure drop across the tube\n",
+ "#(b) if a 4mm dia tube is placed inplace of 2mm tube then what is the pressure drop.\n",
+ "#given\n",
+ "d=1.18*1000 #kg/m**3\n",
+ "vis=0.0045 #Ns/m**2, viscosity\n",
+ "Q=12.0 #ml/sec\n",
+ "dia1=4.0 #mm\n",
+ "l=1.0 #m\n",
+ "dia2=2.0 #mm\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "V=Q/(1000000*math.pi*((dia1/1000)**2)/4) #mean velocity, m/sec\n",
+ "Re=(d*V*dia1/1000)/vis\n",
+ "\n",
+ "#result\n",
+ "print \" The Reynolds number is \",round(Re,0),\"is well below critical value of 2100 so flow is laminar.\"\n",
+ "pdiff=(8*vis*(l)*(12*10**-6)/(math.pi*(dia1/2000)**4))*10**-3 #kPa\n",
+ "print \"a)The pressure drop along a 1 m length of the tube which is far from the tube entrance \",round(pdiff,),\"kpa\"\n",
+ "\n",
+ "#for flow in the annulus\n",
+ "V1=Q/(1000000*math.pi*(((dia1/1000)**2)-((dia2/1000)**2))/4) #mean velocity, m/sec\n",
+ "Re1=d*((dia1-dia2)/1000)*V1/vis\n",
+ "\n",
+ "#Result\n",
+ "print \"b) The Reynolds number is \",round(Re1),\" is well below critical value of 2100 so flow is laminar.\"\n",
+ "r1=dia1/2000\n",
+ "r2=dia2/2000\n",
+ "pdiff1=((8*vis*(l)*(12*10**-6)/(math.pi))*((r1**4)-(r2**4)-((((r1**2)-(r2**2))**2)/(math.log(r1/r2))))**(-1))*10**-3 #kPa\n",
+ "\n",
+ "#result\n",
+ "print \"The pressure drop along a 1 m length of the symmetric annulus =\",round(pdiff1,1),\"kpa\"\n",
+ "\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "T=[0,0.001,0.005,0.01,0.2,0.35,0.5]\n",
+ "K=[1.1,1.17,1.22,1.28,2.2,3.8,7.94]\n",
+ "xlabel(\"Ri/Ro\") \n",
+ "ylabel(\"Pannulus/Ptube\") \n",
+ "plt.xlim((0,0.5))\n",
+ "plt.ylim((1,8))\n",
+ "ax.plot([0.5], [7.94], 'o')\n",
+ "ax.annotate('(0.5,7.94)', xy=(0.5,7.9))\n",
+ "a=plot(T,K)\n",
+ "show(a)\n",
+ "\n",
+ "T1=[0,0.001,0.005,0.01]\n",
+ "K1=[1.1,1.14,1.20,1.28]\n",
+ "xlabel(\"Ri/Ro\") \n",
+ "ylabel(\"Pannulus/Ptube\") \n",
+ "plt.xlim((0,0.01))\n",
+ "plt.ylim((1,1.3))\n",
+ "a1=plot(T1,K1)\n",
+ "show(a1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The Reynolds number is 1002.0 is well below critical value of 2100 so flow is laminar.\n",
+ "a)The pressure drop along a 1 m length of the tube which is far from the tube entrance 9.0 kpa\n",
+ "b) The Reynolds number is 668.0 is well below critical value of 2100 so flow is laminar.\n",
+ "The pressure drop along a 1 m length of the symmetric annulus = 68.2 kpa\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaQAAAEMCAYAAACLA8K2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYlOX+P/D3sCmL4IapLAdFC1TAETAXTDAp9y2x0MsF\nFTy2mGX9WvwqqKV11AqsY2lpenJJxARNcTk5Kpts7iiaguKCuCGLIMs8vz88jZLiDOIzz/DM+3Vd\nXNfALPfbO7o/PJ9nUwiCIICIiEhiJlIHICIiAliQiIjIQLAgERGRQWBBIiIig8CCREREBoEFiYiI\nDAILEhFRA3Pv3j307dsXarUaa9aswfPPP4/nn38ea9eufezrf/75Z9jb20OpVEKpVGLVqlWPvCY7\nO1vzvFKphJ2dHaKioh553e3btzFy5Eh4eXnhxRdfxMmTJ2s8X11dDaVSiaFDh2p+9v777+PgwYNa\n/10Ksc5DWrRoEX755ReYmJjAw8MDq1evRqNGjcQYiojIqKxatQo3b97ElClT4Ovri4yMDACAt7c3\nMjIy0LRp0xqvX7NmDTIyMh5bYB5HrVbDwcEBqampcHJyqvHchx9+CFtbW8yZMwfZ2dl46623sHfv\nXs3zX331FTIyMlBcXIy4uDgAwNmzZzFr1izN97URZQspNzcXK1euRGZmJo4fP47q6mps3LhRjKGI\niIzOhg0bMHz4cOzatQuvvPIKmjZtiqZNmyIwMBDx8fGPvF4QBNRl22Pv3r1wdXV9pBgBwKlTpxAQ\nEAAAeOGFF5Cbm4vr168DAC5duoQdO3Zg6tSpNcbr2LEjcnNzUVhY+MRxRSlItra2MDc3x927d1FV\nVYW7d+/CwcFBjKGIiIxKdXU1Tpw4geeffx6XL1+Go6Oj5jlHR0dcvnz5kfcoFArExMTA09MTQUFB\nuHTp0hPH2LhxI8aOHfvY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ET48FiYxKdXU1du/ejS5dujz2+V27dtUoSH+dphcfH695zzvvvIOQkBAcPXoU48aN\nw4wZM8QPTmQEeGIsGQUzMzN4eHjg8uXLcHFxQUpKCkxMTJCbm4uhQ4fi+PHjqKioQK9evZCeng4A\naNeuHZo0aYJbt27BzMwMJ06cgI2NDezt7ZGfnw9TU1NUVlaibdu2uH79usT/QqKGj1tIZBQsLS1x\n+PBhXLhwAY0bN37svWUOHjwIPz+/Gj9TqVS4cOECevTogZUrV2p+zr/jiJ49FiQyKpaWloiKisLs\n2bMfKSrx8fGPve+SqakpvvnmGyxduhQlJSXo1auX5rph69atw0svvaSX7ERyx4JERuHh+8t07doV\nHTp0wKZNm6BQKDTP7d+/H3379n3se1q3bo1Ro0bhu+++w7Jly7B69Wp4eXlh3bp1iIyM1N8/hEjG\nuA+JCPfvwzVt2jT8/vvvUkchMlosSEREZBDYsiMiIoPAgkRERAaBBYmIiAwCCxIRERkEFiQiIjII\nLEhERGQQ/j8y2WFyYO5hqwAAAABJRU5ErkJggg==\n"
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAELCAYAAAAY3LtyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9UVGX+B/D38Ctd0SRDFAbPqMMKJr8U/FUU7YImpZu0\n9hXZ1QPkcvhueTqZ27etU0ydfqhZm9rW5qadTqw/yu+KJY6s1RCaOCaYFNkXyZEfhoppImrA8Hz/\nGBwlZxy43HtnBt6vczoH5s6Pz32OzZvnee5zH40QQoCIiEgCH3cXQERE3oshQkREkjFEiIhIMoYI\nERFJxhAhIiLJGCJERCSZIiGSnZ2NkJAQREdHOzxeWFiI2NhYxMfHY9KkSfj000/tx4xGIyIjIxER\nEYHly5crUR4REclEo8Q6kdLSUgQGBmLhwoWorKy87nhLSwsGDRoEAKisrMTcuXNx9OhRWK1WjBs3\nDrt370ZYWBgSExOxceNGREVFyV0iER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1lZGXx8fGCxWDB79mxUVlaitbUV06dPt98Jd/To0Rg8eDB+/PFH+Pn54euvv0ZgYCCCg4PR2NgI\nX19ftLW1ITQ0FKdPn3bzGRJJx54IkQsDBw5ERUUFjh8/jgEDBly3ZwMAlJaW4o477ujymMlkwvHj\nxzF16lSsW7fO/jj/bqO+hCFC1E0DBw7E6tWr8dRTT10XBEaj0eE+Lb6+vvjb3/6GVatW4cKFC5g+\nfTo2bdoEACgoKMCdd96pSu1ESmGIELlw7X4KcXFx0Ov12LJlS5e9FkpKSnDXXXc5fM2IESOQnp6O\nN954A2vWrMGGDRsQGxuLgoICvP766+qdCJECOCdC1Ev19fXIzc3Fjh073F0KkeoYIkREJBmHs4iI\nSDKGCBERScYQISIiyRgiREQkGUOEiIgkY4gQEZFk/w8CXDOaRlIIgQAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_7.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_7.ipynb
new file mode 100644
index 00000000..d5266070
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_7.ipynb
@@ -0,0 +1,286 @@
+{
+ "metadata": {
+ "name": "Ch 7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 :Similitude ,Dimensional Analysis and Modelling"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5 Page no.372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.5\n",
+ "#Determine the model dimension and the velocity at which the test should be performed.\n",
+ "#given\n",
+ "D=0.1 #m\n",
+ "H=0.3 #m\n",
+ "v=50.0 #km/hr\n",
+ "Dm=20.0 #mm\n",
+ "T=20.0 #degree C\n",
+ "fm=49.9 #Hz frequency for the model\n",
+ "#f=func(D,H,V,d,vis)\n",
+ "#f=T**(-1) D=l H=L V=L*(T**(-1)) d=M*(L**(-3)) vis=M*(L**(-1))*(T**(-1))\n",
+ "#by applying pi theorem,\n",
+ "#(f*D/V)=funct((D/H),(d*V*D/vis))\n",
+ "#hence Dm/Hm = D/H, dm*Vm*Dm/vism = d*V*D/vis, and (f*D/V)=(fm*Dm/Vm)\n",
+ "\n",
+ "#calculation\n",
+ "Hm=(Dm*H*1000/(D*1000)) #mm\n",
+ "V=v*1000/3600 #m/s\n",
+ "vism=0.001 #kg/(m*s)\n",
+ "vis=1.79*10**-5 #kg/(m*s)\n",
+ "d=1.23 #kg/(m**3)\n",
+ "dm=998 #kg/(m**3)\n",
+ "Vm=(vism*d*D*V*1000)/(vis*dm*Dm) #m/s\n",
+ "f=(V/Vm)*(Dm/(D*1000))*fm #Hz\n",
+ "\n",
+ "#result\n",
+ "print \"The model dimension =\",round(Hm,3),\"mm\"\n",
+ "print \"The velocity at which the test should be performed=\",round(Vm,2),\"m/s\"\n",
+ "print \"The predicted prototype vortex shredding frequency =\",round(f,1),\"Hz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The model dimension = 60.0 mm\n",
+ "The velocity at which the test should be performed= 4.781 m/s\n",
+ "The predicted prototype vortex shredding frequency = 29.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 Page no.377"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.6\n",
+ "#What is the required flowrate in the model.\n",
+ "#given\n",
+ "D=2.0 #ft\n",
+ "Q=30.0 #cfs\n",
+ "Dm=3.0 #in\n",
+ "#Rem=Re hence (Vm*Dm/kvism)=(V*D/kvis) where kvis is kinematic viscosity\n",
+ "#kvis=kvism same fluid is used for model and prototype\n",
+ "#(Vm/V)=(D/Dm)\n",
+ "#Q=VA hence Qm/Q = (Vm*Am)/(V*A)=(Dm/D)\n",
+ "\n",
+ "# calculation\n",
+ "Qm=(Dm/12)*Q/D #cfs\n",
+ "\n",
+ "#result\n",
+ "print \"The required flowrate in the model=\",Qm,\"cfs\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "ax.plot([0.125], [8], 'o')\n",
+ "ax.annotate('(0.125,8)', xy=(0.125,8.5))\n",
+ "\n",
+ "T=[0.04,0.125,0.2,0.6,1]\n",
+ "K=[25,8,5,2,1]\n",
+ "xlabel(\"Dm/D\") \n",
+ "ylabel(\"Vm/V\") \n",
+ "plt.xlim((0,1))\n",
+ "plt.ylim((0,25))\n",
+ "a=plot(T,K)\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required flowrate in the model= 3.75 cfs\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAELCAYAAAA/cjqaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHilJREFUeJzt3X1UVHX+B/D38KCgggIqoFAiQkjAMIKamgoqD5oarlsr\nPou5Vr+tNTt1LNfETql1PLut2J6f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+/eGDZsGIKCgjB+\n/HhkZmaKUDmRZSnv5hpERujRo4fhDovl5eWYPXs2bty4geTkZJO+JysrC5MnTwYAjBs3Dp9//jkA\n4MyZM0hISICzszMmTJhg0dqJLIlHAqR6/fr1w5YtW7Bp0yYAQGpqKhISEhAbGws/Pz9s2rQJGzZs\nwLBhwzBq1ChUVVUZPnvw4EFMmjSpzVGEVqvFG2+8YfhOImvFECAC4Ofnh4aGBly/fh0AcO7cOWRk\nZODEiRNYuXIlXF1dcerUKYwaNQofffQRgKbbVjg6OnZ4fxqdTocffvhBst+ByBwMAaIWmm+2FR0d\njZ49e6Jv377o06cPpk2bBgAIDQ1FYWEhACAnJwdxcXEdfhevwyRbwBAgAnDlyhXY29sbehR0797d\n8JqdnZ3hz3Z2dqivrwfQ1O0qPj6+w+/My8tT5G0cSFm4MEyqV15ejmeffRYvvPBCp+9t+a/7/Px8\naLXadt+Xn5+Pt956C1u3brVYnURiYAiQKt25cwc6nQ51dXVwcHDA/PnzsXz5cgBNU0It78H+2581\nGg2+++476HS6Vs9/9dVXGDZsGG7fvo3+/fsjJSUF0dHR0v1SRGbgDeSIzPD2228jICAATz/9tNyl\nEHUJQ4CISMW4MExEpGIMASIiFWMIEBGpGEOAiEjFGAJERCrGECAiUrH/A1w1d0MWpUCyAAAAAElF\nTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 Page no.380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.7\n",
+ "#Find (a)The required air pressure in the tunnel.\n",
+ "#(b)The corrosponding drag on the prtotype for a 1 lb drag on the model.\n",
+ "V=240.0 #mph\n",
+ "ratio=0.1\n",
+ "Vair=240.0 #mph\n",
+ "Fm=1.0 #lb Fm =drag force on model\n",
+ "p=14.7 #psia standard atmospheric pressure\n",
+ "#Re=Rem\n",
+ "#(d*V*l/vis)=(dm*Vm*lm/vism)\n",
+ "#here Vm=V and lm/l=ratio\n",
+ "#assumption made is that an increase in pressure does not significantly change viscosity\n",
+ "\n",
+ "#calculation\n",
+ "drat=V/(ratio*Vair) #where drat=dm/d\n",
+ "\n",
+ "#for an ideal gas p=d*R*T\n",
+ "#T=Tm\n",
+ "#hence, pm/p=dm/d pm/p=prat\n",
+ "pm=p*drat\n",
+ "#F/(0.5*d*(V**2)*(l**2))=Fm/(0.5*dm*(Vm**2)*(lm**2))\n",
+ "F=(1/drat)*((V/Vair)**2)*((1/ratio)**2)*Fm\n",
+ "\n",
+ "#result\n",
+ "print \"The required air pressure in the tunnel=\",round(pm,3),\"psia\"\n",
+ "print \"The corrosponding drag on the prtotype \\nfor a 1 lb drag on the model=\",round(F,3),\"lb\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required air pressure in the tunnel= 147.0 psia\n",
+ "The corrosponding drag on the prtotype \n",
+ "for a 1 lb drag on the model= 10.0 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8 Page no.384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 7.8\n",
+ "#Determine (a)the flowrate and required model width. (b) the operating time.\n",
+ "#given\n",
+ "w=20.0 #m\n",
+ "Q=125.0 #(m**3)/s\n",
+ "ratio=0.066\n",
+ "t=24.0 #hours\n",
+ "wm=ratio*w #m\n",
+ "#Vm/(gm*lm)**0.5 = V/(g*l)**0.5\n",
+ "#gm=g\n",
+ "#Q=VA and lm/l=1/15\n",
+ "#hence Qm/Q = ((lm/l)**0.5)*((lm/l)**2) = ratio**2.5\n",
+ "Qm=(ratio**2.5)*Q\n",
+ "#V=l/t\n",
+ "#tm/t=(V/Vm)*(lm/l)=ratio**0.5\n",
+ "tm=(ratio**0.5)*t #hours\n",
+ "\n",
+ "#result\n",
+ "print \"The required model width=\",round(wm,3),\"m\" \n",
+ "print \"The required model flowrate=\",round(Qm,3),\"m**3/s\"\n",
+ "print \"The operating time for the model=\",round(tm,1),\"hrs\"\n",
+ "\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "T=[0.02,0.07,0.2,0.4,0.5]\n",
+ "K=[4,6.20,10,15,17]\n",
+ "xlabel(\"lm/l\") \n",
+ "ylabel(\"tm (hr)\") \n",
+ "plt.xlim((0,0.5))\n",
+ "plt.ylim((0,20))\n",
+ "\n",
+ "ax.plot([0.07], [6.20], 'o')\n",
+ "ax.annotate('(1/15,6.20hr)', xy=(0.1,6))\n",
+ "a=plot(T,K)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required model width= 1.32 m\n",
+ "The required model flowrate= 0.14 m**3/s\n",
+ "The operating time for the model= 6.2 hrs\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAELCAYAAADURYGZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHf5JREFUeJzt3XtYFXX+B/D3cElSFJWbpCCJqCSIKOBdMC+IipGut8fU\nFjF/umk+bpmVPV4ixZLdR/CSq66LZl5WS2lJ1k09SIBiiguGImpHkQWMBVTM5Da/P9qOoCCHy8yc\nc+b9eh6fB47DnA9fcd7MfGa+X0EURRFERKRaZkoXQEREymIQEBGpHIOAiEjlGARERCrHICAiUjkG\nARGRykkWBLm5uRgxYgR69+4NT09PREdHAwCKi4sxevRo9OjRA2PGjEFpaalUJRARkR4EqZ4jKCgo\nQEFBAfr27YuysjL0798fR44cwa5du2BnZ4dly5Zh/fr1KCkpQWRkpBQlEBGRHiQ7I+jUqRP69u0L\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PDwcMTExAICqqipkZ2ejV69eCldL1HQMAqJ6+Pn5wdHREc899xy6\nd++OoKAgAICnpye0Wi0A4OzZsxgwYICCVRI1H4OAqB6tWrXSfWxmZqb73MzMDJWVlQCAY8eOITg4\nWJH6iFoKg4CoGU6ePIlRo0YpXQZRszAIiGqoeddQfXcQCYIAQRBQVFQEKyurWquEcW0JMkacdI6o\nifbu3Yu8vDwsW7ZM6VKImoVBQESkcrw0RESkcgwCIiKVYxAQEakcg4CISOUYBEREKscgICJSuf8H\nu0KszCbRxKoAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_8.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_8.ipynb
new file mode 100644
index 00000000..0c545286
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_8.ipynb
@@ -0,0 +1,1058 @@
+{
+ "metadata": {
+ "name": "Ch 8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Viscous flow in pipes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no.405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.1\n",
+ "#Determine the minimum time taken to fill the glass\n",
+ "#(b) Maximum time taken to fill the glass.\n",
+ "\n",
+ "#given\n",
+ "T1=50.0 #degree farenheit\n",
+ "D=0.73 #in\n",
+ "vol=0.0125 #ft**3\n",
+ "T2=140 #degree farenheit\n",
+ "\n",
+ "vis1=2.73*10**-5 #lb*s/ft**2 at 50 degree farenheit\n",
+ "vis2=0.974*10**-5 #lb*s/ft**2 at 140 degree farenheit\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#for 50 degree farenheit\n",
+ "#if flow is laminar, maximum Re=2100 Re=d*V*D/vis\n",
+ "V1=2100*vis1/(1.94*D/12)\n",
+ "t1=vol/(math.pi*((D/12)**2)/4*V1)\n",
+ "#if flow is turbulent, minimum Re=4000\n",
+ "V2=4000*vis1/(1.94*D/12)\n",
+ "t2=vol/(math.pi*((D/12)**2)/4*V2)\n",
+ "\n",
+ "#for 140 degree farenheit\n",
+ "#if flow is laminar, maximum Re=2100 Re=d*V*D/vis\n",
+ "V3=2100*vis2/(1.94*D/12)\n",
+ "t3=vol/(math.pi*((D/12)**2)/4*V3)\n",
+ "#if flow is turbulent, minimum Re=4000\n",
+ "V4=4000*vis2/(1.94*D/12)\n",
+ "t4=vol/(math.pi*((D/12)**2)/4*V4)\n",
+ "\n",
+ "#result\n",
+ "print(\"For laminar flow\")\n",
+ "print \"The time taken to fill the glass at 50 degree F=\",round(t1,2),\"seconds\"\n",
+ "print \"The time taken to fill the glass 100 degree F=\",round(t3,2),\"seconds\"\n",
+ "print (\"For turbulent flow:\")\n",
+ "print \"The time taken to fill the glass at 50 degree F=\",round(t2,2),\"seconds\"\n",
+ "print \"The time taken to fill the glass at 140 degree F=\",round(t4,2),\"seconds\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For laminar flow\n",
+ "The time taken to fill the glass at 50 degree F= 8.85 seconds\n",
+ "The time taken to fill the glass 100 degree F= 24.81 seconds\n",
+ "For turbulent flow:\n",
+ "The time taken to fill the glass at 50 degree F= 4.65 seconds\n",
+ "The time taken to fill the glass at 140 degree F= 13.03 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page no.412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.2\n",
+ "#(a) find the pressure drop\n",
+ "#(b)How steep a hill must the pipe be on if oil is to flow through pipe.\n",
+ "#given\n",
+ "vis=0.4 #Ns/(m**2)\n",
+ "d=900 #kg/(m**3)\n",
+ "D=0.02 #m\n",
+ "Q=2.0*(10**-5) #(m**3)/s\n",
+ "x1=0\n",
+ "x2=10 #m\n",
+ "p1=200 #kPa\n",
+ "x3=5 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=Q/(math.pi*(D**2)/4) #m/s\n",
+ "Re=d*V*D/vis\n",
+ "print \"a) Reynolds number =\",round(Re,0),\"Hence the flow is laminar.\"\n",
+ "\n",
+ "pdiff=128*vis*(x2-x1)*Q/(math.pi*(D**4)*1000)\n",
+ "#for part b0 p1=p2 Q=math.pi*(pdiff-(sw*l*math.sin(ang)))*(D**4)/(128*vis*l)\n",
+ "ang=(math.asin(-128*vis*Q/(math.pi*d*9.81*(D**4))))*180/math.pi\n",
+ "#since sin(ang) doesn= not depend on pdiff, the the pressure is constant all along the pipe\n",
+ "#hence for c)\n",
+ "p3=p1 #kPa\n",
+ "\n",
+ "#result\n",
+ "print \"The pressure drop required if the pipe is horizontal=\",round(pdiff,1),\"kpa\"\n",
+ "print \"b) The angle of the hill the pipe must be on if the oil is to flow at the same rate as a) but with (p1=p2) =\",round(ang,2),\"degree\"\n",
+ "print \"c) For conditions of part b), the pressure at x3=5 m = \",round(p3,3),\"kpa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a) Reynolds number = 3.0 Hence the flow is laminar.\n",
+ "The pressure drop required if the pipe is horizontal= 20.4 kpa\n",
+ "b) The angle of the hill the pipe must be on if the oil is to flow at the same rate as a) but with (p1=p2) = -13.34 degree\n",
+ "c) For conditions of part b), the pressure at x3=5 m = 200.0 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page no.416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.3\n",
+ "#(a) plot K(t) vs T\n",
+ "#(b) Determine wall shear stress and pressure drop.\n",
+ "#(c)Determine the net pressure force.\n",
+ "\n",
+ "from numpy import*\n",
+ "T=array([60,80,100,120,140,160]) #degree F\n",
+ "d=array([2.07,2.06,2.05,2.04,2.03,2.02])#(slugs/(ft**3))\n",
+ "vis=array([0.04,0.019,0.0038,0.00044,0.000092,0.000023])#lb*sec/(ft**2)\n",
+ "Q=0.5 #(ft**3)/sec\n",
+ "T1=100.0 #degree F\n",
+ "l=6.0 #ft\n",
+ "D=3.0 #in\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "pdiff=128*vis[2]*l*Q/(math.pi*(D/12)**4)\n",
+ "print \"The pressure difference is \",round(pdiff,0),\"lb/ft**2\"\n",
+ "V=Q/(math.pi*((D/12)**2)/4) #ft/sec\n",
+ "Re=d[2]*V*(D/12)/vis[2]\n",
+ "print\"The reynolds number=\",round(Re,0),\"< 2100 hence the flow is laminar\"\n",
+ "stress=pdiff*(D/12)/(4*l) #lb/(ft**2)\n",
+ "print \"The wall stress for the given Q and T =\",round(stress,2),\"lb/(ft**2)\"\n",
+ "Fp=(math.pi/4)*((D/12)**2)*pdiff #lb\n",
+ "Fv=(2*math.pi)*((D/24))*l*stress #lb\n",
+ "\n",
+ "#result\n",
+ "print \"The net pressure force =\",round(Fp,2),\"lb\"\n",
+ "print \"The net viscous/shear force =\",round(Fv,2),\"lb\"\n",
+ "\n",
+ "#PLot\n",
+ "T=[60,80,100,120,140,160]\n",
+ "K=[0.0004125,0.00086842,0.0043421,0.0375,0.173,0.695]\n",
+ "xlabel(\"T F\") \n",
+ "ylabel(\"K ft**5/lbs\") \n",
+ "plt.xlim((60,180))\n",
+ "plt.ylim((0.0001,1))\n",
+ "a=plot(T,K)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference is 119.0 lb/ft**2\n",
+ "The reynolds number= 1374.0 < 2100 hence the flow is laminar\n",
+ "The wall stress for the given Q and T = 1.24 lb/(ft**2)\n",
+ "The net pressure force = 5.84 lb\n",
+ "The net viscous/shear force = 5.84 lb\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEKCAYAAAAW8vJGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH0RJREFUeJzt3XtUVXXCxvHvUTDN+21QOTSoIBdRvGtWRqViVpTWlNqs\nTB0zG6daNl5bJViK5HTVt14rL5lm+c5MQxZzxsQonVIsKqexpWSYiMqISlqoCO73j51n3MpFLod9\nzuH5rOVSDpvD80vbD799+W2HYRgGIiIiv2hgdwAREfEuKgYREbFQMYiIiIWKQURELFQMIiJioWIQ\nERELjxXDxIkTCQoKokePHuVu8/DDDxMeHk5sbCxffvmlp6KIiEgVeKwYJkyYgMvlKvfzaWlpfPfd\nd2RnZ/Pqq68ydepUT0UREZEq8FgxXHfddbRu3brcz7/33nuMHz8egIEDB1JYWEh+fr6n4oiIyGWy\n7RxDXl4eISEh7o+dTicHDhywK46IiPwiwM5vfvFqHA6H45JtynpNREQqV90Vj2ybMQQHB5Obm+v+\n+MCBAwQHB5e5rWEYfvtr3rx5tmfQ+DQ2jc//ftWEbcWQkJDA6tWrAdi2bRutWrUiKCjIrjgiIvIL\njx1KGjt2LB9//D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0+MbM2aM0bFjRyMw\nMNBwOp3GihUrKhzPggULjK5duxoRERHuqye82cXjW758uREWFmZcddVVRq9evYxevXoZU6dOdW/v\nq+Nr1KiR++/vQp07d3ZflWQYvjW+ssZWXFxs/Pa3vzViYmKMPn36GB999JF7e18am2GU/f/ejh07\njAEDBhixsbHGoEGDjKysLPf2VR2f16+VJCIidctrDiWJiIh3UDGIiIiFikFERCxUDCIiYuH1z2MQ\nscvRo0cZOnQoAIcPH6Zhw4a0b98eh8PB9u3b3UsrXCguLo7Dhw/TpEkTAJ544gn3tfMivkLFIFKO\ntm3b8uWXXwKQlJRE8+bNmT59eoVf43A4eOutt+jTp09dRBTxCB1KErlMl3tlt64AF1+nGYNILTIM\ng3vvvdd9KCk9PZ02bdrYnEqkalQMIrVIh5LEH+hQkkgt06Ek8XUqBpFa5otLNotcSMUgcpm0w5f6\nQovoiYiIhWYMIiJioWIQERELFYOIiFioGERExELFICIiFioGERGx+H/cxgRIJ7DV5wAAAABJRU5E\nrkJggg==\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no.427"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.4\n",
+ "#Determine (a) The thickness of the viscous sublayer\n",
+ "#(b)The approximate centerline velocity\n",
+ "#C ratio of laminar to turbulant shear stress.\n",
+ "\n",
+ "#Given\n",
+ "T=20.0 #degree C\n",
+ "d=998.0 #kg/(m**3)\n",
+ "kvis=1.004*(10**-6) #(m**2)/s where kvis=kinematic viscosity\n",
+ "D=0.1 #m\n",
+ "Q=0.04 #(m**3)/sec\n",
+ "pgrad=2.59 # kPa/m where pgrad is pressure gradient\n",
+ "l=1 #m length\n",
+ "#calculation\n",
+ "import math\n",
+ "from scipy import integrate\n",
+ "stress=D*(pgrad*1000)/(4*l) #N/(m**2)\n",
+ "uf=(stress/d)**0.5 #m/sec where uf is frictional velocity\n",
+ "ts=5*kvis*1000/(uf) #mm where ts is the thickness of the viscous sublayer\n",
+ "print \"The thickness of the viscous sublayer=\",round(ts,2),\"mm\"\n",
+ "V=Q/(math.pi*(D**2)/4) #m/s\n",
+ "Re=V*D/kvis\n",
+ "print \"The reynolds number=\",round(Re,0),\"hence the flow is turbulent.\"\n",
+ "\n",
+ "n=8.4 #from turbulent flow velocity profile diagram\n",
+ "#Q=(math.pi)*(R**2)*V\n",
+ "R=1 #say \n",
+ "def f1(r):\n",
+ " return(1/R**2*(((1-r/R)**(1/n))*2*math.pi*r))\n",
+ "q=integrate.quad(f1,0.0,R)\n",
+ "q_=q[0]\n",
+ "x=round(q_,2)/math.pi #x=V/Vc\n",
+ "Vc=V/x\n",
+ "print \"The approximate centerline velocity=\",round(Vc,2),\"m/s\"\n",
+ "\n",
+ "#C\n",
+ "r=0.025 #m\n",
+ "stress1=(2*stress*r)/D #N/(m**2)\n",
+ "#d(uavg)/dr=urate=-(Vc/(n*R))*((1-(r/R))**((1-n)/n)) where uavg=average velocity\n",
+ "urate=-(Vc/(n*(D/2)))*((1-(r/(D/2)))**((1-n)/n)) #s**(-1)\n",
+ "stresslam=-(kvis*d*urate) #N/(m**2)\n",
+ "stressratio=(stress1-stresslam)/stresslam\n",
+ "\n",
+ "#result\n",
+ "print \"The ratio of teh turbulent to laminar stress at a point\\nmidway between the centreline and the pipe wall =\",round(stressratio,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thickness of the viscous sublayer= 0.02 mm\n",
+ "The reynolds number= 507267.0 hence the flow is turbulent.\n",
+ "The approximate centerline velocity= 6.04 m/s\n",
+ "The ratio of teh turbulent to laminar stress at a point\n",
+ "midway between the centreline and the pipe wall = 1219.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page no.435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.5\n",
+ "# find The pressure drop if the flow is laminar and turbulent.\n",
+ "\n",
+ "#result\n",
+ "D=4.0 #mm\n",
+ "V=50.0 #m/sec\n",
+ "l=0.1 #m\n",
+ "d=1.23 #kg/(m**3)\n",
+ "vis=1.79/100000 #N*sec/(m**2)\n",
+ "Re=d*V*(D*10**-3)/vis\n",
+ "#if flow is laminar\n",
+ "f=64/Re\n",
+ "pdiff=f*l*0.5*d*(V**2)/((D*10**-3)*1000) #kPa\n",
+ "\n",
+ "#result\n",
+ "print \"The pressure drop if the flow is laminar=\",round(pdiff,3),\"kpa\"\n",
+ "\n",
+ "#if flow is turbulent\n",
+ "#roughness=0.0015 hence f=0.028\n",
+ "f1=0.028\n",
+ "pdiff1=f1*l*0.5*d*(V**2)/((D/1000)*1000) #kPa\n",
+ "print \"The pressure drop if flow is turbulent=\",round(pdiff1,3),\"kpa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop if the flow is laminar= 0.179 kpa\n",
+ "The pressure drop if flow is turbulent= 1.076 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page no.446"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.6\n",
+ "#find the pressure drop.\n",
+ "#The horsepower supplied to the fluid by the fan.\n",
+ "\n",
+ "#Given\n",
+ "#Area and Velocity at location 1 to 9\n",
+ "A=[22,28,35,35,4,4,10,18,22]\n",
+ "V=[36.4,28.6,22.9,22.9,200,200,80,44.4,36.4]\n",
+ "g=32.2 #ft/s**2 gravitational constant \n",
+ "SG=0.0765 #spesific gravity\n",
+ "hl=(0.2*(V[1]**2+V[2]**2+V[6]**2+V[7]**2)+0.6*V[5]**2+0.2*V[4]**2+4*V[3]**2)/(2*g)\n",
+ "pdiff=SG*hl/144 #psi\n",
+ "Pa=SG*A[4]*V[4]*hl\n",
+ "\n",
+ "#result\n",
+ "print \"The value of (p1-p9)=\",round(pdiff,3),\"psi\"\n",
+ "print \"The horsepower supplied to the fluid by the fan=\",round(Pa,1)/550,\"hp\"\n",
+ "\n",
+ "#Plot\n",
+ "V=[50,100,150,200,250,300]\n",
+ "Pa=[0,10,25,62.3,120,220]\n",
+ "a=plot(V,Pa)\n",
+ "xlabel(\"q ft**3/s\") \n",
+ "ylabel(\"d (ft)\") \n",
+ "plt.xlim((0,300))\n",
+ "plt.ylim((0,250))\n",
+ " \n",
+ "show(a)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of (p1-p9)= 0.297 psi\n",
+ "The horsepower supplied to the fluid by the fan= 62.272 hp\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEMCAYAAADal/HVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtwlPW9x/H3AqmXISpasjAJGksSQ0JItkCgcgtjgkXH\nyEWDUSEtgfFoW0VooTpHTTzKpRVroMXxUJT0ODXQdghUIUQdA4F6DMUglyAXGzB3wIAnQZxAeM4f\nT7MS2CyB7O6zu/m8ZjKGZy/5/nxgP3l+t8dmGIaBiIhIB3pYXYCIiPg3BYWIiLiloBAREbcUFCIi\n4paCQkRE3FJQiIiIW14LiqqqKsaPH098fDyDBw9m2bJlAOTk5BAREYHD4cDhcLBp0ybnaxYtWkR0\ndDSxsbEUFxd7qzQREbkCNm+to6ivr6e+vp6kpCSam5sZOnQohYWFrF27ltDQUObOndvu+RUVFTz8\n8MPs2LGDmpoaUlNTOXjwID166KJHRMRKXvsU7tevH0lJSQD07t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n7Nmz/XoLaxFdUYhcwNd3MWu7Ba6IP9MVhYiIuKXBbBERcUtBISIibikoRETELQWFiIi4paAQERG3\nFBQiIuLW/wOZ1ZDRj1PfyAAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page no.449"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.7\n",
+ "#Find the duct size(a) for the square duct if the head loss per foot remains the same for the pipe and the duct.\n",
+ "\n",
+ "#given\n",
+ "T=120.0 #degree F\n",
+ "D=8.0 #in\n",
+ "vavg=10.0 #ft/s\n",
+ "roughness=0\n",
+ "kvis=1.89*10**-4 #(ft**2)/s\n",
+ "Re=vavg*(D/12)/kvis\n",
+ "g=32.2 #ft/s**2 gravitational constant\n",
+ "#Calculation\n",
+ "import math\n",
+ "#from this value of Re and roughness/D=0, and using Moody's chart\n",
+ "f=0.022\n",
+ "x=f*(vavg**2)/(D*2*32.2/12) # x=hl/l\n",
+ "#Dh=4*A/P=4*(a**2)/(4*a)=a\n",
+ "y=(math.pi*((D/12)**2)*vavg)/(4) # y=Vs/a**2 \n",
+ "z=x*2*g/y**2 #z=f/a**5\n",
+ "f=0.023\n",
+ "a=(f/z)**(0.2)\n",
+ "\n",
+ "#result\n",
+ "print \"The duct size(a) for the square duct if the head loss per foot\\n remains the same for the pipe and the duct=\",round(a,3),\"ft\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The duct size(a) for the square duct if the head loss per foot\n",
+ " remains the same for the pipe and the duct= 0.611 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page no.451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.8\n",
+ "#Determine the pressure at point 1 if (a) all losses are neglected \n",
+ "#(b) major losses are included (c) all losses are included.\n",
+ "\n",
+ "#Given\n",
+ "T=60 #degree F\n",
+ "D=0.0625 #ft\n",
+ "Q=0.0267 #(ft**3)/sec \n",
+ "Df=0.5 #in\n",
+ "l1=15.0 #ft\n",
+ "l2=10.0 #ft\n",
+ "l3=5.0 #ft\n",
+ "l4=10.0 #ft\n",
+ "l5=10.0 #ft\n",
+ "l6=10.0 #ft\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "V1=Q/(math.pi*(D**2)/4) #ft/sec\n",
+ "V2=Q/(math.pi*((Df/12)**2)/4) #ft/sec\n",
+ "d=1.94 #slugs/ft\n",
+ "vis=2.34*10**-5 #lb*sec/(ft**2)\n",
+ "Re=d*V1*D/vis\n",
+ "print \"The reynolds number =\",round(Re,3),\"hence the flow is turbulent\"\n",
+ "\n",
+ "#applying energy equation between points 1 and 2\n",
+ "#when all head losses are excluded\n",
+ "p1=(d*32.2*(l2+l4))+(0.5*d*((V2**2)-(V1**2))) #lb/(ft**2)\n",
+ "print \"a)The pressure at point 1 when all head losses are neglected=\",round(p1,3),\"lb/ft**2\"\n",
+ "\n",
+ "#if major losses are included\n",
+ "f=0.0215\n",
+ "hLmajor=f*(l1+l2+l3+l4+l5+l6)*(V1**2)/(D*2*32.2)\n",
+ "p11=p1+(d*32.2*hLmajor) #lb/(ft**2)\n",
+ "\n",
+ "#result\n",
+ "print \"b)The pressure at point 1 when only major head losses are included=\",round(p11/144,1),\"psi\"\n",
+ "\n",
+ "#if major and minor losses are included\n",
+ "KLelbow=1.5\n",
+ "KLvalve=10\n",
+ "KLfaucet=2\n",
+ "hLminor=(KLvalve+(4*KLelbow)+KLfaucet)*(V1**2)/(2*32.2)\n",
+ "p12=p11+(d*32.2*hLminor)#lb/(ft**2)\n",
+ "print \"c)The pressure at point 1 when both major and minor head losses are included=\",round(p12/144,1),\"psi\"\n",
+ "H=(p1/(32.2*1.94))+(V1*V1/(2*32.2))#ft\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "D=[0,15,15,25,25,30,30,40,40,50,50,60]\n",
+ "P=[30.5,27.8,27.1,21.0,20.2,19.3,18.5,12.4,11.7,9.93,4.84,3.09]\n",
+ "xlabel(\"distance along pipe from point ft\") \n",
+ "ylabel(\"P hP\") \n",
+ "plt.xlim((-0.5,60))\n",
+ "plt.ylim((0,32))\n",
+ "a=plot(D,P)\n",
+ "plt.text(40,28, '-(a)no losses')\n",
+ "plt.text(40,25, '-(c)including all losses')\n",
+ "\n",
+ "\n",
+ "plt.text(0,30.5, '30.5')\n",
+ "plt.text(15,27.8, '27.8')\n",
+ "plt.text(15,27.1, '27.1')\n",
+ "plt.text(25,21.0, '21.0')\n",
+ "plt.text(25,20.2, '20.2')\n",
+ "plt.text(30,19.3, '19.3')\n",
+ "plt.text(30,18.5, '18.5')\n",
+ "plt.text(40,12.4, '12.4')\n",
+ "plt.text(40,11.7, '11.7')\n",
+ "plt.text(50,9.93, '9.93')\n",
+ "plt.text(50,4.84, '4.84')\n",
+ "plt.text(60,3.09, '3.09')\n",
+ "plt.text(0,22, 'pressure loss')\n",
+ "plt.grid()\n",
+ "\n",
+ "D=[0,15,25,30,40,50,60]\n",
+ "P=[10.7,10.7,6.37,6.37,2.07,2.07,2.07]\n",
+ "xlabel(\"distance along pipe from point ft\") \n",
+ "ylabel(\"P hP\") \n",
+ "plt.xlim((-0.5,60))\n",
+ "plt.ylim((0,32))\n",
+ "a=plot(D,P)\n",
+ "plt.text(0,10.7, '10.7')\n",
+ "plt.text(15,10.7, '10.7')\n",
+ "plt.text(25,6.37, '6.37')\n",
+ "plt.text(30,6.37, '6.37')\n",
+ "plt.text(40,2.07, '2.07')\n",
+ "plt.text(50,2.07, '2.07')\n",
+ "plt.text(60,2.07, '2.07')\n",
+ "plt.text(5,5, 'Elevation and Kinetic Energy')\n",
+ "show(a)\n",
+ "# 2nd plot\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "D1=[0,15,15,25,25,30,30,40,40,50,50,60,60]\n",
+ "P1=[71.6,67,63,60,58,57,55,53,50,45,31,28,26]\n",
+ "xlabel(\"distance along pipe from point 1 ft\") \n",
+ "ylabel(\"Elevetion to Energy line H ft\") \n",
+ "plt.xlim((0,60))\n",
+ "plt.ylim((0,80))\n",
+ "ax.annotate('slope due to pipe friction', xy=(8, 70), xytext=(15,75),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.000),\n",
+ " )\n",
+ "ax.annotate('sharp drop due to component loss', xy=(15, 65), xytext=(20,65),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.000),\n",
+ " )\n",
+ "ax.annotate('Energy line including all losses', xy=(35, 55), xytext=(40,53),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.000),\n",
+ " )\n",
+ "\n",
+ "a1=plot(D1,P1)\n",
+ "\n",
+ "D1=[0,60]\n",
+ "P1=[26,26]\n",
+ "xlabel(\"distance along pipe from point 1 ft\") \n",
+ "ylabel(\"Elevetion to Energy line H ft\") \n",
+ "plt.xlim((0,60))\n",
+ "plt.ylim((0,80))\n",
+ "a1=plot(D1,P1)\n",
+ "\n",
+ "ax.annotate('Energy line with no losses', xy=(10, 25), xytext=(10,10),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.000),\n",
+ " )\n",
+ "\n",
+ "show(a1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reynolds number = 45094.88 hence the flow is turbulent\n",
+ "a)The pressure at point 1 when all head losses are neglected= 1547.821 lb/ft**2\n",
+ "b)The pressure at point 1 when only major head losses are included= 21.3 psi\n",
+ "c)The pressure at point 1 when both major and minor head losses are included= 30.5 psi\n"
+ ]
+ },
+ {
+ "output_type": "display_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bEOHTIN0/7VVz/y\nzDO98PPzIysri+PHjzN79mw2btxIVFQUd+7coXTp0lStWpXff/+dc+fOMXz4cNavX09ycjIrV67k\n008/5e7du1y/fp1t27bRuHFja6enKIVm6WunKjiUEu2xx+DoUdO/2Xr16sWoUaMYNWoUW7duxdXV\nleTkZEJCQjh69Og999erVy9Gjx5Nhw4dijlyRSk6aiKnP2m9PlLL+Vkzt5y9qlJSUnB1dQVMVVIp\nKSmF3rYgWj5voO38tJybpdlswaEoD+rGjRv07duX2bNnmweOzHa/OVIepkeWojyqiryq6vTp0zz7\n7LOcP3+ZRvKCAAAgAElEQVQenU7H888/n6uh8o8//sDd3Z3ly5fnaahUVVXKg8quqnJ2vkv37t3p\n0qULY8aMAaBRo0YYjUaqV69OUlIS7dq1y7eq6u7dvNsqSklS4quq7O3tmTlzJvHx8URHR/P5559z\n5MgRpk6dSmhoKMePH6dDhw5MnTq1qA+tPKIWLRL69h1K48ZeuS78PXv2ZOHChQAsXLgw3266IsLQ\noUPx8vIqVKExZMgQXF1d8fHxMb928OBBWrVqha+vLz179uT69et5trt9+zYtWrRAr9fj5eXFxIkT\nHyZVRbENxT2myZNPPik///yzNGzYUJKTk0XENLZQzkmWsuUMR8vjyohoOz9L5rZsmUjnztsFdFKq\nlJ84OemlenW9fPjhBklMvCgdOnSQBg0aSGhoqFy+fFlERM6ePStdu3YVEZHt27eLTqcTPz8/0ev1\notfrZcOGDQUeb/bs2XLgwIFc46gFBATItm3bRERkwYIF8q9//SvfbW/evCkiInfv3pUWLVrI9u3b\ni+QzKErq77JkssClPJdifY7jYRoqIyIicHd3JzExkdjY2FxTvGY3bqll217OZonjVasGGzaEAFms\nWmXk8GG4di2En36Cd981Urv223TqFEJgIPz0k5EaNaBduxDWr19v3l/2XCyFOV5WVhaVKlXK9f6J\nEycICgrCaDRSoUIFvv/+e95777082+/ZsweA5s2bk5mZyW+//UZGRobVz1fO5djYWJuKpyiXY2Nj\nbSqef7JsNBqJjIwETFNpW1xxlUjX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w5dffgknJycLuzweD0KhEJGRkdBqtfjoo4/g6ekJT09PtLa2YsmSJQAGB939+/fDzc3N\n5jka6e+T6hqp0dYfBT6fj+DgYJhMJhQVFT1zG0OvRSIRHBwcIBaLkZGRYXUL/dBNNnq9Ht7e3igq\nKoJSqRxV95PYY0xNWBJXxpTBYDDA2dkZDx48wMsvv4w9e/ZALBZb1MnIyIBKpcKyZcts2tm0aRNm\nzJiB99577992+R8RGRmJgoICBAcHT7QrDMZTwWZMjClDVlYWWlpaYDQaoVarrYLS08DWURiMfw82\nY2IwGAyGXcFufmAwGAyGXcECE4PBYDDsChaYGAwGg2FXsMDEYDAYDLuCBSYGg8Fg2BUsMDEYDAbD\nrvgfIHgLBUAjJl4AAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.9 Page no.453"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.9\n",
+ "# Determine the horsepower required to drive the system\n",
+ "\n",
+ "#Given\n",
+ "T=140.0 #degree F\n",
+ "sw=53.7 #lb/(ft**3)\n",
+ "vis=8*10**-5 #lb*sec/(ft**2)\n",
+ "l=799 #miles\n",
+ "D=4.0 #ft\n",
+ "Q=117.0 #(ft**3)/sec\n",
+ "V=9.31 #ft/sec\n",
+ "#energy equation=> hp=hL=f*(l/D)*((V**2)/(2*g))\n",
+ "f=0.0125\n",
+ "hp=f*(l*5280/D)*((V**2)/(2*32.2)) #ft, in book ,calculation mistake\n",
+ "Pa=sw*Q*round(hp,2)/550 #hp\n",
+ "\n",
+ "#Result\n",
+ "print \"The horsepower required to drive the system=\",round(Pa,3),\"hp\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "D=[2,3,4,5,6]\n",
+ "P=[3.2*10**6,0.8*10**6,0.202*10**6,0.15*10**6,0.1*10**6]\n",
+ "xlabel(\"D ft\") \n",
+ "ylabel(\"P hP\") \n",
+ "plt.xlim((0,6))\n",
+ "plt.ylim((0,4*10**6))\n",
+ "ax.plot([4], [0.202*10**6], 'o')\n",
+ "ax.annotate('(4ft,2.02*10**5 hp)', xy=(4,0.25*10**6))\n",
+ "a=plot(D,P)\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The horsepower required to drive the system= 202694.35 hp\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZwAAAEKCAYAAAAmfuNnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1UVOe9L/DvIERjVUaIgpmhB2FmfAGEUXnJ6U0LEqAm\nV9QAAkmU+tJzRWtMlk1MmpMWs2rUJOY0MWjuTTWCPacYTaO2FYQYidYcMSBpTjWNNI4KA9oIM0iM\nMMD87h+UXXlTVGaGl+9nLdcanr2fZ357N92/efY8+zcqEREQERE5mJurAyAioqGBCYeIiJyCCYeI\niJyCCYeIiJyCCYeIiJyCCYeIiJzCYQmntbUVRqMRc+bMAQDU1dUhLi4OBoMB8fHxsFqtyr4bNmyA\nXq/H5MmTUVhYqLSXlZUhJCQEer0eq1evVtqbmpqQmpoKvV6PqKgoXLhwQdmWk5MDg8EAg8GA3Nxc\npd1kMiEyMhJ6vR5paWlobm521KETEVE3HJZw3njjDUydOhUqlQoAsHHjRsTFxeHs2bOIjY3Fxo0b\nAQBnzpzB7t27cebMGRQUFGDFihVofzQoMzMT27dvR0VFBSoqKlBQUAAA2L59O7y9vVFRUYGnn34a\na9euBdCW1F566SWcPHkSJ0+exLp161BfXw8AWLt2LdasWYOKigqMHTsW27dvd9ShExFRNxyScKqq\nqnDw4EEsW7ZMSR4HDhxARkYGACAjIwP79u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rwZnp6e8PT0xPvvv4+AgABnhE50\nW5hwiFysc8IBgLFjx+Ls2bMYN25cj/0mTpyIsrIyeHl5YfHixZgzZw4effRRR4dLdMf4HQ7RIMHP\njtTfMeEQ9TPnzp3DsGHDbjq76c5gKwtDgw8TDlE/8vXXX2P58uVYtWrVbfUbPXo0rl696qCoiPoG\nv8MhcjF3d3eEhISgubkZ7u7uWLRoEZ5++ulbzlgCAgJQWloKLy8vfPLJJ/jxj3+MESNGYM+ePVw0\nQP0SEw4RETkFb6kREZFTMOEQEZFTMOEQEZFTMOEQEZFTMOEQEZFTMOEQEZFT/H+gfiZjch3qYwAA\nAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.10 Page no.454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.10\n",
+ "#Find the flow rate.\n",
+ "#Given\n",
+ "D=4.0 #in\n",
+ "l=20 #ft\n",
+ "n=4.0 #number of 90 degree elbows\n",
+ "h=0.2 #in\n",
+ "T=100 #degree F \n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#energy equation between the inside of the dryer and the exit of the vent pipe\n",
+ "p1=(h/12)*62.4 #lb/(ft**2)\n",
+ "KLentrance=0.5\n",
+ "KLelbow=1.5\n",
+ "sw=0.0709 #lb/(ft**3)\n",
+ "f=0.022 #assumption\n",
+ "#hence,\n",
+ "V=((p1/sw)*2*32.2/(1+(f*l/(D/12))+KLentrance+(n*KLelbow)))**0.5 #ft/sec\n",
+ "Q=V*(math.pi*((D/12)**2)/4) #(ft**3)/sec\n",
+ "\n",
+ "#result\n",
+ "print \"The flowrate=\",round(Q,2),\"ft**3/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flowrate= 0.9 ft**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.11 Page no.456"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.11\n",
+ "#What is the possible flowrate.\n",
+ "\n",
+ "#Given\n",
+ "Pa=50.0 #hp\n",
+ "D=1.0 #ft\n",
+ "l=300.0 #ft\n",
+ "f=0.02 #moody factor\n",
+ "z1=90.0 #ft\n",
+ "g=32.2 #ft/s**2, gravitational constant\n",
+ "sw=62.4 #lb/ft**3, specific heat\n",
+ "import numpy\n",
+ "#calculation\n",
+ "from scipy.optimize import fsolve\n",
+ "#energy equation between the surface of the lake and the outlet of the pipe\n",
+ "#p1=V1=p2=z2=0 V2=V\n",
+ "a=f*l/(D*2*g) #a=hl/V**2\n",
+ "b=Pa*550/(sw*math.pi*(D**2)/4) #b=ht/V\n",
+ "#from bernouli eq. f=0.109*V**3-90*V+561\n",
+ "def f(V1):\n",
+ " f=0.109*V1**3-90*V1+561\n",
+ " return(f)\n",
+ "V1=fsolve(f,10)\n",
+ "def f1(V2):\n",
+ " f1=0.109*V2**3-90*V2+561\n",
+ " return(f)\n",
+ "V2=fsolve(f,20)\n",
+ "\n",
+ "Q1=(math.pi*(D**2)/4)*V1 #(ft**3)/sec\n",
+ "Q2=(math.pi*(D**2)/4)*V2 #(ft**3)/sec\n",
+ "print \"The possible flowrates are=\",round(Q1,1),\"ft**3/s\" \"and \",round(Q2,1),\"ft**3/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The possible flowrates are= 5.166 ft**3/sand 19.537 ft**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 70
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.12 Page no.457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.12\n",
+ "#What is the diameter of the pipe \n",
+ "\n",
+ "#Given\n",
+ "roughness=0.0005 #ft\n",
+ "Q=2.0 #(ft**3)/sec\n",
+ "pd=0.5*144 #lb/ft**2 where pd=pressure drop\n",
+ "l=100 #ft\n",
+ "d=0.00238 #slugs/(ft**3)\n",
+ "vis=3.74*(10**(-7)) #lb*sec/(ft**2)\n",
+ "\n",
+ "#calculation\n",
+ "x=Q/(math.pi/4) #where x =V*(D**2)\n",
+ "#energy equation with z1=z2 and V1=V2\n",
+ "D=0.404*f**(1/5)\n",
+ "#Calculation\n",
+ "y=(l*d*(x**2)*0.5/(pd)) #where y=(D**5)/f\n",
+ "f=0.027 #using reynolds number, roughness and moody's chart\n",
+ "D=((l*d*(x**2)*0.5/(pd))*f)**(0.2)\n",
+ "\n",
+ "#Result\n",
+ "print \"The diameter of the pipe should be =\",round(D,3),\"ft\"\n",
+ "\n",
+ "#Plot\n",
+ "q=[0.1,0.5,2,3]\n",
+ "d=[0.06,0.09,0.196,0.225]\n",
+ "a=plot(q,d)\n",
+ "xlabel(\"q ft**3/s\") \n",
+ "ylabel(\"d (ft)\") \n",
+ "plt.xlim((0,3))\n",
+ "plt.ylim((0,0.25))\n",
+ " \n",
+ "show(a)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diameter of the pipe should be = 0.196 ft\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEMCAYAAADXiYGSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9cVGW+B/DPKKy/M/WlhgxJt0EZlV/KDxVRalVWWrlK\nudG1si7LZb3rupVlbbv3BtZWbNqN4tYlM1uvrnLrvq50DWdNl0khcRRJSvyB3pABRXHzByIKDM/9\n4ywjIyBnBs7MnJnP+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Pno3t27fjxo0baGhowI4dO7oMh45BMmzY\nMDQ0NNj9WbW1tWhqagIAXLp0CcXFxQgJCcGVK1fQ2tpqvSHT6dOnMXnyZKxevRpRUVEMDHI5DkkR\nAYiIiMDjs3s6AAAAuUlEQVSjjz6KsLAwjBkzBlFRUV2eZWg0GmuQjBo1CrGxsQgJCUFiYiKysrJk\nfdaxY8ewatUq63u9/PLLmDBhAj777DPMmzfP2i47OxuFhYXo168fpkyZYh2qInIVXlZL1IXMzEwM\nHToUq1atctpnpqWlIS0tDdHR0U77TCJ78AyDqBvOvnPc+vXrnfp5RPbiGQYREcnCSW8iIpKFgUFE\nRLIwMIiISBYGBhERycLAICIiWRgYREQky/8DJ45fQDgxC4EAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.13 Page no.458"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.13\n",
+ "#find the diameter of pipe.\n",
+ "#Given\n",
+ "T=60.0 #degree F\n",
+ "kvis=1.28*(10**(-5)) #(ft**2)/sec\n",
+ "l=1700.0 #ft\n",
+ "roughness=0.0005 #ft\n",
+ "Q=26.0 #(ft**3)/sec\n",
+ "n=4.0 #number of flanged 45 degree elbows\n",
+ "z1=44.0 #ft\n",
+ "\n",
+ "#Calculation\n",
+ "#V=31.1/D*2 #where V=Q/A\n",
+ "#f=0.0052*D**5-0.00135*D #eleminating V\n",
+ "\n",
+ "#calculation\n",
+ "#assume f=0.052 #(moody chart) hit and trial method\n",
+ "from scipy.optimize import fsolve\n",
+ "def f(D):\n",
+ " f=0.0052*D**5-0.00135*D-0.052\n",
+ " return(f)\n",
+ "D=fsolve(f,1)\n",
+ "\n",
+ "#result\n",
+ "print \"Pipe Diameter is \",round(D,1),\"ft\"\n",
+ "\n",
+ "#Plot\n",
+ "l=[300,1000,1700,2000]\n",
+ "d=[1.2,1.45,1.63,1.72]\n",
+ "a=plot(l,d)\n",
+ "xlabel(\"l ft\") \n",
+ "ylabel(\"d (ft)\") \n",
+ "plt.xlim((0,2000))\n",
+ "plt.ylim((0,1.8))\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DPipe Diameter is 1.6 m\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEPCAYAAABcA4N7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHUNJREFUeJzt3X1wVPW9x/HP0qS9IJTyICFkUyNJyIPkqYQgpcFFpCBz\nE1vQmeSOQkNkUm6pItVhRv8w6YwgdGyvmo6DFsXxIWJn1GgNqxN0Y0RIEMJDBTE8pCQRsKsgQbwk\nLOf+sTe7hCQnCezJbsL7NbPj7p5fDt/8Zj2f/M7v/PbYDMMwBABAN4YEuwAAQGgjKAAApggKAIAp\nggIAYIqgAACYIigAAKYsDYolS5YoIiJCKSkpXW53u92aN2+e0tPTNXnyZG3cuNHKcgAAV8Bm5TqK\n6upqDR8+XIsWLdK+ffs6bS8uLtb58+e1Zs0aud1uJSQk6OTJkwoLC7OqJABAH1k6osjOztaoUaO6\n3R4ZGakzZ85Iks6cOaMxY8YQEgAQYoJ6VF66dKluvfVWTZgwQS0tLXr99deDWQ4AoAtBncxevXq1\n0tPT9eWXX2r37t363e9+p5aWlmCWBAC4TFBHFJ988okeeeQRSVJsbKxuvPFGHTx4UJmZmR3axcXF\n6fDhw8EoEQAGrNjYWB06dOiq9xPUEUViYqIqKyslSSdPntTBgwc1ceLETu0OHz4swzB4BOjx6KOP\nBr2GwfKgL+nPUH4E6g9sS0cU+fn5qqqqktvtVnR0tEpKStTW1iZJKioq0sMPP6yCggKlpaXp4sWL\nWrdunUaPHm1lSQCAPrI0KMrKyky3jx07Vu+8846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jii5Kk\nF1980fcBy83N1WuvvabW1lYdPXpU9fX1vvOW8Otr/40fP14//vGPVVNTI8Mw9NJLL/l+5lp3/Phx\n3/M333zTd0UUfdkzwzBUWFio5ORkrVixwve+5Z9Pa+bmA6OiosKYNGmSERsba6xevTrY5QwIR44c\nMdLS0oy0tDTjpptu8vXb119/bcyePduIj4835syZY5w6dcr3M4899pgRGxtrJCQkGE6nM1ilh4y8\nvDwjMjLSCA8PN+x2u/H8889fUf99+umnxuTJk43Y2Fjj97//fTB+laC7vC83bNhg3HPPPUZKSoqR\nmppq3HHHHcaJEyd87elLc9XV1YbNZjPS0tKM9PR0Iz093di8ebPln08W3AEATIXsqScAQGggKAAA\npggKAIApggIAYIqgAACYIigAAKYICqCXhg8f3uX7Tz31lJKTk3X33XervLxcBw4c6OfKAGsRFEAv\ndff9Oc8884wqKyv18ssv680339T+/fv7uTLAWgQFcBV++9vf6siRI5o3b55Wr16td955Rw899JAy\nMjJ05MiRYJcHBAQrs4FeGjFihO97tC514403aufOnRo9erQKCgqUk5OjBQsWBKFCwBqMKIAA428v\nDDYEBRBg3KsCgw1BAQTQiBEjdObMmWCXAQQUQQH0UncjhUvfz8vL05/+9CdNmTKFyWwMGkxmAwBM\nMaIAAJgiKAAApggKAIApggIAYIqgAACYIigAAKYICgCAKYICAGDq/wCLwfuGk/zGOgAAAABJRU5E\nrkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x8554780>"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.14 Page no.462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.14\n",
+ "#Determine the floerate into and out of each reservoir.\n",
+ "\n",
+ "#Given\n",
+ "D=1 #ft\n",
+ "f=0.02\n",
+ "z1=100 #ft\n",
+ "z2=20 #ft\n",
+ "z3=0 #ft\n",
+ "l1=1000 #ft\n",
+ "l2=500 #ft\n",
+ "l3=400 #ft\n",
+ "#assuming fluid flows into B\n",
+ "#applying energy equation bwtween (1 and 3) and (1 and 2) and using the relation V1=V2+V3\n",
+ "\n",
+ "#Calculation\n",
+ "from scipy.optimize import fsolve\n",
+ "import math\n",
+ "#V1+V2=V3 #from eq of continuity ,because diameter are same\n",
+ "#V1**2+0.4*V3**2=322 #from energy eq..........(1)\n",
+ "#0.5*V2**2+0.4*V3**2=64.4 for fluid flowing B to c.........(2)\n",
+ "# V1**2+0.5*V2**2=258 #...............(3)\n",
+ "#From b and bernouli eq. f=V**4-460*V**2+3748\n",
+ "def f(V2):\n",
+ " f1=V2**4-460*V2**2+3748\n",
+ " return(f1)\n",
+ "V2=fsolve(f,2)\n",
+ "V1=math.sqrt(258-0.5*V2**2) #from eq 3\n",
+ "A=(math.pi/4*(D**2)) # ft**2, area\n",
+ "Q1=V1*A\n",
+ "Q2=V2*A\n",
+ "Q3=Q1-Q2\n",
+ "print \"Flow out of A reservoir =\",round(Q1,1), \"(ft**3)/sec\"\n",
+ "print \"Flow into B reservoir =\",round(Q2,2), \"(ft**3)/sec\"\n",
+ "print \"Flow into C reservoir =\" ,round(Q3,1),\"(ft**3)/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flow out of A reservoir = 12.5 (ft**3)/sec\n",
+ "Flow into B reservoir = 2.26 (ft**3)/sec\n",
+ "Flow into C reservoir = 10.3 (ft**3)/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.15 Page no.467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 8.15\n",
+ "#Find the diameter of nozzle.\n",
+ "#Given\n",
+ "D=60.0 #mm\n",
+ "pdiff=4 #kPa\n",
+ "Q=0.003 #(m**3)/sec\n",
+ "d=789 #kg/(m**3)\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "vis=1.19*(10**(-3)) #N*sec/(m**2)\n",
+ "Re=d*4*Q/(math.pi*D*vis)\n",
+ "#assuming B=dia/D=0.577, where dia=diameter of nozzle, and obtaining Cn from Re as 0.972\n",
+ "Cn=0.972\n",
+ "B=0.577\n",
+ "dia=((4*Q/(Cn*math.pi))/((2*pdiff*1000/(d*(1-(B**4))))**0.5))**0.5\n",
+ "\n",
+ "#result\n",
+ "print \"Diameter of the nozzle=\",round(dia*1000,1),\"mm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter of the nozzle= 34.1 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/Ch_9.ipynb b/Fundamentals_of_Fluid_Mechanics/Ch_9.ipynb
new file mode 100644
index 00000000..d49580cc
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/Ch_9.ipynb
@@ -0,0 +1,555 @@
+{
+ "metadata": {
+ "name": "Ch 9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9:Flow over immersed bodies"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no.487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.1\n",
+ "#Determine the lift and drag on the plate.\n",
+ "\n",
+ "#Given\n",
+ "U=25.0 #ft/sec\n",
+ "p=0 #gage\n",
+ "b=10.0 #ft\n",
+ "t=1.24*(10**-3) #where t=stress*(x**0.5)\n",
+ "a=0.744 #where a=p/(1-((y**2)/4))\n",
+ "p1=-0.893 #lb/(ft**2)\n",
+ "from scipy import integrate\n",
+ "def f(x):\n",
+ " return(2*t*b/(x**0.5))\n",
+ "drag1=integrate.quad(f,0.0,4.0)\n",
+ "print \"The drag when plate is parallel to the upstream flow=\",drag1[0],\"lb\"\n",
+ "\n",
+ "def f1(y):\n",
+ " return((((a*(1-((y**2)/4))))-p1)*b)\n",
+ "drag2=integrate.quad(f1,-2.0,2.0)\n",
+ "\n",
+ "#result\n",
+ "print \"The drag when plate is perpendicular to the upstream flow=\",drag2[0],\"lb\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drag when plate is parallel to the upstream flow= 0.0992 lb\n",
+ "The drag when plate is perpendicular to the upstream flow= 55.56 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page no.508"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.5\n",
+ "#At what location boundary layer become turbulent\n",
+ "#and how thich it is formed if the fluid is \n",
+ "#(a)water (b) air (c) glycerin\n",
+ "\n",
+ "#Given\n",
+ "U=10.0 #ft/sec\n",
+ "Twater=60.0 #degree F\n",
+ "Tglycerin=68.0 #degree F\n",
+ "kviswater=1.21*(10**-5) #(ft**2)/sec\n",
+ "kvisair=1.57*(10**-4) #(ft**2)/sec\n",
+ "kvisglycerin=1.28*(10**-2) #(ft**2)/sec\n",
+ "Re=5*(10**5) #assumption\n",
+ "\n",
+ "#calculation\n",
+ "xcrwater=kviswater*Re/U #ft\n",
+ "xcrair=kvisair*Re/U #ft\n",
+ "xcrglycerin=kvisglycerin*Re/U #ft\n",
+ "btwater=5*(kviswater*xcrwater/U)**0.5 #ft where bt=thickness of boundary layer\n",
+ "btair=5*(kvisair*xcrair/U)**0.5 #ft\n",
+ "btglycerin=5*(kvisglycerin*xcrglycerin/U)**0.5 #ft\n",
+ "\n",
+ "#result\n",
+ "print \"a)WATER\"\n",
+ "print \"location at which boundary layer becomes turbulent=\",round(xcrwater,2),\"ft\"\n",
+ "print \"Thickness of the boundary layer=\",round(btwater,5),\"ft\"\n",
+ "print \"b)AIR\"\n",
+ "print \"location at which boundary layer becomes turbulent=\",round(xcrair,2),\"ft\"\n",
+ "print \"Thickness of the boundary layer=\",round(btair,3),\"ft\"\n",
+ "print \"c)GLYCERIN\"\n",
+ "print \"location at which boundary layer becomes turbulent=\",round(xcrglycerin,2),\"ft\"\n",
+ "print \"Thickness of the boundary layer=\",round(btglycerin,2),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)WATER\n",
+ "location at which boundary layer becomes turbulent= 0.61 ft\n",
+ "Thickness of the boundary layer= 0.00428 ft\n",
+ "b)AIR\n",
+ "location at which boundary layer becomes turbulent= 7.85 ft\n",
+ "Thickness of the boundary layer= 0.056 ft\n",
+ "c)GLYCERIN\n",
+ "location at which boundary layer becomes turbulent= 640.0 ft\n",
+ "Thickness of the boundary layer= 4.53 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page no.512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.7\n",
+ "#Find the drag force.\n",
+ "\n",
+ "#given\n",
+ "T=70.0 #degree F\n",
+ "U1=0.0 #ft/sec\n",
+ "U2=30.0 #ft/sec\n",
+ "l=4.0 #ft\n",
+ "b=0.5 #ft\n",
+ "d=1.94\n",
+ "vis=2.04*(10**(-5))\n",
+ "x=d*l/vis\n",
+ "U=10.0 #ft/s U1 < U < U2\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "Re=d*l*U/(vis) #Reynold no.\n",
+ "#but we take Re approximately =3800000\n",
+ "Re_=3.8*10**6\n",
+ "Cd=0.455/((math.log10(Re_))**2.58)-(1700.0/Re_)\n",
+ "D=d*U**2*Cd\n",
+ "print \"The Drag is \",round(D,3),\"lb\"\n",
+ "\n",
+ "#Plot\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "U=[0,3,8,20,30]\n",
+ "Df=[0,0.1,0.598,2.4,5]\n",
+ "xlabel(\"U (ft/s)\") \n",
+ "ylabel(\"Df (lb)\") \n",
+ "plt.xlim((0,30))\n",
+ "plt.ylim((0,5))\n",
+ "a=plot(U,Df)\n",
+ "\n",
+ "U1=[0,1,1.5,3,5,8,15,30]\n",
+ "Df1=[4,4,3,1.5,1,0.598,0.4,0.3]\n",
+ "ax.annotate('Entire boundary layer laminar', xy=(0.5, 4), xytext=(3,4.2),\n",
+ " arrowprops=dict(facecolor='black', shrink=0.001),\n",
+ " )\n",
+ "xlabel(\"U (ft/s)\") \n",
+ "ylabel(\"Df (lb)\") \n",
+ "plt.xlim((0,30))\n",
+ "plt.ylim((0,5))\n",
+ "\n",
+ "a=plot(U1,Df1,linestyle='--')\n",
+ "plt.text(20,2.8,'Df')\n",
+ "plt.text(3,2.5,'Xcf')\n",
+ "\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Drag is 0.597 lb\n"
+ ]
+ },
+ {
+ "output_type": "display_data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p06fTrl072rdvz+uvvw5AjRo1qFu3LidOnNDtnIQoYLbFS4SwNnv3\n7qVDhw4A+Pn5MXPmTGJjY5k/fz4XL17kxIkTHDlyxLj9li1bGDx4MDdu3GDdunXEx8cDcPv2beM2\ngYGB7N69m3bt2lXuyQjxJ9KzFzanpJLNg0o5v/32m3FOI9Bewy9457C4dw/37dtHt27dqFmzJq6u\nrowdO5a1a9cap6MFaNSoEQkJCeU4CyFMS5K9sDl169bl5s2bhb5248YN6tWr98B9703q97s5nD9/\nnqZNm+Lk5ISTkxMHDx5kyJAhbNy4kb59+xY6nrXPJilsgyR7YXPc3Nxo2LChcRrYlJQUvv/+e7p1\n63bf/Zo3b26cRRAKJ/4aNWoYJ7cDrYQTHh4OaJPd3bp1i/DwcP71r39x7Ngx43ZJSUl4eHiY4rSE\nqBCp2Qub9MUXXzBp0iSmTJkCaEMvW7Rocd99unbtaly/FArPEV63bl26du2Kj48P4eHhxMfHs2DB\nAgDS0tIYOHAg2dnZKKWYN2+e8RgHDx7kww8/NPXpCVFmMhGaEPfo3bs3y5cvL1S7/7OcnBy6dev2\nwPnRU1NTCQkJ4dChQ6YOU4gyk2QvxD02b97MTz/9xIwZMyp8rPnz51OnTh1GjBhhgsiEqBhJ9kII\nYQfkAa0QQtgBSfZCCGEHJNkLIYQdkGQvhBB2QJK9EELYAUn2QghhB/4/X5n9xhZ8YLYAAAAASUVO\nRK5CYII=\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.10 Page no.525"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.10\n",
+ "#Find the velocity of the particle through still water.\n",
+ "\n",
+ "#given\n",
+ "D=0.1 #mm\n",
+ "sg=2.3\n",
+ "vis=1.12*(10**(-3)) #N*s/(m**2)\n",
+ "#by free body diagram and assuming CD=24/Re\n",
+ "U=(sg-1)*999*9.81*((D/1000)**2)/(18*vis)\n",
+ "\n",
+ "#Result\n",
+ "print \"The velocity of the particle through still water =\",round(U,3),\"m/s\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "D=[0,0.01,0.02,0.04,0.06,0.1]\n",
+ "U=[0,0,0.0002,0.001,0.0024,0.00632]\n",
+ "xlabel(\"D (mm)\") \n",
+ "ylabel(\"U (m/s)\") \n",
+ "plt.xlim((0,0.1))\n",
+ "plt.ylim((0,0.007))\n",
+ "\n",
+ "ax.plot([0.1], [0.00632], 'o')\n",
+ "ax.annotate('(0.1mm,0.00632m/s)', xy=(0.06,0.006))\n",
+ "a=plot(D,U)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the particle through still water = 0.006 m/s\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEMCAYAAADnBZCzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlGXeB/DvIEhFGnnCZFhBBmIAHTBY1u1NaT2QpKN5\nCr1SVCyzVXrdSmvdEq/SlcqtXnlTKsV0k1W3DIwRla3x8CbgARUPuWhQAwh5GvOQDgz3+4frJArD\nwMwzJ76f6/K6GLjvZ+77jp4fv+d+nt/IhBACRERENuLh6AEQEZF7YWAhIiKbYmAhIiKbYmAhIiKb\nYmAhIiKbYmAhIiKbkjSw5OfnIywsDCEhIUhPT2+yTWpqKkJCQqBSqVBSUtJi36SkJERHRyM6OhpB\nQUGIjo6WcgpERNRKnlId2Gg0Yvbs2SgoKIC/vz9iY2OhVquhVCpNbTQaDU6dOoWysjIUFRVh1qxZ\nKCwsNNv3H//4h6n/yy+/DF9fX6mmQEREbSBZxlJcXAyFQoHAwEB4eX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ourg6enp6YMmUK5s6da7ZPhw4dEBkZiZMnT+Lhhx+GTCZrNru482fNfX3765qaGnTt\n2hU+Pj5tnRaRJHhXGJGE1qxZg9raWsyfP9/mx/7oo49w9erVFgMckb0xsBBJyGAwYMiQIdi5c6fN\n90IGDx6MnJwcl/70T3JPDCxERGRT3LwnIiKbYmAhIiKbYmAhIiKbYmAhIiKbYmAhIiKbYmAhIiKb\n+n+kDMLwirooewAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.11 Page no.528"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.11\n",
+ "#Find the velocity of the updraft needed\n",
+ "\n",
+ "#Given\n",
+ "D=1.5 #in\n",
+ "#assuming CD=0.5 and verifying this value using value of Re\n",
+ "CD=0.5\n",
+ "dice=1.84 #slugs/(ft**3) density of ice\n",
+ "dair=2.38*(10**(-3)) #slugs/(ft**3)\n",
+ "U=(4*dice*32.2*(D/12)/(3*dair*CD))**0.5 #ft/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"The velocity of the updraft needed=\",round(U*3600/5275,1),\"mph\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the updraft needed= 62.2 mph\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.12 Page no.531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.12\n",
+ "#Determine the drag on a standerd golf ball, a smooth ball and a table tennis ball.\n",
+ "\n",
+ "#Given\n",
+ "Dg=1.69 #in.\n",
+ "Wg=0.0992 #lb\n",
+ "Ug=200 #ft/sec\n",
+ "Dt=1.5 #in.\n",
+ "Wt=0.00551 #lb\n",
+ "Ut=60 #ft/sec\n",
+ "kvis=(1.57*(10**(-4))) #(ft**2)/sec\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Reg=Ug*Dg/kvis\n",
+ "Ret=Ut*Dt/kvis\n",
+ "#the corresponding drag coefficients are calculated as\n",
+ "CDgs=0.25 #standard golf ball\n",
+ "CDgsm=0.51 #smooth golf ball\n",
+ "CDt=0.5 #table tennis ball\n",
+ "Dgs=0.5*0.00238*(Ug**2)*math.pi*((Dg/12)**2)*CDgs/4 #lb\n",
+ "Dgsm=0.5*0.00238*(Ug**2)*math.pi*((Dg/12)**2)*CDgsm/4 #lb\n",
+ "Dt=0.5*0.00238*(Ut**2)*math.pi*((Dt/12)**2)*CDt/4 #lb\n",
+ "#the corresponding decelerations are a=D/s=g*D/W\n",
+ "#deceleration relative to g=D/W\n",
+ "decgs=Dgs/Wg\n",
+ "decgsm=Dgsm/Wg\n",
+ "dect=Dt/Wt\n",
+ "\n",
+ "#result\n",
+ "print\"STANDARD GOLF BALL:\"\n",
+ "print \"The drag coefficient=\",round(Dgs,3),\"lb\"\n",
+ "print \"The deceleration relative to g=\",round(decgs,2)\n",
+ "print\"SMOOTH GOLF BALL:\"\n",
+ "print \"The drag coefficient=\",round(Dgsm,3),\"lb\"\n",
+ "print\"The deceleration relative to g=\",round(decgsm,2)\n",
+ "print\"TABLE TENNIS BALL:\"\n",
+ "print \"The drag coefficient=\",round(Dt,3),\"lb\"\n",
+ "print \"The deceleration relative to g=\",round(dect,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "STANDARD GOLF BALL:\n",
+ "The drag coefficient= 0.185 lb\n",
+ "The deceleration relative to g= 1.87\n",
+ "SMOOTH GOLF BALL:\n",
+ "The drag coefficient= 0.378 lb\n",
+ "The deceleration relative to g= 3.81\n",
+ "TABLE TENNIS BALL:\n",
+ "The drag coefficient= 0.026 lb\n",
+ "The deceleration relative to g= 4.77\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.13 Page no.533"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.13\n",
+ "#Determine the moment needed to prevent the tower from tripping\n",
+ "\n",
+ "#Given\n",
+ "U=88 #fps\n",
+ "Ds=40.0 #ft\n",
+ "Dc=15.0 #ft\n",
+ "b=50#ft\n",
+ "Res=U*Ds/(1.57*(10**(-4)))\n",
+ "Rec=U*Dc/(1.57*(10**(-4)))\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#from these values of Re drag coefficients are found as\n",
+ "CDs=0.3\n",
+ "CDc=0.7\n",
+ "#by summing moments about the base of the tower\n",
+ "Drs=0.5*0.00238*(U**2)*math.pi*(Ds**2)*CDs/4 #lb\n",
+ "Drc=0.5*0.00238*(U**2)*b*Dc*CDc #lb\n",
+ "M=(Drs*(b+(Ds/2)))+(Drc*(b/2)) #ft*lb\n",
+ "\n",
+ "#Result\n",
+ "print \"The moment needed to prevent the tower from tripping=\",round(M,3),\"lb*ft\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The moment needed to prevent the tower from tripping= 364139.221 lb*ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.15 Page no.544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.15\n",
+ "#Determine the lift coefficient and \n",
+ "#The power required by the pilot.\n",
+ "\n",
+ "\n",
+ "#Given\n",
+ "U=15 #ft/sec\n",
+ "b=96 #ft\n",
+ "c=7.5 #ft\n",
+ "W=210 #lb\n",
+ "CD=0.046\n",
+ "eff=0.8 #power train efficiency\n",
+ "d=2.38*(10**(-3)) #slugs/(ft**3)\n",
+ "#W=L\n",
+ "CL=2*W/(d*(U**2)*b*c)\n",
+ "D=0.5*d*(U**2)*b*c*CD\n",
+ "P=D*U/(eff*550) #hp\n",
+ "\n",
+ "#Result\n",
+ "print \"The lift coefficient=\",round(CL,3)\n",
+ "print \"The power required by the pilot=\",round(P,3),\"hp\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lift coefficient= 1.089\n",
+ "The power required by the pilot= 0.302 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.16 Page no.548"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 9.16\n",
+ "#Find the angular velocity.\n",
+ "\n",
+ "#Given\n",
+ "W=2.45*(10**(-2)) #N\n",
+ "D=3.8*(10**(-2)) #m\n",
+ "U=12 #m/s\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "#W=L\n",
+ "d=1.23 #kg/(m**3)\n",
+ "W=0.5*d*(U**2)*(D**2)*math.pi*CL/4\n",
+ "CL=2*W/(d*(U**2)*math.pi*(D**2)/4)\n",
+ "#using this value of CL, omega*D/(2*U)=x is found as \n",
+ "x=0.9\n",
+ "omega=2*U*x/D #rad/sec\n",
+ "angvel=omega*60/(2*math.pi) #rpm where angvel is angular velocity\n",
+ "\n",
+ "#Result\n",
+ "print \"The angular velocity=\",round(angvel,3),\"rpm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The angular velocity= 5428.021 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/README.txt b/Fundamentals_of_Fluid_Mechanics/README.txt
new file mode 100644
index 00000000..6ecc01aa
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ankit Garg
+Course: btech
+College/Institute/Organization: DCRUST
+Department/Designation: Chemical Engineering
+Book Title: Fundamentals of Fluid Mechanics
+Author: B. R. Munson, D F Young, T H Okishii
+Publisher: Wiley India, New Delhi
+Year of publication: 2007
+Isbn: 98-1253-221-8
+Edition: 5th \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/ch_1.ipynb b/Fundamentals_of_Fluid_Mechanics/ch_1.ipynb
new file mode 100644
index 00000000..5e1ad5e6
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/ch_1.ipynb
@@ -0,0 +1,414 @@
+{
+ "metadata": {
+ "name": "ch 1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page No9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.2\n",
+ "#Given\n",
+ "m=36 #kg, mass\n",
+ "acc=7.0 #ft/sq sec acceleration\n",
+ "W=m*9.81\n",
+ "\n",
+ "#F=W+m*acc\n",
+ "#1 ft= 0.3048 m\n",
+ "F=W+(m*acc*0.3048)\n",
+ "\n",
+ "#Result\n",
+ "print \"Required Force is=\",round(F,1),\"N (downward on floor)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required Force is= 430.0 N (downward on floor)\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page No12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.3\n",
+ "#Given\n",
+ "V=0.84 #ft**3, air volume\n",
+ "p=50 #psi, pressure\n",
+ "T=70 #degree farenheit, temprature\n",
+ "atmp=14.7 #psi, pressure\n",
+ "#the air density d=P/(RT)\n",
+ "#1ft**2=144 inches**2\n",
+ "\n",
+ "#calculation\n",
+ "d=((p+atmp)*144)/((1716)*(T+460))\n",
+ "print \"density of air\",round(d,3),\"slugs/ft**3\"\n",
+ "\n",
+ "#slugs/ft**3\n",
+ "#weight of air\n",
+ "W=d*32.2*V\n",
+ "#1lb=1 slug.ft/sq sec\n",
+ "\n",
+ "#result\n",
+ "print \"Weight =\",round(W,2),\"lb\"\n",
+ "\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "p=[-12,50,100]\n",
+ "f=[0,0.276,0.5]\n",
+ "xlabel(\"p (psi)\") \n",
+ "ylabel(\"f (lb)\") \n",
+ "plt.xlim((-20,100))\n",
+ "plt.ylim((0,0.5))\n",
+ "a=plot(p,f)\n",
+ "ax.plot([50], [0.276], 'o')\n",
+ "ax.annotate('(50psi,0.276lb)', xy=(50,0.25))\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "density of air 0.01 slugs/ft**3\n",
+ "Weight = 0.28 lb\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEMCAYAAAAvaXplAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYldX6//H3VklPaWmpqeCUoIATs5VpWBmpiVN9I1Mb\nzMzyV3Y6J8/pdE7St0wqz8k0y8ohs5DMjlgqqRk5iwNaZikpJOKU8xDKtH5/PLW/IqIIbB725vO6\nLq7Lvffaz76X5b6513rWWg5jjEFEROQc1ewOQEREKh8lBxERKULJQUREilByEBGRIpQcRESkCCUH\nEREpwqXJISkpCX9/f/z8/IiLiyvyenJyMtdccw3BwcEEBwfz8ssvuzIcEREpoRquunB+fj4jR45k\n6dKleHt7Ex4eTnR0NAEBAYXa3XrrrcyfP99VYYiISCm4rHJISUnB19eXFi1a4OXlRUxMDImJiUXa\naQ2eiEjl47LkkJWVRdOmTZ2PfXx8yMrKKtTG4XCwevVqOnbsSM+ePdm2bZurwhERkcvgsmElh8Nx\nyTYhISFkZmZy5ZVXsmjRIvr27cuOHTtKdS0RESmqtKMzLqscvL29yczMdD7OzMzEx8enUJs6depw\n5ZVXAtCjRw9yc3M5cuTIBa9njPHYnxdffNH2GNQ/9U39c++fgwcNd99tCAsz7NhhPVcWLksOYWFh\npKWlkZGRQU5ODgkJCURHRxdqc+DAAWcHUlJSMMZw7bXXuiokERGPtHgxBAVB27awahX4+ZX9mi4b\nVqpRowaTJk0iKiqK/Px8hg4dSkBAAFOmTAFg+PDhfPbZZ7zzzjvUqFGDK6+8ktmzZ7sqHBERj3P2\nLDz/PHz6KcyaBd26ld+1HaastUcFcDgcZS6RKrPk5GQiIyPtDsNlPLl/ntw3UP8qsx9/hIEDoWVL\neP99uO66om3K8t2p5CAi4kaMgffegxdegFdegWHDoLh7dsry3emyYSURESlfhw/Do49CRgasWAH+\n/q77LO2tJCLiBr7+2pp0btUK1q51bWIAVQ4iIpVaTg7885/WhPP06XDnnRXzu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GBu3b\nt3deq0ePHsyZM8d1HRQpAyUHqdJ27NjBk08+ybZt27j66quZPHnyRduvXLmSsLAw52OHw0F2djap\nqalMnjyZRx55BIDx48czefJkUlNTWblyZaFV/n+IiIhg+fLl5dshkXKi5CBVWtOmTbnpppsAGDRo\nECtXrrxo+927d9O4ceNCz91///0AdOnShRMnTnD8+HE6d+7MM888w8SJEzl69CjVq1cvcq3GjRuT\nkZFRPh0RKWdKDlKlnbszpTGmRLtyXmqarlq1aowePZqpU6eSnZ1N586d2b59+wWv40m7gIpnUXKQ\nKm337t2sXbsWgE8++YQuXbpctH3z5s3Zv39/oecSEhIAa8ipbt261KlTh507d9K2bVuee+45wsPD\nL5gc9u3bR/PmzcupJyLlS8lBqrQ2bdrw9ttvExgYyPHjxxkxYsRF299yyy1s2LCh0HO1atUiJCSE\nJ554gqlTpwIwYcIE2rdvT8eOHbniiivo0aMHULhSSUlJoWvXruXcI5HyoVtZpcrKyMigd+/efP/9\n9yV+zx+3sq5bt44rrriCbt26MX78eEJCQi7783Urq1RmqhykSrvcMX+Hw8GwYcP4+OOPy/S53333\nHb6+vkoMUmmpchARkSJUOYiISBFKDiIiUoSSg4iIFKHkICIiRSg5iIhIEUoOIiJSxP8HeWG9fzQs\n0EsAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page No18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.4\n",
+ "#Given\n",
+ "vis=0.38 #Ns/m**2, viscosity\n",
+ "sg=0.91 #specific gravity of Newtonian fluid\n",
+ "dia=25 #mm, diameter\n",
+ "vel=2.6 #m/s, velocity\n",
+ "\n",
+ "#calculating in SI units\n",
+ "#fluid density d=sg*(density of water @ 277K)\n",
+ "d=sg*1000 #kg/m**3\n",
+ "#Reynolds number Re=d*vel*dia/vis\n",
+ "Re=(d*vel*dia*10**-3)/(vis) #(kgm/sec**2)/N\n",
+ "print \"Re in SI units=\",round(Re,1)\n",
+ "\n",
+ "#calculating in BG units\n",
+ "d1=d*1.94*10**-3 #slugs/ft**3\n",
+ "vel1=vel*3.281 #ft/s\n",
+ "dia1=(dia*10**-3)*3.281 #ft\n",
+ "vis1=vis*(2.089*10**-2) #lb*s/ft**2\n",
+ "Re1=(d1*vel1*dia1)/vis1 #(slugs.ft/sec**2)/lb\n",
+ "\n",
+ "#result\n",
+ "print \"Re in Bg units=\",round(Re1,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Re in SI units= 155.7\n",
+ "Re in Bg units= 155.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page No19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.5\n",
+ "#Given\n",
+ "vis=0.04 #lb*sec/ft**2 , viscosity\n",
+ "vel=2 #ft/sec, velocity\n",
+ "h=0.2 #inches, height\n",
+ "\n",
+ "#given\n",
+ "#u=(3*vel/2)*(1-(y/h)**2)\n",
+ "#shearing stress t=vis*(du/dy)\n",
+ "#(du/dy)=-(3*vel*y/h)\n",
+ "#along the bottom of the wall y=-h\n",
+ "#(du/dy)=(3*vel/h)\n",
+ "\n",
+ "#Calculation\n",
+ "t=vis*(3*vel/(h/12)) #lb/ft**2\n",
+ "print \"shaering stress t on bottom wall=\",round(t,3),\"lb/ft**2\"\n",
+ "#along the midplane y=0\n",
+ "#(du/dy)=0\n",
+ "t1=0 #lb/ft**2\n",
+ "\n",
+ "#result\n",
+ "print \"shearing stress t on midplane=\",round(t1,3),\"lb/ft**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "shaering stress t on bottom wall= 14.4 lb/ft**2\n",
+ "shearing stress t on midplane= 0.0 lb/ft**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page No 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.6\n",
+ "#Given\n",
+ "p1=14.7 #psi(abs), pressure at inlet\n",
+ "V1=1 #ft**3, velocity at inlet\n",
+ "V2=0.5 #ft**3, outlet velocityx\n",
+ "#for isentropic compression, (p1(d1**k))=(p2/(d2**k))\n",
+ "#volume*density=constant(mass)\n",
+ "ratd=V1/V2\n",
+ "\n",
+ "#Calculation\n",
+ "p2=((ratd)**1.66)*p1 #psi(abs)\n",
+ "\n",
+ "#Result\n",
+ "print \"final pressure p2=\",round(p2,3),\"psi(abs)\"\n",
+ "\n",
+ "#plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "v=[0.1,0.2,0.5,1]\n",
+ "p=[900,200,46.5,10]\n",
+ "xlabel(\"Vf/Vi\") \n",
+ "ylabel(\"p (psi)\") \n",
+ "plt.xlim((0,1))\n",
+ "plt.ylim((0,1000))\n",
+ "a=plot(v,p)\n",
+ "\n",
+ "\n",
+ "ax.plot([0.5], [46.5], 'o')\n",
+ "ax.annotate('(0.5,46.5 psi)', xy=(0.5,50))\n",
+ "\n",
+ "show(a)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "final pressure p2= 46.454 psi(abs)\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAELCAYAAADOeWEXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt0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FjR5555hnOnDkDeH/eDIrP4xARkcARNLeqREQkMCg4RETEIwoOERHxiIJDREQ8\nouAQ8cKQIUN4//33L3lt9uzZTJ06lZdeeom+ffvyxBNPAHDw4EGGDh1Kly5dLlsnMG3aNGbNmsXC\nhQt58803/Va/yLXQU1UiXnjttdf4v//7P/Ly8tyv9evXj1mzZnHfffdRUVFB48aNAXjjjTf47rvv\nOHLkCE2bNuUPf/gDAE6nk1tuuYWioiI6duxoynGIeENXHCJeGDt2LKtWreLs2bMA7N+/n6+//poX\nX3yRw4cPk5iYyLvvvgu4+kPdfffdZGZmsmTJEvd7bNq0iU6dOtGxY0dmzJjByy+/bMqxiHhKwSHi\nhdatW5OYmMjq1asBWLx4Menp6eTn5xMREcG2bdsYP348586dY9euXVitVrp160ZYWBilpaXufTIz\nMwH1VJPgouAQ8VJmZiaLFy8GYMmSJe4QuJjD4bik1cX5fc6dO8fy5csZP3683+oVqS8KDhEvjRo1\nig0bNrBt2zZOnjxJfHz8ZdusWbOGESNGuL/OyMjgnXfeYf369fTo0SOkPx9EQpeCQ8RLLVq0YPDg\nwUycOJH777+/xm0++OAD94cmAURFRXHjjTfy5JNPXnEfkUCn4BC5BpmZmXzyySeX3KY6P19x+PBh\nmjVrxnXXXXfZPrt27WLMmDGXvK55DgkWehxXxEcWLVrEgQMHePzxx80uRaReKThERMQjulUlIiIe\nUXCIiIhHFBwiIuIRBYeIiHhEwSEiIh5RcIiIiEf+P2S92/Nie9kJAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page No 23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.7\n",
+ "#Given\n",
+ "s=550 #(mph), \n",
+ "h=35000 #ft\n",
+ "T=-66 #degrees farenheit, temprature\n",
+ "k=1.40 #W/mK, thermal conductivity\n",
+ "\n",
+ "#calculation\n",
+ "#speed of sound c=(kRT)**0.5\n",
+ "c=((k*1716*(T+460)))**0.5 #ft/s\n",
+ "\n",
+ "#result\n",
+ "print \"speed of sound c=\",round(c,3),\"ft/s\"\n",
+ "#speed of sound V=(s m/hour)*(5280 ft/m)/(3600 s/hour)\n",
+ "V=s*5280/3600 #ft/s\n",
+ "print(\"ft/s\",V,\"air speed =\")\n",
+ "ratio=V/c #Mach number\n",
+ "print \"ratio of V/c = Mach Number=\",round(ratio,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "speed of sound c= 972.906 ft/s\n",
+ "('ft/s', 806, 'air speed =')\n",
+ "ratio of V/c = Mach Number= 0.83\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page No 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 1.8\n",
+ "#calculate minimum required tube diameter.\n",
+ "#Given\n",
+ "T=20 #degree celcius, Temprature\n",
+ "h=1 #mm, height\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "\n",
+ "#h=(2*st*math.cos(x)/(sw*R))\n",
+ "#where st= nsurface tension, x= angle of contact, sw= specific weight of liquid, R= tube radius\n",
+ "st= 0.0728 #N/m\n",
+ "sw=9.789 #kN/m**3\n",
+ "x=0\n",
+ "R=(2*st*math.cos(x))/(sw*1000*h/1000) #m\n",
+ "D=2*R*1000 #mm\n",
+ "print \"minimum required tube diameter= \",round(D,1),\"mm\"\n",
+ "\n",
+ "#Plot\n",
+ "h=[0.3,0.5,1,2]\n",
+ "D=[100,50,29.8,18]\n",
+ "xlabel(\"h (mm)\") \n",
+ "ylabel(\"D (mm)\") \n",
+ "plt.xlim((0,2))\n",
+ "plt.ylim((0,100))\n",
+ "a=plot(h,D)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum required tube diameter= 29.7 mm\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEMCAYAAADeYiHoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHIhJREFUeJzt3X9wVOW9x/FPQggKRIEENgqU2ISYXwQIAhd7lUUaGLiG\npmhRtJqCaKdcVLx2ItNbNdx6JWg7XCu19tq5TGq9IuqIQJEBRxYVQfRCiZCEIBAJmCxgEuWHkB/s\n/eM0kYQT2E1295zdfb9mMobN7p4vZ475cJ7n+T4b5fF4PAIAoINoqwsAANgTAQEAMEVAAABMERAA\nAFMEBADAFAEBADAVsICYO3euHA6HRowY0fZYXV2dcnNzlZqaqilTpqihoaHtZ0uWLNHw4cOVlpam\njRs3BqosAICXAhYQc+bM0YYNG9o9VlxcrNzcXFVWVmry5MkqLi6WJJWVlem1115TWVmZNmzYoPnz\n5+v8+fOBKg0A4IWABcRNN92k/v37t3tszZo1KigokCQVFBRo9erVkqS3335bs2fPVs+ePZWUlKSU\nlBTt2LEjUKUBALwQ1DkIt9sth8MhSXI4HHK73ZKkL7/8UkOGDGl73pAhQ3T06NFglgYA6CDGqgNH\nRUUpKirqkj/35jEAwOV1ZVeloN5BOBwO1dbWSpJqamo0aNAgSdLgwYNVXV3d9rwjR45o8ODBpu/h\n8XhC/mv9eo/++Z+tr+PJJ5+0vIZw+uJ8cj7t+tVVQQ2IGTNmqKSkRJJUUlKi/Pz8tsdXrlypxsZG\nHTp0SPv379e4ceOCWVpQTZoklZZKX31ldSUA0LmABcTs2bN14403at++fRo6dKhWrFihRYsWadOm\nTUpNTdV7772nRYsWSZIyMjI0a9YsZWRkaNq0aXrhhRfCejjpiiukW26R1q+3uhIA6FyUpzv3H0EW\nFRXVrdslO/mf/5E2bJBWrbKuBpfLJafTaV0BYYbz6V+c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wB4GI1qtXr7bve/Tooebm5su+puPm\nA7GxsZKk6Ojodu8XHR3d9n49e/Zs9/iFr7nwmB6Ph91fYRsEBOCDYcOGqba2NmDvX1NTo2HDhgXs\n/QFfEBCIaB3/tX65f73/4Ac/0M6dOzt9TWevv9RxLvx+x44duvnmmy9dNBAkbNYH+OiWW27RK6+8\nctFchD84nU6tWrVKgwYN8vt7A77iDgLw0S9/+Uu9+OKLfn/f0tJSpaSkEA6wDe4gAACmuIMAAJgi\nIAAApggIAIApAgIAYIqAAACYIiAAAKb+H6kHdza7C9VRAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/ch_10.ipynb b/Fundamentals_of_Fluid_Mechanics/ch_10.ipynb
new file mode 100644
index 00000000..8a36a3c6
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/ch_10.ipynb
@@ -0,0 +1,395 @@
+{
+ "metadata": {
+ "name": "ch 10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10:Open Channel Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page no.572"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.2\n",
+ "#Determine the surface elimanation downstrean of ramp.\n",
+ "\n",
+ "#Given\n",
+ "z2=0.5 #ft\n",
+ "q=5.75 #(ft**2)/sec\n",
+ "y1=2.3 #ft\n",
+ "z1=0 #ft\n",
+ "V1=2.5 #ft/sec\n",
+ "\n",
+ "#calculation\n",
+ "#bernoulli equation\n",
+ "a=y1+((V1**2)/(2*32.2))+z1-z2 #ft where a=y2+((V**2)/(2*g))\n",
+ "#continuity equation\n",
+ "from scipy.optimize import fsolve\n",
+ "#Calculation\n",
+ "b=(y1*V1) #(ft**2/sec) where b=(y2*V2)\n",
+ "#From b and bernouli eq. f=y**3-1.90*y**2+0.513\n",
+ "def f(y):\n",
+ " f1=y**3-1.90*y**2+0.513\n",
+ " return(f1)\n",
+ "y=fsolve(f,2)\n",
+ "L=y+z2\n",
+ "print \"Surface Elevation is \",round(L,2),\"ft\"\n",
+ "\n",
+ "#Plot\n",
+ "E=[3,2,1.51,2.4,3]\n",
+ "Y=[2.9,1.8,1.01,0.5,0.4]\n",
+ "a=plot(E,Y)\n",
+ "xlabel(\"E ft\") \n",
+ "ylabel(\"Y (ft)\") \n",
+ "plt.xlim((0,4))\n",
+ "plt.ylim((0,4))\n",
+ "show(a)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Surface Elevation is 2.23 ft\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEKCAYAAAAW8vJGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH8FJREFUeJzt3X9YVHW+B/D3IOzaAKF0Ex8HdnWDDEphsJrbTXPUayyo\nRP54ilJZsY14UrIf2w/v3sIyy9T1seuz+KONIlNKtq6jDRiV448IWXXcxw27YELOgJdifTDoYozM\nuX+cnDjyaxjmzDkzvF/PM4/z4+vx0zedN9/vOd/v0QiCIICIiOgnQUoXQERE6sJgICIiCQY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JBgMREQkwWAgIiIJBgMREUkwGIiISOL/Ac1RMOrb\n1MD8AAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page no.579"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.3\n",
+ "#Find the flowrate and Froude NO.\n",
+ "\n",
+ "#Given\n",
+ "y=5.0 #ft\n",
+ "angle=40.0 #degree\n",
+ "l=12.0 #ft\n",
+ "rate=1.4 #ft per 1000 ft of length\n",
+ "K=1.49\n",
+ "\n",
+ "#Calculation \n",
+ "import math\n",
+ "A=(l*y)+(y*y/math.tan(angle*math.pi/180)) #ft\n",
+ "P=(l+(2*y/math.sin(angle*math.pi/180))) #ft\n",
+ "Rh=A/P\n",
+ "S0=rate/10**3\n",
+ "x=K*(A)*(Rh**(0.666667))*(S0**(0.5)) #where Rh=Q*n\n",
+ "n=0.012\n",
+ "Q=x/n #cfs\n",
+ "\n",
+ "#Result\n",
+ "print \"The flowrate=\",round(Q,0),\"cfs\"\n",
+ "V=Q/A #ft/sec\n",
+ "Fr=V/(32.2*y)**(0.5)\n",
+ "print \"Froude number=\",round(Fr,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flowrate= 917.0 cfs\n",
+ "Froude number= 0.8\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.4 Page no.580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.4\n",
+ "#Find the depth of flow.\n",
+ "\n",
+ "#Given\n",
+ "y=5 #ft\n",
+ "angle=40 #degree\n",
+ "l=12 #ft\n",
+ "rate=1.4 #ft per 1000 ft of length\n",
+ "Q=10 #m**3/sec\n",
+ "bw=l*1/3.281 #m where bw=bottom width \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "from scipy.optimize import fsolve\n",
+ "#A=(l*y)+(y*y/math.tan(angle*math.pi/180)) ft**2\n",
+ "#A=1.19*y**2+3.66*y area interms of distance depth y, 1.19,3.66 are constant\n",
+ "#Rh=1.19*y**2+3.66*y/((3.11*y+3.66)**2)\n",
+ "#P=bw(2*y/math.sin(angle*math.pi/180)) m\n",
+ "#Rh=A/P\n",
+ "#Q=10=k*A*Rh**2/3*So**0.5/(n)\n",
+ "n=0.03 #From table 10.1\n",
+ "\n",
+ "def f(y):\n",
+ " f1=((1.19*y**2+3.66*y)**5-515*(3.11*y+3.66)**2) #digits used are costants which is used in the area equation.\n",
+ " return(f1)\n",
+ "y=fsolve(f,2)\n",
+ "\n",
+ "#Result\n",
+ "print \"The depth of the flow=\",round(y,1),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The depth of the flow= 1.5 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.7 Page no.583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.7\n",
+ "#Find the flowrate at given value of y\n",
+ "\n",
+ "#Given\n",
+ "S0=0.002\n",
+ "n1=0.02\n",
+ "z1=0.6 #ft\n",
+ "n2=0.015\n",
+ "n3=0.03\n",
+ "z2=0.8 #ft\n",
+ "#length of section 1 ,2,3\n",
+ "l1=3.0 #ft\n",
+ "l2=2.0 #ft\n",
+ "l3=3.0 #ft\n",
+ "#Area\n",
+ "A1=l1*(z1) #ft**2\n",
+ "A2=l2*(y) #ft**2\n",
+ "A3=l3*(z1) #ft**2\n",
+ "#Pressure head\n",
+ "P1=l1+z1 #ft\n",
+ "P2=l2+(2*z2) #ft\n",
+ "P3=l3+z1 #ft\n",
+ "Rh1=A1/P1 #ft\n",
+ "Rh2=A2/P2 #ft\n",
+ "Rh3=A3/P3 #ft\n",
+ "y=z1+z2 #ft\n",
+ "K=1.49\n",
+ "\n",
+ "#Calculation\n",
+ "Q=K*(S0**(0.5))*((A1*(Rh1**(0.667))/n1)+(A3*(Rh3**(0.667))/n3)+(A2*(Rh2**(0.667))/n2)) #(ft**3)/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"The flowrate=\",round(Q,1),\"ft**3/s\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flowrate= 16.8 ft**3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.8 Page no.584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.8\n",
+ "#Find the aspect ratio for the best hydrolic section.\n",
+ "\n",
+ "#A=b*y\n",
+ "#p=b+2*y\n",
+ "#Q=K*A*(Rh**(2/3))*(S0**0.5)/n\n",
+ "#dA/dy=0\n",
+ "#from the above, we get\n",
+ "aspratio=2 #asp ratio=aspect ratio=b/y\n",
+ "\n",
+ "#result\n",
+ "print \"The aspect ratio=\",aspratio,\":1\"\n",
+ "\n",
+ "#Plot\n",
+ "b=[0.5,1.2,2,5]\n",
+ "q=[0.85,0.98,1,0.93]\n",
+ "a=plot(b,q)\n",
+ "xlabel(\"b/y \") \n",
+ "ylabel(\"q/qmax\") \n",
+ "plt.xlim((0,5))\n",
+ "plt.ylim((0.80,1.05))\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The aspect ratio= 2 :1\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVB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ysjFmzZrFnzx66d+/OH/7wBwBKS0tJTk6mQ4cOTJw4kb/85S8AFBYWkpycTK9evaws\nW6RFCgeRNoiMjOS2224DYOLEiWzZsgVoekpp6tSpDc3eli1bxpQpU6wpVuQaKBxE2uDSRm4ul6vh\n8YYNGxoamtntdkJDQ9m4cSM7duzQPIT4BIWDSBt8+eWXbN++HYBVq1aRnp7OiRMnqK+vb3L71mnT\npjFx4kQefvjhgO8MKr5B4SBynWw2G/Hx8SxevJh+/fpx4sQJZsyYwYYNGxg2bFiTbUePHk1tba1O\nKYnPCLI6ivU/AAAAbklEQVS6ABFf9b3vfY+9e/eafr5+/Xoee+yxJj/btWsXycnJ9O3bt73KE2kT\n3c9BxMN+85vf8Kc//YlVq1Zx++23W12OSKsoHERExERzDiIiYqJwEBERE4WDiIiYKBxERMRE4SAi\nIiYKBxERMfl/I7iv/evMN9AAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x8481438>"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.9 Page no.593"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.9\n",
+ "#Determine the depth after the jump\n",
+ "#The Froude no. before and after the jump.\n",
+ "#and the power dissipated within the pump.\n",
+ "\n",
+ "#Given\n",
+ "w=100 #ft\n",
+ "y1=0.6 #ft\n",
+ "V1=18 #ft/sec\n",
+ "Fr1=V1/(32.2*y1)**0.5\n",
+ "print \"The Froude number before the jump=\",round(Fr1,2)\n",
+ "yratio=0.5*(-1+(1+(8*(Fr1**2)))**0.5) #where yratio=y2/y1\n",
+ "y2=y1*yratio #ft\n",
+ "print \"The depth after the jump=\",round(y2,2),\"ft\"\n",
+ "#Q1=Q2, hence\n",
+ "V2=(y1*V1)/y2 #ft/sec\n",
+ "Fr2=V2/(32.2*y2)**0.5\n",
+ "print \"The froude number after the jump=\",round(Fr2,2)\n",
+ "Q=w*y1*V1#(ft**3)/sec\n",
+ "hL=(y1+(V1*V1/(32.2*2)))-(y2+(V2*V2/(2*32.2))) #ft\n",
+ "Pd=62.4*hL*Q/550 #hp\n",
+ "print \"Power dissipated within the jump=\",round(Pd,3),\"hp\"\n",
+ "\n",
+ "#Plot\n",
+ "b=[1.54,1.2,0.8,0.6,0.4]\n",
+ "P=[0,10,80,277,900]\n",
+ "a=plot(b,P)\n",
+ "xlabel(\"b (ft)\") \n",
+ "ylabel(\"P (hp)\") \n",
+ "plt.xlim((0,1.6))\n",
+ "plt.ylim((0,1000))\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Froude number before the jump= 4.1\n",
+ "The depth after the jump= 3.19 ft\n",
+ "The froude number after the jump= 0.33\n",
+ "Power dissipated within the jump= 277.539 hp\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEMCAYAAADTfFGvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1UVXWixvHvQbBMxdQS9KCSguLxBTQlLfVihiUFY6UU\nvVGaTdnMlGu6TbeZu9JmraRp1p1xaryrZdawelmo41zhpnLNmdDyDcvURkzJQAGBxpR8LQT2/WPn\nCVTkHODsfc7h+azFGoV9js+22edx//bvt7fDMAwDERERD4XYHUBERAKLikNERLyi4hAREa+oOERE\nxCsqDhER8YqKQ0REvOKz4pg9ezYRERGMHDnS/b1jx46RnJzMkCFDmDZtGjU1Ne6fLVq0iNjYWOLi\n4li/fr37+59++ikjR44kNjaWp556yldxRUTEQz4rjkceeYT8/Pwm38vKyiI5OZkDBw4wdepUsrKy\nACgqKmL58uUUFRWRn5/PvHnzOL+85IknnmDZsmUUFxdTXFx80XuKiIi1fFYckyZNomfPnk2+l5eX\nR2ZmJgCZmZm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1FUsSfqThEWqGuro4HHngA\nl8vFrFmzOHv27EXb5ObmcssttwDwxhtvsHLlSv7zP/+T++67jxdeeIHly5czevRoVq5cicPhYMKE\nCaxfv97qXRHxmopDpBX279/Pk08+SVFREeHh4SxZsuSibTZv3uy+ncijjz5KWloav//973nvvfd4\n8cUXuffee/nss8+YNWsWAImJiWzatMnS/RBpDRWHSCv079+fCRMmAPDAAw/w8ccfX7TNoUOH6Nu3\nb5PvnV9va1zihnf9+vWjtLTUN4FF2pGKQ6QVGt8x1jCMZu8g29DQ0OzrLrWtP9+JVuQ8FYdIKxw+\nfJht27YB5kNwJk2adNE2AwcOpKqqqsn3zp9lhIeHc/LkySY/q6ysZODAgT5KLNJ+VBwiXnI4HAwd\nOpQ///nPuFwuvv32W/fN9hqbOHEin3zyyUWvBZgyZQpFRUXui+NgPkVw8uTJvt8BkTbSTQ5FfOTU\nqVNMmTKFHTt2tLhtQ0MDY8aM4ZNPPrH8cbIi3tIZh4iPdOvWjSlTpvDhhx+2uO3777/PzJkzVRoS\nEHTGISIiXtEZh4iIeEXFISIiXlFxiIiIV1QcIiLiFRWHiIh4RcUhIiJe+X/W0eKMLsKjQwAAAABJ\nRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/ch_11.ipynb b/Fundamentals_of_Fluid_Mechanics/ch_11.ipynb
new file mode 100644
index 00000000..970f9f37
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/ch_11.ipynb
@@ -0,0 +1,1038 @@
+{
+ "metadata": {
+ "name": "ch 11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11:Compressible flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1 page no 617."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.1\n",
+ "#find the change in internal energy ,enthalpy and density between point 1 and 2\n",
+ "#Given\n",
+ "D=4.0 #in\n",
+ "T1=540.0 #degree R\n",
+ "p1=100.0 #psia\n",
+ "T2=453.0 #degree R\n",
+ "p2=18.4 #psia\n",
+ "k=1.4\n",
+ "R=1716/32.174 #ft*lb/(lbm*(degree R))\n",
+ "cv=R/(k-1) #ft*lb/(lbm*(degree R))\n",
+ "udiff=cv*(T2-T1) #ft*lb/lbm change in internal energy\n",
+ "\n",
+ "#Result\n",
+ "print \"a)The change in internal energy between (1) and (2)=\",round(udiff,2),\"ft*lb/lbm\"\n",
+ "cp=k*round(cv,0) #ft*lb/(lbm*(degree R))\n",
+ "hdiff=cp*(T2-T1) #ft*lb/lbm change in enthalpy\n",
+ "print \"b)The change in enthalpy between (1) and (2)=\",round(hdiff,0),\"ft*lb/lbm\"\n",
+ "ddiff=(1/R)*((p2*144/T2)-(p1*144/T1)) #lbm/(ft**3) change in density\n",
+ "\n",
+ "#Result\n",
+ "print \"The change in density betwenn (1) and (2)=\",round(ddiff,3),\"ft*lb/lbm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)The change in internal energy between (1) and (2)= -11600.36 ft*lb/lbm\n",
+ "b)The change in enthalpl energy between (1) and (2)= -16199.0 ft*lb/lbm\n",
+ "The change in density betwenn (1) and (2)= -0.39 ft*lb/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2 page no.619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 11.2\n",
+ "#Find change in entropy between point 1 and 2.\n",
+ "#Given\n",
+ "D=4.0 #in\n",
+ "T1=540.0 #degree R\n",
+ "p1=100.0 #psia\n",
+ "T2=453.0 #degree R\n",
+ "p2=18.4 #psia\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "dratio=(p1/T1)*(T2/p2)\n",
+ "sdif=(cv*(math.log(T2/T1)))+(R*(math.log(dratio)))#ft*lb/lbm*(degree R) change in entropy\n",
+ "\n",
+ "#Result\n",
+ "print \"The change in entropy between (1) and (2)=\",round(sdif,1),\"ft*lb/lbm*(degree R)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy between (1) and (2)= 57.49 ft*lb/lbm*(degree R)\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.3 page no.623"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.3\n",
+ "#Find the speed of sound for air at 0 degree C\n",
+ "\n",
+ "#Given\n",
+ "T=0 #degree C\n",
+ "R=286.9 #J/(kg*K)\n",
+ "k=1.401\n",
+ "c=(R*(T+273.15)*k)**0.5 #m/s\n",
+ "\n",
+ "#Result\n",
+ "print \"The speed of sound for air at 0 degree C =\",round(c,1),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of sound for air at 0 degree C = 331.35 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.4 page no.628"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.4\n",
+ "#determine the number of seconds to wait after the plane passes over-head before it is heard.\n",
+ "\n",
+ "#given\n",
+ "z=1000 #m\n",
+ "Ma=1.5\n",
+ "T=20 #degree C\n",
+ "#alpha=atan(z/x), x=V*t,and Ma=(1/sin(alpha)) where alpha is the angle of the Mach cone\n",
+ "#V=Ma*c\n",
+ "#calculation\n",
+ "import math\n",
+ "c=343.3 #m/s found from the value of temperature\n",
+ "V=Ma*c #m/sec\n",
+ "t=z/(Ma*c*math.tan(math.asin(1/Ma))) #sec\n",
+ "print\"The number of seconds to wait after the plane passes over-head before it is heard=\",round(t,2),\"s\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "Ma=[1,1.1,1.3,1.5,2,4]\n",
+ "t=[0,1.5,2,2.17,2.3,2.75]\n",
+ "xlabel(\"Ma\") \n",
+ "ylabel(\"t (s)\") \n",
+ "plt.xlim((0,4))\n",
+ "plt.ylim((0,3))\n",
+ "ax.plot([1.5], [2.17], 'o')\n",
+ "ax.annotate('(1.5,2.17s)', xy=(1.7,2.1))\n",
+ "a=plot(Ma,t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of seconds to wait after the plane passes over-head before it is heard= 2.17 s\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEKCAYAAAAW8vJGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlGX+P/D3cCgCFEQNdQYPCSmYzIAWuqCNWvkVEW21\ng5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9Jvf/AbR\n0dGIjY3FuXPn5CyVqEsYDEQOeuyxx5CWloZr167h5MmTFjeoCw8Px7Fjx1BQUIDU1FS8+uqrMlZK\n1DWKufKZSOlGjx6N4uJibNu2DdOnT7d4r6amBgsWLMD58+ehUqnMV3ATuSKOGIg6ITExES+88ILF\nNBIA/O53v8OUKVNw8uRJ7Nmzx7wWQeSKOGIg6oSFCxeiT58+GDVqlMUtmGtrazFo0CAA4LPLyeVx\nxEDkgBvxp8WAAAAATklEQVRnH6nVaixbtsy87cb2l156CStXrkR0dDRaWlp4thK5NN5Ej4iILHDE\nQEREFhgMRERkgcFAREQWGAxERGSBwUBERBYYDEREZOH/A5kK4I52RzdaAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.5 page no.635"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Example 11.5\n",
+ "# Determine The mass flowrate through the ducf the reciever pressure\n",
+ "#(a) 80kpa (b) 40 kpa\n",
+ " \n",
+ "#Given\n",
+ "A=1*(10**(-4)) #m**2\n",
+ "p1=80.0 #kPa(abs)\n",
+ "p2=40.0 #kPa(abs)\n",
+ "p0=101.0 #kPa(abs)\n",
+ "pcritical=0.528*p0 #kPa(abs)\n",
+ "k=1.4\n",
+ "#for (a) pth=p1>pcritical\n",
+ "Math1=((((p0/p1)**((k-1)/k))-1)/((k-1)/2))**(0.5) #Math=Mach number at throat\n",
+ "#dth/d0=p1/p0 dth=density at throat\n",
+ "dth1=(1.23)*(1/(1+(((k-1)/2)*(Math1**2))))**(1/(k-1)) #kg/(m**3) density at throat\n",
+ "Tth1=(288)*(1/(1+(((k-1)/2)*(Math1**2)))) #K temperature at throat\n",
+ "Vth1=Math1*(286.9*269*k)**(0.5) #m/sec\n",
+ "m1=dth1*A*Vth1 #kg/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"a) The mass flowrate through the duct=\",round(m1,4),\"kg/s\"\n",
+ "#for (b) pth=p2<pcritical, hence\n",
+ "Math2=1\n",
+ "dth2=1.23*(1/(1+(((k-1)/2)*(Math2**2))))**(1/(k-1)) #kg/(m**3) density at throat\n",
+ "Tth2=(288)*(1/(1+(((k-1)/2)*(Math2**2)))) #K temperature at throat\n",
+ "Vth2=Math2*(286.9*Tth2*k)**0.5 #m/sec\n",
+ "m2=dth2*A*Vth2 #kg/sec\n",
+ "print \"b) The mass flowrate through the duct=\",round(m2,3),\"kg/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a) The mass flowrate through the duct= 0.0201 kg/s\n",
+ "b) The mass flowrate through the duct= 0.024 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.6 page no.637"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.6\n",
+ "#Find the mass flow rate\n",
+ "\n",
+ "#Given\n",
+ "A=1*(10**(-4)) #m**2\n",
+ "p1=80 #kPa(abs)\n",
+ "p2=40 #kPa(abs)\n",
+ "\n",
+ "p0=101 #kPa(abs)\n",
+ "k=1.4\n",
+ "#for (a)\n",
+ "pratio1=p1/p0\n",
+ "#for this value of p1/p0, \n",
+ "Math1=0.59\n",
+ "Tratio1=0.94 #=Tth/T0\n",
+ "dratio1=0.85 #=dth/d0\n",
+ "Tth1=Tratio1*(288) #K\n",
+ "dth1=dratio1*(1.23) #kg/(m**3)\n",
+ "Vth1=Math1*(286.9*Tth1*k)**0.5 #m/sec\n",
+ "m1=(dth1*A*Vth1) #kg/sec\n",
+ "print \"a)The mass flowrate=\",round(m1,3),\"kg/s\"\n",
+ "#for (b)\n",
+ "Math2=1\n",
+ "Tratio2=0.83 #=Tth/T0\n",
+ "dratio2=0.64 #=dth/d0\n",
+ "Tth2=Tratio2*(288) #K\n",
+ "dth2=dratio2*(1.23) #kg/(m**3)\n",
+ "Vth2=Math2*(286.9*Tth2*k)**0.5 #m/sec\n",
+ "m2=(dth2*A*Vth2) #kg/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"b)The mass flowrate=\",round(m2,3),\"kg/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a)The mass flowrate= 0.02 kg/s\n",
+ "b)The mass flowrate= 0.024 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.7 page no.638"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.7\n",
+ "#Find the flow velocity if fluid is air\n",
+ "# if fluid is helium\n",
+ "\n",
+ "#Given\n",
+ "pratio=0.82 #ratio of static to stagnation pressure\n",
+ "T=68 #degree F\n",
+ "#for (a)\n",
+ "#for the value of pratio given Ma is calculated as\n",
+ "Ma1=0.54\n",
+ "k1=1.4\n",
+ "Tratio1=0.94 #T/T0\n",
+ "T1=Tratio1*(T+460) # degree R\n",
+ "V1=(Ma1*(53.3*T1*k1)**0.5)*(32.2**0.5) #ft/sec\n",
+ "#for (b)\n",
+ "k2=1.66\n",
+ "Ma2=((((1/pratio)**((k2-1)/k2))-1)/((k2-1)/2))**0.5\n",
+ "Tratio2=1/(1+(((k2-1)/2)*(Ma2**2))) #T/T0\n",
+ "T2=Tratio2*(T+460) #degree R\n",
+ "V2=(Ma2*(386*T2*k2)**0.5)*(32.2**0.5) #ft/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"The flow velocity if fluid is air=\",round(V1,0),\"ft/s\"\n",
+ "print \"The flow velocity if fluid is helium=\",round(V2,0),\"ft/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow velocity if fluid is air= 590.0 ft/s\n",
+ "The flow velocity if fluid is helium= 1583.0 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.11 page no.648"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exampl 11.11\n",
+ "#The corrosponding value of temperature for Fanno for downstream pressure of 7psia\n",
+ "#and entropy change .\n",
+ "\n",
+ "#Given\n",
+ "k=1.4 \n",
+ "T0=518.67 #degree R\n",
+ "T1=514.55 #degree R\n",
+ "p1=14.3 #psia\n",
+ "R=53.3 #(ft*lb)/(lbm* degree R)\n",
+ "\n",
+ "#calculation\n",
+ "from scipy.optimize import fsolve\n",
+ "import math\n",
+ "cp=R*k/(k-1) #(ft*lb/(lbm* degree R))\n",
+ "Tratio=T1/T0\n",
+ "Ma=(((1/Tratio)-1)/((k-1)/2))**0.5\n",
+ "x=(R*T1*k*32.2)**0.5 #ft/sec where x=(R*T1*k)**0.5\n",
+ "y=p1*144/(R*T1)*(Ma*x) # lbm/((ft**2)*sec) where y=d*V\n",
+ "#for p=7 psia \n",
+ "p=7 #psia\n",
+ "\n",
+ "def f(T):\n",
+ " return(6.5*10**-5*T**2+T-518.67)\n",
+ "T=fsolve(f,500)\n",
+ "sdif=(cp*math.log(T/T1))-(R*math.log(p/p1)) #(ft*lb)/(lbm* degree R)\n",
+ "\n",
+ "#Result\n",
+ "print \"The corrosponding value of temperature for Fanno for downstream pressure of 7psia=\",round(T,1),\"K\"\n",
+ "print \"The corrosponding value of entropy change for Fanno for downstream pressure of 7psia=\",round(sdif,1),\"(ft*lb)/(lbm* degree R)\"\n",
+ "#Plot\n",
+ "s=[33.6,39.8,46.3,52.6,57.3,57.9,55.5,53.0,47.0,44.2]\n",
+ "T=[502.3,496.8,488.3,474.0,447.7,432.1,394.7,378.1,347.6,335.6]\n",
+ "a=plot(s,T)\n",
+ "xlabel(\"s-s1 (ft lb/lbm R)\") \n",
+ "ylabel(\"T (R)\") \n",
+ "plt.xlim((30, 65))\n",
+ "plt.ylim((300,550))\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The corrosponding value of temperature for Fanno for downstream pressure of 7psia= 502.3 K\n",
+ "The corrosponding value of entropy change for Fanno for downstream pressure of 7psia= 33.6 (ft*lb)/(lbm* degree R)\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEPCAYAAACp/QjLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1clHW+//HXIJhZWt4AEqNCgtIY6riKtT/t0IrY6mqx\npzirppZihXtqT9Sq3eN2Ejra3XGj43bc0t1M7ZSKpoZWmGk2KpAWFVJqciOliJniDTC/P64cxZlR\nMYaZgffz8ZhHMHNdw8dvPObN97q+Nya73W5HRETkLAHeLkBERHyPwkFERJwoHERExInCQUREnCgc\nRETEicJBRESceDwcIiIi6NOnD1arlbi4OADS09Mxm81YrVasVitr1qxxHJ+RkUF0dDQxMTHk5OR4\nujwREXEh0NM/wGQykZubS8eOHes9l5aWRlpaWr1jCwsLWbJkCYWFhZSWlpKQkEBRUREBAergiIg0\npSb51HU1z87VcytWrGDMmDEEBQURERFBVFQUNputKUoUEZGzeDwcTCYTCQkJDBgwgFdffdXx/Ny5\nc+nbty+TJ0+mqqoKgLKyMsxms+MYs9lMaWmpp0sUEZFzeDwcNm3aRH5+PmvWrOHll19m48aNpKam\nsnv3bgoKCggLC+Ohhx5ye77JZPJ0iSIicg6P33MICwsDIDg4mKSkJGw2G0OGDHG8npKSwqhRowAI\nDw9n3759jtdKSkoIDw+v935RUVF88803ni5bRKRZ6dGjB8XFxRd9vEd7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bh3Dhg1z+d4mk4lu3boR\nFxfHiBEjmDdvHq1bt3b6+ed+7a4HcPbzTz75JM8884zj+/z8fMclLxF3tGS3yDnuuusuUlNTGTRo\nUKO+75QpU5gyZQpxcXGN+r4NUVRUxMMPP0x2drbXahD/oHAQOcfnn3/Oc889x2uvvebtUhpdWloa\nv//97xk8eLC3SxEfp3AQEREnuucgIiJOFA4iIuJE4SAiIk4UDiIi4kThICIiThQOIiLi5P8DLEKq\npeUsIOIAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x85c1c18>"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.12 page no.655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.12\n",
+ "#What is the maximum mass flow rate through the duct for this rate\n",
+ "#determine the static temprature ,static pressure, stagnation pressure and temprature\n",
+ "#and velocity at inlet and exit.\n",
+ "\n",
+ "#Given\n",
+ "T0=288 #K\n",
+ "p0=101 #kPa(abs)\n",
+ "l=2 #m\n",
+ "D=0.1 #m\n",
+ "f=0.02\n",
+ "k=1.4\n",
+ "x=f*l/D\n",
+ "Tratio=2/(k+1) #where Tratio is Tcritical/T0\n",
+ "Tcritical=Tratio*T0 #K = T2\n",
+ "Vcritical=(286.9*Tcritical*k)**0.5 #m/sec = V2\n",
+ "#from value of x, the following are found\n",
+ "Ma=0.63\n",
+ "Trat=1.1 #where Trat=T1/Tcritical\n",
+ "Vrat=0.66 #where Vrat=V1/Vcritical\n",
+ "prat=1.7 #where prat=p1/pcritical\n",
+ "pratio=1.16 #where pratio=p0,1/p0critical\n",
+ "#from value of Ma, the following are found\n",
+ "Tfraction=0.93 #whereTfraction=T1/T0\n",
+ "pfraction=0.76 #where pfraction=p1/p0,1\n",
+ "dfraction=0.83 #where dfraction=d1/d0,1\n",
+ "\n",
+ "#hence,\n",
+ "#calculation\n",
+ "import math\n",
+ "V1=Vrat*Vcritical #m/sec\n",
+ "d1=dfraction*(1.23) #kg/(m**3)\n",
+ "m=d1*math.pi*(D**2)*V1/4 #kg/sec\n",
+ "T1=Tfraction*T0 #K\n",
+ "p1=pfraction*p0 #kPa(abs)\n",
+ "T01=T0 #K and T01=T02\n",
+ "p01=p0 #kPa(abs)\n",
+ "p2=(1/prat)*(pfraction)*p01 #kpa(abs)\n",
+ "p02=(1/pratio)*p01 #kPa(abs)\n",
+ "\n",
+ "#Result\n",
+ "print \"Critical temperature=\",round(Tcritical,2),\"K\"\n",
+ "print \"Critical velocity=\",round(Vcritical,0),\"m/s\"\n",
+ "print \"Velocity at inlet=\",round(V1,0),\"m/s\"\n",
+ "print \"Maximum mass flowrate=\",round(m,2),\"Kg/s\"\n",
+ "print \"Temperature at inlet=\",round(T1,2),\"K\"\n",
+ "print \"Pressure at inlet=\",round(p1,0),\"kPa(abs)\"\n",
+ "print \"stagnation temperature at inlet and exit=\",round(T01,2),\"K\"\n",
+ "print \"The stagnation pressure at inlet=\",round(p01,2),\"kPa(abs)\"\n",
+ "print \"Pressure at exit=\",round(p2,2),\"kPa(abs)\"\n",
+ "print \"The stagnation pressure at exit=\",round(p02,2),\"kPa(abs)\"\n",
+ "\n",
+ "#Plot\n",
+ "#import numpy as np\n",
+ "#import matplotlib.pyplot as plt\n",
+ "#fig = plt.figure()\n",
+ "#ax = fig.add_subplot(111)\n",
+ "\n",
+ "s=[-5,50]\n",
+ "T=[288,288]\n",
+ "s1=[0,0]\n",
+ "T1=[288,268]\n",
+ "s2=[40,40]\n",
+ "T2=[288,240]\n",
+ "s3=[0,10,20,30,40]\n",
+ "T3=[268,265,261,252,240]\n",
+ "s4=[30,50]\n",
+ "T4=[240,240]\n",
+ "s5=[-3,50]\n",
+ "T5=[288,288]\n",
+ "s6=[-2,8]\n",
+ "T6=[284,294]\n",
+ "s7=[35,45]\n",
+ "T7=[281,295]\n",
+ "s8=[-2,8]\n",
+ "T8=[265,275]\n",
+ "s9=[35,45]\n",
+ "T9=[235,245]\n",
+ "\n",
+ "a=plot(s,T)\n",
+ "a1=plot(s1,T1)\n",
+ "a2=plot(s2,T2)\n",
+ "a3=plot(s3,T3,linestyle='--')\n",
+ "a4=plot(s4,T4)\n",
+ "a5=plot(s5,T5)\n",
+ "a6=plot(s6,T6)\n",
+ "a7=plot(s7,T7)\n",
+ "a8=plot(s8,T8)\n",
+ "a9=plot(s9,T9)\n",
+ "\n",
+ "xlabel(\"s-s1 (J/kg K)\") \n",
+ "ylabel(\"T (K)\") \n",
+ "plt.xlim((-5, 70))\n",
+ "plt.ylim((230,300))\n",
+ "plt.text(50,240,'T2=240K')\n",
+ "plt.text(50,288,'T0=288K')\n",
+ "plt.text(15,255,'fanno line')\n",
+ "plt.text(10,280,'p1=70kpa(abs)')\n",
+ "plt.text(15,268,'T1=268K')\n",
+ "plt.text(10,295,'p01=101kpa(abs)')\n",
+ "plt.text(50,295,'p02=84kpa(abs)')\n",
+ "plt.text(45,245,'p2=45kpa(abs)')\n",
+ "\n",
+ "show(a)\n",
+ "show(a1)\n",
+ "show(a2)\n",
+ "show(a3)\n",
+ "show(a4)\n",
+ "show(a5)\n",
+ "show(a6)\n",
+ "show(a7)\n",
+ "show(a8)\n",
+ "show(a9)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical temperature= 240.0 K\n",
+ "Critical velocity= 310.0 m/s\n",
+ "Velocity at inlet= 205.0 m/s\n",
+ "Maximum mass flowrate= 1.64 Kg/s\n",
+ "Temperature at inlet= 267.84 K\n",
+ "Pressure at inlet= 77.0 kPa(abs)\n",
+ "stagnation temperature at inlet and exit= 288.0 K\n",
+ "The stagnation pressure at inlet= 101.0 kPa(abs)\n",
+ "Pressure at exit= 45.15 kPa(abs)\n",
+ "The stagnation pressure at exit= 87.07 kPa(abs)\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iV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rsdVqsVAODxeCCXy3N7swjJgBrvEfILGo0GOp0OMpkMk5OT\nEAgEKCsrw+PjIwwGQ8bXvr+/g8lkgslk4vT0FHq9Pu1rp0wSiQQkEgkuLi5QWFj421MhJAWFAyG/\nEAqFMD8/j6enJ8TjcWxtbWX9EN3t7S2GhoaQSCRQVFQEq9WK5ubmrGvb7XYEAgEYjcZcl0/Ijygc\nCCGEpKF7DoQQQtJQOBBCCElD4UAIISQNhQMhhJA0FA6EEELSUDgQQghJ8w92HfCDcvY+zwAAAABJ\nRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.13 page no.657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.13\n",
+ "#Find the flowrate for the smaller tube \n",
+ "\n",
+ "#Given\n",
+ "T0=288 #K Temprature\n",
+ "p0=101 #kPa(abs) pressure\n",
+ "l=2 #m length of duct\n",
+ "D=0.1 #m diameter\n",
+ "f=0.02\n",
+ "pd=45 #kPa(abs)\n",
+ "f=0.02\n",
+ "k=1.4\n",
+ "lnew=(50/100)*l #m new length of duct\n",
+ "x=lnew*f/D\n",
+ "\n",
+ "#Calculation\n",
+ "#from this value of x, following are found\n",
+ "Ma=0.7\n",
+ "prat=1.5 #where prat=p1/pcritical\n",
+ "#from this value of Ma, following are found\n",
+ "pratio=0.72 #where pratio=p1/p0\n",
+ "dratio=0.79 #where dratio=d1/d0,1\n",
+ "Vratio=0.73 #where Vratio=V1/Vcritical\n",
+ "#hence,\n",
+ "p2=(1/prat)*pratio*p0 #kPa(abs)\n",
+ "pcritical=p2 \n",
+ "#we find that pd<pcritical\n",
+ "d1=dratio*(1.23) #kg/(m**3)\n",
+ "Vcritical=310 #m/sec = V2, from example 11.12\n",
+ "V1=Vratio*Vcritical #m/sec\n",
+ "m=d1*math.pi*(D**2)*V1/4 #kg/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"The flowrate for the smaller tube is =\",round(m,2),\"kg/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flowrate for the smaller tube is = 1.73 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.14 page no.658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.14\n",
+ "#find The Mach number at the exit.\n",
+ "#and The back pressure required.\n",
+ "\n",
+ "#given\n",
+ "T0=288 #K\n",
+ "p0=101 #kPa(abs)\n",
+ "l=2 #m\n",
+ "D=0.1 #m\n",
+ "f=0.02\n",
+ "pd=45 #kPa(abs)\n",
+ "f=0.02\n",
+ "m=1.65 #kg/sec\n",
+ "lnew=l/2 #m\n",
+ "\n",
+ "x=f*l/D\n",
+ "#from this value of x, Ma at exit is found as\n",
+ "Ma=0.7\n",
+ "#and p2/pcritical is found as\n",
+ "pratio=1.5\n",
+ "#and, from example 11.12,\n",
+ "prat=1.7 #where prat=p1/pcritical\n",
+ "pfraction=0.76 #where pfraction=p1/p0,1\n",
+ "#Hence,\n",
+ "p2=pratio*(1/prat)*pfraction*p0 #kPa(abs)\n",
+ "\n",
+ "#Result\n",
+ "print \"The Mach number at the exit=\",round(Ma,3)\n",
+ "print \"The back pressure required=\",round(p2,0),\"kPa(abs)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Mach number at the exit= 0.7\n",
+ "The back pressure required= 68.0 kPa(abs)\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.15 page no.659"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.15\n",
+ "#The corrosponding value of temperature for the downstream pressure of 13.5 psia\n",
+ "#and change in entropy for the downstream pressure of 13.5 psia.\n",
+ "\n",
+ "#given\n",
+ "k=1.4 \n",
+ "T0=518.67 #degree R\n",
+ "T1=514.55 #degree R\n",
+ "p1=14.3 #psia\n",
+ "\n",
+ "R=53.3 #(ft*lb)/(lbm*degree R)\n",
+ "cp=R*k/(k-1) #(ft*lb/(lbm* degree R))\n",
+ "Tratio=T1/T0\n",
+ "Ma=(((1/Tratio)-1)/((k-1)/2))**0.5\n",
+ "x=(R*T1*k*32.2)**0.5 #ft/sec where x=(R*T1*k)**0.5\n",
+ "y=p1*144/(R*T1)*(Ma*x) #lbm/((ft**2)*sec) where y=d*V\n",
+ "z=R*T1/(p1*144) #(ft**3)/lbm\n",
+ "c=(p1)+(y*y*z/(32.2*144)) #psia =constant\n",
+ "#when downstream pressure p=13.5 psia\n",
+ "p=13.5 #psia \n",
+ "a=(y**2)*R/(p*144*32.2*144) #(lb/(in**2))/degree R\n",
+ " \n",
+ "T=(c-p)/a\n",
+ "sdif=(cp*math.log(T/T1))-(R*math.log(p/p1)) #ft*lb/(lbm*degree R)\n",
+ "\n",
+ "#Result\n",
+ "print \"The corrosponding value of temperature for the downstream pressure of 13.5 psia=\",round(T,0),\"degree R\"\n",
+ "print \"The corrosponding value of change in entropy for the downstream pressure of 13.5 psia=\",round(sdif,0), \"ft*lb/(lbm*degree R)\"\n",
+ "\n",
+ "s=[93.2,202,251,285,317,330,333,334,336,338,338,336,333,328,321,259,181]\n",
+ "T=[969,1459,1859,2168,2464,2549,2558,2558,2544,2488,2450,2369,2260,2140,1992,1175,633]\n",
+ "a=plot(s,T)\n",
+ "xlabel(\"s-s1 (ft lb/lbm R)\") \n",
+ "ylabel(\"T (R)\") \n",
+ "plt.xlim((90,350))\n",
+ "plt.ylim((500,3000))\n",
+ "show(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The corrosponding value of temperature for the downstream pressure of 13.5 psia= 971.0 degree R\n",
+ "The corrosponding value of change in entropy for the downstream pressure of 13.5 psia= 121.0 ft*lb/(lbm*degree R)\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEMCAYAAAAF2YvKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlclWX+//HXMWkbI20awUCjFBcUgUnB+ukMjmFqE1GW\nk5OKZTXp1NhYtnybSmtcWqyxxcZprMwyrSnRTEmbJJcpVDzkQiUVliySa6GhCFy/Py49ioLpgcN9\n4LyfjweP8D7b5z7dnM+5ts/lMsYYREREvNDE6QBERKThUhIRERGvKYmIiIjXlERERMRrSiIiIuI1\nJREREfGaz5LI/v37SUhIIDY2lqioKB544AEAdu3aRVJSEu3bt6dv377s2bPH85hJkyYRGRlJx44d\nWbJkied4VlYW0dHRREZGMnr0aF+FLCIip8hnSeTMM89k2bJlZGdns379epYtW8bKlSuZPHkySUlJ\nbN68mT59+jB58mQAcnJymDt3Ljk5OaSnpzNq1CgOL2EZOXIkM2bMIDc3l9zcXNLT030VtoiInAKf\ndmedffbZAJSVlVFRUUGLFi1YsGABqampAKSmppKWlgbA/PnzGTx4MEFBQURERNCuXTsyMzMpKiqi\npKSE+Ph4AIYNG+Z5jIiIOMunSaSyspLY2FhCQkLo3bs3nTt3pri4mJCQEABCQkIoLi4GoLCwkPDw\ncM9jw8PDKSgoOO54WFgYBQUFvgxbREROUlNfPnmTJk3Izs7mhx9+4IorrmDZsmVVbne5XLhcrjp5\nrbp6HhGRQFOb6lf1Mjvr3HPP5corryQrK4uQkBC2bdsGQFFRES1btgRsC2Pr1q2ex+Tn5xMeHk5Y\nWBj5+flVjoeFhVX7OsaYU/p55JFHTvkxjekn0M9f74HOX+9B7Usn+iyJ7NixwzPzqrS0lKVLlxIX\nF0dycjIzZ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sX0qtXL1asWEFYWBjDhw//2ZZCTVwul9eJ49jnOcwY4/n30qVL6du373H3OdFznHHGGZ5jTZo0\n8fy7SZMmlJeXV/u4MWPGsHHjRubNm8e4ceOqnNPR8YicLCURabCKioo488wzufHGG7nnnntYt24d\n8fHxuN1u3G43v//97/nuu+/41a9+xS233MItt9yC2+326rUuvPDCKkXrjhUUFFTtB/exvvvuOz79\n9FMAZs+eTa9evfjhhx8oLy+vdrMgYwxvv/02xhi+/vprvvnmGzp27HjChHYyt1111VW0adOGN998\n03NbUVERERERP3sOIkdTEpEGa8OGDSQkJBAXF8djjz3GQw89dNx9MjIyiI2N9UzFHT16NAD33nsv\nrVu3prS0lNatW/Poo4+e8LViYmL48ssvPf8+dg+K2267ja5du1Y7sH70/Tp06MALL7xAVFQUP/zw\nA7fffjtLly4lKSmp2ud2uVy0adOG+Ph4BgwYwPTp0zn99NOPe/1jf6+pRXH08YcffpgJEyZ4/u12\nuz1dbSInSwUYRU7S8OHDGTlyJAkJCXX6vLfeeiu33nqroyXHN2/ezD333MOCBQsci0EaJiURkZO0\nceNGpkyZwiuvvOJ0KHVuzJgxXHvttfTs2dPpUKSBURIRERGvaUxERES8piQiIiJeUxIRERGvKYmI\niIjXlERERMRrSiIiIuK1/w8VnHZxfGG+nwAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.18 page no.670"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.18\n",
+ "#What is the Mach number for the flow\n",
+ "#and The velocity of the flow.\n",
+ "\n",
+ "\n",
+ "#Given\n",
+ "p=60 #psia total pressure\n",
+ "T=1000 #degree R Temprature\n",
+ "px=12 #psia\n",
+ "k=1.4 \n",
+ "R=53.3 #ft*lb/(lbm*degree R)\n",
+ "pratio=p/px\n",
+ "#for this value of pratio, Max is calculated as(from fig D.4)\n",
+ "Max=1.9\n",
+ "#using this value of Max, Tx/T0,x is found as\n",
+ "Tratio=0.59\n",
+ "#T=T0,x=T0,y\n",
+ "\n",
+ "#Calculation\n",
+ "Tx=Tratio*T #degree R\n",
+ "cx=(R*Tx*k)**0.5 #ft/sec\n",
+ "Vx=1.87*cx*(32.2**0.5) #ft/sec\n",
+ "\n",
+ "#Result\n",
+ "print \"The Mach number for the flow=\",round(Max,1)\n",
+ "print \"The velocity of the flow=\",round(Vx,0),\"ft/sec\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Mach number for the flow= 1.9\n",
+ "The velocity of the flow= 2227.0 ft/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.19 page no.671"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 11.19\n",
+ "#Find The ratio of back pressure to inlet stagnation pressure that will result in a normal shock at the exit of the duct\n",
+ "#The value of back pressure to inlet stagnation pressure required to position the shock at (x=0.3 m)\n",
+ "\n",
+ "#Given\n",
+ "x1=0.5 #m exit of duct\n",
+ "x2=0.3 #m entring of duct\n",
+ "Acritical=0.1 #m**2 area\n",
+ "#at x1, Max1 is found as\n",
+ "Max1=2.8\n",
+ "#and px/p0,x is found as\n",
+ "pratio1=0.04\n",
+ "#For this value of Max, py/px is found as\n",
+ "prat1=9\n",
+ "pfraction1=prat1*pratio1 #where pfraction=py/p0,x = pIII/p0,x\n",
+ "#at x2, Max2 is found as\n",
+ "Max2=2.14\n",
+ "#for this value of Max2, the following are found\n",
+ "prat2=5.2\n",
+ "prat22=0.66 #where prat22=p0,y/p0,x\n",
+ "May=0.56\n",
+ "#for this valur of May, Ay/Acritical is found as\n",
+ "Aratio=1.24\n",
+ "Arat=(Acritical+(x1**2))/(Acritical+(x2**2)) #where Aratio=A2/Ay\n",
+ "Afraction=Aratio*Arat #where Afraction=A2/Acritical\n",
+ "A2=Acritical+(x1**2) #m**2\n",
+ "Acritical1=A2/Afraction #where Acritical1 critical area for the isentropic flow downstream of the shock\n",
+ "#with the value of Afraction, the following are found\n",
+ "Ma2=0.26\n",
+ "pfraction=0.95 #where pfraction=p2/p0,y\n",
+ "#hence,\n",
+ "pfrac=pfraction*prat22 #where pfrac=p2/p0,x\n",
+ "\n",
+ "#Result\n",
+ "print \"The ratio of back pressure to inlet stagnation pressure \\n that will result in a normal shock at the exit of the duct=\",round(pfraction1,2)\n",
+ "print \"The value of back pressure to inlet stagnation pressure required to position the shock at (x=0.3 m)=\",round(pfrac,2)\n",
+ "\n",
+ "#Plot\n",
+ "s=[0,0]\n",
+ "T=[288,112]\n",
+ "s1=[0,360]\n",
+ "T1=[288,288]\n",
+ "s2=[0,280]\n",
+ "T2=[112,275]\n",
+ "s3=[240,320]\n",
+ "T3=[275,275]\n",
+ "s4=[-10,80]\n",
+ "T4=[112,112]\n",
+ "s5=[280,280]\n",
+ "T5=[288,275]\n",
+ "\n",
+ "\n",
+ "a=plot(s,T)\n",
+ "a1=plot(s1,T1)\n",
+ "a2=plot(s2,T2,linestyle='--')\n",
+ "a3=plot(s3,T3)\n",
+ "a4=plot(s4,T4)\n",
+ "a5=plot(s5,T5)\n",
+ "xlabel(\"s-s1 (J/Kg K)\") \n",
+ "ylabel(\"T (K)\") \n",
+ "plt.xlim((-40,500))\n",
+ "plt.ylim((60,340))\n",
+ "plt.text(82,112,'Tx=112K')\n",
+ "plt.text(60,310,'p0x=101kpa(abs)')\n",
+ "plt.text(300,315,'p0y=38kpa(abs)')\n",
+ "plt.text(340,270,'py=36kpa(abs)')\n",
+ "plt.text(10,275,'0,x')\n",
+ "plt.text(10,110,'x')\n",
+ "plt.text(300,290,'0,y')\n",
+ "plt.text(280,270,'y')\n",
+ "plt.text(280,375,'Ty=275K')\n",
+ "plt.text(350,285,'Tox=Toy=288K')\n",
+ "plt.text(40,125,'px=4kpa(abs)')\n",
+ "plt.text(80,90,'shock at nozzle exit plane x=(0.5m)')\n",
+ "\n",
+ "show(a)\n",
+ "show(a1)\n",
+ "show(a2)\n",
+ "show(a3)\n",
+ "show(a4)\n",
+ "show(a5)\n",
+ "\n",
+ "# For 2nd flow\n",
+ "s=[0,0]\n",
+ "T=[288,150]\n",
+ "s1=[0,360]\n",
+ "T1=[288,288]\n",
+ "s2=[80,200]\n",
+ "T2=[284,284]\n",
+ "s3=[80,160]\n",
+ "T3=[271,271]\n",
+ "s4=[0,120]\n",
+ "T4=(150,271)\n",
+ "s5=[-10,80]\n",
+ "T5=[150,150]\n",
+ "s6=[120,120]\n",
+ "T6=[271,284]\n",
+ "s7=[120,250]\n",
+ "T7=[288,320]\n",
+ "s8=[120,250]\n",
+ "T8=[284,300]\n",
+ "\n",
+ "a=plot(s,T)\n",
+ "a1=plot(s1,T1)\n",
+ "a2=plot(s2,T2)\n",
+ "a3=plot(s3,T3)\n",
+ "a4=plot(s4,T4,linestyle='--')\n",
+ "a5=plot(s5,T5)\n",
+ "a6=plot(s6,T6)\n",
+ "a7=plot(s7,T7)\n",
+ "a8=plot(s8,T8)\n",
+ "\n",
+ "plt.text(100,140,'Tx=150K')\n",
+ "plt.text(40,310,'p0x=101 kpa(abs)')\n",
+ "plt.text(250,320,'p0y=67kpa(abs)')\n",
+ "plt.text(120,250,'py=52kpa(abs)')\n",
+ "plt.text(10,275,'0,x')\n",
+ "plt.text(10,140,'x')\n",
+ "plt.text(120,290,'0,y')\n",
+ "plt.text(80,270,'y')\n",
+ "plt.text(160,265,'Ty=271K')\n",
+ "plt.text(200,280,'T2=284K')\n",
+ "plt.text(380,288,'Tox=Toy=288K')\n",
+ "plt.text(40,160,'px=10kpa(abs)')\n",
+ "plt.text(240,300,'p2=64kpa(abs)')\n",
+ "plt.text(80,100,'shock with nozzle x=(0.3m)')\n",
+ "plt.text(20,200,'normal shock')\n",
+ "\n",
+ "xlabel(\"s-s1 (J/Kg K)\") \n",
+ "ylabel(\"T (K)\") \n",
+ "plt.xlim((-40,500))\n",
+ "plt.ylim((60,340))\n",
+ "show(a)\n",
+ "show(a1)\n",
+ "show(a2)\n",
+ "show(a3)\n",
+ "show(a4)\n",
+ "show(a5)\n",
+ "show(a6)\n",
+ "show(a7)\n",
+ "show(a8)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of back pressure to inlet stagnation pressure \n",
+ " that will result in a normal shock at the exit of the duct= 0.36\n",
+ "The value of back pressure to inlet stagnation pressure required to position the shock at (x=0.3 m)= 0.63\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEsCAYAAADdO/TjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XtcjOn/P/DXRE4rsjqgrGGLDtM0o0iISWEpZ0LCCutr\nd+1ax7Vfh/j4Kh+nJWtPzpGcduUYobAOW5JlxcYqkrKSjjqo3r8/Zt0/oymlpunwfj4ePdbc9zXX\n9b6m9n7Pfd3Xfd0iIiIwxhhjJdDRdgCMMcaqN04UjDHGSsWJgjHGWKk4UTDGGCsVJwrGGGOl4kTB\nGGOsVJwoGKsFnj17BrlcDrlcjtatW8PU1BRyuRydO3fGy5cvy1VXaGgo7O3tIZVKYW9vj7CwMABA\nZmam0IZcLoehoSG++uorAMD27dthaGgo7Nu6dSsAID4+HjY2NkLdP//8M+zt7ZGenl5JPWdVob62\nA2CMVVzLli0RHR0NAFi6dCn09PQwa9asd6rL0NAQR48eRatWrXDr1i30798fjx49gp6entAGANjb\n22PEiBEAAJFIhLFjx2LDhg0l1hsQEICNGzciLCwMzZs3f6fYmHbwGQVjtdCLFy/QoUMHFBQUAAAy\nMjLQoUMHFBYWvvW9MpkMrVq1AgBYWVkhJyen2FlJbGws/vnnH/Ts2RMAQ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x0dXUhPT096vi6ujocPXoU+/fvj2f5RFFhoSAiIkO8RkFE\nRIZYKIiIyBALBRERGWKhICIiQywURERkiIWCiIgM/QNvmThKOMm8UQAAAABJRU5ErkJggg==\n"
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEICAYAAABBBrPDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XlcjWn/B/DPaSFbSmUrCtF62pUtjkfJMkjZRVpmjG0s\n04NZPLI8ZISnQXiMfY38bGNkUDHMmEKWERPpiFSmfVHavr8/mu5HWrSctPi+X6/z0jnnuq/re590\nf89139d13SIiIjDGGGMVkKvvABhjjDVsnCgYY4xVihMFY4yxSnGiYIwxVilOFIwxxirFiYIxxlil\nFOo7gOoSiUT1HQJjjDVKNZ0N0Sh7FERUp4/ly5fXeRsN8cH7/XE9eL8/rkdtNMpEwRhj7MPhRMEY\nY6xSnCjKIZFI6juEesH7/XHh/WZVJaLanrz6wEQiUa3PtzHG2MemNsdO7lEwxhirFCcKxhhjleJE\nwVgDFBMTAxsbG/Ts2ROTJk1Cfn5+reuMjY3F0KFDYWhoCCMjI8TGxgIABg4cCHNzc5ibm0NTUxNj\nx44FAHh7e2PDhg21bhcA7t+/D3d390rL7N27F/PmzatynRMmTEBMTExtQ2NVwImCsQZoyZIl+PLL\nL/H48WOoqqpi165dta5z+vTpWLJkCSIjIxEeHg4NDQ0AwNWrVxEREYGIiAj07dsXzs7OAGQ7uXX9\n+vWYNWtWpWWq296nn36KTZs21SYsVkWcKBirR1KpFPr6+nBxcYGhoSHGjx+P7OxshISEYNy4cQAA\nV1dXnDp1CkSEXr16ISkpCQBQVFSEnj17Ijk5+b3tREZGorCwEEOGDAEAtGzZEi1atChVJiMjA8HB\nwXB0dBReKzl479y5EyNGjEBubi4kEgkWLFgAc3NziMVihIeHAwDCwsLQr18/WFhYoH///oiKigIA\nvHnzBjdu3EDv3r0rL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K1ixYgUCAwOhVCoRFBQEW1tbGBgYoLi4GCEhIf+6fW1trVBQIiMjUV5ejq+//rrL4+fn5yM4\nOBgpKSkvnQNj/4YLBWOv4Pr169i1axfKy8vR0NCAX375pVs/2EtOTkZERASeP38OiUSC+Ph4jB07\ntsvbr1+/HgsWLICrq+vLhM9Yl3ChYIwxphVfo2CMMaYVFwrGGGNacaFgjDGmFRcKxhhjWnGhYIwx\nphUXCsYYY1r9F/d10F9PEo61AAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/ch_12.ipynb b/Fundamentals_of_Fluid_Mechanics/ch_12.ipynb
new file mode 100644
index 00000000..9c63bf6a
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/ch_12.ipynb
@@ -0,0 +1,328 @@
+{
+ "metadata": {
+ "name": "ch 12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 :Turbomachines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page no.697"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.2\n",
+ "#Find The ideal head rise\n",
+ "#and Tangential velocity component and The power transferred to the fluid.\n",
+ "\n",
+ "#Given\n",
+ "Q=1400.0 #gpm, water rate\n",
+ "N=1750.0 #rpm speed\n",
+ "b=2.0 #in height of blade\n",
+ "r1=1.9 #in inner radius\n",
+ "r2=7.0 #in outer radius\n",
+ "beta2=23.0 #degrees exit blade angle\n",
+ "beta2=beta2*3.14/180 #Radian\n",
+ "alpha1=90.0 #degrees water entering angle\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "U2=r2*2*math.pi*N/(60*12) #ft/sec\n",
+ "Vr2=(1400/(7.48*60*2*math.pi*(r2/12)*(b/12))) #ft/sec\n",
+ "V2tangential=round(U2,0)-(Vr2*1/(math.tan(beta2))) #ft/sec\n",
+ "hi=U2*V2tangential/32.2 #ft\n",
+ "print \"The ideal head rise=\",round(hi,2),\"ft\"\n",
+ "d=1.94 #slugs/(ft**3)\n",
+ "Wshaft=(d*Q*U2*V2tangential/(7.58*60))/550 #hp\n",
+ " \n",
+ "#result\n",
+ "print \"Tangential velocity component is \",round(V2tangential,0),\"ft/s\"\n",
+ "print \"The power transferred to the fluid=\",round(Wshaft,1),\"hp\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ideal head rise= 315.27 ft\n",
+ "Tangential velocity component is 95.0 ft/s\n",
+ "The power transferred to the fluid= 110.226 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page no.702\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.3\n",
+ "#Find the maximum height at which the pump can be located.\n",
+ "\n",
+ "#Given\n",
+ "Q=0.5 #(ft**3)/sec\n",
+ "NPSHr=15 #ft\n",
+ "T=80 #degree F\n",
+ "patm=14.7 #psi\n",
+ "KL=20\n",
+ "D=4.0 #in\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=Q/((math.pi/4)*(D/12.0)**2.0) #ft/sec\n",
+ "hL=KL*(V**2)/(2*32.2) #ft\n",
+ "#from value of T\n",
+ "pv=0.5069 #psi\n",
+ "sw=62.22 #lb/(ft**3) sw =specific weight\n",
+ "z1max=(patm*144/sw)-hL-(pv*144/sw)-NPSHr #ft\n",
+ "\n",
+ "#result\n",
+ "print \"The maximum height at which the pump can be located=\",round(z1max,2),\"feet\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum height at which the pump can be located= 7.65 feet\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.5 Page no.708"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.5\n",
+ "#For peak efficiency predict the discharge actual head rise and shaft horsepower.\n",
+ "\n",
+ "#Given\n",
+ "D1=8.0 #in\n",
+ "N1=1200.0 #rpm\n",
+ "D2=12.0 #in\n",
+ "N2=1000.0 #rpm\n",
+ "T=60.0 #degree F\n",
+ "CQ=0.0625\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Q1=CQ*(N1/60)*(2*math.pi)*(D1/12.0)**3.0 #(ft**3)/sec\n",
+ "print \"The discharge=\",round(Q1*7.48*60,0),\"gpm\"\n",
+ "CH=0.19\n",
+ "ha=CH*((N1*2*math.pi/60)**2.0)*((D1/12)**2.0)/32.2 #ft\n",
+ "print \"The actual headrise=\",round(ha,1),\"ft\"\n",
+ "CP=0.014\n",
+ "Wshaft=(CP*(1.94)*((N1*2*math.pi/60)**3.0)*((D1/12.0)**5.0))/550.0 #hp\n",
+ "\n",
+ "#Result\n",
+ "print \"The shaft horsepower=\",round(Wshaft,0),\"hp\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The discharge= 1044.0 gpm\n",
+ "The actual headrise= 41.4 ft\n",
+ "The shaft horsepower= 13.0 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.6 Page no.719"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.6\n",
+ "#determine The nozzle diameter for maximum power outpu.\n",
+ "#The maximum power output and The angular velocity of the rotor.\n",
+ "\n",
+ "#Given\n",
+ "z0=200 #ft height of left section\n",
+ "l=1000 #ft length of pipe\n",
+ "f=0.02\n",
+ "D=8 #in. diameter of pipe\n",
+ "B=150 #degree \n",
+ "R=1.5 #ft radius of wheel\n",
+ "z1=0 #ft height of right section\n",
+ "#calculation\n",
+ "import math\n",
+ "#energy equation between a point on surface of lake and the nozzle outlet\n",
+ "#z0=(V1**2)/(2*32.2) + hL\n",
+ "#from continuity equation, V=(A1*V1/A)=((D1/D)**2)*V1\n",
+ "#neglecting minor losses, \n",
+ "#z0=(1+(f*l/D)*((D1/D)**4))*(V1**2)/(2*32.2)\n",
+ "#Wshaft=d*Q*u*(U-V1)*(1-cos(B))\n",
+ "#The maximum power occurs at U=V1/2 and dWshaft/dD1=0\n",
+ "a=(2*32.2*z0)**(0.5) \n",
+ "b=f*(l/(D/12.0))*(1/(D/12.0))**4.0 \n",
+ "c=a*math.pi*1.94*(1-math.cos(B*math.pi/180))/4.0 \n",
+ "d=(c*a*a/4) #1.04*(10**6)\n",
+ "#by the above conditions, and applying Q=(math.pi*(D1**2)*V1/4)\n",
+ "D1=(1/(2*b))**(0.25) #ft, nozzle diameter\n",
+ "\n",
+ "#result\n",
+ "print \"The nozzle diameter for maximum power output=\",round(D1,2),\"ft\"\n",
+ "Wshaft=-((d*D1**2)/(1+(b*D1**4))**(1.5))/550.0 #hp\n",
+ "print \"The maximum power output=\",round(Wshaft,0),\"hp\"\n",
+ "V1=a/(1+(b*(D1**4)))**0.5 #ft/sec\n",
+ "omega=(V1/(2*R))*60/(2*math.pi) #rpm\n",
+ "print \"The angular velocity of the rotor=\",round(omega,0),\"rpm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The nozzle diameter for maximum power output= 0.24 ft\n",
+ "The maximum power output= -59.0 hp\n",
+ "The angular velocity of the rotor= 295.0 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.8 Page no.723"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.8\n",
+ "#find The shaft energy per unit mass of air.\n",
+ "#Given\n",
+ "ri=0.133 #in.\n",
+ "ro=0.168 #in.\n",
+ "N=300000 #rpm\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "rm=0.5*(ro+ri)/12\n",
+ "U=(N*2*math.pi/60)*rm #ft/sec\n",
+ "wshaft=(-U)*(2*U)/32.174 #ft*lb/lbm\n",
+ "\n",
+ "#Result\n",
+ "print \"The shaft energy per unit mass of air=\",round(wshaft,0),\"ft*lb/lbm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The shaft energy per unit mass of air= -9650.0 Ft*lb/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.9 Page No.727"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 12.9\n",
+ "#What type of turbine should we selected.\n",
+ "\n",
+ "#Given\n",
+ "w=6.0 #rev/s angular velocity\n",
+ "q=10.0 #ft**3/s , flow rate\n",
+ "h=20.0 #ft, head\n",
+ "gamma=62.4 #lb/ft**3, specific wt\n",
+ "n=94 # %, assumed efficiency\n",
+ "#calculation\n",
+ "import math\n",
+ "##rev/min\n",
+ "Wshaft=gamma*q*h*(n*10**-2)/(550.0) #shaft power\n",
+ "N=w1*math.sqrt(Wshaft)/(h)**(1.25)\n",
+ "print \"Accordint to information a mixed flow Francis Turbine must be used.\"\n",
+ "\n",
+ "g=32.2 #ft/s**2\n",
+ "V1=math.sqrt(2*g*h) #ft/s velocity\n",
+ "D=V1/(w*2*math.pi) #ft\n",
+ "d1=math.sqrt(4*q/(math.pi*V1))\n",
+ "print \"So a Pelton wheel with a diameter=\",round(D,3),\"ft\" \"supplied with water through nozzle of diameter=\",round(d1,3),\"ft\" \"is not a practical design.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accordint to information a mixed flow Francis Turbine must be used.\n",
+ "So a Pelton wheel with a diameter= 0.952 ftsupplied with water through nozzle of diameter= 0.596 ftis not a practical design.\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/ch_3.ipynb b/Fundamentals_of_Fluid_Mechanics/ch_3.ipynb
new file mode 100644
index 00000000..c8dc65b8
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/ch_3.ipynb
@@ -0,0 +1,482 @@
+{
+ "metadata": {
+ "name": "ch 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 :Elementary fluid dynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page No.99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.1\n",
+ "#Find the pressure at point 1 and 2 and the pressure difference indicated by the tube.\n",
+ "#given\n",
+ "v1=100 #mi/hr\n",
+ "ht=10000 #ft\n",
+ "#from standard table for static pressure at an altitude\n",
+ "p1=1456 #lb/ft**2(abs)\n",
+ "P1=1456*0.006947 #psi\n",
+ "d=0.001756 #slugs/ft**3\n",
+ "#1 mi/hr = 1.467 ft/s \n",
+ "\n",
+ "#calculation\n",
+ "p2=p1+(d*(v1*1.467)**2/2) #lb/ft**3\n",
+ "#in terms of gage pressure p2g\n",
+ "p2g=p2-p1 #lb/ft**2\n",
+ "#1lb/ft**2 = 0.006947 psi\n",
+ "P2=p2*0.006947 #psi\n",
+ "P2g=p2g*0.006947#psi\n",
+ "#pressure difference indicated by the pitot tube = pdiff\n",
+ "pdiff=P2-P1 #psi\n",
+ "\n",
+ "#Result\n",
+ "print \"Pressure at point 1 =\",round(P1,2),\"psi\"\n",
+ "print \"Pressure at point 2 in terms of gage pressure=\",round(P2g,2),\"psi\"\n",
+ "print \"pressure difference indicated by the pitot static tube=\",round(pdiff,2),\"psi\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure at point 1 = 10.11 psi\n",
+ "Pressure at point 2 in terms of gage pressure= 0.13 psi\n",
+ "pressure difference indicated by the pitot static tube= 0.13 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7 Page No.115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
+ "For more information, type 'help(pylab)'.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.7\n",
+ "#given\n",
+ "dia=0.1 #m\n",
+ "dia1=1.0 #m\n",
+ "h=2.0 #m\n",
+ "\n",
+ "#calculation\n",
+ "#bernoulli's equation: p1+(0.5*d*V1**2)+(sw*z1)= p2+(0.5*d*V2**2)+(sw*z2)\n",
+ "#assuming p1=p2=0, and z1=h and z2=0\n",
+ "#(0.5*d*V1**2)+(g*h)= (0.5*d*V2**2)\n",
+ "#assuming steady flow Q1=Q2, Q=A*V. hence, A1*V1=A2*V2\n",
+ "#V1=((dia/dia1)**2)*V2\n",
+ "#hence V2=((2*g*h)/(1-(dia/dia1)**4))**0.5\n",
+ "import math\n",
+ "V2=((2*9.81*h)/(1-(dia/dia1)**4))**0.5\n",
+ "Q=(math.pi/4*(dia)**2)*V2\n",
+ "\n",
+ "#result\n",
+ "print \"The flow rate needed is=\",round(Q,5),\"m**3/s\"\n",
+ "\n",
+ "#Plot\n",
+ "h=[0,0.2,0.4,0.5,0.6,0.62]\n",
+ "D=[1,1.001,1.01,1.03,1.08,1.10]\n",
+ "xlabel(\"d/D \") \n",
+ "ylabel(\"Q/Q0\") \n",
+ "plt.xlim((0,0.8))\n",
+ "plt.ylim((1,1.10))\n",
+ "a=plot(h,D)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow rate needed is= 0.0492 m**3/s\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAELCAYAAAAoUKpTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH3lJREFUeJzt3XtU1GX+B/A3XvKSZkwQ1i/SQIuLIDcZTUAsLyhL5pHK\nqWQTd5e188vU2N/q5tngbHe1zeisZfs7PzNErSjXK6RtM+CqDJQpIWQhlHYxgY1UREd4fn/MzgjK\nOAPM9zbzfp3DCeY7jp8z6bz9Ps/zeR4fIYQAERHRNfRRugAiIlI/hgURETnFsCAiIqcYFkRE5BTD\ngoiInGJYEBGRU5KERWZmJgICAhAREdHl9ZqaGkyYMAEDBw7E6tWrO10rKSlBaGgoRo8ejby8PCnK\nIyKibvKRos+itLQUQ4YMQUZGBiorK6+6fvr0aXzzzTfYunUrfH198dRTT9mvRUdHY82aNRgxYgSm\nT5+Offv2wc/Pz90lEhFRN0hyZ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1dW5YMECodPp7Ev/xo0bJ3uNrtT50ksvifDwcBEVFSXmz58vKisr\nVVdjR4899phiS2ed1fn666+L8PBwMXbsWDFv3jxx+PBhVdYphBB/+9vfRGhoqEhKShKbNm1SbZ3r\n168XBoNBkfpsnNX5888/i0WLFono6Ggxbdo0sXPnTqevqdnDj4iISD6qHYYiIiL1YFgQEZFTDAsi\nInKKYUFERE4xLIh6IScnB6tXr7b/fPDgQfzud7+DyWTCsGHDEBMTg+DgYEydOlX2vgAid2JYEPXC\nlTsG7N69GzNmzABg3Zvns88+w+HDh5GRkYGHH34Yn332mRJlEvUaw4KomzZt2oSYmBgkJCTg22+/\n7XTtn//8J6ZMmdKpAXPIkCGYN28e5syZg1WrVsldLpFbMCyIuqGhoQHPPPMMdu3ahYKCAvsGd7Zr\n/fv3x9ChQ7v8tWlpafjyyy/lLJfIbTS9kSCR3IqLi5GSkoLhw4cDgH3LbAD46KOP7OfKd6WtrY0b\nXZJm8c6CqBtsu8h2paioCCkpKQ5/7Y4dO5zvv0OkUgwLom6YPn06PvroI5w6dQonTpzAxx9/DMC6\nSeSRI0cwduzYq37N2bNnUVBQgK1bt+Kpp56Su2Qit+AwFFE33HTTTcjNzcWMGTMwePBg+7DTp59+\niujoaPvzfHx8UFpaipiYGDQ3NyMoKAgFBQWdnkOkJdxIkMgNnnvuOYwePRoPPvig0qUQSYJhQURE\nTnHOgoiInGJYEBGRUwwLIiJyimFBREROMSyIiMgphgURETn1//Mag5geBe7+AAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 Page No.116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.8\n",
+ "#What is Flowrate and Pressure in the hose.\n",
+ "#Given\n",
+ "dia=0.03 #m\n",
+ "dia1=0.01 #m\n",
+ "p=3 #kPa(gage)\n",
+ "\n",
+ "#calculation\n",
+ "#density of air d is found using standard temp and pressure conditions\n",
+ "d=(p+101)*1000/((286.9)*(15+273))\n",
+ "#applying Bernoulli's equation at points 1,2 and 3 p=p1\n",
+ "import math\n",
+ "v3=((2*p*1000)/d)**0.5\n",
+ "Q=(math.pi)/4*(dia1**2)*v3\n",
+ "#by continuity equation, A2*v2=A3*v3\n",
+ "v2=((dia1/dia)**2)*v3\n",
+ "p2=(p*1000)-(0.5*d*(v2**2))\n",
+ "\n",
+ "#Result\n",
+ "print \"Flowrate =\",round(Q,5),\"m**3/s\"\n",
+ "print \"Pressure in the hose=\",round(p2,1),\"N/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flowrate = 0.00542 m**3/s\n",
+ "Pressure in the hose= 2963.0 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.10 Page No. 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.10\n",
+ "#What is the maximum height over which the water can be siphoned without cavitation occuring.\n",
+ "#given\n",
+ "T=60 #degree farenheit\n",
+ "z1=5 #ft\n",
+ "atmp=14.7 #psia\n",
+ "#applying bernoulli equation at points 1,2 and 3\n",
+ "z3=-5 #ft\n",
+ "v1=0 #large tank\n",
+ "p1=0 #open tank\n",
+ "p3=0 #open jet\n",
+ "#applying continuity equation A2*v2=A3*v3 A2=A3 so v2=v3\n",
+ "\n",
+ "#calculation\n",
+ "v3=(2*32.2*(z1-z3))**0.5\n",
+ "#vapor pressure of water at 60 degree farenheit = p2=0.256 psia\n",
+ "p2=0.256\n",
+ "z2=z1-((((p2-atmp)*144)+(0.5*1.94*v3**2))/62.4)\n",
+ "\n",
+ "#result\n",
+ "print \"The maximum height over which \\n the water can be siphoned without cavitation occuring=\",round(z2,3),\"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum height over which \n",
+ " the water can be siphoned without cavitation occuring= 28.321 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11 Page No.122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.11\n",
+ "#Find the pressure difference range.\n",
+ "#given\n",
+ "sg=0.85\n",
+ "Q1=0.005 #m**3/s\n",
+ "Q2=0.05 #m**3/s\n",
+ "dia1=0.1 #m\n",
+ "dia2=0.06 #m\n",
+ "\n",
+ "#calculation\n",
+ "#A2/A1=dia2/dia1\n",
+ "import math\n",
+ "d=sg*1000\n",
+ "Arat=(dia2/dia1)**2\n",
+ "A2=math.pi/4*(dia2**2)\n",
+ "pdiffs=(Q1**2)*d*(1-(Arat**2))/(2*1000*(A2**2))\n",
+ "pdiffl=(Q2**2)*d*(1-(Arat**2))/(2*1000*(A2**2))\n",
+ "print \"The pressure difference ranges from =\",round(pdiffs,3),\"kpa\" \"to\" ,round(pdiffl,0),\"kpa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference ranges from = 1.157 kpato 116.0 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.12 Page No.124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 3.12\n",
+ "#What is the flowrate per unit width and \\n The flowrate per unit width .\n",
+ "#given\n",
+ "z1=5 #m\n",
+ "a=0.8 #m\n",
+ "b=6 #m\n",
+ "Cc=0.61 #since a/z1=ratio=0.16<0.2 Cc= contracction coefficient\n",
+ "z2=Cc*a\n",
+ "\n",
+ "#calculation\n",
+ "#Q/b=flowrate\n",
+ "flowrate=z2*((2*9.81*(z1-z2))/(1-((z2/z1)**2)))**0.5\n",
+ "#considering z1>>z2 and neglecting kinetic energy of the upstream fluid\n",
+ "flowrate1=z2*(2*9.81*z1)**0.5\n",
+ "#result\n",
+ "print \"The flowrate per unit width=\",round(flowrate,2),\"m**2/s\"\n",
+ "print \"The flowrate per unit width when we consider z1>>z2=\",round(flowrate1,1),\"m**2/s\"\n",
+ "\n",
+ "#Plot\n",
+ "import matplotlib.pyplot as plt\n",
+ "fig = plt.figure()\n",
+ "ax = fig.add_subplot(111)\n",
+ "\n",
+ "h=[5,10,15]\n",
+ "D=[4.61,6.5,8]\n",
+ "xlabel(\"z1 (m)\") \n",
+ "ylabel(\"Q/b (m**2/s)\") \n",
+ "plt.xlim((0,15))\n",
+ "plt.ylim((0,9))\n",
+ "\n",
+ "ax.plot([5], [4.61], 'o')\n",
+ "ax.annotate('(5 m,4.61 m**2/s)', xy=(5,4.5))\n",
+ "a=plot(h,D)\n",
+ "show(a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flowrate per unit width= 4.61 m**2/s\n",
+ "The flowrate per unit width when we consider z1>>z2= 4.8 m**2/s\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEMCAYAAAA70CbBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1czvf+B/DXlZIQp7OQKYpqEuuGyl1cbheW+LVmmbmd\nYTmYsd/j0I5s53Dc2yFl5maGxvY7Z2xRq3EJk0ohiYoyWVhyk27R5/fH5lKnq0t3366ub6/n4+Hx\nuK5v3+v7frfx6vP4fD99PwohhAAREcmCga4bICKi+sNQJyKSEYY6EZGMMNSJiGSEoU5EJCMMdSIi\nGZE01Pft24fBgwfD0dERX3zxhZ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aGoqAhWVlb45JNPtF7H\nxsam0rx4+W0B/3uLwGfvS0tLUVhYiA4dOtTHt0NUI1z9QqTF/Pnz8frrr2PEiBHV/syBAweQkpJS\nYYMEoobCkTqRFn/5y1+wY8eOGn1m7969mD17tkQdEWnHkToRkYxwpE5EJCMMdSIiGWGoExHJCEOd\niEhGGOpERDLCUCcikpH/B3UDvsh3l9PbAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.13 Page No.125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.13\n",
+ "#Estimate the flow rate when depth is increased to 3 times.\n",
+ "#given\n",
+ "#Q=A*V=(H**2)*tan(theta/2)*(C2*(2*g*H)**0.5)\n",
+ "#Q3H0/QH0=(3H0)**2.5/(H0)**2.5=3**2.5\n",
+ "Qrat=3**2.5\n",
+ "\n",
+ "#Result\n",
+ "print(\"The flowrate is proportional to H**2.5\")\n",
+ "print \"When depth is increased from H0 to 3H0 Q increases \",round(Qrat,1),\"times\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flowrate is proportional to H**2.5\n",
+ "When depth is increased from H0 to 3H0 Q increases 15.6 times\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.15 Page No.130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.15\n",
+ "#determene the stagnation pressure on the leading edge if flow is incompressible.\n",
+ "#given\n",
+ "h=10 #Km\n",
+ "#air is in a standard atmosphere\n",
+ "p1=26.5 #kPa\n",
+ "T1=-49.9 #degree celcius\n",
+ "d=0.414 #Kg/m**3\n",
+ "k=1.4\n",
+ "Ma1=0.82 #Mach\n",
+ "#for incompressible flow,\n",
+ "pdiff=(k*Ma1**2)/2*p1\n",
+ "#for compressible isentropic flow, \n",
+ "pdiff1=((1+((k-1)/2)*(Ma1**2))**(k/(k-1))-1)*p1\n",
+ "\n",
+ "#result\n",
+ "print(\"Stagnation pressure on leading edge on the wing of the Boeing:\")\n",
+ "print \"when flow is imcompressible =\",round(pdiff,1),\"kpa\"\n",
+ "print \"when flow is compressible and isentropic =\",round(pdiff1,1),\"kpa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stagnation pressure on leading edge on the wing of the Boeing:\n",
+ "when flow is imcompressible = 12.5 kpa\n",
+ "when flow is compressible and isentropic = 14.7 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.17 Page No.132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.17\n",
+ "#What is the pressure at stagnation point.\n",
+ "#given\n",
+ "V=5 #m/s\n",
+ "sg=1.03\n",
+ "h=50 #m\n",
+ "#since static pressure is greater than stagnation pressure, Bernoulli's equation is incorrect\n",
+ "#calculation\n",
+ "#p2=(d*(V1**2)/2)+(d*g*h) V1=V\n",
+ "#result\n",
+ "p2=(((sg*1000)*(V**2)/2) + (sg*1000*9.81*h))/1000 #kPa\n",
+ "print \"The pressure at stagnation point 2 =\",round(p2,1),\"kpa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure at stagnation point 2 = 518.1 kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Fluid_Mechanics/screenshots/seconds.png b/Fundamentals_of_Fluid_Mechanics/screenshots/seconds.png
new file mode 100644
index 00000000..fd177f02
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/screenshots/seconds.png
Binary files differ
diff --git a/Fundamentals_of_Fluid_Mechanics/screenshots/surface-elevation.png b/Fundamentals_of_Fluid_Mechanics/screenshots/surface-elevation.png
new file mode 100644
index 00000000..dcfee957
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/screenshots/surface-elevation.png
Binary files differ
diff --git a/Fundamentals_of_Fluid_Mechanics/screenshots/the-drag.png b/Fundamentals_of_Fluid_Mechanics/screenshots/the-drag.png
new file mode 100644
index 00000000..46c163a2
--- /dev/null
+++ b/Fundamentals_of_Fluid_Mechanics/screenshots/the-drag.png
Binary files differ
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_1.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_1.ipynb
new file mode 100644
index 00000000..62ff8fe0
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_1.ipynb
@@ -0,0 +1,391 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page 5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "# Find Wall Heat Loss - Problem of Pure Conduction Unidimensional Heat\n",
+ "\n",
+ "L=.15; \t\t \t\t\t#[m] - Thickness of conducting wall\n",
+ "delT = 1400. - 1150.; \t\t#[K] - Temperature Difference across the Wall\n",
+ "A=.5*1.2; \t\t\t\t\t#[m^2] - Cross sectional Area of wall = H*W\n",
+ "k=1.7; \t\t\t\t\t#[W/m.k] - Thermal Conductivity of Wall Material\n",
+ "#calculations\n",
+ "#Using Fourier's Law eq 1.2\n",
+ "Q = k*delT/L; \t\t\t#[W/m^2] - Heat Flux\n",
+ "\n",
+ "q = A*Q; \t\t\t#[W] - Rate of Heat Transfer \n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"\\n \\n Heat Loss through the Wall =\",q,\" W\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " \n",
+ " Heat Loss through the Wall = 1700.00 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "# Find a) Emissive Power & Irradiation b)Total Heat Loss per unit length \n",
+ "import math\n",
+ "d=.07; \t\t\t\t\t\t\t\t\t#[m] - Outside Diameter of Pipe\n",
+ "Ts = 200+273.15; \t\t\t\t\t\t\t#[K] - Surface Temperature of Steam\n",
+ "Tsurr = 25+273.15; \t\t\t\t\t\t\t#[K] - Temperature outside the pipe\n",
+ "e=.8; \t\t\t\t\t\t\t\t\t\t# Emissivity of Surface\n",
+ "h=15; \t\t\t\t\t\t\t\t\t#[W/m^2.k] - Thermal Convectivity from surface to air\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); \t \t# [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "#calculations\n",
+ "#Using Eq 1.5 \n",
+ "E = e*stfncnstt*Ts*Ts*Ts*Ts; \t\t\t#[W/m^2] - Emissive Power\n",
+ "G = stfncnstt*Tsurr*Tsurr*Tsurr*Tsurr; \t#[W/m^2] - Irradiation falling on surface\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"\\n (a) Surface Emissive Power = \",E,\" W/m^2\");\n",
+ "print '%s %.2f %s' %(\"\\n Irradiation Falling on Surface =\",G,\" W/m^2\");\n",
+ "\n",
+ "#Using Eq 1.10 Total Rate of Heat Transfer Q = Q by convection + Q by radiation\n",
+ "q = h*(math.pi*d)*(Ts-Tsurr)+e*(math.pi*d)*stfncnstt*(Ts*Ts*Ts*Ts-Tsurr*Tsurr*Tsurr*Tsurr); #[W] \n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n (b) Total Heat Loss per unit Length of Pipe=\",q,\" W\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Surface Emissive Power = 2273.36 W/m^2\n",
+ "\n",
+ " Irradiation Falling on Surface = 448.05 W/m^2\n",
+ "\n",
+ "\n",
+ " (b) Total Heat Loss per unit Length of Pipe= 998.38 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Find Velocity of Coolant Fluid\n",
+ "import math\n",
+ "Ts = 56.4+273.15; \t\t\t\t\t#[K] - Surface Temperature of Steam\n",
+ "Tsurr = 25+273.15; \t\t\t\t\t#[K] - Temperature of Surroundings\n",
+ "e=.88; \t\t\t\t\t\t\t\t# Emissivity of Surface\n",
+ "\n",
+ "#As h=(10.9*math.pow(V,.8)[W/m^2.k] - Thermal Convectivity from surface to air\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); \t# [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "\n",
+ "A=2*.05*.05; \t\t\t\t\t# [m^2] Area for Heat transfer i.e. both surfaces\n",
+ "\n",
+ "E = 11.25; \t\t\t \t \t\t#[W] Net heat to be removed by cooling air\n",
+ "#calculations\n",
+ "\n",
+ "Qrad = e*stfncnstt*A*(math.pow(Ts,4)-math.pow(Tsurr,4));\n",
+ "\n",
+ "#Using Eq 1.10 Total Rate of Heat Transfer Q = Q by convection + Q by radiation\n",
+ "Qconv = E - Qrad;\t\t\t\t\t#[W] \n",
+ "\n",
+ "#As Qconv = h*A*(Ts-Tsurr) & h=10.9 Ws^(.8)/m^(-.8)K.V^(.8)\n",
+ "\n",
+ "V = math.pow(Qconv/(10.9*A*(Ts-Tsurr)),(1/0.8));\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n Velocity of Cooling Air flowing= \", V,\"m/s\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " EXAMPLE 1.4 Page 20 \n",
+ "\n",
+ "\n",
+ "\n",
+ " Velocity of Cooling Air flowing= 9.40 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Find Skin Temperature & Heat loss rate\n",
+ "import math\n",
+ "A=1.8;\t \t\t\t\t\t\t\t\t# [m^2] Area for Heat transfer i.e. both surfaces\n",
+ "Ti = 35+273.; \t \t\t\t\t\t\t\t#[K] - Inside Surface Temperature of Body\n",
+ "Tsurr = 297.; \t\t\t\t\t\t\t\t#[K] - Temperature of surrounding\n",
+ "Tf = 297.; \t\t\t\t\t\t\t\t\t#[K] - Temperature of Fluid Flow\n",
+ "e=.95; \t\t\t\t\t\t\t\t\t\t# Emissivity of Surface\n",
+ "L=.003; \t\t\t\t\t\t\t\t\t#[m] - Thickness of Skin\n",
+ "k=.3; \t\t\t\t\t\t\t\t\t\t# Effective Thermal Conductivity\n",
+ "h=2; \t\t\t\t\t\t\t\t\t#[W/m^2.k] - Natural Thermal Convectivity from body to air\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); \t\t\t# [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "#Using Eq 1.5\n",
+ "\n",
+ "Tsa=305.; \t\t\t \t\t\t\t #[K] Body Temperature Assumed\n",
+ "#calculations\n",
+ "\n",
+ "Ts=307.19\n",
+ "q = k*A*(Ti-Ts)/L; #[W] \n",
+ "\n",
+ "print '%s' %(\"\\n\\n (I) In presence of Air\")\n",
+ "print '%s %.2f %s' %(\"\\n (a) Temperature of Skin = \",Ts,\"K\");\n",
+ "print '%s %.2f %s' %(\"\\n (b) Total Heat Loss = \",q,\" W\");\n",
+ "\n",
+ "#When person is in Water\n",
+ "h = 200; \t\t\t\t\t\t\t\t#[W/m^2.k] - Thermal Convectivity from body to water\n",
+ "hr = 0; \t\t\t\t\t\t\t\t\t# As Water is Opaque for Thermal Radiation\n",
+ "Ts = (k*Ti/L + (h+hr)*Tf)/(k/L +(h+hr)); \t#[K] Body Temperature \n",
+ "q = k*A*(Ti-Ts)/L; \t\t\t\t#[W] \n",
+ "#results\n",
+ "\n",
+ "print '%s' %(\"\\n\\n (II) In presence of Water\")\n",
+ "print '%s %.2f %s' %(\"\\n (a) Temperature of Skin =\",Ts,\" K\");\n",
+ "print '%s %.2f %s' %(\"\\n (b) Total Heat Loss =\",q,\" W\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (I) In presence of Air\n",
+ "\n",
+ " (a) Temperature of Skin = 307.19 K\n",
+ "\n",
+ " (b) Total Heat Loss = 145.80 W\n",
+ "\n",
+ "\n",
+ " (II) In presence of Water\n",
+ "\n",
+ " (a) Temperature of Skin = 300.67 K\n",
+ "\n",
+ " (b) Total Heat Loss = 1320.00 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "%pylab inline\n",
+ "# (a) Curie Temperature for h = 15 W/m^2\n",
+ "# (b) Value of h for cure temp = 50 deg C\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import roots\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "Tsurr = 30+273; #[K] - Temperature of surrounding\n",
+ "Tf = 20+273; #[K] - Temperature of Fluid Flow\n",
+ "e=.5; # Emissivity of Surface\n",
+ "a = .8; # Absorptivity of Surface\n",
+ "G = 2000; #[W/m^2] - Irradiation falling on surface\n",
+ "h=15; #[W/m^2.k] - Thermal Convectivity from plate to air\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "T=375; #[K] Value initially assumed for trial-error approach\n",
+ "#Using Eq 1.3a & 1.7 and trial-and error approach of Newton Raphson \n",
+ "#calculations and results\n",
+ "while(1>0):\n",
+ " f=((a*G)-(h*(T-Tf)+e*stfncnstt*(T*T*T*T - Tsurr*Tsurr*Tsurr*Tsurr)));\n",
+ " fd=(-h*T-4*e*stfncnstt*T*T*T);\n",
+ " Tn=T-f/fd;\n",
+ " if(((a*G)-(h*(Tn-Tf)+e*stfncnstt*(Tn*Tn*Tn*Tn - Tsurr*Tsurr*Tsurr*Tsurr)))<.01):\n",
+ " break;\n",
+ " T=Tn;\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n (a) Cure Temperature of Plate =\",T-273.,\"degC\\n\");\n",
+ "#solution (b)\n",
+ "Treq=50+273;\n",
+ "#def T(h):\n",
+ "# t=375;\n",
+ "# while(1>0):\n",
+ "# f=((a*G)-(h*(t-Tf)+e*stfncnstt*(t*t*t*t - Tsurr*Tsurr*Tsurr*Tsurr)));\n",
+ "# fd=(-h*t-4*e*stfncnstt*t*t*t);\n",
+ "# Tn=t-f/fd;\n",
+ "# if((a*G)-(h*(Tn-Tf)+e*stfncnstt*(Tn*Tn*Tn*Tn - Tsurr*Tsurr*Tsurr*Tsurr))<.01):\n",
+ "# break;\n",
+ "# tnew=Tn;\n",
+ "# return tnew;\n",
+ "\n",
+ "\n",
+ "def T(h):\n",
+ " global rt\n",
+ " coeff = ([-e*stfncnstt, 0,0, -h, a*G+h*Tf+e*stfncnstt*Tsurr*Tsurr*Tsurr*Tsurr]);\n",
+ " rot=numpy.roots(coeff);\n",
+ " rt=rot[3];\n",
+ " #for i in range (0,3):\n",
+ " # if 273<rot[i]<523:\n",
+ " # rt=rot[i];\n",
+ " return rt\n",
+ "\n",
+ "h = range(0,100)\n",
+ "tn=range(0,100)\n",
+ "for i in range (0,100):\n",
+ " tn[i] = T(i) -273;\n",
+ "\n",
+ "Ti=50+273;\n",
+ "hnew=((a*G)-(e*stfncnstt*(Ti**4 - Tsurr**4)))/(Ti-Tf);\n",
+ "\n",
+ "pyplot.plot(h,tn);\n",
+ "pyplot.xlabel(\"h (W m^2/K)\");\n",
+ "pyplot.ylabel(\"T (C)\");\n",
+ "pyplot.show();\n",
+ "print '%s %.2f %s' %(\"\\n (b) Air flow must provide a convection of =\",hnew,\" W/m^2.K\");\n",
+ "print '%s' %(\"\\n The code for the graph requires more than 10 min to run. \")\n",
+ "print '%s' %(\"\\n To run it, please remove comments. It is perfectly correct. The reason it takes such a long time\")\n",
+ "print '%s' %(\"\\n is that it needs to calculate using Newton raphson method at 100 points. Each point itself takes a minute.\")\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "\n",
+ " (a) Cure Temperature of Plate = 104.30 degC\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['f', 'e']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEPCAYAAABcA4N7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt4VPWdx/H3JCGgcickQCZyCQKZXDRcImDAoEQkEMEC\nAgK2YqtYwUVst7vdZxewLTyCLuBKWbq6rtuIAuJaNBKRYriHcJEGRCHQpGQigYRwCygk5Owfp5kQ\nICOGTM5M5vN6nvPMmTO375wH5pPf7/zO79gMwzAQERGpRYDVBYiIiHdTUIiIiFsKChERcUtBISIi\nbikoRETELQWFiIi45bGgKCgoYPDgwcTGxtKzZ08WLFgAwJw5c7Db7cTHxxMfH8+6detcr5k/fz4O\nh4PY2FjWr1/vqdJEROQHsHnqPIoTJ05QXFxMTEwMZWVl9O7dm9WrV/Phhx/SokULZs2aVeP5e/bs\nYdq0aWRlZVFUVERiYiKHDh0iODjYE+WJiMhN8liLIiwsjJiYGACaN29OXFwchYWFANwom9LT05kw\nYQKBgYGEh4cTHR1Ndna2p8oTEZGb1CDHKPLz89m1axeDBg0CYOnSpURFRTF58mRKS0sBKCwsxG63\nu15jt9txOp0NUZ6IiLjh8aAoKytj3LhxLFmyhBYtWvDcc89x9OhRDh48SGRkJM8//7ynSxARkVsQ\n5Mk3Ly8vZ8yYMTz++OOMHj0agJCQENfjzzzzDEOGDAHMFkRBQYHrMafTSURExHXv2b17d44ePerJ\nskVEGp3IyEiOHDlSp9d6rEVhGAZPPfUUDoeDF154wbX95MmTrvU1a9YQHR0NQEpKCitXrqSiogKn\n08mBAwdISEi47n2PHj2KYRhaDIPZs2dbXoO3LNoX2hfaF+6XW/kD22Mtim3btpGWlkZcXBzx8fEA\nzJs3jxUrVpCTk8Ply5fp3Lkzb775JgB9+vTh0UcfJS4ujoCAAJYvX06TJk08VZ6IiNwkjwVFYmIi\nlZWV120fPnx4ra/59a9/za9//WtPlSQiInWgM7N9WFJSktUleA3ti2raF9W0L+qHx0648xSb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L48OF+ty+6d+9OVlYW3377LYZhsGHDBiIjI/3y30WV2r57SkoKK1eupKKi\nAqfTyYEDB0hISHD/ZvV9QMVTPvnkEyM6OtqIiooy5s2bZ3U5DWrLli2GzWYz7r77buOee+4x7rnn\nHmPdunXGqVOnjKFDhxqxsbFGcnKycfr0aatLbVCZmZmuUU/+ui/27dtn9O3b13A4HMbw4cON0tJS\nv90Xs2fPNrp372706NHDGD9+vPHtt9/6zb6YMGGC0bFjR6NJkyaG3W43/vu//9vtd//d735nREVF\nGdHR0UZGRsb3vr9OuBMREbd8outJRESso6AQERG3FBQiIuKWgkJERNxSUIiIiFsKChERcUtBIY1G\nfn5+jWkjLnOeAAAEWElEQVSW3Xn99df5n//5H3JycoiPj3dtf/fdd7n99tu5cuUKAPv37+fuu+++\npboqKioYMWIE7du358svv6zx2KxZs3A4HDgcDkaOHMmpU6dqPN63b18uX75Mly5dKC0tBWDPnj10\n69aNffv2sXbtWr+dtkMajoJC/I5hGLz55ptMnjyZmJgYjh07xoULFwBzihCHw8HevXtd9++7775b\n+rxnn30Wh8PBhx9+yPjx4yksLHQ9lpqayoEDBzh48CAxMTH89re/dT2Wl5eH3W4nODjYNd9ZTk4O\n48aNY9WqVdxzzz2kpqayZs0aysvLb6lGEXcUFNKoXLlyhWnTphETE0NSUpIrAK62bds2evXqRVBQ\nEAEBAfTt25esrCwA9u7dy3PPPcf27duB2oMiKSmJWbNm0b9/f6Kioti1axdjxowhMjKSX/3qV67n\nvfTSS7Rp04aFCxdy33338cYbbzBx4kTOnz8PwJAhQ1yz4N533301QiQjI4OHH37Ydf/LL7/k0Ucf\nJS0tjb59+wLmhJkDBgy4uYvPiNSRgkIaldzcXKZPn86BAwcICwtj9erV1z1n69atron0wPyB3r59\nOxcvXiQgIID777/fFRQ7duxg4MCB172HzWbjtttuIysri2effZZRo0axfPlyvvrqK9LS0iguLgbg\n3/7t31xXJATo378/mzdvpkWLFte95x/+8AdGjRrluv/pp5+6gsIwDEaPHs3SpUuvqychIYHNmzf/\nkN0k8oMoKKRR6dq1KzExMQD06dOnxiyZVY4dO0aHDh1c9wcOHMj27dvJzs4mISGBbt26ceTIEUpK\nSigrK6Nr1643/KyRI0cCEBMTQ0xMDCEhIQQHB9O9e/caLYOb8bvf/Y7g4GAmTZoEwOXLl3E6nXTp\n0gUwgyk5OZn/+q//orKyssZrO3XqRH5+/g/6PJEfQkEhjUrTpk1d64GBgdf9qFa5eoqze++9l127\ndrFt2zYGDBgAmFMxv/feezdsTVz7WQEBATU+NyAgoNbPvZG3336b9PR03nnnHde2LVu2kJiYWON5\nr7/+OgA///nPa2yvrKzUNVvEoxQU4nc6d+5MUVGR636LFi2w2+289dZbrqAYMGAAixcvvuUD2d8n\nIyODBQsWsHbtWpo1a1Zj+7VTYgcEBLBixQq+/vprZs+e7dp+/PhxOnfu7NE6xb8pKKRRufYv6xv9\npZ2YmMju3buv23b58mXCw8MBMyjy8vLctiiu/oy6/kU/Y8YMysrKSE5OJj4+3tVa2LRpE/fff/91\n36Np06asXbuWtWvXsmzZMsC8aM/gwYPr9PkiN0PTjIvfMQyD3r17s3PnToKDg60u5zpOp5NnnnmG\n9PT0731uZWUlvXv3Zvfu3QQFBTVAdeKP1KIQv2Oz2fjZz35W45iAN7Hb7TcVEmBeQ3zs2LEKCfEo\ntShERMQttShERMQtBYWIiLiloBAREbcUFCIi4paCQkRE3FJQiIiIW/8PoYB5jwfVkHkAAAAASUVO\nRK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x3886290>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (b) Air flow must provide a convection of = 51.01 W/m^2.K\n",
+ "\n",
+ " The code for the graph requires more than 10 min to run. \n",
+ "\n",
+ " To run it, please remove comments. It is perfectly correct. The reason it takes such a long time\n",
+ "\n",
+ " is that it needs to calculate using Newton raphson method at 100 points. Each point itself takes a minute.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_10.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_10.ipynb
new file mode 100644
index 00000000..e31dd90e
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_10.ipynb
@@ -0,0 +1,295 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Boiling and Condensation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1 Page 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Power Required by electruc heater to cause boiling\n",
+ "# Rate of water evaporation due to boiling\n",
+ "# Critical Heat flux corresponding to the burnout point\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 118+273. \t\t\t\t;#[K] Surface Temperature\n",
+ "Tsat = 100+273. \t\t\t\t;#[K] Saturated Temperature\n",
+ "D = .3 \t\t\t\t;#[m] Diameter of pan\n",
+ "g = 9.81 \t\t\t\t;#[m^2/s] gravitaional constant\n",
+ "#Table A.6 Saturated water Liquid Properties T = 373 K\n",
+ "rhol = 957.9 \t\t;#[kg/m^3] Density\n",
+ "cp = 4.217*math.pow(10,3) ;#[J/kg] Specific Heat\n",
+ "u = 279*math.pow(10,-6) ;#[N.s/m^2] Viscosity\n",
+ "Pr = 1.76 \t\t;# Prandtl Number\n",
+ "hfg = 2257*math.pow(10,3) ;#[J/kg] Specific Heat\n",
+ "si = 58.9*math.pow(10,-3) \t;#[N/m]\n",
+ "#Table A.6 Saturated water Vapor Properties T = 373 K\n",
+ "rhov = .5956 \t\t;#[kg/m^3] Density\n",
+ "\n",
+ "Te = Ts-Tsat;\n",
+ "#calculations\n",
+ "\n",
+ "#From Table 10.1\n",
+ "C = .0128;\n",
+ "n = 1.;\n",
+ "q = u*hfg*math.pow(g*(rhol-rhov)/si,.5)*math.pow((cp*Te/(C*hfg*math.pow(Pr,n))),3);\n",
+ "qs = q*math.pi*D*D/4.; \t\t\t#Boiling heat transfer rate\n",
+ " \n",
+ "m = qs/hfg; \t\t\t\t\t#Rate of evaporation\n",
+ "\n",
+ "qmax = .149*hfg*rhov*math.pow(si*g*(rhol-rhov)/(rhov*rhov),.25); \t#Critical heat flux\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n Boiling Heat transfer rate = \",qs/1000. ,\"kW\")\n",
+ "print '%s %d %s' %(\"\\n Rate of water evaporation due to boiling =\",m*3600 ,\"kg/h\")\n",
+ "print '%s %.2f %s' %(\"\\n Critical Heat flux corresponding to the burnout point =\",qmax/math.pow(10,6) ,\"MW/m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Boiling Heat transfer rate = 59.13 kW\n",
+ "\n",
+ " Rate of water evaporation due to boiling = 94 kg/h\n",
+ "\n",
+ " Critical Heat flux corresponding to the burnout point = 1.26 MW/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page 635"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Power Dissipation per unith length for the cylinder, qs\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 255+273. \t\t\t\t\t;#[K] Surface Temperature\n",
+ "Tsat = 100+273. \t\t\t\t\t;#[K] Saturated Temperature\n",
+ "D = 6*math.pow(10,-3) \t;#[m] Diameter of pan\n",
+ "e = 1 \t\t\t\t\t;# emissivity\n",
+ "stfncnstt=5.67*math.pow(10,(-8)) ;# [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "g = 9.81 \t\t\t\t\t;#[m^2/s] gravitaional constant\n",
+ "#Table A.6 Saturated water Liquid Properties T = 373 K\n",
+ "rhol = 957.9 \t\t\t;#[kg/m^3] Density\n",
+ "hfg = 2257*math.pow(10,3) \t;#[J/kg] Specific Heat\n",
+ "#Table A.4 Water Vapor Properties T = 450 K\n",
+ "rhov = .4902 \t\t\t;#[kg/m^3] Density\n",
+ "cpv = 1.98*math.pow(10,3) ;#[J/kg.K] Specific Heat\n",
+ "kv = 0.0299 \t\t\t;#[W/m.K] Conductivity\n",
+ "uv = 15.25*math.pow(10,-6) ;#[N.s/m^2] Viscosity\n",
+ "#calculations\n",
+ "\n",
+ "Te = Ts-Tsat;\n",
+ "\n",
+ "hconv = .62*math.pow((kv*kv*kv*rhov*(rhol-rhov)*g*(hfg+.8*cpv*Te)/(uv*D*Te)),.25);\n",
+ "hrad = e*stfncnstt*(math.pow(Ts,4)-math.pow(Tsat,4))/(Ts-Tsat);\n",
+ "\n",
+ "#From eqn 10.9 h^(4/3) = hconv^(4/3) + hrad*h^(1/3)\n",
+ "#Newton Raphson\n",
+ "h=250.; \t\t\t\t\t\t#Initial Assumption\n",
+ "while 1>0 :\n",
+ "\tf = math.pow(h,(4./3.)) - (math.pow(hconv,(4./3.)) + math.pow(hrad*h,(1./3.)));\n",
+ "\tfd = (4./3.)*math.pow(h,(1./3.)) - (1./3.)*hrad*math.pow(h,(-2./3.));\n",
+ "\thn=h-f/fd;\n",
+ "\tz=math.pow(hn,(4./3.)) - (math.pow(hconv,(4./3.)) + math.pow(hrad*hn,(1./3.)))\n",
+ "\tif z < .01:\n",
+ "\t\tbreak;\n",
+ "\th=hn;\n",
+ "\n",
+ "q = h*math.pi*D*Te; \t\t\t\t#power dissipation\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n Power Dissipation per unith length for the cylinder, qs= \",q,\"W/m\");\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error\")\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Power Dissipation per unith length for the cylinder, qs= 730 W/m\n",
+ "The answer is a bit different due to rounding off error\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page 648"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Heat Transfer and Condensation Rates\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 50+273. \t\t\t;#[K] Surface Temperature\n",
+ "Tsat = 100+273. \t\t\t;#[K] Saturated Temperature\n",
+ "D = .08 \t\t\t;#[m] Diameter of pan\n",
+ "g = 9.81 \t\t\t;#[m^2/s] gravitaional constant\n",
+ "L = 1 \t\t#[m] Length\n",
+ "#Table A.6 Saturated Vapor Properties p = 1.0133 bars\n",
+ "rhov = .596 \t\t;#[kg/m^3] Density\n",
+ "hfg = 2257*1000. \t;#[J/kg] Specific Heat\n",
+ "#Table A.6 Saturated water Liquid Properties T = 348 K\n",
+ "rhol = 975. \t\t;#[kg/m^3] Density\n",
+ "cpl = 4193. \t; #[J/kg.K] Specific Heat\n",
+ "kl = 0.668 \t;#[W/m.K] Conductivity\n",
+ "ul = 375*math.pow(10,-6) ;#[N.s/m^2] Viscosity\n",
+ "#calculations\n",
+ "\n",
+ "\n",
+ "uvl = ul/rhol \t;#[N.s.m/Kg] Kinematic viscosity\n",
+ "Ja = cpl*(Tsat-Ts)/hfg;\n",
+ "hfg2 = hfg*(1+.68*Ja);\n",
+ "\n",
+ "#Equation 10.43\n",
+ "Re = math.pow((3.70*kl*L*(Tsat-Ts)/(ul*hfg2*math.pow((uvl*uvl/g),.33334))+4.8),.82); #Reynolds number\n",
+ "\n",
+ "#From equation 10.41\n",
+ "hL = Re*ul*hfg2/(4*L*(Tsat-Ts)); \t\t#Transfer coefficient\n",
+ "q = hL*(math.pi*D*L)*(Tsat-Ts); \t\t#Heat transfer rate\n",
+ "\n",
+ "m = q/hfg;\t\t\t\t\t\t\t\t#Rate of condensation\n",
+ "#Using Equation 10.26\n",
+ "delta = math.pow((4*kl*ul*(Tsat-Ts)*L/(g*rhol*(rhol-rhov)*hfg2)),.25);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s %.4f %s' %(\"\\n Heat Transfer Rate = \",q/1000.,\"kW and Condensation Rates=\",m,\" kg/s\"); \n",
+ "print '%s %.3f %s %.2f %s' %(\"\\n And as del(L)\", delta*1000,\"<< (D/2)\", D/2. ,\"m use of vertical cylinder correlation is justified\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Heat Transfer Rate = 66.62 kW and Condensation Rates= 0.0295 kg/s\n",
+ "\n",
+ " And as del(L) 0.218 << (D/2) 0.04 m use of vertical cylinder correlation is justified\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4 Page 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Condensation rate per unit length of tubes\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 25+273. \t\t\t\t\t;#[K] Surface Temperature\n",
+ "Tsat = 54+273. \t\t\t\t\t;#[K] Saturated Temperature\n",
+ "D = .006 \t\t\t\t\t; #[m] Diameter of pan\n",
+ "g = 9.81 \t\t\t\t\t;#[m^2/s] gravitaional constant\n",
+ "N = 20 \t\t\t\t# No of tubes\n",
+ "\n",
+ "#Table A.6 Saturated Vapor Properties p = 1.015 bar\n",
+ "rhov = .098 \t\t\t\t;#[kg/m^3] Density\n",
+ "hfg = 2373*1000. \t\t\t;#[J/kg] Specific Heat\n",
+ "#Table A.6 Saturated water Liquid Properties Tf = 312.5 K\n",
+ "rhol = 992. \t\t\t\t;#[kg/m^3] Density\n",
+ "cpl = 4178. \t\t\t;#[J/kg.K] Specific Heat\n",
+ "kl = 0.631 \t\t\t; #[W/m.K] Conductivity\n",
+ "ul = 663*math.pow(10,-6) \t; #[N.s/m^2] Viscosity\n",
+ "#calculations\n",
+ "\n",
+ "Ja = cpl*(Tsat-Ts)/hfg;\t\t\t\t\n",
+ "hfg2 = hfg*(1+.68*Ja); \t\t\t\t#Coefficient of condensation\n",
+ "#Equation 10.46\n",
+ "h = .729*math.pow((g*rhol*(rhol-rhov)*kl*kl*kl*hfg2/(N*ul*(Tsat-Ts)*D)),.25);\n",
+ "#Equation 10.34\n",
+ "m1 = h*(math.pi*D)*(Tsat-Ts)/hfg2;\t#Average condensation rate\n",
+ "\n",
+ "m = N*N*m1;\t\t\t\t\t\t\t#Rate per unit length\n",
+ "#results\n",
+ "\n",
+ "print '%s %.3f %s' %(\"\\n For the complete array of tubes, the condensation per unit length is\",m ,\" kg/s.m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "EXAMPLE 10.4 Page 652 \n",
+ "\n",
+ "\n",
+ " For the complete array of tubes, the condensation per unit length is 0.463 kg/s.m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_11.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_11.ipynb
new file mode 100644
index 00000000..97945574
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_11.ipynb
@@ -0,0 +1,537 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Heat Exchangers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1 Page 680 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Tube Length to achieve a desired hot fluid temperature\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Tho = 60+273 \t\t\t\t\t\t\t;#[K] Hot Fluid outlet Temperature\n",
+ "Thi = 100+273 \t\t\t\t\t\t\t; #[K] Hot Fluid intlet Temperature\n",
+ "Tci = 30+273 \t\t\t\t\t\t\t;#[K] Cold Fluid intlet Temperature\n",
+ "mh = .1 \t\t\t\t\t\t\t;#[kg/s] Hot Fluid flow rate\n",
+ "mc = .2 \t\t\t\t\t\t\t;#[kg/s] Cold Fluid flow rate\n",
+ "Do = .045 \t\t\t\t\t\t\t;#[m] Outer annulus\n",
+ "Di = .025 \t\t\t\t\t\t\t;#[m] Inner tube\n",
+ "\n",
+ "#Table A.5 Engine Oil Properties T = 353 K\n",
+ "cph = 2131 \t\t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "kh = .138 \t\t\t\t\t; #[W/m.K] Conductivity\n",
+ "uh = 3.25/100. \t\t\t\t\t; #[N.s/m^2] Viscosity\n",
+ "#Table A.6 Saturated water Liquid Properties Tc = 308 K\n",
+ "cpc = 4178 \t\t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "kc = 0.625 \t\t\t\t\t; #[W/m.K] Conductivity\n",
+ "uc = 725*math.pow(10,-6) \t\t\t; #[N.s/m^2] Viscosity\n",
+ "Pr = 4.85 \t\t\t\t\t;#Prandtl Number\n",
+ "#calculations and results\n",
+ "\n",
+ "\n",
+ "q = mh*cph*(Thi-Tho); \t\t\t\t\t\t#Heat transferred\n",
+ "\n",
+ "Tco = q/(mc*cpc)+Tci;\n",
+ "\n",
+ "T1 = Thi-Tco;\n",
+ "T2 = Tho-Tci;\n",
+ "Tlm = (T1-T2)/(2.30*math.log10(T1/T2));\t\t#logarithmic mean temp. difference\n",
+ "\n",
+ "#Through Tube\n",
+ "Ret = 4*mc/(math.pi*Di*uc);\n",
+ "print '%s %.2f %s' %(\"\\n Flow through Tube has Reynolds Number as\", Ret,\" .Thus the flow is Turbulent\");\n",
+ "#Equation 8.60\n",
+ "Nut = .023*math.pow(Ret,.8)*math.pow(Pr,.4);#Nusselt number\n",
+ "hi = Nut*kc/Di;\n",
+ "\n",
+ "#Through Shell\n",
+ "Reo = 4*mh*(Do-Di)/(math.pi*uh*(Do*Do-Di*Di));\n",
+ "print '%s %.2f %s' %(\"\\n Flow through Tube has Reynolds Number as\",Reo,\". Thus the flow is Laminar\");\n",
+ "#Table 8.2\n",
+ "Nuo = 5.63;\n",
+ "ho = Nuo*kh/(Do-Di);\n",
+ "\n",
+ "U = 1./(1./hi+1./ho); \t\t\t\t\t\t#overall heat transfer coefficient\n",
+ "L = q/(U*math.pi*Di*Tlm); \t\t\t\t\t#Length\n",
+ "\n",
+ "print '%s %.2f' %(\"\\n Tube Length to achieve a desired hot fluid temperature is (m) = \",L);\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Flow through Tube has Reynolds Number as 14049.54 .Thus the flow is Turbulent\n",
+ "\n",
+ " Flow through Tube has Reynolds Number as 55.97 . Thus the flow is Laminar\n",
+ "\n",
+ " Tube Length to achieve a desired hot fluid temperature is (m) = 65.71\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2 Page 683"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Exterior Dimensions of heat Exchanger\n",
+ "# Pressure drops within the plate-type Heat exchanger with N=60 gaps\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linspace\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#Operating Conditions\n",
+ "Tho = 60.+273 \t\t\t;#[K] Hot Fluid outlet Temperature\n",
+ "Thi = 100.+273 \t\t\t;#[K] Hot Fluid intlet Temperature\n",
+ "Tci = 30.+273 \t\t\t;#[K] Cold Fluid intlet Temperature\n",
+ "mh = .1 \t\t\t;#[kg/s] Hot Fluid flow rate\n",
+ "mc = .2 \t\t\t;#[kg/s] Cold Fluid flow rate\n",
+ "Do = .045 \t\t\t;#[m] Outer annulus\n",
+ "Di = .025 \t\t\t;#[m] Inner tube\n",
+ "\n",
+ "#Table A.5 Engine Oil Properties T = 353 K\n",
+ "cph = 2131 \t;#[J/kg.K] Specific Heat\n",
+ "kh = .138 \t;#[W/m.K] Conductivity\n",
+ "uh = 3.25/100. \t;#[N.s/m^2] Viscosity\n",
+ "rhoh = 852.1 \t;#[kg/m^3] Density\n",
+ "#Table A.6 Saturated water Liquid Properties Tc = 308 K\n",
+ "cpc = 4178 \t;#[J/kg.K] Specific Heat\n",
+ "kc = 0.625 \t;#[W/m.K] Conductivity\n",
+ "uc = 725*math.pow(10,-6) ;#[N.s/m^2] Viscosity\n",
+ "Pr = 4.85 \t;#Prandtl Number\n",
+ "rhoc = 994 \t;#[kg/m^3] Density\n",
+ "#calculations\n",
+ "\n",
+ "q = mh*cph*(Thi-Tho); \t\t#Heat required\n",
+ "\n",
+ "Tco = q/(mc*cpc)+Tci;\n",
+ "\n",
+ "T1 = Thi-Tco;\n",
+ "T2 = Tho-Tci;\n",
+ "Tlm = (T1-T2)/(2.30*math.log10(T1/T2));\n",
+ "N=numpy.zeros(61)\n",
+ "for i in range (0,60):\n",
+ "\tN[i]=i+20;\n",
+ "\n",
+ "L = numpy.zeros(61)\n",
+ "for i in range (0,60):\n",
+ "\ta=float(N[i]);\n",
+ "\tL[i] = q/Tlm*(1./(7.54*kc/2.)+1/(7.54*kh/2.))/(a*a-a);\n",
+ "\n",
+ "pyplot.plot(N,L);\n",
+ "pyplot.xlabel(\"L (m)\");\n",
+ "pyplot.ylabel('Number of Gaps(N)')\n",
+ "pyplot.show()\n",
+ "#Close the graph to complete the execution\n",
+ "N2 = 60;\n",
+ "L = q/((N2-1)*N2*Tlm)*(1./(7.54*kc/2.)+1/(7.54*kh/2.));\n",
+ "a = L/N2;\n",
+ "Dh = 2*a \t\t\t;#Hydraulic Diameter [m]\n",
+ "#For water filled gaps\n",
+ "umc = mc/(rhoc*L*L/2.);\n",
+ "Rec = rhoc*umc*Dh/uc;\n",
+ "#For oil filled gaps\n",
+ "umh = mh/(rhoh*L*L/2.);\n",
+ "Reh = rhoh*umh*Dh/uh;\n",
+ "print '%s %.2f %s %.2f %s' %(\"\\n Flow of the fluids has Reynolds Number as\",Reh,\" & \",Rec,\" Thus the flow is Laminar for both\");\n",
+ "\n",
+ "#Equations 8.19 and 8.22a\n",
+ "delpc = 64/Rec*rhoc/2*umc*umc/Dh*L ;#For water\n",
+ "delph = 64/Reh*rhoh/2*umh*umh/Dh*L ;#For oil\n",
+ "\n",
+ "#For example 11.1\n",
+ "L1 = 65.9;\n",
+ "Dh1c = .025;\n",
+ "Dh1h = .02;\n",
+ "Ret = 4*mc/(math.pi*Di*uc);\n",
+ "f = math.pow((.790*2.30*math.log10(Ret)-1.64),-2) ;#friction factor through tube Eqn 8.21\n",
+ "umc1 = 4*mc/(rhoc*math.pi*Di*Di);\n",
+ "delpc1 = f*rhoc/2*umc1*umc1/Dh1c*L1;\n",
+ "Reo = 4*mh*(Do-Di)/(math.pi*uh*(Do*Do-Di*Di));\t\t \t#Reynolds number\n",
+ "umh1 = 4*mh/(rhoh*math.pi*(Do*Do-Di*Di));\n",
+ "delph1 = 64/Reo*rhoh/2*umh1*umh1/Dh1h*L1;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.3f %s' %(\"\\n Exterior Dimensions of heat Exchanger L =\",L,\"m\");\n",
+ "print '%s %.3f %s' %(\"\\n Pressure drops within the plate-type Heat exchanger with N=60 gaps\\n For water = \", delpc,\" N/m^2\") \n",
+ "print '%s %.3f %s' %(\" For oil = \",delph,\" N/m^2\\n \")\n",
+ "print '%s %.3f %s' %(\"Pressure drops tube Heat exchanger of example 11.1\\n For water = \",delpc1 ,\"N/m^2\") \n",
+ "print '%s %.3f %s' %(\"\\n For oil =\",delph1,\" N/m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Flow of the fluids has Reynolds Number as 1.57 & 140.77 Thus the flow is Laminar for both\n",
+ "\n",
+ " Exterior Dimensions of heat Exchanger L = 0.131 m\n",
+ "\n",
+ " Pressure drops within the plate-type Heat exchanger with N=60 gaps\n",
+ " For water = 3.768 N/m^2\n",
+ " For oil = 98.523 N/m^2\n",
+ " \n",
+ "Pressure drops tube Heat exchanger of example 11.1\n",
+ " For water = 6331.255 N/m^2\n",
+ "\n",
+ " For oil = 18287.329 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.3 Page 692"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Required gas side surface area\n",
+ "\n",
+ "#Operating Conditions\n",
+ "Tho = 100+273. \t\t\t\t;#[K] Hot Fluid outlet Temperature\n",
+ "Thi = 300+273. \t\t\t\t;#[K] Hot Fluid intlet Temperature\n",
+ "Tci = 35+273. \t\t\t\t;#[K] Cold Fluid intlet Temperature\n",
+ "Tco = 125+273. \t\t\t\t; #[K] Cold Fluid outlet Temperature\n",
+ "mc = 1 \t\t\t\t;#[kg/s] Cold Fluid flow rate\n",
+ "Uh = 100 \t\t\t\t;#[W/m^2.K] Coefficient of heat transfer\n",
+ "#Table A.5 Water Properties T = 353 K\n",
+ "cph = 1000 \t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "#Table A.6 Saturated water Liquid Properties Tc = 308 K\n",
+ "cpc = 4197 \t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "#calculations\n",
+ "\n",
+ "Cc = mc*cpc;\n",
+ "#Equation 11.6b and 11.7b\n",
+ "Ch = Cc*(Tco-Tci)/(Thi-Tho);\n",
+ "# Equation 11.18\n",
+ "qmax = Ch*(Thi-Tci); \t\t\t#Max. heat\n",
+ "#Equation 11.7b \n",
+ "q = mc*cpc*(Tco-Tci); \t\t\t#Heat available\n",
+ "\n",
+ "e = q/qmax; \n",
+ "ratio = Ch/Cc; \n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s %.2f' %(\"\\n As effectiveness is\", e,\" with Ratio Cmin/Cmax =\", ratio);\n",
+ "print '%s' %(\", It follows from figure 11.14 that NTU = 2.1\");\n",
+ "NTU = 2.1; \t\t\t\t\t\t#No. of transfer units\n",
+ "A = 2.1*Ch/Uh;\n",
+ "\n",
+ "print '%s %.2f' %(\"\\n Required gas side surface area (m^2) = \",A);\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As effectiveness is 0.75 with Ratio Cmin/Cmax = 0.45\n",
+ ", It follows from figure 11.14 that NTU = 2.1\n",
+ "\n",
+ " Required gas side surface area (m^2) = 39.66\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4 Page 695"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Heat Transfer Rate and Fluid Outlet Temperatures\n",
+ "\n",
+ "#Operating Conditions\n",
+ "Thi = 250+273. \t\t\t;#[K] Hot Fluid intlet Temperature\n",
+ "Tci = 35+273. \t\t\t;#[K] Cold Fluid intlet Temperature\n",
+ "mc = 1 \t\t\t;#[kg/s] Cold Fluid flow rate\n",
+ "mh = 1.5 \t\t\t; #[kg/s] Hot Fluid flow rate\n",
+ "Uh = 100 \t\t \t\t;#[W/m^2.K] Coefficient of heat transfer\n",
+ "Ah = 40 \t\t\t; #[m^2] Area\n",
+ "#Table A.5 Water Properties T = 353 K\n",
+ "cph = 1000. \t\t\t;#[J/kg.K] Specific Heat\n",
+ "#Table A.6 Saturated water Liquid Properties Tc = 308 K\n",
+ "cpc = 4197. \t\t\t;#[J/kg.K] Specific Heat\n",
+ "#calculations\n",
+ "\n",
+ "Cc = mc*cpc;\n",
+ "Ch = mh*cph;\n",
+ "Cmin = Ch;\n",
+ "Cmax = Cc;\n",
+ "\n",
+ "NTU = Uh*Ah/Cmin;\t\t\t#No.of transfer units\n",
+ "ratio = Cmin/Cmax;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f' %(\"\\n As Ratio Cmin/Cmax =\", ratio)\n",
+ "print '%s %.2f' %(\"and Number of transfer units NTU =\", NTU)\n",
+ "print '%s' %(\", It follows from figure 11.14 that e = .82\");\n",
+ "e = 0.82;\n",
+ "qmax = Cmin*(Thi-Tci);\t\t#Max. heat transferred\n",
+ "q = e*qmax; \t\t\t\t#Actual heat transferred\n",
+ "\n",
+ "#Equation 11.6b\n",
+ "Tco = q/(mc*cpc) + Tci;\n",
+ "#Equation 11.7b\n",
+ "Tho = -q/(mh*cph) + Thi;\n",
+ "print '%s %.2e %s' %(\"\\n Heat Transfer Rate =\",q,\" W \")\n",
+ "print '%s %.1f %s' %(\"\\n Fluid Outlet Temperatures Hot Fluid (Tho) =\" ,Tho-273,\"degC\") \n",
+ "print '%s %.2f %s'\t%(\"Cold Fluid (Tco) =\", Tco-273,\"degC\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As Ratio Cmin/Cmax = 0.36\n",
+ "and Number of transfer units NTU = 2.67\n",
+ ", It follows from figure 11.14 that e = .82\n",
+ "\n",
+ " Heat Transfer Rate = 2.64e+05 W \n",
+ "\n",
+ " Fluid Outlet Temperatures Hot Fluid (Tho) = 73.7 degC\n",
+ "Cold Fluid (Tco) = 98.01 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5 Page 696"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Outlet Temperature of cooling Water\n",
+ "# Tube length per pass to achieve required heat transfer\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "q = 2*math.pow(10,9) \t \t\t\t;#[W] Heat transfer Rate\n",
+ "ho = 11000. \t\t\t\t\t\t;#[W/m^2.K] Coefficient of heat transfer for outer surface\n",
+ "Thi = 50+273. \t\t\t\t\t\t;#[K] Hot Fluid Condensing Temperature\n",
+ "Tho = Thi \t\t\t\t\t\t\t;#[K] Hot Fluid Condensing Temperature\n",
+ "Tci = 20+273. \t\t\t\t\t\t;#[K] Cold Fluid intlet Temperature\n",
+ "mc = 3*math.pow(10,4) \t\t\t\t;#[kg/s] Cold Fluid flow rate\n",
+ "m = 1 \t\t\t\t\t\t;#[kg/s] Cold Fluid flow rate per tube\n",
+ "D = .025 \t\t\t\t\t\t;#[m] diameter of tube\n",
+ "#Table A.6 Saturated water Liquid Properties Tf = 300 K\n",
+ "rho = 997 \t\t\t\t\t\t;#[kg/m^3] Density\n",
+ "cp = 4179 \t\t\t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "k = 0.613 \t\t\t\t\t\t;#[W/m.K] Conductivity\n",
+ "u = 855*math.pow(10,-6) \t\t\t\t;#[N.s/m^2] Viscosity\n",
+ "Pr = 5.83 \t\t\t\t\t\t;# Prandtl number\n",
+ "#calculations and results\n",
+ "\n",
+ "#Equation 11.6b\n",
+ "Tco = q/(mc*cp) + Tci;\n",
+ "\n",
+ "Re = 4*m/(math.pi*D*u);\n",
+ "print '%s %.2f' %(\"\\n As the Reynolds number of tube fluid is\", Re)\n",
+ "print '%s' %(\". Hence the flow is turbulent. Hence using Diettus-Boetllor Equation 8.60\");\n",
+ "Nu = .023*math.pow(Re,.8)*math.pow(Pr,.4);\n",
+ "hi = Nu*k/D;\t\t\t\t\t\t\t#Heat transfer coefficient\n",
+ "U = 1/(1/ho + 1/hi); \t\t\t\t\t#Overall heat transfer coefficient\n",
+ "N = 30000. \t\t\t\t\t;#No of tubes\n",
+ "T1 = Thi-Tco;\n",
+ "T2 = Tho-Tci;\n",
+ "Tlm = (T1-T2)/(2.30*math.log10(T1/T2));#Logarithmic mean temp. difference\n",
+ "L2 = q/(U*N*2*math.pi*D*Tlm);\n",
+ "\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\n Outlet Temperature of cooling Water = \",Tco-273,\" degC\")\n",
+ "print '%s %.2f %s' %(\"\\n Tube length per pass to achieve required heat transfer =\",L2,\" m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As the Reynolds number of tube fluid is 59566.76\n",
+ ". Hence the flow is turbulent. Hence using Diettus-Boetllor Equation 8.60\n",
+ "\n",
+ " Outlet Temperature of cooling Water = 36.0 degC\n",
+ "\n",
+ " Tube length per pass to achieve required heat transfer = 4.51 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6 Page 702"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Gas-side overall heat transfer coefficient. Heat exchanger Volume\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "hc = 1500. \t\t\t\t\t\t\t\t;#[W/m^2.K] Coefficient of heat transfer for outer surface\n",
+ "hi = hc;\n",
+ "Th = 825. \t\t\t\t\t\t\t\t\t;#[K] Hot Fluid Temperature\n",
+ "Tci = 290. \t\t\t\t\t\t\t\t\t;#[K] Cold Fluid intlet Temperature\n",
+ "Tco = 370. \t\t\t\t\t\t\t\t\t;#[K] Cold Fluid outlet Temperature\n",
+ "mc = 1 \t\t\t\t\t\t\t\t;#[kg/s] Cold Fluid flow rate\n",
+ "mh = 1.25 \t\t\t\t\t \t\t\t;#[kg/s] Hot Fluid flow rate\n",
+ "Ah = .20 \t\t\t\t\t\t\t;#[m^2] Area of tubes\n",
+ "Di = .0138 \t\t\t\t\t\t\t\t;#[m] diameter of tube\n",
+ "Do = .0164 \t\t\t\t\t\t\t\t;#[m] Diameter\n",
+ "#Table A.6 Saturated water Liquid Properties Tf = 330 K\n",
+ "cpw = 4184. \t\t\t\t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "#Table A.1 Aluminium Properties T = 300 K\n",
+ "k = 237 \t\t\t\t\t\t\t;#[W/m.K] Conductivity\n",
+ "#Table A.4 Air Properties Tf = 700 K\n",
+ "cpa = 1075 \t\t\t\t\t\t\t\t;#[J/kg.K] Specific Heat\n",
+ "u = 33.88*math.pow(10,-6) \t\t\t\t\t;#[N.s/m^2] Viscosity\n",
+ "Pr = .695 \t\t\t\t\t\t\t\t;# Prandtl number\n",
+ "#calculations\n",
+ "\n",
+ "#Geometric Considerations\n",
+ "si = .449;\n",
+ "Dh = 6.68*math.pow(10,-3) \t\t\t\t;#[m] hydraulic diameter\n",
+ "G = mh/si/Ah;\n",
+ "Re = G*Dh/u; \t\t\t\t\t\t\t\t\t#Reynolds number\n",
+ "#From Figure 11.16\n",
+ "jh = .01;\n",
+ "hh = jh*G*cpa/math.pow(Pr,.66667); \t\t\t\t#Heat transfer coefficient\n",
+ "\n",
+ "AR = Di*2.303*math.log10(Do/Di)/(2*k*(.143));\t#Area of cross section\n",
+ "#Figure 11.16\n",
+ "AcAh = Di/Do*(1-.830);\n",
+ "#From figure 3.19\n",
+ "nf = .89;\n",
+ "noh = 1-(1-.89)*.83;\n",
+ "\n",
+ "U = 1/(1/(hc*AcAh) + AR + 1/(noh*hh));\t\t\t#Overall heat transfer coefficient\n",
+ "\n",
+ "Cc = mc*cpw;\n",
+ "q = Cc*(Tco-Tci); \t\t\t\t\t\t\t\t#Heat released\n",
+ "Ch = mh*cpa;\n",
+ "qmax = Ch*(Th-Tci); \t\t\t\t\t\t\t#MAx. heat transferred\n",
+ "e = q/qmax;\n",
+ "ratio = Ch/Cc;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s %.2f' %(\"\\n As effectiveness is\",e,\" with Ratio Cmin/Cmax = \",ratio)\n",
+ "print '%s' %(\", It follows from figure 11.14 that NTU = .65\");\n",
+ "NTU = .65;\n",
+ "A = NTU*Ch/U; \t\t\t\t\t\t\t\t\t#Area of cross section\n",
+ "#From Fig 11.16\n",
+ "al = 269.; \t\t\t\t\t\t\t#[m^-1] gas side area per unit heat wxchanger volume\n",
+ "V = A/al;\n",
+ "#Answers may vary a bit due to rounding off errors.!\n",
+ "print '%s %.2f %s' %(\"\\n Gas-side overall heat transfer coefficient.r =\", U , \"W/m^2.K\")\n",
+ "print '%s %.3f %s' %(\" \\n Heat exchanger Volume = \",V,\" m^3\");\n",
+ "#END;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As effectiveness is 0.47 with Ratio Cmin/Cmax = 0.32\n",
+ ", It follows from figure 11.14 that NTU = .65\n",
+ "\n",
+ " Gas-side overall heat transfer coefficient.r = 95.55 W/m^2.K\n",
+ " \n",
+ " Heat exchanger Volume = 0.034 m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_12.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_12.ipynb
new file mode 100644
index 00000000..25268933
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_12.ipynb
@@ -0,0 +1,767 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Radiation: Processes and Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.1 Page 731 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# a) Intensity of emission in each of the three directions\n",
+ "# b) Solid angles subtended by the three surfaces\n",
+ "# c) Rate at which radiation is intercepted by the three surfaces\n",
+ "\n",
+ "A1 = .001\t\t;#[m^2] Area of emitter\n",
+ "In = 7000\t\t;#[W/m^2.Sr] Intensity of radiation in normal direction\n",
+ "A2 = .001\t\t;#[m^2] Area of other intercepting plates\n",
+ "A3 = A2\t\t\t;#[m^2] Area of other intercepting plates\n",
+ "A4 = A2\t\t\t;#[m^2] Area of other intercepting plates\n",
+ "r = .5\t\t\t;#[m] Distance of each plate from emitter\n",
+ "theta1 = 60.\t;#[deg] Angle between surface 1 normal & direction of radiation to surface 2\n",
+ "theta2 = 30.\t;#[deg] Angle between surface 2 normal & direction of radiation to surface 1\n",
+ "theta3 = 45.\t;#[deg] Angle between surface 1 normal & direction of radiation to surface 4\n",
+ "#calculations\n",
+ "\n",
+ "#From equation 12.2\n",
+ "w31 = A3/(r*r);\n",
+ "w41 = w31;\n",
+ "w21 = A2*math.cos(theta2*0.0174532925)/(r*r);\n",
+ "\n",
+ "\n",
+ "#From equation 12.6\n",
+ "q12 = In*A1*math.cos(theta1*0.0174532925)*w21;\n",
+ "q13 = In*A1*math.cos(0*math.pi/180.)*w31;\n",
+ "q14 = In*A1*math.cos(theta3*0.0174532925)*w41;\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n (a) As Intensity of emitted radiation is independent of direction, for each of the three directions I = \",In,\"W/m^2.sr\")\n",
+ "print '%s' %(\"\\n\\n (b) By the Three Surfaces\\n Solid angles subtended Rate at which radiation is intercepted \\n\")\n",
+ "print '%s %.2e %s' %(\"w4-1 =\",w41,\" sr\")\n",
+ "print '%s %.2e %s' %(\"\\t \\t \\t \\t \\t \\t q1-4 =\",q14,\" W\") \n",
+ "print '%s %.2e %s' %(\"\\nw3-1 = \",w31,\" sr\")\n",
+ "print '%s %.2e %s' %(\"\\t \\t \\t \\t \\t \\t q1-3 =\",q13,\" W\")\n",
+ "print '%s %.2e %s' %(\"\\n w2-1 = \",w21,\" sr\")\n",
+ "print '%s %.2e %s' %(\"\\t \\t \\t \\t \\t \\tq1-2 = \",q12,\" W \");\n",
+ "#END\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) As Intensity of emitted radiation is independent of direction, for each of the three directions I = 7000 W/m^2.sr\n",
+ "\n",
+ "\n",
+ " (b) By the Three Surfaces\n",
+ " Solid angles subtended Rate at which radiation is intercepted \n",
+ "\n",
+ "w4-1 = 4.00e-03 sr\n",
+ "\t \t \t \t \t \t q1-4 = 1.98e-02 W\n",
+ "\n",
+ "w3-1 = 4.00e-03 sr\n",
+ "\t \t \t \t \t \t q1-3 = 2.80e-02 W\n",
+ "\n",
+ " w2-1 = 3.46e-03 sr\n",
+ "\t \t \t \t \t \tq1-2 = 1.21e-02 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page 734"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "import math\n",
+ "import matplotlib.pyplot as plt\n",
+ "%pylab inline\n",
+ "# Total Irradiation\n",
+ "#calculations\n",
+ "\n",
+ "x=([0, 5, 20, 25]);\n",
+ "y=([0, 1000, 1000, 0]);\n",
+ "\n",
+ "plt.plot(x,y);\n",
+ "plt.xlabel(\"Spectral Distribution\")\n",
+ "plt.ylabel(\"wavelength (micro-m)\")\n",
+ "#By Equation 12.4\n",
+ "G = 1000*(5-0)/2. +1000*(20-5)+1000*(25-20)/2.;\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n G =\",G,\" W/m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "\n",
+ " G = 20000 W/m^2"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEPCAYAAAC+35gCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1UVHX+B/D3QJpupqWAFpC05BMww6OkBooPxAJaWT7Q\nCq5rttqpzE61uf22QO1EtKmpdZTNzLOQ/TSzXylIiomPiYqaYhvHDHSGJEB8VlLi+/tj5AYKzgxz\nZ+69M+/XOXPWuczM/TDNzofv9973/eqEEAJERERW8FC6ACIi0g42DSIishqbBhERWY1Ng4iIrMam\nQUREVmPTICIiqzmsaUydOhU9e/aEXq+XttXV1SE+Ph4GgwEJCQk4e/as9LPMzEwEBQVBr9dj06ZN\n0vaSkhKEh4cjODgYL7zwgqPKJSIiKzisafz1r39FQUF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GERFZjU2DiIisxqZBRERWY9MgIiKrsWkQEZHV2DSIiMhq/w/7Ws1RmQme\nagAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x391dbd0>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page 741"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Spectral Emissive Power of a small aperture on the enclosure\n",
+ "# wavelengths below which and above which 10% of the radiation is concentrated\n",
+ "# Spectral emissive power and wavelength associated with maximum emission\n",
+ "# Irradiation on a small object inside the enclosure\n",
+ "\n",
+ "T = 2000.\t\t\t\t\t\t\t\t;#[K] temperature of surface\n",
+ "stfncnstt = 5.67*math.pow(10,-8)\t\t;#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "E = stfncnstt*T*T*T*T; \t\t\t#[W/m^2]\n",
+ "#calculations\n",
+ "\n",
+ "#From Table 12.1 \n",
+ "constt1 = 2195. ; \t\t\t\t\t#[micro-m.K]\n",
+ "wl1 = constt1/T;\n",
+ "#From Table 12.1 \n",
+ "constt2 = 9382. ; \t\t\t\t\t#[micro-m.K]\n",
+ "wl2 = constt2/T;\n",
+ "\n",
+ "#From Weins Law, wlmax*T = consttmax = 2898 micro-m.K\n",
+ "consttmax = 2898 \t\t\t\t;#micro-m.K\n",
+ "wlmax = consttmax/T;\n",
+ "#from Table 12.1 at wlmax = 1.45 micro-m.K and T = 2000 K\n",
+ "I = .722*stfncnstt*T*T*T*T*T/10000.;\n",
+ "Eb = math.pi*I;\n",
+ "\n",
+ "G = E; #[W/m^2] Irradiation of any small object inside the enclosure is equal to emission from blackbody at enclosure temperature\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n (a) Spectral Emissive Power of a small aperture on the enclosure =\",E,\" W/m^2.Sr for each of the three directions\")\n",
+ "print '%s %.1f %s' %(\"\\n (b) Wavelength below which 10percent of the radiation is concentrated = \",wl1,\" micro-m \\n\") \n",
+ "print '%s %.2f %s' %(\" Wavelength above which 10percent of the radiation is concentrated = \",wl2,\" micro-m \\n\")\n",
+ "print '%s %.2e %s %.2e %s' %(\"(c) Spectral emissive power and wavelength associated with maximum emission is \",Eb,\"micro-m and\",wlmax,\" W/m^2.micro-m respectively\")\n",
+ "print '%s %.2e %s' %(\"\\n (d) Irradiation on a small object inside the enclosure =\",G,\"W/m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Spectral Emissive Power of a small aperture on the enclosure = 9.07e+05 W/m^2.Sr for each of the three directions\n",
+ "\n",
+ " (b) Wavelength below which 10percent of the radiation is concentrated = 1.1 micro-m \n",
+ "\n",
+ " Wavelength above which 10percent of the radiation is concentrated = 4.69 micro-m \n",
+ "\n",
+ "(c) Spectral emissive power and wavelength associated with maximum emission is 4.12e+05 micro-m and 1.45e+00 W/m^2.micro-m respectively\n",
+ "\n",
+ " (d) Irradiation on a small object inside the enclosure = 9.07e+05 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page 743 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "import scipy\n",
+ "from scipy import integrate\n",
+ "# Rate of emission per unit area over all directions between 0 degC and 60 degC and over all wavelengths between wavelengths 2 and 4 micro-m\n",
+ "\n",
+ "T = 1500.\t\t\t\t\t\t\t\t;#[K] temperature of surface\n",
+ "stfncnstt = 5.67*math.pow(10,-8)\t\t;#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "#calculations\n",
+ "\n",
+ "#From Equation 12.26 Black Body Radiation\n",
+ "Eb = stfncnstt*T*T*T*T; \t\t\t#[W/m^2]\n",
+ "\n",
+ "#From Table 12.1 as wl1*T = 2*1500 (micro-m.K)\n",
+ "F02 = .273;\n",
+ "#From Table 12.1 as wl2*T = 4*1500 (micro-m.K)\n",
+ "F04 = .738;\n",
+ "def func(x):\n",
+ "\tfunc = 2*math.cos(x) *math.sin(x)\n",
+ "\treturn func;\n",
+ "\n",
+ "#From equation 12.10 and 12.11\n",
+ "i1 = scipy.integrate.quad(func,0,math.pi/3.);\n",
+ "delE = i1[0] *(F04-F02)*Eb;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n Rate of emission per unit area over all directions between 0 degC and 60 degC and over all wavelengths between wavelengths 2 micro-m and 4 micro-m =\",delE,\" W/m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Rate of emission per unit area over all directions between 0 degC and 60 degC and over all wavelengths between wavelengths 2 micro-m and 4 micro-m = 1.00e+05 W/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.5 Page 748"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Total hemispherical emissivity\n",
+ "# Total emissive Power\n",
+ "# Wavelength at which spectral emissive power will be maximum\n",
+ "\n",
+ "T = 1600.\t\t\t\t\t\t\t\t;#[K] temperature of surface\n",
+ "wl1 = 2 \t\t\t\t\t\t;#[micro-m] wavelength 1\n",
+ "wl2 = 5 \t\t\t\t\t\t;#[micro-m] wavelength 2\n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "# From the given graph of emissivities\n",
+ "e1 = .4;\n",
+ "e2 = .8;\n",
+ "#calculations\n",
+ "\n",
+ "#From Equation 12.26 Black Body Radiation\n",
+ "Eb = stfncnstt*T*T*T*T; \t \t\t#[W/m^2]\n",
+ "\n",
+ "#Solution (A)\n",
+ "#From Table 12.1 as wl1*T = 2*1600 (micro-m.K)\n",
+ "F02 = .318;\n",
+ "#From Table 12.1 as wl2*T = 5*1600 (micro-m.K)\n",
+ "F05 = .856;\n",
+ "#From Equation 12.36\n",
+ "e = e1*F02 + e2*(F05 - F02);\n",
+ "\n",
+ "#Solution (B)\n",
+ "#From equation 12.35\n",
+ "E = e*Eb;\n",
+ "\n",
+ "#Solution (C)\n",
+ "#For maximum condition Using Weins Law\n",
+ "consttmax = 2898. \t\t\t\t;#[micro-m.K]\n",
+ "wlmax = consttmax/T;\n",
+ "\n",
+ "#equation 12.32 with Table 12.1\n",
+ "E1 = math.pi*e1*.722*stfncnstt*T*T*T*T*T/10000.;\n",
+ "\n",
+ "E2 = math.pi*e2*.706*stfncnstt*T*T*T*T*T/10000.;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.3f' %(\"\\n (a) Total hemispherical emissivity =\",e)\n",
+ "print '%s %d %s' %(\"\\n (b) Total emissive Power =\",E/1000. ,\" kW/m^2\")\n",
+ "print '%s %.1f %s %.1f %s ' %(\"\\n (c) Emissive Power at wavelength 2micro-m is greater than Emissive power at maximum wavelength \\n i.e.\",E2/1000.,\" kW/m^2 >\",E1/1000.,\" kW/m^2\")\n",
+ "print '%s %d %s' %(\"\\n Thus, Peak emission occurs at\",wl1,\"micro-m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Total hemispherical emissivity = 0.558\n",
+ "\n",
+ " (b) Total emissive Power = 207 kW/m^2\n",
+ "\n",
+ " (c) Emissive Power at wavelength 2micro-m is greater than Emissive power at maximum wavelength \n",
+ " i.e. 105.5 kW/m^2 > 53.9 kW/m^2 \n",
+ "\n",
+ " Thus, Peak emission occurs at 2 micro-m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.6 Page 751"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "import scipy\n",
+ "from scipy import integrate\n",
+ "# Spectral , Normal emissivity en and spectral hemispherical emissivity e\n",
+ "# Spectral normal intensity In and Spectral emissive power\n",
+ "\n",
+ "T = 2000.\t\t\t\t\t\t\t\t;#[K] temperature of surface\n",
+ "wl = 1 \t\t\t\t\t\t;#[micro-m] wavelength \n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "\n",
+ "# From the given graph of emissivities\n",
+ "e1 = .3;\n",
+ "e2 = .6;\n",
+ "#calculations\n",
+ "\n",
+ "#From Equation 12.26 Black Body Radiation\n",
+ "Eb = stfncnstt*T*T*T*T; \t\t\t\t\t\t#[W/m^2]\n",
+ "def func1(x):\n",
+ "\tfunc1=e1*math.cos(x) *math.sin(x);\n",
+ "\treturn func1;\n",
+ "\n",
+ "def func2(x):\n",
+ "\tfunc2=e2*math.cos(x) *math.sin(x);\n",
+ "\treturn func2;\n",
+ "\n",
+ "#Equation 12.34\n",
+ "i1 = scipy.integrate.quad(func1,0,math.pi/3.);\n",
+ "i2 = scipy.integrate.quad(func2,math.pi/3. ,4*math.pi/9.);\n",
+ "e = 2*(i1[0]+i2[0]);\n",
+ "\n",
+ "# From Table 12.1 at wl = 1 micro-m and T = 2000 K.\n",
+ "\n",
+ "I = .493*math.pow(10,-4) * stfncnstt*T*T*T*T*T ;#[W/m^2.micro-m.sr]\n",
+ "\n",
+ "In = e1*I;\n",
+ "\n",
+ "#Using Equation 12.32 for wl = 1 micro-m and T = 2000 K\n",
+ "E = e*math.pi*I;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.1f' %('\\n Spectral Normal emissivity en =',e1)\n",
+ "print '%s %.2f' %('and spectral hemispherical emissivity e = ',e)\n",
+ "print '%s %.2e %s' %('\\n Spectral normal intensity In =',In,' W/m^2.micro-m.sr')\n",
+ "print '%s %.1e %s' % ('and Spectral emissive power =',E,' W/m^2.micro-m.sr ');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Spectral Normal emissivity en = 0.3\n",
+ "and spectral hemispherical emissivity e = 0.36\n",
+ "\n",
+ " Spectral normal intensity In = 2.68e+04 W/m^2.micro-m.sr\n",
+ "and Spectral emissive power = 1.0e+05 W/m^2.micro-m.sr \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.7 Page 759"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "%pylab inline\n",
+ "# Spectral distribution of reflectivity\n",
+ "# Total, hemispherical absorptivity\n",
+ "# Nature of surface temperature change\n",
+ "\n",
+ "T = 500.\t\t\t\t\t\t\t\t;#[K] temperature of surface\n",
+ "e = .8;\n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "#calculations\n",
+ "\n",
+ "x=([0, 6, 8, 16]);\n",
+ "y=([.8, .8, 0, 0]);\n",
+ "\n",
+ "pyplot.xlabel(\"Spectral Distribution of reflectivity\")\n",
+ "pyplot.ylabel(\"wavelength (micro-m)\");\n",
+ "pyplot.plot(x,y);\n",
+ "pyplot.show();\n",
+ "\n",
+ "\n",
+ "#From equation 12.43 and 12.44\n",
+ "Gabs = (.2*500/2.*(6.-2.)+500*(.2*(8.-6.)+(1.-.2)*(8.-6.)/2.)+1*500*(12.-8.)+500*(16.-12.)/2.) ;#[w/m^2]\n",
+ "G = (500*(6.-2.)/2.+500*(12.-6.)+500*(16.-12.)/2.) \t\t\t\t\t\t\t\t\t;#[w/m^2]\n",
+ "a = Gabs/G;\n",
+ "\n",
+ "#Neglecting convection effects net het flux to the surface\n",
+ "qnet = a*G - e*stfncnstt*T*T*T*T;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f' %('\\n Total, hemispherical absorptivity',a)\n",
+ "print '%s %.2f %s' %('\\n Nature of surface temperature change =',qnet,' W/m^2 \\n Since qnet > 0, the sirface temperature will increase with the time');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEPCAYAAABCyrPIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9cVFXeB/DPICAk/sgfkDIULprIOA4zwBimOSpGpGhP\npdgmpmZLviofd82srU0ss8U0K/d5CNc2nzVNybbSKCrTUVGX/E1YkRnqDIrmT1QUgTnPHyOzjAzM\njM6dO8Dn/XrxigvnXj5Azpd7zj3nKIQQAkRE1Or5yR2AiIh8AwsCEREBYEEgIqJrWBCIiAgACwIR\nEV3DgkBERAAkLgj5+flQq9WIiYlBVlZWg8+fPn0aKSkpUKlUGDBgAA4cOCBlHCIiaoJkBaGqqgrT\npk1Dfn4+ioqKsHbtWuzdu9euTWZmJgYOHIgDBw7gn//8J5544gmp4hARkROSFYTCwkKoVCqEh4fD\n398faWlpyMvLs2tTUlKCoUOHAgD69OmDkydP4vjx41JFIiKiJkhWEMxmMyIiImzHSqUSZrPZro1a\nrca//vUvAMB3332HI0eO4OjRo1JFIiKiJkhWEBQKhdM2c+bMwYkTJ6BS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ORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2fec390>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Total, hemispherical absorptivity 0.76\n",
+ "\n",
+ " Nature of surface temperature change = 965.00 W/m^2 \n",
+ " Since qnet > 0, the sirface temperature will increase with the time\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.8 Page 761"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "import math\n",
+ "# Total emissivity of cover glass to solar radiation\n",
+ "\n",
+ "T = 5800.\t\t\t\t\t\t\t\t;#[K] temperature of surface\n",
+ "e = .8;\n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "#calculations and results\n",
+ "\n",
+ "#From Table 12.1\n",
+ "#For wl1 = .3 micro-m and T = 5800 K, At wl1*T = 1740 micro-m.K\n",
+ "F0wl1 = .0335;\n",
+ "#For wl1 = .3 micro-m and T = 5800 K, At wl2*T = 14500 micro-m.K\n",
+ "F0wl2 = .9664;\n",
+ "\n",
+ "#Hence from equation 12.29\n",
+ "t = .90*(F0wl2 - F0wl1);\n",
+ "\n",
+ "print '%s %.2f' %('\\n Total emissivity of cover glass to solar radiation =',t);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Total emissivity of cover glass to solar radiation = 0.84\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.9 Page 766"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Total hemispherical emissivity of fire brick wall\n",
+ "# Total emissive power of brick wall\n",
+ "# Absorptivity of the wall to irradiation from coals\n",
+ "\n",
+ "Ts = 500.\t\t\t\t\t\t\t;#[K] temperature of brick surface\n",
+ "Tc = 2000. \t\t\t\t;#[K] Temperature of coal exposed\n",
+ "stfncnstt = 5.67*math.pow(10,-8)\t;#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "# From the given graph of emissivities\n",
+ "e1 = .1; \t\t\t\t\t\t#between wavelength 0 micro-m- 1.5 micro-m\n",
+ "e2 = .5; \t\t\t\t\t\t#between wavelength 1.5 micro-m- 10 micro-m\n",
+ "e3 = .8; \t\t\t\t\t\t#greater than wavelength 10 micro-m\n",
+ "#calculations\n",
+ "\n",
+ "#From Table 12.1\n",
+ "#For wl1 = 1.5 micro-m and T = 500 K, At wl1*T = 750 micro-m.K\n",
+ "F0wl1 = 0;\n",
+ "#For wl2 = 10 micro-m and T = 500 K, At wl2*T = 5000 micro-m.K\n",
+ "F0wl2 = .634;\n",
+ "#From equation 12.36\n",
+ "e = e1*F0wl1 + e2*F0wl2 + e3*(1-F0wl1-F0wl2);\n",
+ "\n",
+ "#Equation 12.26 and 12.35\n",
+ "E = e*stfncnstt*Ts*Ts*Ts*Ts;\n",
+ "\n",
+ "#From Table 12.1\n",
+ "#For wl1 = 1.5 micro-m and T = 2000 K, At wl1*T = 3000 micro-m.K\n",
+ "F0wl1c = 0.273;\n",
+ "#For wl2 = 10 micro-m and T = 2000 K, At wl2*T = 20000 micro-m.K\n",
+ "F0wl2c = .986;\n",
+ "ac = e1*F0wl1c + e2*(F0wl2c-F0wl1c) + e3*(1-F0wl2c);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.3f' %('\\n Total hemispherical emissivity of fire brick wall =',e)\n",
+ "print '%s %d %s' %('\\n Total emissive power of brick wall =',E,'W/m^2.')\n",
+ "print '%s %.3f' %('\\n Absorptivity of the wall to irradiation from coals =',ac);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Total hemispherical emissivity of fire brick wall = 0.610\n",
+ "\n",
+ " Total emissive power of brick wall = 2160 W/m^2.\n",
+ "\n",
+ " Absorptivity of the wall to irradiation from coals = 0.395\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.10 Page 768"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Total hemispherical absorptivity and emissivity of sphere for initial condition\n",
+ "# values of absoprtivity and emissivity after sphere has been in furnace a long time\n",
+ "\n",
+ "Ts = 300.;\t\t\t\t\t\t\t#[K] temperature of surface\n",
+ "Tf = 1200; \t\t\t\t#[K] Temperature of Furnace\n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "# From the given graph of absorptivities\n",
+ "a1 = .8; \t\t\t\t\t\t#between wavelength 0 micro-m- 5 micro-m\n",
+ "a2 = .1; \t\t\t\t\t\t#greater than wavelength 5 micro-m\n",
+ "#calculations\n",
+ "\n",
+ "#From Table 12.1\n",
+ "#For wl1 = 5 micro-m and T = 1200 K, At wl1*T = 6000 micro-m.K\n",
+ "F0wl1 = 0.738;\n",
+ "#From equation 12.44\n",
+ "a = a1*F0wl1 + a2*(1-F0wl1);\n",
+ "#From Table 12.1\n",
+ "#For wl1 = 5 micro-m and T = 300 K, At wl1*T = 1500 micro-m.K\n",
+ "F0wl1s = 0.014;\n",
+ "#From equation 12.36\n",
+ "e = a1*F0wl1s + a2*(1-F0wl1s);\n",
+ "#results\n",
+ "\n",
+ "print' %s %.2f' %('\\n For Initial Condition \\n Total hemispherical absorptivity = ',a)\n",
+ "print '%s %.2f' %('Emissivity of sphere =',e)\n",
+ "print '%s' %('\\n\\n Beacuase the spectral characteristics of the coating and the furnace temeprature remain fixed, there is no change in the value of absorptivity with increasing time.')\n",
+ "print '%s %d %s %.2f' %('\\n Hence, After a sufficiently long time, Ts = Tf = ',Tf,' K and emissivity equals absorptivity e = a = ',a);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ " For Initial Condition \n",
+ " Total hemispherical absorptivity = 0.62\n",
+ "Emissivity of sphere = 0.11\n",
+ "\n",
+ "\n",
+ " Beacuase the spectral characteristics of the coating and the furnace temeprature remain fixed, there is no change in the value of absorptivity with increasing time.\n",
+ "\n",
+ " Hence, After a sufficiently long time, Ts = Tf = 1200 K and emissivity equals absorptivity e = a = 0.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.11 Page 774"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Useful heat removal rate per unit area\n",
+ "# Efficiency of the collector\n",
+ "\n",
+ "Ts = 120+273.;\t\t\t\t\t\t\t#[K] temperature of surface\n",
+ "Gs = 750; \t\t\t\t#[W/m^2] Solar irradiation\n",
+ "Tsky = -10+273.; \t\t\t\t#[K] Temperature of Sky\n",
+ "Tsurr = 30+273.; \t \t\t\t#[K] Temperature os surrounding Air\n",
+ "e = .1 \t\t \t\t\t;# emissivity \n",
+ "ast = .95 \t\t\t\t;# Absorptivity of Surface\n",
+ "asky = e \t\t\t\t;# Absorptivity of Sky\n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "#calculations\n",
+ "\n",
+ "h = 0.22*math.pow((Ts - Tsurr),.3334);\t#[W/m^2.K] Convective Heat transfer Coeff\n",
+ "#From equation 12.67\n",
+ "Gsky = stfncnstt*Tsky*Tsky*Tsky*Tsky; \t#[W/m^2] Irradiadtion from sky\n",
+ "qconv = h*(Ts-Tsurr); \t\t\t#[W/m^2] Convective Heat transfer\n",
+ "E = e*stfncnstt*Ts*Ts*Ts*Ts; \t\t#[W/m^2] Irradiadtion from Surface\n",
+ "\n",
+ "#From energy Balance\n",
+ "q = ast*Gs + asky*Gsky - qconv - E;\n",
+ "\n",
+ "#Collector efficiency\n",
+ "eff = q/Gs;\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %('\\n Useful heat removal rate per unit area by Energy Conservation = ',q,'W/m^2')\n",
+ "print '%s %.2f' %('\\n Collector efficiency defined as the fraction of solar irradiation extracted as useful energy is',eff);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Useful heat removal rate per unit area by Energy Conservation = 515 W/m^2\n",
+ "\n",
+ " Collector efficiency defined as the fraction of solar irradiation extracted as useful energy is 0.69\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_13.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_13.ipynb
new file mode 100644
index 00000000..2b72fa5a
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_13.ipynb
@@ -0,0 +1,398 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Radiation Exchange between surfaces"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2 Page 821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "\n",
+ "# View Factors of known surface Geometries\n",
+ "import math\n",
+ "# (1) Sphere within Cube\n",
+ "F12a = 1 \t\t;#By Inspection\n",
+ "F21a = (math.pi/6.)*F12a \t; #By Reciprocity\n",
+ "#calculations\n",
+ "\n",
+ "# (2) Partition within a Square Duct\n",
+ "F11b = 0 \t\t;#By Inspection\n",
+ "#By Symmetry F12 = F13\n",
+ "F12b = (1-F11b)/2. ;\t\t #By Summation Rule\n",
+ "F21b = math.sqrt(2.)*F12b ; #By Reciprocity\n",
+ "\n",
+ "# (3) Circular Tube\n",
+ "#From Table 13.2 or 13.5, with r3/L = 0.5 and L/r1 = 2\n",
+ "F13c = .172;\n",
+ "F11c = 0; \t\t#By Inspection\n",
+ "F12c = 1 - F11c - F13c \t\t;#By Summation Rule\n",
+ "F21c = F12c/4. \t\t;#By Reciprocity\n",
+ "#results\n",
+ "\n",
+ "print' %s' %('\\n Desired View Factors may be obtained from inspection, the reciprocity rule, the summation rule and/or use of charts')\n",
+ "print '%s %.3f' %('\\n (1) Sphere within Cube F21 =',F21a)\n",
+ "print '%s %.3f' %('\\n (2) Partition within a Square Duct F21 = ',F21b)\n",
+ "print '%s %.3f' %('\\n (3) Circular Tube F21 =',F21c);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ " Desired View Factors may be obtained from inspection, the reciprocity rule, the summation rule and/or use of charts\n",
+ "\n",
+ " (1) Sphere within Cube F21 = 0.524\n",
+ "\n",
+ " (2) Partition within a Square Duct F21 = 0.707\n",
+ "\n",
+ " (3) Circular Tube F21 = 0.207\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3 Page 826"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "# Net rate of Heat transfer to the absorber surface\n",
+ "\n",
+ "L = 10 \t;#[m] Collector length = Heater Length\n",
+ "T2 = 600 \t;#[K] Temperature of curved surface\n",
+ "A2 = 15 \t;#[m^2] Area of curved surface\n",
+ "e2 = .5 \t;# emissivity of curved surface\n",
+ "stfncnstt = 5.67*math.pow(10,-8);\t\t#[W/m^2.K^4] Stefan-Boltzmann constant\n",
+ "T1 = 1000 ;#[K] Temperature of heater\n",
+ "A1 = 10 ;#[m^2] area of heater\n",
+ "e1 = .9 ;# emissivity of heater\n",
+ "W = 1 ;#[m] Width of heater\n",
+ "H = 1 ;#[m] Height\n",
+ "T3 = 300 ;#[K] Temperature of surrounding\n",
+ "e3 = 1 ;# emissivity of surrounding\n",
+ "#calculations\n",
+ "\n",
+ "J3 = stfncnstt*T3*T3*T3*T3; #[W/m^2]\n",
+ "#From Figure 13.4 or Table 13.2, with Y/L = 10 and X/L =1\n",
+ "F12 = .39;\n",
+ "F13 = 1 - F12; \t\t\t#By Summation Rule\n",
+ "#For a hypothetical surface A2h\n",
+ "A2h = L*W;\n",
+ "F2h3 = F13; \t\t\t#By Symmetry\n",
+ "F23 = A2h/A2*F13; \t#By reciprocity\n",
+ "Eb1 = stfncnstt*T1*T1*T1*T1;#[W/m^2]\n",
+ "Eb2 = stfncnstt*T2*T2*T2*T2;#[W/m^2]\n",
+ "#Radiation network analysis at Node corresponding 1\n",
+ "#-10J1 + 0.39J2 = -510582\n",
+ "#.26J1 - 1.67J2 = -7536\n",
+ "#Solving above equations\n",
+ "A = ([[-10 ,.39],\n",
+ " [.26, -1.67]]);\n",
+ "B = ([[-510582.],\n",
+ " [-7536.]]);\n",
+ "\n",
+ "X = numpy.linalg.solve (A,B);\n",
+ "\n",
+ "q2 = (Eb2 - X[1])/(1-e2)*(e2*A2);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.1f %s' %('\\n Net Heat transfer rate to the absorber is = ',q2/1000. ,'kW');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Net Heat transfer rate to the absorber is = -77.8 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4 Page 830"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Power required to maintain prescribed temperatures\n",
+ "\n",
+ "T3 = 300. \t\t\t\t\t;#[K] Temperature of surrounding\n",
+ "L = .15 \t\t\t\t\t\t;#[m] Furnace Length\n",
+ "T2 = 1650+273. \t\t\t\t;#[K] Temperature of bottom surface\n",
+ "T1 = 1350+273. \t\t\t\t;#[K] Temperature of sides of furnace\n",
+ "D = .075 \t\t\t\t\t;#[m] Diameter of furnace\n",
+ "stfncnstt = 5.670*math.pow(10,-8); #[W/m^2.K^4] Stefan Boltzman Constant\n",
+ "#calculations\n",
+ "\n",
+ "A2 = math.pi*D*D/4. \t\t\t;#[m] Area of bottom surface\n",
+ "A1 = math.pi*D*L \t \t\t;#[m] Area of curved sides\n",
+ "#From Figure 13.5 or Table 13.2, with ri/L = .25 \n",
+ "F23 = .056;\n",
+ "F21 = 1 - F23; \t\t\t\t#By Summation Rule\n",
+ "F12 = A2/A1*F21; \t\t\t#By reciprocity\n",
+ "F13 = F12 \t\t\t\t;#By Symmetry\n",
+ "#From Equation 13.17 Heat balance\n",
+ "q = A1*F13*stfncnstt*(T1*T1*T1*T1 - T3*T3*T3*T3) + A2*F23*stfncnstt*(T2*T2*T2*T2 - T3*T3*T3*T3);\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %('\\n Power required to maintain prescribed temperatures is =',q, 'W');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Power required to maintain prescribed temperatures is = 1830 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5 Page 834"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Heat gain by the fluid passing through the inner tube\n",
+ "# Percentage change in heat gain with radiation shield inserted midway between inner and outer tubes\n",
+ "\n",
+ "T2 = 300 \t;#[K] Temperature of inner surface\n",
+ "D2 = .05 \t;#[m] Diameter of Inner Surface\n",
+ "e2 = .05 \t;# emissivity of Inner Surface\n",
+ "T1 = 77 \t;#[K] Temperature of Outer Surface\n",
+ "D1 = .02 ;#[m] Diameter of Inner Surface\n",
+ "e1 = .02 \t;# emissivity of Outer Surface\n",
+ "D3 = .035 ;#[m] Diameter of Shield\n",
+ "e3 = .02 ;# emissivity of Shield\n",
+ "stfncnstt = 5.670*math.pow(10,-8) ;#[W/m^2.K^4] Stefan Boltzman Constant\n",
+ "#calculations\n",
+ "\n",
+ "#From Equation 13.20 Heat balance\n",
+ "q = stfncnstt*(math.pi*D1)*(T1*T1*T1*T1-T2*T2*T2*T2)/(1/e1 + (1-e2)/e2*D1/D2) ;#[W/m] \n",
+ "\n",
+ "RtotL = (1-e1)/(e1*math.pi*D1) + 1/(math.pi*D1*1) + 2*((1-e3)/(e3*math.pi*D3)) + 1/(math.pi*D3*1) + (1-e2)/(e2*math.pi*D2) ;#[m^-2]\n",
+ "q2 = stfncnstt*(T1*T1*T1*T1 - T2*T2*T2*T2)/RtotL; #[W/m] \n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %('\\n Heat gain by the fluid passing through the inner tube =',q,'W/m') \n",
+ "print '%s %.2f %s' %('\\n Percentage change in heat gain with radiation shield inserted midway between inner and outer tubes is =',(q2-q)*100/q,'percent'); "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Heat gain by the fluid passing through the inner tube = -0.50 W/m\n",
+ "\n",
+ " Percentage change in heat gain with radiation shield inserted midway between inner and outer tubes is = -49.55 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6 Page 836"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Rate at which heat must be supplied per unit length of duct\n",
+ "# Temperature of the insulated surface\n",
+ "\n",
+ "T2 = 500 \t\t\t\t\t;#[K] Temperature of Painted surface\n",
+ "e2 = .4 \t \t\t\t\t;# emissivity of Painted Surface\n",
+ "T1 = 1200 \t\t\t\t\t;#[K] Temperature of Heated Surface\n",
+ "W = 1 \t\t\t\t\t; #[m] Width of Painted Surface\n",
+ "e1 = .8 \t\t\t\t\t;# emissivity of Heated Surface\n",
+ "er = .8 \t\t\t\t\t;# emissivity of Insulated Surface\n",
+ "stfncnstt = 5.670*math.pow(10,-8);#[W/m^2.K^4] Stefan Boltzman Constant\n",
+ "\n",
+ "#By Symmetry Rule\n",
+ "F2R = .5;\n",
+ "F12 = .5;\n",
+ "F1R = .5;\n",
+ "#calculations\n",
+ "\n",
+ "#From Equation 13.20 Heat balance\n",
+ "q = stfncnstt*(T1*T1*T1*T1-T2*T2*T2*T2)/((1-e1)/e1*W+ 1/(W*F12+1/((1/W/F1R) + (1/W/F2R))) + (1-e2)/e2*W) ;#[W/m] \n",
+ "\n",
+ "#Surface Energy Balance 13.13\n",
+ "J1 = stfncnstt*T1*T1*T1*T1 - (1-e1)*q/(e1*W)\t\t;# [W/m^2] Surface 1\n",
+ "J2 = stfncnstt*T2*T2*T2*T2 - (1-e2)*(-q)/(e2*W)\t\t;# [W/m^2] Surface 2\n",
+ "#From Equation 13.26 Heat balance\n",
+ "JR = (J1+J2)/2.;\n",
+ "TR = math.pow((JR/stfncnstt),.25);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %('\\n Rate at which heat must be supplied per unit length of duct = ',q/1000.,'kW/m') \n",
+ "print '%s %d %s' %('\\n Temperature of the insulated surface = ',TR,'K');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Rate at which heat must be supplied per unit length of duct = 36.98 kW/m\n",
+ "\n",
+ " Temperature of the insulated surface = 1102 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.7 Page 841"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Rate at which heat must be supplied \n",
+ "# Temperature of the insulated surface\n",
+ "\n",
+ "T1 = 1000. \t\t\t\t;#[K] Temperature of Heated Surface\n",
+ "e1 = .8 \t\t\t\t\t;# emissivity of Heated Surface\n",
+ "e2 = .8 \t\t\t\t\t; # emissivity of Insulated Surface\n",
+ "r = .02 \t\t\t\t\t;#[m] Radius of surface\n",
+ "Tm = 400 \t\t\t\t;#[K] Temperature of surrounding air\n",
+ "m = .01 \t\t\t\t\t;#[kg/s] Flow rate of surrounding air\n",
+ "p = 101325 \t\t\t\t\t;#[Pa] Pressure of surrounding air\n",
+ "stfncnstt = 5.670*math.pow(10,-8);#[W/m^2.K^4] Stefan Boltzman Constant\n",
+ "#Table A.4 Air Properties at 1 atm, 400 K\n",
+ "k = .0338 \t\t\t\t;#[W/m.K] conductivity\n",
+ "u = 230*math.pow(10,-7) \t\t;#[kg/s.m] Viscosity\n",
+ "cp = 1014 \t\t\t\t;#[J/kg] Specific heat\n",
+ "Pr = .69 \t\t\t\t;# Prandtl Number\n",
+ "#calculations and results\n",
+ "\n",
+ "#Hydraulic Diameter\n",
+ "Dh = 2*math.pi*r/(math.pi+2.) ;#[m]\n",
+ "#Reynolds number\n",
+ "Re = m*Dh/(math.pi*r*r/2.)/u;\n",
+ "#View Factor\n",
+ "F12 = 1 ;\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n As Reynolds Number is\",Re,\", Hence it is Turbulent flow inside a cylinder. Hence we will use Dittus-Boelter Equation\");\n",
+ "\n",
+ "#From Dittus-Boelter Equation\n",
+ "Nu = .023*math.pow(Re,.8) *math.pow(Pr,.4);\n",
+ "h = Nu*k/Dh; \t\t#[W/m^2.K]\n",
+ "\n",
+ "#From Equation 13.18 Heat Energy balance\n",
+ "#Newton Raphson\n",
+ "T2=600; \t\t\t\t\t#Initial Assumption\n",
+ "T2=696. \t\t\t\t\t\t#Final answer\n",
+ "#From energy Balance\n",
+ "q = h*math.pi*r*(T2-Tm) + h*2*r*(T1-Tm) ;#[W/m]\n",
+ "\n",
+ "print '%s %.2f %s' %('\\n Rate at which heat must be supplied per unit length of duct =',q,'W/m') \n",
+ "print '%s %.2f %s' %('& Temperature of the insulated surface =',T2,'K');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As Reynolds Number is 16912 , Hence it is Turbulent flow inside a cylinder. Hence we will use Dittus-Boelter Equation\n",
+ "\n",
+ " Rate at which heat must be supplied per unit length of duct = 2818.56 W/m\n",
+ "& Temperature of the insulated surface = 696.00 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_14.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_14.ipynb
new file mode 100644
index 00000000..3ce70f77
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_14.ipynb
@@ -0,0 +1,428 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Diffusion Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.1 Page 884"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Molar and mass fluxes of hydrogen and the relative values of the mass and thermal diffusivities for the three cases\n",
+ "\n",
+ "T = 293. \t \t\t\t\t;#[K] Temperature\n",
+ "Ma = 2 \t\t\t\t\t;#[kg/kmol] Molecular Mass\n",
+ "#Table A.8 Hydrogen-Air Properties at 298 K\n",
+ "Dab1 = .41*math.pow(10,-4); #[m^2/s] diffusion coefficient\n",
+ "#Table A.8 Hydrogen-Water Properties at 298 K\n",
+ "Dab2 = .63*math.pow(10,-8); #[m^2/s] diffusion coefficient\n",
+ "#Table A.8 Hydrogen-iron Properties at 293 K\n",
+ "Dab3 = .26*math.pow(10,-12); #[m^2/s] diffusion coefficient\n",
+ "#Table A.4 Air properties at 293 K\n",
+ "a1 = 21.6*math.pow(10,-6); #[m^2/s] Thermal Diffusivity\n",
+ "#Table A.6 Water properties at 293 K\n",
+ "k = .603 \t\t\t\t;#[W/m.K] conductivity\n",
+ "rho = 998 \t\t\t\t;#[kg/m^3] Density\n",
+ "cp = 4182 \t\t\t\t;#[J/kg] specific Heat\n",
+ "#Table A.1 Iron Properties at 300 K\n",
+ "a3 = 23.1 * math.pow(10,-6); #[m^2/s]\n",
+ "#calculations\n",
+ "\n",
+ "#Equation 14.14\n",
+ "#Hydrogen-air Mixture\n",
+ "DabT1 = Dab1*math.pow(T/298.,1.5);# [m^2/s] mass diffusivity\n",
+ "J1 = -DabT1*1; \t\t#[kmol/s.m^2] Total molar concentration\n",
+ "j1 = Ma*J1; \t\t#[kg/s.m^2] mass Flux of Hydrogen\n",
+ "Le1 = a1/DabT1; \t# Lewis Number Equation 6.50\n",
+ "\n",
+ "#Hydrogen-water Mixture\n",
+ "DabT2 = Dab2*math.pow(T/298.,1.5);# [m^2/s] mass diffusivity\n",
+ "a2 = k/(rho*cp) \t;#[m^2/s] thermal diffusivity \n",
+ "J2 = -DabT2*1 \t;#[kmol/s.m^2] Total molar concentration\n",
+ "j2 = Ma*J2 \t;#[kg/s.m^2] mass Flux of Hydrogen\n",
+ "Le2 = a2/DabT2 \t;# Lewis Number Equation 6.50\n",
+ "\n",
+ "#Hydrogen-iron Mixture\n",
+ "DabT3 = Dab3*math.pow(T/298.,1.5);# [m^2/s] mass diffusivity\n",
+ "J3 = -DabT3*1; \t#[kmol/s.m^2] Total molar concentration\n",
+ "j3 = Ma*J3; \t#[kg/s.m^2] mass Flux of Hydrogen\n",
+ "Le3 = a3/DabT3 \t;# Lewis Number Equation 6.50\n",
+ "#results\n",
+ "\n",
+ "print '%s %.1e' %('a (m^2/s) in 1 = ',a1)\n",
+ "print '%s %.1e' %('\\n a (m^2/s) in 2 = ',a2)\n",
+ "print '%s %.1e' %('\\na (m^2/s) in 3 = ',a3)\n",
+ "print '%s %.1e' %('\\nDab (m^2/s) in 1 = ',DabT1)\n",
+ "print '%s %.1e' %('\\n Dab (m^2/s) in 2 = ',DabT2)\n",
+ "print '%s %.1e' %('\\n Dab (m^2/s) in 3 = ',DabT3)\n",
+ "print '%s %.1e' %('\\n Le in 1 = ',Le1)\n",
+ "print '%s %.1e' %('\\n Le in 2 = ',Le2)\n",
+ "print '%s %.1e' %('\\n Le in 3 = ',Le3)\n",
+ "print '%s %.1e' %('\\n ja (kg/s.m^2) in 1 = ',j1)\n",
+ "print '%s %.1e' %('\\n ja (kg/s.m^2) in 2 = ',j2)\n",
+ "print '%s %.1e' %('\\n ja (kg/s.m^2) in 3 = ',j3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a (m^2/s) in 1 = 2.2e-05\n",
+ "\n",
+ " a (m^2/s) in 2 = 1.4e-07\n",
+ "\n",
+ "a (m^2/s) in 3 = 2.3e-05\n",
+ "\n",
+ "Dab (m^2/s) in 1 = 4.0e-05\n",
+ "\n",
+ " Dab (m^2/s) in 2 = 6.1e-09\n",
+ "\n",
+ " Dab (m^2/s) in 3 = 2.5e-13\n",
+ "\n",
+ " Le in 1 = 5.4e-01\n",
+ "\n",
+ " Le in 2 = 2.4e+01\n",
+ "\n",
+ " Le in 3 = 9.1e+07\n",
+ "\n",
+ " ja (kg/s.m^2) in 1 = -8.0e-05\n",
+ "\n",
+ " ja (kg/s.m^2) in 2 = -1.2e-08\n",
+ "\n",
+ " ja (kg/s.m^2) in 3 = -5.1e-13\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.2 Page 898"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "# Evaporation rate through a single pore\n",
+ "\n",
+ "T = 298 \t\t\t;#[K] Temperature\n",
+ "D = 10*math.pow(10,-6) \t;#[m]\n",
+ "L = 100*math.pow(10,-6); #[m]\n",
+ "H = .5 \t\t\t;# Moist Air Humidity\n",
+ "p = 1.01325 \t\t\t;#[bar]\n",
+ "#Table A.6 Saturated Water vapor Properties at 298 K\n",
+ "psat = .03165; \t#[bar] saturated Pressure\n",
+ "#Table A.8 Water vapor-air Properties at 298 K\n",
+ "Dab = .26*math.pow(10,-4); #[m^2/s] diffusion coefficient\n",
+ "#calculations\n",
+ "\n",
+ "C = p/(8.314/100. *298) ;#Total Concentration\n",
+ "#From section 6.7.2, the mole fraction at x = 0 is\n",
+ "xa0 = psat/p;\n",
+ "#the mole fraction at x = L is\n",
+ "xaL = H*psat/p;\n",
+ "\n",
+ "#Evaporation rate per pore Using Equation 14.41 with advection\n",
+ "N = (math.pi*D*D)*C*Dab/(4*L)*2.303*math.log10((1-xaL)/(1-xa0)) ;#[kmol/s]\n",
+ "\n",
+ "#Neglecting effects of molar averaged velocity Equation 14.32\n",
+ "#Species transfer rate per pore\n",
+ "Nh = (math.pi*D*D)*C*Dab/(4*L)*(xa0-xaL) ;#[kmol/s]\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2e %s' %('\\n Evaporation rate per pore Without advection effects',Nh,'kmol/s')\n",
+ "print '%s %.2e %s' %('and With Advection effects',N,'kmol/s')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Evaporation rate per pore Without advection effects 1.30e-14 kmol/s\n",
+ "and With Advection effects 1.34e-14 kmol/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.3 Page 898"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Rate of water vapor molar diffusive ttansfer through the trough wall\n",
+ "\n",
+ "D = .005 \t\t\t\t\t\t;#[m] Diameter\n",
+ "L = 50*math.pow(10,-6); \t#[m] Length\n",
+ "h = .003 \t\t\t\t;#[m] Depth\n",
+ "Dab = 6*math.pow(10,-14) \t;#[m^2/s] Diffusion coefficient\n",
+ "Cas1 = 4.5*math.pow(10,-3) \t;#[kmol/m^3] Molar concentrations of water vapor at outer surface\n",
+ "Cas2 = 0.5*math.pow(10,-3) \t;#[kmol/m^3] Molar concentrations of water vapor at inner surface\n",
+ "#calculations\n",
+ "\n",
+ "#Transfer Rate through cylindrical wall Equation 14.54\n",
+ "Na = Dab/L*(math.pi*D*D/4. + math.pi*D*h)*(Cas1-Cas2); #[kmol/s]\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2e %s' %('\\n Rate of water vapor molar diffusive ttansfer through the trough wall ',Na,'kmol/s');\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Rate of water vapor molar diffusive ttansfer through the trough wall 3.20e-16 kmol/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.4 Page 902"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# The rate of change of the helium pressure dp/dt\n",
+ "\n",
+ "D = .2 \t\t\t;#[m] Diameter\n",
+ "L = 2*math.pow(10,-3) ;#[m] Thickness\n",
+ "p = 4 \t\t\t;#[bars] Helium Pressure\n",
+ "T = 20+273. \t\t\t;#[K] Temperature\n",
+ "#Table A.8 helium-fused silica (293K) Page 952\n",
+ "Dab = .4*math.pow(10,-13)\t;#[m^2/s] Diffusion coefficient\n",
+ "#Table A.10 helium-fused silica (293K)\n",
+ "S = .45*math.pow(10,-3)\t\t;#[kmol/m^3.bar] Solubility\n",
+ "#calculations\n",
+ "\n",
+ "# By applying the species conservation Equation 14.43 and 14.62\n",
+ "dpt = -6*(.08314)*T*(Dab)*S*p/(L*D);\n",
+ "\n",
+ "#results\n",
+ "print '%s %.2e %s' %('\\n The rate of change of the helium pressure dp/dt',dpt,' bar/s');\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The rate of change of the helium pressure dp/dt -2.63e-11 bar/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.5 Page 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# The Hydrogen mass diffusive flux nA (kg/s.m^2)\n",
+ "#A -> Hydrogen\n",
+ "#B -> Plastic\n",
+ "\n",
+ "Dab = 8.7*math.pow(10,-8) ;#[m^2/s] Diffusion coefficient\n",
+ "Sab = 1.5*math.pow(10,-3) ;#[kmol/m^3.bar] Solubility\n",
+ "L = .0003 \t\t\t;#[m] thickness of bar\n",
+ "p1 = 3 \t\t\t;#[bar] pressure on one side\n",
+ "p2 = 1 \t\t\t;#[bar] pressure on other side\n",
+ "Ma = 2 \t\t\t;#[kg/mol] molecular mass of Hydrogen\n",
+ "#calculations\n",
+ "\n",
+ "#Surface molar concentrations of hydrogen from Equation 14.62\n",
+ "Ca1 = Sab*p1 \t\t\t\t; #[kmol/m^3]\n",
+ "Ca2 = Sab*p2 \t\t\t\t; #[kmol/m^3]\n",
+ "#From equation 14.42 to 14.53 for obtaining mass flux\n",
+ "N = Dab/L*(Ca1-Ca2) ; \t#[kmol/s.m^2]\n",
+ "n = Ma*N ; \t#[kg/s.m^2] on Mass basis\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2e %s' %('\\n The Hydrogen mass diffusive flux n =',n,' (kg/s.m^2)');\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The Hydrogen mass diffusive flux n = 1.74e-06 (kg/s.m^2)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.6 Page 909 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Maximum Thickness of a bacteria laden biofilm, that may be siccessfully treated\n",
+ "\n",
+ "Dab = 2*math.pow(10,-12) \t;#[m^2/s] Diffusion coefficient\n",
+ "Ca0 = 4*math.pow(10,-3) \t\t;#[kmol/m^3] Fixed Concentration of medication\n",
+ "Na = -.2*math.pow(10,-3) \t\t;#[kmol/m^3.s] Minimum consumption rate of antibiotic\n",
+ "k1 = .1 \t\t\t\t\t;#[s^-1] Reaction Coefficient\n",
+ "#calculations\n",
+ "\n",
+ "#For firsst order kinetic reaction Equation 14.74\n",
+ "m = math.pow((k1/Dab),.5);\n",
+ "L = math.acosh(-k1*Ca0/Na) /m;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.1f %s' %('\\n Maximum Thickness of a bacteria laden biofilm, that may be siccessfully treated is ',L*math.pow(10,6), 'mu-m');\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Maximum Thickness of a bacteria laden biofilm, that may be siccessfully treated is 5.9 mu-m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.7 Page 913"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "import math\n",
+ "# Total dosage of medicine delivered to the patient over a one-week time period, sensivity of the dosage to the mass duffusivity of the patch and skin\n",
+ "\n",
+ "Dap = .1*math.pow(10,-12) ;#[m^2/s] Diffusion coefficient of medication with patch\n",
+ "Das = .2*math.pow(10,-12) ;#[m^2/s] Diffusion coefficient of medication with skin\n",
+ "L = .05 \t\t\t;#[m] patch Length\n",
+ "rhop = 100 \t\t\t;#[kg/m^3] Density of medication on patch\n",
+ "rho2 = 0 \t\t\t;#[kg/m^3] Density of medication on skin\n",
+ "K = .5 \t\t\t;#Partition Coefficient\n",
+ "t = 3600*24*7 \t\t\t;#[s] Treatment time\n",
+ "#calculations\n",
+ "\n",
+ "#Applying Conservation of species equation 14.47b\n",
+ "#By analogy to equation 5.62, 5.26 and 5.58\n",
+ "D = 2*rhop*L*L/(math.sqrt(math.pi))*math.sqrt(Das*Dap*t)/(math.sqrt(Das)+math.sqrt(Dap)/K);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.1f %s' %('\\n Total dosage of medicine delivered to the patient over a one-week time period is',D*math.pow(10,6) ,'mg');"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Total dosage of medicine delivered to the patient over a one-week time period is 28.7 mg\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_2.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_2.ipynb
new file mode 100644
index 00000000..a3d2e96a
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_2.ipynb
@@ -0,0 +1,184 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Introduction to conduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Find Value for Thermal Diffusivity\n",
+ "\n",
+ "def alpha(p, Cp, k):\n",
+ " a=k/(p*Cp); #[m^2/s]\n",
+ " return a;\n",
+ "#(a) Pure Aluminium at 300K\n",
+ "# From Appendix A, Table A.1\n",
+ "#calculations and results\n",
+ "\n",
+ "p = 2702.; \t\t#[Kg/m^3] - Density Of Material \n",
+ "Cp = 903.; \t\t\t#[J/kg.K] - Specific heat of Material\n",
+ "k = 237.; \t\t#[W/m.k] - Thermal Conductivity of Material\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n (a) Thermal Diffuisivity of Pure Aluminium at 300K = \",alpha(p, Cp, k),\" m^2/s\\n\");\n",
+ "\n",
+ "#(b) Pure Aluminium at 700K\n",
+ "# From Appendix A, Table A.1\n",
+ "\n",
+ "p = 2702.; \t\t#[Kg/m^3] - Density Of Material \n",
+ "Cp = 1090.; \t\t#[J/kg.K] - Specific heat of Material\n",
+ "k = 225.; \t\t#[W/m.k] - Thermal Conductivity of Material\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n (b) Thermal Diffuisivity of Pure Aluminium at 700K =\",alpha(p, Cp, k),\" m^2/s\\n\");\n",
+ "\n",
+ "#(c) Silicon Carbide at 1000K\n",
+ "# From Appendix A, Table A.2\n",
+ "\n",
+ "p = 3160.; \t\t#[Kg/m^3] - Density Of Material \n",
+ "Cp = 1195.; \t\t#[J/kg.K] - Specific heat of Material\n",
+ "k = 87.; \t\t#[W/m.k] - Thermal Conductivity of Material\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n (c) Thermal Diffuisivity of Silicon Carbide at 1000K =\",alpha(p, Cp, k),\" m^2/s\\n\");\n",
+ "\n",
+ "#(d) Paraffin at 300K\n",
+ "# From Appendix A, Table A.3\n",
+ "\n",
+ "p = 900.; \t\t\t#[Kg/m^3] - Density Of Material \n",
+ "Cp = 2890.; \t\t#[J/kg.K] - Specific heat of Material\n",
+ "k = .24; \t\t#[W/m.k] - Thermal Conductivity of Material\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n (d) Thermal Diffuisivity of Paraffin at 300K = \",alpha(p, Cp, k),\"m^2/s\");\n",
+ "#END\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Thermal Diffuisivity of Pure Aluminium at 300K = 9.71e-05 m^2/s\n",
+ "\n",
+ "\n",
+ " (b) Thermal Diffuisivity of Pure Aluminium at 700K = 7.64e-05 m^2/s\n",
+ "\n",
+ "\n",
+ " (c) Thermal Diffuisivity of Silicon Carbide at 1000K = 2.30e-05 m^2/s\n",
+ "\n",
+ "\n",
+ " (d) Thermal Diffuisivity of Paraffin at 300K = 9.23e-08 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Analyze a Situation of Non-Uniform Temperature Distribution\n",
+ "#T(x) = a + bx +cx^2 T-degC & x-meter\n",
+ "\n",
+ "a = 900.; \t\t\t#[degC]\n",
+ "b = -300.; \t\t\t#[degC/m]\n",
+ "c = -50.; \t\t\t#[degC/m^2]\n",
+ "\n",
+ "q = 1000.; \t\t\t#[W/m^2.K] - Uniform heat Generation\n",
+ "A = 10. ; \t\t\t#[m^2] - Wall Area\n",
+ "#Properties of Wall\n",
+ "p = 1600.; \t\t\t#[kg/m^3] - Density\n",
+ "k = 40.; \t\t\t#[W/m] - Thermal Conductivity\n",
+ "Cp = 4000.; \t\t\t#[J/kg.K] - Specific Heat\n",
+ "L = 1; \t\t\t #[m] - Length of wall\n",
+ "#calculations and results\n",
+ "\n",
+ "#(i) Rate of Heat Transfer entering the wall and leaving the wall\n",
+ "# From Eqn 2.1\n",
+ "# qin = -kA(dT/dx)|x=0 = -kA(b)\n",
+ "\n",
+ "qin= - b*k*A;\n",
+ "\n",
+ "# Similarly\n",
+ "# qout = -kA(dT/dx)|x=L = -kA(b+2cx)|x=L\n",
+ "\n",
+ "qout= - k*A*(b+2*c*L);\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n (i) Rate of Heat Transfer entering the wall =\",qin,\" W \");\n",
+ "print '%s %d %s' %(\"\\n And leaving the wall =\",qout,\"W \");\n",
+ "\n",
+ "#(ii) Rate of change Of Energy Storage in Wall E`st\n",
+ "# Applying Overall Energy Balance across the Wall\n",
+ "#E`st = E`in + E`g + E`out = qin + q`AL - qout\n",
+ "Est = qin + q*A*L - qout;\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n (ii) Rate of change Of Energy Storage in Wall =\",Est,\" W\\n\");\n",
+ "\n",
+ "#(iii) Time rate of Temperature change at x= 0, 0.25 and .5m\n",
+ "#Using Eqn 2.19\n",
+ "# T`= dT/dt = (k/p*Cp)*d(dT/dx)/dx + q`/p*Cp\n",
+ "#As d(dT/dx)/dx = d(b + 2cx)/dx = 2c - Independent of x\n",
+ "T = (k/(p*Cp))*(2*c)+ q/(p*Cp);\n",
+ "print '%s %.6f %s' %(\"\\n (iii) Time rate of Temperature change independent of x =\",T,\" degC/s\\n\");\n",
+ "\n",
+ "#END\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (i) Rate of Heat Transfer entering the wall = 120000 W \n",
+ "\n",
+ " And leaving the wall = 160000 W \n",
+ "\n",
+ " (ii) Rate of change Of Energy Storage in Wall = -30000 W\n",
+ "\n",
+ "\n",
+ " (iii) Time rate of Temperature change independent of x = -0.000469 degC/s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_3.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_3.ipynb
new file mode 100644
index 00000000..80e4f209
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_3.ipynb
@@ -0,0 +1,804 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "One-dimensional, Steady State Conduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Find Skin Temperature & Aerogel Insulation Thickness \n",
+ "import math\n",
+ "A=1.8; \t\t\t\t\t# [m^2] Area for Heat transfer i.e. both surfaces\n",
+ "Ti = 35+273.; \t\t\t\t#[K] - Inside Surface Temperature of Body\n",
+ "Tsurr = 10+273.; \t\t\t#[K] - Temperature of surrounding\n",
+ "Tf = 283.; \t\t\t\t\t#[K] - Temperature of Fluid Flow\n",
+ "e=.95; \t\t\t\t\t\t# Emissivity of Surface\n",
+ "Lst=.003; \t\t\t\t#[m] - Thickness of Skin\n",
+ "kst=.3; \t\t \t\t\t# [W/m.K] Effective Thermal Conductivity of Body\n",
+ "kins = .014; \t\t\t\t# [W/m.K] Effective Thermal Conductivity of Aerogel Insulation\n",
+ "hr = 5.9; \t\t\t\t#[W/m^2.k] - Natural Thermal Convectivity from body to air\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "q = 100; \t\t\t#[W] Given Heat rate\n",
+ "#calculations\n",
+ "\n",
+ "#Using Conducion Basic Eq 3.19\n",
+ "Rtot = (Ti-Tsurr)/q;\n",
+ "#Also\n",
+ "#Rtot=Lst/(kst*A) + Lins/(kins*A)+(h*A + hr*A)^-1\n",
+ "#Rtot = 1/A*(Lst/kst + Lins/kins +(1/(h+hr)))\n",
+ "\n",
+ "#Thus\n",
+ "#For Air,\n",
+ "h=2.; \t\t\t\t\t#[W/m^2.k] - Natural Thermal Convectivity from body to air\n",
+ "Lins1 = kins * (A*Rtot - Lst/kst - 1/(h+hr));\n",
+ "\n",
+ "#For Water,\n",
+ "h=200.; \t\t\t\t\t#[W/m^2.k] - Natural Thermal Convectivity from body to air\n",
+ "Lins2 = kins * (A*Rtot - Lst/kst - 1/(h+hr));\n",
+ "\n",
+ "Tsa=305.; \t\t#[K] Body Temperature Assumed\n",
+ "\n",
+ "#Temperature of Skin is same in both cases as Heat Rate is same\n",
+ "#q=(kst*A*(Ti-Ts))/Lst\n",
+ "Ts = Ti - q*Lst/(kst*A);\n",
+ "#results\n",
+ "\n",
+ "#Also from eqn of effective resistance Rtot F\n",
+ "print '%s %.1f %s' %(\"\\n\\n (I) In presence of Air, Insulation Thickness = \",Lins1*1000,\" mm\")\n",
+ "print '%s %.1f %s' %(\"\\n (II) In presence of Water, Insulation Thickness =\",Lins2*1000.,\" mm\");\n",
+ "print '%s %.2f %s' %(\"\\n\\n Temperature of Skin =\",Ts-273,\" degC\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (I) In presence of Air, Insulation Thickness = 4.4 mm\n",
+ "\n",
+ " (II) In presence of Water, Insulation Thickness = 6.1 mm\n",
+ "\n",
+ "\n",
+ " Temperature of Skin = 34.44 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Chip Operating Temperature\n",
+ "import math\n",
+ "Tf = 25+273.; \t\t\t#[K] - Temperature of Fluid Flow\n",
+ "L=.008; \t\t\t\t#[m] - Thickness of Aluminium \n",
+ "k=239; \t\t\t\t# [W/m.K] Effective Thermal Conductivity of Aluminium\n",
+ "Rc=.9*math.pow(10,-4); #[K.m^2/W] Maximum permeasible Resistane of Epoxy Joint\n",
+ "q=10000.; \t\t\t#[W/m^2] Heat dissipated by Chip\n",
+ "h=100.; \t\t\t\t#[W/m^2.k] - Thermal Convectivity from chip to air\n",
+ "#calculations\n",
+ "\n",
+ "#Temperature of Chip\n",
+ "\n",
+ "Tc = Tf + q/(h+1/(Rc+(L/k)+(1/h)));\n",
+ "q=(Tc-Tf)/(1/h)+(Tc-Tf)/(Rc+(L/k)+(1/h))\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n Temperature of Chip =\",Tc-273,\"degC\");\n",
+ "print '%s' %(\"\\n Chip will Work well below its maximum allowable Temperature ie 85 degC\")\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Temperature of Chip = 75.31 degC\n",
+ "\n",
+ " Chip will Work well below its maximum allowable Temperature ie 85 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Find Thermal conductivity of Carbon Nanotube\n",
+ "import math\n",
+ "D = 14 * math.pow(10,-9); \t\t\t# [m]Dia of Nanotube\n",
+ "s = 5*math.pow(10,-6); \t\t\t# [m]Distance between the islands\n",
+ "Ts = 308.4; \t\t\t\t\t\t#[K] Temp of sensing island\n",
+ "Tsurr = 300; \t\t\t\t\t\t#[K] Temp of surrounding\n",
+ "q = 11.3*math.pow(10,-6); \t\t\t#[W] Total Rate of Heat flow\n",
+ "\n",
+ "#Dimension of platinum line\n",
+ "wpt =math.pow(10,-6); \t\t\t#[m]\n",
+ "tpt = 0.2*math.pow(10,-6); \t\t\t#[m] \n",
+ "Lpt = 250*math.pow(10,-6); \t\t\t#[m] \n",
+ "#Dimension of Silicon nitride line\n",
+ "wsn = 3*math.pow(10,-6); \t\t\t#[m]\n",
+ "tsn = 0.5*math.pow(10,-6); \t \t\t#[m] \n",
+ "Lsn = 250*math.pow(10,-6); \t\t\t#[m] \n",
+ "#From Table A.1 Platinum Temp Assumed = 325K\n",
+ "kpt = 71.6; \t\t\t\t\t\t\t#[W/m.K]\n",
+ "#From Table A.2, Silicon Nitride Temp Assumed = 325K\n",
+ "ksn = 15.5; \t \t\t\t\t\t\t#[W/m.K]\n",
+ "#calculations\n",
+ "\n",
+ "Apt = wpt*tpt; \t\t\t\t\t#Cross sectional area of platinum support beam\n",
+ "Asn = wsn*tsn-Apt; \t\t\t\t\t#Cross sectional area of Silicon Nitride support beam\n",
+ "Acn = math.pi*D*D/4.; \t\t\t#Cross sectional Area of Carbon nanotube\n",
+ "\n",
+ "Rtsupp = 1/(kpt*Apt/Lpt + ksn*Asn/Lsn); #[K/W] Thermal Resistance of each support\n",
+ "\n",
+ "qs = 2*(Ts-Tsurr)/Rtsupp; \t\t\t#[W] Heat loss through sensing island support\n",
+ "qh = q - qs; \t\t\t\t\t\t#[W] Heat loss through heating island support\n",
+ "\n",
+ "Th = Tsurr + qh*Rtsupp/2.; \t\t\t#[K] Temp of Heating island\n",
+ "\n",
+ "#For portion Through Carbon Nanotube\n",
+ "\n",
+ "\n",
+ "kcn = qs*s/(Acn*(Th-Ts));\n",
+ "qs = (Th-Ts)/(s/(kcn*Acn));\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n Thermal Conductivity of Carbon nanotube =\",kcn,\"W/m.K\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Thermal Conductivity of Carbon nanotube = 3111.86 W/m.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Temperature Distribution And Heat rate\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linspace\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "a = 0.25;\n",
+ "x1 = .05; #[m] Distance of smaller end\n",
+ "x2 = .25; #[m] Distance of larger end\n",
+ "T1 = 400; #[K] Temperature of smaller end\n",
+ "T2 = 600; #[K] Temperature of larger end\n",
+ "k = 3.46; #[W/m.K] From Table A.2, Pyroceram at Temp 285K\n",
+ "T=numpy.zeros(100)\n",
+ "#calculations\n",
+ "\n",
+ "x = numpy.linspace(0.05,100,num=100);\n",
+ "i=1;\n",
+ "for i in range (0,99):\n",
+ " z=float(x[i]);\n",
+ " T[i]=(T1 + (T1-T2)*((1/z - 1/x1)/(1/x1 - 1/x2)));\t\n",
+ "\n",
+ "pyplot.plot(x,T);\n",
+ "pyplot.xlabel(\"x (m)\");\n",
+ "pyplot.ylabel(\"T (K)\");\n",
+ "pyplot.show()\n",
+ "qx = math.pi*a*a*k*(T1-T2)/(4*(1/x1 - 1/x2)); #[W]\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n Heat Transfer rate =\",qx,\" W\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Heat Transfer rate = -2.12 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page 119 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "%pylab inline\n",
+ "# Critical Thickness\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linspace\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "k = .055; \t\t\t\t#[W/m.K] From Table A.3, Cellular glass at Temp 285K\n",
+ "h = 5; \t\t\t\t#[W/m^2.K]\n",
+ "ri = 5*math.pow(10,-3); #[m] radius of tube\n",
+ "#calculations\n",
+ "\n",
+ "rct = k/h; \t\t\t\t# [m] Critical Thickness of Insulation for maximum Heat loss or minimum resistance\n",
+ "\n",
+ "x = numpy.linspace(0,100,num=99);\n",
+ "ycond= numpy.zeros(99);\n",
+ "yconv= numpy.zeros(99);\n",
+ "ytot= numpy.zeros(99);\n",
+ "for i in range (0,99):\n",
+ " z=float(x[i]);\n",
+ " ycond[i]=(2.30*math.log10((z+ri)/ri)/(2*math.pi*k));\n",
+ " yconv[i]=1/(2*math.pi*(z+ri)*h);\n",
+ " ytot[i]=yconv[i]+ycond[i];\n",
+ "\n",
+ " \n",
+ "pyplot.plot(x,ytot);\n",
+ "pyplot.xlabel(\"r-ri (m)\");\n",
+ "pyplot.ylabel(\"R (m.K/W)\");\n",
+ "pyplot.show();\n",
+ "#results\n",
+ "\n",
+ "print '%s %.3f %s' %(\"\\n\\n Critical Radius is =\",rct,\" m \")\n",
+ "print '%s %.3f %s' %(\"\\n Heat transfer will increase with the addition of insulation up to a thickness of\",rct-ri,\" m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEPCAYAAABCyrPIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtUVWXeB/DvES+RQipwEMUbF5GrIujr3aNJ3LTXScq8\n5KTWW6vGRq2mtzVNwDTpqqYxbKY1s1KnXslSy8qkmLTCa+YNxEvjBcEBRDhHROUmCM/7xwMHSUA8\nsC9wvp+1nnUOx3PO/u29XM/37P3s/WyDEEKAiIjsXhetCyAiIn1gIBAREQAGAhER1WEgEBERAAYC\nERHVYSAQEREABQOhsrISo0ePRmhoKIYNG4bly5cD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K1x6zRg3bp1sz7v0qULunfvbn1eW1vb\n6DO87wfpFfcQyG45ODggPT3dps8OHjwYBQUF6N+//119rqCgAIMHD7ZpmURK4x4C2Z2WfqG39tf7\nxIkTcfjw4WY/d+vftz4/ePAgJk+e3NpSiVTF6a+JbHD+/HksXboUKSkpd/U5k8mEzZs387RT0iXu\nIRDZwMvLC05OTnd9YZqPjw/DgHSLewhERASAewhERFSHgUBERAAYCEREVIeBQEREABgIRERUh4FA\nREQAgP8HciaKFosIw6gAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x42e6390>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Critical Radius is = 0.011 m \n",
+ "\n",
+ " Heat transfer will increase with the addition of insulation up to a thickness of 0.006 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Heat conduction through Spherical Container \n",
+ "import math\n",
+ "k = .0017; \t\t\t\t\t\t#[W/m.K] From Table A.3, Silica Powder at Temp 300K\n",
+ "h = 5; \t\t\t\t\t\t#[W/m^2.K]\n",
+ "r1 = 25./100.; \t\t\t\t#[m] Radius of sphere\n",
+ "r2 = .275; \t\t\t\t#[m] Radius including Insulation thickness\n",
+ "\n",
+ "#Liquid Nitrogen Properties\n",
+ "T = 77; \t\t\t\t\t\t#[K] Temperature\n",
+ "rho = 804; \t\t\t\t\t\t#[kg/m^3] Density\n",
+ "hfg = 2*100000.; \t\t\t\t\t#[J/kg] latent heat of vaporisation\n",
+ "\n",
+ "#Air Properties\n",
+ "Tsurr = 300; \t\t\t\t\t\t#[K] Temperature\n",
+ "h = 20 \t\t\t\t\t\t;#[W/m^2.K] convection coefficient\n",
+ "#calculations\n",
+ "\n",
+ "Rcond = (1/r1-1/r2)/(4*math.pi*k); #Using Eq 3.36\n",
+ "Rconv = 1/(h*4*math.pi*r2*r2);\n",
+ "q = (Tsurr-T)/(Rcond+Rconv);\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n (a)Rate of Heat transfer to Liquid Nitrogen\",q,\" W\");\n",
+ "\n",
+ "#Using Energy Balance q - m*hfg = 0\n",
+ "m=q/hfg; \t\t\t\t\t\t#[kg/s] mass of nirtogen lost per second\n",
+ "mc = m/rho*3600*24*1000.;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n (b)Mass rate of nitrogen boil off \",mc,\"Litres/day\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (a)Rate of Heat transfer to Liquid Nitrogen 13.06 W\n",
+ "\n",
+ "\n",
+ " (b)Mass rate of nitrogen boil off 7.02 Litres/day\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7 Page 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Composite Plane wall\n",
+ "import math\n",
+ "\n",
+ "Tsurr = 30+273.; \t\t\t\t\t\t#[K] Temperature of surrounding Water\n",
+ "h = 1000.; \t\t\t\t\t\t\t#[W/m^2.K] Heat Convection Coeff of Water\n",
+ "kb = 150.; \t\t\t\t\t\t\t#[W/m.K] Material B\n",
+ "Lb = .02; \t\t\t\t\t\t\t#[m] Thickness Material B\n",
+ "ka = 75.; \t\t\t\t\t\t\t#[W/m.K] Material A\n",
+ "La = .05; \t\t\t\t\t\t\t#[m] Thickness Material A\n",
+ "qa = 1.5*math.pow(10,6);\t\t\t\t#[W/m^3] Heat generation at wall A\n",
+ "qb = 0; \t\t\t\t\t\t\t\t#[W/m^3] Heat generation at wall B\n",
+ "#calculations\n",
+ "T2 = Tsurr + qa*La/h;\n",
+ "To = 100+273.15; \t\t\t\t #[K] Temp of opposite end of rod\n",
+ "Rcondb = Lb/kb;\n",
+ "Rconv = 1/h;\n",
+ "T1 = Tsurr +(Rcondb + Rconv)*(qa*La);\n",
+ "#From Eqn 3.43\n",
+ "T0 = qa*La*La/(2*ka) + T1;\n",
+ "\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n\\n (a) Inner Temperature of Composite To = \",T0-273,\" degC\") \n",
+ "print '%s %d %s' %(\"\\n (b) Outer Temperature of the Composite T2 =\",T2-273,\" degC\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (a) Inner Temperature of Composite To = 140 degC\n",
+ "\n",
+ " (b) Outer Temperature of the Composite T2 = 105 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9 Page 145 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "%pylab inline\n",
+ "# Heat conduction through Rod\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "%pylab inline\n",
+ "kc = 398.; \t\t\t\t\t\t#[W/m.K] From Table A.1, Copper at Temp 335K\n",
+ "kal = 180.; \t \t\t\t\t\t#[W/m.K] From Table A.1, Aluminium at Temp 335K\n",
+ "kst = 14.; \t\t\t\t\t\t#[W/m.K] From Table A.1, Stainless Steel at Temp 335K\n",
+ "h = 100.; \t\t\t\t\t\t#[W/m^2.K] Heat Convection Coeff of Air\n",
+ "Tsurr = 25+273.; \t\t\t\t#[K] Temperature of surrounding Air\n",
+ "D = 5/1000.; \t\t\t\t\t#[m] Dia of rod\n",
+ "To = 100+273.15; \t\t\t\t#[K] Temp of opposite end of rod\n",
+ "#calculations\n",
+ "\n",
+ "#For infintely long fin m = h*P/(k*A)\n",
+ "mc = math.pow((4*h/(kc*D)),.5);\n",
+ "mal = math.pow((4*h/(kal*D)),.5);\n",
+ "mst = math.pow((4*h/(kst*D)),.5);\n",
+ "x = numpy.linspace(0,0.3,100);\n",
+ "Tc= numpy.zeros(100);\n",
+ "Tal= numpy.zeros(100);\n",
+ "Tst= numpy.zeros(100);\n",
+ "for i in range (0,100):\n",
+ " z=x[i];\n",
+ " Tc[i] =Tsurr + (To - Tsurr)*math.pow(2.73,(-mc*z)) - 273;\n",
+ " Tal[i] = Tsurr + (To - Tsurr)*math.pow(2.73,(-mal*z)) -273;\n",
+ " Tst[i] = Tsurr + (To - Tsurr)*math.pow(2.73,(-mst*z)) -273;\n",
+ "\n",
+ "\n",
+ "pyplot.plot(x,Tc,label=\"Cu\");\n",
+ "pyplot.plot(x,Tal,label=\"2024 Al\");\n",
+ "pyplot.plot(x,Tst,label=\"316 SS\");\n",
+ "pyplot.legend();\n",
+ "pyplot.xlabel(\"x (m)\");\n",
+ "pyplot.ylabel(\"T (C)\");\n",
+ "pyplot.show();\n",
+ "\n",
+ "#Using eqn 3.80\n",
+ "qfc = math.pow((h*math.pi*D*kc*math.pi/4*D*D),.5)*(To-Tsurr);\n",
+ "qfal = math.pow((h*math.pi*D*kal*math.pi/4*D*D),.5)*(To-Tsurr);\n",
+ "qfst = math.pow((h*math.pi*D*kst*math.pi/4*D*D),.5)*(To-Tsurr);\n",
+ "\n",
+ "print '%s %.2f %s %.2f %s %.2f %s' %(\"\\n\\n (a) Heat rate \\n For Copper = \",qfc,\"W \\n For Aluminium =\",qfal,\" W \\n For Stainless steel = \",qfst,\" W\");\n",
+ "\n",
+ "#Using eqn 3.76 for satisfactory approx\n",
+ "Linfc = 2.65/mc;\n",
+ "Linfal = 2.65/mal;\n",
+ "Linfst = 2.65/mst;\n",
+ "\n",
+ "print '%s %.2f %s %.2f %s %.2f %s' %(\"\\n\\n (a) Rods may be assumed to be infinite Long if it is greater than equal to \\n For Copper =\",Linfc,\"m \\n For Aluminium = \",Linfal,\" m \\n For Stainless steel =\",Linfst,\"m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEPCAYAAACzwehFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdclXX7wPHPAUERkSlggpqoKUvJkTgpIxUyZzkSy8on\nR5laPfb007Bp+VSOxlM2LMVMLbUMNDPFvcIS9woHDjiAKHvevz/uQBCQdQbncL1fr/t1zrnndXOU\ni+/9XRpFURSEEEKIO7AwdgBCCCHqPkkWQgghKiXJQgghRKUkWQghhKiUJAshhBCVkmQhhBCiUnpL\nFk899RRubm74+fkVr1uzZg0+Pj5YWlpy6NChUvvPmzcPb29v/Pz82Lx5s77CEkIIUQN6SxYTJkxg\n06ZNpdb5+fmxbt06+vbtW2p9TEwMa9eu5ciRI2zatIlnn32W3NxcfYUmhBCimvSWLPr06YOjo2Op\ndR06dKB9+/Zl9o2MjGT06NFYWlrSokULfHx8OHDggL5CE0IIUU11os7i8uXLeHh4FH/28PAgPj7e\niBEJIYQoqU4kCyGEEHVbA2MHAGpJ4tKlS8Wf4+Pj8fT0LLNf27ZtOXfunCFDE0IIk+fl5cXZs2dr\ndQ6jlSxKjl8YEhLCqlWryM/PJz4+nqNHj9K9e/cyx5w7dw5FUcx2CQ8PN3oMcn9yf/Xx/sz53hRF\n0ckf2XorWYwZM4bt27eTlJSEp6cnr7/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gghKiV1\nFkIIISolyUIIIUSlJFkIIYSolCQLIYQQlZJkIYQQolKSLIQQQlTq/wHpPf5jfDuLugAAAABJRU5E\nrkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x43e7f50>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (a) Heat rate \n",
+ " For Copper = 8.33 W \n",
+ " For Aluminium = 5.60 W \n",
+ " For Stainless steel = 1.56 W\n",
+ "\n",
+ "\n",
+ " (a) Rods may be assumed to be infinite Long if it is greater than equal to \n",
+ " For Copper = 0.19 m \n",
+ " For Aluminium = 0.13 m \n",
+ " For Stainless steel = 0.04 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 Page 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Study of motorcycle finned cylinder\n",
+ "import math\n",
+ "H = .15; \t\t\t\t\t\t#[m] height\n",
+ "k = 186; \t\t\t\t\t#[W/m.K] alumunium at 400K\n",
+ "h = 50; \t\t\t\t\t#[W/m^2.K] Heat convection coefficient\n",
+ "Tsurr = 300; \t\t\t\t#[K] Temperature of surrounding air\n",
+ "To = 500; \t\t\t\t\t#[K] Temp inside\n",
+ "\n",
+ "#Dimensions of Fin\n",
+ "N = 5;\n",
+ "t = .006; \t\t\t\t\t#[m] Thickness\n",
+ "L = .020; \t\t\t\t\t#[m] Length\n",
+ "r2c = .048; \t\t\t\t#[m]\n",
+ "r1 = .025; \t\t\t#[m]\n",
+ "#calculations\n",
+ "\n",
+ "Af = 2*math.pi*(r2c*r2c-r1*r1);\n",
+ "At = N*Af + 2*math.pi*r1*(H-N*t);\n",
+ "\n",
+ "#Using fig 3.19 \n",
+ "nf = .95;\n",
+ "\n",
+ "qt = h*At*(1-N*Af*(1-nf)/At)*(To-Tsurr);\n",
+ "qwo = h*(2*math.pi*r1*H)*(To-Tsurr);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n Heat Transfer Rate with the fins =\",qt,\"W \")\n",
+ "print '%s %.2f %s' %(\" \\n Heat Transfer Rate without the fins =\",qwo,\"W\")\n",
+ "print '%s %.2f %s' %(\"\\n Thus Increase in Heat transfer rate of\",qt-qwo,\" W is observed with fins\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Heat Transfer Rate with the fins = 689.60 W \n",
+ " \n",
+ " Heat Transfer Rate without the fins = 235.62 W\n",
+ "\n",
+ " Thus Increase in Heat transfer rate of 453.98 W is observed with fins\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 Page 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Study of Fuel-cell fan system\n",
+ "import math\n",
+ "Wc =.05; \t\t\t\t#[m] width\n",
+ "H = .026; \t \t\t\t\t#[m] height\n",
+ "tc = .006; \t\t\t\t#[m] thickness of cell\n",
+ "V = 9.4; \t\t\t\t#[m/sec] vel of cooling air\n",
+ "P = 9; \t\t\t\t#[W] Power generated\n",
+ "C = 1000; \t\t\t\t#[W/(m^3/s)] Ratio of fan power consumption to vol flow rate\n",
+ "k = 200; \t\t\t\t#[W/m.K] alumunium\n",
+ "Tsurr = 25+273.15; \t\t#[K] Temperature of surrounding air\n",
+ "Tc = 56.4+273.15; \t\t#[K] Temp of fuel cell\n",
+ "Rtcy = math.pow(10,-3); #[K/W] Contact thermal resistance\n",
+ "tb = .002; \t\t#[m] thickness of base of heat sink\n",
+ "Lc = .05; \t\t\t#[m] length of fuel cell\n",
+ "#Dimensions of Fin\n",
+ "tf = .001; \t\t\t\t#[m] Thickness\n",
+ "Lf = .008; \t\t\t\t#[m] Length\n",
+ "#calculations\n",
+ "\n",
+ "Vf = V*(Wc*(H-tc)); \t\t#[m^3/sec] Volumetric flow rate\n",
+ "Pnet = P - C*Vf;\n",
+ "\n",
+ "\n",
+ "P = 2*(Lc+tf);\n",
+ "Ac = Lc*tf;\n",
+ "N = 22;\n",
+ "a=(2*Wc - N*tf)/N;\n",
+ "h = 19.1; \t\t#/[W/m^2.K]\n",
+ "q = 11.25; \t\t#[W]\n",
+ "m = math.pow((h*P/(k*Ac)),.5);\n",
+ "Rtf = math.pow((h*P*k*Ac),(-.5))/ math.tanh(m*Lf);\n",
+ "Rtc = Rtcy/(2*Lc*Wc);\n",
+ "Rtbase = tb/(2*k*Lc*Wc);\n",
+ "Rtb = 1/(h*(2*Wc-N*tf)*Lc);\n",
+ "Rtfn = Rtf/N;\n",
+ "Requiv = 1/(1/Rtb + 1/Rtfn);\n",
+ "Rtot = Rtc + Rtbase + Requiv;\n",
+ "\n",
+ "Tc2 = Tsurr +q*(Rtot);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n (a) Power consumed by fan is more than the generated power of fuel cell, and hence system cannot produce net power = \",Pnet ,\"W \")\n",
+ "print '%s %.2f %s %.2f %s' %(\"\\n\\n (b) Actual fuel cell Temp is close enough to \",Tc2-273.,\" degC for reducing the fan power consumption by half ie Pnet =\",C*Vf/2.,\" W, we require 22 fins, 11 on top and 11 on bottom.\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (a) Power consumed by fan is more than the generated power of fuel cell, and hence system cannot produce net power = -0.40 W \n",
+ "\n",
+ "\n",
+ " (b) Actual fuel cell Temp is close enough to 54.47 degC for reducing the fan power consumption by half ie Pnet = 4.70 W, we require 22 fins, 11 on top and 11 on bottom.\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 Page 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Heat loss from body & temp at inner surface\n",
+ "import math\n",
+ "hair = 2.; \t\t\t#[W/m^2.K] Heat convection coefficient air\n",
+ "hwater = 200.; \t\t#[W/m^2.K] Heat convection coefficient water\n",
+ "hr = 5.9 ; \t\t\t#[W/m^2.K] Heat radiation coefficient\n",
+ "Tsurr = 297.; \t\t#[K] Temperature of surrounding air\n",
+ "Tc = 37+273.; \t\t#[K] Temp inside\n",
+ "e = .95;\n",
+ "A = 1.8 ; \t\t#[m^2] area\n",
+ "#Prop of blood\n",
+ "w = .0005 ; \t\t#[s^-1] perfusion rate\n",
+ "pb = 1000.; \t\t#[kg/m^3] blood density\n",
+ "cb = 3600.; \t\t#[J/kg] specific heat\n",
+ "#Dimensions & properties of muscle & skin/fat\n",
+ "Lm = .03 ; \t\t#[m]\n",
+ "Lsf = .003 ; \t\t#[m]\n",
+ "km = .5 ; \t\t#[W/m.K]\n",
+ "ksf = .3; \t\t#[W/m.K]\n",
+ "q = 700.; \t\t#[W/m^3] Metabolic heat generation rate\n",
+ "#calculations\n",
+ "\n",
+ "Rtotair = (Lsf/ksf + 1/(hair + hr))/A;\n",
+ "Rtotwater = (Lsf/ksf + 1/(hwater+hr))/A;\n",
+ "#please correct this in the textbook. \n",
+ "m = math.pow((w*pb*cb/km),.5);\n",
+ "Theta = -q/(w*pb*cb);\n",
+ "\n",
+ "Tiair = (Tsurr*math.sinh(m*Lm) + km*A*m*Rtotair*(Theta + (Tc + q/(w*pb*cb))*math.cosh(m*Lm)))/(math.sinh(m*Lm)+km*A*m*Rtotair*math.cosh(m*Lm));\n",
+ "qair = (Tiair - Tsurr)/Rtotair;\n",
+ "\n",
+ "Tiwater = (Tsurr*math.sinh(m*Lm) + km*A*m*Rtotwater*(Theta + (Tc + q/(w*pb*cb))*math.cosh(m*Lm)))/(math.sinh(m*Lm)+km*A*m*Rtotwater*math.cosh(m*Lm));\n",
+ "qwater = (Tiwater - Tsurr)/Rtotwater;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n For Air \\n Temp excess Ti = \",Tiair-273,\" degC \")\n",
+ "print '%s %.2f %s %.2f %s %.2f %s' %(\"and Heat loss rate =\",qair,\" W \\n\\n For Water \\n Temp excess Ti = \",Tiwater-273,\" degC and Heat loss rate =\",qwater,\"W \");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " For Air \n",
+ " Temp excess Ti = 34.77 degC \n",
+ "and Heat loss rate = 141.99 W \n",
+ "\n",
+ " For Water \n",
+ " Temp excess Ti = 28.25 degC and Heat loss rate = 514.35 W \n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_4.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_4.ipynb
new file mode 100644
index 00000000..70b74f06
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_4.ipynb
@@ -0,0 +1,277 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Two dimensional, Steady State Conduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page 211 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Thermal resistance of wire coating associated with peripheral variations in coating thickness\n",
+ "import math\n",
+ "d = .005; \t\t\t\t\t\t\t\t\t\t#[m] Diameter of wire\n",
+ "k = .35; \t\t\t\t\t\t\t\t\t\t#[W/m.K] Thermal Conductivity\n",
+ "h = 15; \t\t\t\t\t\t\t\t\t\t#[W/m^2.K] Total coeff with Convection n Radiation\n",
+ "#calculations\n",
+ "\n",
+ "rcr = k/h; \t\t\t\t\t\t\t\t\t\t# [m] critical insulation radius\n",
+ "tcr = rcr - d/2.; \t\t\t\t\t\t\t\t\t\t# [m] critical insulation Thickness\n",
+ "\n",
+ "Rtcond = 2.302*math.log10(rcr/(d/2.))/(2*math.pi*k); #[K/W] Thermal resistance \n",
+ "\n",
+ "#Using Table 4.1 Case 7\n",
+ "z = .5*tcr;\n",
+ "D=2*rcr;\n",
+ "Rtcond2D = (math.acosh((D*D + d*d - 4*z*z)/(2*D*d)))/(2*math.pi*k);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n\\n The reduction in thermal resistance of the insulation is\", Rtcond-Rtcond2D,\" K/W \");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " The reduction in thermal resistance of the insulation is 0.10 K/W \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Temperature Distribution and Heat rate per unit length\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "Ts = 500.; \t#[K] Temp of surface\n",
+ "Tsurr = 300.; \t#[K] Temp of surrounding Air\n",
+ "h = 10.; \t#[W/m^2.K] Heat Convection soefficient\n",
+ "#Support Column\n",
+ "delx = .25; \t#[m]\n",
+ "dely = .25; \t#[m]\n",
+ "k = 1.; \t#[W/m.K] From Table A.3, Fireclay Brick at T = 478K\n",
+ "#calculations\n",
+ "\n",
+ "#Applying Eqn 4.42 and 4.48\n",
+ "A = numpy.array([[-4, 1, 1, 0, 0, 0, 0, 0],\n",
+ "\t\t[2, -4, 0, 1, 0, 0, 0, 0],\n",
+ "\t\t[1, 0, -4, 1, 1, 0, 0, 0],\n",
+ "\t\t[0, 1, 2, -4, 0, 1, 0, 0],\n",
+ "\t\t[0,0, 1, 0, -4, 1, 1, 0],\n",
+ "\t\t[0, 0, 0, 1, 2, -4, 0, 1],\n",
+ "\t\t[0, 0, 0, 0, 2, 0, -9, 1],\n",
+ "\t\t[0, 0, 0, 0, 0, 2, 2, -9]]);\n",
+ " \n",
+ "C = numpy.array([[-1000], [-500], [-500], [0], [-500], [0], [-2000], [-1500]]);\n",
+ "\n",
+ "T = numpy.linalg.solve (A,C);\n",
+ "#results\n",
+ "\n",
+ "print '%s' %(\"\\n Temp Distribution in K = \");\n",
+ "print (T);\n",
+ "\n",
+ "q = 2*h*((delx/2.)*(Ts-Tsurr)+delx*(T[6]-Tsurr)+delx*(T[7]-Tsurr)/2.);\n",
+ "print '%s %.2f %s' %(\"\\n\\n Heat rate from column to the airstream\",q,\" W/m \");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Temp Distribution in K = \n",
+ "[[ 489.30472333]\n",
+ " [ 485.15381783]\n",
+ " [ 472.06507549]\n",
+ " [ 462.00582466]\n",
+ " [ 436.94975396]\n",
+ " [ 418.73932983]\n",
+ " [ 356.99461052]\n",
+ " [ 339.05198674]]"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "\n",
+ " Heat rate from column to the airstream 882.60 W/m \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Temperature Field and Rate of Heat Transfer\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "#Operating Conditions\n",
+ "\n",
+ "ho = 1000; #[W/m^2.K] Heat Convection coefficient\n",
+ "hi = 200; #[W/m^2.K] Heat Convection coefficient\n",
+ "Ti = 400; #[K] Temp of Air\n",
+ "Tg = 1700; #[K] Temp of Gas\n",
+ "h = 10 ; #[W/m^2.K] Heat Convection coefficient\n",
+ "\n",
+ "A = 2*6*math.pow(10,-6) ;#[m^2] Cross section of each Channel\n",
+ "x = .004 ; #[m] Spacing between joints\n",
+ "t = .006; #[m] Thickness\n",
+ "k = 25; #[W/m.K] Thermal Conductivity of Blade\n",
+ "delx = .001 ; #[m]\n",
+ "dely = .001 ; #[m]\n",
+ "#calculations and results\n",
+ "\n",
+ "#Applying Eqn 4.42 and 4.48\n",
+ "A = numpy.array([[-(2+ho*delx/k), 1, 0,0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1,-2*(2+ho*delx/k),1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0],\n",
+ " [0,1,-2*(2+ho*delx/k),1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0],\n",
+ " [0,0,1,-2*(2+ho*delx/k),1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0],\n",
+ " [0,0,0,1,-2*(2+ho*delx/k),1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0],\n",
+ " [0,0,0,0,1,-(2+ho*delx/k),0,0,0,0,0,1,0,0,0,0,0,0,0,0,0],\n",
+ " [1,0,0,0,0,0,-4,2,0,0,0,0,1,0,0,0,0,0,0,0,0],\n",
+ " [0,1,0,0,0,0,1,-4,1,0,0,0,0,1,0,0,0,0,0,0,0],\n",
+ " [0,0,1,0,0,0,0,1,-4,1,0,0,0,0,1,0,0,0,0,0,0],\n",
+ " [0,0,0,1,0,0,0,0,1,-4,1,0,0,0,0,1,0,0,0,0,0],\n",
+ " [0,0,0,0,1,0,0,0,0,1,-4,1,0,0,0,0,1,0,0,0,0],\n",
+ " [0,0,0,0,0,1,0,0,0,0,2,-4,0,0,0,0,0,1,0,0,0],\n",
+ " [0,0,0,0,0,0,1,0,0,0,0,0,-4,2,0,0,0,0,1,0,0],\n",
+ " [0,0,0,0,0,0,0,1,0,0,0,0,1,-4,1,0,0,0,0,1,0],\n",
+ " [0,0,0,0,0,0,0,0,2,0,0,0,0,2,-2*(3+hi*delx/k),1,0,0,0,0,1],\n",
+ " [0,0,0,0,0,0,0,0,0,2,0,0,0,0,1,-2*(2+hi*delx/k),1,0,0,0,0],\n",
+ " [0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,1,-2*(2+hi*delx/k),1,0,0,0],\n",
+ " [0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,-(2+hi*delx/k),0,0,0],\n",
+ " [0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,1,0],\n",
+ " [0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,1,-4,1],\n",
+ " [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,-(2+hi*delx/k)]]);\n",
+ " \n",
+ "C = numpy.array([[-ho*delx*Tg/k], \n",
+ " [-2*ho*delx*Tg/k],\n",
+ " [-2*ho*delx*Tg/k],\n",
+ " [-2*ho*delx*Tg/k],\n",
+ " [-2*ho*delx*Tg/k],\n",
+ " [-ho*delx*Tg/k],\n",
+ " [0],\n",
+ " [0],\n",
+ " [0],\n",
+ " [0],\n",
+ " [0],\n",
+ " [0],\n",
+ " [0],\n",
+ " [0],\n",
+ " [-2*hi*delx*Ti/k],\n",
+ " [-2*hi*delx*Ti/k],\n",
+ " [-2*hi*delx*Ti/k],\n",
+ " [-hi*delx*Ti/k],\n",
+ " [0],\n",
+ " [0],\n",
+ " [-hi*delx*Ti/k]]);\n",
+ "\n",
+ "T = numpy.linalg.solve (A,C);\n",
+ "print '%s' %(\"\\n Temp Distribution in K = \");\n",
+ "print (T);\n",
+ "q = 4*ho*((delx/2.)*(Tg-T[0])+delx*(Tg-T[1])+delx*(Tg-T[2])+ delx*(Tg-T[3])+delx*(Tg-T[4])+delx*(Tg-T[5])/2.);\n",
+ "print '%s %.1f %s' %(\"\\n\\n Heat rate Transfer = \" ,q,\"W/m \");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Temp Distribution in K = \n",
+ "[[ 1525.95413813]\n",
+ " [ 1525.27944565]\n",
+ " [ 1523.59609075]\n",
+ " [ 1521.93574674]\n",
+ " [ 1520.83066847]\n",
+ " [ 1520.45069026]\n",
+ " [ 1519.66699612]\n",
+ " [ 1518.7949547 ]\n",
+ " [ 1516.52842892]\n",
+ " [ 1514.53554374]\n",
+ " [ 1513.30134519]\n",
+ " [ 1512.88873965]\n",
+ " [ 1515.12393697]\n",
+ " [ 1513.70494809]\n",
+ " [ 1509.18712651]\n",
+ " [ 1506.37665411]\n",
+ " [ 1504.9504289 ]\n",
+ " [ 1504.50157796]\n",
+ " [ 1513.41885557]\n",
+ " [ 1511.71377418]\n",
+ " [ 1506.02634497]]\n",
+ "\n",
+ "\n",
+ " Heat rate Transfer = 3540.6 W/m \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_5.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_5.ipynb
new file mode 100644
index 00000000..a8498107
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_5.ipynb
@@ -0,0 +1,710 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Transient Conduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Junction Diameter and Time Calculation to attain certain temp\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "h = 400.; \t\t\t\t\t\t\t\t#[W/m^2.K] Heat Convection coefficient\n",
+ "k = 20.; \t\t\t\t\t\t\t\t#[W/m.K] Thermal Conductivity of Blade\n",
+ "c = 400.; \t\t\t\t\t\t\t\t#[J/kg.K] Specific Heat\n",
+ "rho = 8500.; \t\t\t\t\t\t\t\t#[kg/m^3] Density\n",
+ "Ti = 25+273.; \t\t\t\t\t\t\t#[K] Temp of Air\n",
+ "Tsurr = 200+273.; \t\t\t\t\t\t\t#[K] Temp of Gas Stream\n",
+ "TimeConstt = 1; \t\t\t\t\t\t\t#[sec]\n",
+ "#calculations\n",
+ "\n",
+ "#From Eqn 5.7\n",
+ "D = 6*h*TimeConstt/(rho*c);\n",
+ "Lc = D/6.;\n",
+ "Bi = h*Lc/k;\n",
+ "\n",
+ "#From eqn 5.5 for time to reach \n",
+ "T = 199+273.; \t\t\t\t\t\t\t\t#[K] Required temperature\n",
+ "\n",
+ "t = rho*D*c*2.30*math.log10((Ti-Tsurr)/(T-Tsurr))/(h*6.);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2e %s' %(\"\\n\\n Junction Diameter needed for a time constant of 1 s = \",D,\" m\") \n",
+ "print '%s %.2f %s' %(\"\\n\\n Time Required to reach 199degC in a gas stream =\",t,\" sec \");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Junction Diameter needed for a time constant of 1 s = 7.06e-04 m\n",
+ "\n",
+ "\n",
+ " Time Required to reach 199degC in a gas stream = 5.16 sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Steady State Temperature of junction\n",
+ "# Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "h = 400; \t\t#[W/m^2.K] Heat Convection coefficient\n",
+ "k = 20; \t\t#[W/m.K] Thermal Conductivity of Blade\n",
+ "c = 400; \t\t#[J/kg.K] Specific Heat\n",
+ "e = .9; \t\t\t#Absorptivity\n",
+ "rho = 8500; \t\t#[kg/m^3] Density\n",
+ "Ti = 25+273; \t#[K] Temp of Air\n",
+ "Tsurr = 400+273; \t#[K] Temp of duct wall\n",
+ "Tg = 200+273; \t\t#[K] Temp of Gas Stream\n",
+ "TimeConstt = 1; \t#[sec]\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "#calculations and results\n",
+ "\n",
+ "#From Eqn 5.7\n",
+ "D = 6*h*TimeConstt/(rho*c);\n",
+ "As = math.pi*D*D;\n",
+ "V = math.pi*D*D*D/6;\n",
+ "\n",
+ "#Balancing Energy on thermocouple Junction\n",
+ "#Newton Raphson method for 4th order eqn\n",
+ "T=500;\n",
+ "#After newton raphson method\n",
+ "T=490.7 \n",
+ "print '%s %.2f %s' %(\"\\n (a) Steady State Temperature of junction =\",T-273,\"degC\\n\");\n",
+ "\n",
+ "#Using Eqn 5.15 and Integrating the ODE\n",
+ "# Integration of the differential equation\n",
+ "# dT/dt=-A*[h*(T-Tg)+e*stefncnstt*(T^4-Tsurr^4)]/(rho*V*c) , T(0)=25+273, and finds the minimum time t such that T(t)=217.7+273.15\n",
+ "\n",
+ "T0=25+273;ng=1;\n",
+ "rd=4.98\n",
+ "print '%s %.2f %s' %(\"\\n (b) Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value = \",rd,\" s\\n\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Steady State Temperature of junction = 217.70 degC\n",
+ "\n",
+ "\n",
+ " (b) Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value = 4.98 s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Total Time t required for two step process\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "ho = 40; \t\t\t#[W/m^2.K] Heat Convection coefficient\n",
+ "hc = 10; \t \t\t#[W/m^2.K] Heat Convection coefficient\n",
+ "k = 177; \t\t\t#[W/m.K] Thermal Conductivity \n",
+ "e = .8; \t\t\t\t#Absorptivity\n",
+ "L = 3*math.pow(10,-3) /2.; #[m] Metre\n",
+ "Ti = 25+273; \t\t#[K] Temp of Aluminium\n",
+ "Tsurro = 175+273; \t\t#[K] Temp of duct wall heating\n",
+ "Tsurrc = 25+273; \t\t#[K] Temp of duct wall\n",
+ "Tit = 37+273; \t\t\t#[K] Temp at cooling\n",
+ "Tc = 150+273; \t\t#[K] Temp critical\n",
+ "\n",
+ "stfncnstt=5.67*math.pow(10,(-8)); # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "p = 2770; #[kg/m^3] density of aluminium\n",
+ "c = 875; #[J/kg.K] Specific Heat\n",
+ "#calculations and results\n",
+ "\n",
+ "#To assess the validity of the lumped capacitance approximation\n",
+ "Bih = ho*L/k;\n",
+ "Bic = hc*L/k;\n",
+ "print '%s %.1f %s %.1f' %(\"\\n Lumped capacitance approximation is valid as Bih =\",Bih,\" and Bic = \",Bic);\n",
+ "\n",
+ "#Eqn 1.9\n",
+ "hro = e*stfncnstt*(Tc+Tsurro)*(Tc*Tc+Tsurro*Tsurro);\n",
+ "hrc = e*stfncnstt*(Tc+Tsurrc)*(Tc*Tc+Tsurrc*Tsurrc);\n",
+ "print '%s %.1f %s %.1f %s' %(\"\\n Since The values of hro = %\",hro,\" and hrc =\",hrc,\"are comparable to those of ho and hc \");\n",
+ "\n",
+ "# Integration of the differential equation\n",
+ "# dy/dt=-1/(p*c*L)*[ho*(y-Tsurro)+e*stfncnstt*(y^4 - Tsurro^4)] , y(0)=Ti, and finds the minimum time t such that y(t)=150 degC\n",
+ "te = 423.07\n",
+ "tc=123.07\n",
+ "#From equation 5.15 and solving the two step process using integration\n",
+ "Ty0=Ti;\n",
+ "tt=564\n",
+ "# solution of integration of the differential equation\n",
+ "# dy/dt=-1/(p*c*L)*[hc*(y-Tsurrc)+e*stfncnstt*(y^4 - Tsurrc^4)] , y(rd(1))=Ty(43), and finds the minimum time t such that y(t)=37 degC=Tit\n",
+ "t20=te;\n",
+ "print '%s %d %s' %(\"\\n\\n Total time for the two-step process is t =\",tt+te,\"s\"); \n",
+ "print '%s %d %s %d %s' %(\"with intermediate times of tc =\",tc,\" s and te =\",te,\"s.\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Lumped capacitance approximation is valid as Bih = 0.0 and Bic = 0.0\n",
+ "\n",
+ " Since The values of hro = % 15.0 and hrc = 8.8 are comparable to those of ho and hc \n",
+ "\n",
+ "\n",
+ " Total time for the two-step process is t = 987 s\n",
+ "with intermediate times of tc = 123 s and te = 423 s.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Radial System with Convection\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "h = 500; \t\t\t#[W/m^2.K] Heat Convection coefficientat inner surface\n",
+ "k = 63.9; \t\t\t#[W/m.K] Thermal Conductivity \n",
+ "rho = 7832; \t\t\t#[kg/m^3] Density\n",
+ "c = 434; \t\t#[J/kg.K] Specific Heat\n",
+ "alpha = 18.8*math.pow(10,-6);#[m^2/s]\n",
+ "L = 40.*math.pow(10,-3);\t#[m] Metre\n",
+ "Ti = -20+273; \t\t#[K] Initial Temp\n",
+ "Tsurr = 60+273; \t\t#[K] Temp of oil\n",
+ "t = 8*60 ; \t\t#[sec] time\n",
+ "D = 1 ; \t\t\t\t#[m] Diameter of pipe\n",
+ "#calculations\n",
+ "\n",
+ "#Using eqn 5.10 and 5.12\n",
+ "Bi = h*L/k;\n",
+ "Fo = alpha*t/(L*L);\n",
+ "\n",
+ "#From Table 5.1 at this Bi\n",
+ "C1 = 1.047;\n",
+ "eta = 0.531;\n",
+ "theta0=C1*math.exp(-eta*eta*Fo);\n",
+ "T = Tsurr+theta0*(Ti-Tsurr);\n",
+ "\n",
+ "#Using eqn 5.40b\n",
+ "x=1;\n",
+ "theta = theta0*math.cos(eta);\n",
+ "Tl = Tsurr + (Ti-Tsurr)*theta;\n",
+ "q = h*(Tl - Tsurr);\n",
+ "\n",
+ "#Using Eqn 5.44, 5.46 and Vol per unit length V = pi*D*L\n",
+ "Q = (1-(math.sin(eta)/eta)*theta0)*rho*c*math.pi*D*L*(Ti-Tsurr);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n (a) After 8 min Biot number =\",Bi,\" and\");\t \n",
+ "print '%s %.2f' %(\"\\n \\n Fourier Numer =\",Fo)\n",
+ "print '%s %.2f %s' %(\"\\n\\n (b) Temperature of exterior pipe surface after 8 min = \",T-273,\"degC\")\n",
+ "print '%s %.2f %s' %(\"\\n\\n (c) Heat Flux to the wall at 8 min = \",q,\"W/m^2\")\n",
+ "print '%s %.2e %s' %(\"\\n\\n (d) Energy transferred to pipe per unit length after 8 min =\",Q,\" J/m\")\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) After 8 min Biot number = 0.31 and\n",
+ "\n",
+ " \n",
+ " Fourier Numer = 5.64\n",
+ "\n",
+ "\n",
+ " (b) Temperature of exterior pipe surface after 8 min = 42.92 degC\n",
+ "\n",
+ "\n",
+ " (c) Heat Flux to the wall at 8 min = -7362.49 W/m^2\n",
+ "\n",
+ "\n",
+ " (d) Energy transferred to pipe per unit length after 8 min = -2.72e+07 J/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page 280 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Two step cooling process of Sphere\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "ha = 10.; \t\t#[W/m^2.K] Heat Convection coefficientat air\n",
+ "hw = 6000.; \t#[W/m^2.K] Heat Convection coefficientat water\n",
+ "k = 20.; \t\t#[W/m.K] Thermal Conductivity \n",
+ "rho = 3000.; \t\t#[kg/m^3] Density\n",
+ "c = 1000.; \t#[J/kg.K] Specific Heat\n",
+ "alpha = 6.66*math.pow(10,-6); #[m^2/s]\n",
+ "Tiw = 335+273.; \t#[K] Initial Temp\n",
+ "Tia = 400+273.; \t#[K] Initial Temp\n",
+ "Tsurr = 20+273.; \t#[K] Temp of surrounding\n",
+ "T = 50+273.; \t\t#[K] Temp of center\n",
+ "ro = .005; \t\t#[m] radius of sphere\n",
+ "#calculations\n",
+ "\n",
+ "#Using eqn 5.10 and\n",
+ "Lc = ro/3.;\n",
+ "Bi = ha*Lc/k;\n",
+ "ta = rho*ro*c*2.30*(math.log10((Tia-Tsurr)/(Tiw-Tsurr)))/(3*ha);\n",
+ "\n",
+ "#From Table 5.1 at this Bi\n",
+ "C1 = 1.367;\n",
+ "eta = 1.8;\n",
+ "Fo = -1*2.30*math.log10((T-Tsurr)/((Tiw-Tsurr)*C1))/(eta*eta);\n",
+ "\n",
+ "tw = Fo*ro*ro/alpha;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\n (a) Time required to accomplish desired cooling in air ta =\",ta,\" s\")\n",
+ "print '%s %.2f %s' %(\"\\n\\n (b) Time required to accomplish desired cooling in water bath tw =\",tw,\"s\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Time required to accomplish desired cooling in air ta = 93.7 s\n",
+ "\n",
+ "\n",
+ " (b) Time required to accomplish desired cooling in water bath tw = 3.08 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Burial Depth\n",
+ "\n",
+ "#Operating Conditions\n",
+ "import math\n",
+ "k = .52; \t\t#[W/m.K] Thermal Conductivity \n",
+ "rho = 2050; \t\t#[kg/m^3] Density\n",
+ "c = 1840; \t#[J/kg.K] Specific Heat\n",
+ "Ti = 20+273.; \t#[K] Initial Temp\n",
+ "Ts = -15+273.; \t\t#[K] Temp of surrounding\n",
+ "T = 0+273.; \t\t#[K] Temp at depth xm after 60 days\n",
+ "t = 60*24*3600.; #[sec] time perod\n",
+ "#calculations\n",
+ "\n",
+ "alpha = k/(rho*c); #[m^2/s]\n",
+ "#Using eqn 5.57\n",
+ "xm = math.erfc((T-Ts)/(Ti-Ts)) *2*math.pow((alpha*t),.5);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n Depth at which after 60 days soil freeze =\",xm,\" m\");\n",
+ "print '%s' %(\"The answer given in textbook is wrong. Please check using a calculator.\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Depth at which after 60 days soil freeze = 0.92 m\n",
+ "The answer given in textbook is wrong. Please check using a calculator.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page 293 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Spherical Tumor\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "k = .5; \t\t#[W/m.K] Thermal Conductivity Healthy Tissue\n",
+ "kappa = .02*math.pow(10,3);#[m] extinction coefficient\n",
+ "p = .05; \t# reflectivity of skin\n",
+ "D = .005; \t#[m] Laser beam Dia\n",
+ "rho = 989.1 ; \t#[kg/m^3] Density\n",
+ "c = 4180 ; \t#[J/kg.K] Specific Heat\n",
+ "Tb = 37+273; \t#[K] Temp of healthy tissue\n",
+ "Dt = .003 ; \t#[m] Dia of tissue\n",
+ "d = .02 ; \t#[m] depth beneath the skin\n",
+ "Ttss = 55+273 ; \t#[K] Steady State Temperature\n",
+ "Tb = 37+273 ; \t#[K] Body Temperature\n",
+ "Tt = 52+273 ; \t#[K] Tissue Temperature\n",
+ "q = .170 ; \t#[W] \n",
+ "#calculations\n",
+ "\n",
+ "#Case 12 of Table 4.1\n",
+ "q = 2*math.pi*k*Dt*(Ttss-Tb);\n",
+ "\n",
+ "#Energy Balancing\n",
+ "P = q*(D*D)*math.exp(kappa*d)/((1-p)*Dt*Dt);\n",
+ "\n",
+ "#Using Eqn 5.14\n",
+ "t = rho*(math.pi*Dt*Dt*Dt/6.)*c*(Tt-Tb)/q;\n",
+ "\n",
+ "alpha=k/(rho*c);\n",
+ "Fo = 10.3;\n",
+ "#Using Eqn 5.68\n",
+ "t2 = Fo*Dt*Dt/(4*alpha);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s' %(\"\\n (a) Heat transferred from the tumor to maintain its surface temperature at Ttss = 55 degC is \",q,\"W\"); \n",
+ "print '%s %.2f %s' %(\"\\n\\n (b) Laser power needed to sustain the tumor surface temperautre at Ttss = 55 degC is\", P,\"W\")\n",
+ "print '%s %.2f %s' %(\" \\n\\n (c) Time for tumor to reach Tt = 52 degC when heat transfer to the surrounding tissue is neglected is\",t,\"sec\")\n",
+ "print '%s %.2f %s' %(\" \\n\\n (d) Time for tumor to reach Tt = 52 degC when Heat transfer to thesurrounding tissue is considered and teh thermal mass of tumor is neglected is\",t2,\"sec\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Heat transferred from the tumor to maintain its surface temperature at Ttss = 55 degC is 0.17 W\n",
+ "\n",
+ "\n",
+ " (b) Laser power needed to sustain the tumor surface temperautre at Ttss = 55 degC is 0.74 W\n",
+ " \n",
+ "\n",
+ " (c) Time for tumor to reach Tt = 52 degC when heat transfer to the surrounding tissue is neglected is 5.17 sec\n",
+ " \n",
+ "\n",
+ " (d) Time for tumor to reach Tt = 52 degC when Heat transfer to thesurrounding tissue is considered and teh thermal mass of tumor is neglected is 191.63 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Thermal Conductivity of Nanostructured material\n",
+ "import numpy\n",
+ "import math\n",
+ "from numpy import linalg\n",
+ "#Operating Conditions\n",
+ "\n",
+ "k = 1.11 ; \t\t\t#[W/m.K] Thermal Conductivity \n",
+ "rho = 3100; \t\t\t#[kg/m^3] Density\n",
+ "c = 820 ; \t\t\t#[J/kg.K] Specific Heat\n",
+ "#Dimensions of Strip\n",
+ "w = 100*math.pow(10,-6);\t#[m] Width\n",
+ "L = .0035 ; \t\t\t#[m] Long\n",
+ "d = 3000*math.pow(10,-10);\t#[m] Thickness\n",
+ "delq = 3.5*math.pow(10,-3);\t#[W] heating Rate \n",
+ "delT1 =1.37 ; \t\t\t#[K] Temperature 1\n",
+ "f1 = 2*math.pi ; \t\t\t#[rad/s] Frequency 1\n",
+ "delT2 =.71 ; \t\t\t#[K] Temperature 2\n",
+ "f2 = 200*math.pi; \t\t#[rad/s] Frequency 2\n",
+ "#calculations\n",
+ "\n",
+ "A = ([[delT1, -delq/(L*math.pi)],\n",
+ " [delT2, -delq/(L*math.pi)]]) ;\n",
+ "\n",
+ "C= ([[delq*-2.30*math.log10(f1/2.)/(2*L*math.pi)],\n",
+ " [delq*-2.30*math.log10(f2/2.)/(2*L*math.pi)]]) ;\n",
+ "\n",
+ "B = numpy.linalg.solve (A,C);\n",
+ "\n",
+ "alpha = k/(rho*c);\n",
+ "delp = ([math.pow((alpha/f1),.5), math.pow((alpha/f2),.5)]);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.2f %s %.2f %s' %(\"\\n C2 = \",B[1],\"k =\",B[0],\" W/m.K \")\n",
+ "print '%s %.2e %s %.2e %s'\t%(\"\\n\\n Thermal Penetration depths are\",delp[0],\" m and \",delp[1],\"m at frequency 2*pi rad/s and 200*pi rad/s\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " C2 = 5.35 k = 1.11 W/m.K \n",
+ "\n",
+ "\n",
+ " Thermal Penetration depths are 2.64e-04 m and 2.64e-05 m at frequency 2*pi rad/s and 200*pi rad/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page 305 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Temperature distribution 1.5s after a change in operating power\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "L = .01; #[m] Metre\n",
+ "Tsurr = 250+273.; #[K] Temperature\n",
+ "h = 1100; #[W/m^2.K] Heat Convective Coefficient\n",
+ "q1 = math.pow(10,7); #[W/m^3] Volumetric Rate\n",
+ "q2 = 2*math.pow(10,7); #[W/m^3] Volumetric Rate\n",
+ "k = 30; #[W/m.K] Conductivity\n",
+ "a = 5*math.pow(10,-6); #[m^2/s]\n",
+ "#calculations\n",
+ "\n",
+ "delx = L/5.; #Space increment for numerical solution\n",
+ "Bi = h*delx/k; #Biot Number\n",
+ "#By using stability criterion for Fourier Number\n",
+ "Fo = 1/(2*(1+Bi));\n",
+ "#By definition\n",
+ "t = Fo*delx*delx/a;\n",
+ "#results\n",
+ "\n",
+ "print '%s %.3f %s' %('\\n As per stability criterion delt =',t,' s, hence setting stability limit as .3 s.')\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As per stability criterion delt = 0.373 s, hence setting stability limit as .3 s.\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10 Page 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Initialization\n",
+ "\n",
+ "# Using Explicit Finite Difference method, determine temperatures at the surface and 150 mm from the surface after an elapsed time of 2 min\n",
+ "# Repeat the calculations using the Implicit Finite Difference Method\n",
+ "# Determine the same temperatures analytically\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "a\n",
+ "delx = .075; #[m] Metre\n",
+ "T = 20+273.; #[K] Temperature\n",
+ "q = 3*math.pow(10,5); #[W/m^3] Volumetric Rate\n",
+ "\n",
+ "#From Table A.1 copper 300 K\n",
+ "k = 401; #[W/m.K] Conductivity\n",
+ "a = 117*math.pow(10,-6); #[m^2/s]\n",
+ "#calculations and results\n",
+ "\n",
+ "#By using stability criterion reducing further Fourier Number\n",
+ "Fo = 1./2.;\n",
+ "#By definition\n",
+ "delt = Fo*delx*delx/a;\n",
+ "#From calculations,\n",
+ "T11=125.19\n",
+ "T12=48.1\n",
+ "print '%s %.2f %s %.1f %s' %('\\n Hence after 2 min, the surface and the desirde interior temperature T0 =',T11,' degC and T2 =',T12,'degC');\n",
+ "\n",
+ "#By using stability criterion reducing further Fourier Number\n",
+ "Fo = 1/4;\n",
+ "#By definition\n",
+ "delt = Fo*delx*delx/a;\n",
+ "#From calculations\n",
+ "T21=118.86 \n",
+ "T22=44.4\n",
+ "print '%s %.2f %s %.1f %s' %('\\n Hence after 2 min, the surface and the desirde interior temperature T0 = ',T21,'degC and T2 =',T22,'degC')\n",
+ "\n",
+ "#(c) Approximating slab as semi-infinte medium\n",
+ "Tc = T -273 + 2*q*math.pow((a*t/math.pi),.5) /k;\n",
+ "t=120. #s\n",
+ "#At interior point x=0.15 m\n",
+ "x =.15; #[metre]\n",
+ "#Analytical Expression\n",
+ "Tc2 = T -273 + 2*q*math.pow((a*t/math.pi),.5) /k*math.exp(-x*x/(4*a*t))-q*x/k*(1-math.erf(.15/(2*math.sqrt(a*t))));\n",
+ "\n",
+ "print '%s %.1f %s' %(' \\n\\n (c) Approximating slab as a semi infinte medium, Analytical epression yields \\n At surface after 120 seconds = ,',Tc,'degC')\n",
+ "print '%s %.1f %s' %('\\n At x=.15 m after 120 seconds = ',Tc2,'degC');\n",
+ "#END\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Hence after 2 min, the surface and the desirde interior temperature T0 = 125.19 degC and T2 = 48.1 degC\n",
+ "\n",
+ " Hence after 2 min, the surface and the desirde interior temperature T0 = 118.86 degC and T2 = 44.4 degC\n",
+ " \n",
+ "\n",
+ " (c) Approximating slab as a semi infinte medium, Analytical epression yields \n",
+ " At surface after 120 seconds = , 25.6 degC\n",
+ "\n",
+ " At x=.15 m after 120 seconds = 45.4 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_6.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_6.ipynb
new file mode 100644
index 00000000..a8c5a4a2
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_6.ipynb
@@ -0,0 +1,342 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Introduction to Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page 356 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Napthalene Sublimation rate per unit length\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "h = .05; \t\t\t#[W/m^2.K] Heat Convection coefficient\n",
+ "D = .02; \t\t\t#[m] Diameter of cylinder\n",
+ "Cas = 5*math.pow(10,-6); #[kmol/m^3] Surface molar Conc\n",
+ "Casurr = 0; \t\t\t#[kmol/m^3] Surrounding molar Conc\n",
+ "Ma = 128; \t\t\t#[Kg/kmol] Molecular weight\n",
+ "#calculations\n",
+ "#From Eqn 6.15\n",
+ "Na = h*(math.pi*D)*(Cas-Casurr);\n",
+ "na = Ma*Na;\n",
+ "#results\n",
+ "print '%s %.2e %s' %(\"\\n\\n Mass sublimation Rate is =\",na,\" kg/s.m \");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Mass sublimation Rate is = 2.01e-06 kg/s.m \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Convection Mass Transfer coefficient \n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "\n",
+ "Dab = .288*math.pow(10,-4); \t#[m^2/s] Table A.8 water vapor-air (319K)\n",
+ "pas = .1; \t\t\t\t#[atm] Partial pressure at surface\n",
+ "pasurr = .02; \t\t\t#[atm] Partial pressure at infinity\n",
+ "y0 = .003; \t\t\t\t#[m] Tangent at y = 0 intercepts y axis at 3 mm\n",
+ "#calculations\n",
+ "#From Measured Vapor Pressure Distribution\n",
+ "delp = (0 - pas)/(y0 - 0); #[atm/m]\n",
+ "hmx = -Dab*delp/(pas - pasurr); #[m/s] \n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"\\n\\n Convection Mass Transfer coefficient at prescribed location =\",hmx,\" m/s\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Convection Mass Transfer coefficient at prescribed location = 0.0120 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page 362 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Convection Mass Transfer coefficient \n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 1; \t\t\t\t#[m/s] Velocity of water\n",
+ "L = 0.6; \t\t\t\t#[m] Plate length\n",
+ "Tw1 = 300.; \t\t\t\t#[K]\n",
+ "Tw2 = 350.; \t\t\t\t#[K]\n",
+ "#Coefficients [W/m^1.5 . K]\n",
+ "Clam1 = 395;\n",
+ "Cturb1 = 2330;\n",
+ "Clam2 = 477;\n",
+ "Cturb2 = 3600;\n",
+ "\n",
+ "#Water Properties at T = 300K\n",
+ "p1 = 997; \t\t\t\t#[kg/m^3] Density\n",
+ "u1 = 855*math.pow(10,-6); #[N.s/m^2] Viscosity\n",
+ "#Water Properties at T = 350K\n",
+ "p2 = 974; \t\t\t\t#[kg/m^3] Density\n",
+ "u2 = 365*math.pow(10,-6); #[N.s/m^2] Viscosity\n",
+ "\n",
+ "\n",
+ "Rec = 5*math.pow(10,5); #Transititon Reynolds Number\n",
+ "xc1 = Rec*u1/(p1*v); \t\t#[m]Transition length at 300K\n",
+ "xc2 = Rec*u2/(p2*v); \t\t#[m]Transition length at 350K\n",
+ "#calculations\n",
+ "#Integrating eqn 6.14\n",
+ "#At 300 K\n",
+ "h1 = (Clam1*math.pow(xc1,.5) /.5 + Cturb1*(math.pow(L,.8)-math.pow(xc1,.8))/.8)/L;\n",
+ "\n",
+ "#At 350 K\n",
+ "h2 = (Clam2*math.pow(xc2,.5) /.5 + Cturb2*(math.pow(L,.8)-math.pow(xc2,.8))/.8)/L;\n",
+ "#results\n",
+ "print '%s %.2f %s %.2f %s' %(\"\\n\\n Average Convection Coefficient over the entire plate for the two temperatures at 300K =\",h1,\" W/m^2.K and at 350K =\",h2,\" W/m^2.K\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Average Convection Coefficient over the entire plate for the two temperatures at 300K = 1622.45 W/m^2.K and at 350K = 3707.93 W/m^2.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page 372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Heat Flux to blade when surface temp is reduced\n",
+ "# Heat flux to a larger turbine blade\n",
+ "\n",
+ "#Operating Conditions\n",
+ "v = 160; \t\t\t\t#[m/s] Velocity of air\n",
+ "L = 0.04; \t\t\t\t\t#[m] Blade length\n",
+ "Tsurr = 1150+273.; \t\t\t#[K]\n",
+ "Ts = 800+273.; \t\t\t\t#[K] Surface Temp\n",
+ "q = 95000; \t\t\t\t#[W/m^2] Original heat flux\n",
+ "#calculations\n",
+ "#Case 1\n",
+ "Ts1 = 700+273.; \t \t\t\t#[K] Surface Temp\n",
+ "q1 = q*(Tsurr-Ts1)/(Tsurr-Ts);\n",
+ "\n",
+ "#Case 2\n",
+ "L2 = .08; \t\t\t#[m] Length\n",
+ "q2 = q*L/L2; \t\t\t#[W/m^2] Heat flux\n",
+ "#results\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n\\n (a) Heat Flux to blade when surface temp is reduced =\",q1/1000. ,\" KW/m^2\") \n",
+ "print '%s %.2f %s' %(\"\\n (b) Heat flux to a larger turbine blade = \",q2/1000. ,\"KW/m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " (a) Heat Flux to blade when surface temp is reduced = 122 KW/m^2\n",
+ "\n",
+ " (b) Heat flux to a larger turbine blade = 47.50 KW/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6 Page 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Water vapor conc and flux associated with the same location on larger surface of the same shape\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 100; \t\t\t#[m/s] Velocity of air\n",
+ "Tsurr = 20+273.; \t\t#[K] Surrounding Air Temperature\n",
+ "L1 = 1; \t\t\t\t#[m] solid length\n",
+ "Ts = 80+273.; \t\t\t#[K] Surface Temp\n",
+ "qx = 10000; \t\t\t#[W/m^2] heat flux at a point x\n",
+ "Txy = 60+273.; \t\t#[K] Temp in boundary layer above the point\n",
+ "\n",
+ "#Table A.4 Air Properties at T = 323K\n",
+ "v = 18.2*math.pow(10,-6); #[m^2/s] Viscosity\n",
+ "k = 28*math.pow(10,-3); \t#[W/m.K] Conductivity\n",
+ "Pr = 0.7; \t\t\t#Prandttl Number\n",
+ "#Table A.6 Saturated Water Vapor at T = 323K\n",
+ "pasat = 0.082; \t\t\t#[kg/m^3]\n",
+ "Ma = 18; \t\t\t#[kg/kmol] Molecular mass of water vapor\n",
+ "#Table A.8 Water Vapor-air at T = 323K\n",
+ "Dab = .26*math.pow(10,-4);\t#[m^2/s]\n",
+ "#calculations\n",
+ "#Case 1\n",
+ "Casurr = 0;\n",
+ "Cas = pasat/Ma; \t\t#[kmol/m^3] Molar conc of saturated water vapor at surface\n",
+ "Caxy = Cas + (Casurr - Cas)*(Txy - Ts)/(Tsurr - Ts);\n",
+ "\n",
+ "#Case 2\n",
+ "L2 = 2.;\n",
+ "hm = L1/L2 * Dab/k * qx/(Ts-Tsurr);\n",
+ "Na = hm*(Cas - Casurr);\n",
+ "#results\n",
+ "\n",
+ "print '%s %.4f %s' %(\"\\n (a) Water vapor Concentration above the point =\",Caxy,\"Kmol/m^3 \\n\") \n",
+ "print '%s %.2e %s' %(\"(b) Molar flux to a larger surface = \",Na,\"Kmol/s.m^2\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Water vapor Concentration above the point = 0.0030 Kmol/m^3 \n",
+ "\n",
+ "(b) Molar flux to a larger surface = 3.53e-04 Kmol/s.m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.7 Page 383 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Steady State Temperature of Beverage\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Tsurr = 40+273.; \t\t#[K] Surrounding Air Temperature\n",
+ "#Volatile Wetting Agent A\n",
+ "hfg = 100; \t\t\t#[kJ/kg]\n",
+ "Ma = 200; \t\t\t#[kg/kmol] Molecular mass\n",
+ "pasat = 5000; \t\t\t#[N/m^2] Saturate pressure\n",
+ "Dab = .2*math.pow(10,-4); #[m^2/s] Diffusion coefficient\n",
+ "\n",
+ "#Table A.4 Air Properties at T = 300K\n",
+ "p = 1.16; \t#[kg/m^3] Density\n",
+ "cp = 1.007; \t#[kJ/kg.K] Specific Heat\n",
+ "alpha = 22.5*math.pow(10,-6)#[m^2/s] \n",
+ "R = 8.314; \t#[kJ/kmol] Universal Gas Constt\n",
+ "#calculations\n",
+ "#Applying Eqn 6.65 and setting pasurr = 0\n",
+ "# Ts^2 - Tsurr*Ts + B = 0 , where the coefficient B is\n",
+ "B = Ma*hfg*pasat*math.pow(10,-3) /(R*p*cp*math.pow((alpha/Dab),(2./3.)));\n",
+ "Ts = (Tsurr + math.sqrt(Tsurr*Tsurr - 4*B))/2. ;\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"\\n Steady State Surface Temperature of Beverage =\",Ts-273.,\"degC\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Steady State Surface Temperature of Beverage = 5.9 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_7.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_7.ipynb
new file mode 100644
index 00000000..f8aa1a6f
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_7.ipynb
@@ -0,0 +1,506 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "External Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1 Page 415"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Cooling rate per Unit Width of the Plate\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 10; \t\t\t\t\t\t\t#[m/s] Air velocity\n",
+ "p = 6000; \t\t\t\t\t\t\t#[N/m^2] Air pressure\n",
+ "Tsurr = 300+273.; \t\t\t\t\t\t#[K] Surrounding Air Temperature\n",
+ "L = .5; \t\t\t\t\t\t\t#[m] Length of plate\n",
+ "Ts = 27+273.; \t\t\t\t\t\t#[K] Surface Temp\n",
+ "\n",
+ "#Table A.4 Air Properties at T = 437K \n",
+ "uv = 30.84*math.pow(10,-6)*(101325./6000.); #[m^2/s] Kinematic Viscosity at P = 6000 N/m^2\n",
+ "k = 36.4*math.pow(10,-3); \t\t#[W/m.K] Thermal COnductivity\n",
+ "Pr = .687; \t\t\t\t\t#Prandtl number\n",
+ "#calculations\n",
+ "Re = v*L/uv; \t\t\t\t\t\t#Reynolds number\n",
+ "print '%s %d %s' %(\"\\n Since Reynolds Number is\",Re,\", The flow is laminar over the entire plate\");\n",
+ "\n",
+ "#Correlation 7.30 \n",
+ "NuL = .664*math.pow(Re,.5)*math.pow(Pr,0.3334); #Nusselt Number over entire plate length\n",
+ "hL = NuL*k/L; # Average Convection Coefficient\n",
+ "#Required cooling rate per unit width of plate\n",
+ "q = hL*L*(Tsurr-Ts);\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n\\n Required cooling rate per unit width of plate =\",q,\" W/m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Since Reynolds Number is 9600 , The flow is laminar over the entire plate\n",
+ "\n",
+ "\n",
+ " Required cooling rate per unit width of plate = 570 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2 Page 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Maximum Heater Power Requirement\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 60; \t\t\t#[m/s] Air velocity\n",
+ "Tsurr = 25+273.; \t\t#[K] Surrounding Air Temperature\n",
+ "w = 1; \t\t\t#[m] Width of plate\n",
+ "L = .05; \t\t\t#[m] Length of stripper\n",
+ "Ts = 230+273.; \t\t#[K] Surface Temp\n",
+ "\n",
+ "#Table A.4 Air Properties at T = 400K \n",
+ "uv = 26.41*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "k = .0338; \t#[W/m.K] Thermal COnductivity\n",
+ "Pr = .690; \t#Prandtl number\n",
+ "#calculations\n",
+ "Re = v*L/uv; \t\t#Reynolds number\n",
+ "\n",
+ "Rexc = 5*math.pow(10,5); #Transition Reynolds Number\n",
+ "xc = uv*Rexc/v; \t\t#Transition Length\n",
+ "#results\n",
+ "print '%s %d' %(\"\\n Reynolds Number based on length L = .05m is \",Re)\n",
+ "print '%s %.2f %s' %(\"\\n And the transition occur at xc =\",xc,\" m ie fifth plate\");\n",
+ "\n",
+ "#For first heater\n",
+ "#Correlation 7.30 \n",
+ "Nu1 = .664*math.pow(Re,0.5)*math.pow(Pr,0.3334); #Nusselt Number \n",
+ "h1 = Nu1*k/L; # Average Convection Coefficient\n",
+ "q1 = h1*(L*w)*(Ts-Tsurr); # Convective Heat exchange\n",
+ "\n",
+ "#For first four heaters\n",
+ "Re4 = 4*Re;\n",
+ "L4 = 4*L;\n",
+ "Nu4 = .664*math.pow(Re4,0.5)*math.pow(Pr,0.3334); #Nusselt Number \n",
+ "h4 = Nu4*k/L4; # Average Convection Coefficient\n",
+ "print(h4)\n",
+ "#For Fifth heater from Eqn 7.38\n",
+ "Re5 = 5*Re;\n",
+ "A = 871; \n",
+ "L5 = 5*L;\n",
+ "Nu5 = (.037*math.pow(Re5,.8)-A)*math.pow(Pr,.3334); #Nusselt Number \n",
+ "h5 = Nu5*k/L5; # Average Convection Coefficient\n",
+ "q5 = (h5*L5-h4*L4)*w*(Ts-Tsurr);\n",
+ "\n",
+ "#For Sixth heater from Eqn 7.38\n",
+ "Re6 = 6*Re;\n",
+ "L6 = 6*L;\n",
+ "Nu6 = (.037*math.pow(Re6,.8)-A)*math.pow(Pr,.3334) ; #Nusselt Number \n",
+ "h6 = Nu6*k/L6 ; # Average Convection Coefficient\n",
+ "q6 = (h6*L6-h5*L5)*w*(Ts-Tsurr);\n",
+ "\n",
+ "print '%s %d %s %d %s %d %s' %(\"\\n\\n Power requirement are \\n qconv1 = \",q1,\"W qconv5 =\",q5,\" W qconv6 = \",q6,\"W\");\n",
+ "print '%s %d %s %d %s %d %s' %(\"\\n Hence\",q6,\">\",q1,\" >\",q5,\"and the sixth plate has largest power requirement\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Reynolds Number based on length L = .05m is 113593\n",
+ "\n",
+ " And the transition occur at xc = 0.22 m ie fifth plate\n",
+ "66.8395462952\n",
+ "\n",
+ "\n",
+ " Power requirement are \n",
+ " qconv1 = 1370 W qconv5 = 1017 W qconv6 = 1427 W\n",
+ "\n",
+ " Hence 1427 > 1370 > 1017 and the sixth plate has largest power requirement\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3 Page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Daily Water Loss\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 2; \t\t\t#[m/s] Air velocity\n",
+ "Tsurr = 25+273.; \t\t#[K] Surrounding Air Temperature\n",
+ "H = .5; \t\t\t# Humidity\n",
+ "w = 6; \t\t\t#[m] Width of pool\n",
+ "L1 = 12; \t\t\t#[m] Length of pool\n",
+ "e = 1.5; \t\t\t#[m] Deck Wide\n",
+ "Ts = 25+273.; \t\t\t#[K] Surface Temp of water\n",
+ "#calculations\n",
+ "#Table A.4 Air Properties at T = 298K \n",
+ "uv = 15.7*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "#Table A.8 Water vapor-Air Properties at T = 298K \n",
+ "Dab = .26*math.pow(10,-4); \t#[m^2/s] Diffusion Coefficient\n",
+ "Sc = uv/Dab;\n",
+ "#Table A.6 Air Properties at T = 298K \n",
+ "rho = .0226; \t#[kg/m^3]\n",
+ "\n",
+ "L = L1+e;\n",
+ "Re = v*L/uv; \t\t#Reynolds number\n",
+ "\n",
+ "#Equation 7.41 yields\n",
+ "ShLe = .037*math.pow(Re,.8)*math.pow(Sc,.3334);\n",
+ "#Equation 7.44\n",
+ "p = 8.; #Turbulent Flow\n",
+ "ShL = (L/(L-e))*ShLe*math.pow((1-math.pow((e/L),((p+1)/(p+2)))),(p/(p+1)));\n",
+ "\n",
+ "hmL = ShL*(Dab/L);\n",
+ "n = hmL*(L1*w)*rho*(1-H);\n",
+ "#results\n",
+ "print '%s %.2e %s' %(\"\\n Reynolds Number is \",Re,\". Hence for turbulent Flow p = 8 in Equation 7.44.\")\n",
+ "print '%s %d %s' %(\"\\n Daily Water Loss due to evaporation is\",n*86400. ,\"kg/day\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Reynolds Number is 1.72e+06 . Hence for turbulent Flow p = 8 in Equation 7.44.\n",
+ "\n",
+ " Daily Water Loss due to evaporation is 406 kg/day\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4 Page 428"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Convection Coefficient associated with operating conditions\n",
+ "# Convection Coefficient from an appropriate correlation\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 10; \t\t\t#[m/s] Air velocity\n",
+ "Tsurr = 26.2+273.; \t\t#[K] Surrounding Air Temperature\n",
+ "P = 46.; \t\t\t# [W] Power dissipation\n",
+ "L = .094; \t\t\t#[m] Length of cylinder\n",
+ "D = .0127; \t\t\t#[m] Diameter of cylinder\n",
+ "Ts = 128.4+273.; \t\t#[K] Surface Temp of water\n",
+ "q = 46.15*46; \t\t#[W] Actual power dissipation without the 15% loss\n",
+ "\n",
+ "#Table A.4 Air Properties at T = 300K \n",
+ "uv = 15.89*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "k = 26.3*math.pow(10,-3); #[W/m.K] Thermal conductivity\n",
+ "Pr = .707; \t#Prandtl Number\n",
+ "#Table A.4 Air Properties at T = 401K \n",
+ "Prs = .690; \t#Prandtl Number\n",
+ "#calculations\n",
+ "A = math.pi*D*L;\n",
+ "h = q/(A*(Ts-Tsurr));\n",
+ "\n",
+ "Re = v*D/uv; \t\t#Reynolds number\n",
+ "#Using Zukauskas Relation, Equation 7.53\n",
+ "C = .26;\n",
+ "m = .6;\n",
+ "n = .37;\n",
+ "Nu = C*math.pow(Re,m)*math.pow(Pr,n)*math.pow((Pr/Prs),.25);\n",
+ "havg = Nu*k/D;\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n Convection Coefficient associated with operating conditions\",h,\"W/m^2.K.\") \n",
+ "print '%s %d %s' %(\"\\n Reynolds Number is \",Re,\". Hence taking suitable corresponding data from Table 7.4.\")\n",
+ "print '%s %d %s' %(\"\\n Convection Coefficient from an appropriate Zukauskas correlation\",havg,\" W/m^2.K\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Convection Coefficient associated with operating conditions 5538 W/m^2.K.\n",
+ "\n",
+ " Reynolds Number is 7992 . Hence taking suitable corresponding data from Table 7.4.\n",
+ "\n",
+ " Convection Coefficient from an appropriate Zukauskas correlation 104 W/m^2.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 page 431"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Convective Heat transfer to the canister and the additional heating needed\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 23; \t\t\t\t#[m/s] Air velocity\n",
+ "Tsurr = 296.; \t\t\t\t#[K] Surrounding Air Temperature\n",
+ "L = .8; \t\t\t\t#[m] Length of cylinder\n",
+ "Di = .1; \t\t\t\t#[m] Diameter of cylinder\n",
+ "t = .005; \t\t\t\t\t#[m] Thickness of cylinder\n",
+ "\n",
+ "#Table A.4 Air Properties at T = 285K \n",
+ "uv = 14.56*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "k = 25.2*math.pow(10,-3); #[W/m.K] Thermal conductivity\n",
+ "Pr = .712; \t\t#Prandtl Number\n",
+ "#Table A.1 AISI 316 Stainless steel Properties at T = 300K \n",
+ "kss = 13.4; \t\t#[W/m.K]Conductivity\n",
+ "\n",
+ "pH2 = 1.01; \t\t\t\t#[N]\n",
+ "Ti = -3550/(2.30*math.log10(pH2) - 12.9);\n",
+ "Eg = -(1.35*math.pow(10,-4))*(29.5*math.pow(10,6));\n",
+ "#calculations\n",
+ "Re = v*(Di+2*t)/uv; \t\t#Reynolds number\n",
+ "# Equation 7.54\n",
+ "Nu = .3+.62*math.pow(Re,.5)*math.pow(Pr,.3334) /math.pow((1+math.pow((.4/Pr),.6668)),.25) *math.pow(1+math.pow((Re/282000.),(5./8.)),.8);\n",
+ "h = Nu*k/(Di+2*t);\n",
+ "\n",
+ "qconv = (Tsurr-Ti)/((1/(math.pi*L*(Di+2*t)*h))+(2.30*math.log10((Di+2*t)/Di)/(2*math.pi*kss*L)));\n",
+ "\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n Additional Thermal Energy must be supplied to canister to mainatin steady-state operating temperatue\",-qconv-Eg,\"W\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Additional Thermal Energy must be supplied to canister to mainatin steady-state operating temperatue 3581 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6 page 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Time required to cool from Ti = 75 degC to 35 degC\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 10; \t\t\t#[m/s] Air velocity\n",
+ "Tsurr = 23+273.; \t\t#[K] Surrounding Air Temperature\n",
+ "D = .01; \t\t\t#[m] Diameter of sphere\n",
+ "Ti = 75+273.; \t\t#[K] Initial temp\n",
+ "Tt = 35+273.; \t\t#[K] Temperature after time t\n",
+ "p = 1; \t\t#[atm]\n",
+ "\n",
+ "#Table A.1 Copper at T = 328K \n",
+ "rho = 8933; \t\t\t#[kg/m^3] Density\n",
+ "k = 399; \t\t\t#[W/m.K] Conductivity\n",
+ "cp = 388; \t\t\t#[J/kg.K] specific \n",
+ "#Table A.4 Air Properties T = 296 K\n",
+ "u = 182.6*math.pow(10,-7); #[N.s/m^2] Viscosity\n",
+ "uv = 15.53*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "k = 25.1*math.pow(10,-3); #[W/m.K] Thermal conductivity\n",
+ "Pr = .708; \t#Prandtl Number\n",
+ "#Table A.4 Air Properties T = 328 K\n",
+ "u2 = 197.8*math.pow(10,-7); #[N.s/m^2] Viscosity\n",
+ "#calculations\n",
+ "Re = v*D/uv; \t\t#Reynolds number\n",
+ "#Using Equation 7.56\n",
+ "Nu = 2+(0.4*math.pow(Re,.5) + 0.06*math.pow(Re,.668))*math.pow(Pr,.4)*math.pow((u/u2),.25);\n",
+ "h = Nu*k/D;\n",
+ "#From equation 5.4 and 5.5\n",
+ "t = rho*cp*D*2.30*math.log10((Ti-Tsurr)/(Tt-Tsurr))/(6*h);\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"\\nTime required for cooling is\",t,\"sec\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Time required for cooling is 71.2 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7 Page 443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Air side Convection coefficient and Heat rate\n",
+ "# pressure Drop\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "v = 6; \t\t\t#[m/s] Air velocity\n",
+ "Tsurr = 15+273.; \t \t\t#[K] Surrounding Air Temperature\n",
+ "D = .0164; \t\t\t#[m] Diameter of tube\n",
+ "Ts = 70+273.; \t\t#[K] Temp of tube\n",
+ "#Staggered arrangement dimensions\n",
+ "St = .0313; \t\t\t#[m]\n",
+ "Sl = .0343; \t\t\t#[m]\n",
+ "\n",
+ "#Table A.4 Air Properties T = 288 K\n",
+ "rho = 1.217; \t\t#[kg/m^3] Density\n",
+ "cp = 1007; \t\t#[J/kg.K] specific heat\n",
+ "uv = 14.82*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "k = 25.3*math.pow(10,-3); #[W/m.K] Thermal conductivity\n",
+ "Pr = .71; \t#Prandtl Number\n",
+ "#Table A.4 Air Properties T = 343 K\n",
+ "Pr2 = .701; \t#Prandtl Number\n",
+ "#Table A.4 Air Properties T = 316 K\n",
+ "uv3 = 17.4*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "k3 = 27.4*math.pow(10,-3); #[W/m.K] Thermal conductivity\n",
+ "Pr3 = .705; \t#Prandtl Number\n",
+ "#calculations\n",
+ "Sd = math.pow((Sl*Sl + (St/2)*(St/2)),.5);\n",
+ "Vmax = St*v/(St-D);\n",
+ "\n",
+ "Re = Vmax*D/uv; \t\t#Reynolds number\n",
+ "\n",
+ "C = .35*math.pow((St/Sl),.2);\n",
+ "m = .6;\n",
+ "C2 = .95;\n",
+ "N = 56;\n",
+ "Nt = 8;\n",
+ "#Using Equation 7.64 & 7.65\n",
+ "Nu = C2*C*math.pow(Re,m)* math.pow(Pr,.36) *math.pow((Pr/Pr2),.25);\n",
+ "h = Nu*k/D;\n",
+ "\n",
+ "#From Eqnn 7.67\n",
+ "Tso = (Ts-Tsurr)*math.exp(-(math.pi*D*N*h)/(rho*v*Nt*St*cp));\n",
+ "Tlm = ((Ts-Tsurr) - Tso)/(2.30*math.log10((Ts-Tsurr)/Tso));\n",
+ "q = N*(h*math.pi*D*Tlm);\n",
+ "\n",
+ "Pt = St/D;\n",
+ "#From Fig 7.14\n",
+ "X = 1.04;\n",
+ "f = .35;\n",
+ "NL = 7;\n",
+ "press = NL*X*(rho*Vmax*Vmax/2.)*f;\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"\\n Air side Convection coefficient h = \",h,\"W/m^2.k\"); \n",
+ "print '%s %.1f %s' %(\"\\n and Heat rate q = \",q/1000. ,\" kW/m\"); \n",
+ "print '%s %.2e %s' %(\"\t\\n Pressure Drop =\",press/100000. ,\" bars\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Air side Convection coefficient h = 137.0 W/m^2.k\n",
+ "\n",
+ " and Heat rate q = 19.6 kW/m\n",
+ "\t\n",
+ " Pressure Drop = 2.46e-03 bars\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_8.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_8.ipynb
new file mode 100644
index 00000000..fac7e1bf
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_8.ipynb
@@ -0,0 +1,532 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Internal Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page 499"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Length of tube needed to achieve the desired outlet temperature\n",
+ "#Local convection coefficient at the outlet\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "m = .1; #[kg/s] mass flow rate of water\n",
+ "Ti = 20+273.; #[K] Inlet temp\n",
+ "To = 60+273.; #[K] Outlet temperature\n",
+ "Di = .02; #[m] Inner Diameter\n",
+ "Do = .04; #[m] Outer Diameter\n",
+ "q = 1000000.;\t #[w/m^3] Heat generation Rate\n",
+ "Tsi = 70+273.; #[K] Inner Surface Temp\n",
+ "#Table A.4 Air Properties T = 313 K\n",
+ "cp = 4179; #[J/kg.K] specific heat\n",
+ "#calculations\n",
+ "L = 4*m*cp*(To-Ti)/(math.pi*(Do*Do-Di*Di)*q);\n",
+ "\n",
+ "#From Newtons Law of cooling, Equation 8.27, local heat convection coefficient is\n",
+ "h = q*(Do*Do-Di*Di)/(Di*4*(Tsi-To));\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"\\n Length of tube needed to achieve the desired outlet temperature = \",L,\"m \")\n",
+ "print '%s %.1f %s' %(\"\\n Local convection coefficient at the outlet =\",h,\" W/m^2.K\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Length of tube needed to achieve the desired outlet temperature = 17.7 m \n",
+ "\n",
+ " Local convection coefficient at the outlet = 1500.0 W/m^2.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page 503 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# average convection coefficient \n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "m = .25; \t#[kg/s] mass flow rate of water\n",
+ "Ti = 15+273.; \t#[K] Inlet temp\n",
+ "To = 57+273.; \t#[K] Outlet temperature\n",
+ "D = .05; \t\t#[m] Diameter\n",
+ "L = 6; \t\t#[m] Length of tube\n",
+ "Ts = 100+273.; \t#[K] outer Surface Temp\n",
+ "\n",
+ "#Table A.4 Air Properties T = 309 K\n",
+ "cp = 4178; \t#[J/kg.K] specific heat\n",
+ "#calculations\n",
+ "Tlm = ((Ts-To)-(Ts-Ti))/(2.30*math.log10((Ts-To)/(Ts-Ti)));\n",
+ "\n",
+ "h = m*cp*(To-Ti)/(math.pi*D*L*Tlm);\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n Average Heat transfer Convection Coefficient = \",h,\"W/m^2.K\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Average Heat transfer Convection Coefficient = 754 W/m^2.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page 506 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Length of tube for required heating\n",
+ "# Surface temperature Ts at outlet section\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "m = .01; #[kg/s] mass flow rate of water\n",
+ "Ti = 20+273; \t#[K] Inlet temp\n",
+ "To = 80+273; \t#[K] Outlet temperature\n",
+ "D = .06; \t#[m] Diameter\n",
+ "q = 2000; \t#[W/m^2] Heat flux to fluid\n",
+ "\n",
+ "#Table A.4 Air Properties T = 323 K\n",
+ "cp = 4178; #[J/kg.K] specific heat\n",
+ "#Table A.4 Air Properties T = 353 K\n",
+ "k = .670; #[W/m] Thermal Conductivity\n",
+ "u = 352*math.pow(10,-6);#[N.s/m^2] Viscosity\n",
+ "Pr = 2.2; #Prandtl Number\n",
+ "cp = 4178; #[J/kg.K] specific heat\n",
+ "#calculations\n",
+ "L = m*cp*(To-Ti)/(math.pi*D*q);\n",
+ "\n",
+ "#Using equation 8.6\n",
+ "Re = m*4/(math.pi*D*u);\n",
+ "print '%s %.2f %s' %(\"\\n (a) Length of tube for required heating =\",L,\"m\")\n",
+ "print '%s %.2f %s' %(\"\\n\\n (b)As Reynolds Number is\",Re,\".The flow is laminar.\");\n",
+ "\n",
+ "Nu = 4.364; #Nusselt Number\n",
+ "h = Nu*k/D; #[W/m^2.K] Heat convection Coefficient\n",
+ "\n",
+ "Ts = q/h+To; #[K]\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"\\n Surface Temperature at tube outlet = \",Ts-273,\"degC\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " (a) Length of tube for required heating = 6.65 m\n",
+ "\n",
+ "\n",
+ " (b)As Reynolds Number is 602.86 .The flow is laminar.\n",
+ "\n",
+ " Surface Temperature at tube outlet = 121.04 degC\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page 509 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Length of Blood Vessel\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "um1 = .13; #[m/s] Blood stream\n",
+ "um2 = 3*math.pow(10,-3); #[m/s] Blood stream\n",
+ "um3 = .7*math.pow(10,-3); #[m/s] Blood stream\n",
+ "D1 = .003; #[m] Diameter\n",
+ "D2 = .02*math.pow(10,-3); #[m] Diameter\n",
+ "D3 = .008*math.pow(10,-3); #[m] Diameter\n",
+ "Tlm = .05;\n",
+ "kf = .5; #[W/m.K] Conductivity\n",
+ "#Table A. Water Properties T = 310 K\n",
+ "rho = 993.; #[kg/m^3] density\n",
+ "cp = 4178.; #[J/kg.K] specific heat\n",
+ "u = 695*math.pow(10,-6); #[N.s/m^2] Viscosity\n",
+ "kb = .628; #[W/m.K] Conductivity\n",
+ "Pr = 4.62; #Prandtl Number\n",
+ "i=1.;\n",
+ "#calculations\n",
+ "#Using equation 8.6\n",
+ "Re1 = rho*um1*D1/u;\n",
+ "Nu = 4;\n",
+ "hb = Nu*kb/D1;\n",
+ "hf = kf/D1;\n",
+ "U1 = 1/(1/hb + 1/hf);\n",
+ "L1 = -rho*um1*D1/U1*cp*2.303*math.log10(Tlm)/4.;\n",
+ "xfdh1 = .05*Re1*D1;\n",
+ "xfdr1 = xfdh1*Pr;\n",
+ "\n",
+ "Re2 = rho*um2*D2/u;\n",
+ "Nu = 4;\n",
+ "hb = Nu*kb/D2;\n",
+ "hf = kf/D2;\n",
+ "U2 = 1/(1/hb + 1/hf);\n",
+ "L2 = -rho*um2*D2/U2*cp*2.303*math.log10(Tlm)/4.;\n",
+ "xfdh2 = .05*Re2*D2;\n",
+ "xfdr2 = xfdh2*Pr;\n",
+ "\n",
+ "Re3 = rho*um3*D3/u;\n",
+ "Nu = 4;\n",
+ "hb = Nu*kb/D3;\n",
+ "hf = kf/D3;\n",
+ "U3 = 1/(1/hb + 1/hf);\n",
+ "L3 = -rho*um3*D3/U3*cp*2.303*math.log10(Tlm)/4.;\n",
+ "xfdh3 = .05*Re3*D3;\n",
+ "xfdr3 = xfdh3*Pr;\n",
+ "#results\n",
+ "print ' %s' %(\"\\n Vessel Re U(W/m^2.K) L(m) xfdh(m) xfdr(m)\")\n",
+ "print '%s %.3f %d %.1e %.1e %.1e' %(\"\\n Artery \",Re1, U1 ,L1, xfdh1 , xfdr1)\n",
+ "print '%s %.3f %d %.1e %.1e %.1e' %(\"\\n Anteriole \",Re2, U2 ,L2, xfdh2 , xfdr2)\n",
+ "print '%s %.3f %d %.1e %.1e %.1e' %(\"\\n Capillary \",Re3,U3,L3,xfdh3,xfdr3);\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ " Vessel Re U(W/m^2.K) L(m) xfdh(m) xfdr(m)\n",
+ "\n",
+ " Artery 557.223 138 8.7e+00 8.4e-02 3.9e-01\n",
+ "\n",
+ " Anteriole 0.086 20849 8.9e-06 8.6e-08 4.0e-07\n",
+ "\n",
+ " Capillary 0.008 52124 3.3e-07 3.2e-09 1.5e-08\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page 516 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Heat Loss from the Duct over the Length L, q \n",
+ "# Heat flux and suface temperature at x=L\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "m = .05; \t#[kg/s] mass flow rate of water\n",
+ "Ti = 103+273.; \t#[K] Inlet temp\n",
+ "To = 77+273.; \t\t#[K] Outlet temperature\n",
+ "D = .15; \t\t#[m] Diameter\n",
+ "L = 5; \t\t#[m] length\n",
+ "ho = 6.; \t\t#[W/m^2.K] Heat transfer convective coefficient\n",
+ "Tsurr = 0+273.; \t\t#[K] Temperature of surrounding\n",
+ "\n",
+ "#Table A.4 Air Properties T = 363 K\n",
+ "cp = 1010; \t#[J/kg.K] specific heat\n",
+ "#Table A.4 Air Properties T = 350 K\n",
+ "k = .030; \t#[W/m] Thermal Conductivity\n",
+ "u = 20.82/1000000.; \t#[N.s/m^2] Viscosity\n",
+ "Pr = .7; \t\t#Prandtl Number\n",
+ "#calculations and results\n",
+ "q = m*cp*(To-Ti);\n",
+ "\n",
+ "Re = m*4/(math.pi*D*u);\n",
+ "print '%s %d %s' %(\"\\n As Reynolds Number is\",Re,\". The flow is Turbulent.\");\n",
+ "\n",
+ "#Equation 8.6\n",
+ "n = 0.3;\n",
+ "Nu = .023*math.pow(Re,.8)*math.pow(Pr,.3);\n",
+ "h = Nu*k/D;\n",
+ "q2 = (To-Tsurr)/(1/h + 1/ho);\n",
+ "Ts = -q2/h+To;\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n\\n Heat Loss from the Duct over the Length L, q =\",q,\" W \")\n",
+ "print '%s %.1f %s %.1f %s' %(\"\\n Heat flux and suface temperature at x=L is\",q2,\"W/m^2 &\",Ts-273,\"degC respectively\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As Reynolds Number is 20384 . The flow is Turbulent.\n",
+ "\n",
+ "\n",
+ " Heat Loss from the Duct over the Length L, q = -1313 W \n",
+ "\n",
+ " Heat flux and suface temperature at x=L is 304.3 W/m^2 & 50.7 degC respectively\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page 525"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Time needed to bring the reactants to within 1 degC of processing temperature\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "T1 = 125+273.; \t\t\t#[K] Chip Temperature 1\n",
+ "T2 = 25+273.; \t\t\t#[K] Chip Temperature 2\n",
+ "Ti = 5+273.; \t\t\t#[K] Inlet Temperature \n",
+ "D = .01; \t\t\t#[m] Diameter\n",
+ "L = .02; \t\t#[m] length\n",
+ "delP = 500*1000.; \t\t#[N/m^2] Pressure drop\n",
+ "#Dimensions\n",
+ "a = 40*math.pow(10,-6); \n",
+ "b = 160*math.pow(10,-6);\n",
+ "s = 40*math.pow(10,-6);\n",
+ "\n",
+ "#Table A.5 Ethylene Glycol Properties T = 288 K\n",
+ "rho = 1120.2; \t#[kg/m^3] Density\n",
+ "cp = 2359.; \t#[J/kg.K] Specific Heat\n",
+ "u = 2.82*math.pow(10,-2);\t#[N.s/m^2] Viscosity\n",
+ "k = 247*math.pow(10,-3); \t#[W/m.K] Thermal Conductivity\n",
+ "Pr = 269; \t\t#Prandtl number \n",
+ "#Table A.5 Ethylene Glycol Properties T = 338 K\n",
+ "rho2 = 1085.; \t#[kg/m^3] Density\n",
+ "cp2 = 2583.; \t#[J/kg.K] Specific Heat\n",
+ "u2 = .427*math.pow(10,-2);\t#[N.s/m^2] Viscosity\n",
+ "k2 = 261*math.pow(10,-3); \t#[W/m.K] Thermal Conductivity\n",
+ "Pr2 = 45.2; \t#Prandtl number\n",
+ "#calculations\n",
+ "P = 2*a+2*b; \t#Perimeter of microchannel\n",
+ "Dh = 4*a*b/P; \t#Hydraulic Diameter\n",
+ "\n",
+ "um2 = 2/73.*Dh*Dh/u2*delP/L;#[[m/s] Equation 8.22a\n",
+ "Re2 = um2*Dh*rho2/u2; #Reynolds Number\n",
+ "xfdh2 = .05*Dh*Re2; \t#[m] From Equation 8.3\n",
+ "xfdr2 = xfdh2*Pr2; \t#[m] From Equation 8.23\n",
+ "m2 = rho2*a*b*um2; \t#[kg/s]\n",
+ "Nu2 = 4.44; \t\t#Nusselt Number from Table 8.1\n",
+ "h2 = Nu2*k2/Dh; \t\t#[W/m^2.K] Convection Coeff\n",
+ "Tc2 = 124+273.; \t\t#[K]\n",
+ "xc2 = m2/P*cp2/h2*2.303*math.log10((T1-Ti)/(T1-Tc2));\n",
+ "tc2 = xc2/um2;\n",
+ "\n",
+ "um = 2/73.*Dh*Dh/u*delP/L; #[[m/s] Equation 8.22a\n",
+ "Re = um*Dh*rho/u; \t#Reynolds Number\n",
+ "xfdh = .05*Dh*Re; \t#[m] From Equation 8.3\n",
+ "xfdr = xfdh*Pr; \t\t#[m] From Equation 8.23\n",
+ "m = rho2*a*b*um; \t#[kg/s]\n",
+ "Nu = 4.44; \t\t#Nusselt Number from Table 8.1\n",
+ "h = Nu*k/Dh; \t\t#[W/m^2.K] Convection Coeff\n",
+ "Tc = 24+273.; \t\t#[K]\n",
+ "xc = m/P*cp/h*2.303*math.log10((T2-Ti)/(T2-Tc));\n",
+ "tc = xc/um;\n",
+ "\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"\\nTemp in case 2= \",T2-273,\" [degC]\")\n",
+ "print '%s %.1f %s' %(\"\\nTemp in case 1= \",T1-273,\" [degC]\")\n",
+ "print '%s %.3f %s' %(\"\\nFlow rate in case 2 = \",um2,\"[m/s]\")\n",
+ "print '%s %.3f %s' %(\"\\nFlow rate in case 1 = \",um,\"[m/s]\")\n",
+ "print '%s %.1f' %(\"\\nReynolds number in case 2 = \",Re2)\n",
+ "print '%s %.1f' %(\"\\nReynolds number in case 1 = \",Re)\n",
+ "print '%s %.1f' %(\"\\nHydrodynamic entrance Length [m] =\",xfdh)\n",
+ "print '%s %.1f' %(\"\\nHydrodynamic entrance Length in case 2 [m] =\",xfdh2) \n",
+ "print '%s %.1e' %(\"\\nThermal entrance Length [m] = \",xfdr)\n",
+ "print '%s %.1e' %(\"\\nThermal entrance Length in case 2 [m] = \",xfdr2)\n",
+ "print '%s %.2e' %(\"\\nMass Flow rate [kg/s] = \",m)\n",
+ "print '%s %.2e' %(\"\\nMass Flow rate in case 2 [kg/s] = \",m2)\n",
+ "print '%s %.2e' %(\"\\nConvective Coeff [W/m^2.K] = \",h)\n",
+ "print '%s %.2e' %(\"\\nConvective Coeff in case 2 [W/m^2.K] = \",h2)\n",
+ "print '%s %.2e' %(\"\\nTransition Length [m] = \",xc)\n",
+ "print '%s %.2e' %(\"\\nTransition Length in case 2 [m] = \",xc2)\n",
+ "print '%s %.3f' %(\"\\nRequired Time [s] = \",tc)\n",
+ "print '%s %.3f' %(\"\\nRequired Time in case 2 [s] = \",tc2)\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Temp in case 2= 25.0 [degC]\n",
+ "\n",
+ "Temp in case 1= 125.0 [degC]\n",
+ "\n",
+ "Flow rate in case 2 = 0.657 [m/s]\n",
+ "\n",
+ "Flow rate in case 1 = 0.099 [m/s]\n",
+ "\n",
+ "Reynolds number in case 2 = 10.7\n",
+ "\n",
+ "Reynolds number in case 1 = 0.3\n",
+ "\n",
+ "Hydrodynamic entrance Length [m] = 0.0\n",
+ "\n",
+ "Hydrodynamic entrance Length in case 2 [m] = 0.0\n",
+ "\n",
+ "Thermal entrance Length [m] = 2.2e-04\n",
+ "\n",
+ "Thermal entrance Length in case 2 [m] = 1.5e-03\n",
+ "\n",
+ "Mass Flow rate [kg/s] = 6.91e-07\n",
+ "\n",
+ "Mass Flow rate in case 2 [kg/s] = 4.56e-06\n",
+ "\n",
+ "Convective Coeff [W/m^2.K] = 1.71e+04\n",
+ "\n",
+ "Convective Coeff in case 2 [W/m^2.K] = 1.81e+04\n",
+ "\n",
+ "Transition Length [m] = 7.12e-04\n",
+ "\n",
+ "Transition Length in case 2 [m] = 7.79e-03\n",
+ "\n",
+ "Required Time [s] = 0.007\n",
+ "\n",
+ "Required Time in case 2 [s] = 0.012\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page 529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Average mass trasnfer convection coefficient for the tube\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "m = .0003; \t\t#[kg/s] mass flow rate of water\n",
+ "T = 25+273; \t\t\t\t#[K] Temperature of surrounding and tube\n",
+ "D = .01; \t\t\t#[m] Diameter\n",
+ "L = 1; \t\t\t#[m] length\n",
+ "#calculations and results\n",
+ "#Table A.4 Air Properties T = 298 K\n",
+ "uv = 15.7*math.pow(10,-6); #[m^2/s] Kinematic Viscosity\n",
+ "u = 18.36*math.pow(10,-6); #[N.s/m^2] Viscosity\n",
+ "#Table A.8 Ammonia-Air Properties T = 298 K\n",
+ "Dab = .28*math.pow(10,-4); #[m^2/s] Diffusion coeff\n",
+ "Sc = .56;\n",
+ "\n",
+ "Re = m*4/(math.pi*D*u);\n",
+ "print '%s %d %s' %(\"\\n As Reynolds Number is\",Re,\". The flow is Laminar.\");\n",
+ "\n",
+ "#Using Equation 8.57\n",
+ "Sh = 1.86*math.pow((Re*Sc*D/L),.3334);\n",
+ "h = Sh*Dab/D;\n",
+ "print '%s %.3f %s' %(\"\\n Average mass trasnfer convection coefficient for the tube\",h,\"m/s\");\n",
+ "\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " As Reynolds Number is 2080 . The flow is Laminar.\n",
+ "\n",
+ " Average mass trasnfer convection coefficient for the tube 0.012 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_9.ipynb b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_9.ipynb
new file mode 100644
index 00000000..8bdfef75
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_9.ipynb
@@ -0,0 +1,311 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Free Convection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page 569"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Boundary Layer thickness at trailing edge.\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 70+273.; \t\t\t\t\t#[K] Surface Temperature\n",
+ "Tsurr = 25+273.; \t\t\t\t#[K] Surrounding Temperature\n",
+ "v1 = 0; \t\t\t\t\t#[m/s] Velocity of free air\n",
+ "v2 = 5; \t\t\t\t\t#[m/s] Velocity of free air\n",
+ "L = .25; \t\t\t\t#[m] length\n",
+ "#calculations and results\n",
+ "#Table A.4 Air Properties T = 320 K\n",
+ "uv = 17.95*math.pow(10,-6);\t\t\t#[m^2/s] Kinematic Viscosity\n",
+ "be = 3.12*math.pow(10,-3); \t\t\t#[K^-1] Tf^-1\n",
+ "Pr = 269; \t\t\t# Prandtl number \n",
+ "g = 9.81; \t\t\t\t\t#[m^2/s]gravitational constt\n",
+ "\n",
+ "Gr = g*be*(Ts-Tsurr)*L*L*L/(uv*uv);\n",
+ "del1 = 6*L/math.pow((Gr/4),.25);\n",
+ "print '%s %.3f %s' %(\"\\n Boundary Layer thickness at trailing edge for no air stream\",del1,\"m\");\n",
+ "\n",
+ "Re = v2*L/uv;\n",
+ "print '%s %.2e %s' %(\"\\n\\n For air stream at 5 m/s As the Reynolds Number is \",Re,\"the free convection boundary layer is Laminar\");\n",
+ "del2 = 5*L/math.pow((Re),.5);\n",
+ "print '%s %.4f %s' %(\"\\n Boundary Layer thickness at trailing edge for air stream at 5 m/s is\",del2,\"m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Boundary Layer thickness at trailing edge for no air stream 0.023 m\n",
+ "\n",
+ "\n",
+ " For air stream at 5 m/s As the Reynolds Number is 6.96e+04 the free convection boundary layer is Laminar\n",
+ "\n",
+ " Boundary Layer thickness at trailing edge for air stream at 5 m/s is 0.0047 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page 572 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Heat transfer by convection between screen and room air.\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 232+273.; \t\t\t#[K] Surface Temperature\n",
+ "Tsurr = 23+273.; \t\t#[K] Surrounding Temperature\n",
+ "L = .71; \t\t#[m] length\n",
+ "w = 1.02; \t\t#[m] Width\n",
+ "\n",
+ "#Table A.4 Air Properties T = 400 K\n",
+ "k = 33.8*math.pow(10,-3) \t;#[W/m.K]\n",
+ "uv = 26.4*math.pow(10,-6) \t;#[m^2/s] Kinematic Viscosity\n",
+ "al = 38.3*math.pow(10,-6)\t;#[m^2/s]\n",
+ "be = 2.5*math.pow(10,-3) \t;#[K^-1] Tf^-1\n",
+ "Pr = .69 \t\t;# Prandtl number \n",
+ "g = 9.81 \t;#[m^2/s] gravitational constt\n",
+ "#calculations and results\n",
+ "Ra = g*be*(Ts-Tsurr)/al*L*L*L/uv;\n",
+ "print '%s %.2e %s' %(\"\\n\\n As the Rayleigh Number is\",Ra,\"the free convection boundary layer is turbulent\");\n",
+ "#From equatiom 9.23\n",
+ "Nu = math.pow(.825 + .387*math.pow(Ra,.16667) /math.pow((1+math.pow((.492/Pr),(9./16.))),(8./27.)),2);\n",
+ "h = Nu*k/L;\n",
+ "q = h*L*w*(Ts-Tsurr);\n",
+ "\n",
+ "print '%s %d %s' %(\"\\n Heat transfer by convection between screen and room air is\",q,\"W\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " As the Rayleigh Number is 1.81e+09 the free convection boundary layer is turbulent\n",
+ "\n",
+ " Heat transfer by convection between screen and room air is 1060 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page 577"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Heat Loss from duct per meter of length\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 45+273.; \t\t\t\t#[K] Surface Temperature\n",
+ "Tsurr = 15+273. \t\t\t\t;#[K] Surrounding Temperature\n",
+ "H = .3 \t\t\t\t;#[m] Height \n",
+ "w = .75 \t\t\t\t;#[m] Width\n",
+ "\n",
+ "#Table A.4 Air Properties T = 303 K\n",
+ "k = 26.5*math.pow(10,-3) \t\t;#[W/m.K]\n",
+ "uv = 16.2*math.pow(10,-6) ;#[m^2/s] Kinematic Viscosity\n",
+ "al = 22.9*math.pow(10,-6) ;#[m^2/s] alpha\n",
+ "be = 3.3*math.pow(10,-3) ;#[K^-1] Tf^-1\n",
+ "Pr = .71 \t\t\t;# Prandtl number \n",
+ "g = 9.81 \t\t;#[m^2/s] gravitational constt\n",
+ "#calculations\n",
+ "Ra = g*be*(Ts-Tsurr)/al*H*H*H/uv; #Length = Height\n",
+ "#From equatiom 9.27\n",
+ "Nu = (.68 + .67*math.pow(Ra,.25) /math.pow((1+math.pow((.492/Pr),(9./16.))),(4./9.)));\n",
+ "#for Sides\n",
+ "hs = Nu*k/H;\n",
+ "\n",
+ "Ra2 = g*be*(Ts-Tsurr)/al*(w/2.)*(w/2.)*(w/2.)/uv; #Length = w/2\n",
+ "#For top eq 9.31\n",
+ "ht = k/(w/2.)*.15*math.pow(Ra2,.3334);\n",
+ "#For bottom Eq 9.32\n",
+ "hb = k/(w/2.)*.27*math.pow(Ra2,.25);\n",
+ "\n",
+ "q = (2*hs*H+ht*w+hb*w)*(Ts-Tsurr);\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n Rate of heat loss per unit length of duct is\",q,\" W/m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Rate of heat loss per unit length of duct is 246 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page 580 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Heat Loss from pipe per meter of length\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "Ts = 165+273.; \t\t\t\t#[K] Surface Temperature\n",
+ "Tsurr = 23+273.; \t\t\t#[K] Surrounding Temperature\n",
+ "D = .1 \t\t\t\t;#[m] Diameter\n",
+ "e = .85 \t\t\t\t;# emissivity\n",
+ "stfncnstt=5.67*math.pow(10,(-8))# [W/m^2.K^4] - Stefan Boltzmann Constant \n",
+ "\n",
+ "#Table A.4 Air Properties T = 303 K\n",
+ "k = 31.3*math.pow(10,-3) ;#[W/m.K] Conductivity\n",
+ "uv = 22.8*math.pow(10,-6) ;#[m^2/s] Kinematic Viscosity\n",
+ "al = 32.8*math.pow(10,-6) ;#[m^2/s] alpha\n",
+ "be = 2.725*math.pow(10,-3) \t;#[K^-1] Tf^-1\n",
+ "Pr = .697 \t\t;# Prandtl number \n",
+ "g = 9.81 \t\t;#[m^2/s] gravitational constt\n",
+ "#calculations\t\n",
+ "Ra = g*be*(Ts-Tsurr)/al*D*D*D/uv; \n",
+ "#From equatiom 9.34\n",
+ "Nu = math.pow((.60 + .387*math.pow(Ra,(1./6.))/math.pow(1+math.pow((.559/Pr),(9./16.)),(8./27.))),2);\n",
+ "h = Nu*k/D;\n",
+ "\n",
+ "qconv = h*math.pi*D*(Ts-Tsurr);\n",
+ "qrad = e*math.pi*D*stfncnstt*(Ts*Ts*Ts*Ts-Tsurr*Tsurr*Tsurr*Tsurr);\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n Rate of heat loss per unit length of pipe is \",qrad+qconv,\"W/m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Rate of heat loss per unit length of pipe is 763 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page 592"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#variable initialization\n",
+ "# Heat Loss from pipe per unit of length\n",
+ "# Heat Loss if air is filled with glass-fiber blanket insulation\n",
+ "import math\n",
+ "#Operating Conditions\n",
+ "To = 35+273. \t\t\t;#[K] Shield Temperature\n",
+ "Ti = 120+273. \t\t\t;#[K] Tube Temperature\n",
+ "Di = .1 \t\t\t;#[m] Diameter inner\n",
+ "Do = .12 \t\t;#[m] Diameter outer\n",
+ "L = .01 \t\t\t;#[m] air gap insulation\n",
+ "\n",
+ "#Table A.4 Air Properties T = 350 K\n",
+ "k = 30*math.pow(10,-3) ;#[W/m.K] Conductivity\n",
+ "uv = 20.92*math.pow(10,-6) ;#[m^2/s] Kinematic Viscosity\n",
+ "al = 29.9*math.pow(10,-6) ;#[m^2/s] alpha\n",
+ "be = 2.85*math.pow(10,-3) ;#[K^-1] Tf^-1\n",
+ "Pr = .7 \t\t;# Prandtl number \n",
+ "g = 9.81 \t;#[m^2/s] gravitational constt\n",
+ "#Table A.3 Insulation glass fiber T=300K\n",
+ "kins = .038 \t;#[W/m.K] Conductivity\n",
+ "#calculations\n",
+ "Lc = 2*math.pow((2.303*math.log10(Do/Di)),(4./3.))/math.pow((math.pow((Di/2.),(-3./5.))+math.pow((Do/2.),(-3./5.))),(5./3.));\n",
+ "Ra = g*be*(Ti-To)/al*Lc*Lc*Lc/uv; \n",
+ "keff = .386*k*math.pow((Pr/(.861+Pr)),.25) *math.pow(Ra,.25);\n",
+ "q = 2*math.pi*keff*(Ti-To)/(2.303*math.log10(Do/Di));\n",
+ "\n",
+ "#From equatiom 9.58 and 3.27\n",
+ "qin = q*kins/keff;\n",
+ "#results\n",
+ "print '%s %d %s' %(\"\\n Heat Loss from pipe per unit of length is \",q,\"W/m\")\n",
+ "print '%s %d %s' %(\" \\n Heat Loss if air is filled with glass-fiber blanket insulation\",qin,\"W/m\");\n",
+ "#END"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Heat Loss from pipe per unit of length is 100 W/m\n",
+ " \n",
+ " Heat Loss if air is filled with glass-fiber blanket insulation 111 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/README.txt b/Fundamentals_of_Heat_and_Mass_Transfer/README.txt
new file mode 100644
index 00000000..593587fe
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Devika Raj
+Course: be
+College/Institute/Organization: RVR college of Engineering
+Department/Designation: Electronics and Communication En
+Book Title: Fundamentals of Heat and Mass Transfer
+Author: Incropera, DeWitt, Bergman, Lavine
+Publisher: John Wiley & Sons Inc
+Year of publication: 1981
+Isbn: 9780471612469
+Edition: 3rd \ No newline at end of file
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-1.png b/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-1.png
new file mode 100644
index 00000000..bc6e5b2f
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-1.png
Binary files differ
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-2.png b/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-2.png
new file mode 100644
index 00000000..81db83ab
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-2.png
Binary files differ
diff --git a/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-3.png b/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-3.png
new file mode 100644
index 00000000..9c02d6f1
--- /dev/null
+++ b/Fundamentals_of_Heat_and_Mass_Transfer/screenshots/devika-3.png
Binary files differ
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_03.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_03.ipynb
new file mode 100644
index 00000000..0ee01bdd
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_03.ipynb
@@ -0,0 +1,230 @@
+{
+ "metadata": {
+ "name": "Chapter 03"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 3: Process Variables"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.2, Page number: 17"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Convert the following:\n1. 8.03 yr to seconds (s)\n2. 150 miles/h to yards/h\n3. 100.0 m/s2 to ft/min2\n4. 0.03 g/cm3 to lb/ft3\n'''\n \n#Variable Declaration:\nQ1 = 8.03 #Years(part 1)\nD = 365 #Days in a year\nH = 24 #Hours in a day\nM = 60 #Minutes in an hour\nS = 60 #Seconds in a minute\nQ2 = 150 #Miles per hour(part 2)\nFM = 5280 #Feet in a mile\nYF = 1.0/3.0 #Yard in a feet\nQ3 = 100 #Meter per second square(part 3)\nCmm = 100 #Centimeter in a meter\nFC = 1.0/30.48 #Feet in a centimeter\nSsMs = 60**2 #Second square in a minute square\nQ4 = 0.03 #Gram per centimeter cube (part 4)\nPG = 1.0/454.0 #Pound in a gram\nCF = (30.48)**3 #Centimeter in a feet\n \n#Calculation:\nA1 = Q1*D*H*M*S #Seconds (s)\nA2 = Q2*FM*YF #Yards per hour (yd/hr)\nA3 = Q3*Cmm*FC*SsMs #Feet per min square (ft/min^2)\nA4 = Q4*PG*CF #Pound per feet cube (lb/ft^3)\n \n#Results:\nprint \"1. Seconds in\",Q1,\"year is:\",round(A1/10**8,2),\" x 10**8 s\"\nprint \"2. Yards per hour in\",Q2,\"miles per hour is:\",round(A2/10**5,1),\" x 10**5 yd/h\"\nprint \"3. Feets per minute square in\",Q3,\"meter per square is:\",round(A3/10**6,3),\" x 10**6 ft/min^2\"\nprint \"4. Pounds per feet cube in\",Q4,\"gram per centimeter cube is:\",round(A4),\"lb/ft^3\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. Seconds in 8.03 year is: 2.53 x 10**8 s\n2. Yards per hour in 150 miles per hour is: 2.6 x 10**5 yd/h\n3. Feets per minute square in 100 meter per square is: 1.181 x 10**6 ft/min^2\n4. Pounds per feet cube in 0.03 gram per centimeter cube is: 2.0 lb/ft^3\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.3, Page number: 21"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider the following pressure calculations.\n1. A liquid weighing 100 lb held in a cylindrical column with a base area of 3 in2 exerts\nhow much pressure at the base in lbf/ft2?\n2. If a pressure reading is 35 psig (pounds per square inch gauge), what is the absolute\npressure?\n'''\n \n#Variable Declaration:\nQ1 = 32.2 #Gravitational acceleration (ft/s^2) (part 1)\nCF = 32.2 #Conversion factor (lb.ft/lbf.s^2)\nM = 100 #Mass (lb)\nSA = 3 #Surface area (in^2)\nFsIs = (1.0/12.0)**2 #Feet square in a inch square\nQ2 = 14.7 #Atmospheric pressure (psi) (part 2)\nGP = 35 #Gauge Pressure (psig)\n \n#Caculations:\nF = M*Q1/CF #Force (lbf)\nP = F/SA/FsIs #Pressure at the base (lbf/ft^2)\nPa = GP+Q2 #Absolute pressure (psia)\n \n#Results:\nprint \"1. Pressure at the base is:\",round(P),\"lbf/ft^2\"\nprint \"2. Absolute pressure is:\",round(Pa,1),\"psia\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. Pressure at the base is: 4800.0 lbf/ft^2\n2. Absolute pressure is: 49.7 psia\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.4, Page number: 23"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''If a 55-gal tank contains 20.0 lb of water,\n1. How many pound . moles of water does it contain?\n2. How many gram . moles does it contain?\n3. How many molecules does it contain?\n'''\n \n#Variable Declaration:\nQ1 = 20.0 #Mass (lb) (part 1)\nMH = 1.008 #Molecular weight of H (lb/lbmol)\nMO = 15.999 #Molecular weight of O (lb/lbmol)\nQ2 = 454 #Gram in pound (part 2)\nQ3 = 6.023*10**23 #Avogadro nuber (part 3)\n \n#Calculations:\nMol = 2*MH+MO #Molecular weight of water (lb/lbmol)\nA1 = Q1/Mol #Pound.moles of water (lbmol)\nA2 = Q1*Q2/Mol #Gram.moles of water (gmol)\nA3 = A2*Q3 #Molecules of water (molecules)\n \n#Results:\nprint \"1. Pound.moles of water is:\",round(A1,2),\"lbmol water\"\nprint \"2. Gram.moles of water is:\",round(A2),\"gmol water\"\nprint \"3. Molecules of water is:\",round(A3/10**26,3),\" x 10**26 molecules\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. Pound.moles of water is: 1.11 lbmol water\n2. Gram.moles of water is: 504.0 gmol water\n3. Molecules of water is: 3.036 x 10**26 molecules\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.5, Page number: 25"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following information is given:\nSpecific gravity of liquid (methanol) = 0.92 (at 60\u00b0F)\nDensity of reference substance (water) = 62.4 lb/ft^3 (at 60\u00b0F)\nDetermine the density of methanol in lb/ft^3.\n'''\n \n#Variable declaration:\nSG = 0.92 #Specific gavity of liquid, methanol\nDW = 62.4 #Density of reference substance, water (lb/ft^3)\n \n#Calculation:\nDM = SG*DW #Density of methanol (lb/ft^3)\n \n#Result:\nprint \"Density of methanol is:\",round(DM,1),\"lb/ft^3\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Density of methanol is: 57.4 lb/ft^3\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.6, Page number: 27\n"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the kinematic viscosity of a gas, if the specific gravity and absolute viscosity are 0.8 and\n0.02 cP, respectively?\n'''\n \n#Variable declaration:\nSG = 0.8 #Specific Gravity\nAV = 0.02 #Absolute Viscosity (cP)\ncP = 1 #Viscosity of centipoise (cP)\nVcP = 6.72 * 10**-4 #Pound per feet.sec in a centipoise (lb/ft.s)\npR = 62.43 #Reference density (lb/ft^3)\n \n#Calculations:\nu = AV*VcP/cP #Viscosity of gas (lb/ft.s)\np = SG*pR #Density of gas (lb/ft^3)\nv = u/p #Kinematic viscosity of gas (ft^2/s)\n \n#Result:\nprint \"Kinematic viscosity of gas is:\",round(v/10**-7,3),\"x 10**-7 ft^2/s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Kinematic viscosity of gas is: 2.691 x 10**-7 ft^2/s\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.7, Page number: 27"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''To illustrate the use of a monogram, calculate the absolute viscosity of a 98% sulfuric acid\nsolution at 45\u00b0C.\n'''\n \n#Variable declaration:\nX = 7.0 #Coordinate X of H2SO4\nY = 24.8 #Coordinate Y of H2SO4\nS = 45 #Slope\n \n#Calculations:\n#From the figure C.1 we found the intersection of curves mu = 12cP\nmu = 12\n \n#Results:\nprint \"Absolute viscosity of a 98% sulfuric acid solution at 45\u00b0 C is :\",mu*10**-2,\" g/cm.s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Absolute viscosity of a 98% sulfuric acid solution at 45\u00b0 C is : 0.12 g/cm.s\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.8, Page number: 28"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following is given:\nHeat capacity of methanol = 0.61 cal/g.\u00b0C (at 60\u00b0F)\nConvert the heat capacities to English units.\n'''\n \n#Variable declaration:\nCpM = 0.61 #Heat capacity of methanol (cal/g.\u00b0C)\nG = 454 #Grams in a pound\nB = 1.0/252.0 #Btu in a calorie\nC = 1.0/1.8 #Degree celsius in a degree fahrenheit\n \n#Calculation:\nCp = CpM*G*B*C #Heat capacity in English units (Btu/lb.\u00b0F)\n \n#Result:\nprint \"Heat capacity in English units is: \",round(Cp,2),\" Btu/lb.\u00b0F\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Heat capacity in English units is: 0.61 Btu/lb.\u00b0F\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.9, Page number: 29"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following data is given:\nThermal conductivity of methanol = 0.0512 cal/m.s.\u00b0C(at 60\u00b0F)\nConvert the thermal conductivity to English units.\n'''\n \n#Variable declaration:\nkM = 0.0512 #Thermal conductivity of methanol (cal/m.s\u00b0C)\nB = 1.0/252.0 #Btu in a calorie\nM = 0.3048 #Meters in a feet\nS = 3600 #Seconds in an hour\nC = 1.0/1.8 #Degree celsius in a degree fahrenheit\n \n#Calculation:\nk = kM*B*M*S*C #Thermal conductivity in English units (Btu/ft.h.\u00b0F)\n \n#Result:\nprint \"Thermal coductivity in English units is:\",round(k,3),\"Btu/ft.h.\u00b0F\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Thermal coductivity in English units is: 0.124 Btu/ft.h.\u00b0F\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.11, Page number: 31"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the Reynolds number for a fluid flowing through a 5-inch diameter pipe at 10 fps\n(feet per second) with a density of 50 lb/ft3 and a viscosity of 0.65 cP. Is the flow turbulent\nor laminar?\n'''\n \n#Variable declaration:\nD = 5 #Diameter of pipe (ft)\nV = 10 #Fluid velocity (ft/s)\np = 50 #Fluid density (lb/ft^3)\nu = 0.65 #Fluid viscosity (lb/ft.s)\nF = 1.0/12.0 #Feet in an inch\nVCp = 6.72*10**-4 #Viscosity of centipoise (lb/ft.s)\n \n#Calculation:\nA = D*V*p*F/u/VCp #Reynolds Number\n \n#Result:\nif(A>2100):\n print \"The Reynolds number is :\",round(A,-2),\"; therefore, the flow is turbulent.\"\nelif(A<2100):\n print \"The Reynolds number is :\",round(A,-2),\"; therefore, the flow is not turbulent.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Reynolds number is : 477000.0 ; therefore, the flow is turbulent.\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 3.12, Page number: 32"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''As part of a heat transfer course, a young environmental engineering major has been requested to\ndetermine the potential energy of water before it flows over a waterfall 10 meters in height above\nground level conditions.\n'''\n#Variable declaration:\n#For the problem at hand, take as a basis 1 kilogram of water and assume the potential energy to be zero at ground level conditions.\nz1 = 0 #Intial height from ground level (m)\nz2 = 10 #Final height from ground level (m)\nPE1 = 0 #Initial potential energy at z1 (J)\nm = 1 #Mass of water (kg)\ng = 9.8 #Gravitational acceleration (m/s^2)\ngc = 1 #Conversion factor\n \n#Calculations:\nPE2 = m*(g/gc)*z2 #Final potential energy at z2 (J)\n \n#Result:\nprint \"The potential energy of water is :\",PE2,\"J \"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The potential energy of water is : 98.0 J \n"
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_04.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_04.ipynb
new file mode 100644
index 00000000..7d7ce512
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_04.ipynb
@@ -0,0 +1,272 @@
+{
+ "metadata": {
+ "name": "Chapter 04"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 4: The Conservation Law for Momentum"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.1, Page number: 39"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A 10-cm-diameter horizontal line carries saturated steam at 420 m/s. Water is entrained by the\nsteam at a rate of 0.15 kg/s. The line has a 90\u00b0 bend. Calculate the force components in the horizontal\nand vertical directions required to hold the bend in place due to the entrained water.\n'''\n\n#Variable declaration:\nVx_in = 420 #Entry Velocity in X direction (m/s)\nVx_out = 0 #Exit Velocity in X direction (m/s)\nVy_in = 0 #Entry Velocity in Y direction (m/s)\nVy_out = 420 #Exit Velocity in Y direction (m/s)\nm = 0.15 #Rate of water entrained by the steam (kg/s)\nlb = 1.0/4.46 #Pound force in a newton force\n\n#Calculations:\nMx_out = m*Vx_out #Rate of change of momentum at entry in x-direction (kg.m)\nMx_in = m*Vx_in #Rate of change of momentum at exit in x-direction (kg.m)\nMy_out = m*Vy_out #Rate of change of momentum at entry in y-direction (kg.m)\nMy_in = m*Vy_in #Rate of change of momentum at exit in y-direction (kg.m)\nFxgc = (Mx_out - Mx_in)*lb #Force in X direction (lbf)\nFygc = (My_out - My_in)*lb #Force in X direction (lbf)\n\n#Results:\nif Fxgc < 1:\n print \"The x-direction supporting force acting on the 90\u00b0 elbow is :\",round(-Fxgc,1),\" lbf acting toward the left. \"\nelse:\n print \"The x-direction supporting force acting on the 90\u00b0 elbow is :\",round(Fxgc,1),\" lbf acting toward the right. \"\nif Fygc < 1:\n print \"The y-direction supporting force acting on the 90\u00b0 elbow is :\",round(-Fygc,1),\" lbf acting downwards. \" \nelse:\n print \"The y-direction supporting force acting on the 90\u00b0 elbow is :\",round(Fygc,1),\" lbf acting upwards. \"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The x-direction supporting force acting on the 90\u00b0 elbow is : 14.1 lbf acting toward the left. \nThe y-direction supporting force acting on the 90\u00b0 elbow is : 14.1 lbf acting upwards. \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.2 Page number: 40"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 4.1. Calculate the magnitude and direction of the resultant force.\n'''\n\nfrom math import sqrt,degrees,atan2\n\n#Variable declaration:\nFx = -63 #Force component in X direction (N)\nFy = 63 #Force component in Y direction (N)\nlbf = 0.22481 #Pound-forrce in unit newton (lbf)\n\n#Calculations:\nFr = sqrt(Fx**2 + Fy**2)*lbf #The resultant supporting force (lbf)\nu = degrees(atan2(Fy,Fx)) #Angle between the positive x axis and the direction of the force (degrees)\n\n#Result: \nif (0<u<90):\n print \"The supporting force is :\",round(Fr,1),\" lbf acting at\",u,\"\u00b0 i.e in the \u201cnortheast\u201d direction.\"\nelif (90<u<180):\n print \"The supporting force is :\",round(Fr,1),\" lbf acting at\",u,\"\u00b0 i.e in the \u201cnorthwest\u201d direction.\"\nelif (180<u<270):\n print \"The supporting force is :\",round(Fr,1),\" lbf acting at\",u,\"\u00b0 i.e in the \u201csouthwest\u201d direction.\"\nelif (270<u<360):\n print \"The supporting force is :\",round(Fr,1),\" lbf acting at\",u,\"\u00b0 i.e in the \u201csoutheast\u201d direction.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The supporting force is : 20.0 lbf acting at 135.0 \u00b0 i.e in the \u201cnorthwest\u201d direction.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.3, Page number: 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Fuel is fed into a boiler at a rate of 10,000 lb/h in the presence of 20,000 lb/h of air. Due to the\nlow heating value of the fuel, 2000 lb/h of methane is added to assist in the combustion of the\nfuel. At what rate (lb/h) do the product gases exit the incinerator?\n'''\n\n#Variable declaration:\nR1_in = 10000 #Rate of fuel fed into the boiler (lb/h)\nR2_1n = 20000 #Rate of air fed into the boiler (lb/h)\nR3_in = 2000 #Rate of methane fed into the boiler (lb/h)\n\n#Calculations:\nm_in = R1_in + R2_1n + R3_in #Rate of mass in (lb/h)\nm_out = m_in #Rate of mass out (lb/h)\n\n#Result:\nprint \"The rate of the product gases exit from the incinerator is :\",round(m_in),\" lb/h\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of the product gases exit from the incinerator is : 32000.0 lb/h\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.4, Page number: 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A proposed heat exchanger design requires that a packed column and a spray tower are to be used\nin series for the removal of HCl from a gas feed stream. The spray tower is operating at an efficiency\nof 65% and the packed column at an efficiency of 98%. Calculate the mass flow rate of HCl leaving the spray tower, the mass flow rate of HCl entering the packed tower, and the overall\nfractional efficiency of the removal system if 76.0 lb of HCl enters the system every hour.\n'''\n\n#Variable declaration:\nE1 = 65 #Efficiency of spray tower (%)\nE2 = 98 #Efficiency of packed column (%)\nm_in = 76 #Mass flow rate of HCl entering the system (lb/h)\n\n#Calculations:\nm1_out = (1 - E1/100.0)*m_in #Mass flow rate of HCl leaving the spray tower (lb/h)\nm2_out = (1 - E2/100.0)*m1_out #Mass flow rate of HCl entering the packed column (lb/h)\nE = (m_in - m2_out)/m_in #Overall fractional efficiency (%)\n\n#Result:\nprint \"The mass flow rate of HCl leaving the spray tower is :\",round(m1_out,2),\" lb/h HCL\"\nprint \"The mass flow rate of HCl entering the packed column is :\",round(m2_out,3),\" lb/h HCL\"\nprint \"The overall fractional efficiency is :\",round(E*100,1),\" %\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mass flow rate of HCl leaving the spray tower is : 26.6 lb/h HCL\nThe mass flow rate of HCl entering the packed column is : 0.532 lb/h HCL\nThe overall fractional efficiency is : 99.3 %\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.5, Page number: 43"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider the flow diagram in Figure 4.3 for a wastewater treatment system. The following\nflowrate data are given:\nm\u02d91 = 1000 lb/min\nm\u02d92 = 1000 lb/min\nm\u02d94 = 200 lb/min\nCalculate the amount of water lost by evaporation in the operation, m\u02d9 .\n'''\n\n#Variable declaration:\nm1 = 1000 #Flowrate data 1 (lb/min)\nm2 = 1000 #Flowrate data 2 (lb/min)\nm4 = 200 #Flowrate data 4 (lb/min)\n\n#Calculations:\nm5 = m1 + m2 - m4 #Flowrate data 5 (lb/min)\nm6 = m2 #Flowrate data 6 (lb/min)\nm = m5 - m6 #Flowrate of water lost in operation (lb/min)\n\n#Result:\nprint \"The amount of water lost by evaporation in the operation is\", round(m),\" lb/min\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The amount of water lost by evaporation in the operation is 800.0 lb/min\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.6, Page number: 44"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider the system shown in Figure 4.4. The following volumetric flowrate and phosphate concentration\n(volume basis) data have been provided by the plant manager. Are the data correct\nand/or consistent?\nq1 = 1000 gal/day\nq2 = 1000 gal/day\nq3 = 2000 gal/day\nq4 = 200 gal/day\nq5 = 1800 gal/day\nq6 = 1000 gal/day\nC1 = 4 ppm\nC2 = 0 ppm\nC3 = 2 ppm\nC4 = 20 ppm\nC5 = 0 ppm\nC6 = 0 ppm\n'''\n\n#Variable declaration:\nq1 = 1000.0 #Volumetric flowrate from tank 1 (gal/day)\nq2 = 1000.0 #Volumetric flowrate from tank 2 (gal/day)\nq3 = 2000.0 #Volumetric flowrate from tank 3 (gal/day)\nq4 = 200.0 #Volumetric flowrate from tank 4 (gal/day)\nq5 = 1800.0 #Volumetric flowrate from tank 5 (gal/day)\nq6 = 1000.0 #Volumetric flowrate from tank 6 (gal/day)\nC1 = 4.0 #Phosphate concentration in tank 1 (ppm)\nC2 = 0.0 #Phosphate concentration in tank 2 (ppm)\nC3 = 2.0 #Phosphate concentration in tank 3 (ppm)\nC4 = 20.0 #Phosphate concentration in tank 4 (ppm)\nC5 = 0.0 #Phosphate concentration in tank 5 (ppm)\nC6 = 0.0 #Phosphate concentration in tank 6 (ppm)\nCf = 120000.0 #conversion factor for water (gal/10**6lb)\n\n#Calculations:\nC1q1 = C1*q1/Cf #Data 1 (lb/day)\nC2q2 = C2*q2/Cf #Data 2 (lb/day)\nC3q3 = C3*q3/Cf #Data 3 (lb/day)\nC4q4 = C4*q4/Cf #Data 4 (lb/day)\nC5q5 = C5*q5/Cf #Data 5 (lb/day)\nC6q6 = C6*q6/Cf #Data 6 (lb/day)\n\n#Results:\nif (((C1q1 + C2q2) == C3q3) and C3q3 == (C4q4 + C5q5) and C5q5 == C6q6 and C2q2 == C6q6):\n print \"The data appear to be consistent .\"\nelse:\n print \"The data appear to be inconsistent .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The data appear to be consistent .\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.7, Page number: 48"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A lake is located at the top of a mountain. A power plant has been constructed at the bottom of\nthe mountain. The potential energy of the water traveling downhill can be used to spin turbines\nand generate electricity. This is the operating mode in the daytime during peak electrical\ndemand. At night, when demand is reduced, the water is pumped back up the mountain. The\noperation is shown in Figure 4.5.\nUsing the method of power \u201cproduction\u201d described above, determine how much power\n(Watts) is generated by the lake located at an elevation of 3000 ft above the power plant. The\nflowrate of water is 500,000 gpm. The turbine efficiency is 30%. Neglect friction effects.\nNote: This programmed-instructional problem is a modified and edited version (with permission)\nof an illustrative example prepared by Marie Gillman, a graduate mechanical engineering\nstudent at Manhattan College.\n'''\n\n#Variable declaration:\nDz = 3000 #Height (ft)\nV0 = 500000 #Flowrate of water (gal/min)\nn = 30 #Turbine efficiency (%)\nm = 0.3048 #Meters in a feet\nm3 = 0.00378 #Meters-cube in a gallon\ng = 9.8 #Gravitational acceleration (m/s^2)\ngc = 1 #Conversion factor\nMW = 10**(-6) #Megawatt in newton-meter-per-second\n\n#Calculations:\nV1 = (V0*m3)*1000.0/60.0 #The mass flow rate of the water in kilograms/second (kg/s)\nDPE = V1*g*Dz*m/gc*MW #The loss in potential energy (MW)\nAP = n/100.0*DPE #The actual power output (MW)\n\n#Result:\nprint \"The power generated by the lake located is :\",round(AP,1),\" MW\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The power generated by the lake located is : 84.7 MW\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.8, Page number: 50"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''If 111.4 lbmol/min of an air stream is heated from 200\u00b0F to 600\u00b0F, calculate the heat transfer\nrate required to bring about this change in temperature. Use the following enthalpy and average\nheat capacity data:\nH200\u00b0F = 1170 Btu/lbmol\nH600\u00b0F = 4010 Btu/lbmol\n'''\n\n#Variable declaration:\nn = 111.4 #Flowrate of air stream (lbmol/min)\nH1 = 1170 #Average heat capacity at 200\u00b0F (Btu/lbmol)\nH2 = 4010 #Average heat capacity at 600\u00b0F (Btu/lbmol)\n\n#Calculation:\nQ = n*(H2 - H1) #The heat transfer rate (Btu/min)\n\n#Result:\nprint \"The heat transfer rate required is:\",round(Q/10**5,2),\" x 10**5 Btu/min\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate required is: 3.16 x 10**5 Btu/min\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.9, Page number: 50"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Given the mass flow rate of a fluid and its heat capacity, determine the required heat rate to\nchange the fluid from one temperature to another. Data are provided below:\nn = 600 lbmol/min\nCp,AV = 0.271 Btu/lbmol . \u00b0F (over the 200\u2013600\u00b0F range)\nT1 = 200\u00b0F\nT2 = 600\u00b0F\n'''\n\n#Variable declaration:\nn = 600 #The mass flow rate of fluid (lbmol/min)\nCp_AV = 0.271 #Heat capacity (Btu/lbmol . \u00b0F)\nT1 = 200 #Initial temperature(\u00b0F)\nT2 = 600 #Final temperature(\u00b0F)\n\n#Calcultaion:\nQ = n*Cp_AV*(T2 - T1) #The required heat rate (Btu/min)\n\n#Result:\nprint \"The required heat rate is :\",round(Q,-2),\" Btu/min\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required heat rate is : 65000.0 Btu/min\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.10, Page number: 51"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Obtain the heat transfer rate in an exchanger if equal mass liquid flow rates are used. The hot\nfluid is cooled from 94 \u00b0C to 82 \u00b0C while the cold fluid is initially at 20 \u00b0C.\n'''\n\n#Variable declaration:\nT_c1 = 20 #Initial cold fluid temperature (\u00b0C)\nT_h1 = 82 #Initial hot fluid temperature (\u00b0C)\nT_h2 = 94 #Final hot fluid temperature (\u00b0C)\n\n#Calculation:\nT_c2 = (T_h2 - T_h1 + T_c1) #Final cold fluid temperature (\u00b0C)\n\n#Result:\nprint \"The heat transfer rate is:\",round(T_c2),\" \u00b0C\"\nprint \"There is a printing mistake in book regarding unit of the final result.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate is: 32.0 \u00b0C\nThere is a printing mistake in book regarding unit of the final result.\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.11, Page number: 51"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''As a gas flows through a cooler, 5.5MW of heat is transferred from the gas. The average heat\ncapacity of the gas is 1090 J/(kg . \u00b0C), the gas mass flow rate, m\u02d9 , is 9 kg/s and the gas inlet temperature,\nT1, is 650 \u00b0C. For this example, kinetic and potential energy effects are again neglected.\nFurthermore, there is no shaft work. Determine the gas outlet temperature.\n'''\n\n#Variable declaration:\nQ = -5.5*10**6 #The heat transferred out from the gas (W)\nCp = 1090.0 #The average heat capacity of the gas (J/(kg . \u00b0C))\nm = 9.0 #The gas mass flow rate (kg/s)\nT1 = 650 #The gas inlet temperature (\u00b0C)\n\n#Calculation:\nT2 = Q/(m*Cp)+T1 #The gas outlet temperature (\u00b0C)\n\n#Result:\nprint \"The gas outlet temperature is :\",round(T2),\" \u00b0C\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The gas outlet temperature is : 89.0 \u00b0C\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 4.12, Page number: 52"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A heat pump takes in 3500 gpm of water at a temperature of 38 \u00b0F and discharges it back to the\nlake at 36.2 \u00b0F. How many Btu are removed from thewater per day [Cp for H2O = 75.4 J/(gmol .\u00b0C),\np = 62.4 lb/ft^3]?\n '''\n\n#Variable declaration:\nn = 3500.0 #Inlet flowrate of water (gal/min)\nCp_W = 75.4 #Heat capacity of water (J/(gmol . \u00b0C)\np = 62.4 #Density of water (lb/ft^3)\nM = 24*60.0 #Minutes in a day (min/day)\nG = 7.48 #Gallons in a feet cube (gal/ft^3)\ngm = 454.0 #Grams in a pound (g/lb)\nJ = 1054.0 #Joules in a Btu (J/Btu)\ng = 18.0 #Grams in a gmol (g/gmol)\nF = 1.8 #Degree fahrenheit in a degree celcius (\u00b0F)\nTi = 38.0 #Initial temperature (\u00b0F)\nTf = 36.2 #Final temperature (\u00b0F)\n\n#Calculations:\nT= Ti-Tf #Temperature loss (\u00b0F)\nm = n*p*M/G #Mass flow rate of water (lb/day)\nCp = Cp_W*gm/J/g/F #Heat capacity in cosistent units (Btu/(lb.\u00b0F))\nQ = m*Cp*T #Rate of heat flow from water (Btu/day)\n\n#Result:\nprint \"The rate of Btu removed from the water per day is :\",round(Q/10**8,2),\" x 10**8 Btu/day .\"\nprint \"There is a calculation mistake in the book regarding the final result.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of Btu removed from the water per day is : 0.76 x 10**8 Btu/day .\nThere is a calculation mistake in the book regarding the final result.\n"
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_05.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_05.ipynb
new file mode 100644
index 00000000..8cc3b0eb
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_05.ipynb
@@ -0,0 +1,251 @@
+{
+ "metadata": {
+ "name": "Chapter 05"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 5: Gas Laws"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.1, Page number: 56"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the final ( f ) volumetric flow rate of a gas that is heated at constant pressure in a heat\nexchanger from 100 to 300\u00b0F if its initial (i) flow is 3500 actual cubic feet per minute (acfm).\n'''\n\n#Variable declaration:\nqi = 3500 #Initial volumetric flow rate of gas (acfm)\nTi = 100.0 #Initial temperature (\u00b0F)\nTf = 300.0 #Final temperature (\u00b0F)\n\n#Calculation:\nTi_R = Ti+460 #Initial temperatur in Rankine scale (\u00b0R)\nTf_R = Tf+460 #Final temperatur in Rankine scale (\u00b0R)\nqf = qi*(Tf_R/Ti_R) #Final volumetric flow rate of gas (acfm)\n\n#Result:\nprint \"The final volumetric flow rate of gas is :\",round(qf),\" acfm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The final volumetric flow rate of gas is : 4750.0 acfm\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.2, Page number: 57"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the volumetric flow rate of the gas (100\u00b0F, 1 atm) in the previous example if it is compressed\nisothermally (constant temperature) to 3 atm?\n'''\n\n#Variable declaration:\nqi = 3500 #Initial volumetric flow rate of gas (acfm)\nPi = 1.0 #Iitial pressure (atm)\nPf = 3.0 #Final pressure (atm)\n\n#Calculation:\nqf = qi*(Pi/Pf) #Final volumetric flow rate of gas (acfm)\n\n#Result:\nprint \"The volumetric flow rate of the gas (100\u00b0F, 1 atm) is:\",round(qf),\" acfm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The volumetric flow rate of the gas (100\u00b0F, 1 atm) is: 1167.0 acfm\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.3, Page number: 57"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the volumetric flow rate of the gas in the previous example if the final temperature\nis 300\u00b0F.\n'''\n\n#Variable declaration:\nqi = 3500 #Initial volumetric flow rate of the gas (acfm)\nPi = 1.0 #Initial pressure (atm)\nPf = 3.0 #Final pressure (atm)\nTf = 300.0+460.0 #Final temperature in Rankine scale (\u00b0R)\nTi = 100.0+460.0 #Initial temperature in Rankine scale (\u00b0R)\n\n#Calculation:\nqf = qi*(Pi/Pf)*(Tf/Ti) #Final volumetric flow rate of the gas (acfm)\n\n#Result:\nprint \"The volumetric flow rate of the gas at 300\u00b0F temperature is :\",round(qf),\" acfm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The volumetric flow rate of the gas at 300\u00b0F temperature is : 1583.0 acfm\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.4, Page number: 59"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the density of air at 75 \u00b0F and 14.7 psia? The molecular weight of air is approximately 29.\n'''\n\n#Variable declaration:\nP = 14.7 #Absolute pressure of air (psia)\nMW = 29 #Molecular weight of air (lb/lbmol)\nT = 75+460 #Temperature in Rankine scale (\u00b0R)\nR = 10.73 #Universal gas constant (ft^3.psi/lbmol.\u00b0R)\n\n#Calculation:\np = P*MW/R/T #Density of air (lb/ft^3)\n\n#Result:\nprint \"The density of air at 75\u00b0F and 14.7 psia is :\",round(p,4),\" lb/ft^3\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The density of air at 75\u00b0F and 14.7 psia is : 0.0743 lb/ft^3\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.5, Page number: 59"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the volume (in ft3) of 1.0 lbmol of any ideal gas at 60\u00b0F and 14.7 psia.\n'''\n\n#Variable declaration:\nn = 1 #Molar flow rate of gas (lbmol/h)\nR = 10.73 #Universal gas constant (ft^3.psi/lbmol.\u00b0R)\nT = 60+460 #Temperature in Rankine scale (\u00b0R)\nP = 14.7 #Absolute pressure of gas (psia)\n\n#Calculation:\nV = n*R*T/P #Volume of gas (ft^3)\n\n#Result:\nprint \"The volume of given ideal gas is :\",round(V,1),\" ft^3\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The volume of given ideal gas is : 379.6 ft^3\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.6, Page number: 59"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the density of a gas (MW = 29) in g/cm3 at 20\u00b0C and 1.2 atm using the ideal gas law.\n'''\n\n#Variable declaration:\nP = 1.2 #Abslute pressure of gas (psia)\nMW = 29 #Molecular weight of gas (g/gmol)\nR = 82.06 #Universal gas constant (atm.cm^3/gmol.K)\nT = 20+273 #Temperature in Kelvin (K)\n\n#Calculation:\np = P*MW/R/T #Dendity of gas (g/cm^3)\n\n#Result:\nprint \"The density of given gas is :\",round(p,5),\" g/cm^3\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The density of given gas is : 0.00145 g/cm^3\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.7, Page number: 60"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A certain pure-component two-element ideal gas has a specific volume v of 10.58 ft3/lb at 70\u00b0F\nand 14.7 psia. Determine the molecular weight of the gas and state its name. (Hint: The gas is\nacidic and soluble in water.)\n'''\n\n#Variable declaration:\nR = 10.73 #Universal gas constant (psia . ft^3/lbmol .\u00b0R)\nT = 70+460 #Temperature in Rankine scale (\u00b0R)\nv = 10.58 #Specific volume (ft^3/lb)\nP = 14.7 #Absolute pressure (psia)\n\n#Calculation:\nMW = R*T/v/P #Molecular weight of gas (lb/lbmol)\n\n#Result:\nprint \"The molecular weight of the gas is :\",round(MW,2),\" lb/lbmol.\"\nprint \"It appears that the gas is HCl (i.e., hydrogen chloride).\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The molecular weight of the gas is : 36.57 lb/lbmol.\nIt appears that the gas is HCl (i.e., hydrogen chloride).\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.8, Page number: 61"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Data from a heat exchanger indicate a volumetric flow rate of 30,000 scfm (60\u00b0F, 1 atm). If the\noperating temperature and pressure of the unit are 1100\u00b0F and 1 atm, respectively, calculate the\nflow rate in actual cubic feet per minute (acfm).\n'''\n\n#Variable declaration:\nqs = 30000 #Volumetric flow rate at standard conditions (scfm)\nTa = 1100+460 #Actual absolute temperature in Rankine scale (\u00b0R)\nTs = 60+460 #Standard absolute temperature in Rankine scale (\u00b0R)\n\n#Calculation:\nqa = qs*Ta/Ts #Volumetric flow rate at actual conditions (acfm)\n\n#Result:\nprint \"The volumetric flow rate in actual cubic feet per minute is :\",round(qa),\" acfm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The volumetric flow rate in actual cubic feet per minute is : 90000.0 acfm\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.9, Page number: 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The exhaust gas flow rate from a condenser is 1000 scfm. All of the gas is vented through a small\nstack that has an inlet area of 2.0 ft^2. The exhaust gas temperature is 300\u00b0F. What is the velocity\nof the gas through the stack inlet in feet per second? Assume standard conditions to be 70\u00b0F and\n1.0 atm. Neglect the pressure drop across the stack.\n'''\n\n#Variable declaration:\nqs = 1000 #Volumetric flow rate at standard conditions (scfm)\nTa = 300+460 #Actual absolute temperature in Rankine scale (\u00b0R)\nTs = 70+460 #Standard absolute temperature in Rankine scale (\u00b0R)\nA = 2.0 #Inlet area of stack (ft^2)\n\n#Calculations:\nqa = qs*Ta/Ts #Volumetric flow rate at actual conditions (acfm)\nv = qa/A/60 #Velocity of gas (ft/s)\n\n#Result:\nprint \"The velocity of the gas through the stack inlet is :\",round(v),\" ft/s\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The velocity of the gas through the stack inlet is : 12.0 ft/s\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.10, Page number: 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''C6H5Cl is fed into a thermal oxidizer at a rate of 5000 scfm (60\u00b0F, 1 atm) and is combusted in the\npresence of air fed at a rate of 3000 scfm (60\u00b0F, 1 atm). Both streams enter the oxidizer at 70\u00b0F.\nThe products are then cooled from 20008F and exit the cooler at 180\u00b0F. At what rate (lb/h) do the\nproducts exit the cooler? The molecular weight of C6H5Cl is 112.5; the molecular weight of\nair is 29.\n'''\n\n#Variable declaration:\nqs1 = 5000.0 #Volumetric flow rate of C6H5Cl at standard conditions (scfm)\nqs2 = 3000.0 #Volumetric flow rate of air at standard conditions (scfm)\nTa = 70+460.0 #Actual absolute temperature in Rankine scale (\u00b0R)\nTs = 60+460.0 #Standard absolute temperature in Rankine scale (\u00b0R)\nV = 387.0 #Volume occupied by one lbmol of any ideal gas (ft^3)\nM1 = 112.5 #Molecular weight of C6H5Cl (lb/lbmol)\nM2 = 29.0 #Molecular weight of air (lb/lbmol)\nT = 60.0 #Absolute temperature (\u00b0F)\n\n#Calculations:\nqa1 = qs1*(Ta/Ts) #Volumetric flow rate of C6H5Cl at actual conditions (acfm)\nqa2 = qs2*(Ta/Ts) #Volumetric flow rate of air at actual conditions (acfm)\nn1 = qa1/V #Molar flow rate of C6H5Cl (lbmol/min)\nn2 = qa2/V #Molar flow rate of air (lbmol/min)\nm1 = n1*M1*T #Mass flow rate of C6H5Cl (lb/h)\nm2 = n2*M2*T #Mass flow rate of air (lb/h)\nm_in = m1+m2 #Total mass flow rate of both streams entering the oxidizer (lb/h)\nm_out = m_in #Total mass flow rate of both streams exit the cooler (lb/h)\n\n#Result:\nprint \"The rate of the products exit the cooler is :\",round(m_out),\" lb/h\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of the products exit the cooler is : 102634.0 lb/h\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 5.11, Page number: 64"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The exhaust to the atmosphere from a thermal device has a SO3 concentration expressed as\n0.15 mm Hg partial pressure. Calculate the parts per million of SO3 in the exhaust.\n'''\n\n#Variable declaration:\np = 0.15 #Partial pressure of SO3 (mm Hg)\nP = 760.0 #Atmospheric pressure (mm Hg)\nm = 10**6 #Particles in a million\n\n#Calculation:\ny = p/P #Mole fraction of SO3\nppm = y*m #Parts per million of SO3 (ppm)\n\n#Result:\nprint \"The parts per million of SO3 in the exhaust is :\",round(ppm),\" ppm .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The parts per million of SO3 in the exhaust is : 197.0 ppm .\n"
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_06.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_06.ipynb
new file mode 100644
index 00000000..dfc904b2
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_06.ipynb
@@ -0,0 +1,188 @@
+{
+ "metadata": {
+ "name": "Chapter 06"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 6: Heat Exchanger Pipes and Tubes"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.1, Page number: 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Obtain the inside diameter in inches of 2 inch schedule 40 nominal steel pipe.\n'''\n\n#Variable declaration:\nNPS = 2 #Nominal pipe size (inch)\nSN = 40 #Schedule number\n\n#Calculation:\n#From Table 6.2, we obtain that the inside diameter of steel pipe is ID = 2.067 in.\nID = 2.067\n\n#Result:\nprint \"The inside diameter of steel pipe is :\",ID,\" in.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The inside diameter of steel pipe is : 2.067 in.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.2, Page number: 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Determine the inside diameter (ID), outside diameter (OD), wall thickness, and pipe weight\n(in lb/ft) of 3 inch schedule 40 steel pipe.\n'''\n\n#Variable declaration:\nNPS = 3 #Nominal pipe size (inch)\nSN = 40 #Schedule number\n\n#Calculation:\n#From Table 6.2, we obtain that the inside diameter of steel pipe is ID = 3.068 in, outside diameter OD = 3.5 in, wal thickness WT = 0.216 in, and pipe weight PW = 7.58 lb/ft.\nID = 3.068\nOD = 3.5\nWT = 0.216\nPW = 7.58\n\n#Result:\nprint \"The inside diameter of steel pipe is :\",ID,\" in\"\nprint \"The outside diameter of steel pipe is :\",OD,\" in\"\nprint \"The wall thickness of steel pipe is :\",WT,\" in\"\nprint \"The weight of steel pipe is :\",PW,\" lb/ft.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The inside diameter of steel pipe is : 3.068 in\nThe outside diameter of steel pipe is : 3.5 in\nThe wall thickness of steel pipe is : 0.216 in\nThe weight of steel pipe is : 7.58 lb/ft.\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.3, Page number: 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following information is provided for a steel pipe:\nID = 0.957 in\nOD = 1.315 in\nWall thickness = 0.179 in\nPipe weight = 2.17 lb/ft\nDetermine the nominal size and schedule number of the pipe.\n'''\n\n#Variable declaration:\nID = 0.957 #Inside diameter of pipe (in)\nOD = 1.315 #Outside diameter of pipe (in)\nWT = 0.179 #Wall thickness of pipe (in)\nPW = 2.17 #Weight of pipe (lb/ft)\n\n#Calculation:\n#From Table 6.2, it indicates that the steel pipe is 1 inch schedule 80.\nNSP = 1\nSN = 80\n\n#Result:\nprint \"The nominal size of the pipe is :\",NSP,\" in.\"\nprint \"The schedule number of the pipe is:\",SN,\".\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The nominal size of the pipe is : 1 in.\nThe schedule number of the pipe is: 80 .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.4, Page number: 75"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Determine the inside diameter, wall thickness, outside diameter, and external area per foot (EA)\nof a 3/4 inch 16 BWG tube.\n'''\n\n#Variable declaration:\nS = 3/4 #Tube size (in)\nBWG = 16 #Birmingham Wire Gauge number (gauge)\n\n#calculation:\n#From table 6.3, we get:\nID = 0.620 #Internal diameter of tube (in)\nWT = 0.065 #Wall thickness of tube (in)\nOD = ID+2*WT #Outside diameter of tube (in)\nEA = 0.1963 #External area per foot (ft)\n\n#Result:\nprint \"The inside diameter is :\",ID,\" in\"\nprint \"The wall thickness is :\",WT,\" in\"\nprint \"The outside diamater is :\",OD,\" in\"\nprint \"The external area per foot per foot :\",EA,\" ft.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The inside diameter is : 0.62 in\nThe wall thickness is : 0.065 in\nThe outside diamater is : 0.75 in\nThe external area per foot per foot : 0.1963 ft.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.11, Page number: 81"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An air-conditioning duct has a rectangular cross-section of 1 m by 0.25 m. If the kinematic viscosity\nof the air is approximately 1 x 10**-5 m2/s, determine the maximum air velocity before\nthe flow becomes turbulent. Assume the critical Reynolds number is 2300.\n'''\n\n#Variable declaration:\na = 1 #Length of cross-section (m)\nb = 0.25 #Width of cross-section (m)\nv = 1*10**-5 #Kinematic viscosity of air (m^2/s)\nRe = 2300.0 #Reynolds Number\ncm = 100 #Cenitmeters in a meter\n\n#Calculation:\nDh = 2*a*b/(a+b) #Hydraulic diameter of duct (m)\nV = Re*v/Dh*cm #Maximum air velocity (cm/s)\n\n#Result:\nprint \"The maximum air velocity before the flow becomes turbulent is :\",round(V,1),\" cm/s.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The maximum air velocity before the flow becomes turbulent is : 5.8 cm/s.\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.12, Page number: 82"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A circular 2-inch diameter horizontal tube contains a cold liquid fluid of density and viscosity\n70 lb/ft3 and 0.1806 lb/ft . s, respectively. If, the flow rate is 0.486 ft3/s, determine if the flow\nis laminar.\n'''\n\n#Variable declaration:\nq = 0.486 #Flow rate of fluid (ft^3/s)\nD = 2.0/12.0 #Diameter of tube in feet (ft)\npi = 3.14 #Value of pi\np = 70.0 #Density of fluid (lb/ft^3)\nu = 0.1806 #Viscosity of fluid (lb/ft)\n\n#Calculation:\nV = 4*q/pi/D**2 #Flow velocity (ft/s)\nRe = D*V*p/u #Reynolds Number\n\n#Result:\nif(Re<2100):\n print \"The flow is laminar.\"\nelif(Re>2100):\n print \"The flow is turbulant.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The flow is laminar.\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.13, Page number: 82"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 6.12. How long must the pipe be to ensure a fully developed flow?'''\n\n#Variable declaration:\n#From example 6.12, we have:\nD = 2.0/12.0 #Diameter of pipe in feet (ft)\nRe = 1440.0 #Reynolds number\n\n#Calculation:\nLc = 0.05*D*Re #Length of pipe (ft)\n\n#Result:\nprint \"The pipe length to ensure a fully developed flow is:\",Lc,\" ft.\"\nprint \"This is an abnormally long calming length for a pipe (or tube) in a heat exchanger.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The pipe length to ensure a fully developed flow is: 12.0 ft.\nThis is an abnormally long calming length for a pipe (or tube) in a heat exchanger.\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 6.14, Page number: 82"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the average velocity of water flowing in a 2-inch schedule 40 standard pipe at 608F for\nwhich the flow is viscous (laminar).\n'''\n\n#Variable declaration:\nu = 6.72*10**-4 #Viscosity of water (lb/ft.s)\np = 62.4 #Density of water (lb/ft^3)\n#For laminar flow:\nRe = 2100.0 #Reynolds number\n#From table 6.2, we have:\nD = 2.067/12.0 #Inside diameter of pipe (ft)\n\n#Calculation:\nV = Re*u/D/p #Average velocity of water flowing (ft/s)\n\n#Result:\nprint \"The average velocity of water flowing is:\",round(V,2),\" ft/s.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The average velocity of water flowing is: 0.13 ft/s.\n"
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_07.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_07.ipynb
new file mode 100644
index 00000000..939dc2b5
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_07.ipynb
@@ -0,0 +1,188 @@
+{
+ "metadata": {
+ "name": "Chapter 07"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 7: Steady-State Heat Conduction"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.1, Page number: 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A glass window is 1 cm thick and has an area of 3 m^2. The temperature at the outer surface is\n10\u00b0C. The glass has a conductivity of 1.4 W/m . K. The heat transfer rate is 3 kW. Calculate\nthe temperature at the inner surface.\n'''\n\n#Variable declaration:\nQ = 3000.0 #The rate of heat flow through the glass window (W)\nL = 0.01 #Thickness of glass window (m)\nA = 3.0 #Area of heat transfer (m^2)\nTC = 10+273 #Temperature at the outside surface (K)\nk = 1.4 #Thermal onductivity of glass (W/m.K)\n\n#Calculation:\nTH = TC+Q*L/k/A #Temperature at the inner surface (K)\n\n#Result:\nprint \"The temperature at the inner surface is :\",round(TH,1),\" K\"\nprint \"The temperature at the inner surface is :\",round(TH-273,1),\" \u00b0C\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature at the inner surface is : 290.1 K\nThe temperature at the inner surface is : 17.1 \u00b0C\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.2, Page number: 94"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A new 1 ft thick insulating material was recently tested for heat resistant properties. The data\nrecorded temperatures of 70\u00b0F and 210\u00b0F on the cold and hot sides, respectively. If the thermal\nconductivity of the insulating material is 0.026 Btu/ft . h . \u00b0F, calculate the rate of the heat flux,\nQ/A, through the wall in Btu/ft^2 . h. Resolve the problem in SI units.\n'''\n\n#Variable declaration:\nk = 0.026 #Thermal conductivity of insulating material (Btu/ft.h.\u00b0F)\nL = 1.0 #Thickness of insulating material (ft)\nTC = 70.0 #Temperature on the cold side surface (\u00b0F)\nTH = 210.0 #Temperature on the hot side surface (\u00b0F)\nc = 0.252 #Kilocalorie per hour in a Btu per hour\nm = 0.093 #meter square in a feet square\n\n#Calculation:\nDT = TH-TC #Change in temperature (\u00b0F)\nQ1 = k*DT/L #Rate of heat flux throughthe wall (Btu/f^t2.h.)\nQ2 = Q1*c/m #Rate of heat flux throughthe wall in SI units (kcal/m^2.h)\n\n#Result:\nprint \"The rate of heat flux in Btu/ft^2.h is :\",round(Q1,3),\" Btu/ft^2.h .\"\nprint \"The rate of heat flux in SI units is :\",round(Q2,3),\" kcal/m^2.h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of heat flux in Btu/ft^2.h is : 3.64 Btu/ft^2.h .\nThe rate of heat flux in SI units is : 9.863 kcal/m^2.h .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.3, Page number: 94"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following information is provided. A rectangular furnace wall is made of fire clay (height,\nH = 3 m, width, W = 1.2 m, thickness, L = 0.17 m). Temperature of inside surface (area =\nH x W), TH, is 1592 K, and of the outside surface (area = H x W), TC, is 1364 K.\nDetermine the temperature gradient, the heat transfer rate, and the heat transfer flux.\n'''\n\n#Variable declaration:\nTH = 1592.0 #Temperature of inside surface (K)\nTC = 1364.0 #Temperature of outside surface (K)\nH = 3.0 #Height of furnace wall (m)\nW = 1.2 #Width of furnace wall (m)\nL = 0.17 #Thickness furnace wall (m)\nm = 0.0929 #Meter square per second in a feet square per second\nBtu = 3.412 #Btu per hour in a Watt\nBtu2 = 0.3171 #Btu per feet square hour in a watt per meter square\n\n#Calculation:\nTav = (TH+TC)/2 #Average wall temperature (K)\n#From Table in Appendix:\np = 2645.0 #Density of material (kg/m^3)\nk = 1.8 #Thermal conductivity (W/m.K)\nCp = 960.0 #Heat capacity of material (J/kg.K)\na = k/(p*Cp)/m #Thermal diffusivity (ft^2/s)\nt = (TC-TH)/L #Temperature gradient (\u00b0C/m)\nA = H*W #Heat transfer area (m^2)\nQ1 = k*A*(TH-TC)/L*Btu #Heat transfer rate (Btu/h)\nQ2 = k*(TH-TC)/L*Btu2 #Heat transfer flux (Btu/h.ft^2)\nR = L/(k*A) #Thermal resistance (\u00b0C/W)\n\n#Result:\nprint \"The temperature gradient is :\",round(t),\" \u00b0C/m.\"\nprint \"The heat transfer rate is :\",round(Q1),\" Btu/h.\"\nprint \"The heat transfer flux is :\",round(Q2,1),\" Btu/h.ft^2.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature gradient is : -1341.0 \u00b0C/m.\nThe heat transfer rate is : 29653.0 Btu/h.\nThe heat transfer flux is : 765.5 Btu/h.ft^2.\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.4, Page number: 96"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A concrete wall has a surface area of 30 m^2 and is 0.30 m thick. It separates warm room air from\ncold ambient air. The inner surface of the wall is known to be at a temperature of 25\u00b0C, while the\nouter surface is at -15\u00b0C. The thermal conductivity of the concrete is 1.0 W/m . K.\n1. Describe the conditions that must be satisfied in order for the temperature distribution in\nthe wall to be linear.\n2. What is the driving force for the transfer of heat?\n3. What is the heat loss through the wall?\n'''\n\n#Variable declaration:\nTH = 25.0 #Temperature at inner suface of wall (\u00b0C)\nTC = -15.0 #Temperature at outer suface of wall (\u00b0C)\nL = 0.3 #Thickness of wall (m)\nk = 1.0 #Thermal conductivity of concrete (W/m)\nA = 30.0 #Sueface area of wall (m^2)\n\n#Calculation:\nDT = TH-TC #Driving force for heat transfer (\u00b0C) (part 2)\nR = L/(k*A) #Thermal resistance (\u00b0C/W) (part 3)\nQ = DT/R/10**3 #Heat loss through the wall (kW)\n\n#Result:\nprint \"1. Theoretical part.\"\nprint \"2. The driving force for heat transfer is :\",DT,\" \u00b0C.\"\nprint \"3. The heat loss through the wall is :\",Q,\" kW.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. Theoretical part.\n2. The driving force for heat transfer is : 40.0 \u00b0C.\n3. The heat loss through the wall is : 4.0 kW.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.5, Page number: 97"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The inside and outside temperatures of the walls of a room are 27\u00b0C and 68.7\u00b0C, respectively.\nThe room walls consist of 6-inch concrete (C), 8-inch cork-board (B), and 1-inch wood (W) with\ncorresponding thermal conductivities of 0.762, 0.0433, and 0.151W/m . K, respectively.\nCalculate the heat transfer rate across the wall and determine the temperature at the interface\nbetween the wood and the cork-board.\n'''\n\n#Variable declaration:\nTC = 27.0 #Inside temperature of walls (\u00b0C)\nTH = 68.7 #Outside temperature of walls (\u00b0C)\nLC = 6*0.0254 #Thickness of concrete (m)\nLB = 8*0.0254 #Thickness of cork-board (m)\nLW = 1*0.0254 #Thickness of wood (m)\nkC = 0.762 #Thermal conductivity of concrete (W/m.K)\nkB = 0.0433 #Thermal conductivity of cork-board (W/m.K)\nkW = 0.151 #Thermal conductivity of wood (W/m.K)\n\n#Calculation:\nRC = LC/kC #Thermal resistance of concrete (K/W)\nRB = LB/kB #Thermal resistance of cork-board (K/W)\nRW = LW/kW #Thermal resistance of wood (K/W)\nQ = (TC-TH)/(RC+RB+RW) #Heat transfer rate across the wall (W)\nT = -(Q*RW-TC) #Interface temperature between wood and cork-board (K)\n\n#Result:\nprint \"The heat transfer rate across the wall is :\",round(Q,3),\" W.\"\nprint \"The interface temperature between wood and cork-board is :\",round(T,1),\" \u00b0C.\"\nprint \"The interface temperature between wood and cork-board is :\",round(T+273,1),\" K.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate across the wall is : -8.239 W.\nThe interface temperature between wood and cork-board is : 28.4 \u00b0C.\nThe interface temperature between wood and cork-board is : 301.4 K.\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.6, Page number: 98"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A 3-inch outside diameter steel pipe is covered with a 1/2-inch layer of asbestos, (a), which in turn\nis covered with a 2-inch layer of glass wool, (b). Determine the steady-state heat transfer per foot\nof pipe, Z, if the pipe outer surface temperature is 500\u00b0F and the glass wool outer temperature\nis 100\u00b0F.\nAssume an asbestos\u2013glass wool interfacial temperature of 300\u00b0F and an average asbestos (a)\ntemperature of 200\u00b0F and glass wool (b) temperature of 400\u00b0F. Based on a literature review,\nasbestos and glass wool thermal conductivity values have been estimated to be:\nk(a)(200\u00b0F) = 0.120 Btu=h . ft . \u00b0F\nk(b)(400\u00b0F) = 0.0317 Btu=h . ft . \u00b0F\n'''\n\nfrom math import pi, log\nfrom sympy import symbols\n\n#Variable declaration:\nZ = symbols ('z') #Length of pipe\nD1s = 4.0 #Glass wool inside diameter (in)\nD2s = 8.0 #Glass wool outside diameter (in)\nD1a = 3.0 #Asbestos inside diameter (in)\nD2a = 4.0 #Asbestos outside diameter (in)\nTH = 500.0 #Outer surface temperature of pipe (\u00b0F)\nTC = 100.0 #Outer surface temperature of glass wool (\u00b0F)\nLa = 0.5/12.0 #Thickness of asbestos (ft)\nLb = 2.0/12.0 #Thickness of glss wool (ft)\nka = 0.120 #Thermal conductivity of asbestos (Btu/h.ft.\u00b0F)\nkb = 0.0317 #Thermal conductivity of asbestos (Btu/h.ft.\u00b0F)\n\n#Calculation:\nAa = (pi*Z*(D2a-D1a)/12.0)/log(D2a/D1a) #Area of asbestos (ft^2)\nAb = (pi*Z*(D2s-D1s)/12.0)/log(D2s/D1s) #Area of glass wool (ft^2)\nQ1 = (TH-TC)/(La/(ka*Aa)+Lb/(kb*Ab)) #Steady-state heat transfer per foot of pipe (Btu/h.)\nQ2 = Q1/Z #Factorization of Q/Z (Btu/h.ft)\n\n#Result:\nprint \"The steady-state heat transfer per foot of pipe, Z, is :\",round(Q1/Z,1),\" x z Btu/h.\"\nprint \"The steady-state heat transfer factorizating out Z is :\",round(Q2,1),\" Btu/h.ft.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The steady-state heat transfer per foot of pipe, Z, is : 103.6 x z Btu/h.\nThe steady-state heat transfer factorizating out Z is : 103.6 Btu/h.ft.\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.7, Page number: 99"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous example. Calculate the outer asbestos temperature, Ti (i.e., the interfacial\ntemperature between the asbestos and glass wool).\n'''\n\n#Variable declaration:\n#From example 7.6:\nTH = 500 #Outer surface temperature of pipe (\u00b0F)\nLb = 2.0/12.0 #Thickness of glss wool (ft)\nkb = 0.0317 #Thermal conductivity of asbestos (Btu/h.ft.\u00b0F)\nAb = 1.51 #Area of glass wool (ft^2)\nQ = 103.5 #Steady-state heat transfer per foot of pipe (Btu/h.)\nLa = 0.5/12.0 #Thickness of asbestos (ft)\nka = 0.120 #Thermal conductivity of asbestos (Btu/h.ft.\u00b0F)\nAa = 0.91 #Area of asbestos (ft^2)\nTC = 100 #Outer surface temperature of glass wool (\u00b0F)\n\n#Calculation:\nTi_b = -((Lb*Q)/(kb*Ab)-TH) #Interfacial temperature of glass wool layer (\u00b0F)\nTi_a = (Q*La)/(ka*Aa)+TC #Interfacial temperature of asbestos layer (\u00b0F)\n\n#Result:\nprint \"The interfacial temperature of glass wool layer is :\",round(Ti_b),\" \u00b0F.\"\nprint \"The interfacial temperature of asbestos layer is :\",round(Ti_a,1),\" \u00b0F.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The interfacial temperature of glass wool layer is : 140.0 \u00b0F.\nThe interfacial temperature of asbestos layer is : 139.5 \u00b0F.\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 7.8, Page number: 100"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The temperature of the solid slab pictured in Figure 7.4 is given by the expression\nT = 100cos(pz/2h)\nCalculate the heat flux at z = 0 and z = h in terms of the thermal conductivity and h. Comment\non the results.\n'''\n\nfrom sympy import cos,symbols,diff,pi\n\n#Variable declaration:\nz,h,k = symbols('z, h, k') #Length, height, thermal conductivity\nT = 100*cos((pi*z)/(2*h)) #Temperature of solid slab\n\n#Calculation:\nDT = diff(T,z) #Temperature at z\nQ = -k*(DT) #Heat flux in slab (Btu/s.ft^2)\nQ1 = Q.subs(z,0) #Heat flux in slab at z = 0 (Btu/s.ft^2)\nQ2 = Q.subs(z,h) #Heat flux in slab at z = h (Btu/s.ft^2)\n\n#Result:\nprint \"The heat flux in slab is :\",Q,\" Btu/s.ft^2 .\"\nprint \"The heat flux in slab at z = 0 is :\",Q1,\" Btu/s.ft^2 .\"\nprint \"The heat flux in slab at z = h is :5\",Q2,\" Btu/s.ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat flux in slab is : 50*pi*k*sin(pi*z/(2*h))/h Btu/s.ft^2 .\nThe heat flux in slab at z = 0 is : 0 Btu/s.ft^2 .\nThe heat flux in slab at z = h is :5 50*pi*k/h Btu/s.ft^2 .\n"
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_08.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_08.ipynb
new file mode 100644
index 00000000..cb9b01d8
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_08.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 08"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 8: Unsteady-State Heat Conduction"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 8.4, Page number: 122"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 8.3. If TS represents saturated steam at 15 psig, the initial temperature\nTA is 71\u00b0F, and the rod is 20 inches in length of stainless steel with k = 9.1 Btu/h . ft . \u00b0F,\nr = 0.29 lb/in3, and cp = 0.12 Btu/lb . \u00b0F, calculate the temperature 0.875 inches from one of\nthe ends after 30 minutes. Note: This unit was designed by the author and is located in the Unit\nOperations Laboratory of Manhattan College.\n'''\n\nfrom math import pi,sin,e\n\n#Variable declaration:\nk = 9.1 #Thermal coductivity of steel rod (Btu/h.ft.\u00b0F)\np = 0.29*1728 #Density of steel rod (lb/ft^3)\nCp = 0.12 #Heat capacity of steel rod (Btu/lb.\u00b0F)\nP = 15+14.7 #Absolute pressure (psia)\nTa = 71.0 #Initial temperature (\u00b0F)\nL = 20.0/12.0 #Length of rod (ft)\nt = 30.0/60.0 #Time taken (h)\nx = 0.875/12.0 #Length from one of end (ft)\n#From assumption:\nn = 1.0 #First term\n#From tables in Appendix:\nTs = 249.7 #Saturated steam temperature (\u00b0F)\n\n#Calculation:\na = k/(p*Cp) #Thermal diffusivity (ft^2/s)\nT = Ts+(Ta-Ts)*(((n+1)*(-1)**2 + 1 )/pi)*e**((-a*((n*pi)/L)**2)*t)*sin((n*pi*x)/L) #Temperature 0.875 inches from one of the ends after 30 minutes (\u00b0F)\n\n#Result:\nprint \"The temperature 0.875 inches from one of the ends after 30 minutes is :\",round(T),\" \u00b0F.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature 0.875 inches from one of the ends after 30 minutes is : 232.0 \u00b0F.\n"
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_09.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_09.ipynb
new file mode 100644
index 00000000..f6fe87e6
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_09.ipynb
@@ -0,0 +1,293 @@
+{
+ "metadata": {
+ "name": "Chapter 09"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 9: Forced Convection"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.1, Page number: 135"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider a closed cylindrical reactor vessel of diameter D = 1 ft, and length L = 1.5 ft. The surface\ntemperature of the vessel, T1, and the surrounding temperature, T2, are 390\u00b0F and 50\u00b0F,\nrespectively. The convective heat transfer coefficient, h, between the vessel wall and surrounding\nfluid is 4.0 Btu/h . ft . \u00b0F. Calculate the thermal resistance in \u00b0F . h/Btu.\n'''\n\n#Variable declaration:\nD = 1.0 #Diamete of vessel (ft)\nL = 1.5 #Length of vessel (ft)\nT1 = 390.0 #Surface temperature of vessel (\u00b0F)\nT2 = 50.0 #Surrounding temperature of vessel (\u00b0F)\nh = 4.0 #Convective heat transfer coefficient (Btu/h.ft.\u00b0F)\n\n#Calculation:\nA = pi*D*L+2*pi*(D/2)**2 #Total heat transfer area (ft^2)\nQ = h*A*(T1-T2) #Rate of heat transfer (Btu/h)\nR = 1/(h*A) #Thermal resistance (\u00b0F.h/Btu)\n\n#Result:\nprint \"The thermal resistance of vessel wal is :\",round(R,4),\" \u00b0F.h/Btu .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The thermal resistance of vessel wal is : 0.0398 \u00b0F.h/Btu .\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.2, Page number: 135"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Referring to the previous example, convert the resistance to K/W and \u00b0C/W.\n'''\n\n#Variable declaration:\n#From example 9.1:\nR = 0.0398 #Theral resistance (\u00b0F.h/Btu)\nBtu = 3.412 #Btu/h in a watt\nC = 1.8 #Change in degree fahrenheit for a degree change in celsius\nK = 1 #Change in degree celsius for a unit change in Kelvin\n\n#Calculation:\nRc = R*Btu/C #Thermal resistance in degree cesius per watt (\u00b0C/W)\nRk = Rc/K #Thermal resistance in Kelvin per watt (K/W)\n\n#Result:\nprint \"The thermal resistance in \u00b0C/W is :\",round(Rc,3),\" \u00b0C/W.\"\nprint \"The thermal resistance in K/W is :\",round(Rk,3),\" K/W.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The thermal resistance in \u00b0C/W is : 0.075 \u00b0C/W.\nThe thermal resistance in K/W is : 0.075 K/W.\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.3, Page number: 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Hot gas at 530\u00b0F flows over a flat plate of dimensions 2 ft by 1.5 ft. The convection heat transfer\ncoefficient between the plate and the gas is 48 Btu/ft2 . h . \u00b0F. Determine the heat transfer rate in\nBtu/h and kW from the air to one side of the plate when the plate is maintained at 105\u00b0F.\n'''\n\n#Variable declaration:\nh = 48.0 #Convective heat transfer coefficient (Btu/h.ft.\u00b0F)\nA = 2*1.5 #Total heat transfer area (ft^2)\nTs = 530.0 #Surface temperature of plate (\u00b0F)\nTm = 105.0 #Maintained temperature of opposite side of plate (\u00b0F)\nkW = 3.4123*10**3 #Units kW in a Btu/h\n\n#Calculation:\nQ = h*A*(Ts-Tm) #Heat transfer rate in Btu/h (Btu/h)\nQ1 = Q/kW #Heat transfer rate in kW (kW)\n\n#Result:\nprint \"The heat transfer rate in Btu/h is :\",round(Q),\" Btu/h.\"\nprint \"The heat transfer rate in kW is :\",round(Q1,2),\" kW.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate in Btu/h is : 61200.0 Btu/h.\nThe heat transfer rate in kW is : 17.94 kW.\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.4, Page number: 136"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The glass window shown in Figure 9.3 of area 3.0 m2 has a temperature at the outer surface of\n10\u00b0C. The glass has conductivity of 1.4W/m . K. The convection coefficient (heat transfer\ncoefficient) of the air is 100W/m2 . K. The heat transfer is 3.0 kW. Calculate the bulk temperature\nof the fluid.\n'''\n\n#Variable declaration:\nTS = 10+273 #Outer surface temperature of wall (K)\nQ = 3000.0 #Heat transfer rate (W)\nh = 100.0 #Convection coefficient of air (W/m^2)\nA = 3.0 #Area of glass window (m^2)\n\n#Calculation:\nTM = TS-Q/(h*A) #Bulk temperature of fluid (K)\n\n#Result:\nprint \"The bulk temperature of fluid is :\",round(TM),\" K.\"\nprint \"The bulk temperature of fluid is :\",round(TM-273),\" \u00b0C.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The bulk temperature of fluid is : 273.0 K.\nThe bulk temperature of fluid is : 0.0 \u00b0C.\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.5, Page number: 137"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 9.1. If the convective heat transfer coefficient, h, between the\nvessel wall and the surrounding fluid is constant at 4.0 Btu/h . ft2 . \u00b0F and the plant operates\n24 h/day, 350 days/yr, calculate the steady-state energy loss in Btu/yr.\n'''\n\n#Variable declaration:\nh = 24.0 #Plant operating hour per day (h/day)\nd = 350.0 #Plant operating day per year (day/yr)\n\n#Calculation:\nN = h*d #Operating hours per year (h/yr)\n#From example 9.1:\nQ = 8545.0 #Rate of energy loss (Btu/h)\nQy = Q*N #Steady-state energy loss yearly (Btu/yr)\n\n#Result:\nprint \"The yearly steady-state energy loss is :\",round(Qy/10**7,2),\" x 10^7 Btu/yr.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The yearly steady-state energy loss is : 7.18 x 10^7 Btu/yr.\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.7, Page number: 148"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''For a flow of air over a horizontal flat plate, the local heat transfer coefficient, hx, is given by the\nequation\nhx = 25/x**0.4, W/m^2 . K\nwhere hx is the local heat transfer coefficient at a distance x from the leading edge of the plate and\nx is the distance in meters. The critical Reynolds number, Recr, which is the Reynolds number at\nwhich the flow is no longer laminar, is 500,000.\nConsider the flow of air at T1 = 21\u00b0C (cp = 1004.8 J/kg . K, v = 1.5 x 10**(-5) m^2/s,\nk = 0.025W/m . K, Pr = 0.7), at a velocity of 3 m/s, over a flat plate. The plate has a thermal conductivity k = 33W/m . K,\nsurface temperature, TS = 58\u00b0C, width, b = 1 m, and length,L = 1.2 m. Calculate\n1. the heat flux at 0.3 m from the leading edge of the plate\n2. the local heat transfer coefficient at the end of the plate\n3. the ratio h/hx at the end of the plate\n'''\nfrom sympy import symbols, integrate\n\n#Variable declaration:\nx = 0.3 #Length from the leading age of the plate (m)\nL = 1.2 #Length of plate (m)\nTS = 58.0 #Surface temperature of plate (\u00b0C)\nTa = 21.0 #Temperature of flowing air (\u00b0C)\n\n#Calculation:\nhx = 25/x**0.4 #Local heat transfer coefficient at 0.3m (W/m^2.K) (Part 1)\ny = symbols('y') #Length\nhy = 25/y**0.4 #hx at the end of the plate (W/m^2.K)\nh = integrate(hy, (y,0,L))/L #Average heat transfer coefficient (W/m^2.K)\nQ = hx*(TS-Ta) #Heat flux at 0.3m from leading edge of plate (W/m^2)\nhL = 25/L**0.4 #Local heat transfer coefficient at plate end (W/m^2.K) (Part 2) \nr = h/hL #Ratio h/hL at the end of the plate\n\n#Result:\nprint \"1. The heat flux at 0.3 m from the leading edge of the plate is :\",round(Q),\" W/m^2.\"\nprint \"2. The local heat transfer coefficient at the end of the plate is :\",round(hL,1),\" W/m^2.K.\"\nprint \"3. The ratio h/hL at the end of plate is :\",round(r,3),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The heat flux at 0.3 m from the leading edge of the plate is : 1497.0 W/m^2.\n2. The local heat transfer coefficient at the end of the plate is : 23.2 W/m^2.K.\n3. The ratio h/hL at the end of plate is : 1.667 .\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.8, Page number: 150"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous example. Calculate the rate of heat transfer over the whole length of the\nplate.\n'''\n\n#Variable declaration:\n#From example 9.7:\nb = 1.0 #Width of plate (m)\nL = 1.2 #Length of plate (m)\nTS = 58.0 #Surface temperture of plate (\u00b0C)\nTa = 21.0 #Air flow temperature (\u00b0C)\nh = 38.7 #Average heat transfer coefficient (W/m^2.K)\n\n#Calculation:\nA = b*L #Area for heat transfer for the entire plate (m^2)\nQ = h*A*(TS-Ta) #Rate of heat transfer over the whole length of the plate (W)\n\n#Result:\nprint \"The rate of heat transfer over the whole length of the plate is :\",round(Q,-1),\" W.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of heat transfer over the whole length of the plate is : 1720.0 W.\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.9, Page number: 150"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Air with a mass rate of 0.075 kg/s flows through a tube of diameter D = 0.225 m. The air enters\nat 100\u00b0C and, after a distance of L = 5 m, cools to 70\u00b0C. Determine the heat transfer coefficient\nof the air. The properties of air at 85\u00b0C are approximately, cp = 1010 J/kg . K, k = 0.030\nW/m . K, mu = 20\u00b0 x 10**-7 N . s/m2, and Pr = 0.71.\n'''\nfrom math import pi\n#Variable declaration:\nm = 0.075 #Mass rate of air flow (kg/s)\nD = 0.225 #Diameter of tube (m)\nmu = 208*10**-7 #Dynamic viscosity of fluid (N)\nPr = 0.71 #Prandtl number\nk = 0.030 #Thermal conductivity of air (W/m.K)\n\n#Calculation:\nRe = 4*m/(pi*D*mu) #Reynolds number\n#From equation 9.26:\nNu = 0.023*(Re**0.8)*(Pr**0.3) #Nusselt number\nh = (k/D)*Nu #Heat transfer coefficient of air (W/m^2.K)\n\n#Result:\nprint \"The Heat transfer coefficient of air is :\",round(h,2),\" W/m^2.K.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Heat transfer coefficient of air is : 7.76 W/m^2.K.\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.10, Page number: 150"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the average film heat transfer coefficient (Btu/h . ft^2 . \u00b0F) on the water side of a single\npass steam condenser. The tubes are 0.902 inch inside diameter, and the cooling water enters\nat 60\u00b0F and leaves at 70\u00b0F. Employ the Dittus\u2013Boelter equation and assume the average\nwater velocity is 7 ft/s. Pertinent physical properties of water at an average temperature of\n65\u00b0F are:\np = 62.3 lb/ft^3\nmu = 2.51 lb/ft . h\nCp = 1.0 Btu/lb . \u00b0F\nk = 0.340 Btu/h . ft . \u00b0F\n'''\n\n#Variable declaration:\nD = 0.902/12.0 #Inside diameter of tube (ft)\nT_in = 60.0 #Temperature water entering the tube (\u00b0F)\nT_out = 70.0 #Temperature water leaving the tube (\u00b0F)\nV = 7.0 #Average wave velocity water (ft/s)\np = 62.3 #Density of water (lb/ft^3)\nmu = 2.51/3600.0 #Dynamic viscosity of water (lb/ft.s)\nCp = 1.0 #Viscosity of centipoise (Btu/lb.\u00b0F)\nk = 0.34 #Thermal conductivity of water (Btu/h.ft.\u00b0F)\n\n#Calculation:\nRe = D*V*p/mu #Reynolds Number\nPr = Cp*mu/k*3600 #Prandtl number\n#From equation 9.26:\nNu = 0.023*(Re**0.8)*(Pr**0.4) #Nusselt number\nh = (k/D)*Nu #Average film heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The required average film heat transfer coefficient is :\",round(h),\" Btu/h.ft^2.\u00b0F.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required average film heat transfer coefficient is : 1265.0 Btu/h.ft^2.\u00b0F.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.11, Page number: 151"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Air at 1 atm and 300\u00b0C is cooled as it flows at a velocity 5.0 m/s through a tube with a diameter\nof 2.54 cm. Calculate the heat transfer coefficient if a constant heat flux condition is maintained\nat the wall and the wall temperature is 20\u00b0C above the temperature along the entire length of\nthe tube.\n'''\n\n#Variable declaration:\nP = 1.0132 * 10**5 #Air pressure (Pa)\nT = 300.0+273.0 #Air temperature (K)\nV = 5.0 #Air flow velocity (m/s)\nD = 2.54/100.0 #Diameter of tube (m)\nR = 287.0 #Gas constant (m^2/s^2.K)\n#From Appendix:\nPr = 0.713 #Prandtl number of nitrogen\nmu = 1.784*10**(-5) #Dynamic viscosity of nitrogen (kg/m.s)\nk = 0.0262 #Thermal conductivity of nitrogen (W/m.K)\nCp = 1.041 #Heat capacity of nitrogen (kJ/kg.K)\n\n#Calculation:\np = P/(R*T) #Density of air\nRe = D*V*p/mu #Reynolds number\n#From table 9.5:\nNu = 0.023*(Re**0.8)*(Pr**0.3) #Nusselt number\nh = (k/D)*Nu #Heat transfer coefficient (W/m^2.K)\n\n#Result:\nprint \"The required Heat transfer coefficient is :\",round(h,2),\" W/m^2.K.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required Heat transfer coefficient is : 17.57 W/m^2.K.\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.12, Page number: 152"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Water flows with an average velocity of 0.355 m/s through a long copper tube (inside\ndiameter = 2.2 cm) in a heat exchanger. The water is heated by steam condensing at 150\u00b0C\non the outside of the tube. Water enters at 15\u00b0C and leaves at 60\u00b0C. Determine the heat transfer\ncoefficient, h, for the water. (Adapted from Griskey.^(5))\n'''\n\n#Variable declaration:\nT1 = 15.0 #Water entering temperature (\u00b0C)\nT2 = 60.0 #Water leaving temperature (\u00b0C)\nD = 0.022 #Inside diameter of tube (m)\nV = 0.355 #Average water flow velocity (m/s)\nTC = 150.0 #Outside wall temperature (\u00b0C)\n#From Appendix:\np = 993.0 #Density of water (kg/m^3)\nmu = 0.000683 #Dynamic viscosity of water (kg/m.s)\nCp = 4.17*10**3 #Heat capacity of water (J/kg.K)\nk = 0.63 #Thermal conductivity of water (W/m.K)\n\n#Calculation:\nTav1 = (T1+T2)/2.0 #Average bulk temperature of water (\u00b0C)\nRe = D*V*p/mu #Reynolds number\nPr = Cp*mu/k #Prandtl number\nTav2 = (Tav1+TC)/2.0 #Fluid's average wall temperature (\u00b0C)\n#From Appendix:\nmu_w = 0.000306 #Dynamic viscosity of fluid at wall (kg/m.s)\n#From Table 9.5:\nh = (k/D)*0.027*Re**0.8*Pr**0.33*(mu/mu_w)**0.14 #Heat transfer coefficient for water (W/m^2.K)\n\n#Result:\nprint \"The heat transfer coefficient for water is :\",round(h,1),\" W/m^2.K.\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer coefficient for water is : 2497.3 W/m^2.K.\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.13, Page number: 153"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 9.7. Calculate the average Biot number.\n'''\n\n#Variable declaration:\n#From example 9.7:\nh = 38.7 #Average heat transfer coefficient (W/m^2.K)\nL = 1.2 #Length of plate (m)\nk = 0.025 #Thermal conductivity of air (W/m)\n\n#Calculation:\nBi = h*L/k #Average Biot number\n\n#Result:\nprint \"The average Biot number is :\",round(Bi),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The average Biot number is : 1858.0 .\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 9.14, Page number: 154"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The surface temperature Ts of a circular conducting rod is maintained at 250\u00b0C by the passage of\nan electric current. The rod diameter is 10 mm, the length is 2.5 m, the thermal conductivity is 60\nW/m . K, the density is 7850 kg/m3, and the heat capacity is 434 J/kg . K. The rod is in a fluid\nat temperature Tf = 25\u00b0C, and the convection heat transfer coefficient is 140 W/m2 . K. The\nthermal conductivity of the fluid is 0.6W/m . K.\n1. What is the thermal diffusivity of the bare rod?\n2. What is the Nusselt number of the fluid in contact with the bare rod?\n3. What is the Biot number of the bare rod?\n4. Calculate the heat transferred from the rod to the fluid.\n'''\nfrom math import pi\n#Variable declaration:\nk = 60.0 #Thermal conductivity of rod (W/m.K)\np = 7850.0 #Density of rod (kg/m^3)\nCp = 434.0 #Heat capacity of rod (J/kg.K)\nh = 140.0 #Convection heat transfer coefficient (W/m^2.K)\nD = 0.01 #Diameter of rod (m)\nkf = 0.6 #Thermal conductivity of fluid (W/m.K)\nL = 2.5 #Length of rod (m)\nTs = 250.0 #Surface temperature of rod (\u00b0C)\nTf = 25.0 #Fluid temperature (\u00b0C)\n\n#Calculation:\n#Case 1:\na = k/(p*Cp) #Thermal diffusivity of bare rod (m^2/s)\n#Case 2:\nNu = h*D/kf #Nusselt number\n#Case 3:\nBi = h*D/k #Biot number of bare rod\n#Case 4:\nQ = h*(pi*D*L)*(Ts-Tf) #Heat transferred from rod to fluid (W)\n\n#Result:\nprint \"1. The thermal diffusivity of the bare rod is :\",round(a/10**-5,2),\" x 10^-5 m^2/s.\"\nprint \"2. The nusselt number is :\",round(Nu,2),\" .\"\nprint \"3. The Biot number is :\",round(Bi,4),\" .\"\nprint \"4. The heat transferred from the rod to the fluid is :\",round(Q),\" W.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The thermal diffusivity of the bare rod is : 1.76 x 10^-5 m^2/s.\n2. The nusselt number is : 2.33 .\n3. The Biot number is : 0.0233 .\n4. The heat transferred from the rod to the fluid is : 2474.0 W.\n"
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_10.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_10.ipynb
new file mode 100644
index 00000000..76eae3ba
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_10.ipynb
@@ -0,0 +1,251 @@
+{
+ "metadata": {
+ "name": "Chapter 10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 10: Free Convection"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.1, Page number: 163"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The Grashof and Reynolds numbers for a system involved in a heat transfer process are approximately\n100 and 50, respectively. Can free convection effects be neglected.\n'''\n\n#Variable declaration:\nGr = 100.0 #Grashof number\nRe = 50.0 #Reynolds number\n\n#Calculation:\nLT = Gr/Re**2 #Measure of influence of convection effect\n\n#Result:\nif (LT<1.0):\n print \"The free convection effects can be neglected.\"\nelif (LT>1.0):\n print \"The free convection effects can not be neglected.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The free convection effects can be neglected.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.2, Page number: 166"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The heat flux rate incident on a vertical flat plate at 110\u00b0C is 800W/m2. The plate is 2 m wide\nand 3.5 m high and is well insulated on the back side. The ambient air temperature is 30\u00b0C. All\nthe incident radiation (800W/m2) on the plate is absorbed and dissipated by free convection to\nthe ambient air at 30\u00b0C. Determine the Grashof and Rayleigh numbers.\n'''\n\n#Variable declaration:\nTs = 110.0+273.0 #Surface temperature of plate (K)\nToo = 30.0+273.0 #Ambient air temperature (K)\nL = 3.5 #Height of plate (m)\ng = 9.807 #Gravitational acceleration (m^2/s)\n\n#Calculation:\nTf = (Ts+Too)/2 #Film temperature (K)\nDT = Ts - Too #Temperature difference between surface and air (K)\n#From appendix:\nv = 2.0*10**-5 #Kinematic viscosity for air (m^2/s)\nk = 0.029 #Thermal conductivity for air (W/m.K)\nPr = 0.7 #Prandtl number\nB = 1.0/Tf #Coefficient of expansion (K^-1)\nGr = g*B*DT*L**3/v**2 #Grashof number\nRa = Gr*Pr #Rayleigh number\n\n#Result:\nprint \"The Grashof number is :\",round(Gr/10**11,2),\" x 10^11 .\"\nprint \"The Rayleigh number is :\",round(Ra/10**11,2),\" x 10^11 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Grashof number is : 2.45 x 10^11 .\nThe Rayleigh number is : 1.72 x 10^11 .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.3, Page number: 166"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 10.2. Determine the type of natural convection (flow regime).\n'''\n\n#Variable declaration:\n#From example 10.2:\nRa = 1.71*10**11 #Rayleigh number\n\n#Result:\nif (Ra>10**9):\n print \"The convection flow category is turbulent.\"\nelif(Ra<10**9):\n print \"The convection flow category is laminar.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The convection flow category is turbulent.\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.4, Page number: 167"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 10.2. Determine the average heat transfer coefficient.\n'''\n\n#Variable declaration:\n#From Table 10.1:\nc = 0.1 #Constant c\nm = 1.0/3.0 #Constant for turbulent free conection\n#From example 10.2:\nRa = 1.71*10**11 #Rayleigh number\nk = 0.029 #Thermal conductivity (W/m.K)\nL = 3.5 #Thickness of plate (m)\n\n#Calculation:\nNu = c*Ra**m #Average Nusselt number\nh = Nu*k/L #Average heat transfer coefficient (W/m^2.K)\n\n#Result:\nprint \"The average heat transfer coefficient is :\",round(h,1),\" W/m^2.K .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The average heat transfer coefficient is : 4.6 W/m^2.K .\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.6, Page number: 167"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the air heat transfer film coefficient for a horizontal 6 inch diameter pipe whose surface\ntemperature is 200\u00b0F in a room containing air at 70\u00b0F.\n'''\n\nfrom math import log,e\n\n#Variable declaration:\nTs = 200.0+460.0 #Surface temperature of pipe (\u00b0R)\nToo = 70.0+460.0 #Air temperature (\u00b0R)\nD = 0.5 #Diameter of pipe (ft)\nR = 0.73 #Universal gas constant (ft^3.atm.R^\u22121.lb.mol^\u22121)\nP = 1.0 #Atmospheric pressure (Pa)\nMW = 29.0 #Molecular weight of fluid (mol)\n#From Appendix:\nmu = 1.28*10**-5 #Absolute viscosity (lb/ft.s)\nk = 0.016/3600.0 #Thermal conductivity (Btu/s.ft.\u00b0F)\ng = 32.174 #Gravitational acceleration (ft/s^2)\n\n#Calculation:\nTav = (Ts+Too)/2 #Average temperature (\u00b0R)\nv = R*Tav/P #kinematic viscosity (ft^3/lbmol)\np = MW/v #Air density (lb/ft^3)\nB = 1.0/Tav #Coefficient of expansion (\u00b0R^-1)\nDT = Ts-Too #Temperature difference (\u00b0R)\nGr = D**3*p**2*g*B*DT/mu**2 #Grashof number\n#From equation 10.5:\nCp = 0.25 #Air heat capacity (Btu/lb.\u00b0F)\nPr = Cp*mu/k #Prandtl number\nGrPr = 10**8.24 #Rayleigh number\n#From Holman^(3):\nNu = 10**(1.5) #Nusselt number\nh = Nu*(k/D)*3600.0 #Air heat transfer film coefficient (Btu/h.ft.\u00b0F)\n\n#Result:\nprint \"The required air heat transfer film coefficient is :\",round(h,2),\" Btu/h.ft.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required air heat transfer film coefficient is : 1.01 Btu/h.ft.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.7, Page number: 168"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the free convection heat transfer coefficient for a plate 6 ft high and 8 ft wide at 120\u00b0F\nthat is exposed to nitrogen at 60\u00b0F.\n'''\n\n#Variable declaration:\nTs = 120.0+460 #Surface temperature of plate (\u00b0R)\nToo = 60.0+460 #Ambient temperature of nitrogen (\u00b0R)\nL = 6 #Height of plate (ft)\n#From Appendix:\np = 0.0713 #Air density (lb/ft^3)\nk = 0.01514 #Thermal conductivity (Btu/h.ft.\u00b0F)\nv = 16.82*10**-5 #Kinematic viscosity (ft^2/s)\nPr = 0.713 #Prandtl number\ng = 32.2 #Gravitational acceleration (ft/s^2)\n\n#Calculation:\nTf = (Ts+Too)/2 #Mean film temperature (\u00b0R)\nB = 1.0/Tf #Coefficient of expansion (\u00b0R^-1)\nGr = g*B*(Ts-Too)*L**3/v**2 #Grashof number\nRa = Gr*Pr #Rayleigh number\n#From equation 10.13(Table 10.2) and costants from Table 10.1:\nh = 0.10*(k/L)*Ra**(1.0/3.0) #Free convection heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The free convection heat transfer coefficient is :\",round(h,3),\" Btu/h.ft^2.\u00b0F .\"\nprint \"There is a calculation mistake in the book for calculating 'Gr', so, value of 'h' alters from that given.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The free convection heat transfer coefficient is : 0.675 Btu/h.ft^2.\u00b0F .\nThere is a calculation mistake in the book for calculating 'Gr', so, value of 'h' alters from that given.\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.8, Page number: 169"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the heat loss in the previous example.\n'''\n\n#Variable declaration:\n#From example:\nh = 0.675 #Free convection heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nA = 6.0*8.0 #Area of plate (ft^2)\nTs = 120.0 #Surface temperature of plate (\u00b0F)\nToo = 60.0 #Ambient temperature of nitrogen (\u00b0F)\n\n#Calculation:\nQ = h*A*(Ts-Too) #Heat loss (Btu/h)\n\n#Result:\nprint \"The heat loss is :\",round(Q,-1),\" Btu/h .\"\nprint \" The 'h' obtained in the previous example differs, therefore, 'Q' obtained here also fiffers from that given in book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat loss is : 1940.0 Btu/h .\n The 'h' obtained in the previous example differs, therefore, 'Q' obtained here also fiffers from that given in book.\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.9, Page number: 169"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the heat transfer from a 100-W light bulb at 113\u00b0C to 31\u00b0C ambient air. Approximate\nthe bulb as a 120-mm-diameter sphere.\n'''\n\n#Variable declaration:\nTs = 113.0+273.0 #Surface temperature of bulb (K)\nToo = 31.0+273.0 #Ambient air temperature (K)\nD = 0.06 #Diameter of sphere (m)\ng = 9.8 #Gravitational acceleration (m/s^2)\n\n#Calculation:\nTf = (Ts+Too)/2 #Mean temperature (K)\n#From Appendix:\nv = (22.38*10**-5)*0.0929 #Kinematic viscosity (m^2/s)\nPr = 0.70 #Prandtl number\nk = 0.01735*1.729 #Thermal conductivity (W/m.K)\nB = 1.0/(Tf) #Coefficient of expansion (K^-1)\nGr = g*B*(Ts-Too)*D**3/v**2 #Grashof number\nRa = Gr*Pr #Rayleigh number\n\n#From equation 10.13:\nh = (k/D)*0.6*Ra**(1.0/4.0) #Heat transferred from bulb (W/m^2.K)\n\n#Result:\nprint \"The heat transferred from bulb to air is :\",round(h,2),\" W/m^2.K .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transferred from bulb to air is : 9.01 W/m^2.K .\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.10, Page number: 170"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 10.9. Calculate the heat transfer lost by free convection from the\nlight bulb.\n'''\n\nfrom math import pi\n\n#Variable declaration:\n#From example 10.9:\nh = 9.01 #Heat transferred from bulb (W/m^2.K)\nD = 0.06 #Diameter of sphere (m)\nTs = 113.0+273.0 #Surface temperature of bulb (K)\nToo = 31.0+273.0 #Ambient air temperature (K)\n\n#Calculation:\nA = pi*D**2 #Surface area of bulb (m^2)\nQ = h*A*(Ts-Too) #Heat transfer lost by free convection from light bulb (W)\n\n#Result:\nprint \"The heat transfer lost by free convection from light bulb is :\",round(Q,2),\" W .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer lost by free convection from light bulb is : 8.36 W .\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.11, Page number: 170"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''With reference to Illustrative Examples 10.9\u009610.10, what percentage of the energy is lost by free\nconvection.\n'''\n\n#Variable declaration:\n#From example 10.9-10.10:\nQ = 8.36 #Heat transfer lost by free convection from light bulb (W)\n\n#Calculation:\nE = Q/100.0*(100.0) #Percent energy lost by free convection (%)\n\n#Result:\nprint \"The percentage of the energy lost by free convection is :\",round(E,2),\" % .\"\nprint \"The energy lost fraction is :\",round(E/100.0,4),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The percentage of the energy lost by free convection is : 8.36 % .\nThe energy lost fraction is : 0.0836 .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 10.13, Page number: 175"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''If a waste source emits a gas with a buoyancy flux of 50 m^4/s^3, and the wind speed averages 4\nm/s, find the plume rise at a distance of 750 m downward from a stack that is 50 m high under\nunstable atmospheric conditions. Several plume rise equations are available. Use the equation\nproposed by Briggs.\nBriggs(5) used the following equations to calculate the plume rise.\nDh = 1.6F^1/3u^-1x^2/3 ; x < xf (10.23)\n= 1.6F^1/3u^-1xf^2/3 ; if x < xf\nxc = 14F^5/8 ; when F < 55m^4/s^3\n= 34F^2/5 ; when F < 55m^4/s^3\nxf = 3.5xc\nwhere Dh = plume rise, m\nF = buoyancy flux, m^4/s^3 =3 .7 x 10^-5 Q\u02d9H\nu = wind speed, m/s\nx* = downward distance, m\nxf = distance of transition from first stage of rise to the second stage of rise, m\nQ\u02d9H = heat emission rate, kcal/s\nIf the term Q\u02d9H is not available, the term F may be estimated by\nF = (g/pi)q(TS - T)/TS (10.24)\nwhere g = gravity term 9.8 m/s^2\nq = stack gas volumetric flowrate, m^3/s (actual conditions)\nTS, T = stack gas and ambient air temperature, K, respectively\n'''\n\n#Variable declaration:\nF = 50.0 #Buoyancy flux of gas (m^4/s^3)\nu = 4.0 #wind speed (m/s)\n\n#Calculation:\nxc = 14*F**(5.0/8.0) #Downward distance (m)\nxf = 3.5*xc #distance of transition from first stage of rise to the second stage of rise (m)\nDh = 1.6*F**(1.0/3.0)*u**-1*xf**(2.0/3.0) #Plume rise (m)\n\n#Result:\nprint \"The plume rise is :\",round(Dh),\" m .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The plume rise is : 101.0 m .\n"
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_11.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_11.ipynb
new file mode 100644
index 00000000..485669cf
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_11.ipynb
@@ -0,0 +1,335 @@
+{
+ "metadata": {
+ "name": "Chapter 11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 11: Radiation"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.3, Page number: 181"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The intensity of radiation as a function of wavelength (l = mu*m) is specified as\nI = 40e^-l^2 ; Btu/h.ft^2.mu.m\nCalculate the total emissive power.\n'''\n\nfrom sympy import symbols, integrate,oo,exp,pi\n\n#Variable declaration:\nl = symbols('l') #Wavelength (mu.m)\nI = 40*exp(-l**2) #Intensity of radiation (Btu/h.ft^2.mu.m)\n\n#Calculation:\nE = integrate(I, (l,0,oo)).evalf() #Total emissive power (Btu/h.ft^2)\n\n#Result:\nprint \"The total emissive power is :\",round(E,1),\" Btu/h.ft^2 .\" ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total emissive power is : 35.4 Btu/h.ft^2 .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.4, Page number: 182"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Estimate the Sun\u2019s temperature. Employ equation (11.4).\n'''\n\n#Variable declaration:\nl = 0.25 #Wavelength (mu.m)\n#From equation 11.4:\nlT = 2884 #Product of wavelength and absolute temperature (mu.m.\u00b0R)\n\n#Calculation:\nT = lT/l #Sun's temperature (\u00b0R)\n\n#Result:\nprint \"The Sun's temperature is :\",round(T,-2),\" \u00b0R .\"\nprint \"The Sun's temperature in fahrenheit scale is :\",round(T-460,-3),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Sun's temperature is : 11500.0 \u00b0R .\nThe Sun's temperature in fahrenheit scale is : 11000.0 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.5, Page number: 188"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Estimate the increase in heat transferred by radiation of a black body at 1500\u00b0F relative to one at\n1000\u00b0F.\n'''\n\n#Variable declaration:\nT1 = 1500.0+460.0 #Absolute temperature 1 (\u00b0R)\nT2 = 1000.0+460.0 #Absolute temperature 2 (\u00b0R)\n\n#Calculation:\nX = T1**4/T2**4 #Ratio of quantity of heat transferred\nx = 100*(T1**4-T2**4)/T2**4 #Percentage increase in heat transfer (%)\n\n#Result:\nprint \"The ratio of the quantity/rate of heat transferred is :\",round(X,2),\" .\"\nprint \"The percentage increase in heat transfer is :\",round(x),\"%\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The ratio of the quantity/rate of heat transferred is : 3.25 .\nThe percentage increase in heat transfer is : 225.0 %\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.6, Page number: 189"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two large walls are required to be maintained at constant temperatures of 800\u00b0F and 1200\u00b0F.\nAssuming the walls are black bodies, how much heat must be removed from the colder wall\nto maintain a steady-state, constant temperature?\n'''\n\n#Variable declaration:\nT1 = 1200.0+460.0 #Absolute temperature of wall 1 (\u00b0R)\nT2 = 800.0+460.0 #Absolute temperature of wall 2 (\u00b0R)\n\n#Calculation:\n#From equation 11.23:\nX = 0.173*((T1/100.0)**4-(T2/100.0)**4) #Heat removed from colder wall (Btu/h.ft^2)\n\n#Result:\nprint \"The heat removed from the colder wall to maintain a steady-state is :\",round(X),\" Btu/h.ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat removed from the colder wall to maintain a steady-state is : 8776.0 Btu/h.ft^2 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.7, Page number: 190"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''If the two bodies from Illustrative Example 11.6 have emissivities of 0.5 and 0.75, respectively,\nwhat is the net energy exchange (per unit area)? Assume that the temperatures remain constant at\n1660\u00b0R and 1260\u00b0R, and the two bodies are of infinite size.\n'''\n\n#Variable declaration:\ns = 0.173 #Stefan-Boltzmann constant (Btu/h.ft^2.\u00b0R)\nEH = 0.5 #Energy transferred from hotter body (Btu/h.ft^2)\nEC = 0.75 #Energy transferred to colder body (Btu/h.ft^2)\nTH = 1660.0 #Absolute temperature of hotter body (\u00b0R)\nTC = 1260.0 #Absolute temperature of colder body (\u00b0R)\n\n#Calculation:\nE = s*((TH/100.0)**4-(TC/100.0)**4)/((1.0/EH)+(1.0/EC)-1.0) #Net energy exchange per unit area (Btu/h.ft^2)\n\n#Result:\nprint \"The net energy exchange per unit area is :\",round(E,-1),\" Btu/h.ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The net energy exchange per unit area is : 3760.0 Btu/h.ft^2 .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.8, Page number: 191"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Compare and discuss the results of the last two illustrative examples.\n'''\n\n#Variable declaration:\n#From example 11.6-11.7:\nE1 = 8776.0 #Energy exchange between black bodies (Btu/h.ft^2)\nE2 = 3760.0 #Energy exchange between non-black bodies (Btu/h.ft^2)\n\n#Calculation:\nD = (E1-E2)/E1*100 #Percent difference in energy (%)\n\n#Result:\nprint \"The percent difference relative to the black body is:\",round(D,1),\" % .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The percent difference relative to the black body is: 57.2 % .\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.9, Page number: 192"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the radiation from a 2-inch IPS cast iron pipe (assume polished) carrying steam at\n300\u00b0F and passing through the center of a 1 ft x 1 ft galvanized zinc duct at 75\u00b0F and whose\noutside is insulated.\n'''\n\n#Variable declaration:\ns = 0.173*10**-8 #Stefan-Boltzmann constant (Btu/h.ft^2.\u00b0R)\nTH = 300.0+460.0 #Absolute temperature of external surface (\u00b0R)\nTC = 75.0+460.0 #Absolute temperature of duct (\u00b0R)\n#From Table 6.2:\nAH = 0.622 #External surface area of pipe (ft^2)\n#From Table 11.2:\nEH = 0.44 #Emissivity of oxidized steel\nAC = 4.0*1.0*1.0 #External surface area of duct (ft^2)\nEC = 0.23 #Emissivity of galvanized zinc\n\n#Calculation:\nFE = 1.0/(1.0/EH+((AH/AC)*(1.0/EC-1.0))) #Emissivity correction factor\nQ = FE*AH*s*(TH**4-TC**4) #Net radiation heat transfer (Btu/h.ft)\n\n#Result:\nprint \"The net radiation heat transfer is :\",round(Q,2),\" Btu/h.ft^2 .\"\nprint \"There is a calculation error in book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The net radiation heat transfer is : 96.96 Btu/h.ft^2 .\nThere is a calculation error in book.\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.10, Page number: 193"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The outside temperature of a 10 ft2 hot insulated pipe is 140\u00b0F and the surrounding atmosphere\nis 60\u00b0F. The heat loss by free convection and radiation is 13,020 Btu/h, and the combined coefficient\nof heat transfer is estimated to be 2.10 Btu/h.ft^2.\u00b0F . How much of the heat loss is due to\nradiation? Assume the pipe emissivity is approximately 0.9.\n'''\n\n#Variable declaration:\nTH = 140.0+460.0 #Absolute outside temperature of pipe (ft^2)\nTC = 60.0+460.0 #Absolute temperature of surrounding atmosphere (ft^2)\nA = 10.0 #Area of pipe (ft^2)\nE = 0.9 #Emissivity of pipe\n\n#Calculation:\nQ = E*A*0.173*((TH/100.0)**4-(TC/100.0)**4) #Heat loss due to radiation (Btu/h)\n\n#Result:\nprint \"The heat loss due to radiation is :\",round(Q,-1),\" Btu/h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat loss due to radiation is : 880.0 Btu/h .\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.11, Page number: 193"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''With reference to Illustrative Example 11.10, calculate the radiation heat transfer coefficient, hr.\n'''\n\n#Variable declaration:\n#Froma example 11.10:\nQ = 880.0 #Heat loss due to radiation (Btu/h)\nA = 10.0 #Area of pipe (ft^2)\nTH = 140.0 #Absolute outside temperature of pipe (\u00b0F)\nTC = 60.0 #Absolute temperature of surrounding atmosphere (\u00b0F)\n\n#Calculation:\nhr = Q/(A*(TH-TC)) #Radiation heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The radiation heat transfer coefficient is :\",round(hr,1),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The radiation heat transfer coefficient is : 1.1 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.12, Page number: 194"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A small oxidized horizontal metal tube is placed in a very large furnace enclosure with firebrick\nwalls. The metal tube has an outside diameter of 1 inch, a length of 2 ft, a surface emissivity of\n0.6, and its surface is maintained at 600\u00b0F. The hot air in the furnace is at 1500\u00b0F and the furnace\nbrick walls are at 1350\u00b0F. The convection heat transfer coefficient for the horizontal tube is 2.8\nBtu/h.ft2.\u00b0F . Calculate\n1. The convective, radiative, and total heat transferred to the metal tube;\n2. The percent of total heat transferred by radiation;\n3. The radiation heat transfer coefficient;\n4. Is it appropriate to use the approximate equation presented in Equation (11.30) for (3)?\n'''\n\nfrom math import pi\n\n#Variable declaration:\nD = 0.0833 #Diameter of tube (ft)\nL = 2.0 #Length of tube (ft)\nh = 2.8 #Heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nTa1 = 1500.0+460.0 #Temperature of hot air in furnace (\u00b0R)\nTa2 = 1350.0+460.0 #Temperature of hot air in the furnace brick walls (\u00b0R)\nTt = 600.0+460.0 #Surface temperature of tube (\u00b0R)\nE = 0.6 #Surface emissivity of tube\ns = 0.1713*10**-8 #Stefan-Boltzmann constant\n\n\n#Calculation:\n#Case 1:\nA = pi*D*L #Area of tube (ft^2)\nQc = round(h*A*(Ta1-Tt),-1) #Convection heat transfer from air to tube (Btu/h)\nQr = round(E*s*A*(Ta2**4-Tt**4),-2) #Radiation feat transfer from wall to tube (Btu/h)\nQ = Qr+Qc #Total heat transfer (Btu/h)\n#Case 2:\nQp = Qr/Q*100 #Radiation percent \n#Case 3:\nhr = Qr/(A*(Ta2-Tt)) #Radiation heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n#Case 4:\nT = Ta2-Tt #Temperature difference (\u00b0F)\n\n#Result:\nprint \"1. The convective heat transferred to the metal tube is :\",Qc,\" Btu/h .\"\nprint \" The radiative heat transferred to the metal tube is :\",Qr,\" Btu/h .\"\nprint \" The total heat transferred to the metal tube is :\",Q,\" Btu/h .\"\nprint \"2. The percent of total heat transferred by radiation is :\",round(Qp,1),\" % .\"\nprint \"3. The radiation heat transfer coefficient is :\",round(hr,1),\" Btu/h.ft^2.\u00b0F .\"\nif (T > 200):\n print \"4. The use of the approximation Equation (11.30), hr = 4EsTav^3, is not appropriate.\"\nelif (T < 200):\n print \"4. The use of the approximation Equation (11.30), hr = 4EsTav^3, is appropriate.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The convective heat transferred to the metal tube is : 1320.0 Btu/h .\n The radiative heat transferred to the metal tube is : 5100.0 Btu/h .\n The total heat transferred to the metal tube is : 6420.0 Btu/h .\n2. The percent of total heat transferred by radiation is : 79.4 % .\n3. The radiation heat transfer coefficient is : 13.0 Btu/h.ft^2.\u00b0F .\n4. The use of the approximation Equation (11.30), hr = 4EsTav^3, is not appropriate.\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.13, Page number: 194"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The filament of a light bulb is at a temperature of 900\u00b0C and emits 5W of heat toward the glass\nbulb. The interior of a light bulb can be considered a vacuum and the temperature of the glass\nbulb is 150\u00b0C. Ignoring heat transfer to the room and assuming the emissivity of the filament is\n1.0, calculate the surface area of the filament in cm^2.\n'''\n\n#Variable declaration:\nQ = 5.0 #Radiation heat transfer (W)\nE = 1.0 #Emissivity of filament\ns = 5.669*10**-8 #Stefan-Boltzmann constant\nT1 = 900.0+273.0 #Light bulb temperature (K)\nT2 = 150.0+273.0 #Glass bulb temperature (K)\n\n#Calculation:\nA = Q/(E*s*(T1**4-T2**4)) #Surface area of the filament (m^2)\n\n#Result:\nprint \"The surface area of the filament is :\",round(A*10**4,2), \"cm^2\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The surface area of the filament is : 0.47 cm^2\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.14, Page number: 195"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A system consists of an uninsulated steam pipe made of anodized aluminum with a diameter\nD = 0.06 m and a length L = 100 m. The surface temperature is T1 = 127\u00b0C and the surface\nemissivity of anodized aluminum is 1 = 0.76. The pipe is in a large room with a wall temperature\nT2 = 20\u00b0C. The air in the room is at a temperature T3 = 22\u00b0C. The pipe convective heat\ntransfer coefficient is h = 15 W/m^2 . K.\nEstimate the emissive power, the total heat transfer by convection and radiation, and the radiation\nheat transfer coefficient. Assume steady-state operation, constant properties, and a room\nsurface area much larger than the pipe surface area.\n'''\n\nfrom math import pi\n\n#Variable declaration:\nT1 = 127.0+273.0 #Surface temperature (K)\nT2 = 20.0+273.0 #Wall temperature (K)\nT3 = 22.0+273.0 #Air temperature (K)\ns = 5.669*10**-8 #Stefan-Boltzmann constant\ne = 0.76 #Surface emissivity of anodized aluminium\nD = 0.06 #Diameter of pipe (m)\nL = 100.0 #Length of pipe (m)\nh = 15.0 #Pipe convective heat transfer coefficient (W/m^2.K)\n\n#Calculation:\nEb = s*T1**4 #Emissive energy of pipe (W/m^2)\nE = e*Eb #Emissive power from surface of pipe (W/m^2)\nA = pi*D*L #Surface area of pipe (m^2)\nQc = h*A*(T1-T3) #Convection heat transfer to air (W)\nQr = e*s*A*(T1**4-T2**4) #Radiation heat transfer rate (W)\nQ = Qc+Qr #Total heat transfer rate (Btu/h)\nTav = (T1+T2)/2.0 #Average temperature (K)\nhr = 4*e*s*Tav**3 #Radiation heat transfer coefficient (W/m^2.K)\n\n#Result:\nprint \"The emissive power from surface of pipe is :\",round(E),\" W/m^2 .\"\nprint \"The convection heat transfer to air is :\",round(Qc/10**3,1),\" kW .\"\nprint \"The radiation heat transfer rate is :\",round(Qr/10**3,1),\" kW \"\nprint \"The radiation heat transfer coefficient is :\",round(hr,1),\" W/m^2.K .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The emissive power from surface of pipe is : 1103.0 W/m^2 .\nThe convection heat transfer to air is : 29.7 kW .\nThe radiation heat transfer rate is : 14.8 kW \nThe radiation heat transfer coefficient is : 7.2 W/m^2.K .\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.15, Page number: 196"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 11.14. How much does radiation contribute to the total heat\ntransfer?\n'''\n\n#Variable declaration:\n#From example 11.14:\nQc = 15.0 #Convection heat transfer coefficient (W/m^2.K)\nhr = 7.2 #Radiation heat transfer coefficient (W/m^2.K)\n\n#Calculation:\nX = hr/(Qc+hr)*100.0 #Percent heat transfer by radiation (%)\n\n#Result:\nprint \"The percent heat transfer by radiation is :\",round(X,1),\" % .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The percent heat transfer by radiation is : 32.4 % .\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.16, Page number: 200"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 11.9. Calculate the heat transfer rate if Fv = 1.0.\n'''\n\n#Variable declaration:\nFV = 1.0 #Correction factor\n#From example 11.9:\nFE = 0.358 #Emissivity correction factor\nTH = 300.0+460.0 #Absolute temperature of external surface (\u00b0R)\nTC = 75.0+460.0 #Absolute temperature of duct (\u00b0R)\nAH = 0.622 #Area of pipe (ft^2)\ns = 0.173*10**-8 #Stefan-Boltzmann constant\n\n#Calculation:\nQ = FV*FE*AH*s*(TH**4-TC**4) #Heat transfer rate (Btu/h.ft)\n\n#Result:\nprint \"The heat transfer rate is :\",round(Q,2),\" Btu/h.ft\"\nprint \"Since, 'Q' obtained in (11.9) is 96.96 Btu/h.ft, the solution does not match with book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate is : 96.96 Btu/h.ft\nSince, 'Q' obtained in (11.9) is 96.96 Btu/h.ft, the solution does not match with book.\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 11.17, Page number: 200"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two parallel rectangular black plates 0.5 m by 2.0 m are spaced 1.0 m apart. One plate is maintained\nat 1000\u00b0C and the other at 2000\u00b0C. What is the net radiant heat exchange between the two\nplates?\n'''\n\n#Variable declaration:\n#From figure 11.2:\nL = 1.0 #Space between plates (m)\nX = 0.5 #Length of plate (m)\nY = 2.0 #Width of plate (m)\ns = 5.669*10**-8 #Stefan-Boltzmann constant\nTH = 2000.0+273.0 #Temperature of hotter plate (K)\nTC = 1000.0+273.0 #Temperature of colder plate (K)\nBtu = 0.2934*10**-3 #Btu/h in a KW\n\n#Calculation:\nA = X*Y #Area of plate (m^2)\nZ1 = Y/L #Ratio of width with space\nZ2 = X/L #Ratio of length with space\n#From figure 11.2:\nFV = 0.18 #Correction factor\nFE = 1.0 #Emissivity correction factor\nQ1 = FV*FE*s*A*(TH**4-TC**4) #Net radiant heat exchange between plates (kW)\nQ2 = Q1/Btu #Net radiant heat exchange between plates in Btu/h (Btu/h)\n\n#Result:\nprint \"The net radiant heat exchange between plates is :\",round(Q1,-2),\" kW .\"\nprint \"The net radiant heat exchange between plates in Btu/h is :\",round(Q2/10**8,2),\" x 10^8 Btu/h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The net radiant heat exchange between plates is : 245600.0 kW .\nThe net radiant heat exchange between plates in Btu/h is : 8.37 x 10^8 Btu/h .\n"
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_12.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_12.ipynb
new file mode 100644
index 00000000..fab7925c
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_12.ipynb
@@ -0,0 +1,230 @@
+{
+ "metadata": {
+ "name": "Chapter 12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 12: Condensation and Boiling"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.2, Page number: 206"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the number of degrees of freedom for a one-component, one-phase system.\n'''\n\n#Variable declaration:\nC = 1 #Number of constituents\nP = 1 #Number of phases\n\n#Calculation:\nF = C-P+2 #Number of degrees of freedom\n\n#Result:\nprint \"The number of degrees of freedom is :\",F,\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The number of degrees of freedom is : 2 .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.4, Page number: 209"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous illustrative example. How much heat is removed from the system during\nthis process?\n'''\n\n#Variable declaration:\n#From steam tables:\nU1 = 1237.1 #Internnal energy of gas (Btu/lb)\nU2_g = 1112.2 #Internal energy of gas (Btu/lb)\nU2_l = 343.15 #Internal energy of liquid (Btu/lb)\n\n#Calculation:\nQ = 0.5*(U2_g+U2_l)-1*U1 #Heat removed (Btu/lb)\n\n#Result:\nprint \"Heat removed from the system during the process is :\",round(Q,1),\" Btu/lb .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Heat removed from the system during the process is : -509.4 Btu/lb .\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.5, Page number: 212"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A vertical rectangular plate is 0.2 m wide and 0.4 m high. One surface of the plate is exposed to\nsaturated steam at atmospheric pressure. The plate surface is maintained at 98\u00b0C. Filmwise condensation\nmay be assumed. Calculate the type of condensation (flow type) and the condensation\nheat transfer coefficient. Assume steady-state, constant properties, an isotropic homogeneous\nsurface, and that the properties of the water condensate may be evaluated at a film temperature\nof 99\u00b0C. The thermal conductivity of water may be assumed equal to 0.68W/m . K.\n'''\nfrom __future__ import division\nfrom sympy import symbols,solve\n\n#Variable declaration:\nT1 = 99.0 #Mean film temperature (\u00b0C)\nT2 = 98.0 #Plate surface temperature (\u00b0C)\ng = 9.807 #Gravitational acceleration (m/s^2)\n#From Appendix:\nT3 = 100.0 #Saturation temperatre (\u00b0C)\nh_vap1 = 970.3 #Latent heat of steam in Btu/lb (Btu/lb)\nh_vap2 = 2.255*10**6 #Latent heat of steam in J/kg (J/kg)\np_v = 0.577 #Density of steam (kg/m^3)\np_l = 960.0 #Density of liquid water condensate (kg/m^3)\nmu_l = 2.82*10**-4 #Absolute viscosity of liquid water condensate (kg/m.s)\nk = 0.68 #Thermal conductivity of water (W/m.K)\n#From table 12.2\nZ = 0.4 #Height of rectangular plate (m)\nPw = 0.2 #Wetted perimeter of rectangular plate (m)\nh = symbols('h') #Average heat transfer coefficient (W/m^2.K)\n\n#Calculation:\nA = Z*Pw #Heat transfer area of plate (m^2)\nR = A/Pw #Ratio A/Pw (m)\nv_l = mu_l/p_l #Kinematic viscosity of liquid water condensate (m^2/s)\nCo1 = (h/k)*(v_l**2/g/(1-p_v/p_l))**(1/3) #Condensation number (in terms of the average heat transfer coefficient)\nRe = 4*h*Z*(T3-T2)/(mu_l*h_vap2) #Reynolds number in terms of the average heat transfer coefficient\n#From equation 12.14:\nCO1 = 0.0077*Re**Z #Co in terms of Reynolds number for flow type 1\nx1 = solve(Co1-CO1,h) #Solving heat transfer coefficient (W/m^2.K)\nh1 =x1[1]; #Average heat transfer coefficient for flow type 1 (W/m^2.K)\nRe1 = Re.subs(h,h1); #Reynolds number for flow type 1\nCO2 = 1.874*Re**(-1/3) #Co in terms of Reynolds number for flow tupe 2\nx2 = solve(Co1-CO2,h) #Solving average heat transfer coefficient for flow type 2 (W/m^2.K)\nh2 = x2[0]; #Average heat transfer coefficient for flow type 2 (W/m^2.K)\nRe2 = Re.subs(h,h2) #Reynolds number for flow type 2\n\n#Result:\nprint \"The type of condensation flow type 2 is laminar.\"\nprint \"And the condensation heat transfer coefficient is :\",round(h2,-1),\" W/m^2.K .\"\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The type of condensation flow type 2 is laminar.\nAnd the condensation heat transfer coefficient is : 14700.0 W/m^2.K .\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.6, Page number: 214"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 12.5. Calculate\n1. the mass flow rate of condensate, m\u02d91\n2. the heat transfer rate Q\u02d9 .\n'''\n\n#Variable declaration:\n#From example 12.5:\nRe = 73.9 #Reynolds number\nmu_l = 2.82*10**-4 #Absolute viscosity of liquid water condensate (kg/m.s)\nPw = 0.2 #Wetted perimeter of rectangular plate (m)\nh = 14700.0 #Heat transfer coefficient (W/m^2.K)\nT_sat = 100.0 #Saturation temperature (\u00b0C)\nTs = 98.0 #Surface temperature (\u00b0C)\nA = 0.2*0.4 #Heat transfer area of plate (m^2) \n\n#Calculation:\nm1 = Re*mu_l/4.0 #Mass flow rate of condensate (kg/m.s)\nm = Pw*m1 #Mass flow rate of condensate (kg/s)\nCo = (3.038*10**-5)*h #Condensation number\nQ = h*A*(T_sat-Ts) #Heat transfer rate (W)\n\n#Result:\nprint \"1. The mass flow rate of condensate is :\",round(m1,4),\" kg/m.s . \"\nprint \"2. The heat transfer rate is :\",round(Q/10**3,2),\" kW . \"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The mass flow rate of condensate is : 0.0052 kg/m.s . \n2. The heat transfer rate is : 2.35 kW . \n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.7, Page number: 215"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A horizontal 4-inch OD tube is surrounded by saturated steam at 2.0 psia. The tube is maintained\nat 64\u00b0F. What is the average heat-transfer coefficient? Assume laminar flow.\n'''\n\n#Variable declaration:\nT_sat = 126.0 #Saturation temperature (\u00b0F)\nT = 64.0 #Surface temperature of tube (\u00b0F)\ng = 32.2 #Gravitational acceleration (ft^2/s)\nD = 4.0/12.0 #Outside diameter of tube (ft)\n\n#Calculation:\nTf = (T_sat+T)/2.0 #Mean film temperature (\u00b0F)\n#From approximate values of key properties:\nh_vap = 1022.0 #Latent heat of steam (Btu/lb)\np_v = 0.00576 #Density of steam (lb/ft^3)\np_l = 62.03 #Density of liquid (lb/ft^3)\nk_l = 0.364 #Thermal conductivity of liquid (Btu/h.ft.\u00b0F)\nmu_l = 4.26*10**-4 #Absolute viscosity of liquid water condensate (lb/ft.s)\nh = 0.725*((p_l*(p_l-p_v)*g*h_vap*k_l**3)/(mu_l*D*(T_sat-T)/3600.0))**(1.0/4.0) #Average heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The average heat transfer coefficient is :\",round(h,1),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The average heat transfer coefficient is : 911.4 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.9, Page number: 222"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Boiling water at 100\u00b0C and 1 atm is supplied with heat from a surface at 102\u00b0C. The heat flux is\n9\u00b000W/m2. If the surface temperature is raised to 103\u00b0C, determine the new heat flux.\nAt 1 atm, the saturation temperature of the water is 100\u00b0C. The liquid water properties (SI\nunits) are: density = 957.9 kg/m3, heat capacity = 4217 J/kg . K, latent heat of vaporization =\n2.26 \u0005 106 J/kg. Assume steady-state operation, constant properties, and laminar conditions.\n'''\n\n#Variable declaration:\nQs1 = 9800.0 #Heat flux (W/m^2)\nTs1 = 102.0 #Original surface temperature (\u00b0C)\nTs2 = 103.0 #New surface temperature (\u00b0C)\nTsat = 100.0 #Saturation temperature (\u00b0C)\n\n#Calculation:\nh1 = Qs1/(Ts1-Tsat) #Original heat transfer coefficient (W/m^2.K)\nDT1 = (Ts1 - Tsat) #Original excess temperature (\u00b0C)\nDT2 = (Ts2 - Tsat) #New excess temperature (\u00b0C)\nn = 0.25 #Value of n for laminar flow\nh2 = h1*(DT2/DT1)**(n) #New heat transfer coefficient (W/m^2.K)\nQs2 = h2*(Ts2-Tsat) #New heat flux (W/m^2)\n\n#Result:\nprint \"The new heat flux is :\",round(Qs2),\" W/m^2.K . \"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The new heat flux is : 16268.0 W/m^2.K . \n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.10, Page number: 223"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''With respect to Illustrative Example 12.9, determine the mechanism of boiling heat transfer.\nIs the earlier assumed boiling mechanism still valid?\n'''\n\n#Variable declaration:\n#From example 12.9:\nTs1 = 102.0 #Original surface temperature (\u00b0C)\nTs2 = 103.0 #New surface temperature (\u00b0C)\nTsat = 100.0 #Saturation temperature (\u00b0C)\n\n#Calculation:\nDTe1 = (Ts1 - Tsat) #Original excess temperature (\u00b0C)\nDTe2 = (Ts2 - Tsat) #New excess temperature (\u00b0C)\n\n#Result:\nprint \"The original excess temperature is: DTe = \",DTe1,\" \u00b0C .\"\nprint \"The new excess temperature is: DTe = \",DTe2,\" \u00b0C .\"\nif ((DTe1 < 5) and (DTe2 < 5)):\n print \"The assumption of the free convection mechanism is valid since DTe < 5\u00b0C.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The original excess temperature is: DTe = 2.0 \u00b0C .\nThe new excess temperature is: DTe = 3.0 \u00b0C .\nThe assumption of the free convection mechanism is valid since DTe < 5\u00b0C.\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.11, Page number: 223"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 12.9 and calculate the liquid Jakob number.\n'''\n\n#Variable declaration:\n#From example 12.9:\nCp = 4127.0 #heat capacity (J/kg . K)\nDTe = 3.0 #New excess temperature (\u00b0C)\nh_vap = 2.26*10**6 #latent heat of vaporization (J/kg)\n\n#Calculation:\nJa_L = Cp*DTe/h_vap #Liquid Jakob number\n\n#Result:\nprint \"The liquid Jakob number is :\",round(Ja_L,5),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The liquid Jakob number is : 0.00548 .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.12, Page number: 223"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An electric heater 0.3 m in diameter at 106\u00b0C is used to heat water. The water is at 1 atm and\n100\u00b0C. Determine\n1. the boiling regime, and\n2. The heat transfer coefficient.\nAssume steady-state operation and constant properties.\n'''\n\n#Variable declaration:\nTs = 106.0 #Surface temperature (\u00b0C)\nTsat = 100.0 #Saturation temperature (\u00b0C)\n\n#Calculation:\nDTe = Ts-Tsat #Excess temperature (\u00b0C)\n#From table 12.5:\nC1 = 5.56 #Constant C1\nn1 = 3.0 #Constant n1\nC2 = 1040.0 #Constant C2\nn2 = 1.0/3.0 #Constant n2\nP = 1.0 #Absolute pressure (atm)\nPa = 1.0 #Ambient absolute pressure (atm)\n\n#Calculation:\nh1 = C1*DTe**n1*(P/Pa)**0.4 #Boiling water heat transfer coefficient (W/m^2)\nQs1 = h1*DTe #Surface flux (W/m^2)\nh2 = C2*DTe**n2*(P/Pa)**0.4 #Second Boiling water heat transfer coefficient (W/m^2)\nQs2 = h2*DTe #Second Surface flux (W/m^2) \n\n#Result:\n \nif (Qs1/10**3 > 15.8 and Qs1/10**3 < 236):\n print \"The boiling regime is :\",round(Qs1/10**3,1),\" kW/m^2 .\"\n print \"The heat transfer coefficient is :\",round(h1), \" W/m^2 .\"\nelif (Qs1/10**3 < 15.8):\n print \"The boiling regime is :\",round(Qs2/10**3,2),\" kW/m^2 .\"\n print \"The heat transfer coefficient is :\",round(h2), \" W/m^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The boiling regime is : 11.34 kW/m^2 .\nThe heat transfer coefficient is : 1890.0 W/m^2 .\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 12.13, Page number: 224"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous example. Calculate the rate of heat transfer.\n'''\n\nfrom math import pi\n\n#Variable declaration:\n#From example 12.12:\nQs1 = 11340.0 #Surface flux (W/m^2)\nD = 0.3 #Diameter of electric heater (m)\n\n#Calculation:\nA = pi*(D/2.0)**2 #Surface area of heater (m^2)\nQs = Qs1*A #Heat transfer rate (W)\n\n#Result:\nprint \"The rate of heat transfer is :\",round(Qs),\" W .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of heat transfer is : 802.0 W .\n"
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_13.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_13.ipynb
new file mode 100644
index 00000000..3f81a28b
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_13.ipynb
@@ -0,0 +1,230 @@
+{
+ "metadata": {
+ "name": "Chapter 13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 13: Refrigeration and Cryogenics"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.1, Page number: 237"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The vertical flat walls of the combustion chamber of a furnace consist of 7.5 in of refractory,\nkR = 0.75; 3 in of insulation, kI = 0.08; and 0.25 in of steel, kS = 26.0. The units of k are\nBtu/h.ft.\u00b0F. The average surface temperature of the inner face of the refractory and the outer\nface of the steel are 2000\u00b0F and 220\u00b0F, respectively.\nCalculate the heat loss expressed as Btu/h.ft^2.\n'''\n\n#Variable declaration:\nLR = 7.5/12.0 #Thickness of refractory (ft)\nLI = 3.0/12.0 #Thickness of insulation (ft)\nLS = 0.25/12.0 #Thickness of steel (ft)\nkR = 0.75 #Thermal conductivity of refractory\nkI = 0.08 #Thermal conductivity of insulation\nkS = 26.0 #Thermal conductivity of steel\nTR = 2000.0 #Average surface temperature of the inner face of the refractory (\u00b0F)\nTS = 220.0 #Average surface temperature of the outer face of the steel (\u00b0F)\n\n#Calculation:\nDT = TR-TS #Temperature difference (\u00b0F)\nQ = DT/(LR/kR+LI/kI+LS/kS) #Heat loss (Btu/h.ft^2)(here representing Qdot/A)\n\n#Result:\nprint \"The heat loss is :\",round(Q),\" Btu/h.ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat loss is : 450.0 Btu/h.ft^2 .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.2, Page number: 239"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''For the combustion chamber of the furnace in the previous example, calculate the temperature of\nthe boundary where the refractory meets the insulation, TI.\n'''\n\n#Variable declaration:\nLR = 7.5/12.0 #Thickness of refractory (ft)\nkR = 0.75 #Thermal conductivity of refractory\nTR = 2000.0 #Average surface temperature of the inner face of the refractory (\u00b0F)\nQ = 450.0 #Heat loss (Btu/h.ft^2)\n\n#Calculation:\nTI = TR - Q*(LR/kR) #Temperature of the boundary where the refractory meets the insulation (\u00b0F)\n\n#Result:\nprint \"The temperature of the boundary where the refractory meets the insulation is :\",round(TI),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature of the boundary where the refractory meets the insulation is : 1625.0 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.3, Page number: 239"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using the scenario described in Illustrative Examples 13.1 and 13.2, calculate the area available\nfor heat transfer if the total heat loss is 70,000 Btu/h.\n'''\n\n#Variable declaration:\nQbyA = 70000.0 #Total heat loss (Btu/h)\nQ = 450.0 #Heat loss (Btu/h.ft^2)\n\n#Calculation:\nA = QbyA/Q #Area available for heat transfer (ft^2)\n\n#Result:\nprint \"The area available for heat transfer is :\",round(A,1),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The area available for heat transfer is : 155.6 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.9, Page number: 245"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A refrigerator\u2019s evaporator is at 0.2 MPa and has a working fluid that enters the unit as liquid\nwith an enthalpy, hin, of 230 kJ/kg. If the refrigerator\u2019s working fluid (see Table 13.3) exits\nthe evaporator as dry and saturated vapor, calculate the heat absorbed by the evaporator, QC.\nTable 13.3 Fluid Data for Illustrative Example 13.9\nP, MPa Tsat, \u00b0C hf, kJ/kg hg, kJ/kg, h at 20\u00b0C superheated, kJ/kg\n0.2 210 190 390 410\n0.6 20 230 410 430\n'''\n\n#Variable declaration:\nh_out = 390.0 #Enthalpy of the fluid that exits from the evaporator (kJ/kg)\nh_in = 230.0 #Enthalpy of the fluid that enters the unit (kJ/kg)\n\n#Calculation:\nQC = h_out - h_in #Heat absorbed by the evaporator (kJ/kg)\n\n#Result:\nprint \"The heat absorbed by the evaporator is :\",round(QC),\" kJ/kg .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat absorbed by the evaporator is : 160.0 kJ/kg .\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.10, Page number: 246"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''As a follow-up to Illustrative Example 13.9, what is the fluid\u2019s change in entropy across the\nevaporator?\n'''\n\n#Variable declaration:\n#From example 13.9:\nTS = -10.0+273.0 #Fluid\u2019s saturation temperature expressed in Kelvin (K)\nQC = 160.0 #Heat absorbed by the evaporator (kJ/kg)\n\n#Calcuation:\nDS = QC/TS #Fluid\u2019s change in entropy(kJ/kg.K)\n\n#Result:\nprint \"The fluid's change in entropy across the evaporator is :\",round(DS,2),\" kJ/kg.K .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fluid's change in entropy across the evaporator is : 0.61 kJ/kg.K .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.11, Page number: 247"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The working fluid in a refrigerator enters a compressor at dry-saturated conditions at a pressure\nof 0.2 MPa and exits the compressor 20\u00b0C superheated at a pressure of 0.6 MPa. Given the fluid\ndata from Illustrative Example 13.9, and given that the fluid leaves the condenser wet-saturated,\nwhat is the heat absorbed by the evaporator of the refrigerator?\n'''\n\n#Variable declaration:\n#From figure 13.2:\nh1 = 390.0 #Fluid enthalpy on entering the compressor (kJ/kg)\nh2 = 430.0 #Fluid enthalpy on leaving the compressor (kJ/kg)\nh3 = 230.0 #Fluid enthalpy on leaving the condenser (kJ/kg)\n\n#Calculation:\nQH = h2 - h3 #Heat rejected from the condenser (kJ/kg)\nW_in = h2 - h1 #Change in enthalpy across the compressor (kJ/kg)\nQC = QH - W_in #Heat absorbed by the evaporator (kJ/kg)\n\n#Result:\nprint \"The heat absorbed by the evaporator of the refrigerator is :\",round(QC),\" kJ/kg .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat absorbed by the evaporator of the refrigerator is : 160.0 kJ/kg .\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.12, Page number: 248"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''From Illustrative Example 13.11, what is the refrigerator\u2019s C.O.P.?\n'''\n\n#Variable declaration:\n#From example 13.11:\nW_in = 40.0 #Change in enthalpy across the compressor (kJ/kg)\nQC = 160.0 #Heat absorbed by the evaporator (kJ/kg)\n\n#Calculation:\nCOP = QC/W_in #Refrigerator\u2019s C.O.P.\n\n#Result:\nprint \"the refrigerator's C.O.P. is :\",round(COP),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "the refrigerator's C.O.P. is : 4.0 .\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.13, Page number: 250"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A Rankine cycle has a T-S diagram as shown in Figure 13.4, and rejects 2043 kJ/kg of heat\nduring the constant pressure process between points 3 and 4. The data provided in Table 13.4\nis also associated with this cycle. Calculate the enthalpy change across the boiler.\nProperties associated with the condenser are as follows:\nP = 0.1235 bar\nhf = 209 kJ/kg\nhg = 2592 kJ/kg\nsf = 0.7038 kJ/kg . K\nsg = 8.0763 kJ/kg . K\n\nTable 13.4 T-S Data for Illustrative Example 13.13\nPoint x h, kJ/kg s, kJ/kg.K\n1 548\n2 3989 7.5190\n3 0.9575 2491 7.7630\n4 1.4410\n'''\n\n#Variable declaration:\nh1 = 548.0 #Steam enthalpy at the entry and exit to the boiler (kJ/kg)\nh2 = 3989.0 #Steam enthalpy at the entry and exit to the turbine (kJ/kg)\nh3 = 2491.0 #Steam enthalpy at the entry and exit to the pump (kJ/kg)\nQH = 2043.0 #Heat rejected by the condenser (kJ/kg)\n\n#Calculation:\nh4 = h3 - QH #Steam enthalpy at the entry and exit to the condenser (kJ/kg)\nQb = h2 - h1 #Enthalpy change across the boiler (kJ/kg)\n\n#Result:\nprint \"The enthalpy change across the boiler is :\",round(Qb),\" kJ/kg .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The enthalpy change across the boiler is : 3441.0 kJ/kg .\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.14, Page number: 251"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the thermal efficiency of the cycle in Illustrative Example 13.13?\n'''\n\n#Variable declaration:\n#From example 13.4:\nh1 = 548.0 #Steam enthalpy at the entry and exit to the boiler (kJ/kg)\nh2 = 3989.0 #Steam enthalpy at the entry and exit to the turbine (kJ/kg)\nh3 = 2491.0 #Steam enthalpy at the entry and exit to the pump (kJ/kg)\nh4 = 448.0 #Steam enthalpy at the entry and exit to the condenser (kJ/kg)\nQb = 3441.0 #Enthalpy change across the boiler (kJ/kg)\n\n#Calculation:\nWt = h2 - h3 #Work produced by the turbine (kJ/kg)\nWp = h1 - h4 #Work used by the pump (kJ/kg)\nW_net = Wt - Wp #Net work by subtracting the pump work from the turbine work (kJ/kg)\nn_th = W_net/Qb #Thermal efficiency\n\n#Result:\nprint \"The thermal efficiency is :\",round(n_th*100,1),\" % .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The thermal efficiency is : 40.6 % .\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 13.15, Page number: 252"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using the Rankine cycle T-s diagram, in Figure 13.4, and the data from Illustrative Example\n13.13, calculate the temperature at point 3.\n'''\n\n#Variable declaration:\n#From table 13.4:\nx3 = 0.9575 #Mass fraction vapour at point 3\nh3 = 2491.0 #Steam enthalpy at the entry and exit to the pump (kJ/kg)\ns3 = 7.7630 #Entropy at the entry and exit to the pump (kJ/kg.K)\ns4 = 1.4410 #Entropy at the entry and exit to the condenser (kJ/kg.K)\n#From example13.14:\nh4 = 448.0 #Steam enthalpy at the entry and exit to the condenser (kJ/kg)\n\n#Calculation:\nQ_out = h3 - h4 #Heat rejected (kJ/kg)\nDS = s3 - s4 #Process change in entropy (kJ/kg)\nT3 = Q_out/DS #Temperature at point 3 (K)\n\n#Result:\nprint \"The temperature at point 3 is :\",round(T3),\" K .\"\nprint \"Or, the temperature at point 3 is :\",round(T3-273),\" \u00b0C .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature at point 3 is : 323.0 K .\nOr, the temperature at point 3 is : 50.0 \u00b0C .\n"
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_14.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_14.ipynb
new file mode 100644
index 00000000..8d13ffd1
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_14.ipynb
@@ -0,0 +1,335 @@
+{
+ "metadata": {
+ "name": "Chapter 14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 14: Introduction to Heat Exchangers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.1, Page number: 259"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''If 20,000 scfm (32\u00b0F, 1 atm) of an air stream is heated from 200\u00b0F to 2000\u00b0F, calculate the heat\ntransfer rate required to bring about this change in temperature. Use the following enthalpy and\naverage heat capacity data:\nH_200\u00b0F = 1170 Btu/lbmol\nH_2000\u00b0F = 14,970 Btu/lbmol\nCp,av = 7.53 Btu/lbmol.\u00b0F (over the 200-2000\u00b0F range)\n'''\n\n#Variable declaration:\nscfm = 20000.0 #Volumetric flow rate of air at standard conditions (scfm)\nH1 = 1170.0 #Enthalpy at 200\u00b0F (Btu/lbmol)\nH2 = 14970.0 #Enthalpy at 2000\u00b0F (Btu/lbmol)\nCp = 7.53 #Average heat capacity (Btu/lbmol.\u00b0F)\nT1 = 200.0 #Initial temperature (\u00b0F)\nT2 = 2000.0 #Final temperature (\u00b0F)\n\n#Calculation:\nn = scfm/359.0 #Flow rate of air in a molar flow rate (lbmol/min)\nDH = H2 - H1 #Change in enthalpy (Btu/lbmol)\nDT = T2 - T1 #Change in temperature (\u00b0F)\nQ1 = n*DH #Heat transfer rate using enthalpy data (Btu/min)\nQ2 = n*Cp*DT #Heat transfer rate using the average heat capacity data (Btu/min)\n\n#Result:\nprint \"The heat transfer rate using enthalpy data is :\",round(Q1/10**5,2),\" x 10^5 Btu/min.\"\nprint \"The heat transfer rate using the average heat capacity data is :\",round(Q2/10**5,2),\" x 10^5 Btu/min.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate using enthalpy data is : 7.69 x 10^5 Btu/min.\nThe heat transfer rate using the average heat capacity data is : 7.55 x 10^5 Btu/min.\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.2, Page number: 259"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Given the mass flow rate of a gas stream and its heat capacity, determine the required heat rate to\nchange the gas stream from one temperature to another. Data are provided below:\nn = 1200 lbmol/min\nCP,av = 0.26 Btu/lbmol.\u00b0F (over the 200-2000\u00b0F range)\nT1 = 200\u00b0F\nT2 = 1200\u00b0F\n'''\n\n#Variable declaration:\nn = 1200.0 #Flow rate of air in a molar flow rate (lbmol/min)\nCp = 0.26 #Average heat capacity (Btu/lbmol.\u00b0F)\nT1 = 200.0 #Initial temperature (\u00b0F)\nT2 = 1200.0 #Final temperature (\u00b0F)\n\n#Calculation:\nDT = T2 - T1 #Change in temperature (\u00b0F)\nQ = n*Cp*DT #Required heat rate (Btu/min)\n\n#Result:\nprint \"The required heat rate is :\",round(Q/10**5,2),\" x 10^5 Btu/min .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required heat rate is : 3.12 x 10^5 Btu/min .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.3, Page number: 260"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Obtain the heat transfer rate in an exchanger if equal similar liquid flow rates are used. The hot\nfluid is cooled from 84\u00b0C to 72\u00b0C while the cold fluid is initially at 25\u00b0C.\n'''\n\n#Variable declaration:\nTc1 = 25.0 #Initial temperature of cold fluid (\u00b0C)\nTh1 = 72.0 #Initial temperature of hot fluid (\u00b0C)\nTh2 = 84.0 #Final temperature of hot fluid (\u00b0C)\n\n#Calculation:\n#From equation 14.2:\nTc2 = (Th2-Th1)+Tc1 #Final temperature of cold fluid (\u00b0C)\n\n#Result:\nprint \"The final temperature of the cold liquid is :\",Tc2,\" \u00b0C .\"\nprint \"There is a printing mistake in unit of final temperature in book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The final temperature of the cold liquid is : 37.0 \u00b0C .\nThere is a printing mistake in unit of final temperature in book.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.4, Page number: 265"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Steam at 1 atm outside a pipe is heating a fluid inside a pipe whose temperature may be assumed\nuniform at 25\u00b0C. Calculate the LMTD.\n'''\n\n#Variable declaration:\nTs = 100.0 #Steam temperature at 1 atm (\u00b0C)\nTl = 25.0 #Fluid temperature (\u00b0C)\n\n#Calculation:\nDTlm = Ts - Tl #Log mean temperature difference (\u00b0C)\n\n#Result:\nprint \"The LMTD is :\",DTlm,\" \u00b0C .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The LMTD is : 75.0 \u00b0C .\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.5, Page number: 265"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Repeat the calculation in the previous example if the fluid is heated from 25\u00b0C and 80\u00b0C\n'''\n\nfrom math import log\n\n#Variable declaration:\nTs = 100.0 #Steam temperature at 1 atm (\u00b0C)\nT1 = 25.0 #Initial fluid temperature (\u00b0C)\nT2 = 80.0 #Final fluid temperature (\u00b0C)\n\n#Calculation:\nDT1 = Ts - T1 #Temperature difference driving force at the fluid entrance (\u00b0C)\nDT2 = Ts - T2 #Temperature driving force at the fluid exit (\u00b0C)\nDTlm = (DT1 - DT2)/log(DT1/DT2) #Log mean temperature difference (\u00b0C)\n\n#Result:\nprint \"The LMTD is :\",round(DTlm,1),\" \u00b0C .\"\nprint \"There is a calculation mistake regarding final result in book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The LMTD is : 41.6 \u00b0C .\nThere is a calculation mistake regarding final result in book.\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.6, Page number: 266"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A liquid-to-liquid counterflow heat exchanger is used to heat a cold fluid from 120\u00b0F to 310\u00b0F.\nAssuming that the hot fluid enters at 500\u00b0F and leaves at 400\u00b0F, calculate the log mean temperature\ndifference (driving force) for the heat exchanger.\n'''\n\nfrom math import log\n\n#Variable declaration:\nT1 = 500.0 #Temperature of hot fluid entering the heat exchanger (\u00b0F)\nT2 = 400.0 #Temperature of hot fluid exiting the heat exchanger (\u00b0F)\nt1 = 120.0 #Temperature of cold fluid entering the heat exchanger (\u00b0F)\nt2 = 310.0 #Temperature of cold fluid exiting the heat exchanger (\u00b0F)\n\n#Calculation:\nDT1 = T1 - t2 #Temperature difference driving force at the heat exchanger entrance (\u00b0F)\nDT2 = T2 - t1 #Temperature difference driving force at the heat exchanger exit (\u00b0F)\nDTlm = (DT1 - DT2)/(log(DT1/DT2)) #LMTD (driving force) for the heat exchanger (\u00b0F)\n\n#Result:\nprint \"The LMTD (driving force) for the heat exchanger is :\",round(DTlm),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The LMTD (driving force) for the heat exchanger is : 232.0 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.7, Page number: 267"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A heavy hydrocarbon oil with heat capacity, cp = 0.55 Btu/lb . \u00b0F, is being cooled from T1 =\n210\u00b0F to T2 = 170\u00b0F. The oil flows inside a tube at a rate of 8000 lb/h and the tube surface temperature\nis maintained at 60\u00b0F. Calculate the heat transfer rate and the LMTD in \u00b0F.\n'''\n\nfrom math import log\n\n#Variable declaration:\nm = 8000.0 #Rate of oil flow inside the tube (lb/h)\nCp = 0.55 #Heat capacity of oil (Btu/lb.\u00b0F)\nT1 = 210.0 #Initial temperature of oil (\u00b0F)\nT2 = 170.0 #Final temperature of oil (\u00b0F)\nt = 60.0 #Tube surface temperature (\u00b0F)\n\n#Calculation:\nDT = T2 - T1 #Change in temperature (\u00b0F)\nQ = m*Cp*DT #Heat transferred from the heavy oil (Btu/h)\nDT1 = T1 - t #Temperature difference driving force at the pipe entrance (\u00b0F)\nDT2 = T2 - t #Temperature difference driving force at the pipe exit (\u00b0F)\nDTlm = (DT1 - DT2)/(log(DT1/DT2)) #LMTD (driving force) for the heat exchanger (\u00b0F)\n\n#Result:\nprint \"The heat transfer rate is :\",round(Q),\" Btu/h .\"\nprint \"The LMTD for the heat exchanger is :\",round(DTlm),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate is : -176000.0 Btu/h .\nThe LMTD for the heat exchanger is : 129.0 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.8, Page number: 267"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An oil cooler is to operate with an inlet of 138\u00b0F and outlet of 103\u00b0F, and the coolant entering at\n88\u00b0F is to be allowed to rise to 98\u00b0F. What is the LMTD for this unit, if it is considered as\n1. counter-current flow unit, and\n2. a parallel flow unit.\n'''\n\nfrom math import log\n\n#Variable declaration:\nT1 = 138.0 #Temperature of oil entering the cooler (\u00b0F)\nT2 = 103.0 #Temperature of oil leaving the cooler (\u00b0F)\nt1 = 88.0 #Temperature of coolant entering the cooler (\u00b0F)\nt2 = 98.0 #Temperature of coolant leaving the cooler (\u00b0F)\n\n#Calculation:\n#For counter flow unit:\nDT1 = T1 - t2 #Temperature difference driving force at the cooler entrance (\u00b0F)\nDT2 = T2 - t1 #Temperature difference driving force at the cooler exit (\u00b0F)\nDTlm1 = (DT1 - DT2)/(log(DT1/DT2)) #LMTD (driving force) for the heat exchanger (\u00b0F)\n#For parallel flow unit:\nDT3 = T1 - t1 #Temperature difference driving force at the cooler entrance (\u00b0F)\nDT4 = T2 - t2 #Temperature difference driving force at the cooler exit (\u00b0F)\nDTlm2 = (DT3 - DT4)/(log(DT3/DT4)) #LMTD (driving force) for the heat exchanger (\u00b0F)\n\n#Result:\nprint \"The LMTD for counter-current flow unit is :\",round(DTlm1,1),\" \u00b0F .\"\nprint \"The LMTD for parallel flow unit is :\",round(DTlm2,1),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The LMTD for counter-current flow unit is : 25.5 \u00b0F .\nThe LMTD for parallel flow unit is : 19.5 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.10, Page number: 272"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Arectangular plane window glass panel is mounted on a house. The glass is 0.125 inch thick and\nhas a surface area of 1.0 m2; its thermal conductivity, k2, is 1.4W/m . K. The inside house temperature,\nT1, and the outside air temperature, t4, are 25\u00b0C and 214\u00b0C, respectively. The heat\ntransfer coefficient inside the room, h1, is 11.0 W/m^2 . K and the heat transfer coefficient\nfrom the window to the surrounding cold air, h3, is 9.0 W/m^2 . K. Calculate the overall heat\ntransfer coefficient in W/m^2 . K.\n'''\n\n#Variable declaration:\nA = 1.0 #Surface area of glass (m^2)\nh1 = 11.0 #Heat transfer coefficient inside room (W/m^2.K)\nL2 = 0.125*0.0254 #Thickness of glass (m)\nk2 = 1.4 #Thermal conductivity of glass (W/m.K)\nh3 = 9.0 #Heat transfer coefficient from window to surrounding cold air (W/m^2.K)\n\n#Calculation:\nR1 = 1.0/(h1*A) #Internal convection resistance (K/W)\nR2 = L2/(k2*A) #Conduction resistance through glass panel (K/W)\nR3 = 1.0/(h3*A) #Outside convection resistance (K/W)\nRt = R1+R2+R3 #Total thermal resistance (K/W)\nU = 1.0/(A*Rt) #Overall heat transfer coefficient (W/m^2.K)\n\n#Result:\nprint \"The overall heat transfer coefficient is :\",round(U,1),\" W/m^2.K .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The overall heat transfer coefficient is : 4.9 W/m^2.K .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.11, Page number: 273"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A heat exchanger wall consists of a copper plate 0.049 inch thick. If the two surface film coefficients\nare 208 and 10.8 Btu/h.ft^2.\u00b0F, respectively, calculate the overall heat transfer coefficient\nin Btu/h.ft^2.\u00b0F.\n'''\n\n#Variable declaration:\nDx = 0.049/12.0 #Thickness of copper plate (ft)\nh1 = 208.0 #Film coefficient of surface one (Btu/h.ft^2.\u00b0F)\nh2 = 10.8 #Film coefficient of surface two (Btu/h.ft^2.\u00b0F)\nk = 220.0 #Thermal conductivity for copper (W/m.K)\n\n#Calculation:\nU = 1.0/(1.0/h1+Dx/k+1.0/h2) #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The overall heat transfer coefficient is :\",round(U,2),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The overall heat transfer coefficient is : 10.26 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.12, Page number: 274"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A coolant flows through a steel pipe (inside diameter of 0.05 m, outside diameter of 0.06 m) at a\nvelocity of 0.25 m/s. What is the overall heat transfer coefficient for the system based on the\npipe\u2019s outside surface area if the inside and outside coefficients are 2000 W/m^2 . K and 8.25\nW/m^2 . K, respectively. Assume the \u201cresistance\u201d term for the steel, that is,\nR = Do x ln(Do/Di)/2k\nis 1.33 x 10^-4 m^2.K/W .\n'''\n\n#Variable declaration:\nDo = 0.06 #Outside diameter of pipe (m)\nDi = 0.05 #Inside diameter of pipe (m)\nho = 8.25 #Outside coefficient (W/m^2.K)\nhi = 2000.0 #Inside coefficient (W/m^2.K)\nR = 1.33*10**-4 #Resistance for steel (m^2.K/W)\n\n#Calculation:\nU = 1.0/(Do/(hi*Di)+R+1.0/ho) #Overall heat transfer coefficient (W/m^2.\u00b0K)\n\n#Result:\nprint \"The overall heat transfer coefficient is :\",round(U,2),\" W/m^2.\u00b0K .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The overall heat transfer coefficient is : 8.2 W/m^2.\u00b0K .\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.14, Page number: 274"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Steam at 247\u00b0F is flowing through a pipe exposed to air but covered with 1.5 inch thick insulation.\nThe following data is provided:\n1. Pipe diameter, inside = 0.825 inch\n2. Pipe diameter, outside = 1.05 inch\n3. Surrounding air temperature = 60\u00b0F\n4. Thermal conductivity, pipe = 26 Btu/h . ft . \u00b0F\n5. Thermal conductivity, insulation = 0.037 Btu/h . ft . \u00b0F\n6. Steam film coefficient = 800 Btu/h . ft^2 . \u00b0F\n7. Air film coefficient = 2.5 Btu/h . ft^2 . \u00b0F\nCalculate the overall heat transfer coefficient based on the inside area of the pipe.\n'''\n\nfrom math import pi,log\n\n#Variable declaration:\nDi = 0.825/12.0 #Pipe inside diameter (ft)\nDo = 1.05/12.0 #Pipe outside diameter (ft)\nDl = 4.05/12.0 #Insulation thickness (ft)\nl = 1.0 #Pipe length (ft)\nkp = 26.0 #Thermal conductivity of pipe (Btu/h.ft.\u00b0F)\nkl = 0.037 #Thermal conductivity of insulation (Btu/h.ft.\u00b0F)\nhi = 800.0 #Steam film coefficient (Btu/h.ft^2.\u00b0F)\nho = 2.5 #Air film coefficient (Btu/h.ft^2.\u00b0F)\n\n#Calculation:\nri = Di/2.0 #Pipe inside radius (ft)\nro = Do/2.0 #Pipe outside radius (ft)\nrl = Dl/2.0 #Insulation radius (ft)\nAi = pi*Di*l #Inside area of pipe (ft^2)\nAo = pi*Do*l #Outside area of pipe (ft^2)\nAl = pi*Dl*l #Insulation area of pipe (ft^2)\nA_Plm = (Ao-Ai)/log(Ao/Ai) #Log mean area for steel pipe (ft^2)\nA_Ilm = (Al-Ao)/log(Al/Ao) #Log mean area for insulation (ft^2)\nRi = 1.0/(hi*Ai) #Air resistance (m^2.K/W)\nRo = 1.0/(ho*Al) #Steam resistance (m^2.K/W)\nRp = (ro-ri)/(kp*A_Plm) #Pipe resistance (m^2.K/W)\nRl = (rl-ro)/(kl*A_Ilm) #Insulation resistance (m^2.K/W)\nU = 1.0/(Ai*(Ri+Rp+Ro+Rl)) #Overall heat coefficient based on the inside area (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The overall heat transfer coefficient based on the inside area of the pipe is :\",round(U,3),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The overall heat transfer coefficient based on the inside area of the pipe is : 0.748 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.15, Page number: 275"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the rate of heat transfer in the previous example.\n'''\n\nfrom math import pi\n\n#Variable declaration:\n#From example 14.14:\nDi = 0.825/12.0 #Pipe inside diameter (ft)\nL = 1.0 #Pipe length (ft)\nUi = 0.7492 #Overall heat coefficient (Btu/h.ft^2.\u00b0F)\nTs = 247.0 #Steam temperature (\u00b0F)\nta = 60.0 #Air temperature (\u00b0F)\n\n#Calculation:\nAi = pi*Di*L #Inside area of pipe (ft^2)\nQ = Ui*Ai*(Ts-ta) #Heat transfer rate (Btu/h)\n\n#Result:\nprint \"The heat transfer rate is :\",round(Q,1),\" Btu/h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate is : 30.3 Btu/h .\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.16, Page number: 276"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following information is provided for a heat exchanger:\nhw(water) = 200 Btu/h.ft^2.\u00b0F\nho(oil) = 50 Btu/h.ft^2.\u00b0F\nhf (fouling) = 1000 Btu/h.ft^2.\u00b0F\nDTlm = 90\u00b0F\nA = 15.0 ft^2\nCalculate the heat transfer rate for the exchanger if the wall resistance can be neglected.\n'''\n\n#Variable declaration:\nhw = 200.0 #Water heat coefficient (Btu/h.ft^2.\u00b0F)\nho = 50.0 #Oil heat coefficient (Btu/h.ft^2.\u00b0F)\nhf = 1000.0 #Fouling heat coefficient (Btu/h.ft^2.\u00b0F)\nDTlm = 90.0 #Log mean temperature difference (\u00b0F)\nA = 15.0 #Area of wall (ft^2)\n\n#Calculation:\nX = 1.0/hw+1.0/ho+1.0/hf #Equation 14.34 for constant A\nU = 1.0/X #Overall heat coeffocient (Btu/h.ft^2.\u00b0F)\nQ = U*A*DTlm #Heat transfer rate (Btu/h)\n\n#Result:\nprint \"The heat transfer rate is :\",round(Q,-1),\" Btu/h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate is : 51920.0 Btu/h .\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 14.17, Page number: 277"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A brine solution at 10\u00b0F in a food processing plant is heated by flowing through a heated pipe.\nThe pipe surface is maintained at 80\u00b0F. The pipe surface area for heat transfer is 2.5 ft^2. The\nbrine solution (with a density of 62.4 lb/ft^3 and a heat capacity of 0.99 Btu/lb.\u00b0F) flows at a\nrate of 20 lb/min. The overall heat transfer coefficient varies linearly with the temperature\napproach, with values of 150 Btu/h.ft^2.\u00b0F at the brine solution entrance (where the brine\ntemperature is 10\u00b0F) and 140 Btu/h.ft^2.\u00b0F at the brine solution exit. Determine the temperature\napproach at the brine inlet side, the exit temperature of the brine solution, and the rate of heat\ntransfer, Q .\n''' \n\nfrom __future__ import division\nfrom sympy import symbols,log,nsolve\n\n\n#Variable declaration:\nT = 80.0 #Pipe surface temperature (\u00b0F)\nt1 = 10.0 #Brine inlet temperature (\u00b0F)\nDT2 = symbols('DT2') #Discharge temperature of the brine solution (\u00b0F)\nm = 20*60 #Flowrate of brine solution (lb/h)\nCp = 0.99 #Heat capacity of brine solution (Btu/lb.\u00b0F)\nU1 = 150 #Overall heat transfer coefficient at brine solution entrance (Btu/h.ft^2.\u00b0F)\nU2 = 140 #Overall heat transfer coefficientat at brine solution exit (Btu/h.ft^2.\u00b0F)\nA = 2.5 #Pipe surface area for heat transfer (ft^2)\n\n#Calculation:\nDT1 = T-t1 #Temperature approach at the pipe entrance (\u00b0F)\nQ = m*Cp*(DT1-DT2) #Energy balance to the brine solution across the full length of the pipe (Btu/h)\nDT1m = (DT1-DT2)/log(DT1/DT2) #Equation for the LMTD\nQQ = A*(U2*DT1-U1*DT2)/log(U2*DT1/U1/DT2) #Equation for the heat transfer rate (Btu/h)\nE = QQ-Q #Energy balance equation\nR = nsolve([E],[DT2],[1.2]) #\nDT = R[0] #Log mean temperature difference\nt2 = T-DT #In discharge temperature of the brine solution (\u00b0F)\nt2c = 5/9*(t2-32) #In discharge temperature of the brine solution in \u00b0C (c/5 = (F-32)/9)\n_Q_ = Q.subs(DT2,DT) #Heat transfer rate (Btu/h)\n\n#Result:\nprint \"The temperature approach at the brine inlet side is :\",round(DT1,1),\" \u00b0F.\"\nprint \"Or, the temperature approach at the brine inlet side is :\",round(DT1/1.8,1),\" \u00b0C.\"\nprint \"The exit temperature of the brine solution is :\",round(t2,1),\" \u00b0F.\"\nprint \"Or, the exit temperature of the brine solution is :\",round((t2-32)/1.8,1),\" \u00b0C.\"\nprint \"The rate of heat transfer is :\",round(_Q_,-1),\" Btu/h.\"\nprint \"Or, the rate of heat transfer is :\",round(_Q_/3.412,-2),\" W.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature approach at the brine inlet side is : 70.0 \u00b0F.\nOr, the temperature approach at the brine inlet side is : 38.9 \u00b0C.\nThe exit temperature of the brine solution is : 28.4 \u00b0F.\nOr, the exit temperature of the brine solution is : -2.0 \u00b0C.\nThe rate of heat transfer is : 21830.0 Btu/h.\nOr, the rate of heat transfer is : 6400.0 W.\n"
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_15.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_15.ipynb
new file mode 100644
index 00000000..cbfe94ac
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_15.ipynb
@@ -0,0 +1,356 @@
+{
+ "metadata": {
+ "name": "Chapter 15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 15: Double Pipe Heat Exchangers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.2, Page number: 290"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following data is provided for a double pipe heat exchanger\nQ = 12,000 Btu/h\nU = 48.0 Btu/ft^2.h.\u00b0F\nDTlm = 50\u00b0F\nCalculate the area of the exchanger.\n'''\n\n#Variable declaration:\nQ = 12000.0 #Heat transfer rate (Btu/h)\nU = 48.0 #Overall heat coefficient (Btu/ft^2.h.\u00b0F)\nDTlm = 50.0 #Log mean temperature difference (\u00b0F)\n\n#Calculation:\nA = Q/(U*DTlm) #Area of exchanger (ft^2)\n\n#Result:\nprint \"The area of the exchanger is :\",round(A),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The area of the exchanger is : 5.0 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.3, Page number: 291"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the inlet cold water temperature flowing at a rate of 14.6 lb/min in a double pipe heat\nexchanger given the following data. Assume co-current operation.\nt1 = tc,i = 63\u00b0F\nT1 = TH,i = 164\u00b0F\nT2 = TH,o = 99\u00b0F\nU = 35.35 Btu/ft.h.\u00b0F\nQ = 56,760 Btu/h\nA = 32.1 ft^2\n'''\n\nfrom sympy import symbols,solve,log\n\n#Variable declaration:\nQ = 56760 #Heat transfer rate (Btu/h)\nU = 35.35 #Overall heat coefficient (Btu/ft.h.\u00b0F)\nA = 32.1 #Area of exachanger (ft^2)\nt1 = 63.0 #Outlet cold water temperature (\u00b0F)\nT1 = 164 #Outlet hot water temperature (\u00b0F)\nT2 = 99 #Inlet hot water temperature (\u00b0F)\nt2 = symbols('t2') #Inlet cold water temperature (\u00b0F)\n\n#Calculation:\nDTlm = Q/(U*A) #Log mean temperature difference (\u00b0F)\ndT1 = T1-t1 #Temperature approach at pipe outlet (\u00b0F)\ndT2 = T2-t2 #Temperature approach at pipe inlet (\u00b0F)\nEq = (dT2-dT1)/log(dT2/dT1)-DTlm\nR = solve(Eq,t2) #Inlet cold water temperature (\u00b0F)\n\n#Result:\nprint \"The inlet cold water temperature is : \",round(R[0]),\" \u00b0F.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The inlet cold water temperature is : 79.0 \u00b0F.\n"
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.4, Page number: 292"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''As Shakespeare once said: \u201cSomething is rotten in the state of . . .\u201d Comment on whether the\ninformation provided in the previous example is \u201cconsistent.\u201d\n'''\n\n#Variable declaration:\nm = 14.6 #Flow rate of water inside the tube (lb/min)\nCp = 1 #Heat capacity of water (Btu/lb.\u00b0F)\nt2 = 79 #Initial temperature of water (\u00b0F)\nt1 = 63 #Final temperature of water (\u00b0F)\n#From example 15.3:\nQ1 = 56760 #Old heat transfer rate (Btu/h)\n\n#Calculation:\nQ2 = m*Cp*(t2-t1) #New heat transfer rate (Btu/min)\n\n#Result:\nprint \"The new heat transfer rate is :\",round(Q2),\" Btu/min.\" \nprint \"Or, the new heat transfer rate is :\",round(Q2*60),\" Btu/h.\"\nif (Q1==Q2) :\n print \"This result agree with the Q\u02d9 provided in the problem statement. Shakespeare is wrong, nothing is rotten there.\"\nelse :\n print \"This result does not agree with the Q\u02d9 provided in the problem statement. Shakespeare is right, something is indeed rotten.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The new heat transfer rate is : 234.0 Btu/min.\nOr, the new heat transfer rate is : 14016.0 Btu/h.\nThis result does not agree with the Q\u02d9 provided in the problem statement. Shakespeare is right, something is indeed rotten.\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.5, Page number: 292"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A heavy hydrocarbon oil with a heat capacity, cp = 0.55 Btu/lb.\u00b0F, is being cooled in a double\npipe heat exchanger from T1 = 210\u00b0F to T2 = 170\u00b0F. The oil flows inside a tube at a rate of\n8000 lb/h and the tube surface temperature is maintained at 60\u00b0F. The overall heat transfer\ncoefficient U = 63 Btu.h.ft^2.\u00b0F. Calculate the required heat transfer area, A, in ft^2.\n'''\n\nfrom math import log\n\n#Variable declaration:\nT1 = 210.0 #Initial temperature of oil (\u00b0F)\nT2 = 170.0 #Final temperature of oil (\u00b0F)\nT3 = 60.0 #Surface temperature of oil (\u00b0F)\nm = 8000.0 #Flow rate of oil inside tube (lb/h)\ncp = 0.55 #Heat capacity of oil (Btu/lb.\u00b0F)\nU = 63.0 #Overall heat teansfer coefficient (Btu.h.ft^2.\u00b0F)\n\n#Calculation:\nDT1 = T1-T3 #Temperature difference 1 (\u00b0F)\nDT2 = T2-T3 #Temperature difference 2 (\u00b0F)\nDTlm = (DT1-DT2)/log(DT1/DT2) #Log mean temerature difference (\u00b0F)\nQ = m*cp*(T1-T2) #Heat transferred (Btu/h)\nA = Q/(U*DTlm) #Heat transfer area (ft^2)\n\n#Result:\nprint \"The required heat transfer area is :\",round(A,2),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required heat transfer area is : 21.66 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.6, Page number: 293"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two variations of the design of a heat exchanger have been proposed. The unit is to cool a hot\nwater stream from 140\u00b0F to 110\u00b0F through indirect contact with a cold water stream that is being\nheated from 60\u00b0F to 90\u00b0F. The water flow rate is 100 lb/min and the overall heat transfer coefficient\nmay be assumed equal to 750 Btu/h.ft^2.\u00b0F. Calculate the area requirements for the following\ntwo exchanger conditions:\n1. double pipe co-current flow\n2. double pipe countercurrent flow\n'''\n\nfrom math import log\n\n#Variable declaration:\nT1 = 140.0 #Initial temperature of hot water (\u00b0F)\nT2 = 110.0 #Final temperature of hot water (\u00b0F)\nT3 = 60.0 #Initial temperature of cold water (\u00b0F)\nT4 = 90.0 #Initial temperature of cold water (\u00b0F)\nDTlm2 = 50.0 #Log mean temerature difference for countercurrent flow, a constant (\u00b0F) (part 2)\nm = 100.0*60 #Water flow rate (lb/h)\ncp = 1.0 ##Heat capacity of water (Btu/lb.\u00b0F)\nU = 750.0 #Overall heat teansfer coefficient (Btu.h.ft^2.\u00b0F)\n\n#Calculation:\nDT1 = T1-T3 #Temperature difference 1 (\u00b0F) (part 1)\nDT2 = T2-T4 #Temperature difference 2 (\u00b0F)\nDTlm1 = (DT1-DT2)/log(DT1/DT2) #Log mean temerature difference (\u00b0F)\nQ = m*cp*(T1-T2) #Heat transferred (Btu/h)\nAp = Q/(U*DTlm1) #Heat transfer area for parallel flow (ft^2)\nAc = Q/(U*DTlm2) #Heat transfer area for counter flow (ft^2)\n\n#Result:\nprint \"1. The double pipe co-current flow is :\",round(Ap,2),\" ft^2 .\"\nprint \"1. The double pipe countercurrent flow is :\",round(Ac,2),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The double pipe co-current flow is : 5.55 ft^2 .\n1. The double pipe countercurrent flow is : 4.8 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.8, Page number: 294"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The double pipe heat exchanger shown in Figure 15.4 is used for heating 2500 lb/h benzene\n\tfrom 60\u00b0F to 120\u00b0F. Hot water at 200\u00b0F from a boiler is available for heating purposes in\n\tamounts up to 4000 lb/h. Use schedule 40 brass pipe and an integral number of 15 foot long\n\tsections are to be employed in the design of the exchanger.\n\tThe design is to be based on achieving a Reynolds number of 13,000 (turbulent flow) in both\n\tthe inner pipe and annular region. As an additional constrain because of pressure drop consideration,\n\tthe width of the annular region must be at least equal to one fourth the outside diameter of\n\tthe inner pipe.\n\tNote that one can obtainQ\u02d9 by calculating the duty of the benzene stream, and a heat balance\n\twill yield the exit temperature of the water, Tw. However, the area or the overall heat transfer\n\tcoefficient is not known. Obtaining U becomes more complicated since information on flow\n\tvariables or a pipe diameter is not given.\n\tData is provided below for this problem, but can be estimated or obtained from Tables in the\n\tAppendix:\n\tCenzene at 90\u00b0F:\n\tmu = 0.55 cP = 3.70 x 10^-4 lb/ft.s\n\tSG = 0.879 (at 68.8\u00b0F)\n\tr = 0.879(62.4) = 54.8 lb/ft^3\n\tcp = 0.415 Ctu/lb.\u00b0F\n\tk = 0.092 Ctu/h.ft.\u00b0F (at 86\u00b0F)\n\tHater at 200\u00b0F.\n\tmu = 0.305 cP = 2.05 x 10^-4 lb/ft.s\n\tr = 60.13 lb/ft^3\n\tcp = 1.0 Btu/lb.\u00b0F\n\tk = 0.392 Btu/h.ft.\u00b0F\n'''\n\nfrom __future__ import division\nfrom math import pi,log\n\n#Variable declaration:\nuC = 3.7*10**-4 \t #Viscosity of benzene (lb/ft.s)\nuH = 2.05*10**-4 \t #Viscosity of water @200 \u00b0F (lb/ft.s)\nu2 = 2.16*10**-4 \t\t\t\t #Viscosity of water @192 \u00b0F (lb/ft.s)\npC = 54.8 #Density of benzene (lb/ft^3)\npH = 60.13 #Density of water (lb/ft^3)\ncpC = 0.415 #Specific heat capacity of benzene (Btu/lb.\u00b0F)\ncpH = 1 #Specific heat capacity of water (Btu/lb.\u00b0F)\nsgC = 0.879 \nkC = 0.092 #Thermal conductivity of benzene (Btu/h.ft.\u00b0F)\nkH = 0.392 #Thermal conductivity of water @200 \u00b0F (Btu/h.ft.\u00b0F)\nk2 = 0.390\t\t\t\t\t #Thermal conductivity of water @192 \u00b0F (Btu/h.ft.\u00b0F)\nmC = 2500\t \t\t\t #Flow rate of benzene (lb/s)\nmH = 4000 #Flow rate of water (lb/s)\nRe = 13000 #Reynolds number\ndTc = 120-60\t\t\t\t\t #Difference in temperature heating for benzene\nTw = 200\t\t\t\t #Temperatperature of hot water (\u00b0F)\n#For 2-inch schedule 40 pipe\nAi = 0.541 #Inside area of pipe (ft^2/ft)\nAo = 0.622 #Outside area of pipe (ft^2/ft)\nDi = 2.067 #Inside diameter of pipe (inch)\nDo = 2.375 #Outside diameter of pipe (inch)\nSi = 0.0233 #Inside surface area of pipe (ft^2)\ndXw = 0.128 #Width of pipe (ft)\n\n#For 4-inch schedule 40 pipe\nDio = 4.026 #Inside diameter of pipe (inch)\nDoi = Do #Outside diameter of pipe (inch)\nkw = 26 \n\n#Calculations:\ndef St(Re,Pr):\t\t\t\t #Dittus Boelter equation\n\treturn 0.023*Re**-0.2*Pr**-0.667\n#For inside tubes:\nDicalc = 4*mC/(Re*pi*uC)/3600 #Inside diameter (ft)\nmHcalc = Re*pi*uH*(Doi+Dio)/4*3600/12 #Mass flow rate of water (lb/h)\nQ = mC*cpC*dTc\t\t\t\t\t #Heat in water (Btu/h)\ndTH = Q/mH #Temperature difference of water (\u00b0F)\nTHo = Tw - dTH #Outlet temperature of water (\u00b0F)\nTHav = (Tw+THo)/2 #Average temperature of water (\u00b0F) \n#For benzene:\nPrC = cpC*uC/kC*3600 #Prandtl number\nStC = round(St(13000, PrC),5) #Stanton number\nhi = StC*cpC*mC/Si #Heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n#For water:\nReH = 4*mH/3600/(pi*u2*(Doi+Dio)/12) #Reynolds number\nPrH = round(cpH*(u2)/k2*3600 ,2) #Prandtl number\nStH = round(St(ReH, PrH),5) #Stanton number\nSann = round(pi/4*(Dio**2-Doi**2)/144,4) #Surface area of annulus (ft^2)\nho = round(StH*cpH*mH/Sann) #Heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n#For pipe:\nDlm = round((Do-Di)/log(Do/Di)*12,3) #Log mean difference in diameter (ft)\nUo = 1/(Do/Di/hi + dXw*Do/kw/Dlm + 1/ho) #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\ndTlm = (124.4-80)/log(124.4/80) #Log mean temperature difference (\u00b0F)\nL = Q/(Uo*0.622*dTlm) #Length of pipe (ft)\n\n#Result:\nprint 'The required length of pipe: ',round(L,1), 'ft'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required length of pipe: 31.4 ft\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.10, Page number: 300"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate T2 and t2 in (consistent units)\nMC = m_HcpH = 2000\nmc = m_CcpC = 1000\nU = 2000\nA = 10\nT1 = 300\nt1 = 60\nCalculate the exit temperatures if the flow is countercurrent by employing Equation (15.32).(7)\n'''\n\nfrom __future__ import division\nfrom math import e\n\n#Variable declaration:\nMC = 2000.0 \nmc = 1000.0\nU = 2000.0\nA = 10.0\nT1 = 300.0\nt1 = 60.0\n\n#Calculation:\nB = 1.0/mc \nb = 1.0/MC\nx = B/b\ny = U*(B-b)\nT2 = ((x-y)*T1 + x*(e-y)*t1)/(2*e-1)\nt2 = t1+(T1-T2)/x\n\n#Result:\nprint \"T2 = :\",round(T2),\" \u00b0F\"\nprint \"t2 = :\",round(t2),\" \u00b0F\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "T2 = : 114.0 \u00b0F\nt2 = : 153.0 \u00b0F\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.11, Page number: 301"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following information is provided for a co-current flow double pipe heat exchanger. The\npipe consists of 200 ft of 2-inch schedule 40 pipe, k = 25 Btu/h.ft.\u00b0F. The hot and cold\nfilm coefficients are 1200 and 1175 Btu/h.ft^2.\u00b0F, respectively, In addition,\nMC = m_HcpH = 30,000 Btu/h.\u00b0F\nmc = m_CcpC = 22,300 Btu/h.\u00b0F\nT1 = 300 \u00b0F\nt1 = 60 \u00b0F\nCalculate T2 and t2.\n'''\n\nfrom sympy import symbols,solve,log\n\n#Variable declaration:\nh1 = 1200.0 #Hot film coefficient (Btu/h.ft^2.\u00b0F)\nh2 = 1175.0 #Cold film coefficient (Btu/h.ft^2.\u00b0F)\nL = 200.0 #Length of pipe (ft)\nMC = 30000.0\nmc = 22300.0\nT1 = 300.0 #Inlet temperature of hot fluid in pipe (\u00b0F)\nt1 = 60.0 #Inlet temperature of cold fluid in pipe (\u00b0F)\nT2 = symbols('T2') #Outlet temperature of hot fluid \u00b0F\nt2 = symbols('t2') #Outlet temperature of cold fluid \u00b0F\n#From table 6.2:\nID = 2.067 #Inside diameter of pipe (in)\nOD = 2.375 #Outside diameter of pipe (in)\nDx = 0.154 #Thickness of pipe (in)\nAi = 0.541 #Inside sectional area of pipe (ft^2/ft)\nk = 25.0 #Thermal conductivity of pipe (Btu/h)\n\n#Calculation:\nUi = 1.0/((1.0/h1) +(Dx/(k*12.0))+(1.0/(h2*(OD/ID)))) #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nAi1 = Ai*L #Inside area of pipe (ft^3/ft)\nQH = MC*(T1-T2) #Heat transfer rate of hot fluid (Btu/h)\nQC = mc*(t2-t1) #Heat transfer rate of cold fluid (Btu/h)\nt2ht = 195 #t2 by hit and trial\nx = solve(QC-QH,T2)\nT2 = x[0]\nDTlm = (T1-t1-T2+t2)/log((T1-t1)/(T2-t2)) #Log mean temperature difference (\u00b0F)\nQ = Ui*Ai1*DTlm.subs(t2,t2ht) #Total heat transfer rate (Btu/h)\n\n#Result:\nprint \"T2 :\", round(T2.subs(t2,t2ht)),\"(\u00b0F)\"\nprint \"t2 :\", t2.subs(t2,t2ht),\"(\u00b0F)\"\nprint \"Qdot :\", round(Q/10**6) ,\"x 10**6 Btu/h\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "T2 : 200.0 (\u00b0F)\nt2 : 195 (\u00b0F)\nQdot : 3.0 x 10**6 Btu/h\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.12, Page number: 302"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Solve the previous example employing the equations above provided by Famularo.(7) Also calculate\nthe discharge temperature, the LMTD, and Q\u02d9 for the countercurrent case.\n'''\n\nfrom __future__ import division\nfrom math import log,e\n\n#Variable declaration:\nB = 3.33*10**-5\nb = 4.48*10**-5\n#From example 15.11:\nA = 108.2 #Inside area of pipe (ft^3/ft)\nU = 482 #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nMC = 30000.0\nmc = 23000.0\nT1 = 300.0 #Inlet temperature of hot fluid in pipe (\u00b0F)\nt1 = 60.0 #Inlet temperature of cold fluid in pipe (\u00b0F)\n\n#Calculation:\n#From equation 15.28:\nT2 = ((B/b)*(e**(U*A*(B-b))-1)*t1+T1*(B/b-1))/((B/b)*e**(U*A*(B-b))-1) #Outlet temperature of hot fluid (\u00b0F)\n#From equation 15.32:\nt2 = ((b/B)*(e**(U*A*(b-B))-1)*T1+t1*(b/B-1))/((b/B)*e**(U*A*(b-B))-1) #Outlet temperature of cold fluid (\u00b0F)\nDT = ((T2-t1)-(T1-t2))/(log((T2-t1)/(T1-t2))) #Log mean difference temperature (\u00b0F)\nQ1 = U*A*DT #Heat transfer rate of hot fluid (Btu/h)\nQ2 = MC*(T1-T2) #Heat transfer rate of cold fluid (Btu/h)\n\n#Result:\nprint \"The heat load is :\",round(Q2,-3),\" Btu/h.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat load is : 4078000.0 Btu/h.\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.14, Page number: 305"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A double pipe heat exchanger is employed to heat 228 kg/h of water from 25 \u00b0C to 73 \u00b0C.\nWater is on the tube side and the flow is countercurrent. The heating fluid is saturated steam\nat 1 atm, with 55 kg/h of steam condensing on the annular side. No subcooling of condensed\nwater takes place. The inner pipe of the double pipe heat exchanger has an inner radius (ri,i)\nof 1.3 cm and an outer radius (ro,i) of 1.9 cm. The inner radius of the outer tube (ri,o) is 3.2\ncm. Both tubes are 0.5 % carbon steel. The overall heat transfer coefficient for the new heat\nexchanger, Uclean, was originally determined to be 3994 W/m^2.K, based on the inside area of\nthe inner pipe. After a period of use, the fouling factor, Rf, was estimated to be 0.0002 m^2.K/W.\nDetermine:\n1. the temperature profile of the water and steam along the length of the exchanger,\n2. whether the steam has enough energy to heat the water,\n3. the minimum length of the heat exchanger, and\n4. the dirty overall heat transfer coefficient.\nWater properties at the average bulk temperature (25 \u00fe 73)/2 = 49\u00b0C are: heat capacity,\ncp = 4174 J/kg.K; density, r = 993 kg/m^3; absolute viscosity, m = 6.82 x 10^-4 kg/m.s ;\nkinematic viscosity, n = 6.87 x 10^-7 m2/s, and the Prandtl number, Pr = 4.53. The properties\nof water at the \u201caverage\u201d film temperature (100 + 49)/2 = 74.9 \u00b0C are: heat capacity, cp = 4190\nJ/kg.K; density, r = 975 kg/m^3; absolute viscosity, m = 3.8 x 10^-4 kg/m.s; kinematic viscosity,\nn = 3.89 x 10^-7 m^2/s, and the Prandtl number, Pr = 2.53.\nFor saturated steam at 100\u00b0C: latent heat of condensation = 2.26 x 10^6 J/kg, vapor\ndensity = 0.596 kg/m^3. The thermal conductivity for 0.5% carbon steel at an average temperature\nof (100 + 25)/2 = 62.5 \u00b0C is k = 54 W/m.K\nAssumptions include steady-state operation, incompressible fluids, Newtonian fluids,\nconstant properties, homogeneous isotropic materials, and there are negligible heat losses.\nNotations 1 and 2 denote the water inlet and outlet, respectively, and s the stream.\n'''\n\nfrom __future__ import division\nfrom math import log,pi\n\n#Variable declaration:\nTs = 100.0 #Saturation temperature (\u00b0C)\nt1 = 25.0 #Initial temperature of water (\u00b0C)\nt2 = 73.0 #Final temperature of water (\u00b0C)\nm = 228.0/3600.0 #Mass flow rate of water (kg/s)\ncp = 4174.0 #Heat capacity of water (J/kg.K)\nm_s = 55.0/3600.0 #Mass flow rate of steam (kg/s)\nh_vap = 2.26*10**26 #Latent heat of condensation (J/kg)\nk = 54.0 #Thermal conductivity for 0.5% carbon steel (W/m.K)\nrii = 0.013 #Inner radius of inner pipe of the double pipe heat exchanger (m)\nroi = 0.019 #Outer radius of inner pipe of the double pipe heat exchanger (m)\nRf = 0.0002 #Fouling factor (m^2.K/W)\nUc = 0.00045 #Clean overall heat transfer coefficient (W/m^2.K)\n\n#Calculation:\nDT1 = Ts-t1 #Temperature driving force at end 1 (K)\nDT2 = Ts-t2 #Temperature driving force at end 2 (K)\nDTlm = (DT1-DT2)/(log(DT1/DT2)) #Log mean difference temperature (\u00b0C)\nCw =m*cp #Capacitance rate of water (W/K)\nQ = Cw*(t2-t1) #Heat transfer rate (W)\nQmax1 = Cw*(Ts-t1) #Maximum heat term from the water stream (W)\nQmax2 = m_s*h_vap #Maximum heat term from the steam (W)\nE = Q/Qmax1 #Effectiveness\nLmin = (Q*(log(roi/rii)))/(2*pi*k*(Ts-t1)) #Minimum required length of heat exchanger (m)\nUd = 1.0/(1.0/Uc+Rf) #Dirty overall heat transfer coefficient (W/m^2.K)\n\n#Result:\nprint \"1. The temperature profile of the water and steam along the length of the exchanger is :\",round(DTlm),\" \u00b0C .\"\nprint \"2. Effectiveness of energy from steam to heat the water is :\",round(E,3),\" .\"\nprint \"3. The minimum length of the heat exchanger is :\",round(Lmin,3),\" m .\"\nprint \"4. The dirty overall heat transfer coefficient :\",round(Ud,5),\" W/m^2.K .\"\nprint \"5. U_dirty: \", round(1/Ud,-1),\" W/m^2.K\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The temperature profile of the water and steam along the length of the exchanger is : 47.0 \u00b0C .\n2. Effectiveness of energy from steam to heat the water is : 0.64 .\n3. The minimum length of the heat exchanger is : 0.189 m .\n4. The dirty overall heat transfer coefficient : 0.00045 W/m^2.K .\n5. U_dirty: 2220.0 W/m^2.K\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.15, Page number: 308"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous example. Calculate the area and the length of the heat exchanger.'''\n\nfrom math import pi\n\n#Variable declaration:\nQ = 12700.0 #Heat transfer rate (W)\nUd = 2220.0 #Dirty overall heat transfer coefficient (W/m^2.K)\nDTlm = 47.0 #Log mean difference temperature (\u00b0C)\nrii = 0.013 #Inner radius of inner pipe of the double pipe heat exchanger (m)\n#Calculation:\nA = Q/(Ud*DTlm) #Heat transfer area (m^2)\nL = A/(2*pi*rii) #Tube length (m)\n\n#Result:\nprint \"The heat transfer area is :\",round(A,4),\" m^2 .\"\nprint \"The length of the heat exchanger is :\",round(L,2),\" m .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer area is : 0.1217 m^2 .\nThe length of the heat exchanger is : 1.49 m .\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.16, Page number: 308"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''With reference to Illustrative Example 15.14, calculate the number of transfer units (NTU) of the\nexchanger.\n'''\n\n#Variable declaration:\nUd = 2220.0 #Dirty overall heat transfer coefficient (W/m^2.K)\nA = 0.1217 #Heat transfer area (m^2)\nCw = 264.0 #Capacitance rate of water (W/K)\n\n#Calculation:\nNTU = (Ud*A)/Cw #Number of transfer units of the exchanger\n\n#Result:\nprint \"The number of transfer units (NTU) of the exchanger is :\",round(NTU,2),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The number of transfer units (NTU) of the exchanger is : 1.02 .\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.18, Page number: 309"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''In 1975, Arthur Andrews(10)\u2014achemical engineering senior at Manhattan College\u2014conducted\na double pipe heat exchanger experiment in the Unit Operations Laboratory. Some of the\nTable 15.4 Wilson Method Information: Illustrative Example 15.18\nRun l/Uo Ao, \u00b0F.h/Btu T, \u00b0F Average temperature l/V, h/ft\n1 1.2176 x 10^-3 124.5 2.29 x 10^-4\n2 0.9454 x 10^-3 125 1.65 x 10^-4\n3 0.9366 x 10^-3 129 1.29 x 10^-4\n4 0.8618 x 10^-3 121.5 1.117 x 10^-4\n5 0.7966 x 10^-3 122 0.962 x 10^-4\nco-current flow data and calculations submitted are presented in Table 15.4. Employing\nAndrew\u2019s data and Wilson\u2019s method, estimate ho for the exchanger fluid. For this lab unit\n(see Figure 15.1), Ao = 1.85 ft^2.\n'''\n\n#Variable declaration:\nAo = 1.85 #Area of heat exchanger (ft^2)\n\n#Calculation:\n#From figure 15.6:\ny = 0.560*10**-3 #Intercept 1/UoAo (\u00b0F.h/Btu)\nho = 1.0/(Ao*y) #Thermal conductivity for heat exchanger (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"Thermal conductivity for the heat exchanger is :\",round(ho),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Thermal conductivity for the heat exchanger is : 965.0 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.19, Page number: 310"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Another experiment(11) on the double pipe heat exchanger in the Unit Operation Laboratory at\nManhattan College produced the following data and calculated results for U (overall heat transfer\ncoefficient) and m\u02d9C (inside cold water flow rate); see Table 15.5.\nTable 15.5 Wilson Experiment Data and Results\nU, Btu/h.ft^2.\u00b0F m\u02d9C, lb/h m_C^-0.8\n687.98 500.97 144.49\n740.74 1001.94 251.58\n748.10 1502.90 347.97\n757.08 2003.87 438.02\n756.31 2204.26 472.73\nUsing the Wilson method, estimate the outside fluid film coefficient. Once again, neglect the\neffects of scale and pipe wall.\n'''\n\n#Variable declaration:\n#From figure 15.7:\na = 0.00126\nb = 0.0276\n\n#Calculation:\nho = 1.0/a #The value of ho (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"Thermal conductivity is :\",round(ho),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Thermal conductivity is : 794.0 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.20, Page number: 311"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous illustrative example. Perform the same calculation but include the resistance\nassociated with the tube (Admiralty metal) if the inside and outside diameters are 1.00 and\n0.902 in, respectively; k for the tube is 60 Btu/h.ft^2.\u00b0F.\nTable 15.6 Wilson Experiment Data and Results\nU, Btu/h.ft^2.\u00b0F 1/U, h.ft^2.\u00b0F m\u02d9C, lb/h m_C^0.8 m_C^-0.8\n687.98 0.0014535 500.97 144.49 0.00692071\n740.74 0.00135 1001.94 251.58 0.003974904\n748.10 0.0013367 1502.90 347.97 0.002873796\n757.08 0.0013209 2003.87 438.02 0.002282992\n756.31 0.0013222 2204.26 472.73 0.002115387\n'''\n\n#Variable declaration:\nDi = 0.902/12.0 #Inside diameter of tube (ft)\nDo = 1.0/12.0 #Outside diameter of tube (ft)\nk = 60.0 #Thermal conductivity of tube (Btu/h.ft^2.\u00b0F) \n\n#Calculation:\n#From example 15.19:\na = 0.00126\nDr = (Do - Di)/2.0 #Radial thickness of tube wall (ft)\nRw = Dr/k #Resistance of wall (Btu/h.\u00b0F)\nho = 1.0/(a-Rw) #The revised ho (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The revised ho is :\",round(ho),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The revised ho is : 839.0 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 15.21, Page number: 312"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Data from experiments based on Wilson\u2019s method produced the following results.\nClean tube:\n1/Uclean = 0.00044 + 0.0050/(m\u02d9)0.8\n\nTube with scale:\n1/Udirty = 0.00089 +0.0050/(m\u02d9)0.8\nCalculate the scale film coefficient if the wall resistance can be neglected.\n'''\n\n#Variable declaration:\na1 = 0.00044 #Term 'a' for U_clean\na2 = 0.00089 #Term 'a' for U_dirty\n\n#Calculation:\nRs = a2 - a1 #Resistance associated with the scale\nhs = 1.0/Rs #Scale film coefficient (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The scale film coefficient neglecting the wall resistance is:\",round(hs),\" Btu/h.ft^2.\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The scale film coefficient neglecting the wall resistance is: 2222.0 Btu/h.ft^2.\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_16.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_16.ipynb
new file mode 100644
index 00000000..ed13cc7c
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_16.ipynb
@@ -0,0 +1,230 @@
+{
+ "metadata": {
+ "name": "Chapter 16"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 16: Shell and Tube Heat Exchangers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.5, Page number: 334"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider the shell and tube heat exchanger in Figure 16.13. Calculate the log mean temperature\ndriving force. Also perform the calculation for the exchanger described in Figure 16.14.\n'''\n\nfrom math import log\n\n#Variable declaration:\n#From figure 16.13, for ideal countercurrent heat exchanger:\nT1 = 150.0 #Inlet temperature of hot fluid (\u00b0F)\nT2 = 100.0 #Outet temperature of hot fluid (\u00b0F)\nt1 = 50.0 #Inlet temperature of cold fluid (\u00b0F)\nt2 = 80.0 #Outet temperature of hot fluid (\u00b0F)\n#From figure 16.14, for shell and tube exchanger:\nT_1 = 50.0 #Inlet temperature of cold fluid (\u00b0F)\nT_2 = 80.0 #Outet temperature of hot fluid (\u00b0F)\nt_1 = 150.0 #Inlet temperature of hot fluid (\u00b0F)\nt_2 = 100.0 #Outet temperature of hot fluid (\u00b0F)\n\n#Calculation:\nDT1 = T1 - t2 #Temperature driving force 1 (\u00b0F)\nDT2 = T2 - t1 #Temperature driving force 1 (\u00b0F)\nDTlm1 = ((DT1-DT2)/log(DT1/DT2)) #Log mean temperature driving force for ideal countercurrent heat exchanger (\u00b0F)\nP = (t2-t1)/(T1 - t1) #Dimensionless ratio P\nR = (T1-T2)/(t2-t1) #Dimensionless ratio R\n#From figure 16.7:\nF = 0.925 #Correction Factor\nDTlm2 = F*DTlm1 #Log mean temperature driving force for shell and tube exchanger (\u00b0F)\n\n#Result:\nprint \"The log mean temperature difference for ideal system is :\",round(DTlm1,1),\" \u00b0F .\"\nprint \"The log mean temperature difference for real system is :\",round(DTlm2,2),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The log mean temperature difference for ideal system is : 59.4 \u00b0F .\nThe log mean temperature difference for real system is : 54.98 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.6, Page number: 335"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A shell and tube heat exchanger having two shell passes and four tube passes is being used\nfor cooling. The shell-side fluid enters at 400\u00b0F and leaves at 250\u00b0F and the tube-side fluid\nenters at 100\u00b0F and leaves at 175\u00b0F. What is the log mean temperature difference between the\nhot fluid and the cold fluid?\n'''\n\nfrom math import log\n5\n#Variable declaration:\nT1 = 400.0 #Temperature of fluid entering the shell (\u00b0F)\nT2 = 250.0 #Temperature of fluid leaving the shell (\u00b0F)\nt1 = 100.0 #Temperature of fluid entering the tube (\u00b0F)\nt2 = 175.0 #Temperature of fluid leaving the tube (\u00b0F)\n\n#Calculation:\nDT1 = T1 - T2 #Temperature driving force 1 (\u00b0F)\nDT2 = t2 - t1 #Temperature driving force 1 (\u00b0F)\nDTlm1 = ((DT1-DT2)/log(DT1/DT2)) #Log mean temperature driving force for ideal countercurrent heat exchanger (\u00b0F)\nP = (t2-t1)/(T1 - t1) #Dimensionless ratio P\nR = (T1-T2)/(t2-t1) #Dimensionless ratio R\n#From figure 16.8:\nF = 0.985 #Correction factor\nDTlm2 = F*DTlm1 #Log mean temperature driving force for shell and tube exchanger (\u00b0F)\n\n#Result:\nprint \"The log mean temperature difference between the hot fluid and the cold fluid is :\",round(DTlm2,1),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The log mean temperature difference between the hot fluid and the cold fluid is : 106.6 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.7, Page number: 336"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Recalculate the results of the two previous examples using the equation upon which the graphs\nare based.\n'''\n#Variable declaration:\n#From example 16.5:\nP1 = 0.30 #Dimensionless ratio P\nR1 = 1.67 #Dimensionless ratio R\n#From example 16.6:\nP2 = 0.30 #Dimensionless ratio P\nR2 = 1.67 #Dimensionless ratio R\n\n#Calculation:\n#Applying Equation 16.27:\nF1 = 0.92 #Correction Factor\n#Applying Equation 16.33:\nF2 = 0.985 #Correction Factor\n#From example 16.6:\nLMTD1 = 59.4 #Log mean temperature driving force 1 for ideal countercurrent heat exchanger (\u00b0F)\nLMTD2 = 108.0 #Log mean temperature driving force 2 for ideal countercurrent heat exchanger (\u00b0F)\nDTlm1 = F1*LMTD1 #Log mean temperature driving force 1 for shell and tube exchanger (\u00b0F)\nDTlm2 = F2*LMTD2 #Log mean temperature driving force 2 for shell and tube exchanger (\u00b0F)\n\n#Result:\nprint \"The log mean temperature difference for real system (in example 16.5) is :\",round(DTlm1,2),\" \u00b0F .\"\nprint \"The log mean temperature difference for real system (in example 16.6) is :\",round(DTlm2,1),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The log mean temperature difference for real system (in example 16.5) is : 54.65 \u00b0F .\nThe log mean temperature difference for real system (in example 16.6) is : 106.4 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.8, Page number: 337"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A shell and tube heat exchanger has one pass on the shell side and two passes on the tube side\n(i.e., a 1\u20132 shell and tube heat exchanger). It is being used for oil cooling. The oil flows in the\ntube side. It enters at 110\u00b0C and leaves at 75\u00b0C. The shell-side fluid is water at a flowrate of 1.133\nkg/s, entering at 35\u00b0C and leaving at 75\u00b0C. The heat capacity of the water is 4180 J/kg.K. The\noverall heat-transfer coefficient for the heat exchanger is 350W/m^2.K. The geometry factor F\nhas been previously estimated to be 0.965. Calculate the heat-transfer area requirement for this\nunit in square meters.(9)\n'''\n\nfrom math import log\n\n#Variable declaration:\nt2 = 75.0 #Temperature of water leaving the shell (\u00b0C)\nt1 = 35.0 #Temperature of water enteringing the shell (\u00b0C)\nT2 = 75.0 #Temperature of oil leaving the tube (\u00b0C)\nT1 = 110.0 #Temperature of oil entering the tube (\u00b0C)\nm = 1.133 #Mass flowrate of water (kg/s)\ncp = 4180.0 #Heat capacity of water (J/kg.K)\nF = 0.965 #Correction factor\nU = 350.0 #Overall heat transfer coefficient (W/m^2.K)\n\n#Calculation:\nQ = m*cp*(t2-t1) #Heat load (W)\nDT1 = T1-t2 #Temperature driving force 1 (\u00b0C)\nDT2 = T2-t1 #Temperature driving force 2 (\u00b0C)\nDTlm1 = (DT1-DT2)/log(DT1/DT2)+273.0 #Countercurrent log-mean temperature difference (K)\nDTlm2 = F*DTlm1 #Corrected log-mean temperature difference (K)\nA = Q/(U*DTlm2) #Required heat transfer area (m^2)\n\n#Result:\nprint \"The required heat-transfer area is :\",round(A,3),\" m^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required heat-transfer area is : 1.807 m^2 .\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.10, Page number: 338"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A shell and tube heat exchanger is to be designed for heating 10,000 kg/h of water from 16 \u00b0C to\n84 \u00b0C by a new high heat capacity hot engine oil flowing through the shell. The oil makes a single\nshell pass, entering at 160 \u00b0C and leaving at 94 \u00b0C. Thewater flows through 11 brass tubes of 22.9\nmm inside diameter and 25.4 mm outside diameter with each tube making four passes through\nthe shell. The overall heat transfer coefficient (including the fouling resistance effect) is approximately\n350 W/m^2.\u00b0C and the thermal conductivity of brass is 137 W/m.\u00b0C. Calculate\n1. the heat load, in MW,\n2. the countercurrent flow log mean temperature difference, and\n3. the F correction factor and the corrected log mean temperature difference.\n'''\n\nfrom math import log\n\n#Variable declaration:\nt2 = 84.0 #Temperature of water leaving the tube (\u00b0C)\nt1 = 16.0 #Temperature of water entering the tube (\u00b0C)\nm1 = 10000.0/3600.0 #Mass flowrate of water (kg/s)\nT2 = 94.0 #Temperature of oil leaving the shell (\u00b0C)\nT1 = 160.0 #Temperature of oil entering the shell (\u00b0C)\n\n#Calculation:\nTw = (t1+t2)/2.0 #Average bulk temperature of water (\u00b0C)\nTo = (T1+T2)/2.0 #Average bulk temperature of oil (\u00b0C)\n#From table 16.1:\np1 = 987.0 #Density of water (kg/m^3)\ncp1 = 4176.0 #Heat capacity of water (J/kg.\u00b0C)\np2 = 822.0 #Density of oil (kg/m^3)\nQ = m1*cp1*(t2-t1) #Heat load (W)\ncp2 = 4820.0 #Heat capacity of oil (J/kg.\u00b0C)\nm2 = Q/(cp2*(T1-T2)) #Mass flowrate of oil (kg/s)\nDT1 = T2-t1 #Temperature driving force 1 (\u00b0C)\nDT2 = T1-t2 #Temperature driving force 2 (\u00b0C)\nDTlm1 = ((DT1-DT2)/log(DT1/DT2)) #Log mean temperature driving force for ideal countercurrent heat exchanger (\u00b0C)\nP = (t2-t1)/(T1 - t1) #Dimensionless ratio P\nR = (T1-T2)/(t2-t1) #Dimensionless ratio R\n#From figure 16.7:\nF = 0.965 #Correction factor\nDTlm2 = F*DTlm1 #Log mean temperature driving force for 1-4 shell and tube exchanger (\u00b0C)\n\n#Result:\nprint \"1. The heat load is :\",round(Q/10**6,3),\" MW .\"\nprint \"2. The countercurrent flow log mean temperature difference is :\",round(DTlm1),\" \u00b0C .\"\nprint \"3. The F correction factor and the corrected log mean temperature difference is :\",round(DTlm2,1),\" \u00b0C .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The heat load is : 0.789 MW .\n2. The countercurrent flow log mean temperature difference is : 77.0 \u00b0C .\n3. The F correction factor and the corrected log mean temperature difference is : 74.3 \u00b0C .\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.11, Page number: 340"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous example. Calculate the area and the length of the tubes required for this\nheat exchanger.\n'''\n\nfrom math import pi\n\n#Variable declaration:\n#From example 16.10:\nU = 350.0 #Over all heat transfer coefficient (W/m^2.\u00b0C)\nDTlm = 74.3 #Log mean temperature driving force for 1-4 shell and tube exchanger (\u00b0C)\nQ = 788800.0 #Heat load (W)\nNt = 11.0 #Number of tubes per pass\nNp = 4.0 #Number of passes\nDi = 0.0229 #Inside diameter of tube (m)\n\n#Calculation:\nA = Q/(U*DTlm) #Heat transfer area required for heat exchanger (m^2)\nN = Nt*Np #Total number of tubes\nL = A/(pi*Di*N) #Tube length (m)\n\n#Result:\nprint \"The heat transfer area required for the heat exchanger is :\",round(A,2),\" m^2 .\"\nprint \"The length of the tubes required for the heat exchanger is :\",round(L*3.28,1),\" ft .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer area required for the heat exchanger is : 30.33 m^2 .\nThe length of the tubes required for the heat exchanger is : 31.4 ft .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.18, Page number: 349"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 16.10. Determine the effectiveness and number of transfer units.'''\n\n#Variable declaration:\n#From example 16.10:\nm1 = 2.778 #Mass flowrate of water (kg/s)\ncp1 = 4176.0 #Heat capacity of water (J/kg.\u00b0C)\ncp2 = 4820.0 #Heat capacity of oil (J/kg.\u00b0C)\nm2 = 2.48 #Mass flowrate of oil (kg/s)\nt2 = 84.0 #Temperature of water leaving the tube (\u00b0C)\nt1 = 16.0 #Temperature of water entering the tube (\u00b0C)\nT2 = 94.0 #Temperature of oil leaving the shell (\u00b0C)\nT1 = 160.0 #Temperature of oil entering the shell (\u00b0C)\nU = 350.0 #Over all heat transfer coefficient (W/m^2.\u00b0C)\nA = 30.33 #Heat transfer area required for heat exchanger (m^2)\n\n#Calculation:\nC1 = m1*cp1 #Capacitance rate of water (W/\u00b0C)\nC2 = m2*cp2 #Capacitance rate of oil (W/\u00b0C)\nQ = C1*(t2-t1) #Heat load of water (W)\nQmax = C1*(T1-t1) #Maximum heat load of water (W)\nE = Q/Qmax #Effectiveness\nif (C1<C2):\n Cmin = C1 #Minimum capacitance rate (W/\u00b0C)\n Cmax = C2 #Maximum capacitance rate (W/\u00b0C)\nelse:\n Cmin = C2 #Minimum capacitance rate (W/\u00b0C)\n Cmax = C1 #Maximum capacitance rate (W/\u00b0C)\nNTU = U*A/Cmin #Number of transfer units\nC = Cmin/Cmax #Capacitance rate ratio\n\n#Result:\nprint \"The effectiveness is :\",round(E,3),\".\"\nprint \"The number of transfer units is :\",round(NTU,3),\".\"\nprint \"The capacitance rate ratio is :\",round(C,3),\".\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The effectiveness is : 0.472 .\nThe number of transfer units is : 0.915 .\nThe capacitance rate ratio is : 0.97 .\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.19, Page number: 351"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The feedwater heater for a boiler supplies 10,000 kg/h of water at 65\u00b0C. The raw feedwater\nenters the tubes with an inlet temperature of 20\u00b0C and is to be heated in a single-shell, twotube\npass heat exchanger by condensing steam at 1.30 bars. Water is on the tube side and\nsteam is on the shell side. The overall heat transfer coefficient is 2000W/m^2.K. Determine\nthe required heat transfer area for the exchanger. Use both the LMTD method and the E-NTU\napproach to obtain the results.\n'''\n\nfrom math import log\n\n#Variable declaration:\n#From table 16.4:\nCw = 11680.3 #Capacitance rate of water (W/\u00b0C)\nt2 = 65.0 #Temperature of water leaving the tube (\u00b0C)\nt1 = 20.0 #Temperature of water entering the tube (\u00b0C)\nT2 = 107.3 #Temperature of steam leaving the shell (\u00b0C)\nT1 = 107.3 #Temperature of steam entering the shell (\u00b0C)\nhv = 2.238*10**6 #Latenet heat of condensation for steam (J/kg)\nU = 2000.0 #Overall heat transfer coefficient (W/m^2.\u00b0C)\n\n#Calculation:\nQ = Cw*(t2-t1) #Heat load (W)\nm2 = Q/hv #Steam condensation rate (kg/s)\nDT1 = T2-t1 #Temperature driving force 1 (\u00b0C)\nDT2 = T1-t2 #Temperature driving force 2 (\u00b0C)\nDTlm1 = ((DT1-DT2)/log(DT1/DT2)) #Log mean temperature driving force for ideal countercurrent heat exchanger (\u00b0C)\nF = 1.0 #Correction factor (since, T2 = T1)\nDTlm2 = F*DTlm1 #Log mean temperature driving force for shell and tube exchanger (\u00b0C)\nA1 = Q/(U*DTlm2) #Heat transfer area using LMTD method (m^2)\nE = (t2-t1)/(T1-t1) #Effectiveness\n#From figure 16.18:\nNTU = 0.7 #Number of transfer units\nA2 = (NTU*Cw)/U #Heat transfer area using E-NTU method (m^2)\n\n#Result:\nprint \"The heat transfr area for the exchanger (using LMTD method) is :\",round(A1,2),\" m^2 .\"\nprint \"The heat transfr area for the exchanger (using E-NTU method) is :\",round(A2,1),\" m^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfr area for the exchanger (using LMTD method) is : 4.23 m^2 .\nThe heat transfr area for the exchanger (using E-NTU method) is : 4.1 m^2 .\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.21, Page number: 353"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A shell and tube heat exchanger has one pass on the shell side and two passes on the tube side\n(i.e., 1\u20132 shell and tube heat exchanger). It is being used for oil cooling. The oil flows in the\ntube side. It enters at 110\u00b0C and leaves at 75\u00b0C. The shell-side fluid is water at a flow rate of\n1.133 kg/s, entering at 35\u00b0C and leaving at 75\u00b0C. The oil flows in the tubes at an average\nvelocity of 0.3 m/s. The tube inside diameter is 3/4 inch or 0.01905 m. The overall heat transfer\ncoefficient for a clean heat exchanger is 350W/m^2.K. The fouling factor, Rf, is 0.00027 m2 .\nK/W. The oil properties are: p_oil = 850 kg/m3 and c_oil = 1900 J/kg.K. Calculate:\n1. the mass flow rate of the oil\n2. the minimum and maximum heat capacity rate\n3. the heat load, Q\u02d9\n4. the total number of tubes\n5. the tube length.\n'''\n\nfrom math import pi,log\n\n#Variable declaration:\n#From table 16.5:\nt2 = 75.0 #Temperature of water leaving the shell (\u00b0C)\nt1 = 35.0 #Temperature of water entering the shell (\u00b0C\nT2 = 75.0 #Temperature of oil leaving the tube (\u00b0C)\nT1 = 110.0 #Temperature of oil entering the tube (\u00b0C)\nmw = 1.133 #Mass flowrtae of water (kg/s)\ncpw = 4180.0 #Heat capacity of water (J/kg.K)\ncpo = 1900.0 #Heat capacity of oil (J/kg.K)\np = 850.0 #Density of oil (kg/m^3)\nDi = 0.01905 #Inside diameter of tube (m)\nV = 0.3 #Average velocity of oil flow inside the tube (m/s)\nNp = 2.0 #Number of passes\nUc = 350.0 #Overall heat transfer coefficient for clean heat exchanger (W/m^2)\nRf = 0.00027 #Fouling factor (m^2.K/w)\n\n#Calculation:\nCw = mw*cpw #Water capacitance rate (W/K)\nQ = Cw*(t2-t1) #Heat load (W)\nCo = Q/(T1-T2) #Oil capacitance rate (W/K)\nmo = Co/cpo #Total flowrate of oil (kg/s)\nif (Cw<Co):\n Cmin = Cw #Minimum capacitance rate (W/K)\n Cmax = Co #Maximum capacitance rate (W/K)\nelse:\n Cmin = Co #Minimum capacitance rate (W/K)\n Cmax = Cw #Maximum capacitance rate (W/K)\nm_ot = p*V*(pi/4.0)*Di**2 #Oil flowrate per tube (kg/s)\nNt = mo/m_ot #Number of tubes per pass\nN = Nt*Np #Number of tubes\nDT1 = T2-t1 #Temperature driving force 1 (\u00b0C)\nDT2 = T1-t2 #Temperature driving force 2 (\u00b0C)\nDTlm1 = ((DT1-DT2)/log(DT1/DT2)) #Log mean temperature driving force for ideal countercurrent heat exchanger (\u00b0C)\nP = (t2-t1)/(T1 - t1) #Dimensionless parameter P\nR = (T1-T2)/(t2-t1) #Dimensionless parameter R\n#From figure 16.7:\nF = 0.81 #Correction factor\nDTlm2 = F*DTlm1 #Log mean temperature driving force for shell and tube exchanger (\u00b0C)\nUd = 1.0/(1.0/Uc+Rf) #Dirty overall heat transfer coefficient (W/m^2.K)\nA = Q/(Ud*DTlm2) #Required heat transfer area (m^2)\nL = A/(N*pi*Di) #Tube length (m)\n\n#Result:\nprint \"1. The mass flow rate of the oil is :\",round(mo,2),\" kg/s .\"\nprint \"2. The minimum and maximum heat capacity rate is :\",round(Cmin),\" and \",round(Cmax,1),\" W/K .\"\nprint \"3. The heat load, Q is :\",round(Q),\" W .\"\nprint \"4. The total number of tubes is :\",round(N,-1),\".\"\nprint \"5. The tube length is :\",round(L,1),\" m .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The mass flow rate of the oil is : 2.85 kg/s .\n2. The minimum and maximum heat capacity rate is : 4736.0 and 5412.5 W/K .\n3. The heat load, Q is : 189438.0 W .\n4. The total number of tubes is : 80.0 .\n5. The tube length is : 4.2 m .\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 16.22, Page number: 356"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Determine the effectiveness and NTU for the previous example.'''\n\n#Variable declaration:\n#From example 16.22:\nt2 = 75.0 #Temperature of water leaving the shell (\u00b0F)\nt1 = 35.0 #Temperature of water entering the shell (\u00b0F)\nT2 = 75.0 #Temperature of oil leaving the tube (\u00b0F)\nT1 = 110.0 #Temperature of oil entering the tube (\u00b0F)\nU = 320.0 #Overall heat transfer coefficient (W/m^2.K)\nA = 19.5 #Required heat transfer area (m^2)\nCmin = 4736.0 #Minimum capacitance rate (W/K)\n\n#Calculation:\nDT1 = t2-t1 #Actual water temperature change (\u00b0F)\nDT2 = T1 - t1 #Maximum water temperature change (\u00b0F)\nE = DT1/DT2 #Effectiveness\nNTU = (U*A)/Cmin #Number of transfer units\n\n#Result:\nprint \"The effectiveness is :\",round(E,3),\".\"\nprint \"The NTU is :\",round(NTU,3),\".\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The effectiveness is : 0.533 .\nThe NTU is : 1.318 .\n"
+ }
+ ],
+ "prompt_number": 22
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_17.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_17.ipynb
new file mode 100644
index 00000000..16924e48
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_17.ipynb
@@ -0,0 +1,335 @@
+{
+ "metadata": {
+ "name": "Chapter 17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 17: Fins and Extended Surfaces"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.1, Page number: 358"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider the longitudinal (rectangular) fin pictured in Figure 17.1. Estimate the fin face area,\nneglecting the (top) area contribution associated with the fin thickness if w = 1 ft and L =\n1.5 in. The fin thickness is 0.1 in. Also calculate the total area of the fin.\n'''\n\n#Variable declaration:\nw1 = 1.5 #Thicknessof fin (in)\nL = 12.0 #Length of fin (in)\nw2 = 0.1 #Thickness of fin(in)\n\n#Calculation:\nAf = 2*w1*L #Face area of fin (in^2)\nAt = Af + L*w2 #Total area of fin (in^2)\n\n#Result:\nprint \"The face area of the fin is :\",round(Af),\" in^2 .\"\nprint \"The face area of the fin is :\",round(Af/12**2,2),\" ft^2 .\"\nprint \"The total area of the fin is :\",round(At,1),\" in^2 .\"\nprint \"The total area of the fin is :\",round(At/12**2,3),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The face area of the fin is : 36.0 in^2 .\nThe face area of the fin is : 0.25 ft^2 .\nThe total area of the fin is : 37.2 in^2 .\nThe total area of the fin is : 0.258 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.3, Page number: 359"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Figure 17.2. Estimate the fin area, neglecting the area contribution associated with the\nfin thickness if r0 = 4.0 in, rf = 6.0 in, and t = 0.1 in.\n'''\n\nfrom math import pi\n\n#Variable declaration:\nrf = 6.0/12.0 #Outside radius of fin (ft)\nro = 4.0/12.0 #Outside radius of pipe (ft)\nt = 0.1/12.0 #Thickness of fin (ft)\n\n#Calculation:\nAf = 2*pi*(rf**2-ro**2) #Face area of fin (ft^2)\nAt = Af + 2*pi*rf*t #Total area of fin (ft^2)\n\n#Result:\nprint \"The total fin area is :\",round(At,3),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total fin area is : 0.899 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.4, Page number: 364"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following information is provided for a straight rectangular fin: h = 15 W/m^2.K,\nk = 300 W/m.K, L = 3 in, and t = 1 in. Estimate the fin efficiency.\n'''\n\nfrom math import sqrt\n\n#Variable declaration:\nL = 3.0*0.0254 #Height of fin (m)\nt = 1.0*0.0254 #Thickness of fin (m)\nh = 15.0 #Heat transfer coefficient (W/m^2.K)\nk = 300.0 #Thermal conductivity (W/m.K)\n\n#Calculation:\nLc = L + t/2.0 #Corrected height of fin (m)\nAp = Lc*t #Profile area of fin (m^2)\nx = sqrt((Lc**3*h)/(k*Ap)) #x-coordinate of figure 17.3\n#From figure 17.3:\nnf = 98.0 #Fin efficiency\n\n#Result:\nprint \"The fin efficiency is :\",nf,\"% .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fin efficiency is : 98.0 % .\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.5, Page number: 365"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Estimate the fin efficiency in the previous example using the equation developed by\nBarkwill et al.(3)\n'''\n\n#Variable declaration:\n#From example 17.4:\nX = 0.1246 #X-coordinate of figure 17.3\n\n#Calculation:\n#Applying equation (A) from Table 17.3:\nY = 4.5128*X**3 - 10.079*X**2 - 31.413*X + 101.47\n\n#Result:\nprint \"The fin efficiency is :\",round(Y,1),\"% .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fin efficiency is : 97.4 % .\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.6, Page number: 365"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A set of micro-fins is designed to cool an electronic circuit. Each micro-fin has a square\ncross-section of 0.2 cm by 0.2 cm and a length of 1 cm. The conductivity of the fin material\nis 400 W/m.K and the air heat transfer coefficient is 16 W/m^2.K. The circuit temperature\nis 100\u00b0C and the air temperature is 25\u00b0C. Calculate the heat transfer from each micro-fin in W.\n'''\n\nfrom math import sqrt,atan\n\n#Variable declaration:\nw = 0.2/100.0 #Width of fin (m)\nt = 0.2/100.0 #Thickness of fin (m)\nL = 1.0/100.0 #Length of fin (m)\nh = 16.0 #Heat transfer coefficient (W/m^2.K)\nk = 400.0 #Thermal conductivity of fin (W/m.K)\nTc = 100.0 #Circuit temperature (\u00b0C)\nTa = 25.0 #Air temperature (\u00b0C)\n\n#Calculation:\nP = 4*w #Fin cross-section parameter (m)\nAc = w*t #Cross-sectional area of fin (m^2)\nLc = L+Ac/P #Corrected height of fin (m)\nm = sqrt((h*P)/(k*Ac)) #Location of minimum temperature (m^-1)\nQ = (sqrt(h*P*k*Ac))*(Tc-Ta)*atan(h)*(m*Lc) #Heat transfer from each micro-fin (W)\n\n#Result:\nprint \"The heat transfer from each micro-fin is :\",round(Q,2),\" W .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer from each micro-fin is : 0.15 W .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.8, Page number: 366"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Air and water are separated by a 1.5 mm plane wall made of steel (k = 38 W/m.K; density, r =\n7753 kg/m^3; heat capacity, cp = 486 J/kg.K). The air temperature, T4, is 19\u00b0C, and the water\ntemperature, T4, is 83\u00b0C. Denote the temperature at the air\u2013wall interface T1 and let T3 be the\ntemperature at the wall\u2013water interface. The air-side heat transfer coefficient, h1, is 13 W/m^2.K\nand the water side heat transfer coefficient, h3, is 260 W/m^2.K. Assume an area of the wall that\nis 1 m high and 1 m wide as a basis.\n1. Show whether the conduction resistance may be neglected.\n2. What is the rate of heat transfer from water to air?\nTo increase the rate of heat transfer, it is proposed to add steel fins to the wall. These straight\nrectangular steel fins will be 2.5 cm long, 1.3 mm thick, and will be spaced such that the fin\npitch, S, is 1.3 cm between centers.\n3. Calculate the percent increase in steady-state heat transfer rate that can be realized by\nadding fins to the air side of the plane wall.\n4. Calculate the percent increase in steady-state heat transfer rate that can be realized by\nadding fins to the water side of the plane wall.\n'''\nfrom __future__ import division\nfrom math import sqrt\n#Variable declaration:\nh1 = 13.0 #Air-side heat transfer coefficient (W/m^2.K)\nA = 1.0 #Base wall area (m^2)\nL = 2.5/100 #Length of steel fins (m)\nL2 = 1.5/10**3 #Length of steel wall (m)\nk = 13.0 #Thermal conductivity of fin (W/m.K)\nk1 = 38.0 #Thermal conductivity of steel wall (W/m.K)\nh2 = 260.0 #Water side heat transfer coefficient (W/m^2.K)\nT4 = 19.0 #Air temperature (\u00b0C)\nT1 = 83.0 #Water temperature (\u00b0C)\nt = 1.3/10**3 #Thickness of steel fins (m)\nw = 1.0 #Width of wall (m)\nS = 1.3/100 #Fin pitch(m)\n\n#Calculation:\nR1 = 1/(h1*A) #Air resistance (\u00b0C/W) (part 1)\nR2 = L2/(k1*A) #Conduction resistance (\u00b0C/W)\nR3 = 1/(h2*A) #Water resistance (\u00b0C/W)\nRt = (R1+R3) #Total resistance (\u00b0C/W) (part 2)\nQ = (T1-T4)/Rt #Total heat transfer (W)\nNf = 1/S #Number of fins (part 3)\nLbe = w - Nf*t #Unfinned exposed base surface\nAbe = w*Lbe #Exposed base surface area (m^2)\nLc = L+t/2 #Corrected length (m)\nAp = Lc*t #Profile area (m^2)\nAf = 2*w*Lc #Fin surface area (m^2)\nBi = h1*(t/2)/k1 #Biot number\na = sqrt(Lc**3*h1/(k*Ap)) #Abscissa of the fin efficiency\n#From figure 17.3:\nnf = 0.88 #Fin efficiency\nRb = 1/(h1*Abe) #Air thermal resistance of base wall (\u00b0C/W)\nRf = 1/(h1*Nf*Af*nf) #Air thermal resistance of fins (\u00b0C/W)\nRT1 = 1/(1/Rb+1/Rf) #Total outside resistance of the fin array (\u00b0C/W)\nRt3 = RT1+R3 #Total resistance on air side fins (\u00b0C/W)\nQt = (T1-T4)/round(Rt3,5) #Heat transfer rate on air side fins (W)\nI = (Qt/Q - 1)*100 #Percent increase in heat transfer rate to air side fins (W)\nA = sqrt(Lc**3*h2/(k1*Ap)) #Abscissa of the new fin efficiency (part 4)\n#From figure 17.3:\nnf2 = 38.0 #New fin efficiency\nRb2 = 1/(h2*Abe) #Thermal resistance of base wall (\u00b0C/W)\nRf2 = 1/(h2*Nf*Af*nf2) #Thermal resistance of fins (\u00b0C/W)\nRt4 = 1/(1/Rb2+1/Rf2) #Total resistance of the finned surface (\u00b0C/W)\nRt5 = R1+Rt4 #Total resistance on water side fins (\u00b0C/W)\nQT1 = (T1-T4)/Rt5 #Heat transfer rate on water side fins (W)\nI2 = (QT1/Q - 1)*100 #Percent increase in heat transfer rate to water side fins (W)\n\n#Result:\nif (R2<R1 or R2<R3):\n print \"1. The conduction resistance may be neglected.\"\nelse:\n print \"1. The conduction resistance can not be neglected.\"\nprint \"2. The rate of heat transfer from water to air is :\",round(Q,1),\" W .\"\nprint \"3. The percent increase in steady-state heat transfer rate by adding fins to the air side of the plane wall is :\",round(I,1),\" % .\"\nprint \"4. The percent increase in steady-state heat transfer rate by adding fins to the water side of the plane wall is :\",round(I2,1),\" % .\"\nprint \"____There is a calculation mistake in book in calculating Qt(83-19/0.0214 = 2999), hence slight differences in answer______\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The conduction resistance may be neglected.\n2. The rate of heat transfer from water to air is : 792.4 W .\n3. The percent increase in steady-state heat transfer rate by adding fins to the air side of the plane wall is : 276.7 % .\n4. The percent increase in steady-state heat transfer rate by adding fins to the water side of the plane wall is : 5.0 % .\n____There is a calculation mistake in book in calculating Qt(83-19/0.0214 = 2999), hence slight differences in answer______\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.10, Page number: 369"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A circular tube has an outside diameter of 2.5 cm and a surface tempeature, Tb, of 170\u00b0C. An\nannular aluminum fin of rectangular profile is attached to the tube. The fin has an outside\nradius, rf, of 2.75 cm, a thickness, t, of 1 mm, and a thermal conductivity, k, of 200 W/m . K.\nThe surrounding fluid is at a temperature Too = 25\u00b0C and the associated heat transfer coefficient,\nh, is 130 W/m^2.K. Calculate the heat transfer rate without the fin,Q\u02d9w/o,f, the corrected\nlength, Lc, the outer radius, r2c, the maximum heat transfer rate from the fin,Q\u02d9f,max, the fin efficiency,\nhf, the fin heat transfer rate, qf, and the fin thermal resistance, Rt,f.\n'''\n\nfrom __future__ import division\nfrom math import pi,sqrt\n\n#Variable declaration:\nDo = 2.5/100 #Outside diameter of tube (m)\nt = 1/10**3 #Thickness of fin (m)\nT = 25 #Fluid temperature (\u00b0C)\nTb = 170 #Surface temperature (\u00b0C)\nh = 130 #Heat transfer coefficient (W/m^2.K)\nk = 200 #Thermal conductivity of fin (W/m.K)\nrf = 2.75/100 #Outside radius of fin (m)\n\n#Calculation:\nro = Do/2 #Radius of tube (m)\nAb = 2*pi*ro*t #Area of the base of the fin (m^2)\nTe = Tb-T #Excess temperature at the base of the fin (K)\nQ1 = h*Ab*Te #Total heat transfer rate without the fin (W)\nBi = h*(t/2)/k #Biot number\nL = rf-ro #Fin height (m)\nrc = rf+t/2 #Corrected radius (m)\nLc = L+t/2 #Corrected height (m)\nAp = Lc*t #Profile area (m^2)\nAf = 2*pi*(rc**2-ro**2) #Fin surface area (m^2)\nQm = h*Af*Te #Maximum fin heat transfer rate (W)\nA = sqrt(Lc**3*h/(k*Ap)) #Abscissa of fin efficiency\nC = rf/ro #Curve parameter of fin efficiency\n#From figure 17.4:\nnf = 0.86 #Fin efficiency\nQf = nf*Qm #Fin heat transfer rate (W)\nR = Te/Qf #Fin resistance (K/W)\n\n#Result:\nprint \"1. The heat transfer rate without the fin is :\",round(Q1,2),\" W .\"\nprint \"Or, the heat transfer rate without the fin is :\",round(Q1*3.412),\" Btu/h .\"\nprint \"2. The corrected length is :\",round(Lc,4),\" m .\"\nprint \"3. The outer radius is :\",round(rc,3),\" m .\"\nprint \"4. The maximum heat transfer rate from the fin is :\",round(Qm,2),\" W .\" \nprint \"5. The fin efficiency is :\",round(nf*100),\" % .\" \nprint \"6. The fin heat transfer rate is :\",round(Qf),\" W .\"\nprint \"Or, the fin heat transfer rate is :\",round(Qf*3.412),\" Btu/h .\"\nprint \"7. The fin thermal resistance is :\",round(R,2),\" K/W .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The heat transfer rate without the fin is : 1.48 W .\nOr, the heat transfer rate without the fin is : 5.0 Btu/h .\n2. The corrected length is : 0.0155 m .\n3. The outer radius is : 0.028 m .\n4. The maximum heat transfer rate from the fin is : 74.35 W .\n5. The fin efficiency is : 86.0 % .\n6. The fin heat transfer rate is : 64.0 W .\nOr, the fin heat transfer rate is : 218.0 Btu/h .\n7. The fin thermal resistance is : 2.27 K/W .\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.11, Page number: 370"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 17.10. Calculate the fin effectiveness, 1f, and whether the use of\nthe fin is justified.\n'''\n\n#Variable declaration:\n#From example 17.10:\nQf = 64 #Fin heat transfer rate (W)\nQ1 = 1.48 #Total heat transfer rate without the fin (W)\n\n#Calculation:\nE = Qf/Q1 #Fin effectiveness\n\n#Result:\nprint \"The fin effectiveness is :\",round(E,1),\" .\"\nif E>2:\n print \"Hence, the use of the fin is justified.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fin effectiveness is : 43.2 .\nHence, the use of the fin is justified.\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.12, Page number: 370"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''If the tube described in Illustrative Example 17.10 had a length of one meter and fin pitch of\n10 mm, what would be the total surface area for heat transfer, the exposed tube base total\nheat transfer rate,Q\u02d9t, the overall efficiency of the surface, and the overall surface effectiveness?\nNote: This problem is an extension of Illustrative Example 17.10. The information is\nobtained from it and its solution is used in the solution of this problem.\n'''\n\nfrom __future__ import division\nfrom math import pi\n\n#Variable declaration:\nw = 1 #Length of tube (m)\nS = 10/10**3 #Fin patch (m)\n#From example 17.10:\nt = 1/10**3 #Thickness of fin (m)\nro = 0.0125 #Radius of tube (m)\nAf = 3.94*10**-3 #Fin surface area (m^2)\nTb = 145 #Excess temperature at the base of the fin (K)\nh = 130 #Heat transfer coefficient (W/m^2.K)\nQf = 64 #Fin heat transfer rate (W)\n\n#Calculation:\nNf = w/S #Number of fins in tube length\nwb = w-Nf*t #Unfinned base length (m)\nAb = 2*pi*ro*wb #Unfinned base area (m^2)\nAt =Ab+Nf*Af #Total transfer surface area (m^2)\nQt = h*(2*pi*ro*w*Tb) #Total heat rate without fins (W)\nQb = h*Ab*Tb #Heat flow rate from the exposed tube base (W)\nQft = Nf*Qf #Heat flow rate from all the fins (W)\nQt2 = Qb+Qft #Total heat flow rate (W)\nQm = h*At*Tb #Maximum heat transfer rate (W)\nno = Qt2/Qm #Overall fin efficiency\nEo = Qt2/Qt #Overall effectiveness\nRb = 1/(h*Ab) #Thermal resistance of base (K/W)\nRf = 1/(h*Nf*Af*no) #Thermal resistance of fins (K/W)\n\n#Result:\nprint \"1. The total surface area for heat transfer is :\",round(At,3),\" m^2 .\"\nprint \"2. The exposed tube base total heat transfer rate is :\",round(Qb,1),\" W .\"\nprint \"Or, the exposed tube base total heat transfer rate is :\",round(Qb*3.412),\" Btu/h .\"\nprint \"3. The overall efficiency of the surface is :\",round(no*100,1),\" % .\"\nprint \"4. The overall surface effectiveness is :\",round(Eo,2),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The total surface area for heat transfer is : 0.465 m^2 .\n2. The exposed tube base total heat transfer rate is : 1332.4 W .\nOr, the exposed tube base total heat transfer rate is : 4546.0 Btu/h .\n3. The overall efficiency of the surface is : 88.3 % .\n4. The overall surface effectiveness is : 5.22 .\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.13, Page number: 374"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Consider the case of aluminum fins of triangular profile that are attached to a plane wall with a\nsurface temperature is 250\u00b0C. The fin base thickness is 2 mm and its length is 6 mm. The system\nis in ambient air at a temperature of 20\u00b0C and the surface convection coefficient is 40W/m2 . K.\nConsider a 1 m width of a single fin. Determine:\n1. the heat transfer rate without the fin,\n2. the maximum heat transfer rate from the fin, and\n3. the fin efficiency, thermal resistance, and effectiveness.\nProperties of the aluminum may be evaluated at the average temperature, (Tb + T1)/2 =\n(250 + 20)/2 = 135\u00b0C = 408 K, where k \u2243 240 W/m.K.\n'''\n\nfrom __future__ import division\nfrom math import sqrt\n\n#Variable declaration:\nw = 1 #Width of single of fin (m)\nt = 2/10**3 #Fin base thickness (m)\nl = 6/10**3 #Fin length thickness (m)\nT1 = 250 #Surface temperature (\u00b0C)\nT2 = 20 #Ambient air temperature (\u00b0C)\nh = 40 #Surface convection coefficient (W/m^2.K)\nk = 240 #Thermal conductivity of fin (W/m.K)\n\n#Calculation:\nAb = t*w #Base area of the fin (m^2)\nTe = T1-T2 #Excess temperature at the base of the fin (K)\nQw = h*Ab*Te #Heat transfer rate without a fin (W)\nAf = 2*w*(sqrt(l**2-(t/2)**2)) #Fin surface area (m^2)\nQm = h*Af*Te #Maximum heat transfer rate (m^2)\nBi = h*(t/2)/k #Biot number\nLc = l #Corrected length (m)\nAp = l*t/2 #Profile area (m^2)\nA = sqrt((Lc**3*h)/k*Ap) #Abscissa for the fin efficiency figure\n#From figure 17.4:\nnf = 0.99 #Fin efficiency\nQf = nf*Qm #Fin heat transfer rate (W)\nR = Te/Qf #Fin thermal resistance (K/W)\nE = Qf/Qw #Fin effectiveness\n\n#Result:\nprint \"1. The heat transfer rate without the fin is :\",round(Qw,1),\" W .\"\nprint \"2. The maximum heat transfer rate from the fin is :\",round(Qm,-1),\" W .\"\nprint \"3. The fin efficiency is :\",round(nf*100),\" % .\"\nprint \" The fin thermal resistance is :\",round(R,1),\" \u00b0C/W .\"\nprint \" The fin effectiveness is :\",round(E,1),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The heat transfer rate without the fin is : 18.4 W .\n2. The maximum heat transfer rate from the fin is : 110.0 W .\n3. The fin efficiency is : 99.0 % .\n The fin thermal resistance is : 2.1 \u00b0C/W .\n The fin effectiveness is : 5.9 .\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.14, Page number: 375"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Determine whether the use of the fin is justified in the previous example.'''\n\n#Variable declaration:\n#From example 17.13:\nQf = 108.9 #Fin heat transfer rate (W)\nQw = 18.4 #Total heat transfer rate without the fin (W)\n\n#Calculation:\nE = Qf/Qw #Fin effectiveness\n\n#Result:\nprint \"The fin effectiveness is :\",round(E,2),\" .\"\nif E>2:\n print \"Hence, the use of the fin is justified.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fin effectiveness is : 5.92 .\nHence, the use of the fin is justified.\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.15, Page number: 375"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Annular aluminum fins of rectangular profile are attached to a circular tube. The outside diameter\nof the tube is 50 mm and the temperature of its outer surface is 200\u00b0C. The fins are 4 mm\nthick and have a length of 15 mm. The system is in ambient air at a temperature of 20\u00b0C and the\nsurface convection coefficient is 40 W/m^2.K. The thermal conductivity of aluminum is\n240 W/m.K. What are the efficiency, thermal resistance, effectiveness, and heat transfer rate\nof a single fin? Is the use of the fin justified?\n'''\n\nfrom __future__ import division\nfrom math import pi,sqrt\n\n#Variable declaration:\nDo = 50/10**3 #Outside diameter of tube (m)\nt = 4/10**3 #Thickness of fin (m)\nT = 20 #Fluid temperature (\u00b0C)\nTb = 200 #Surface temperature (\u00b0C)\nh = 40 #Heat transfer coefficient (W/m^2.K)\nk = 240 #Thermal conductivity of fin (W/m.K)\nl = 15/10**3 #Length of fin (m)\n\n#Calculation:\nro = Do/2 #Radius of tube (m)\nrf = ro+l #Outside radius of fin (m)\nAb = 2*pi*ro*t #Area of the base of the fin (m^2)\nTe = Tb-T #Excess temperature at the base of the fin (K)\nQ1 = h*Ab*Te #Total heat transfer rate without the fin (W)\nBi = h*(t/2)/k #Biot number\nL = rf-ro #Fin height (m)\nrc = rf+t/2 #Corrected radius (m)\nLc = L+t/2 #Corrected height (m)\nAp = Lc*t #Profile area (m^2)\nAf = 2*pi*(rc**2-ro**2) #Fin surface area (m^2)\nQm = h*Af*Te #Maximum fin heat transfer rate (W)\nA = sqrt(Lc**3*h/(k*Ap)) #Abscissa of fin efficiency\nC = rf/ro #Curve parameter of fin efficiency\n#From figure 17.4:\nnf = 0.97 #Fin efficiency\nQf = nf*Qm #Fin heat transfer rate (W)\nR = Te/Qf #Fin resistance (K/W)\nE = Qf/Q1 #Fin effectiveness\n\n#Result:\nprint \"The fin efficiency is :\",round(nf*100),\" % .\"\nprint \"The fin thermal resistance is :\",round(R,1),\" \u00b0C/W .\"\nprint \"The fin effectiveness is :\",round(E,2),\" .\"\nprint \"The maximum heat transfer rate from a single fin is :\",round(Qm,2),\" W .\"\nif E>2:\n print \"Since Ef = FCP>2, the use of the fin is justified.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fin efficiency is : 97.0 % .\nThe fin thermal resistance is : 3.6 \u00b0C/W .\nThe fin effectiveness is : 11.05 .\nThe maximum heat transfer rate from a single fin is : 51.53 W .\nSince Ef = FCP>2, the use of the fin is justified.\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.16, Page number: 376"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''What is the rate of heat transfer per unit length of tube in the previous illustrative example, if\nthere are 125 such fins per meter of tube length? Also calculate the total efficiency and\neffectiveness.\n'''\n\nfrom __future__ import division\nfrom math import pi,sqrt\n\n#Variable declaration:\nNf = 125 #Array of fins per meter\nw = 1 #Length of fin (m)\n#From example 17.15:\nt = 4/10**3 #Thickness of fin (m)\nDo = 50/10**3 #Outside diameter of tube (m)\nAf = 7.157*10**-3 #Fin surface area (m^2)\nh = 40 #Heat transfer coefficient (W/m^2.K)\nDTb = 180 #Excess temperature at the base of the fin (K)\nQf = 50 #Fin heat transfer rate (W)\n\n#Calculation:\nro = Do/2 #Radius of tube (m)\nwb = w-Nf*t #Unfinned exposed base length (m)\nAb = 2*pi*ro*wb #Area of the base of the fin (m^2)\nAt = Ab+Nf*Af #Total heat transfer surface area (m^2)\nQw = h*(2*pi*ro*w)*DTb #Heat rate without fin (W)\nQb = h*Ab*DTb #Heat rate from the base (W)\nQft = Nf*Qf #Heat rate from the fin (W)\nQt = Qb+Qft #Total heat rate (W)\nQm = h*At*DTb #Maximum heat transfer rate (W)\nn = Qt/Qm #Overall fin efficiency\nE = Qt/Qw #Overall fin effectiveness\nRb = 1/(h*Ab) #Thermal resistance of base (\u00b0C/W)\nRf = 1/(h*Nf*Af*n) #Thermal resistance of fin (\u00b0C/W)\n\n#Result:\nprint \"The rate of heat transfer per unit length of tube is :\",round(Qt,1),\" W .\"\nprint \"Or, the rate of heat transfer per unit length of tube is :\",round(Qt/10**3,2),\" kW .\"\nprint \"The overall fin efficiency is :\",round(n*100,1),\" % .\"\nprint \"The overall fin effectiveness is :\",round(E,2),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of heat transfer per unit length of tube is : 6815.5 W .\nOr, the rate of heat transfer per unit length of tube is : 6.82 kW .\nThe overall fin efficiency is : 97.3 % .\nThe overall fin effectiveness is : 6.03 .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.17, Page number: 377"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A metal fin 1 inch high and 1/8 inch thick has a thermal conductivity, k, of 25 Btu/h.ft.\u00b0F and a\nuniform base temperature of 250\u00b0F. It is exposed to an air stream at 60\u00b0F with a velocity past\nthe fin such that the convection coefficient of heat transfer, h, is 15 Btu/h.ft.\u00b0F. Calculate the\ntemperature at the tip of the fin and the heat transfer from the fin per foot of fin. Solve the problem\nanalytically.\n'''\n#Variable declaration:\nprint 'Analytical Solution'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Analytical Solution\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 17.18, Page number: 379"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Estimate the fin efficiency in the previous example, if the efficiency is defined (as noted earlier)\nas the actual heat transfer divided by the heat rate of the entire fin with the same temperature as its\nbase.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\n#From example 17.18:\nT = 250 #Base temperature of fin (\u00b0F)\nh = 15 #Convection coefficient of heat transfer (Btu/h.ft.\u00b0F)\nw = 1 #Base width of fin (ft)\nt = 1 #Thickness of fin (in)\nH = 1/8 #Height of fin (in)\nl = 1 #Length of fin (in)\nQ = 357.2 #Heat transfer rate (Btu/h.ft)\n\n#Calculation:\nA = (l*w+t*w+H*w)/12 #Heat transfer area of fin (ft^2)\nQm = h*A*(T-70) #Maximum heat transfer rate (Btu/h.ft)\nn = Q/Qm*100 #Fin efficiency\n\n#Result:\nprint \"The fin efficiency is :\",round(n,1),\" % .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The fin efficiency is : 74.7 % .\n"
+ }
+ ],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_18.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_18.ipynb
new file mode 100644
index 00000000..d5d13bdf
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_18.ipynb
@@ -0,0 +1,272 @@
+{
+ "metadata": {
+ "name": "Chapter 18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 18: Other Heat Exchange Equipment"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.2, Page number: 384"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the temperature when 50 lb of pure H2SO4 at 25\u00b0C is mixed adiabatically with 200 lb\nof a 50% by weight aqueous H2SO4 solution at 25\u00b0C. Also calculate the heat effect if the final\nmixture is at 25\u00b0C.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nT1 = 25 #Temperature of H2SO4 (\u00b0C)\nm = 50+200 #Mass of H2SO4 (lb)\n#From figure 18.2:\nW1 = 50+100 #Weight of H2SO4 (lb)\nW2 = 100 #Weight of H2O (lb)\n\n#Calculation:\nm = W1/(W1+W2)*100 #Percent weight of H2SO4 (%)\nm2 = W1+W2 #Mass of mixture (lb)\n#From fgure 18.2:\nT2 = 140 #Final temperature between the 50% solution and pure H2SO4 at 25\u00b0C (\u00b0F)\nh1 = -86 #Specific heat capacity of H2O (Btu/lb)\nh2 = -121.5 #Specific heat capacity of H2SO4 (Btu/lb)\nQ = m2*(h2-h1) #Heat transferred (Btu)\n\n#Result:\nprint \"The final temperature between the 50% solution and pure H2SO4 at 25\u00b0C is :\",round(T2),\" \u00b0F .\"\nprint \"The heat transferred is :\",round(Q),\" Btu .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The final temperature between the 50% solution and pure H2SO4 at 25\u00b0C is : 140.0 \u00b0F .\nThe heat transferred is : -8875.0 Btu .\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.3, Page number: 386"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A single-effect evaporator is to concentrate 10,000 lb/h of a 10% NaOH solution to 75%. The\nfeed enters at 120\u00b0F and the evaporator is to operate at an absolute pressure of 14.7 psi. The 75%\nNaOH solution leaves at the evaporator equilibrium temperature. For what heat transfer rate\n(Btu/h) should the evaporator be designed? Also calculate the area requirement in the evaporator\nif the overall heat transfer coefficient is 500 Btu/h.ft^2.\u00b0F and 103 psig (340\u00b0F) saturated\nsteam is employed in the steam chest. The NaOH\u2013H2O enthalpy-concentration diagram is provided\nin Figure 18.3. The enthalpy of saturated steam at 14.7 psia is approximately 1150 Btu/lb.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nF = 10000 #Mass flow rate of NaOH (lb/h)\nC1 = 10 #Old concentration of NaOH solution (%)\nC2 = 75 #New concentration of NaOH solution (%)\nh1 = 1150 #Enthalpy of saturated steam at 14.7 psia (Btu/lb)\nU = 500 #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nT1 = 212 #Absolute temperature of evaporator (\u00b0F)\nT2 = 340 #Saturated steam temperature (\u00b0F)\n\n#Calculation:\nL = F*(C1/100)/(C2/100) #Flow rate of steam leaving the evaporator (lb/h)\nV = F-L #Overall material balance (lb/h)\n#From figure 18.3:\nhF = 81 #Enthalpy of solution entering the unit (Btu/lb)\nhL = 395 #Enthalpy of the 75% NaOH solution (Btu/lb)\nQ = round(V)*h1+round(L)*hL-F*hF #Evaporator heat required (Btu/h)\nA = Q/(U*(T2-T1)) #Area of the evaporaor (ft^2)\n\n#Result:\nprint \"The heat transfer rate required for the evaporator is :\",round(Q,-2),\" Btu/h .\"\nprint \"The area requirement in the evaporator is :\",round(A,1),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat transfer rate required for the evaporator is : 9683600.0 Btu/h .\nThe area requirement in the evaporator is : 151.3 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.4, Page number: 388"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Given the triple-effect evaporator information below, calculate the temperature drop across the\nheating surface in the first effect:\nEffect U, Btu/h.ft^2.\u00b0F A, ft^3\n1 240 125\n2 200 150\n3 125 160\nThe condensing stream temperature in the first effect and the vapor leaving the third effect are\n400\u00b0F and 120\u00b0F, respectively.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nU1 = 240 #Overall heat transfer coefficient for first effect (Btu/h.ft^2.\u00b0F)\nU2 = 200 #Overall heat transfer coefficient for second effect (Btu/h.ft^2.\u00b0F)\nU3 = 125 #Overall heat transfer coefficient for third effect (Btu/h.ft^2.\u00b0F)\nA1 = 125 #Heating surface area in first effect (ft^3)\nA2 = 150 #Heating surface area in second effect (ft^3)\nA3 = 160 #Heating surface area in third effect (ft^3)\nT1 = 400 #Condensation stream temperature in the first effect (\u00b0F)\nT2 = 120 #Vapor leaving temperature in the first effect (\u00b0F)\n\n#Calculation:\nR1 = 1/(U1*A1) #Resistance across first effect\nR2 = 1/(U2*A2) #Resistance across second effect\nR3 = 1/(U3*A3) #Resistance across third effect\nR = R1+R2+R3 #Total resistance\nDT1 = (R1/R)*(T1-T2) #Temperature drop across the heating surface in the first effect (\u00b0F)\n\n#Result:\nprint \"The temperature drop across the heating surface in the first effect is :\",round(DT1),\" \u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature drop across the heating surface in the first effect is : 80.0 \u00b0F .\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.6, Page number: 389"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An evaporator is to be fed with 5000 lb of solution containing 2% solids by weight. The feed,\nF, is at a temperature of 100\u00b0F. It is to be concentrated to a solution of 5% solute by weight in\nan evaporator operating at a pressure of 1 atm in the vapor space. In order to carry out the\nevaporation, the heating surface is supplied with steam at 5 psig (227\u00b0F) and the overall heat\ntransfer coefficient of the evaporator, U, is 280 Btu/h.ft^2.\u00b0F. What is the mass of vapor\nproduced, the total mass of steam required, and the surface area required? Neglect enthalpy\nof solution effects.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nF = 5000 #Mass of soltuion fed in the evaporator (lb)\nxF = 2/100 #Concentration of feed\nxL = 5/100 #Concentration of liquor\nU = 280 #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n#From figure 18.1 & 18.3:\nTF = 100 #Feed temperature (\u00b0F)\nTS = 227 #Steam temperature (\u00b0F)\nTV = 212 #Vapour temperature (\u00b0F)\nTL = 212 #Liquor temperature (\u00b0F)\nTC = 227 #Condensate temperature (\u00b0F)\n\n#Calculation:\n#From steam tables:\nhF = 68 #Enthalpy of feed (Btu/lb)\nhL = 180 #Enthalpy of liquor (Btu/lb)\nhV = 1150 #Enthalpy of vapour (Btu/lb)\nhS = 1156 #Enthalpy of steam (Btu/lb)\nhC = 195 #Enthalpy of condensate (Btu/lb)\ns1 = F*xF #Total solids in feed (lb)\nw = F-s1 #Total water in feed (lb)\ns2 = F*xF #Total solids in liquor (lb)\nL = s2/xL #Total water in liquor (lb)\nV = F-L #Overall balance (lb)\nS = (V*hV+L*hL-F*hF)/(hS-hC) #Mass of steam (lb)\nQ = S*(hS-hC) #Total heat requirement (Btu)\nA = Q/(U*(TS-TL)) #Required surface aea (ft^2)\n\n#Result:\nprint \"The mass of vapor produced is :\",round(V),\" lb .\"\nprint \"The total mass of steam required is :\",round(S),\" lb .\"\nprint \"The surface area required is :\",round(A),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mass of vapor produced is : 3000.0 lb .\nThe total mass of steam required is : 3611.0 lb .\nThe surface area required is : 826.0 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.7, Page number: 390"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An evaporator is fed with 5000 lb/h of a 20% solution of sodium hydroxide at 100\u00b0F. This is to\nbe concentrated to a 40% solution. The evaporator is supplied with saturated steam at 5 psig.\nAlthough the unit operates with the vapor space at a pressure of 4 in Hg absolute, the boiling\ntemperature of the solution in the evaporator is 198\u00b0F (due to the superheat created by the\nexposed heating element). The overall heat transfer coefficient is 400 Btu/h.ft^2.\u00b0F.\nCalculate the steam rate and the required heat transfer area.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nF = 5000 #Mass flow rate of NaOH (lb/h)\nxF = 20/100 #Old concentration of NaOH solution\nTF = 100 #Feed temperature (\u00b0F)\nxL = 40/100 #New concentration of NaOH solution\nxv = 0 #Vapour concentration at x\nyv = 0 #Vapour concentration at y\nT1 = 198 #Boiling temperature of solution in the evaporator (\u00b0F)\nT2 = 125 #Saturated steam temperature (\u00b0F)\nU = 400 #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nTs = 228 #Steam temperature (\u00b0F)\n\n#Calculation:\n#From steam tables at 228\u00b0F and 5 psig:\nhS = 1156 #Enthalpy of steam (Btu/lb)\nhC = 196 #Enthalpy of condensate (Btu/lb)\nhV = hS-hC #Enthalpy of vapour (Btu/lb)\nTw = 125.4 #Boiling point of water at 4 in Hg absolute (\u00b0F)\nhS2 = 1116 #Enthalpy of saturated steam at 125\u00b0F (Btu/lb)\nhs = 0.46 #Heat capacity of superheated steam (Btu/lb.\u00b0F)\n#From figure 18.3:\nhF = 55 #Enthalpy of feed (Btu/lb)\nhL = 177 #Enthalpy of liquor (Btu/lb)\nL = F*xF/xL #Mass of liquor (lb)\nV = L #Mass of vapour (lb)\nhV = hS2+hs*(T1-T2) #Enthalpy of vapour leaving the solution (Btu/lb)\nS = (V*hV+L*hL-F*hF)/(hS-hC) #Mass flow rate of steam (lb/h)\nQ = S*(hS-hC) #Total heat requirement (Btu)\nA = Q/(U*(Ts-T1)) #Required heat transfer area (ft^2)\n\n#Result:\nprint \"The steam flow rate is :\",round(S,-1),\" lb/h .\"\nprint \"The required heat transfer area is :\",round(A),\" ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The steam flow rate is : 3170.0 lb/h .\nThe required heat transfer area is : 253.0 ft^2 .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.10, Page number: 398"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Using Ganapathy\u2019s method, determine the required \u201clength\u201d of a waste heat boiler to be used to\ncool hot gases (average heat capacity = 0.279 Btu/lb.\u00b0F) from 2000 to 550\u00b0F and generate\n30,000 lb/h of steam at 3308F from water at 140\u00b0F. The boiler contains 800 1.5-inch ID tubes.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nT1 = 2000 #Hot gas temperature (\u00b0F)\nT2 = 550 #Cool gas temperature (\u00b0F)\nT3 = 330 #Steam temperature (\u00b0F)\nT4 = 140 #Water temperature (\u00b0F)\nm = 30000 #Mass flow rate of steam (lb/h)\ncp = 0.279 #Average heat capacity of gas (Btu/lb.\u00b0F)\nN = 800 #Number of boiler tubes\n\n#Calculation:\nDT = (T1-T3)/(T2-T3) #Temperature difference ratio\nTav = (T1+T2)/2 #Average gas temperature (\u00b0F)\n#From steam tables (Appendix):\nhs = 1187.7 #Steam enthalpy (Btu/lb)\nhw = 107.89 #Water enthalpy (Btu/lb)\nQ = m*(hs-hw) #Heat duty (Btu/h)\nmh = Q/cp*(T1-T2) #Mass flow rate of gas (lb/h)\nx = mh/N #Gas mass flow rate per tube (lb/h)\n#From figure 18.5:\nL = 15 #Length of boiler tubes (ft)\n\n#Result:\nprint \"The length of boiler tubes is :\",L,\" ft .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The length of boiler tubes is : 15 ft .\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.12, Page number: 399"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''120,000 lb/h of flue gas from an incinerator is to be cooled from 1800 to 500\u00b0F in a waste heat\nboiler. If 2-inch ID tubes and a flow rate of 150 lb/h through each tube is to be used, estimate the\nrequired heat transfer area, tube length, heat duty, and water mass flow rate. Water at 200\u00b0F is\navailable for the steam generator; saturated steam at 80 psia is needed. The average heat capacity\nof the flue gas is 0.26 Btu/lb.\u00b0F. Use Ganapathy\u2019s method to solve the problem.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nT1 = 1800 #Hot gas temperature (\u00b0F)\nT2 = 500 #Cool gas temperature (\u00b0F)\n#From steam tables:\nTw = 312 #Boiling point of water at 80 psia (\u00b0F)\nm1 = 120000 #Mass flow rate of flue gas (lb/h)\nD = 2/12 #Inside diameter of tube (ft)\ncp = 0.26 #Average heat capacity of flue gas (Btu/lb.\u00b0F)\n\n#Calculation:\nDT = (T1-Tw)/(T2-Tw) #Temperature difference ratio\nTav = (T1+T2)/2 #Average gas temperature (\u00b0F)\n#From figure 18.4:\nx = 150 #Gas mass flow rate per tube (m/N) (lb/h)\nN = m1/x #Number of tubes\nL = 21.5 #Length of tubes (ft)\nA = N*L*D #Total heat transfer area (ft^2)\nQ = m1*cp*(T1-T2) #Heat duty (Btu/h)\n#From steam tables (Appendix):\nhs = 1183.1 #Steam enthalpy at 80 psia (Btu/lb)\nhw = 168.1 #Water enthalpy at 200\u00b0F (Btu/lb)\nm2 = Q/(hs-hw) #Mass flow rate of water (lb/h)\n\n#Result:\nprint \"The required heat transfer area is :\",round(A),\" ft^2 .\"\nprint \"The tube length is :\",L,\" ft .\"\nprint \"The heat duty is :\",round(Q/10**7,2),\" x 10^7 .\"\nprint \"The water mass flow rate is :\",round(m2,-4),\" lb/h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The required heat transfer area is : 2867.0 ft^2 .\nThe tube length is : 21.5 ft .\nThe heat duty is : 4.06 x 10^7 .\nThe water mass flow rate is : 40000.0 lb/h .\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.18, Page number: 407"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''It is proposed to cool 144,206 lb/h of a hot flue combustion gas by using ambient air at 70\u00b0F.\nCalculate the quantity (mass, mole, and volume basis) of air required to cool the gases from\n2050\u00b0F to an acceptable temperature of 560\u00b0F. Assume an average flue gas heat capacity of\n0.3 Btu/lb.\u00b0F.\n'''\n\n#Variable declaration:\nm1 = 144206 #Mass flow rate of flue gas (lb/h)\ncp = 0.3 #Average flue gas heat capacity (Btu/lb.\u00b0F)\nT1 = 2050 #Initial temperature of gas (\u00b0F)\nT2 = 560 #Final temperature of gas (\u00b0F)\nT3 = 70 #Ambient air temperature (\u00b0F)\n\n#Calculation:\nQ = m1*cp*(T1-T2) #Duty rate (Btu/h)\n#From appendix:\ncpa = 0.243 #Average ambient air heat capacity 70\u00b0F (Btu/lb.\u00b0F)\nMW = 29 #Molecular weight of air at 70\u00b0F\nma = round(Q,-5)/(cpa*(T2-T3)) #Mass of air required (lb/h)\nm2 = round(ma)/MW #Moles of air required (lb mol/h)\nm3 = round(ma)*13.32 #Volume of air required (ft^3/h)\n\n#Result:\nprint \"The mass of air required is :\",round(ma,-2),\" lb/h .\"\nprint \"The moles of air required is :\",round(m2,-1),\"lb mol/h .\"\nprint \"The volume of air required is :\",round(m3,-3),\" ft^3/h .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mass of air required is : 541700.0 lb/h .\nThe moles of air required is : 18680.0 lb mol/h .\nThe volume of air required is : 7215000.0 ft^3/h .\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.19, Page number: 407"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Design the air quench tank in the previous example if a 1.5-s residence time is required.'''\n\n#Variable declaration:\n#From example 18.19:\nm1 = 144200 #Mass flow rate of flue gas (lb/h)\nm2 = 541700 #Mass flow rate of air (lb/h)\nR = 0.73 #Universal gas constant (psia.ft^3/lbmol.\u00b0R)\nP = 1 #Absolute pressure (psia)\nT = 1020 #Absolute temperature (\u00b0R)\nMW = 29 #Molecular weight of air\nt = 1.5 #Residence time (s)\n\n#Calculation:\nm = m1+m2 #Total mass flow rate of the gas (lb/h)\nq = m*R*T/(P*MW) #Volumetric flow at 560\u00b0F (ft^3/h)\nV = q*t/3600 #Volume of tank (ft^3)\n\n#Result:\nprint \"The total mass flow rate of the gas is :\",round(m,-2),\" lb/h .\"\nprint \"The volumetric flow at 560\u00b0F is :\",round(q/10**7,2),\" x 10^7 ft^3/h .\"\nprint \"The volume of tank is :\",round(V),\" ft^3 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total mass flow rate of the gas is : 685900.0 lb/h .\nThe volumetric flow at 560\u00b0F is : 1.76 x 10^7 ft^3/h .\nThe volume of tank is : 7338.0 ft^3 .\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.20, Page number: 408"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the physical dimensions of the tank in the previous example.'''\n\nfrom __future__ import division\nfrom math import pi\n\n#Variable declaration:\n#Fro example 18.20:\nV = 7335 #Volume of tank (ft^3)\n\n#Calculation:\nD = (4*V/pi)**(1/3) #Diameter of tank (ft)\nH = D #Height of tube (ft)\n\n#Result:\nprint \"The diameter of tank is :\",round(H,2),\" ft .\"\nprint \"The height of tube is :\",round(D,2),\" ft .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The diameter of tank is : 21.06 ft .\nThe height of tube is : 21.06 ft .\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.21, Page number: 408"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''It is proposed to reduce the temperature of 10% of the 144,206 lb/h of flue gas described\nin Illustrative Example 18.18 to 5508F using a solids contact method that operates on a 1-h\ncooling cycle. Assume the average heat capacities of the flue gas and solid to be 0.3 and\n0.88 Btu/lb.\u00b0F, respectively, over the temperature range in question. The initial temperature\nof the solids is 70\u00b0F. Assuming an approach temperature of 40\u00b0F, what mass of solid must be\nprovided in order to cool the flue gas to the required temperature during each hour of operation.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nm1 = 144206 #Mass flow rate of flue gas (lb/h)\ncp1 = 0.3 #Average heat capacities of the flue gas (Btu/lb\u00b0F)\ncp2 = 0.88 #Average heat capacities of the solid (Btu/lb\u00b0F)\n#From example 18.18:\nT1 = 550 #Initial temperature of gas (\u00b0F)\nT2 = 2050 #Final temperature of gas (\u00b0F)\nT3 = 70 #Initial temperature of solid (\u00b0F)\nT4 = 550-40 #Final temperature of solid (\u00b0F)\n\n#Calculation:\nDhf = m1*cp1*(T2-T1) #For the flue gas, the enthalpy change for one hour of operation (Btu)\nDhs = round(Dhf,-4) #For the solids, the enthalpy change for one hour of operation (Btu)\nm2 = Dhs/(cp2*(T4-T3)) #Mass of solid (lb)\n\n#Result:\nprint \"The mass of solid is :\",round(m2),\" lb .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mass of solid is : 167588.0 lb .\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 18.22, Page number: 409"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''With reference to the previous example, design a radiative heat exchanger to cool the entire\ncombustion gases (MW = 28.27) from 2050 to 180\u00b0F. The ambient air temperature is 60\u00b0F\nand an overall heat transfer coefficient for the cooler of 1.5 Btu/h.ft^2.\u00b0F may be assumed to\napply.\n'''\n\nfrom __future__ import division\nfrom math import log,sqrt,pi\n\n#Variable declaration:\n#From example 18.21:\nm = 144206 #Mass flow rate of flue gas (lb/h)\ncp = 0.3 #Average heat capacities of the flue gas (Btu/lb\u00b0F)\nT1 = 2050 #Initial temperature of gas (\u00b0F)\nT2 = 180 #Final temperature of gas (\u00b0F)\nT3 = 60 #Ambient air temperature (\u00b0F)\nU = 1.5 #Overall heat transfer coefficient for cooler (Btu/h.ft^2.\u00b0F)\nMW = 28.27 #Molecular weight of gas\nR = 379 #Universal gas constant (psia.ft^3/lbmol.\u00b0R)\nv = 60 #Duct or pipe velcity at inlet (2050\u00b0F) (ft/s)\n\n#Calculation:\nQ = m*cp*(T1-T2) #Heat duty (Btu/h)\nDTlm = ((T1-T3)-(T2-T3))/log((T1-T3)/(T2-T3)) #Log-mean temperature difference (\u00b0F)\nA1 = round(Q,-5)/(U*round(DTlm)) #Radiative surface area (ft^2)\nq = m*R*(T1+460)/(T3+460)/MW #Volumetric flow at inlet (ft^3/h)\nA2 = q/(v*3600) #Duct area (ft^2)\nD = sqrt(A2*4/pi) #Duct diameter (ft)\nL = A1/(pi*D) #Length of required heat exchange ducting (ft)\n\n#Result:\nprint \" The radiative surface area required is :\",round(A1,-1),\" ft^2 .\"\nprint \" The length of required heat exchange ducting is :\",round(L),\" ft .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " The radiative surface area required is : 80980.0 ft^2 .\n The length of required heat exchange ducting is : 3476.0 ft .\n"
+ }
+ ],
+ "prompt_number": 23
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_19.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_19.ipynb
new file mode 100644
index 00000000..f5466410
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_19.ipynb
@@ -0,0 +1,335 @@
+{
+ "metadata": {
+ "name": "Chapter 19"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 19: Insulation and Refractory"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.1, Page number: 413"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The following data is provided: a rectangular plane room wall, 2.5 m high and 4 m wide, has an\noutside surface temperature, T1 = 24\u00b0C; the outside air temperature is T3 = -15\u00b0C. Calculate\nthe heat transfer rate. The convective heat transfer coefficient between the outside surface and\nthe air is 11W/m^2.K.\nIf loosely packed wool with k = 0.04 W/m.K and a thickness of 7.62 mm (3 in.) is used\nfor insulation on the outer wall, calculate a revised heat transfer rate.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nH = 2.5 #Height of wall (m)\nW = 4 #Width of wall (m)\nh = 11 #Convective heat transfer coefficient (W/m^2.K)\nT1 = 24 #Outside surface temperature (\u00b0C)\nT3 = -15 #Outside air temperature (\u00b0C)\nL = 7.62/10**3 #Insulation thickness (m)\nk = 0.04 #Thermal conductivity of wool (W/m.K)\n\n#Calculation:\nA = H*W #Heat transfer area (m^2)\nQ = h*A*(T1-T3) #Heat transfer rate (W)\nRi = L/(k*A) #Insuation resistance (K/W)\nRc = 1/(h*A) #Convective resitance (K/W)\nR = Ri+Rc #Total resistance (K/W)\nQt = (T1-T3)/R #Revised heat transfer rate (Btu/h)\n \n#Result:\nprint \"1. The heat transfer rate without insulation is :\",round(Q),\" W .\"\nprint \"Or, the heat transfer rate without insulation is :\",round(Q*3.412),\" Btu/h .\"\nprint \"2. The revised heat transfer rate with insulation is :\",round(Qt),\" W .\"\nprint \"Or, the revised heat transfer rate with insulation is :\",round(Qt*3.412),\" Btu/h .\"\nprint \"There is a calculation mistake in book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The heat transfer rate without insulation is : 4290.0 W .\nOr, the heat transfer rate without insulation is : 14637.0 Btu/h .\n2. The revised heat transfer rate with insulation is : 1386.0 W .\nOr, the revised heat transfer rate with insulation is : 4729.0 Btu/h .\nThere is a calculation mistake in book.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.2, Page number: 414"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 19.1. Calculate the temperature at the wall-insulation surface.\n'''\n\n#Variable declaration:\n#From example 19.1:\nT1 = 24 #Outside surface temperature (\u00b0C)\nRi = 0.0191 #Insulation resistance (K/W)\nQ = 1383 #Revised heat transfer rate (Btu/h)\n\n#Calculation:\nT2 = T1-Q*Ri #Temperature at outer surface of insulation (\u00b0C)\n\n#Result:\nprint \"The temperature at the outer surface of the insulation is :\",round(T2,1),\" \u00b0C .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature at the outer surface of the insulation is : -2.4 \u00b0C .\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.3, Page number: 415"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the Biot number in the previous example and comment on the results.'''\n\n#Variable declaration:\n#From example 19.1:\nh = 11 #Convective heat transfer coefficient (W/m^2.K)\nL = 7.62/10**3 #Insulation thickness (m)\nk = 0.04 #Thermal conductivity of wool (W/m.K)\n\n#Calculation:\nBi = h*L/k #Biot number\n\n#Result:\nprint \"The Biot nmuber is :\",round(Bi,1),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Biot nmuber is : 2.1 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.4, Page number: 415"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''One wall of an oven has a 3-inch insulation cover. The temperature on the inside of the wall is at\n400\u00b0F; the temperature on the outside is at 25\u00b0C. What is the heat flux (heat flow rate per unit\narea) across the wall if the insulation is made of glass wool (k = 0.022 Btu/h.ft.\u00b0F)?\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nk = 0.022 #Thermal conductivity of glass wool (Btu/h.ft.\u00b0F)\nT1 = 400 #Inside wall temperature (\u00b0F)\nT2 = 25 #Outside wall temperature (\u00b0C)\nL = 3/12 #Length of insulation cover (ft)\n\n#Calculation:\nT_2 = T2*(9/5)+32 #Outside wall temperature in fahrenheit scale (\u00b0F)\nQbyA = k*(T1-T_2)/L #Heat flux across the wall (Btu/h.ft^2)\n\n#Result:\nprint \"The heat flux across the wall is :\",round(QbyA,1),\" Btu/h.ft^2 .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat flux across the wall is : 28.4 Btu/h.ft^2 .\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.5, Page number: 415"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A cold-storage room has a plane rectangular wall 8 m wide (w) and 3 m high (H). The temperature\nof the outside surface of the wall T1 is -18\u00b0C. The surrounding air temperature T3 is 26\u00b0C.\nThe convective heat transfer coefficient between the air and the surface is 21 W/m^2.K. A layer\nof cork board insulation (thermal conductivity, k = 0.0433 W/m.K) is to be attached to the\noutside wall to reduce the cooling load by 80%.\n1. Calculate the rate of heat flow through the rectangular wall without insulation. Express\nthe answer in tons of refrigeration (1 ton of refrigeration = 12,000 Btu/h). Which direction\nis the heat flowing?\n2. Determine the required thickness of the insulation board.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nw = 8 #Width of wall (m)\nH = 3 #Height of wall (m)\nh = 21 #Convective heat transfer coefficient between the air and the surface (W/m^2.K)\nT1 = -18 #Outside surace of wall temperature (\u00b0C)\nT3 = 26 #Surrounding air temperature (\u00b0C)\nl1 = 80/100 #Reduction in cooling load\nk = 0.0433 #Thermal conductivity of cork board insulation (W/m.K)\nT = 12000 #Units Btu/h in 1 ton of refrigeration\n\n#Calculation:\nA = w*H #Heat transfer area (m^2) (part 1)\nQ1 = h*A*(T1-T3) #Rate of heat flow in the absence of insulation (W)\nQ2 = Q1*3.4123/T #Rate of heat flow in the absence of insulation (ton of refrigeration)\nl2 = 1-l1 #Reduced cooling load (part 2)\nQ3 = l2*Q1 #Heat rate with insulation (W)\nRt = (T1-T3)/Q3 #Total thermal resistance (\u00b0C/W)\nR2 = 1/(h*A) #Convection thermal resistance (\u00b0C/W)\nR1 = Rt-R2 #Insulation conduction resistance (\u00b0C/W)\nL = R1*k*A #Required insulation thickness (m)\n\n#Result:\nprint \"1. The rate of heat flow through the rectangular wall without insulation is :\",round(Q1/10**3,2),\" kW .\"\nprint \"Or, the rate of heat flow through the rectangular wall without insulation in tons of refrigeration is :\",round(Q2,1),\" ton of refrigeration .\"\nif (Q1<0):\n print \" The negative sign indicates heat flow from the surrounding air into the cold room.\"\nelse :\n print \" The positive sign indicates heat flow from the surrounding air into the cold room.\"\nprint \"2. The required thickness of the insulation board is :\",round(L*10**3,2),\" mm .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The rate of heat flow through the rectangular wall without insulation is : -22.18 kW .\nOr, the rate of heat flow through the rectangular wall without insulation in tons of refrigeration is : -6.3 ton of refrigeration .\n The negative sign indicates heat flow from the surrounding air into the cold room.\n2. The required thickness of the insulation board is : 8.25 mm .\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.6, Page number: 417"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the previous example.\n1. Calculate the temperature at the interface between the cork board and the air.\n2. Calculate the Biot number, Bi.\n3. What can one conclude?\n'''\n\n#Variable declaration:\n#From example 19.5:\nQ = -4435.2 #Heat rate with insulation (W)\nR2 = 0.00198 #Convection thermal resistance (\u00b0C/W)\nT3 = 26 #Surrounding air temperature (\u00b0C)\nh = 21 #Convective heat transfer coefficient between the air and the surface (W/m^2.K)\nk = 0.0433 #Thermal conductivity of cork board insulation (W/m.K)\nL = 0.00825 #Required insulation thickness (m)\n\n#Calculation:\nT2 = T3+Q*R2 #Interface temperature (\u00b0C) (part 1)\nBi = h*L/k #Biot number (part 2)\n\n#Result:\nprint \"1. The interface temperature is :\",round(T2,2),\" \u00b0C .\"\nprint \"2. The Biot number is :\",round(Bi),\" .\"\nprint \"3. Theoretical part.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The interface temperature is : 17.22 \u00b0C .\n2. The Biot number is : 4.0 .\n3. Theoretical part.\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.7, Page number: 417"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A hypodermic needle with an external diameter D1 of 0.50 mm is to be used to transfer a reactant\npreheated to 95\u00b0C in a laboratory reactor. To reduce the heat loss from the transfer line, the hypodermic\nneedle is threaded through the center of a solid rubber insulating tube (thermal conductivity,\nk2 = 0.2 W/m.K) with a diameter of D2 of 2 mm.\n1. Calculate the rate of the heat loss from the hypodermic needle with and without the\nrubber insulation.\n2. Calculate the Biot and Nusselt numbers for the uninsulated needle taking the characteristic\ndimension to be the diameter of the needle.\nThe stainless steel needle has a thermal conductivity, k1, of 16 W/m.K. The ambient air\ntemperature is 20\u00b0C. The thermal conductivity of the air, k3, is 0.0242 W/m.K. The heat transfer\ncoefficient, h3, from the outside surface of the transfer line to the surrounding air is primarily\ndue to natural convection and is approximately equal to 12 W/m^2.K; it may also be assumed\nindependent of the radius or the temperature.\n'''\n\nfrom __future__ import division\nfrom math import pi,log\n\n#Variable declaration:\nD2 = 0.5/10**3 #External diameter of needle (m)\nh3 = 12 #Heat transfer coefficient (W/m^2.K)\nL = 1 #Insulation thickness (m)\nT1 = 95 #Reactant temperature (\u00b0C)\nT3 = 20 #Ambient air temperature (\u00b0C)\nk1 = 16 #Thermal conductivity of needle (W/m.K)\nk3 = 0.0242 #Thermal conductivity of air (W/m.K)\nD3 = 2/10**3 #Diameter of rubber tube (m)\n\n#Calculation:\nr2 = D2/2 #External radius of needle (m)\nr3 = D3/2 #Radius of rubber tube (m)\nRt1 = 1/(h3*(2*pi*r2*L)) #Thermal resistance (\u00b0C/W)\nQ1 = (T1-T3)/Rt1 #Rate of heat flow in the absence of insulation (W)\nBi = h3*D2/k1 #Biot number \nNu = h3*D2/k3 #Nusselt number\nR2 = log(r3/r2) #Thermal resistance of needle (\u00b0C/W)\nR3 = 1/(h3*(2*pi*r3*L)) #Thermal resistance of rubber tube (\u00b0C/W)\nRt2 = R2+R3 #Total thermal resistance (\u00b0C/W)\nQ2 = (T1-T3)/Rt2 #Rate of heat loss (W)\n\n#Result:\nprint \"1. The rate of the heat loss from the hypodermic needle with the rubber insulation is :\",round(Q1,2),\" W .\"\nprint \" The rate of the heat loss from the hypodermic needle without the rubber insulation is :\",round(Q2,2),\" W .\"\nprint \"2. The Biot number is :\",round(Bi,6),\" .\"\nprint \" The nusselt number is :\",round(Nu,3),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The rate of the heat loss from the hypodermic needle with the rubber insulation is : 1.41 W .\n The rate of the heat loss from the hypodermic needle without the rubber insulation is : 5.12 W .\n2. The Biot number is : 0.000375 .\n The nusselt number is : 0.248 .\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.9, Page number: 420"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The surface temperature of a circular conducting rod is maintained at 200\u00b0C (T1) by the passage\nof an electric current. The rod diameter is 10 mm, the length is 2.5 m, the thermal conductivity is\n60 W/m.K, the density is 7850 kg/m^3, and the heat capacity is 434 J/kg.K. A bakelite coating\n(thermal conductivity = 1.4 W/m.K) is applied to the rod. The rod is in a fluid at 25\u00b0C (T3),\nand the convection heat transfer coefficient is 140 W/m^2.K. The thermal conductivity of the\nfluid is 0.6 W/m.K.\n1. Calcualte the rate of heat transfer for the bare rod?\n2. What is the critical radius associated with the bakelite coating? What is the heat transfer\nrate at the critical radius?\n3. If the bakelite insulation thickness is 55 mm, determine the fractional reduction in heat\ntransfer rate relative to the case of a bare rod.\n'''\n\nfrom __future__ import division\nfrom math import log, pi\n\n#Variable declaration:\nh = 140 #Convention heat transfer coefficient (W/m^2.K)\nD1 = 10/10**3 #Rod diameter (m)\nL = 2.5 #Rod length (m)\nT1 = 200 #Surface temperature of rod (\u00b0C)\nT2 = 25 #Fluid temperature (\u00b0C)\nk = 1.4 #Thermal conductivity of bakellite (W/m.K)\nl = 55/10**3 #Insulation thickness (m)\n\n#Calculation:\nQ1 = h*pi*D1*L*(T1-T2) #Rate of heat transfer for the bare rod (W) (part 1)\nBi = 2 #Critical Biot number (part 2)\nD2 = Bi*k/h #Critical diameter associated with the bakelite coating (m)\nr2 = D2/2 #Critical radius associated with the bakelite coating (m)\nr1 = D1/2 #Rod radius (m)\nR1 = log(r2/r1)/(2*pi*k*L) #Insulation conduction resistance (\u00b0C/W)\nR2 = 1/(h*(2*pi*r2*L)) #Convection thermal resistance (\u00b0C/W)\nRt1 = R1+R2 #Total thermal resistance (\u00b0C/W)\nQc = (T1-T2)/Rt1 #Heat transfer rate at the critical radius (W)\nr3 = r1+l #New radius associated with the bakelite coating after insulation (m) (part 3)\nR3 = log(r3/r1)/(2*pi*k*L) #Insulation conduction bakelite resistance (\u00b0C/W)\nR4 = 1/(h*(2*pi*r3*L)) #Convection bakelite thermal resistance (\u00b0C/W)\nRt2 = R3+R4 #Total bakelite thermal resistance (\u00b0C/W)\nQ2 = (T1-T2)/Rt2 #Heat transfer rate at the bakelite critical radius (W)\nRe = ((Q1-Q2)/Q1)*100 #Percent reduction in heat transfer rate relative to the case of a bare rod (%)\n\n#Result:\nprint \"1. The rate of heat transfer for the bare rod is :\",round(Q1),\" W .\"\nprint \"2. The critical radius associated with the bakelite coating is :\",round(r2*10**3),\" mm.\"\nprint \" & the heat transfer rate at the critical radius is :\",round(Qc),\" W .\"\nprint \"3. The fractional reduction in heat transfer rate relative to the case of a bare rod is :\",round(Re,1),\" % .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The rate of heat transfer for the bare rod is : 1924.0 W .\n2. The critical radius associated with the bakelite coating is : 10.0 mm.\n & the heat transfer rate at the critical radius is : 2273.0 W .\n3. The fractional reduction in heat transfer rate relative to the case of a bare rod is : 24.6 % .\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.10, Page number: 421"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A stainless steel tube carries hot ethylene glycol at 124\u00b0C (T1). The surrounding air outside the\ntube is at 2\u00b0C (T5). To reduce the heat losses from the ethylene glycol, the tube is surrounded by\nasbestos insulation. For a 1 m length of the tube, calculate:\n1. the rate of heat transfer without insulation,\n2. the rate of heat transfer with insulation, and\n3. the overall heat transfer coefficient based on the inside area of the tube,\n4. the overall heat transfer coefficient based on the outside area of the insulation,\n5. the temperature, T3, at the steel\u2013insulation interface,\n6. the inside and outside Biot numbers, and the outside Nusselt number, and\n7. the log mean radius of insulation.\nThe following data is provided.\nStainless steel pipe: inside radius, r1 = 1.1 cm; outside radius, r2 = 1.3 cm; thermal conductivity,\nk2 = 19 W/m.K; heat transfer coefficient from ethylene glycol to the stainless\nsteel pipe, h1 = 190 W/m^2.K.\nAsbestos insulation: inside radius, r2 = 1.3 cm; outside radius, r3 = 3.8 cm; thermal conductivity,\nk3 = 0.2 W/m.K.\nThe outside heat transfer coefficient from the air to the surface of the insulation (or of the\npipe, in the case of no insulation), h3 = 14 W/m^2.K. The thermal conductivity, k4, of the air\nis 0.0242 W/m.K.\n'''\n\nfrom __future__ import division\nfrom math import pi, log\n\n#Variable declaration:\nr1 = 1.1/100 #Inside radius of pipe (m)\nr2 = 1.3/100 #Outside radius of pipe (m)\nr3 = 3.8/100 #Outside radius of asbestos insulation (m)\nL = 1 #Length of tube (m)\nh1 = 190 #Heat transfer coefficient from ethylene glycol to the stainless steel pipe (W/m^2.K)\nk2 = 19 #Thermal conductivity of pipe (W/m.K)\nh2 = 14 #Outside heat transfer coefficient from the air to the surface of the insulation (W/m^2.K)\nk3 = 0.2 #Thermal conductivity of asbestos (W/m.K)\nT1 = 124 #Hot ethylene glycol temperature (\u00b0C)\nT5 = 2 #Surrounding air temperature (\u00b0C)\nk4 = 0.0242 #Thermal conductivity of air (W/m.K)\n\n#Calculation:\nA1 = 2*pi*r1*L #Inside surface area of pipe (m^2) (part1)\nA2 = 2*pi*r2*L #Outside surface area of pipe (m^2)\nA3 = 2*pi*r3*L #Outside surface area of asbestos insulation (m^2)\nR1 = 1/(h1*A1) #Inside convection resistance (\u00b0C/W)\nR2 = log(r2/r1)/(2*pi*k2*L) #Conduction resistance through the tube (\u00b0C/W)\nR3 = 1/(h2*A2) #Outside convection resistance (\u00b0C/W)\nRt1 = R1+R2+R3 #Total resistance without insulation (\u00b0C/W)\nQ1 = (T1 - T5)/Rt1 #Heat transfer rate without insulation (W)\nR4 = log(r3/r2)/(2*pi*k3*L) #Conduction resistance associated with the insulation (\u00b0C/W) (part 2)\nR5 = 1/(h2*A3) #Outside convection resistance (\u00b0C/W)\nRt2 = R1+R2+R4+R5 #Total rsistance with the insulation (\u00b0C/W)\nQ2 = (T1-T5)/Rt2 #Heat transfer rate with the insulation (W)\nU1 = 1/(Rt2*A1) #Overall heat transfer coefficient based on the inside area (W/m^2.K) (part 3)\nU3 = 1/(Rt2*A3) #Overall heat transfer coefficient based on the outside area (W/m^2.K) (part 4)\nT3 = T1-(R1+R2)*Q2 #Temperature at the steel\u2013insulation interface (\u00b0C) (part 5)\nBi1 = h2*(2*r3)/k3 #Outside Biot number (part 6)\nBi2 = h1*(2*r1)/k2 #Inside Biot number\nNu = h1*(2*r1)/k4 #Nusselt number of the air\nrlm = (r3-r2)/log(r3/r2) #Log mean radius of the insulation (m) (part 7)\n\n#Result:\nprint \"1. The rate of heat transfer without insulation is :\",round(Q1,1),\" W.\"\nprint \"2. The rate of heat transfer with insulation is :\",round(Q2,1),\" W.\"\nprint \"3. The overall heat transfer coefficient based on the inside area of the tube is :\",round(U1,2),\" W/m^2.K .\"\nprint \"4. The overall heat transfer coefficient based on the outside area of the insulation is :\",round(U3,1),\" W/m^2.K .\"\nprint \"5. The temperature, T3, at the steel\u2013insulation interface is :\",round(T3,1),\" \u00b0C.\"\nprint \"6. The inside Biot numbers is :\",round(Bi2,2),\" .\"\nprint \" The outside Biot numbers is :\",round(Bi1,2),\" .\"\nprint \" The Nusselt number is :\",round(Nu,1),\" .\"\nprint \"7. The log mean radius of insulation is :\",round(rlm*100,2),\" cm.\"\nprint \"There is a printing mistake in book for unit in part 7.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The rate of heat transfer without insulation is : 128.1 W.\n2. The rate of heat transfer with insulation is : 99.2 W.\n3. The overall heat transfer coefficient based on the inside area of the tube is : 11.76 W/m^2.K .\n4. The overall heat transfer coefficient based on the outside area of the insulation is : 3.4 W/m^2.K .\n5. The temperature, T3, at the steel\u2013insulation interface is : 116.3 \u00b0C.\n6. The inside Biot numbers is : 0.22 .\n The outside Biot numbers is : 5.32 .\n The Nusselt number is : 172.7 .\n7. The log mean radius of insulation is : 2.33 cm.\nThere is a printing mistake in book for unit in part 7.\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.11, Page number: 424"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A recently developed synthetic oil is stored in a vertical tank 10 feet in diameter and 30 feet\nhigh which is insulated with a 2-inch layer of insulation (k = 0.039 Btu/h.ft.\u00b0F). To prevent\nfreezing of the oil, it is maintained at a temperature of 115\u00b0F by a heating coil consisting of an\n18-gauge, 3/4-inch copper tube (k = 224 Btu/h.ft.\u00b0F) containing saturated steam at 10 psig.\nAssuming that the minimum outdoor temperature is 5\u00b0F and that the oil temperature is uniform,\ncalculate of copper tubing required in feet to maintain the tank at 120\u00b0F in the coldest weather.\nNeglect upper and lower tank surface heat losses. The following additional information is\nprovided:\nSteam condensing inside coil, h = 800 Btu/h.ft^2.\u00b0F\nOil outside coil, h = 40 Btu/h.ft^2\u00b0F\nOil inside tank wall, h = 40 Btu/h.ft^2\u00b0F\nOuter tank wall to ambient air, h = 2.0 Btu/h.ft^2.\u00b0F\n'''\n\nfrom __future__ import division\nfrom math import pi\n\n#Variable declaration:\nh1 = 800 #Heat transfer coefficient for steam condensing inside coil (Btu/h.ft^2.\u00b0F)\nh2 = 40 #Heat transfer coefficient for oil outside coil (Btu/h.ft^2.\u00b0F)\nh3 = 40 #Heat transfer coefficient for oil inside tank wal (Btu/h.ft^2.\u00b0F)\nh4 = 2 #Heat transfer coefficient for outer tank wall to ambient air (Btu/h.ft^2.\u00b0F)\nk1 = 0.039 #Thermal conductivity of insulation layer (Btu/h.ft.\u00b0F)\nl1 = 2/12 #Thickness of insulation layer (ft)\nD = 10 #Diameter of tank (ft)\nH = 30 #Height of tank (ft)\nk2 = 224 #Thermal conductivity of copper tube (Btu/h.ft.\u00b0F)\nl2 = (3/4)/12 #Thickness of insulation layer (ft)\nT1 = 120 #Temperature of tank (\u00b0F)\nT2 = 5 #Outdoor temperature (\u00b0F)\n\n#Calculation:\nUo1 = 1/(1/h3+(l1/k1)+1/h4) #Overall heat transfer coefficient for tank (Btu/h.ft^2.\u00b0F)\nAt = pi*(D+2*l1)*H #Surface area of tank (ft^2)\nQ = Uo1*At*(T1-T2) #Heat transfer rate lost from the tank (Btu/h)\n#From table 6.3:\nl2 = 0.049/12 #Thickness of coil (ft)\nA = 0.1963 #Area of 18 guage, 3/4-inch copper tube (ft^2/ft)\nUo2 = 1/(1/h2+(l2/k2)+1/h1) #Overall heat transfer coefficient for coil (Btu/h.ft^2.\u00b0F)\n#From steam tables:\nTst = 240 #Temperature for 10 psia (24.7 psia) steam (\u00b0F)\nAc = Q/(Uo2*(Tst-T1)) #Area of tube (ft^2)\nL = Ac/A #Lengt of tube (ft)\n\n#Result:\nprint \"The length ofcopper tubing required is :\",round(L,1),\" ft .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The length ofcopper tubing required is : 26.0 ft .\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.12, Page number: 426"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Ricci and Theodore (R&T) Consultants have been assigned the job of selecting insulation for all\nthe plant piping at the local power plant. Included in the plant piping are 8000 ft of 1-inch schedule\n40 steel (1% C) pipe carrying steam at 240\u00b0F. It is estimated that the heat transfer coefficient\nfor condensing steam on the inside of the pipe is 2000 Btu/h.ft^2.\u00b0F. The air temperature outside\nof the pipe can drop to 20\u00b0F, and with wind motion the outside heat transfer coefficient can\nbe as high as 100 Btu/h.ft.\u00b0F.\nR&T have decided to use a fiberglass insulation having a thermal conductivity of 0.01\nBtu/h . ft . \u00b0F. It is available in 6 ft lengths in the four thicknesses listed below:\n3/8-inch thick $1.51/6 ft length\n1/2-inch thick $3.54/6 ft length\n3/4-inch thick $5.54/6 ft length\n1-inch thick $8.36/6 ft length\nCalculate the energy saved per dollar of insulation investment in going from 3/8-inch to 1/2-inch\nthick insulation. Repeat this calculation in going from 1/2-inch to 3/4-inch and 3/4-inch to 1-inch.\nExpress the results in units of Btu/h per dollar.\n'''\n\nfrom __future__ import division\nfrom math import pi, log\nfrom numpy import array,log as LOG\n\n#Variable declaration:\n#For 1-inch pipe schedule 40:\nDi = 1.049/12 #Inside diameter (ft)\nDo = 1.315/12 #Outside diameter (ft)\nL = 8000 #Length of pipe (ft)\nhi = 2000 #Heat transfer coefficient inside of the pipe (Btu/h.ft^2.\u00b0F)\nho = 100 #Outside heat transfer coefficient (Btu/h.ft.\u00b0F)\nkl = 0.01 #Thermal conductivity of insulation (Btu/h.ft.\u00b0F)\nT1 = 240 #Steam temperature (\u00b0F)\nT2 = 20 #Air temperature (\u00b0F)\nk = 24.8 #Thermal conductivity for steel (Btu/h.ft.\u00b0F)\nDxl = array([3/8,1/2,3/4,1])/12 #thickness(ft)\namt = array([1.51,3.54,5.54,8.36])/6 #Cost per feet($) \n\n#Calculation:\nD_ = (Do-Di)/log(Do/Di) #Log-mean diameter of the pipe (ft)\nDl = Do+2*(Dxl) #Insulation thickness (ft)\nD_l = (Dl-Do)/LOG(Dl/Do) #Log mean diameter of pipe (ft)\nDxw = (Do-Di)/2 #Pipe thickness (ft)\nRw = Dxw/(k*pi*D_*L) #Wall resistance ((Btu/h.\u00b0F)^-1)\nRi = 1/(hi*pi*Di*L) #Inside steam convection resistance ((Btu/h.\u00b0F)^-1)\nRl = Dxl/(kl*pi*D_l*L) #Insulation resistance ((Btu/h.\u00b0F)^-1)\nRo = 1/(ho*pi*Dl*L) #Outside air convection resistance ((Btu/h.\u00b0F)^-1)\nR = Ri+Rw+Rl+Ro #Total resistance ((Btu/h.\u00b0F)^-1)\nUo = 1/(R*pi*Dl*L) #Overall outside heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nUi = 1/(R*pi*Di*L) #Overall inside heat transfer coefficient (Btu/h.ft^2.\u00b0F)\ndT = T1-T2\nAi = pi*Di*L #Inside area (ft^2)\nQ = Ui*Ai*dT #Energy loss (Btu/h)\ndef energyPerDollar(Q1,Q2,amt1,amt2):\n return round((Q1-Q2)/(8000*(amt2-amt1)),1)\n\n#Results:\nprint \"Energy saved per dollar ingoing from 3/8 to 1/2 inch is :\",energyPerDollar(Q[0],Q[1],amt[0],amt[1]),' Btu/h.$'\nprint \"Energy saved per dollar ingoing from 1/2 to 3/4 inch is :\",energyPerDollar(Q[1],Q[2],amt[1],amt[2]),' Btu/h.$'\nprint \"Energy saved per dollar ingoing from 3/4 to 1 inch is :\",energyPerDollar(Q[2],Q[3],amt[2],amt[3]),' Btu/h.$'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Energy saved per dollar ingoing from 3/8 to 1/2 inch is : 18.2 Btu/h.$\nEnergy saved per dollar ingoing from 1/2 to 3/4 inch is : 18.8 Btu/h.$\nEnergy saved per dollar ingoing from 3/4 to 1 inch is : 6.8 Btu/h.$\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.16, Page number: 434"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the outer critical radius of insulation on a 2.0-inch OD pipe. Assume the air flow coefficient\nto be 1.32 Btu/h.ft^2.\u00b0F and the loosely-packed insulation\u2019s thermal conductivity to be\n0.44 Btu/h.ft.\u00b0F. Comment on the effect of insulation on the heat rate lost from the pipe.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nki = 0.44 #Thermal conductivity of insulation (Btu/h.ft.\u00b0F)\nho = 1.32 #Air flow coefficient (Btu/h.ft^2.\u00b0F)\nOD = 2 #Outside diameter of pipe (in)\n\n#Calculation:\nrc = (ki/ho)*12 #Outer critical radius of insulation (in)\nro = OD/2 #Outside radius of pipe (in)\nL = rc-ro #Critical insulation thickness (in)\n\n#Result:\nprint \"The outer critical radius of insulation is :\",round(rc),\" in .\"\nif ro<rc:\n print \"Since, ro<rc, the heat loss will increase as insulation is added.\"\nelse :\n print \"Sice, ro>rc, the heat loss will decrease as insulation is added.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The outer critical radius of insulation is : 4.0 in .\nSince, ro<rc, the heat loss will increase as insulation is added.\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.18, Page number: 439"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A flat incinerator wall with a surface area of 480 ft^2 consists of 6 inches of firebrick with a thermal\nconductivity of 0.61 Btu/h.ft.\u00b0F and an 8-inch outer layer of rock wool insulation with a\nthermal conductivity of 0.023 Btu/h.ft.\u00b0F. If the temperature of the insulation of the inside\nface of the firebrick and the outside surface of the rock wool insulation are 1900 and 140\u00b0F,\nrespectively, calculate the following:\n1. The heat loss through the wall in Btu/h.\n2. The temperature of the interface between the firebrick and the rock wool.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nLf = 6/12 #Length of firebrick (ft)\nkf = 0.61 #Thermal conductivity of firebrick (Btu/h.ft.\u00b0F)\nA = 480 #Surface area of wall (ft^2)\nLw = 8/12 #Length of rock wool (ft)\nkw = 0.023 #Thermal conductivity of rock wool (Btu/h.ft.\u00b0F)\nT1 = 1900 #Temperature of insulation of firebrick (\u00b0F)\nT2 = 140 #Temperature of insulation of rock wool (\u00b0F)\n\n#Calculation:\nRf = Lf/(kf*A) #Resistance of firebrick (h.\u00b0F/Btu)\nRw = Lw/(kw*A) #Resistance of rock wool (h.\u00b0F/Btu)\nR = Rf+Rw #Total resitance (h.\u00b0F/Btu)\nQ = (T1-T2)/R #Heat loss through the wall (Btu/h)\n\n#Result:\nprint \"The heat loss through the wall is :\",round(Q),\" Btu/h .\"\n ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The heat loss through the wall is : 28344.0 Btu/h .\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.19, Page number: 440"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Heat is flowing from steam on one side of a 0.375-inch thick vertical steel sheet to air on the\nother side. The steam heat-transfer coefficient is 1700 Btu/h.ft^2.\u00b0F and that of the air is\n2.0 Btu/h.ft^2.\u00b0F. The total temperature difference is 120\u00b0F. How would the rate of heat transfer\nbe affected if:\n1. the wall was copper rather than steel,\n2. by increasing the steam coefficient to 2500, and\n3. by increasing the air coefficient to 12.0?\nNote that the thermal conductivities, k, for steel and copper are 26 and 218 Btu/h.ft.\u00b0F,\nrespectively.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nh1 = 1700 #Steam heat-transfer coefficient (Btu/h.ft^2.\u00b0F)\nh2 = 2 #Air heat-transfer coefficient (Btu/h.ft^2.\u00b0F)\nA = 1 #Area of base (ft^2) (assumption)\nk1 = 26 #Thermal conductivity of steel (Btu/h.ft.\u00b0F)\nk2 = 218 #Thermal conductivity of copper (Btu/h.ft.\u00b0F)\nt = 0.375 #Thickness of steel sheet (in)\nh3 = 2500 #Increased steam heat-transfer coefficient (Btu/h.ft^2.\u00b0F)\nh4 = 12 #Increased air heat-transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Calculation:\nR1 = 1/(h1*A) #Steam resistance (h.\u00b0F/Btu)\nR2 = 1/(h2*A) #Air resistance (h.\u00b0F/Btu)\nR3 = (t/12)/(k1*A) #Steel resistance (h.\u00b0F/Btu)\nRt1 = R1+R2+R3 #Total resistance (with steel) (h.\u00b0F/Btu)\nR4 = (t/12)/(k2*A) #Copper resistance (h.\u00b0F/Btu) (part 1)\nRt2 = R1+R2+R4 #Total resistance (with copper) (h.\u00b0F/Btu)\nR5 = 1/(h1*A) #New steam resistance (h.\u00b0F/Btu)\nRt3 = R5+R2+R3 #Total resistance after increasing the steam coefficient (h.\u00b0F/Btu)\nR6 = 1/(h4*A) #Air resistance (h.\u00b0F/Btu)\nRt4 = R1+R6+R3 #Total resistance after increasing the air coefficient (h.\u00b0F/Btu)\n\n#Result:\nif (Rt1==Rt2):\n print \"1.The rate of heat transfer is essentially unaffected.\"\nelse :\n print \"1. The rate of heat transfer is essentially affected.\"\nif (Rt1==Rt3):\n print \"2. The rate is again unaffected.\"\nelse :\n print \"2. The rate is again affected.\"\nif (Rt1==Rt4):\n print \"3. The rate is unaffected for this case.\"\nelse :\n print \"3. The rate is affected for this case.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The rate of heat transfer is essentially affected.\n2. The rate is again unaffected.\n3. The rate is affected for this case.\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 19.20, Page number: 441"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''An incinerator is 30 ft long, has a 12-ft ID and is constructed of 3/4-inch carbon steel. The inside of\nthe steel shell is protected by 10 in. of firebrick (k = 0.608 Btu/h.ft.\u00b0F) and 5 inches of Sil-o-cel\ninsulation (k = 0.035 Btu/h.ft.\u00b0F) covers the outside. The ambient air temperature is 85\u00b0F\nand the average inside temperature is 1800\u00b0F. The present heat loss through the furnace wall\nis 6% of the heat generated by combustion of a fuel. Calculate the thickness of Sil-o-cel\ninsulation that must be added to cut the losses to 3%.\n'''\n\nfrom __future__ import division\nfrom math import pi, log, exp\n\n#Variable declaration:\nrfo = 12/2 #Outside radius of firebrick (ft)\nrfi = 5.167 #Inside radius of firebrick (ft)\nrso = 6.479 #Outside radius of sil-o-cel (ft)\nrsi = 6.063 #Inside radius of fsil-o-cel (ft)\nL = 30 #Length of incinerator (ft)\nkf = 0.608 #Thermal conductivity of firebrick (Btu/h.ft.\u00b0F)\nks = 0.035 #Thermal conductivity of sil-o-cel (Btu/h.ft.\u00b0F)\n\n#Calculation:\nRf= log(rfo/rfi)/(2*pi*L*kf) #Resistance of firebrick (h.ft.\u00b0F/Btu)\nRs= log(rso/rsi)/(2*pi*L*ks) #Resistance of sil-o-cel (h.ft.\u00b0F/Btu)\nR = Rf+Rs #Total resistance (h.ft.\u00b0F/Btu)\nro = exp(R*(2*pi*L*ks))*rso #New outside radius of sil-o-cel (ft)\nr= ro-rso #Extra thickness (ft)\n\n#Result:\nprint \"The extra thickness is :\",round(r,3),\" ft.\"\nprint \"Or, the extra thickness is :\",round(r*12,2),\" in.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The extra thickness is : 0.504 ft.\nOr, the extra thickness is : 6.05 in.\n"
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_21.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_21.ipynb
new file mode 100644
index 00000000..1566d542
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_21.ipynb
@@ -0,0 +1,83 @@
+{
+ "metadata": {
+ "name": "Chapter 21"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 21: Entropy Considerations and Analysis"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 21.1, Page number: 460"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Case I, Figure 21.3, above. Calculate the entropy change of the two exchangers. For the\npurposes of analysis, arbitrarily assume cp = l.0 Btu/lb.\u00b0F and mH = mC = l.0 lb\n'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\nm = 1 #Mass flowrate (lb)\ncP = 1 #Heat capacity (Btu/lb.\u00b0F)\n#From figure 21.3:\nT1 = 300 #Temperature of hot fluid leaving exchanger (\u00b0F)\nT2 = 540 #Temperature of hot fluid entering exchanger (\u00b0F)\nT3 = 60 #Temperature of cold fluid leaving exchanger (\u00b0F)\nT4 = 300 #Temperature of cold fluid entering exchanger (\u00b0F)\n\n#Calculation:\nDSh = m*cP*log((T1+460)/(T2+460)) #Entropy for hot fluid (Btu/\u00b0F)\nDSc = m*cP*log((T4+460)/(T3+460)) #Entropy for cold fluid (Btu/\u00b0F)\nDSa = DSh+DSc #Entropy for one exchanger (Btu/\u00b0F)\nDSt = DSa*2 #Total entropy change (Btu/\u00b0F)\n\n#Result:\nprint \"The entropy chage is :\",round(DSt,4),\" Btu/\u00b0F .\"\nif (DSt>0):\n print \"There is a positive entropy change.\"\nelse :\n print \"There is a negative entropy change.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The entropy chage is : 0.2101 Btu/\u00b0F .\nThere is a positive entropy change.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 21.2, Page number: 461"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Case II, Figure 21.4. Calculate the entropy change of exchangers C and D.'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\n#From example 21.1:\nDSh = -0.2744 #Entropy for hot fluid (Btu/\u00b0F)\nDSc = 0.3795 #Entropy for cold fluid (Btu/\u00b0F)\nm = 1 #Mass flowrate (lb)\ncP = 1 #Heat capacity (Btu/lb.\u00b0F)\n#From figure 21.4:\nDT = 0 #Temperature difference driving force (\u00b0F)\nDS_D = 0 #Entropy for D exchanger (Btu/\u00b0F)\n\n#Calculation:\nDS_C = DSh+DSc #Entropy for C exchanger (Btu/\u00b0F)\nDSt = DS_C+DS_D #Total entropy change of exchangers (Btu/\u00b0F)\n\n#Result:\nprint \"The total entropy change is :\",DSt,\" Btu/\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total entropy change is : 0.1051 Btu/\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 21.3, Page number: 462"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Case III, Figure 21.5. Calculate the entropy change in exchangers E and F.'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\n#From figure 21.5:\nm = 2 #Mass flowrate (lb)\ncP = 1 #Heat capacity (Btu/lb.\u00b0F)\nDS1 = -0.2744 #Entropy for hot fluid for E exchanger (Btu/\u00b0F)\nT1 = 180 #Temperature cold fluid entering the E exchabger (\u00b0F)\nT2 = 60 #Temperature cold fluid leaving the E exchabger (\u00b0F)\n\n#Calculation:\nDS2 = m*cP*log((T1+460)/(T2+460)) #Entropy for cold fluid for E exchanger (Btu/\u00b0F)\nDS_E = DS1+DS2 #Entropy for E exchanger (Btu/\u00b0F)\nDS_F = DS_E #Entropy for F exchanger (Btu/\u00b0F)\nDSt = DS_F+DS_E #Entropy change in exchangers E and F (Btu/\u00b0F)\n\n#Result:\nprint \"The entropy change in exchangers E and F is :\",round(DSt,4),\" Btu/\u00b0F .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The entropy change in exchangers E and F is : 0.2818 Btu/\u00b0F .\n"
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_22.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_22.ipynb
new file mode 100644
index 00000000..92991017
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_22.ipynb
@@ -0,0 +1,209 @@
+{
+ "metadata": {
+ "name": "Chapter 22"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 22: Design Principles and Industrial Applications"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.6, Page number: 471"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''It is desired to evaporate 1000 lb/h of 60\u00b0F water at 1 atm at a power plant. Utility superheated\nsteam at 40 atm and 1000\u00b0F is available, but since this steam is to be used elsewhere in the plant,\nit cannot drop below 20 atm and 600\u00b0F. What mass flowrate of the utility steam is required?\nAssume that there is no heat loss in the evaporator.\nFrom the steam tables:\nP = 40 atm, T = 1000\u00b0F, h = 1572 Btu/lb\nP = 20 atm, T = 600\u00b0F, h = 1316 Btu/lb\nFor saturated steam:\nP = 1 atm, h = 1151 Btu/lb\nFor saturated water:\nT = 60\u00b0F, h = 28.1 Btu/lb\n'''\n\nfrom __future__ import division\nfrom sympy import symbols,solve\n\n#Variable declaration:\n#From steam tables:\nh1 = 1572 #Enthalpy for super heated steam at (P = 40 atm, T = 1000\u00b0F) (Btu/lb)\nh2 = 1316 #Enthalpy for super heated steam at (P = 20 atm, T = 600\u00b0F) (Btu/lb)\nh3 = 1151 #Enthalpy for saturated steam (Btu/lb)\nh4 = 28.1 #Enthalpy for saturated water (Btu/lb)\nm1 = 1000 #Mass flowrate of steam (lb/h)\nm = symbols('m') #Mass flow rate of steam (lb/h)\n\n#Calculation:\nDh1 = m1*(h3-h4) #The change in enthalpy for the vaporization of the water stream (Btu/h)\nDh2 = m*(h1-h2) #The change in enthalpy for the cooling of the water stream (Btu/h)\nx = solve(Dh1-Dh2,m) #Mass flowrate of steam (lb/h)\nm2 = x[0]; #Mass flowrate of steam (lb/h)\n\n#Result:\nprint \"The mass flowrate of the utility steam required is :\",round(m2),\" lb/h.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The mass flowrate of the utility steam required is : 4386.0 lb/h.\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.7, Page number: 473"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Determine the total flowrate of cooling water required for the services listed below if a cooling\ntower system supplies the water at 90\u00b0F with a return temperature of 115\u00b0F. How much fresh\nwater makeup is required if 5% of the return water is sent to \u201cblowdown?\u201d Note that the cooling\nwater heat capacity is 1.00 Btu/(lb.\u00b0F), the heat of vaporization at cooling tower operating\nconditions is 1030 Btu/lb, and the density of water at cooling tower operating conditions is\n62.0 lb/ft^3. Process data is provided in Table 22.1.\nTable 22.1 Data for Illustrative Example 22.7\nProcess unit Heat duty, Btu/h Required\n temperature, \u00b0F\n1 12,000,000 250\n2 6,000,000 200\u2013276\n3 23,500,000 130\u2013175\n4 17,000,000 300\n5 31,500,000 150\u2013225\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\n#From table 22.1:\nQH1 = 12*10**6 #Heat duty for process unit 1 (Btu/h)\nQH2 = 6*10**6 #Heat duty for process unit 2 (Btu/h)\nQH3 = 23.5*10**6 #Heat duty for process unit 3 (Btu/h)\nQH4 = 17*10**6 #Heat duty for process unit 4 (Btu/h)\nQH5 = 31*10**6 #Heat duty for process unit 5 (Btu/h)\nT1 = 90 #Supply water temperature (\u00b0F)\nT2 = 115 #Return water temperature (\u00b0F)\ncP = 1 #Cooling water heat capacity (Btu/(lb.\u00b0F))\np = 62*0.1337 #Density of water (lb/gal)\nBDR = 5/100 #Blow-down rate\n\n#Calculation:\nQHL = (QH1+QH2+QH3+QH4+QH5)/60 #Heat load (Btu/min)\nDT = T2-T1 #Change in temperature (\u00b0F)\nqCW = round(QHL,-5)/(DT*cP*p) #Required cooling water flowrate (gpm)\nqBD = BDR*qCW #Blow-down flow (gpm)\n\n#Result:\nprint \"The total flowrate of cooling water required for the services is :\",round(qCW,-1),\" gpm.\"\nprint \"The required blow-down flow is :\",round(qBD),\" gpm.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total flowrate of cooling water required for the services is : 7240.0 gpm.\nThe required blow-down flow is : 362.0 gpm.\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.8, Page number: 474"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Determine how many pounds per hour of steam are required for the following situation if steam\nis provided at 500 psig, and if steam is provided at both 500 and 75 psig pressures. The plant has\nthe heating requirements given in Table 22.2. Also note the properties of saturated steam in\nTable 22.3.\nTable 22.2 Process Data for Illustrative Example 22.8\nProcess unit Unit heat duty (Q\u02d9 ), Required\n Btu/h temperature, \u00b0F\n1 10,000,000 250\n2 8,000,000 450\n3 12,000,000 400\n4 20,000,000 300\nTable 22.3 Steam Data\nPressure Saturation Enthalpy of vaporization\nprovided, psig temperature, \u00b0F (hvap), Btu/lb\n75 320 894\n500 470 751\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nQ1 = 10*10**6 #Unit heat duty for process unit 1 (Btu/h)\nQ2 = 8*10**6 #Unit heat duty for process unit 2 (Btu/h)\nQ3 = 12*10**6 #Unit heat duty for process unit 3 (Btu/h)\nQ4 = 20*10**6 #Unit heat duty for process unit 4 (Btu/h)\nhv = 751 #Enthalpy of vaporization for pressure 500 psig (Btu/lb)\n\n#Calculation:\nmB1 = Q1/hv #Mass flowrate of 500 psig steam through unit 1 (lb/h)\nmB2 = Q2/hv #Mass flowrate of 500 psig steam through unit 2 (lb/h)\nmB3 = Q3/hv #Mass flowrate of 500 psig steam through unit 3 (lb/h)\nmB4 = Q4/hv #Mass flowrate of 500 psig steam through unit 4 (lb/h)\nmBT = mB1+mB2+mB3+mB4 #Total steam required (lb/h)\n\n#Result:\nprint \"The total steam required is :\", round(mBT,-1),\" lb/h.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The total steam required is : 66580.0 lb/h.\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.9, Page number: 474"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Afeed stream to a distillation column processes of 28,830 gals/day of a light oil, and is fed to the\ncolumn through a 6-inch I.D. pipeline. The temperature of the feed is usually 27\u00b0C. You are\nasked to explore the possibility of using either a countercurrent or a parallel (co-current)\ndouble pipe heat exchanger as an auxiliary heater for the feed stream. The double-pipe exchanger\nis to heat the oil from 23.5\u00b0C to 27\u00b0C.Water at 8406 gals/day and 93\u00b0C is available for heating\nthe oil. The necessary physical properties are provided in Table 22.4. The inner diameter of\nthe pipe forming the annular region is 20.3 cm and the outer surface of that pipe is well insulated.\nFor a counter-current flow arrangement, calculate the following using the SI system:\n1. The lowest temperature the exiting heating water could reach. Is there sufficient energy\navailable from thewater to raise the oil temperature? (If there is not enough energy, there\nis no point in designing the exchanger.)\n2. The log mean temperature difference.\n3. The overall heat transfer coefficient, U, for a new clean exchanger based on the inside\narea is 35.4 W/m^2.K. Correct the U for the fouling of the heat exchanger. Use a\nfouling factor, Rf, of quenching oil, which is 0.0007 m^2.K/W.\n4. The length of the double pipe heat exchanger.\n5. The effectiveness of the exchanger and the NTU.\nTable 22.4 Property Data for Illustrative Example 22.9\nOil (27\u00b0C) Water (93\u00b0C) Pipe\np = 53 lb/ft^3 p = 964 kg/m^3 ID = 6.0 in\ncp = 0.46 Btu/lb.\u00b0F cp = 4204 J/kg.\u00b0C OD= 168 mm\nmu = 150 cP mu = 0.7 lb/h.ft k = 45 W/m.\u00b0C\nk = 0.11 Btu/h.ft.\u00b0F k = 0.678 W/m.\u00b0C\n'''\n\nfrom __future__ import division\nfrom sympy import symbols,solve\nfrom math import log,pi\n\n#Variable declaration:\npo = 53*16.0185 #Density of oil (kg/m^3)\nco = 0.46*4186.7 #Heat capacity of oil (J/kg.\u00b0C)\nmuo = 150/1000 #Dynamic viscosity of oil (kg/m.s)\nko = 0.11*1.7303 #Thermal conductivity of oil (W/m.\u00b0C)\nqo = 28830*4.381*10**-8 #Volumetric flowrate of oil (m^3/s)\npw = 964 #Density of water (kg/m^3)\ncw = 4204 #Heat capacity of water (J/kg.\u00b0C)\nmuw = 0.7/3600*1.4881 #Dynamic viscosity of water (kg/m.s)\nkw = 0.678 #Thermal conductivity of water (W/m.\u00b0C)\nqw = 8406*4.381*10**-8 #Volumetric flowrate of water (m^3/s)\nt1 = 23.5 #Initial temperature of oil (\u00b0C)\nt2 = 27 #Final temperature of oil (\u00b0C)\nT1 = 93 #Water heating temperature of water (\u00b0C)\nT2 = symbols('T2') #Minimum temperature of heating water (\u00b0C)\nA = symbols('A') #Heat transfer area (m^2)\nUc = 35.4 #Clean heat transfer coefficient (W/m^2.K)\nRf = 0.0007 #Thermal resistance (m^2.K/W)\nD = 6*0.0254 #Inside diameter of pipe (m)\n\n#Calculation:\nvo = muo/po #Kinematic viscosity of oil (m^2/s)\nmo = po*qo #Mass flowrate of oil (kg/s)\nvw = muw/pw #Kinematic viscosity of (m^2/s)\nmw = pw*qw #Masss flow rate of water (kg/s)\nQ1 = mo*co*(t2-t1) #Duty of exchanger of oil (W)\nT2m = t1 #Lowest possible temperature of the water (\u00b0C) (part 1)\nQmw = mw*cw*(T1-T2m) #Maximum duty of exchanger of water (W) (part 2)\nQ2 = mw*cw*(T1-T2) #Duty of exchanger of water in terms of T2 (W)\nx = solve(Q1-Q2,T2) #Solving value for T2 (\u00b0C)\nT3 = x[0]; #Minimum temperature of heating water (\u00b0C)\nDT1 = T3-t1 #Inlet temperature difference (\u00b0C)\nDT2 = T1-t2 #Outlet temperature difference (\u00b0C)\nDTlm = (DT1-DT2)/log(DT1/DT2) #Log mean temperature difference (\u00b0C)\nUd1 = 1/Uc+Rf #Dirty heat transfer coefficient (W/m^2.K) (part 3)\nUd2 = 34.6 #Dirty heat transfer coefficient (W/m^2.\u00b0C)\nQ3 = Ud2*A*DTlm #Duty of exchanger (W) (part 4)\ny = solve(Q1-Q3,A) #Heat transfer area (m^2)\nA1 = y[0]; #Required heat transfer area (m^2)\nL = A1/(pi*D) #Required heat transfer length (m)\nQmo = mo*co*(T1-t1) #Maximum duty of exchanger of oil (W) (part 5)\nQm = Qmw #Maximum duty of exchanger (W)\nE = Q1/Qm*100 #Effectiveness (%)\nNTU = Ud2*A1/(mw*cw) #Number of transfer units\n\n#Result:\nprint \"1. The lowest possible temperature of the water is :\",T2m,\" \u00b0C .\"\nprint \"2. The log mean temperature difference is :\",round(DTlm,2),\" \u00b0C .\"\nprint \"3. The overall heat transfer coefficient for the new clean exchanger is :\",round(Ud2,1),\" (W/m^2.\u00b0C .\"\nprint \"4. The length of the double pipe heat exchanger is :\",round(L,2),\" m .\"\nprint \"5. The effectiveness of the exchanger is :\",round(E,2),\" % .\"\nprint \" The NTU of the exchanger is :\",round(NTU,4),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The lowest possible temperature of the water is : 23.5 \u00b0C .\n2. The log mean temperature difference is : 65.33 \u00b0C .\n3. The overall heat transfer coefficient for the new clean exchanger is : 34.6 (W/m^2.\u00b0C .\n4. The length of the double pipe heat exchanger is : 6.68 m .\n5. The effectiveness of the exchanger is : 6.97 % .\n The NTU of the exchanger is : 0.0741 .\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.10, Page number: 477"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 22.9. How would the answer to Parts 2 and 4 be affected if the flow\nwere parallel?\n'''\n\nfrom __future__ import division\nfrom math import log,pi\n\n#Variable declaration:\n#From example 22.9:\nt1 = 23.5 #Initial temperature of oil (\u00b0C)\nt2 = 27 #Final temperature of oil (\u00b0C)\nT1 = 93 #Water heating temperature of water (\u00b0C)\nT2 = 88.16 #Minimum temperature of heating water (\u00b0C)\nU = 34.6 #Overall heat transfer coefficient (W/m^2.\u00b0C)\nQ = 7227.2 #Duty of exchanger (W)\nD = 6*0.0254 #Inside diameter of pipe (m)\nl = 6.68 #Previous heat transfer length (m)\n\n#Calculation:\nDT1 = T1-t1 #Inlet temperature difference (\u00b0C)\nDT2 = T2-t2 #Outlet temperature difference (\u00b0C)\nDTlm = (DT1-DT2)/log(DT1/DT2) #Log mean temperature difference (\u00b0C)\nA = Q/(U*DTlm) #Required heat transfer area (m^2)\nL = A/(pi*D) #Required heat transfer length (m)\n\n#Result:\nprint \"The length of the parallel pipe heat exchanger is :\",round(L,2),\" m .\"\nif L>l:\n print \"The tube length would increase slightly.\"\nelif L<l:\n print \"The tube length would decrease slightly.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The length of the parallel pipe heat exchanger is : 6.69 m .\nThe tube length would increase slightly.\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.12, Page number: 478"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A brine solution at 10\u00b0F is heated in a food processing plant by flowing through a heated\npipe. The pipe surface is maintained at 80\u00b0F. The pipe surface area for heat transfer is 2.5 ft^2.\nThe brine solution (with a density of 62.4 lb/ft^3 and a heat capacity of 0.99 Btu/lb.\u00b0F)\nflows at a rate of 20 lb/min. The overall heat transfer coefficient varies linearly with the temperature\napproach, with values of 150 Btu/h.ft^2.\u00b0F at the brine solution entrance (where the\nbrine temperature is 10\u00b0F) and 140 Btu/h.ft.\u00b0F at the brine solution exit. Determine:\n1. the temperature approach at the brine inlet side\n2. the exit temperature of the brine solution.\n'''\n\nfrom __future__ import division\nfrom scipy.optimize import fsolve\nfrom math import log\n\n#Variable declaration:\nT = 80 #Pipe surface temperature (\u00b0F)\nt1 = 10 #Inlet temperature of brine solution (\u00b0F)\nm = 1200 #mass flowrate of solution (kg/s)\nc = 0.99 #Heat capacity of brine solution (Btu/lb.\u00b0F)\nA = 2.5 #Heat transfer area (ft^2)\nU1 = 150 #Overall heat transfer coefficient at temperature approach (Btu/h.ft^2.\u00b0F)\nU2 = 140 #Overall heat transfer coefficient at inlet brine temperature (Btu/h.ft^2.\u00b0F)\n\n#Calculation:\nDT1 = T-t1 #Temperature approach at the pipe entrance (\u00b0F)\n\ndef equation(DT2):\n\tQ1 = m*c*(DT1-DT2) #Energy balance to the brine solution across the full length of the pipe (Btu/h)\n\tDTlm = (DT1-DT2)*log(DT2/DT1) #Log mean temperature difference (\u00b0F)\n\tQ2 = A*(U2*DT1-U1*DT2)/log((U2*DT1)/(U1*DT2)) #Heat transfer rate (Btu/h)\n\treturn Q2-Q1\t\nt2 = round(T-fsolve(equation,1),1)\t #The temperature of the brine solution (\u00b0F)\n\n#Results:\nprint 'The temperature of brine solution is: ',(t2-32)/1.8,'\u00b0C'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The temperature of brine solution is: -2.0 \u00b0C\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.13, Page number: 479"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to Illustrative Example 22.12. Calculate:\n1. the rate of heat transfer, Q\u02d9\n2. the log mean temperature difference.\n'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\nm = 1200 #mass flowrate of solution (kg/s)\nc = 0.99 #Heat capacity of brine solution (Btu/lb.\u00b0F)\nDT1 = 70 #Temperature approach at the pipe entrance (\u00b0F)\nDT2 = 51.6 #Temperature difference at the pipe exit (\u00b0F)\n\n#Calculation:\nQ = m*c*(DT1-DT2) #Heat transfer rate (Btu/h)\nDTlm = (DT1-DT2)/log(DT1/DT2) #Log mean temperature difference (\u00b0F)\n\n#Result:\nprint \"1. The rate of heat transfer is :\",round(Q,-1),\" Btu/h.\"\nprint \"Or, the rate of heat transfer is :\",round(Q/3.412),\" W.\"\nprint \"2. The log mean temperature difference is :\",round(DTlm,1),\" \u00b0F.\"\nprint \"Or, the log mean temperature difference is :\",round(DTlm/1.8,1),\" \u00b0C.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The rate of heat transfer is : 21860.0 Btu/h.\nOr, the rate of heat transfer is : 6407.0 W.\n2. The log mean temperature difference is : 60.3 \u00b0F.\nOr, the log mean temperature difference is : 33.5 \u00b0C.\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.23, Page number: 484"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Heating or cooling of liquids in batch processes is used in a number of commercial applications.\nSome reasons for using a batch rather than a continuous heat transfer operation include: the\nliquid is not continuously available, the liquid cleaning and regeneration is a significant part\nof the operation, or batch operation is simpler and cheaper.\nFor example, vapor degreasers are widely used for cleaning metal parts. A degreaser consists\nof a tank partially filled with a solvent. The tank is equipped with a heating coil to heat the solvent\nclose to its boiling point. The vapor of the solvent occupies the remaining volume of the\ntank, forming the \u201csolvent vapor zone.\u201d When a metal part is placed in the solvent vapor\nzone, the solvent condenses on the metal part and then drips off, taking contaminants with it.\nFor ease of use, vapor degreasers are often open to the atmosphere. This makes it easier to introduce\nand remove the metal parts. It has been a common practice to use a halogenated hydrocarbon\nfor such cleaning since they are excellent solvents, volatile, and non-flammable;\nhowever, they can be toxic and the open tank of a degreaser can be a significant source of solvent\nemissions or volatile organic components (VOCs).\nWhen an agitated liquid batch, initially at Ti, is heated, the temperature, T, of the liquid at\nany time, t, can be assumed to be uniform if the liquid is well stirred. Three different types of\ncalculations involving the batch heating of liquids are outlined in Table 22.6.\nThe assumptions in these analyses include:\n1. constant properties for the duration of the process,\n2. constant overall heat transfer coefficient, U, for the process,\n3. a constant temperature, T1, of the heating medium,\n\nTable 22.6 Batch Heating of Liquids\nCase Description Calculate\nDesign It is desired to heat the liquid to a The surface area required.\n specified temperature within a\n given time.\n\nSimulation It is desired to heat the liquid for a The final temperature, T.\n specified time; the heat transfer\n surface area is known.\n\nTime The heat transfer surface area and the The batch time, t.\n final temperature are known.\n\n4. a vigorously stirred unit (and therefore a uniform temperature),\n5. negligible heat losses, and\n6. no phase change.\nThe describing equation for these batch systems can be developed. Consider a liquid batch\nthat has a volume, V, density, r, and heat capacity, c. The initial temperature is Ti, and the temperature\nat any time, t, is T. The energy balance on the liquid in the agitated tank simplifies to\n UA(Too - T) = pVcp(dT/dt) (1)\nAn excess temperature, u, can be defined as\n u = T00 - T; ui = T00 - Ti, Ti 2 initial temprature (2)\nSubstituting this expression into Equation (1) and integrating with respect to t yields\n u/ui = e^(-t/r) (3)\nwhere rt is the thermal time constant that is given by\n r = pVcp/(UA) (4)\n Design a degreaser employing the development provided above; i.e., calculate the heating\nsurface area requirement for a vapor degreaser using 1,1,1-trichloroethane, Cl3C-CH3 (TCA)\nas the solvent. The degreaser tank has a rectangular cross section (6 ft x 3 ft) and a height of\n5 ft. Liquid TCA at 18\u00b0C is poured into the tank to a height of 1 ft. The solvent vapor zone\nwill occupy the remaining 4 ft. At time t = 0, saturated steam is passed into the heating coil.\nThe steam temperature is 100\u00b0C. The overall heat transfer coefficient, U, from the steam to\nthe liquid TCA, based on the outside area of the coil, is 200 Btu/h.ft^2.\u00b0F. It is desired to\nheat the liquid TCA from 18\u00b0C to its boiling point (74\u00b0C) without evaporation in 180 seconds.\nThe approximate properties of TCA are: density, p = 87.4 lb/ft3, heat capacity, cp = 0.23 Btu/lb.\u00b0F,\nand viscosity = 0.56 cP. The design should include:\n1. the required surface area of the heating coil\n2. the total heat added to the liquid TCA.\n'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\nToo = 100 #Steam temperature (\u00b0C)\nTi = 18 #Initial temperature of liquid TCA (\u00b0C)\nTf = 74 #Final temperature of liquid TCA (\u00b0C)\nt = 180 #Heating time (s)\np = 87.4 #Density of TCA (lb/ft^3)\nV = 18 #Kinematic viscosity of TCA (m^2/s)\ncp = 0.23 #Heat capacity of TCA (Btu/lb.\u00b0F)\nU = 200 #Overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\n\n#Calculation:\nui = Too-Ti #Initial excess temperature (\u00b0C)\nuf = Too-Tf #Final excess temperature (\u00b0C)\nR = log(ui/uf) #Ratio t/r\nr = t/R #Thermal time constant (s)\nA = p*V*cp/(3600*U*r) #Required heating area (ft^3)\nTi_F = Ti*9/5+32 #Initial temperature in fahrenheit scale (\u00b0F)\nTf_F = Tf*9/5+32 #Final temperature in fahrenheit scale (\u00b0F)\nQ = p*V*cp*(Tf_F-Ti_F) #Total amount of heat added (Btu)\n\n#Result:\nprint \"1. The required surface area of the heating coil is :\",(A,1),\" ft^3 .\"\nprint \"2. The total heat added to the liquid TCA is :\",round(Q),\" Btu .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The required surface area of the heating coil is : (3.2068907918330814e-06, 1) ft^3 .\n2. The total heat added to the liquid TCA is : 36473.0 Btu .\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 22.24, Page number: 486"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''62,000 lb/h of pure ethyl alcohol (hvap = 365 Btu/lb; specific gravity, s = 0.79) at 2.0 psig is\nto be condensed by water (r = 62.5 lb/ft^3) entering at 85\u00b0F and exiting at 120\u00b0F. A 1\u20132 horizontal\ncondenser consists of 700(Nt) one-inch outside diameter, 14 BWGtubes, 16-inch long on\na 1.25-inch triangular pitch. There are four (n) tube passes. Assume that the flow is countercurrent\nand that the alcohol is on the shell side. A fouling factor of 0.003 Btu/h.ft^2.\u00b0F is recommended.\nThe cooling water inside film coefficient has been previously determined to be\n862.4 Btu/h.ft^2.\u00b0F. Neglecting any pressure drop considerations, determine if the exchanger\nis suitable. Additional information is provided in Table 22.7.\nTable 22.7 Exchanger Information for Illustrative Example 22.24\nShell Tubes\nID = 39 inch Pitch = 1.25 inch\nBaffle spacing = 39 inch Flow area/tube = 0.546 in2\nFlow area = 2.11 ft^2 ID = 0.834 inch\nCondensation temperature, tc = 173\u00b0F Wall thickness = 0.083 inch\nFor film condensation on horizontal tubes (see also Chapter 12), the average heat transfer\ncoefficient is to be calculated from the equation (consistent units):\nh = 1.51((kf*pf^2gmuf)/(muf^24G))^1/3\nwhere kf = thermal conductivity\npf = fluid density\ng = acceleration due to gravity\nmuf = viscosity of the fluid\nG = loading, G = (m_ alcohol/LNt^(2/3))\nm_alcohol = condensate mass flow\nL = tube length\nNt = number of tubes in bundle\nV = velocity\nFor a clean (unused) tube, the overall heat transfer coefficient can be calculated from the\nfollowing equation:\nUC = Uclean =hioho/(hio + ho)\nwhere UC = Uclean = heat transfer coefficient of a clean (new/unused) tube\nhio = corrected inside heat transfer coefficient to the outside diameter, with\nhio = hi(Di/Do)\nThe dirt fouling factor may be calculated from:\nRD = Rdirty = (Uc - U)/UcU (14.32)\nwhere RD = Rdirty = dirt (fouling) factor\nU = heat transfer coefficient calculated from the actual heat transfer\n'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\nm1 = 62000 #Mass flowrate of alcohol (lb/h)\nh1 = 365 #Enthalpy of vapour (Btu/lb)\ncp = 1 #Heat capacity of water (Btu/lb.\u00b0F)\nT1 = 85 #Entering temperature of water (\u00b0F)\nT2 = 120 #Exit temperature of water (\u00b0F)\na1 = 2.11 #Flow area for the shell side (ft^2)\nN = 700 #Total number of tubes\na2 = 0.546 #Flow area per tube (in^2/tube)\nn = 4 #Number of tube passes\np = 62.5 #Density of water (lb/ft^3)\nL = 16 #Length of condenser (ft)\nhio = 862.4 #Cooling water inside film coefficient (Btu/h.ft^2.\u00b0F)\ng = 9.8 #Gravitational accleration (m^2/s)\nRf = 0.003 #Fouling factor (Btu/h.ft^2.\u00b0F)\n\n#Calculation:\nQ1 = m1*h1 #Heat loss from alcohol (Btu/h)\nQ2 = Q1 #Heat gained by water (Btu/h)\nDT = T2-T1 #Temperature difference (\u00b0F)\nm2 = Q2/(cp*DT) #Water mass flow rate (lb/h)\nLMTD = ((T2-32)-(T1-32))/log((T2-32)/(T1-32)) #Log mean temperature difference (\u00b0F)\nat = (N*a2)/(144*n) #Total flow area for tube side (ft^2)\nG1 = m1/a1 #Mass velocity of flow in shell side (lb/h.ft^2)\nG2 = m2/at #Mass velocity of flow in tube side (lb/h.ft^2)\nV = G2/(3600*p) #Velocity of water (ft/s)\nG3 = m1/(L*N)**(2/3) #Loading G (lb/h.ft)\n#For alcohol:\nkf = 0.105 #Thermal conductivity (Btu/h.ft.\u00b0F)\nmuf = 0.55*2.42 #Dynamic viscosity (lb/ft.h)\nsf = 0.79 #\npf = sf*p #Density (lb/ft^3)\nh = 151*(((kf**3)*(pf**2)*g*muf)/((muf**2)*n*G3))**(1/3) #Heat transfer coefficient for the shell side (Btu/h.ft^2.\u00b0F)\nho = h #Outside heat transfer coefficient of the tube bundle (Btu/h.ft^2.\u00b0F)\nUc = (hio*ho)/(hio+ho) #Overall heat transfer coefficient for a new (clean) heat exchanger (Btu/h.ft^2.\u00b0F)\nA = N*L*0.2618 #Area for heat transfer (ft^2)\nUd = Q1/(A*DT) #Design (D) overall heat transfer coefficient (Btu/h.ft^2.\u00b0F)\nRd = (Uc-Ud)/(Uc*Ud) #Dirt (d) factor (Btu/h.ft^2.\u00b0F)\n\n#Result:\nprint \"The dirt (d) factor is :\",round(Rd,4),\" Btu/h.ft^2.\u00b0F .\"\nif (Rd>Rd):\n print \"Therefore, the exchanger as specified is unsuitable for these process conditions since the fouling factor is above the recommended value. Cleaning is recommended.\"\nelse:\n print \"Therefore, the exchanger as specified is suitable for these process conditions since the fouling factor is below the recommended value. Cleaning is not recommended.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The dirt (d) factor is : -0.0157 Btu/h.ft^2.\u00b0F .\nTherefore, the exchanger as specified is suitable for these process conditions since the fouling factor is below the recommended value. Cleaning is not recommended.\n"
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_23.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_23.ipynb
new file mode 100644
index 00000000..3ff4626b
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_23.ipynb
@@ -0,0 +1,62 @@
+{
+ "metadata": {
+ "name": "Chapter 23"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 23: Environmental Management"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 23.6, Page number: 498"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''In 1900, it took about 20,000 Btu fuel input to produce 1 kW. h of electricity. Estimate the\nefficiency of conversion and compare it with a typical value for today\u2019s power industry.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nQ = 20000 #Fuel input (Btu)\ne = 1 #Energy produced (kW.h)\nBtu = 3412 #Units Btu in 1 kW.h\n\n#Calulation:\nER = Q/Btu #Energy requirement in 1990 (kW.h)\nE = e/ER*100 #Efficiency of energy conversion (%)\n\n#Result:\nprint \"The efficiency of energy conversion is :\",round(E,1),\" % .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The efficiency of energy conversion is : 17.1 % .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 23.7, Page number: 499"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The James David University runs it own coal-fired power plant, consuming Utah bituminous\ncoal with an energy content (in the combustion literature, energy content is defined as the\nlower heating value, LHV) of 25,000 kJ/kg. The coal contains, on average, 1.0 wt% sulfur\nand 1.2 wt% ash (based on the total mass of the coal). The power plant is 35% efficient (indicating\nthat 35% of the energy in the coal is actually converted to electrical energy), and is operated\nat a 2.0-MW average daily load (ADL).\nAssume that the coal is completely burned during combustion, and also that the power plant\ncaptures 99% of the ash and 70% of the sulfur dioxide produced during combustion. After a\nU.S. Environmental Protection Agency (EPA) Green Lights energy audit, James David found\nthat it could install energy-efficient lighting and reduce its average daily electrical generating\nneeds by 25%.\nUsing the information given above, calculate the average reduction in electrical load and the\nnew average daily load for the power plant.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nADL1 = 2 #Average daily load (MW)\nR = 25/100 #Reduction in electrical load (%)\n\n#Calculation:\nL = 1-R #New load fraction\nADL2 = ADL1*L #New average daily load (MW)\nAR = ADL1-ADL2 #Average reduction in electrical load (MW)\n\n#Result:\nprint \"The new Average daily load for the plant is :\",ADL2,\" MW.\"\nprint \"The average reduction in electrical load is :\",AR,\" MW.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The new Average daily load for the plant is : 1.5 MW.\nThe average reduction in electrical load is : 0.5 MW.\n"
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_24.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_24.ipynb
new file mode 100644
index 00000000..38c2db87
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_24.ipynb
@@ -0,0 +1,188 @@
+{
+ "metadata": {
+ "name": "Chapter 24"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 24: Accident and Emergency Management"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.4, Page number: 514"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Calculate the upper flammability limit (UFL) and the lower flammability limit (LFL) of a gas\nmixture that consists of 30% methane (m), 50% ethane (e), and 20% pentane ( p) by volume.\nEmploy the following equation:\nFL(mixture, n components) = 1/(fi/FLi) ; fi = mole fraction i ; i = 1 to n\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nfm = 30/100 #Mole fraction of methane\nfe = 50/100 #Mole fraction of ethane\nfp = 20/100 #Mole fraction of pentane\nLFLm = 0.046 #Lower flammability limit for methane\nLFLe = 0.035 #Lower flammability limit for ethane\nLFLp = 0.014 #Lower flammability limit for propane\nUFLm = 0.142 #Upper flammability limit for methane\nUFLe = 0.151 #Upper flammability limit for ethane\nUFLp = 0.078 #Upper flammability limit for propane\n\n#Calculation:\nLFLmix = 1/((fm/LFLm)+(fe/LFLe)+(fp/LFLp)) #Lower flammability limit of gas mixture\nUFLmix = 1/((fm/UFLm)+(fe/UFLe)+(fp/UFLp)) #Upper flammability limit of gas mixture\n\n#Result:\nprint \"The upper flammability limit (UFL) of the gas mixture is :\",round(UFLmix*100,2),\" % .\"\nprint \"The lower flammability limit (LFL) of the gas mixture is :\",round(LFLmix*100,2),\" % .\"\nprint \"There is a printing mistake in book.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The upper flammability limit (UFL) of the gas mixture is : 12.52 % .\nThe lower flammability limit (LFL) of the gas mixture is : 2.85 % .\nThere is a printing mistake in book.\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.5, Page number: 514"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two boiler tubes are drawn in succession from a lot of 100 tubes, of which 10 are defective.\nWhat is the probability that both tubes are defective if (a) the first is replaced before the\nsecond is drawn and (b) the first is not replaced before the second is drawn.\n'''\n\nfrom __future__ import division\nfrom sympy import nsimplify as changeToFraction\n\n#Variable declaration:\nP_A = 10/100 #Probability that the first tube is defective if the first is replaced\nP_B = 10/100 #Probability that the second tube is defective if the first is replaced\n\n#Calculation:\nP_AB = P_A*P_B #Probability that the two tubes are defective if the first is replaced\nP_B_A = 9/99 #Probability that the second tube is defective if the first tube is not replaced\nPd_AB = P_A*P_B_A #Probability that both tubes are defective if the first tube is not replaced\n\n#Result:\nprint \"The probability that both tubes are defective if :\"\nprint \"(a) the first is replaced before the second is drawn is :\",changeToFraction(P_AB),\" .\"\nprint \"(b) the first is not replaced before the second is drawn is :\",changeToFraction(Pd_AB),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The probability that both tubes are defective if :\n(a) the first is replaced before the second is drawn is : 1/100 .\n(b) the first is not replaced before the second is drawn is : 1/110 .\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.6, Page number: 515"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The difference between the magnitude of a large earthquake at a nuclear power plant, on the\nRichter scale, and the threshold value of 3.25, is a random variable X having the following\nprobability distribution function (pdf):\n f(X) = 1.7 exp(-1.7X) ; X > 0\n = 0 ; elsewhere\nFind the probability that X will have a value between 2 and 6; that is, P(2 < X < 6).\n'''\n\nfrom sympy import symbols, integrate, exp\n\n#Variable declaration:\nX = symbols('X') #Range of X\nPx = 1.7*(exp(-1.7*X)) #Probability distribution function\n\n#Calculation:\nP = integrate(Px, (X,2,6)) #Probability that X will have a value between 2 and 6\n\n#Result:\nprint \"The probability that X will have a value between 2 and 6 is :\",round(P,4),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The probability that X will have a value between 2 and 6 is : 0.0333 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.7, Page number: 517"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A coolant sprinkler system in a reactor has 20 independent spray components each of which\nfails with a probability of 0.1. The coolant system is considered to \u201cfail\u201d only if four or more\nof the sprays fail. What is the probability that the sprinkler systems fails?\n'''\n\nfrom __future__ import division\nfrom math import factorial\n\n#Variable Declaration:\nn = 20 #Total number of components\np = 0.1 #Probability of success\n\n#Calculations:\ndef binomial(n,p,x):\n P=0\n for x in range(0,x,1):\n P = P + p**x*(1-p)**(n-x)*factorial(n)/(factorial(x)*factorial(n-x))\n return P\n\n#Results:\nprint \"Probability that the sprinkler system fails :\",round((1-binomial(n,p,4))*100,2),\"%\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Probability that the sprinkler system fails : 13.3 %\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.8, Page number: 518"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Assume the time to failure (in hours), t, of a tube in a heat exchanger has aWeibull distribution\nwith a = 1.3x10^-3 and b = 0.77. Find the probability that a tube in a heat exchanger will fail\nin 1000 hours.\n'''\n\nfrom sympy import symbols, integrate, exp\n\n#Variable declaration:\na = 1.3*10**-3 #Constant a\nB = 0.77 #Constant B\nt = symbols('t') #Time (h)\nFt = a*B*t**(B-1)*(exp(-a*t**B)) #Pdf for heat exchanger tube\nPt = integrate(Ft, (t,0,1000)) #Probability that a heat exchanger will fail within 100 hours\n\n#Result:\nprint \"The probability that a tube in a heat exchanger will fail in 1000 hours is :\",round(Pt,2),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The probability that a tube in a heat exchanger will fail in 1000 hours is : 0.23 .\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.9, Page number: 519"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The measurement of the pitch diameter of an acceptable thread of a boiler tube is normally distributed\nwith mean of 0.4008 inch and standard deviation of 0.0004 inch. The specifications are\ngiven as 0.4000+0.0010 and 0.4000-0.0010. What is the probability of a \u201cdefect\u201d occurring?\n'''\n\nfrom __future__ import division\nfrom scipy.stats import norm as f\n\n#Variable declaration:\nm = 0.4008 #Mean(inch)\ns = 0.0004 #Standard Deviation(inch)\nUL = 0.4000+0.001 #Upper Limit\nLL = 0.4000-0.001 #Upper Limit\n\n#Calculation:\nPs = f.cdf(UL,m,s)-f.cdf(LL,m,s)#Probability of meeting specs\nPd = 1-Ps #Probability of defect\n\n#Results:\nprint 'Probability of meeting specifications:',round(Ps*100,2),'%'\nprint 'Probability of Defect:',round(Pd*100,2),'%'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Probability of meeting specifications: 69.15 %\nProbability of Defect: 30.85 %\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.10, Page number: 522"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Three thermometers (A, B, C) are positioned near the outlet of a heat exchanger. Assume that\nthe individual thermometer component lifetimes are normally distributed with ms and\nstandard deviations provided in Table 24.3.\nUsing the following random numbers, simulate the lifetime (time to failure) of the temperature\nrecording system and estimate its m and standard deviation. The lifetime to failure is\ndefined as the time (in weeks) for one of the thermometers to \u201cfail\u201d.\nMonte Carlo simulation is a procedure for mimicking observations on a random variable that\npermits verification of results that would ordinarily require difficult mathematical calculations or\nextensive experimentation. The method normally uses computer programs called random\nnumber generators. A random number is a number selected from the interval (0, 1) in such a\nway that the probabilities that the number comes from any two subintervals of equal length\nare equal. For example, the probability the number is in the sub-interval (0.1, 0.3) is the\nsame as the probability that the number is in the subinterval (0.5, 0.7). Thus, random numbers\nare observations on a random variable X having a uniform distribution on the interval (0, 1). This\nms that the pdf of X is specified by:\nf(x) = 1; 0 , x , 1\n = 0; elsewhere\nThe above pdf assigns equal probability to subintervals of equal length in the interval (0, 1).\nUsing random number generators, Monte Carlo simulation can generate observed values of a\nrandom variable having any specified pdf. For example, to generate observed values of T, the\ntime to failure, when T is assumed to have a pdf specified by f (t), first use the random\nnumber generator to generate a value of X between 0 and 1. The solution is an observed\nvalue of the random variable T having pdf specified by f (t). Additional information on\nMonte Carlo methods is provided in Chapter 26.\n'''\n\nfrom __future__ import division\nfrom numpy import array,minimum\nfrom math import sqrt\n\n#variable Declaration:\nmTa = array([100]*10) #Mean weeks for thermometer failure(A)\nmTb = array([90]*10) #Mean weeks for thermometer failure(B)\nmTc = array([80]*10) #Mean weeks for thermometer failure(C)\nsTa = 30 #Standard deviation (weeks) for thermometer failure(A)\nsTb = 20 #Standard deviation (weeks) for thermometer failure(B)\nsTc = 10 #Standard deviation (weeks) for thermometer failure(C)\nRa = array([0.52,0.80,0.45,0.68,0.59,0.01,0.50,0.29,0.34,0.46]) #Random No corrosponding to A\nRb = array([0.77,0.54,0.96,0.02,0.73,0.67,0.31,0.34,0.00,0.48]) #Random No corrosponding to B\nRc = array([0.14,0.39,0.06,0.86,0.87,0.90,0.28,0.51,0.56,0.82]) #Random No corrosponding to B\nZa = array([0.05,0.84,-0.13,0.47,0.23,-2.33,0.00,-0.55,-0.41,-0.10]) #Normal variable corrosponding to random No for A\nZb = array([0.74,0.10,1.75,-2.05,0.61,0.44,-0.50,-0.41,-3.90,-0.05]) #Normal variable corrosponding to random No for B\nZc = array([-1.08,-0.28,-1.56,1.08,1.13,1.28,-0.58,0.03,0.15,0.92]) #Normal variable corrosponding to random No for C\n\n#Calculations:\nTa = mTa+sTa*Za\nTb = mTb+sTb*Zb\nTc = mTc+sTc*Zc\nTs = minimum(Ta,Tb)\nTs = minimum(Ts,Tc)\nm = array([sum(Ts)/len(Ts)]*10)\ns = sqrt(sum((Ts-m)**2)/(len(Ts)-1))\n\n#Results:\nprint 'Standard deviation :',round(s,1),\" Weeks\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Standard deviation : 25.9 Weeks\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 24.15, Page number: 531"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A heat exchanger is located in a relatively large laboratory with a volume of 1100 m^3 at 22\u00b0C and\n1 atm. The exchanger can leak as much as 0.75 gmol of hydrocarbon (HC) from the flowing\nliquid into the room if the exchanger ruptures. A hydrocarbon mole fraction in the air greater\nthan 425 parts per billion (ppb) constitutes a health and safety hazard.\nSuppose the heat exchanger fails and the maximum amount of HC is released instantaneously.\nAssume the air flow in the room is sufficient to cause the room to behave as a continuously\nstirred tank reactor (CSTR^(17 \u2013 19)); i.e., the air composition is spatially uniform.\nCalculate the ppb of hydrocarbon in the room. Is there a health risk? From a treatment pointof-\nview, what can be done to decrease the environmental hazard or to improve the safety of\nthe exchanger?\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nt = 273 #Standard temperature (K)\nv = 0.0224 #Volume of air occupied by 1 gmol of ideal gas (m^3)\nV = 1100 #Volume of heat exchanger (m^3)\nT = 22+273 #Temperature of heat exchanger (K)\nx1 = 0.75 #gmols of hydrocarbon leaking from the exchanger (gmol)\n\n#Calculation:\nn = V*(1/v)*(t/T) #Total number of gmols of air in the room (gmol)\nxHC = (x1/(n+x1))*10**6 #The mole fraction of hydrocarbon in the room (ppm)\n\n#Result:\nprint \"1. The mole fraction of hydrocarbon in the room is :\",round(xHC*1000,-1),\" ppb .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The mole fraction of hydrocarbon in the room is : 16500.0 ppb .\n"
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_26.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_26.ipynb
new file mode 100644
index 00000000..2aff0c90
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_26.ipynb
@@ -0,0 +1,83 @@
+{
+ "metadata": {
+ "name": "Chapter 26"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 26: Numerical Methods"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 26.8, Page number: 558"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Species A is undergoing a reaction in a tubular flow unit. The following data (see Table 26.1)\nhave been obtained for the rate, 2rA, versus concentration, CA. Using this data, estimate the\ncoefficient kA and a in the equation below.\n-rA = kACA^a\n'''\nfrom __future__ import division\nfrom sympy import symbols,solve,log\nfrom math import exp\n\n#Variable Declaration:\nA,B,r,C = symbols('A B r C');\n\n#Calculation:\nres = solve([A + B*log(2)-log(3),A + B*log(4)-log(12)],[A,B])\nA = round(float(res[A]),4)\nB = round(float(res[B]))\nkA = round(exp(A),2)\na = B\n\n#Result:\nprint 'The equation for rate of reaction is: ',-r,'=',kA*C**a ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The equation for rate of reaction is: -r = 0.75*C**2.0\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 26.9, Page number: 559"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The viscosity of air as a function of temperature is provided below in Table 26.2. Assuming a\nlinear relationship, obtain the viscosity as a function of temperature.\n'''\nimport scipy.stats as f\n\n#Variable Declaration:\nT = [-40,-20,0,10,12,30,40,50,60,80,100,150,200,250,300,400,500]\nu = [1.51,1.61,1.71,1.76,1.81,1.86,1.90,1.95,2.00,2.09,2.17,2.38,2.57,2.75,2.93,3.25,3.55]\n\n#Calculations:\nB,A,r_value, p_value, std_err = f.linregress(T,u)\n\n#Results:\nprint 'The value of A in regression model is:',round(A,4)\nprint 'The value of B in regression model is:',round(B,4)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The value of A in regression model is: 1.7484\nThe value of B in regression model is: 0.0038\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 26.11, Page number: 561"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A refinery has two catcrackers that can produce various grades of hydrocarbon products.\nBecause of consumer fuel demand, the production of gasoline, home heating oil and diesel\nmust be limited. This information is provided in Table 26.3.\nThe profit on processing U.S. crude oil is $2.00/gal and on Venezuelan crude is $1.60/gal.\nFind the approximate daily processing rate of the two crudes in order to maximize profits.\n'''\nfrom __future__ import division\nfrom scipy.optimize import fmin_cobyla as optimize\n\n#Key:\n#f(x) : Objective Function\n#ci(x)'s : Constraints\n\n#Variable Declaration:\ndef f(x):\t\n return -2.0*x[0] - 1.6*x[1]\n\ndef c1(x):\n return 16820 - x[0]\n\ndef c2(x):\n return 1152 - x[1]\n\ndef c3(x):\n return 1500 - 0.08*x[0] - 0.11*x[1]\n\ndef c4(x):\n return 6000 - 0.29*x[0] - 0.54*x[1]\n\ndef c5(x):\n return 11000 - 0.63*x[0] - 0.35*x[1]\n\ndef c6(x):\n return x[0]\n\ndef c7(x):\n return x[1]\n\n#Calculation\nX = optimize(f,[16820,1152],[c1,c2,c3,c4,c5,c6], disp = 0)\n\n#Result:\nprint \"Maximum Profit is $\",round(-f(X)), \"/day or $\", -365*f(X), \"/year\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Maximum Profit is $ 35483.0 /day or $ 12951368.0 /year\n"
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_27.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_27.ipynb
new file mode 100644
index 00000000..c26d4fbd
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_27.ipynb
@@ -0,0 +1,188 @@
+{
+ "metadata": {
+ "name": "Chapter 27"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 27: Economics and Finance"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.5, Page number: 575"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A heat exchanger costing $60,000 has an estimated lifetime of 9 years and a salvage value of\n$500. What uniform annual payment must be made into a fund at the end of the year to replace\nTable 27.1 Comparative Methods of Analysis\nYear Straight-line Double-declining Sum-of-the-year\u2019s digits\n0 1.000 1.000 1.000\n1 0.900 0.800 0.818\n2 0.800 0.640 0.655\n3 0.700 0.512 0.510\n4 0.600 0.410 0.383\n5 0.500 0.328 0.274\n6 0.400 0.262 0.183\n7 0.300 0.210 0.110\n8 0.200 0.168 0.056\n9 0.100 0.134 0.018\n10 0.000 0.108 0.000\nthe exchanger if the fund earns 3.375%? What would be the appraisal value of the exchanger at\nthe end of the fifth year based on straight line depreciation?\n'''\n\n#Variable declaration:\ni = 0.03375 #Rate of interest (%)\nn = 9 #Years to the end of life (yr)\nP = 60000 #Cost of exchanger ($)\nL = 500 #Salvage value ($)\nx = 5 #Time after 5 years (yr)\n\n#Calculation:\nSFDF = i/((1+i)**n-1) #Sinking fund depreciation factor\nUAP = (P-L)*SFDF #Uniform annual payment ($)\nB = P-((P-L)/n)*x #Appraisal value after 5 years ($)\n\n#Result:\nprint \"1. The uniform annual payment made into the fund at the of the year is : $\",round(UAP),\" .\"\nprint \"2. The appraisal value of the exchanger at the end of the fifth year is : $\",round(B),\" .\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The uniform annual payment made into the fund at the of the year is : $ 5768.0 .\n2. The appraisal value of the exchanger at the end of the fifth year is : $ 26945.0 .\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.6, Page number: 576"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''The annual operation costs of an outdated heat exchanger/boiler system is $75,000. Under a\nproposed new design, the installation of a new system will require an initial cost of $150,000\nand an annual operating cost of $15,000 for the first five years. Determine the annualized cost for\nthe new heating system by assuming the system has only five years (n) operational life. The interest\nrate (i) is 7%. The capital recovery factor (CRF) or annual payment of a capital investment\ncan be calculated as follows:\nCRF = (A/P)i,n = i(1 + i)^n/(1 + i)^n - 1 (27.11)\nwhere A is the annual cost and P is the present worth.\nCompare the costs for both the outdated and proposed operations.\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\nC = 150000 #Capital cost ($)\ni = 7/100 #Interest rate\nn = 5 #Time (yr)\nOC = 15000 #Operating cost ($)\nA = 75000 #Annual cost for the old process ($)\n\n#Calculation:\nCRF = (i*(1+i)**n)/((1+i)**n-1) #Capital recovery factor\nIC = CRF*C #Initial cost ($)\nAC = IC+OC #Total annualized cost ($)\n\n#Result:\nprint \"The annualized cost for the new heating system is : $\",round(AC),\" .\"\nif (AC<A):\n print \"Since this cost is lower than the annual cost of $75,000 for the old process, the proposed plan should be implemented.\"\nelse :\n print \"Since this cost is higher than the annual cost of $75,000 for the old process, the proposed plan should not be implemented.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The annualized cost for the new heating system is : $ 51584.0 .\nSince this cost is lower than the annual cost of $75,000 for the old process, the proposed plan should be implemented.\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.7, Page number: 577"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Plans are underway to construct and operate a commercial hazardous waste facility in\nDumpsville in the sate of Egabrag. The company is still undecided as to whether to install a\ndouble pipe or shell-and-tube heat exchanger at the plant site to recover energy. The double\npipe (DP) unit is less expensive to purchase and operate than a comparable shell-and-tube\n(ST) system. However, projected energy recover income from the ST unit is higher since it\nwill handle a larger quantity and different temperature steam.\nBased on economic and financial data provided in Table 27.2, select the heat exchanger or\nthat will yield the higher annual profit.\nCalculations should be based on an interest rate of 12% and a process lifetime of 12 years for\nboth exchangers.\nTable 27.2 Costs/Credits Data\nCosts/credits Double pipe (DP) Shell-and-tube (ST)\nCapital ($) 2,625,000 2,975,000\nInstallation ($) 1,575,000 1,700,000\nOperation ($/yr) 400,000 550,000\nMaintenance ($/yr) 650,000 775,000\nIncome ($/yr) 2,000,000 2,500,000\n'''\n\nfrom __future__ import division\n\n#Variable declaration:\ni = 12/100 #Intersest rate\nn = 12 #Lifetime period (yr)\nCC = 2625000 #Capital cost ($)\nIC = 1575000 #Installation cost ($)\n#From table 27.3:\nIc1 = 2000000 #Income credit for double pipe ($/yr)\nIc2 = 2500000 #Income credit for Shell-and-tube ($/yr)\nAC1 = 1728000 #Total annual cost for double pipe ($/yr)\nAC2 = 2080000 #Total annual cost for Shell-and-tube ($/yr)\n\n#Calculation:\nCRF = i/(1-(1+i)**-n) #Capital recovery factor\nDPc = (CC+IC)*CRF #Annual capital and installation costs for the DP unit ($/yr)\nSTc = (CC+IC)*CRF #Annual capital and installation costs for the ST unit ($/yr)\nDPp = Ic1-AC1 #Profit for the DP unit ($/yr)\nSTp = Ic2-AC2 #Profit for the ST unit ($/yr)\n\n#Result:\nprint \"The profit for the shell-and-tube unit is : $\",round(DPp),\"/yr .\"\nprint \"The profit for the double pipe unit is : $\",round(STp),\"/yr .\"\nif (STp>DPp):\n print \"A shell-and-tube heat exchanger should therefore be selected based on the above economic analysis.\"\nelse :\n print \"A double pipe heat exchanger should therefore be selected based on the above economic analysis.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The profit for the shell-and-tube unit is : $ 272000.0 /yr .\nThe profit for the double pipe unit is : $ 420000.0 /yr .\nA shell-and-tube heat exchanger should therefore be selected based on the above economic analysis.\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.8, Page number: 579"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Based on an outgrowth of a 2011 energy audit study for a new process, it is necessary to heat\n50,000 lb/h of an organic liquid form 150 to 330\u00b0F. The liquid is at a pressure of 135 psia. A\nsimple steam-heated shell-and-tube foating-head carbon steel exchanger is the preferred equipment\nchoice. Steam is available at 150 psia (135 psig) and 300 psia (285 psig). The higher\npressure steam should result in a smaller heat exchanger but the steam will cost more. Which\nsteam choice would be better?\nData:\nThe heat capacity of the organic liquid is 0.6 Btu/lb.\u00b0F.\nThe plant on-stream operation factor is expected to be 90%.\nSteam properties are:\n 150 psia 300 psia\nSaturation temperature, \u00b0F 358.0 417.0\nLatent heat (enthalpy), Btu/lb 863.6 809.0\nCost, $/1000 lb 5.20 5.75\nHeat exchanger cost correlation (1998 basis):\nBase cost (BC) = 117 A^0.65\nInstallation factor (IF) = 3.29\nPressure factors (PF):\n100 to 200 psig = 1.15\n200 to 300 psig = 1.20\nCost indexes (CI):\n1998 = 230\n2011 = 360\nCapital cost (C) = (BC)(IF)(PF)(CI)\n'''\n\nfrom __future__ import division\nfrom math import log\n\n#Variable declaration:\nm = 50000 #Mass flowrate of the organic fluid (lb/h)\ncP = 0.6 #The heat capacity of the organic liquid (Btu/lb.\u00b0F)\nT1 = 150 #Initial temperature of organic fluid (\u00b0F)\nT2 = 330 #Final temperature of organic fluid (\u00b0F)\nTs1 = 358 #Saturation temperature for 150 psia (\u00b0F)\nTs2 = 417 #Saturation temperature for 300 psia (\u00b0F)\nL1 = 863.6 #Latent heat for 150 psia (Btu/lb)\nL2 = 809 #Latent heat for 300 psia (Btu/lb)\nc1 = 5.20/1000 #Cost for 150 psia ($/lb)\nc2 = 5.75/1000 #Cost for 300 psia ($/lb)\nCI1 = 230 #Cost index in 1998 \nCI2 = 360 #Cost index in 2011\nIF = 3.29 #Installation factor\nPF1 = 1.15 #Pressure factors for 100 to 200 psig\nPF2 = 1.20 #Pressure factors for 200 to 300 psig\nOP = 90/100 #Plant on-stream operation factor\nh = 365*24 #Hours in a year (h)\n\n#Calculation:\nQ = m*cP*(T2-T1) #Overall heta duty (Btu/h)\nDT1 = Ts1-T1 #Temperature driving force 1 for 150 psia (\u00b0F)\nDT2 = Ts1-T2 #Temperature driving force 2 for 150 psia (\u00b0F)\nLMTD1 = (DT1-DT2)/log(DT1/DT2) #Log-mean temperature difference for 150 psia (\u00b0F)\nDT3 = Ts2-T1 #Temperature driving force 1 for 300 psia (\u00b0F)\nDT4 = Ts2-T2 #Temperature driving force 2 for 300 psia (\u00b0F)\nLMTD2 = (DT3-DT4)/log(DT3/DT4) #Log-mean temperature difference for 1300 psia (\u00b0F)\nA1 = Q/(138*LMTD1) #Required heat transfer area for 150 psia (ft^2)\nA2 = Q/(138*LMTD2) #Required heat transfer area for 300 psia (ft^2)\nBC1 = 117*A1**0.65 #Base cost for 150 psia ($)\nBC2 = 117*A2**0.65 #Base cost for 13000 psia ($)\nC1 = BC1*(CI2/CI1)*IF*PF1 #Capital cost for 150 psia ($)\nC2 = BC2*(CI2/CI1)*IF*PF2 #Capital cost for 300 psia ($)\nS1 = Q*(h*OP)/L1 #Steam requirement for 150 psia (lb/yr)\nS2 = Q*(h*OP)/L2 #Steam requirement for 300 psia (lb/yr)\nSC1 = S1*c1 #Annual steam cost for 150 psia ($/yr)\nSC2 = S2*c2 #Annual steam cost for 300 psia ($/yr)\n\n#Result:\nprint \"1. The capital cost for 150 psia is : $\",round(C1,-3),\" .\"\nprint \" The capital cost for 300 psia is : $\",round(C2,-3),\" .\"\nprint \"2. The annual steam cost for 150 psia is : $\",round(SC1,-3),\"/yr .\"\nprint \" The annual steam cost for 300 psia is : $\",round(SC2,-3),\"/yr .\"\nif (C1<C2 and SC1>SC2):\n print \"The 300-psia exchanger costs less to purchase and install, but it costs more to operate. Choosing the more expensive, 150-psia exchanger is the obvious choice.\"\nelif (C1>C2 and SC1<SC2):\n print \"The 150-psia exchanger costs less to purchase and install, but it costs more to operate. Choosing the more expensive, 300-psia exchanger is the obvious choice.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1. The capital cost for 150 psia is : $ 36000.0 .\n The capital cost for 300 psia is : $ 26000.0 .\n2. The annual steam cost for 150 psia is : $ 256000.0 /yr .\n The annual steam cost for 300 psia is : $ 303000.0 /yr .\nThe 150-psia exchanger costs less to purchase and install, but it costs more to operate. Choosing the more expensive, 300-psia exchanger is the obvious choice.\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.9, Page number: 581"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Two small commercial power plant designs are under consideration. The first design involves a\ntraditional boiler (TB) and the second a fluidized fed (FB). For the TB system, the total capital\ncost (TCC_TB) is $2.5 million, the annual operating costs (AOC_TB) are $1.2 million, and the annual\nrevenue generated from the facility (R_TB) is $3.6 million. For the FB system, TCC_TB, AOC_TB and R_TB are\n$3.5, 1.4 and 5.3 million, respectively. Using straight-line depreciation and the discounted cash\nflow method, which unit is more attractive? Assume a 10-yr facility lifetime and a 2 yr construction\nperiod. Note that the solution involves the calculation of the rate of return for each of the two\nproposals.(11)\n'''\n\nfrom __future__ import division\nfrom sympy import symbols,solve\nfrom scipy.optimize import fsolve\n\n#Variable declaration:\nTCC_TB = 2500000 #Total capital cost ($)\nR_TB = 3600000 #R_TBevenue generated from the facility ($)\nAOC_TB = 1200000 #Annual operating costs ($)\nTCC_FB = 3500000 #Total capital cost ($)\nR_FB = 5300000 #R_TBevenue generated from the facility ($)\nAOC_FB = 1400000 #Annual operating costs ($)\nn = 10 \t#Time of facility (yr)\n\n#Calculation:\nD = 0.1*TCC_TB #Depriciation ($)\nWC = 0.1*TCC_TB #Working capital ($)\nTI = R_TB-AOC_TB-D #Taxable income ($)\nIT = 0.5*TI #Income tax to be paid ($)\nA = R_TB-AOC_TB-IT #After-tax cash flow ($)\ndef eqTB(i):\n\tx = (((1+i)**n-1)/(i*(1+i)**n))*A + (1/(1+i)**n)*WC #Equation for computing rate of return for TB unit\n\ty = WC + 0.5*TCC_TB + 0.5*TCC_TB*(1+i)**1 #Equation for computing rate of return for TB unit\n\treturn x-y\niTB = round(fsolve(eqTB,0.8)*100,1) #Rate of return for TB unit (%)\n\nD = 0.1*TCC_FB #Depriciation ($)\nWC = 0.1*TCC_FB #Working capital ($)\nTI = R_FB-AOC_FB-D #Taxable income ($)\nIT = 0.5*TI #Income tax to be paid ($)\nA = R_FB-AOC_FB-IT #After-tax cash flow ($)\n\ndef eqFB(i):\n\tx = (((1+i)**n-1)/(i*(1+i)**n))*A + (1/(1+i)**n)*WC #Equation for computing rate of return for FB unit\n\ty = WC + 0.5*TCC_FB + 0.5*TCC_FB*(1+i)**1 #Equation for computing rate of return for FB unit\n\treturn x-y\niFB = round(fsolve(eqFB,0.8)*100,1) #Rate of return for FB unit (%)\n\n#Results:\nprint \"The rate of return for TB unit is:\",round(iTB),\" %.\"\nprint \"The rate of return for FB unit is:\",round(iFB,1),\" %.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The rate of return for TB unit is: 40.0 %.\nThe rate of return for FB unit is: 44.8 %.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.10, Page number: 582"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A stream of 100,000 acfm flue gas from a utility facility is to be cooled in an air preheater. You\nhave been requested to find the best unit to install to cool the flue gas and preheat the combustion\nair feed to the boiler. A reputable vendor has provided information on the cost of three units, as\nwell as installation, operating, and maintenance costs. Table 27.4 summarizes all the data you\nhave collected. Determine what preheater you would select in order to minimize costs on an\nannualized basis.\n'''\n\n#Variable declaration:\nf = 100000 #Flow rate of flue gas (acfm)\ni = 0.1 #Interest rate\n#From table 27.4:\n#For finned preheater:\nac1 = 3.1 #Equipment cost ($/acfm)\nac2 = 0.8 #Installation cost ($/acfm)\nac3 = 0.06 #Operating cost ($/acfm-yr)\nac4 = 14000 #Maintenance cost ($/yr)\nan = 20 #Lifetime (yr)\n#For 4-pass preheater:\nbc1 = 1.9 #Equipment cost ($/acfm)\nbc2 = 1.4 #Installation cost ($/acfm)\nbc3 = 0.06 #Operating cost for ($/acfm-yr)\nbc4 = 28000 #Maintenance cost ($/yr)\nbn = 15 #Lifetime of (yr)\n#For 2-pass preheater:\ncc1 = 2.5 #Equipment cost ($/acfm)\ncc2 = 1.0 #Installation cost ($/acfm)\ncc3 = 0.095 #Operating cost for ($/acfm-yr)\ncc4 = 9500 #Maintenance cost for ($/yr)\ncn = 20 #Lifetime of (yr)\n\n#Calculation:\n#For Finned preheater:\naEC = f*ac1 #Total equipment cost ($)\naIC = f*ac2 #Total installation cost ($)\naOC = f*ac3 #Total operating cost ($)\naMC = f*ac4 #Total maintenance cost ($)\naCRF = (i*(1+i)**an)/((1+i)**an-1) #Capital recovery factor\naAEC = aEC*aCRF #Equipment annual cost ($/yr)\naAIC = aIC*aCRF #Installation annual cost($/yr)\naAOC = ac3*f #Annual operating cost ($)\naAMC = ac4 #Annual maintenance cost ($)\naTAC = aAEC+aAIC+aAOC+aAMC #Total annual cost ($)\n\n#For 4-pass preheater:\nbEC = f*bc1 #Total equipment cost ($)\nbIC = f*bc2 #Total installation cost ($)\nbOC = f*bc3 #Total operating cost ($)\nbMC = f*bc4 #Total maintenance cost ($)\nbCRF = (i*(1+i)**bn)/((1+i)**bn-1) #Capital recovery factor\nbAEC = bEC*bCRF #Equipment annual cost ($/yr)\nbAIC = bIC*bCRF #Installation annual cost($/yr)\nbAOC = bc3*f #Annual operating cost ($)\nbAMC = bc4 #Annual maintenance cost ($)\nbTAC = bAEC+bAIC+bAOC+bAMC #Total annual cost ($)\n#For 2-pass preheater:\ncEC = f*cc1 #Total equipment cost ($)\ncIC = f*cc2 #Total installation cost ($)\ncOC = f*cc3 #Total operating cost ($)\ncMC = f*cc4 #Total maintenance cost ($)\ncCRF = (i*(1+i)**cn)/((1+i)**cn-1) #Capital recovery factor\ncAEC = cEC*cCRF #Equipment annual cost ($/yr)\ncAIC = cIC*cCRF #Installation annual cost($/yr)\ncAOC = cc3*f #Annual operating cost ($)\ncAMC = cc4 #Annual maintenance cost ($)\ncTAC = cAEC+cAIC+cAOC+cAMC #Total annual cost ($)\n\n#Result:\nprint \"Total annual cost for finned preheater is : $\",round(aTAC),\" .\"\nprint \"Total annual cost for 4-pass preheater is : $\",round(bTAC),\" .\"\nprint \"Total annual cost for 2-pass preheater is : $\",round(cTAC),\" .\"\nif (cTAC<aTAC and cTAC<bTAC):\n print \"According to the analysis, the 2-pass exchanger is the most economically attractive device since the annual cost is the lowest.\"\nelif (bTAC<aTAC and bTAC<cTAC):\n print \"According to the analysis, the 4-pass exchanger is the most economically attractive device since the annual cost is the lowest.\"\nelif (aTAC<cTAC and aTAC<bTAC):\n print \"According to the analysis, the finned exchanger is the most economically attractive device since the annual cost is the lowest.\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Total annual cost for finned preheater is : $ 65809.0 .\nTotal annual cost for 4-pass preheater is : $ 77386.0 .\nTotal annual cost for 2-pass preheater is : $ 60111.0 .\nAccording to the analysis, the 2-pass exchanger is the most economically attractive device since the annual cost is the lowest.\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.12, Page number: 584"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Shannon O\u2019Brien, a recent graduate from Manhattan College\u2019s prestigious chemical engineering\nprogramwas given an assignment to design the most cost-effective heat exchanger to recover\nenergy from a hot flue gas at 500\u00b0F. The design is to be based on pre-heating 1008F incoming air\n(to be employed in the boiler) to a temperature that will result in the maximum annual profit to\nthe utility. A line diagram of the proposed countercurrent exchanger is provided in Figure 27.2.\nHaving just completed a heat transfer course with Dr. Flynn and a thermodynamics course\nwith the infamous Dr. Theodore, Shannon realizes that their are two costs that need to be\nconsidered:\n1. the heat exchanger employed for energy recovery, and\n2. the \u201cquality\u201d (from an entropy perspective) of the recovered energy\u2014refer to Chapter\n20 for additional details.\nShe also notes that the higher the discharge temperature of the heated air, t, the smaller will be\nthe temperature difference driving force, and the higher the area requirement of the exchanger\nand the higher the equipment cost. Alternatively, with a higher t, the \u201cquality\u201d of the recovered\nenergy is higher, thus leading to an increase in recovered profits (by reducing fuel costs).\nBased on similar system designs, Ricci Consultants (RC) has provided the following annual\neconomic models:\nRecovered energy profit: A(t - tc); A = $/yr.\u00b0F\nExchange cost: B/(TH - t); B = $.\u00b0F/yr\nFor the above system, RC suggests a value for the coefficients in the cost model be set at:\nA = 10\nB = 100,000\nEmploying the above information, Shannon has been asked to calculate a t that will\n1. provide breakeven operation\n2. maximize profits\nShe is also required to perform the calculation if A = 10, B = 4000, and A = 10, B = 400,000.\nFinally, an analysis of the results is requested.\n'''\nfrom __future__ import division\nfrom numpy import roots\nfrom math import sqrt\n\n#Variable declaration:\nTH = 500 #Hot stream temperature at exchanger 1 (\u00b0F)\ntc = 100 #Cold stream temperature at exchanger 2 (\u00b0F)\nA = 10 #Constant A\nB1 = 100000 #Constant B1\nB2 = 4000 #Constant B2\nB3 = 400000 #Constant B3\n\n#Calculations:\n#It forms equation fo form t^2 - t(Th-tc) +tcTH +B/A\nt1 = roots([1, -(TH+tc),(tc*TH + B1/A) ]); #Roots\ntmax1 = TH - sqrt(B1/A) #Upon maximising profit\nt2 = roots([1, -(TH+tc),(tc*TH + B2/A) ]); #Roots\ntmax2 = TH - sqrt(B2/A) #Upon maximising profit\nt3 = roots([1, -(TH+tc),(tc*TH + B3/A) ]); #Roots\ntmax3 = TH - sqrt(B3/A) #Upon maximising profit\n\n#Results:\nprint 'tBE for case 1: ',round(t1[0]),'\u00b0F',round(t1[1]),'\u00b0F'\nprint 'tmax1:', round(tmax1),'\u00b0F'\nprint 'tBE for case 2: ',round(t2[0]),'\u00b0F',round(t2[1]),'\u00b0F'\nprint 'tmax1:', round(tmax2),'\u00b0F'\nprint 'tBE for case 1: ',round(t3[0]),'\u00b0F',round(t3[1]),'\u00b0F'\nprint 'tmax1:', round(tmax3),'\u00b0F'",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "tBE for case 1: 473.0 \u00b0F 127.0 \u00b0F\ntmax1: 400.0 \u00b0F\ntBE for case 2: 499.0 \u00b0F 101.0 \u00b0F\ntmax1: 480.0 \u00b0F\ntBE for case 1: 300.0 \u00b0F 300.0 \u00b0F\ntmax1: 300.0 \u00b0F\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 27.15, Page number: 588"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''Refer to the two previous examples. Calculate values of qA and qB that will maximize the profit\nfrom this process. Also calculate the annual (365 day basis) profit based on this condition.\n'''\n\nfrom __future__ import division\nfrom scipy.optimize import fmin_cobyla as optimize\n\n#Key:\n#f(x) : Objective Function\n#ci(x)'s : Constraints\n\n#Variable Declaration:\ndef f(x):\t\n return -1.70*x[0] - 2*x[1]\n\ndef c1(x):\n return 8000 - x[0]\n\ndef c2(x):\n return 6000 - x[1]\n\ndef c3(x):\n return 12000 - 0.75*x[0] - 0.40*x[1]\n\ndef c4(x):\n return 6000 - 0.60*x[0] - 0.25*x[1]\n\ndef c5(x):\n return x[0]\n\ndef c6(x):\n return x[1]\n\n#Calculation\nX = optimize(f,[7000,6000],[c1,c2,c3,c4,c5,c6], disp = 0)\n\n#Result:\nprint \"Maximum Profit is $\",-f(X), \"/day or $\", -365*f(X), \"/year\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Maximum Profit is $ 24750.0 /day or $ 9033750.0 /year\n"
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_28.ipynb b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_28.ipynb
new file mode 100644
index 00000000..ada59276
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/Chapter_28.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 28"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 28: Open-Ended Problems"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "ILLUSTRATIVE EXAMPLE 28.11, Page number: 600"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "'''A plant has three streams to be heated (see Table 28.3) and three streams to be cooled (see\nTable 28.4). Cooling water (90\u00b0F supply, 155\u00b0F return) and steam (saturated at 250 psia) are\navailable. Note that the saturated steam at 250 psia has a temperature of 401\u00b0F. Calculate the\nheating and cooling duties and indicate what utility (or utilities) should be employed.\n'''\n\n#Variable declaration:\n#From table 28.3:\n#For stream 1 to be heated:\nhm1 = 50000 #Mass flowrate (lb/h)\nhcP1 = 0.65 #Heat capacity (Btu/lb.\u00b0F)\nhTi1 = 70 #Inlet temperature (\u00b0F)\nhTo1 = 300 #Outlet temperature (\u00b0F)\n#For stream 2 to be heated:\nhm2 = 60000 #Mass flowrate (lb/h)\nhcP2 = 0.58 #Heat capacity (Btu/lb.\u00b0F)\nhTi2 = 120 #Inlet temperature (\u00b0F)\nhTo2 = 310 #Outlet temperature (\u00b0F)\n#For stream 3 to be heated:\nhm3 = 80000 #Mass flowrate (lb/h)\nhcP3 = 0.78 #Heat capacity (Btu/lb.\u00b0F)\nhTi3 = 90 #Inlet temperature (\u00b0F)\nhTo3 = 250 #Outlet temperature (\u00b0F)\n#From table 28.4:\n#For stream 1 to be cooled:\ncm1 = 60000 #Mass flowrate (lb/h)\nccP1 = 0.70 #Heat capacity (Btu/lb.\u00b0F)\ncTi1 = 420 #Inlet temperature (\u00b0F)\ncTo1 = 120 #Outlet temperature (\u00b0F)\n#For stream 2 to be cooled:\ncm2 = 40000 #Mass flowrate (lb/h)\nccP2 = 0.52 #Heat capacity (Btu/lb.\u00b0F)\ncTi2 = 300 #Inlet temperature (\u00b0F)\ncTo2 = 100 #Outlet temperature (\u00b0F)\n#For stream 3 to be cooled:\ncm3 = 35000 #Mass flowrate (lb/h)\nccP3 = 0.60 #Heat capacity (Btu/lb.\u00b0F)\ncTi3 = 240 #Inlet temperature (\u00b0F)\ncTo3 = 90 #Outlet temperature (\u00b0F)\n\n#Calculation:\nH1 = hm1*hcP1*(hTo1-hTi1) #Heating duty for stream 1 (Btu/h)\nH2 = hm2*hcP2*(hTo2-hTi2) #Heating duty for stream 2 (Btu/h)\nH3 = hm3*hcP3*(hTo3-hTi3) #Heating duty for stream 1 (Btu/h)\nH = H1+H2+H3 #Total heating duty (Btu/h)\nC1 = cm1*ccP1*(cTi1-cTo1) #Cooling duty for stream 1 (Btu/h)\nC2 = cm2*ccP2*(cTi2-cTo2) #Cooling duty for stream 2 (Btu/h)\nC3 = cm3*ccP3*(cTi3-cTo3) #Cooling duty for stream 1 (Btu/h)\nC = C1+C2+C3 #Total Cooling duty (Btu/h)\n\n#Result:\nprint \"Table: Duty Requirements.\"\nprint \"Stream Duty, Btu/h\"\nprint \"1 \",round(H1)\nprint \"2 \",round(H2)\nprint \"3 \",round(H3)\nprint \"4 \",round(C1)\nprint \"5 \",round(C2)\nprint \"6 \",round(C3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Table: Duty Requirements.\nStream Duty, Btu/h\n1 7475000.0\n2 6612000.0\n3 9984000.0\n4 12600000.0\n5 4160000.0\n6 3150000.0\n"
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/README.txt b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/README.txt
new file mode 100644
index 00000000..7cc312e6
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Amitesh Kumar
+Course: btech
+College/Institute/Organization: Manav Rachna International University
+Department/Designation: Electrical & Electronic Engg.
+Book Title: Heat Transfer Applications for the Practicing Engineer
+Author: Louis Theodore
+Publisher: John Wiley & Sons Inc. Publication
+Year of publication: 2011
+Isbn: 9780470643723
+Edition: 1st \ No newline at end of file
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/economics.png b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/economics.png
new file mode 100644
index 00000000..e58b6698
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/economics.png
Binary files differ
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/forced_convention.png b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/forced_convention.png
new file mode 100644
index 00000000..44694e5e
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/forced_convention.png
Binary files differ
diff --git a/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/shell_heat.png b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/shell_heat.png
new file mode 100644
index 00000000..427304c9
--- /dev/null
+++ b/Heat_Transfer_Applications_for_the_Practicing_Engineer_/screenshots/shell_heat.png
Binary files differ
diff --git a/Hydraulics/Chapter_1.ipynb b/Hydraulics/Chapter_1.ipynb
new file mode 100644
index 00000000..558e6301
--- /dev/null
+++ b/Hydraulics/Chapter_1.ipynb
@@ -0,0 +1,964 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Hydrostatics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page no : 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find pressure of water\n",
+ "\n",
+ "#initialisation of variables\n",
+ "h1 = 2 \t\t\t#in\n",
+ "h2 = 2 \t\t\t#in\n",
+ "wn = 13.6 \t\t\t#g/cc\n",
+ "w = 1 \t\t\t#g/cc\n",
+ "W = 62.4 \t\t\t#lbs/ft**3\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "ha = ((h2*wn/w)-h1)/12\n",
+ "pa = ha*W/144\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Pressure of water = %.2f lb/sq in '%(pa)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure of water = 0.91 lb/sq in \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 page no : 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "pressure difference in ft of water\n",
+ "reading of mercury\n",
+ "'''\n",
+ "\n",
+ "#initialisation of variables\n",
+ "a = 6 \t\t\t#ft\n",
+ "h = 2 \t\t\t#ft\n",
+ "sm = 13.6\n",
+ "sw = 1\n",
+ "sl =0.8\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "dh = h*(sm-sw)+a\n",
+ "h1 = (dh-a)/(sl-1)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'pressure difference in ft of water = %.1f ft of water '%(dh)\n",
+ "print 'reading of mercury = %.f ft of liquid '%(h1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure difference in ft of water = 31.2 ft of water \n",
+ "reading of mercury = -126 ft of liquid \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 page no : 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# FIND THE INTENSITY OF PRESSURE IN TERMS OF FT OF WATER AT POINTS A,B,C and D\n",
+ "\n",
+ "#initialisation of variables\n",
+ "sm = 13.6\n",
+ "so = 0.9\n",
+ "sw =1\n",
+ "hb = 8 \t\t\t#ft\n",
+ "hc = 7.5 \t\t\t#ft\n",
+ "hd = 1.75 \t\t\t#ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "pa = (sm-so)*sw\n",
+ "pc = pa - hb*so\n",
+ "pd = pa+so*2-sm*2.5-hc\n",
+ "pb = hb+hd+pd\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'pressure at A = %.2f ft of water '%(pa)\n",
+ "print 'pressure at B = %.2f ft of water '%(pb)\n",
+ "print 'pressure at C = %.2f ft of water '%(pc)\n",
+ "print 'pressure at D = %.2f ft of water '%(pd)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure at A = 12.70 ft of water \n",
+ "pressure at B = -17.25 ft of water \n",
+ "pressure at C = 5.50 ft of water \n",
+ "pressure at D = -27.00 ft of water \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4 page no : 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Reading of the pressure guage at the top of tank\n",
+ "\n",
+ "#initialisation of variables\n",
+ "lm = 2 \t\t\t#ft\n",
+ "lw = 5 \t\t\t#ft\n",
+ "lo = 8 \t\t\t#ft\n",
+ "so = 0.75\n",
+ "p = 40 \t\t\t#lb/in**2\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "sm = 13.6\n",
+ "#CALCULATIONS\n",
+ "h = p*144/w\n",
+ "Pd = (h-lm*sm)\n",
+ "Pc = Pd-lw\n",
+ "Pb = Pc-lo*so\n",
+ "Pg = Pb*w/144\n",
+ "#RESULTS\n",
+ "print 'Reading of the pressure guage at the top of tank = %.1f lb/in**2 '%(Pg)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reading of the pressure guage at the top of tank = 23.4 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5 page no : 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the pressure in lb/sq. in\n",
+ "\n",
+ "#initialisation of variables\n",
+ "h = 42 \t\t\t#in\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "#RESULTS\n",
+ "D = h*w/(144*12)\n",
+ "#CALCULATIONS\n",
+ "print 'Depth of point = %.1f lb/in**2 '%(D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth of point = 1.5 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6 pageno : 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the pressure exerted by a vertical column\n",
+ "\n",
+ "#initialisation of variables\n",
+ "h = 200 \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "#RESULTS\n",
+ "D = h*w/(144)\n",
+ "#CALCULATIONS\n",
+ "print 'Depth of point = %.1f lb/in**2 '%(D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth of point = 86.7 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.7 pageno :15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Total pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "l = 2 \t\t\t#ft\n",
+ "b = 3 \t\t\t#ft\n",
+ "h = 10 \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "P = w*l*b*h\n",
+ "#RESULTS\n",
+ "print 'Total pressure = %.f lb '%(P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total pressure = 3744 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.8 page no : 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Total pressure\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "l = 2. \t\t\t#ft\n",
+ "b = 3. \t\t\t#ft\n",
+ "a = 60. \t\t\t#degrees\n",
+ "h = 8. \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "#CALCULATIONS\n",
+ "x = h+(b/l)*math.cos(math.radians(a))\n",
+ "P = w*l*b*x\n",
+ "#RESULTS\n",
+ "print 'total pressure = %.f lb '%(P)\n",
+ "\n",
+ "\n",
+ "# Note : Answer is different in book please calculate manually using calculator."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total pressure = 3276 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.9 page no : 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find total pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "l = 2. \t\t\t#ft\n",
+ "b = 3. \t\t\t#ft\n",
+ "h = 8. \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "#CALCULATIONS\n",
+ "P = w*l*b*(h+(b/2))\n",
+ "#RESULTS\n",
+ "print 'total pressure = %.f lb '%(P)\n",
+ "\n",
+ "# Note : Answer is different in book please calculate manually using calculator."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total pressure = 3557 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.10 pageno : 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Total pressure\n",
+ "Depth\n",
+ "pressure in ft\n",
+ "'''\n",
+ "#initialisation of variables\n",
+ "l = 6. \t\t\t#ft\n",
+ "b = 4. \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lbs/ft**3\n",
+ "h = 10. \t\t\t#ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P = w*l*b*(b/2)\n",
+ "hn = (b/2)+(l*b**3/(12*l*b*(b/2)))\n",
+ "P1 = w*(h+(b/2))*l*b\n",
+ "h1 = (h+(b/2))+(l*b**3/(12*l*b*(h+(b/2))))\n",
+ "\n",
+ "#RESULTS\n",
+ "print \"Total pressure = %d lb\"%(P1)\n",
+ "print \"Depth = %.2f ft\"%(hn)\n",
+ "print 'pressure in ft in case 2 = %.3f ft '%(h1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total pressure = 17971 lb\n",
+ "Depth = 2.67 ft\n",
+ "pressure in ft in case 2 = 12.111 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.11 page no : 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "force exerted by the oil \n",
+ "position of centre of pressure\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "sp = 0.87\n",
+ "d = 12. \t\t\t#ft\n",
+ "W = 62.4 \t\t\t#lb/ft**3\n",
+ "Wa = 30. \t\t\t#lb/in**2\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "A = math.pi*d**2/4\n",
+ "w = W*sp\n",
+ "x = Wa*144/(w)\n",
+ "P = round(w*A*x,-3)\n",
+ "h = x+(A*d**2/16/(A*x))\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'force exerted by the oil upon the gate = %.f lb '%(P)\n",
+ "print ' position of centre of pressure = %.3f ft '%(h)\n",
+ "\n",
+ "# Note : Answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "force exerted by the oil upon the gate = 489000 lb \n",
+ " position of centre of pressure = 79.689 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.12 page no : 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find level of water\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "a = 60. \t\t\t#degrees\n",
+ "l = 18. \t\t\t#ft\n",
+ "b = 4. \t\t\t#ft\n",
+ "W = 8000. \t\t\t#lb\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P = w*b/(math.sin(math.radians(a))*2)\n",
+ "h = ((b/(12*(math.sin(math.radians(a)))**3))*(math.sin(math.radians(a)))**2/(b/(math.sin(math.radians(a))*2)))+0.5\n",
+ "h1 = (1-h)/math.sin(math.radians(a))\n",
+ "x = ((l*W)/(h1*P))**(1./3)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Level of water = %.2f ft '%(x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Level of water = 13.74 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.13 page no : 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Total comression in the promp CD\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "l = 12 \t\t\t#ft\n",
+ "b = 6 \t\t\t#ft\n",
+ "h = 5.196 \t\t\t#ft\n",
+ "a = 60 \t\t\t#degrees\n",
+ "a1 = 45 \t\t\t#degrees\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P = w*l*b*h/2\n",
+ "h1 = ((l*b**3*(math.sin(math.radians(a)))**2/12)/(l*b*(h/2)))+(h/2)\n",
+ "R = round(P*(b-(h1/math.cos(math.radians(a/2))))/((b*math.sin(math.radians(a1)))/2),-2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Total comression in the promp CD = %.f lb '%(R)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total comression in the promp CD = 11000 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.14 page no : 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "depth of centre of pressure\n",
+ "force F required to act horizontally at the top of gate\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "h = 4. \t\t\t#ft\n",
+ "b = 6. \t\t\t#ft\n",
+ "sg = 1.45\n",
+ "h1 = 5. \t\t\t#ft\n",
+ "a = 90. \t\t\t#degrees\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P1 = w*sg*h*b*(h1+(h/2))\n",
+ "P2 = w*h*b*(h/2)\n",
+ "Pr = P1-P2\n",
+ "hup = ((b*h**3/12)*(math.sin(math.radians(a)))**2/(h*b*(h1+(h/2))))+(h1+(h/2))\n",
+ "x1 = h+h1-hup\n",
+ "hd = h*2/3\n",
+ "x2 = h-hd\n",
+ "x = (P1*x1-P2*x2)/Pr\n",
+ "d = h1+h-x\n",
+ "F = Pr*x/4\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'P resultant = %.f lb '%(Pr)\n",
+ "print 'depth of centre of pressure = %.3f ft '%(d)\n",
+ "print 'force F required to act horizontally at the top of gate = %.f lb '%(F)\n",
+ "\n",
+ "\n",
+ "# Note : The answer given in texxtbook is wrong. Please check using a calculator.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P resultant = 12205 lb \n",
+ "depth of centre of pressure = 7.074 ft \n",
+ "force F required to act horizontally at the top of gate = 5878 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.15 page no : 23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find magnitude and position of the resultant water pressure.\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "w = 15. \t\t\t#ft\n",
+ "D = 15. \t\t\t#ft\n",
+ "W = 62.4 \t\t\t#lb/ft**3\n",
+ "a = 120. \t\t\t#degrees\n",
+ "h1 = 15. \t\t\t#ft\n",
+ "h2 = 4. \t\t\t#/ft\n",
+ "h3 = 18. \t\t\t#ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Pu = round(w*D*W*w/2,-3)\n",
+ "hu = ((w*D**3/12)/(w**2*D/2))+w/2\n",
+ "Pd = W*h2*w*h2/2-8\n",
+ "hd = ((w*h2**3/12)/(h2*h1*(h2/2)))+(h2/2)\n",
+ "P = Pu-Pd\n",
+ "h = (Pu*(h1-hu)-Pd*(h2-hd))/P\n",
+ "F = P/(2*math.sin(math.radians(a/4)))\n",
+ "RT = round(F*(h3-(h1/10)-h)/(h3-(h1/5)),-3)\n",
+ "RB =F-RT\n",
+ "\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Resultant water pressure on each gate : %d lb'%P\n",
+ "print 'Height of c.p from bottom %.2f ft'%h\n",
+ "print 'RB = %.f lb '%(RB)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant water pressure on each gate : 97520 lb\n",
+ "Height of c.p from bottom 5.28 ft\n",
+ "RB = 24520 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.16 page no : 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "a) the resultant thrust on the base per ft length of dam\n",
+ "b) distribution of normal stress on base,\n",
+ "c) normal stress on the vertical plane at the base\n",
+ "'''\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "h = 42. \t\t\t#ft\n",
+ "w = 25. \t\t\t#ft\n",
+ "d = 8. \t\t\t#ft\n",
+ "W = 150. \t\t\t#lb/ft**3\n",
+ "w1 = 62.4 \t\t\t#lb/ft**3\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "W1 = W*(h*d+(h*(w-d)/2))\n",
+ "P = round(w1*h*(h/2),-3)\n",
+ "R = round(math.sqrt(W1**2+P**2)-100,-2)\n",
+ "o = math.tan(math.radians(P/W1))\n",
+ "AE = round((d*h*(d/2)+(w-d)*h*(d+(w-d)/3)/2)/(d*h+h*(w-d)/2),2)\n",
+ "EF = round(14*P/W1,2)\n",
+ "AF = EF+AE\n",
+ "AH = w/2\n",
+ "e = round(AF-AH,1)\n",
+ "BS = round(W1*e*AH/(w**3/12),-1)\n",
+ "DS = W1/w-3\n",
+ "Smax = BS+DS\n",
+ "Smin = DS-BS\n",
+ "u = w1 * h\n",
+ "#RESULTS\n",
+ "print \"Resultant thrust R = %d lb\"%R\n",
+ "print 'S max = %.f lb/sq ft '%(Smax)\n",
+ "print ' S min = %.f lb/sq ft '%(Smin)\n",
+ "print 'Normal stress on vertical plane at the base due to water pressure and is uniform = %d lb/sq ft'%u"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant thrust R = 117500 lb\n",
+ "S max = 8045 lb/sq ft \n",
+ " S min = 265 lb/sq ft \n",
+ "Normal stress on vertical plane at the base due to water pressure and is uniform = 2620 lb/sq ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 86
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.17 page no : 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Volume of concrete\n",
+ "\n",
+ "#initialisation of variables\n",
+ "W = 145. \t\t\t#lb/cu ft\n",
+ "M = 500. \t\t\t#lb\n",
+ "W1 = 64. \t\t\t#lb/cu ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "dW = W-W1\n",
+ "V = M/dW\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Volume of concrete = %.1f cu ft '%(V)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume of concrete = 6.2 cu ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.18 page no : 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Depth necessary to just float the ship in river\n",
+ "\n",
+ "#initialisation of variables\n",
+ "W = 10000. \t\t\t#tons\n",
+ "A = 15000. \t\t\t#ft**2\n",
+ "d = 15. \t\t\t#ft\n",
+ "Dsw = 64. \t\t\t#lb/ft**3\n",
+ "Dw = 62.4 \t\t\t#lb/ft**3\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Vsw = 2240./Dsw\n",
+ "Vw = 2240./Dw\n",
+ "dV = Vw-Vsw\n",
+ "V1 = W*dV\n",
+ "h = W/A\n",
+ "h1 = d+h\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Depth necessary to just float the ship in river = %.2f ft '%(h1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth necessary to just float the ship in river = 15.67 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.19 page no : 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Rightening moment\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "W = 5000. \t\t\t#tons\n",
+ "w = 10. \t\t\t#tons\n",
+ "d = 30. \t\t\t#ft\n",
+ "x = 5.5 \t\t\t#in\n",
+ "l = 10. \t\t\t#ft\n",
+ "a = 15. \t\t\t#degrees\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "GM = round((w*d)*l/(W*(x/12)),1)\n",
+ "M = round(GM*math.sin(math.radians(a))*W,-1)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Metacentric Height = %.1f ft'%GM\n",
+ "print 'Rightening moment = %.f lb '%(M)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Metacentric Height = 1.3 ft\n",
+ "Rightening moment = 1680 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.20 page no : 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate angle through which the cube will tilt\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#initialisation of variables\n",
+ "l = 5. \t\t\t#ft\n",
+ "h = 20. \t\t\t#in\n",
+ "n = 1./15\n",
+ "AG = 50. \t\t\t#in\n",
+ "x = 30. \t\t\t#in\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "AG1 = round(AG/(1+n),1)\n",
+ "G1G2 = round(n*x/(1+n),2)\n",
+ "W = l**2*w*(l/2)\n",
+ "h1 = 32. \t\t\t#in\n",
+ "BK = h1/2\n",
+ "GK = 10. \t\t\t#in\n",
+ "G1K = (AG+GK)-AG1\n",
+ "BG1 = BK-G1K\n",
+ "BM = (l**4./12)*2.*12/(l**3*BK*n)\n",
+ "G1M = BM+BG1\n",
+ "o = G1G2/G1M\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'AG1 = %.1f in.'%AG1\n",
+ "print 'G1G2 = %.2f in.'%G1G2\n",
+ "print 'angle through which the cube will tilt = %.3f in '%(o)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "AG1 = 46.9 in.\n",
+ "G1G2 = 1.88 in.\n",
+ "angle through which the cube will tilt = 0.153 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Hydraulics/Chapter_2.ipynb b/Hydraulics/Chapter_2.ipynb
new file mode 100644
index 00000000..66db0d7d
--- /dev/null
+++ b/Hydraulics/Chapter_2.ipynb
@@ -0,0 +1,400 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Hydrodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 pageno : 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge in gal per min and also average velocities at the two sections\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "Q = 0.8 \t\t\t#ft**3/sec\n",
+ "w = 62.4 \t\t\t#lb/sec\n",
+ "d1 = 3. \t\t\t#in\n",
+ "d2 = 1.5 \t\t\t#in\n",
+ "#CALCULATIONS\n",
+ "Q1 = Q*w*60/10.\n",
+ "a1 = math.pi*(d1/12.)**2/4.\n",
+ "a2 = math.pi*(d2/12.)**2/4.\n",
+ "v1 = Q/a1\n",
+ "v2 = Q/a2\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Q = %.f gpm'%Q1\n",
+ "print 'v1 = %.1f ft/sec '%(v1)\n",
+ "print 'v2 = %.1f ft/sec '%(v2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 300 gpm\n",
+ "v1 = 16.3 ft/sec \n",
+ "v2 = 65.2 ft/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 page no : 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "d1 = 12. \t\t\t#in\n",
+ "d2 = 9. \t\t\t#in\n",
+ "z1 = 10. \t\t\t#ft\n",
+ "z2 = 10. \t\t\t#ft\n",
+ "p1 = 15. \t\t\t#lb/in**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "Q = 2. \t\t\t#cuses\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "v1 = Q/(math.pi*(d1/12.)**2/4.)\n",
+ "v2 = Q/(math.pi*(d2/12.)**2/4.)\n",
+ "p2 = w*(z1-z2+(p1*144/w)+(v1**2/(2*g))-(v2**2/(2*g)))/144\n",
+ "#RESULTS\n",
+ "print 'p2 = %.2f lb/in**2 '%(p2)\n",
+ "\n",
+ "# note : answer is slightly differet because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "p2 = 14.91 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 page no : 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge in gpm.\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "d0 = 4. \t\t\t#ft\n",
+ "d2 = 2. \t\t\t#ft\n",
+ "z0 = 0 \t\t\t#ft\n",
+ "z1 = 5. \t\t\t#ft\n",
+ "z2 = 13. \t\t\t#ft\n",
+ "h = 9.5 \t\t\t#in\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "w1 = 30. \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "r = 0.1\n",
+ "#CALCULATIONS\n",
+ "p2 = -h*34/w1\n",
+ "v2 = math.sqrt(2*g*(z1-p2-z2)/(1+r))\n",
+ "Q = math.pi*(d2/12)**2*v2*w*60/(10*4)\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.f gpm '%(Q)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 104 gpm \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 pageno :47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the water pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "d1 = 2 \t\t\t#ft\n",
+ "d2 = 3 \t\t\t#ft\n",
+ "v1 = 20 \t\t\t#ft/sec\n",
+ "z1 = 20 \t\t\t#ft\n",
+ "z2 = 0 \t\t\t#ft\n",
+ "h = 5 \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "Hl = v1**2*0.15/(2*g)\n",
+ "a1 = math.pi*d1**2/4\n",
+ "a2 = math.pi*d2**2/4\n",
+ "v2 = a1*v1/a2\n",
+ "p1 = ((h-z1+(v2**2)/(2*g))-(0.85*v1**2/(2*g)))\n",
+ "#RESULTS\n",
+ "print 'water pressure at top = %.2f ft of water '%(p1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "water pressure at top = -19.05 ft of water \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 page no : 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate the flow of water in gallons per hour.\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "d1 = 15. \t\t\t#in\n",
+ "d2 = 6.\t\t\t#in\n",
+ "h = 10. \t\t\t#in of mercury\n",
+ "C = 0.98\n",
+ "sm = 13.6\n",
+ "w = 12.\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "a1 = math.pi*(d1/12)**2/4\n",
+ "a2 = math.pi*(d2/12)**2/4\n",
+ "h1 = h*(sm-1)/w\n",
+ "Q = round(C*(a1*a2/(math.sqrt(a1**2-a2**2)))*math.sqrt(2*g)*math.sqrt(h1)*6.24*60*60,-2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.f gph '%(Q)\n",
+ "\n",
+ "# answer is different because of rounding error. Please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 113900 gph \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 page no : 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find rate of flow\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "d1 = 8. \t\t\t#in\n",
+ "d2 = 4. \t\t\t#in\n",
+ "h = 10. \t\t\t#in of mercury\n",
+ "Cd = 0.98\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "sm = 13.56\n",
+ "#CALCULATIONS\n",
+ "a1 = math.pi*(d1/12)**2/4\n",
+ "a2 = math.pi*(d2/12)**2/4\n",
+ "h1 = h*(sm-1)/12\n",
+ "Q = a1*a2*math.sqrt(2*g)*math.sqrt(h1)/math.sqrt(a1**2-a2**2)\n",
+ "Qactual = Cd*Q\n",
+ "#RESULTS\n",
+ "print 'Actual discharge = %.2f cusecs '%(Qactual)\n",
+ "\n",
+ "# Note : Answer is slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual discharge = 2.29 cusecs \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 page no : 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the speed of the submarine\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "h = 6.8 \t\t\t#in of mercury\n",
+ "sm = 13.6\n",
+ "ssw = 1.026\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "V = math.sqrt(2*g*h*(sm-ssw)/12)*3600/5280\n",
+ "#RESULTS\n",
+ "print 'speed of submarine = %.1f miles per hour '%(V)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "speed of submarine = 14.6 miles per hour \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 page no : 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the volume of air flowing \n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "d1 = 2. \t\t\t#in\n",
+ "d2 = 12. \t\t\t#in\n",
+ "r = 1.4\n",
+ "n = 0.905\n",
+ "Q = 2995. \t\t\t#lb/ft**2\n",
+ "w = 0.083 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "V1 = round(1/w,2)\n",
+ "n1 = round(n**((r-1)/r),2)\n",
+ "n2 = n**(2/r)\n",
+ "Q = math.pi*(d1/12)**2*math.sqrt(2*g*Q*(1-n1)*r/((r-1)*n2*(1-(d1/d2)**2)))\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Volume of air passing through the Venturimeter = %.1f cuses '%(Q)\n",
+ "\n",
+ "# note : answer is different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume of air passing through the Venturimeter = 13.5 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Hydraulics/Chapter_3.ipynb b/Hydraulics/Chapter_3.ipynb
new file mode 100644
index 00000000..52d98bab
--- /dev/null
+++ b/Hydraulics/Chapter_3.ipynb
@@ -0,0 +1,718 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Flow Through Orifices Mouthpieces Nozzles"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 page no : 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the hydraulic co-efficients.\n",
+ "\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "Q = 16. \t\t\t#gpm\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "d = 1. \t\t\t#in\n",
+ "h = 2+(5./12) \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "x = 11.5 \t\t\t#ft\n",
+ "h1 = 1.2 \t\t\t#in\n",
+ "#CALCULATIONS\n",
+ "Cd = Q*10/(60*w*(math.pi*(d/12)**2/4)*math.sqrt(2*g*h))\n",
+ "Cv = math.sqrt(x**2/(4*(h1/12)*h*12**2))\n",
+ "Cc = Cd/Cv\n",
+ "Cr = (1-Cv**2)/Cv**2\n",
+ "#RESULTS\n",
+ "print 'Cc = %.3f '%(Cc)\n",
+ "print 'Cv = %.3f '%(Cv)\n",
+ "print 'Cd = %.3f '%(Cd)\n",
+ "print 'Cr = %.3f '%(Cr)\n",
+ "\n",
+ "# note : answers are slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cc = 0.644 \n",
+ "Cv = 0.975 \n",
+ "Cd = 0.628 \n",
+ "Cr = 0.053 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 page no : 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine coefficients of velocity and contraction and discharge of the jet.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "Ww = 261. \t\t\t#lb/min\n",
+ "a = 1. \t\t\t#in**2\n",
+ "h = 4. \t\t\t#ft\n",
+ "y = 5. \t\t\t#ft\n",
+ "W1 = 10.65 \t\t\t#lb\n",
+ "l = 1. \t\t\t#ft\n",
+ "Q = 261. \t\t\t#lb/min\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "v = Q*144./(w*60)\n",
+ "F = W1*l/y\n",
+ "v = F*g*60./Q\n",
+ "vth = math.sqrt(2*g*h)\n",
+ "Cv = v/vth\n",
+ "Q1 = Ww/w\n",
+ "Qth = vth*60./144\n",
+ "Cd = Q1/Qth\n",
+ "Cc = Cd/Cv\n",
+ "#RESULTS\n",
+ "print 'Cv = %.3f '%(Cv)\n",
+ "print 'Cd = %.3f '%(Cd)\n",
+ "print 'Cc = %.3f '%(Cc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cv = 0.982 \n",
+ "Cd = 0.625 \n",
+ "Cc = 0.637 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 page no : 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "a) Head lost due to shock\n",
+ "b) pressure in the larger part of pipe\n",
+ "c) work done in forcing the water through the enlargement.\n",
+ "'''\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "Q = 10. \t\t\t#ft**3/sec\n",
+ "a1 = 1. \t\t\t#ft**2\n",
+ "a2 = 4. \t\t\t#ft**2\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "p1 = 12. \t\t\t#lb/in**2\n",
+ "v1 = 10. \t\t\t#ft/sec\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#RESULTS\n",
+ "v2 = v1*a1/a2\n",
+ "Hl = (v1-v2)**2/(2*g)\n",
+ "p2 = ((p1*144/w)+(v1**2/(2*g))-(v2**2/(2*g))-Hl)*(w/144)\n",
+ "W = Hl*v1*w/550.\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Head lost = %.3f ft of water '%(Hl)\n",
+ "print 'Pressure in larger part of pipe = %.2f lb/in**2 '%(p2)\n",
+ "print 'Work done = %.3f HP '%(W)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head lost = 0.873 ft of water \n",
+ "Pressure in larger part of pipe = 12.25 lb/in**2 \n",
+ "Work done = 0.991 HP \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 page no : 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "a) discharge in cusecs\n",
+ "b) co-efficient of discharge\n",
+ "c) absolute pressure \n",
+ "'''\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "Cc = 1.\n",
+ "Cv = 0.833\n",
+ "d = 2. \t\t\t#in\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "H = 12. \t\t\t#ft\n",
+ "Pa = 34. \t\t\t#lb/in**2\n",
+ "#/CALCULATIONS\n",
+ "Q = Cc*Cv*math.pi*(d/12)**2*math.sqrt(2*g*H)/4\n",
+ "Cd = Cc*Cv\n",
+ "Pc = Pa-0.92*H\n",
+ "#RESULTS\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.3f cu ft/sec '%(Q)\n",
+ "print 'Coefficient of discharge = %.3f '%(Cd)\n",
+ "print 'Pressure at Vent-contraction = %.2f ft of water '%(Pc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 0.505 cu ft/sec \n",
+ "Coefficient of discharge = 0.833 \n",
+ "Pressure at Vent-contraction = 22.96 ft of water \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 page no : 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find discharge per second\n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "import math \n",
+ "H = 4. \t\t\t#ft\n",
+ "d = 1. \t\t\t#in\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cc = 0.5\n",
+ "#CALCULATIONS\n",
+ "Q = Cc*math.pi*(d/12)**2*math.sqrt(2*g*H)/4\n",
+ "#RESULTS\n",
+ "print 'Actual Discharge = %.4f cu ft/sec '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual Discharge = 0.0438 cu ft/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 page no : 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the rate of discharge in gpm\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "\n",
+ "D = 4. \t\t\t#ft\n",
+ "d = 2. \t\t\t#in\n",
+ "H1 = 6. \t\t\t#ft\n",
+ "H2 = 2. \t\t\t#ft\n",
+ "t = 4. \t\t\t#min\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "H = 5. \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "Cd = (2.*(math.pi/4.)*D**2*(math.sqrt(H1)-math.sqrt(H2)))/(t*60*(math.pi/4)*(d/12)**2*math.sqrt(2*g))\n",
+ "Q = Cd*(math.pi/4)*(d/12)**2*math.sqrt(2*g*H)*w*60/10\n",
+ "#RESULTS\n",
+ "print 'Cd = %.3f '%(Cd)\n",
+ "print 'Discharge = %.1f gpm'%(Q)\n",
+ "\n",
+ "# note : answers are slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cd = 0.619 \n",
+ "Discharge = 90.8 gpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7 page no : 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find time required to lower the water level\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "H1 = 10. \t\t\t#ft\n",
+ "H2 = 2. \t\t\t#ft\n",
+ "Cd = 0.61\n",
+ "d1 = 8. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "d2 = 3. \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "a = d2**2./144\n",
+ "H0 = H1*d2/(d1-d2)\n",
+ "t = math.pi*(d1/2)**2*((2/5.)*(H1**(5./2)-H2**(5./2))+2*H0**2*(math.sqrt(H1)- \\\n",
+ "math.sqrt(H2))+(4./3)*H0*(H1**(3./2)-H2**(3./2)))/(60*Cd*a*math.sqrt(2*g)*(H1+H0)**2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'time required to lower the water level = %.2f min'%(t)\n",
+ "\n",
+ "# Note : answer is different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time required to lower the water level = 5.14 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 page no : 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the time required to empty.\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "D = 10. \t\t\t#ft\n",
+ "H1 = 17. \t\t\t#ft\n",
+ "H2 = 5. \t\t\t#ft\n",
+ "d = 3. \t\t\t#in\n",
+ "Cd = 0.62\n",
+ "g =32.2 \t\t\t#ft/s**2\n",
+ "#CALCULATIONS\n",
+ "t1 = (2*math.pi*D**2/4)*(math.sqrt(H1)-math.sqrt(H2))/(Cd*math.sqrt(2*g)*math.pi*(d/12)**2/4)\n",
+ "t2 = math.pi*(14./15)*H2**(5./2)*4/(Cd*math.pi*(d/12.)**2*math.sqrt(2*g))\n",
+ "t = t1+t2\n",
+ "#RESULTS\n",
+ "print 'time required to empty the vessel = %.f sec'%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time required to empty the vessel = 1885 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9 page no : 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find minutes will the mouthpiece empty the boiler\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "Cd = 0.8\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "d = 3. \t\t\t#in\n",
+ "#CALCULATIONS\n",
+ "t = (60*2/(math.pi*(d/12)**2*math.sqrt(2*g)/4*Cd))*(6-d)**(3./2)/(3*60./2)\n",
+ "#RESULTS\n",
+ "print 'time to emptify biler = %.2f min'%(t)\n",
+ "\n",
+ "# note : answer is different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time to emptify biler = 21.98 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.10 page no : 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the time of emptying the bath when co-efficient \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "A = 100 * 27 # sq ft\n",
+ "dif = 8 - 3. # ft\n",
+ "a = 2. # sq ft\n",
+ "Cd = 0.8 # Co-efficient\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t1 = round(A*((a/3 * 22.7) - a/3 * 5.19 - (a/3*11.2))/(Cd*2*8.02*dif))\n",
+ "t2 = round(A*(2./3)*11.2/(Cd*a*8.02*dif))\n",
+ "t = t1 + t2\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Total time to empty the tank = %d sec'%t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total time to empty the tank = 491 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11 page no : 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find time required to reduce the difference of water levels\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "H1 = 9. \t\t\t#ft\n",
+ "H2 = 4. \t\t\t#ft\n",
+ "Cd = 0.6\n",
+ "a = 4. \t\t\t#in**2\n",
+ "A1 = 72. \t\t\t#ft**2\n",
+ "A2 = 24. \t\t\t#ft**2\n",
+ "g =32.2 \t\t\t#ft/s**2\n",
+ "#CALCULATIONS\n",
+ "t = (2*A1*A2/(A1+A2))*(math.sqrt(H1)-math.sqrt(H2))*144/(Cd*60*a*math.sqrt(2*g))\n",
+ "#RESULTS\n",
+ "print 'time required to reduce the water level difference = %.1f min'%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time required to reduce the water level difference = 4.5 min\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.12 pageno : 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the size of a square orifice placed below the tail water level.\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "l = 80. \t\t\t#ft\n",
+ "w = 12. \t\t\t#ft\n",
+ "t = 3. \t\t\t#min\n",
+ "Hl = 12. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cd = 0.6\n",
+ "#CALCULATIONS\n",
+ "s = math.sqrt(2*l*w*Hl**(1./2)/(Cd*math.sqrt(2*g)*t*60.))\n",
+ "#RESULTS\n",
+ "print 'side of the square orifice = %.2f ft'%(s)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "side of the square orifice = 2.77 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.13 page no : 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find How much water will escape through the orifice d\n",
+ "\n",
+ "#initialisation of variables\n",
+ "import math \n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cd = 0.6\n",
+ "d = 2. \t\t\t#in\n",
+ "H1 = 5. \t\t\t#ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "K = round(Cd * math.pi/4 * (d/12)**2 * math.sqrt(g*2),3)\n",
+ "t = d*math.pi*(0.5*math.log(1.89) - 0.235)/K**2 \n",
+ "v = round(math.sqrt(2*g*H1)/2.)\n",
+ "q = v*Cd*math.pi*(d/12)**2./4\n",
+ "\n",
+ "#RESULTS\n",
+ "print \"Time required to raise the level is : %.2f sec\"%t\n",
+ "print 'Total discharge = %.3f cfs'%(q)\n",
+ "\n",
+ "# Note : answers may vary because of rounding error. Please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required to raise the level is : 47.47 sec\n",
+ "Total discharge = 0.118 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.14 page no : 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge in cu\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "Cd = 0.62\n",
+ "H = 9. \t\t\t#in\n",
+ "l = 3. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#t/sec**2\n",
+ "#CALCULATIONS\n",
+ "Q1 = Cd*(H*l/12)*math.sqrt(2*g*3*H/24.)\n",
+ "Q2 = Cd*2*l*math.sqrt(2*g)*((H/6)**(3./2)-(H/12)**(3./2))/3\n",
+ "#RESULTS\n",
+ "print 'Discharge by appropriate formula = %.2f cfs'%(Q1)\n",
+ "print ' Discharge by exact formula = %.2f cfs'%(Q2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge by appropriate formula = 11.87 cfs\n",
+ " Discharge by exact formula = 11.82 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.15 pageno : 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find appropriate discharge in cu ft/sec.\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "\n",
+ "Cd = 0.62\n",
+ "B = 2.5 \t\t\t#ft\n",
+ "H2 = 8. \t\t\t#ft\n",
+ "H1 = 7. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "h = 4. \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "Q1 = round(2*Cd*B*math.sqrt(2*g)*(H2**(3./2)-H1**(3./2))/3)\n",
+ "Q2 = Cd*math.sqrt(2*g)*math.sqrt(H2)*B*(h-1)\n",
+ "Q = Q1+Q2\n",
+ "#RESULTS\n",
+ "print 'Total discharge = %d cfs'%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total discharge = 139 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Hydraulics/Chapter_4.ipynb b/Hydraulics/Chapter_4.ipynb
new file mode 100644
index 00000000..9cf88603
--- /dev/null
+++ b/Hydraulics/Chapter_4.ipynb
@@ -0,0 +1,778 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Flow Over Weirs Notches"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 page no : 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the length of the weir\n",
+ "import math\n",
+ "#initialisation of variables\n",
+ "p = 70. \t\t\t#per cent\n",
+ "Cd = 0.6\n",
+ "Q = 50. \t\t\t#million gallons\n",
+ "H = 2. \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "Q1 = p*Q*10**6*10/(100*w*24*3600)\n",
+ "L = Q1*3/(2*Cd*math.sqrt(2*g)*H**1.5)\n",
+ "#RESULTS\n",
+ "print 'length of the weir = %.2f ft '%(L)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "length of the weir = 7.15 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 page no : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the theoretical horse power\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "L = 15. \t\t\t#ft\n",
+ "H = 1. \t\t\t#ft\n",
+ "Cd = 0.6\n",
+ "v = 80. \t\t\t#ft/min\n",
+ "g = 32.2 \t\t\t#ft/sec62\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "vo = v/60\n",
+ "Q = 2*Cd*math.sqrt(2*g)*L*((1+(vo**2/(2*g)))**1.5-(vo**2/(2*g))**1.5)*w*100/(3*550)\n",
+ "#RESULTS\n",
+ "print 'HP = %.f HP '%(Q)\n",
+ "\n",
+ "# This is accurate answer. Please calcualte manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "HP = 567 HP \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 pageno : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge per second\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "L = 11. \t\t\t#ft\n",
+ "H = 0.7 \t\t\t#ft\n",
+ "Cd = 0.6\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "h = 1.95 \t\t\t#ft\n",
+ "Q = 20.65 \t\t\t#cuses\n",
+ "Q1 = 21.2 \t\t\t#cfs\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Q = 2*Cd*math.sqrt(2*g)*L*H**1.5/3\n",
+ "vo = Q/(h*L)\n",
+ "h1 = vo**2/(2*g)\n",
+ "Q1 = 2*Cd*math.sqrt(2*g)*L*((H+(vo**2/(2*g)))**1.5-(vo**2/(2*g))**1.5)/3\n",
+ "v1 = Q1/(L*h)\n",
+ "Q2 = 2*Cd*math.sqrt(2*g)*L*((H+(v1**2/(2*g)))**1.5-(v1**2/(2*g))**1.5)/3\n",
+ "p = (Q2-Q1)*100/Q1\n",
+ "\n",
+ "#RESULTS\n",
+ "print \"Head to velocity approach = %.1f cu ft/sec\"%Q1\n",
+ "print \"Q2 = %.2f cu ft/sec\"%Q2\n",
+ "print 'discharge percent = %.3f per cent '%(p)\n",
+ "\n",
+ "# Note : answers may vary because of rounding error. Please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head to velocity approach = 21.3 cu ft/sec\n",
+ "Q2 = 21.29 cu ft/sec\n",
+ "discharge percent = 0.148 per cent \n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 page no : 106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find K and n\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "b = 3. \t\t\t#ft\n",
+ "H = 1 \t\t\t#ft\n",
+ "Q = 9 \t\t\t#cfs\n",
+ "Q1 = 1.105 # log Q from fig.\n",
+ "h = 0.1 \t\t# log H from fig. ft\n",
+ "#CALCULATIONS\n",
+ "K = Q/b\n",
+ "n = (Q1-math.log10(3*K))/h\n",
+ "#RESULTS\n",
+ "print 'K = %.f '%(K)\n",
+ "print 'n = %.1f '%(n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K = 3 \n",
+ "n = 1.5 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 page no : 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the rate of discharge\n",
+ "'''\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cd = 0.62\n",
+ "L = 7.573 \t\t\t#ft\n",
+ "H = 1.2 \t\t\t#ft\n",
+ "S = 2.85 \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "Q1 = 2*Cd*math.sqrt(2*g)*L*H**1.5/3\n",
+ "Q2 = 3.33*L*H**1.5\n",
+ "Q3 = math.sqrt(2*g)*L*H**1.5*(0.405+(0.00984/H))\n",
+ "He = H+0.004\n",
+ "Q4 = (3.227+0.435*(He/S))*L*He**1.5\n",
+ "#RESULTS\n",
+ "print 'Q = %.2f cuses '%(Q1)\n",
+ "print 'Q = %.2f cuses '%(Q2)\n",
+ "print 'Q = %.2f cuses '%(Q3)\n",
+ "print 'Q = %.2f cuses '%(Q4)\n",
+ "\n",
+ "# Note : answers may vari because of rounding error. Please check manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 33.02 cuses \n",
+ "Q = 33.15 cuses \n",
+ "Q = 33.01 cuses \n",
+ "Q = 34.12 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 pageno : 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the length of the waste weir required.\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "H = 2.5 \t\t\t#ft\n",
+ "L = 10 \t\t\t#ft\n",
+ "A = 10 \t\t\t#miles\n",
+ "p = 30 \t\t\t#per cent\n",
+ "a = 2 \t\t\t#in/hr\n",
+ "w = 2 \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "Q = L*1760**2*3**2*a*p/(60*60*12*100)\n",
+ "n = ((Q/(3.33*H**1.5))-(L-0.1*w*H))/(L-0.1*w*H)\n",
+ "#RESULTS\n",
+ "print 'n = %.f '%(n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n = 30 \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7 page no : 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge of water \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "L = 2.5 \t\t\t#ft\n",
+ "H = 1 \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cd = 0.61\n",
+ "L1 = 1.75 \t\t\t#ft\n",
+ "L2 = 2.25 \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "Q1 = 2*Cd*math.sqrt(2*g)*L*H/3\n",
+ "Q2 = 2*Cd*math.sqrt(2*g)*L1*(L1**1.5-1)/3\n",
+ "Q3 = 2*Cd*math.sqrt(2*g)*H*(L2**1.5-L1**1.5)/3\n",
+ "Q = Q1+Q2+Q3\n",
+ "#RESULTS\n",
+ "print 'Total discharge = %.1f cfs '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total discharge = 19.1 cfs \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8 page no : 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the percentage error in estimating the discharge\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "h1 = 16.63 \t\t\t#cm\n",
+ "h2 = 10.18 \t\t\t#cm\n",
+ "h3 = 16.53 \t\t\t#cm\n",
+ "#CALCULATIONS\n",
+ "H1 = h1-h2\n",
+ "H2 = h3-h2\n",
+ "p = (H1**1.5-H2**1.5)*100/H1**1.5\n",
+ "#RESULTS\n",
+ "print 'Percent decrease in discharge = %.2f %% '%(p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percent decrease in discharge = 2.32 % \n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9 pageno : 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find time required to lower the level of a reservoir of superficial area\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "Cd = 0.6\n",
+ "a = 20000 \t\t\t#yd**2\n",
+ "H2 = 12 \t\t\t#in\n",
+ "L = 5 \t\t\t#ft\n",
+ "H1 = 2 \t\t\t#ft\n",
+ "g =32.2 \t\t\t#ft/s**2\n",
+ "#CALCULATIONS\n",
+ "t = 2*a*9*(L-H1)*((1/math.sqrt(H2/12))-(1/math.sqrt(H1)))/(2*60*Cd*math.sqrt(2*g)*L)\n",
+ "#RESULTS\n",
+ "print 'time required to lower level of reservoir = %.2f min '%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time required to lower level of reservoir = 109.49 min \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10 pageno : 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find depth of water through this notch.\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "L = 3. \t\t\t#ft\n",
+ "H = 6. \t\t\t#in\n",
+ "Cd = 0.62\n",
+ "Cd1 = 0.59\n",
+ "a = 45. \t\t\t#degrees\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "H = ((2./3)*Cd*math.sqrt(2*g)*L*(H/12)**1.5/((8./15)*Cd1*math.sqrt(2*g)))**0.4\n",
+ "#RESULTS\n",
+ "print 'depth of water = %.3f ft '%(H)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "depth of water = 1.142 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11 page no : 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find in each case the percentage error \n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "V = 20. \t\t\t#litres\n",
+ "g = 981. \t\t\t#cm/sec**2\n",
+ "Cd = 0.593\n",
+ "r = 2.5\n",
+ "r1 = 1.5\n",
+ "e = 2. \t\t\t#mm\n",
+ "Cd1 = 0.623\n",
+ "L = 30. \t\t\t#cm\n",
+ "#CALCULATIONS\n",
+ "H = (V*1000*15/(8*Cd*math.sqrt(2*g)))**0.4\n",
+ "dH1 = e/10.\n",
+ "p = r*dH1*100/H\n",
+ "H1 = (V*3*1000/(2*Cd1*math.sqrt(2*g)*L))**(2./3)\n",
+ "p1 = r1*dH1*100/H1\n",
+ "#RESULTS\n",
+ "print 'percentage error of discharge over the weir = %.2f %% '%(p)\n",
+ "print 'percentage error of discharge over the weir = %.2f %% '%(p1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percentage error of discharge over the weir = 2.74 % \n",
+ "percentage error of discharge over the weir = 2.74 % \n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.12 page no : 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the discharge in the channel in gallons per minute\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "L = 16. \t\t\t#in\n",
+ "H = 9. \t\t\t#in\n",
+ "h = 18. \t\t\t#in\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 2. \t\t\t#ft\n",
+ "Cd = 0.63\n",
+ "W = 62.4 \t\t\t#lbs/ft**3\n",
+ "#CALCULATIONS\n",
+ "Q = 2*Cd*math.sqrt(2*g)*(L/12)*(H/12)**1.5/3\n",
+ "v = Q/(w*(h/12))\n",
+ "H1 = v**2/(2*g)\n",
+ "Q1 = 2*Cd*math.sqrt(2*g)*(L/12)*(((H/12)+H1)**1.5-H1**1.5)*W*6/3.\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.f gpm '%(Q1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 1122 gpm \n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.13 pageno : 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine the discharge \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "L = 100 \t\t\t#ft\n",
+ "H = 2.25 \t\t\t#ft\n",
+ "Cd = 0.95\n",
+ "w = 120 \t\t\t#ft\n",
+ "h = 2 \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "Q = round(3.087*Cd*L*H**1.5)\n",
+ "v0 = round(Q/(w*(h+H)),2)\n",
+ "Q1 = 3.087*Cd*L*((H+(v0**2/(2*g)))**1.5-(v0**2/(2*g))**1.5)\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.0f cuses '%(Q1)\n",
+ "\n",
+ "# Note: answer is slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 1024 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.14 pageno : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find discharge over this weir in gallons per hour\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "L = 6 \t\t\t#ft\n",
+ "H1 = 0.5 \t\t\t#ft\n",
+ "H2 = 0.25 \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cd1 = 0.58\n",
+ "Cd2 = 0.8\n",
+ "w = 6.24 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "Q1 = 2*Cd1*math.sqrt(2*g)*L*(H1-H2)**1.5/3\n",
+ "Q2 = Cd2*L*H2*math.sqrt(2*g*(H1-H2))\n",
+ "Q = round((Q1+Q2)*w*3600,-3)\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.f gph '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 160000 gph \n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.15 pageno : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the height of an anicut \n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "W = 100 \t\t\t#ft\n",
+ "h = 10 \t\t\t#ft\n",
+ "v = 4 \t\t\t#ft/sec\n",
+ "h1 = 3 \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "H = 5.4 \t\t\t#ft\n",
+ "Cd1 = 0.58\n",
+ "Cd2 = 0.8\n",
+ "#CALCULATIONS\n",
+ "v0 = (W*h*v)/(W*(h+h1))\n",
+ "h0 =v0**2/(2*g)\n",
+ "H2 = (W*h*v-(2*Cd1*W*math.sqrt(2*g)*((h1+h0)**1.5-h0**1.5)/3))/(Cd2*W*math.sqrt(2*g*(h1+h0)))\n",
+ "dh = h-H2\n",
+ "#RESULTS\n",
+ "print 'height of anicut which is drowned = %.f ft '%(dh)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "height of anicut which is drowned = 8 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.16 page no : 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find length\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "x = 6. \t\t\t#in\n",
+ "l = 200. \t\t\t#ft\n",
+ "d = 10. \t\t\t#ft\n",
+ "v = 4. \t\t\t#ft/sec\n",
+ "Ce = 0.95\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "l1 = math.sqrt(l**2/(Ce**2*(((x/12)*2*g/v**2)+(d**2/(d+(x/12))**2))))\n",
+ "#RESULTS\n",
+ "print 'length = %.f ft '%(l1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "length = 123 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.17 page no : 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the number of siphons required\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "H = 25. \t\t\t#ft\n",
+ "l = 2.5 \t\t\t#ft\n",
+ "b = 5. \t\t\t#ft\n",
+ "Cd = 0.64\n",
+ "Q = 3200. \t\t\t#cuses\n",
+ "L =150. \t\t\t#ft\n",
+ "C =3.2\n",
+ "depth =0.5 \t\t\t#ft\n",
+ "A1 =5000000. \t\t\t#sq yards\n",
+ "#CALCULATIONS\n",
+ "Q1 = Cd*l*b*math.sqrt(2*g*H)\n",
+ "n = Q/Q1\n",
+ "h = (Q/(3.2*L))**(2./3)\n",
+ "hr =h-depth\n",
+ "Area =A1*9\n",
+ "V = round(Area*hr,-6)\n",
+ "#RESULTS\n",
+ "print 'number of spilways = %.f '%(n)\n",
+ "print \"Volume of extra water stored = %d cu ft\"%(V)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "number of spilways = 10 \n",
+ "Volume of extra water stored = 137000000 cu ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Hydraulics/Chapter_5.ipynb b/Hydraulics/Chapter_5.ipynb
new file mode 100644
index 00000000..7fdc90dc
--- /dev/null
+++ b/Hydraulics/Chapter_5.ipynb
@@ -0,0 +1,1214 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Flow Through Pipes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 pageno : 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "a) a channel having bottom width\n",
+ "b) channel whose section is an arc of a circle\n",
+ "'''\n",
+ "import math\n",
+ "import numpy \n",
+ "#initialisation of variables\n",
+ "h = 4. \t\t\t#ft\n",
+ "h1 = 3. \t\t\t#ft\n",
+ "r = 3. \t\t\t#ft\n",
+ "h2 = 1.5 \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "m = (h*h1+(h1**2/2))/(h+(h/2)*math.sqrt(h1**2+(h1/2)**2))\n",
+ "a = 2*numpy.degrees(numpy.arccos(h2/r))\n",
+ "P = 2*math.pi*r*a/360.\n",
+ "A = r**2*((2*math.pi/3.)-math.sin(math.radians(a)))/2.\n",
+ "H = A/(2*math.pi)\n",
+ "#RESULTS\n",
+ "print 'Hydraulic mean depth m = %.2f ft'%m\n",
+ "print 'hydraulic mean depth = %.2f ft '%(H)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hydraulic mean depth m = 1.54 ft\n",
+ "hydraulic mean depth = 0.88 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 pageno : 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the head lost\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "d = 3. \t\t\t#ft\n",
+ "l = 5280. \t\t\t#ft\n",
+ "v = 3. \t\t\t#ft/sec\n",
+ "f = 0.005\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "C = 115.\n",
+ "#CALCULATIONS\n",
+ "hf = 4*f*l*v**2/(2*g*v)\n",
+ "m = d/4\n",
+ "hf1 = (v/C)**2*4*l/3\n",
+ "#RESULTS\n",
+ "print 'hf = %.2f ft '%(hf)\n",
+ "print 'hf = %.1f ft '%(hf1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hf = 4.92 ft \n",
+ "hf = 4.8 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 page no : 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the pressure difference between two points\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 6. \t\t\t#in\n",
+ "Q = 2. \t\t\t#cfs\n",
+ "l = 1000. \t\t\t#ft\n",
+ "f = 0.0055\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "h = 70. \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "v = Q/(math.pi*(d/12)**2/4)\n",
+ "hf = 4*f*l*w*(Q/(math.pi*(d/12)**2/4))**2/((d/12)*2*144*g)\n",
+ "ft_water = round(hf*144/w + 70)\n",
+ "P = ft_water*w/144\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'pressure = %.1f lb/in**2 '%(hf)\n",
+ "print 'presure difference = %.0f lb/in**2 '%(P)\n",
+ "\n",
+ "# Answers are slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure = 30.7 lb/in**2 \n",
+ "presure difference = 61 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 pageno : 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 6. \t\t\t#in\n",
+ "hf = 7.7 \t\t\t#ft\n",
+ "f = 0.005\n",
+ "l = 1000. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "C = math.sqrt(2*g/f)\n",
+ "Q = math.pi*C*(d/12)**2.5*(hf/1000)**0.5 /8\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.2f cfs '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 0.69 cfs \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 page no : 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the size of the supply main \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "Q = 400000.\n",
+ "d = 4. \t\t\t#miles\n",
+ "h = 50. \t\t\t#ft\n",
+ "q = 40. \t\t\t#gallons of water\n",
+ "t = 8. \t\t\t#hr\n",
+ "f = 0.0075\n",
+ "w = 6.24 \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "Q1 = round(Q*q*0.5/(t*60*60*w),1)\n",
+ "d = (4*f*(d*5280)*Q1**2*16/(math.pi**2*h*2*g))**0.2*12\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'size of the supply = %.3f in '%(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "size of the supply = 43.579 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 pageno : 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the critical velocities \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q = 0.7 \t\t\t#cfs\n",
+ "d = 6. \t\t\t#in\n",
+ "v1 = 1.084*10**-5 \t\t\t#ft**2/sec\n",
+ "v2 = 0.394*10**-5 \t\t\t#ft**2/sec\n",
+ "R = 2320.\n",
+ "#CALCULATIONS\n",
+ "Re = (4*Q)/(math.pi*.5*v2)\n",
+ "v3 = R*v1/(d/12.)\n",
+ "v4 =R*v2/(d/12.) \n",
+ "v = Q*4/(math.pi*(d/12.)**2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Re at 80 C %.0f'%Re\n",
+ "print 'crititcal velocity = %.4f ft/sec '%(v4)\n",
+ "print 'actual velocity = %.2f ft/sec '%(v)\n",
+ "\n",
+ "# Note : answer is correct. Please calculate it manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Re at 80 C 452420\n",
+ "crititcal velocity = 0.0183 ft/sec \n",
+ "actual velocity = 3.57 ft/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 pageno : 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find pressure \n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "p = 0.91 \t\t\t#units\n",
+ "u = 0.21 \t\t\t#poise\n",
+ "q = 200. \t\t\t#gallons\n",
+ "h = 40. \t\t\t#ft\n",
+ "l = 200. \t\t\t#ft\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "d = 3./4 \t\t\t#in\n",
+ "g =32.2 \t\t\t#ft/s**2\n",
+ "#CALCULATIONS\n",
+ "v = u/(p*(30.5)**2)\n",
+ "Q = q*10/(w*3600*p)\n",
+ "V = Q/(math.pi*(d/12)**2/4)\n",
+ "Re = V*(d/12)/v\n",
+ "F = 64/Re\n",
+ "Hf = F*l*V**2/(2*g*(d/12))\n",
+ "Ht = Hf+h\n",
+ "P = w*p*Ht/144\n",
+ "#RESULTS\n",
+ "print 'Pressure head = %.1f lb/sq in '%(P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure head = 31.6 lb/sq in \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 page no : 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the value of n\n",
+ "from math import log10\n",
+ "#initialisation of variables\n",
+ "h = 1.5 # H\n",
+ "v = 2. # V\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "logh = round(log10(h),4)\n",
+ "logk = -0.415 # from fig.\n",
+ "logv = round(log10(v),4)\n",
+ "n = (logh-logk)/logv\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'n = %.3f '%(n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n = 1.964 \n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10 page no : 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the pressure \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "pb = 20. \t\t\t#lb/in**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "Q = 1.96 \t\t\t#cfs\n",
+ "d1 = 0.5 \t\t\t#ft\n",
+ "d2 = 1. \t\t\t#ft\n",
+ "f = 0.005\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "l1 = 300. \t\t\t#ft\n",
+ "H = 14.015 \t\t\t#ft of water\n",
+ "#CALCULATIONS\n",
+ "v1 = Q/(math.pi*d1**2/4.)\n",
+ "v2 = Q/(math.pi*d2**2./4.)\n",
+ "hf1 = 4*f*l1*v1**2./(2.*g*d1)\n",
+ "hf2 = 4*f*l1*v2**2/(2*g*d2)\n",
+ "h = (v1-v2)**2/(2*g)\n",
+ "h1 = v1**2/(2*g)\n",
+ "h2 = v2**2/(2*g)\n",
+ "P = H*w/144\n",
+ "#RESULTS\n",
+ "print 'Loss of head at C = %.2f ft '%(h1)\n",
+ "print 'Loss of head at C = %.3f ft '%(h2)\n",
+ "print 'Pressure differnece at discharge end = %.2f lb/in**2 '%(P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss of head at C = 1.55 ft \n",
+ "Loss of head at C = 0.097 ft \n",
+ "Pressure differnece at discharge end = 6.07 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11 page no : 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find rate of flow \n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 8. \t\t\t#in\n",
+ "l = 6000. \t\t\t#ft\n",
+ "H = 100. \t\t\t#ft\n",
+ "H1 = 1000. \t\t\t#ft\n",
+ "f = 0.008\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "h1 = 24. \t\t\t#ft\n",
+ "h2 = 34. \t\t\t#ft \n",
+ "h3 = 25. \t\t\t#ft\n",
+ "w = 6.24 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "v = math.sqrt(H*d*2*g/(4*f*l*12))\n",
+ "h = -h1+(v**2/(2*g))+h3+(4*f*H1*v**2/(2*g*(d/12)))\n",
+ "Q = round(math.pi*(d/12)**2*v*3600*w/4,-2)\n",
+ "#RESULTS\n",
+ "print 'minimum depth = %.f ft '%(h)\n",
+ "print 'Discharge = %.f gpm'%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum depth = 18 ft \n",
+ "Discharge = 37100 gpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12 page no : 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find discharge when the syphone is running full\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "h = 25. \t\t\t#ft\n",
+ "l = 2000. \t\t\t#ft\n",
+ "d = 12. \t\t\t#in\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "f = 0.005\n",
+ "dz = 16. \t\t\t#ft\n",
+ "zb = 25. \t\t\t#ft\n",
+ "zc = -16. \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "v = math.sqrt(2*g*h/(1.5+(4*f*l/(d/12))))\n",
+ "Q = math.pi*(d/12)**2*v/4\n",
+ "l1 = (34-dz)*l/(zb-zc-dz)\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.1f cfs '%(Q)\n",
+ "print 'length of the inlet = %.f ft of water '%(l1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 4.9 cfs \n",
+ "length of the inlet = 1440 ft of water \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13 page no : 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the necessary height of water surface\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "d1 = 2 \t\t\t#in\n",
+ "l1 = 25 \t\t\t#ft\n",
+ "d2 = 4 \t\t\t#in\n",
+ "l2 = 140 \t\t\t#ft\n",
+ "v = 4 \t\t\t#ft/sec\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "f = 0.0065\n",
+ "#CALCULATIONS\n",
+ "v1 = v*(d2/d1)**2\n",
+ "H = (0.5*v1**2/(2*g))+(4*f*l1*12*v1**2/(d1*2*g))+((v1-v)**2/(2*g))+(4*f*l2*12*v**2/(d2*2*g))+(v**2/(2*g))\n",
+ "#RESULTS\n",
+ "print 'necessaey height of water = %.3f ft '%(H)\n",
+ "\n",
+ "# Note : answer is slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "necessaey height of water = 22.688 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.14 page no : 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the diameter of uniform pipe \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "l1 = 3000. \t\t\t#ft\n",
+ "d1 = 18. \t\t\t#in\n",
+ "l2 = 1500. \t\t\t#ft\n",
+ "d2 = 15. \t\t\t#ft\n",
+ "l3 = 1000. \t\t\t#ft\n",
+ "d3 = 12. \t\t\t#in\n",
+ "#CALCULATIONS\n",
+ "d = ((l1+l2+l3)/((l1/d1**5)+(l2/d2**5)+(l3/d3**5)))**(1./5)\n",
+ "#RESULTS\n",
+ "print 'Diameter = %.2f in '%(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter = 14.86 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.15 page no : 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the diameter of the parallel mains\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "D = 9. \t\t\t#in\n",
+ "#CALCULATIONS\n",
+ "d = D/(2**0.4)\n",
+ "#RESULTS\n",
+ "print 'diameter of paralle mains = %.2f in '%(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diameter of paralle mains = 6.82 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.16 page no : 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the increase in discharge\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 2. \t\t\t#ft\n",
+ "l = 5280. \t\t\t#ft\n",
+ "f = 0.01\n",
+ "H = 100. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCLATIONS\n",
+ "v = math.sqrt(H*2*d*g/(4*f*l))\n",
+ "Q = math.pi*d**2*v/4.\n",
+ "r = d\n",
+ "v2 = math.sqrt(H/((r**2+1)*(4*f*l/(2*2*2*g))))\n",
+ "Q1 = 2*math.pi*d**2*v2/4.\n",
+ "dQ = Q1-Q\n",
+ "p = dQ*100./Q\n",
+ "#RESULTS\n",
+ "print 'percentage increase in discharge = %.1f %% '%(p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percentage increase in discharge = 26.5 % \n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.17 Page no : 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the velocity of flow in each pipe\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "d1 = 2 # ft\n",
+ "d2 = 1.5 # ft\n",
+ "d3 = 1 # ft\n",
+ "l1 = 2000 # ft\n",
+ "l2 = 3000 # ft\n",
+ "l3 = 1500 # ft\n",
+ "za = 100 # ft\n",
+ "zb = 70 # ft\n",
+ "zc = 50 # ft\n",
+ "zd = 80 # ft\n",
+ "f = 0.007 # ft\n",
+ "v3 = 7.93\n",
+ "\n",
+ "# Calculations\n",
+ "\n",
+ "v1 = round(math.sqrt(111-1.412*(v3**2)),1)\n",
+ "v2 = round(math.sqrt(-23.4+.745*(v3**2)),2)\n",
+ "pd_w = round((za - zd) - ( 29 * v1**2/64.4),2)\n",
+ "Q1 = (math.pi/4)*d1**2*v1\n",
+ "Q2 = (math.pi/4)*d2**2*v2\n",
+ "Q3 = Q1 - Q2\n",
+ "\n",
+ "# Results\n",
+ "print \"V1 = %.1f ft/sec\"%v1\n",
+ "print \"V2 = %.2f ft/sec\"%v2\n",
+ "print \"V3 = %.2f ft/sec\"%v3\n",
+ "print \"Pressure at the junction point : %.2f ft of water\"%pd_w\n",
+ "print \"Discharge in section : %.2f cfs\"%Q3\n",
+ "\n",
+ "# Note : Answers may vary because of rounding error. Please check it manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V1 = 4.7 ft/sec\n",
+ "V2 = 4.84 ft/sec\n",
+ "V3 = 7.93 ft/sec\n",
+ "Pressure at the junction point : 10.05 ft of water\n",
+ "Discharge in section : 6.21 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.18 page no : 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the time taken to lower the level of water\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "A = 10000. \t\t\t#ft**2\n",
+ "H1 = 50. \t\t\t#ft\n",
+ "H2 = 40. \t\t\t#ft\n",
+ "l = 1500. \t\t\t#ft\n",
+ "d = 6. \t\t\t#in\n",
+ "f = 0.0075\n",
+ "g = 32.2 \t\t\t#f/sec**2\n",
+ "#CALCULATIONS\n",
+ "t = 2.*A*math.sqrt((1.5+(4*f*l/(d/12)))/(2*g))*(math.sqrt(H1)-math.sqrt(H2))/(math.pi*(d/12)**2/4)\n",
+ "#RESULTS\n",
+ "print 'Time taken to lower the level of water = %.f hours '%(t/3600)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken to lower the level of water = 25 hours \n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.19 page no : 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the time required to empty the overhead\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "l = 24. \t\t\t#ft\n",
+ "b = 12. \t\t\t#ft\n",
+ "f = 0.006\n",
+ "d = 4. \t\t\t#in\n",
+ "l1 = 25. \t\t\t#ft\n",
+ "H1 = 6. \t\t\t#ft\n",
+ "H = 20. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "Cd = 0.6\n",
+ "#CALCULATIONS\n",
+ "a = math.pi*(d/12)**2/4\n",
+ "A = l*b\n",
+ "H2 = H1+H\n",
+ "t = round(2*A*math.sqrt((1.5+(4*f*l1/(d/12)))/(2*g))*(math.sqrt(H2)-math.sqrt(H))/a,-1)\n",
+ "t1 = 2*A*math.sqrt((1.5+(4*f*l1/(d/12)))/(2*g))*math.sqrt(H1)/a\n",
+ "t2 = 2*A*math.sqrt(H1)/(Cd*a*math.sqrt(2*g))\n",
+ "#RESULTS\n",
+ "print 'Time taken to lower the pipe = %.f sec '%(t)\n",
+ "print 'Time taken to lower the pipe = %.f sec '%(t1)\n",
+ "print 'Time taken to lower the pipe = %.f sec '%(t2)\n",
+ "\n",
+ "# note : answers may vary becasue of ronding error. "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken to lower the pipe = 940 sec \n",
+ "Time taken to lower the pipe = 3660 sec \n",
+ "Time taken to lower the pipe = 3358 sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.20 page no : 165\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the time taken \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 2 \t\t\t#ft\n",
+ "l = 1000 \t\t\t#ft\n",
+ "f = 0.0075\n",
+ "H1 = 20 \t\t\t#ft\n",
+ "A1 = 100000 \t\t\t#ft**2\n",
+ "A2 = 50000 \t\t\t#ft**2\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "h = 2*A1/A2\n",
+ "H2 = H1-h\n",
+ "t = 2*A1*A2*math.sqrt(1.5+(4*f*l/2))*0.47/((A1+A2)*(math.pi*d**2/4)*math.sqrt(2*g))/60\n",
+ "#RESULTS\n",
+ "print 'Time taken to lower the level of water = %.f min '%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken to lower the level of water = 84 min \n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.21 page no : 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find diameter of the pipe and efficiency of transmission.\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "H = 1000. \t\t\t#lb/in**2\n",
+ "Hf = 100. \t\t\t#lb/in**2\n",
+ "l = 10. \t\t\t#miles\n",
+ "HP = 100.\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 64.4 \t\t\t#lb/ft**3\n",
+ "f = 0.006\n",
+ "#CALCULATIONS\n",
+ "n = (H-Hf)*100/H\n",
+ "v = Hf*550/((math.pi/4)*n*10*144)\n",
+ "r = Hf*144*2*g/(w*4*f*l*5280)\n",
+ "d = (v**2/r)**(1./5)\n",
+ "#RESULTS\n",
+ "print 'Diameter = %.4f ft '%(d)\n",
+ "\n",
+ "# answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter = 0.4808 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.22 page no : 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the horse-powers of the jet.\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "h1 = 1640. \t\t\t#ft\n",
+ "h2 = 40. \t\t\t#ft\n",
+ "d = 8. \t\t\t#in\n",
+ "l = 2. \t\t\t#miles\n",
+ "D = 3. \t\t\t#ft\n",
+ "f = 0.006\n",
+ "Cv = 0.98\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "r = (d/12)/D\n",
+ "vact = Cv*math.sqrt(2*g*(h1-h2)/(1+(4*f*l*5280*r**4/D)))\n",
+ "HP = round(round(w*vact**3*(math.pi*(d/12)**2/4)/(550*2*g),-2),-3)\n",
+ "#RESULTS\n",
+ "print 'Horse Power of Jet = %.f HP '%(HP)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Horse Power of Jet = 15000 HP \n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.23 page no : 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find volume of flow \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "p = 60. \t\t\t#lb/in**2\n",
+ "l = 300. \t\t\t#ft\n",
+ "D = 2.5 \t\t\t#in\n",
+ "d = 7./8 \t\t\t#in\n",
+ "f = 0.018\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "r = (D/d)**4\n",
+ "V = math.sqrt(2*g*144*p/(w*(r+0.5+(4*f*l/(D/12)))))\n",
+ "Q = V*(math.pi*(D/12)**2)/4\n",
+ "#RESULTS\n",
+ "print 'Volume of flow = %.3f cu ft/sec '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume of flow = 0.246 cu ft/sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.24 page no : 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find maximum power transmitted by the jet\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "D = 3. \t\t\t#in\n",
+ "l = 800. \t\t\t#ft\n",
+ "H = 120. \t\t\t#ft\n",
+ "f = 0.01\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "d = ((D/12)**5/(8*f*l))**0.25\n",
+ "hf = H/3\n",
+ "dh = H-hf\n",
+ "v = math.sqrt(hf*(D/12)*2*g/(4*f*l))\n",
+ "HPmax = w*math.pi*((D/48)**2/4)*v*dh/550\n",
+ "#RESULTS\n",
+ "print 'HPmax = %.3f HP '%(HPmax)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "HPmax = 0.125 HP \n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.25 page no : 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find height\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "l = 2. \t\t\t#miles\n",
+ "Q = 2.*10**6 \t\t\t#gal/day\n",
+ "d = 12. \t\t\t#in\n",
+ "t = 16. \t\t\t#sec\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIO\n",
+ "Q1 =Q*10/(w*24*60*60)\n",
+ "hi = l*5280*Q1/((math.pi*(d/12)**2./4)*(g*t))\n",
+ "#RESULTS\n",
+ "print 'height = %.1f ft '%(hi)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "height = 96.8 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.26 pageno : 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find rise of pressure in the pipe\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 6. \t\t\t#in\n",
+ "Q = 0.7854 \t\t\t#cfs\n",
+ "E = 30*10**6 \t\t\t#lb/in**2\n",
+ "t = 0.25 \t\t\t#in\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "K = 300000. \t\t\t#lb/in**2\n",
+ "#CALCULATIONS\n",
+ "v = Q/(math.pi*(d/12)**2/4)\n",
+ "p = v/(math.sqrt(144*(g/w)*((1/K)+(d/(t*E)))))\n",
+ "#RESULTS\n",
+ "print 'rise of presure in the pipe = %.f lb/in**2 '%(p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rise of presure in the pipe = 228 lb/in**2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.27 page no : 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find economical diameter of pipe line\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "f = 0.005\n",
+ "Q = 100. \t\t\t#cuses\n",
+ "m = 40. \t\t\t#Rs\n",
+ "n = 0.75\n",
+ "n1 = 0.065\n",
+ "K = 15. \t\t\t#Rs\n",
+ "#CALCULATIONS\n",
+ "d = ((5*w/(1.5*550*10))*n*f*Q**3*m/(K*n1))**(1/6.5)\n",
+ "#RESULTS\n",
+ "print 'economical diameter of pipe line = %.3f ft '%(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "economical diameter of pipe line = 3.795 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 63
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Hydraulics/Chapter_6.ipynb b/Hydraulics/Chapter_6.ipynb
new file mode 100644
index 00000000..b60e19b9
--- /dev/null
+++ b/Hydraulics/Chapter_6.ipynb
@@ -0,0 +1,935 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Flow Through Open Channels"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 page no : 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the value of C and K\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "i = 0.000146\n",
+ "v = 2.8 \t\t\t#ft/sec\n",
+ "m = 7. \t\t\t#ft\n",
+ "#CALCULAIONS\n",
+ "C = v/math.sqrt(m*i)\n",
+ "K = (157.6-C)*math.sqrt(m)/C\n",
+ "#RESULTS\n",
+ "print 'C = %.3f '%(C)\n",
+ "print 'K = %.3f '%(K)\n",
+ "\n",
+ "# answers may vary because of rounding error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 87.586 \n",
+ "K = 2.115 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 pageno : 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find value of C \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "b = 10. \t\t\t#ft\n",
+ "n = 1.\n",
+ "i = 1./1000\n",
+ "d = 1.5 \t\t\t#ft\n",
+ "C = 110.\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "L = math.sqrt(2*d**2)\n",
+ "P = b+2*L\n",
+ "A = d*(b+n*d)\n",
+ "m = A/P\n",
+ "v = round(C*math.sqrt(m*i),2)\n",
+ "A_v = round(A*v)\n",
+ "Q = A_v*w*60*60*24/10\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.2e gal/day '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 3.56e+07 gal/day \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 page no : 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "b = 10. \t\t\t#ft\n",
+ "n = 2.\n",
+ "d = 3.5 \t\t\t#ft\n",
+ "i = 1./625\n",
+ "#CALCULATIONS\n",
+ "A = d*(b+(d/n))\n",
+ "L = math.sqrt(d**2+(d/2)**2)\n",
+ "P = b+2*L\n",
+ "m = A/P\n",
+ "v = 1.486*m**(2./3)*i**0.5/0.03\n",
+ "Q = A*v\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.1f cuses '%(Q)\n",
+ "\n",
+ "# Note : answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 142.3 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 pageno : 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the discharge of a channel\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 3. \t\t\t#ft\n",
+ "i = 1./4500\n",
+ "C = 80.\n",
+ "#CALCULATIONS\n",
+ "A = 0.5*(math.pi*d**2/4)\n",
+ "P = math.pi*d/2\n",
+ "m = A/P\n",
+ "v = C*math.sqrt(m*i)\n",
+ "Q = v*A\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.2f cuses '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 3.65 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 page no : 198\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find diameter\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "A = 2500. \t\t\t#acres\n",
+ "n = 20.\n",
+ "Q = 40. \t\t\t#gal/head\n",
+ "C = 130.\n",
+ "i = 1./3000\n",
+ "p = 7. \t\t\t#per cent\n",
+ "w = 62.4 \t\t\t#lb/ft**3\n",
+ "#CALCULATIONS\n",
+ "Q1 = Q*50000*p/(60*100*60*w)\n",
+ "Q2 = Q1+(A*4840*9/(12*24*60*60))\n",
+ "d = (Q2*8*math.sqrt(4/i)/(math.pi*C))**0.4\n",
+ "#RESULTS\n",
+ "print 'Diameter = %.3f ft '%(d)\n",
+ "\n",
+ "# answer is different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter = 8.754 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 page no : 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find depth of water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation of variables\n",
+ "Qt = 150000. \t\t\t#cuses\n",
+ "i = 1/10000.\n",
+ "n1 = 1.\n",
+ "n2 = 2./3\n",
+ "d1 = 30. \t\t\t#ft\n",
+ "C1 = 100.\n",
+ "C2 = 75.\n",
+ "b1 = 600. \t\t\t#ft\n",
+ "b2 = 2000. \t\t\t#ft\n",
+ "r = 2.\n",
+ "A1 = (b1+d1)*d1\n",
+ "P1 = b1+(2*d1*math.sqrt(2))\n",
+ "m1 = A1/P1\n",
+ "v1 = C1*math.sqrt(m1*i)\n",
+ "Q1 = A1*v1\n",
+ "Q2 = Qt-Q1\n",
+ "v2 = v1/2\n",
+ "A2 = Q2/v2\n",
+ "d2 = (-b2+math.sqrt(b2**2+4*1.5*A2))/(2*1.5)\n",
+ "#RESULTS\n",
+ "print 'depth of water = %.f ft '%(d2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "depth of water = 10 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 page no : 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find height of dam\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 3. \t\t\t#ft\n",
+ "i = 1./1000\n",
+ "C = 65.\n",
+ "Cd = 0.56\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "h1 = 7.5 \t\t\t#ft\n",
+ "h2 = 3. \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "m = d\n",
+ "v = C*math.sqrt(m*i)\n",
+ "Q = v*d\n",
+ "H = (Q*d/(2*math.sqrt(2*g)*Cd))**(2./3)\n",
+ "h = h1+h2-H\n",
+ "#RESULTS\n",
+ "print 'Height of dam = %.2f ft '%(h)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of dam = 8.17 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8 page no : 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find depth, bottom width and top width\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "Q =100.\t\t\t#cuses\n",
+ "v = 2. \t\t\t#/ft/sec\n",
+ "n = 1.5\n",
+ "A = 50. \t\t\t#ft**2\n",
+ "C = 120.\n",
+ "#CALCULATIONS\n",
+ "d = math.sqrt((Q/v)/(2*math.sqrt(n**2+1)-n))\n",
+ "m = A/d\n",
+ "h1 = m-n*d\n",
+ "h2 = m+n*d\n",
+ "i = (v/C)**2*(2/d)\n",
+ "#RSULTS\n",
+ "print 'Depth = %.2f ft '%(d)\n",
+ "print ' Bottom width = %.2f ft '%(h1)\n",
+ "print ' Top width = %.2f ft '%(h2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth = 4.87 ft \n",
+ " Bottom width = 2.95 ft \n",
+ " Top width = 17.57 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 page no : 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find depth, bottom width, and top width\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "Q = 1100. \t\t\t#cuses\n",
+ "i = 1/1800.\n",
+ "C = 95.\n",
+ "n = 1.5\n",
+ "#CALCULATIONS\n",
+ "d = ((Q*math.sqrt(3600)/C)/(n+0.6))**0.4\n",
+ "b = 0.6*d\n",
+ "ht = b+2*(n*d)\n",
+ "#RESULTS\n",
+ "print 'Depth = %.1f ft '%(d)\n",
+ "print ' Bottom width = %.2f ft '%(b)\n",
+ "print ' Top width = %.1f ft '%(ht)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth = 10.2 ft \n",
+ " Bottom width = 6.11 ft \n",
+ " Top width = 36.7 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 pageno : 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find depth of channel\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "\n",
+ "n = 1.5\n",
+ "Q = 800. \t\t\t#cuses\n",
+ "i = 2.5/5280\n",
+ "n1 = 9.24\n",
+ "r = 0.6\n",
+ "k = 1.49\n",
+ "#CALCULATIONS\n",
+ "d = (k*10**7*4/n1)**(1/8.)\n",
+ "#RESULTS\n",
+ "print 'Depth of channel = %.1f ft '%(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depth of channel = 7.1 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.11 page no : 210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find discharge\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d = 8. \t\t\t#ft\n",
+ "i = 1./1200\n",
+ "C = 90.\n",
+ "a = 308. \t\t\t#degrees\n",
+ "#CALCULATIONS\n",
+ "h = 0.95*d\n",
+ "A = (d/2)**2*(a*(math.pi/180)-math.sin(math.radians(a)))/2\n",
+ "m = 0.29*d\n",
+ "Q = A*C*math.sqrt(m*i)\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.f cuses '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 195 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.12 page no : 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find specific energy\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "v = 5. \t\t\t#ft/sec\n",
+ "Q = 500. \t\t\t#cuses\n",
+ "w = 25. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "h = (Q/v)/w\n",
+ "E = h+(v**2/(2*g))\n",
+ "he = round((400*2/64.4)**(1./3),2)\n",
+ "ve = round(20./2.32,2)\n",
+ "Emin = he + (ve**2 / (g*2))\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Specific energy = %.2f ft '%(E)\n",
+ "print \"Critical Velocity of flow = %.2f ft/sec\"%ve\n",
+ "print 'Minimum energy Emin = %.2f ft'%Emin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific energy = 4.39 ft \n",
+ "Critical Velocity of flow = 8.62 ft/sec\n",
+ "Minimum energy Emin = 3.47 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.13 page no : 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find slope of free water\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "\n",
+ "i = 1./5000\n",
+ "C = 100.\n",
+ "b = 50. \t\t\t#ft\n",
+ "h = 10. \t\t\t#ft\n",
+ "Q = 1000. \t\t\t#cuses\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "f = 2.*g/C**2\n",
+ "m = (b*h)/(b+2*h)\n",
+ "v = Q/(b*h)\n",
+ "r = (i-(f*4/(2*g*m)))/(1-(2**2/(g*h)))\n",
+ "s = i-r\n",
+ "#RESULTS\n",
+ "print 'Slope = %.6f '%(s)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Slope = 0.000054 \n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.14 page no : 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find height required\n",
+ "\n",
+ "import math \n",
+ "#Initialization of variables\n",
+ "B =48. \t\t\t#ft\n",
+ "D =5. \t\t\t#ft\n",
+ "f =0.005\n",
+ "i =1./1000\n",
+ "g =32.2\n",
+ "#calculations\n",
+ "C =math.sqrt(2*g/f)\n",
+ "m =B*D/(B+2*D)\n",
+ "V =C*math.sqrt(m*i)\n",
+ "Q =B*D*V\n",
+ "Dc =(Q**2 /(g*B**2))**(1./3)\n",
+ "d1 =2.25 \t\t\t#ft\n",
+ "Q1 =1*D*V\n",
+ "d2 =-d1/2 + math.sqrt(2*Q1**2 /(g*d1) + d1**2 /4)\n",
+ "hd =d2-d1\n",
+ "#results\n",
+ "print \"height required = %.1f ft\"%(hd)\n",
+ "#The answer is a bit different due to rounding off error in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "height required = 2.8 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.15 page no : 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find loss in energy\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "Q = 360. \t\t\t#cfs\n",
+ "d1 = 1. \t\t\t#ft\n",
+ "B = 18. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "w1 = 624. \t\t\t#lb/ft**3\n",
+ "d2 =4.5 \t\t\t#ft\n",
+ "#CALCULATIONS\n",
+ "w = Q/B\n",
+ "v1 = w/d1\n",
+ "v2 = v1/d2\n",
+ "d2 = -0.5+math.sqrt((2*v1**2*d1/(g))+(d1**2./4))\n",
+ "El = (d1+(w**2/(2*g)))-(d2+(v2**2/(2*g)))\n",
+ "EL = round(w1*Q*El,-4)\n",
+ "#RESULTS\n",
+ "print 'loss in energy = %.f lb '%(EL)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "loss in energy = 540000 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.16 page no : 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find downstream depth \n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "d1 = 4. \t\t\t#ft\n",
+ "v1 = 60. \t\t\t#ft/sec\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALULATIONS\n",
+ "d2 = d1*(math.sqrt(1+8*v1**2/(g*d1))-1)/2.\n",
+ "#RESULTS\n",
+ "print 'd2 = %.f ft '%(d2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "d2 = 28 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.17 page no : 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find approximate length\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "b = 150. \t\t\t#ft\n",
+ "d = 12. \t\t\t#ft\n",
+ "N = 0.03\n",
+ "i = 1./10000\n",
+ "h = 10. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "A = b*d\n",
+ "P = b+2*d\n",
+ "m = A/P\n",
+ "v = m**(2/3.)*1.49*i**0.5/N\n",
+ "A1 = b*(h+d)\n",
+ "P1 = b+2*(h+d)\n",
+ "m1 = A1/P1\n",
+ "C1 = 1.49*m1**(1./6)/N\n",
+ "v1 = A*v/A1\n",
+ "s = (i-(v1**2/(C1**2*m1)))/(1-(v1**2/(g*(h+d))))\n",
+ "L = round(2*h/s,-3)\n",
+ "#RESULTS\n",
+ "print 'Length of back water = %.f ft '%(L)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of back water = 236000 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.18 page no : 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find discharge through the venturi flume \n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "b1 = 3.2 \t\t\t#ft\n",
+ "b2 = 1.3 \t\t\t#ft\n",
+ "h1 = 1.86 \t\t\t#ft\n",
+ "h2 = 1.63 \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "a1 = b1*h1\n",
+ "a2 = b2*h2\n",
+ "Q = a1*a2*math.sqrt(2*g)*math.sqrt(h1-h2)/(math.sqrt(a1**2-a2**2))\n",
+ "#RESULTS\n",
+ "print 'Discharge = %.1f cuses '%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Discharge = 8.7 cuses \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.19 page no : 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find discharge and depth of flow at the throat\n",
+ "\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "b1 = 4. \t\t\t#ft\n",
+ "b2 = 2. \t\t\t#ft\n",
+ "h1 = 2. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "#CALCULATIONS\n",
+ "Qmax = 3.09*b2*h1**1.5\n",
+ "v1 = Qmax/(b1*h1)\n",
+ "H = h1+(v1**2/(2*g))\n",
+ "Qmax2 = 3.09*b2*H**1.5\n",
+ "h2 = 2*H/3\n",
+ "#RESULTS\n",
+ "print 'Qmax = %.2f cfs '%(Qmax2)\n",
+ "print 'h2 = %.3f ft '%(h2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Qmax = 18.46 cfs \n",
+ "h2 = 1.383 ft \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.20 pageno : 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "a) discharge\n",
+ "b) depth of water\n",
+ "c) height of standing wave\n",
+ "d) depth of water in channel\n",
+ "'''\n",
+ "import math \n",
+ "#initialisation of variables\n",
+ "h1 = 8. \t\t\t#ft\n",
+ "b1 = 32. \t\t\t#ft\n",
+ "h = 1. \t\t\t#ft\n",
+ "b2 = 24. \t\t\t#ft\n",
+ "g = 32.2 \t\t\t#ft/sec**2\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "H = h1-h\n",
+ "h = 9.65\n",
+ "Q = 3.09*H**1.5*b2\n",
+ "v1 = Q/(b1*h1)\n",
+ "Q1 = 3.09*(H+(v1**2/(2*g)))**1.5*b2\n",
+ "hc = (Q1**2/(g*b2**2))**(1./3)\n",
+ "d2 = -(hc/2)+math.sqrt(9*hc**2/2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print 'Q = %.f cfs '%(Q1)\n",
+ "print 'hc = %.2f ft '%(hc)\n",
+ "print 'max depth = %.2f ft '%(d2)\n",
+ "print 'Maximum depth of water downstream %.2f ft'%(d2+1)\n",
+ "print 'h = %.2f ft'%h\n",
+ "\n",
+ "# answers may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 1507 cfs \n",
+ "hc = 4.97 ft \n",
+ "max depth = 8.05 ft \n",
+ "Maximum depth of water downstream 9.05 ft\n",
+ "h = 9.65 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Hydraulics/README.txt b/Hydraulics/README.txt
new file mode 100644
index 00000000..0c52211b
--- /dev/null
+++ b/Hydraulics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Raviraj Jadeja
+Course: mca
+College/Institute/Organization: Freelancing work
+Department/Designation: Freelancer
+Book Title: Hydraulics
+Author: J. Lal
+Publisher: Metropolitan Book Co. Pvt. Ltd.
+Year of publication: 1959
+Isbn: 9788120004221
+Edition: 2 \ No newline at end of file
diff --git a/Hydraulics/screenshots/pic11.png b/Hydraulics/screenshots/pic11.png
new file mode 100644
index 00000000..234881bb
--- /dev/null
+++ b/Hydraulics/screenshots/pic11.png
Binary files differ
diff --git a/Hydraulics/screenshots/pic22.png b/Hydraulics/screenshots/pic22.png
new file mode 100644
index 00000000..0107e587
--- /dev/null
+++ b/Hydraulics/screenshots/pic22.png
Binary files differ
diff --git a/Hydraulics/screenshots/pic33.png b/Hydraulics/screenshots/pic33.png
new file mode 100644
index 00000000..fe6ba2b2
--- /dev/null
+++ b/Hydraulics/screenshots/pic33.png
Binary files differ
diff --git a/Industrial_Instrumentation/Chapter_1.ipynb b/Industrial_Instrumentation/Chapter_1.ipynb
new file mode 100644
index 00000000..ee337d56
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_1.ipynb
@@ -0,0 +1,412 @@
+{
+ "metadata": {
+ "name": "Chapter_1"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 1: Temperature<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.1, Page Number: 53<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Temperature Conversion'''",
+ "",
+ "#variable declaration",
+ "c=-40.0 #Temp in degree Celcius",
+ "",
+ "#calculations",
+ "k=c+273",
+ "F=((9.0/5.0)*c)+32.0",
+ "R=((9.0/5.0)*c)+492.0",
+ "",
+ "#Result",
+ "print('\\nK=%d\u00b0K' %k)",
+ "print('\\nF=%d\u00b0F' %F)",
+ "print('\\nR=%d\u00b0R' %R)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "K=233\u00b0K",
+ "",
+ "F=-40\u00b0F",
+ "",
+ "R=420\u00b0R"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3> Example 1.2, Page Number: 53<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''percentage Accuracy and Error'''",
+ "",
+ "#varable Declaration",
+ "span=1000.0 #given value of span in \u00b0C",
+ "accuracy=1.0/100.0 #1% accuracy",
+ "",
+ "#calculations",
+ "err=span*accuracy",
+ "max_scale=1200.0",
+ "Range_instr=max_scale+span",
+ "meter_reading=700.0",
+ "per_of_err=(err/meter_reading)*100.0",
+ "",
+ "#result",
+ "print('(a)\\nAs error can be either positive or negative') ",
+ "print('\\n the probable error at any point on the scale =\u00b1 %d\u00b0C'%err)",
+ "print('\\n(b)\\nRange of the Instrument = %d\u00b0C'%Range_instr)",
+ "print('\\n(c)\\nPercentage of Error = \u00b1 %.2f%% '%per_of_err)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "As error can be either positive or negative",
+ "",
+ " the probable error at any point on the scale =\u00b1 10\u00b0C",
+ "",
+ "(b)",
+ "Range of the Instrument = 2200\u00b0C",
+ "",
+ "(c)",
+ "Percentage of Error = \u00b1 1.43% "
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.3, Page Number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Two wire RTD'''",
+ "",
+ "#variable declaration",
+ "resi_per_leg=5.0 # lead wire resistance per leg in Ohm",
+ "temp_coeff=0.385 # Temperature coefficient of Pt 100 RTD in ohms/\u00b0C",
+ "",
+ "#calculation",
+ "R_due_to_leadwires=2*resi_per_leg",
+ "err=R_due_to_leadwires/temp_coeff",
+ "err =round(err,0)",
+ "temp_obj=200.0",
+ "temp_measured=temp_obj+err",
+ "per_of_err=((temp_measured-temp_obj)/temp_obj)*100.0",
+ "",
+ "#Result",
+ "print('(a)\\nThe contribution of 10 ohms lead wire resistance')",
+ "print('to the measurement error = %d\u00b0C' %err)",
+ "print('\\n(b)\\nPercentage of Error = %d%%' %per_of_err)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "The contribution of 10 ohms lead wire resistance",
+ "to the measurement error = 26\u00b0C",
+ "",
+ "(b)",
+ "Percentage of Error = 13%"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.4, Page Number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Thermocouple temperature measurement'''",
+ "",
+ "#variable declaration",
+ "temp=2.022 #Millivolt corresponds to reference junction temp 50\u00b0C",
+ "millivolt_cor=37.325 #Millivolt corresponds to reference junction temp 900\u00b0C",
+ "",
+ "#calculation",
+ "op=millivolt_cor-temp",
+ "",
+ "#result",
+ "print('Millivolt output available = % .3f' %op)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Millivolt output available = 35.303"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.5, Page Number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Hot junction temperature of thermocouple'''",
+ "",
+ "#variable declaration",
+ "millivolt_cor=2.585 #Millivolt corresponds to reference junction temp 50\u00b0C",
+ "pot_reading=30.511 #reading on pot",
+ "",
+ "#calculation",
+ "corrected_millivolt=pot_reading+millivolt_cor",
+ "",
+ "#result",
+ "print('Temperature correspond to %.3f mV from the table = 600\u00b0C' %corrected_millivolt)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature correspond to 33.096 mV from the table = 600\u00b0C"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.6, Page Number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Caliberation of an instrument'''",
+ "",
+ "#variable Declarion",
+ "ref_jun=100.0 #reference junction temp.",
+ "mV_100=0.645 #voltage at 100\u00b0C",
+ "mV_1000=9.585 #voltage at 1000\u00b0C",
+ "mV_1200=11.947 #voltage at 1200\u00b0C",
+ "",
+ "#calculation",
+ "op1=mV_1000-mV_100",
+ "op2=mV_1200-mV_100",
+ "",
+ "#result",
+ "print('Millivolt to be fed checking 1000 C = %.3f mV'%op1)",
+ "print('\\nMillivolt to be fed checking 1200 C = %.3f mV'%op2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Millivolt to be fed checking 1000 C = 8.940 mV",
+ "",
+ "Millivolt to be fed checking 1200 C = 11.302 mV"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.7, page Number: 55<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Wall temperature measurement'''",
+ "",
+ "#variable declaration",
+ "E_rec_pyro=0.95*0.85 #Energy received by pyrometer",
+ "",
+ "#calculation",
+ "T=1100.0/E_rec_pyro",
+ " ",
+ "#result",
+ "print('Pyrometer reading T = %.2f\u00b0C'%T)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pyrometer reading T = 1362.23\u00b0C"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.8, Page Number: 55<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Thermocouple output'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "hot1_mV=41.29 # Millivolt corresponds to hot junction temp ",
+ "cold1_mV=2.022 # Millivolt corresponds to cold junction temp ",
+ "",
+ "#calculation",
+ "op1=hot1_mV-cold1_mV",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "hot2_mV=33.096 #Millivolt corresponds to hot junction temp ",
+ "cold2_mV=2.585 #Millivolt corresponds to cold junction temp ",
+ "#calculation",
+ "op2=hot2_mV-cold2_mV",
+ "",
+ "#(c)",
+ "",
+ "#variable declaration",
+ "hot3_mV=11.947 #Millivolt corresponds to hot junction temp ",
+ "cold3_mV=0.299 #Millivolt corresponds to cold junction temp ",
+ "#calculation",
+ "op3=hot3_mV-cold3_mV",
+ "",
+ "#result",
+ "print('(a)\\nOutput Millivolt = %.3f'%op1)",
+ "print('\\n(b)\\nOutput Millivolt = %.3f'%op2)",
+ "print('\\n(c)\\nAs the wrongly formed thermocouples at J1 and J2 will always oppose')",
+ "print('the main millivolt output, the net output will be lower than normal value.')",
+ "print('Output mV<%.3f'%op3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Output Millivolt = 39.268",
+ "",
+ "(b)",
+ "Output Millivolt = 30.511",
+ "",
+ "(c)",
+ "As the wrongly formed thermocouples at J1 and J2 will always oppose",
+ "the main millivolt output, the net output will be lower than normal value.",
+ "Output mV<11.648"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.9, Page Number: 56<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''electtronic temperature transmitter'''",
+ "",
+ "#variable declaration",
+ "Rl_ind=250.0 #load resistor for indicator",
+ "Rl_rec=250.0 #load resistor for recorder",
+ "load_allowable=600.0 #allowable load with load independency",
+ "",
+ "#calculation",
+ "load_connected= Rl_ind+Rl_rec",
+ "max_load_controller=load_allowable-load_connected",
+ "op_cont=600.0",
+ "total=Rl_ind+Rl_rec+load_allowable",
+ "extra_load=total-op_cont",
+ "",
+ "#result",
+ "print('(a)\\nThe max load to the controller = %d ohms'%max_load_controller)",
+ "print('\\n(b)\\nExtra Load = %d ohms'%extra_load)",
+ "print('\\nAdditional Power Supply voltage required = 10 V')",
+ "print('\\nMinimum Power Supply Voltage = 34 ')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "The max load to the controller = 100 ohms",
+ "",
+ "(b)",
+ "Extra Load = 500 ohms",
+ "",
+ "Additional Power Supply voltage required = 10 V",
+ "",
+ "Minimum Power Supply Voltage = 34 "
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_2.ipynb b/Industrial_Instrumentation/Chapter_2.ipynb
new file mode 100644
index 00000000..f6c4dada
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_2.ipynb
@@ -0,0 +1,603 @@
+{
+ "metadata": {
+ "name": "Chapter_2"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 2: Pressure<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.1, Page Number: 116<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Pressure conversion'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "#1kg/cm^2=10000 mmWG",
+ "x=10000.0*10.0 #equivalnt to 10kg/cm^2",
+ "",
+ "#result",
+ "print('(a)\\n 10kg/cm^2 = %.0f mmWG' %x)",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "onemm_Hg=13.546 #pressure of 1 mm Hg",
+ "",
+ "#calculation",
+ "y=10.0**5/onemm_Hg",
+ "y=y/10.0**3",
+ "",
+ "#result",
+ "print('\\n(b)\\n10kg/cm^2 = 10^5 mmWG = %.2f * 10^3 mmHg' %y)",
+ "",
+ "#(c)",
+ "",
+ "#variable declaration",
+ "onebar=1.03 # 1 Bar presssure in kg/cm^2",
+ "#calculation",
+ "z=10.0/onebar",
+ "",
+ "#result",
+ "print('\\n(c)\\n10kg/cm^2 = %.2f bars' %z)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ " 10kg/cm^2 = 100000 mmWG",
+ "",
+ "(b)",
+ "10kg/cm^2 = 10^5 mmWG = 7.38 * 10^3 mmHg",
+ "",
+ "(c)",
+ "10kg/cm^2 = 9.71 bars"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.2, Page Number: 116<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gauge and absolute pressure'''",
+ "",
+ "#(a)",
+ "",
+ "#variable Declaration",
+ "gamm=1000.0 # density of water",
+ "d=35.0 # depth of water ",
+ "dens_Hg=13.546 # density of Hg",
+ "",
+ "#calculation",
+ "press_in_kg_cm=gamm*d*10**-4",
+ "press_in_mmHg=gamm*d/dens_Hg",
+ "press_in_mmHg=press_in_mmHg/10**3",
+ "",
+ "#result",
+ "print('(a)\\nThe pressure at depth of %d meters in a water tank=%.1f kg/cm^2 = %.2f*10^3 mmHg'%(d, press_in_kg_cm, press_in_mmHg))",
+ "",
+ "#(b)",
+ "",
+ "#varible declaration",
+ "press_atm=1.03 #atmospheric pressure",
+ "",
+ "#calculation",
+ "abspress=press_in_kg_cm+press_atm",
+ "abspress_mmHg=press_in_mmHg*1000.0+760.0",
+ "abspress_mmHg=abspress_mmHg/1000.0",
+ "",
+ "#result",
+ "print('\\n(b)\\nAbsolute Pressure= %.2f kg/cm^2 Abs = %.2f*10^3 mmHg Abs'%(abspress, abspress_mmHg))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "The pressure at depth of 35 meters in a water tank=3.5 kg/cm^2 = 2.58*10^3 mmHg",
+ "",
+ "(b)",
+ "Absolute Pressure= 4.53 kg/cm^2 Abs = 3.34*10^3 mmHg Abs"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.3, Page Number:116<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Gauge and absolute pressure'''",
+ "",
+ "#varible declaration",
+ "egp=260.0 # equivalent gauge pressure",
+ "",
+ "#calculation",
+ "abspress=760.0-egp",
+ "",
+ "#result",
+ "print('Absolute Presssure = %d mmHg' %abspress)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute Presssure = 500 mmHg"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.4,Page Number:117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''pressure measurement using U tube manometer'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "p_diff=500.0 #pressure difference in mmHg",
+ "",
+ "#calculations",
+ "pdiff=p_diff*13.546/10000",
+ "",
+ "#Result",
+ "print('(a)\\np1-p2 = %.3f kg/cm^2' %pdiff)",
+ "",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "p1=6770.0 # Gauge pressure in mmWG",
+ "p_atm=10300.0 # atmospheric pressure ",
+ "",
+ "#calculation",
+ "abs_p1=p1+p_atm",
+ "",
+ "#result",
+ "print('\\n(b)If p2 is open to atmosphere:\\nAbsolute Pressure P1 = %d mmWG abs.' %abs_p1)",
+ "",
+ "#(c)",
+ "",
+ "#variable declaration",
+ "P1=500.0 #mmHg absolute pressure",
+ "",
+ "#calculations",
+ "P1_gauge=P1-760.0",
+ "",
+ "#result",
+ "print('\\n(c)If p2 is evacuated and sealed:\\np1= %d mmHg gauge Pressure' %P1_gauge)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "p1-p2 = 0.677 kg/cm^2",
+ "",
+ "(b)If p2 is open to atmosphere:",
+ "Absolute Pressure P1 = 17070 mmWG abs.",
+ "",
+ "(c)If p2 is evacuated and sealed:",
+ "p1= -260 mmHg gauge Pressure"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.5, Page Number: 117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Specific Gravity and weight density'''",
+ "",
+ "#variable declaration",
+ "spe_grav_water=1.0 # specific gravity of water",
+ "",
+ "#calculation",
+ "spe_grav_X=spe_grav_water*100.0/50.0",
+ "wt_dens_water=1000.0",
+ "wt_dens_X=wt_dens_water*2.0",
+ "",
+ "#result",
+ "print('Weight Density of X = %d kg/m^3' %wt_dens_X)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Weight Density of X = 2000 kg/m^3"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.6, Page Number: 117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''water flow rate using mercury manometer'''",
+ "",
+ "#variable declaration",
+ "A=1.0/20.0 # Area ratio",
+ "p_diff=1500.0 # pressure difference in mmWG",
+ "",
+ "#result",
+ "print('(a)\\nAs Delta_h=A2/A1*h << h and normally negligible for well type manometer')",
+ "print('hence, p1-p2 = h = %d =111 mmHg' %p_diff)",
+ "print('\\n(b)\\nh measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg')",
+ "print('(Since area of both legs are same)')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "As Delta_h=A2/A1*h << h and normally negligible for well type manometer",
+ "hence, p1-p2 = h = 1500 =111 mmHg",
+ "",
+ "(b)",
+ "h measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg",
+ "(Since area of both legs are same)"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.7, Page Number: 119<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''readings and errors in Bourdon gauge reading'''",
+ "",
+ "print('1 kg/cm^2 = 10 mWG\\n')",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "press=10+2 #pressure read by the gauge",
+ "",
+ "#result",
+ "print('\\n(a)Bourdon Gauge is mounted 20 meters below water line:')",
+ "print('\\nPressure read by the Gauge = %d kg/cm^2'%press)",
+ "",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "press2=10-3 #pressure read by the gauge",
+ "",
+ "#result",
+ "print('\\n\\n(b)Bourdon Gauge is located 30 meters above the water line:')",
+ "print('\\nPressure read by the Gauge = %d kg/cm^2'%press2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 kg/cm^2 = 10 mWG",
+ "",
+ "",
+ "(a)Bourdon Gauge is mounted 20 meters below water line:",
+ "",
+ "Pressure read by the Gauge = 12 kg/cm^2",
+ "",
+ "",
+ "(b)Bourdon Gauge is located 30 meters above the water line:",
+ "",
+ "Pressure read by the Gauge = 7 kg/cm^2"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.8, Page Number: 120<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Specific Gravity and density of liquid'''",
+ "",
+ "#Variable declaration",
+ "dens_water=1000.0 # water Density",
+ "h1=125.0 # height1 mm",
+ "h2=250.0 # height2 mm",
+ "d2=h1*dens_water/h2",
+ "",
+ "#result",
+ "",
+ "#a",
+ "print('(a)\\nDensity of Liquid = %d kg/m^3' %d2)",
+ "print('\\nSpecific Density of the liquid = %.1f' %(h1/h2))",
+ "",
+ "#(b)",
+ "print('\\n\\n(b)\\nIf Values of water and liquid interchanged:\\n')",
+ "d3=h2*dens_water/h1",
+ "print('\\nDensity of Liquid = %d kg/m^3' %d3)",
+ "print('\\nSpecific Density of the liquid = %.1f' %(h2/h1))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Density of Liquid = 500 kg/m^3",
+ "",
+ "Specific Density of the liquid = 0.5",
+ "",
+ "",
+ "(b)",
+ "If Values of water and liquid interchanged:",
+ "",
+ "",
+ "Density of Liquid = 2000 kg/m^3",
+ "",
+ "Specific Density of the liquid = 2.0"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.9, Page Number: 120<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''strain gauge wire length and cross section area'''",
+ "",
+ "import math",
+ "#variable Declaration",
+ "R=120.0 #resistance",
+ "l=122.0 #length",
+ "a=0.1 #area",
+ "R1=140.0 #resistance in ohm",
+ "",
+ "#calculation",
+ "rho=R*a/l",
+ "l1=math.sqrt(R1*a*l/rho)",
+ "l1=round(l1,0)",
+ "",
+ "#Result",
+ "print('Length l1 = %d meters' %l1)",
+ "A1=a*l/l1",
+ "print('\\nArea A1 = %.4f mm^2' %A1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length l1 = 132 meters",
+ "",
+ "Area A1 = 0.0924 mm^2"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.10, Page Number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Capacitance calculation for variable dielectric'''",
+ "",
+ "c=0.57 #Constant",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "d=0.1 #distance between plates",
+ "di1=100.0 #Dielectric constant",
+ "di2=1000.0 #Dielectric constant",
+ "",
+ "#calculation",
+ "c1=c*di1*10.0/d",
+ "c1=round(c1,0)",
+ "",
+ "#result",
+ "print('(a)\\nC1=%d pf' %c1)",
+ "",
+ "",
+ "#(b)",
+ "",
+ "#calculation",
+ "c2=c*di2*10/d",
+ "",
+ "#result",
+ "print('\\n(b)\\nC2=%d pf' %c2)",
+ "",
+ "",
+ "#(c)",
+ "",
+ "#calculation",
+ "ds=0.09",
+ "c11=c*di1*10/ds",
+ "c12=c*di2*10/ds",
+ "",
+ "#result",
+ "print('\\n(c)\\nC1 = %.1f pf\\nC2 = %d pf'%(c11,c12))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "C1=5700 pf",
+ "",
+ "(b)",
+ "C2=57000 pf",
+ "",
+ "(c)",
+ "C1 = 6333.3 pf",
+ "C2 = 63333 pf"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.11, Page Number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''pressure gauge caliberation'''",
+ "",
+ "#variable Declaration",
+ "A=1.0 #area",
+ "p1=10.0 #pressure",
+ "",
+ "#calculation",
+ "W1=A*p1",
+ "",
+ "#Result",
+ "print('W1 = %d kg' %W1)",
+ "print('\\nWith the 4 standard weights of 10kg, 20kg, 30kg and 40kg')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W1 = 10 kg",
+ "",
+ "With the 4 standard weights of 10kg, 20kg, 30kg and 40kg"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.12, Page Number: 122<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''pressure calculation using McLeod gauge'''",
+ "",
+ "#varable declaration",
+ "p1=10**-2 #pressure in torr",
+ "h1=20.0 #height in mm",
+ "",
+ "#xalculation",
+ "K=p1/h1**2",
+ "p2=K*30**2",
+ "p2=p2*100.0",
+ "",
+ "#Result",
+ "print('The unknown pressure p2 = %.2f * 10^-2 torr' %p2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The unknown pressure p2 = 2.25 * 10^-2 torr"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_3.ipynb b/Industrial_Instrumentation/Chapter_3.ipynb
new file mode 100644
index 00000000..6d26bc18
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_3.ipynb
@@ -0,0 +1,391 @@
+{
+ "metadata": {
+ "name": "Chapter_3"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter_3: Force Torque and Velocity<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.1, Page Number: 163<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Force calculation'''",
+ "",
+ "#variable declaration",
+ "m1=20 #mass of the body in Kg ",
+ "a=5 #acceleration in m/s^2",
+ "",
+ "#calculation",
+ "F=m1*a",
+ "",
+ "#result",
+ "print('F = %d Newtons'%F)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F = 100 Newtons"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.2, Page Number: 163<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Weight calculation'''",
+ "",
+ "#variable declaration",
+ "m1=50 #mass of the body in Kg ",
+ "g1=9.8 #acceleration due to gravity",
+ "",
+ "#calculation",
+ "W2=m1*g1",
+ "",
+ "#result",
+ "print('W = %d Newtons = %d kgf' %(W2,m1))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W = 490 Newtons = 50 kgf"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.3, Page Number: 164<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of specific gravity'''",
+ "",
+ "#variable declaration",
+ "wt_material=2500.0 #weight of 1 m^3 material",
+ "wt_water=1000.0 #weight of 1 m^3 water",
+ "",
+ "#calculation",
+ "spe_grav=wt_material/wt_water",
+ "",
+ "#result",
+ "print('Specific gravity of the material = %.1f' %spe_grav)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific gravity of the material = 2.5"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.4, Page Number: 164<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Estimation of uncertainty due to sensitivity'''",
+ "",
+ "import math",
+ "#variable declaration",
+ "L=20.0 # length in cm",
+ "W=2000.0 # Weight of mass in gm ",
+ "db=0.02 # length in cm ",
+ "Wb=100.0 # Weight of mass in gm ",
+ "dG=0.5 # length in cm",
+ "",
+ "#calculation",
+ "S=L/(2*W*db+Wb*dG)",
+ "fi=0.2",
+ "DeltaW=fi*math.pi/(180*S)",
+ "",
+ "#result",
+ "print('S = %.3f rad/g' %S)",
+ "print('\\nDeltaW = %.3f g' %DeltaW)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S = 0.154 rad/g",
+ "",
+ "DeltaW = 0.023 g"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.5, Page Number: 164<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Torque Calculation'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "hp=746.0 # horse power",
+ "P=5*hp # Saft power in Watts",
+ "N=1500.0 # speed in rpm",
+ "",
+ "#calculation",
+ "n=N/60.0",
+ "T=P*60/(2*math.pi*n)",
+ "",
+ "#result",
+ "print('T = %.0f Newton meters' %(math.ceil(T)))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T = 1425 Newton meters"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.6, Page Number: 165<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Force calculation'''",
+ "",
+ "#variable declaration",
+ "ch_l=0.075 #change in length",
+ "orig_l=50.0 #Original length",
+ "",
+ "#calculation",
+ "S=ch_l/orig_l",
+ "E=9.66*10**5",
+ "stress=E*S",
+ "area=1.5",
+ "f=stress*area",
+ "",
+ "#result",
+ "print('Strain = %.4f cm/cm\\nStress =%d kg/cm^2\\nForce = %.1f kg'%(S,stress,f))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Strain = 0.0015 cm/cm",
+ "Stress =1449 kg/cm^2",
+ "Force = 2173.5 kg"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.7, Page Number: 165<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''resistance strain gauge'''",
+ "",
+ "import math",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "R1=120.0 # resistance in Ohm",
+ "R2=120.0 # resistance in Ohm",
+ "R3=120.0 # resistance in Ohm",
+ "R4=120.0 # resistance in Ohm",
+ "Rg=100.0 # resistance in Ohm",
+ "",
+ "#calculation",
+ "C=(R1*R2*R4)+(R1*R3*R4)+(R1*R2*R3)+(R2*R3*R4)+(Rg*(R1+R4)*(R2+R3))",
+ "C=C/(10**7)",
+ "",
+ "#result",
+ "print('(a)\\nC=%.3f*10^7' %C)",
+ "E=10",
+ "F=(E*R3*R1*2*10**3)/(C*10**7)",
+ "print('\\nF = %.1f *10^3 A/mm = %.1f mA/mm'%(F,F))",
+ "",
+ "#(b)",
+ "",
+ "#calculation",
+ "Fe=2*10**-4",
+ "E=10",
+ "DeltaE=Fe*E/(4+4*10**-4)",
+ "DeltaE=DeltaE*10**3",
+ "",
+ "#Result",
+ "print('\\n(b)\\nDeltaEg=%.1f mV' %DeltaE)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "C=1.267*10^7",
+ "",
+ "F = 22.7 *10^3 A/mm = 22.7 mA/mm",
+ "",
+ "(b)",
+ "DeltaEg=0.5 mV"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.8, PAge Number: 167<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''speed measurement using stroboscope'''",
+ "",
+ "#(a)",
+ "import math",
+ "",
+ "#variable Declaration",
+ "r1=2500.0 # Highest flasing rate ",
+ "r2=1500.0 # next Highest flasing rate ",
+ "",
+ "#calculation",
+ "n=(r1*r2)/(r1-r2)",
+ "",
+ "#result",
+ "print('(a)\\nn = %d rpm'%n)",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "N=5.0 # Fift time syncronization for same speed",
+ "",
+ "#calculation",
+ "r5=n*r1/((r1*(N-1))+n)",
+ "r5=math.ceil(r5)",
+ "",
+ "#result",
+ "print('\\n(b)\\nr5=%d Flashes/Minute' %r5)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "n = 3750 rpm",
+ "",
+ "(b)",
+ "r5=682 Flashes/Minute"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.9, Page Number: 167<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''speed measurement using proximity'''",
+ "",
+ "#variable declaration",
+ "rpm=1500.0 #rotation in rpm",
+ "f=200.0 #frequency",
+ "",
+ "#calculation",
+ "N=60*f/rpm",
+ "",
+ "#result",
+ "print('No of teeth on the wheel\\nN=%d' %N)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No of teeth on the wheel",
+ "N=8"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_4.ipynb b/Industrial_Instrumentation/Chapter_4.ipynb
new file mode 100644
index 00000000..f58d6ec6
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_4.ipynb
@@ -0,0 +1,554 @@
+{
+ "metadata": {
+ "name": "Chapter_4"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 4: Acceleration Vibration and Density<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.1, Page Number:209 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''''mechanical system for a seismic instrument'''",
+ "",
+ "import math",
+ "#(a)",
+ "",
+ "#variable Declaration",
+ "k=50.0 #Spring constant ",
+ "m=0.005 # mass in kg",
+ "",
+ "#calculation",
+ "wn=math.sqrt(k/m)",
+ "",
+ "#result",
+ "print('(a)\\nNatural frequency(wn)= %d rad/s' %wn)",
+ "",
+ "",
+ "#(b)",
+ "",
+ "#calculation",
+ "Cc=2*(m*k)**(0.5)",
+ "",
+ "#result",
+ "print('\\n(b)\\nCc=%d' %Cc)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Natural frequency(wn)= 100 rad/s",
+ "",
+ "(b)",
+ "Cc=1"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.2, Page Number:209<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Frequency and phase angle of motion'''",
+ "",
+ "#(a)",
+ "import math",
+ "",
+ "#variable Declaration",
+ "Cc=1.0 # damping ratio ",
+ "C=0.7*Cc # Critical damping ratio ",
+ "m=0.005 # mass",
+ "k=50.0 # spring constant",
+ "",
+ "#calculation",
+ "w=math.sqrt((k/m)-(C/(2*m))**2)",
+ "",
+ "#result",
+ "print('(a)\\nw=%.1f rad/s' %w)",
+ "",
+ "#(b)",
+ "",
+ "#variable Declaration",
+ "w1=250.0 # angular velocity",
+ "",
+ "#calculation",
+ "theta=C*w1/(k-m*w1**2)",
+ "print('\\ntheta=%f' %theta)",
+ "fi=math.atan(-theta)",
+ "fi=fi*180.0/math.pi",
+ "",
+ "#result",
+ "print('\\nfi = %d\u00b0'%fi)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "w=71.4 rad/s",
+ "",
+ "theta=-0.666667",
+ "",
+ "fi = 33\u00b0"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.3, PAge Number: 210<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''time calculation for exponetial transient term'''",
+ "import math",
+ "",
+ "#variable Declaration",
+ "m=0.005 # mass ",
+ "c=0.7 # damping ratio",
+ "",
+ "#calculation",
+ "y=-math.log(0.01)",
+ "t=y*2*m/c",
+ "",
+ "#result",
+ "print('t=%.4f Secs' %t)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t=0.0658 Secs"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.4, Page Number:210<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Acceleration measurement'''",
+ "",
+ "#variable Declaration",
+ "rg1=1200.0 #resistance in Ohm",
+ "rg2=1200.0 #resistance in Ohm",
+ "rg3=1200.0 #resistance in Ohm",
+ "rg4=1200.0 #resistance in Ohm",
+ "",
+ "#calculation",
+ "D1=rg1*5.0/100.0",
+ "D2=rg2*5.0/100.0",
+ "D3=rg3*5.0/100.0",
+ "D4=rg4*5.0/100.0",
+ "E=12.0",
+ "v=E*(((rg1+D1)/(rg1+D1+rg2-D2))-((rg4-D4)/(rg3+D3+rg4-D4)))",
+ "v=v*1000.0",
+ "",
+ "#result",
+ "print('V0=%d mV' %v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V0=600 mV"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.5, Page Number:211<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''output voltage of quartz piezoelectric crystal'''",
+ "",
+ "#variable declaration",
+ "g=0.06 # voltage sensitivity",
+ "",
+ "#calculation",
+ "t=2.5*10**-3",
+ "p=20*9.8*10**4",
+ "E=g*t*p",
+ "",
+ "#Result",
+ "print('E=%d V' %E)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "E=294 V"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.6, Page Number: 211<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Differential values of capacitor'''",
+ "",
+ "#resistance in Ohm",
+ "c0=25.0 # capacitance in pF",
+ "x0=0.5 # distance between plates",
+ "x1=0.05 # steady state displacement ",
+ "",
+ "#calculations",
+ "c1=c0*x0/(x0-x1)",
+ "c2=c0*x0/(x0+x1)",
+ "",
+ "#result",
+ "print('C1=%.2f pF\\nC2=%.2f pF'%(c1,c2))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C1=27.78 pF",
+ "C2=22.73 pF"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.7, Page Number: 211<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Specific Gravity Conversion'''",
+ "",
+ "#(a)",
+ "",
+ "#Specific gravity at 60 degree F",
+ "sg_at_60=1.02",
+ "",
+ "#calculation",
+ "API=(141.5/sg_at_60)-131.5",
+ "",
+ "#result",
+ "print('(a)\\nDegrees API = %.2f\u00b0API' %API)",
+ "",
+ "#(b)",
+ "",
+ "#calculation",
+ "Be=145-145/sg_at_60",
+ "",
+ "#result",
+ "print('\\n(b)\\nDegrees Baume(heavy) = %.1f\u00b0Be' %Be)",
+ "",
+ "",
+ "#(c)",
+ "",
+ "#calculation",
+ "Bk=(sg_at_60-1)*1000",
+ "",
+ "#result",
+ "print('\\n(c)\\nDegrees Barkometer = %d\u00b0Bk' %Bk)",
+ "",
+ "#(d)",
+ "",
+ "#calculation",
+ "Q=(sg_at_60-1)*1000",
+ "",
+ "#result",
+ "print('\\n(c)\\nDegrees Quevenne = %d\u00b0Q' %Q)",
+ "",
+ "#(e)",
+ "",
+ "#calculation",
+ "Tw=200*(sg_at_60-1.0)",
+ "",
+ "#result",
+ "print('\\n(d)\\nDegrees Twaddel = %d\u00b0Tw' %Tw)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Degrees API = 7.23\u00b0API",
+ "",
+ "(b)",
+ "Degrees Baume(heavy) = 2.8\u00b0Be",
+ "",
+ "(c)",
+ "Degrees Barkometer = 20\u00b0Bk",
+ "",
+ "(c)",
+ "Degrees Quevenne = 20\u00b0Q",
+ "",
+ "(d)",
+ "Degrees Twaddel = 4\u00b0Tw"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.8, Page NUmber: 212<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of the volume of displacer'''",
+ "",
+ "import math",
+ "",
+ "#variable Declaration",
+ "T=0.5 # Torque Tube Force",
+ "sg1=1.02 # Maximum spe.gravity to be measured",
+ "sg2=0.98 # Minimum spe.gravity to be measured",
+ "wt=1000*10**-6",
+ "",
+ "#calculation",
+ "v=T/((sg1-sg2)*wt)",
+ "v=math.ceil(v)",
+ "",
+ "#result",
+ "print('V=%d cm^3' %v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V=12500 cm^3"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.9, Page Number: 212<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Differential pressure Sensor'''",
+ "",
+ "import math",
+ "",
+ "#variavle declaration",
+ "sg1=0.85 # Maximum spe.gravity to be measured",
+ "sg2=0.8 # Minimum spe.gravity to be measured",
+ "span=150.0 # D/P cell span",
+ "",
+ "",
+ "#a",
+ "",
+ "#calculation",
+ "H=span/(sg1-sg2)",
+ "",
+ "#result",
+ "print('(a)\\nH=%d mm = %dm' %(H,H/1000))",
+ "",
+ "#b",
+ "",
+ "#calculation",
+ "span_min=1500.0",
+ "span2=span_min*(sg1-sg2)",
+ "span2=math.ceil(span2)",
+ "",
+ "#result",
+ "print('\\n(b)\\nD/P span = %d mm' %span2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "H=3000 mm = 3m",
+ "",
+ "(b)",
+ "D/P span = 75 mm"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.10, Page Number:212<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Specific Gravity of unknown liquid'''",
+ "",
+ "#variable declaration",
+ "Ww=12-2 # Width of water",
+ "dw=1000.0 # density of water",
+ "",
+ "#calculation",
+ "v=Ww/dw",
+ "dx=(10-2)/v",
+ "sg=dx/dw ",
+ "",
+ "#result",
+ "print('Specific Gravity of X =%.1f' %sg)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific Gravity of X =0.8"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.11, PAge Number: 213<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of specific gravity'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "wt=1.5 # weight of object",
+ " ",
+ "#calculation",
+ "v_obj=2.0/1000",
+ "dx=wt/v_obj",
+ "sg=dx/1000",
+ "",
+ "#result",
+ "print('(a)\\nSpecific Gravity = %.2f' %sg)",
+ "",
+ "#(b)",
+ "",
+ "sgl=0.8 # specific grav of liquid",
+ "dens=800.0 # density",
+ "",
+ "#calculation",
+ "W1=dens*v_obj-wt",
+ "",
+ "#result",
+ "print('\\n(b)\\nW1 = %.1f kg' %W1)",
+ "",
+ "",
+ "#(c)",
+ "",
+ "#variable declaration",
+ "sg2=1.2 # spe. grav.",
+ "dens2=1200.0 # density",
+ "",
+ "#calculation",
+ "W2=dens2*v_obj-wt",
+ "",
+ "#result",
+ "print('\\n(c)\\nW2 = %.1f kg' %W2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Specific Gravity = 0.75",
+ "",
+ "(b)",
+ "W1 = 0.1 kg",
+ "",
+ "(c)",
+ "W2 = 0.9 kg"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_5.ipynb b/Industrial_Instrumentation/Chapter_5.ipynb
new file mode 100644
index 00000000..fa1d0762
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_5.ipynb
@@ -0,0 +1,874 @@
+{
+ "metadata": {
+ "name": "Chapter_5"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 5: Flow <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.1, Page Number: 310<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''flow rate calulation'''",
+ "",
+ "import math",
+ "#(i)",
+ "",
+ "#variable declaration",
+ "d=75.0*10**-3 # diameter of pipe",
+ "a=math.pi*d**2/4 # area of cross section of pipe",
+ "v=760.0*10**-3 # flow velocity",
+ "",
+ "#calculation",
+ "Q=v*a",
+ "Q=Q*10**3",
+ "print('(i)\\nVolume Flow Rate Q=%.3f *10^-3 m^3/sec' %Q)",
+ "rho=1000.0",
+ "W=rho*Q*10**-3",
+ "",
+ "#result",
+ "print('\\n(ii)\\nMass Flow rate W=%.3f kg/sec' %W)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)",
+ "Volume Flow Rate Q=3.358 *10^-3 m^3/sec",
+ "",
+ "(ii)",
+ "Mass Flow rate W=3.358 kg/sec"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.2, page Number:310<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Volumetric flow rate calculation'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "D=40.0 # Diameter of pipe",
+ "d=20.0 # Diameter of Orifice",
+ "mr=15.0 # Manometer reading",
+ "",
+ "#calculation",
+ "h=(13.6-1)*15.0*10.0",
+ "B=d/D",
+ "M=1/math.sqrt(1-(B**4))",
+ "Cd=0.5999",
+ "x=math.sqrt(2*9.8*h*(10**-3))",
+ "Q=x*Cd*M*(math.pi*((20*(10**-3))**2))/4",
+ "Q=Q*3600.0",
+ "",
+ "#result",
+ "print('Volumetric flow rate Q= %.4f m^3/hr' %Q)",
+ "#Answer slightly deviates from answer given in the book because of pi value.",
+ "#if pi=3.14, then answer is same as in textbook "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volumetric flow rate Q= 4.2649 m^3/hr"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.3, Page Number: 310<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Nominal flow velocity'''",
+ "",
+ "import math",
+ "#variable declaration",
+ "Re=10.0**5 # Reynolds number",
+ "D=40.0*10**-3 # Diameter of pipe ",
+ "v=10**-6 # Kinematic viscosity in m^2/sec",
+ "",
+ "#calculation",
+ "V1=Re*v/D",
+ "A1=(math.pi*(40.0*10**-3)**2)/4",
+ "A2=(math.pi*(20.0*10**-3)**2)/4",
+ "V2=V1*A1/A2",
+ "",
+ "#result",
+ "print('V2=%.1f m/sec' %V2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V2=10.0 m/sec"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.4, Page Number: 311<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''pressure difference calculation'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "Cd=0.61 # discharge coefficient",
+ "D=40.0*10**-3 # Diameter of pipe",
+ "d=20.0*10**-3 # Diameter of Orifice ",
+ "",
+ "#calculation",
+ "M=1/math.sqrt(1-(d/D)**4)",
+ "V2=10.0",
+ "rho=1000.0",
+ "g=9.8",
+ "X=V2*math.sqrt(rho/(2*g))/(Cd*M)",
+ "p_diff=X**2",
+ "p_diff=math.floor(p_diff/100)",
+ "p_diff=p_diff/100.0",
+ "",
+ "",
+ "#result",
+ "print('P1-P2 = %.2f kg/cm^2'%p_diff)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P1-P2 = 1.28 kg/cm^2"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.5, Page Number: 312<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''volume flow rate for orifice and venturi Tubes'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "Cd=0.6 # discharge coefficient",
+ "D=150.0*10**-3 # Diameter of pipe",
+ "d=75.0*10**-3 # Diameter of Orifice ",
+ "p=250.0 # pressure recorded",
+ "g=9.8 # acceleration due to gravity",
+ "rho=1000.0 # Water density ",
+ "s=75.0*10**-3 # venturi tube size",
+ "",
+ "#(a)",
+ "",
+ "#calculation",
+ "Q=Cd*math.pi*s**2*math.sqrt(2*g*p/rho)/(4*math.sqrt(1-(d/D)**4)) ",
+ "",
+ "#result",
+ "print('(a) For orifice plate\\nQ=%f m^3/sec = %.3f litres/sec'%(Q,Q*1000))",
+ "",
+ "#calculation",
+ "Cd1=0.99",
+ "Q2=Cd1*math.pi*s**2*math.sqrt(2*g*p/rho)/(4*math.sqrt(1-(d/D)**4))",
+ "",
+ "#result",
+ "print('\\n\\n(b)For venturi tube\\nQ=%f m^3/sec = %.2f litres/sec'%(Q2,Q2*1000))",
+ "#Answer slightly deviates from answer given in the book because of pi value.",
+ "#if pi=3.14, then answer is same as in textbook "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) For orifice plate",
+ "Q=0.006060 m^3/sec = 6.060 litres/sec",
+ "",
+ "",
+ "(b)For venturi tube",
+ "Q=0.009999 m^3/sec = 10.00 litres/sec"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.6, Page Number: 312<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''determination of Reynolds number'''",
+ "",
+ "import math",
+ "",
+ "#(i)",
+ "",
+ "#variable declaration",
+ "V=0.02 # volumetric flow rate",
+ "d=10*10**-2 # Diameter of pipe",
+ "",
+ "#calculation",
+ "A=math.pi*d**2/4",
+ "v=V/A",
+ "rho=1000.0",
+ "Re=rho*v*d/10**-3",
+ "Re=Re/100000.0",
+ "",
+ "#result",
+ "print('(i)\\nReynolds number(Re) = %.3f * 10^5'%Re)",
+ "",
+ "#(ii)",
+ "",
+ "#variable declaration",
+ "Cd=0.98 # discharge coefficient ",
+ "D=20*10**-2 # Diameter of pipe ",
+ "d=10*10**-2 # Diameter of orifice",
+ "",
+ "#calculation",
+ "M=1/math.sqrt(1-(d/D)**4)",
+ "a2=math.pi*d**2/4",
+ "Q=0.02",
+ "g=9.8",
+ "X=Q*math.sqrt(rho)/(M*Cd*a2*math.sqrt(2*g))",
+ "p_diff=math.ceil(X**2)",
+ "",
+ "#result",
+ "print('\\n(ii)\\nPressur_difference = %d kg/m^2 = %.4f kg/cm^2'%(p_diff,p_diff/10000))",
+ "#Answer slightly deviates from answer given in the book because of pi value.",
+ "#if pi=3.14, then answer is same as in textbook "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)",
+ "Reynolds number(Re) = 2.546 * 10^5",
+ "",
+ "(ii)",
+ "Pressur_difference = 323 kg/m^2 = 0.0323 kg/cm^2"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.7, Page Number: 313<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Fluid velocity and Volumetric flow rate'''",
+ "",
+ "import math",
+ "",
+ "#1kg/m^2=10 meters water head",
+ "",
+ "#variable declaration",
+ "g=9.81 #acceleration due to gravity",
+ "h=20.0 #height",
+ "",
+ "#calculation",
+ "v=math.sqrt(2*g*h)",
+ "d=300.0*10**-3",
+ "A=(math.pi*d**2)/4",
+ "A=math.floor(A*1000)",
+ "A=A/1000.0",
+ "Q=A*v",
+ "",
+ "#result",
+ "print('Q = %.3f m^3/sec'%Q)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q = 1.387 m^3/sec"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.8, Page Number:313<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Fluid velocity calculation'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "Cd=0.6 # coefficient of discharge ",
+ "g=9.8 #acceleration due to gravity",
+ "h=400*10**-3 #height",
+ "",
+ "#calculation",
+ "V=Cd*math.sqrt(2*g*h)",
+ "",
+ "#result",
+ "print('V = %.2f m/sec' %V)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V = 1.68 m/sec"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.9, Page Number: 314<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''velocity measurement using pilot tube'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "Cd=0.98 # coefficient of discharge",
+ "g=9.8 #acceleration due to gravity",
+ "h=900.0*10**-3 #height",
+ "",
+ "#calculation",
+ "V=Cd*math.sqrt(2*g*h)",
+ "V=math.floor(V*100)",
+ "V=(V/100.0)",
+ "",
+ "#result",
+ "print('V = %.2f m/sec' %V)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V = 4.11 m/sec"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.10, Page Number:314<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determination of flow velocity'''",
+ "",
+ "import math",
+ "",
+ "#Variable declaration",
+ "del_p=20*10**3 #Pa",
+ "dens_water=1000 #kg/m^3",
+ "dens_air=1.29 #kg/m^3",
+ "",
+ "#calculations",
+ "",
+ "#(i)When flowing fluid is water",
+ "v=math.sqrt(2*del_p/dens_water)",
+ "",
+ "#(ii)When flowing fluid is air",
+ "v1=math.sqrt(2*del_p/dens_air)",
+ "",
+ "#result",
+ "print('\\n(i)When flowing fluid is water\\n\\tV=%.3f m/sec'%v)",
+ "print('\\n(ii)When flowing fluid is air\\n\\tV=%.0f m/sec'%v1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "(i)When flowing fluid is water",
+ "\tV=6.325 m/sec",
+ "",
+ "(ii)When flowing fluid is air",
+ "\tV=176 m/sec"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.11, Page Number: 314<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''detemination of flow velocity'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "dens=1026.0 # density of see water",
+ "p=25.0*10**3 # pressure difference in manometer ",
+ "",
+ "#calculation",
+ "V=math.sqrt(2*p/dens)",
+ "",
+ "#result",
+ "print('V=%.2f m/sec =%.3f km/hr'%(V,V*18/5))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V=6.98 m/sec =25.131 km/hr"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.12, Page Number: 314<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of flying speed of aircraft'''",
+ "import math",
+ "",
+ "# variable declaration",
+ "dens=1.29 # air density at height ",
+ "",
+ "#calculation",
+ "p=12.5*1000",
+ "V=math.sqrt(2*p/dens)",
+ "",
+ "",
+ "#result",
+ "print('V=%.2f m/sec =%.2f km/hr'%(V,V*18/5))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V=139.21 m/sec =501.16 km/hr"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.13, Page Number: 315<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Maximum fluid handling capacity of Rotameter'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "Cd=0.6 # discharge coefficient",
+ "Dp=0.05 # inside diameter of metering tube ",
+ "Df=0.035 # diameter of rotameter ",
+ "g=9.8 # acceleration due to gravity",
+ "rho_f=3.9*10**3 # density of cylindrical float",
+ "rho=1000.0 # water density ",
+ "Vf=3.36*10**-5 # volume of the float",
+ "",
+ "#calculation",
+ "Q=Cd*((Dp**2-Df**2)/Df)*math.sqrt(math.pi*g*Vf*(rho_f-rho)/(2*rho))",
+ "Q=Q*10000.0",
+ "",
+ "#result",
+ "print('Volumetric flow Q=%.4f *10^-4 m^3/sec' %Q)",
+ "#Answer slightly deviates from answer given in the book because of pi value.",
+ "#if pi=3.14, then answer is same as in textbook "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volumetric flow Q=8.4652 *10^-4 m^3/sec"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.14, Page number: 315<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determination of range of flow for ratameter'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "Cd=1 # discharge coefficient",
+ "Dp=0.018 # inside diameter of metering tube ",
+ "Df=0.015 # diameter of rotameter ",
+ "g=9.81 # acceleration due to gravity",
+ "rho_f=2.7 # density of cylindrical float",
+ "rho=0.8 # water density ",
+ "Vf=520.0*10**-9 # volume of the float",
+ "",
+ "#case 1",
+ "",
+ "#caculation",
+ "Qmin=Cd*((Dp**2-Df**2)/Df)*math.sqrt(math.pi*g*Vf*(rho_f-rho)/(2*rho))",
+ "Qmin=Qmin*100000.0",
+ "",
+ "#result",
+ "print('Case 1: When float is at the bottom\\n Volumetric flow Qmin=%.3f *10^-5 m^3/sec'%Qmin)",
+ "",
+ "#case 2",
+ "",
+ "#calculation",
+ "Dp2=0.0617",
+ "Qmax=Cd*((Dp2**2-Df**2)/Df)*math.sqrt(math.pi*g*Vf*(rho_f-rho)/(2*rho))",
+ "Qmax=Qmax*100000",
+ "",
+ "#result",
+ "print('\\n\\nCase 2: When float is at the bottom\\n Volumetric flow Qmax=%.2f *10^-5 m^3/sec'%Qmax)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case 1: When float is at the bottom",
+ " Volumetric flow Qmin=2.879 *10^-5 m^3/sec",
+ "",
+ "",
+ "Case 2: When float is at the bottom",
+ " Volumetric flow Qmax=104.17 *10^-5 m^3/sec"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.15, Page Number:316<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of coal delivery for coal conveyor system'''",
+ "",
+ "# variable declaration",
+ "W=165.0 # weight of material on section of length",
+ "R=328.0 # Conveyor speed m/min",
+ "L=16.0 # Length of weighting platform in m",
+ "",
+ "#calculation",
+ "Q=W*R/L",
+ "",
+ "#result",
+ "print('Flow Rate Q=%.2f kg/min =%.1f kg/hour'%(Q,Q/60))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flow Rate Q=3382.50 kg/min =56.4 kg/hour"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.16, Page Number:316<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Fluid velocity calculation'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "f=100.0 # beat frequency",
+ "d=300.0*10**-3 # Sound path",
+ "a=45.0 #angle between transmeter and receiver in degrees",
+ "",
+ "#calculation",
+ "a_rad=45.0*math.pi/180.0",
+ "v=f*d/(2*math.cos(a_rad))",
+ "",
+ "#Result",
+ "print('Fluid Velocity V=%.1f m/sec'%v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fluid Velocity V=21.2 m/sec"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.17, Page Number: 316<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''volume flow rate'''",
+ "",
+ "# variable declaration",
+ "r=150.0 # speed of rotation",
+ "v=120.0 # volume trapped between gears and casting",
+ "",
+ "#clculation",
+ "Q=4.0*v*r",
+ "",
+ "#result",
+ "print('Volume flow rate Q=%d cm^3/min = %d litres/min'%(Q,Q/1000))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume flow rate Q=72000 cm^3/min = 72 litres/min"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.18, Page Number: 317<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''induced emf in electromagnetic flow meter'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "Q=2500.0 # Quantitty flow rate",
+ "d=2.75 # inner diameter",
+ "",
+ "#calculation",
+ "a=(math.pi*d**2)/4",
+ "v=Q/(60*a)",
+ "B=60.0",
+ "e=B*d*10**-2*v*10**-2",
+ "",
+ "#result",
+ "print('Induced emf e =%.4f V=%.1f mV'%(e,e*1000))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Induced emf e =0.1157 V=115.7 mV"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.19, Pae Number:317<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''velocity of flow in electromagnetic flow meter'''",
+ "",
+ "# variable declaration",
+ "e=0.2*10**-3 # voltage of electromagnetic flow meter",
+ "B=0.08 # Flux density",
+ "l=10.0*10**-2 # Diameter of pipe",
+ "",
+ "#calculation",
+ "v=e/(B*l)",
+ "",
+ "#result",
+ "print('V = %.3f m/sec = %.2f cm/sec'%(v,v*100))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V = 0.025 m/sec = 2.50 cm/sec"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.20, Page Number: 317<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''average velocity of flow in electromagnetic flow meter'''",
+ "",
+ "# variable declaration",
+ "ei=0.15*10**-3 # peak value",
+ "em=2*ei # p-p amplifier output ",
+ "B=0.1 # flux density",
+ "l=60.0*10**-3 # diameter of the pipe",
+ "",
+ "#calculation",
+ "v=em/(B*l)",
+ "",
+ "#result",
+ "print('Velocity of flow V = %.2f m/sec = %.1f cm/sec'%(v,v*100))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of flow V = 0.05 m/sec = 5.0 cm/sec"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_6.ipynb b/Industrial_Instrumentation/Chapter_6.ipynb
new file mode 100644
index 00000000..d3a9a093
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_6.ipynb
@@ -0,0 +1,534 @@
+{
+ "metadata": {
+ "name": "Chapter_6"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 6: Level<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.1,Page Number:370<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''output current of two wire pressure transmitter'''",
+ "",
+ "#(a)",
+ "",
+ "# variable declaration",
+ "p=1.5 # pressure applied",
+ "a=4.0 # mA corresponds to 0 kg/cm^2",
+ "b=20.0 # mA corresponds to 2 kg/cm^2",
+ "",
+ "#calculation",
+ "wh=(((b-a)/2)*p)+a",
+ "",
+ "#result",
+ "print('(a)just at the bottom level of the tank')",
+ "print('Water head applied to the transmitter =%d mA'%wh)",
+ "",
+ "#(b)",
+ "",
+ "#calculation",
+ "wh2=(((b-a)/2)*p)+2*a",
+ "",
+ "#result",
+ "print('\\n\\n(b)5m below the bottom of the tank')",
+ "print('Water head applied to the transmitter =%d mA' %wh2)",
+ "",
+ "#(c)",
+ "",
+ "#calculation",
+ "wh3=(((b-a)/2)*p)",
+ "",
+ "#result",
+ "print('\\n\\n(c)5m above the bottom of the tank')",
+ "print('Water head applied to the transmitter =%d mA'%wh3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)just at the bottom level of the tank",
+ "Water head applied to the transmitter =16 mA",
+ "",
+ "",
+ "(b)5m below the bottom of the tank",
+ "Water head applied to the transmitter =20 mA",
+ "",
+ "",
+ "(c)5m above the bottom of the tank",
+ "Water head applied to the transmitter =12 mA"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.2, Page Number:371<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''water level and current at different positions'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "b=20.0 # Maximum output",
+ "a=4.0 # minimum output ",
+ "op=16.0 # output in mA",
+ "",
+ "#calculation",
+ "p=(op-a)*2/(b-a)",
+ "p_h=p*10.0",
+ "h=p_h-2-5",
+ "",
+ "#result",
+ "print('(a)\\nh = %dm'%h)",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "p1=1 # pressure applied",
+ "",
+ "#calculation",
+ "t_op=((b-a)/2)*p1+4",
+ "",
+ "#result",
+ "print('\\n(b)\\nTransmitter output =%d mA'%t_op)",
+ "",
+ "#(c)",
+ "",
+ "#variable declaration",
+ "p2=0.5 # applied pressure",
+ "",
+ "#calculation",
+ "t_op1=((b-a)/2)*p2+4",
+ "",
+ "#result",
+ "print('\\n(c)\\nTransmitter output =%d mA'%t_op1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "h = 8m",
+ "",
+ "(b)",
+ "Transmitter output =12 mA",
+ "",
+ "(c)",
+ "Transmitter output =8 mA"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.3, Page Number: 372<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Differential pressure output at different levels'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "b=20.0 # Maximum output",
+ "a=4.0 # minimum output",
+ "op=16.0 # actual output ",
+ "wt_l1=25.0 # water level (i)",
+ "",
+ "#calculation",
+ "t_op=((b-a)/100)*(100-75)+4",
+ "",
+ "#result",
+ "print('(a)\\nWater level=+25cm\\nTransmitter output = %d mA' %t_op)",
+ "",
+ "#(b)",
+ "",
+ "#calculation",
+ "wt_l2=-25.0 # water level (ii)",
+ "t_op2=((b-a)/100)*(100-25)+4",
+ "",
+ "#result",
+ "print('\\n(b)\\nWater level=-25cm\\nTransmitter output = %d mA' %t_op2)",
+ "",
+ "#(c)",
+ "",
+ "#Variable declaration",
+ "t_op3=12.0 # Transmitter output ",
+ "",
+ "#calculation",
+ "H=(100.0/(b-a))*(12-4) ",
+ "",
+ "#result",
+ "print('\\n(c)\\nHead Applied = %d cm\\nLevel corresponding to 50 cm head =0 cm' %H)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Water level=+25cm",
+ "Transmitter output = 8 mA",
+ "",
+ "(b)",
+ "Water level=-25cm",
+ "Transmitter output = 16 mA",
+ "",
+ "(c)",
+ "Head Applied = 50 cm",
+ "Level corresponding to 50 cm head =0 cm"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.4, Page Number: 373<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Displacer with spring balance'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "a=5.0*10**-4 #area",
+ "l=8.0 #length",
+ "dens=6.0*1000.0 #density",
+ "",
+ "#calculation",
+ "w=a*l*dens",
+ "",
+ "#result",
+ "print('(a)\\nWeight of the displacer if weighed in air = %d kg'%w)",
+ "",
+ "",
+ "#(i)",
+ "",
+ "#variable declaration",
+ "sbr1=23.0 # spring balance reading",
+ "",
+ "#calculation",
+ "wloss1=w-sbr1",
+ "L1=wloss1/(1000.0*a)",
+ "",
+ "#result",
+ "print('\\n(i)\\tL1=%dm'%L1)",
+ "",
+ "",
+ "#(ii)",
+ "",
+ "#variable declaration",
+ "sbr2=22.0 # spring balance reading",
+ "",
+ "#calculation",
+ "wloss2=w-sbr2",
+ "L2=wloss2/(1000.0*a)",
+ "",
+ "#result",
+ "print('\\n(ii)\\tL2=%dm'%L2)",
+ "",
+ "#(iii)",
+ "",
+ "#variable declaration",
+ "sbr3=21.0 # spring balance reading",
+ "",
+ "#calculation",
+ "wloss3=w-sbr3",
+ "L3=wloss3/(1000.0*a)",
+ "",
+ "#result",
+ "print('\\n(iii)\\tL3=%dm'%L3)",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "level=8.0 # level wen tank is full ",
+ "",
+ "#calculation",
+ "wt=a*level*1000.0",
+ "spring=w-wt",
+ "",
+ "#result",
+ "print('\\n(b):when the tank is full\\nSpring Balance reading = %d kg'%spring)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Weight of the displacer if weighed in air = 24 kg",
+ "",
+ "(i)\tL1=2m",
+ "",
+ "(ii)\tL2=4m",
+ "",
+ "(iii)\tL3=6m",
+ "",
+ "(b):when the tank is full",
+ "Spring Balance reading = 20 kg"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.5, Page Number: 374<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Buoyancy Force calculation'''",
+ "",
+ "#variable declaration",
+ "rho=1000.0 # density of water ",
+ "v=3.0 # displaced volume of water ",
+ "",
+ "#calculation",
+ "Bw=rho*v",
+ "",
+ "#Result",
+ "print('Buoyance Force(Bw) = %d kg'%Bw)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Buoyance Force(Bw) = 3000 kg"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.6, Page Number: 374<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determination of displaced volume from Buoyancy Force'''",
+ "",
+ "#variable declaration",
+ "rho=1000.0 # density of water",
+ "Bw=5000.0 # Buoyancy Force",
+ "",
+ "#calculation",
+ "v=Bw/rho",
+ "",
+ "#result",
+ "print('V = %d m^3' %v)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V = 5 m^3"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.7, Page Number: 374<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determination of hydrostatic pressure in open tank'''",
+ "",
+ "#variable declaration",
+ "rho=1000.0 # density of water",
+ "h=10.0 # height of liquid",
+ "",
+ "#calculation",
+ "P=rho*h",
+ "",
+ "#result",
+ "print('P = %d kg/m^2 = %d kg/cm^2 '%(P,P/10000))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P = 10000 kg/m^2 = 1 kg/cm^2 "
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.8, Page Number: 374<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determination of hydrostatic pressure in closed tank'''",
+ "",
+ "#variable declaration",
+ "rho=1000.0 # density of water",
+ "h=15.0 # height of liquid ",
+ "ex_p=1.0 # External pressure on liquid",
+ "",
+ "#calculation",
+ "P=(rho*h/10000.0)+ex_p",
+ "",
+ "#result",
+ "print('P = %.1f kg/cm^2' %P)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P = 2.5 kg/cm^2"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.9, Page Number:374<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determination of height from hydrostatic pressure'''",
+ "",
+ "#variable declaration",
+ "rho=1000.0 # density of water",
+ "ex_p=0.5*10**4 # External pressure on liquid ",
+ "P=1.6*10**4 #(rho*h/10000)+ex_p",
+ "",
+ "#calculation",
+ "h=(P-ex_p)/1000.0",
+ "",
+ "#result",
+ "print('h = %d m' %h)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "h = 11 m"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.10, Page Number:375<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of level on the probe'''",
+ "",
+ "#variable declaration",
+ "c2=100.0*10**-6 # capacitance in capacitance probe",
+ "r1=10.0*10**3 # value of resistor in bride",
+ "r2=100.0*10**3 # value of resistor in bride",
+ "r3=50.0*10**3 # value of resistor in bride",
+ "",
+ "#calculation",
+ "Cx=r1*c2/r3",
+ "Cx=Cx*10**6",
+ "",
+ "#result",
+ "print('Cx = %d microFarad'%Cx)",
+ "c=5.0",
+ "",
+ "#calculation",
+ "l=Cx/c",
+ "",
+ "#result",
+ "print('\\nLevel on the probe = %dm'%l)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cx = 20 microFarad",
+ "",
+ "Level on the probe = 4m"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_7.ipynb b/Industrial_Instrumentation/Chapter_7.ipynb
new file mode 100644
index 00000000..f42da02c
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_7.ipynb
@@ -0,0 +1,567 @@
+{
+ "metadata": {
+ "name": "Chapter_7"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 7: Velocity Humidity and Moisture<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.1, Page NUmber: 436<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of absolute viscosity'''",
+ "",
+ "#variable declaration",
+ "f=2*9.8*10**5 # Force in Dynes",
+ "A=100.0 # area in cm^2",
+ "V=20.0 # velocity in m/sec",
+ "l=10.0 # length in cm",
+ "",
+ "#calculation",
+ "mu=(f/A)/(V/l)",
+ "mu=mu/1000.0",
+ "",
+ "#result",
+ "print('The absolute viscosity mu = %.1f*10^5 centipoises'%mu)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absolute viscosity mu = 9.8*10^5 centipoises"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.2, Page Number:437<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of kinematic relative and absolute viscosity'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "v=10.0 # absolute viscosity",
+ "",
+ "#calculation",
+ "F=1/v",
+ "",
+ "#result",
+ "print('(a)\\nFluidity = %.1f rhe'%F)",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "mu=10.0 # absolute viscosity",
+ "rho=0.8 # density in m/cm^3",
+ "",
+ "#calculation",
+ "ve=mu/rho",
+ "",
+ "#result",
+ "print('\\n(b)\\nKinematic viscosity (v)= %.1f cm^2/sec'%ve)",
+ "",
+ "",
+ "#(c)",
+ "",
+ "#variable declaration",
+ "ab=1000.0 # absolute viscosity ",
+ "abwt=1.002 # absolute viscosity of water at 20 deree celcius",
+ "",
+ "#calculation",
+ "rv=ab/abwt",
+ "",
+ "#result",
+ "print('\\n(c)\\nRelative viscosity = %d centipoises'%rv)",
+ "",
+ "#(d)",
+ "",
+ "#variable declaration",
+ "PAS=10.0",
+ "",
+ "#Result",
+ "print('\\n(c)\\nAbsolute viscosity = 1000 centipoises =10 poises = 1PAS')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Fluidity = 0.1 rhe",
+ "",
+ "(b)",
+ "Kinematic viscosity (v)= 12.5 cm^2/sec",
+ "",
+ "(c)",
+ "Relative viscosity = 998 centipoises",
+ "",
+ "(c)",
+ "Absolute viscosity = 1000 centipoises =10 poises = 1PAS"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.3, Page Number: 438<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Absolute viscosity of the Newtonian fluid'''",
+ "",
+ "import math",
+ "#b)",
+ "",
+ "#variable declaration",
+ "R=0.5 # radius",
+ "L=5 # length",
+ "p_diff=800.0 # pressure difference",
+ "V=10.0 # volume",
+ "",
+ "#calculation",
+ "mu=(math.pi*R**4)*p_diff/(8*V*L)",
+ "",
+ "#result",
+ "print('(b)\\nmu=%.4f poise =%.2f centipoise'%(mu,mu*100))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b)",
+ "mu=0.3927 poise =39.27 centipoise"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.4, Page Number: 439<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''kinematic viscosity and density calculation'''",
+ "",
+ "import math ",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "g=980.0 # acceleration due to gravity",
+ "h=4 # Height",
+ "R=0.5 # radius",
+ "V=10.0 # volume ",
+ "l=5.0 # length ",
+ "t=1.0",
+ "",
+ "#calculation",
+ "v=(math.pi*g*h*t*R**4)/(8*l*V)",
+ "",
+ "#result",
+ "print('(a)\\n v = %.2f stokes'%v)",
+ "",
+ "#calculation",
+ "mu=0.3925",
+ "rho=mu/v",
+ "",
+ "#result",
+ "print('\\n(b)\\n Density of the fluid rho = %.3f gm/cm^3'%rho)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ " v = 1.92 stokes",
+ "",
+ "(b)",
+ " Density of the fluid rho = 0.204 gm/cm^3"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.5, Page Number: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Kinematic Viscosity in Saybolts Universal viscometer'''",
+ "",
+ "#variable declaration",
+ "",
+ "#(a)",
+ "A=0.226 # value of A as per equation",
+ "B=195.0 # value of B as per equation",
+ "t=60.0 # Efflux time",
+ "",
+ "#calcullation",
+ "v=A*t-B/t",
+ "A1=0.220",
+ "B1=135.0",
+ "t1=140.0",
+ "v1=A1*t1-B1/t1",
+ "",
+ "#result",
+ "print('(a) Fluid X\\n v = %.2f centipoises'%v)",
+ "print('\\n(b)Fluid Y\\n v = %.1f centipoises'%v1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Fluid X",
+ " v = 10.31 centipoises",
+ "",
+ "(b)Fluid Y",
+ " v = 29.8 centipoises"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.6, Page Number: 441<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of absolute viscosity'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "t=12.0 # time interval of falling ball in sec ",
+ "Rsb=7.0 # Specific gravity of ball",
+ "Rsf=1.12 # Specific gravity of fluid",
+ "B=1.5 # Ball constant in centipoises",
+ "",
+ "#calculation",
+ "mu=t*(Rsb-Rsf)*B",
+ "",
+ "#result",
+ "print('mu= %.2f centipoises = %d centipoises(approx)'%(mu,math.ceil(mu)))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mu= 105.84 centipoises = 106 centipoises(approx)"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.7, Page Number: 441<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of relative humidity'''",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "B=45.0 # dry bulb temperature",
+ "W=25.0 # wet bulb temperature",
+ "",
+ "#result",
+ "print('\\n(b)\\nPsychromatic differential : %d\u00b0C'%(B-W))",
+ "print('\\n Relative humidity is 80%% corresponding to')",
+ "print(' \\ntemperature 45\u00b0C and psychromatic differential 20\u00b0C')",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "B1=30.0 # dry bulb temperature",
+ "W1=27.0 # wet bulb temperature",
+ "",
+ "#result",
+ "print('\\n(b)\\nPsychromatic differential : %d\u00b0C'%(B1-W1))",
+ "print('\\n Relative humidity is 80%% corresponding to')",
+ "print(' \\ntemperature 30\u00b0C and psychromatic differential 3\u00b0C')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "(b)",
+ "Psychromatic differential : 20\u00b0C",
+ "",
+ " Relative humidity is 80%% corresponding to",
+ " ",
+ "temperature 45\u00b0C and psychromatic differential 20\u00b0C",
+ "",
+ "(b)",
+ "Psychromatic differential : 3\u00b0C",
+ "",
+ " Relative humidity is 80%% corresponding to",
+ " ",
+ "temperature 30\u00b0C and psychromatic differential 3\u00b0C"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.8, Page Number: 441<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of Relative Humidity dew point and moisture content'''",
+ "",
+ "#variable declaration",
+ "D=80.0 # intersection point of DB temperature",
+ "W=66.5 # intersection point of WB temperature",
+ "",
+ "#Result",
+ "",
+ "#(a)",
+ "print('(a)\\nThe intersection point of DB temperature 80\u00b0F and WB temperature 66.5\u00b0F')",
+ "print(' \\nlines on the relative humidity curve for 50%.\\n RH = 50%')",
+ "",
+ "#(b)",
+ "print('\\n(b)\\nFrom the point of intersection of the dry and wet bulb curves, move left')",
+ "print(' \\nhorizontally to the dew point temperature curve where it meets at 60\u00b0F')",
+ "print('\\nDew Point = 60\u00b0F')",
+ "",
+ "#(c)",
+ "print('\\n(c)\\nFrom the point of intersection of the dry and wet bulb curves,')",
+ "print('\\nhorizontally to the right to the moisture content plot where it meets at 76.')",
+ "print('\\nMoisture Content : 76 grains of water per pound of dry air.')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "The intersection point of DB temperature 80\u00b0F and WB temperature 66.5\u00b0F",
+ " ",
+ "lines on the relative humidity curve for 50%.",
+ " RH = 50%",
+ "",
+ "(b)",
+ "From the point of intersection of the dry and wet bulb curves, move left",
+ " ",
+ "horizontally to the dew point temperature curve where it meets at 60\u00b0F",
+ "",
+ "Dew Point = 60\u00b0F",
+ "",
+ "(c)",
+ "From the point of intersection of the dry and wet bulb curves,",
+ "",
+ "horizontally to the right to the moisture content plot where it meets at 76.",
+ "",
+ "Moisture Content : 76 grains of water per pound of dry air."
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.9, Page Number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of relative humidity'''",
+ "",
+ "#variable declaration",
+ "wt_vap=500.0 # Amount of water vapour present",
+ "wt_vap_to_sat=1500.0 # Amount of water vapour added to saturate",
+ "",
+ "#calculation",
+ "total=wt_vap+wt_vap_to_sat",
+ "Rh=(wt_vap/total)*100",
+ "",
+ "#result",
+ "print('RH = %d%%'%Rh)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RH = 25%"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.10, Page Number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''percentage relative humidity'''",
+ "",
+ "#variable declaration",
+ "pv=30.0 # partial pressure of water vapour",
+ "ps=60.0 # Saturation partial pressure ",
+ "",
+ "#calculations",
+ "Rh=(pv/ps)*100",
+ "",
+ "#Result",
+ "print('%%RH = %d%%'%Rh)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "%RH = 50%"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.11, Page Number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''percentage increase in moisture content'''",
+ "",
+ "#variable declaration",
+ "i1=250.0 # ionazation current ",
+ "i2=350.0 # ionazation current ",
+ "",
+ "#calculation",
+ "m=(i2-i1)*100/i1",
+ "",
+ "#result",
+ "print('%% increase in moisture content = %d%%'%m)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "% increase in moisture content = 40%"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.12, Page Number: 443<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of moisture content'''",
+ "",
+ "#variable declaraton",
+ "i2=150.0 # wet weight",
+ "i1=125.0 # dry weight",
+ "",
+ "#calculation",
+ "m=(i2-i1)*100/i1",
+ "",
+ "#result",
+ "print('Moisture percentage = %d%%'%m)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Moisture percentage = 20%"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/Chapter_8.ipynb b/Industrial_Instrumentation/Chapter_8.ipynb
new file mode 100644
index 00000000..8a84dda0
--- /dev/null
+++ b/Industrial_Instrumentation/Chapter_8.ipynb
@@ -0,0 +1,485 @@
+{
+ "metadata": {
+ "name": "Chapter_8"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 8:Fundamentals of measuring instruments <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.1, Page Number: 507<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Flux density calculation'''",
+ "",
+ "#variable declaration",
+ "fi=10.0*10**-6 # fi-flux",
+ "inch=2.54*10**-2 # length",
+ "A=inch**2 # area",
+ "",
+ "#calculation",
+ "B =fi/A",
+ "",
+ "#Result",
+ "print('Flux Density B= %.1f mT'%(B*1000))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux Density B= 15.5 mT"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.2, Page Number: 508<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power Dissipation and accuracy of result'''",
+ "",
+ "#variable Declaration",
+ "i=10*10**-3 # current in A",
+ "R=1000.0 # resistance in ohm",
+ "P=(i**2)*R # Power",
+ "err_R=10.0 # Error in Resistance measurement",
+ "err_I=(2.0/100)*25*100/10 # Error in current measurement",
+ "",
+ "#calculation",
+ "err_I2=2*err_I",
+ "err_p=err_I2+err_R",
+ "",
+ "#Result",
+ "print('%% error in I^2 = \u00b1 %d%%\\n%% error in Power = \u00b1 %d%%'%(err_I2,err_p))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "% error in I^2 = \u00b1 10%",
+ "% error in Power = \u00b1 20%"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.3, Page Number: 508<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''max and min levels of input supply current'''",
+ "",
+ "#variable Declaration",
+ "i1=37.0 # current in branch 1 ",
+ "i2=42.0 # current in branch 2",
+ "i3=13.0 # current in branch 3",
+ "i4=6.7 # current in branch 4",
+ "",
+ "#Calculation",
+ "Imax=(i1+i2)+(i1+i2)*(3.0/100)+(i3+i4)+(i3+i4)*(1.0/100)",
+ "Imin=(i1+i2)-(i1+i2)*(3.0/100)+(i3+i4)-(i3+i4)*(1.0/100)",
+ "",
+ "#result",
+ "print('Maximum level of total supply current = %.3f mA'%Imax)",
+ "print('\\nMinimum level of total supply current = %.3f mA'%Imin)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum level of total supply current = 101.267 mA",
+ "",
+ "Minimum level of total supply current = 96.133 mA"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.4, Page Number:508<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Time constant for thermometer'''",
+ "",
+ "import math",
+ "",
+ "#(a)",
+ "",
+ "#variable declaration",
+ "T=200.0 # intermediate temperature ",
+ "T0=300.0 # final temperature ",
+ "Ti=70.0 # initial temperature ",
+ "t=3.0 # time in seconds ",
+ "",
+ "#calculation",
+ "x=(T-T0)/(Ti-T0)",
+ "tow=-t/math.log(x)",
+ "",
+ "#result",
+ "print('(a)\\nTime constant tow=%.1f s'%tow)",
+ "",
+ "",
+ "#(b)",
+ "",
+ "#variable declaration",
+ "t1=5.0 # time in seconds ",
+ "#calculation",
+ "T5=T0+((Ti-T0)*math.e**(-t1/tow))",
+ "",
+ "#result",
+ "print('\\n(b)\\nTemperature after 5 seconds T5 = %.2f\u00b0C'%T5)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)",
+ "Time constant tow=3.6 s",
+ "",
+ "(b)",
+ "Temperature after 5 seconds T5 = 242.61\u00b0C"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.5, Page Number:<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Error calculation of second order instrument'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "w=9.0 # excitation frequency",
+ "wn=6.0 # natural frequency",
+ "dr=0.6 # damping ratio",
+ "",
+ "#calculations",
+ "",
+ "x=w/wn",
+ "Ar=1/math.sqrt(((1-(x)**2)**2)+(2*dr*x)**2)",
+ "err=(1-Ar)*100",
+ "",
+ "#Result",
+ "print('A=%.3f'%Ar)",
+ "print('\\nError = %.2f%%'%err)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A=0.456",
+ "",
+ "Error = 54.37%"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.6, PAge Number: 510<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Output of first order instrument for unit step input'''",
+ "",
+ "#variable Declaration",
+ "t=2.0 # output to be calculated after t seconds",
+ "",
+ "#calculation",
+ "y=1-math.e**(-(t-1.5)/0.5)",
+ "",
+ "#result",
+ "print('y(t)at t=2 will be y(t)=%.3f'%y)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y(t)at t=2 will be y(t)=0.632"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.7, Page Number: 510<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Statistic of Temperature readings'''",
+ "",
+ "import math",
+ "",
+ "#variable declaration",
+ "",
+ "#Temperature Readings",
+ "x1=98.5 # Reading 1",
+ "x2=99.0 # Reading 2",
+ "x3=99.5 # Reading 3 ",
+ "x4=100.0 # Reading 4",
+ "x5=100.5 # Reading 5",
+ "x6=101.0 # Reading 6",
+ "x7=101.5 # Reading 7",
+ "# Frequency",
+ "f1=4.0 # Reading 1",
+ "f2=13.0 # Reading 2",
+ "f3=19.0 # Reading 3",
+ "f4=35.0 # Reading 4",
+ "f5=17.0 # Reading 5",
+ "f6=10.0 # Reading 6",
+ "f7=2.0 # Reading 7",
+ "",
+ "#(i) Arithmatic Mean",
+ "",
+ "#calculation",
+ "x_bar=((x1*f1)+(x2*f2)+(x3*f3)+(x4*f4)+(x5*f5)+(x6*f6)+(x7*f7))/(f1+f2+f3+f4+f5+f6+f7)",
+ "",
+ "#result",
+ "print('(i)\\n\\tArithmatic Mean = %.2f\u00b0C'%x_bar)",
+ "",
+ "#(ii) Average Deviation",
+ "",
+ "#calculation",
+ "D=(abs(x1-x_bar)*f1)+(abs(x2-x_bar)*f2)+(abs(x3-x_bar)*f3)+(abs(x4-x_bar)*f4)",
+ "D=D+(abs(x5-x_bar)*f5)+(abs(x6-x_bar)*f6)+(abs(x7-x_bar)*f7)",
+ "D=D/(f1+f2+f3+f4+f5+f6+f7)",
+ "",
+ "#result",
+ "print('\\n(ii)\\n\\tAverage Deviation =%.4f\u00b0C'%D)",
+ "",
+ "#Standard deviation",
+ "",
+ "#Calculation",
+ "sigma=((x1-x_bar)**2*f1)+((x2-x_bar)**2*f2)+((x3-x_bar)**2*f3)+((x4-x_bar)**2*f4)",
+ "sigma=sigma+((x5-x_bar)**2*f5)+((x6-x_bar)**2*f6)+((x7-x_bar)**2*f7)",
+ "sigma=math.sqrt(sigma)",
+ "sigma=sigma/math.sqrt(f1+f2+f3+f4+f5+f6+f7)",
+ "",
+ "#result",
+ "print('\\n(iii)\\n\\tStandard deviation = %.3f\u00b0C'%sigma)",
+ "",
+ "#variance",
+ "",
+ "#result",
+ "print('\\n(iv)\\n\\tVariance = %.4f\u00b0C'%(sigma**2))",
+ "",
+ "#Probable Error",
+ "",
+ "#result",
+ "print('\\n(v)\\n\\tProbable Error= %.4f\u00b0C'%(0.6745*sigma))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)",
+ "\tArithmatic Mean = 99.93\u00b0C",
+ "",
+ "(ii)",
+ "\tAverage Deviation =0.5196\u00b0C",
+ "",
+ "(iii)",
+ "\tStandard deviation = 0.671\u00b0C",
+ "",
+ "(iv)",
+ "\tVariance = 0.4501\u00b0C",
+ "",
+ "(v)",
+ "\tProbable Error= 0.4525\u00b0C"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.8, Page Number: 511<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculation of damping coefficient and natural frequency for 2nd order instrument'''",
+ "",
+ "import math",
+ "",
+ "#variable Declaration",
+ "wn=math.sqrt(3.0) # natural frequency of osscilation",
+ "",
+ "#Calculation",
+ "x=3.2/(2*wn)",
+ "",
+ "#Result",
+ "print('Damping coefficient = %.3f\\nNatural frequency of Oscillation = %.3f'%(x,wn))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Damping coefficient = 0.924",
+ "Natural frequency of Oscillation = 1.732"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.9, Page Number: 512<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculation of Amplitude inaccuracy and phase shift from transfer function'''",
+ "",
+ "import math",
+ "#variable declaration",
+ "w=100.0 # natural frequency of osscilation",
+ "",
+ "#calculation",
+ "fi=-math.atan(0.1*w)-math.atan(0.5*w)",
+ "A=1/(math.sqrt(1+(0.1*w)**2)*(math.sqrt(1+(0.5*w)**2)))",
+ "A=1*1000.0/math.ceil(1000*A)",
+ "err=(1-1.0/A)*100",
+ "",
+ "#Result",
+ "print('A=K/%d\\n%% error = %.1f%%\\nfi = %.2f\u00b0'%(A,err,fi*180/math.pi))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A=K/500",
+ "% error = 99.8%",
+ "fi = -173.14\u00b0"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.10, Page Number: 512<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''temperature and altitude calculation from first order thermometer placed in balloon'''",
+ "",
+ "#calculations",
+ "R=0.15*10/50 # Temperature gradient",
+ "K=1.0 # constant",
+ "tow=15.0 # time constant ",
+ "",
+ "#Calculations",
+ "deg=K*R*tow",
+ "",
+ "#(i)",
+ "a=15-deg",
+ "",
+ "#(ii)",
+ "alt_red=deg*50.0/0.15",
+ "h=5000-alt_red",
+ "",
+ "#result",
+ "print('(i)The actual temperature when instrument reads 15\u00b0C is %.2f\u00b0C'%a)",
+ "print('\\n The true temperature at 5000 metres = %.2f '%a)",
+ "print('\\n(ii)\\nThe true altitude at which 15\u00b0C occurs is %d metres'%h)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)The actual temperature when instrument reads 15\u00b0C is 14.55\u00b0C",
+ "",
+ " The true temperature at 5000 metres = 14.55 ",
+ "",
+ "(ii)",
+ "The true altitude at which 15\u00b0C occurs is 4850 metres"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/README.txt b/Industrial_Instrumentation/README.txt
new file mode 100644
index 00000000..2f922759
--- /dev/null
+++ b/Industrial_Instrumentation/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Laxman Sole
+Course: btech
+College/Institute/Organization: Vishwakarma Institute of Technology, Pune
+Department/Designation: Electronics Engineering
+Book Title: Industrial Instrumentation
+Author: K. Krishnaswamy And S. Vijayachitra
+Publisher: New Age International Publishers, New Delhi
+Year of publication: 2010
+Isbn: 9788122427509
+Edition: 2nd \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch2.ipynb b/Industrial_Instrumentation/ch2.ipynb
new file mode 100644
index 00000000..22755012
--- /dev/null
+++ b/Industrial_Instrumentation/ch2.ipynb
@@ -0,0 +1,997 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Basic Concepts Of Thermodynamicsm"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page no : 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Convert the following readings of pressure to kPa assuming that barometer reads 760 mm of Hg.\n",
+ "\n",
+ "# Variables\n",
+ "rho_Hg = 13596.; \t\t\t#kg/m**3\n",
+ "g = 9.806; \t\t\t#m/s**2\n",
+ "h = 0.76; \t\t\t#m\n",
+ "\n",
+ "# Calculations and Results\n",
+ "P = rho_Hg*g*h/1000; \t\t\t#kPa\n",
+ "\n",
+ "\n",
+ "h1 = 0.80; \t\t\t#m\n",
+ "P1 = h1/h*P;\n",
+ "print \"(i) Pressure of 80 cm of Hg %.3f kPa\"%P1\n",
+ "\n",
+ "\n",
+ "print (\"(ii) 30 cm Hg vacuum\")\n",
+ "H2 = 0.30; \t\t\t#cm Hg vacuum\n",
+ "h2 = h-H2; \t\t\t#cm of Hg absolute\n",
+ "\n",
+ "P2 = h2/h*P;\n",
+ "print \"Pressure due to 46 cm of Hg %.3f kPa\"%P2\n",
+ "\n",
+ "rho_H2O = 1000; \t\t\t#kg/m**3\n",
+ "h3 = 1.35; \t\t\t#m\n",
+ "P3 = rho_H2O*g*h3/1000;\n",
+ "print \"(iii) Pressure due to 1.35 m H2O gauge %.3f kPa\"%(P3)\n",
+ "\n",
+ "\n",
+ "P4 = 4.2*10**2;\n",
+ "print \"(iv) 4.2 bar %.3f kPa\"%(P4),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure of 80 cm of Hg 106.658 kPa\n",
+ "(ii) 30 cm Hg vacuum\n",
+ "Pressure due to 46 cm of Hg 61.328 kPa\n",
+ "(iii) Pressure due to 1.35 m H2O gauge 13.238 kPa\n",
+ "(iv) 4.2 bar 420.000 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 page no : 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the pressure on the piston.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 0.1; \t\t\t#m\n",
+ "F = 1000.; \t\t\t#N\n",
+ "\n",
+ "# Calculations\n",
+ "A = math.pi/4*d**2; \t\t\t#m**2\n",
+ "P = F/A/10**3;\n",
+ "\n",
+ "# Results\n",
+ "print \"Pressure on the piston = %.3f kN/m**2\"%(P),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure on the piston = 127.324 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 page no : 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the gauge pressure \n",
+ "\n",
+ "# Variables\n",
+ "SG = 0.9;\n",
+ "h = 1.2; \t\t\t#m\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "rho_w = 1000.; \t\t\t#kg/m**3\n",
+ "\n",
+ "# Calculations\n",
+ "rho = SG*rho_w; \t\t\t#kg/m**3\n",
+ "P = rho*g*h/10**3;\n",
+ "\n",
+ "# Results\n",
+ "print \"Gauge pressure P = %.3f kN/m**2\"%(P)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gauge pressure P = 10.595 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4 page no : 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the absolute pressure in the condenser in Pa. \n",
+ "\n",
+ "# Variables\n",
+ "Vacuum_recorded = 740.; \t\t\t#mm of Hg\n",
+ "Barometric_reading = 760.; \t\t\t#mm of Hg\n",
+ "\n",
+ "# Calculations\n",
+ "Absolute_pressure = (Barometric_reading-Vacuum_recorded)*133.4;\n",
+ "\n",
+ "# Results\n",
+ "print \"Absolute pressure in the condenser = %.3f Pa\"%(Absolute_pressure),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute pressure in the condenser = 2668.000 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 page no : 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The absolute pressure of the gas in the vessel in bar.\n",
+ "(ii) Specific volume and density of the gas.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 0.5; \t\t\t#m\n",
+ "h = 0.75; \t\t\t#m\n",
+ "m = 4.; \t\t\t#kg\n",
+ "Manometer_reading = 620.; \t\t\t#mm of Hg above atmosphere\n",
+ "Barometer_reading = 760.; \t\t\t#mm of Hg\n",
+ "V = math.pi/4*d**2*h; \t\t\t#m**3\n",
+ "print (\"(i) Total pressure in the vessel\")\n",
+ "\n",
+ "# Calculations and Results\n",
+ "P = (Barometer_reading+Manometer_reading)*133.4/10**5; \t\t\t#bar\n",
+ "print \"P = %.3f bar\"%(P)\n",
+ "\n",
+ "print (\"(ii) Specific volume and density\")\n",
+ "SV = V/m; \n",
+ "print \"Specific volume = %.3f m**3/kg\"%(SV)\n",
+ "\n",
+ "D = m/V;\n",
+ "print \"Density = %.3f kg/m**3\"%(D),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Total pressure in the vessel\n",
+ "P = 1.841 bar\n",
+ "(ii) Specific volume and density\n",
+ "Specific volume = 0.037 m**3/kg\n",
+ "Density = 27.162 kg/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 page no : 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the gas pressure.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "h0 = .761; \t\t\t#m\n",
+ "h = .55; \t\t\t#m\n",
+ "g = 9.79; \t\t\t#m/s**2\n",
+ "rho = 13640.; \t\t\t#kg/m**3\n",
+ "\n",
+ "# Calculations\n",
+ "P = rho*g*(h0+h); \t\t\t#N/m**2\n",
+ "\n",
+ "# Results\n",
+ "print \"Gas pressure = %.3f bar\"%(P/10**5),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gas pressure = 1.751 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 page no : 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the absolute pressure of steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "h_H2O = 34.; \t\t\t#mm of Hg\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "rho = 13600.; \t\t\t#kg/m**3\n",
+ "P_Hg = 97.5; \t\t\t#mm of Hg\n",
+ "P_atm = 760.; \t\t\t#mm of Hg\n",
+ "\n",
+ "# Calculations\n",
+ "P_H2O = h_H2O/13.6; \t\t\t#mm of Hg\n",
+ "Pabs = rho*g*(P_Hg+P_atm-P_H2O)/10**8; \t\t\t#bar\n",
+ "\n",
+ "# Results\n",
+ "print \"absolute pressure = %.3f bar\"%(Pabs)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "absolute pressure = 1.141 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 page no : 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the absolute pressure of the gas \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "SG = 0.8;\n",
+ "rho_H2O = 1000.; \t\t\t#kg/m**3\n",
+ "g = 9.81; \t\t\t#ms**2\n",
+ "h = 0.17; \t\t\t#m\n",
+ "Patm = 1.01325; \t\t\t#bar\n",
+ "\n",
+ "# Calculations\n",
+ "rho = SG*rho_H2O; \t\t\t#kg/m**3\n",
+ "P_liq = rho*g*h/10**5; \t\t\t#bar\n",
+ "P_gas = Patm - P_liq;\n",
+ "\n",
+ "# Results\n",
+ "print \"gas pressure = %.3f bar\"%(P_gas),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gas pressure = 1.000 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9 page no : 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the mass of a piston that can be supported by a gas entrapped\n",
+ "under the piston '''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 0.2; \t\t\t#m\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "h = 0.117; \t\t\t#m\n",
+ "rho = 13600.; \t\t\t#kg/m**3\n",
+ "\n",
+ "# Calculations\n",
+ "p = rho*g*h;\n",
+ "m = (p*math.pi/4*d**2)/g;\n",
+ "\n",
+ "# Results\n",
+ "print \"mass = %.3f kg\"%(m),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass = 49.989 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10 page no : 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the kinetic energy of an artificial satellite revolves round the earth \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "v = 800.; \t\t\t#m/s\n",
+ "g = 9.; \t\t\t#m/s**2\n",
+ "F = 3600.; \t\t\t#N\n",
+ "\n",
+ "# Calculations\n",
+ "m = F/g;\n",
+ "KE = 1./2*m*v**2./10**6;\n",
+ "\n",
+ "# Results\n",
+ "print \"Kinetic Energy = %.3f MJ\"%(KE),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kinetic Energy = 128.000 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11 page no : 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find :\n",
+ "(i) Heat transferred ;\n",
+ "(ii) Mean specific heat of the gas.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "m = 6.; \t\t\t#kg\n",
+ "T1 = 25.; \t\t\t#0C\n",
+ "T2 = 125.; \t\t\t#0C\n",
+ "\n",
+ "print (\"(i) Heat transferred\")\n",
+ "\n",
+ "# Calculations and Results\n",
+ "def f18(T): \n",
+ "\t return m*(0.4+0.004*T)\n",
+ "\n",
+ "Q = quad(f18,T1,T2)[0]\n",
+ "\n",
+ "print \"heat tranferred = %.3f kJ\"%(Q)\n",
+ "\n",
+ "print (\"(ii) Mean specific heat of the gas\")\n",
+ "c_n = Q/m/(T2-T1);\n",
+ "print \"Mean specific heat = %.3f kJ/kg.0C\"%(c_n),\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Heat transferred\n",
+ "heat tranferred = 420.000 kJ\n",
+ "(ii) Mean specific heat of the gas\n",
+ "Mean specific heat = 0.700 kJ/kg.0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12 page no : 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "what will be the temperature corresponding to the thermometric property of 3.5 on\n",
+ "Celsius scale.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "# Variables\n",
+ "Ice_point = 0.;\n",
+ "Steam_point = 100.;\n",
+ "\n",
+ "# Calculations\n",
+ "P = [[math.log(1.5),1],[math.log(7.5),1]];\n",
+ "Q = [0,100];\n",
+ "X = linalg.inv(P)*Q;\n",
+ "\n",
+ "a = X[0,1];\n",
+ "b = X[1,1];\n",
+ "p = 3.5;\n",
+ "t = a*math.log(p)+b;\n",
+ "\n",
+ "# Results\n",
+ "print (\"The value of temperature is given by %.3f\")%(t),(\"\u00b0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of temperature is given by 52.646 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13 page no : 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What will be the reading on the thermometer where the gas thermometer reads 70\u00b0C ?\n",
+ "'''\n",
+ "\n",
+ "def func(t): \n",
+ "\t return 0.20*t-5*10**(-4)*t**2\n",
+ "# Variables # Calculations\n",
+ "t1 = 0; \t\t\t#0C\n",
+ "e1 = func(t1);\n",
+ "t2 = 100; \t\t\t#0C\n",
+ "e2 = func(t2);\n",
+ "t3 = 70; \t\t\t#0C\n",
+ "e3 = func(t3);\n",
+ "t = e3*(t2-t1)/e2-e1;\n",
+ "\n",
+ "# Results\n",
+ "print \"thermocouple will read\",t,\"\u00b0C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "thermocouple will read 77.0 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.15 page no : 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What is the amount of work done upon the atmosphere by the balloon ? \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 101.325; \t\t#kPa\n",
+ "V2 = 0.6; \t\t\t#m**3\n",
+ "V1 = 0; \t\t\t#m**3\n",
+ "\n",
+ "# Calculations\n",
+ "W = p*(V2-V1);\n",
+ "\n",
+ "# Results\n",
+ "print (\"work done by atmosphere = \"),(-W),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "work done by atmosphere = -60.795 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.16 page no : 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the work done by the air which enters into an evacuated vessel\n",
+ "from atmosphere when the valve is opened'''\n",
+ "\n",
+ "from scipy import integrate\n",
+ "\n",
+ "# Variables\n",
+ "#p = 1.013*10**5; \t#N/m**2\n",
+ "p = lambda x: 1.013*10**5\n",
+ "V1 = 1.5; \t\t\t#m**3\n",
+ "V2 = 0; \t\t\t#m**3\n",
+ "\n",
+ "# Calculations\n",
+ "integ, err = integrate.quad(p,V1,V2)\n",
+ "\n",
+ "# Results\n",
+ "print (\"W = \"),(integ/10**3),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W = -151.95 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.17 page no : 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A piston and cylinder machine containing a fluid system has a stirring\n",
+ "device as shown in Fig. 2.36. Find the net work transfer for the system.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 1.25; \t\t\t#N.m\n",
+ "N = 9500.;\n",
+ "p = 101.3; \t\t\t#kPa\n",
+ "d = 0.65; \t\t\t#m\n",
+ "L = 0.6; \t\t\t#m\n",
+ "\n",
+ "# Calculations\n",
+ "W1 = 2*math.pi*N*T/1000; \t#kJ\n",
+ "A = math.pi/4*d**2; #m**2\n",
+ "W2 = p*A*L; \t\t#kJ\n",
+ "Wnet = (-W1)+W2;\n",
+ "\n",
+ "# Results\n",
+ "print \"The net work transfer for the system = %.3f\"%(Wnet),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The net work transfer for the system = -54.444 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.18 page no : 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the net work done during the process.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "A = 45.*10**(-4); \t #m**2\n",
+ "P = 0.9*10**5; \t\t #N/m**2\n",
+ "Patm = 1.013*10**5; #N/m**2\n",
+ "L = 0.05; \t\t\t #m\n",
+ "\n",
+ "# Calculations\n",
+ "dV = 300.*10**(-6); \t\t\t#m**3\n",
+ "W = P*A*L-Patm*dV;\n",
+ "\n",
+ "# Results\n",
+ "print (\"net work done = \"),(W),\"J\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "net work done = -10.14 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.19 page no : 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the work done when the pressure increases from 1.5 bar to 7.5 bar.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1.5; \t\t\t#bar\n",
+ "p2 = 7.5; \t\t\t#bar\n",
+ "V1 = 3/p1;\n",
+ "V2 = 3/p2;\n",
+ "\n",
+ "# Calculations\n",
+ "def f19( V): \n",
+ "\t return 3./V*10**2\n",
+ "\n",
+ "W = quad(f19, V1, V2)[0]\n",
+ "\n",
+ "# Results\n",
+ "print \"Work done = %.3f\"%(W),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = -482.831 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.20 page no : 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "'''\n",
+ "To a closed system 150 kJ of work is supplied, determine the final volume and pressure of the system.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "W = 150; \t\t\t#kJ\n",
+ "V1 = 0.6; \t\t\t#m**3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "V2 = (8-math.sqrt(64-4*2*2.58))/4; \t\t\t#m**3\n",
+ "print (\"Final volume = %.3f\")%V2,\"m**3\"\n",
+ "\n",
+ "p2 = 8-4*V2;\n",
+ "print \"Final pressure = %.2f\"%p2,\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final volume = 0.354 m**3\n",
+ "Final pressure = 6.58 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.21 page no : 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the work done by the fluid on the piston.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 3.*10**5; \t\t\t#Pa\n",
+ "v1 = 0.18; \t\t\t#m**3/kg\n",
+ "p2 = 0.6*10**5; \t\t\t#Pa\n",
+ "\n",
+ "# Calculations\n",
+ "C = p1*v1**2;\n",
+ "v2 = math.sqrt(C/p2);\n",
+ "\n",
+ "def f17( v): \n",
+ " return C/v**2\n",
+ "\n",
+ "W = quad(f17, v1,v2)[0]\n",
+ "\n",
+ "# Results\n",
+ "print (\"Work done = %d\")%(W),(\"Nm/kg\")\n",
+ "\n",
+ "# Note : output would be differ as rounding error is there. v2 has rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = 29850 Nm/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.22 page no : 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the net work done by the fluid, for an initial volume of 0.05 m 3 .\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p1 = 20.*10**5; \t#Pa\n",
+ "V1 = 0.05; \t\t\t#m**3\n",
+ "\n",
+ "# Calculations\n",
+ "V2 = 2*V1;\n",
+ "p2 = p1*(V1/V2)**2;\n",
+ "C = p1*V1**2;\n",
+ "V3 = V1;\n",
+ "\n",
+ "def f20( V): \n",
+ "\t return C/V**2\n",
+ "\n",
+ "W_12 = quad(f20, V1,V2)[0]\n",
+ "W_23 = p2*(V2-V3);\n",
+ "W_net = W_12-W_23;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Net work done = \"),(W_net),(\"Nm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net work done = 25000.0 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch3.ipynb b/Industrial_Instrumentation/ch3.ipynb
new file mode 100644
index 00000000..8e397388
--- /dev/null
+++ b/Industrial_Instrumentation/ch3.ipynb
@@ -0,0 +1,1515 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Properties of Pure Substances"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 page no : 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the dryness fraction (quality) of steam \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m_s = 50. \t\t\t#kg\n",
+ "m_w = 1.5; \t\t\t#kg\n",
+ "\n",
+ "# Calculations\n",
+ "x = m_s/(m_s+m_w);\n",
+ "\n",
+ "# Results\n",
+ "print (\"dryness fraction = %.3f\")%(x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dryness fraction = 0.971\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 page no : 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) Mass and volume of liquid ;\n",
+ "(ii) Mass and volume of vapour.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.6; \t\t\t#m**3\n",
+ "m = 3.0; \t\t\t#kg\n",
+ "p = 5.; \t\t\t#bar\n",
+ "v = V/m;\n",
+ "\n",
+ "# At 5 bar: From steam tables\n",
+ "v_g = 0.375; \t\t\t#m**3/kg\n",
+ "v_f = 0.00109; \t\t\t#m**3/kg\n",
+ "\n",
+ "# Calculations\n",
+ "v_fg = v_g - v_f;\n",
+ "x = 1-((v_g - v)/v_fg);\n",
+ "\n",
+ "# Results\n",
+ "print (\"(i) Mass and volume of liquid\")\n",
+ "m_liq = m*(1-x);\n",
+ "print (\"mass of liquid = %.3f\")%(m_liq),(\"kg\")\n",
+ "V_liq = m_liq*v_f;\n",
+ "print (\"volume of liquid = %.3f\")%(V_liq),(\"m**3\")\n",
+ "\n",
+ "print (\"(ii) Mass and volume of vapour\")\n",
+ "m_vap = m*x;\n",
+ "print (\"mass of vapour = %.3f\")%(m_vap),(\"kg\")\n",
+ "V_vap = m_vap*v_g;\n",
+ "print (\"volume of vapour = %.3f\")%(V_vap),(\"m**3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Mass and volume of liquid\n",
+ "mass of liquid = 1.404 kg\n",
+ "volume of liquid = 0.002 m**3\n",
+ "(ii) Mass and volume of vapour\n",
+ "mass of vapour = 1.596 kg\n",
+ "volume of vapour = 0.598 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 page no : 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the following :\n",
+ "(i) The pressure,\n",
+ "(ii) The mass,\n",
+ "(iii) The specific volume,\n",
+ "(v) The specific entropy, and\n",
+ "(iv) The specific enthalpy,\n",
+ "(vi) The specific internal energy.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.05; \t\t\t#m**3\n",
+ "m_f = 10.; \t\t\t#kg\n",
+ "# From steam tables corresponding to 245 0C\n",
+ "p_sat = 36.5; \t\t\t#bar\n",
+ "v_f = 0.001239; \t\t\t#m**3/kg\n",
+ "v_g = 0.0546; \t\t\t#m**3/kg\n",
+ "h_f = 1061.4; \t\t\t#kJ/kg\n",
+ "h_fg = 1740.2; \t\t\t#kJ/kg\n",
+ "s_f = 2.7474; \t\t\t#kJ/kg.K\n",
+ "s_fg = 3.3585; \t\t\t#kJ/kg.K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The pressure = \"),(p_sat),(\"bar\")\n",
+ "\n",
+ "print (\"(ii) The mass\")\n",
+ "V_f = m_f*v_f;\n",
+ "V_g = V - V_f;\n",
+ "m_g = V_g/v_g;\n",
+ "m = m_f+m_g;\n",
+ "print (\"The total mass of mixture = %.3f\")%(m),(\"kg\")\n",
+ "\n",
+ "print (\"(iii) The specific volume\")\n",
+ "v_fg = v_g-v_f;\n",
+ "x = m_g/(m_g+ m_f);\n",
+ "v = v_f+x*v_fg;\n",
+ "print (\"specific volume = %.3f\")%(v),(\"m**3/kg\")\n",
+ "\n",
+ "print (\"(iv)The specific enthalpy\")\n",
+ "h = h_f+x*h_fg;\n",
+ "print (\"specific enthalpy = %.3f\")%(h),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"(v)The specific entropy\")\n",
+ "s = s_f+x*s_fg;\n",
+ "print (\"specific entropy = %.3f\")%(s),(\"kJ/kg.K\")\n",
+ "\n",
+ "print (\"(vi)The specific internal enegy\")\n",
+ "u = h-(p_sat*v*10**2); \t\t\t#kJ/kg\n",
+ "print (\"specific internal energy = %.3f\")%(u),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The pressure = 36.5 bar\n",
+ "(ii) The mass\n",
+ "The total mass of mixture = 10.689 kg\n",
+ "(iii) The specific volume\n",
+ "specific volume = 0.005 m**3/kg\n",
+ "(iv)The specific enthalpy\n",
+ "specific enthalpy = 1173.545 kJ/kg\n",
+ "(v)The specific entropy\n",
+ "specific entropy = 2.964 kJ/kg.K\n",
+ "(vi)The specific internal enegy\n",
+ "specific internal energy = 1156.471 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 page no : 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the amount of heat\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m_w = 2.; \t\t\t#kg\n",
+ "t_w = 25.; \t\t\t#0C\n",
+ "p = 5.; \t\t\t#bar\n",
+ "x = 0.9;\n",
+ "c_pw = 4.18;\n",
+ "# at 5 bar; from steam tables\n",
+ "h_f = 640.1; \t\t\t#kJ/kg\n",
+ "h_fg = 2107.4; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "h = h_f+x*h_fg;\n",
+ "\n",
+ "Qw = c_pw*(t_w-0);\n",
+ "print (\"Sensible heat associated with 1kg of water, Qw = %.3f\")%(Qw),(\"kJ\")\n",
+ "\n",
+ "Q = h-Qw;\n",
+ "print (\"Net quantity of heat to be supplies per kg of water, Q = %.3f\")%(Q),(\"kJ\")\n",
+ "\n",
+ "Q_total = m_w*Q;\n",
+ "print (\"Total amount of heat supplied, Q_total = \"),(Q_total),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sensible heat associated with 1kg of water, Qw = 104.500 kJ\n",
+ "Net quantity of heat to be supplies per kg of water, Q = 2432.260 kJ\n",
+ "Total amount of heat supplied, Q_total = 4864.52 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 page no : 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What amount of heat would be required to produce 4.4 kg of steam \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 4.4; \t\t\t#kg\n",
+ "p = 6.; \t\t\t#bar\n",
+ "t_sup = 250.; \t\t\t#0C\n",
+ "t_w = 30.; \t\t\t#0C\n",
+ "c_ps = 2.2; \t\t\t#kJ/kg\n",
+ "c_pw = 4.18;\n",
+ "# At 6 bar, 250 0C; From steam tables\n",
+ "t_s = 158.8; \t\t\t#0C\n",
+ "h_f = 670.4; \t\t\t#kJ/kg\n",
+ "h_fg = 2085; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "h_sup = h_f+h_fg+ c_ps*(t_sup-t_s);\n",
+ "\n",
+ "Qw = c_pw*(t_w-0);\n",
+ "print (\"Amount of heat added per kg of water, Qw = \"),(Qw)\n",
+ "\n",
+ "Q = h_sup-Qw;\n",
+ "print (\"Net amount of heat required to be supplied per kg, Q = \"),(Q)\n",
+ "\n",
+ "Q_total = m*Q;\n",
+ "print (\"Total amount of heat required, Q_total = \"),(Q_total),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of heat added per kg of water, Qw = 125.4\n",
+ "Net amount of heat required to be supplied per kg, Q = 2830.64\n",
+ "Total amount of heat required, Q_total = 12454.816 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 page no : 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the mass of 0.15 m 3 of wet steam and calculate the heat of 1 m 3 of steam.\n",
+ "'''\n",
+ "# Variables\n",
+ "v = 0.15; \t\t\t#m**3\n",
+ "p = 4.; \t\t\t#bar\n",
+ "x = 0.8;\n",
+ "# At 4 bar: From steam tables\n",
+ "v_g = 0.462; \t\t\t#m**3/kg\n",
+ "h_f = 604.7; \t\t\t#kJ/kg\n",
+ "h_fg = 2133.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "density = 1/x/v_g;\n",
+ "\n",
+ "m = v*density;\n",
+ "print (\"mass of 0.15 m**3 steam, m = %.3f\")%(m),(\"kg\")\n",
+ "\n",
+ "Q = density*(h_f+x*h_fg);\n",
+ "print (\"Total heat of 1 m3 of steam which has a mass of 2.7056 kg, Q = %.3f\")%(Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass of 0.15 m**3 steam, m = 0.406 kg\n",
+ "Total heat of 1 m3 of steam which has a mass of 2.7056 kg, Q = 6252.976 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7 page no : 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine\n",
+ "(i) The total heat supplied to feed water per hour to produce wet steam.\n",
+ "(ii) The total heat absorbed per hour in the superheater.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 1000.; \t\t\t#kJ/kg.K\n",
+ "p = 16.; \t\t\t#bar\n",
+ "x = 0.9;\n",
+ "T_sup = 653.; \t\t\t#K\n",
+ "T_w = 30.; \t\t\t#0C\n",
+ "c_ps = 2.2; \t\t\t#kJ/kg\n",
+ "c_pw = 4.18;\n",
+ "# At 16 bar:From steam tables\n",
+ "T_s = 474.4; \t\t\t#K\n",
+ "h_f = 858.6; \t\t\t#kJ/kg\n",
+ "h_fg = 1933.2; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "H = m*((h_f+x*h_fg)-c_pw*(T_w-0));\n",
+ "print (\"(i) Heat supplied to feed water per hour to produce wet steam is given by\"),(H),(\"kJ\")\n",
+ "\n",
+ "Q = m*((1-x)*h_fg+c_ps*(T_sup-T_s));\n",
+ "print (\"(ii) Heat absorbed by superheater per hour, Q = \"),(Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Heat supplied to feed water per hour to produce wet steam is given by 2473080.0 kJ\n",
+ "(ii) Heat absorbed by superheater per hour, Q = 586240.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 page no : 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the mean specific heat for superheated steam :\n",
+ "(i) at 0.75 bar, between 100\u00b0C and 150\u00b0C ;\n",
+ "(ii) at 0.5 bar, between 300\u00b0C and 400\u00b0C\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "print (\"(i) at 0.75 bar, between 100\u00b0C and 150\u00b0C\")\n",
+ "\n",
+ "# Variables\n",
+ "# At 100 \u00b0C\n",
+ "T1 = 100.; \t\t\t#\u00b0C\n",
+ "h_sup1 = 2679.4; \t\t\t#kJ/kg\n",
+ "# At 150 \u00b0C\n",
+ "T2 = 150.; \t\t\t#\u00b0C\n",
+ "h_sup2 = 2778.2; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "c_ps = (h_sup2-h_sup1)/(T2-T1);\n",
+ "print (\"mean specific heat = \"),(c_ps)\n",
+ "\n",
+ "print (\"(ii) at 0.5 bar, between 300\u00b0C and 400\u00b0C\")\n",
+ "T1 = 300; \t\t\t#\u00b0C\n",
+ "h_sup1 = 3075.5; \t#kJ/kg\n",
+ "T2 = 400; \t\t\t#\u00b0C\n",
+ "h_sup2 = 3278.9; \t#kJ/kg\n",
+ "\n",
+ "c_ps = (h_sup2-h_sup1)/(T2-T1);\n",
+ "print (\"mean specific heat c_ps = \"),(c_ps)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) at 0.75 bar, between 100\u00b0C and 150\u00b0C\n",
+ "mean specific heat = 1.976\n",
+ "(ii) at 0.5 bar, between 300\u00b0C and 400\u00b0C\n",
+ "mean specific heat c_ps = 2.034\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9 page no : 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the pressure and temperature of the steam at the new state.\n",
+ "'''\n",
+ "# Variables\n",
+ "m = 1.5; \t\t\t#kg\n",
+ "p = 5.; \t\t\t#bar\n",
+ "x1 = 1.;\n",
+ "x2 = 0.6;\n",
+ "p1 = 5.*10**5; \t\t\t#N/m\n",
+ "# At 5 bar: From steam tables\n",
+ "t_s = 151.8; \t\t\t#0C\n",
+ "h_f = 640.1; \t\t\t#kJ/kg\n",
+ "h_fg = 2107.4; \t\t\t#kJ/kg\n",
+ "v_g = 0.375; \t\t\t#m**3/kg\n",
+ "v_g1 = 0.375*10**(-3);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "h1 = h_f+h_fg;\n",
+ "V = m*v_g;\n",
+ "u1 = h1-p1*v_g1;\n",
+ "v_g2 = V/m/x2; \t\t\t#m**3/kg\n",
+ "\n",
+ "# From steam table corresponding to 0.625 m**3/kg\n",
+ "p2 = 2.9; \t\t\t#bar\n",
+ "print (\"Pressure at new state = \"),(p2),(\"bar\")\n",
+ "\n",
+ "t_s = 132.4; \t\t\t#0C\n",
+ "print (\"Temperature at new state = \"),(t_s),(\"\u00b0C\")\n",
+ "h_f2 = 556.5; \t\t\t#kJ/kg\n",
+ "h_fg2 = 2166.6; \t\t\t#kJ/kg\n",
+ "u2 = (h_f2+x2*h_fg2)-p2*x2*v_g2*10**2;\n",
+ "\n",
+ "Q = u2-u1; \t\t\t#heat transferred at consmath.tant volume per kg\n",
+ "\n",
+ "Q_total = m*Q;\n",
+ "print (\"Total heat transfered,Q_total = \"),(Q_total),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure at new state = 2.9 bar\n",
+ "Temperature at new state = 132.4 \u00b0C\n",
+ "Total heat transfered,Q_total = -1218.435 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.10 page no : 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine :\n",
+ "(i) The mass of steam blown off ;\n",
+ "(ii) The dryness fraction of steam in the vessel after cooling ;\n",
+ "(iii) The heat lost by steam per kg during cooling.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.9; \t\t\t#m**3\n",
+ "p1 = 8.; \t\t\t#bar\n",
+ "x1 = 0.9;\n",
+ "p2 = 4.; \t\t\t#bar\n",
+ "p3 = 3.; \t\t\t#bar\n",
+ "v_g1 = 0.24; \t\t#m**3/kg\n",
+ "\n",
+ "print (\"(i) The mass of steam blown off :\")\n",
+ "m1 = V/x1/v_g1;\n",
+ "h_f1 = 720.9; \t\t\t#kJ/kg\n",
+ "h_fg1 = 2046.5; \t\t#kJ/kg\n",
+ "h_f2 = 604.7; \t\t\t#kJ/kg\n",
+ "h_fg2 = 2133; \t\t\t#kJ/kg\n",
+ "v_g2 = 0.462; \t\t\t#m**3/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "h1 = h_f1+x1*h_fg1; \t\t\t#The enthalpy of steam before blowing off\n",
+ "h2 = h1;\n",
+ "x2 = (h1-h_f2)/h_fg2;\n",
+ "m2 = x1/(x2*v_g2);\n",
+ "\n",
+ "m = m1-m2;\n",
+ "print (\"Mass of steam blown off = %.3f\")%(m),(\"kg\")\n",
+ "\n",
+ "print (\"(ii) Dryness fraction of steam in the vessel after cooling\")\n",
+ "v_g3 = 0.606; \t\t\t#m**3/kg\n",
+ "x3 = x2*v_g2/v_g3;\n",
+ "print (\"dryness fraction = %.4f\")%(x3)\n",
+ "x3 = 0.699\n",
+ "\n",
+ "print (\"(iii) Heat lost during cooling\")\n",
+ "h_f3 = 561.4; \t\t\t #kJ/kg\n",
+ "h_fg3 = 2163.2; \t\t\t#kJ/kg\n",
+ "h3 = h_f3+x3*h_fg3;\n",
+ "u2 = h2-p2*x2*v_g2*10**2; \t\t\t#kJ/kg\n",
+ "u3 = h3-p3*x3*v_g3*10**2; \t\t\t#kJ/kg\n",
+ "Q = m*(u3-u2);\n",
+ "print (\"Heat lost during cooling = %.3f\")%(-Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The mass of steam blown off :\n",
+ "Mass of steam blown off = 2.045 kg\n",
+ "(ii) Dryness fraction of steam in the vessel after cooling\n",
+ "dryness fraction = 0.6998\n",
+ "(iii) Heat lost during cooling\n",
+ "Heat lost during cooling = 913.322 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11 page no : 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) External work done during evaporation.\n",
+ "(ii) Internal latent heat of steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 8*10**5; \t\t\t#Pa\n",
+ "x = 0.8; \n",
+ "v_g = 0.240; \t\t\t#m**3/kg\n",
+ "h_fg = 2046.5; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) External work done during evaporation\")\n",
+ "W = p*x*v_g/10**3; \t\t\t#kJ\n",
+ "print (\"W = \"),(W),(\"kJ\")\n",
+ "\n",
+ "print (\"(ii) Internal latent heat\")\n",
+ "Q = x*h_fg-W;\n",
+ "print (\"Q = \"),(Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) External work done during evaporation\n",
+ "W = 153.6 kJ\n",
+ "(ii) Internal latent heat\n",
+ "Q = 1483.6 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.12 page no : 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the heat supplied to raise the temperature of the steam to 300\u00b0C at constant pressure and\n",
+ "percentage of this heat which appears as external work.\n",
+ "'''\n",
+ "\n",
+ "p1 = 10; \t\t\t#bar\n",
+ "import math \n",
+ "p2 = 10; \t\t\t#bar\n",
+ "x1 = 0.85;\n",
+ "V1 = 0.15; \t\t\t#m**3\n",
+ "t_sup2 = 300; \t\t\t#0C\n",
+ "t_sup1 = 179.9; \t\t\t#0C\n",
+ "c_ps = 2.2; \t\t\t#kJ/kg.K\n",
+ "v_g1 = 0.194; \t\t\t#m**3/kg\n",
+ "m = V1/(x1*v_g1);\n",
+ "h_fg1 = 2013.6; \t\t\t#kJ/kg\n",
+ "Q = (1-x1)*h_fg1+c_ps*(t_sup2-t_sup1);\n",
+ "Q_total = m*Q;\n",
+ "\n",
+ "print (\"Total heat supplied = %.3f\")%(Q_total),(\"kJ\")\n",
+ "\n",
+ "v_sup2 = v_g1*(t_sup2+273)/(t_sup1+273)\n",
+ "W = p1*(v_sup2 - (x1*v_g1))*10**2;\n",
+ "Percentage = W/Q*100;\n",
+ "\n",
+ "print (\"Percentage of total heat supplied = %.3f\")%(Percentage),(\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total heat supplied = 515.094 kJ\n",
+ "Percentage of total heat supplied = 14.224 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.13 page no : 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the specific volume, enthalpy and internal energy of wet steam \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 18.; \t\t\t#bar\n",
+ "x = 0.85;\n",
+ "h_f = 884.6; \t\t\t#kJ/kg\n",
+ "h_fg = 1910.3; \t\t\t#kJ/kg\n",
+ "v_g = 0.110; \t\t\t#m**3/kg\n",
+ "u_f = 883.; \t\t\t#kJ/kg\n",
+ "u_g = 2598.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "v = x*v_g;\n",
+ "print (\"Specific volume of wet steam = \"),(v),(\"m**3/kg\")\n",
+ "\n",
+ "h = h_f+x*h_fg;\n",
+ "print (\"Specific enthalpy of wet steam = \"),(h),(\"kJ/kg\")\n",
+ "u = (1-x)*u_f+ x*u_g;\n",
+ "print (\"Specific internal energy of wet steam = \"),(u),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific volume of wet steam = 0.0935 m**3/kg\n",
+ "Specific enthalpy of wet steam = 2508.355 kJ/kg\n",
+ "Specific internal energy of wet steam = 2340.75 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.14 page no : 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the dryness fraction, specific volume and internal energy of steam \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 7.; \t\t\t#bar\n",
+ "h = 2550.; \t\t\t#kJ/kg\n",
+ "h_f = 697.1; \t\t\t#kJ/kg\n",
+ "h_fg = 2064.9; \t\t\t#kJ/kg\n",
+ "v_g = 0.273; \t\t\t#m**3/kg\n",
+ "u_f = 696.; \t\t\t#kJ/kg\n",
+ "u_g = 2573.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x = (h-h_f)/h_fg;\n",
+ "print (\"(i) Dryness fraction = %.3f\")%(x)\n",
+ "\n",
+ "v = x*v_g;\n",
+ "print (\"(ii) Specific volume of wet steam = %.3f\")%(v),(\"m**3/kg\")\n",
+ "\n",
+ "u = (1-x)*u_f+ x*u_g;\n",
+ "print (\"(iii) Specific internal energy of wet steam = %.3f\")%(u),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Dryness fraction = 0.897\n",
+ "(ii) Specific volume of wet steam = 0.245 m**3/kg\n",
+ "(iii) Specific internal energy of wet steam = 2380.291 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.15 page no : 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the temperature, enthalpy and the internal energy.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 120.; \t\t\t#bar\n",
+ "v = 0.01721; \t\t\t#m**3/kg\n",
+ "\n",
+ "T = 350.; \t\t\t#\u00b0C\n",
+ "print (\"Temperature = \"), (T),(\"\u00b0C\")\n",
+ "\n",
+ "h = 2847.7; \t\t\t#kJ/kg\n",
+ "print (\"specific enthalpy = \"), (h),(\"kJ/kg\")\n",
+ "\n",
+ "u = h-p*v*10**2; \t\t\t#kJ/kg\n",
+ "print (\"Internal energy = \"), (u),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature = 350.0 \u00b0C\n",
+ "specific enthalpy = 2847.7 kJ/kg\n",
+ "Internal energy = 2641.18 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.16 page no : 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the temperature,the specific volume and the internal energy.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 140.; \t\t\t#bar\n",
+ "h = 3001.9; \t\t\t#kJ/kg\n",
+ "T = 400; \t\t\t#0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"Temperature = \"),(T), (\"\u00b0C\")\n",
+ "\n",
+ "v = 0.01722; \t\t\t#m**3/kg\n",
+ "print (\"The specific volume %.3f\")%(v), (\"m**3/kg\")\n",
+ "\n",
+ "u = h-p*v*10**2;\n",
+ "print (\"specific internal energy = \"),(u),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature = 400 \u00b0C\n",
+ "The specific volume 0.017 m**3/kg\n",
+ "specific internal energy = 2760.82 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.17 page no : 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the internal energy per kg of superheated steam \n",
+ "'''\n",
+ "\n",
+ "# At 10 bar: From steam table for superheated steam\n",
+ "\n",
+ "# Variables\n",
+ "h_sup = 3051.2; \t\t\t#kJ/kg\n",
+ "T_sup = 573; \t\t\t#K\n",
+ "T_s = 452.9; \t\t\t#K\n",
+ "v_g = 0.194; \t\t\t#m**3/kg\n",
+ "v_sup = v_g*T_sup/T_s;\n",
+ "p = 10.; \t\t\t#bar\n",
+ "\n",
+ "# Calculations and Results\n",
+ "u1 = h_sup-p*v_sup*10**2; \t\t\t#kJ/kg\n",
+ "print (\"Internal energy of superheated steam at 10 bar = %.3f\")%(u1), (\"kJ/kg\")\n",
+ "\n",
+ "# At 1.4 bar: From steam tables\n",
+ "p = 1.4; \t\t\t#bar\n",
+ "h_f = 458.4; \t\t\t#kJ/kg\n",
+ "h_fg = 2231.9; \t\t\t#kJ/kg\n",
+ "v_g = 1.236; \t\t\t#m**3/kg\n",
+ "x = 0.8;\n",
+ "h = h_f+x*h_fg;\n",
+ "u2 = h-p*x*v_g*10**2; \t\t\t#kJ\n",
+ "du = u2-u1;\n",
+ "print (\"Change in internal energy = %.3f\")%(du),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Internal energy of superheated steam at 10 bar = 2805.755 kJ/kg\n",
+ "Change in internal energy = -700.267 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.18 page no : 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the internal energy of 1 kg of steam at 20 bar when\n",
+ "(i) it is superheated, its temperature being 400\u00b0C ;\n",
+ "(ii) it is wet, its dryness being 0.9.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p = 20.; \t\t\t#bar\n",
+ "T_sup = 400.; \t\t\t#0C\n",
+ "x = 0.9;\n",
+ "c_ps = 2.3; \t\t\t#kJ/kg.K\n",
+ "\n",
+ "print (\"(i) Internal energy of 1 kg of superheated steam\")\n",
+ "# At 20 bar: From steam tables\n",
+ "T_s = 212.4; \t\t\t#0C\n",
+ "h_f = 908.6; \t\t\t#kJ/kg\n",
+ "h_fg = 1888.6; \t\t\t#kJ/kg\n",
+ "v_g = 0.0995; \t\t\t#m**3/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "h_sup = h_f+h_fg+c_ps*(T_sup-T_s);\n",
+ "v_sup = v_g*(T_sup+273)/(T_s+273);\n",
+ "u = h_sup-p*v_sup*10**2;\n",
+ "print (\"Internal energy = %.3f\")%(u),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) Internal energy of 1 kg of wet steam\")\n",
+ "h = h_f+x*h_fg;\n",
+ "u = h-p*x*v_g*10**2;\n",
+ "print (\"Internal energy = %.3f\")%(u),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Internal energy of 1 kg of superheated steam\n",
+ "Internal energy = 2952.769 kJ/kg\n",
+ "(ii) Internal energy of 1 kg of wet steam\n",
+ "Internal energy = 2429.240 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.19 page no : 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the quality of steam supplied by the other boiler. Take c ps = 2.25 kJ/kg.\n",
+ "'''\n",
+ "# Variables\n",
+ "h_g1 = 2797.2; \t\t\t#kJ/kg\n",
+ "c_ps = 2.25;\n",
+ "T_sup = 350.; \t\t\t#0C\n",
+ "T_s = 212.4; \t\t\t#0C\n",
+ "\n",
+ "# Calculations\n",
+ "h1 = h_g1+c_ps*(T_sup-T_s);\n",
+ "h_f2 = 908.6; \t\t\t#kJ/kg\n",
+ "h_fg2 = 1888.6; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Main:20 bar, 250 0C\n",
+ "T_sup = 250.; \t\t\t#0C\n",
+ "Q = 2*(h_g1+c_ps*(T_sup-T_s));\n",
+ "x2 = (Q-h1-h_f2)/h_fg2;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Quality of steam %.3f\")%(x2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quality of steam 0.926\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.20 page no : 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the entropy of 1 kg of wet steam \n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p = 6.; \t\t\t#bar\n",
+ "x = 0.8;\n",
+ "T_s = 473.; \t\t\t#K\n",
+ "h_fg = 2085.; \t\t\t#kJ/kg\n",
+ "c_pw = 4.18;\n",
+ "\n",
+ "# Calculations\n",
+ "s_wet = c_pw*math.log(T_s/273)+x*h_fg/T_s;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Entropy of wet steam = %.3f\")%(s_wet),(\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy of wet steam = 5.824 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.21 page no : 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find :\n",
+ "(i) Drop in enthalpy ;\n",
+ "(ii) Change in entropy.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 10.; \t\t\t#bar\n",
+ "t_sup = 400.; \t\t#0C\n",
+ "p2 = 0.2; \t\t\t#bar\n",
+ "x2 = 0.9;\n",
+ "h_sup = 3263.9; \t\t\t#kJ/kg\n",
+ "s_sup = 7.465; \t\t\t#kJ/kg\n",
+ "h1 = 3263.9; \t\t\t#kJ/kg\n",
+ "s1 = s_sup;\n",
+ "h_f2 = 251.5; \t\t\t#kJ/kg\n",
+ "h_fg2 = 2358.4; \t\t#kJ/kg\n",
+ "s_f2 = 0.8321; \t\t\t#kJ/kg.K\n",
+ "s_g2 = 7.9094; \t\t\t#kJ/kg.K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "s_fg2 = s_g2-s_f2;\n",
+ "h2 = h_f2+x2*h_fg2;\n",
+ "s2 = s_f2+x2*s_fg2;\n",
+ "\n",
+ "print (\"(i) Drop in enthalpy\")\n",
+ "dh = h1-h2;\n",
+ "print (\"Drop in enthalpy = %.3f\")%(dh),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) Change in entropy\")\n",
+ "ds = s1-s2;\n",
+ "print (\"Change in entropy = %.3f\")%(ds),(\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Drop in enthalpy\n",
+ "Drop in enthalpy = 889.840 kJ/kg\n",
+ "(ii) Change in entropy\n",
+ "Change in entropy = 0.263 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.22 page no : 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the entropy of 1 kg of superheated steam \n",
+ "'''\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t \t #kg\n",
+ "p = 12.; \t\t \t#bar\n",
+ "T_sup = 523.; \t\t\t#K\n",
+ "c_ps = 2.1; \t\t\t#kJ/kg.K\n",
+ "T_s = 461.; \t\t\t#K\n",
+ "h_fg = 1984.3; \t\t\t#kJ/kg\n",
+ "c_pw = 4.18;\n",
+ "\n",
+ "# Calculations\n",
+ "s_sup = c_pw*math.log(T_s/273)+h_fg/T_s+c_ps*math.log(T_sup/T_s);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Entropy = %.3f\")%(s_sup),(\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy = 6.759 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.23 page no : 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the amount of work and heat transfer to or from steam\n",
+ "'''\n",
+ "# Variables\n",
+ "m = 3.; \t\t\t#kg\n",
+ "v1 = 0.75; \t\t\t#m**3/kg\n",
+ "v2 = 1.2363; \t\t\t#m**3/kg\n",
+ "x = v1/v2;\n",
+ "h_f = 458.4; \t\t\t#kJ/kg\n",
+ "h_fg = 2231.9; \t\t\t#kJ/kg\n",
+ "h_s = m*(h_f+x*h_fg); \t\t\t#kJ\n",
+ "v_sup = 1.55; \t\t\t#m**3/kg\n",
+ "p = 2; \t\t\t#bar\n",
+ "t_s = 120.2; \t\t\t#0C\n",
+ "t_sup = 400; \t\t\t#0C\n",
+ "h = 3276.6; \t\t\t#kJ/kg\n",
+ "U = 1708.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Degree = t_sup-t_s;\n",
+ "h_sup = m*h;\n",
+ "\n",
+ "Q_added = h_sup - h_s;\n",
+ "print (\"Heat added = %.3f\")%(Q_added),(\"kJ\")\n",
+ "\n",
+ "U_s = m*U;\n",
+ "U_sup = m*(h-p*v_sup*10**2);\n",
+ "dU = U_sup - U_s;\n",
+ "W = Q_added - dU;\n",
+ "print (\"work done = %.3f\")%(W),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat added = 4392.661 kJ\n",
+ "work done = 616.861 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.24 page no : 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the dryness fraction of steam as it enters the tank \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 5.; \t\t\t#bar\n",
+ "m = 50.; \t\t\t#kg\n",
+ "T1 = 20.; \t\t\t#0C\n",
+ "m_s = 3.; \t\t\t#kg\n",
+ "T2 = 40.; \t\t\t#0C\n",
+ "m_eq = 1.5; \t\t\t#kg\n",
+ "h_f = 640.1; \t\t\t#kJ/kg\n",
+ "h_fg = 2107.4; \t\t\t#kJ/kg\n",
+ "c_pw = 4.18;\n",
+ "\n",
+ "# Calculations\n",
+ "m_w = m+m_eq;\n",
+ "x = ((m_w*c_pw*(T2-T1))/m_s + c_pw*T2 - h_f)/h_fg;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Dryness fraction of steam %.3f\")%(x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dryness fraction of steam 0.457\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.25 page no : 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the mass of steam condensed\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 1.1; \t\t\t#bar\n",
+ "x = 0.95;\n",
+ "c_pw = 4.18;\n",
+ "m1 = 90.; \t\t\t#kg\n",
+ "m2 = 5.25; \t\t\t#kg\n",
+ "T1 = 25.; \t\t\t#0C\n",
+ "T2 = 40.; \t\t\t#0C\n",
+ "\n",
+ "# Calculations\n",
+ "m = m1+m2;\n",
+ "h_f = 428.8; \t\t\t#kJ/kg\n",
+ "h_fg = 2250.8; \t\t\t#kJ/kg\n",
+ "m_s = (m*c_pw*(T2-T1))/((h_f + x*h_fg) - c_pw*T2)\n",
+ "\n",
+ "# Results\n",
+ "print (\"Mass of steam condensed = %.3f\")%(m_s),(\"kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of steam condensed = 2.489 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.26 page no : 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the dryness fraction of the steam \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 8.; \t\t\t#bar\n",
+ "p2 = 1.; \t\t\t#bar\n",
+ "T_sup2 = 115.; \t\t#0C\n",
+ "T_s2 = 99.6; \t\t#0C\n",
+ "h_f1 = 720.9; \t\t#kJ/kg\n",
+ "h_fg1 = 2046.5; \t#kJ/kg\n",
+ "h_f2 = 417.5; \t\t#kJ/kg\n",
+ "h_fg2 = 2257.9; \t#kJ/kg\n",
+ "c_ps = 2.1;\n",
+ "\n",
+ "# Calculations\n",
+ "x1 = (h_f2+h_fg2+c_ps*(T_sup2-T_s2)-h_f1)/h_fg1;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Dryness fraction of the steam in the main = %.3f\")%(x1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dryness fraction of the steam in the main = 0.971\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.27 page no : 94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the quality of steam supplied.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m_w = 2.; \t\t\t#kg\n",
+ "m_s = 20.5; \t\t#kg\n",
+ "t_sup = 110.; \t\t#0C\n",
+ "p1 = 12.; \t\t\t#bar\n",
+ "p3 = 1.; \t\t\t#bar\n",
+ "p2 = p1;\n",
+ "h_f2 = 798.4; \t\t#kJ/kg\n",
+ "h_fg2 = 1984.3; \t#kJ/kg\n",
+ "T_s = 99.6; \t\t#0C\n",
+ "h_f3 = 417.5; \t\t#kJ/kg\n",
+ "h_fg3 = 2257.9; \t#kJ/kg\n",
+ "T_sup = 110.; \t\t#0C\n",
+ "c_ps = 2.; \t\t\t#kJ/kg.K\n",
+ "\n",
+ "# Calculations\n",
+ "x2 = (h_f3+h_fg3 + c_ps*(T_sup-T_s) - h_f2)/h_fg2;\n",
+ "x1 = x2*m_s/(m_w+m_s);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Quality of steam supplied = %.3f\")%(x1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quality of steam supplied = 0.871\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.28 page no : 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the dryness fraction of the sample steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 15.; \t\t\t#bar\n",
+ "p2 = p1;\n",
+ "p3 = 1.; \t\t\t#bar\n",
+ "t_sup3 = 150.; \t\t#0C\n",
+ "m_w = 0.5; \t\t\t#kg/min\n",
+ "m_s = 10.; \t\t\t#kg/min\n",
+ "h_f2 = 844.7; \t\t#kJ/kg\n",
+ "h_fg2 = 1945.2; \t#kJ/kg\n",
+ "h_sup3 = 2776.4; \t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "x2 = (h_sup3 - h_f2)/h_fg2;\n",
+ "x1 = x2*m_s/(m_s + m_w);\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print (\"Quality of steam supplied = %.3f\")%(x1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quality of steam supplied = 0.946\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch4.ipynb b/Industrial_Instrumentation/ch4.ipynb
new file mode 100644
index 00000000..35fec4af
--- /dev/null
+++ b/Industrial_Instrumentation/ch4.ipynb
@@ -0,0 +1,3551 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : First Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 page no : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the change in internal energy of the working fluid stating whether it is a gain or loss.\n",
+ "\n",
+ "# Variables\n",
+ "Q = -50.; \t\t\t#kJ/kg\n",
+ "W = -100.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "dU = Q-W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"gain in internal energy = \"),(dU),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gain in internal energy = 50.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 page no : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the heat flow to and from the cylinder\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "u1 = 450.; \t\t\t#kJ/kg\n",
+ "u2 = 220; \t\t\t#kJ/kg\n",
+ "W = 120; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "Q = (u2-u1) + W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat rejected by air = \"),(-Q),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat rejected by air = 110.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 page no : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the heat transferred from the nitrogen to the surroundings.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 0.3; \t\t\t#kg\n",
+ "cv = 0.75; \t\t\t#kJ/kg.K\n",
+ "T1 = 313.; \t\t\t#K\n",
+ "T2 = 433.; \t\t\t#K\n",
+ "W = -30.; \t\t\t#kJ\n",
+ "\n",
+ "# Calculations\n",
+ "dU = m*cv*(T2-T1);\n",
+ "Q = dU + W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat rejected during the process = \"),(-Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat rejected during the process = 3.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 page no : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "How much did the internal energy of the gas change ?\n",
+ "'''\n",
+ "# Variables\n",
+ "p1 = 105.; \t\t\t#kPa\n",
+ "V1 = 0.4; \t\t\t#m**3\n",
+ "p2 = p1;\n",
+ "V2 = 0.20; \t\t\t#m**3\n",
+ "Q = -42.5; \t\t\t#kJ\n",
+ "\n",
+ "# Calculations\n",
+ "W = p1*(V2-V1);\n",
+ "dU = Q-W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"change in internal energy = \"),(dU),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in internal energy = -21.5 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page no :121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine : (i) Work done ;\n",
+ "(ii) Change in internal energy ; and\n",
+ "(iii) Heat transferred\n",
+ "'''\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 10.**5 # Pa\n",
+ "T1 = 25 + 273 # K\n",
+ "p2 = 5 * 10**5 # Pa\n",
+ "T2 = T1 \n",
+ "\n",
+ "# Calculations and Result\n",
+ "print \"(i) For isothermal process :\"\n",
+ "W12 = -p1 * (1.8)* math.log(p1/p2)\n",
+ "print \"Work done on the air = %.3e kJ/kg.\"%W12\n",
+ "\n",
+ "print \"(ii) Since temperature is constant,\"\n",
+ "print \"u2 \u2013 u1 = 0\"\n",
+ "print \"Change in internal energy = zero.\"\n",
+ "\n",
+ "print \"(iii) Again,\"\n",
+ "Q12 = 0 + W12\n",
+ "print \"Heat rejected = %.3e kJ/kg.\"%Q12\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) For isothermal process :\n",
+ "Work done on the air = 2.897e+05 kJ/kg.\n",
+ "(ii) Since temperature is constant,\n",
+ "u2 \u2013 u1 = 0\n",
+ "Change in internal energy = zero.\n",
+ "(iii) Again,\n",
+ "Heat rejected = 2.897e+05 kJ/kg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7 page no : 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the quantity of heat added to the system.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "W_12 = -82.; \t\t\t#kJ\n",
+ "Q_12 = -45.; \t\t\t#kJ\n",
+ "dU_12 = Q_12 - W_12;\n",
+ "W_21 = 100.; \t\t\t#kJ\n",
+ "dU_21 = -dU_12;\n",
+ "\n",
+ "# Calculations\n",
+ "Q_21 = dU_21 + W_21;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat added to the system = \"),(Q_21),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat added to the system = 63.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8 page no : 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine : \n",
+ "(i) Work done ;\n",
+ "(ii) Change in internal energy of the system.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Q2 = 9000.; \t\t\t#kJ\n",
+ "Q1 = 3000.; \t\t\t#kJ\n",
+ "Q = Q1-Q2; \n",
+ "W = 0;\n",
+ "\n",
+ "# Calculations\n",
+ "dU = W-Q;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Work done = \"),(W)\n",
+ "\n",
+ "print (\"Change in internal energy = \"),(dU),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = 0\n",
+ "Change in internal energy = 6000.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9 page no : 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine \u2206U, \u2206PE, \u2206KE, Q and W, when\n",
+ "(i) the stone is about to enter the water,\n",
+ "(ii) the stone has come to rest in the tank, and\n",
+ "(iii) the heat is transferred to the surroundings in such an amount that the stone and water\n",
+ "come to their initial temperature.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 20.; \t\t\t#kg\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "z2 = 0.;\n",
+ "z1 = 15.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) When the stone is about to enter the water\")\n",
+ "Q = 0\n",
+ "W = 0\n",
+ "dU = 0\n",
+ "PE = m*g*(z2-z1)\n",
+ "KE = -PE\n",
+ "print \"\u2206 PE = %.3f\"%KE,\"J\"\n",
+ "\n",
+ "print (\"(ii) When the stone dips into the math.tank and comes to rest\")\n",
+ "Q = 0\n",
+ "W = 0\n",
+ "KE = 0\n",
+ "PE = m*g*(z2-z1)\n",
+ "dU = -PE\n",
+ "print \"\u2206U = %.3f\"%dU\n",
+ "\n",
+ "print (\"(iii) When the water and stone come to their initial temperature\")\n",
+ "W = 0\n",
+ "KE = 0\n",
+ "Q = -dU\n",
+ "print \"Q = %.3f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) When the stone is about to enter the water\n",
+ "\u2206 PE = 2943.000 J\n",
+ "(ii) When the stone dips into the math.tank and comes to rest\n",
+ "\u2206U = 2943.000\n",
+ "(iii) When the water and stone come to their initial temperature\n",
+ "Q = -2943.000\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10 page no : 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) How much will be the heat that flows into the system along path lnm if the work done\n",
+ "is 21 kJ ?\n",
+ "(ii) When the system is returned from m to l along the curved path, the work done on the\n",
+ "system is 42 kJ. Does the system absorb or liberate heat, and how much of the heat is absorbed\n",
+ "or liberated ?\n",
+ "(iii) If U l = 0 and U n = 84 kJ, find the heat absorbed in the processes ln and nm.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Q_lqm = 168.; \t\t\t#kJ\n",
+ "W_lqm = 64.; \t\t\t#kJ\n",
+ "dU_lm = Q_lqm - W_lqm;\n",
+ "W_lnm = 21.; \t\t\t#kJ\n",
+ "W_ml = -42.; \t\t\t#kJ\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q_lnm = dU_lm + W_lnm;\n",
+ "print (\"(i)Q_lnm = \"),(Q_lnm), (\"kJ\")\n",
+ "\n",
+ "Q_ml = W_ml - dU_lm;\n",
+ "print (\"(ii)Q_ml = \"),(Q_ml),(\"kJ\")\n",
+ "\n",
+ "W_ln = 21.; \t\t\t#kJ\n",
+ "dU_ln = 84.; \t\t\t#kJ\n",
+ "Q_ln = dU_ln + W_ln;\n",
+ "Q_nm = Q_lnm-Q_ln;\n",
+ "print (\"(iii)Q_nm = \"), (Q_nm), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Q_lnm = 125.0 kJ\n",
+ "(ii)Q_ml = -146.0 kJ\n",
+ "(iii)Q_nm = 20.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11 page no : 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What will be the change of internal energy of the system when its temperature changes\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 55.; \t\t\t#0C\n",
+ "T2 = 95.; \t\t\t#0C\n",
+ "\n",
+ "# Calculations\n",
+ "def f1( T): \n",
+ "\t return 200\n",
+ "W = quad(f1, T1, T2)[0]\n",
+ "\n",
+ "\n",
+ "def f2( T): \n",
+ "\t return 160\n",
+ "Q = quad(f2, T1, T2)[0]\n",
+ "dU = Q-W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"change in internal energy = \"),(dU/10**3),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in internal energy = -1.6 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.12 page no : 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Completeing the table\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Q = -340.; \t\t\t#kJ\n",
+ "n = 200.; \t\t\t#cycles/min\n",
+ "\n",
+ "#For Process 1-2\n",
+ "W_12 = 4340.; \t\t\t#kJ/min\n",
+ "Q_12 = 0.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "dE_12 = Q_12-W_12;\n",
+ "print (\"dE_12 = \"),(dE_12),(\"kJ/min\")\n",
+ "\n",
+ "#For process 2-3\n",
+ "Q_23 = 42000.; \t\t\t#kJ/min\n",
+ "W_23 = 0;\n",
+ "\n",
+ "dE_23 = Q_23-W_23;\n",
+ "print (\"dE_23 = \"),(dE_23),(\"kJ/min\")\n",
+ "\n",
+ "#For process 3-4\n",
+ "Q_34 = -4200.; \t\t\t#kJ/min\n",
+ "dE_34 = -73200.; \t\t\t#kJ/min\n",
+ "\n",
+ "W_34 = Q_34-dE_34;\n",
+ "print (\"W_34 = \"), (W_34), (\"kJ/min\")\n",
+ "\n",
+ "#For process 4-1\n",
+ "Q_41 = Q*n-Q_12-Q_23-Q_34;\n",
+ "print (\"Q_41 = \"), (Q_41), (\"kJ/min\")\n",
+ "\n",
+ "dE_41 = 0-dE_12-dE_23-dE_34;\n",
+ "print (\"dE_41 = \"), (dE_41), (\"kJ/min\")\n",
+ "\n",
+ "W_41 = Q_41-dE_41;\n",
+ "print (\"W_41 = \"), (W_41), (\"kJ/min\")\n",
+ "\n",
+ "print \"Since sum(Q) = sum(W), \"\n",
+ "print \"Rate of work output = -68000 KJ/min\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dE_12 = -4340.0 kJ/min\n",
+ "dE_23 = 42000.0 kJ/min\n",
+ "W_34 = 69000.0 kJ/min\n",
+ "Q_41 = -105800.0 kJ/min\n",
+ "dE_41 = 35540.0 kJ/min\n",
+ "W_41 = -141340.0 kJ/min\n",
+ "Since sum(Q) = sum(W), \n",
+ "Rate of work output = -68000 KJ/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.13 page no : 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the steam flow round the cycle in kg/s.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "P = 1200.; \t\t\t#kW\n",
+ "Qin = 3360.; \t\t\t#kJ/kg\n",
+ "Qout = 2520.; \t\t\t#kJ/kg\n",
+ "F = 6.; \t\t\t#kW\n",
+ "\n",
+ "# Calculations\n",
+ "dQ = Qin - Qout;\n",
+ "dW = P-F; \t\t\t#kJ/s\n",
+ "m = dW/dQ;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Steam flow round the cycle %.3f\")%(m), (\"kg/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steam flow round the cycle 1.421 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.14 page no : 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The change in internal energy ;\n",
+ "(ii) The work done.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "dT = 25.; \t\t\t#0C\n",
+ "Q = 30.; \t\t\t#kJ\n",
+ "cv = 1.2; \t\t\t#kJ/kg.0C\n",
+ "m = 2.5; \t\t\t#kg\n",
+ "\n",
+ "# Calculations\n",
+ "dU = m*cv*dT;\n",
+ "\n",
+ "# Results\n",
+ "print (\"change in internal energy = \"),(dU), (\"kJ\")\n",
+ "\n",
+ "W = Q - dU;\n",
+ "print (\"Work done = \"),(W),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in internal energy = 75.0 kJ\n",
+ "Work done = -45.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.15 page no : 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Find the change in energy of the system.\n",
+ "(ii) The system is returned to its initial volume by an adiabatic process which requires\n",
+ "110 kJ of work. Find the change in energy of the system.\n",
+ "(iii) For the combined processes of (i) and (ii) determine the change in energy of the system.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Q = 50.; \t\t\t#kJ\n",
+ "dV = 0.14; \t\t\t#m**3\n",
+ "p = 1.2*10**5; \t\t#N/m**2\n",
+ "m = 90.; \t\t\t#kg\n",
+ "d = 5.5; \t\t\t#m\n",
+ "g = 9.8; \t\t\t#m/s**2\n",
+ "W_adb = -110.; \t#kJ\n",
+ "Wnet = m*g*d/1000; \t#kJ\n",
+ "\n",
+ "# Calculations and Results\n",
+ "W = p*dV/1000 + Wnet; \t\t\t#kJ\n",
+ "dE = Q-W;\n",
+ "print (\"(i)Change in internal energy %.3f kJ\")%(dE)\n",
+ "\n",
+ "Q = 0;\n",
+ "dE = -W_adb;\n",
+ "print (\"(ii) Adiabatic process %.3f kJ\")%(dE)\n",
+ "\n",
+ "\n",
+ "Q = 50.; \t\t\t#kJ\n",
+ "dE = Q - (W_adb+W);\n",
+ "print (\"(iii)Change in internal energy %.3f kJ\")%(dE)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Change in internal energy 28.349 kJ\n",
+ "(ii) Adiabatic process 110.000 kJ\n",
+ "(iii)Change in internal energy 138.349 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.16 page no : 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Change in internal energy ;\n",
+ "(ii) Change in enthalpy.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.15; \t\t\t#m**3\n",
+ "V2 = 0.05; \t\t\t#m**3\n",
+ "Q = -45.; \t\t\t#kJ\n",
+ "p1 = (5./V1+1.5)*10**5; \t\t\t#N/m**2\n",
+ "p2 = (5./V2+1.5)*10**5; \t\t\t#N/m**2\n",
+ "\n",
+ "# Calculations\n",
+ "def f0( V): \n",
+ "\t return (5/V+1.5)*10**2\n",
+ "\n",
+ "W = quad(f0, V1, V2)[0]\n",
+ "\n",
+ "dU = Q-W;\n",
+ "print (\"(i)Change in internal energy = %.3f kJ\")%(dU)\n",
+ "\n",
+ "dH = (dU*10**3+(p2*V2-p1*V1))/10**3;\n",
+ "print (\"(ii) Change in enthalpy = %.3f kJ\")%(dH)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Change in internal energy = 519.306 kJ\n",
+ "(ii) Change in enthalpy = 504.306 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.17 page no : 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine:\n",
+ "(i) If the expansion is quasi-static, find Q, \u2206U and W for the process.\n",
+ "(ii) In another process, the same system expands according to the same pressure-volume\n",
+ "relationship as in part (i), and from the same initial state to the same final state as in part (i), but\n",
+ "the heat transfer in this case is 32 kJ. Find the work transfer for this process.\n",
+ "(iii) Explain the difference in work transfer in parts (i) and (ii).\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.25; \t\t\t#m**3\n",
+ "p1 = 500.; \t\t\t#kPa\n",
+ "p2 = 100.; \t\t\t#kPa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "V2 = V1*(p1/p2)**(1/1.25)\n",
+ "n = 1.25\n",
+ "dU = 3.64*(p2*V2 - p1*V1)\n",
+ "\n",
+ "print (\"(i) If the expansion is quasi-static\")\n",
+ "W = (p1*V1-p2*V2)/(n-1);\n",
+ "Q = dU+W\n",
+ "print (\"Heat transfered = %.3f\")%(Q),(\"kJ\")\n",
+ "\n",
+ "print (\"(ii) In another process\")\n",
+ "Q = 32; \t\t\t#kJ\n",
+ "W = Q-dU;\n",
+ "print (\"Work done = %.3f\")%(W),(\"kJ\")\n",
+ "\n",
+ "print (\"(iii)The difference\")\n",
+ "print (\" The work in (ii) is not equal to \u222b p dV math.since the process is not quasi-static.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) If the expansion is quasi-static\n",
+ "Heat transfered = 12.385 kJ\n",
+ "(ii) In another process\n",
+ "Work done = 157.225 kJ\n",
+ "(iii)The difference\n",
+ " The work in (ii) is not equal to \u222b p dV math.since the process is not quasi-static.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.18 page no : 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "(i) Heat added/kg ;\n",
+ "(ii) Work done/kg ;\n",
+ "(iii) Change in internal energy/kg ;\n",
+ "(iv) Change in enthalpy/kg.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "v1 = 0.3; \t\t\t#m**3/kg\n",
+ "T1 = 20.; \t\t\t#0C\n",
+ "v2 = 0.55; \t\t\t#m**3/kg\n",
+ "T2 = 260; \t\t\t#0C\n",
+ "p = 1.6*10**5; \t\t\t#Pa\n",
+ "\n",
+ "print (\"(i)Heat added per kg = \")\n",
+ "\n",
+ "# Calculations and Results\n",
+ "def f5( T): \n",
+ "\t return 1.5 + 75/(T+45)\n",
+ "\n",
+ "Q = quad(f5, T1,T2)[0]\n",
+ "\n",
+ "print (\"Q = %.3f\")%(Q), (\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii)The work done per kg of fluid\")\n",
+ "W = p*(v2-v1)/1000; \t\t\t#kJ/kg\n",
+ "print (\"W = %.3f\")%(W),(\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii)Change in internal energy\")\n",
+ "dU = Q-W;\n",
+ "print (\"dU = %.3f\")%(dU),(\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(iv)Change in enthalpy\")\n",
+ "dH = Q;\n",
+ "print (\"dH = %.3f\")%(dH),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Heat added per kg = \n",
+ "Q = 475.944 kJ/kg\n",
+ "(ii)The work done per kg of fluid\n",
+ "W = 40.000 kJ/kg\n",
+ "(iii)Change in internal energy\n",
+ "dU = 435.944 kJ/kg\n",
+ "(iv)Change in enthalpy\n",
+ "dH = 475.944 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.19 page no : 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the work done during the process.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "du = -42000.; \t\t\t#J\n",
+ "cp = 840.; \t\t\t#J/kg.0C\n",
+ "cv = 600.; \t\t\t#J/kg.0C\n",
+ "\n",
+ "# Calculations\n",
+ "dT = du/m/cv;\n",
+ "Q = m*cp*dT;\n",
+ "W = (Q-du)/10**3;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Work done = \"),(W),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = -16.8 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 4.20 page no : 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the direction and magnitude of the work and heat transfer.\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 190.; \t\t\t#kPa\n",
+ "V1 = 0.035; \t\t\t#m**3\n",
+ "p2 = 420.; \t\t\t#kPa\n",
+ "V2 = 0.07; \t\t\t#m**3\n",
+ "dU = 3.6*(p2*V2-p1*V1);\n",
+ "p = [[1,0.035],[1,0.07]]\n",
+ "q = [190,420];\n",
+ "#X = linalg.inv(p)*q;\n",
+ "X = linalg.solve(p,q)\n",
+ "a = X[0]\n",
+ "b = X[1]\n",
+ "\n",
+ "# Calculations\n",
+ "def f4( V): \n",
+ "\t return a+b*V\n",
+ "\n",
+ "W = quad(f4, V1, V2)[0]\n",
+ "\n",
+ "# Results\n",
+ "print (\"Work done by the system = \"),(W),(\"kJ\")\n",
+ "\n",
+ "\n",
+ "Q = dU+W;\n",
+ "print (\"Heat transfer into the system = \"),(Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done by the system = 10.675 kJ\n",
+ "Heat transfer into the system = 92.575 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.21 page no : 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The adiabatic work ;\n",
+ "(ii) The values of internal energy at all end states if initial value is 105 kJ.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Qv = 90.; \t\t\t#kJ\n",
+ "Qp = -95; \t\t\t#kJ\n",
+ "W = -18; \t\t\t#kJ\n",
+ "U_l = 105; \t\t\t#kJ\n",
+ "W_lm = 0;\n",
+ "Q_lm = 90;\n",
+ "\n",
+ "# Calculations\n",
+ "U_m = U_l+90;\n",
+ "dU_mn = Qp-W;\n",
+ "U_n = U_m+dU_mn;\n",
+ "dQ = Qv+Qp;\n",
+ "dW = dQ;\n",
+ "W_nl = dW-W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"W_nl(in kJ) = \"),(W_nl)\n",
+ "\n",
+ "print (\"U_l in kJ = \"),(U_l)\n",
+ "\n",
+ "print (\"U_m in kJ = \"),(U_m)\n",
+ "print (\"U_n in kJ\"), (U_n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W_nl(in kJ) = 13.0\n",
+ "U_l in kJ = 105\n",
+ "U_m in kJ = 195\n",
+ "U_n in kJ 118\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.23 page no : 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The work done ;\n",
+ "(ii) The index of expansion, if the above processes are replaced by a single reversible polytropic\n",
+ "process giving the same work between the same initial and final states.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.2; \t\t\t#m**3\n",
+ "p1 = 4.*10**5; \t\t#N/m**2\n",
+ "T1 = 403.; \t\t\t#K\n",
+ "p2 = 1.02*10**5; \t#N/m**2\n",
+ "dH = 72.5; \t\t\t#kJ\n",
+ "Q_23 = dH;\n",
+ "cp = 1.; \t\t\t#kJ/kg\n",
+ "cv = 0.714; \t\t#kJ/kg\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations\n",
+ "V2 = round(V1*(p1/p2)**(1/y),2);\n",
+ "T2 = round(T1*((p2/p1)**((y-1)/y)),1);\n",
+ "R = (cp-cv)*1000; \t\t\t#J/kg.K\n",
+ "m = round(p1*V1/R/T1,3);\n",
+ "T3 = round(Q_23/(m*cp) +T2);\n",
+ "V3 = 0.732 # round(V2*T3/T2,2);\n",
+ "W_12 = (p1*V1 - p2*V2)/(y-1);\n",
+ "W_23 = p2*(V3-V2);\n",
+ "W_123 = W_12+W_23;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Total work done = %.3f\")%(W_123),(\"J\")\n",
+ "\n",
+ "print (\"(ii) Index of expansion, n\")\n",
+ "p3 = p2;\n",
+ "n = (p1*V1-p3*V3)/W_123 + 1;\n",
+ "print (\"value of index = %.3f\")%(n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total work done = 85454.000 J\n",
+ "(ii) Index of expansion, n\n",
+ "value of index = 1.062\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.25 page no : 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Evaluate :\n",
+ "(i) The work ;\n",
+ "(ii) Decrease in internal energy of the system.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "d = 0.15; \t\t\t#m\n",
+ "T = 303.; \t\t\t#K\n",
+ "p = 3.*10**5; \t\t#N/m**2\n",
+ "l = 0.085; \t\t\t#m\n",
+ "Q = -4000.; \t\t#J\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Workdone by the system\")\n",
+ "dv = math.pi/4*d**2*l;\n",
+ "W = p*dv;\n",
+ "print (\"W = %.3f\")%(W/10**3),(\"kJ\")\n",
+ "\n",
+ "print (\"(ii) Decrease in internal energy of the system\")\n",
+ "dU = (Q-W)/10**3;\n",
+ "print (\"Decrease in internal energy = %.3f\")%(-dU),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Workdone by the system\n",
+ "W = 0.451 kJ\n",
+ "(ii) Decrease in internal energy of the system\n",
+ "Decrease in internal energy = 4.451 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.27 page no : 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The mass of gas ;\n",
+ "(ii) The value of index \u2018n\u2019 for compression ;\n",
+ "(iii) The increase in internal energy of the gas ;\n",
+ "(iv) The heat received or rejected by the gas during compression.\n",
+ "Take \u03b3 = 1.4, R = 294.2 J/kg\u00b0C.\n",
+ "'''\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "y = 1.4\n",
+ "R = 294.2; \t\t\t#J/kg.0C\n",
+ "p1 = 1.*10**5; \t\t#N/m**2\n",
+ "T1 = 353.; \t\t\t#K\n",
+ "V1 = 0.45; \t\t\t#m**3\n",
+ "V2 = 0.13; \t\t\t#m**3\n",
+ "p2 = 5.*10**5; \t\t#N/m**2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "cv = R/(y-1);\n",
+ "print (\"(i) The mass of gas\")\n",
+ "m = p1*V1/R/T1;\n",
+ "print (\"m = %.3f\")%(m),(\"kg\")\n",
+ "\n",
+ "print (\"(ii) The value of index \u2018n\u2019 for compression\")\n",
+ "n = math.log(p2/p1)/math.log(V1/V2);\n",
+ "print (\"n = %.3f\")%(n)\n",
+ "\n",
+ "print (\"(iii) The increase in internal energy of the gas\")\n",
+ "T2 = T1*(V1/V2)**(n-1);\n",
+ "dU = m*cv*(T2-T1)/10**3;\n",
+ "print (\"dU = %.3f\")%(dU),(\"kJ\")\n",
+ "\n",
+ "print (\"(iv) The heat received or rejected by the gas during compression.\")\n",
+ "W = m*R*(T1-T2)/(n-1)/10**3;\n",
+ "Q = dU+W;\n",
+ "print (\"Q = %.3f\")%(Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The mass of gas\n",
+ "m = 0.433 kg\n",
+ "(ii) The value of index \u2018n\u2019 for compression\n",
+ "n = 1.296\n",
+ "(iii) The increase in internal energy of the gas\n",
+ "dU = 50.000 kJ\n",
+ "(iv) The heat received or rejected by the gas during compression.\n",
+ "Q = -17.535 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.28 page no : 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The final temperature ;\n",
+ "(ii) The final volume ;\n",
+ "(iii) The work done.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1.02*10**5; \t#Pa\n",
+ "T1 = 295.; \t\t\t#K\n",
+ "V1 = 0.015; \t\t#m**3\n",
+ "p2 = 6.8*10**5; \t#Pa\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Final temperature\")\n",
+ "T2 = T1*(p2/p1)**((y-1)/y);\n",
+ "t2 = T2-273; \n",
+ "print (\"t2 = %.3f\")%(t2),(\"\u00b0C\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Final volume :\")\n",
+ "V2 = V1*(p1/p2)**(1/y);\n",
+ "print (\"V2 = %.3f\")%(V2),(\"m**3\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii)Work done\")\n",
+ "R = 287;\n",
+ "m = p1*V1/R/T1;\n",
+ "W = m*R*(T1-T2)/(y-1)/10**3;\n",
+ "print (\"W = %.3f\")%(W),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Final temperature\n",
+ "t2 = 234.253 \u00b0C\n",
+ "(ii) Final volume :\n",
+ "V2 = 0.004 m**3\n",
+ "(iii)Work done\n",
+ "W = -2.752 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.29 page no : 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate c p and c v .\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "m = 0.44; \t\t\t#kg\n",
+ "T1 = 453.; \t\t\t#K\n",
+ "ratio = 3.; \t\t#ratio = V2/V1\n",
+ "T2 = 288.; \t\t\t#K\n",
+ "W_12 = 52.5; \t\t#kJ\n",
+ "\n",
+ "# Calculations\n",
+ "y = math.log(T2/T1)/ math.log(1/ratio) + 1;\n",
+ "R = W_12*(y-1)/m/(T1-T2);\n",
+ "M = [[1,-1],[1,-y]];\n",
+ "N = [R,0];\n",
+ "X = linalg.inv(M)*N;\n",
+ "cp = X[0][0];\n",
+ "cv = X[1][0];\n",
+ "\n",
+ "# Results\n",
+ "print (\"cp = %.3f\")%(cp),(\"kJ/kg.K\")\n",
+ "\n",
+ "print (\"cv = %.3f\")%(cv),(\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cp = 1.021 kJ/kg.K\n",
+ "cv = 0.723 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.30 page no : 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the heat flow to or from the cylinder walls.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "n = 1.3;\n",
+ "m = 1; \t\t\t#kg\n",
+ "p1 = 1.1; \t\t\t#bar\n",
+ "T1 = 300.; \t\t\t#K\n",
+ "p2 = 6.6; \t\t\t#bar\n",
+ "R0 = 8314.;\n",
+ "M = 30.;\n",
+ "cp = 1.75; \t\t\t#kJ/kg.K\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "R = R0/M/1000; \t\t\t#kJ/kg.K\n",
+ "cv = cp - R;\n",
+ "y = cp/cv;\n",
+ "T2 = T1 *(p2/p1)**((n-1)/n);\n",
+ "W = R*(T1-T2)/(n-1);\n",
+ "Q = ((y-n)/(y-1))*W;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat supplied = %.3f\")%(Q),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat supplied = 84.352 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.31 page no : 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) Pressure at the end of constant volume cooling.\n",
+ "(ii) Change in internal energy during constant volume process.\n",
+ "(iii) Net work done and heat transferred during the cycle. Assume\n",
+ "'''\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "cp = 14.3; \t\t\t#kJ/kg.K\n",
+ "cv = 10.2; \t\t\t#kJ/kg.K\n",
+ "V1 = 0.1; \t\t\t#m**3\n",
+ "T1 = 300.; \t\t\t#K\n",
+ "p1 = 1.; \t\t\t#bar\n",
+ "p2 = 8.; \t\t\t#bar\n",
+ "y = cp/cv;\n",
+ "R = cp-cv;\n",
+ "V2 = V1*(p1/p2)**(1/y);\n",
+ "V3 = V2;\n",
+ "T2 = T1*(p2/p1)**((y-1)/y);\n",
+ "p3 = p1*V1/V3;\n",
+ "T3 = 300.; \t\t\t#K\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Pressure at the end of consmath.tant volume cooling = %.3f\")%(p3),(\"bar\")\n",
+ "\n",
+ "print (\"(ii) Change in internal energy during consmath.tant volume process\")\n",
+ "m = p1*V1/R/T1*10**2; \t\t\t#kg\n",
+ "\n",
+ "dU_23 = m*cv*(T3-T2);\n",
+ "print (\"dU_23 = %.3f\")%(dU_23),(\"kJ\")\n",
+ "\n",
+ "print (\"(iii) Net work done and heat transferred during the cycle\")\n",
+ "W_12 = m*R*(T1-T2)/(y-1);\n",
+ "W_23 = 0;\n",
+ "W_31 = p3*V3*math.log(V1/V3)*10**2; \t\t\t#kJ\n",
+ "Wnet = W_12+W_23+W_31;\n",
+ "print (\"Net work done = %.3f\")%(Wnet),(\"kJ\")\n",
+ "Qnet = Wnet;\n",
+ "print (\"Heat transferred during the complete cycle = %.3f\")%(Qnet),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure at the end of consmath.tant volume cooling = 4.407 bar\n",
+ "(ii) Change in internal energy during consmath.tant volume process\n",
+ "dU_23 = -20.281 kJ\n",
+ "(iii) Net work done and heat transferred during the cycle\n",
+ "Net work done = -5.449 kJ\n",
+ "Heat transferred during the complete cycle = -5.449 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.32 page no : 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the net work done and heat transferred during the cycle.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.15; \t\t\t#m**3\n",
+ "p1 = 15.; \t\t\t#bar\n",
+ "T1 = 550.; \t\t\t#K\n",
+ "T2 = T1;\n",
+ "r = 4.; \t\t\t#r = V2/V1\n",
+ "V2 = r*V1;\n",
+ "T3 = 290.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "p2 = p1*V1/V2;\n",
+ "W_12 = p1*V1*math.log(V2/V1)*10**2; \t\t\t#kJ\n",
+ "V3 = V2;\n",
+ "p3 = p2*T3/T2;\n",
+ "W_23 = 0;\n",
+ "n = math.log(p1/p3)/math.log(V3/V1);\n",
+ "W_31 = (p3*V3-p1*V1)/(n-1)*10**2; \t\t\t#kJ\n",
+ "\n",
+ "# Results\n",
+ "\n",
+ "Wnet = W_12+W_23+W_31\n",
+ "print (\"net work done = %.3f\")%Wnet , (\"kJ\")\n",
+ "\n",
+ "Qnet = Wnet;\n",
+ "print (\"Heat transferred during the cycle = %.3f\")%(Qnet),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "net work done = 81.537 kJ\n",
+ "Heat transferred during the cycle = 81.537 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.33 page no : 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Sketch the cycle on p-V diagram.\n",
+ "(ii) Calculate the work done in each process starting whether it is done on or by the system\n",
+ "and evaluate the net cyclic work and heat transfer.\n",
+ "'''\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "from matplotlib.pyplot import *\n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "m = 1; \t\t\t#kg\n",
+ "p1 = 5; \t\t\t#bar\n",
+ "V1 = 0.02; \t\t\t#m**3\n",
+ "V2 = 0.08; \t\t\t#m**3\n",
+ "p2 = 1.5; \t\t\t#bar\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "def f(V):\n",
+ " return a+b*V;\n",
+ "\n",
+ "A = [[1,0.02],[1,0.08]]\n",
+ "B = [5,1.5];\n",
+ "#X = linalg.inv(A)*B;\n",
+ "X = linalg.solve(A,B)\n",
+ "a = X[0]\n",
+ "b = X[1]\n",
+ "\n",
+ "print (\"(i) p-V diagram\")\n",
+ "\n",
+ "V = linspace(0.02,0.08,80);\n",
+ "p = a+b*V;\n",
+ "plot(V,p,'b')\n",
+ "\n",
+ "V = [0.0667 ,0.08];\n",
+ "p = [1.5 ,1.5];\n",
+ "plot(V,p,'g')\n",
+ "\n",
+ "V = linspace(0.02,0.0667,447)\n",
+ "def fa(V):\n",
+ " return 0.1/V;\n",
+ "f = fa(V)\n",
+ "plot(V,f,'r')\n",
+ "suptitle(\"p-V diagram\")\n",
+ "\n",
+ "V = [0.0667, 0.0667];\n",
+ "p = [1.5, 0];\n",
+ "plot(V,p,'--')\n",
+ "xlabel(\"V(m)**3\")\n",
+ "ylabel(\"P(bar)\")\n",
+ "text(.04,4,'Reversible Expansion')\n",
+ "text(0.04,2.3,\"pV = C\")\n",
+ "text(0.07,1.2,\"p = C\")\n",
+ "\n",
+ "print (\"(ii) Work done and heat transfer\")\n",
+ "\n",
+ "\n",
+ "def f7(V): \n",
+ "\t return (a+b*V)*10**2\n",
+ "\n",
+ "W_12 = quad(f7,V1,V2)[0]\n",
+ "\n",
+ "print (\"Work done by the system = \"),(W_12), (\"kJ\")\n",
+ "\n",
+ "p3 = p2;\n",
+ "V3 = round(p1*V1/p3,4);\n",
+ "W_23 = p2*(V3-V2)*10**2; \t\t\t#kJ\n",
+ "\n",
+ "W_31 = round(p3*V3*math.log(V1/V3)*10**2,2); \t\t\t#kJ\n",
+ "print (\"Work done on the system = %.3f\")% (W_31), (\"kJ\")\n",
+ "\n",
+ "W_net = W_12+W_23+W_31;\n",
+ "print (\"Net work done = %.3f\")% (W_net), (\"kJ\")\n",
+ "\n",
+ "Q_net = W_net;\n",
+ "print (\"Heat transferred during the complete cycle = %.3f\")% (Q_net),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "(i) p-V diagram"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(ii) Work done and heat transfer"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Work done by the system = 19.5 kJ\n",
+ "Work done on the system = -12.050 kJ\n",
+ "Net work done = 5.455 kJ\n",
+ "Heat transferred during the complete cycle = 5.455 kJ\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEhCAYAAACXwKDgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYVNX6B/DvAJoX1ATvlxwzQIEBRhBFCaG0vJGaKGFp\nZmqWdEHNS+ZBs/KG59hRT1iW2qmOmubxkpqmB7VEUQFFTVFzTNT8eUURUYH1+2M1E1cFZvZcv5/n\nmSc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iMGTMGfn5+GD16tNl/HkQPwmEfshtubm4IDg7Gpk2bAMiyvdHR0bh06RKc\nnZ1Rq1Ytw7ZHjx7F2rVrsX//fkyZMgX169fHgQMHEB4ejmXLlhm202q1SE5OxqFDh5CYmIghQ4bg\nmWeewdSpU8t8T++VV15B06ZNcfjwYYwYMcJsPwOiimLwJ7sSExODFStWAABWrlyJmJgY6HQ6NG3a\n1LCNSqVCREQEatSogQYNGuDRRx9Fr169AAAajaZYxcRmzZpBp9PB398f8+fPh5ubG/r27YsZM2aU\n+Z7e0qVLceHCBfj5+eGjjz4y09ETVRyDP9mV5557Dtu3b0daWhpyc3Oh1WoBlK5//sgjjxj+7eTk\nZPjayckJhYWFhu8JIYrVWI+Pjy/VZlnv6ff1wgsvWOU6uEQM/mRXXF1dERERgVdeecWwUlOrVq3w\nxx9/GLZ50DRXye9dvHgRarW6Un3Q6XSGfa1fvx4ajaZSnycyBwZ/sjsxMTHIyMgwrEXbpEkTw5qm\ngBz2KXo1X/LfRb9OS0tDSEhIhdsWQmDw4MGGVM+LFy+We2dAZEnM9iGHMG3aNLRr1w7R0dEV/kxm\nZibGjx+P9evXK9gzIsvglT85hDFjxmD58uWV+kxiYiImTJigUI+ILItX/kREDohX/kREDojBn4jI\nATH4ExE5IAZ/IiIHxOBPROSAGPyJiBzQ/wNTN0khb0PDfQAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x1dbbbd0>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.34 page no : 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine theamount of heat added to the system so that piston moves by 3.5 cm.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "cv = 0.71; \t\t\t#kJ/kg.K\n",
+ "R = 0.287; \t\t\t#kJ/kg.K\n",
+ "d = 8.; \t\t\t#cm\n",
+ "l = 3.5; \t\t\t#cm\n",
+ "S = 150.; \t\t\t#N/cm\n",
+ "p1 = 30.; \t\t\t#N/cm\n",
+ "V1 = 45.; \t\t\t#cm**3\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "cv = 0.71; \t\t\t#kJ/kg.K\n",
+ "R = 0.287; \t\t\t#kJ/kg.K\n",
+ "\n",
+ "# Calculations\n",
+ "A = math.pi/4*d**2;\n",
+ "C = p1-S/A**2*V1;\n",
+ "dV = l*A;\n",
+ "V2 = V1+dV;\n",
+ "p2 = S/A**2*V2 + C;\n",
+ "\n",
+ "def f3( p): \n",
+ "\t return A**2/S*p/100\n",
+ "\n",
+ "W = quad(f3, p1, p2)[0]\n",
+ "\n",
+ "T2 = p2*V2*T1/p1/V1;\n",
+ "m = p1*V1/R/T1/10**5; \t\t\t#kg\n",
+ "dU = m*cv*(T2-T1);\n",
+ "Q_12 = dU + W*10**(-3);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Amount of heat added to the system = %.3f\")% (Q_12), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of heat added to the system = 0.250 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.35 page no : 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The change in enthalpy (\u2206 h) ;\n",
+ "(ii) Work done during the process (W).\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "r = 10.; \t\t\t#kg/min\n",
+ "p1 = 1.5*10**5; \t\t\t#N/m**2\n",
+ "rho1 = 26.; \t\t\t#kg/m**3\n",
+ "C1 = 110.; \t\t\t#m/s\n",
+ "u1 = 910.; \t\t\t#kJ/kg\n",
+ "p2 = 5.5*10**5; \t\t\t#N/m**2\n",
+ "rho2 = 5.5; \t\t\t#kg/m**3\n",
+ "C2 = 190.; \t\t\t#m/s\n",
+ "u2 = 710.; \t\t\t#kJ/kg\n",
+ "Q = 55.; \t\t\t#kJ/s\n",
+ "h = 55.; \t\t\t#m\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "v2 = 1/rho2;\n",
+ "v1 = 1/rho1;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\n",
+ "dh = u2-u1+ (p2*v2-p1*v1)/10**3;\n",
+ "print (\"(i) Change in enthalpy %.3f\")%(dh), (\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) Work done during the process (W).\")\n",
+ "\n",
+ "Q = 330.; \t\t\t#kJ/kg\n",
+ "KE = (C2**2-C1**2)/2/10**3; \t\t\t#kJ\n",
+ "PE = g*h/10**3; \t\t\t#kJ\n",
+ "W = -Q-KE-PE-dh;\n",
+ "print (\"Work done = %.3f\")%(W),(\"kJ\")\n",
+ "\n",
+ "\n",
+ "P = W*10/60.;\n",
+ "print (\"Work done per second = %.3f\")%(P),(\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Change in enthalpy -105.769 kJ/kg\n",
+ "(ii) Work done during the process (W).\n",
+ "Work done = -236.770 kJ\n",
+ "Work done per second = -39.462 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.36 page no : 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The rate at which heat is rejected to the turbine, and\n",
+ "(ii) The area of the inlet pipe given that the specific volume of the gases at the inlet is\n",
+ "0.45 m 3 /kg.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "m = 15.; \t\t\t#kg/s\n",
+ "v = 0.45; \t\t\t#m**3/kg\n",
+ "P = 12000.; \t\t#kW\n",
+ "W = P/m; \t\t\t#kJ/kg\n",
+ "h1 = 1260.; \t\t#kJ/kg\n",
+ "h2 = 400.; \t\t\t#kJ/kg\n",
+ "C1 = 50.; \t\t\t#m/s\n",
+ "C2 = 110.; \t\t\t#m/s\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Heat rejected = \"),\n",
+ "Q = h2-h1+(C2**2-C1**2)/2/10**3 +W;\n",
+ "Qnet = m*Q;\n",
+ "print (\"Qnet = %.3f\")%(-Qnet),(\"kW\")\n",
+ "\n",
+ "print (\"(ii) Inlet area\")\n",
+ "A = v*m/C1;\n",
+ "print (\"A = %.3f\")%(A),(\"m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Heat rejected = Qnet = 828.000 kW\n",
+ "(ii) Inlet area\n",
+ "A = 0.135 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.37 page no : 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The power required to drive the compressor ;\n",
+ "(ii) The inlet and output pipe cross-sectional areas.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 0.5; \t\t\t#kg/s\n",
+ "C1 = 6.; \t\t\t#m/s\n",
+ "C2 = 5.; \t\t\t#m/s\n",
+ "p1 = 1.; \t\t\t#bar\n",
+ "p2 = 7.; \t\t\t#bar\n",
+ "v1 = 0.85; \t\t\t#m**3/kg\n",
+ "v2 = 0.16; \t\t\t#m**3/kg\n",
+ "du = 90.; \t\t\t#kJ/kg\n",
+ "Q = -120.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Power required to drive the compressor\")\n",
+ "W = -du+(C1**2-C2**2)/2/1000 + (p1*v1 - p2*v2)*10**2 + Q;\n",
+ "Power = m*W; \n",
+ "print (\"Power = %.3f\")%(-Power),(\"kW\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Inlet and outlet pipe cross-sectional areas\")\n",
+ "A1 = m*v1/C1;\n",
+ "A2 = m*v2/C2;\n",
+ "print (\"Inlet crosssectional area = %.3f\")% (A1), (\"m**2\")\n",
+ "\n",
+ "print (\"Outlet crossectional area = %.3f\")%(A2), (\"m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Power required to drive the compressor\n",
+ "Power = 118.497 kW\n",
+ "(ii) Inlet and outlet pipe cross-sectional areas\n",
+ "Inlet crosssectional area = 0.071 m**2\n",
+ "Outlet crossectional area = 0.016 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.38 page no : 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the power developed by the turbine. Consider the boiler and turbine as single system\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "h1 = 800.; \t\t\t#kJ/kg\n",
+ "C1 = 5.; \t\t\t#m/s\n",
+ "h2 = 2520.; \t\t\t#kJ/kg\n",
+ "C2 = 50.; \t\t\t#m/s\n",
+ "dZ = 4.; \t\t\t#m\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "Q = 2180.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "W = h1-h2+(C1**2 - C2**2)/2/1000 +dZ*g/1000+Q;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Power developed = %.3f\")%(W), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power developed = 458.802 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.39 page no : 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the power output of the turbine.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "g = 9.8; \t\t\t#m/s**2\n",
+ "m = 4500./3600; \t#kg/s\n",
+ "C1 = 2800./60; \t\t#m/s\n",
+ "Z1 = 5.5; \t\t\t#m\n",
+ "h1 = 2800.; \t\t#kJ/g\n",
+ "C2 = 5600./60; \t\t#m/s\n",
+ "Z2 = 1.5; \t\t\t#m\n",
+ "h2 = 2300.; \t\t#kJ/kg\n",
+ "Q = -16000./3600; \t#kJ/s\n",
+ "\n",
+ "# Calculations\n",
+ "W = Q-m*((h1-h2) + (C2**2 - C1**2)/2/1000 + (Z2-Z1)*g/1000);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Power output of the turbine = %.3f\")% (-W),(\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power output of the turbine = 633.479 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.40 page no : 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the final enthalpy of steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 6.87; \t\t\t#bar\n",
+ "C1 = 50.; \t\t\t#m/s\n",
+ "p2 = 1.37; \t\t\t#bar\n",
+ "C2 = 500.; \t\t\t#m/s\n",
+ "print (\"From steam table corresponding to p1\")\n",
+ "h1 = 2850.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "h2 = h1 - (C2**2-C1**2)/2/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Final enthalpy of steam = \"), (h2),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam table corresponding to p1\n",
+ "Final enthalpy of steam = 2726.25 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.41 page no : 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the power capacity of the system in MW.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 220./60; \t\t\t#kg/s\n",
+ "C1 = 320.; \t\t\t#m/s\n",
+ "p1 = 6*10.**5; \t\t\t#N/m**2\n",
+ "u1 = 2000.*10**3; \t\t\t#J/kg\n",
+ "v1 = 0.36; \t\t\t#m**3/kg\n",
+ "C2 = 140.; \t\t\t#m/s\n",
+ "p2 = 1.2*10**5; \t\t\t#N/m**2\n",
+ "u2 = 1400.*10**3; \t\t\t#J/kg\n",
+ "v2 = 1.3; \t\t\t#m**3/kg\n",
+ "Q = 100*10.**3; \t\t\t#J/s\n",
+ "\n",
+ "# Calculations\n",
+ "W = (m*((u1-u2)+ (p1*v1 - p2*v2) + (C1**2-C2**2)/2) -Q)/10**6;\n",
+ "\n",
+ "# Results\n",
+ "print (\"power capacity of the system = %.3f\")% (W),(\"MW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power capacity of the system = 2.472 MW\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.42 page no : 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the capacity of the turbine if the gas flow is 5 kg/s.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 7.5*10**5; \t\t\t#N/m**2\n",
+ "C1 = 140.; \t\t\t#m/s\n",
+ "h1 = 950.*10**3; \t\t\t#J/kg\n",
+ "p2 = 2*10.**5; \t\t\t#N/m**2\n",
+ "C2 = 280.; \t\t\t#m/s\n",
+ "h2 = 650.*10**3; \t\t\t#J/kg\n",
+ "m = 5.; \t\t\t#kg/s\n",
+ "\n",
+ "# Calculations\n",
+ "W = (h1-h2)+(C1**2-C2**2)/2\n",
+ "Power = m*W/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Power capacity of turbine = \"), (Power), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power capacity of turbine = 1353.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.43 page no : 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find : (i) Motor power required to drive the compressor ;\n",
+ "(ii) Ratio of inlet to outlet pipe diameter.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "C1 = 12.; \t\t\t#m/s\n",
+ "p1 = 1.*10**5; \t\t\t#N/m**2\n",
+ "v1 = 0.5; \t\t\t#m**3/kg\n",
+ "C2 = 90.; \t\t\t#m/s\n",
+ "p2 = 8.*10**5; \t\t\t#N/m**2\n",
+ "v2 = 0.14; \t\t\t#m**3/kg\n",
+ "dh = 150.; \t\t\t#kJ/kg\n",
+ "Q = -11.67; \t\t\t#kJ/s\n",
+ "m = 0.2; \t\t\t#kg/s\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Motor power required to drive the compressor\")\n",
+ "W = m*(-dh + (C1**2-C2**2)/2/1000) +Q;\n",
+ "print (\"Power = %.3f\")% (-W), (\"kW\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii)Ratio of inlet to outlet pipi diameter\")\n",
+ "ratio = math.sqrt(C2/C1*v1/v2);\n",
+ "print (\"ratio = %.3f\")% (ratio)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Motor power required to drive the compressor\n",
+ "Power = 42.466 kW\n",
+ "(ii)Ratio of inlet to outlet pipi diameter\n",
+ "ratio = 5.175\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.44 page no : 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Compute the amount of heat transfer to the atmosphere from the compressor per kg of air.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "W = -175.; \t\t\t #kJ/kg\n",
+ "dh = 70.; \t\t \t#kJ/kg\n",
+ "Q_water = -92.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "Q = dh+W;\n",
+ "Q_atm = Q-Q_water;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Heat transferred to the atmosphere = \"),(-Q_atm), (\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transferred to the atmosphere = 13.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.45 page no : 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "'''\n",
+ "(i) Find the velocity at exit of the nozzle.\n",
+ "(ii) If the inlet area is 900 cm 2 and the specific volume at inlet is 0.187 m 3 /kg, find the mass\n",
+ "flow rate.\n",
+ "(iii) If the specific volume at the nozzle exit is 0.498 m 3 /kg, find the exit area of nozzle.\n",
+ "'''\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "h1 = 2800.*10**3; \t\t\t#J/kg\n",
+ "C1 = 50.; \t\t\t#m/s\n",
+ "A1 = 900.*10**(-4); \t\t\t#m**2\n",
+ "v1 = 0.187; \t\t\t#m**3/kg\n",
+ "h2 = 2600.*10**3; \t\t\t#J/kg\n",
+ "v2 = 0.498; \t\t\t#m**3/kJ\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Velocity at exit of the nozzle\")\n",
+ "C2 = math.sqrt(2*((h1-h2) + C1**2/2));\n",
+ "\n",
+ "print (\"C2 = %.3f\")% (C2),(\"m/s\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Mass flow rate\")\n",
+ "m = A1*C1/v1;\n",
+ "print (\"m = %.3f\")% (m), (\"kg/s\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) Area at the exit\")\n",
+ "A2 = m*v2/C2*10**4;\n",
+ "print (\"A2 = %.3f\")%(A2), (\"cm**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Velocity at exit of the nozzle\n",
+ "C2 = 634.429 m/s\n",
+ "(ii) Mass flow rate\n",
+ "m = 24.064 kg/s\n",
+ "(iii) Area at the exit\n",
+ "A2 = 188.894 cm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.46 page no : 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "evaluate the heat transfer from the water per kg of water flowing.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "h1 = 240.; \t\t\t#kJ/kg\n",
+ "h2 = 192.; \t\t\t#kJ/kg\n",
+ "dZ = 20.; \t\t\t#m\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "\n",
+ "# Calculations\n",
+ "Q = (h2-h1)+dZ*g/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"heat transfer = %.3f\")% (-Q), (\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat transfer = 47.804 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.47 page no : 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "evaluate the relative velocity of gas leaving the jet pipe. For the gas at t = 820\u00b0C, h = 800 kJ/kg and at 910\u00b0C, 915 kJ/kg.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 2.; \t\t\t#bar\n",
+ "C1 = 300.; \t\t\t#m/s\n",
+ "Q = 0.;\n",
+ "h1 = 915.*10**3; \t\t\t#J/kg\n",
+ "h2 = 800.*10**3; \t\t\t#J/kg\n",
+ "\n",
+ "# Calculations\n",
+ "C2 = math.sqrt(2*(h1-h2 + C1**2/2));\n",
+ "\n",
+ "# Results\n",
+ "print (\"Relative velocity of gas leaving the pipe = %.3f\")% (C2), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative velocity of gas leaving the pipe = 565.685 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.48 page no : 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the capacity of the electric motor to run the pump.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "mw = 50; \t\t\t#kg/s\n",
+ "p1 = 10.**5; \t\t\t#N/m**2\n",
+ "p2 = 4.2*10**5; \t\t\t#N/m**2\n",
+ "h = 10.7; \t\t\t#m\n",
+ "d1 = 0.2; \t\t\t#m\n",
+ "d2 = 0.1; \t\t\t#m\n",
+ "v1 = 1./1000;\n",
+ "v2 = 1./1000;\n",
+ "g = 9.81; \t\t\t#m/s**2\n",
+ "\n",
+ "# Calculations\n",
+ "C1 = mw*4/math.pi/d1**2*v1;\n",
+ "C2 = mw*4/math.pi/d2**2*v2;\n",
+ "W = mw*((p1*v1-p2*v2) + (g*(0-h))+(C1**2-C2**2)/2)/10**3;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Capacity of electric motor %.3f\")%(-W), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacity of electric motor 22.198 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 4.49 page no : 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the velocity of the exhaust jet.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Ca = 250.; \t\t\t#m/s\n",
+ "t = -14.; \t\t\t#0C\n",
+ "ha = 250.; \t\t\t#kJ/kg\n",
+ "hg = 900.; \t\t\t#kJ/kg\n",
+ "ratio = 0.0180;\n",
+ "Ef = 45.*10**3; \t\t\t#kJ/kg\n",
+ "Q = -21.; \t\t\t#kJ/kg\n",
+ "ma = 1.; \t\t\t#kg\n",
+ "mg = 1.018; \t\t\t#kg\n",
+ "mf = 0.018; \t\t\t#kg\n",
+ "\n",
+ "#Calculations\n",
+ "Eg = 0.06*mf/mg*Ef;\n",
+ "Cg = math.sqrt(2000*((ma*(ha+Ca**2/2/1000) + mf*Ef + Q)/mg -hg-Eg));\n",
+ "\n",
+ "# Results\n",
+ "print (\"velocity of exhaust gas jet = %.3f\")%(Cg),(\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity of exhaust gas jet = 455.160 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.50 page no : 181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate :\n",
+ "(i) Rate of heat transfer to the air in the heat exchanger ;\n",
+ "(ii) The power output from the turbine assuming no heat loss ;\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "t1 = 20.; \t\t\t#0C\n",
+ "C1 = 40.; \t\t\t#m/s\n",
+ "t2 = 820.; \t\t\t#0C\n",
+ "C2 = 40.; \t\t\t#m/s\n",
+ "t3 = 620.; \t\t\t#0C\n",
+ "C3 = 55.; \t\t\t#m/s\n",
+ "t4 = 510.; \t\t\t#0C\n",
+ "m = 2.5; \t\t\t#kg/s\n",
+ "cp = 1.005; \t\t\t#kJ/kg.0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Heat exchanger\")\n",
+ "Q_12 = m*cp*(t2-t1);\n",
+ "print (\"rate of heat transfer = \"),(Q_12), (\"kJ/s\")\n",
+ "\n",
+ "print (\"(ii) Turbine\")\n",
+ "W_23 = m*((cp*(t2-t3))+(C2**2-C3**2)/2/1000);\n",
+ "print (\"Power output of turbine = %.3f\")%(W_23), (\"kW\")\n",
+ "\n",
+ "print (\"(iii) Nozzle\")\n",
+ "C4 = math.sqrt(2*1000*(cp*(t3-t4)+C3**2/2/1000));\n",
+ "print (\"Velocity at exit from the nozzle = %.3f\")%(C4), (\"m/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Heat exchanger\n",
+ "rate of heat transfer = 2010.0 kJ/s\n",
+ "(ii) Turbine\n",
+ "Power output of turbine = 500.719 kW\n",
+ "(iii) Nozzle\n",
+ "Velocity at exit from the nozzle = 473.418 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.51 page no : 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The state of steam after cooling ;\n",
+ "(ii) The amount of heat rejected by the steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.028; \t\t\t#m**3\n",
+ "p1 = 80.; \t\t\t#bar\n",
+ "t = 350.; \t\t\t#0C\n",
+ "p2 = 50.; \t\t\t#bar\n",
+ "v1 = 0.02995; \t\t\t#m**3/kg\n",
+ "h1 = 2987.3; \t\t\t#kJ/kg\n",
+ "v2 = 0.02995; \t\t\t#m**3/kg\n",
+ "vg2 = 0.0394; \t\t\t#m**3/kg\n",
+ "uf2 = 1149.; \t\t\t#kJ/kg\n",
+ "ug2 = 2597.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m = V/v1;\n",
+ "u1 = h1 - (p1*v1*10**2); \t\t\t#kJ/kg\n",
+ "\n",
+ "print (\"(i) State of steam after cooling\")\n",
+ "x2 = v2/vg2;\n",
+ "print (\"dryness fraction = %.3f\")%(x2)\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Heat rejected by the steam\")\n",
+ "u2 = (1-x2)*uf2 + x2*ug2;\n",
+ "Q = m*(u2-u1);\n",
+ "print (\"Heat rejected = %.3f\")% (-Q), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) State of steam after cooling\n",
+ "dryness fraction = 0.760\n",
+ "(ii) Heat rejected by the steam\n",
+ "Heat rejected = 465.575 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.52 page no : 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) Heat supplied ;\n",
+ "(ii) Work done\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 0.08; \t\t\t#kg\n",
+ "p = 2.*10**5; \t\t\t#Pa\n",
+ "V = 0.10528; \t\t\t#m**3\n",
+ "h1 = 2706.3; \t\t\t#kJ/kg\n",
+ "h2 = 3071.8; \t\t\t#kJ/kg\n",
+ "v1 = 0.885; \t\t\t#m**3/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "v2 = V/m; \t\t\t#m**3/kg\n",
+ "\n",
+ "print (\"(i) Heat supplied\")\n",
+ "Q = m*(h2-h1);\n",
+ "print (\"Q = \"),(Q), (\"kJ\")\n",
+ "\n",
+ "\n",
+ "W = p*(v2-v1);\n",
+ "W_total = m*W/10**3;\n",
+ "print (\"(ii)Total work done = \"), (W_total), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Heat supplied\n",
+ "Q = 29.24 kJ\n",
+ "(ii)Total work done = 6.896 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.53 page no : 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the heat supplied, and show on a T-s diagram the area which represents the heat flow.\n",
+ "'''\n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p = 8.; \t\t\t#bar\n",
+ "s1 = 6.55; \t\t\t#kJ/kg.K\n",
+ "T = 200.; \t\t\t#0C\n",
+ "s_f1 = 2.0457; \t\t\t#kJ/kg.K\n",
+ "s_fg1 = 4.6139; \t\t\t#kJ/kg.K\n",
+ "h_f1 = 720.9; \t\t\t#kJ/kg\n",
+ "h_fg1 = 2046.5; \t\t\t#kJ/kg\n",
+ "h2 = 2839.3; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x1 = (s1-s_f1)/s_fg1;\n",
+ "h1 = h_f1+x1*h_fg1;\n",
+ "Q = h2-h1;\n",
+ "print (\"Heat supplied = %.3f\")%(Q), (\"kJ/kg\")\n",
+ "\n",
+ "# For T-s diagram\n",
+ "\n",
+ "s = linspace(0,.10,10);\n",
+ "T = (-(s-5)**2+298);\n",
+ "plot(s,T)\n",
+ "\n",
+ "T = [295.44 ,295.44];\n",
+ "s = [6.6 ,3.45];\n",
+ "plot(s,T,'g')\n",
+ "\n",
+ "s = [6.6 ,7];\n",
+ "T = [295.44, 300];\n",
+ "plot(s,T,'g')\n",
+ "\n",
+ "s = [6.55 ,6.55];\n",
+ "T = [270 ,295.44];\n",
+ "plot(s,T,'r')\n",
+ "\n",
+ "s = [6.6, 6.6];\n",
+ "T = [270 ,295.44];\n",
+ "plot(s,T,'--r')\n",
+ "\n",
+ "s = [6.66, 6.66];\n",
+ "T = [270, 295.44];\n",
+ "plot(s,T,'r')\n",
+ "\n",
+ "\t\t\t#The area in red represents the heat flow and it goes upto x-axis\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat supplied = 120.513 kJ/kg\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 50,
+ "text": [
+ "[<matplotlib.lines.Line2D at 0x3e9d150>]"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAD9CAYAAABDaefJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGRdJREFUeJzt3XtQVHee9/FPM5BdDUadioKC9RBBIg2DtBfUlE6aicZY\nUQIFMcEoJuKkjFoWSayxsjUbr6tmRs3gjNZqKjqZdSuglY2YxBh0FUWTDGbo5HEgG3nWJtPgJTEz\nOOCtEc7zh5teGRUa7At95v2q6iq6+5zz+56U+XD8nd/5ajEMwxAAwBTCgl0AAMB3CHUAMBFCHQBM\nhFAHABMh1AHARAh1ADCRDkP96tWrGjt2rNLS0mS1WvXKK69Ikv785z9r8uTJSkxM1KOPPqrGxkbP\nPmvXrtWwYcM0fPhwlZWV+bd6AEA7ls7WqV++fFm9e/fW9evXNWHCBK1fv1579+7V/fffr5/97Gd6\n7bXX9Je//EXr1q1TTU2NZs6cqRMnTqihoUGTJk3SqVOnFBbGXwgAIBA6TdvevXtLktxut1pbW9W/\nf3/t3btXc+bMkSTNmTNHe/bskSSVlpYqLy9PERERiouLU0JCgiorK/1YPgDgZp2Geltbm9LS0hQV\nFaWMjAwlJyfr/PnzioqKkiRFRUXp/PnzkqQzZ84oNjbWs29sbKwaGhr8VDoA4G+Fd7ZBWFiYPv/8\nc128eFFTpkzR4cOH231vsVhksVjuuP/tvutoewDAnXXW2cXrye6+ffvq8ccf1x/+8AdFRUXp3Llz\nkqSzZ89q4MCBkqSYmBi5XC7PPvX19YqJibljYaH6WrZsWdBr+HusnfqD/6L+wL++vfSt7v/F/ar5\npsarrO4w1C9cuOBZ2XLlyhUdOHBANptNmZmZeuuttyRJb731lrKysiRJmZmZKi4ultvtltPpVG1t\nr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XLampqkiRdunRJZWVl\n+tGPfhTkqrwTHR2tIUOG6NSpU5JuzEsnJycHuaque/vtt29ZRn47nT5R6ivh4eH6zW9+oylTpqi1\ntVUFBQVKSkoK1PA+kZeXpyNHjui7777TkCFDtHLlSj333HPBLssrHT1zEArOnj2rOXPmqK2tTW1t\nbZo9e7YeeeSRYJfVbaE2HXn+/HllZ2dLujGd8cwzz+jRRx8NclXe+/Wvf61nnnlGbrdb8fHx2rFj\nR7BL6pJLly7p4MGDXt3LCMo/kgEA8I/QvA0PALgtQh0ATIRQBwATIdQBwEQIdQAwEUIdAEzk/wOv\n7sf4EZKFzwAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x319ff90>"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.54 page no : 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate per kg :\n",
+ "(i) The change of internal energy ;\n",
+ "(ii) The change of enthalpy ;\n",
+ "(iii) The work done.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 7.*10**5; \t\t\t#Pa\n",
+ "p2 = 1.5*10**5; \t\t\t#Pa\n",
+ "Q = 420.; \t\t\t#kJ/kg\n",
+ "uf = 696.; \t\t\t#kJ/kg\n",
+ "x = 0.95;\n",
+ "ug = 2573.; \t\t\t#kJ/kg\n",
+ "u_f2 = 2580.; \t\t\t#kJ/kg\n",
+ "u_g2 = 2856.; \t\t\t#kJ/kg\n",
+ "x2 = 15./50;\n",
+ "h_f1 = 697.1; \t\t\t#kJ/kg\n",
+ "h_fg1 = 2064.9; \t\t\t#kJ.kg\n",
+ "h_f2 = 2772.6; \t\t\t#kJ/kg\n",
+ "h_g2 = 2872.9; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Change of internal energy\")\n",
+ "u1 = (1-x)*uf + x*ug;\n",
+ "u2 = 2602.8; \t\t\t#kJ/kg\n",
+ "du = u2-u1;\n",
+ "print (\"du = \"),(du), (\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) Change in enthalpy\")\n",
+ "h1 = h_f1+x*h_fg1;\n",
+ "h2 = h_f2+x2*(h_g2-h_f2);\n",
+ "dh = h2-h1;\n",
+ "print (\"dh = \"), (dh), (\"kJ/kg\")\n",
+ "\n",
+ "print (\"(iii) Work done \")\n",
+ "W = Q-du;\n",
+ "print (\"W = \"), (W), (\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Change of internal energy\n",
+ "du = 123.65 kJ/kg\n",
+ "(ii) Change in enthalpy\n",
+ "dh = 143.935 kJ/kg\n",
+ "(iii) Work done \n",
+ "W = 296.35 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.55 page no : 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate per kg of steam :\n",
+ "(i) Work done ;\n",
+ "(ii) Heat flow to or from the cylinder walls.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "\n",
+ "p1 = 5.5*10**5; \t\t\t#Pa\n",
+ "x1 = 1.;\n",
+ "p2 = 0.75*10**5; \t\t\t#Pa\n",
+ "v1 = 0.3427; \t\t\t#m**3/kg\n",
+ "v2 = p1*v1/p2;\n",
+ "\n",
+ "# Since v2 > vg (at 0.75 bar), therefore, the steam is superheated at state 2.\n",
+ "u2 = 2567.25; \t\t\t#kJ/kg\n",
+ "u1 = 2565.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "du = u2-u1; \t\t\t#kJ/kg\n",
+ "C = p1*v1;\n",
+ "\n",
+ "print (\"Work done \"),\n",
+ "\n",
+ "def f6( v): \n",
+ "\t return C/v\n",
+ "\n",
+ "W = quad(f6, v1,v2)[0]\n",
+ "\n",
+ "print (\"W =\"),(W), (\"N-m/kg\")\n",
+ "\n",
+ "\n",
+ "\n",
+ "Q = du+W/10**3;\n",
+ "\n",
+ "print (\"Heat supplied = %.3f\")%(Q),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done W = 375543.199592 N-m/kg\n",
+ "Heat supplied = 377.793 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.56 page no : 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate per kg of steam :\n",
+ "(i) The heat supplied ;\n",
+ "(ii) The work done.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 100.; \t\t\t#bar\n",
+ "p2 = 10.; \t\t\t#bar\n",
+ "s1 = 5.619; \t\t\t#kJ/kg.K\n",
+ "T = 584.; \t\t\t#K\n",
+ "s2 = 7.163; \t\t\t#kJ/kg.K\n",
+ "u1 = 2545.; \t\t\t#kJ/kg\n",
+ "u2 = 2811.8; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i)Heat supplied \")\n",
+ "Q = T*(s2-s1);\n",
+ "print (\"Q = \"),(Q),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) Work done\")\n",
+ "W = Q-(u2-u1);\n",
+ "print (\"W = \"), (W), (\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Heat supplied \n",
+ "Q = 901.696 kJ/kg\n",
+ "(ii) Work done\n",
+ "W = 634.896 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.57 page no : 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the work done by the steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p1 = 120.*10**5; \t#N/m**2\n",
+ "t1 = 400.; \t\t\t#0C\n",
+ "p2 = 38.; \t\t\t#bar\n",
+ "h1 = 3051.3; \t\t#kJ/kg\n",
+ "v1 = 0.02108; \t\t#m**3/kg\n",
+ "\n",
+ "# Calculations\n",
+ "u1 = h1-p1*v1/10**3; \t#kJ/kg\n",
+ "u2 = 2602; \t\t\t #kJ/kg\n",
+ "\n",
+ "# Results\n",
+ "W = u1-u2; \n",
+ "print (\"Work done = %.3f\")%(W),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = 196.340 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.58 page no : 201 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate per kg of steam :\n",
+ "(i) The work done during expansion ;\n",
+ "(ii) The heat flow to or from the cylinder walls during the expansion.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 7.*10**5; \t\t\t#N/m**2\n",
+ "x1 = 0.98;\n",
+ "p2 = 0.34*10**5; \t\t#N/m**2\n",
+ "vg = 0.273; \t\t\t#m**3/kg\n",
+ "n = 1.1;\n",
+ "v_g2 = 4.65; \t\t\t#m**3/kg\n",
+ "u_f1 = 696.; \t\t\t#kJ/kg\n",
+ "u_g1 = 2573.; \t\t\t#kJ/kg\n",
+ "u_f2 = 302.; \t\t\t#kJ/kg\n",
+ "u_g2 = 2472.; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "v1 = x1*vg;\n",
+ "v2 = v1*(p1/p2)**(1/n);\n",
+ "x2 = v2/v_g2;\n",
+ "\n",
+ "\n",
+ "print (\"(i) Work done by the steam during the process\")\n",
+ "W = (p1*v1-p2*v2)/(n-1)/10**3; \t\t\t#kJ/kg\n",
+ "print (\"W = %.3f\")%(W), (\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Heat transferred\")\n",
+ "u1 = (1-x1)*u_f1+x1*u_g1;\n",
+ "u2 = (1-x2)*u_f2+x2*u_g2;\n",
+ "Q = u2-u1 + W;\n",
+ "print (\"Q = %.3f\")%(Q), (\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Work done by the steam during the process\n",
+ "W = 450.232 kJ/kg\n",
+ "(ii) Heat transferred\n",
+ "Q = 169.289 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.59 page no : 203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the work done per kg of steam flow through the turbine\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 15.; \t\t\t#bar\n",
+ "t1 = 350.; \t\t\t#0C\n",
+ "C1 = 60.; \t\t\t#m/s\n",
+ "p2 = 1.2; \t\t\t#bar\n",
+ "C2 = 180.; \t\t\t#m/s\n",
+ "s1 = 7.102; \t\t\t#kJ/kg\n",
+ "s_f2 = 1.3609; \t\t\t#kJ/kg\n",
+ "s_g2 = 7.2884; \t\t\t#kJ/kg\n",
+ "h_f2 = 439.4; \t\t\t#kJ/kg\n",
+ "h_fg2 = 2241.1; \t\t\t#kJ/kg\n",
+ "h1 = 3147.5; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "x2 = (s1 - s_f2)/(s_g2-s_f2);\n",
+ "h2 = h_f2+x2*h_fg2;\n",
+ "W = (h1-h2) + (C1**2 - C2**2)/2/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Work done = %.3f\")%(W),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = 523.075 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.60 page no : 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the quality of the steam leaving the nozzle.\n",
+ "'''\n",
+ "# Variables\n",
+ "p1 = 10.; \t\t\t#bar\n",
+ "t1 = 200.; \t\t\t#0C\n",
+ "C1 = 60.; \t\t\t#m/s**2\n",
+ "c2 = 650.; \t\t\t#m/s\n",
+ "p2 = 1.5; \t\t\t#bar\n",
+ "h1 = 2827.9; \t\t\t#kJ/kg\n",
+ "h_f2 = 467.1; \t\t\t#kJ/kg\n",
+ "h2 = 2618.45; \t\t\t#kJ/kg\n",
+ "h_g2 = 2693.4; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "x2 = (h2-h_f2)/(h_g2-h_f2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"quality of steam leaving the nozzle = %.3f\")%(x2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "quality of steam leaving the nozzle = 0.966\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.61 page no : 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the initial dryness fraction of the steam.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "h1 = 2776.4; \t\t\t#kJ/kg\n",
+ "h2 = h1;\n",
+ "h_f1 = 884.6; \t\t\t#kJ/kg\n",
+ "h_fg1 = 1910.3; \t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "x1 = (h1-h_f1)/h_fg1;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Initial dryness fraction = %.3f\")%(x1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial dryness fraction = 0.990\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.62 page no : 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the exit condition of steam using Mollier chart.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 10.; \t\t\t#bar\n",
+ "x1 = 0.9; \t\t\t#bar\n",
+ "p2 = 2.; \t\t\t#bar\n",
+ "\n",
+ "# Calculations\n",
+ "# Umath.sing Mollier chart, we get\n",
+ "x2 = 0.94;\n",
+ "\n",
+ "# Results\n",
+ "print (\"x2 = \"),(x2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x2 = 0.94\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.63 Page no :208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Change in entropy ;\n",
+ "(ii) Change in enthalpy ;\n",
+ "(iii) Change in internal energy.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "print (\"(a)From steam tables\")\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 15*10**5; \t\t\t#Pa\n",
+ "p2 = 7.5*10**5; \t\t\t#Pa\n",
+ "h_f1 = 844.7; \t\t\t#kJ/kg\n",
+ "ts1 = 198.3; \t\t\t#0C\n",
+ "s_f1 = 2.3145; \t\t\t#kJ/kg.K\n",
+ "s_g1 = 6.4406; \t\t\t#kJ/kg.K\n",
+ "v_g1 = 0.132; \t\t\t#m**3/kg\n",
+ "h_fg1 = 1945.2; \t\t\t#kJ/kg\n",
+ "x1 = 0.95;\n",
+ "h_f2 = 709.3; \t\t\t#kJ/kg\n",
+ "h_fg2 = 2055.55; \t\t\t#kJ/kg\n",
+ "s_f2 = 2.0195; \t\t\t#kJ/kg\n",
+ "s_g2 = 6.6816; \t\t\t#kJ/kg.K\n",
+ "v_g2 = 0.255; \t\t\t#m**3/kg\n",
+ "x2 = 0.9;\n",
+ "x3 = 1;\n",
+ "s_f3 = 0.521; \t\t\t#kJ/kg K\n",
+ "s_g3 = 8.330; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "h2 = h_f2+x2*h_fg2;\n",
+ "h1 = h_f1 + x1*h_fg1;\n",
+ "s1 = s_f1 + x1*(s_g1-s_f1);\n",
+ "s2 = s1;\n",
+ "ds_12 = s2-s1;\n",
+ "\n",
+ "s3 = s_f3+x3*(s_g3-s_f3);\n",
+ "ds_23 = s3-s2;\n",
+ "\n",
+ "ds = 709.3 + 0.9 * 2055.55\n",
+ "\n",
+ "# Results\n",
+ "print (\"(i) Change in entropy = %.3f\")% (ds), (\"kJ/kg K\")\n",
+ "\n",
+ "h3 = h2;\n",
+ "\n",
+ "dh = h2-h1;\n",
+ "print (\"(ii) Change in enthalpy %.2f\")%(dh), (\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) Change in internal energy\"),\n",
+ "u1 = h1-p1*x1*v_g1/10**3;\n",
+ "u2 = h2-p2*x2*v_g2/10**3;\n",
+ "du = u2-u1;\n",
+ "print (\"du = %.3f\")% (du), (\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "\t\t\t# Only the expansion of steam from point 1 to 2 (i.e., isentropic expansion) is reversible because of unresisted flow whereas the expansion from point 2 to point 3 (i.e., throttling expansion) is irreversible because of frictional resismath.tance to flow. Increase of entropy also shows that expansion from point 2 to point 3 is irreversible.\n",
+ "\n",
+ "\n",
+ "print (\"(b) Using Mollier chart\")\n",
+ "h1 = 2692; \t\t\t#kJ/kg\n",
+ "h2 = 2560; \t\t\t#kJ/kg\n",
+ "s1 = 6.23; \t\t\t#kJ/kg K\n",
+ "s2 = s1;\n",
+ "s3 = 8.3; \t\t\t#kJ/kg K\n",
+ "\n",
+ "ds = s3-s1;\n",
+ "print (\"(i) Change in entropy = %.3f\")%(ds), (\"kJ/kg K\")\n",
+ "\n",
+ "\n",
+ "dh = h2-h1;\n",
+ "print (\"(ii) Change in enthalpy = %.3f\")%(dh),(\"kJ/kg\")\n",
+ "\n",
+ "u3=u2-u1\n",
+ "print (\"(iii) Change in internal energy =%.3f\")%(u3),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)From steam tables\n",
+ "(i) Change in entropy = 2559.295 kJ/kg K\n",
+ "(ii) Change in enthalpy -133.35 kJ/kg\n",
+ "(iii) Change in internal energy du = -117.370 kJ/kg\n",
+ "(b) Using Mollier chart\n",
+ "(i) Change in entropy = 2.070 kJ/kg K\n",
+ "(ii) Change in enthalpy = -132.000 kJ/kg\n",
+ "(iii) Change in internal energy =-117.370 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.64 Page no :212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the mass of air which has left the receiver.\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 5.5; \t\t\t#m**3\n",
+ "p1 = 16.*10**5; \t\t\t#Pa\n",
+ "T1 = 315.; \t\t\t#K\n",
+ "V2 = V1;\n",
+ "p2 = 12.*10**5; \t\t\t#Pa\n",
+ "R = 0.287*10**3;\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations\n",
+ "m1 = p1*V1/R/T1;\n",
+ "T2 = T1*(p2/p1)**((y-1)/y);\n",
+ "m2 = p2*V2/R/T2;\n",
+ "\n",
+ "# Results\n",
+ "m = m1-m2;\n",
+ "print (\"Mass of air which left the receiver = %.3f\")% (m), (\"kg\")\n",
+ "\n",
+ "# Note : Rounding error is there."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of air which left the receiver = 18.081 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.65 Page no :213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the work obtainable by utilising the kinetic energy of the discharge air to run a frictionless\n",
+ "turbine\n",
+ "'''\n",
+ "# Variables\n",
+ "cp = 1.; \t\t\t#kJ/kg.K\n",
+ "cv = 0.711; \t\t\t#kJ/kg.K\n",
+ "V1 = 1.6; \t\t\t#m**3\n",
+ "V2 = V1;\n",
+ "p1 = 5.*10**5; \t\t\t#Pa\n",
+ "T1 = 373.; \t\t\t#K\n",
+ "p2 = 1.*10**5; \t\t\t#Pa\n",
+ "R = 287.;\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations\n",
+ "m1 = round(p1*V1/R/T1,2);\n",
+ "T2 = round(T1*(p2/p1)**((y-1)/y),2);\n",
+ "m2 = round(p2*V2/R/T2,3);\n",
+ "KE = (m1*cv*T1)-(m2*cv*T2)-(m1-m2)*cp*T2;\n",
+ "\n",
+ "# Results\n",
+ "print \"Kinetic energy of discharge air = %.3f\"% (KE), (\"kJ\")\n",
+ "print (\"This is the exact answer when using proper value of cv\")\n",
+ "\n",
+ "# Book answer is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kinetic energy of discharge air = 382.910 kJ\n",
+ "This is the exact answer when using proper value of cv\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.66 Page no :214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Final state condition ;\n",
+ "(ii) Work done by the piston ;\n",
+ "(iii) Heat transferred to oxygen.\n",
+ "'''\n",
+ "\n",
+ "#For oxygen\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cpa = 0.88; \t\t\t#kJ/kg K\n",
+ "Ra = 0.24; \t\t\t#kJ/kg K\n",
+ "V1a = 0.035; \t\t\t#m**3\n",
+ "p1a = 4.5; \t\t\t#bar\n",
+ "T1a = 333.; \t\t\t#K\n",
+ "V2a = 0.07; \t\t\t#m**3\n",
+ "\n",
+ "#For methane\n",
+ "V1b = 0.07; \t\t\t#m**3\n",
+ "V2b = 0.035; \t\t\t#m**3\n",
+ "p1b = 4.5; \t\t\t#bar\n",
+ "T1b = 261; \t\t\t#K\n",
+ "cpb = 1.92; \t\t\t#kJ/kg K\n",
+ "Rb = 0.496; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "yb = cpb/(cpb-Rb); \t\t\t#for methane\n",
+ "cva = cpa-Ra; \t\t\t#for oxygen\n",
+ "\n",
+ "print (\"(i) Final state condition\")\n",
+ "\n",
+ "p2b = p1b*(V1b/V2b)**yb;\n",
+ "print (\"p2 for methane = %.3f\")% (p2b), (\"bar\")\n",
+ "\n",
+ "T2b = p2b*V2b*T1b/p1b/V1b;\n",
+ "print (\"T2 for methane = %.3f\")% (T2b), (\"K\")\n",
+ "\n",
+ "p2a = p2b;\n",
+ "\n",
+ "T2a = p2a*V2a/p1a/V1a*T1a;\n",
+ "print (\"T2 for oxygen = %.3f\")% (T2a), (\"K\")\n",
+ "\n",
+ "Wb = (p1b*V1b - p2b*V2b)/(yb-1)*100; \t\t\t#kJ\n",
+ "\n",
+ "print (\"(ii)The piston will be in virtual equilibrium and hence zero work is effected by the piston.\")\n",
+ "\n",
+ "Wa = -Wb;\n",
+ "\n",
+ "ma = p1a*V1a/Ra/T1a*10**2;\n",
+ "\n",
+ "Q = ma*cva*(T2a-T1a) + Wa;\n",
+ "print \"(iii) Heat transferred to oxygen = %.3f\"% (Q), (\"kJ\")\n",
+ "\n",
+ "# Rouding error is there."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Final state condition\n",
+ "p2 for methane = 11.458 bar\n",
+ "T2 for methane = 332.272 K\n",
+ "T2 for oxygen = 1695.733 K\n",
+ "(ii)The piston will be in virtual equilibrium and hence zero work is effected by the piston.\n",
+ "(iii) Heat transferred to oxygen = 196.572 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch5.ipynb b/Industrial_Instrumentation/ch5.ipynb
new file mode 100644
index 00000000..575e68d6
--- /dev/null
+++ b/Industrial_Instrumentation/ch5.ipynb
@@ -0,0 +1,2760 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Second Law of Thermodynamics and Entropy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page no : 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The thermal efficiency \n",
+ "(ii) The rate of heat rejection.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Q1 = 1500./60; \t\t#kJ/s\n",
+ "W = 8.2; \t\t\t#kW\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Thermal efficiency\")\n",
+ "n = W/Q1;\n",
+ "print (\"n = \"),(n)\n",
+ "\n",
+ "print (\"(ii) Rate of heat rejection\")\n",
+ "Q2 = Q1-W; \n",
+ "print (\"Q2 = \"),(Q2), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Thermal efficiency\n",
+ "n = 0.328\n",
+ "(ii) Rate of heat rejection\n",
+ "Q2 = 16.8 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page no : 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Is it possible to reach initial state by an adiabatic process ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Q_12 = 30.; \t\t#kJ\n",
+ "W_12 = 60; \t\t\t#kJ\n",
+ "\n",
+ "# Calculations\n",
+ "dU_12 = Q_12-W_12;\n",
+ "Q_21 = 0;\n",
+ "W_21 = Q_21+dU_12;\n",
+ "\n",
+ "# Results\n",
+ "print (\"W_21 = \"),(W_21)\n",
+ "print (\"Thus 30 kJ work has to be done on the system to restore it to original state, by adiabatic process.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W_21 = -30.0\n",
+ "Thus 30 kJ work has to be done on the system to restore it to original state, by adiabatic process.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page no : 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the co-efficient of performance and heat transfer rate in the condenser of a refrigerator \n",
+ "'''\n",
+ "# Variables\n",
+ "Q2 = 12000.; \t\t\t#kJ/h\n",
+ "W = 0.75*60*60; \t\t#kJ/h\n",
+ "\n",
+ "# Calculations and Results\n",
+ "COP = Q2/W;\n",
+ "print (\"Coefficient of performance %.3f\")%(COP)\n",
+ "\n",
+ "Q1 = Q2+W;\n",
+ "print (\"heat transfer rate = %.3f\")%(Q1), (\"kJ/h\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Coefficient of performance 4.444\n",
+ "heat transfer rate = 14700.000 kJ/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page no : 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the least power necessary to pump this heat out continuously\n",
+ "'''\n",
+ "# Variables\n",
+ "T2 = 261.; \t\t\t#K\n",
+ "T1 = 308.; \t\t\t#K\n",
+ "Q2 = 2.; \t\t\t#kJ/s\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = Q2*(T1/T2);\n",
+ "W = Q1-Q2;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Least power required to pump the heat continuosly %.3f\")%(W),(\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Least power required to pump the heat continuosly 0.360 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page no :239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Heat abstracted from outside ;\n",
+ "(ii) Co-efficient of performance.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "Q1 = 2*10**5; \t\t\t#kJ/h\n",
+ "W = 3*10**4; \t\t\t#kJ/h\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q2 = Q1-W;\n",
+ "print (\"Heat abstracted from outside = \"),(Q2), (\"kJ/h\")\n",
+ "\n",
+ "\n",
+ "COP_hp = Q1/(Q1-Q2);\n",
+ "print (\"Co-efficient of performance = %.2f\")%(COP_hp)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat abstracted from outside = 170000 kJ/h\n",
+ "Co-efficient of performance = 6.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page no : 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What is the highest possible theoretical efficiency of a heat engine operating\n",
+ "with a hot reservoir of furnace gases \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 2373; \t\t\t#K\n",
+ "T2 = 288.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "n_max = 1-T2/T1;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Highest possible theoritical efficiency = %.3f\")% (n_max*100), (\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Highest possible theoritical efficiency = 87.863 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page no : 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find :\n",
+ "(i) Efficiency of the system ;\n",
+ "(ii) The net work transfer ;\n",
+ "(iii) Heat rejected to sink.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 523.; \t\t\t#K\n",
+ "T2 = 258.; \t\t\t#K\n",
+ "Q1 = 90.; \t\t\t#kJ\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n = 1-T2/T1;\n",
+ "print (\"(i) Efficiency of the system %.3f\")%(n*100), (\"%\")\n",
+ "\n",
+ "W = n*Q1;\n",
+ "print (\"(ii) The net work transfer\"),(\"W = %.3f\")%(W),(\"kJ\")\n",
+ " \n",
+ "Q2 = Q1-W;\n",
+ "print (\"(iii) Heat rejected to the math.sink\"),(\"Q2 = %.3f\")%(Q2),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Efficiency of the system 50.669 %\n",
+ "(ii) The net work transfer W = 45.602 kJ\n",
+ "(iii) Heat rejected to the math.sink Q2 = 44.398 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page no : 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "An inventor claims that his engine has few specifications :\n",
+ "State whether his claim is valid or not.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 1023.; \t\t#K\n",
+ "T2 = 298.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "n_carnot = 1-T2/T1;\n",
+ "W = 75*1000*60*60;\n",
+ "Q = 3.9*74500*1000;\n",
+ "n_thermal = W/Q;\n",
+ "\n",
+ "# Results\n",
+ "print (\"n_carnot = %.3f\")%(n_carnot)\n",
+ "\n",
+ "print (\"n_thermal = %.3f\")%(n_thermal)\n",
+ "\n",
+ "print (\"Since \u03b7thermal > \u03b7carnot, therefore claim of the inventor is not valid (or possible)\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n_carnot = 0.709\n",
+ "n_thermal = 0.929\n",
+ "Since \u03b7thermal > \u03b7carnot, therefore claim of the inventor is not valid (or possible)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page no : 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the least rate of heat rejection per kW net output of the engine ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 1273.; \t\t#K\n",
+ "T2 = 313.; \t\t\t#K\n",
+ "n_max = 1-T2/T1;\n",
+ "Wnet = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = Wnet/n_max;\n",
+ "Q2 = Q1-Wnet;\n",
+ "\n",
+ "# Results\n",
+ "print (\"the least rate of heat rejection = %.3f\")%(Q2), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the least rate of heat rejection = 0.326 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10 Page no : 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the power required\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "one_ton_of_refrigeration = 210.; \t\t\t#kJ/min\n",
+ "Cooling_required = 40*(one_ton_of_refrigeration); \t\t\t#kJ/min\n",
+ "T1 = 303.; \t\t\t#K\n",
+ "T2 = 238.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "COP_refrigerator = T2/(T1-T2);\n",
+ "COP_actual = 0.20*COP_refrigerator;\n",
+ "W = Cooling_required/COP_actual/60;\n",
+ "\n",
+ "# Results\n",
+ "print (\"power required = %.1f\")% (W), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power required = 191.2 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11 Page no : 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Which source (1 or 2) would you choose to supply energy to an ideal reversible heat engine that is to produce large amount of\n",
+ "power if the temperature of the surroundings is 35\u00b0C ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "E = 12000.; \t\t#kJ/min\n",
+ "T2 = 308.; \t\t\t#K\n",
+ "# Source 1\n",
+ "T1 = 593.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "n1 = 1-T2/T1;\n",
+ "# Source 2\n",
+ "T1 = 343.; \t\t\t#K\n",
+ "n2 = 1-T2/T1;\n",
+ "W1 = E*n1;\n",
+ "\n",
+ "# Results\n",
+ "print (\"W1 = %.3f\")% (W1),(\"kJ/min\")\n",
+ "\n",
+ "W2 = E*n2;\n",
+ "print (\"W2 = %.3f\")% (W2),(\"kJ/min\")\n",
+ "\n",
+ "print (\"Thus, choose source 2.\")\n",
+ "print (\"The source 2 is selected even though efficiency in this case is lower, because the criterion for selection is the larger output.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W1 = 5767.285 kJ/min\n",
+ "W2 = 1224.490 kJ/min\n",
+ "Thus, choose source 2.\n",
+ "The source 2 is selected even though efficiency in this case is lower, because the criterion for selection is the larger output.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.12 Page no : 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ ".'''\n",
+ "(i) Determine the heat transfer to the refrigerant and the net heat transfer to the reservoir\n",
+ "at 50\u00b0C ;\n",
+ "(ii) Reconsider (i) given that the efficiency of the heat engine and the C.O.P. of the refrig-\n",
+ "erator are each 45 per cent of their maximum possible values.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 973.; \t\t\t#K\n",
+ "T2 = 323.; \t\t\t#K\n",
+ "T3 = 248.; \t\t\t#K\n",
+ "\n",
+ "Q1 = 2500.; \t\t\t#kJ\n",
+ "W = 400.; \t\t\t#kJ\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n_max = 1-T2/T1;\n",
+ "W1 = n_max*Q1;\n",
+ "COP_max = T3/(T2-T3);\n",
+ "W2 = W1-W;\n",
+ "Q4 = COP_max*W2;\n",
+ "COP1 = round(Q4/W2,3);\n",
+ "Q3 = Q4+W2;\n",
+ "Q2 = Q1-W1;\n",
+ "print (\"Heat rejection to the 50\u00b0C reservoir = %.3f\")%(Q2+Q3), (\"kJ\")\n",
+ "\n",
+ "\n",
+ "n = 0.45*n_max;\n",
+ "W1 = n*Q1;\n",
+ "W2 = W1-W;\n",
+ "COP2 = 0.45*COP1;\n",
+ "Q4 = W2*COP2;\n",
+ "Q3 = Q4+W2;\n",
+ "Q2 = Q1-W1;\n",
+ "\n",
+ "print (\"Heat rejected to 50\u00b0C reservoir = %.3f\")% (Q2+Q3), (\"kJ\")\n",
+ "\n",
+ "# Note : Answers are slightly different then book because of Rounding Error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat rejection to the 50\u00b0C reservoir = 6299.773 kJ\n",
+ "Heat rejected to 50\u00b0C reservoir = 2623.147 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13 Page no : 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) determine the C.O.P. of the machine and work input required.\n",
+ "(ii) determine the overall C.O.P. of the system.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 298.; \t\t\t#K\n",
+ "T2 = 273.; \t\t\t#K\n",
+ "Q1 = 24.; \t\t\t#kJ/s\n",
+ "T3 = 653.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "COP = T1/(T1-T2);\n",
+ "print (\"(i) determine COP and work input required\")\n",
+ "\n",
+ "print (\"Coefficient of performance = \"),(COP)\n",
+ "\n",
+ "COP_ref = T2/(T1-T2);\n",
+ "W = Q1/COP_ref;\n",
+ "print (\"Work input required = %.3f\")%(W),(\"kW\")\n",
+ "\n",
+ " \n",
+ "Q4 = T1*W/(T3-T1);\n",
+ "Q3 = Q4+W;\n",
+ "Q2 = Q1+W;\n",
+ "COP = Q1/Q3;\n",
+ "print (\"(ii)Determine overall COP of the system \"),(\"COP = %.3f\")%(COP)\n",
+ "\n",
+ "COP_overall = (Q2+Q4)/Q3;\n",
+ "print (\"Overall COP = %.3f\")%(COP_overall)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) determine COP and work input required\n",
+ "Coefficient of performance = 11.92\n",
+ "Work input required = 2.198 kW\n",
+ "(ii)Determine overall COP of the system COP = 5.937\n",
+ "Overall COP = 6.937\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.14 Page no : 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Power developed by the engine ;\n",
+ "(ii) Fuel consumed per hour.\n",
+ "Take enthalpy of fusion of ice = 334.5 kJ/kg.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T_e1 = 493.; \t\t\t#K\n",
+ "T_e2 = 298.; \t\t\t#K\n",
+ "T_p1 = 298.; \t\t\t#K\n",
+ "T_p2 = 273.; \t\t\t#K\n",
+ "Amt = 15.; \t\t \t#tonnes produced per day\n",
+ "h = 334.5; \t\t\t #kJ/kg\n",
+ "Q_abs = 44500.; \t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q_p2 = Amt*10**3*h/24/60;\n",
+ "COP_hp = T_p2/(T_p1-T_p2);\n",
+ "W = Q_p2/COP_hp/60;\n",
+ "print (\"(i)Power developed by the engine = %.3f\")%(W),(\"kW\")\n",
+ "\n",
+ "print (\"(ii) Fuel consumed per hour\")\n",
+ "n_carnot = 1-(T_e2/T_e1);\n",
+ "Q_e1 = W/n_carnot*3600; \t\t\t#kJ/h\n",
+ "fuel_consumed = Q_e1/Q_abs;\n",
+ "print (\"Quantity of fuel consumed/hour = %.3f\")%(fuel_consumed),(\"kg/h\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Power developed by the engine = 5.318 kW\n",
+ "(ii) Fuel consumed per hour\n",
+ "Quantity of fuel consumed/hour = 1.088 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.15 Page no : 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the intermediate temperature.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 550.; \t\t\t#K\n",
+ "T3 = 350.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "T2 = (T1+T3)/2;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Intermediate temperature = \"), (T2),(\"K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Intermediate temperature = 450.0 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.16 Page no : 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine :\n",
+ "(i) The temperature T 3 such that heat supplied to engine Q 1 is equal to the heat absorbed\n",
+ "by refrigerator Q 2 .\n",
+ "(ii) The efficiency of Carnot engine and C.O.P. of Carnot refrigerator.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 600.; \t\t\t#K\n",
+ "T2 = 300.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "T3 = 2*T1/(T1/T2+1);\n",
+ "print (\"(i) When Q1 = Q2\"),(\"T3 = \"),(T3),(\"K\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Efficiency of Carnot engine and COP of carnot refrigerator\")\n",
+ "n = (T1-T3)/T1; \t\t\t#carnot engine\n",
+ "COP = T2/(T3-T2); \t\t\t#refrigerator\n",
+ "\n",
+ "print (\"Efficiency of carnot engine = %.3f\")% (n)\n",
+ "\n",
+ "print (\"COP of carnot refrigerator = \"), (COP)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) When Q1 = Q2 T3 = 400.0 K\n",
+ "(ii) Efficiency of Carnot engine and COP of carnot refrigerator\n",
+ "Efficiency of carnot engine = 0.333\n",
+ "COP of carnot refrigerator = 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.17 Page no : 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "estimate the energy taken from the reservoir at 1077\u00b0C.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T3 = 278.; \t\t\t#K\n",
+ "T2 = 350.; \t\t\t#K\n",
+ "T4 = T2;\n",
+ "T1 = 1350.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = 100/(((T4/T1)*(T1-T2)/(T4-T3))+T2/T1) \t#Q4+Q2 = 100; Q4 = Q1*((T4/T1)*(T1-T2)/(T4-T3)); Q2 = T2/T1*Q1;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Q1 = %.3f\")%(Q1),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q1 = 25.906 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.18 Page no : 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Classify which of the result report a reversible cycle or irreversible cycle or impossible\n",
+ "results.\n",
+ "'''\n",
+ "# Variables\n",
+ "Q1 = 300.; \t\t\t#kJ/s\n",
+ "T1 = 290.; \t\t\t#0C\n",
+ "T2 = 8.5; \t\t\t#0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"let \u03a3dQ/T = A\")\n",
+ "\n",
+ "print (\"(i) 215 kJ/s are rejected\")\n",
+ "Q2 = 215.; \t\t\t#kJ/s\n",
+ "A = Q1/(T1+273) - Q2/(T2+273)\n",
+ "print (\"Since, A<0, Cycle is irreversible.\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) 150 kJ/s are rejected\")\n",
+ "Q2 = 150; \t\t\t#kJ/s\n",
+ "A = Q1/(T1+273) - Q2/(T2+273)\n",
+ "print (\"Since A = 0, cycle is reversible\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) 75 kJ/s are rejected.\")\n",
+ "Q2 = 75; \t\t\t#kJ/s\n",
+ "A = Q1/(T1+273) - Q2/(T2+273)\n",
+ "print (\"Since A>0, cycle is impossible\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "let \u03a3dQ/T = A\n",
+ "(i) 215 kJ/s are rejected\n",
+ "Since, A<0, Cycle is irreversible.\n",
+ "(ii) 150 kJ/s are rejected\n",
+ "Since A = 0, cycle is reversible\n",
+ "(iii) 75 kJ/s are rejected.\n",
+ "Since A>0, cycle is impossible\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.19 Page no : 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Verify the Clausius inequality for the cycle.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "P1 = 0.124*10**5; \t\t\t#N/m**2\n",
+ "T1 = 433; \t\t\t#K\n",
+ "T2 = 323; \t\t\t#K\n",
+ "h_f1 = 687; \t\t\t#kJ/kg\n",
+ "h2 = 2760; \t\t\t#kJ/kg\n",
+ "h3 = 2160; \t\t\t#kJ/kg\n",
+ "h_f4 = 209; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q1 = h2-h_f1;\n",
+ "Q2 = h_f4-h3;\n",
+ "print (\"Let A = \u03a3dQ/T\")\n",
+ "A = Q1/T1+Q2/T2;\n",
+ "print (A)\n",
+ "print (\"A<0. Hence classius inequality is verified\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let A = \u03a3dQ/T\n",
+ "-3\n",
+ "A<0. Hence classius inequality is verified\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.20 Page no :251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Verify the Clausius Inequality'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 437.; \t\t\t#K\n",
+ "T2 = 324.; \t \t\t#K\n",
+ "h2 = 2760.; \t\t\t#kJ/kg\n",
+ "h1 = 690.; \t\t \t#kJ/kg\n",
+ "h3 = 2360.; \t\t\t#kJ/kg\n",
+ "h4 = 450.; \t\t\t #kJkg\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = h2-h1;\n",
+ "Q2 = h4-h3;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Let A = \u03a3dQ/T\")\n",
+ "A = Q1/T1 + Q2/T2;\n",
+ "print \"%.3f\"%(A)\n",
+ "print (\"Since A<0, Classius inequality is verified\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let A = \u03a3dQ/T\n",
+ "-1.158\n",
+ "Since A<0, Classius inequality is verified\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.21 Page no : 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the entropy changes for the iron cube and the water. Is the process reversible ? If so why ?\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T0 = 273.; \t\t\t#K\n",
+ "T1 = 673.; \t\t\t#K\n",
+ "T2 = 298.; \t\t\t#K\n",
+ "m_w = 10.; \t\t\t#kg\n",
+ "T3 = 323.; \t\t\t#K\n",
+ "c_pw = 4186.; \t\t#kJ/kg.K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"Let C = mi*cpi\")\n",
+ "C = m_w*c_pw*(T3-T2)/(T1-T3);\n",
+ "S_iT1 = C*math.log(T1/T0); \t\t\t# Entropy of iron at 673 K\n",
+ "S_wT2 = m_w*c_pw*math.log(T2/T0); \t#Entropy of water at 298 K\n",
+ "S_iT3 = C*math.log(T3/T0); \t\t\t#Entropy of iron at 323 K\n",
+ "S_wT3 = m_w*c_pw*math.log(T3/T0); \t#Entropy of water at 323 K\n",
+ "\n",
+ "dS_i = S_iT3 - S_iT1;\n",
+ "dS_w = S_wT3 - S_wT2; \n",
+ "dS_net = dS_i + dS_w\n",
+ "\n",
+ "print (\"Since dS>0, process is irreversible\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let C = mi*cpi\n",
+ "Since dS>0, process is irreversible\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.23 Page no : 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The net heat flow from the air.\n",
+ "(ii) The net entropy change.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "V1 = 0.025; \t\t\t#m**3\n",
+ "V3 = V1;\n",
+ "p1 = 1.05*10**5; \t\t\t#N/m**2\n",
+ "p2 = 4.5*10**5; \t\t\t#N/m**2\n",
+ "R = 0.287*10**3; \n",
+ "cv = 0.718;\n",
+ "cp = 1.005;\n",
+ "T3 = 293.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m = p1*V1/R/T1;\n",
+ "T2 = p2/p1*T1;\n",
+ "Q_12 = m*cv*(T2-T1);\n",
+ "Q_23 = m*cp*(T3-T2)\n",
+ "\n",
+ "Q_net = Q_12+Q_23;\n",
+ "print (\"Net heat flow = \"),(Q_net), (\"kJ\")\n",
+ "\n",
+ "\n",
+ "dS_32 = m*cp*math.log(T2/T1);\n",
+ "dS_12 = m*cv*math.log(T2/T1);\n",
+ "dS_31 = dS_32 - dS_12;\n",
+ "print (\"Decrease in entropy = %.3f\")% (dS_31), (\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net heat flow = -8.625 kJ\n",
+ "Decrease in entropy = 0.013 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.24 Page no : 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The change of entropy,\n",
+ "(ii) The heat flow, and\n",
+ "(iii) The work done.\n",
+ "'''\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "from matplotlib.pyplot import *\n",
+ "from numpy import *\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1.05*10**5; \t#N/m**2\n",
+ "V1 = 0.04; \t\t\t#m**3\n",
+ "T1 = 288.; \t\t\t#K\n",
+ "p2 = 4.8*10**5;\n",
+ "T2 = T1;\n",
+ "R0 = 8314.;\n",
+ "M = 28.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "R = R0/M;\n",
+ "m = p1*V1/R/T1;\n",
+ "dS = m*R*math.log(p1/p2)\n",
+ "print (\"Decrease in entropy = %.3f\")% (-dS), (\"J/K\")\n",
+ "\n",
+ "\n",
+ "print \n",
+ "Q = T1*(-dS);\n",
+ "print (\"(ii)Heat rejected = \"),(\"Q = %.3f\")%(Q),(\"J\")\n",
+ "\n",
+ "\n",
+ "W = Q;\n",
+ "print (\"Work done = %.3f\")% (W), (\"J\")\n",
+ "\n",
+ "V2 = p1*V1/p2;\n",
+ "v1 = V1/m; \t\t\t#specific volume\n",
+ "v2 = V2/m; \t\t\t#specific volume\n",
+ "\n",
+ "v = linspace(v2,0.8081571,64);\n",
+ "\n",
+ "\n",
+ "def f(v):\n",
+ " return p1*v1/v\n",
+ "plot(v,f(v))\n",
+ "\n",
+ "p = []\n",
+ "for i in range(len(v)):\n",
+ " p.append(p1)\n",
+ "plot(v,p,'--')\n",
+ "\n",
+ "p = [0 ,p2]\n",
+ "v = [v2 ,v2]\n",
+ "plot(v,p,'--')\n",
+ "\n",
+ "p = [0 ,p1]\n",
+ "v = [v1 ,v1]\n",
+ "plot(v,p,'--')\n",
+ "\n",
+ "T = [288, 288]\n",
+ "s = [10 ,(10-dS)]\n",
+ "plot(s,T)\n",
+ "\n",
+ "s = [10 ,10]\n",
+ "T = [0 ,288]\n",
+ "plot(s,T,'--')\n",
+ "\n",
+ "s = [(10-dS), (10-dS)]\n",
+ "T = [0 ,288]\n",
+ "plot(s,T,'--')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "Decrease in entropy = 22.164 J/K\n",
+ "\n",
+ "(ii)Heat rejected = Q = 6383.268 J\n",
+ "Work done = 6383.268 J\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 13,
+ "text": [
+ "[<matplotlib.lines.Line2D at 0x2c3da90>]"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "i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93JaF0+lEIBCI/jsQCIwaacQDh8MBAEhKSsKmTZtw6NAhkxNN\nTlJSEjo6OgBcGWUMb0+8SExMhMVigcViwbPPPjvt9//g4CCefPJJPPPMM3jssccAxNdnMJz/6aef\njuaPt88AAO644w4UFhbC7/fH1f4H/pn9888/n/S+j9uyeOCBB3Dy5EkEg0EMDg5iz549yM/PNzvW\nhPX29qK3txcAcOnSJfh8PmiaZnKqySkoKEBdXR0AoK6uDgUFBSYnmpyRhww++OCDab3/RQQ//vGP\nkZmZGb2aBYifz2Cs/PHyGXR2diIcDgMAvv32WzQ1NcHlcsXF/h8reygUir5mQvt+6s+7f38aGxtF\n0zTJyMiQ119/3ew4k/LVV1+J2+2WZcuWyX333Se/+MUvzI40rpKSElm4cKHMnDlTnE6n1NbWSmdn\np+Tk5IjL5ZLc3Fy5cOGC2THHdG3+3//+91JaWiput1uWLFkieXl5ouu62THH9Omnn4rFYpFly5ZJ\nVlaWZGVlyUcffRQ3n8GN8jc2NsbNZ3D8+HHJysqSZcuWyeLFi6W6ulpEJC72/1jZJ7vveVMeERHF\nFLeHoYiI6PvDsiAiophYFkREFBPLgoiIYmJZEBFRTCwLIiKKiWVBREQxsSyIiCim/w93T0cbP4g9\nZgAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2124290>"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.25 Page no : 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the change in entropy.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t\t\t#kJ/kg.K\n",
+ "dU = 0;\n",
+ "W = 0;\n",
+ "Q = dU+W;\n",
+ "\n",
+ "# Calculations\n",
+ "dS = R*math.log(2); \t\t\t#v2/v1 = 2\n",
+ "\n",
+ "# Results\n",
+ "print (\"Change in entropy = %.3f\")%(dS),(\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy = 198.933 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.26 Page no : 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the change of entropy\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 0.04; \t\t\t#kg\n",
+ "p1 = 1*10.**5; \t\t\t#N/m**2\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "p2 = 9*10.**5; \t\t\t#N/m**2\n",
+ "V2 = 0.003; \t\t\t#m**3\n",
+ "cp = 0.88; \t\t\t#kJ/kg.K\n",
+ "R0 = 8314.;\n",
+ "M = 44.;\n",
+ "\n",
+ "# Calculations\n",
+ "R = R0/M;\n",
+ "T2 = p2*V2/m/R;\n",
+ "ds_2A = R/10**3*math.log(p2/p1);\n",
+ "ds_1A = cp*math.log(T2/T1);\n",
+ "ds_21 = ds_2A - ds_1A;\n",
+ "dS_21 = m*ds_21;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Decrease in entropy = %.3f\")% (dS_21),(\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in entropy = 0.010 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.27 Page no : 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the change of entropy \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 7.*10**5; \t\t\t#N/m**2\n",
+ "T1 = 873.; \t\t\t#K\n",
+ "p2 = 1.05*10**5; \t\t\t#N/M62\n",
+ "n = 1.25;\n",
+ "m = 1.; \t\t\t#kg\n",
+ "R = 0.287;\n",
+ "cp = 1.005;\n",
+ "\n",
+ "# Calculations\n",
+ "T2 = T1*(p2/p1)**((n-1)/n);\n",
+ "\n",
+ "# At constant temperature from 1 to A\n",
+ "ds_1A = R*math.log(p1/p2);\n",
+ "# At constant pressure from A to 2\n",
+ "ds_2A = cp*math.log(T1/T2);\n",
+ "ds_12 = ds_1A - ds_2A;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Increase in entropy = %.3f\")% (ds_12), (\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Increase in entropy = 0.163 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.28 Page no : 274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Show that the process is irreversible ;\n",
+ "(ii) Calculate the change of entropy per kg of air.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 7*10**5; \t\t#Pa\n",
+ "T1 = 733.; \t\t\t#K\n",
+ "p2 = 1.012*10**5; \t#Pa\n",
+ "T2a = 433.; \t\t#K\n",
+ "y = 1.4;\n",
+ "cp = 1.005;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) To prove that the process is irreversible\")\n",
+ "T2 = T1*(p2/p1)**((y-1)/y);\n",
+ "print (\"T2 = %.3f\")% (T2)\n",
+ "print (\"But the actual temperature is 433K at th epressure of 1.012 bar, Hence the process is irreversible. Proved.\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Change of entropy per kg of air\")\n",
+ "ds = cp*math.log(T2a/T2);\n",
+ "print (\"Increase of entropy = %.3f\")% (ds), (\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) To prove that the process is irreversible\n",
+ "T2 = 421.820\n",
+ "But the actual temperature is 433K at th epressure of 1.012 bar, Hence the process is irreversible. Proved.\n",
+ "(ii) Change of entropy per kg of air\n",
+ "Increase of entropy = 0.026 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.29 Page no : 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine : \n",
+ "(i) Change in enthalpy ;\n",
+ "(ii) Change in internal energy ;\n",
+ "(iii) Change in entropy ;\n",
+ "(iv) Heat transfer ;\n",
+ "(v) Work transfer.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.3; \t\t\t#m**3\n",
+ "p1 = 4*10**5; \t\t#N/m**2\n",
+ "V2 = 0.08; \t\t\t#m**3\n",
+ "n = 1.25; \n",
+ "\n",
+ "# Calculations and Results\n",
+ "p2 = p1*(V1/V2)**n;\n",
+ "\n",
+ "dH = n*(p2*V2-p1*V1)/(n-1)/10**3;\n",
+ "print (\"(i) Change in enthalpy\"), (\"dH = %.3f\")% (dH), (\"kJ\")\n",
+ "\n",
+ "dU = dH-(p2*V2 - p1*V1)/10**3;\n",
+ "print (\"(ii) Change in internal energy\"),(\"dU = %.3f\")% (dU), (\"kJ\")\n",
+ "\n",
+ "dS = 0;\n",
+ "print (\"(iii) Change in entropy\"),(\"dS\"), (dS)\n",
+ "\n",
+ "Q = 0;\n",
+ "print (\"(iv)Heat transfer\"),(\"Q = \"), (Q)\n",
+ "\n",
+ "W = Q-dU;\n",
+ "print (\"(v) Work transfer\"),(\"W = %.3f\")%(W),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Change in enthalpy dH = 234.947 kJ\n",
+ "(ii) Change in internal energy dU = 187.958 kJ\n",
+ "(iii) Change in entropy dS 0\n",
+ "(iv)Heat transfer Q = 0\n",
+ "(v) Work transfer W = -187.958 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.30 Page no : 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Change in internal energy,\n",
+ "(ii) Work done,\n",
+ "(iii) Heat transferred, and\n",
+ "(iv) Change in entropy\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 20.; \t\t\t#kg\n",
+ "p1 = 4.*10**5; \t\t\t#Pa\n",
+ "p2 = 8.*10**5; \t\t\t#Pa\n",
+ "V1 = 4.; \t\t\t#m**3\n",
+ "V2 = V1;\n",
+ "cp = 1.04; \t\t\t#kJ/kg.K\n",
+ "cv = 0.7432; \t\t\t#kJ/kg.K\n",
+ "R = cp-cv;\n",
+ "T1 = p1*V1/R/1000.; \t\t\t#kg.K; T = mass*temperature\n",
+ "T2 = p2*V2/R/1000.; \t\t\t#kg.K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "dU = cv*(T2-T1);\n",
+ "print (\"(i) Change in internal energy\"),(\"dU = %.3f\")% (dU), (\"kJ\")\n",
+ "\n",
+ "Q = 0;\n",
+ "W = Q-dU;\n",
+ "print (\"(ii) Work done\"),(\"W %.3f\")% (W), (\"kJ\")\n",
+ "\n",
+ "print (\"(iii) Heat transferred = \"), (Q)\n",
+ "\n",
+ "dS = m*cv*math.log(T2/T1);\n",
+ "print (\"(iv) Change in entropy = %.3f\")%(dS), (\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Change in internal energy dU = 4006.469 kJ\n",
+ "(ii) Work done W -4006.469 kJ\n",
+ "(iii) Heat transferred = 0\n",
+ "(iv) Change in entropy = 10.303 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.31 Page no : 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the net work. Also plot the processes on T-S diagram\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "%pylab inline\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 5.; \t\t\t#m**3\n",
+ "p1 = 2.*10**5; \t\t\t#Pa\n",
+ "T1 = 300.; \t\t\t#K\n",
+ "p2 = 6.*10**5; \t\t\t#Pa\n",
+ "p3 = 2.*10**5; \t\t\t#Pa\n",
+ "R = 287.;\n",
+ "n = 1.3;\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m = p1*V1/R/T1;\n",
+ "T2 = T1*(p2/p1)**((n-1)/n);\n",
+ "T3 = T2*(p3/p2)**((y-1)/y);\n",
+ "W_12 = m*R*(T1-T2)/(n-1)/1000; \t\t\t#polytropic compression\n",
+ "W_23 = m*R*(T2-T3)/(y-1)/1000; \t\t\t#Adiabatic expansion\n",
+ "\n",
+ "\n",
+ "W_net = W_12+W_23;\n",
+ "print (\"Net work done on the air = %.3f\")%(-W_net), (\"kJ\")\n",
+ "\n",
+ "T = [T1, 310, 320, 330, 340, 350, 360, 370, 380, T2];\n",
+ "def f(T):\n",
+ " return (y-n)/(y-1)/(1-n)*R/10**3*math.log(T);\n",
+ "\n",
+ "s = [f(T1), f(310), f(320), f(330), f(340), f(350), f(360), f(370), f(380), f(T2)]\n",
+ "\n",
+ "plot(s,T)\n",
+ "\n",
+ "T = [T2, T3];\n",
+ "s = [f(T2), f(T2)];\n",
+ "plot(s,T,'r')\n",
+ "\n",
+ "# Answers are slightly diffferent because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "Net work done on the air = 94.023 kJ\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['f', 'draw_if_interactive']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 9,
+ "text": [
+ "[<matplotlib.lines.Line2D at 0x2aa0d90>]"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAD9CAYAAABazssqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1c1fX9//HHITBklWkqLpjRAsWDF2AK2s8KFbQ0SavR\ncPllX21bdrWcadLF0iyhtLVso75u+c22vpHuQqw5B83O7MphGrVJBRWbgMY3S+hC7Ajn/fvjnXy1\nlAvh8OFwnvfb7dzCcz6f83lCel583pcuY4xBRESCUojTAURExDkqAiIiQUxFQEQkiKkIiIgEMRUB\nEZEgpiIgIhLE2lQEmpqaSEpKYsaMGQB8/PHHpKenM2TIEKZMmUJdXV3zsbm5ucTFxREfH09RUZF/\nUouISKdoUxF4+OGHcbvduFwuAPLy8khPT6e8vJzJkyeTl5cHQFlZGc888wxlZWVs2bKF66+/Hp/P\n57/0IiLSIa0WgerqajZv3sy1117LkXllmzZtIjs7G4Ds7Gw2btwIQGFhIVlZWYSFhRETE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ZrEk08+CdjbmiMKCwubh6c64WTyb9myhZUrV1JYWEh4eHhXxj3GyWRvy/ld5WTyZ2Rk\nsG7dOgDWrVvXPMHRCSfKv3//furq6gBoaGiguLi4+e/4hx9+CNhb/nvvvZf58+d3TdjjaE/+I2uM\nnWgOkRNO5ucP8PzzzzNs2DDOPvvsLsl5PCeTfebMmWzduhWA8vJyvF4vZ511VqsX8os//OEPJjo6\n2oSHh5vIyEhzySWXGGOMqampMdOmTfva8R6P55gRHldeeaUZPny4GTVqlLniiitMbW2tv6IeV0fz\nx8bGmsGDBzcPNZs/f37AZD/R+V2lo/k/+ugjM3nyZMeGiLYl/xtvvGGSkpLMqFGjzIgRI8wDDzzQ\nfP7DDz9shgwZYoYMGWJycnK6NHtn5N+xY0fzEMZx48aZXbt2BVR+Y4z5/ve/b/7rv/6rS3N3Rnav\n12uuueYaM3z4cDN69GjzwgsvtHpNlzFaw0FEJFgF5rAQERHpFCoCIiJBTEVARCSIqQiIiAQxFQER\nkSCmIiAiEsT+P3S/G55r8UZJAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2aa0bd0>"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.32 Page no : 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The heat supplied.\n",
+ "(ii) The entropy change.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.004; \t\t\t#m**3\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "T1 = 300.; \t\t\t#K\n",
+ "T2 = 400.; \t\t\t#K\n",
+ "y = 1.4;\n",
+ "M = 28.;\n",
+ "R0 = 8.314;\n",
+ "R = R0/M;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The heat supplied\")\n",
+ "m = p1*V1/R/1000/T1; \t\t\t#kg\n",
+ "cv = R/(y-1);\n",
+ "Q = m*cv*(T2-T1);\n",
+ "print (\"Q %.3f\")%(Q), (\"kJ\")\n",
+ "\n",
+ "print (\"(ii) The entropy change\")\n",
+ "dS = m*cv*math.log(T2/T1);\n",
+ "print (\"dS = %.8f\")%(dS), (\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The heat supplied\n",
+ "Q 0.333 kJ\n",
+ "(ii) The entropy change\n",
+ "dS = 0.00095894 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.33 Page no : 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Change in entropy.\n",
+ "(ii) Work done\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.05; \t\t\t#m**3\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "T1 = 280.; \t\t\t#K\n",
+ "p2 = 5.*10**5; \t\t\t#Pa\n",
+ "\n",
+ "# Calculations\n",
+ "print (\"(i) Change in entropy\")\n",
+ "R0 = 8.314;\n",
+ "M = 28.;\n",
+ "R = R0/M;\n",
+ "m = p1*V1/R/T1/1000;\n",
+ "dS = m*R*math.log(p1/p2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"dS = %.3f\")%(dS), (\"kJ/K\")\n",
+ "\n",
+ "print (\"(ii)Work done\")\n",
+ "Q = T1*dS;\n",
+ "print (\"Q = %.3f\")%(Q),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Change in entropy\n",
+ "dS = -0.029 kJ/K\n",
+ "(ii)Work done\n",
+ "Q = -8.047 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.34 Page no : 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) Final specific volume and temperature.\n",
+ "(ii) Change of internal energy, work done and heat interaction.\n",
+ "(iii) Change in entropy.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 0.287; \t\t\t#kJ/kg.K\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p1 = 8.*10**5; \t\t\t#Pa\n",
+ "p2 = 1.6*10**5; \t\t\t#Pa\n",
+ "T1 = 380.; \t\t\t#K\n",
+ "n = 1.2;\n",
+ "y = 1.4;\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Final specific volume and temperature\")\n",
+ "v1 = R*T1/p1*10**3; \t\t\t#m**3/kg\n",
+ "v2 = v1*(p1/p2)**(1/n);\n",
+ "T2 = T1*(p2/p1)**((n-1)/n);\n",
+ "\n",
+ "print (\"v2 = %.3f\")%(v2), (\"m**3/kg\")\n",
+ "print (\"T2 = %.3f\")% (T2),(\"K\")\n",
+ "\n",
+ "print (\"(ii) Change of internal energy, work done and heat interaction\")\n",
+ "dU = R/(y-1)*(T2-T1);\n",
+ "print (\"dU = %.3f\")%(dU), (\"kJ/kg\")\n",
+ "\n",
+ "W = R*(T1-T2)/(n-1);\n",
+ "print (\"W = %.3f\")%(W), (\"kJ/kg\")\n",
+ "\n",
+ "Q = dU + W;\n",
+ "print (\"Q = %.3f\")%(Q),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"(iii) Change in entropy\")\n",
+ "dS = R/(y-1)*math.log(T2/T1) + R*math.log(v2/v1)\n",
+ "print (\"dS = %.3f\")%(dS),(\"kJ/kg.K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Final specific volume and temperature\n",
+ "v2 = 0.521 m**3/kg\n",
+ "T2 = 290.595 K\n",
+ "(ii) Change of internal energy, work done and heat interaction\n",
+ "dU = -64.148 kJ/kg\n",
+ "W = 128.296 kJ/kg\n",
+ "Q = 64.148 kJ/kg\n",
+ "(iii) Change in entropy\n",
+ "dS = 0.192 kJ/kg.K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.35 Page no : 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(b)What would be the percentage error if the entropy change is calculated by dividing the\n",
+ "quantity of heat exchanged by the mean absolute temperature during the process ?\n",
+ "\n",
+ "'''\n",
+ "%pylab inline\n",
+ "import math\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Variables\n",
+ "y = 1.4;\n",
+ "cv = 0.718; \t\t#kJ/kg.K\n",
+ "m = 1.; \t\t\t #kg\n",
+ "T1 = 290.; \t\t\t#K\n",
+ "n = 1.3;\n",
+ "r = 16.;\n",
+ "y = 1.4;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "T2 = T1*(r)**(n-1);\n",
+ "\n",
+ "print (\"(a)\")\n",
+ "\n",
+ "T = [T1, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, T2];\n",
+ "def f(T):\n",
+ " return (y-n)*cv/(1-n)/10**3*math.log(T);\n",
+ "\n",
+ "s = [f(T1),f(300),f(310),f(320),f(330),f(340),f(350),f(360),f(370),f(380),f(390),f(400),f(410),f(420),f(430),f(440),f(450),f(460),f(470),f(480),f(490),f(500),f(510),f(520),f(530),f(540),f(550),f(560),f(570),f(580),f(590),f(600),f(610),f(620),f(630),f(640),f(650),f(660), f(T2)];\n",
+ "plot(s,T)\n",
+ "\n",
+ "T = [0, T2];\n",
+ "s = [f(T2), f(T2)];\n",
+ "plot(s,T,'r--')\n",
+ "\n",
+ "T = [0 ,T1];\n",
+ "s = [f(T1),f(T1)];\n",
+ "plot(s,T,'r--')\n",
+ "\n",
+ "T = [T1 ,T2];\n",
+ "s = [f(T1), f(T2)];\n",
+ "plot(s,T,'r--' )\n",
+ "suptitle(\"T-S diagram\")\n",
+ "xlabel(\"S\")\n",
+ "ylabel(\"T\")\n",
+ "text(-0.00150,400,\"pV**n = C\")\n",
+ "\n",
+ "print (\"(b)Entropy change\")\n",
+ "dS = cv*((n-y)/(n-1))*math.log(T2/T1);\n",
+ "print (\"dS = %.3f\")%(dS), (\"kJ/kg.K\")\n",
+ "print (\"There is decrease in entropy\")\n",
+ "\n",
+ "Q = cv*((y-n)/(n-1))*(T1-T2);\n",
+ "Tmean = (T1+T2)/2;\n",
+ "dS_app = Q/Tmean;\n",
+ "\n",
+ "error = ((-dS) - (-dS_app))/(-dS) * 100;\n",
+ "print (\"age error = %.3f\")%(error), (\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "(a)\n",
+ "(b)Entropy change"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dS = -0.199 kJ/kg.K\n",
+ "There is decrease in entropy\n",
+ "age error = 5.393 %\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAEhCAYAAABGC2bVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlclXX6//EXoOZeJqAFpg2NCwiKC2aSkUUYLpNtYknN\npJXNaJ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ea\nNWtmff/995ZlWdaPP/5ode/e3YqJibESExOt/Px8y7JMhcYtt9xitW3b1uratavncV/x1bmIjIy0\nvv/+e+vgwYNWhw4drHbt2lm///3vrSFDhlhHjx61LMuyHn74YSs2NtaKjo62unXrZuXl5fnoLPz2\na/HHuQiU98XJ/0aOy8/PL1NpFSjvi/Kci0B5Xxz/N7Jjxw6rU6dOVrt27ayWLVtaQ4cOtYqLiy3L\nOrf3hSZsioiIrRzVvVlERKofJRoREbGVEo2IiNhKiUZERGylRCMiIrZSohEREVsp0Yh4wRNPPEGr\nVq1o164d7dq1Iycnx98hiTiGo1bYFKmKsrOz+fzzz8nLy6NmzZrs27ePQ4cO+TssEcdQohGpJLfb\nTVhYGDVr1gSgYcOGNGzY0M9RiTiHOgOIVNK+ffvo1q0bxcXFJCUlcfPNN3PNNdf4OywRx9A9GpFK\natiwIStXruTll1+mSZMmDBw4kFdeecXfYYk4hkY0Il42a9YsXnnlFT799FN/hyLiCBrRiFTSxo0b\nyyyUtWLFijIrHYoEOhUDiFTS/v37+fOf/8zBgwcpLi7msssu06UzkZPo0pmIiNhKl85ERMRWSjQi\nImIrJRoREbGVEo2IiNhKiUZERGylRCMiIrZSohEREVsp0YiIiK3+P0qnzwUjczFJAAAAAElFTkSu\nQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x3b860d0>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.36 Page no : 282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate :\n",
+ "(i) The net heat flow.\n",
+ "(ii) The overall change in entropy.\n",
+ "'''\n",
+ "\n",
+ "from matplotlib.pyplot import *\n",
+ "from numpy import *\n",
+ "# Variables\n",
+ "cp = 1.005; \t\t\t#kJ/kg.K\n",
+ "R = 0.287; \t\t\t#kJ/kg.K\n",
+ "V1 = 1.2; \t\t\t#m**3\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "p2 = p1;\n",
+ "T1 = 300.; \t\t\t#K\n",
+ "T2 = 600.; \t\t\t#K\n",
+ "T3 = T1;\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "cv = cp-R;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The net heat flow\")\n",
+ "m = p1*V1/R/1000/T1; \t\t\t#kg\n",
+ "Q = m*R*(T2-T1);\n",
+ "print (\"Q = \"), (Q), (\"kJ\")\n",
+ "\n",
+ "print (\"(ii) The overall change in entropy\")\n",
+ "dS_12 = m*cp*math.log(T2/T1);\n",
+ "dS_23 = m*(cp-R)*math.log(T3/T2); \t\t\t#cv = cp-R\n",
+ "dS_overall = dS_12+dS_23;\n",
+ "print (\"Overall change in entropy = %.3f\")%(dS_overall),(\"kJ/K\")\n",
+ "\n",
+ "s = linspace(math.sqrt(300),math.sqrt(600),100);\n",
+ "T = s**2;\n",
+ "plot(s,T)\n",
+ "\n",
+ "s = linspace(22.18,math.sqrt(600),100)\n",
+ "T = 10*(s-16.725)**2;\n",
+ "plot(s,T,'r')\n",
+ "\n",
+ "s = [17, 25];\n",
+ "T = [600, 600];\n",
+ "plot(s,T,'--')\n",
+ "\n",
+ "s = [17 ,25];\n",
+ "T = [300 ,300];\n",
+ "plot(s,T,'--')\n",
+ "\n",
+ "suptitle(\"T-s diagram \")\n",
+ "xlabel(\"S\")\n",
+ "ylabel(\"T\")\n",
+ "text(24,400,\"v = C\")\n",
+ "text(20,450,\"p = C\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The net heat flow\n",
+ "Q = 120.0 kJ\n",
+ "(ii) The overall change in entropy\n",
+ "Overall change in entropy = 0.277 kJ/K\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 2,
+ "text": [
+ "<matplotlib.text.Text at 0x4787450>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEhCAYAAACUW2yNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtY1GXex/E3kJaVtilixRC6msppdMRDJvZgaRZqG64H\nTLSezVbL8tyaVopRUpl5yopKtzXsSUsqV9C1VNQOiiIqmOEhLAZDCUJRNATu549bZ8UBE5nhN8D3\ndV1cwfCbHx9J5zv32U0ppRBCCCEu4m50ACGEEK5HioMQQgg7UhyEEELYkeIghBDCjhQHIYQQdqQ4\nCCGEsHON0QGEqK68vDx69+4NQE5ODh4eHjRv3hw3Nze2b99OgwYNqnzPDz74gJSUFBYtWkRsbCzX\nX389I0aMcHR0IVyWFAdR6zVr1ozU1FQAZs2aRePGjZk0aZLD7j969GiH3Ke0tBQPDw+H3EsIZ5Nu\nJVHnVLSuc8+ePXTr1g2LxYLZbObQoUN218TGxtK6dWvuuusuvv32W9vjUVFRzJ0713ZN165dCQgI\nYMCAAZw6dQqAH374gY4dOxIcHMzzzz9P48aNAUhKSqJnz56Eh4djNpsBGDBgAJ07d6Zt27YsXLjQ\n9nNuvPFGpk6ditlspk+fPmzfvp177rmH22+/nfj4eMf9goS4AlIcRL3w7rvvMnnyZFJTU9m9ezcm\nk6nc97OysoiOjmbXrl1s3bqVH374ATc3NwDbfwGGDRtGcnIy+/bto2PHjsTGxgLw9NNP8/zzz5OS\nkkLLli3L3Ts1NZU333yTffv2AbB8+XJ27tzJnj17eOedd8jNzQWgqKiI3r17s3fvXho3bsyMGTPY\nsGEDa9asYcaMGc761QhRISkOol4ICQnhpZde4tVXX+XgwYNcd9115b7/3Xff0bt3b2666SY8PDwY\nPHhwhS2Q7du3c+edd9KhQweWL19ORkYGANu2bWPgwIEADBkypNxzunbtire3t+3rmJgYgoKC6N69\nO0ePHuXgwYMANGzYkD59+gAQFBREaGgobm5uBAYGkp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Uu3bt1G+/\n/WZwOu3ijJ9//rmt5eUKLYeLXZwzKipKtWrVSrVv314NHz78D3PW2uIwZsyYStdOGOHSnPfee6+K\nj49XSim1cuVK1bt3b6Oi2VyaMT09XYWGhqrAwEA1ffp01aRJEwPTlVdYWKiCg4PVZ599ppSyLwau\nUhwKCwtV586dbTkvcLXiUFnOl156SQ0cONCgVPYqy6mUUjExMerRRx81IFV5F2c8ffq06tq1qzpx\n4oRSSheHX3/91eCE2qW/y9zcXFVWVqbKysrUjBkz1PDhwy/7/FpZHM6dO6datGihsrOzDUpl79Kc\nN9xwg+3zsrKycl8bpbJCe+F7HTt2rOFEFato4eSf//xnlZubq5RS6vjx41Ve0OMMl1vg6UrFobKc\nH3zwgerevbs6c+aMQcnK+6MFsz/99JNq165dDacq79KMe/fuVV5eXqply5aqZcuW6pprrlG+vr7q\n2LFjLpXzUhcvPq6MS485VOarr77Cz8+P2267zegolfL19WXz5s0AbNy4kVatWhmcyN6FGSpKKWbP\nns2oUaMMTqSzPPbYY/j7+zNx4kTb42FhYcTFxQEQFxdHWFiYURGBynNeeo3RKsu5bt06XnvtNVav\nXs11111nYEKtspyZmZm2z7/44otys+1qWkUZg4KCOHbsGJmZmWRmZmIymdi1a5dtka+r5AS9+PiC\nVatWERAQ8Ic3clkRERHq1ltvVQ0bNlQmk0ktXbpUKaXUo48+qmJjYw1O918XcjZo0MCW85tvvlEd\nOnRQ/v7+ymKxqO3bt7tUxiVLlqj58+er9u3bq8DAQDVt2jRD812wdetW5ebmpjp06KA6duyoOnbs\nqNauXavy8vJU7969VVBQkOrTp4/hfc8V5UxMTFSfffaZMplM6rrrrlMtWrRQ999/v0vmbNOmjbr9\n9tttjz3xxBMumTM8PFyZzWbl5+enwsLC1NGjR10u48VatWpl+JhDZTkjIyOV2WxW7du3V3379lVW\nq/Wy95FFcEIIIezUym4lIYQQziXFQQghhB0pDkIIIexIcRBCCGFHioMQQgg7UhyEEELYkeIghAO8\n8MILtGvXjg4dOtChQwe2b99udCQhqsWpJ8EJUR8kJSWxYcMG0tPTadCgASdPnqSoqMjoWEJUixQH\nIaopNzeX5s2b2460bdKkCU2aNDE4lRDVIyukhaimkydP0qNHD0pKSggNDWXQoEHce++9RscSolpk\nzEGIamrSpAm7d+9m8eLFtGjRgsjISN5//32jYwlRLdJyEMLBVq1axfvvv8/atWuNjiLEVZOWgxDV\ndPDgQY4cOWL7OjU1FR8fH+MCCeEAMiAtRDUVFhby5JNPcvr0aUpKSmjTpo10K4laT7qVhBBC2JFu\nJSGEEHakOAghhLAjxUEIIYQdKQ5CCCHsSHEQQghhR4qDEEIIO1IchBBC2JHiIIQQws7/A7QEHj3e\nWXM+AAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x46d17d0>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.37 Page no : 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Constant volume heat addition till pressure becomes 5 bar, \n",
+ "(ii) Constant pressure cooling, and \n",
+ "(iii) Isothermal heating to initial state.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Variables\n",
+ "cv = 0.718; \t\t\t#kJ/kg.K\n",
+ "R = 0.287 \t\t\t#kJ/kg.K\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "T1 = 300. \t\t\t#K\n",
+ "V1 = 0.018; \t\t\t#m**3\n",
+ "p2 = 5.*10**5 \t\t\t#Pa\n",
+ "T3 = T1;\n",
+ "cp = cv+R;\n",
+ "p3 = p2;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m = p1*V1/R/T1/1000; \t\t\t#kg\n",
+ "T2 = T1*p2/p1;\n",
+ "\n",
+ "print (\"(i) constant volume process\")\n",
+ "dS_12 = m*cv*math.log(T2/T1);\n",
+ "print (\"dS = %.3f\")%(dS_12), (\"kJ/K\")\n",
+ "\n",
+ "print (\"(ii) Constant prssure process \")\n",
+ "dS_23 = m*cp*math.log(T3/T2);\n",
+ "print (\"dS = %.3f\")%(dS_23), (\"kJ/K\")\n",
+ "\n",
+ "print (\"(iii) Isothermal process\")\n",
+ "dS_31 = m*R*math.log(p3/p1);\n",
+ "print (\"dS = %.5f\")%(dS_31),(\"kJ/K\")\n",
+ "\n",
+ "print (\"T-s diagram\")\n",
+ "s = linspace(math.sqrt(300),math.sqrt(600),72);\n",
+ "T = s**2;\n",
+ "#plot(s,T)\n",
+ "\n",
+ "s = linspace(22.18,math.sqrt(600),24)\n",
+ "T = 10*(s-16.725)**2;\n",
+ "#plot(s,T,'r')\n",
+ "\n",
+ "s = [math.sqrt(300), 22.18];\n",
+ "T = [300 ,300];\n",
+ "#plot(s,T,'g')\n",
+ "\n",
+ "print (\"p-V diagram\")\n",
+ "\n",
+ "V = [0.018, 0.018];\n",
+ "p = [1 ,5];\n",
+ "#plot(V,p)\n",
+ "\n",
+ "p = [5 ,5];\n",
+ "V = [0.0036, 0.018];\n",
+ "#plot(V,p,'r')\n",
+ "\n",
+ "V = linspace(0.0036,0.018,145)\n",
+ "\n",
+ "def f():\n",
+ " return 1*0.018/V;\n",
+ "f1 = f()\n",
+ "\n",
+ "plot(V,f1,'g')\n",
+ "suptitle(\"p-V diagram\")\n",
+ "xlabel(\"V\")\n",
+ "ylabel(\"p\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) constant volume process\n",
+ "dS = 0.024 kJ/K\n",
+ "(ii) Constant prssure process \n",
+ "dS = -0.034 kJ/K\n",
+ "(iii) Isothermal process\n",
+ "dS = 0.00966 kJ/K\n",
+ "T-s diagram\n",
+ "p-V diagram\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 3,
+ "text": [
+ "<matplotlib.text.Text at 0x4047ad0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEdCAYAAAASHSDrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlUFGfCNfDbgKiAikRBBFQEFZCtAcUNbXFfI+7gglvC\noAbNJI6vGecVc6LRxJjEaAzJJBrzmWBe4kIUUKO2ioqIggFRAQXZBNzAlSBQ3x9OeiQsCnZR3c39\nncM5dHdVeeFYfXme6qqSCYIggIiIqBZ6UgcgIiLNxqIgIqI6sSiIiKhOLAoiIqoTi4KIiOrEoiAi\nojqxKEinrF69Gu+9916V55KSkuDk5FTnekqlEuPGjQMA/Prrr1i/fr1oGYm0DYuCdEpAQAB27dpV\n5bnw8HAEBAS89DbGjRuH5cuXv3IWQRDA05RIF7AoSGtkZWXBwcEBM2fOhJOTE6ZMmYInT55UWaZb\nt25o27Yt4uPjVc/93//9H/z9/attLyYmBo6OjvD09MSePXtUz2/fvh1vvfUWgGejiz59+sDDwwPD\nhg1DUVERAODWrVsYNmwYnJ2d8cYbb6BLly64e/cusrKy0KNHDwQGBsLFxQU5OTlYuHAhevXqBWdn\nZ4SGhqr+nS5duuC9996DXC6Hl5cXLly4gOHDh8Pe3h5hYWHq/NURvRIWBWmVtLQ0LFq0CKmpqWjd\nujW+/PLLasv4+/sjPDwcABAXFwczMzPY2dlVWaa0tBRvvvkm9u/fj/Pnz6OgoAAymazatnx8fBAX\nF4cLFy5g2rRp+OijjwA8m+IaOnQoUlJSMHnyZGRnZ6vWycjIwKJFi5CSkoJOnTphzZo1OHfuHC5e\nvIjjx48jJSUFACCTydC5c2ckJiZi4MCBmDNnDvbs2YO4uDisWrVKbb8zolfFoiCtYmNjg759+wIA\nZs6cidjY2GrLTJs2DRERERAEodZppytXrsDW1lZVIDNnzqxxmignJwfDhw+Hq6srNmzYgNTUVADA\nqVOnMH36dADAiB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2WLlVOd+JFbG50m9D9WVU5P2obpy1ncfarSPx0ZFRQndu3cX7OzshLVr1wqC8OyX+tVXX6mW\nWbRokWBnZye4urpWuaRHTesKgiDY29sLnTp1Etzd3QV3d3chODhYI3M+z9bWVi0f7RMjZ1lZmTBz\n5kzB2dlZ8PDwEI4dO6aROc+dOyf07t1bcHNzE/r06VPl44BS5Jw+fbpgaWkpGBoaCtbW1sJ3330n\nCMKzj8cOGTJErR+PFSOnuvcjMTI+TxP2odpyato+VFvO+u5DGn3jIiIikp60N3YlIiKNx6IgIqI6\nsSiIiKhOLAoiIqoTi4LoJfn6+uLQoUNVnvvss8+wcOFCiRIRNQ4WBdFL8vf3R3h4eJXndu3a9cpX\nBCDSdPx4LNFLunv3LhwdHZGXlwcDAwNkZWVh0KBBuHHjhtTRiETFEQXRSzIzM0Pv3r0RFRUFAAgP\nD8e0adMkTkUkPhYFUT08P/20a9cu+Pv7S5yISHyceiKqh4cPH8LOzg4xMTGYPn06rl69KnUkItFx\nREFUDyYmJhg8eDDmzp3Lg9jUZLAoiOrJ398fycnJnHaiJoNTT0REVCeOKIiIqE4sCiIiqhOLgoiI\n6sSiICKiOrEoiIioTiwKIiKq0/8HJIEAIIPDm7IAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x4232ad0>"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.39 Page no : 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the entropy change of 4 kg of a perfect gas \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "m = 4; \t\t\t #kg\n",
+ "T1 = 400; \t\t\t#K\n",
+ "T2 = 500; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "def f12( T): \n",
+ "\t return m*(0.48+0.0096*T)/T\n",
+ "\n",
+ "dS = quad(f12, T1,T2)[0]\n",
+ "\n",
+ "# Results\n",
+ "print (\"dS = %.3f\")%(dS), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dS = 4.268 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.40 Page no : 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the entropy of the gas at 25 bar and 750 K temperature.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1*10**5; \t\t\t#Pa\n",
+ "T1 = 273; \t\t\t#K\n",
+ "p2 = 25*10**5; \t\t\t#Pa\n",
+ "T2 = 750; \t\t\t#K\n",
+ "R = 0.29; \t\t\t#kJ/kg.K ; cp = 0.85+0.00025*T; cv = 0.56+0.00025*T; R = cp-cv;\n",
+ "\n",
+ "# Calculations\n",
+ "v2 = R*T2/p2;\n",
+ "v1 = R*T1/p1;\n",
+ "\n",
+ "def f8( T): \n",
+ "\t return (0.56+0.00025*T)/T\n",
+ "\n",
+ "def f9(v):\n",
+ " return R/v\n",
+ "ds = quad(f8, T1, T2)[0] + quad(f9,v1,v2)[0]\n",
+ "\n",
+ "# Results\n",
+ "print (\"ds = %.3f\")%(ds),(\"kJ/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ds = 0.045 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.41 Page no : 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) Final equilibrium temperature,\n",
+ "(ii) Final pressure on each side of the diaphragm, and\n",
+ "(iii) Entropy change of system.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cv = 0.715; \t\t\t#kJ/kg K\n",
+ "R = 0.287; \t\t\t#kJ/kg K\n",
+ "V_A = 0.25; \t\t\t#m**3\n",
+ "p_Ai = 1.4; \t\t\t#bar\n",
+ "T_Ai = 290; \t\t\t#K\n",
+ "V_B = 0.25; \t\t\t#m**3\n",
+ "p_Bi = 4.2; \t\t\t#bar\n",
+ "T_Bi = 440; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Final equilibrium temperature\")\n",
+ "m_A = p_Ai * 10**5 * V_A / R / 1000/ T_Ai; \t\t\t#kg\n",
+ "m_B = p_Bi * 10**5 * V_B / R / 1000/ T_Bi; \t\t\t#kg\n",
+ "\n",
+ "T_f = (m_B * T_Bi + m_A * T_Ai)/(m_A + m_B);\n",
+ "print (\"T_f = %.3f\")% (T_f), (\"K\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Final pressure on each side of the diaphragm\")\n",
+ "p_Af = p_Ai*T_f/T_Ai;\n",
+ "print (\"p_Af = %.3f\")%(p_Af),(\"bar\")\n",
+ "\n",
+ "p_Bf = p_Bi*T_f/T_Bi;\n",
+ "print (\"p_Bf = %.3f\")%(p_Bf),(\"bar\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) Entropy change of the system\")\n",
+ "dS_A = m_A*cv*math.log(T_f/T_Ai);\n",
+ "dS_B = m_B*cv*math.log(T_f/T_Bi);\n",
+ "dS_net = dS_A+dS_B;\n",
+ "print (\"Net change of entropy = %.3f\")%(dS_net), (\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Final equilibrium temperature\n",
+ "T_f = 389.618 K\n",
+ "(ii) Final pressure on each side of the diaphragm\n",
+ "p_Af = 1.881 bar\n",
+ "p_Bf = 3.719 bar\n",
+ "(iii) Entropy change of the system\n",
+ "Net change of entropy = 0.016 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.42 Page no : 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the change in entropy in each of the adiabatic processes.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cv = 1.25; \t\t\t#kJ/kg.K\n",
+ "T1 = 530.; \t\t\t#K\n",
+ "v1 = 0.0624; \t\t\t#m**3/kg\n",
+ "v2 = 0.186; \t\t\t#m**3/kg\n",
+ "dT_31 = 25.; \t\t\t#K\n",
+ "T3 = T1-dT_31; \t\t\t#K\n",
+ "dT_21 = 165.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "T2 = T1-dT_21; \t\t\t#K\n",
+ "# Path 1-2 : Reversible adiabatic process\n",
+ "ds_12 = 0;\n",
+ "v3 = 0.186; \t\t\t#m**3/kg\n",
+ "v3 = v2;\n",
+ "ds_13 = cv*math.log(T3/T2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Chang in entropy = %.4f\")%(ds_13), (\"kJ/kgK\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Chang in entropy = 0.4058 kJ/kgK\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.44 Page no : 289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Determine the heat interactions with the other two sources of heat.\n",
+ "(ii) Evaluate the entropy change due to each heat interaction with the engine.\n",
+ "(iii) Total entropy change during the cycle.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 500.; \t\t\t#K\n",
+ "T2 = 400.; \t\t\t#K\n",
+ "T3 = 300.; \t\t\t#K\n",
+ "Q1 = 1500.; \t\t\t#kJ/min\n",
+ "W = 200.; \t\t\t#kJ/min\n",
+ "\n",
+ "# Calculations and Results\n",
+ "A = [[1,-1],[(1./400),(-1./300)]];\n",
+ "B = [(-1300),(-3)];\n",
+ "X = linalg.solve(A,B)\n",
+ "\n",
+ "Q2 = X[0];\n",
+ "print (\"Q2 = \"), (Q2), (\"kJ/min\")\n",
+ "\n",
+ "Q3 = X[1];\n",
+ "print (\"Q3 = \"), (Q3), (\"kJ/min\")\n",
+ "\n",
+ "print (\"(ii) Entropy change \")\n",
+ "dS1 = (-Q1)/T1;\n",
+ "print (\"Entropy change of source 1 = \"), (dS1), (\"kJ/K\")\n",
+ "\n",
+ "dS2 = (-Q2)/T2;\n",
+ "print (\"Entropy change of math.sink 2 = \"), (dS2), (\"kJ/K\")\n",
+ "\n",
+ "dS3 = Q3/T3;\n",
+ "print (\"Entropy change of source 3 = \"),(dS3), (\"kJ/K\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) Net change of the entropy\")\n",
+ "dSnet = dS1 + dS2 + dS3;\n",
+ "print (\"dSnet = %d\")% (dSnet)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q2 = -1600.0 kJ/min\n",
+ "Q3 = -300.0 kJ/min\n",
+ "(ii) Entropy change \n",
+ "Entropy change of source 1 = -3.0 kJ/K\n",
+ "Entropy change of math.sink 2 = 4.0 kJ/K\n",
+ "Entropy change of source 3 = -1.0 kJ/K\n",
+ "(iii) Net change of the entropy\n",
+ "dSnet = 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.45 Page no : 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the maximum amount of work that can be recovered as the system is cooled down to the temperature of the reservoir.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 250; \t\t\t#K\n",
+ "T2 = 125; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "#cv = 0.0045*T**2\n",
+ "def f10( T): \n",
+ "\t return 0.045*T**2\n",
+ "\n",
+ "Q1 = quad(f10, T1, T2)[0]\n",
+ "\n",
+ "def f11( T): \n",
+ "\t return 0.045*T\n",
+ "\n",
+ "dS_system = quad(f11, T1, T2)[0]\n",
+ "\n",
+ "dS_universe = 0;\n",
+ "\n",
+ "W_max = ((-Q1) -T2*(dS_universe-dS_system))/1000;\n",
+ "\n",
+ "# Results\n",
+ "print (\"W_max = %.3f\")%(W_max), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W_max = 73.242 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.46 Page no : 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Establish the direction of the flow of the air in the duct.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "cp = 1.005; \t\t\t#kJ/kg K\n",
+ "T_A = 333.; \t\t\t#K\n",
+ "T_B = 288.; \t\t\t#K\n",
+ "p_A = 140.; \t\t\t#kPa\n",
+ "p_B = 110.; \t\t\t#kPa\n",
+ "#h = cp*T\n",
+ "#v/T = 0.287/p\n",
+ "\n",
+ "# Calculations\n",
+ "def f9( T): \n",
+ "\t return cp/T\n",
+ "\n",
+ "def f10(p):\n",
+ " return 0.287/p\n",
+ " \n",
+ "ds_system = quad(f9, T_B, T_A)[0] + quad(f10,p_A,p_B)[0]\n",
+ "ds_surr = 0;\n",
+ "ds_universe = ds_system+ds_surr;\n",
+ "\n",
+ "# Results\n",
+ "print (\"change in entropy of universe = -%.4f\")% (ds_universe), (\"kJ/kgK\")\n",
+ "print (\"Since change in entropy of universe from A to B is -ve\")\n",
+ "print (\"The flow is from B to A\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in entropy of universe = -0.0767 kJ/kgK\n",
+ "Since change in entropy of universe from A to B is -ve\n",
+ "The flow is from B to A\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.47 Page no : 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the change of entropy due to mixing process.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m1 = 3.; \t\t\t#kg\n",
+ "m2 = 4.; \t\t\t#kg\n",
+ "T0 = 273.; \t\t\t#K\n",
+ "T1 = 80.+273; \t\t\t#K\n",
+ "T2 = 15.+273; \t\t\t#K\n",
+ "c_pw = 4.187; \t\t\t#kJ/kgK\n",
+ "\n",
+ "# Calculations\n",
+ "tm = (m1*T1 + m2*T2)/(m1+m2);\n",
+ "Si = m1*c_pw*math.log(T1/T0) + m2*c_pw*math.log(T2/T0);\n",
+ "Sf = (m1+m2)*c_pw*math.log(tm/T0);\n",
+ "dS = Sf-Si;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Net change in entropy = %.3f\")%(dS),(\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net change in entropy = 0.150 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.49 Page no : 294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a)find :\n",
+ "(i) Entropy change of water ;\n",
+ "(ii) Entropy change of the heat reservoir ;\n",
+ "(iii) Entropy change of the universe.\n",
+ "(b)what will the entropy change of the universe be ?\n",
+ "(c) Explain how water might be heated from 0\u00b0C to 90\u00b0C \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "T1 = 273.; \t\t\t#K\n",
+ "T2 = 363.; \t\t\t#K\n",
+ "c = 4.187;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(a)\")\n",
+ "ds_water = m*c*math.log(T2/T1);\n",
+ "print (\"(i) Entropy of water = %.3f\")%(ds_water), (\"kJ/kgK\")\n",
+ "\n",
+ "print (\"(ii) Entropy change of the reservoir \")\n",
+ "Q = m*c*(T2-T1);\n",
+ "ds_reservoir = -Q/T2;\n",
+ "print (\"ds_reservoir = %.3f\")% (ds_reservoir), (\"kJ/K\")\n",
+ "\n",
+ "ds_universe = ds_water+ds_reservoir;\n",
+ "print (\"(iii) Entropy change of universe = %.3f\")% (ds_universe), (\"kJ/K\")\n",
+ "\n",
+ "print (\"(b)\")\n",
+ "T3 = 313; \t\t\t#K\n",
+ "ds_water = m*c*(math.log(T3/T1) + math.log(T2/T3));\n",
+ "ds_res1 = -m*c*(T3-T1)/T3;\n",
+ "ds_res2 = -m*c*(T2-T3)/T2;\n",
+ "\n",
+ "ds_universe = ds_water+ds_res1+ds_res2;\n",
+ "print (\"(iii) Entropy change of universe = %.3f\")%(ds_universe), (\"kJ/K\")\n",
+ "\n",
+ "print (\"(c) The entropy change of universe would be less and less, if the water is heated in more and more stages, by bringing\")\n",
+ "print (\"the water in contact successively with more and more heat reservoirs, each succeeding reservoir being at a higher temperature\") \n",
+ "print (\"than the preceding one.\")\n",
+ "\n",
+ "print (\"When water is heated in infinite steps, by bringing in contact with an infinite number of reservoirs in succession, so that\") \n",
+ "print (\"at any insmath.tant the temperature difference between the water and the reservoir in contact is infinitesimally small, then\") \n",
+ "print (\"the entropy change of the universe would be zero and the water would be reversibly heated.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "(i) Entropy of water = 1.193 kJ/kgK\n",
+ "(ii) Entropy change of the reservoir \n",
+ "ds_reservoir = -1.038 kJ/K\n",
+ "(iii) Entropy change of universe = 0.155 kJ/K\n",
+ "(b)\n",
+ "(iii) Entropy change of universe = 0.081 kJ/K\n",
+ "(c) The entropy change of universe would be less and less, if the water is heated in more and more stages, by bringing\n",
+ "the water in contact successively with more and more heat reservoirs, each succeeding reservoir being at a higher temperature\n",
+ "than the preceding one.\n",
+ "When water is heated in infinite steps, by bringing in contact with an infinite number of reservoirs in succession, so that\n",
+ "at any insmath.tant the temperature difference between the water and the reservoir in contact is infinitesimally small, then\n",
+ "the entropy change of the universe would be zero and the water would be reversibly heated.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.50 Page no : 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Determine the entropy increase of the universe.\n",
+ "(ii) What is the minimum amount of work necessary to convert the water back into ice at \u2013 5\u00b0C ?\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cp = 2.093; \t\t\t#kJ/kg0C\n",
+ "c = 4.187;\n",
+ "Lf = 333.33; \t\t\t#kJ/kg\n",
+ "m = 1.; \t\t\t#kg\n",
+ "T0 = 273.; \t\t\t#K\n",
+ "T1 = 268.; \t\t\t#K\n",
+ "T2 = 298.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q_s = m*cp*(T0-T1);\n",
+ "Q_f = m*Lf;\n",
+ "Q_l = m*c*(T2-T0);\n",
+ "Q = Q_s+Q_f+Q_l;\n",
+ "\n",
+ "print (\"(i) Entropy increase of the universe\")\n",
+ "ds_atm = -Q/T2;\n",
+ "ds_sys1 = m*cp*math.log(T0/T1);\n",
+ "ds_sys2 = Lf/T0;\n",
+ "ds_sys3 = m*c*math.log(T2/T0);\n",
+ "ds_total = ds_sys1+ds_sys2+ds_sys3;\n",
+ "ds_universe = ds_total+ds_atm;\n",
+ "\n",
+ "print (\"Entropy increase of universe = %.3f\")%(ds_universe), (\"kJ/K\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Minimum amount of work necessary to convert the water back into ice at \u2013 5\u00b0C, Wmin.\")\n",
+ "dS_refrigerator = 0;\n",
+ "\n",
+ "dS_system = -1.6263; \t\t\t#kJ/kg K\n",
+ "T = 298; \t\t\t#K\n",
+ "#For minimum work \n",
+ "W_min = T*(-dS_system)-Q;\n",
+ "\n",
+ "print (\"Minimum work done = %.3f\")% (W_min), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Entropy increase of the universe\n",
+ "Entropy increase of universe = 0.122 kJ/K\n",
+ "(ii) Minimum amount of work necessary to convert the water back into ice at \u2013 5\u00b0C, Wmin.\n",
+ "Minimum work done = 36.167 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch6.ipynb b/Industrial_Instrumentation/ch6.ipynb
new file mode 100644
index 00000000..a3874b6a
--- /dev/null
+++ b/Industrial_Instrumentation/ch6.ipynb
@@ -0,0 +1,1286 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Availability and Irreversibility"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page no : 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the irreversibility if the sink temperature is 293 K. \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T0 = 293.; \t\t\t#K\n",
+ "T1 = 300.; \t\t\t#K\n",
+ "T2 = 370.; \t\t\t#K\n",
+ "cv = 0.716;\n",
+ "cp = 1.005;\n",
+ "R = 0.287;\n",
+ "p1 = 1.; \t\t\t#bar\n",
+ "p2 = 6.8; \t\t\t#bar\n",
+ "m = 1.; \t\t\t#kg\n",
+ "\n",
+ "# Calculations\n",
+ "Wmax = -(cv*(T2-T1) - T0*(cp*math.log(T2/T1)-R*math.log(p2/p1)));\n",
+ "n = 1/(1-(math.log(T2/T1)/math.log(p2/p1)));\n",
+ "Wact = m*R*(T1-T2)/(n-1);\n",
+ "I = Wmax - Wact;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Irreversibility = %.3f\")%(I),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Irreversibility = 13.979 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page no : 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "(i) The entropy produced during heat transfer ;\n",
+ "(ii) The decrease in available energy after heat transfer.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 1000.; \t\t\t#K\n",
+ "T2 = 500.; \t\t\t#K\n",
+ "T0 = 300.; \t\t\t#K\n",
+ "Q = 7200.; \t\t\t#kJ/min\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Net change of entropy :\")\n",
+ "dS_source = -Q/T1;\n",
+ "dS_system = Q/T2;\n",
+ "dS_net = dS_source+dS_system;\n",
+ "print (\"dS_net = \"), (dS_net), (\"kJ/min.K\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Decrease in available energy :\")\n",
+ "AE_source = (T1-T0)*(-dS_source); \t\t\t#Available energy with the source\n",
+ "AE_system = (T2-T0)*dS_system; \t\t\t#Available energy with the system\n",
+ "dAE = AE_source - AE_system; \t\t\t#Decrease in available energy\n",
+ "print (\"dAE = \"), (dAE), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Net change of entropy :\n",
+ "dS_net = 7.2 kJ/min.K\n",
+ "(ii) Decrease in available energy :\n",
+ "dAE = 2160.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page no : 315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The availability if the system goes through the ideal work producing process.\n",
+ "(ii) The availability and effectiveness if the air is cooled at constant pressure to atmos-\n",
+ "pheric temperature without bringing it to complete dead state. Take c v = 0.718 kJ/kg K ;\n",
+ "c p = 1.005 kJ/kg K\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 8.; \t\t\t#kg\n",
+ "T1 = 650.; \t\t\t#K\n",
+ "p1 = 5.5*10**5; \t\t\t#Pa\n",
+ "p0 = 1*10.**5; \t\t\t#Pa\n",
+ "T0 = 300.; \t\t\t#K\n",
+ "cp = 1.005; \t\t\t#kJ/kg.K\n",
+ "cv = 0.718;\n",
+ "R = 0.287;\n",
+ "#p1*v1/T1 = p0*v0/T0\n",
+ "#Let r = v1/v0 = 1/2.54\n",
+ "r = 1/2.54;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Change in available energy(for bringing the system to dead state) = \")\n",
+ "ds = cv*math.log(T1/T0) + R*math.log(r);\n",
+ "dAE = m*(cv*(T1-T0) - T0*ds);\n",
+ "#dAE is the change in available energy in kJ\n",
+ "V1 = m*R*10**3*T1/p1;\n",
+ "V0 = V1/r;\n",
+ "L = p0*(V0 - V1)/10**3;\n",
+ "print (\"Loss of availability, L = \"), (L), (\"kJ\")\n",
+ "\n",
+ "print (\"(ii) Available Energy and Effectiveness\")\n",
+ "Q = m*cp*(T1-T0);\n",
+ "ds = m*cp*math.log(T1/T0);\n",
+ "Unavailable_energy = T0*ds;\n",
+ "Available_energy = Q - Unavailable_energy;\n",
+ "print (\"Available energy = %.3f\")% (Available_energy), (\"kJ\")\n",
+ "\n",
+ "Effectiveness = Available_energy/dAE;\n",
+ "print (\"Effectiveness = %.3f\")% (Effectiveness)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Change in available energy(for bringing the system to dead state) = \n",
+ "Loss of availability, L = 417.872 kJ\n",
+ "(ii) Available Energy and Effectiveness\n",
+ "Available energy = 949.066 kJ\n",
+ "Effectiveness = 0.719\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page no : 316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Obtain the results on the basis of 1 kg of water.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "c_pg = 1.; \t\t\t#kJ/kgK\n",
+ "h_fg = 1940.7; \t\t\t#kJ/kg\n",
+ "Ts = 473.; \t \t\t#K ; Temperature of saturation of steam\n",
+ "T1 = 1273.; \t\t\t#K ; Initial temperature of gases\n",
+ "T2 = 773.; \t\t \t#K ; Final temperature of gases\n",
+ "T0 = 293.; \t\t\t #K ; atmospheric temperature\n",
+ "\n",
+ "# Calculations\n",
+ "#Heat lost by gases = Heat gained by 1 kg saturated water when it is converted to steam at 200 0C\n",
+ "m_g = h_fg/c_pg/(T1-T2);\n",
+ "dS_g = m_g*c_pg*math.log(T2/T1);\n",
+ "dS_w = h_fg/Ts;\n",
+ "dS_net = dS_g + dS_w;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Net change in entropy = %.3f\")% (dS_net), (\"kJ/K\")\n",
+ "\n",
+ "E = T0*dS_net; \t\t\t#Increase in unavailable energy due to hea transfer\n",
+ "print (\"Increase in unavailable energy = %.3f\")%(E), (\"kJ per kg of steam formed\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net change in entropy = 2.167 kJ/K\n",
+ "Increase in unavailable energy = 634.847 kJ per kg of steam formed\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page no : 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the loss in available energy due to above heat transfer.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "m_g = 3.; \t\t\t#kg\n",
+ "p1 = 2.5; \t\t\t#bar\n",
+ "T1 = 1200.; \t\t\t#K; Temperature of infinite source\n",
+ "T1a = 400.; \t\t\t#K; Initial temperature\n",
+ "Q = 600.; \t\t\t#kJ\n",
+ "cv = 0.81; \t\t\t#kJ/kg.K\n",
+ "T0 = 290.; \t\t\t#K; Surrounding Temperature\n",
+ "\n",
+ "# Calculations\n",
+ "#final temperature = T2a\n",
+ "T2a = Q/m_g/cv + T1a;\n",
+ "AE = (T1-T0)*Q/T1; \t\t\t#Available energy with the source\n",
+ "dS = m_g*cv*math.log(T2a/T1a); \t\t\t#Change in entropy of the gas\n",
+ "UAE = T0*dS; \t\t\t#Unavailability of the gas \n",
+ "A = Q-UAE; \t\t\t#Available energy with the gas\n",
+ "loss = AE-A;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Loss in available energy due to heat transfer = %.3f\")%(loss),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss in available energy due to heat transfer = 193.783 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 Page no : 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the unavailable energy in 60 kg of water at 60\u00b0C \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "m = 60.; \t\t\t#kg\n",
+ "T1 = 333.; \t\t\t#K\n",
+ "T0 = 279.; \t\t\t#K\n",
+ "p = 1.; \t\t\t#atm\n",
+ "cp = 4.187;\n",
+ "\n",
+ "# Calculations\n",
+ "def f16( T): \n",
+ "\t return m*cp*(1-T0/T)\n",
+ "\n",
+ "Wmax = quad(f16, T0, T1)[0]\n",
+ "Q1 = m*cp*(T1-T0);\n",
+ "#Let unavailable energy = E\n",
+ "E = Q1-Wmax;\n",
+ "\n",
+ "# Results\n",
+ "print (\"unavailable energy = %.3f\")%(E), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "unavailable energy = 12401.141 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 Page no : 319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the loss in availability for the process.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 15.; \t\t\t#kg\n",
+ "T1 = 340.; \t\t\t#K\n",
+ "T0 = 300.; \t\t\t#K\n",
+ "cp = 4.187; \t\t\t#kJ/kgK\n",
+ "\n",
+ "# Calculations\n",
+ "#Work added during churning = Increase in enthalpy of water\n",
+ "W = m*cp*(T1-T0);\n",
+ "ds = cp*math.log(T1/T0);\n",
+ "AE = m*(cp*(T1-T0)-T0*ds);\n",
+ "AE_loss = W-AE; \t\t\t#Loss in availability\n",
+ "\n",
+ "# Results\n",
+ "print (\"Loss in availability %.3f\")% (AE_loss), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss in availability 2358.261 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8 Page no : 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Determine the availability of the system if the surrounding pressure and temperature\n",
+ "are 1 bar and 290 K respectively.\n",
+ "(ii) determine the availability and effectiveness\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 5.; \t\t\t#kg\n",
+ "T1 = 550.; \t\t\t#K\n",
+ "p1 = 4*10.**5; \t\t\t#Pa\n",
+ "T2 = 290.; \t\t\t#K\n",
+ "T0 = T2;\n",
+ "p2 = 1.*10**5; \t\t\t#Pa\n",
+ "p0 = p2;\n",
+ "cp = 1.005; \t\t\t#kJ/kg K\n",
+ "cv = 0.718; \t\t\t#kJ/kg K\n",
+ "R = 0.287; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Availability of the system :\")\n",
+ "ds = cp*math.log(T1/T0) - R*math.log(p1/p0);\n",
+ "Availability = m*(cv*(T1-T0) - T0*ds);\n",
+ "print (\"Availability of the system = %.3f\")% (Availability), (\"kJ\")\n",
+ "\n",
+ "print (\"(ii) Available energy and Effectiveness\")\n",
+ "Q = m*cp*(T1-T0);\n",
+ "dS = m*cp*math.log(T1/T0);\n",
+ "E = T0*dS; \t\t\t#Unavailable energy\n",
+ "AE = Q-E;\n",
+ "print (\"Available Energy = %.3f\")%(AE), (\"kJ\")\n",
+ "\n",
+ "Effectiveness = AE/Availability;\n",
+ "print (\"Effectiveness = %.3f\")%(Effectiveness)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Availability of the system :\n",
+ "Availability of the system = 577.612 kJ\n",
+ "(ii) Available energy and Effectiveness\n",
+ "Available Energy = 373.806 kJ\n",
+ "Effectiveness = 0.647\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 Page no : 321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine actual and minimum power required to run the compressor. \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 0.287; \t\t\t#kJ/kgK\n",
+ "cp = 1.005; \t\t\t#kJ/kgK\n",
+ "m = 25./60; \t\t\t#kg/s\n",
+ "p1 = 1.; \t\t\t#bar\n",
+ "p2 = 2.; \t\t\t#bar\n",
+ "T1 = 288.; \t\t\t#K\n",
+ "T0 = T1;\n",
+ "T2 = 373.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "W_act = cp*(T2-T1); \t\t\t#W_actual\n",
+ "W_total = m*W_act;\n",
+ "\n",
+ "print (\"Total actual power required = %.3f\")%(W_total), (\"kW\")\n",
+ "\n",
+ "ds = cp*math.log(T2/T1) - R*math.log(p2/p1);\n",
+ "Wmin = cp*(T2-T1) - T0*(ds);\n",
+ "\n",
+ "\n",
+ "W = m*Wmin;\n",
+ "print (\"Minimuumm work required = %.3f\")%(W), (\"kW\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total actual power required = 35.594 kW\n",
+ "Minimuumm work required = 28.276 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 Page no : 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the loss in availability if the surrounding temperature is 290 K.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_O2 = 1.; \t\t\t#kg\n",
+ "m_H2 = 1.; \t\t\t#kg\n",
+ "p = 1*10.**5; \t\t\t#Pa\n",
+ "T_O2 = 450.; \t\t\t#K\n",
+ "T_H2 = 450.; \t\t\t#K\n",
+ "T0 = 290.; \t\t\t#K\n",
+ "R0 = 8.314;\n",
+ "M_O2 = 32.;\n",
+ "M_H2 = 2.;\n",
+ "\n",
+ "# Calculations\n",
+ "R_O2 = R0/M_O2;\n",
+ "v_O2 = m_O2*R_O2*T_O2/p;\n",
+ "R_H2 = R0/M_H2;\n",
+ "v_H2 = m_H2*R_H2*T_H2/p;\n",
+ "v_f = v_O2 + v_H2; \t\t\t#total volume after mixing\n",
+ "dS_O2 = R_O2*math.log(v_f/v_O2);\n",
+ "dS_H2 = R_H2*math.log(v_f/v_H2);\n",
+ "dS_net = dS_O2 + dS_H2;\n",
+ "#Let E be the loss in availability \n",
+ "E = T0*dS_net;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Loss in availability = %.3f\")% (E), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss in availability = 286.555 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.11 Page no : 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the decrease in available energy \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T0 = 283.; \t\t\t#K\n",
+ "cp = 4.18; \t\t\t#kJ/kgK\n",
+ "m1 = 20.; \t\t\t#kg\n",
+ "T1 = 363.; \t\t\t#K\n",
+ "m2 = 30.; \t\t\t#kg\n",
+ "T2 = 303.; \t\t\t#K\n",
+ "T3 = 327.; \t\t\t#K\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "def f13( T): \n",
+ "\t return m1*cp*(1-T0/T)\n",
+ "\n",
+ "AE1 = quad(f13, T0, T1)[0]\n",
+ "\n",
+ "def f14( T): \n",
+ "\t return m2*cp*(1-T0/T)\n",
+ "\n",
+ "AE2 = quad(f14, T0, T2)[0]\n",
+ "AE_total = AE1 + AE2; \t\t\t#before mixing\n",
+ "#If T K is the final temperature after mixing\n",
+ "T = (m1*T1+m2*T2)/(m1+m2);\n",
+ "m_total = m1+m2;\n",
+ "\n",
+ "#Available energy of 50kg of water at 54 0C\n",
+ "AE3 = m_total*cp*((T3-T0) - T0*math.log(T3/T0));\n",
+ "\n",
+ "#Decrease in available energy due to mixing dAE\n",
+ "dAE = AE_total - AE3;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Decrease in avialble energy = %.3f\")% (dAE), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrease in avialble energy = 234.184 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.12 Page no : 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the loss in availability on the basis of one kg of oil per second.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T_w1 = 323.; \t\t\t#K\n",
+ "T_w2 = 343.; \t\t\t#K\n",
+ "T_o1 = 513.; \t\t\t#K\n",
+ "T_o2 = 363.; \t\t\t#K\n",
+ "SG_oil = 0.82;\n",
+ "c_po = 2.6; \t\t\t#kJ/kg K\n",
+ "c_pw = 4.18; \t\t\t#kJ/kg K\n",
+ "T0 = 300.; \t\t\t#K\n",
+ "m_o = 1.; \t\t\t#kg\n",
+ "\n",
+ "# Calculations\n",
+ "#Heat lost by oil = Heat gained by water\n",
+ "m_w = (m_o*c_po*(T_o1-T_o2))/(c_pw*(T_w2-T_w1));\n",
+ "dS_w = m_w*c_pw*math.log(T_w2/T_w1);\n",
+ "dS_o = m_o*c_po*math.log(T_o2/T_o1);\n",
+ "dAE_w = m_w*(c_pw*(T_w2-T_w1))-T0*dS_w;\n",
+ "dAE_o = m_o*(c_po*(T_o2-T_o1))-T0*dS_o;\n",
+ "\n",
+ "# Loss in availability E = \n",
+ "E = dAE_w+dAE_o;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Loss in availability = %.3f\")%(E),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss in availability = -81.676 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.13 Page no : 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the net increase in entropy and unavailable energy when the system reaches common temperature\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_i = 1.; \t\t\t#kg\n",
+ "T_i = 273.; \t\t\t#K\n",
+ "m_w = 12.; \t\t\t#kg\n",
+ "T_w = 300.; \t\t\t#K\n",
+ "T0 = 288.; \t\t\t#K\n",
+ "c_pw = 4.18; \t\t\t#kJ/kg K\n",
+ "c_pi = 2.1; \t\t\t#kJ/kg K\n",
+ "L_i = 333.5; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations\n",
+ "Tc = (m_w*c_pw*T_w + m_i*c_pw*T_i - L_i)/(m_w*c_pw + m_i*c_pw);\n",
+ "dS_w = m_w*c_pw*math.log(Tc/T_w);\n",
+ "dS_i = m_i*c_pw*math.log(Tc/T_i) + L_i/T_i;\n",
+ "dS_net = dS_w+dS_i;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Increase in entropy = %.3f\")% (dS_net), (\"kJ/K\")\n",
+ "\n",
+ "dAE = T0*dS_net;\n",
+ "print (\"Increase in unavailable energy = %.3f\")% (dAE),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Increase in entropy = 0.107 kJ/K\n",
+ "Increase in unavailable energy = 30.878 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.14 Page no : 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What is the fraction of the available energy in the heat transferred from the process vapour\n",
+ "at 400\u00b0C that is lost due to the irreversible heat transfer at 200\u00b0C ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 673.; \t\t\t#K\n",
+ "T2 = 473.; \t\t\t#K\n",
+ "T0 = 303.; \t\t\t#K\n",
+ "T1a = T2;\n",
+ "\n",
+ "# Calculations\n",
+ "UAE = T0*(T1-T1a)/T1a/(T1-T0);\n",
+ "\n",
+ "# Results\n",
+ "print (\"the fraction of energy that becomes unavailable = %.3f\")%(UAE)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the fraction of energy that becomes unavailable = 0.346\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.15 Page no : 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the effectiveness of the heating process when the atmospheric temperature is 15\u00b0C.\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "T2 = 353.; \t\t\t#K\n",
+ "Tf = 1773.; \t\t\t#K\n",
+ "T0 = 288.; \t\t\t#K\n",
+ "c_pl = 6.3; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "dAE = c_pl*(T2-T1) - T0*c_pl*math.log(T2/T1);\n",
+ "n = (1-T0/Tf); \t\t\t#efficiency\n",
+ "E = c_pl*(T2-T1)*n;\n",
+ "Effectiveness = dAE/E;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Effectiveness of the heating process = %.3f\")%(Effectiveness)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effectiveness of the heating process = 0.126\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.16 Page no : 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate :\n",
+ "(i) The ratio of mass flow of air initially at 100\u00b0C to that initially at 20\u00b0C.\n",
+ "(ii) The effectiveness of heating process, if the atmospheric temperature is 20\u00b0C.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T0 = 293.; \t\t\t#K\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "T2 = 373.; \t\t\t#K\n",
+ "T3 = 323.; \t\t\t#K\n",
+ "cp = 1.005;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The ratio of mass flow\")\n",
+ "x = (T3-T1)/(T2-T3);\n",
+ "print (\"x = \"), (x)\n",
+ "\n",
+ "ds_13 = cp*math.log(T3/T1);\n",
+ "ds_32 = cp*math.log(T2/T3);\n",
+ "A = cp*(T3-T1) - T1*ds_13; \t \t\t#Increase of availability of system\n",
+ "B = x*(cp*(T2-T3)-T0*(ds_32));\t\t\t# Loss of availability of surroundings\n",
+ "Effectiveness = A/B;\n",
+ "print (\"Effectiveness of heating process = %.3f\")%(Effectiveness)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The ratio of mass flow\n",
+ "x = 0.6\n",
+ "Effectiveness of heating process = 0.306\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.17 Page no : 329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine :\n",
+ "(i) The maximum work ;\n",
+ "(ii) The change in availability ;\n",
+ "(iii) The irreversibility.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 2.5; \t\t\t#kg\n",
+ "p1 = 6.*10**5; \t\t\t#Pa\n",
+ "r = 2.; \t\t\t#r = V2/V1\n",
+ "cv = 0.718; \t\t\t#kJ/kg K\n",
+ "R = 0.287; \t\t\t#kJ/kg K\n",
+ "T1 = 363.; \t\t\t#K\n",
+ "p2 = 1.*10**5; \t\t\t#Pa\n",
+ "T2 = 278.; \t\t\t#K\n",
+ "V1 = m*R*T1/p1;\n",
+ "V2 = 2*V1;\n",
+ "T0 = 278.; \t\t\t#K\n",
+ "p0 = 1.*10**5; \t\t\t#Pa\n",
+ "Q = 0.; \t\t\t#adiabatic process\n",
+ "\n",
+ "# Calculations and Results\n",
+ "dS = m*cv*math.log(T2/T1) + m*R*math.log(V2/V1);\n",
+ "Wmax = m*(cv*(T1-T2)) + T0*(cv*math.log(T2/T1) + R*math.log(V2/V1));\n",
+ "print (\"(i)The maximum work\"),(\"Wmax = %.3f\")% (Wmax), (\"kJ\")\n",
+ "\n",
+ "dA = Wmax+p0*(V1-V2);\n",
+ "print (\"(ii)Change in availability = %.3f\")%(dA), (\"kJ\")\n",
+ "\n",
+ "I = T0*m*(cv*math.log(T2/T1)+R*math.log(V2/V1));\n",
+ "print (\"(iii)Irreversibility = %.3f\")% (I),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)The maximum work Wmax = 154.628 kJ\n",
+ "(ii)Change in availability = 111.219 kJ\n",
+ "(iii)Irreversibility = 5.132 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.18 Page no : 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine per kg of air :\n",
+ "(i) The decrease in availability ;\n",
+ "(ii) The maximum work ;\n",
+ "(iii) The irreversibility.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 1.; \t\t\t#kg\n",
+ "p1 = 7.*10**5; \t\t\t#Pa\n",
+ "T1 = 873.; \t\t\t#K\n",
+ "p2 = 1.*10**5; \t\t\t#Pa\n",
+ "T2 = 523.; \t\t\t#K\n",
+ "T0 = 288.; \t\t\t#K\n",
+ "Q = -9.; \t\t\t#kJ/kg\n",
+ "cp = 1.005; \t\t\t#kJ/kg K\n",
+ "R = 0.287; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The decrease in availability \")\n",
+ "dA = cp*(T1-T2) - T0*(R*math.log(p2/p1) - cp*math.log(T2/T1));\n",
+ "print (\"dA = %.3f\")%(dA), (\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) The maximum work\")\n",
+ "Wmax = dA; \t\t\t#change in availability\n",
+ "print (\"Wmax %.3f\")% (Wmax), (\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "W = cp*(T1-T2) + Q;\n",
+ "I = Wmax - W;\n",
+ "print (\"(iii)Irreversibility = %.3f\")%(I), (\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The decrease in availability \n",
+ "dA = 364.295 kJ/kg\n",
+ "(ii) The maximum work\n",
+ "Wmax 364.295 kJ/kg\n",
+ "(iii)Irreversibility = 21.545 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.19 Page no : 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine\n",
+ "(i) The irreversibility ;\n",
+ "(ii) The effectiveness.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cp = 1.005; \t\t\t#kJ/kg K\n",
+ "cv = 0.718; \t\t\t#kJ/kg K\n",
+ "R = 0.287; \t\t\t#kJ/kg K\n",
+ "m = 1.; \t\t\t#kg\n",
+ "T1 = 290.; \t\t\t#K\n",
+ "T0 = 290.; \t\t\t#K\n",
+ "T2 = 400.; \t\t\t#K\n",
+ "p1 = 1.; \t\t\t#bar\n",
+ "p0 = 1.; \t\t\t#bar\n",
+ "p2 = 6.; \t\t\t#bar\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#Wrev = change in internal energy - T0*change in entropy\n",
+ "Wrev = -(cv*(T2-T1) - T0*(cp*math.log(T2/T1) - R*math.log(p2/p1)));\n",
+ "n = (1./(1-math.log(T2/T1)/math.log(p2/p1)));\n",
+ "Wact = m*R*(T1-T2)/(n-1);\n",
+ "\n",
+ "I = Wrev-Wact;\n",
+ "print (\"(i)Irreversibility = %.3f\")% (I), (\"kJ\")\n",
+ "\n",
+ "effectiveness = Wrev/Wact*100;\n",
+ "print (\"(ii)The effectiveness = %.3f\")%(effectiveness), (\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Irreversibility = 9.945 kJ\n",
+ "(ii)The effectiveness = 93.109 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.20 Page no : 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) find the rise in the temperature of the bearings when the flywheel has come to rest.\n",
+ "(ii) Calculate the greatest possible amount of the above heat which may be returned to the\n",
+ "flywheel? What would be the final r.p.m. of the flywheel, if it is set in motion with this available energy ?\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "I = 0.62; \t\t\t#kg/m**2\n",
+ "N1 = 2500.; \t\t\t#rpm\n",
+ "w1 = 2*math.pi*N1/60; \t\t\t#rad/s\n",
+ "m = 1.9; \t\t\t#kg; Water equivalent of shaft bearings\n",
+ "cp = 4.18;\n",
+ "T0 = 293.; \t\t\t#K\n",
+ "t0 = 20.; \t\t\t#0C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i)Rise in temperature of bearings\")\n",
+ "KE = 1./2*I*w1**2/1000; \t\t\t#kJ\n",
+ "dT = KE/(m*cp); \t\t\t#rise in temperature of bearings\n",
+ "print (\"dT = %.3f\")% (dT), (\"0C\")\n",
+ "\n",
+ "t2 = t0+dT;\n",
+ "print (\"Final temperature of the bearings = %.3f\")% (t2), (\"0C\")\n",
+ "\n",
+ "T2 = t2+273;\n",
+ "print (\"(ii)Final r.p.m. of the flywheel\")\n",
+ "def f15( T): \n",
+ "\t return m*cp*(1-T0/T)\n",
+ "\n",
+ "AE = quad(f15, T0, T2)[0]\n",
+ "UE = KE - AE;\n",
+ "\n",
+ "print (\"Available energy = %.3f\")% (AE), (\"kJ\")\n",
+ "\n",
+ "UAE = KE-AE;\n",
+ "print (\"Unavailable energy = %.3f\")%(UAE), (\"kJ\")\n",
+ "\n",
+ "w2 = math.sqrt(AE*10**3*2/I);\n",
+ "N2 = w2*60/2/math.pi;\n",
+ "print (\"Final rpm of the flywheel = %.3f\")%(N2), (\"rpm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Rise in temperature of bearings\n",
+ "dT = 2.675 0C\n",
+ "Final temperature of the bearings = 22.675 0C\n",
+ "(ii)Final r.p.m. of the flywheel\n",
+ "Available energy = 0.096 kJ\n",
+ "Unavailable energy = 21.151 kJ\n",
+ "Final rpm of the flywheel = 168.407 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.21 Page no : 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) Reversible work and actual work assuming the process to be adiabatic ;\n",
+ "(ii) Irreversibility and effectiveness of the system on the basis of 1 kg of air flow.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 8.; \t\t\t#bar\n",
+ "T1 = 453.; \t\t\t#K\n",
+ "p2 = 1.4; \t\t\t#bar\n",
+ "T2 = 293.; \t\t\t#K\n",
+ "T0 = T2;\n",
+ "p0 = 1.; \t\t\t#bar\n",
+ "m = 1.; \t\t\t#kg\n",
+ "C1 = 80.; \t\t\t#m/s\n",
+ "C2 = 40.; \t\t\t#m/s\n",
+ "cp = 1.005; \t\t\t#kJ/kg K\n",
+ "R = 0.287; \t\t\t#kJ/kg K \n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Reversible work and actual work \")\n",
+ "A1 = cp*(T1-T0)-T0*(cp*math.log(T1/T0)-R*math.log(p1/p0))+C1**2/2/10**3; \t\t\t#Availability at the inlet\n",
+ "A2 = cp*(T2-T0)-T0*(cp*math.log(T2/T0)-R*math.log(p2/p0))+C2**2/2/10**3; \t\t\t#Availability at the exit\n",
+ "\n",
+ "W_rev = A1-A2;\n",
+ "print (\"W_rev = %.3f\")%(W_rev), (\"kJ/kg\")\n",
+ "\n",
+ "W_act = cp*(T1-T2) + (C1**2-C2**2)/2/10**3;\n",
+ "print (\"W_act = %.3f\")%(W_act),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) Irreversibilty and effectiveness = \")\n",
+ "\n",
+ "I = W_rev-W_act;\n",
+ "print (\"Irreversibilty = %.3f\")% (I), (\"kJ/kg\")\n",
+ "\n",
+ "Effectiveness = W_act/W_rev*100;\n",
+ "print (\"Effectiveness = %.3f\")%(Effectiveness),(\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Reversible work and actual work \n",
+ "W_rev = 181.464 kJ/kg\n",
+ "W_act = 163.200 kJ/kg\n",
+ "(ii) Irreversibilty and effectiveness = \n",
+ "Irreversibilty = 18.264 kJ/kg\n",
+ "Effectiveness = 89.935 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.22 Page no : 335 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The isentropic efficiency of the process ;\n",
+ "(ii) The loss of availability of the system assuming an atmospheric temperature of 20\u00b0C ;\n",
+ "(iii) The effectiveness of the process ;\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p1 = 20.; \t\t\t#bar\n",
+ "t1 = 400.; \t\t\t#0C\n",
+ "p2 = 4.; \t\t\t#bar\n",
+ "t2 = 250.; \t\t\t#0C\n",
+ "t0 = 20.; \t\t\t#0C\n",
+ "T0 = t0+273;\n",
+ "h1 = 3247.6; \t\t\t#kJ/kg\n",
+ "s1 = 7.127; \t\t\t#kJ/kg K\n",
+ "#let h2' = h2a and s2' = s2a\n",
+ "h2a = 2964.3; \t\t\t#kJ/kg\n",
+ "s2a = 7.379; \t\t\t#kJ/kg K\n",
+ "s2 = s1;\n",
+ "s1a = s1;\n",
+ "#By interpolation, we get\n",
+ "h2 = 2840.8; \t\t\t#kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n_isen = (h1-h2a)/(h1-h2);\n",
+ "print (\"(i)Isentropic efficiency = %.3f\")%(n_isen)\n",
+ "\n",
+ "A = h1-h2a + T0*(s2a-s1a);\n",
+ "print (\"(ii)Loss of availability = %.3f\")%(A), (\"kJ/kg\")\n",
+ "\n",
+ "Effectiveness = (h1-h2a)/A;\n",
+ "print (\"(iii)Effectiveness = %.3f\")% (Effectiveness)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)Isentropic efficiency = 0.696\n",
+ "(ii)Loss of availability = 357.136 kJ/kg\n",
+ "(iii)Effectiveness = 0.793\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch7.ipynb b/Industrial_Instrumentation/ch7.ipynb
new file mode 100644
index 00000000..f35bb080
--- /dev/null
+++ b/Industrial_Instrumentation/ch7.ipynb
@@ -0,0 +1,210 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Thermodynamic Relations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.17 Page no : 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the following :\n",
+ "(i) Work done on the copper during the process,\n",
+ "(ii) Change in entropy,\n",
+ "(iii) The heat transfer,\n",
+ "(iv) Change in internal energy, and\n",
+ "(v) (c p \u2013 c v ) for this change of state.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "B = 5.*10**(-5); \t\t\t# /K\n",
+ "K = 8.6*10**(-12); \t\t\t# m**2/N\n",
+ "v = 0.114*10**(-3); \t\t\t#m**3/kg\n",
+ "p2 = 800.*10**5; \t\t\t#Pa\n",
+ "p1 = 20.*10**5; \t\t\t#Pa\n",
+ "T = 288.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "W = -v*K/2*(p2**2-p1**2);\n",
+ "print (\"(i) Work done on the copper = %.3f\")%(W),(\"J/kg\")\n",
+ "\n",
+ "ds = -v*B*(p2-p1);\n",
+ "print (\"(ii) Change in entropy = %.3f\")% (ds), (\"J/kg K\")\n",
+ "\n",
+ "Q = T*ds;\n",
+ "print (\"(iii) The heat transfer = %.3f\")%(Q), (\"J/kg\")\n",
+ "\n",
+ "du = Q-W;\n",
+ "print (\"(iv) Change in internal energy = %.3f\")%(du),(\"J/kg\")\n",
+ "\n",
+ "R = B**2*T*v/K;\n",
+ "print (\"(v) cp \u2013 cv = %.3f\")%(R),(\"J/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Work done on the copper = -3.135 J/kg\n",
+ "(ii) Change in entropy = -0.445 J/kg K\n",
+ "(iii) The heat transfer = -128.045 J/kg\n",
+ "(iv) Change in internal energy = -124.909 J/kg\n",
+ "(v) cp \u2013 cv = 9.544 J/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.18 Page no : 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Using Clausius-Claperyon\u2019s equation, find enthalpy of vapourisation.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "vg = 0.1274; \t\t\t#m**3/kg\n",
+ "vf = 0.001157; \t\t\t#m**3/kg\n",
+ "# dp/dT = 32; \t\t\t#kPa/K\n",
+ "T3 = 473; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "h_fg = 32*10**3*T3*(vg-vf)/10**3;\n",
+ "\n",
+ "# Results\n",
+ "print (\" enthalpy of vapourisation = %.3f\")%(h_fg),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " enthalpy of vapourisation = 1910.814 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.19 Page no : 372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the pressure an ice skate blade must exert to allow smooth ice skate at \u2013 10\u00b0C.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "h_fg = 334.; \t\t\t#kJ/kg\n",
+ "v_liq = 1.; \t\t\t#m**3/kg\n",
+ "v_ice = 1.01; \t\t\t#m**3/kg\n",
+ "T1 = 273.; \t\t\t#K\n",
+ "T2 = 263.; \t\t\t#K\n",
+ "p1 = 1.013*10**5; \t\t\t#Pa\n",
+ "\n",
+ "# Calculations\n",
+ "p2 = (p1+h_fg*10**3/(v_ice-v_liq)*math.log(T1/T2))/10**5;\n",
+ "\n",
+ "# Results\n",
+ "print (\"pressure = %.3f\")%(p2),(\"bar\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure = 13.477 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.20 Page no : 372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the specific volume v g of saturation mercury vapour at 0.1 bar\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "h_fg = 294.54; \t\t\t#kJ/kg\n",
+ "p = 0.1; \t\t\t#bar\n",
+ "T = 523; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "vg = h_fg*10**3/T/(2.302*3276.6*p*10**5/T**2 - 0.652*p*10**5/T);\n",
+ "\n",
+ "# Results\n",
+ "print (\"specific volume = %.3f\")%(vg),(\"m**3/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "specific volume = 2.139 m**3/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch8.ipynb b/Industrial_Instrumentation/ch8.ipynb
new file mode 100644
index 00000000..5b548006
--- /dev/null
+++ b/Industrial_Instrumentation/ch8.ipynb
@@ -0,0 +1,966 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Ideal and Real Gases"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no : 392"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "How many kg of air must be removed from the chamber during the process ? Express this\n",
+ "mass as a volume measured at 1 bar and 25\u00b0C.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "V1 = 40.; \t\t\t#m**3\n",
+ "V2 = 40.; \t\t\t#m**3\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "p2 = 0.4*10**5; \t\t\t#Pa\n",
+ "T1 = 298.; \t\t\t#K\n",
+ "T2 = 278.; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "m1 = p1*V1/R/T1;\n",
+ "m2 = p2*V2/R/T2;\n",
+ "#Let mass of air removed be m\n",
+ "m = m1-m2;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Mass of air removed = %.3f\")% (m),(\"kg\")\n",
+ "\n",
+ "V = m*R*T1/p1;\n",
+ "print (\"Volume of gas removed = %.3f\")% (V), (\"m**3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of air removed = 26.716 kg\n",
+ "Volume of gas removed = 22.849 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page no : 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) How many kg of nitrogen will the flask hold at the designed conditions ?\n",
+ "(ii) At what temperature must the fusible plug melt in order to limit the pressure of a full\n",
+ "flask to a maximum of 150 bar ?\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.04; \t\t\t#m**3\n",
+ "p = 120.*10**5; \t\t\t#Pa\n",
+ "T = 293.; \t\t\t#K\n",
+ "R0 = 8314.; \n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) kg of nitrogen the flask can hold\")\n",
+ "M = 28; \t\t\t#molecular weight of Nitrogen\n",
+ "R = R0/M;\n",
+ "\n",
+ "m = p*V/R/T;\n",
+ "print (\"kg of nitrogen = %.3f\")% (m), (\"kg\")\n",
+ "\n",
+ "print (\"(ii) Temperature at which fusible plug should melt\")\n",
+ "p = 150.*10**5; \t\t\t#Pa\n",
+ "T = p*V/R/m; \t\t\t#K\n",
+ "t = T-273; \t\t\t#0C\n",
+ "print (\"Temperature = %.3f\")% (t),(\"\u00b0C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) kg of nitrogen the flask can hold\n",
+ "kg of nitrogen = 5.517 kg\n",
+ "(ii) Temperature at which fusible plug should melt\n",
+ "Temperature = 93.250 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page no : 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) What mass of original gas must have escaped if the dimensions of the balloon is not\n",
+ "changed ?\n",
+ "(ii) Find the amount of heat to be removed to cause the same drop in pressure at constant\n",
+ "volume.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 1.*10**5; \t\t\t#Pa\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "d = 6.; \t\t\t#m; diameter of the spherical balloon\n",
+ "p2 = 0.94*p1;\n",
+ "T2 = T1;\n",
+ "cv = 10400.; \t\t\t#J/kg K\n",
+ "R = 8314/2.;\n",
+ "r = 3.; \t\t\t#m\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Mass of original gas escaped\")\n",
+ "\n",
+ "mass_escaped = (p1-p2)/p1*100;\n",
+ "print (\"%mass_escaped = \"), (mass_escaped), (\"%\")\n",
+ "\n",
+ "print (\"(ii)Amount of heat to be removed \")\n",
+ "T2 = 0.94*T1;\n",
+ "m = p1*4/3*math.pi*r**3/R/T1;\n",
+ "\n",
+ "Q = m*cv*(T1-T2)/10**6;\n",
+ "print (\"Q = %.3f\")% (Q),(\"MJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Mass of original gas escaped\n",
+ "%mass_escaped = 6.0 %\n",
+ "(ii)Amount of heat to be removed \n",
+ "Q = 1.698 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no : 394"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(i) Calculate pressure and the specific volume of the gas.\n",
+ "(ii) evaluate the values of c p and c v .\n",
+ "(iii) evaluate the final pressure of gas.\n",
+ "(iv) Evaluate the increase in specific internal energy, the increase in specific enthalpy, increase\n",
+ "in specific entropy and magnitude and sign of heat transfer.\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 28.; \t\t\t#kg\n",
+ "V1 = 3.; \t\t\t#m**3\n",
+ "T1 = 363.; \t\t\t#K\n",
+ "R0 = 8314.;\n",
+ "M = 28.; \t\t\t#Molecular mass of N2\n",
+ "R = R0/m;\n",
+ "V2 = V1;\n",
+ "T2 = 293.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Pressure (p1) and specific volume (v1) of the gas\")\n",
+ "\n",
+ "p1 = m*R*T1/V1/10**5; \t\t\t#bar\n",
+ "print (\"Pressure = %.3f\")% (p1), (\"bar\")\n",
+ "\n",
+ "v1 = V1/m;\n",
+ "print (\"specific volume = %.3f\")% (v1), (\"m**3/kg\")\n",
+ "\n",
+ "\n",
+ "#cp-cv = R/1000;\n",
+ "#cp-1.4cv = 0;\n",
+ "#solving the above two eqns \n",
+ "A = [[1,-1],[1,-1.4]];\n",
+ "B = [R/1000,0];\n",
+ "X = linalg.inv(A)*B;\n",
+ "cp = X[0,0]\n",
+ "print (\"cp = %.3f\")% (cp), (\"kJ/kg K\")\n",
+ "\n",
+ "cv = X[1][0];\n",
+ "print (\"cv = %.3f\")% (cv),(\"kJ/kg K\")\n",
+ "\n",
+ "print (\"(iii) Final pressure of the gas after cooling to 20\u00b0C\")\n",
+ "p2 = p1*T2/T1;\n",
+ "print (\"p2 = %.3f\")% (p2), (\"bar\")\n",
+ "\n",
+ "\n",
+ "du = cv*(T2-T1);\n",
+ "print (\"Increase in specific internal energy = %.3f\")% (du), (\"kJ/kg\")\n",
+ "\n",
+ "dh = cp*(T2-T1);\n",
+ "print (\"Increase in specific Enthalpy = %.3f\")%(dh), (\"kJ/kg\")\n",
+ "\n",
+ "v2 = v1;\n",
+ "ds = cv*math.log(T2/T1) + R*math.log(v2/v1);\n",
+ "print (\"Increase in specific entropy = %.3f\")%(ds),(\"kJ/kg K\")\n",
+ "\n",
+ "W = 0; \t\t\t#constant volume process\n",
+ "Q = m*du+W;\n",
+ "print (\"Heat transfer = %.3f\")%(Q), (\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Pressure (p1) and specific volume (v1) of the gas\n",
+ "Pressure = 10.060 bar\n",
+ "specific volume = 0.107 m**3/kg\n",
+ "cp = 1.039 kJ/kg K\n",
+ "cv = 0.742 kJ/kg K\n",
+ "(iii) Final pressure of the gas after cooling to 20\u00b0C\n",
+ "p2 = 8.120 bar\n",
+ "Increase in specific internal energy = -51.963 kJ/kg\n",
+ "Increase in specific Enthalpy = -72.748 kJ/kg\n",
+ "Increase in specific entropy = -0.159 kJ/kg K\n",
+ "Heat transfer = -1454.950 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page no : 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) \n",
+ "determine :\n",
+ "(i) The final specific volume, temperature and increase in entropy ;\n",
+ "(ii) The work done and the heat transfer.\n",
+ "(b) Repeat (a) assuming the process to be irreversible and adiabatic between end states.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "print (\"Part (a)\")\n",
+ "# Variables\n",
+ "R = 0.287; \t\t\t#kJ/kg K\n",
+ "y = 1.4;\n",
+ "m1 = 1.; \t\t\t#kg\n",
+ "p1 = 8.*10**5; \t\t\t#Pa\n",
+ "T1 = 373.; \t\t\t#K\n",
+ "p2 = 1.8*10**5; \t\t\t#Pa\n",
+ "cv = 0.717; \t\t\t#kJ/kg K\n",
+ "n = 1.2;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#pv**1.2 = consmath.tant\n",
+ "print (\"(i) The final specific volume, temperature and increase in entropy\")\n",
+ "\n",
+ "v1 = R*10**3*T1/p1;\n",
+ "v2 = v1*(p1/p2)**(1./n);\n",
+ "print (\"v2 = %.3f\")%(v2), (\"m**3/kg\")\n",
+ "\n",
+ "T2 = p2*v2/R/10**3; \t\t\t#K\n",
+ "t2 = T2-273; \t\t\t#0C\n",
+ "print (\"Final temperature = %.3f\")% (t2), (\"0C\")\n",
+ "\n",
+ "ds = cv*math.log(T2/T1) + R*math.log(v2/v1);\n",
+ "print (\"ds = %.3f\")%(ds), (\"kJ/kg K\")\n",
+ "\n",
+ "\n",
+ "W = R*(T1-T2)/(n-1);\n",
+ "print (\"Work done = %.3f\")% (W), (\"kJ/kg\")\n",
+ "\n",
+ "Q = cv*(T2-T1) + W;\n",
+ "print (\"Heat transfer = %.3f\")%(Q),(\"kJ/kg\")\n",
+ "\n",
+ "print (\"Part (b)\")\n",
+ "\n",
+ "print (\"(i) Though the process is assumed now to be irreversible and adiabatic, the end states are given to be the same as in (a). Therefore, all the properties at the end of the process are the same as in (a).\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Adiabatic process\")\n",
+ "Q = 0;\n",
+ "print (\"Heat transfer = %.3f\")%(Q), (\"kJ/kg\")\n",
+ "\n",
+ "W = -cv*(T2-T1);\n",
+ "print (\"Work done = %.3f\")%(W),(\"kJ/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "(i) The final specific volume, temperature and increase in entropy\n",
+ "v2 = 0.464 m**3/kg\n",
+ "Final temperature = 17.897 0C\n",
+ "ds = 0.179 kJ/kg K\n",
+ "Work done = 117.818 kJ/kg\n",
+ "Heat transfer = 58.950 kJ/kg\n",
+ "Part (b)\n",
+ "(i) Though the process is assumed now to be irreversible and adiabatic, the end states are given to be the same as in (a). Therefore, all the properties at the end of the process are the same as in (a).\n",
+ "(ii) Adiabatic process\n",
+ "Heat transfer = 0.000 kJ/kg\n",
+ "Work done = 58.868 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page no : 397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine the pressure in the spheres when the system attains equilibrium.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "d = 2.5; \t\t\t#m; diameter\n",
+ "V1 = 4./3*math.pi*(d/2)**3; \t\t\t#volume of each sphere\n",
+ "T1 = 298.; \t\t\t#K\n",
+ "T2 = 298.; \t\t\t#K\n",
+ "m1 = 16.; \t\t\t#kg\n",
+ "m2 = 8.; \t\t\t#kg\n",
+ "V = 2.*V1; \t\t\t#total volume\n",
+ "m = m1+m2;\n",
+ "R = 287.; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "p = m*R*T1/V/10**5; \t\t\t#bar\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print (\"pressure in the spheres when the system attains equilibrium = %.3f\")%(p),(\"bar\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure in the spheres when the system attains equilibrium = 1.254 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page no : 398"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "evaluate the heat transfer rate from the gas and the power delivered by the turbine.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m = 6.5/60; \t\t\t#kg/s\n",
+ "import math \n",
+ "cv = 0.837; \t\t\t#kJ/kg K\n",
+ "p1 = 10*10**5; \t\t\t#Pa\n",
+ "p2 = 1.05*10**5; \t\t\t#Pa\n",
+ "T1 = 453; \t\t\t#K\n",
+ "R0 = 8.314;\n",
+ "M = 44.; \t\t\t#Molecular mass of CO2\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "R = R0/M;\n",
+ "cp = cv+R;\n",
+ "y = cp/cv;\n",
+ "\n",
+ "T2 = T1*(p2/p1)**((y-1)/y);\n",
+ "print T2\n",
+ "t2 = T2-273;\n",
+ "print (\"Final temperature = %.3f\")%(t2),(\"0C\")\n",
+ "\n",
+ "v2 = R*10**3*T2/p2; \t\t\t#m**3/kg\n",
+ "print (\"final specific volume = %.3f\")%(v2), (\"m**3/kg\")\n",
+ "\n",
+ "ds = 0; \t\t\t#Reversible and adiabatic process\n",
+ "print (\"Increase in entropy = \"), (ds)\n",
+ "\n",
+ "Q = 0; \t\t\t#Adiabatic process\n",
+ "print (\"Heat transfer rate from turbine = \"), (Q)\n",
+ "\n",
+ "W = m*cp*(T1-T2);\n",
+ "print (\"Power delivered by the turbine = %.3f\")% (W), (\"kW\")\n",
+ "\n",
+ "\n",
+ "# Note : answers wont match with the book because of the rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "299.106840283\n",
+ "Final temperature = 26.107 0C\n",
+ "final specific volume = 0.538 m**3/kg\n",
+ "Increase in entropy = 0\n",
+ "Heat transfer rate from turbine = 0\n",
+ "Power delivered by the turbine = 17.104 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page no : 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Evaluate the following :\n",
+ "(i) The heat received in the cycle ;\n",
+ "(ii) The heat rejected in the cycle ;\n",
+ "(iii) Efficiency of the cycle.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 8.*10**5; \t\t\t#Pa\n",
+ "V1 = 0.035; \t\t\t#m**3\n",
+ "T1 = 553.; \t\t\t#K\n",
+ "p2 = 8.*10**5; \t\t\t#Pa\n",
+ "V2 = 0.1; \t\t\t#m**3\n",
+ "n = 1.4;\n",
+ "R = 287.; \t\t\t#J/kg K\n",
+ "T3 = 553.; \t\t\t#K\n",
+ "cv = 0.71; \t\t\t#kJ/kg K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m = p1*V1/R/T1;\n",
+ "T2 = p2*V2/m/R;\n",
+ "p3 = p2/((T2/T3)**(n/(n-1)));\n",
+ "V3 = m*R*T3/p3;\n",
+ "\n",
+ "print (\"(i) The heat received in the cycle\")\n",
+ "\n",
+ "#constant pressure process 1-2\n",
+ "W_12 = p1*(V2-V1)/10**3; \t\t\t#kJ\n",
+ "Q_12 = m*cv*(T2-T1) + W_12; \t\t\t#kJ\n",
+ "\n",
+ "#polytropic process 2-3\n",
+ "W_23 = m*R/10**3*(T2-T3)/(n-1);\n",
+ "Q_23 = m*cv*(T3-T2) + W_23;\n",
+ "\n",
+ "Q_received = Q_12 + Q_23;\n",
+ "print (\"Total heat received in the cycle = \"),(Q_received), (\"kJ\")\n",
+ "\n",
+ "print (\"(ii) The heat rejected in the cycle\")\n",
+ "\n",
+ "#Isothermal process 3-1\n",
+ "W_31 = p3*V3*math.log(V1/V3)/10**3; \t\t\t#kJ\n",
+ "Q_31 = m*cv*(T3-T1) + W_31;\n",
+ "print (\"Heat rejected in the cycle = %.3f\")% (-Q_31), (\"kJ\")\n",
+ "\n",
+ "\n",
+ "n = (Q_received - (-Q_31))/Q_received*100;\n",
+ "print (\"Efficiency of the cycle = %.3f\")% (n), (\"%\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The heat received in the cycle\n",
+ "Total heat received in the cycle = 182.0 kJ\n",
+ "(ii) The heat rejected in the cycle\n",
+ "Heat rejected in the cycle = 102.883 kJ\n",
+ "Efficiency of the cycle = 43.471 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.9 Page no : 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Compute the pressure by\n",
+ "(i) Van der Waals\u2019 equation\n",
+ "(ii) Perfect gas equation.\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "v = 44.; \t\t\t#m**3/kg-mol\n",
+ "T = 373.; \t\t\t#K\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Using Van der Waals\u2019 equation\")\n",
+ "a = 362850.; \t\t\t#N*m**4/(kg-mol)**2\n",
+ "b = 0.0423; \t\t\t#M**3/kg-mol\n",
+ "R0 = 8314.; \t\t\t#J/kg K\n",
+ "\n",
+ "p = ((R0*T/(v-b)) - a/v**2);\n",
+ "print (\"Pressure umath.sing Van der Waals equation = %.3f\")%(p), (\"N/m**2\")\n",
+ "\n",
+ "print (\"(ii) Using perfect gas equation\")\n",
+ "\n",
+ "p = R0*T/v;\n",
+ "print (\"Pressure using perfect gas equation = %.3f\")% (p), (\"N/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Using Van der Waals\u2019 equation\n",
+ "Pressure umath.sing Van der Waals equation = 70360.445 N/m**2\n",
+ "(ii) Using perfect gas equation\n",
+ "Pressure using perfect gas equation = 70480.045 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.10 Page no : 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the\n",
+ "pressure exerted by CO 2 by using :\n",
+ "(i) Perfect gas equation\n",
+ "(ii) Van der Waals\u2019 equation\n",
+ "(iii) Beattie Bridgeman equation.\n",
+ "'''\n",
+ "# Variables\n",
+ "V = 3.; \t\t\t#m**3\n",
+ "m = 10.; \t\t\t#kg\n",
+ "T = 300.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "R0 = 8314.;\n",
+ "M = 44.; \n",
+ "R = R0/M;\n",
+ "p = m*R*T/V;\n",
+ "print (\"Pressure Using perfect gas equation = %.3f\")% (p),(\"N/m**2\")\n",
+ "\n",
+ "a = 362850; \t\t\t#Nm**4/(kg-mol)**2\n",
+ "b = 0.0423; \t\t\t#m**3/(kg-mol)\n",
+ "v = 13.2; \t\t\t #m**3/kg-mol\n",
+ "\n",
+ "p = R0*T/(v-b) - a/v**2;\n",
+ "print (\"Pressure Using Van der Waals\u2019 equation = %.3f\")%(p), (\"N/m**2\")\n",
+ "\n",
+ "\n",
+ "A0 = 507.2836;\n",
+ "a = 0.07132;\n",
+ "B0 = 0.10476;\n",
+ "b = 0.07235;\n",
+ "C = 66*10**4;\n",
+ "A = A0*(1-a/v);\n",
+ "B = B0*(1-b/v);\n",
+ "e = C/v/T**3;\n",
+ "\n",
+ "p = R0*T*(1-e)/v**2*(v+B) - A/v**2;\n",
+ "print (\"Pressure Using Beattie Bridgeman equation = %.3f\")%(p), (\"N/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure Using perfect gas equation = 188954.545 N/m**2\n",
+ "Pressure Using Van der Waals\u2019 equation = 187479.533 N/m**2\n",
+ "Pressure Using Beattie Bridgeman equation = 190090.365 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.11 Page no : 404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find :\n",
+ "(i) The work done during the process\n",
+ "(ii) The final pressure.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "a = 139250; \t\t\t#Nm**4/(kg-mol)**2\n",
+ "b = 0.0314; \t\t\t#m**3/kg-mol\n",
+ "R0 = 8314; \t\t\t#Nm/kg-mol K\n",
+ "v1 = 0.2*32; \t\t\t#m**3/kg-mol\n",
+ "v2 = 0.08*32; \t\t\t#m**3/kg-mol\n",
+ "T = 333; \t\t\t#K\n",
+ "print (\"(i) Work done during the process\")\n",
+ "\n",
+ "# Calculations\n",
+ "def f21( v): \n",
+ "\t return R0*T/(v-b) - a/v**2\n",
+ "\n",
+ "W = quad(f21, v1, v2)[0]\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print (\"W = %.3f\")% (W),(\"Nm/kg-mol\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) The final pressure\")\n",
+ "p2 = R0*T/(v2-b) - a/v2**2;\n",
+ "print (\"p2 = %.3f\")%(p2), (\"N/m**2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Work done during the process\n",
+ "W = -2524722.415 Nm/kg-mol\n",
+ "(ii) The final pressure\n",
+ "p2 = 1073651.290 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.12 Page no : 404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "compute the temperature.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "pr = 20;\n",
+ "Z = 1.25;\n",
+ "Tr = 8.0;\n",
+ "Tc = 282.4; \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "T = Tc*Tr;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Temperature = %.3f\")%(T),(\"K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature = 2259.200 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.13 Page no : 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the density using the compressibility chart\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 260.*10**5; \t\t\t#Pa\n",
+ "T = 288.; \t\t\t#K\n",
+ "pc = 33.94*10**5; \t\t\t#Pa\n",
+ "Tc = 126.2; \t\t\t#K\n",
+ "R = 8314./28;\n",
+ "\n",
+ "# Calculations\n",
+ "pr = p/pc;\n",
+ "Tr = T/Tc;\n",
+ "Z = 1.08;\n",
+ "rho = p/Z/R/T;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Density of N2 = %.3f\")% (rho), (\"kg/m**3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of N2 = 281.517 kg/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.14 Page no : 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "What should be the temperature of 1.3 kg of CO 2 gas to behave as an ideal ?\n",
+ "'''\n",
+ "# Variables\n",
+ "p = 200.*10**5; \t\t\t#Pa\n",
+ "pc = 73.86*10**5; \t\t\t#Pa\n",
+ "Tc = 304.2; \t\t\t#K\n",
+ "pr = p/pc;\n",
+ "Z = 1;\n",
+ "Tr = 2.48;\n",
+ "\n",
+ "# Calculations\n",
+ "T = Tr*Tc;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Temperature = \"), (T), (\"K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature = 754.416 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.15 Page no : 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the mass of H 2 in the balloon using real gas equation.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 12.; \t\t\t#m; diameter of spherical balloon\n",
+ "V = 4./3*math.pi*(d/2)**3;\n",
+ "T = 303.; \t\t\t#K\n",
+ "p = 1.21*10**5; \t\t\t#Pa\n",
+ "pc = 12.97*10**5; \t\t\t#Pa\n",
+ "Tc = 33.3; \t\t\t#K\n",
+ "R = 8314./2;\n",
+ "\n",
+ "# Calculations\n",
+ "pr = p/pc;\n",
+ "Tr = T/Tc;\n",
+ "Z = 1;\n",
+ "m = p*V/Z/R/T;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Mass of H2 in the balloon = %.3f\")% (m), (\"kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of H2 in the balloon = 86.917 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.16 Page no : 406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the value of compressibility factor \n",
+ "'''\n",
+ "# Calculations\n",
+ "Z_cp = 3./2-9./8;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Z_cp = \"),(Z_cp)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Z_cp = 0.375\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/ch9.ipynb b/Industrial_Instrumentation/ch9.ipynb
new file mode 100644
index 00000000..db39a5a3
--- /dev/null
+++ b/Industrial_Instrumentation/ch9.ipynb
@@ -0,0 +1,1647 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Gases and Vapour Mixtures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no : 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The partial pressure of each constituent,\n",
+ "(ii) The total pressure in the vessel, and\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.35; \t\t\t#m**3\n",
+ "import math \n",
+ "m_CO = 0.4; \t\t\t#kg\n",
+ "m_air = 1; \t\t\t#kg\n",
+ "m_O2 = 0.233; \t\t\t#kg\n",
+ "m_N2 = 0.767; \t\t\t#kg\n",
+ "T = 293.; \t\t\t#K\n",
+ "R0 = 8.314; \t\t\t#kJ/kg K\n",
+ "M_O2 = 32.; \t\t\t#Molecular mass of O2\n",
+ "M_N2 = 28.; \t\t\t#Molecular mass of N2\n",
+ "M_CO = 28.; \t\t\t#Molecular mass of CO\n",
+ "\n",
+ "# Calculations and Results\n",
+ "\n",
+ "p_O2 = m_O2*R0*10**3*T/M_O2/V/10**5; \t\t\t#bar\n",
+ "print (\"partial pressure for p_O2 %.3f\")% (p_O2), (\"bar\")\n",
+ "\n",
+ "p_N2 = m_N2*R0*10**3*T/M_N2/V/10**5; \t\t\t#bar\n",
+ "print (\"partial pressure for p_N2 %.3f\")% (p_N2), (\"bar\")\n",
+ "\n",
+ "p_CO = m_CO*R0*10**3*T/M_CO/V/10**5; \t\t\t#bar\n",
+ "print (\"partial pressure for p_CO %.3f\")%(p_CO), (\"bar\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Total pressure in the vessel\")\n",
+ "p = p_O2+p_N2+p_CO;\n",
+ "print (\"p = %.3f\")% (p), (\"bar\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "partial pressure for p_O2 0.507 bar\n",
+ "partial pressure for p_N2 1.907 bar\n",
+ "partial pressure for p_CO 0.994 bar\n",
+ "(ii) Total pressure in the vessel\n",
+ "p = 3.408 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page no : 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate : (i) Gas constant for air ;\n",
+ "(ii) Apparent molecular weight.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "R0 = 8.314;\n",
+ "M_O2 = 32.;\n",
+ "M_N2 = 28.;\n",
+ "M_Ar = 40.;\n",
+ "M_CO2 = 44.;\n",
+ "\n",
+ "# Calculations\n",
+ "R_O2 = R0/M_O2; \t\t\t#kJ/kg K\n",
+ "R_N2 = R0/M_N2; \t\t\t#kJ/kg K\n",
+ "R_Ar = R0/M_Ar; \t\t\t#kJ/kg K\n",
+ "R_CO2 = R0/M_CO2; \t\t\t#kJ/kg K\n",
+ "\n",
+ "O2 = 0.2314;\n",
+ "N2 = 0.7553;\n",
+ "Ar = 0.0128;\n",
+ "CO2 = 0.0005;\n",
+ "\n",
+ "# Results\n",
+ "print (\"(i) Gas constant for air\")\n",
+ "R = O2*R_O2 + N2*R_N2 + Ar*R_Ar + CO2*R_CO2;\n",
+ "print (\"R = %.3f\")%(R), (\"kJ/kg K\")\n",
+ "\n",
+ "print (\"(ii) Apparent molecular weight.\")\n",
+ "M = R0/R;\n",
+ "print (\"M = %.3f\")%(M)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Gas constant for air\n",
+ "R = 0.287 kJ/kg K\n",
+ "(ii) Apparent molecular weight.\n",
+ "M = 28.954\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page no : 422"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the analysis by volume and the partial pressure \n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 1.; \t\t\t#bar\n",
+ "#For oxygen\n",
+ "m_O2 = 0.2314;\n",
+ "M_O2 = 32;\n",
+ "n_O2 = m_O2/M_O2;\n",
+ "#For Nitrogen\n",
+ "m_N2 = 0.7553;\n",
+ "M_N2 = 28.;\n",
+ "n_N2 = m_N2/M_N2;\n",
+ "#For Argon\n",
+ "m_Ar = 0.0128;\n",
+ "M_Ar = 40;\n",
+ "n_Ar = m_Ar/M_Ar;\n",
+ "\n",
+ "#For CO2\n",
+ "m_CO2 = 0.0005;\n",
+ "M_CO2 = 44;\n",
+ "n_CO2 = m_CO2/M_CO2;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n = n_O2 + n_N2 + n_Ar + n_CO2;\n",
+ "\n",
+ "#Let Vi/V be A\n",
+ "A_O2 = n_O2/n * 100;\n",
+ "print (\"Vi/V of O2 = %.3f\")%(A_O2),(\"%\")\n",
+ "\n",
+ "A_N2 = n_N2/n * 100;\n",
+ "print (\"Vi/V of N2 = %.3f\")%(A_N2), (\"%\")\n",
+ "\n",
+ "A_Ar = n_Ar/n *100;\n",
+ "print (\"Vi/V of Ar %.3f\")% (A_Ar), (\"%\")\n",
+ "\n",
+ "A_CO2 = n_CO2/n * 100;\n",
+ "print (\"Vi/V of CO2 = %.3f\")% (A_CO2), (\"%\")\n",
+ "\n",
+ "\n",
+ "P_O2 = n_O2/n*p;\n",
+ "print (\"Partial pressure of O2 = %.3f\")% (P_O2), (\"bar\")\n",
+ "\n",
+ "P_N2 = n_N2/n*p;\n",
+ "print (\"Partial pressure of N2 = %.3f\")% (P_N2), (\"bar\")\n",
+ "\n",
+ "P_Ar = n_Ar/n*p;\n",
+ "print (\"Partial pressure of Ar = %.3f\")% (P_Ar), (\"bar\")\n",
+ "\n",
+ "P_CO2 = n_CO2/n*p;\n",
+ "print (\"Partial pressure of CO2 = %.4f\")% (P_CO2), (\"bar\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vi/V of O2 = 20.937 %\n",
+ "Vi/V of N2 = 78.103 %\n",
+ "Vi/V of Ar 0.927 %\n",
+ "Vi/V of CO2 = 0.033 %\n",
+ "Partial pressure of O2 = 0.209 bar\n",
+ "Partial pressure of N2 = 0.781 bar\n",
+ "Partial pressure of Ar = 0.009 bar\n",
+ "Partial pressure of CO2 = 0.0003 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page no : 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate for the mixture :\n",
+ "(i) The masses of CO 2 , O 2 and N 2 , and the total mass ;\n",
+ "(ii) The percentage carbon content by mass ;\n",
+ "(iii) The apparent molecular weight and the gas constant for the mixture ;\n",
+ "(iv) The specific volume of the mixture\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 1.*10**5; \t\t\t#Pa\n",
+ "T = 293.; \t\t\t#K\n",
+ "n_CO2 = 1.; \t\t\t#moles of CO2\n",
+ "n = 4.; \t\t\t#moles of air\n",
+ "M_CO2 = 44.;\n",
+ "M_N2 = 28.;\n",
+ "M_O2 = 32.;\n",
+ "\n",
+ "#Let A be the volumeetric analysis\n",
+ "A_O2 = 0.21;\n",
+ "A_N2 = 0.79;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n_O2 = A_O2*n;\n",
+ "n_N2 = A_N2*n;\n",
+ "\n",
+ "print (\"(i) The masses of CO2, O2 and N2, and the total mass\")\n",
+ "\n",
+ "m_CO2 = n_CO2*M_CO2;\n",
+ "print (\"Mass of CO2 = %.3f\")%(m_CO2),(\"kg\")\n",
+ "\n",
+ "m_O2 = n_O2*M_O2;\n",
+ "print (\"Mass of O2 = %.3f\")%(m_O2),(\"kg\")\n",
+ "\n",
+ "m_N2 = n_N2*M_N2;\n",
+ "print (\"Mass of N2 = %.3f\")%(m_N2),(\"kg\")\n",
+ "\n",
+ "m = m_CO2 + m_O2 + m_N2;\n",
+ "print (\"Total mass = %.3f\")% (m), (\"kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) The percentage carbon content by mass\")\n",
+ "#Since the molecular weight of carbon is 12, therefore, there are 12 kg of carbon present for every mole of CO2\n",
+ "m_C = 12; \t\t\t#kg\n",
+ "\n",
+ "C = m_C/m*100;\n",
+ "print (\"Percentage carbon in mixture %.3f\")%(C),(\"%\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) The apparent molecular weight and the gas consmath.tant for the mixture\")\n",
+ "n = n_CO2 + n_O2 + n_N2;\n",
+ "M = n_CO2/n*M_CO2 + n_O2/n*M_O2 + n_N2/n*M_N2;\n",
+ "print (\"Apparent Molecular weight %.3f\")%(M)\n",
+ "\n",
+ "R0 = 8.314;\n",
+ "R = R0/M;\n",
+ "print (\"Gas constant for the mixture = %.3f\")%(R),(\"kJ/kg K\")\n",
+ "\n",
+ "\n",
+ "print (\"(iv) The specific volume of the mixture\")\n",
+ "v = R*10**3*T/p;\n",
+ "print (\"specific volume = %.3f\")%(v),(\"m**3/kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The masses of CO2, O2 and N2, and the total mass\n",
+ "Mass of CO2 = 44.000 kg\n",
+ "Mass of O2 = 26.880 kg\n",
+ "Mass of N2 = 88.480 kg\n",
+ "Total mass = 159.360 kg\n",
+ "(ii) The percentage carbon content by mass\n",
+ "Percentage carbon in mixture 7.530 %\n",
+ "(iii) The apparent molecular weight and the gas consmath.tant for the mixture\n",
+ "Apparent Molecular weight 31.872\n",
+ "Gas constant for the mixture = 0.261 kJ/kg K\n",
+ "(iv) The specific volume of the mixture\n",
+ "specific volume = 0.764 m**3/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page no : 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate :\n",
+ "(ii) The volume of the container.\n",
+ "(i) The mass of O 2 required ;\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 1.*10**5; \t\t\t#Pa\n",
+ "T = 298.; \t\t\t#K\n",
+ "M_H2 = 2.;\n",
+ "M_O2 = 32.;\n",
+ "R0 = 8314.;\n",
+ "# ratio = V_H2/V_O2 = 2;\n",
+ "ratio = 2;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The mass of O2 required\")\n",
+ "\t\t\t#Let the mass of O2 per kg of H2 = x kg\n",
+ "m_H2 = 1; \t\t\t#kg\n",
+ "n_H2 = m_H2/M_H2;\n",
+ "\n",
+ "# n_O2 = x/M_O2\n",
+ "x = M_O2*n_H2/ratio;\n",
+ "print (\"Mass of O2 per kg of H2 = %.3f\")%(x), (\"kg\")\n",
+ "\n",
+ "print (\"(ii) The volume of the container\")\n",
+ "n_O2 = x/M_O2;\n",
+ "n = n_H2 + n_O2;\n",
+ "V = n*R0*T/p;\n",
+ "print (\"V = %.3f\")%(V), (\"m**3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The mass of O2 required\n",
+ "Mass of O2 per kg of H2 = 8.000 kg\n",
+ "(ii) The volume of the container\n",
+ "V = 18.582 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.6 Page no : 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate per mole of mixture the mass of mixture to be removed, and mass of CO to be added.\n",
+ "'''\n",
+ "\n",
+ "#Let composition of mixture by volume be denoted by c1\n",
+ "#Let Final composition desired be denoted by c2\n",
+ "\n",
+ "# Variables\n",
+ "c1_H2 = 0.78;\n",
+ "c1_CO = 0.22;\n",
+ "c2_H2 = 0.52;\n",
+ "c2_CO = 0.48;\n",
+ "M_H2 = 2.;\n",
+ "M_CO = 28.;\n",
+ "\n",
+ "# Calculations\n",
+ "M = c1_H2*M_H2 + c1_CO*M_CO;\n",
+ "# Let x kg of mixture be removed and y kg of CO be added.\n",
+ "x = (c1_H2 - c2_H2)/c1_H2*M;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Mass of mixture removed = %.3f\")%(x), (\"kg\")\n",
+ "\n",
+ "y = M_CO/M*x;\n",
+ "print (\"Mass of CO added = %.3f\")%(y),(\"kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of mixture removed = 2.573 kg\n",
+ "Mass of CO added = 9.333 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page no : 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate per kg of gas :\n",
+ "(i) The workdone ;\n",
+ "(ii) The heat flow ;\n",
+ "(iii) Change of entropy per kg of mixture.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "ratio = 1./8; \t\t\t#volume ratio; v1/v2\n",
+ "T1 = 1223.; \t\t\t#K\n",
+ "cp_CO2 = 1.235; \t\t\t#kJ/kg K\n",
+ "cp_O2 = 1.088; \t\t\t#kJ/kg K\n",
+ "cp_N2 = 1.172; \t\t\t#kJ/kg K\n",
+ "n_CO2 = 0.13;\n",
+ "n_O2 = 0.125;\n",
+ "n_N2 = 0.745;\n",
+ "M_CO2 = 44.;\n",
+ "M_O2 = 32.;\n",
+ "M_N2 = 28.;\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "m_CO2 = M_CO2*n_CO2;\n",
+ "m_O2 = M_O2*n_O2;\n",
+ "m_N2 = M_N2*n_N2;\n",
+ "m = m_CO2 + m_O2 + m_N2;\n",
+ "\n",
+ "# Let Fraction by mass be denoted by F\n",
+ "F_CO2 = m_CO2/m;\n",
+ "F_O2 = m_O2/m;\n",
+ "F_N2 = m_N2/m;\n",
+ "cp = F_CO2*cp_CO2 + F_O2*cp_O2 + F_N2*cp_N2;\n",
+ "R0 = 8.314;\n",
+ "R = F_CO2*R0/M_CO2 + F_O2*R0/M_O2 + F_N2*R0/M_N2;\n",
+ "\n",
+ "cv = cp - R;\n",
+ "n = 1.2;\n",
+ "\n",
+ "print (\"(i) The workdone\")\n",
+ "T2 = T1*(ratio)**(n-1);\n",
+ "W = R*(T1-T2)/(n-1);\n",
+ "print (\"W = %.3f\")%(W), (\"kJ/kg\")\n",
+ "\n",
+ "print (\"(ii) The heat flow\")\n",
+ "du = cv*(T2-T1);\n",
+ "Q = du + W;\n",
+ "print (\"Q = %.3f\")%(Q), (\"kJ/kg\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) Change of entropy per kg of mixture\")\n",
+ "ds_1A = R*math.log(1/ratio); \t\t\t#isothermal process\n",
+ "ds_2A = cv*math.log(T1/T2);\n",
+ "\n",
+ "ds_12 = ds_1A - ds_2A;\n",
+ "print (\"change of entropy = %.3f\")% (ds_12), (\"kJ/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The workdone\n",
+ "W = 565.669 kJ/kg\n",
+ "(ii) The heat flow\n",
+ "Q = 190.777 kJ/kg\n",
+ "(iii) Change of entropy per kg of mixture\n",
+ "change of entropy = 0.191 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.8 Page no : 427"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Calculate the values of C p , C v , c p and c v for the mixture.\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "M_CO2 = 44.;\n",
+ "M_H2 = 2.;\n",
+ "M_N2 = 28.;\n",
+ "M_CH4 = 16.;\n",
+ "M_CO = 28.;\n",
+ "\n",
+ "# Let volumetric analysis be denoted by V\n",
+ "V_CO = 0.28;\n",
+ "V_H2 = 0.13;\n",
+ "V_CH4 = 0.04;\n",
+ "V_CO2 = 0.04;\n",
+ "V_N2 = 0.51;\n",
+ "Cp_CO = 29.27; \t\t\t#kJ/mole K\n",
+ "Cp_H2 = 28.89; \t\t\t#kJ/mole K\n",
+ "Cp_CH4 = 35.8; \t\t\t#kJ/mole K\n",
+ "Cp_CO2 = 37.22; \t\t\t#kJ/mole K\n",
+ "Cp_N2 = 29.14; \t\t\t#kJ/mole K\n",
+ "R0 = 8.314; \n",
+ "\n",
+ "# Calculations and Results\n",
+ "Cp = V_CO*Cp_CO + V_H2*Cp_H2 + V_CO2*Cp_CO2 + V_CH4*Cp_CH4 + V_N2*Cp_N2;\n",
+ "print (\"Cp = %.3f\")%(Cp), (\"kJ/mole K\")\n",
+ "\n",
+ "Cv = Cp-R0;\n",
+ "print (\"Cv = %.3f\")% (Cv), (\"kJ/mole K\")\n",
+ "\n",
+ "M = V_CO*M_CO + V_H2*M_H2 + V_CO2*M_CO2 + V_CH4*M_CH4 + V_N2*M_N2;\n",
+ "\n",
+ "cp = Cp/M;\n",
+ "print (\"cp = %.3f\")%(cp), (\"kJ/kg K\")\n",
+ "\n",
+ "cv = Cv/M;\n",
+ "print (\"cv %.3f\")% (cv), (\"kJ/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cp = 29.733 kJ/mole K\n",
+ "Cv = 21.419 kJ/mole K\n",
+ "cp = 1.200 kJ/kg K\n",
+ "cv 0.864 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.9 Page no : 427"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determine :\n",
+ "# (i) Partial pressures of the constituents ; (ii) Gas constant of mixture.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p = 1.3 \t\t\t#bar\n",
+ "R0 = 8.314;\n",
+ "M_CO2 = 44.;\n",
+ "M_O2 = 32.;\n",
+ "M_N2 = 28.;\n",
+ "M_CO = 28.;\n",
+ "m_O2 = 0.1;\n",
+ "m_N2 = 0.7;\n",
+ "m_CO2 = 0.15;\n",
+ "m_CO = 0.05;\n",
+ "#Considering 1 kg of mixture\n",
+ "m = 1; \t\t\t#kg\n",
+ "\n",
+ "# Calculations\n",
+ "#let moles be denoted by n\n",
+ "n_O2 = m_O2/M_O2;\n",
+ "n_N2 = m_N2/M_N2;\n",
+ "n_CO2 = m_CO2/M_CO2;\n",
+ "n_CO = m_CO/M_CO;\n",
+ "M = 1/(m_O2/M_O2 + m_N2/M_N2 + m_CO2/M_CO2 + m_CO/M_CO);\n",
+ "n = m/M;\n",
+ "x_O2 = n_O2/n;\n",
+ "x_N2 = n_N2/n;\n",
+ "x_CO2 = n_CO2/n;\n",
+ "x_CO = n_CO/n;\n",
+ "\n",
+ "# Results\n",
+ "print (\"(i) Partial pressures of the constituents\")\n",
+ "P_O2 = x_O2*p;\n",
+ "print (\"Partial pressure of O2 = %.3f\")% (P_O2), (\"bar\")\n",
+ "\n",
+ "P_N2 = x_N2*p;\n",
+ "print (\"Partial pressure of N2 = %.3f\")% (P_N2), (\"bar\")\n",
+ "\n",
+ "P_CO2 = x_CO2*p;\n",
+ "print (\"Partial pressure of CO2 = %.3f\")% (P_CO2), (\"bar\")\n",
+ "\n",
+ "P_CO = x_CO*p;\n",
+ "print (\"Partial pressure of CO = %.3f\")% (P_CO), (\"bar\")\n",
+ "\n",
+ "R_mix = R0/M;\n",
+ "print (\"Gas constant of mixture = %.3f\")%(R_mix), (\"kJ/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Partial pressures of the constituents\n",
+ "Partial pressure of O2 = 0.122 bar\n",
+ "Partial pressure of N2 = 0.975 bar\n",
+ "Partial pressure of CO2 = 0.133 bar\n",
+ "Partial pressure of CO = 0.070 bar\n",
+ "Gas constant of mixture = 0.277 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.10 Page no : 428"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find :\n",
+ "(i) The mole fraction of each constituent,\n",
+ "(ii) The equivalent molecular weight of the mixture,\n",
+ "(iii) The equivalent gas constant of the mixture,\n",
+ "(iv) The partial pressures and partial volumes,\n",
+ "(v) The volume and density of the mixture, and\n",
+ "(vi) The c p and c v of the mixture.\n",
+ "\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 4.*10**5; \t\t \t#Pa\n",
+ "import math \n",
+ "T = 293.; \t\t\t #K\n",
+ "R0 = 8.314;\n",
+ "\n",
+ "m_N2 = 4.; \t \t\t #kg\n",
+ "m_CO2 = 6.; \t\t\t #kg\n",
+ "\n",
+ "M_N2 = 28.; \t\t \t #Molecular mass\n",
+ "M_CO2 = 44.; \t\t\t #Molecular mass\n",
+ "\n",
+ "n_N2 = m_N2/M_N2; \t\t\t#moles of N2\n",
+ "n_CO2 = m_CO2/M_CO2; \t\t\t#moles of CO2\n",
+ "\n",
+ "x_N2 = n_N2/(n_N2+n_CO2);\n",
+ "print (\"x_N2 = %.3f\")% (x_N2)\n",
+ "\n",
+ "x_CO2 = n_CO2/(n_CO2+n_N2);\n",
+ "print (\"x_CO2 = %.3f\")% (x_CO2)\n",
+ "\n",
+ "\n",
+ "print (\"(ii) The equivalent molecular weight of the mixture\")\n",
+ "M = x_N2*M_N2 + x_CO2*M_CO2;\n",
+ "print (\"M = %.3f\")%(M), (\"kg/kg-mole\")\n",
+ "\n",
+ "print (\"(iii) The equivalent gas consmath.tant of the mixture\")\n",
+ "m = m_N2+m_CO2;\n",
+ "Rmix = (m_N2*(R0/M_N2) + m_CO2*(R0/M_CO2))/m;\n",
+ "print (\"Rmix = %.3f\")% (Rmix), (\"kJ/kg K\")\n",
+ "\n",
+ "print (\"(iv) The partial pressures and partial volumes\")\n",
+ "P_N2 = x_N2*p/10**5;\n",
+ "print (\"P_N2 = %.3f\")% (P_N2), (\"bar\")\n",
+ "\n",
+ "P_CO2 = x_CO2*p/10**5;\n",
+ "print (\"P_CO2 = %.3f\")% (P_CO2), (\"bar\")\n",
+ "\n",
+ "V_N2 = m_N2*R0/M_N2*T/p*10**3;\n",
+ "print (\"V_N2 %.3f\")% (V_N2), (\"m**3\")\n",
+ "\n",
+ "V_CO2 = m_CO2*R0/M_CO2*T/p*10**3;\n",
+ "print (\"V_CO2 %.3f\")% (V_CO2), (\"m**3\")\n",
+ "\n",
+ "print (\"(v) The volume and density of the mixture\")\n",
+ "\n",
+ "V = m*Rmix*10**3*T/p;\n",
+ "print (\"V = %.3f\")% (V), (\"m**3\")\n",
+ "\n",
+ "rho_mix = m/V;\n",
+ "print (\"Density of mixture = %.3f\")% (rho_mix), (\"kg/m**3\")\n",
+ "\n",
+ "\n",
+ "print (\"(vi) cp and cv of the mixture\")\n",
+ "\n",
+ "y_N2 = 1.4;\n",
+ "cv_N2 = (R0/M_N2)/(y_N2 - 1);\n",
+ "cp_N2 = cv_N2*y_N2;\n",
+ "\n",
+ "y_CO2 = 1.286;\n",
+ "cv_CO2 = (R0/M_CO2)/(y_CO2 - 1);\n",
+ "cp_CO2 = cv_CO2*y_CO2;\n",
+ "\n",
+ "cp = (m_N2*cp_N2 + m_CO2*cp_CO2)/(m_N2+m_CO2);\n",
+ "print (\"cp = %.3f\")%(cp),(\"kJ/kg K\")\n",
+ "\n",
+ "cv = (m_N2*cv_N2 + m_CO2*cv_CO2)/(m_N2+m_CO2);\n",
+ "print (\"cv = %.3f\")%(cv),(\"kJ/kg K\")\n",
+ "\n",
+ "T1 = 293.; \t\t\t#K\n",
+ "T2 = 323.; \t\t\t#K\n",
+ "dU = m*cv*(T2-T1);\n",
+ "print (\"Change in internal energy = %.3f\")% (dU), (\"kJ\")\n",
+ "\n",
+ "dH = m*cp*(T2-T1);\n",
+ "print (\"Change in enthalpy = %.3f\")% (dH), (\"kJ\")\n",
+ "\n",
+ "dS = m*cv*math.log(T2/T1); \t\t\t#Consmath.tant volume process\n",
+ "print (\"Change in entropy = %.3f\")% (dS), (\"kJ/kg K\")\n",
+ "\n",
+ "\n",
+ "print (\"When the mixture is heated at constant pressure\")\n",
+ "\n",
+ "print (\"If the mixture is heated at constant pressure \u0394U and \u0394H will remain the same\")\n",
+ "\n",
+ "dS = m*cp*math.log(T2/T1);\n",
+ "print (\"Change in entropy = %.3f\")% (dS), (\"kJ/kg K\")\n",
+ "\n",
+ "\n",
+ "# Note : Answers are slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x_N2 = 0.512\n",
+ "x_CO2 = 0.488\n",
+ "(ii) The equivalent molecular weight of the mixture\n",
+ "M = 35.814 kg/kg-mole\n",
+ "(iii) The equivalent gas consmath.tant of the mixture\n",
+ "Rmix = 0.232 kJ/kg K\n",
+ "(iv) The partial pressures and partial volumes\n",
+ "P_N2 = 2.047 bar\n",
+ "P_CO2 = 1.953 bar\n",
+ "V_N2 0.870 m**3\n",
+ "V_CO2 0.830 m**3\n",
+ "(v) The volume and density of the mixture\n",
+ "V = 1.700 m**3\n",
+ "Density of mixture = 5.881 kg/m**3\n",
+ "(vi) cp and cv of the mixture\n",
+ "cp = 0.925 kJ/kg K\n",
+ "cv = 0.693 kJ/kg K\n",
+ "Change in internal energy = 208.001 kJ\n",
+ "Change in enthalpy = 277.644 kJ\n",
+ "Change in entropy = 0.676 kJ/kg K\n",
+ "When the mixture is heated at constant pressure\n",
+ "If the mixture is heated at constant pressure \u0394U and \u0394H will remain the same\n",
+ "Change in entropy = 0.902 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.11 Page no : 430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The final temperature and pressure of the mixture ;\n",
+ "(ii) The change of entropy of the system.\n",
+ "\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Cv_O2 = 21.07; \t\t\t#kJ/mole K\n",
+ "Cv_CO = 20.86; \t\t\t#kJ/mole K\n",
+ "p_O2 = 8*10**5; \t\t\t#Pa\n",
+ "p_CO = 1*10**5; \t\t\t#Pa\n",
+ "V_O2 = 1.8; \t\t\t#m**3\n",
+ "V_CO = 3.6; \t\t\t#m**3\n",
+ "T_O2 = 323.; \t\t\t#K\n",
+ "T_CO = 293.; \t\t\t#K\n",
+ "R0 = 8314.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "n_O2 = p_O2*V_O2/R0/T_O2;\n",
+ "n_CO = p_CO*V_CO/R0/T_CO;\n",
+ "n = (n_O2+n_CO);\n",
+ "V = (V_O2+V_CO);\n",
+ "\n",
+ "print (\"(i) Final temperature (T) and pressure (p) of the mixture\")\n",
+ "\n",
+ "#Before mixing\n",
+ "U1 = n_O2*Cv_O2*T_O2 + n_CO*Cv_CO*T_CO;\n",
+ "\n",
+ "T = U1/(n_O2*Cv_O2 + n_CO*Cv_CO);\n",
+ "t = T-273;\n",
+ "\n",
+ "print (\"Final temperature = %.3f\")% (t), (\"\u00b0C\")\n",
+ "\n",
+ "p = n*R0*T/V/10**5;\n",
+ "print (\"Final pressure = %.3f\")% (p), (\"bar\")\n",
+ "\n",
+ "\n",
+ "#For oxygen\n",
+ "dS_O1A = n_O2*R0*math.log(V/V_O2); \t\t\t#isothermal process\n",
+ "dS_O2A = n_O2*Cv_O2*math.log(T_O2/T); \t\t\t#consmath.tant volume process\n",
+ "dS_O12 = dS_O1A - dS_O2A; \t\t\t# Change of entropy of O2\n",
+ "\n",
+ "#For CO\n",
+ "dS_CO12 = n_CO*R0*math.log(V/V_CO) + n_CO*Cv_CO*math.log(T/T_CO); \t\t\t#Change of entropy of CO\n",
+ "dS = (dS_O12 + dS_CO12)/10**3;\n",
+ "print (\"(ii)Change of entropy of system = %.3f\")% (dS), (\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Final temperature (T) and pressure (p) of the mixture\n",
+ "Final temperature = 43.569 \u00b0C\n",
+ "Final pressure = 3.334 bar\n",
+ "(ii)Change of entropy of system = 5.396 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.12 Page no : 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) Calculate : (i) The final equilibrium pressure ;\n",
+ "(ii) The amount of heat transferred to the surroundings ;\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p_A = 16.*10**5; \t\t\t#Pa\n",
+ "p_B = 6.4*10**5; \t\t\t#Pa\n",
+ "\n",
+ "T_A = 328.; \t\t\t#K\n",
+ "T_B = 298.; \t\t\t#K\n",
+ "\n",
+ "n_A = 0.6 \t\t\t#kg-mole\n",
+ "m_B = 3; \t \t\t#kg\n",
+ "\n",
+ "R0 = 8314.;\n",
+ "M_A = 28.; \n",
+ "y = 1.4;\n",
+ "\n",
+ "V_A = n_A*R0*T_A/p_A;\n",
+ "m_A = n_A*M_A;\n",
+ "R = R0/M_A;\n",
+ "V_B = m_B*R*T_B/p_B;\n",
+ "V = V_A+V_B;\n",
+ "m = m_A+m_B;\n",
+ "T = 303.; \t\t\t#K\n",
+ "\n",
+ "print (\"(a) (i) Final equilibrium pressure, p\")\n",
+ "p = m*R*T/V/10**5;\n",
+ "print (\"p = %.3f\")% (p), (\"bar\")\n",
+ "\n",
+ "cv = R/10**3/(y-1);\n",
+ "\n",
+ "print (\"(ii) Amount of heat transferred, Q :\")\n",
+ "\n",
+ "U1 = cv*(m_A*T_A + m_B*T_B);\n",
+ "U2 = m*cv*T;\n",
+ "Q = U2-U1;\n",
+ "print (\"Q = %.3f\")% (Q),(\"kJ\")\n",
+ "\n",
+ "print (\"(b) If the vessel were insulated :\")\n",
+ "\n",
+ "print (\"(i) Final temperature,\")\n",
+ "\n",
+ "T = cv*(m_A*T_A + m_B*T_B)/(m*cv);\n",
+ "t = T-273;\n",
+ "print (\"T = %.3f\")% (t), (\"\u00b0C\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) Final pressure\")\n",
+ "\n",
+ "p = m*R*T/V/10**5;\n",
+ "print (\"p = %.3f\")% (p), (\"bar\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) (i) Final equilibrium pressure, p\n",
+ "p = 12.393 bar\n",
+ "(ii) Amount of heat transferred, Q :\n",
+ "Q = -300.640 kJ\n",
+ "(b) If the vessel were insulated :\n",
+ "(i) Final temperature,\n",
+ "T = 50.455 \u00b0C\n",
+ "(ii) Final pressure\n",
+ "p = 13.230 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.13 Page no : 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the increase in entropy \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_O2 = 3.; \t\t\t#kg\n",
+ "M_O2 = 32.;\n",
+ "m_N2 = 9.; \t\t\t#kg\n",
+ "M_N2 = 28.;\n",
+ "R0 = 8.314;\n",
+ "\n",
+ "# Calculations\n",
+ "R_O2 = R0/M_O2;\n",
+ "R_N2 = R0/M_N2;\n",
+ "x_O2 = (m_O2/M_O2)/((m_O2/M_O2) + (m_N2/M_N2));\n",
+ "x_N2 = (m_N2/M_N2)/((m_O2/M_O2) + (m_N2/M_N2));\n",
+ "dS = -m_O2*R_O2*math.log(x_O2) -m_N2*R_N2*math.log(x_N2);\n",
+ "\n",
+ "# Results\n",
+ "print (\"Change in entropy = %.3f\")% (dS),(\"kJ/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy = 1.844 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.14 Page no : 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the mass of O 2 added.\n",
+ "# Variables\n",
+ "m_N2 = 2.5; \t\t\t#kg \n",
+ "M_N2 = 28.;\n",
+ "p_N2 = 15.; \t\t\t#bar\n",
+ "p_total = 20.; \t\t\t#bar\n",
+ "\n",
+ "# Calculations\n",
+ "n_N2 = m_N2/M_N2;\n",
+ "p_O2 = p_total-p_N2;\n",
+ "n_O2 = p_O2/p_N2*n_N2;\n",
+ "M_O2 = 32;\n",
+ "m_O2 = n_O2*M_O2;\n",
+ "\n",
+ "# Results\n",
+ "print (\"Mass of O2 added = %.3f\")% (m_O2), (\"kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of O2 added = 0.952 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.15 Page no : 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The moles of nitrogen per mole of oxygen ;\n",
+ "(ii) The partial pressure of oxygen and nitrogen if the total pressure is atmosphere ;\n",
+ "(iii) The kg of nitrogen per kg of mixture.\n",
+ "\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "n_O2 = 1.;\n",
+ "M_N2 = 28.;\n",
+ "M_O2 = 32.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Moles of N2 per mole of O2 :\")\n",
+ "n_N2 = n_O2*0.79/0.21;\n",
+ "print (\"n_N2 = %.3f\")%(n_N2),(\"moles\")\n",
+ "\n",
+ "n = n_O2+n_N2;\n",
+ "print (\"(ii)\")\n",
+ "p = 1; \t\t\t#atm\n",
+ "\n",
+ "p_O2 = n_O2/n*p;\n",
+ "print (\"p_O2 = %.3f\")% (p_O2), (\"atm\")\n",
+ "\n",
+ "p_N2 = n_N2/n*p;\n",
+ "print (\"p_N2 = %.3f\")% (p_N2), (\"atm\")\n",
+ "\n",
+ "\n",
+ "x = n_N2*M_N2/(n_N2*M_N2+n_O2*M_O2);\n",
+ "print (\"(iii) The kg of nitrogen per kg of mixture = %.3f\")% (x), (\"kg N2/kg mix\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Moles of N2 per mole of O2 :\n",
+ "n_N2 = 3.762 moles\n",
+ "(ii)\n",
+ "p_O2 = 0.210 atm\n",
+ "p_N2 = 0.790 atm\n",
+ "(iii) The kg of nitrogen per kg of mixture = 0.767 kg N2/kg mix\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.16 Page no : 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " # Find the masses of O 2 , N 2 and CO 2 in the cylinder.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V = 0.6; \t\t\t#m**3\n",
+ "p1 = 12.*10**5; \t\t\t#Pa\n",
+ "p2 = 18.*10**5; \t\t\t#Pa\n",
+ "T = 298.; \t\t\t#K\n",
+ "R0 = 8.314;\n",
+ "x_O2 = 0.23;\n",
+ "x_N2 = 0.77;\n",
+ "\n",
+ "n = p1*V/R0/10**3/T;\n",
+ "#Considering 100 kg of air\n",
+ "m_O2 = 23.; \t\t\t#kg\n",
+ "m_N2 = 77.; \t\t\t#kg\n",
+ "M_O2 = 32.;\n",
+ "M_N2 = 28.;\n",
+ "m = 100.; \t\t\t#kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "R = (m_O2/M_O2 + m_N2/M_N2)*R0/m; \t\t\t#for air\n",
+ "M = R0/R \t \t\t#for air\n",
+ "\n",
+ "m = p1*V/R/T/10**3;\n",
+ "\n",
+ "m_O2 = x_O2*m;\n",
+ "print (\"Mass of O2 = %.3f\")% (m_O2), (\"kg\")\n",
+ "\n",
+ "m_N2 = x_N2*m;\n",
+ "print (\"Mass of N2 = %.3f\")% (m_N2), (\"kg\")\n",
+ "\n",
+ "#After adding CO2 in the vessel\n",
+ "p2 = 18.*10**5; \t\t\t#Pa;\n",
+ "\n",
+ "p_CO2 = 6.*10**5; \t\t\t#Pa\n",
+ "M_CO2 = 44.;\n",
+ "R_CO2 = R0/M_CO2;\n",
+ "\n",
+ "m_CO2 = p_CO2*V/(R_CO2*10**3*T);\n",
+ "print (\"Mass of CO2 = %.3f\")% (m_CO2), (\"kg\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of O2 = 1.927 kg\n",
+ "Mass of N2 = 6.451 kg\n",
+ "Mass of CO2 = 6.393 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.17 Page no : 437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate-\n",
+ "(i) The partial pressure ;\n",
+ "(ii) The total pressure ;\n",
+ "(iii) The mean value of R for the mixture.\n",
+ "'''\n",
+ "# Variables\n",
+ "V = 6; \t\t \t#m**3\n",
+ "A = 0.45; \n",
+ "B = 0.55;\n",
+ "R_A = 0.288; \t\t\t#kJ/kg K\n",
+ "R_B = 0.295; \t\t\t#kJ/kg K\n",
+ "m = 2. \t\t\t#kg\n",
+ "T = 303. \t\t\t #K\n",
+ "\n",
+ "# Calculations\n",
+ "print (\"(i) The partial pressures\")\n",
+ "m_A = A*m;\n",
+ "m_B = B*m;\n",
+ "\n",
+ "p_A = m_A*R_A*10**3*T/V/10**5; \t\t\t#bar\n",
+ "print (\"p_A = %.3f\")% (p_A), (\"bar\")\n",
+ "\n",
+ "p_B = m_B*R_B*10**3*T/V/10**5; \t\t\t#bar\n",
+ "print (\"p_B = %.3f\")% (p_B), (\"bar\")\n",
+ "\n",
+ "\n",
+ "print (\"(ii) The total pressure\")\n",
+ "p = p_A+p_B;\n",
+ "print (\"p = %.3f\")% (p), (\"bar\")\n",
+ "\n",
+ "\n",
+ "print (\"(iii) The mean value of R for the mixture\")\n",
+ "Rm = (m_A*R_A + m_B*R_B)/(m_A + m_B);\n",
+ "print (\"Rm = %.3f\")% (Rm), (\"kJ/kg K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The partial pressures\n",
+ "p_A = 0.131 bar\n",
+ "p_B = 0.164 bar\n",
+ "(ii) The total pressure\n",
+ "p = 0.295 bar\n",
+ "(iii) The mean value of R for the mixture\n",
+ "Rm = 0.292 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.18 Page no : 438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine-\n",
+ "(i) The mole fraction of each component ; (ii) The average molecular weight ;\n",
+ "(iii) The specific gas constant ;\n",
+ "(iv) The volume and density ;\n",
+ "(v) The partial pressures and partial volumes.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "m_O2 = 4.; \t\t\t#kg\n",
+ "m_N2 = 6.; \t\t\t#kg\n",
+ "p = 4.*10**5; \t\t\t#Pa\n",
+ "T = 300.; \t\t\t#K\n",
+ "M_O2 = 32.;\n",
+ "M_N2 = 28.;\n",
+ "m = 10.; \t\t\t#kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) The mole fraction of each component\")\n",
+ "n_O2 = m_O2/M_O2;\n",
+ "n_N2 = m_N2/M_N2;\n",
+ "\n",
+ "x_O2 = n_O2/(n_O2+n_N2);\n",
+ "print (\"x_O2 = %.3f\")% (x_O2)\n",
+ "\n",
+ "x_N2 = n_N2/(n_N2+n_O2);\n",
+ "print (\"x_N2 = %.3f\")% (x_N2)\n",
+ "\n",
+ "\n",
+ "print (\"(ii) The average molecular weight\")\n",
+ "M = (n_O2*M_O2 + n_N2*M_N2)/(n_O2 + n_N2);\n",
+ "print (\"M = %.3f\")%(M)\n",
+ "\n",
+ "print (\"(iii) The specific gas consmath.tant\")\n",
+ "R0 = 8.314;\n",
+ "R = R0/M;\n",
+ "print (\"R = %.3f\")% (R), (\"kJ/kg K\")\n",
+ "\n",
+ "print (\"(iv) The volume and density\")\n",
+ "V = m*R*T*10**3/p;\n",
+ "print (\"V = %.3f\")%(V), (\"m**3\")\n",
+ "\n",
+ "rho = (m_O2/V) + (m_N2/V);\n",
+ "print (\"density = %.3f\")% (rho), (\"kg/m**3\")\n",
+ "\n",
+ "\n",
+ "print (\"(v) The partial pressures and partial volumes\")\n",
+ "p_O2 = n_O2*R0*10**3*T/V/10**5; \t\t\t#bar\n",
+ "print (\"p_O2 = %.3f\")%(p_O2), (\"bar\")\n",
+ "\n",
+ "p_N2 = n_N2*R0*10**3*T/V/10**5; \t\t\t#bar\n",
+ "print (\"p_N2 = %.3f\")% (p_N2), (\"bar\")\n",
+ "\n",
+ "V_O2 = x_O2*V;\n",
+ "print (\"V_O2 = %.3f\")% (V_O2), (\"m**3\")\n",
+ "\n",
+ "V_N2 = x_N2*V;\n",
+ "print (\"V_N2 = %.3f\")% (V_N2), (\"m**3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The mole fraction of each component\n",
+ "x_O2 = 0.368\n",
+ "x_N2 = 0.632\n",
+ "(ii) The average molecular weight\n",
+ "M = 29.474\n",
+ "(iii) The specific gas consmath.tant\n",
+ "R = 0.282 kJ/kg K\n",
+ "(iv) The volume and density\n",
+ "V = 2.116 m**3\n",
+ "density = 4.727 kg/m**3\n",
+ "(v) The partial pressures and partial volumes\n",
+ "p_O2 = 1.474 bar\n",
+ "p_N2 = 2.526 bar\n",
+ "V_O2 = 0.779 m**3\n",
+ "V_N2 = 1.336 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.19 Page no : 439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate :\n",
+ "(i) The final temperature of the mixture ; \n",
+ "(ii) The change in entropy.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cp_CO2 = 0.85; \t\t\t#kJ/kg K\n",
+ "cp_N2 = 1.04; \t\t\t#kJ/kg K\n",
+ "m_CO2 = 4.; \t\t\t#kg\n",
+ "T1_CO2 = 313.; \t\t\t#K\n",
+ "m_N2 = 8.; \t\t\t#kg\n",
+ "T1_N2 = 433.; \t\t\t#K\n",
+ "p2 = 0.7; \t\t\t#bar\n",
+ "p1_CO2 = 1.4; \t\t\t#bar\n",
+ "p1_N2 = 1.;\n",
+ "R = 8.314;\n",
+ "M_CO2 = 44.;\n",
+ "M_N2 = 28.;\n",
+ "R_CO2 = R/M_CO2;\n",
+ "R_N2 = R/M_N2;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"(i) Final temperature, T2\")\n",
+ "T2 = (m_CO2*cp_CO2*T1_CO2 + m_N2*cp_N2*T1_N2)/(m_CO2*cp_CO2 + m_N2*cp_N2);\n",
+ "print (\"T2 = %.3f\")%(T2),(\"K\")\n",
+ "\n",
+ "print (\"(ii) Change in entropy\")\n",
+ "n_CO2 = 0.0909;\n",
+ "n_N2 = 0.2857;\n",
+ "n = n_CO2 + n_N2;\n",
+ "x_CO2 = n_CO2/n;\n",
+ "x_N2 = n_N2/n;\n",
+ "p2_CO2 = x_CO2*p2;\n",
+ "p2_N2 = x_N2*p2;\n",
+ "\n",
+ "dS = m_CO2*cp_CO2*math.log(T2/T1_CO2) - m_CO2*R_CO2*math.log(p2_CO2/p1_CO2) + m_N2*cp_N2*math.log(T2/T1_N2) - m_N2*R_N2*math.log(p2_N2/p1_N2);\n",
+ "print (\"dS = %.3f\")%(dS), (\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Final temperature, T2\n",
+ "T2 = 398.188 K\n",
+ "(ii) Change in entropy\n",
+ "dS = 3.223 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.20 Page no : 440"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the entropy change in the mixing process.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cv_O2 = 0.39; \t\t\t#kJ/kg K\n",
+ "cv_N2 = 0.446; \t\t\t#kJ/kg K\n",
+ "n_O2 = 1.;\n",
+ "n_N2 = 2.;\n",
+ "M_O2 = 32.;\n",
+ "M_N2 = 28.;\n",
+ "m_O2 = 32.; \t\t\t#kg\n",
+ "m_N2 = 2*28.; \t\t\t#kg\n",
+ "T_O2 = 293.; \t\t\t#K\n",
+ "T_N2 = 301.; \t\t\t#K\n",
+ "R0 = 8.314;\n",
+ "\n",
+ "# Calculations\n",
+ "p_O2 = 2.5*10**5; \t\t\t#Pa\n",
+ "p_N2 = 1.5*10**5; \t\t\t#Pa\n",
+ "T2 = (m_O2*cv_O2*T_O2 + m_N2*cv_N2*T_N2)/(m_O2*cv_O2 + m_N2*cv_N2);\n",
+ "V_O2 = n_O2*R0*10**5*T_O2/p_O2;\n",
+ "V_N2 = n_N2*R0*10**5*T_N2/p_N2;\n",
+ "V = V_O2+V_N2;\n",
+ "dS = m_O2*(cv_O2*math.log(T2/T_O2) + R0/M_O2*math.log(V/V_O2)) + m_N2*(cv_N2*math.log(T2/T_N2) + R0/M_N2*math.log(V/V_N2));\n",
+ "\n",
+ "# Results\n",
+ "print (\"Entropy change in the mixing process = %.3f\")%(dS),(\"kJ\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy change in the mixing process = 16.627 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.21 Page no : 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine :\n",
+ "(i) The temperature of the equilibrium mixture ;\n",
+ "(ii) The pressure of the mixture ;\n",
+ "(iii) The change in entropy for each component and total value.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cv_N2 = 0.744; \t\t\t#kJ/kg K\n",
+ "cv_H2 = 10.352; \t\t\t#kJ/kg K\n",
+ "cp_N2 = 1.041; \t\t\t#kJ/kg K\n",
+ "cp_H2 = 14.476; \t\t\t#kJ/kg K\n",
+ "V = 0.45; \t\t\t#m**3\n",
+ "V_H2 = 0.3; \t\t\t#m**3\n",
+ "V_N2 = 0.15; \t\t\t#m**3\n",
+ "p_H2 = 3.*10**5; \t\t\t#Pa\n",
+ "p_N2 = 6.*10**5; \t\t\t#Pa\n",
+ "T_H2 = 403.; \t\t\t#K\n",
+ "T_N2 = 303.; \t\t\t#K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "R_H2 = 8.314/2;\n",
+ "R_N2 = 8.314/28;\n",
+ "\n",
+ "print (\"(i) Temperature of equilibrium mixture\")\n",
+ "\n",
+ "m_H2 = p_H2*V_H2/(R_H2*10**3)/T_H2;\n",
+ "m_N2 = p_N2*V_N2/(R_N2*10**3)/T_N2;\n",
+ "T2 = (m_H2*cv_H2*T_H2 + m_N2*cv_N2*T_N2)/(m_H2*cv_H2 + m_N2*cv_N2);\n",
+ "print (\"T2 = %.3f\")%(T2),(\"K\")\n",
+ "\n",
+ "print (\"(ii) Pressure of the mixture\")\n",
+ "p2_H2 = m_H2*R_H2*10**3*T2/V;\n",
+ "p2_N2 = m_N2*R_N2*10**3*T2/V;\n",
+ "\n",
+ "p2 = p2_H2+p2_N2;\n",
+ "print (\"p2 = %.3f\")%(p2/10**5),(\"bar\")\n",
+ "\n",
+ "print (\"(iii) Change in entropy :\")\n",
+ "\n",
+ "dS_H2 = m_H2*(cp_H2*math.log(T2/T_H2) - R_H2*math.log(p2_H2/p_H2));\n",
+ "print (\"Change in entropy of H2 = %.3f\")%(dS_H2),(\"kJ/K\")\n",
+ "\n",
+ "dS_N2 = m_N2*(cp_N2*math.log(T2/T_N2) - R_N2*math.log(p2_N2/p_N2));\n",
+ "print (\"Change in entropy of N2 = %.3f\")%(dS_N2),(\"kJ/K\")\n",
+ "\n",
+ "dS = dS_H2+dS_N2;\n",
+ "\n",
+ "print (\"Total change in entropy = %.3f\")%(dS),(\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Temperature of equilibrium mixture\n",
+ "T2 = 345.767 K\n",
+ "(ii) Pressure of the mixture\n",
+ "p2 = 3.998 bar\n",
+ "(iii) Change in entropy :\n",
+ "Change in entropy of H2 = 0.006 kJ/K\n",
+ "Change in entropy of N2 = 0.425 kJ/K\n",
+ "Total change in entropy = 0.430 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.22 Page no : 443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate c v and c p of the mixture.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cv_N2 = 0.745; \t\t\t#kJ/kg K\n",
+ "cv_CO2 = 0.653; \t\t#kJ/kg K\n",
+ "cp_N2 = 1.041; \t\t\t#kJ/kg K\n",
+ "cp_CO2 = 0.842; \t\t#kJ/kg K\n",
+ "m_N2 = 4.; \t\t\t#kg\n",
+ "m_CO2 = 6.; \t\t#kg\n",
+ "pmix = 4.; \t\t \t#bar\n",
+ "m = m_N2+m_CO2;\n",
+ "\n",
+ "T1 = 298.; \t\t\t #K\n",
+ "T2 = 323.; \t\t\t #K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "cv_mix = (m_N2*cv_N2 + m_CO2*cv_CO2)/(m_N2+m_CO2);\n",
+ "print (\"cv_mix = %.3f\")% (cv_mix), (\"kJ/kg K\")\n",
+ "\n",
+ "cp_mix = (m_N2*cp_N2 + m_CO2*cp_CO2)/(m_N2+m_CO2);\n",
+ "print (\"cp_mix = %.3f\")% (cp_mix), (\"kJ/kg K\")\n",
+ "\n",
+ "dU = m*cv_mix*(T2-T1);\n",
+ "print (\"Change in internal energy = %.3f\")% (dU), (\"kJ\")\n",
+ "\n",
+ "dH = m*cp_mix*(T2-T1);\n",
+ "print (\"Change in enthalpy = %.3f\")% (dH), (\"kJ\")\n",
+ "\n",
+ "dS = m_N2*cv_N2*math.log(T2/T1) + m_CO2*cv_CO2*math.log(T2/T1);\n",
+ "print (\"Change in entropy = %.3f\")% (dS), (\"kJ/K\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cv_mix = 0.690 kJ/kg K\n",
+ "cp_mix = 0.922 kJ/kg K\n",
+ "Change in internal energy = 172.450 kJ\n",
+ "Change in enthalpy = 230.400 kJ\n",
+ "Change in entropy = 0.556 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Industrial_Instrumentation/screenshots/chapter8.png b/Industrial_Instrumentation/screenshots/chapter8.png
new file mode 100644
index 00000000..d0d66354
--- /dev/null
+++ b/Industrial_Instrumentation/screenshots/chapter8.png
Binary files differ
diff --git a/Industrial_Instrumentation/screenshots/coldair-stardotto.png b/Industrial_Instrumentation/screenshots/coldair-stardotto.png
new file mode 100644
index 00000000..7234c1fa
--- /dev/null
+++ b/Industrial_Instrumentation/screenshots/coldair-stardotto.png
Binary files differ
diff --git a/Industrial_Instrumentation/screenshots/decreaseentropy.png b/Industrial_Instrumentation/screenshots/decreaseentropy.png
new file mode 100644
index 00000000..718cfb9f
--- /dev/null
+++ b/Industrial_Instrumentation/screenshots/decreaseentropy.png
Binary files differ
diff --git a/Industrial_Instrumentation/screenshots/mechanicsesmicinst.png b/Industrial_Instrumentation/screenshots/mechanicsesmicinst.png
new file mode 100644
index 00000000..535bb827
--- /dev/null
+++ b/Industrial_Instrumentation/screenshots/mechanicsesmicinst.png
Binary files differ
diff --git a/Industrial_Instrumentation/screenshots/pvdiagram.png b/Industrial_Instrumentation/screenshots/pvdiagram.png
new file mode 100644
index 00000000..bd945aff
--- /dev/null
+++ b/Industrial_Instrumentation/screenshots/pvdiagram.png
Binary files differ
diff --git a/Industrial_Instrumentation/screenshots/rangeflowratameter.png b/Industrial_Instrumentation/screenshots/rangeflowratameter.png
new file mode 100644
index 00000000..3a5df08f
--- /dev/null
+++ b/Industrial_Instrumentation/screenshots/rangeflowratameter.png
Binary files differ
diff --git a/Introduction_To_Chemical_Engineering/README.txt b/Introduction_To_Chemical_Engineering/README.txt
new file mode 100644
index 00000000..4b3c548b
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Vaibhav Shah
+Course: mca
+College/Institute/Organization: IIT
+Department/Designation: Developer
+Book Title: Introduction To Chemical Engineering
+Author: S. K. Ghoshal, S. K. Sanyal And S. Datta
+Publisher: Tata McGraw Hill Education Pvt. Ltd., New Delhi
+Year of publication: 2006
+Isbn: 0-07-460140-7
+Edition: 1 \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch1.ipynb b/Introduction_To_Chemical_Engineering/ch1.ipynb
new file mode 100644
index 00000000..a09b75a5
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch1.ipynb
@@ -0,0 +1,900 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.1 page number 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find composition of air by weight\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "y_oxygen = 0.21 #mole fraction of oxygen\n",
+ "y_nitrogen = 0.79 #mole fraction of nitrogen\n",
+ "molar_mass_oxygen = 32.\n",
+ "molar_mass_nitrogen = 28.\n",
+ "\n",
+ "# Calculations and Results\n",
+ "molar_mass_air = y_oxygen*molar_mass_oxygen+y_nitrogen*molar_mass_nitrogen;\n",
+ "mass_fraction_oxygen =y_oxygen*molar_mass_oxygen/molar_mass_air;\n",
+ "mass_fraction_nitrogen = y_nitrogen*molar_mass_nitrogen/molar_mass_air;\n",
+ "\n",
+ "print \"mass fraction of oxygen = %f \"%(mass_fraction_oxygen)\n",
+ "print \"mass fraction of nitrogen = %f \"%(mass_fraction_nitrogen)\n",
+ "\n",
+ "V1 = 22.4 #in liters\n",
+ "P1 = 760. #in mm Hg\n",
+ "P2= 735.56 #in mm Hg\n",
+ "T1= 273. #in K\n",
+ "T2 = 298. #in K\n",
+ "\n",
+ "V2= (P1*T2*V1)/(P2*T1);\n",
+ "density = molar_mass_air/V2;\n",
+ "\n",
+ "print \"density = %f gm/l\"%(density)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass fraction of oxygen = 0.233010 \n",
+ "mass fraction of nitrogen = 0.766990 \n",
+ "density = 1.141558 gm/l\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.2 page number 20\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the volume occupied by propane\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "mass_propane=14.2 #in kg\n",
+ "molar_mass=44 #in kg\n",
+ "\n",
+ "# Calculations\n",
+ "moles=(mass_propane*1000)/molar_mass;\n",
+ "volume=22.4*moles; #in liters\n",
+ "\n",
+ "# Results\n",
+ "print \"volume = %d liters\"%(volume)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volume = 7229 liters\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.3 page number 20\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the average weight, weight composition, gas volume in absence of SO2\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "y_CO2 = 0.25;\n",
+ "y_CO = 0.002;\n",
+ "y_SO2 = 0.012;\n",
+ "y_N2 = 0.680;\n",
+ "y_O2 = 0.056;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Mm = y_CO2*44+y_CO*28+y_SO2*64+y_N2*28+y_O2*32;\n",
+ "print \" molar mass = %d \"%(Mm)\n",
+ "\n",
+ "print \" finding weight composition \"\n",
+ "w_CO2 = y_CO2*44*100/Mm;\n",
+ "print \" weight_CO2 = %f \"%(w_CO2)\n",
+ "w_CO = y_CO*28*100/Mm;\n",
+ "print \"weight_CO = %f \"%(w_CO)\n",
+ "w_SO2 = y_SO2*64*100/Mm;\n",
+ "print \"weight_SO2 = %f \"%( w_SO2)\n",
+ "w_N2 = y_N2*28*100/Mm;\n",
+ "print \"weight_N2 = %f \"%( w_N2)\n",
+ "w_O2 = y_O2*32*100/Mm;\n",
+ "print \"weight_O2 = %f \"%( w_O2)\n",
+ "\n",
+ "print \"if SO2 is removed \"\n",
+ "v_CO2 = 25;\n",
+ "v_CO = 0.2;\n",
+ "v_N2 = 68.0;\n",
+ "v_O2 = 5.6;\n",
+ "v = v_CO2+v_CO+v_N2+v_O2;\n",
+ "v1_CO2 = (v_CO2*100/98.8);\n",
+ "\n",
+ "print \"volume_CO2 = %f \"%( v1_CO2)\n",
+ "v1_CO = (v_CO*100/98.8);\n",
+ "print \"volume_CO = %f \"%(v1_CO)\n",
+ "v1_N2 = (v_N2*100/98.8);\n",
+ "print \"volume_N2 = %f \"%(v1_N2)\n",
+ "v1_O2 = (v_O2*100/98.8);\n",
+ "print \"volume_O2 = %f \"%(v1_O2 )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " molar mass = 32 \n",
+ " finding weight composition \n",
+ " weight_CO2 = 33.684468 \n",
+ "weight_CO = 0.171485 \n",
+ "weight_SO2 = 2.351788 \n",
+ "weight_N2 = 58.304753 \n",
+ "weight_O2 = 5.487506 \n",
+ "if SO2 is removed \n",
+ "volume_CO2 = 25.303644 \n",
+ "volume_CO = 0.202429 \n",
+ "volume_N2 = 68.825911 \n",
+ "volume_O2 = 5.668016 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.4 page number 24\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find volume of NH3 dissolvable in water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p=1. #atm\n",
+ "H=2.7 #atm\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x=p/H;\n",
+ "\n",
+ "mole_ratio = (x)/(1-x);\n",
+ "moles_of_water=(100*1000)/18.;\n",
+ "moles_of_NH3=mole_ratio*moles_of_water;\n",
+ "\n",
+ "print \"moles of NH3 dissolved = %f\"%(moles_of_NH3)\n",
+ "\n",
+ "volume_NH3=(moles_of_NH3*22.4*293)/273;\n",
+ "print \"volume of NH3 dissolved = %f liters\"%(volume_NH3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "moles of NH3 dissolved = 3267.973856\n",
+ "volume of NH3 dissolved = 78565.443271 liters\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.5 page number 24\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to calculate amount of CO2 released by water\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "p=746 #in mm Hg\n",
+ "H=1.08*10**6 #in mm Hg, Henry's constant\n",
+ "\n",
+ "# Calculations\n",
+ "x= p/H; #mole fraction of CO2\n",
+ "X=x*(44./18); #mass ratio of CO2 in water\n",
+ "\n",
+ "initial_CO2 = 0.005; #kg CO2/kg H20\n",
+ "G=1000*(initial_CO2-X);\n",
+ "\n",
+ "# Results\n",
+ "print \"CO2 given up by 1 cubic meter of water = %f kg CO2/cubic meter H20\"%(G)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CO2 given up by 1 cubic meter of water = 3.311523 kg CO2/cubic meter H20\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.6 page number 27 \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find vapor pressre of ethyl alchohal\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "pa1 = 23.6; #VP of ethyl alchohal at 10 degree C\n",
+ "pa3=760. #VP of ethyl alchohal at 78.3 degree C in mm Hg\n",
+ "pb1 = 9.2 #VP of ethyl water at 10 degree C in mm Hg\n",
+ "pb3=332. #VP of ethyl water at 78.3 degree C in mm Hg\n",
+ "\n",
+ "# Calculations\n",
+ "C=(math.log10(pa1/pa3)/(math.log10(pb1/pb3)));\n",
+ "\n",
+ "pb2=149. #VP of water at 60 degree C in mm Hg\n",
+ "\n",
+ "pas=(pb3/pb2);\n",
+ "pa=C*math.log10(pas);\n",
+ "pa2=pa3/(10**pa);\n",
+ "\n",
+ "# Results\n",
+ "print \"vapor pressure of ethyl alcholoh at 60 degree C = %f mm Hg\"%(pa2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "vapor pressure of ethyl alcholoh at 60 degree C = 349.872551 mm Hg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.7 page number 28 \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find vapor pressure using duhring plot\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "t1 = 41. #in degree C\n",
+ "t2=59. #in degree C\n",
+ "theta_1 =83. #in degree C\n",
+ "theta_2=100. #in degree C\n",
+ "\n",
+ "# Calculations\n",
+ "K = (t1-t2)/(theta_1-theta_2);\n",
+ "t=59+(K*(104.2-100));\n",
+ "\n",
+ "# Results\n",
+ "print \"boiling point of SCl2 at 880 Torr = %f degree celcius\"%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "boiling point of SCl2 at 880 Torr = 63.447059 degree celcius\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.8 page number 29\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the amount of steam released\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "vp_C6H6 = 520. #in torr\n",
+ "vp_H2O = 225. #in torr\n",
+ "mass_water=18.\n",
+ "mass_benzene=78.\n",
+ "\n",
+ "# Calculations\n",
+ "amount_of_steam = (vp_H2O/vp_C6H6)/(mass_benzene/mass_water);\n",
+ "\n",
+ "# Results\n",
+ "print \"amount of steam = %f\"%( amount_of_steam)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of steam = 0.099852\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.9 page number 30\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find equilibrium vapor liquid composition\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p0b = 385. #vapor pressue of benzene at 60 degree C in torr\n",
+ "p0t=140. #vapor pressue of toluene at 60 degree C in torr\n",
+ "xb=0.4;\n",
+ "xt=0.6;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "pb=p0b*xb;\n",
+ "pt=p0t*xt;\n",
+ "P=pb+pt;\n",
+ "\n",
+ "print \"total pressure = %.0f torr\"%(P)\n",
+ "\n",
+ "yb=pb/P;\n",
+ "yt=pt/P;\n",
+ "print \"vapor composition of benzene = %f vapor composition of toluene = %f\"%(yb,yt)\n",
+ "\n",
+ "#for liquid boiling at 90 degree C and 760 torr, liquid phase composition\n",
+ "x=(760.-408)/(1013-408);\n",
+ "#(1013*x)+(408*(1-x))==760;\n",
+ "print \"mole fraction of benzene in liquid mixture = %.3f mole fraction of toluene in liquid mixture= %.3f\"%(x,1-x)\n",
+ "print \"Thus, the liquid mixture contained %.1f mole %% benzene and %.1f mole %% toluene\"%(x*100,(1-x)*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total pressure = 238 torr\n",
+ "vapor composition of benzene = 0.647059 vapor composition of toluene = 0.352941\n",
+ "mole fraction of benzene in liquid mixture = 0.582 mole fraction of toluene in liquid mixture= 0.418\n",
+ "Thus, the liquid mixture contained 58.2 mole % benzene and 41.8 mole % toluene\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.10 page number 33\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find relation between friction factor and reynold's number\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "#math.log f=y, math.log Re=x, math.log a=c\n",
+ "sigma_x=23.393;\n",
+ "sigma_y=-12.437;\n",
+ "sigma_x2=91.456\n",
+ "sigma_xy=-48.554;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m=((6*sigma_xy)-(sigma_x*sigma_y))/(6*sigma_x2-(sigma_x)**2);\n",
+ "print \"m = %f \"%(m)\n",
+ "\n",
+ "c=((sigma_x2*sigma_y)-(sigma_xy*sigma_x))/(6*sigma_x2-(sigma_x)**2);\n",
+ "print \"c = %f \"%(c)\n",
+ "\n",
+ "print \"f=0.084*Re**-0.256\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "m = -0.256233 \n",
+ "c = -1.073825 \n",
+ "f=0.084*Re**-0.256\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.11 page number 35\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the average velocity\n",
+ "\n",
+ "import math\n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import * \n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "# Variables\n",
+ "u = array([2,1.92,1.68,1.28,0.72,0]);\n",
+ "r = array([0,1,2,3,4,5]);\n",
+ "\n",
+ "# Calculations\n",
+ "z = u*r;\n",
+ "plot(r,z)\n",
+ "suptitle(\"variation of ur with r\")\n",
+ "xlabel(\"r\")\n",
+ "ylabel(\"ur\")\n",
+ "show()\n",
+ "#by graphical integration, we get\n",
+ "u_avg = (2./25)*12.4\n",
+ "\n",
+ "# Results\n",
+ "print \"average velocity = %f cm/s\"%(u_avg)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive', 'new_figure_manager']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEbCAYAAAA21FQWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9UlHW+B/D3CKzugKJ2F9oGSguuMQrM+Ast0EEz/Mnq\nmqdwVUot4mpqtp3y3r0GJ1I7Uh5T15Xa3LVfutItZ2tk1zYmRURWw+rYD7E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TESkImz5RNyg944X8H1/IJSJSEJ70iYgUhE2fiEhB2PSJiBSETZ+ISEHY9ImI\nFOT/AdQ5DLwCjsLdAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2575250>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average velocity = 0.992000 cm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.12 page number 37\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the average velocity\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "n = 6.;\n",
+ "h = (3. - 0)/n;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "I = (h/2.)*(0+2*0.97+2*1.78+2*2.25+2*2.22+2*1.52+0);\n",
+ "u_avg = (2./3**2)*I;\n",
+ "\n",
+ "print \"average velocity = %f cm/s\"%(u_avg)\n",
+ "\n",
+ "print ('Simpsons rule')\n",
+ "\n",
+ "n = 6.;\n",
+ "h = 3./n;\n",
+ "I = (h/3)*(0+4*(0.97+2.25+1.52)+2*(1.78+2.22)+0);\n",
+ "u_avg = (2./3**2)*I;\n",
+ "\n",
+ "print \"average velocity = %f cm/s\"%(u_avg)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average velocity = 0.971111 cm/s\n",
+ "Simpsons rule\n",
+ "average velocity = 0.998519 cm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.13 page number 38\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the settling velocity as a function of time\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "z0 = 30.84;\n",
+ "z1 = 29.89;\n",
+ "z2 = 29.10;\n",
+ "h = 4;\n",
+ "\n",
+ "# Calculations\n",
+ "u1_t0 = (-3*z0+4*z1-z2)/(2*h);\n",
+ "u1_t4 = (-z0+z2)/(2*h);\n",
+ "u1_t8 = (z0-4*z1+3*z2)/(2*h);\n",
+ "\n",
+ "#considering data set for t = 4,8,12 min\n",
+ "z0 = 29.89;\n",
+ "z1 = 29.10;\n",
+ "z2 = 28.30;\n",
+ "u2_t4 = (-3*z0+4*z1-z2)/(2*h);\n",
+ "u2_t8 = (-z0+z2)/(2*h);\n",
+ "u2_t12 = (z0-4*z1+3*z2)/(2*h);\n",
+ "\n",
+ "#considering data set for t = 8,12,16 min\n",
+ "z0 = 29.10;\n",
+ "z1 = 28.30;\n",
+ "z2 = 27.50;\n",
+ "u3_t8 = (-3*z0+4*z1-z2)/(2*h);\n",
+ "u3_t12 = (-z0+z2)/(2*h);\n",
+ "u3_t16 = (z0-4*z1+3*z2)/(2*h);\n",
+ "\n",
+ "#taking average\n",
+ "u_t4 = (u1_t4+u2_t4)/2;\n",
+ "u_t8 = (u1_t8+u2_t8+u3_t8)/3;\n",
+ "u_t12 = (u2_t12+u3_t12)/2;\n",
+ "\n",
+ "# Results\n",
+ "print \"u_t0 = %f cm/min u_t4 = %f cm/min u_t8 = %f cm/min u_t12 = %f/n cm/min u_t16 =%f/n cm/min \"%(u1_t0,u_t4,u_t8,u_t12,u3_t16)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u_t0 = -0.257500 cm/min u_t4 = -0.206875 cm/min u_t8 = -0.192083 cm/min u_t12 = -0.200625/n cm/min u_t16 =-0.200000/n cm/min \n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.16 page number 49\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flow rate and pressure drop\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "density_water=988. #in kg/m3\n",
+ "viscosity_water=55.*10**-5 #in Ns/m2\n",
+ "density_air=1.21 #in kg/m3\n",
+ "viscosity_air=1.83*10**-5 #in Ns/m2\n",
+ "L=1 #length in m\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "L1=10.*L #length in m\n",
+ "Q=0.0133;\n",
+ "\n",
+ "Q1=((Q*density_water*viscosity_air*L)/(L1*viscosity_water*density_air))\n",
+ "\n",
+ "print \"flow rate = %f cubic meter/s\"%(Q1)\n",
+ "\n",
+ "#equating euler number\n",
+ "\n",
+ "p=9.8067*10**4; #pressure in pascal\n",
+ "p1=(p*density_water*Q**2*L**4)/(density_air*Q1**2*L1**4);\n",
+ "\n",
+ "print \"pressure drop corresponding to 1kp/square cm = %f kP/square cm\"%(p1/p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "flow rate = 0.036134 cubic meter/s\n",
+ "pressure drop corresponding to 1kp/square cm = 0.011062 kP/square cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.17 page number 50\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the specific gravity of plasstic\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "L=1. #length of prototype in m\n",
+ "L1=10*L #length of model in m\n",
+ "density_prototype=2.65 #gm/cc\n",
+ "density_water=1. #gm/cc\n",
+ "\n",
+ "# Calculations\n",
+ "density_model=(L**3*(density_prototype-density_water))/(L1**3)+1;\n",
+ "\n",
+ "# Results\n",
+ "print \"specific gravity of plastic = %f\"%(density_model)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "specific gravity of plastic = 1.001650\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.18 page number 53\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find error in actual data and nomographic chat value\n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "#for my\n",
+ "ly = 8 #in cm\n",
+ "my = ly/((1/0.25) - (1/0.5));\n",
+ "lz = 10.15 #in cm\n",
+ "\n",
+ "# Calculations and Results\n",
+ "mz = lz/((1./2.85) - (1/6.76));\n",
+ "mx = (my*mz)/(my+mz);\n",
+ "print \"mx = %f cm\"%(mx)\n",
+ "err = ((1-0.9945)/0.9945)*100;\n",
+ "print \"error = %f \"%(err)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mx = 3.703774 cm\n",
+ "error = 0.553042 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.19 page number 54\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the economic pipe diameter from nomograph\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "#from the nomograph,we get the values of w and density\n",
+ "w=450. #in kg/hr\n",
+ "density=1000. #in kg/m3\n",
+ "d=16. #in mm\n",
+ "\n",
+ "# Calculations\n",
+ "u=(w/density)/(3.14*d**2/4);\n",
+ "Re=u*density*d/0.001;\n",
+ "\n",
+ "# Results\n",
+ "if Re>2100:\n",
+ " print \"flow is turbulent and d= %f mm\"%(d)\n",
+ "else:\n",
+ " print (\"flow is laminar and this nomograph is not valid\")\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "flow is turbulent and d= 16.000000 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch2.ipynb b/Introduction_To_Chemical_Engineering/ch2.ipynb
new file mode 100644
index 00000000..7f49d9ae
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch2.ipynb
@@ -0,0 +1,1550 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Physico Chemical Calculations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.1 page number 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the volume of oxygen that can be obtained\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p1=15. #in bar\n",
+ "p2=1.013 #in bar\n",
+ "t1=283. #in K\n",
+ "t2=273. #in K\n",
+ "v1=10. #in l\n",
+ "\n",
+ "# Calculations\n",
+ "v2=p1*v1*t2/(t1*p2);\n",
+ "\n",
+ "# Results\n",
+ "print \"volume of oxygen = %f liters\"%(v2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volume of oxygen = 142.842692 liters\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.2 page number 71\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find volumetric composition,partial pressue of each gas and total pressure of mixture\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "nCO2 = 2./44; #moles of CO2\n",
+ "nO2 = 4./32; #moles of O2\n",
+ "nCH4 = 1.5/16; #moles of CH4\n",
+ "\n",
+ "# Calculations and Results\n",
+ "total_moles = nCO2+nO2+nCH4;\n",
+ "yCO2 = nCO2/total_moles;\n",
+ "yO2 = nO2/total_moles;\n",
+ "yCH4 = nCH4/total_moles;\n",
+ "\n",
+ "print \" Composition of mixture = CH4 = %f O2 = %f CO2 = %f \"%(yCH4,yO2,yCO2)\n",
+ "\n",
+ "pCO2=nCO2*8.314*273/(6*10**-3);\n",
+ "pO2=nO2*8.314*273/(6*10**-3);\n",
+ "pCH4=nCH4*8.314*273/(6*10**-3);\n",
+ "\n",
+ "print \"pressure of CH4 = %f kPa pressure of O2 = %f kPa pressure of CO2 =%f kPa\"%(pCH4*10**-3,pO2*10**-3,pCO2*10**-3)\n",
+ "\n",
+ "total_pressure=pCO2+pCH4+pO2;\n",
+ "print \"total pressure = %f Kpa\"%(total_pressure*10**-3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Composition of mixture = CH4 = 0.354839 O2 = 0.473118 CO2 = 0.172043 \n",
+ "pressure of CH4 = 35.464406 kPa pressure of O2 = 47.285875 kPa pressure of CO2 =17.194864 kPa\n",
+ "total pressure = 99.945145 Kpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.3 page number 72\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find equivalent mass of metal\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P=104.3 #total pressure in KPa\n",
+ "pH2O=2.3 #in KPa\n",
+ "pH2=P-pH2O; #in KPa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "VH2=209*pH2*273/(293*101.3)\n",
+ "\n",
+ "print \"volume of hydrogen obtained = %f ml\"%(VH2)\n",
+ "\n",
+ "#calculating amount of metal having 11.2l of hydrogen\n",
+ "\n",
+ "m=350/196.08*11.2 #mass of metal in grams\n",
+ "print \"mass of metal equivalent to 11.2 litre/mol of hydrogen = %f gm\"%(m)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volume of hydrogen obtained = 196.079432 ml\n",
+ "mass of metal equivalent to 11.2 litre/mol of hydrogen = 19.991840 gm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.4 page number 72\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find NaCl content in NaOH solution\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "w=2 #in gm\n",
+ "m=0.287 #in gm\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#precipitate from 58.5gm of NaCl=143.4gm\n",
+ "mNaCl=58.5/143.4*m;\n",
+ "\n",
+ "print \"mass of NaCl = %f gm\"%(mNaCl )\n",
+ "\n",
+ "percentage_NaCl=mNaCl/w*100;\n",
+ "print \"amount of NaCl = %f\"%(percentage_NaCl)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass of NaCl = 0.117082 gm\n",
+ "amount of NaCl = 5.854079\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.5 page number 72\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the carbon content in sample\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "w=4.73 #in gm5\n",
+ "VCO2=5.30 #in liters\n",
+ "\n",
+ "# Calculations\n",
+ "weight_CO2=44/22.4*VCO2;\n",
+ "carbon_content=12./44*weight_CO2;\n",
+ "percentage_content=(carbon_content/w)*100;\n",
+ "\n",
+ "# Results\n",
+ "print \"percentage amount of carbon in sample = %f\"%(percentage_content)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percentage amount of carbon in sample = 60.027182\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.6 page number 73\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the volume of air\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "volume_H2=0.5 #in m3\n",
+ "volume_CH4=0.35 #in m3\n",
+ "volume_CO=0.08 #in m3\n",
+ "volume_C2H4=0.02 #in m3\n",
+ "volume_oxygen=0.21 #in m3 in air\n",
+ "\n",
+ "# Calculations\n",
+ "#required oxygen for various gases\n",
+ "H2=0.5*volume_H2;\n",
+ "CH4=2*volume_CH4;\n",
+ "CO=0.5*volume_CO;\n",
+ "C2H4=3*volume_C2H4;\n",
+ "\n",
+ "total_O2=H2+CH4+CO+C2H4;\n",
+ "oxygen_required=total_O2/volume_oxygen;\n",
+ "\n",
+ "# Results\n",
+ "print \"amount of oxygen required = %f cubic meter\"%(oxygen_required)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of oxygen required = 5.000000 cubic meter\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.7 page number 73\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the volume of sulphuric acid and mass of water consumed\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "density_H2SO4 = 1.10 #in g/ml\n",
+ "mass_1 = 100*density_H2SO4; #mass of 100ml of 15% solution\n",
+ "mass_H2SO4 = 0.15*mass_1;\n",
+ "density_std = 1.84 #density of 96% sulphuric acid\n",
+ "mass_std = 0.96*density_std; #mass of H2SO4 in 1ml 96% H2SO4\n",
+ "\n",
+ "# Calculations\n",
+ "volume_std = mass_H2SO4/mass_std; #volume of 96%H2SO4\n",
+ "mass_water = mass_1 - mass_H2SO4;\n",
+ "\n",
+ "# Results\n",
+ "print \"volume of 0.96 H2SO4 required = %f ml\"%(volume_std)\n",
+ "print \"mass of water required = %f g\"%(mass_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volume of 0.96 H2SO4 required = 9.341033 ml\n",
+ "mass of water required = 93.500000 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.8 page number 73\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find molarity,molality and normality\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "w_H2SO4=0.15 #in gm/1gm solution\n",
+ "density=1.10 #in gm/ml\n",
+ "m=density*1000; #mass per liter\n",
+ "weight=m*w_H2SO4; #H2SO4 per liter solution\n",
+ "molar_mass=98;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Molarity=weight/molar_mass;\n",
+ "print \"Molarity = %f mol/l\"%(Molarity)\n",
+ "\n",
+ "equivalent_mass=49;\n",
+ "normality=weight/equivalent_mass;\n",
+ "print \"Normality = %f N\"%(normality)\n",
+ "\n",
+ "molality=176.5/molar_mass;\n",
+ "print \"Molality = %f\"%(molality)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molarity = 1.683673 mol/l\n",
+ "Normality = 3.367347 N\n",
+ "Molality = 1.801020\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.9 page number 74\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find normality\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "molar_mass_BaCl2=208.3; #in gm\n",
+ "equivalent_H2SO4=0.144;\n",
+ "\n",
+ "# Calculations\n",
+ "normality=equivalent_H2SO4*1000/28.8;\n",
+ "\n",
+ "# Results\n",
+ "print \"Normality = %f N\"%(normality)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Normality = 5.000000 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.10 page number 74\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find amount of KClO3 precipitated\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "solubility_70=30.2 #in gm/100gm\n",
+ "w_solute=solubility_70*350/130.2; #in gm\n",
+ "\n",
+ "# Calculations\n",
+ "w_water=350-w_solute;\n",
+ "solubility_30=10.1 #in gm/100gm\n",
+ "precipitate=(solubility_70-solubility_30)*w_water/100\n",
+ "\n",
+ "# Results\n",
+ "print \"amount precipitated = %f gm\"%(precipitate)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount precipitated = 54.032258 gm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.11 page number 74\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the pressure for solubility of CO2\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "absorbtion_coefficient=1.71 #in liters\n",
+ "molar_mass=44;\n",
+ "\n",
+ "# Calculations\n",
+ "solubility=absorbtion_coefficient*molar_mass/22.4; #in gm\n",
+ "pressure=8/solubility*101.3;\n",
+ "\n",
+ "# Results\n",
+ "print \"pressure required = %f kPa\"%(pressure)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure required = 241.267411 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.12 page number 74\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the vapor pressure of water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "w_water=540. #in gm\n",
+ "w_glucose=36. #in gm\n",
+ "m_water=18.; #molar mass of water\n",
+ "m_glucose=180.; #molar mass of glucose\n",
+ "\n",
+ "# Calculations\n",
+ "x=(w_water/m_water)/(w_water/m_water+w_glucose/m_glucose);\n",
+ "p=8.2*x;\n",
+ "depression=8.2-p;\n",
+ "\n",
+ "# Results\n",
+ "print \"depression in vapor pressure = %f Pa\"%(depression*1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "depression in vapor pressure = 54.304636 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.13 page number 75\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the boiling point of solution\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "w_glucose=9. #in gm\n",
+ "w_water=100. #in gm\n",
+ "E=0.52;\n",
+ "m=90/180.; #moles/1000gm water\n",
+ "\n",
+ "# Calculations\n",
+ "delta_t=E*m;\n",
+ "boiling_point=100+delta_t;\n",
+ "\n",
+ "# Results\n",
+ "print \"boiling_point of water = %f degreeC\"%(boiling_point)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "boiling_point of water = 100.260000 degreeC\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.14 page number 75\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the molar mass and osmotic pressure\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "K=1.86;\n",
+ "c=15 #concentration of alcohol\n",
+ "delta_t=10.26;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "m=delta_t/K; #molality\n",
+ "M=c/(m*85); #molar mass\n",
+ "print \"molar mass = %f gm\"%(M*1000)\n",
+ "\n",
+ "density=0.97 #g/ml\n",
+ "cm=c*density/(M*100);\n",
+ "print \"molar concentration of alcohol = %f moles/l\"%(cm)\n",
+ "\n",
+ "p=cm*8.314*293 #osmotic pressure\n",
+ "print \"osmotic pressure = %f Mpa\"%(p/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "molar mass = 31.991744 gm\n",
+ "molar concentration of alcohol = 4.548048 moles/l\n",
+ "osmotic pressure = 11.079055 Mpa\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.15 page number 75\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find u_in, M_v, k'\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "u_in = 0.575 #from the graph\n",
+ "u_s = 0.295 #in mPa-s\n",
+ "\n",
+ "# Calculations\n",
+ "M_v = (u_in/(5.80*10**-5))**(1/0.72);\n",
+ "u_red = 0.628; #in dl/g\n",
+ "\n",
+ "c = 0.40 #in g/dl\n",
+ "k = (u_red-u_in)/((u_in**2)*c);\n",
+ "\n",
+ "# Results\n",
+ "print \"k = %f Mv = %fu_in = %f dl/gm\"%(k,M_v,u_in)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "k = 0.400756 Mv = 355085.654054u_in = 0.575000 dl/gm\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.16 page number 76\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the molecular formula\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "C=54.5 #% of carbon\n",
+ "H2=9.1 #% of hydrogen\n",
+ "O2=36.4 #% of oxygen\n",
+ "x=C/12.; #number of carbon molecules\n",
+ "y=O2/16.; #number of oxygen molecules\n",
+ "z=H2/2. #number of hydrogen molecules\n",
+ "molar_mass=88.;\n",
+ "density=44.;\n",
+ "\n",
+ "# Calculations\n",
+ "ratio=molar_mass/density;\n",
+ "x=ratio*2;\n",
+ "y=ratio*1;\n",
+ "z=ratio*4;\n",
+ "\n",
+ "# Results\n",
+ "print \"x = %f y = %f z = %f\"%(x,y,z)\n",
+ "print \"formula of butyric acid is = C4H8O2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 4.000000 y = 2.000000 z = 8.000000\n",
+ "formula of butyric acid is = C4H8O2\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.17 page number 77\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find molecular foemula \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "C=93.75 #% of carbon\n",
+ "H2=6.25 #% of hydrogen\n",
+ "x=C/12 #number of carbon atoms\n",
+ "y=H2/2 #number of hydrogen atoms\n",
+ "molar_mass=64\n",
+ "density=4.41*29;\n",
+ "\n",
+ "# Calculations\n",
+ "ratio=density/molar_mass;\n",
+ "x=round(ratio*5);\n",
+ "y=round(ratio*4);\n",
+ "\n",
+ "# Results\n",
+ "print \"x = %f y = %f\"%(x,y)\n",
+ "print \"formula of butyric acid is = C10H8\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 10.000000 y = 8.000000\n",
+ "formula of butyric acid is = C10H8\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.18 page number 77\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find molecular formula\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "C=50.69 #% of carbon\n",
+ "H2=4.23 #% of hydrogen\n",
+ "O2=45.08 #% of oxygen\n",
+ "a=C/12; #number of carbon molecules\n",
+ "c=O2/16; #number of oxygen molecules\n",
+ "b=H2/2; #number of hydrogen molecules\n",
+ "molar_mass=71;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "def f(m):\n",
+ " return (2.09*1000)/(60*m);\n",
+ "\n",
+ "\n",
+ "M=f((1.25/5.1));\n",
+ "\n",
+ "print \"actual molecular mass = %f\"%(M)\n",
+ "\n",
+ "ratio=M/molar_mass;\n",
+ "a=round(ratio*3);\n",
+ "b=round(ratio*3);\n",
+ "c=round(ratio*2);\n",
+ "\n",
+ "print \"a = %d, b = %d, c = %d\"%(a,b,c)\n",
+ "print \"M = %.1f g/mol\"%M\n",
+ "print \"formula of butyric acid is = C6H6O4\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "actual molecular mass = 142.120000\n",
+ "a = 6, b = 6, c = 4\n",
+ "M = 142.1 g/mol\n",
+ "formula of butyric acid is = C6H6O4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.19 page number 78\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the molecular formula\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "C=64.6 #% of carbon\n",
+ "H2=5.2 #% of hydrogen\n",
+ "O2=12.6 #% of oxygen\n",
+ "N2=8.8 #% of nitrogen\n",
+ "Fe=8.8 #% of iron\n",
+ "\n",
+ "# Calculations\n",
+ "a=C/12; #number of carbon molecules\n",
+ "c=8.8/14; #number of nitrogen molecules\n",
+ "b=H2; #number of hydrogen molecules\n",
+ "d=O2/16; #number of oxygen molecules\n",
+ "e=Fe/56 #number of iron atoms\n",
+ "\n",
+ "cm=243.4/(8.31*293) #concentration\n",
+ "\n",
+ "molar_mass=63.3/cm;\n",
+ " \n",
+ "# Results \n",
+ "print \"a = %d, b = %d, c = %d, d = %d, e = %d\"%(a*6.5,b*6.5,c*6.5,d*6.5,e*6.5)\n",
+ "print \"formula of butyric acid is = C34H33N4O5Fe\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a = 34, b = 33, c = 4, d = 5, e = 1\n",
+ "formula of butyric acid is = C34H33N4O5Fe\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.20 page number 78\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find sequence of deposition\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "E1=-0.25;\n",
+ "E2=0.80;\n",
+ "E3=0.34;\n",
+ "\n",
+ "# Calculations\n",
+ "a=[E1,E2,E3];\n",
+ "sorted(a)\n",
+ "\n",
+ "# Results\n",
+ "print \"sorted potential in volts =\"\n",
+ "print (a)\n",
+ "print (\"E2>E3>E1\")\n",
+ "print (\"silver>copper>nickel\")\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sorted potential in volts =\n",
+ "[-0.25, 0.8, 0.34]\n",
+ "E2>E3>E1\n",
+ "silver>copper>nickel\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.21 page number 79\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the emf of cell\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "E0_Zn=-0.76;\n",
+ "E0_Pb=-0.13;\n",
+ "c_Zn=0.1;\n",
+ "c_Pb=0.02;\n",
+ "\n",
+ "# Calculations\n",
+ "E_Zn=E0_Zn+(0.059/2)*math.log10(c_Zn);\n",
+ "E_Pb=E0_Pb+(0.059/2)*math.log10(c_Pb);\n",
+ "E=E_Pb-E_Zn;\n",
+ "\n",
+ "# Results\n",
+ "print \"emf of cell = %f V\"%(E)\n",
+ "print \"Since potential of lead is greater than that of zinc thus reduction will occur at\\\n",
+ " lead electrode and oxidation will occur at zinc electrode\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "emf of cell = 0.609380 V\n",
+ "Since potential of lead is greater than that of zinc thus reduction will occur at lead electrode and oxidation will occur at zinc electrode\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.22 page number 79\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the emf of cell\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "E0_Ag=0.80;\n",
+ "E0_AgNO3=0.80;\n",
+ "c_Ag=0.001;\n",
+ "c_AgNO3=0.1;\n",
+ "\n",
+ "# Calculations\n",
+ "E_Ag=E0_Ag+(0.059)*math.log10(c_Ag);\n",
+ "E_AgNO3=E0_AgNO3+(0.059)*math.log10(c_AgNO3);\n",
+ "E=E_AgNO3-E_Ag;\n",
+ "\n",
+ "# Results\n",
+ "print \"emf of cell = %f V\" %(E)\n",
+ "print \"since E is positive, the left hand electrode will be anode and\\\n",
+ " the electron will travel in the external circuit from the left hand to the right hand electrode\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "emf of cell = 0.118000 V\n",
+ "since E is positive, the left hand electrode will be anode and the electron will travel in the external circuit from the left hand to the right hand electrode\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.23 page number 79\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find emf of cell\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "pH=12; #pH of solution\n",
+ "E_H2=0;\n",
+ "\n",
+ "# Calculations\n",
+ "E2=-0.059*pH;\n",
+ "E=E_H2-E2;\n",
+ "\n",
+ "# Results\n",
+ "print \"EMF of cell = %f V\"%(E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "EMF of cell = 0.708000 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.24 page number 80\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find amount of silver deposited\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "I=3 #in Ampere\n",
+ "t=900 #in s\n",
+ "m_eq=107.9 #in gm/mol\n",
+ "F=96500;\n",
+ "\n",
+ "# Calculations\n",
+ "m=(I*t*m_eq)/F;\n",
+ "\n",
+ "# Results\n",
+ "print \"mass = %f gm\"%(m)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass = 3.018964 gm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.25 page number 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the time for electroplating\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "volume=10*10*0.005; #in cm3\n",
+ "mass=volume*8.9;\n",
+ "F=96500;\n",
+ "atomic_mass=58.7 #in amu\n",
+ "current=2.5 #in Ampere\n",
+ "\n",
+ "# Calculations\n",
+ "charge=(8.9*F*2)/atomic_mass;\n",
+ "yield_=0.95;\n",
+ "actual_charge=charge/(yield_*3600);\n",
+ "t=actual_charge/current;\n",
+ "\n",
+ "# Results\n",
+ "print \"time required = %f hours\"%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time required = 3.422497 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.26 page number 80\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find hardness of water\n",
+ "\n",
+ "# Variables\n",
+ "m_MgSO4=90. #in ppm\n",
+ "MgSO4_parts=120.;\n",
+ "CaCO3_parts=100.;\n",
+ "\n",
+ "# Calculations\n",
+ "hardness=(CaCO3_parts/MgSO4_parts)*m_MgSO4;\n",
+ "\n",
+ "# Results\n",
+ "print \"hardness of water = %f mg/l\"%(hardness)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hardness of water = 75.000000 mg/l\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.27 page number 81\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate\n",
+ "i) the temporary and total hardness of the sample\n",
+ "ii) the amounts of lime and soda needed for softening of 1 l of the sample\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m1 = 162. #mass of calcium bi carbonate in mg\n",
+ "m2 = 73. #mass of magnesium bi carbonate in mg\n",
+ "m3 = 136. # mass of calsium sulfate in mg\n",
+ "m4 = 95. # mass of magnesium cloride\n",
+ "m5 = 500. #mass of sodium cloride in mg\n",
+ "m6 = 50. # mass of potassium cloride in mg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "content_1 = m1*100/m1; #content of calcium bi carbonate in mg\n",
+ "content_2 = m2*100/(2*m2); #content of magnesium bi carbonate in mg\n",
+ "content_3 = m3*100/m3; # content of calsium sufate in mg\n",
+ "content_4 = m4*100/m4; # content of magnesium cloride\n",
+ "\n",
+ "#part_1\n",
+ "\n",
+ "temp_hardness = content_1 + content_2; #depends on bicarbonate only\n",
+ "total_hardness = content_1+content_2+content_3+content_4;\n",
+ "print \"total hardness = %.0f mg/l temporary hardness = %.0f mg/l\"%(temp_hardness,total_hardness)\n",
+ "\n",
+ "#part 2\n",
+ "wt_lime = (74./100)*(content_1+2*content_2+content_4);\n",
+ "actual_lime = wt_lime/0.85;\n",
+ "print \"amount of lime required = %.1f mg/l\"%(actual_lime)\n",
+ "\n",
+ "soda_required = (106./100)*(content_1+content_4);\n",
+ "actual_soda = soda_required/0.98;\n",
+ "print \"amount of soda required = %.1f mg/l\"%(actual_soda)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total hardness = 150 mg/l temporary hardness = 350 mg/l\n",
+ "amount of lime required = 261.2 mg/l\n",
+ "amount of soda required = 216.3 mg/l\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.28 page number 82\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find hardness of water\n",
+ "\n",
+ "# Variables\n",
+ "volume_NaCl=50. #in l\n",
+ "c_NaCl=5000. #in mg/l\n",
+ "\n",
+ "# Calculations\n",
+ "m=volume_NaCl*c_NaCl;\n",
+ "equivalent_NaCl=50/58.5;\n",
+ "\n",
+ "hardness=equivalent_NaCl*m;\n",
+ "\n",
+ "# Results\n",
+ "print \"hardness of water = %f mg/l\"%(hardness/1000.)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hardness of water = 213.675214 mg/l\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.29 page number 82\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the total vapor pressure and molar compositions\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_benzene = 55. #in kg\n",
+ "m_toluene = 28. #in kg\n",
+ "m_xylene = 17. # in kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "mole_benzene = m_benzene/78.;\n",
+ "mole_toluene = m_toluene/92.;\n",
+ "mole_xylene = m_xylene/106.;\n",
+ "\n",
+ "mole_total = mole_benzene+mole_toluene+mole_xylene;\n",
+ "x_benzene = mole_benzene/mole_total;\n",
+ "x_toluene = mole_toluene/mole_total;\n",
+ "x_xylene = mole_xylene/mole_total;\n",
+ "\n",
+ "P = x_benzene*178.6+x_toluene*74.6+x_xylene*28;\n",
+ "print \"total pressure = %f kPa\"%(P)\n",
+ "\n",
+ "benzene = (x_benzene*178.6*100)/P;\n",
+ "toluene = (x_toluene*74.6*100)/P;\n",
+ "xylene = (x_xylene*28*100)/P;\n",
+ "\n",
+ "print \"xylene = %f toluene = %f benzene = %f\"%(xylene,toluene,benzene)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total pressure = 130.897438 kPa\n",
+ "xylene = 2.932503 toluene = 14.826766 benzene = 82.240730\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.30 page number 83\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the mixture composition\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "vapor_pressure=8. #in kPa\n",
+ "pressure=100. #in kPa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#part 1\n",
+ "volume=1 #in m3\n",
+ "volume_ethanol=volume*(vapor_pressure/pressure);\n",
+ "volume_air=1-volume_ethanol;\n",
+ "print \"volumetric composition:- air composition = %f ethanol compostion = %f\"%(volume_air*100,volume_ethanol*100)\n",
+ "\n",
+ "#part 2\n",
+ "molar_mass_ethanol=46;\n",
+ "molar_mass_air=28.9;\n",
+ "mass_ethanol=0.08*molar_mass_ethanol; #in kg\n",
+ "mass_air=0.92*molar_mass_air; #in kg\n",
+ "fraction_ethanol=(mass_ethanol*100)/(mass_air+mass_ethanol);\n",
+ "fraction_air=(mass_air*100)/(mass_air+mass_ethanol);\n",
+ "print \"composition by weight:-Air = %f Ethanol vapor = %f\"%(fraction_air,fraction_ethanol)\n",
+ "\n",
+ "#part 3\n",
+ "mixture_volume=22.3*(101.3/100)*(299./273); #in m3\n",
+ "weight_ethanol=mass_ethanol/mixture_volume;\n",
+ "print \"weight of ethanol/cubic meter = %f Kg\"%(weight_ethanol)\n",
+ "\n",
+ "#part 4\n",
+ "w_ethanol=mass_ethanol/mass_air;\n",
+ "print \"weight of ethanol/kg vapor free air = %f Kg\"%(w_ethanol)\n",
+ "\n",
+ "#part 5\n",
+ "moles_ethanol=0.08/0.92;\n",
+ "print \"kmol of ethanol per kmol of vapor free air = %f\"%(moles_ethanol)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric composition:- air composition = 92.000000 ethanol compostion = 8.000000\n",
+ "composition by weight:-Air = 87.841945 Ethanol vapor = 12.158055\n",
+ "weight of ethanol/cubic meter = 0.148739 Kg\n",
+ "weight of ethanol/kg vapor free air = 0.138408 Kg\n",
+ "kmol of ethanol per kmol of vapor free air = 0.086957\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.31 page number 84\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find relative saturation and dew point\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "vapor_pressure=8. #in kPa\n",
+ "volume_ethanol=0.05;\n",
+ "\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#basis 1kmol of mixture\n",
+ "partial_pressure=volume_ethanol*100;\n",
+ "relative_saturation=partial_pressure/vapor_pressure;\n",
+ "mole_ratio=volume_ethanol/(1-volume_ethanol);\n",
+ "print \"mole ratio = %f \\nrelative saturation = %f %%\"%(mole_ratio,relative_saturation*100)\n",
+ "\n",
+ "#basis 1kmol saturated gas mixture at 100kPa\n",
+ "volume_vapor=(8./100)*100;\n",
+ "ethanol_vapor=volume_vapor/100.;\n",
+ "air_vapor=1-ethanol_vapor;\n",
+ "saturation_ratio=ethanol_vapor/air_vapor;\n",
+ "percentage_saturation=mole_ratio/saturation_ratio;\n",
+ "\n",
+ "print \"percentage saturation = %f %%\"%(percentage_saturation*100)\n",
+ "\n",
+ "#dew point\n",
+ "print \"corresponding to partial pressure of 5kPa we get a dew point of 17.3 degree celcius\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mole ratio = 0.052632 \n",
+ "relative saturation = 62.500000 %\n",
+ "percentage saturation = 60.526316 %\n",
+ "corresponding to partial pressure of 5kPa we get a dew point of 17.3 degree celcius\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.32 page number 84\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the properties of humid air\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p = 4.24 #in kPa\n",
+ "H_rel = 0.8;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "p_partial = p*H_rel;\n",
+ "molal_H = p_partial/(100-p_partial);\n",
+ "print \"initial molal humidity = %.3f\"%(molal_H)\n",
+ "\n",
+ "#part 2\n",
+ "P = 200. #in kPa\n",
+ "p_partial = 1.70 #in kPa\n",
+ "final_H = p_partial/(P-p_partial);\n",
+ "print \"final molal humidity = %.4f\"%(final_H)\n",
+ "\n",
+ "#part 3\n",
+ "p_dryair = 100 - 3.39;\n",
+ "v = 100*(p_dryair/101.3)*(273./303);\n",
+ "moles_dryair = v/22.4;\n",
+ "vapor_initial = molal_H*moles_dryair;\n",
+ "vapor_final = final_H*moles_dryair;\n",
+ "water_condensed = (vapor_initial-vapor_final)*18;\n",
+ "print \"amount of water condensed = %f kg\"%(water_condensed)\n",
+ "\n",
+ "#part 4\n",
+ "total_air = moles_dryair+vapor_final;\n",
+ "final_v = 22.4*(101.3/200)*(288./273)*total_air;\n",
+ "print \"final volume of wety air = %f m**3\"%(final_v)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "initial molal humidity = 0.035\n",
+ "final molal humidity = 0.0086\n",
+ "amount of water condensed = 1.832428 kg\n",
+ "final volume of wety air = 46.307275 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch3.ipynb b/Introduction_To_Chemical_Engineering/ch3.ipynb
new file mode 100644
index 00000000..e6461254
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch3.ipynb
@@ -0,0 +1,1587 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Material and Energy Balances"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.1 page number 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the coal consumption\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "w_C = 0.6; #amount of carbon in coal\n",
+ "N2_content = 40. #in m3 per 100m3 air\n",
+ "\n",
+ "# Calculations\n",
+ "air_consumed = N2_content/0.79;\n",
+ "weight_air = air_consumed*(28.8/22.4);\n",
+ "O2_content = air_consumed*32*(0.21/22.4); #in kg\n",
+ "\n",
+ "H2_content = 20. #in m3\n",
+ "\n",
+ "steam_consumed = H2_content*(18/22.4);\n",
+ "\n",
+ "C_consumption1 = (12./18)*steam_consumed; #in reaction 1\n",
+ "C_consumption2 = (24./32)*O2_content; #in reaction 2\n",
+ "\n",
+ "total_consumption = C_consumption1+C_consumption2;\n",
+ "coal_consumption = total_consumption/w_C;\n",
+ "\n",
+ "# Results\n",
+ "print \"coal consumption = %f kg\"%(coal_consumption)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "coal consumption = 36.844485 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.2 page number 91\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find amount of ammonia and air consumed\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "NH3_required = (17./63)*1000; #NH3 required for 1 ton of nitric acid\n",
+ "NO_consumption = 0.96;\n",
+ "HNO3_consumption = 0.92;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "NH3_consumed = NH3_required/(NO_consumption*HNO3_consumption);\n",
+ "volume_NH3 = NH3_consumed*(22.4/17);\n",
+ "print \"volume of ammonia consumed= %f cubic metre/h\"%(volume_NH3)\n",
+ "\n",
+ "NH3_content = 11. #% by volume\n",
+ "air_consumption = volume_NH3*((100-11)/11.);\n",
+ "print \"volume of air consumed = %f cubic metre/h\"%(air_consumption)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volume of ammonia consumed= 402.576490 cubic metre/h\n",
+ "volume of air consumed = 3257.209779 cubic metre/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.3 page number 91\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the consumption of NaCl and H2SO4 in HCl consumption\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "HCl_production = 500. #required to be produced in kg\n",
+ "NaCl_required = (117./73)*HCl_production;\n",
+ "yield_ = 0.92;\n",
+ "purity_NaCl= 0.96;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "actual_NaCl = NaCl_required/(purity_NaCl*yield_);\n",
+ "print \"amount of NaCl required = %f kg\"%(actual_NaCl)\n",
+ "\n",
+ "purity_H2SO4 = 0.93;\n",
+ "H2SO4_consumption = (98./73)*(HCl_production/(yield_*purity_H2SO4));\n",
+ "print \"amount of H2SO4 consumed = %f kg\"%(H2SO4_consumption)\n",
+ "\n",
+ "Na2SO4_produced = (142/73.)*HCl_production;\n",
+ "print \"amount of Na2SO4 produced = %f kg\"%(Na2SO4_produced)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of NaCl required = 907.348124 kg\n",
+ "amount of H2SO4 consumed = 784.517154 kg\n",
+ "amount of Na2SO4 produced = 972.602740 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.4 page number 92\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the period of service\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "C2H2_produced = (1./64)*0.86; #in kmol\n",
+ "volume_C2H2 = C2H2_produced*22.4*1000; #in l\n",
+ "\n",
+ "# Calculations\n",
+ "#assuming ideal behaviour,\n",
+ "volume = (100/101.3)*(273./(273+30));\n",
+ "time = (volume_C2H2/volume)*(1./60);\n",
+ "\n",
+ "# Results\n",
+ "print \"time of service = %f hr\"%(time)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time of service = 5.640332 hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.5 page number 92\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the screen effectiveness\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "xv = 0.88;\n",
+ "xf = 0.46;\n",
+ "xl = 0.32;\n",
+ "F= 100. #in kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "L = (F*(xf-xv))/(xl-xv);\n",
+ "V = F-L;\n",
+ "print \"L = %f Kg V = %f Kg\"%(L,V)\n",
+ "Eo = (V*xv)/(F*xf);\n",
+ "\n",
+ "print \" effectiveness based on oversized partices = %f \"%(Eo)\n",
+ "Eu = (L*(1-xl))/(F*(1-xf));\n",
+ "\n",
+ "print \"effectiveness based on undersized partices = %f\"%(Eu)\n",
+ "E=Eu*Eo;\n",
+ "\n",
+ "print \"overall effectiveness = %f\"%(E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L = 75.000000 Kg V = 25.000000 Kg\n",
+ " effectiveness based on oversized partices = 0.478261 \n",
+ "effectiveness based on undersized partices = 0.944444\n",
+ "overall effectiveness = 0.451691\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.6 page number 94\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flow rate and concentration\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "G1 = 3600. #in m3/h\n",
+ "P = 106.6 #in kPa\n",
+ "T = 40 #in degree C\n",
+ "\n",
+ "# Calculations and Results\n",
+ "q = G1*(P/101.3)*(273./((273+T))); #in m3/s\n",
+ "m = q/22.4; #in kmol/h\n",
+ "y1 = 0.02;\n",
+ "Y1 = y1/(1-y1);\n",
+ "\n",
+ "print \"mole ratio of benzene = %f kmol benzene/kmol dry gas\"%(Y1)\n",
+ "\n",
+ "Gs = m*(1-y1);\n",
+ "print \"moles of benzene free gas = %f kmol drygas/h\"%(Gs)\n",
+ "\n",
+ "#for 95% removal\n",
+ "Y2 = Y1*(1-0.95);\n",
+ "print \"final mole ratio of benzene = %f kmol benzene/kmol dry gas\"%(Y2)\n",
+ "\n",
+ "x2 = 0.002\n",
+ "X2 = 0.002/(1-0.002);\n",
+ "\n",
+ "#at equilibrium y* = 0.2406X\n",
+ "#part 1\n",
+ "#for oil rate to be minimum the wash oil leaving the absorber must be in equilibrium with the entering gas\n",
+ "\n",
+ "y1 = 0.02;\n",
+ "x1 = y1/(0.2406);\n",
+ "X1 = x1/(1-x1);\n",
+ "min_Ls = Gs*((Y1-Y2)/(X1-X2));\n",
+ "print \"minimum Ls required = %f kg/h\"%(min_Ls*260)\n",
+ "\n",
+ "#for 1.5 times of the minimum\n",
+ "Ls = 1.5*min_Ls;\n",
+ "print \"flow rate of wash oil = %f kg/h\"%(Ls*260)\n",
+ "X1 = X2 + (Gs*((Y1-Y2)/Ls));\n",
+ "print \"concentration of benzene in wash oil = %f kmol benzene/kmol wash oil\"%(X1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mole ratio of benzene = 0.020408 kmol benzene/kmol dry gas\n",
+ "moles of benzene free gas = 144.559497 kmol drygas/h\n",
+ "final mole ratio of benzene = 0.001020 kmol benzene/kmol dry gas\n",
+ "minimum Ls required = 8219.216789 kg/h\n",
+ "flow rate of wash oil = 12328.825184 kg/h\n",
+ "concentration of benzene in wash oil = 0.061109 kmol benzene/kmol wash oil\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.7 page number 95\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the extraction of nicotine\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "xf = 0.01\n",
+ "Xf = xf/(1-xf);\n",
+ "Feed = 100 #feed in kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "c_nicotine = Feed*Xf; #nicotine conc in feed\n",
+ "c_water = Feed*(1-Xf) #water conc in feed\n",
+ "\n",
+ "#part 1\n",
+ "def F1(x):\n",
+ " return (x/150.)-0.9*((1-x)/99.);\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "y = fsolve(F1,x)\n",
+ "print \"amount of nicotine removed N = %f kg\"%(y)\n",
+ "#part 2\n",
+ "def F2(x):\n",
+ " return (x/50.)-0.9*((1-x)/99.);\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "N1 = fsolve(F2,x)\n",
+ "print \"amount of nicotine removed in stage 1, N1 = %f kg\"%(N1)\n",
+ "def F3(x):\n",
+ " return (x/50.)-0.9*((1-x-N1)/99.);\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "N2 = fsolve(F3,x)\n",
+ "print \"amount of nicotine removed in stage 2, N2 = %f kg\"%(N2)\n",
+ "def F4(x):\n",
+ " return (x/50.)-0.9*((1-x-N2-N1)/99.);\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "N3 = fsolve(F4,x)\n",
+ "\n",
+ "print \"amount of nicotine removed in stage 3, N3 = %f kg\"%(N3)\n",
+ "N = N1+N2+N3;\n",
+ "print \"total amount of nicotine removed = %f kg\"%(N)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of nicotine removed N = 0.576923 kg\n",
+ "amount of nicotine removed in stage 1, N1 = 0.312500 kg\n",
+ "amount of nicotine removed in stage 2, N2 = 0.214844 kg\n",
+ "amount of nicotine removed in stage 3, N3 = 0.147705 kg\n",
+ "total amount of nicotine removed = 0.675049 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.8 page number 96\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the amount of water in residue\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "vp_water = 31.06 #in kPa\n",
+ "vp_benzene = 72.92 #in kPa\n",
+ "\n",
+ "P = vp_water +vp_benzene;\n",
+ "x_benzene = vp_benzene/P;\n",
+ "x_water = vp_water/P;\n",
+ "\n",
+ "# Calculations\n",
+ "initial_water = 50./18; #in kmol of water\n",
+ "initial_benzene = 50./78 #in kmol of benzene\n",
+ "water_evaporated = initial_benzene*(x_water/x_benzene);\n",
+ "water_left = (initial_water - water_evaporated);\n",
+ "\n",
+ "# Results\n",
+ "print \"amount of water left in residue = %f kg\"%(water_left*18)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of water left in residue = 45.085236 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.9 page number 97\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the vapor content of dimethylanaline\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "po_D = 4.93 #in kPa\n",
+ "po_W = 96.3 #in kPa\n",
+ "n = 0.75 #vaporization efficiency\n",
+ "\n",
+ "# Calculations and Results\n",
+ "P = n*po_D+po_W;\n",
+ "print \"P = %f kPa\"%(P)\n",
+ "\n",
+ "x_water = 96.3/100;\n",
+ "x_dimethylanaline = 1-x_water;\n",
+ "wt_dimethylanaline = (x_dimethylanaline*121)/(x_dimethylanaline*121+x_water*18);\n",
+ "print \"weight of dimethylanaline in water = %f\"%(wt_dimethylanaline*100)\n",
+ "\n",
+ "#part 1\n",
+ "n = 0.8;\n",
+ "po_D = 32 #in kPa\n",
+ "actual_vp = n*po_D;\n",
+ "p_water = 100 - actual_vp;\n",
+ "steam_required = (p_water*18)/(actual_vp*121);\n",
+ "print \"amount of steam required = %f kg steam/kg dimethylanaline\"%(steam_required)\n",
+ "\n",
+ "#part 2\n",
+ "x_water = p_water/100.;\n",
+ "wt_water = x_water*18./(x_water*18+(1-x_water)*121.);\n",
+ "print \"weight of water vapor = %f weight of dimethylanaline =%f\"%(wt_water*100,100*(1-wt_water))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P = 99.997500 kPa\n",
+ "weight of dimethylanaline in water = 20.526340\n",
+ "amount of steam required = 0.432335 kg steam/kg dimethylanaline\n",
+ "weight of water vapor = 30.183916 weight of dimethylanaline =69.816084\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.10 page number 98\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the amount of water evaporated\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "xf = 0.15;\n",
+ "xl = (114.7)/(114.7+1000);\n",
+ "xc = 1;\n",
+ "\n",
+ "# Calculations\n",
+ "K2Cr2O7_feed = 1000*0.15; #in kg\n",
+ "\n",
+ "n = 0.8;\n",
+ "C = n*K2Cr2O7_feed;\n",
+ "V = (K2Cr2O7_feed-120 - 880*0.103)/(-0.103);\n",
+ "\n",
+ "# Results\n",
+ "print \"amount of water evaporated = %f kg\"%(V)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of water evaporated = 588.737864 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.11 page number 98\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the yield of crystals\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "xc = round(106./286,3);\n",
+ "xf = 0.25;\n",
+ "xl = round(27.5/127.5,3);\n",
+ "\n",
+ "# Calculations\n",
+ "water_present = 100*(1-xf); #in kg\n",
+ "V = 0.15*75; #in kg\n",
+ "C = (100*xf - 88.7*xl)/(xc-xl);\n",
+ "Na2CO3_feed = 25./xc;\n",
+ "\n",
+ "yield_ = (C/Na2CO3_feed)*100;\n",
+ "\n",
+ "# Results\n",
+ "print \"yield = %.1f %%\"%(yield_)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "yield = 55.9 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.12 page number 99\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the fraction of air recirculated\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "r = 50. #weight of dry air passing through drier\n",
+ "w1 = 1.60 #in kg per kg dry solid\n",
+ "w2 = 0.1 #in kg/kg dry solid\n",
+ "H0 = 0.016 #in kg water vapor/kg dry air\n",
+ "H2 = 0.055 #in kg water vapor/kg dry air\n",
+ "\n",
+ "# Calculations and Results\n",
+ "y = 1 - (w1-w2)/(r*(H2-H0));\n",
+ "print \"fraction of air recirculated = %f\"%(y)\n",
+ "\n",
+ "H1 = H2 - (w1-w2)/r;\n",
+ "print \"humidity of air entering the drier = %f kg water vapor/kg kg dry air\"%(H1)\n",
+ "\n",
+ "#check\n",
+ "H11 = H2*y+H0*(1-y);\n",
+ "if H1 == H11:\n",
+ " print \"fraction of air recirculated = %f verified\"%(y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fraction of air recirculated = 0.230769\n",
+ "humidity of air entering the drier = 0.025000 kg water vapor/kg kg dry air\n",
+ "fraction of air recirculated = 0.230769 verified\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.13 page number 100\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the volumetric flow rate and fraction of air passing through the cooler\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "Hf = 0.012;\n",
+ "Hi = 0.033;\n",
+ "H1 = 0.0075;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "water_vapor = Hf/18.; #in kmol of water vapor\n",
+ "dry_air = 1/28.9; #in kmol\n",
+ "total_mass = water_vapor+dry_air;\n",
+ "\n",
+ "volume = 22.4*(298./273)*total_mass;\n",
+ "weight = 60/volume;\n",
+ "print \"weight of dry air handled per hr = %f kg\"%(weight)\n",
+ "\n",
+ "#part 1\n",
+ "inlet_watervapor = 0.033/18; #in kmol of water vapor\n",
+ "volume_inlet = 22.4*(308./273)*(inlet_watervapor+dry_air);\n",
+ "print \"volumetric flow rate of inlet air = %f cubic meter\"%(volume_inlet*weight)\n",
+ "\n",
+ "#part 2\n",
+ "y = (Hf - Hi)/(H1 - Hi);\n",
+ "print \"fraction of inlet air passing through cooler = %f\"%(y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "weight of dry air handled per hr = 69.576029 kg\n",
+ "volumetric flow rate of inlet air = 64.064786 cubic meter\n",
+ "fraction of inlet air passing through cooler = 0.823529\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.14 page number 102\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the fraction of purged recycle and total yield\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "#x- moles of N2 and H2 recycled; y - moles of N2 H2 purged\n",
+ "Ar_freshfeed = 0.2;\n",
+ "#argon in fresh feed is equal to argon in purge \n",
+ "\n",
+ "# Calculations and Results\n",
+ "y = 0.2/0.0633; #argon in purge = 0.0633y\n",
+ "x = (0.79*100 - y)/(1-0.79);\n",
+ "print \"y = %f kmolx = %f kmol\"%(y,x)\n",
+ "\n",
+ "#part 1\n",
+ "fraction = y/x;\n",
+ "print \"fration of recycle that is purged = %f\"%(fraction)\n",
+ "\n",
+ "#part 2\n",
+ "yield_ = 0.105*(100+x);\n",
+ "print \"overall yield of ammonia = %f kmol\"%(yield_)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y = 3.159558 kmolx = 361.144964 kmol\n",
+ "fration of recycle that is purged = 0.008749\n",
+ "overall yield of ammonia = 48.420221 kmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.15 page number 107\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find change in enthalpy\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "H0_CH4 = -74.9 #in kJ\n",
+ "H0_CO2 = -393.5 #in kJ\n",
+ "H0_H2O = -241.8 #in kJ\n",
+ "\n",
+ "# Calculations\n",
+ "delta_H0 = H0_CO2+2*H0_H2O-H0_CH4;\n",
+ "\n",
+ "# Results\n",
+ "print \"change in enthalpy = %f kJ\"%(delta_H0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in enthalpy = -802.200000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.16 page number 107\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to compare the enthalpy change in two reactions\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "H0_glucose = -1273 #in kJ\n",
+ "H0_ethanol = -277.6 #in kJ\n",
+ "H0_CO2 = -393.5 #in kJ\n",
+ "H0_H2O = -285.8 #in kJ\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#for reaction 1\n",
+ "delta_H1 = 2*H0_ethanol+2*H0_CO2-H0_glucose;\n",
+ "print \"enthalpy change in reaction 1 = %f KJ\"%(delta_H1)\n",
+ "\n",
+ "#for reaction 2\n",
+ "delta_H2 = 6*H0_H2O+6*H0_CO2-H0_glucose;\n",
+ "print \"enthalpy change in reaction 2 = %f kJ\"%(delta_H2)\n",
+ "\n",
+ "if delta_H1>delta_H2:\n",
+ " print \"reaction 2 supplies more energy\"\n",
+ "else:\n",
+ " print \"reaction 1 supplies more energy\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enthalpy change in reaction 1 = -69.200000 KJ\n",
+ "enthalpy change in reaction 2 = -2802.800000 kJ\n",
+ "reaction 2 supplies more energy\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.17 page number 108\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find enthalpy of formation of CuSO4.5H2O\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "delta_H2 = 11.7 #in kJ/mol\n",
+ "m_CuSO4 = 16 #in gm\n",
+ "m_H2O = 384 #in gm\n",
+ "\n",
+ "# Calculations\n",
+ "delta_H3 = -((m_CuSO4+m_H2O)*4.18*3.95*159.6)/(16*10**3)\n",
+ "delta_H1 = delta_H3 - delta_H2;\n",
+ "\n",
+ "# Results\n",
+ "print \"enthalpy of formation = %f kJ/mol\"%(delta_H1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enthalpy of formation = -77.578890 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.18 page number 108\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the temperature of combustion\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "H_combustion = 1560000 #in kJ/kmol \n",
+ "H0_CO2 = 54.56 #in kJ/kmol\n",
+ "H0_O2 = 35.2 #in kJ/kmol\n",
+ "H0_steam = 43.38 #in kJ/kmol\n",
+ "H0_N2 = 33.32 #in kJ/kmol\n",
+ "\n",
+ "# Calculations\n",
+ "t = H_combustion/(2*H0_CO2+3*H0_steam+0.875*H0_O2+16.46*H0_N2);\n",
+ "\n",
+ "# Results\n",
+ "print \"theoritical temperature of combustion = %f degree C\"%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "theoritical temperature of combustion = 1905.908708 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.19 page number 109\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the heat of reaction and consumption of coke\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "H_NaCl = 410.9 #in MJ/kmol\n",
+ "H_H2SO4 = 811.3 #in MJ/kmol\n",
+ "H_Na2SO4 = 1384 #in MJ/kmol\n",
+ "H_HCl = 92.3 #in MJ/kmol\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q = H_Na2SO4 + 2*H_HCl -2*H_NaCl-H_H2SO4;\n",
+ "print \"heat of reaction = %f MJ\"%(Q)\n",
+ "\n",
+ "heat_required = 64.5*(500./73);\n",
+ "coke_consumption = heat_required/19\n",
+ "print \"amount of coke oven gas consumed = %f cubic meter\"%(coke_consumption)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat of reaction = -64.500000 MJ\n",
+ "amount of coke oven gas consumed = 23.251622 cubic meter\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.20 page number 109\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of heat flow\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "cp_water = 146.5 #in kj/kg\n",
+ "cp_steam = 3040 #in kJ/kg\n",
+ "d = 0.102 #in m\n",
+ "u = 1.5 #in m/s\n",
+ "density = 1000 #in kg/m3\n",
+ "\n",
+ "# Calculations\n",
+ "m = (3.14/4)*d**2*u*density;\n",
+ "Q = m*(cp_steam-cp_water);\n",
+ "\n",
+ "# Results\n",
+ "print \"rate of heat flow = %f kW\"%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of heat flow = 35447.429385 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.22 page number 110\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the amount of air required for combustion and composition of flue gas\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "wt_C = 0.75 #in kg\n",
+ "wt_H2 = 0.05 #in kg\n",
+ "wt_O2 = 0.12 #in kg\n",
+ "wt_N2 = 0.03 #in kg\n",
+ "wt_S = 0.01 #in kg\n",
+ "wt_ash = 0.04 #in kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "O2_C = wt_C*(32./12); #in kg\n",
+ "O2_H2 = wt_H2*(16./2); #in kg\n",
+ "O2_S = wt_S*(32./32); #in kg\n",
+ "O2_required = O2_C+O2_H2+O2_S;\n",
+ "\n",
+ "oxygen_supplied = O2_required - wt_O2;\n",
+ "air_needed = oxygen_supplied/0.23;\n",
+ "print \"amount of air required = %f kg\"%(air_needed)\n",
+ "\n",
+ "volume = (22.4/28.8)*air_needed;\n",
+ "print \"volume of air needed = %f cubic meter\"%(volume)\n",
+ "\n",
+ "air_supplied = 1.20*air_needed;\n",
+ "N2_supplied = air_supplied*0.77;\n",
+ "total_N2 = N2_supplied+wt_N2;\n",
+ "\n",
+ "O2_fluegas = air_supplied*0.23 - oxygen_supplied;\n",
+ "\n",
+ "wt_CO2 = wt_C+O2_C;\n",
+ "wt_SO2 = wt_S+O2_S;\n",
+ "\n",
+ "moles_CO2 = wt_CO2/44;\n",
+ "moles_SO2 = wt_SO2/64;\n",
+ "moles_N2 = total_N2/28;\n",
+ "moles_O2 = O2_fluegas/32;\n",
+ "total_moles = moles_CO2+moles_SO2+moles_N2+moles_O2;\n",
+ "\n",
+ "x_CO2 = moles_CO2/total_moles;\n",
+ "x_SO2 = moles_SO2/total_moles;\n",
+ "x_N2 = moles_N2/total_moles;\n",
+ "x_O2 = moles_O2/total_moles;\n",
+ "\n",
+ "print \"CO2 = %f %%\"%(x_CO2*100)\n",
+ "print \"SO2 = %f %%\"%(x_SO2*100)\n",
+ "print \"N2 = %f %%\"%(x_N2*100)\n",
+ "print \"O2 = %f %%\"%(x_O2*100)\n",
+ "\n",
+ "# Note : answers are slightly different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of air required = 9.956522 kg\n",
+ "volume of air needed = 7.743961 cubic meter\n",
+ "CO2 = 15.365264 %\n",
+ "SO2 = 0.076826 %\n",
+ "N2 = 81.039264 %\n",
+ "O2 = 3.518645 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.23 page number 110\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the composition of flue gas\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "C = 0.8 #in kg\n",
+ "H2 = 0.05 #in kg\n",
+ "S = 0.005 #in kg\n",
+ "ash = 0.145 #in kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#required oxygen in kg\n",
+ "C_O2 = C*(32./12); \n",
+ "H2_O2 = H2*(16./2);\n",
+ "S_O2 = S*(32./32);\n",
+ "O2_supplied = C_O2+S_O2+H2_O2;\n",
+ "print \"amount of O2 supplied = %f kg\"%(O2_supplied)\n",
+ "\n",
+ "wt_air = O2_supplied*(100./23);\n",
+ "wt_airsupplied = 1.25*wt_air;\n",
+ "print \"amount of air supplied = %f kg\"%(wt_airsupplied)\n",
+ "\n",
+ "#flue gas composition\n",
+ "m_N2 = wt_airsupplied*0.77; #in kg\n",
+ "mole_N2 = m_N2/28.;\n",
+ "\n",
+ "m_O2 = (wt_airsupplied-wt_air)*0.23; #in kg\n",
+ "mole_O2 = m_O2/32.;\n",
+ "\n",
+ "m_CO2 = C*(44/12.); #in kg\n",
+ "mole_CO2 = m_CO2/44.;\n",
+ "\n",
+ "m_H2O = H2*(18/2.); #in kg\n",
+ "mole_H2O = m_H2O/18.;\n",
+ "\n",
+ "m_SO2 = S*(64/32.); #in kg\n",
+ "mole_SO2 = m_SO2/64.;\n",
+ "\n",
+ "m = m_N2+m_O2+m_CO2+m_H2O+m_SO2\n",
+ "\n",
+ "#percent by weight\n",
+ "w_N2 = m_N2/m;\n",
+ "print \"percentage of N2 by weight = %f\"%(w_N2*100)\n",
+ "\n",
+ "w_O2 = m_O2/m;\n",
+ "print \"percentage of O2 by weight = %f\"%(w_O2*100)\n",
+ "\n",
+ "w_CO2 = m_CO2/m;\n",
+ "print \"percentage of CO2 by weight = %f\"%(w_CO2*100)\n",
+ "\n",
+ "w_H2O = m_H2O/m;\n",
+ "print \"percentage of H2O by weight = %f\"%(w_H2O*100)\n",
+ "\n",
+ "w_SO2 = m_SO2/m;\n",
+ "print \"percentage of SO2 by weight = %f\"%(w_SO2*100)\n",
+ "\n",
+ "m1 = mole_N2+mole_O2+mole_CO2+mole_H2O+mole_SO2\n",
+ "\n",
+ "#percent by mole \n",
+ "x_N2 = mole_N2/m1;\n",
+ "print \"percentage of N2 by mole = %f\"%(x_N2*100)\n",
+ "\n",
+ "x_O2 = mole_O2/m1;\n",
+ "print \"percentage of O2 by mole = %f\"%(x_O2*100)\n",
+ "\n",
+ "x_CO2 = mole_CO2/m1;\n",
+ "print \"percentage of CO2 by mole = %f\"%(x_CO2*100)\n",
+ "\n",
+ "x_H2O = mole_H2O/m1;\n",
+ "print \"percentage of H2O by mole = %f\"%(x_H2O*100)\n",
+ "\n",
+ "x_SO2 = mole_SO2/m1;\n",
+ "print \"percentage of SO2 by mole = %f\"%(x_SO2*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of O2 supplied = 2.538333 kg\n",
+ "amount of air supplied = 13.795290 kg\n",
+ "percentage of N2 by weight = 72.506232\n",
+ "percentage of O2 by weight = 4.331541\n",
+ "percentage of CO2 by weight = 20.022357\n",
+ "percentage of H2O by weight = 3.071612\n",
+ "percentage of SO2 by weight = 0.068258\n",
+ "percentage of N2 by mole = 77.261067\n",
+ "percentage of O2 by mole = 4.038647\n",
+ "percentage of CO2 by mole = 13.577066\n",
+ "percentage of H2O by mole = 5.091400\n",
+ "percentage of SO2 by mole = 0.031821\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.24 page number 112\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find volumetric composition of flue glass\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "wt_H2 = 0.15;\n",
+ "wt_C = 0.85;\n",
+ "O2_H2 = wt_H2*(16./2);\n",
+ "O2_C = wt_C*(32./12);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "total_O2 = O2_H2+O2_C;\n",
+ "wt_air = total_O2/0.23;\n",
+ "air_supplied = 1.15*(wt_air);\n",
+ "N2_supplied = 0.77*air_supplied/28.;\n",
+ "O2_supplied = 0.23*(air_supplied-wt_air)/32.;\n",
+ "moles_CO2 = 0.85/12;\n",
+ "\n",
+ "print \"moles of CO2 = %f kmol\"%(moles_CO2)\n",
+ "print \"moles of N2 = %f kmol \"%(N2_supplied)\n",
+ "print \"moles of O2 = %f kmol\"%(O2_supplied)\n",
+ "\n",
+ "total_moles = N2_supplied+O2_supplied+moles_CO2;\n",
+ "\n",
+ "print \"percentage of CO2 = %f\"%((moles_CO2/total_moles)*100)\n",
+ "print \"percentage of N2 = %f\"%((N2_supplied/total_moles)*100)\n",
+ "print \"percentage of O2 = %f\"%((O2_supplied/total_moles)*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "moles of CO2 = 0.070833 kmol\n",
+ "moles of N2 = 0.476667 kmol \n",
+ "moles of O2 = 0.016250 kmol\n",
+ "percentage of CO2 = 12.564671\n",
+ "percentage of N2 = 84.552846\n",
+ "percentage of O2 = 2.882483\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.25 page number 113\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the excess air supplied\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "N2 = 80.5 #in m3\n",
+ "air_supplied = N2/0.79 #in m3\n",
+ "volume_O2 = air_supplied*0.21; #in m3\n",
+ "O2_fluegas = 6.1 #in m3\n",
+ "\n",
+ "# Calculations\n",
+ "O2_used = volume_O2 - O2_fluegas;\n",
+ "excess_air_supplied = (O2_fluegas/O2_used)*100;\n",
+ "\n",
+ "# Results\n",
+ "print \"percentage of excess air supplied = %f\"%(excess_air_supplied)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percentage of excess air supplied = 39.872580\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.26 page number 114\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the outlet temperature of water\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "q_NTP = 10*(200/101.3)*(273./313);\n",
+ "m_CO2 = 44*(q_NTP/22.4);\n",
+ "s_CO2 = 0.85 #in kJ/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "Q = m_CO2*s_CO2*(40-20) #Q = ms*delta_T\n",
+ "\n",
+ "d0 = 0.023 #in mm\n",
+ "A0 = (3.14/4)*d0**2;\n",
+ "di = 0.035 #in mm\n",
+ "Ai = (3.14/4)*di**2;\n",
+ "\n",
+ "A_annular = Ai-A0;\n",
+ "u = 0.15 #in m/s\n",
+ "m_water = A_annular*(u*3600)*1000 #in kg/hr\n",
+ "\n",
+ "s_water = 4.19 #in kJ/kg K\n",
+ "t = 15+(Q/(m_water*s_water));\n",
+ "\n",
+ "# Results\n",
+ "print \"exit water temperature = %f degree C\"%(t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "exit water temperature = 15.465164 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.27 page number 114\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the area of heating surface\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "F = 1000 #in kg\n",
+ "xF = 0.01 \n",
+ "\n",
+ "# Calculations and Results\n",
+ "solid_feed = F*xF;\n",
+ "water_feed = F - solid_feed;\n",
+ "\n",
+ "tF = 40 #in degree C\n",
+ "hF = 167.5 #in kJ/kg\n",
+ "xL = 0.02;\n",
+ "\n",
+ "solid_liquor = 10 #in kg\n",
+ "L = solid_liquor/xL;\n",
+ "tL = 100 #in degree C\n",
+ "hL = 418.6 #in kJ/kg\n",
+ "\n",
+ "V = F -L;\n",
+ "\n",
+ "tv = 100 #in degree C\n",
+ "Hv = 2675 #in kJ/kg\n",
+ "ts = 108.4 #in degree C\n",
+ "Hs = 2690 #in kJ/kg\n",
+ "tc = 108.4 #in degree C\n",
+ "hc = 454 #in kJ/kg\n",
+ "\n",
+ "#applying heat balance\n",
+ "S = (F*hF-V*Hv-L*hL)/(hc-Hs);\n",
+ "print \"weight of steam required = %f kg/hr\"%(S)\n",
+ "\n",
+ "Q = S*(Hs-hc);\n",
+ "U = 1.4 #in kW/m2K\n",
+ "delta_t = ts-tL;\n",
+ "A = 383.2/(U*delta_t);\n",
+ "print \"area of heating surface = %f square meter\"%(A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "weight of steam required = 616.860465 kg/hr\n",
+ "area of heating surface = 32.585034 square meter\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.28 page number 115\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the top and bottom product,condenser duty,heat input to rebpoiler\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "hF = 171 #in kJ/kg\n",
+ "hD = 67 #in kJ/kg\n",
+ "hL = hD;\n",
+ "\n",
+ "hW = 200 #in kJ/kg\n",
+ "H = 540 #in kJ/kg\n",
+ "\n",
+ "print ('part 1')\n",
+ "F = 1000 #in kg/h\n",
+ "xF = 0.40\n",
+ "xW = 0.02;\n",
+ "xD = 0.97;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "D = F*(xF-xW)/(xD-xW);\n",
+ "W = F-D;\n",
+ "\n",
+ "print \"bottom product = %f kg/hr\"%(W)\n",
+ "print \"top product = %f kg/hr\"%(D)\n",
+ "\n",
+ "print ('part 2')\n",
+ "L = 3.5*D;\n",
+ "V = L+D;\n",
+ "Qc = V*H-L*hL-D*hD;\n",
+ "print \"condenser duty = %f KJ/hr\"%(Qc)\n",
+ "\n",
+ "print ('part 3')\n",
+ "Qr = Qc - 24200;\n",
+ "print \"rate of heat input to reboiler = %f kJ/hr\"%(Qr)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part 1\n",
+ "bottom product = 600.000000 kg/hr\n",
+ "top product = 400.000000 kg/hr\n",
+ "part 2\n",
+ "condenser duty = 851400.000000 KJ/hr\n",
+ "part 3\n",
+ "rate of heat input to reboiler = 827200.000000 kJ/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.29 page number 117\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of crystal formation, cooling water rate, required area\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "F = 1000.; #in kg\n",
+ "V = 0.05*F; #in kg\n",
+ "xF = 0.48;\n",
+ "xL = 75./(100+75);\n",
+ "xC = 1.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "C = (F*xF-950*xL)/(1-0.429);\n",
+ "print \"rate of crystal formation = %f kg\"%(C)\n",
+ "\n",
+ "L = F-C-V;\n",
+ "\n",
+ "#cooling water\n",
+ "W = (F*2.97*(85-35)+126.9*75.2-V*2414)/(4.19*11);\n",
+ "print \"rate of cooling water = %f kg\"%(W)\n",
+ "\n",
+ "delta_T1 = 56.;\n",
+ "delta_T2 = 17.;\n",
+ "delta_Tm = (delta_T1-delta_T2)/(math.log(delta_T1/delta_T2))\n",
+ "U = 125;\n",
+ "\n",
+ "A=(F*2.97*(85-35)+126.9*75.2-V*2414)/(U*delta_Tm*3.6);\n",
+ "print \"area = %f square meter\"%(A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of crystal formation = 127.595697 kg\n",
+ "rate of cooling water = 810.216533 kg\n",
+ "area = 2.536631 square meter\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.30 page number 118\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the heat of combustion\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "delta_n = 10-12.; #mole per mole napthanlene\n",
+ "\n",
+ "#basis 1g\n",
+ "moles_napthalene = (1./128);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print ('part 1')\n",
+ "Qv = 40.28 #in kJ\n",
+ "Qp = Qv-(delta_n*moles_napthalene*8.3144*298./1000);\n",
+ "print \"heat of combustion = %f kJ\"%(Qp)\n",
+ "\n",
+ "print ('part 2')\n",
+ "delta_H = 44.05 #in kJ/gmol\n",
+ "water_formed = 4./128; #in g mol\n",
+ "Qp1 = Qp - (delta_H*water_formed);\n",
+ "print \"heat of combustion = %f kJ\"%(Qp1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part 1\n",
+ "heat of combustion = 40.318714 kJ\n",
+ "part 2\n",
+ "heat of combustion = 38.942151 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch4.ipynb b/Introduction_To_Chemical_Engineering/ch4.ipynb
new file mode 100644
index 00000000..4c312cd2
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch4.ipynb
@@ -0,0 +1,916 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Flow Of Fluids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.1 page number 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find water compressibility\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "delta_p=70.; #in bar\n",
+ "Et=20680. #in bar\n",
+ "\n",
+ "# Calculations\n",
+ "compressibility = delta_p/Et;\n",
+ "\n",
+ "# Results\n",
+ "print \"compressibilty of water = %f\"%(compressibility)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "compressibilty of water = 0.003385\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.3 page number 128\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the viscosity of oil\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "F=0.5*9.8; #in N\n",
+ "A=3.14*0.05*0.15; #in m2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "shear_stress=F/A; #in Pa\n",
+ "print \"shear_stress = %f Pa\"%(shear_stress)\n",
+ "\n",
+ "velocity_distribution =0.1/(0.05*10**-3);\n",
+ "viscosity=shear_stress/velocity_distribution;\n",
+ "print \"viscosity = %f Pa-s\"%(viscosity) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "shear_stress = 208.067941 Pa\n",
+ "viscosity = 0.104034 Pa-s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.5 page number 133\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find variation of losses with velocity\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "loss_ratio=3.6; #delta_P2/delta_P1=3.6\n",
+ "velocity_ratio=2.; #u2/u1=2\n",
+ "\n",
+ "# Calculations\n",
+ "n=math.log(loss_ratio,2); #delta_P2/delta_P1=(u2/u1)**n\n",
+ "\n",
+ "# Results\n",
+ "print \"power constant = %f flow is turbulent\"%(n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power constant = 1.847997 flow is turbulent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.8 page number 137\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the boundary layer properties\n",
+ "\n",
+ "import math \n",
+ "print ('part 1')\n",
+ "\n",
+ "# Variables\n",
+ "x=0.05 #in m\n",
+ "density=1000. #in kg/m3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "viscosity=1.*10**-3 #in Pa-s\n",
+ "u=1. #in m/s\n",
+ "Re=(density*u*x)/viscosity;\n",
+ "\n",
+ "print \"Reynolds Number = %f\"%(Re)\n",
+ "\n",
+ "thickness=4.65*x*(Re)**-0.5;\n",
+ "print \"boundary layer thickness = %f m\"%(thickness)\n",
+ "\n",
+ "print ('part 2')\n",
+ "Re_x=3.2*10**5;\n",
+ "x_cr=(Re_x*viscosity)/(density*u);\n",
+ "print \"transition takes place at x = %f m\"%(x_cr) \n",
+ "\n",
+ "print ('part 3')\n",
+ "x=0.5 #in m\n",
+ "Re=(density*u*x)/viscosity;\n",
+ "thickness=0.367*x*(Re)**-0.2;\n",
+ "print \"boundary layer thickness= %f m\"%(thickness)\n",
+ "\n",
+ "t_sublayer=71.5*x*(Re)**-0.9;\n",
+ "print \"sub layer thickness= %f m\"%(t_sublayer)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part 1\n",
+ "Reynolds Number = 50000.000000\n",
+ "boundary layer thickness = 0.001040 m\n",
+ "part 2\n",
+ "transition takes place at x = 0.320000 m\n",
+ "part 3\n",
+ "boundary layer thickness= 0.013300 m\n",
+ "sub layer thickness= 0.000266 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.9 page number 138\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flow properties\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "d1=0.05 #in m\n",
+ "A1=(3.14*d1**2)/4.;\n",
+ "density_1=2.1 #in kg/m3\n",
+ "u1=15. #in m/s\n",
+ "P1=1.8; #in bar\n",
+ "P2=1.3; #in bar\n",
+ "\n",
+ "# Calculations and Results\n",
+ "w=density_1*A1*u1;\n",
+ "density_2=density_1*(P2/P1);\n",
+ "print \"density at section 2 = %f kg/cubic meter\"%(density_2)\n",
+ "\n",
+ "u2=u1*(density_1/density_2)*(0.05/0.075)**2;\n",
+ "print \"velocity at section 2 = %f m/s\"%(u2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "density at section 2 = 1.516667 kg/cubic meter\n",
+ "velocity at section 2 = 9.230769 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.10 page number 139\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the temperature increase\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "Q=0.001*10**5 #in J/s\n",
+ "w=0.001*1000 #in kg/s\n",
+ "density=1000. #in kg/m3\n",
+ "cp=4.19*10**3 #in J/kg K\n",
+ "\n",
+ "# Calculations\n",
+ "delta_T=Q/(w*cp);\n",
+ "\n",
+ "# Results\n",
+ "print \"Temperature increase = %f degree celcius\"%(delta_T)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature increase = 0.023866 degree celcius\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.11 page number 142\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the pressure\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "u1=0; #in m/s\n",
+ "ws=0;\n",
+ "P1=0.7*10**5 #in Pa\n",
+ "P3=0\n",
+ "density=1000 #in kg/m3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "u3=((2*(P1-P3))/density)**0.5;\n",
+ "print \"u3 = %f m/s\"%(u3)\n",
+ "\n",
+ "ratio_area=0.5;\n",
+ "u2=u3/ratio_area;\n",
+ "print \"u2 = %f m/s\"%(u2)\n",
+ "\n",
+ "#applying bernoulli's equation\n",
+ "P2=1.7*10**5-((density*u2**2)/2)\n",
+ "print \"P2 = %f Pa\"%(P2)\n",
+ "print \"this flow is physically unreal\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u3 = 11.832160 m/s\n",
+ "u2 = 23.664319 m/s\n",
+ "P2 = -110000.000000 Pa\n",
+ "this flow is physically unreal\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.12 page number 143\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the power requirements\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Q=3800./(24*3600) #in m3/s\n",
+ "d=0.202 #in m\n",
+ "\n",
+ "# Calculations\n",
+ "u=Q/((3.14/4)*d**2); #in m/s\n",
+ "delta_P=5.3*10**6 #in Pa\n",
+ "density=897. #in kg/m3\n",
+ "F=delta_P/density; #in J/kg\n",
+ "ws=9.8*30+F;\n",
+ "mass_flow_rate= Q*density;\n",
+ "power=(ws*mass_flow_rate)/0.6;\n",
+ "\n",
+ "# Results\n",
+ "print \"power required = %f kW\"%(power/1000)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power required = 407.834267 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.13 page number 146\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the tube length\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "density=1000 #in kg/m3\n",
+ "viscosity=1*10**-3 #in Pa s\n",
+ "P=100*1000 #in Pa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "vdP=P/density;\n",
+ "\n",
+ "Q=2.5*10**-3/(24*3600)\n",
+ "A=3.14*(0.0005)**2/4;\n",
+ "u=Q/A;\n",
+ "print \"u = %f m/s\"%(u)\n",
+ "\n",
+ "Re=density*u*0.0005/viscosity;\n",
+ "print \"Re = %f\"%(Re)\n",
+ "\n",
+ "#F=18.86*L\n",
+ "L=(-u**2+vdP)/18.86;\n",
+ "print \"L = %f m\"%(L)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u = 0.147440 m/s\n",
+ "Re = 73.720217\n",
+ "L = 5.301074 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.14 page number 151\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the discharge pressure\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "d=0.025 #in m\n",
+ "u=3. #in m/s\n",
+ "density=894. #in kg/m3\n",
+ "viscosity=6.2*10**4 #in Pa-s\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Re=(u*d*density)/viscosity;\n",
+ "f=0.0045;\n",
+ "L=50.;\n",
+ "\n",
+ "delta_P=2*f*density*u**2*(L/d)\n",
+ "print \"frictional head loss = %f kPa\"%(delta_P/1000)\n",
+ "\n",
+ "required_P=25*density*9.8;\n",
+ "total_head=delta_P+required_P;\n",
+ "print \"total pressure head = %f bar\"%(total_head/10**5)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frictional head loss = 144.828000 kPa\n",
+ "total pressure head = 3.638580 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.15 page number 152\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the level difference\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "Q=0.8*10**-3; #in m3/s\n",
+ "d=0.026 #in m\n",
+ "A=(3.14*(d**2))/4 #in m2\n",
+ "\n",
+ "# Calculations\n",
+ "u=Q/A; #in m/s\n",
+ "density=800 #in kg/m3\n",
+ "viscosity=0.0005 #in Pa-s\n",
+ "\n",
+ "Re=(u*density*d)/viscosity;\n",
+ "f=0.079*(Re)**-0.25;\n",
+ "L=60\n",
+ "h_f=2*f*((u**2)/9.8)*(L/d);\n",
+ "\n",
+ "# Results\n",
+ "print \"level difference = %f m\"%(h_f)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "level difference = 5.343360 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.16 page number 153\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the engery cost\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "delta_z=50; #in m\n",
+ "L=290.36 #in m\n",
+ "d=0.18 #in m\n",
+ "Q=0.05 #in m3/s\n",
+ "\n",
+ "# Calculations\n",
+ "A=(3.14*d**2)/4; #in m2\n",
+ "u=Q/A; #in m/s\n",
+ "density=1180; #in kg/m3\n",
+ "viscosity=0.0012 #in Pa-s\n",
+ "Re=u*density*d/viscosity;\n",
+ "\n",
+ "f=0.004;\n",
+ "sigma_F=2*f*u**2*L/d;\n",
+ "ws=((9.8*50)+sigma_F)/0.6;\n",
+ "mass_flow_rate=Q*density; #in Kg/s\n",
+ "power=mass_flow_rate*ws/1000; #in KW\n",
+ "energy_cost=power*24*0.8;\n",
+ "\n",
+ "# Results\n",
+ "print \"Energy cost = Rs %f\"%(energy_cost)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy cost = Rs 1019.280105\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.17 page number 154\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the pressure loss\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "density=998 #in kg/m3\n",
+ "viscosity=0.0008 #in Pa-s\n",
+ "d=0.03 #in m\n",
+ "u=1.2 #in m/s\n",
+ "\n",
+ "# Calculations\n",
+ "Re=density*d*u/viscosity;\n",
+ "\n",
+ "f=0.0088;\n",
+ "D=1 #in m\n",
+ "N=10\n",
+ "L=3.14*D*N;\n",
+ "delta_P=(2*f*u**2*L)/d; #in Pa\n",
+ "delta_P_coil=delta_P*(1+(3.54*(d/D)));\n",
+ "\n",
+ "# Results\n",
+ "print \"frictional pressure drop = %f kPa\"%(delta_P_coil)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frictional pressure drop = 29.343858 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.18 page number 154\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find pressure drop per unit length\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "b=0.050 #in m\n",
+ "a=0.025 #in m\n",
+ "d_eq=b-a #in m\n",
+ "density=1000 #in kg/m3\n",
+ "u=3 #in m/s\n",
+ "viscosity = 0.001\n",
+ "\n",
+ "# Calculations\n",
+ "Re=d_eq*u*density/viscosity;\n",
+ "\n",
+ "e=40*10**6 #in m\n",
+ "f=0.0062;\n",
+ "P_perunit_length=2*f*density*u**2/d_eq; #in Pa/m\n",
+ "\n",
+ "# Results\n",
+ "print \"pressure per unit length = %f Pa/m\"%(P_perunit_length)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure per unit length = 4464.000000 Pa/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.19 page number 155\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flow rate\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "d = 0.3 #in m\n",
+ "u = 17.63 #avg velocity in m/s\n",
+ "\n",
+ "# Calculations\n",
+ "q = (3.14/4)*d**2*u;\n",
+ "\n",
+ "# Results\n",
+ "print \"volumetric flow rate = %f cubic meter per second\"%(q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate = 1.245559 cubic meter per second\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.20 page number 156\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the size of pipe required\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 0.15 #in m\n",
+ "\n",
+ "# Calculations\n",
+ "u = (0.0191/0.15**2); #in m/s\n",
+ "q = (3.14/4)*d**2*u;\n",
+ "\n",
+ "# Results\n",
+ "print \"volumetric flow rate = %f cubic meter/s\"%(q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate = 0.014994 cubic meter/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.21 page number 160\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the pressure gradient\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "Q=0.0003 #in m3/s\n",
+ "d=0.05 #in m\n",
+ "A=(3.14*d**2)/4;\n",
+ "\n",
+ "# Calculations\n",
+ "u=Q/A;\n",
+ "\n",
+ "density=1000; #in kg/m3\n",
+ "viscosity=0.001; #in Pa-s\n",
+ "e=0.3;\n",
+ "dp=0.00125; #particle diameter in m\n",
+ "\n",
+ "Re=(dp*u*density)/(viscosity*(1-e));\n",
+ "fm=(150/Re)+1.75;\n",
+ "L=0.5 #in m\n",
+ "delta_Pf=fm*((density*L*u**2)/dp)*((1-e)/e**3); #in Pa\n",
+ "\n",
+ "#applying bernoulli's equation, we get\n",
+ "delta_P=delta_Pf-(density*9.8*L);\n",
+ "pressure_gradient=delta_P/(L*1000); #in kPa/m\n",
+ "\n",
+ "# Results\n",
+ "print \"required pressure gradient = %f kPa/m of packed height\"%(pressure_gradient)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "required pressure gradient = 1104.702008 kPa/m of packed height\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.22 page number 163\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find minimum fluidization velocity\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d=120*10**-6 #in m\n",
+ "density=2500 #particle density in kg/m3\n",
+ "e_min=0.45;\n",
+ "density_water=1000 #in kg/m3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "viscosity=0.9*10**-3; #in Pa-s\n",
+ "umf=(d**2*(density-density_water)*9.8*e_min**3)/(150*viscosity*(1-e_min));\n",
+ "print \"minimum fludization velocity = %f m/s\"%(umf)\n",
+ "\n",
+ "Re_mf=(d*umf*density_water)/(viscosity*(1-e_min));\n",
+ "\n",
+ "\n",
+ "#given that uo/umf=10\n",
+ "def F(e):\n",
+ " return e**3+1.657*e-1.675;\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "e = fsolve(F,x)\n",
+ "\n",
+ "print \"e = %f\"%(e)\n",
+ "length_ratio=(1-e_min)/(1-e);\n",
+ "print \"ratio of heights = %f\"%(length_ratio)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum fludization velocity = 0.000260 m/s\n",
+ "e = 0.753096\n",
+ "ratio of heights = 2.227583\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.23 page number 167\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the power requirements\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "P=9807. #in Pa\n",
+ "density=1000. #in kg/m3\n",
+ "Q=250./(60.*density)\n",
+ "head=25. #in m\n",
+ "\n",
+ "# Calculations\n",
+ "w= head*Q*P; #in kW\n",
+ "power_delivered=w/0.65;\n",
+ "power_taken=power_delivered/0.9;\n",
+ "\n",
+ "# Results\n",
+ "print \"power_delivered = %f kW\"%(power_delivered/1000)\n",
+ "print \"power taken by motor = %f kW\"%(power_taken/1000)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power_delivered = 1.571635 kW\n",
+ "power taken by motor = 1.746261 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch5.ipynb b/Introduction_To_Chemical_Engineering/ch5.ipynb
new file mode 100644
index 00000000..b8695b88
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch5.ipynb
@@ -0,0 +1,842 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.1 page number 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of heat loss\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "A=5.*4 #in m2\n",
+ "T1=100.; #in K\n",
+ "T2=30.; #in K\n",
+ "\n",
+ "# Calculations\n",
+ "delta_T=T1-T2;\n",
+ "\n",
+ "x=0.25 #in m\n",
+ "k=0.70 #in W/mK\n",
+ "Q=k*A*(delta_T/x);\n",
+ "\n",
+ "# Results\n",
+ "print \"rate of heat loss = %f W\"%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of heat loss = 3920.000000 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.2 page number 171\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the heat loss\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "d1=0.15 #in m\n",
+ "d2=0.16 #in m\n",
+ "l=1. #in m\n",
+ "\n",
+ "# Calculations\n",
+ "A1=3.14*d1*l;\n",
+ "A2=3.14*d2*l\n",
+ "Am=(A1-A2)/math.log (A1/A2);\n",
+ "\n",
+ "T1=120.; #in K\n",
+ "T2=119.8; #in K\n",
+ "\n",
+ "delta_T=T1-T2;\n",
+ "x=(d2-d1)/2;\n",
+ "k=50. #in W/mK\n",
+ "Q=k*Am*(delta_T/x);\n",
+ "\n",
+ "# Results\n",
+ "print \"rate of heat loss per unit length = %f W/m\"%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rate of heat loss per unit length = 973.062272 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.3 page number 172\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of heat loss\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "ri=0.5 #in m\n",
+ "ro=0.6; #in m\n",
+ "A1=4*3.14*ri**2;\n",
+ "A2=4*3.14*ro**2;\n",
+ "\n",
+ "# Calculations\n",
+ "Am=(A1*A2)**0.5;\n",
+ "\n",
+ "Ti=140.; #in K\n",
+ "To=50.; #in K\n",
+ "delta_T=Ti-To;\n",
+ "x=0.1 #in m\n",
+ "k=0.12 #in W/mK\n",
+ "\n",
+ "Q=k*Am*(delta_T/x);\n",
+ "\n",
+ "# Results\n",
+ "print \"Heat loss through sphere = %f W\"%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat loss through sphere = 406.944000 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.4 page number 173\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the heat loss from composite wall\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "x1=0.250; #in m\n",
+ "k1=0.7; #in W/mK\n",
+ "A1=1.; #in m2\n",
+ "R1=x1/(k1*A1); #in K/W\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#for the felt layer\n",
+ "x2=0.020; #in m\n",
+ "k2=0.046; #in W/mK\n",
+ "A2=1.; #in m2\n",
+ "R2=x2/(k2*A2); #in K/W\n",
+ "R=R1+R2;\n",
+ "print \"Total resistance = %f K/W\"%(R)\n",
+ "\n",
+ "T1=110.; #in K\n",
+ "T2=25. #in K\n",
+ "delta_T=T1-T2;\n",
+ "Q=delta_T/R;\n",
+ "print \"heat loss through wall = %f W/square m\"%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total resistance = 0.791925 K/W\n",
+ "heat loss through wall = 107.333333 W/square m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.5 page number 173\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of heat loss through pipeline\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "d1=0.15 #in m\n",
+ "d2=0.16 #in m\n",
+ "l=1. #in m\n",
+ "A1=3.14*d1*l;\n",
+ "A2=3.14*d2*l\n",
+ "Am1=(A2-A1)/math.log (A2/A1);\n",
+ "x1=(d2-d1)/2.;\n",
+ "k1=50. #in W/mK\n",
+ "R1=x1/(k1*Am1);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#resistance by insulation\n",
+ "d2=0.16 #in m\n",
+ "d3=0.26 #in m\n",
+ "l=1. #in m\n",
+ "A2=3.14*d2*l;\n",
+ "A3=3.14*d3*l\n",
+ "Am2=(A3-A2)/math.log (A3/A2);\n",
+ "x2=(d3-d2)/2.;\n",
+ "k2=0.08 #in W/mK\n",
+ "R2=x2/(k2*Am2);\n",
+ "R=R1+R2;\n",
+ "\n",
+ "print \"total resistance = %f K/W\"%(R)\n",
+ "\n",
+ "T1=120.; #in K\n",
+ "T2=40.; #in K\n",
+ "delta_T=T1-T2;\n",
+ "Q=delta_T/R;\n",
+ "\n",
+ "print \"heat loss = %f W/m\"%(Q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total resistance = 0.966583 K/W\n",
+ "heat loss = 82.765822 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.6 page number 174\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the increase in heat transfer rate\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "x1=0.1; #in m\n",
+ "x2= 0.25; #in m\n",
+ "k_rb=0.93; #in W/mK\n",
+ "k_ib=0.116 #in W/mK\n",
+ "k_al=203.6 #in W/mK\n",
+ "A=0.1 #in m2\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#to find resistance without rivets\n",
+ "R=(1/A)*((x1/k_rb)+(x2/k_ib));\n",
+ "T1=225 #in K\n",
+ "T2=37 #in K\n",
+ "delta_T=T1-T2;\n",
+ "Q=delta_T/R;\n",
+ "print \"heat transfer rate = %f W\"%(Q)\n",
+ "\n",
+ "#to find resistance with rivet\n",
+ "d=0.03 #in m\n",
+ "rivet_area= (3.14/4)*d**2;\n",
+ "R_r=(x1+x2)/(k_al*rivet_area);\n",
+ "area_norivet=A-rivet_area;\n",
+ "R_cl=(A/area_norivet)*R;\n",
+ "R_eq=1/(1/R_r+1/R_cl);\n",
+ "Q_new=delta_T/R_eq;\n",
+ "\n",
+ "print \"Rate of heat transfer with rivet = %f W\"%(Q_new)\n",
+ "increase=((Q_new-Q)/Q)*100;\n",
+ "print \"percentage increase in heat transfer rate = %f\"%(increase)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat transfer rate = 8.308660 W\n",
+ "Rate of heat transfer with rivet = 85.514415 W\n",
+ "percentage increase in heat transfer rate = 929.220242\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.7 page number 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the heat tranfer coefficient based on \n",
+ "i) the arithmetic mean difference between the temperatures of the water and the wall of the tube\n",
+ "ii) the logarithmic mean difference between the temperatures of the water and the wall of the tube.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "Cp = 4.178 # kJ/kg K for water\n",
+ "q = 1838. # rate at which heat is transfered\n",
+ "A = .1005 # heat transfer area\n",
+ "dt1 = 80. - 24 # temperature diffference at hot end\n",
+ "dt2 = 36.-24 # temperature difference at cold end\n",
+ "\n",
+ "# Calculations and Results\n",
+ "dtm = (56 + 12)/2.0\n",
+ "h = q/(A*dtm)\n",
+ "print \"Heat transfer coefficient, h = %.0f W/m**2 K\"%h\n",
+ "\n",
+ "dtm = (56 - 12)/math.log(56/12.)\n",
+ "h = q/(A*dtm)\n",
+ "print \"h = %.0f W/m**2 K\"%h\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat transfer coefficient, h = 538 W/m**2 K\n",
+ "h = 640 W/m**2 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.8 page number 188\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the heat transfer coefficient\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "density=984.1 #in kg/cubic meter\n",
+ "v=3. #in m/s\n",
+ "viscosity=485*10**-6; #in Pa-s\n",
+ "k=0.657 #in W/mK\n",
+ "cp=4178. #in J/kg K\n",
+ "d=0.016 #in m\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Re=(density*v*d)/viscosity;\n",
+ "Pr=(cp*viscosity)/k;\n",
+ "\n",
+ "#dittus boelter equation\n",
+ "h=0.023*Re**0.8*Pr**0.3*(k/d);\n",
+ "print \"heat transfer coefficient = %f W/sq meter K\"%(h)\n",
+ "\n",
+ "#Sieder Tate equation\n",
+ "viscosity_w=920*10**-6.\n",
+ "h1=0.023*Re**0.8*Pr**(1./3)*(k/d)*(viscosity/viscosity_w)**0.14;\n",
+ "print \"heat transfer coefficient = %f W/sq meter K\"%(h1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat transfer coefficient = 12964.257508 W/sq meter K\n",
+ "heat transfer coefficient = 12306.258209 W/sq meter K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.9 page number 191\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the surface temperature of earth\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "T_sun = 5973 #in degree C\n",
+ "d = 1.5*10**13 #in cm\n",
+ "R = 7.1*10**10; #in cm\n",
+ "\n",
+ "# Calculations\n",
+ "T_earth = ((R/(2*d))**0.5)*T_sun;\n",
+ "\n",
+ "# Results\n",
+ "print \"Temperature of earth = %f C\"%(T_earth-273) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of earth = 17.576884 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.10 page number 191\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find temperature of earth\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "R=7*10**10; #in cm\n",
+ "Ts=6000; #in K\n",
+ "\n",
+ "# Calculations\n",
+ "l=1.5*10**13; #in m\n",
+ "To=((R**2/(4*l**2))**0.25)*Ts;\n",
+ "\n",
+ "# Results\n",
+ "print \"temperature of earth = %f K\"%(To)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "temperature of earth = 289.827535 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.11 page number 192\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the equilibrium temperature\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "R=6.92*10**5 #in km\n",
+ "l=14.97*10**7 #in km\n",
+ "Ts=6200; #in K\n",
+ "\n",
+ "# Calculations\n",
+ "To=(R**2/l**2)**0.25*Ts;\n",
+ "\n",
+ "# Results\n",
+ "print \"Equilibrium temperature = %f K\"%(To)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium temperature = 421.535191 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.12 page number 192\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the equilibrium temperature\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "view_factor=0.5;\n",
+ "R=6.92*10**5 #in km\n",
+ "l=14.97*10**7 #in km\n",
+ "Ts=6200; #in K\n",
+ "\n",
+ "# Calculations\n",
+ "To=(view_factor*(R**2/l**2))**0.25*Ts;\n",
+ "\n",
+ "# Results\n",
+ "print \"Equilibrium temperature = %f K\"%(To)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium temperature = 354.467431 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.13 page number 193\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the surface temperature\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "view_factor=0.25;\n",
+ "R=7.1*10**10 #in cm\n",
+ "l=1.5*10**13 #in cm\n",
+ "Ts=5973; #in K\n",
+ "alpha=0.2;\n",
+ "epsilon=0.1;\n",
+ "\n",
+ "# Calculations\n",
+ "ratio=alpha/epsilon;\n",
+ "To=(ratio*view_factor*(R**2/l**2))**0.25*Ts;\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \"Equilibrium temperature = %f K\"%(To)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium temperature = 345.556097 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.14 page number 193\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the solar constant\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "R=7*10**10; #in cm\n",
+ "l=1.5*10**13; #in cm\n",
+ "sigma=5.3*10**-5; #in erd/s(cm2)(K)4\n",
+ "T=6000; #in K\n",
+ "\n",
+ "# Calculations\n",
+ "S=(R/l)**2*(sigma)*(T**4)*60;\n",
+ "\n",
+ "# Results\n",
+ "print \"solar constant = %f J/sq cm min\"%(S/10**7)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "solar constant = 8.975232 J/sq cm min\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.15 page number 207\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the amount of vapor and liquid and amount of heat transfer\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "F = 5000. #in kg/hr\n",
+ "xF = 0.01\n",
+ "xL = 0.02;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "L = F*xF/xL;\n",
+ "V = F-L;\n",
+ "print \"L = %f Kg/hr V = %f kg/hr\"%(L,V)\n",
+ "\n",
+ "TF= 303 #in K\n",
+ "hF = 125.9 #in KJ/kg\n",
+ "T1 = 373.2 #in K\n",
+ "Hv = 2676.1 #in kJ/kg\n",
+ "hL = 419.04; #in kJ/kg\n",
+ "Ts = 383.2 #in K\n",
+ "Hs = 2691.5 #in kJ/kg\n",
+ "hs = 461.30 #in kJ/kg\n",
+ "\n",
+ "S = (F*hF-L*hL-V*Hv)/(hs-Hs);\n",
+ "print \"amount of steam = %f kg steam/h\"%(S)\n",
+ "\n",
+ "q = S*(Hs - hs);\n",
+ "q = q*1000/3600 #conversion to Watt\n",
+ "U = q/(69.9*10);\n",
+ "print \"heat transfer coefficient = %f W/sq m K\"%(U)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L = 2500.000000 Kg/hr V = 2500.000000 kg/hr\n",
+ "amount of steam = 3187.315039 kg steam/h\n",
+ "heat transfer coefficient = 2824.809251 W/sq m K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.16 page number 208\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the amount of liquid and vapor leaving and outlet concentration\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "# Variables\n",
+ "b1 = 6000*125.79+3187.56*2691.5-3187.56*461.30; #data from previous problem\n",
+ "b2 = 6000;\n",
+ "A = array([[419.04, 2676.1],[1, 1]])\n",
+ "\n",
+ "# Calculations and Results\n",
+ "b = array([[b1],[b2]]);\n",
+ "x = linalg.solve(A,b)\n",
+ "#x = x*b\n",
+ "L = x[0];\n",
+ "V = x[1];\n",
+ "\n",
+ "print \"L = %f kg/hrV = %f kg/hr\"%(L,V)\n",
+ "\n",
+ "F = 6000 #in kg/hr\n",
+ "xF = 0.01;\n",
+ "xL = F*xF/L;\n",
+ "print \"percentage increase in outlet concentration = %f\"%(xL*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L = 3629.927289 kg/hrV = 2370.072711 kg/hr\n",
+ "percentage increase in outlet concentration = 1.652926\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.17 page number 209\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the change in heat trnasfer area\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "Hv=2635.3 #kJ/kg\n",
+ "hL=313.93 #in kJ/kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "S=(2500*313.93+2500*2635.3-5000*125.79)/(2691.5-461.30);\n",
+ "print \"steam flow rate = %f kg steam/hr\"%(S)\n",
+ "\n",
+ "q = S*(2691.5 - 461.30);\n",
+ "q = q*1000./3600 #in W\n",
+ "U = 2833.13; #in W/m2 K\n",
+ "delta_T = 383.2-348.2; #in K\n",
+ "A = q/(U*delta_T);\n",
+ "\n",
+ "print \"Area = %f sq meter\"%(A)\n",
+ "print \"in this case a condensor and vaccum pump should be used\"\n",
+ "\n",
+ "# Note : there is mistake in calculation in Book. Please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "steam flow rate = 3024.000090 kg steam/hr\n",
+ "Area = 18.892462 sq meter\n",
+ "in this case a condensor and vaccum pump should be used\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch6.ipynb b/Introduction_To_Chemical_Engineering/ch6.ipynb
new file mode 100644
index 00000000..dc10eb48
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch6.ipynb
@@ -0,0 +1,866 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.3 page number 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flux and pressure difference\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "D_AB=6.75*10**-5 #in m2/s\n",
+ "Z=0.03 #in m\n",
+ "R=8314\n",
+ "p_A1=5.5*10**4 #in Pa\n",
+ "p_A2=1.5*10**4 #in Pa\n",
+ "T=298 #in K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "N_A=D_AB*(p_A1-p_A2)/(R*T*Z);\n",
+ "print \"flux = %f kmol/sq m s\"%(N_A)\n",
+ "\n",
+ "#for partial pressure\n",
+ "Z=0.02; #in m\n",
+ "p_A2=p_A1-((N_A*R*T*Z)/D_AB);\n",
+ "print \"pressure = %f Pa\"%(p_A2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "flux = 0.000036 kmol/sq m s\n",
+ "pressure = 28333.333333 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.4 page number 216\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flux of NH3 and equimolar counter diffusion flux\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Z=0.15 #in m\n",
+ "P=1.013*10**5 #in Pa\n",
+ "p_A1=1.5*10**4 #in Pa\n",
+ "p_A2=5*10**3 #in Pa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "p_B1=P-p_A1;\n",
+ "p_B2=P-p_A2;\n",
+ "\n",
+ "D_AB=2.30*10**-5 #in m2/s\n",
+ "R=8314.\n",
+ "T=298. #in K\n",
+ "\n",
+ "#for non diffusing N2\n",
+ "p_BM=(p_B2-p_B1)/math.log (p_B2/p_B1);\n",
+ "print p_B1, p_B2\n",
+ "N_A=D_AB*(p_A1-p_A2)*P/(R*T*Z*p_BM);\n",
+ "print \"flux = %.4e kmol/sq m s\"%(N_A)\n",
+ "\n",
+ "#for diffusing N2\n",
+ "N_A=D_AB*(p_A1-p_A2)/(R*T*Z);\n",
+ "print \"flux = %.4e kmol/sq m s\"%(N_A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "86300.0 96300.0\n",
+ "flux = 6.8736e-07 kmol/sq m s\n",
+ "flux = 6.1889e-07 kmol/sq m s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.6 page number 218\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "# Variables\n",
+ "M_A=36.5 #molar mass of HCl\n",
+ "M_B=18. #molar masss of water\n",
+ "w_A1=12.; #weight % of HCL\n",
+ "w_A2=4. #weight % of HCL\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x_A1=(w_A1/M_A)/((w_A1/M_A)+((100-w_A1)/M_B));\n",
+ "print 'x_A1 =%f'%(x_A1)\n",
+ "\n",
+ "x_B1=1.-x_A1;\n",
+ "M1=100./((w_A1/M_A)+((100-w_A1)/M_B));\n",
+ "print \"molar mass at point 1 = %f kg/kmol\"%(M1)\n",
+ "\n",
+ "#at point 2\n",
+ "x_A2=(w_A2/M_A)/((w_A2/M_A)+((100-w_A2)/M_B));\n",
+ "x_B2=1-x_A2;\n",
+ "M2=100/((w_A2/M_A)+((100-w_A2)/M_B)); #avg molecular weight at point 2\n",
+ "print \"molar mass at point 2 = %f Kg/kmol\"%(M2)\n",
+ "\n",
+ "density_1=1060.7; #in kg/m3\n",
+ "density_2=1020.15; #in kg/m3\n",
+ "C_av=((density_1/M1)+(density_2/M2))/2;\n",
+ "print \"C_av = %f kmol/cubic m\"%(C_av)\n",
+ "\n",
+ "x_BM=(x_B2-x_B1)/(math.log (x_B2/x_B1));\n",
+ "Z=0.004 #in m\n",
+ "D_AB=2.5*10**-9;\n",
+ "N_A=(D_AB*C_av*(x_A1-x_A2))/(x_BM*Z);\n",
+ "print \"flux = %f kmol/sq m-s\"%(N_A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x_A1 =0.063011\n",
+ "molar mass at point 1 = 19.165694 kg/kmol\n",
+ "molar mass at point 2 = 18.372483 Kg/kmol\n",
+ "C_av = 55.434825 kmol/cubic m\n",
+ "flux = 0.000002 kmol/sq m-s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.8 page number 229\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the mean driving force and mass transfer area\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "Gs=700/22.4 #in kmol of dry air/hr\n",
+ "Ls=1500./18 #in kmol of dry air/hr\n",
+ "y1=0.05\n",
+ "Y1=y1/(1-y1);\n",
+ "Y2=0.02*Y1;\n",
+ "X2=0\n",
+ "X1=(Gs/Ls)*(Y1-Y2);\n",
+ "m=Gs*(Y1-Y2);\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#driving force\n",
+ "delta_Y1=Y1-1.68*X1;\n",
+ "delta_Y2=Y2-1.68*X2;\n",
+ "delta_Y=(delta_Y1-delta_Y2)/(math.log (delta_Y1/delta_Y2));\n",
+ "print \"driving force = %f kmol acetone/kmol dry air\"%(delta_Y)\n",
+ "\n",
+ "#mass transfer area\n",
+ "K_G=0.4 #in kmol acetone/kmol dry air\n",
+ "A=m/(K_G*delta_Y);\n",
+ "print \"area = %f sq m\"%(A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "driving force = 0.006466 kmol acetone/kmol dry air\n",
+ "area = 623.154093 sq m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.9 page number 229\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to calculate minimum oil circulation rate\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "G1=(855/22.4)*(106.6/101.3)*(273/299.7);\n",
+ "y1=0.02;\n",
+ "Y1=y1/(1-y1);\n",
+ "Gs=G1*(1-y1);\n",
+ "\n",
+ "# Calculations\n",
+ "#for 95% removal\n",
+ "Y2=0.05*Y1;\n",
+ "x2=0.005;\n",
+ "X2=x2/(1-x2);\n",
+ "Y=0.204;\n",
+ "X1=0.176; #in kmol bgenzene/kmol benzene free oil\n",
+ "\n",
+ "Ls_molar=(Gs*(Y1-Y2))/(X1-X2);\n",
+ "Ls=Ls_molar*260;\n",
+ "\n",
+ "# Results\n",
+ "print \"minimum oil circulation rate = %f kg/hr\"%(Ls)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum oil circulation rate = 1057.149516 kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.10 page number 231\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# to find the equilibrium composition\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "P_M = 53.32 #kPa\n",
+ "P_W = 12.33 #in kpA\n",
+ "P = 40 #IN K pA\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x = (P - P_W)/(P_M-P_W);\n",
+ "\n",
+ "print \"liquid phase composition = %f\"%(x)\n",
+ "\n",
+ "y = P_M*x/P;\n",
+ "print \"vapor phase composition = %f\"%(y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "liquid phase composition = 0.675043\n",
+ "vapor phase composition = 0.899832\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.12 page number 231\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the top and bottom composition\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "from numpy import *\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "# Variables\n",
+ "x = [1,0.69,0.40,0.192,0.045,0];\n",
+ "y = [1,0.932,0.78,0.538,0.1775,0];\n",
+ "plot(x,y)\n",
+ "#xlabel(\"x\")\n",
+ "#ylabel(\"y\")\n",
+ "#title(\"distillation curve\")\n",
+ "x = linspace(0,1,10)\n",
+ "y = linspace(0,1,10)\n",
+ "plot(x,y)\n",
+ "x = [0.5,0.31];\n",
+ "y = [0.5,0.7];\n",
+ "plot (x,y)\n",
+ "\n",
+ "xlabel(\"x\")\n",
+ "ylabel(\"y\")\n",
+ "suptitle(\"distillation curve\")\n",
+ "Z=0.5;\n",
+ "y_D=0.69;\n",
+ "x_W=0.31;\n",
+ "\n",
+ "show()\n",
+ "\n",
+ "# Results\n",
+ "print \"composition of top product = %f mole percent of hexane\"%(y_D*100)\n",
+ "print \"composition of bottom product = %f mole percent of hexane\"%(x_W*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive', 'new_figure_manager']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEhCAYAAAB7mQezAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVGX+B/APAiF5SXMBVwZvaCoj14DEyzpmiZfUUhM0\ncdFs1bK2tVx7beVtvVZ2sxZxTcsbiuI1k9zSUfFHqDBkXvKaySCStw0vIAOc3x/POjICOgxz5szl\n8369fAlxnPl61j3f+Zznec7jJkmSBCIiov+pp3QBRERkX9gYiIjIBBsDERGZYGMgIiITbAxERGSC\njYGIiEywMZBdmjFjBhYuXAgAmD59Or7//vsaj92yZQuOHz9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EB8fj4qKCnTt2hVarRYajUbp0ojqjImBiIhMcIyBiIhMsDEQEZEJNgYiIjLB\nxkBERCbYGIiIyAQbAxERmWBjICIiE2wMRERk4v8BePf8wahk3K8AAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x27f1450>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "composition of top product = 69.000000 mole percent of hexane\n",
+ "composition of bottom product = 31.000000 mole percent of hexane\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.13 page number 237\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the composite distillate and residue\n",
+ "\n",
+ "%pylab inline\n",
+ "import math \n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "# Variables\n",
+ "F = 100. #moles\n",
+ "xf = 0.4;\n",
+ "D = 60. #moles\n",
+ "W = 40. #moles\n",
+ "\n",
+ "# Calculations\n",
+ "x = linspace(0.2,0.45,6)\n",
+ "y = zeros(6)\n",
+ "z = zeros(6)\n",
+ "for i in range(6):\n",
+ " y[i] = 2.16*x[i]/(1+1.16*x[i]);\n",
+ " z[i] = (y[i]-x[i])**-1;\n",
+ "z = z.T / 10\n",
+ "plot(x,z)\n",
+ "suptitle('Batch Distillation Curve')\n",
+ "xlabel('x')\n",
+ "ylabel('y')\n",
+ "xw = 0.22; #from the graph\n",
+ "yd = (F*xf-W*xw)/D;\n",
+ "show()\n",
+ "\n",
+ "# Results\n",
+ "print \"composition of distillate = %f\"%(yd)\n",
+ "print \"composition of residue = %f\"%(xw)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png":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/927d3PXXXc1ezfSjh07SElJYebMmYSFhbF9+3bO\nOuusRrGc+CN/YlI7duwYAQEBdO3alcOHD7vGcRo+16FDhxqVt9lspKamUlxczLfffkt9fT3Lly9n\n6NChLf5M06dPZ/bs2Xz55ZeAmSTy8/MBiIiIcI2rFBYWUltbe9LrZGdns3TpUlasWMHYsWMByMzM\n5JlnnuHIkSMA7N27l3379rU4Nmnf1PIQjzp8+DB2u536+npqa2tZtGgRQUFBTJgwgczMTBISEhg0\naBDR0dEAhIWFkZiYSExMDCNGjCA3N5ePPvqI+Ph4QkJCyMrK4qGHHmryPie722nbtm0kJSVhGAad\nOnXitttuc3WdHX+X1IwZM/j888+pr693DeT37t2bhx56iISEBO6///7T3mHVtWtXbrzxRqKioujT\npw+XXHKJ67WJEydy4403cu655/L++++7/h4REcHs2bNJTU0FzB/shh/v469/sju6UlNTmTdvHmPG\njOHo0aPU1dWRkZEBwC233MIvf/lL/vnPfzJs2DDXgHlz9RUTE0NVVRURERGEhYUB5t1ln3zyCUlJ\nSQQFBdGpUyeWLVtGjx49mq1r8S82o6WduiIiIj9Qt5WIiLhNyUNERNym5CEiIm5T8hAREbcpeYiI\niNuUPERExG1KHiIi4jYlDxERcZuSh4iIuM2jyaOoqIi4uDhiYmJOumObw+EgJSWFxMRE0tLSXH+f\nOXMmF110EVFRUYwZM6bRGkMiImItjy1PUlNTQ1RUFCUlJYSFhZGamkpBQQF2u91VZs+ePWRkZFBc\nXExoaCj79++nW7dubN26lauvvprNmzcTFBREdnY2V199NTfddJMnQhURETd5rOVRVlZGbGws4eHh\nBAYGkp2dTWFhYaMyy5YtIzs727W7XLdu3Vz/7dixI4cOHeLYsWNUV1fTp08fT4UqIiJu8ljycDqd\nREZGuo4jIiJwOp2NymzZsoVdu3aRmppKfHw8ixYtAszkcdddd9G7d2969epF165dXSuFioiI9TyW\nPE62RPbx6urq2LBhA8XFxaxevZrc3Fw+/vhjtm3bxuOPP86OHTvYtWsXVVVVLFmyxFOhioiImzy2\n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NuUPERExG1K\nHiIi4jYlDxERcZuSh4iIuE3JQ0RE3KbkIdKG1q1bR0JCAjU1NRw6dIgBAwbwySefWB2WSJvTDHOR\nNvbAAw9w5MgRDh8+TGRkJPfcc4/VIYm0OSUPkTZWW1vLoEGDCAkJobS0tN0t+y0C6rYSaXP79u3j\n0KFDVFVVcfjwYavDEfEItTxE2tg111zDb37zGz7//HN2797NE088YXVIIm3OK5dkF/FVixcvplOn\nTowbN476+nqGDBmCw+EgPT3d6tBE2pRaHiIi4jaNeYiIiNuUPERExG1KHiIi4jYlDxERcZuSh4iI\nuE3JQ0RE3KbkISIiblPyEBERt/1/DZ660K/RnHYAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x1c46110>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "composition of distillate = 0.520000\n",
+ "composition of residue = 0.220000\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.15 page number 249\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the top and bottom product composition\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "#part 1\n",
+ "x=0.4;\n",
+ "y=0.8;\n",
+ "x_D=y;\n",
+ "x_W=0.135; #bottom concentration\n",
+ "\n",
+ "# Calculations and Results\n",
+ "D=(100*x-100*x_W)/(y-x_W); #distillate amount\n",
+ "print \"amount of distillate =%f moles/h\"%(D)\n",
+ "\n",
+ "#part 2\n",
+ "alpha=6; #relative volatility\n",
+ "x_R=y/(y+(alpha*(1-y))); #liquid leaving partial condensor\n",
+ "print \"liquid leaving partial condenser = %f\"%(x_R)\n",
+ "\n",
+ "y1=(1./3)*y+(2./3)*x;\n",
+ "x1=y1/(y1+(alpha*(1-y1)));\n",
+ "y_W = (1./3)*x_D+(2./3)*x1;\n",
+ "x_W=y_W/(y_W+(alpha*(1-y_W)));\n",
+ "D=(100*(x-x_W))/(y-x_W);\n",
+ "\n",
+ "print \"amount of distillate = %f moles/h\"%(D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of distillate =39.849624 moles/h\n",
+ "liquid leaving partial condenser = 0.400000\n",
+ "amount of distillate = 43.636364 moles/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.16 page number 264\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the percentage extraction of nicotine\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "x=0.01; #% of nicotine\n",
+ "X0 = x/(1-x);\n",
+ "w=150. #weight of nicotine water solution\n",
+ "\n",
+ "# Calculations and Results\n",
+ "A0=w*(1-X0);\n",
+ "B0=250.; #kg keroscene\n",
+ "X1 = A0*X0/(A0+B0*0.798);\n",
+ "print \"final concentration of nicotine = %f\"%(X1)\n",
+ "\n",
+ "c=A0*(X0-X1);\n",
+ "print \"amount of nicotine removed = %f kg\"%(c)\n",
+ "\n",
+ "percentage = (c*100)/(A0*x);\n",
+ "print \"percentage recovery = %f percent\"%(percentage)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "final concentration of nicotine = 0.004310\n",
+ "amount of nicotine removed = 0.859863 kg\n",
+ "percentage recovery = 57.909174 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.17 page number 264\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the number of stages\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "x=0.01 #mole fraction of nicotine\n",
+ "yN = 0.0006; #mole fraction in solvent\n",
+ "xN = 0.001; #final mole fraction in water\n",
+ "\n",
+ "# Calculations and Results\n",
+ "X0=x/(1.-x); #in kg nicotine/kg water\n",
+ "YN =yN/(1.-yN); #in kg nicotine/kg keroscene\n",
+ "XN = xN/(1.-xN);\n",
+ "A0=100.*(1.-X0); #kgwater/h\n",
+ "B0=150.*(1.-YN); #in kg kerosene/h\n",
+ "\n",
+ "Y1=((A0*(X0-XN))/B0)+YN; #in kg nicotine/kg kerosene\n",
+ "print \"Y1 = %f kg nicotine/kg kerosene\"%(Y1)\n",
+ "\n",
+ "#for graph refer to the book\n",
+ "number_of_stages = 8.4;\n",
+ "print \"numnber of stages = %f\"%(number_of_stages)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y1 = 0.006609 kg nicotine/kg kerosene\n",
+ "numnber of stages = 8.400000\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.18 page number 274\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to calculate the humidity\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 101.3 #in kPa\n",
+ "pA = 3.74 #in kPa\n",
+ "p_AS = 7.415 #in kPa\n",
+ "\n",
+ "# Calculations and Results\n",
+ "H = (18.02/28.97)*(pA/(P-pA));\n",
+ "print \"humidity = %f kg H2O/kg air\"%(H)\n",
+ "\n",
+ "Hs = (18.02/28.97)*(p_AS/(P-p_AS));\n",
+ "print \"Saturated humidity = %f kg H2O/kg air\"%(Hs)\n",
+ "\n",
+ "humidity = 100*(H/Hs);\n",
+ "print \"percentage humidity = %f percent\"%(humidity)\n",
+ "\n",
+ "relative_humidity = 100*(pA/p_AS);\n",
+ "print \"percentage relative humidity = %f percent\"%(relative_humidity)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "humidity = 0.023845 kg H2O/kg air\n",
+ "Saturated humidity = 0.049127 kg H2O/kg air\n",
+ "percentage humidity = 48.538334 percent\n",
+ "percentage relative humidity = 50.438301 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.19 page number 264\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the air flow rate and outlet humidity\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "S=425.6 #in kg/h\n",
+ "X1 = 0.035 #in kgwater/kg dry solid\n",
+ "t_s1=25. #in degree C\n",
+ "X2 = 0.017 #in kg H2O/kg dry air\n",
+ "t_s2=60. #in degree C\n",
+ "H2 = 0.0175 #in kg H2O/kg dry air\n",
+ "t_G2 = 84.2 #in degree C\n",
+ "t_G1= 32.8 #in degree C\n",
+ "C_pS = 1.465 #in kJ/kg dry solid\n",
+ "C_pA = 4.187 #in kg/ kg H2O K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "H_G2=(1.005+1.88*H2)*(t_G2-0)+H2*2501;\n",
+ "H_S1 = C_pS*(t_s1-0)+X1*C_pA*(t_s1-0); #in kJ/kg\n",
+ "H_S2 = C_pS*(t_s2-0)+X2*C_pA*(t_s2-0); #in kJ/kg\n",
+ "Q=9300.; #in kJ/h\n",
+ "\n",
+ "print \"Latent heat of water at 0C HG2 = %f kJ/kg dryair\"%(H_G2)\n",
+ "print \"Enthalpy of entering solid HS1 = %f kJ/kg dryair\"%(H_S1)\n",
+ "print \"Enthalpy of exit solid HS2 = %f kJ/kg dryair\"%(H_S2)\n",
+ "\n",
+ "#applying GHg2 + SHs1 = GHg1 +SHs2 +Q, we get two linear equations\n",
+ "#0.0175G+14.17248 = GH1 and 98.194G-29745.398 = 2562.664GH1\n",
+ "A = array([[0.0175, -1],[98.194, -2562.664]]);\n",
+ "b = array([[-14.17248],[29745.398]]);\n",
+ "x = linalg.solve(A,b)\n",
+ "G = x[0]\n",
+ "H1 = x[1]/G;\n",
+ "print \"Air flow rate G = %f kg dryair/hr\"%(G)\n",
+ "print \"Humidity H1 = %f kg dryair/hr\"%(H1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Latent heat of water at 0C HG2 = 131.158680 kJ/kg dryair\n",
+ "Enthalpy of entering solid HS1 = 40.288625 kJ/kg dryair\n",
+ "Enthalpy of exit solid HS2 = 92.170740 kJ/kg dryair\n",
+ "Air flow rate G = 1238.387008 kg dryair/hr\n",
+ "Humidity H1 = 0.028944 kg dryair/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.20 page number 291\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the crystal yield\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "# Variables\n",
+ "M_Na2CO3 = 106\n",
+ "M_10H2O = 180.2\n",
+ "M_Na2CO3_10H2O = 286.2;\n",
+ "w_Na2CO3 = 5000. #in kg\n",
+ "water = 0.05 #% of water evaporated\n",
+ "\n",
+ "# Calculations\n",
+ "W = water*w_Na2CO3;\n",
+ "#solving material balance, we have two equations\n",
+ "#equation 1 -> 0.8230L +0.6296C = 3500\n",
+ "#equation 2 -> 0.1769L + 0.3703C = 1250\n",
+ "\n",
+ "A = array([[0.8230, 0.6296],[0.1769, 0.3703]])\n",
+ "b = array([[3500],[1250]])\n",
+ "x = linalg.solve(A,b);\n",
+ "L = x[0]\n",
+ "C = x[1];\n",
+ "\n",
+ "# Results\n",
+ "print \"L = %f kg solution\"%(L)\n",
+ "print \"C = %f kg of Na2CO3.10H2O crystals\"%(C)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L = 2632.372855 kg solution\n",
+ "C = 2118.102193 kg of Na2CO3.10H2O crystals\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.21 page number 291\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the crystal yield\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "# Variables\n",
+ "A = array([[0.7380, 0.5117],[0.2619, 0.4882]])\n",
+ "b = array([[1400],[600]])\n",
+ "\n",
+ "# Calculations and Results\n",
+ "x = linalg.solve(A,b)\n",
+ "L = x[0]\n",
+ "C = x[1];\n",
+ "print \"L = %f kg solution\"%(L)\n",
+ "print \"C = %f kg of MgSO4.7H2O crystals\"%(C)\n",
+ "\n",
+ "F = 2000 #in kg/h\n",
+ "cv = 2.93 #in kJ/kg K\n",
+ "H1 = F*cv*(330-293);\n",
+ "print \"enthalpy of feed = %f kJ\"%(H1)\n",
+ "\n",
+ "wt = 246.49 #molar mass MgSO4.7H2O\n",
+ "heat_soln = -13.31*10**3; #in kJ/kg mol\n",
+ "heat = heat_soln/wt;\n",
+ "heat_crystallization = abs(heat);\n",
+ "H2 = heat_crystallization*C; #total heat\n",
+ "q = -H1-H2;\n",
+ "print \"heat absorbed = %f kJthus heat shall be removed\"%(q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L = 1663.710339 kg solution\n",
+ "C = 336.489681 kg of MgSO4.7H2O crystals\n",
+ "enthalpy of feed = 216820.000000 kJ\n",
+ "heat absorbed = -234989.814805 kJthus heat shall be removed\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch7.ipynb b/Introduction_To_Chemical_Engineering/ch7.ipynb
new file mode 100644
index 00000000..abdbbfb1
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch7.ipynb
@@ -0,0 +1,417 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Chemical Kinetics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.3 page number 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the change on rate of reaction\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#part 1\n",
+ "#rate equation r = kC_NO**2*C_O2\n",
+ "#if pressure increases 3 times\n",
+ "# Calculations and Results\n",
+ "r = 3**2*3; #according to the rate reaction\n",
+ "print \"reaction reate will be increased by with 3 times increase in pressure = %f times\"%(r)\n",
+ "\n",
+ "#part 2\n",
+ "r = 3**2*3; #according to the rate reaction\n",
+ "print \"reaction reate will be increased by with 3 times decrease in volume = %f times\"%(r)\n",
+ "\n",
+ "r = 3**2; #according to the rate reaction\n",
+ "print \"reaction reate will be increased by with 3 times increase in conc of NO = %f times\"%(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "reaction reate will be increased by with 3 times increase in pressure = 27.000000 times\n",
+ "reaction reate will be increased by with 3 times decrease in volume = 27.000000 times\n",
+ "reaction reate will be increased by with 3 times increase in conc of NO = 9.000000 times\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.10 page number 316\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the % transformation\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "# Variables\n",
+ "moles_A = 3.;\n",
+ "moles_B = 5.;\n",
+ "K = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "def F(x):\n",
+ " return 15.-8*x;\n",
+ "\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "y = fsolve(F,x)\n",
+ "\n",
+ "# Results\n",
+ "print \"amount of A transformed = %f percent\"%(y*100/3)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of A transformed = 62.500000 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.11 page number 316\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the initial conc of A and B\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "# Variables\n",
+ "Cp = 0.02;\n",
+ "Cq = 0.02;\n",
+ "K = 4*10**-2;\n",
+ "Cb = 0.05;\n",
+ "Cb_i = Cb+Cp;\n",
+ "a = (Cp*Cq)/(K*Cb);\n",
+ "\n",
+ "# Calculations\n",
+ "def F(x):\n",
+ " return x-0.02-a;\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "y = fsolve(F,x)\n",
+ "\n",
+ "# Results\n",
+ "print \"conc of A= %f mol/l\"%(y)\n",
+ "print \"conc of B= %f mol/l\"%(Cb_i)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "conc of A= 0.220000 mol/l\n",
+ "conc of B= 0.070000 mol/l\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.12 page number 316\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the initial concentration and shift in equilibrium\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Ce_N2 = 3.; #equilibrium conc of N2\n",
+ "Ce_H2 = 9.; #equilibrium conc of H2\n",
+ "Ce_NH3 = 4.; #equilibrium conc oh NH3\n",
+ "\n",
+ "# Calculations and Results\n",
+ "C_N2 = Ce_N2 + 0.5*Ce_NH3;\n",
+ "C_H2 = Ce_H2 + 1.5*Ce_NH3;\n",
+ "\n",
+ "print \"concentration of N2 = %f mol/l \\nconcentration of H2 = %f mol/l\"%(C_N2,C_H2)\n",
+ "# Note :second part is theoritical, book shall be referred for solution\n",
+ "\n",
+ "n_H2 = 3.; #stotiometric coefficient\n",
+ "n_N2 = 1.; #stotiometric coefficient\n",
+ "n_NH3= 2.; #stotiometric coefficient\n",
+ "delta_n = n_H2+n_N2-n_NH3;\n",
+ "if delta_n > 0:\n",
+ " print \"delta_n =%f since delta_n is greater than 0,equilibrium will shift to right with increase in volume\"%(delta_n)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "concentration of N2 = 5.000000 mol/l \n",
+ "concentration of H2 = 15.000000 mol/l\n",
+ "delta_n =2.000000 since delta_n is greater than 0,equilibrium will shift to right with increase in volume\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.13 page number 317\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the % transformation\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "# Variables\n",
+ "moles_A = 0.02;\n",
+ "K = 1.;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "#part 1\n",
+ "moles_B = 0.02;\n",
+ "def F(x):\n",
+ " return moles_A*moles_B-(moles_A+moles_B)*x;\n",
+ "\n",
+ "#initial guess\n",
+ "x = 10.;\n",
+ "y = fsolve(F,x)\n",
+ "print \"amount of A transformed = %f percent\"%(y*100/0.02)\n",
+ "\n",
+ "#part 2\n",
+ "moles_B = 0.1;\n",
+ "y = fsolve(F,x)\n",
+ "print \"amount of A transformed = %f percent\"%(y*100/0.02)\n",
+ "\n",
+ "#part 1\n",
+ "moles_B = 0.2;\n",
+ "y = fsolve(F,x)\n",
+ "print \"amount of A transformed = %.0f percent\"%(y*100/0.02)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amount of A transformed = 50.000000 percent\n",
+ "amount of A transformed = 83.333333 percent\n",
+ "amount of A transformed = 91 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.15 page no : 319\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate equation\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "%pylab inline\n",
+ "# Variables\n",
+ "t = array([0,5,10,15,20,25])\n",
+ "C_A = array([25,18.2,13.2,9.6,7,5.1])\n",
+ "\n",
+ "#integral method of rate determination\n",
+ "s = 0;\n",
+ "k = zeros(6)\n",
+ "\n",
+ "# Calculations and Results\n",
+ "for i in range(1,6):\n",
+ " k[i] = (1./t[i])*math.log(25./C_A[i])\n",
+ " #print (k[i],\"k values for various conc.\")\n",
+ " s = s+k[i]\n",
+ "\n",
+ "print \"average value of k = %f\"%(s/5)\n",
+ "print (\"ra =- 0.06367*CA\",\"since its a first order reaction,\")\n",
+ "\n",
+ "subplot(221) \n",
+ "plot(t,C_A)\n",
+ "\n",
+ "xlabel(\"time\")\n",
+ "ylabel(\"concentration\")\n",
+ "suptitle(\"integral method\")\n",
+ "\n",
+ "#differential method of rate determination\n",
+ "ra = array([1.16,0.83,0.60,0.43])\n",
+ "C_A = array([18.2,13.2,9.6,7])\n",
+ "\n",
+ "subplot(222) \n",
+ "plot(C_A,ra)\n",
+ "plot(C_A,ra,'ro')\n",
+ "xlabel(\"Concentration\")\n",
+ "ylabel(\"-ra\")\n",
+ "suptitle(\"differential method\")\n",
+ "xlim(1,20)\n",
+ "ylim(.1,2)\n",
+ "print \"rate from differential method = -0.064*CA\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "average value of k = 0.063680\n",
+ "('ra =- 0.06367*CA', 'since its a first order reaction,')\n",
+ "rate from differential method = -0.064*CA"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive', 'new_figure_manager']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAACnCAYAAAD32+C7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XdYFNf6B/Dv0CFgUCkqqOhakLIUsStgAdRYuBoFI4lK\nkmtuVCxJrt7cJGKKJqZQjCWJJQU1tovXoEGNEVQSExWNJZpEApG1InYQpby/P+bHXqq7LLs7W97P\n8/DIDrNz3vE5s+/OOXPOEYiIwBhjzCxZ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MGDa23Lyspq8DgNsbOzUx7/3r17mDNnDk6ePIk2bdpg0aJFqKioqBdj3bjrftGq3s/a2lq5\nvfqaMlXcJ2DA7O3tldP/qqu6Uru4uMDV1RUZGRnK7dwnwNQVGRmJK1euYP369cptp06dQtu2bbFl\nyxYQEW7cuIHvv/8e/fr1a3DJRUEQIJfLUVBQgBMnTgAQp7GurKxEVFQUPvnkE+WHa35+vso7VXt7\ne5SUlDT4t4qKClhYWMDZ2Rn379/Hli1bHvk+QRDQr18/fP/997h16xaqqqqwefNmhIaGqvcfZEL4\nTsCAubu7IzAwED4+PvDz81N+S6le1KJa3d+rX2/atAnPP/88Xn31VVRWVmLixIkGOYc8MzyWlpbI\nzMzEnDlzsGTJElhaWqJNmzZYtmwZrl69Ch8fHwiCgCVLlqBdu3b4448/Gvy2bWNjg02bNiE+Ph5V\nVVWws7PD999/jxkzZqCgoAC+vr6wsbFBy5YtsWPHjnp1u6Znn30WgwcPRseOHbFv375a+zk7O2Pa\ntGnw9vZGx44d0adPH+Xfnn76aUybNg0tWrTADz/8oNzu6emJN998E/369QMAREVFKZtPG7umTBE/\nIsoYY2aMm4MYY8yMcRJgjDEzxkmAMcbMGCcBxhgzY5wEGGPMjHESYIwxM8ZJgDHGzNj/ATOW5vyu\n6kMaAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2b3a490>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.16 page no : 322\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of reaction\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "E = 75200. #in J/mol\n",
+ "E1 = 50100. #in J/mol\n",
+ "R = 8.314 #in J/mol K\n",
+ "T = 298. #in K\n",
+ "\n",
+ "# Calculations\n",
+ "ratio = math.exp((E1-E)/(R*T));\n",
+ "rate_increase = ratio**-1\n",
+ "\n",
+ "# Results\n",
+ "print \"increase in rate of reaction =\",rate_increase,\"times\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "increase in rate of reaction = 25106.6042072 times\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch8.ipynb b/Introduction_To_Chemical_Engineering/ch8.ipynb
new file mode 100644
index 00000000..a18b8152
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch8.ipynb
@@ -0,0 +1,472 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Measuring Devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.4 page number 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "pressure_difference = 3.4 #in mm water\n",
+ "pressure = 1.0133*10**5 #in pa\n",
+ "temperatue = 293. #in K\n",
+ "mass_of_air = 29. #in Kg\n",
+ "\n",
+ "# Calculations and Results\n",
+ "density_air = pressure/(temperatue*8314)*mass_of_air #in kg/m3\n",
+ "print \"Density of air = %f kg/cu m\"%(density_air)\n",
+ "\n",
+ "delta_p = pressure_difference*9.8 #in pascal, acceleration due to gravity, g=9.8\n",
+ "Height=4\n",
+ "density_difference = delta_p/(9.8*Height);\n",
+ "print \"Density difference = %f kg/cu m\"%(density_difference)\n",
+ "\n",
+ "density_mixture= density_air-density_difference; #in kg/m3\n",
+ "print \"Density of mixture = %f kg/cu m\"%(density_mixture)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of air = 1.206309 kg/cu m\n",
+ "Density difference = 0.850000 kg/cu m\n",
+ "Density of mixture = 0.356309 kg/cu m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.5 page number 341\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find viscosity of oil \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "diameter=0.6; #in m\n",
+ "disk_distance=1.25*10**-3; #in m\n",
+ "speed=5.; #revolutions/min\n",
+ "torque=11.5; #in Joules\n",
+ "\n",
+ "# Calculations\n",
+ "#we know that torque= pi*omega*viscosity*radius**4/2*disc_distance\n",
+ "viscosity=(2*disk_distance*torque)/(3.14*(10*3.14)*(diameter/2)**4);\n",
+ "\n",
+ "# Results\n",
+ "print \"viscosity = %f Pa-s\"%(viscosity)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "viscosity = 0.035999 Pa-s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.6 page number 342\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the viscosity of solution using given parameters\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "diameter =10.; #in mm\n",
+ "density_of_solution = 1750.; #in kg/m3\n",
+ "density_of_air = 1.2; #in kg/m3\n",
+ "velocity = 0.9; #in mm/s\n",
+ "\n",
+ "# Calculations and Results\n",
+ "viscosity = (density_of_solution-density_of_air)*9.8*(diameter*10**-3)**2/(18*velocity*10**-3); #expression for finding viscosity\n",
+ "\n",
+ "print \"viscosity of solution = %f Pa-s\"%(viscosity)\n",
+ "\n",
+ "\n",
+ "#checking stoke's region validity\n",
+ "v=(0.2*viscosity)/(density_of_solution*diameter*10**-3);\n",
+ "if v>0.9 :\n",
+ " print \"system follows stokes law\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "viscosity of solution = 105.791605 Pa-s\n",
+ "system follows stokes law\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.7 page number 367\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the flow rate in an orifice\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "density_of_water = 1000.; #in kg/m3\n",
+ "viscosity = 1*10.**-3; #in Pa-s\n",
+ "pipe_diameter = 250.; #in mm\n",
+ "orifice_diameter = 50.; # in mm\n",
+ "density_of_mercury = 13600.; # in mm\n",
+ "manometer_height = 242.; #in mm\n",
+ "\n",
+ "# Calculations and Results\n",
+ "height_water_equivalent = (density_of_mercury-density_of_water)*(manometer_height*10**-3)/(density_of_water) #in m\n",
+ "\n",
+ "#assuming Re>30000\n",
+ "Co = 0.61;\n",
+ "velocity = Co*(2*9.8*height_water_equivalent/(1-(orifice_diameter/pipe_diameter)**4))**0.5; #in m/s\n",
+ "\n",
+ "#checking Reynold's number\n",
+ "Re = (orifice_diameter*10**-3*velocity*density_of_water)/viscosity;\n",
+ "print \"reynolds number = %f which is greater than 30000\"%(Re)\n",
+ "\n",
+ "if Re>30000:\n",
+ " print \"velocity of water = %f m/s\"%(velocity)\n",
+ "\n",
+ "rate_of_flow = (3.14*(orifice_diameter*10.**-3)**2./4)*velocity*density_of_water;\n",
+ "print \"rate of flow = %f litre/s\"%(rate_of_flow)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "reynolds number = 235976.385359 which is greater than 30000\n",
+ "velocity of water = 4.719528 m/s\n",
+ "rate of flow = 9.262073 litre/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.8 page number 368\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the coefficient of discharge for converging cone\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "pipe_diameter=0.15; #in m\n",
+ "venturi_diameter=0.05; #in m\n",
+ "pressure_drop=0.12; #m of water\n",
+ "flow_rate=3.; #in kg/s\n",
+ "density = 1000.; #in kg/m3\n",
+ "viscosity = 0.001 #in Pa-s\n",
+ "\n",
+ "# Calculations and Results\n",
+ "velocity = ((4./3.14)*flow_rate)/(venturi_diameter**2*density);\n",
+ "print \"velociy = %f m/s\"%(velocity)\n",
+ "\n",
+ "#calculating coefficient of discharge\n",
+ "Cv=velocity*((1-(venturi_diameter/pipe_diameter)**4)/(2*9.8*pressure_drop))**0.5;\n",
+ "print \"coefficient of discharge = %f\"%(Cv)\n",
+ "\n",
+ "#calculating reynold's number\n",
+ "Re = velocity*(venturi_diameter/pipe_diameter)**2*pipe_diameter*density/viscosity;\n",
+ "print \"reynolds No = %f\"%(Re)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velociy = 1.528662 m/s\n",
+ "coefficient of discharge = 0.990593\n",
+ "reynolds No = 25477.707006\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.9 page number 369\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find pA and pB\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "h1=0.66; #in m\n",
+ "h2=0.203; #in m\n",
+ "h3=0.305 #in m\n",
+ "density=1000.; #in kg/m3\n",
+ "pB=68900.; #in Pa\n",
+ "s1=0.83;\n",
+ "s2=13.6;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "print (\"part 1\")\n",
+ "pA=pB+(h2*s2-(h1-h3)*s1)*density*9.81; #in Pa\n",
+ "print \"pressure at A = %f Pa\"%(pA)\n",
+ "\n",
+ "print (\"part 2\")\n",
+ "pA1=137800. #in Pa\n",
+ "pressure=735. #mm Hg\n",
+ "pB1=pA1-(h2*s2-(h1-h3)*s1)*density*9.81;\n",
+ "pressure_B=(pB1-pressure*133.3)/9810.; #m of water\n",
+ "print \"pressure at B = %f m of water\"%(pressure_B)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part 1\n",
+ "pressure at A = 93092.931500 Pa\n",
+ "part 2\n",
+ "pressure at B = 1.593432 m of water\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.10 page number 370\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of oil flow in l/s\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "density_oil=900.; #in kg/m3\n",
+ "viscosity_oil=38.8*10**-3; #in Pa-s\n",
+ "density_water = 1000.; #in kg/m3\n",
+ "diameter=0.102 #in m\n",
+ "manometer_reading=0.9; #m of water\n",
+ "\n",
+ "# Calculations and Results\n",
+ "delta_H=manometer_reading*(density_water-density_oil)/density_oil;\n",
+ "print \"manometer reading as m of oil = %f m\"%(delta_H)\n",
+ "\n",
+ "maximum_velocity=(2*9.8*delta_H)**0.5;\n",
+ "print \"maximum_velocityVmax) = %f m/s\"%(maximum_velocity)\n",
+ "\n",
+ "Re=diameter*maximum_velocity*density_oil/viscosity_oil;\n",
+ "print \"if Re<4000 then v=0.5*Vmax Re = %f\"%(Re)\n",
+ "if Re<4000 :\n",
+ " velocity=maximum_velocity*0.5;\n",
+ "\n",
+ "print \"velocity = %f m/s\"%(velocity)\n",
+ "\n",
+ "flow_rate=(3.14/4)*diameter**2*velocity*1000;\n",
+ "print \"flow rate =%f litre/s\"%(flow_rate)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "manometer reading as m of oil = 0.100000 m\n",
+ "maximum_velocityVmax) = 1.400000 m/s\n",
+ "if Re<4000 then v=0.5*Vmax Re = 3312.371134\n",
+ "velocity = 0.700000 m/s\n",
+ "flow rate =5.716998 litre/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.11 page number 372\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the maximum capacity of keroscene\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "flow_rate_steel=1.2; #l/s\n",
+ "density_steel=7.92;\n",
+ "density_kerosene=0.82;\n",
+ "density_water=1;\n",
+ "\n",
+ "# Calculations\n",
+ "flow_rate_kerosene =(((density_steel-density_kerosene)/density_kerosene)/((density_steel-density_water)/density_water))**0.5*flow_rate_steel\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \"maximum_flow rate of kerosene = %f litre/s\"%(flow_rate_kerosene)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum_flow rate of kerosene = 1.342303 litre/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.12 page number 373\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the rate of flow of flue gas\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "# Variables\n",
+ "initial_CO2 = 0.02; #weight fraction\n",
+ "flow_rate_CO2 = 22.5; #gm/s\n",
+ "final_CO2=0.031; #weight fraction\n",
+ "\n",
+ "#flow rate of flue gas =x\n",
+ "#amount of CO2 entering = 0.02*x\n",
+ "#amount of CO2 leaving = 0.02x+0.0225\n",
+ "#amount of gas leaving = x+0.0225\n",
+ "#amount of CO2 leaving = 0.031*(x+0.0225)\n",
+ "\n",
+ "# Calculations\n",
+ "def f(x): \n",
+ "\t return initial_CO2*x+0.0225 - 0.031*(x+0.0225)\n",
+ "\n",
+ "flow_rate_flue_gas=fsolve(f,0)\n",
+ "\n",
+ "# Results\n",
+ "print \"flow rate of flue gas = %f kg/s\"%(flow_rate_flue_gas)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "flow rate of flue gas = 1.982045 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/ch9.ipynb b/Introduction_To_Chemical_Engineering/ch9.ipynb
new file mode 100644
index 00000000..ebdb2cdc
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/ch9.ipynb
@@ -0,0 +1,219 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Computers and their application"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.1 page number 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the pressure drop in the coil\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "D = 38.*10**-3; #in m\n",
+ "U = 1. #in m/s\n",
+ "density = 998. #in kg/cubic m\n",
+ "viscosity = 8.*10**-4 #in Pa-s\n",
+ "DC = 1. #in m\n",
+ "N = 10.\n",
+ "e = 4.*10**-6; #in m\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Re = (density*U*D)/viscosity;\n",
+ "print \"Reynolds number = %f\"%(Re)\n",
+ "\n",
+ "f = (4*math.log10((e/D)/3.7+(6.81/Re)**0.9))**-2;\n",
+ "print \"friction factor = %f\"%(f);\n",
+ "\n",
+ "L = 3.14*DC*N;\n",
+ "\n",
+ "delta_Pstr = (2*f*U*density*L)/D;\n",
+ "print \"pressure drop through straight pipe = %f Pa\"%(delta_Pstr)\n",
+ "\n",
+ "S = 1+3.54*(D/DC);\n",
+ "print \"correction factor = %f\"%(S)\n",
+ "\n",
+ "delta_P = S*delta_Pstr\n",
+ "print \"pressure drop of coil = %f Pa\"%(delta_P)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds number = 47405.000000\n",
+ "friction factor = 0.005330\n",
+ "pressure drop through straight pipe = 8791.184173 Pa\n",
+ "correction factor = 1.134520\n",
+ "pressure drop of coil = 9973.774268 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.2 page number 384\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#to find the shell side pressure drop in heat exchanger\n",
+ "\n",
+ "import math \n",
+ "# Variables\n",
+ "U = 0.5 #in m/s\n",
+ "N = 19.;\n",
+ "DT = 0.026 #in m\n",
+ "L = 2.7 #in m\n",
+ "DS = 0.2 #in m\n",
+ "e = 0.0002 #in m\n",
+ "density = 836. #in kg/cu m\n",
+ "viscosity = 0.00032 #in Pa s\n",
+ "Pr = 6.5;\n",
+ "Prw = 7.6;\n",
+ "\n",
+ "# Calculations and Results\n",
+ "HYDIA = (DS**2-N*DT**2)/(DS+N*DT);\n",
+ "Re = HYDIA*U*density/viscosity;\n",
+ "print \"Reynolds number = %f\"%(Re)\n",
+ "\n",
+ "f = (4*math.log10((e/HYDIA)/3.7+(6.81/Re)**0.9))**-2;\n",
+ "print \"friction factor = %f\"%(f);\n",
+ "\n",
+ "L = 3.14*DT*N;\n",
+ "\n",
+ "delta_Pstr = (2*f*U*density*L)/HYDIA;\n",
+ "print \"pressure drop through straight pipe = %f Pa\"%(delta_Pstr)\n",
+ "\n",
+ "S = (Prw/Pr)**0.33;\n",
+ "print \"correction factor = %f\"%(S)\n",
+ "\n",
+ "delta_P = S*delta_Pstr\n",
+ "print \"pressure drop of coil = %f Pa\"%(delta_P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds number = 51113.148415\n",
+ "friction factor = 0.008158\n",
+ "pressure drop through straight pipe = 270.362537 Pa\n",
+ "correction factor = 1.052948\n",
+ "pressure drop of coil = 284.677794 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.3 page number 385\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "# Variables\n",
+ "MH = 10. #in kg/s\n",
+ "MC = 12.5 #in kg/s\n",
+ "CPH = 4.2 #in kJ/kg\n",
+ "CPC = 4.2 #in kJ/kg\n",
+ "THI = 353. #in K\n",
+ "THO = 333. #in K\n",
+ "TCI = 300. #in K\n",
+ "U = 1.8 #in kW/sq m K\n",
+ "\n",
+ "# Calculations and Results\n",
+ "Q = MH*CPH*(THI-THO);\n",
+ "print \"heat load = %f J\"%(Q)\n",
+ "\n",
+ "TCO = Q/(MC*CPC)+TCI;\n",
+ "print \"cold fluid outlet temperature = %f K\"%(TCO)\n",
+ "\n",
+ "#for co current flow\n",
+ "\n",
+ "DT1 = THI-TCO;\n",
+ "DT2 = THO-TCO;\n",
+ "\n",
+ "LMTD = (DT1-DT2)/math.log(DT1/DT2);\n",
+ "\n",
+ "A = Q/(U*LMTD);\n",
+ "print \"for co current flow area = %f sq m\"%(A);\n",
+ "\n",
+ "#for counter current flow\n",
+ "\n",
+ "DT1 = THI-TCO;\n",
+ "DT2 = THO-TCI;\n",
+ "\n",
+ "LMTD = (DT1-DT2)/math.log(DT1/DT2);\n",
+ "\n",
+ "A = Q/(U*LMTD);\n",
+ "print \"for counter current flow area = %f sq m\"%(A);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "heat load = 840.000000 J\n",
+ "cold fluid outlet temperature = 316.000000 K\n",
+ "for co current flow area = 18.146440 sq m\n",
+ "for counter current flow area = 13.347874 sq m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introduction_To_Chemical_Engineering/screenshots/pic11.png b/Introduction_To_Chemical_Engineering/screenshots/pic11.png
new file mode 100644
index 00000000..25fb271a
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/screenshots/pic11.png
Binary files differ
diff --git a/Introduction_To_Chemical_Engineering/screenshots/pic22.png b/Introduction_To_Chemical_Engineering/screenshots/pic22.png
new file mode 100644
index 00000000..10d2054e
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/screenshots/pic22.png
Binary files differ
diff --git a/Introduction_To_Chemical_Engineering/screenshots/pic33.png b/Introduction_To_Chemical_Engineering/screenshots/pic33.png
new file mode 100644
index 00000000..ccbe0f95
--- /dev/null
+++ b/Introduction_To_Chemical_Engineering/screenshots/pic33.png
Binary files differ
diff --git a/Let_us_C/README.txt b/Let_us_C/README.txt
new file mode 100644
index 00000000..752b7f71
--- /dev/null
+++ b/Let_us_C/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Akshata M
+Course: btech
+College/Institute/Organization: NITK Surathkal
+Department/Designation: Computer Science
+Book Title: Let us C
+Author: Yashavant P. Kanetkar
+Publisher: BPB Publications
+Year of publication: 2008
+Isbn: 8176569402
+Edition: 5th \ No newline at end of file
diff --git a/Let_us_C/chapter-1.ipynb b/Let_us_C/chapter-1.ipynb
new file mode 100644
index 00000000..19d3a98f
--- /dev/null
+++ b/Let_us_C/chapter-1.ipynb
@@ -0,0 +1,221 @@
+{
+ "metadata": {
+ "name": "chapter-1.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 1: Getting Started<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>First C Program, Page number: 14<h3>\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculate simple interest for a set of values representing principle,\n",
+ "number of years and rate of interest.'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "p = 1000 #principle\n",
+ "n = 3 # number of years\n",
+ "r = 8.5 # rate of interest\n",
+ "\n",
+ "#Calculation\n",
+ "si = p * n * r / 100 ; #formula for simple interest\n",
+ "\n",
+ "#Result\n",
+ "print ( si )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "255.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Simple Interest, Page number: 21<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''calculate simple interest by inputing principle,\n",
+ "number of years and rate of interest from the user.'''\n",
+ "\n",
+ "#Input from the user\n",
+ "#p,n,r = raw_input(\"Enter values of p, n, r : \").split()\n",
+ "p = 100 # principle\n",
+ "n = 5 # number of years\n",
+ "r = 15.5 # rate of interest\n",
+ "\n",
+ "#Calculation\n",
+ "si = p * n * r / 100 ; #formula for simple interest\n",
+ "\n",
+ "#Result\n",
+ "print ( si )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "77.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Just for fun, Page number: 22<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Just for fun. Author: Bozo'''\n",
+ "\n",
+ "#Input from the user\n",
+ "#num = raw_input(\"Enter a number : \")\n",
+ "num = 11\n",
+ "\n",
+ "#Result\n",
+ "print \"Now I am letting you on a secret...\" \n",
+ "print \"You have just entered the number\", num \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Now I am letting you on a secret...\n",
+ "You have just entered the number 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.1, Page number: 32<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine the hierarchy of operations and evaluate the following expression:\n",
+ "i = 2 * 3 / 4 + 4 / 4 + 8 - 2 + 5 / 8'''\n",
+ "\n",
+ "#Calculation\n",
+ "i1 = 2 * 3 # operation *\n",
+ "i2 = i1 / 4 # operation /\n",
+ "i3 = 4 / 4 # operation /\n",
+ "i4 = 5 / 8 # operation /\n",
+ "i5 = i2 + i3 # operation +\n",
+ "i6 = i5 + 8 # operation +\n",
+ "i7 = i6 - 2 # operation -\n",
+ "i8 = i7 + i4 # operation +\n",
+ "i = i8\n",
+ "\n",
+ "#Result\n",
+ "print \"i = \", i"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.2, Page number: 33<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine the hierarchy of operations and evaluate the following expression:\n",
+ "kk = 3 / 2 * 4 + 3 / 8 + 3'''\n",
+ "\n",
+ "#Calculation\n",
+ "kk1 = 3 / 2# operation /\n",
+ "kk2 = kk1 * 4 # operation *\n",
+ "kk3 = 3 / 8 # operation /\n",
+ "kk4 = kk2 + kk3 # operation +\n",
+ "kk5 = kk4 + 3 # operation +\n",
+ "kk = kk5\n",
+ "\n",
+ "#Result\n",
+ "print \"kk = \", kk\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "kk = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-10.ipynb b/Let_us_C/chapter-10.ipynb
new file mode 100644
index 00000000..db8bf067
--- /dev/null
+++ b/Let_us_C/chapter-10.ipynb
@@ -0,0 +1,499 @@
+{
+ "metadata": {
+ "name": "chapter-10.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 10: Structures <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Arrays , Page number: 365<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to store data about 3 books that is their name\n",
+ "(a string), price (a float) and number of pages (an int).'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "name = []\n",
+ "price = []\n",
+ "pages = []\n",
+ "\n",
+ "n =[\"A\",\"C\",\"F\"]\n",
+ "p=[100.00,256.50,233.70]\n",
+ "pg=[354,682,512]\n",
+ "\n",
+ "print \"Enter names, prices and no. of pages of 3 books \" \n",
+ "\n",
+ "for i in range(0,3):\n",
+ " #n,p,pg = raw_input(\"\").split()\n",
+ " print n[i],p[i],pg[i]\n",
+ " name.append(n[i])\n",
+ " price.append(p[i])\n",
+ " pages.append(pg[i])\n",
+ "\n",
+ "print \"And this is what you entered\" \n",
+ "\n",
+ "for i in range(0,3):\n",
+ " print name[i], price[i], pages[i] "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter names, prices and no. of pages of 3 books \n",
+ "A 100.0 354\n",
+ "C 256.5 682\n",
+ "F 233.7 512\n",
+ "And this is what you entered\n",
+ "A 100.0 354\n",
+ "C 256.5 682\n",
+ "F 233.7 512\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Structure Example , Page number: 366<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to store data about 3 books that is their name\n",
+ "(a string), price (a float) and number of pages (an int).'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_book = namedtuple(\"struct_book\", \"name price pages\")\n",
+ "\n",
+ "#Input from user\n",
+ "print \"Enter names, prices & no. of pages of 3 books\" \n",
+ "#b1n,b1p,b1pg = raw_input(\"\").split()\n",
+ "#b2n,b2p,b2pg = raw_input(\"\").split()\n",
+ "#b3n,b3p,b3pg = raw_input(\"\").split()\n",
+ "n =[\"A\",\"C\",\"F\"]\n",
+ "p=[100.00,256.50,233.70]\n",
+ "pg=[354,682,512]\n",
+ "print n[0],p[0],pg[0]\n",
+ "print n[1],p[1],pg[1]\n",
+ "print n[2],p[2],pg[2]\n",
+ "#Structures for 3 books\n",
+ "b1 = struct_book(n[0], p[0], pg[0])\n",
+ "b2 = struct_book(n[1], p[1], pg[1])\n",
+ "b3 = struct_book(n[2], p[2], pg[2])\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"And this is what you entered\" \n",
+ "print b1.name, b1.price, b1.pages \n",
+ "print b2.name, b2.price, b2.pages \n",
+ "print b3.name, b3.price, b3.pages \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter names, prices & no. of pages of 3 books\n",
+ "A 100.0 354\n",
+ "C 256.5 682\n",
+ "F 233.7 512\n",
+ "And this is what you entered\n",
+ "A 100.0 354\n",
+ "C 256.5 682\n",
+ "F 233.7 512\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Memory Map of Structures , Page number: 370<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate that elements of a structure,\n",
+ "are always stored in contiguous memory locations'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_book = namedtuple(\"struct_book\", \"name price pages\")\n",
+ "\n",
+ "#Structures for a book\n",
+ "b1 = struct_book('B', 130.00, 550)\n",
+ "\n",
+ "#Result\n",
+ "print \"Address of name = \", id(b1.name )\n",
+ "print \"Address of price = \", id(b1.price )\n",
+ "print \"Address of pages = \", id(b1.pages )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of name = 31603728\n",
+ "Address of price = 108997488\n",
+ "Address of pages = 133808864\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Array of Structures , Page number: 371<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to show how to use an array of structures.'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_book = namedtuple(\"struct_book\", \"name price pages\")\n",
+ "\n",
+ "#Array of structures\n",
+ "b =[]\n",
+ "\n",
+ "n =[\"A\",\"C\",\"F\"]\n",
+ "p=[100.00,256.50,233.70]\n",
+ "pg=[354,682,512]\n",
+ "\n",
+ "#Storing data in the array\n",
+ "for i in range(0,3):\n",
+ " #bn, bp, bpg =raw_input( \"Enter name, price and pages: \" ).split()\n",
+ " print \"Enter name, price and pages: \"\n",
+ " print n[i],p[i],pg[i]\n",
+ " b.append(struct_book(n[i], p[i], pg[i]))\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,3):\n",
+ " print b[i].name, b[i].price, b[i].pages \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name, price and pages: \n",
+ "A 100.0 354\n",
+ "Enter name, price and pages: \n",
+ "C 256.5 682\n",
+ "Enter name, price and pages: \n",
+ "F 233.7 512\n",
+ "A 100.0 354\n",
+ "C 256.5 682\n",
+ "F 233.7 512\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Copying Structures , Page number: 374<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate that values of a structure variable can be\n",
+ "assigned to another structure variable of the same type\n",
+ "using the assignment operator.'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_employee = namedtuple(\"struct_employee\", \"name age salary\")\n",
+ "\n",
+ "#Structures for 3 employees\n",
+ "e1 = struct_employee(\"Sanjay\", 30, 5500.50)\n",
+ "e2 = struct_employee(\" \",0,0)\n",
+ "e3 = struct_employee(\" \",0,0)\n",
+ "\n",
+ "#piece-meal copying \n",
+ "import copy\n",
+ "e2 = e2._replace(name = e1.name)\n",
+ "e2 = e2._replace(age = e1.age)\n",
+ "e2 = e2._replace(salary = e1.salary)\n",
+ "\n",
+ "\n",
+ "#copying all elements at one go \n",
+ "e3 = e2\n",
+ "\n",
+ "#Result\n",
+ "print e1.name, e1.age, e1.salary \n",
+ "print e2.name, e2.age, e2.salary \n",
+ "print e3.name, e3.age, e3.salary \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sanjay 30 5500.5\n",
+ "Sanjay 30 5500.5\n",
+ "Sanjay 30 5500.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Nested Structures , Page number: 375<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate nested structures at work.'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintions\n",
+ "struct_address = namedtuple(\"struct_address\", \"phone city pin\")\n",
+ "struct_emp = namedtuple(\"struct_emp\", \"name struct_address\") #nested structures\n",
+ "\n",
+ "#Structures for employee\n",
+ "a = struct_address(\"531046\", \"nagpur\", 10)\n",
+ "e = struct_emp(\"jeru\",a) #nested structure\n",
+ "\n",
+ "#Result\n",
+ "print \"name = %s phone = %s\" %( e.name, e.struct_address.phone )\n",
+ "print \"city = %s pin = %d\" %( e.struct_address.city, e.struct_address.pin )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name = jeru phone = 531046\n",
+ "city = nagpur pin = 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Passing Individual Structure Elements to Functions, Page number: 377<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the method of passing individual structure elements to\n",
+ "functions'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintions\n",
+ "struct_book = namedtuple(\"struct_book\", \"name author callno\")\n",
+ "\n",
+ "#Function definition\n",
+ "def display (s,t,n):\n",
+ " print s, t, n \n",
+ " \n",
+ "#Structures for book\n",
+ "b1 = struct_book(\"Let us C\", \"YPK\", 101)\n",
+ "\n",
+ "\n",
+ "display ( b1.name, b1.author, b1.callno ) #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Passing Structure to a Function , Page number: 378<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the method of passing \n",
+ "the entire structure variable to a function'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintions\n",
+ "struct_book = namedtuple(\"struct_book\", \"name author callno\")\n",
+ "\n",
+ "#Function definition\n",
+ "def display (b):\n",
+ " print b.name, b.author, b.callno \n",
+ " \n",
+ "#Structures for book\n",
+ "b1 = struct_book(\"Let us C\", \"YPK\", 101)\n",
+ "\n",
+ "\n",
+ "display ( b1) #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Structure Pointers , Page number: 379<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that demonstrates the usage of a structure pointer.'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintions\n",
+ "struct_book = namedtuple(\"struct_book\", \"name author callno\")\n",
+ "\n",
+ "#Structure for book\n",
+ "b1 = struct_book(\"Let us C\", \"YPK\", 101)\n",
+ "ptr = id(b1) #structure pointer\n",
+ "\n",
+ "#Result\n",
+ "print b1.name, b1.author, b1.callno \n",
+ "print b1.name, b1.author, b1.callno \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n",
+ "Let us C YPK 101\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Passing Address of a Structure Variable , Page number: 380<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that demonstrates passing address of a structure variable'''\n",
+ "\n",
+ "#function definition\n",
+ "def display (b):\n",
+ " print b.name, b.author, b.callno \n",
+ " \n",
+ "from collections import namedtuple\n",
+ "#Structure defintions\n",
+ "struct_book = namedtuple(\"struct_book\", \"name author callno\")\n",
+ "\n",
+ "#Structure for book\n",
+ "b1 = struct_book(\"Let us C\", \"YPK\", 101)\n",
+ "\n",
+ "#function call\n",
+ "display ( b1 ) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let us C YPK 101\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-11.ipynb b/Let_us_C/chapter-11.ipynb
new file mode 100644
index 00000000..4f966f44
--- /dev/null
+++ b/Let_us_C/chapter-11.ipynb
@@ -0,0 +1,383 @@
+{
+ "metadata": {
+ "name": "chapter-11.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 11: Console Input/Output<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Printf Example, Page number: 397<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate printing a formatted string using printf function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "avg = 346 \n",
+ "per = 69.2\n",
+ "\n",
+ "#Result\n",
+ "print \"Average = %d\\nPercentage = %f\" %(avg, per )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average = 346\n",
+ "Percentage = 69.200000\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Format Specifications, Page number: 399<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate printing using format specifiers in printf function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "weight = 63\n",
+ "\n",
+ "#Result\n",
+ "print \"weight is %d kg\" %( weight ) \n",
+ "print \"weight is %2d kg\"%( weight ) \n",
+ "print \"weight is %4d kg\" %( weight )\n",
+ "print \"weight is %6d kg\" %(weight ) \n",
+ "print \"weight is %-6d kg\" %( weight )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "weight is 63 kg\n",
+ "weight is 63 kg\n",
+ "weight is 63 kg\n",
+ "weight is 63 kg\n",
+ "weight is 63 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>String Format Specifiers, Page number: 400<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate printing using format specifiers in printf function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "firstname1 = \"Sandy\" \n",
+ "surname1 = \"Malya\" \n",
+ "firstname2 = \"AjayKumar\" \n",
+ "surname2 = \"Gurubaxani\" \n",
+ "\n",
+ "#Result\n",
+ "print \"%20s%20s\" %( firstname1, surname1 )\n",
+ "print \"%20s%20s\" %(firstname2, surname2 ) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sandy Malya\n",
+ " AjayKumar Gurubaxani\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Escape Sequences, Page number: 401<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrateshows usage of \\n and a\n",
+ "new escape sequence \\t, called \u2018tab\u2019'''\n",
+ "\n",
+ "#Result\n",
+ "print \"You\\tmust\\tbe\\tcrazy\\nto\\thate\\tthis\\tbook\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "You\tmust\tbe\tcrazy\n",
+ "to\thate\tthis\tbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Format Conversions, Page number: 403<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to perform the specified conversion using printf function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "ch = 'z' \n",
+ "i = 125 \n",
+ "a = 12.55 \n",
+ "s = \"hello there !\"\n",
+ "\n",
+ "#Result\n",
+ "print \"%c %d %f\" %( ch, ord(ch), ord(ch )) \n",
+ "print \"%s %d %f\"%( s, ord(s[1]), ord(s[1]) )\n",
+ "print \"%c %d %f\"%(i ,i, i ) \n",
+ "print \"%f %d\\n\"%( a, a )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z 122 122.000000\n",
+ "hello there ! 101 101.000000\n",
+ "} 125 125.000000\n",
+ "12.550000 12\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Sprintf Function, Page number: 404<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the usage of sprintf function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 10 \n",
+ "ch = 'A'\n",
+ "a = 3.14 \n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"%d %c %f\" %(i, ch, a ) \n",
+ "str = \"%d %c %f\" %(i, ch, a ) #sprintf\n",
+ "print \"%s\" %(str )\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10 A 3.140000\n",
+ "10 A 3.140000\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Unformatted Input, Page number: 406<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the usage of unformatted input functions'''\n",
+ "\n",
+ "import msvcrt\n",
+ "\n",
+ "print \"Press any key to continue\" \n",
+ "#msvcrt.getch( ) # will not echo the character \n",
+ "print \"Type any character\" \n",
+ "#ch = msvcrt.getche( ) # will echo the character typed \n",
+ "ch = 'A'\n",
+ "print ch\n",
+ "#ch = input(\"Type any character\")#getchar( ) will echo character, must be followed by enter key \n",
+ "print \"Type any character\"\n",
+ "ch = 8\n",
+ "print ch\n",
+ "#ch = input( \"Continue Y/N\" ) #fgetchar( ) will echo character, must be followed by enter key\n",
+ "print \"Continue Y/N\" \n",
+ "ch = 'N'\n",
+ "print ch\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Press any key to continue\n",
+ "Type any character\n",
+ "A\n",
+ "Type any character\n",
+ "8\n",
+ "Continue Y/N\n",
+ "N\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Unformatted Output, Page number: 407<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the usage of unformatted output functions'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "ch = 'A'\n",
+ "\n",
+ "#Result\n",
+ "print ch #putch\n",
+ "print ch #putchar\n",
+ "print ch #fputchar\n",
+ "print 'Z' #putch\n",
+ "print 'Z' #putchar\n",
+ "print 'Z' #fputchar\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A\n",
+ "A\n",
+ "A\n",
+ "Z\n",
+ "Z\n",
+ "Z\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Unformatted String Input/Output, Page number: 408<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the usage of gets and puts functions'''\n",
+ "\n",
+ "#Input from user\n",
+ "#footballer = input(\"Enter name\" ) # puts(\"Enter name \") ; gets(footballer)\n",
+ "print \"Enter name\"\n",
+ "footballer = \"Jonty Rhodes\"\n",
+ "print footballer\n",
+ "\n",
+ "#Result\n",
+ "print \"Happy footballing!\" \n",
+ "print footballer "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name\n",
+ "Jonty Rhodes\n",
+ "Happy footballing!\n",
+ "Jonty Rhodes\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-12.ipynb b/Let_us_C/chapter-12.ipynb
new file mode 100644
index 00000000..f0567d09
--- /dev/null
+++ b/Let_us_C/chapter-12.ipynb
@@ -0,0 +1,2351 @@
+{
+ "metadata": {
+ "name": "chapter-12.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 12: File Input/Output <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Display Contents of a File , Page number: 417<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to display contents of a file on screen.'''\n",
+ "\n",
+ "fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
+ "while ( 1 ):\n",
+ " ch = fp.read(1)\n",
+ " if not ch :\n",
+ " break\n",
+ " print ch\n",
+ "\n",
+ "fp.close() #close file\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M\n",
+ "e\n",
+ "t\n",
+ "h\n",
+ "o\n",
+ "d\n",
+ "\n",
+ "\n",
+ "T\n",
+ "h\n",
+ "r\n",
+ "o\n",
+ "u\n",
+ "g\n",
+ "h\n",
+ "l\n",
+ "y\n",
+ " \n",
+ "w\n",
+ "a\n",
+ "s\n",
+ " \n",
+ "b\n",
+ "o\n",
+ "t\n",
+ "h\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "r\n",
+ "e\n",
+ "m\n",
+ "o\n",
+ "v\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "m\n",
+ "u\n",
+ "d\n",
+ " \n",
+ "o\n",
+ "n\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "h\n",
+ "a\n",
+ "i\n",
+ "r\n",
+ " \n",
+ "o\n",
+ "n\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ "\n",
+ "\n",
+ "P\n",
+ "e\n",
+ "e\n",
+ "l\n",
+ " \n",
+ "o\n",
+ "f\n",
+ "f\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "s\n",
+ "k\n",
+ "i\n",
+ "n\n",
+ ".\n",
+ " \n",
+ "d\n",
+ "o\n",
+ " \n",
+ "n\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "p\n",
+ "e\n",
+ "e\n",
+ "l\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "r\n",
+ "a\n",
+ "d\n",
+ "d\n",
+ "i\n",
+ "s\n",
+ "h\n",
+ " \n",
+ "s\n",
+ "k\n",
+ "i\n",
+ "n\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "a\n",
+ "v\n",
+ "o\n",
+ "i\n",
+ "d\n",
+ " \n",
+ "p\n",
+ "o\n",
+ "s\n",
+ "s\n",
+ "i\n",
+ "b\n",
+ "l\n",
+ "e\n",
+ " \n",
+ "l\n",
+ "o\n",
+ "s\n",
+ "s\n",
+ " \n",
+ "o\n",
+ "f\n",
+ " \n",
+ "v\n",
+ "i\n",
+ "t\n",
+ "a\n",
+ "m\n",
+ "i\n",
+ "n\n",
+ "s\n",
+ "\n",
+ "\n",
+ "C\n",
+ "u\n",
+ "t\n",
+ " \n",
+ "e\n",
+ "a\n",
+ "c\n",
+ "h\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "i\n",
+ "n\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "4\n",
+ " \n",
+ "h\n",
+ "a\n",
+ "l\n",
+ "v\n",
+ "e\n",
+ "s\n",
+ "\n",
+ "\n",
+ "P\n",
+ "r\n",
+ "e\n",
+ "a\n",
+ "s\n",
+ "s\n",
+ "u\n",
+ "r\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "k\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ ".\n",
+ " \n",
+ "m\n",
+ "a\n",
+ "k\n",
+ "e\n",
+ " \n",
+ "3\n",
+ " \n",
+ "w\n",
+ "h\n",
+ "i\n",
+ "s\n",
+ "t\n",
+ "l\n",
+ "e\n",
+ "s\n",
+ " \n",
+ "s\n",
+ "o\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ "t\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ "y\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "c\n",
+ "o\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "v\n",
+ "e\n",
+ "r\n",
+ "y\n",
+ " \n",
+ "s\n",
+ "m\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ "h\n",
+ "\n",
+ "\n",
+ "D\n",
+ "r\n",
+ "a\n",
+ "i\n",
+ "n\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "r\n",
+ "e\n",
+ "s\n",
+ "e\n",
+ "r\n",
+ "v\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "w\n",
+ "a\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "a\n",
+ "f\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "p\n",
+ "r\n",
+ "e\n",
+ "s\n",
+ "s\n",
+ "u\n",
+ "r\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "k\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ ".\n",
+ "\n",
+ "\n",
+ "M\n",
+ "a\n",
+ "s\n",
+ "h\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "k\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "p\n",
+ "i\n",
+ "e\n",
+ "c\n",
+ "e\n",
+ "s\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "l\n",
+ "l\n",
+ "o\n",
+ "w\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "l\n",
+ "\n",
+ "\n",
+ "C\n",
+ "u\n",
+ "t\n",
+ " \n",
+ "o\n",
+ "n\n",
+ "i\n",
+ "o\n",
+ "n\n",
+ "s\n",
+ " \n",
+ "i\n",
+ "n\n",
+ "t\n",
+ "o\n",
+ " \n",
+ "c\n",
+ "u\n",
+ "b\n",
+ "e\n",
+ "s\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "a\n",
+ "u\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "i\n",
+ "l\n",
+ "l\n",
+ " \n",
+ "g\n",
+ "o\n",
+ "l\n",
+ "d\n",
+ "e\n",
+ "n\n",
+ " \n",
+ "b\n",
+ "r\n",
+ "o\n",
+ "w\n",
+ "n\n",
+ " \n",
+ "o\n",
+ "n\n",
+ " \n",
+ "o\n",
+ "i\n",
+ "l\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "l\n",
+ "l\n",
+ "o\n",
+ "w\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "l\n",
+ "\n",
+ "\n",
+ "A\n",
+ "f\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "l\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ " \n",
+ "g\n",
+ "r\n",
+ "i\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "m\n",
+ "a\n",
+ "s\n",
+ "h\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ ",\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "a\n",
+ "u\n",
+ "t\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "o\n",
+ "n\n",
+ "i\n",
+ "o\n",
+ "n\n",
+ "s\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "i\n",
+ "n\n",
+ " \n",
+ "a\n",
+ " \n",
+ "m\n",
+ "i\n",
+ "x\n",
+ "y\n",
+ ".\n",
+ " \n",
+ "a\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "e\n",
+ "n\n",
+ "o\n",
+ "u\n",
+ "g\n",
+ "h\n",
+ " \n",
+ "w\n",
+ "a\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "m\n",
+ "a\n",
+ "k\n",
+ "e\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "n\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "v\n",
+ "e\n",
+ "r\n",
+ "y\n",
+ " \n",
+ "f\n",
+ "i\n",
+ "n\n",
+ "e\n",
+ ".\n",
+ "\n",
+ "\n",
+ "N\n",
+ "o\n",
+ "w\n",
+ " \n",
+ "s\n",
+ "t\n",
+ "r\n",
+ "a\n",
+ "i\n",
+ "n\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "g\n",
+ "r\n",
+ "i\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ ".\n",
+ "\n",
+ "\n",
+ "T\n",
+ "a\n",
+ "k\n",
+ "e\n",
+ " \n",
+ "s\n",
+ "o\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "b\n",
+ "u\n",
+ "t\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "i\n",
+ "n\n",
+ " \n",
+ "a\n",
+ " \n",
+ "v\n",
+ "e\n",
+ "s\n",
+ "s\n",
+ "e\n",
+ "l\n",
+ " \n",
+ "a\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "g\n",
+ "a\n",
+ "r\n",
+ "l\n",
+ "i\n",
+ "c\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ ",\n",
+ "g\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ "e\n",
+ "r\n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "g\n",
+ "r\n",
+ "e\n",
+ "e\n",
+ "n\n",
+ " \n",
+ "c\n",
+ "h\n",
+ "i\n",
+ "l\n",
+ "l\n",
+ "i\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "a\n",
+ "u\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "f\n",
+ "o\n",
+ "r\n",
+ " \n",
+ "s\n",
+ "o\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "i\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "i\n",
+ "l\n",
+ "l\n",
+ " \n",
+ "u\n",
+ " \n",
+ "g\n",
+ "e\n",
+ "t\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "s\n",
+ "p\n",
+ "e\n",
+ "c\n",
+ "i\n",
+ "f\n",
+ "i\n",
+ "c\n",
+ " \n",
+ "g\n",
+ "a\n",
+ "r\n",
+ "l\n",
+ "i\n",
+ "c\n",
+ "-\n",
+ "b\n",
+ "e\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ "-\n",
+ "f\n",
+ "r\n",
+ "i\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "m\n",
+ "e\n",
+ "l\n",
+ "l\n",
+ "\n",
+ "\n",
+ "A\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "m\n",
+ "o\n",
+ "o\n",
+ "n\n",
+ "g\n",
+ " \n",
+ "s\n",
+ "p\n",
+ "r\n",
+ "o\n",
+ "u\n",
+ "t\n",
+ "s\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "a\n",
+ "u\n",
+ "t\n",
+ "e\n",
+ ",\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "v\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "w\n",
+ "i\n",
+ "t\n",
+ "h\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "l\n",
+ "i\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "l\n",
+ "e\n",
+ "t\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "k\n",
+ " \n",
+ "f\n",
+ "o\n",
+ "r\n",
+ " \n",
+ "5\n",
+ " \n",
+ "m\n",
+ "i\n",
+ "n\n",
+ "s\n",
+ "\n",
+ "\n",
+ "N\n",
+ "o\n",
+ "w\n",
+ " \n",
+ "a\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "s\n",
+ "t\n",
+ "r\n",
+ "a\n",
+ "i\n",
+ "n\n",
+ " \n",
+ "o\n",
+ "f\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ ",\n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "o\n",
+ "n\n",
+ "i\n",
+ "o\n",
+ "n\n",
+ "s\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ "\n",
+ "\n",
+ "A\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "6\n",
+ " \n",
+ "c\n",
+ "u\n",
+ "p\n",
+ "s\n",
+ " \n",
+ "o\n",
+ "f\n",
+ " \n",
+ "w\n",
+ "a\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "i\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "l\n",
+ "s\n",
+ "o\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "w\n",
+ "a\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "r\n",
+ "e\n",
+ "s\n",
+ "e\n",
+ "r\n",
+ "v\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "t\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "i\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "o\n",
+ "f\n",
+ " \n",
+ "p\n",
+ "r\n",
+ "e\n",
+ "s\n",
+ "s\n",
+ "u\n",
+ "r\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "k\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "b\n",
+ "e\n",
+ "e\n",
+ "t\n",
+ "r\n",
+ "o\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "c\n",
+ "a\n",
+ "r\n",
+ "r\n",
+ "o\n",
+ "t\n",
+ ".\n",
+ "\n",
+ "\n",
+ "A\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "a\n",
+ "l\n",
+ "t\n",
+ ",\n",
+ " \n",
+ "c\n",
+ "i\n",
+ "n\n",
+ "n\n",
+ "a\n",
+ "m\n",
+ "o\n",
+ "n\n",
+ ",\n",
+ " \n",
+ "c\n",
+ "u\n",
+ "m\n",
+ "m\n",
+ "i\n",
+ "n\n",
+ ",\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "r\n",
+ "i\n",
+ "a\n",
+ "n\n",
+ "d\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "p\n",
+ "o\n",
+ "w\n",
+ "d\n",
+ "e\n",
+ "r\n",
+ ",\n",
+ "l\n",
+ "e\n",
+ "m\n",
+ "o\n",
+ "n\n",
+ " \n",
+ "j\n",
+ "u\n",
+ "i\n",
+ "c\n",
+ "e\n",
+ "\n",
+ "\n",
+ "B\n",
+ "r\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "a\n",
+ " \n",
+ "b\n",
+ "o\n",
+ "i\n",
+ "l\n",
+ ",\n",
+ " \n",
+ "l\n",
+ "e\n",
+ "t\n",
+ " \n",
+ "s\n",
+ "i\n",
+ "m\n",
+ "m\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "f\n",
+ "o\n",
+ "r\n",
+ " \n",
+ "a\n",
+ " \n",
+ "f\n",
+ "e\n",
+ "w\n",
+ " \n",
+ "m\n",
+ "i\n",
+ "n\n",
+ "s\n",
+ "\n",
+ "\n",
+ "M\n",
+ "a\n",
+ "k\n",
+ "e\n",
+ " \n",
+ "a\n",
+ " \n",
+ "f\n",
+ "i\n",
+ "n\n",
+ "e\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "o\n",
+ "f\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "r\n",
+ "n\n",
+ "f\n",
+ "l\n",
+ "o\n",
+ "u\n",
+ "r\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "i\n",
+ "t\n",
+ " \n",
+ "w\n",
+ "h\n",
+ "i\n",
+ "l\n",
+ "e\n",
+ " \n",
+ "s\n",
+ "t\n",
+ "i\n",
+ "r\n",
+ "r\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "a\n",
+ "v\n",
+ "o\n",
+ "i\n",
+ "d\n",
+ " \n",
+ "l\n",
+ "u\n",
+ "m\n",
+ "p\n",
+ "s\n",
+ "\n",
+ "\n",
+ "T\n",
+ "i\n",
+ "l\n",
+ " \n",
+ "f\n",
+ "o\n",
+ "r\n",
+ " \n",
+ "s\n",
+ "o\n",
+ "m\n",
+ "e\n",
+ "m\n",
+ "o\n",
+ "r\n",
+ "e\n",
+ " \n",
+ "t\n",
+ "i\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "s\n",
+ "o\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "a\n",
+ "t\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "r\n",
+ "n\n",
+ "f\n",
+ "l\n",
+ "o\n",
+ "u\n",
+ "r\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "s\n",
+ "t\n",
+ "e\n",
+ " \n",
+ "i\n",
+ "s\n",
+ " \n",
+ "c\n",
+ "o\n",
+ "o\n",
+ "k\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "m\n",
+ "i\n",
+ "x\n",
+ "e\n",
+ "d\n",
+ " \n",
+ "w\n",
+ "e\n",
+ "l\n",
+ "l\n",
+ "\n",
+ "\n",
+ "T\n",
+ "a\n",
+ "k\n",
+ "e\n",
+ " \n",
+ "o\n",
+ "i\n",
+ "l\n",
+ " \n",
+ "i\n",
+ "n\n",
+ " \n",
+ "a\n",
+ " \n",
+ "k\n",
+ "a\n",
+ "d\n",
+ "h\n",
+ "a\n",
+ "i\n",
+ " \n",
+ "t\n",
+ "o\n",
+ " \n",
+ "f\n",
+ "r\n",
+ "y\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "n\n",
+ "o\n",
+ "o\n",
+ "d\n",
+ "l\n",
+ "e\n",
+ "s\n",
+ ".\n",
+ "f\n",
+ "r\n",
+ "y\n",
+ " \n",
+ "t\n",
+ "i"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "l\n",
+ "l\n",
+ " \n",
+ "g\n",
+ "o\n",
+ "l\n",
+ "d\n",
+ "e\n",
+ "n\n",
+ " \n",
+ "b\n",
+ "r\n",
+ "o\n",
+ "w\n",
+ "n\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "r\n",
+ "e\n",
+ "s\n",
+ "e\n",
+ "r\n",
+ "v\n",
+ "e\n",
+ " \n",
+ "o\n",
+ "n\n",
+ " \n",
+ "a\n",
+ " \n",
+ "t\n",
+ "i\n",
+ "s\n",
+ "s\n",
+ "u\n",
+ "e\n",
+ " \n",
+ "p\n",
+ "a\n",
+ "p\n",
+ "e\n",
+ "r\n",
+ "\n",
+ "\n",
+ "C\n",
+ "r\n",
+ "u\n",
+ "s\n",
+ "h\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "n\n",
+ "o\n",
+ "o\n",
+ "d\n",
+ "l\n",
+ "e\n",
+ "s\n",
+ " \n",
+ "n\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "t\n",
+ "o\n",
+ "o\n",
+ " \n",
+ "m\n",
+ "u\n",
+ "c\n",
+ "h\n",
+ "\n",
+ "\n",
+ "S\n",
+ "e\n",
+ "r\n",
+ "v\n",
+ "e\n",
+ " \n",
+ "s\n",
+ "t\n",
+ "e\n",
+ "a\n",
+ "m\n",
+ "i\n",
+ "n\n",
+ "g\n",
+ " \n",
+ "h\n",
+ "o\n",
+ "t\n",
+ " \n",
+ "i\n",
+ "n\n",
+ " \n",
+ "s\n",
+ "o\n",
+ "u\n",
+ "p\n",
+ " \n",
+ "b\n",
+ "o\n",
+ "w\n",
+ "l\n",
+ "s\n",
+ " \n",
+ "a\n",
+ "d\n",
+ "d\n",
+ " \n",
+ "s\n",
+ "o\n",
+ "m\n",
+ "e\n",
+ " \n",
+ "b\n",
+ "u\n",
+ "t\n",
+ "t\n",
+ "e\n",
+ "r\n",
+ " \n",
+ "a\n",
+ "n\n",
+ "d\n",
+ " \n",
+ "t\n",
+ "o\n",
+ "p\n",
+ " \n",
+ "w\n",
+ "i\n",
+ "t\n",
+ "h\n",
+ " \n",
+ "t\n",
+ "h\n",
+ "e\n",
+ " \n",
+ "c\n",
+ "r\n",
+ "i\n",
+ "s\n",
+ "p\n",
+ "y\n",
+ " \n",
+ "n\n",
+ "o\n",
+ "o\n",
+ "d\n",
+ "l\n",
+ "e\n",
+ "s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Opening a File , Page number: 421<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to check whether a file has been opened successfully before\n",
+ "trying to read or write to the file'''\n",
+ "\n",
+ "try :\n",
+ " fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" )#open file in read mode and check if file is opened successfully\n",
+ "except:\n",
+ " print \"cannot open file\" \n",
+ " exit()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cannot open file\n"
+ ]
+ }
+ ],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Counting Characters,Tabs,Spaces and Newlines , Page number: 423<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to count chars, spaces, tabs and newlines in a file.'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "nol = 0\n",
+ "Not = 0\n",
+ "nob = 0\n",
+ "noc = 0\n",
+ "\n",
+ "fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
+ "while ( 1 ):\n",
+ " ch = fp.read(1)\n",
+ " if not ch :\n",
+ " break\n",
+ " noc = noc + 1 #number of chars\n",
+ " if ( ch == \" \" ):\n",
+ " nob = nob + 1 #number of spaces\n",
+ " if ( ch == \"\\n\" ):\n",
+ " nol = nol + 1 # number of newlines\n",
+ " if ( ch == \"\\t\" ):\n",
+ " Not = Not + 1 #number of tabs\n",
+ "\n",
+ "fp.close() #close file\n",
+ "\n",
+ "#Result\n",
+ "print \"Number of characters = \", noc \n",
+ "print \"Number of blanks = \", nob \n",
+ "print \"Number of tabs = \", Not \n",
+ "print \"Number of lines = \", nol \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of characters = 1495\n",
+ "Number of blanks = 254\n",
+ "Number of tabs = 0\n",
+ "Number of lines = 20\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>File Copy , Page number: 424<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to take the contents of a file and\n",
+ "copy them into another file, character by character.'''\n",
+ "\n",
+ "fs = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
+ "if(not fs):\n",
+ " print \"Cannot open source file\"\n",
+ " exit()\n",
+ "\n",
+ "ft = open ( \"C:/Users/Akshatha M/Desktop/temp.txt\", \"w\" ) #open file in write mode\n",
+ "if(not ft):\n",
+ " print \"Cannot open target file\"\n",
+ " fs.close() \n",
+ " exit()\n",
+ " \n",
+ "while ( 1 ):\n",
+ " ch = fs.read(1)\n",
+ " if not ch :\n",
+ " break\n",
+ " else:\n",
+ " ft.writelines(ch) #write into target file\n",
+ "\n",
+ "#closen files\n",
+ "fs.close()\n",
+ "ft.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Writing Strings to Files, Page number: 427<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to receive strings from keyboard and write them to file'''\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha M/Desktop/temp.txt\", \"w\" ) #open file in write mode\n",
+ "if(not fp):\n",
+ " print \"Cannot open target file\" \n",
+ " exit()\n",
+ "\n",
+ "print \"Enter a few lines of text:\" \n",
+ "#s=input(\"\") #Input strings from keyboard\n",
+ "s = \"File written\"\n",
+ "print s\n",
+ "while ( len(s) > 0 ):\n",
+ " fp.writelines(s) #write into file\n",
+ " fp.writelines(\"\\n\")\n",
+ " #s=input(\"\") #Input strings from keyboard\n",
+ " s=\"\"\n",
+ " \n",
+ "#close files\n",
+ "fp.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a few lines of text:\n",
+ "File written\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Reading Strings from Files , Page number: 429<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to reads strings from the file and displays them on screen.'''\n",
+ "\n",
+ "fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
+ "if ( not fp ):\n",
+ " print \"Cannot open file\" \n",
+ " exit( ) \n",
+ "\n",
+ "while ( 1 ) :#Read strings from file\n",
+ " s = fp.read(79)\n",
+ " if(s):\n",
+ " print s\n",
+ " else:\n",
+ " break\n",
+ " \n",
+ "\n",
+ "fp.close() #close file\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Method\n",
+ "Throughly was both beetroot and carrot to remove the mud on beetroot and\n",
+ " the hair on carrot\n",
+ "Peel off the carrot skin. do not peel the raddish skin to a\n",
+ "void possible loss of vitamins\n",
+ "Cut each beetroot and carrot in to 4 halves\n",
+ "Prea\n",
+ "ssure cook the beetroot and carrot. make 3 whistles so thet they become very sm\n",
+ "ooth\n",
+ "Drain and reserve the water after pressure cooking.\n",
+ "Mash the cooked pieces\n",
+ " and allow to cool\n",
+ "Cut onions into cubes and saute till golden brown on oil and\n",
+ " allow to cool\n",
+ "After cooling grind the mashed beetroot, carrot and sauted onion\n",
+ "s to paste in a mixy. add enough water to make paste not very fine.\n",
+ "Now strain \n",
+ "the grind paste.\n",
+ "Take some butter in a vessel add the garlic paste,gingerpaste \n",
+ "and green chilli paste and saute for some time till u get the specific garlic-b\n",
+ "eing-fried smell\n",
+ "Add moong sprouts and saute, cover with the lid and let cook f\n",
+ "or 5 mins\n",
+ "Now add the strain of beetroot,carrot and onions paste\n",
+ "Add 6 cups of \n",
+ "water to it and also the water reserved at the time of pressure cooking the bee\n",
+ "troot and carrot.\n",
+ "Add salt, cinnamon, cummin, coriander powder,lemon juice\n",
+ "Brin\n",
+ "g to a boil, let simmer for a few mins\n",
+ "Make a fine paste of cornflour and add i\n",
+ "t while stirring to avoid lumps\n",
+ "Til for somemore time so that the cornflour pas\n",
+ "te is cooked and mixed well\n",
+ "Take oil in a kadhai to fry the noodles.fry till go\n",
+ "lden brown and reserve on a tissue paper\n",
+ "Crush the noodles not too much\n",
+ "Serve s\n",
+ "teaming hot in soup bowls add some butter and top with the crispy noodles\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Writing Records to Files , Page number: 431<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to write records to a file using structure'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "\n",
+ "#Variable declaration\n",
+ "another = 'Y'\n",
+ "\n",
+ "#Structure defintion\n",
+ "struct_emp = namedtuple(\"struct_emp\", \"name age bs\")\n",
+ "\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.dat\", \"w\" ) #open file in write mode\n",
+ "if(not fp):\n",
+ " print \"Cannot open target file\"\n",
+ " exit()\n",
+ "\n",
+ "while ( another == 'Y' ):\n",
+ " print \"Enter name, age and basic salary: \" \n",
+ " #en,ea,ebs = input(\"\").split()\n",
+ " en =\"John\"\n",
+ " ea=\"34\"\n",
+ " ebs=\"25000\"\n",
+ " print en,ea,ebs\n",
+ " e = struct_emp(en,ea,ebs)\n",
+ " fp.writelines(e) #write into file\n",
+ " fp.writelines(\"\\n\")\n",
+ " #another = input( \"Add another record (Y/N): \" ) \n",
+ " print \"Add another record (Y/N): \"\n",
+ " another = 'N'\n",
+ " print another\n",
+ "#close file\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name, age and basic salary: \n",
+ "John 34 25000\n",
+ "Add another record (Y/N): \n",
+ "N\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Reading Records from File , Page number: 433<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to read records from a file using structure'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_emp = namedtuple(\"struct_emp\", \"name age bs\")\n",
+ "\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.txt\", \"r\" ) #open file in read mode\n",
+ "if(not fp):\n",
+ " print \"Cannot open target file\"\n",
+ " exit()\n",
+ "\n",
+ "while ( 1 ):\n",
+ " s = fp.readline()\n",
+ " if(s):\n",
+ " en,ea,ebs = s.split()\n",
+ " e = struct_emp(en,ea,ebs) #Read record\n",
+ " print e.name, e.age, e.bs \n",
+ " else:\n",
+ " break\n",
+ " \n",
+ "#close file\n",
+ "fp.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "John 34 25000\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Copying Binary Files , Page number: 434<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to copy text as well as binary files'''\n",
+ "\n",
+ "fs = open (\"C:/Users/Akshatha M/Desktop/Project1.exe\", \"rb\" ) #open file in read binary mode\n",
+ "if(not fs):\n",
+ " print \"Cannot open source file\"\n",
+ " exit()\n",
+ "\n",
+ "ft = open ( \"C:/Users/Akshatha M/Desktop/NewProject1.exe\", \"wb\" ) #open file in write binary mode\n",
+ "if(not ft):\n",
+ " print \"Cannot open target file\"\n",
+ " fs.close() \n",
+ " exit()\n",
+ " \n",
+ "while ( 1 ):\n",
+ " ch = fs.read(1)\n",
+ " if not ch :\n",
+ " break\n",
+ " else:\n",
+ " ft.write(ch) #write into target file\n",
+ "\n",
+ "#closen files\n",
+ "fs.close()\n",
+ "ft.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Writing To Files in Binary Mode, Page number: 438<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to receive records from keyboard and write them to a file in binary mode'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "\n",
+ "#Variable declaration\n",
+ "another = 'Y'\n",
+ "\n",
+ "#Structure defintion\n",
+ "struct_emp = namedtuple(\"struct_emp\", \"name age bs\")\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.dat\", \"wb\" ) #open file in write mode\n",
+ "if(not fp):\n",
+ " print \"Cannot open target file\" \n",
+ " exit()\n",
+ "\n",
+ "while ( another == 'Y' ):\n",
+ " print ( \"Enter name, age and basic salary: \" )\n",
+ " #en,ea,ebs = input(\"\").split()\n",
+ " en =\"John\"\n",
+ " ea=\"34\"\n",
+ " ebs=\"25000\"\n",
+ " print en,ea,ebs\n",
+ " e = struct_emp(en,ea,ebs)\n",
+ " #write into file\n",
+ " fp.write(b'e.name')\n",
+ " fp.write(b'e.age')\n",
+ " fp.write(b'e.bs')\n",
+ " fp.write(b'\\n')\n",
+ " #another = input( \"Add another record (Y/N): \" ) \n",
+ " print \"Add another record (Y/N): \"\n",
+ " another = 'N'\n",
+ " print another\n",
+ "\n",
+ "#close file\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name, age and basic salary: \n",
+ "John 34 25000\n",
+ "Add another record (Y/N): \n",
+ "N\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Reading From Binary Files , Page number: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to read records from binary file and displays them on VDU'''\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_emp = namedtuple(\"struct_emp\", \"name age bs\")\n",
+ "\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.txt\", \"rb\" ) #open file in read mode\n",
+ "if(not fp):\n",
+ " print \"Cannot open target file\" \n",
+ " exit()\n",
+ "\n",
+ "while ( 1 ):\n",
+ " s = fp.readline()\n",
+ " if(s):\n",
+ " en,ea,ebs = s.split()\n",
+ " e = struct_emp(en,ea,ebs) #Read record\n",
+ " print e.name, e.age, e.bs \n",
+ " else:\n",
+ " break\n",
+ " \n",
+ "#close file\n",
+ "fp.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "John 34 25000\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Database Management, Page number: 442<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A menu-driven program for elementary database management'''\n",
+ "\n",
+ "import os\n",
+ "from collections import namedtuple\n",
+ "#Structure defintion\n",
+ "struct_emp = namedtuple(\"struct_emp\", \"name age bs\")\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.txt\", \"r+b\")\n",
+ "if ( not fp ):\n",
+ " fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.txt\", \"w+b\" )\n",
+ " if ( not fp ):\n",
+ " print \"Cannot open file\" \n",
+ " exit( )\n",
+ "\n",
+ "while ( 1 ):\n",
+ " print \" 1. Add Records\"\n",
+ " print \" 2. List Records\"\n",
+ " print \" 3. Modify Records\"\n",
+ " print \" 4. Delete Records\" \n",
+ " print \" 0. Exit\" \n",
+ " #choice = input(\"\\nYour choice\")\n",
+ " print \"\\nYour choice\"\n",
+ " choice = 1\n",
+ " if(choice == '1'):\n",
+ " another = 'Y'\n",
+ " while ( another == 'Y' ):\n",
+ " print ( \"Enter name, age and basic salary: \" )\n",
+ " en,ea,ebs = input(\"\").split()\n",
+ " e = struct_emp(en,ea,ebs)\n",
+ " #write into file\n",
+ " fp.write(b'e.name')\n",
+ " fp.write(b' ')\n",
+ " fp.write(b'e.age')\n",
+ " fp.write(b' ')\n",
+ " fp.write(b'e.bs')\n",
+ " fp.write(b'\\n')\n",
+ " another = input( \"Add another record (Y/N): \" )\n",
+ " elif(choice == '2'):\n",
+ " fp.seek(0,0)\n",
+ " while ( 1 ):\n",
+ " s = fp.readline()\n",
+ " if(s):\n",
+ " en,j1,ea,j2,ebs = s.split()\n",
+ " e = struct_emp(en,ea,ebs) #Read record\n",
+ " print ( e.name, e.age, e.bs )\n",
+ " else:\n",
+ " break\n",
+ " elif(choice == '3'):\n",
+ " another = 'Y'\n",
+ " while ( another == 'Y' ):\n",
+ " empname =input(\"Enter name of employee to modify \" )\n",
+ " fp.seek(0,0)\n",
+ " while (fp.readline()):\n",
+ " if ( b'empname' == b'e.name' ):\n",
+ " en,ea,ebs = input(\"Enter new name, age & bs\" ).spilt()\n",
+ " e = struct_emp(en,ea,ebs)\n",
+ " cur = fp.tell()\n",
+ " fp.write(b'e.name')\n",
+ " fp.write(b'e.age')\n",
+ " fp.write(b'e.bs')\n",
+ " fp.write(b'\\n')\n",
+ " break\n",
+ " print ( \"\\nModify another Record (Y/N) \" )\n",
+ " another = input(\"\")\n",
+ " elif(choice == '4'):\n",
+ " another = 'Y'\n",
+ " while ( another == 'Y' ):\n",
+ " empname = input(\"Enter name of employee to delete \" )\n",
+ " ft = open ( \"C:/Users/Akshatha M/Desktop/temp.txt\", \"wb\" )\n",
+ " fp.seek(0,0)\n",
+ " while ( 1 ):\n",
+ " s = fp.readline()\n",
+ " if(s):\n",
+ " if ( not(b'empname' == b'e.name' )):\n",
+ " ft.write(s)\n",
+ " else:\n",
+ " break\n",
+ " fp.close()\n",
+ " ft.close()\n",
+ " os.remove(\"C:/Users/Akshatha M/Desktop/Employee.txt\")\n",
+ " os.rename ( \"C:/Users/Akshatha M/Desktop/temp.txt\", \"C:/Users/Akshatha M/Desktop/Employee.txt\" )\n",
+ " fp = open ( \"C:/Users/Akshatha M/Desktop/Employee.txt\", \"r+b\" )\n",
+ " print ( \"Delete another Record (Y/N) \" )\n",
+ " another = input(\"\")\n",
+ "\n",
+ " else:\n",
+ " fp.close()#close file\n",
+ " exit( )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Low Level File Copy, Page number: 448<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''File-copy program which copies text, .com and .exe files'''\n",
+ "\n",
+ "#source=input( \"Enter source file name \" ) \n",
+ "print \"Enter source file name \" \n",
+ "source = \"Employee.txt\"\n",
+ "print source\n",
+ "source=\"C:/Users/Akshatha M/Desktop/\"+source\n",
+ "\n",
+ "inhandle = open (source, \"rb\" ) #open file in read binary mode\n",
+ "if(not inhandle):\n",
+ " print \"Cannot open file\"\n",
+ " exit()\n",
+ "\n",
+ "#target=input( \"Enter target file name \" ) \n",
+ "print \"Enter target file name \"\n",
+ "target = \"temp.txt\"\n",
+ "print target\n",
+ "target=\"C:/Users/Akshatha M/Desktop/\"+target\n",
+ "\n",
+ "outhandle = open ( target, \"wb\" ) #open file in write binary mode\n",
+ "if(not outhandle):\n",
+ " print \"Cannot open target file\"\n",
+ " inhandle.close() \n",
+ " exit()\n",
+ "\n",
+ "\n",
+ " \n",
+ "while ( 1 ):\n",
+ " Bytes = inhandle.read(1)\n",
+ " if not Bytes :\n",
+ " break\n",
+ " else:\n",
+ " outhandle.write(Bytes) #write into target file\n",
+ "\n",
+ "#closen files\n",
+ "inhandle.close()\n",
+ "outhandle.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter source file name \n",
+ "Employee.txt\n",
+ "Enter target file name \n",
+ "temp.txt\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Detecting Errors in Reading/Writing, Page number: 470<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A program that illustrates the usage of ferror( )'''\n",
+ "\n",
+ "\n",
+ "fp = open ( \"C:/Users/Akshatha/Documents/extrastuff/skills.txt\", \"w\" ) \n",
+ "while (1):\n",
+ " try:\n",
+ " ch = fp.read(1) #read character from file \n",
+ " except: #ferror()\n",
+ " print \"Error in reading file\" \n",
+ " break \n",
+ " print ch \n",
+ " \n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error in reading file\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Standard IO devices, Page number: 472<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A program to write a file to a printer'''\n",
+ "\n",
+ "import io\n",
+ "\n",
+ "try:\n",
+ " fp = open (\"C:/Users/Akshatha/Documents/extrastuff/skills.txt\", \"r\")\n",
+ "except:\n",
+ " print \"cannot open file\"\n",
+ " exit()\n",
+ " \n",
+ "io.open('stdprn','w') \n",
+ "try:\n",
+ " stdprn = io.open('stdprn', 'w') #open printer\n",
+ "\n",
+ " while ( 1 ):\n",
+ " ch = fp.read(1)\n",
+ " if not ch :\n",
+ " break\n",
+ " else:\n",
+ " stdprn.write(ch) #write into printer\n",
+ "except: #no printer\n",
+ " #closen files\n",
+ " fp.close()\n",
+ " stdprn.close()\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-13.ipynb b/Let_us_C/chapter-13.ipynb
new file mode 100644
index 00000000..d3b93ca6
--- /dev/null
+++ b/Let_us_C/chapter-13.ipynb
@@ -0,0 +1,83 @@
+{
+ "metadata": {
+ "name": "chapter-13.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 13: More Issues In Input/Output<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Using argc and argv, Page number: 467<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''File-copy program usinng command line arguments'''\n",
+ "\n",
+ "import sys\n",
+ "\n",
+ "if ( len(sys.argv) != 3 ):\n",
+ " print ( \"Improper number of arguments\" )\n",
+ " exit( )\n",
+ " \n",
+ "fs = open ( sys.argv[2], \"r\" ) #open file in read mode\n",
+ "if ( not fs):\n",
+ " print ( \"Cannot open source file\" )\n",
+ " exit( )\n",
+ " \n",
+ "ft = open ( sys.argv[2], \"w\" ) #open file in write mode\n",
+ "if ( not ft ):\n",
+ " print ( \"Cannot open target file\" )\n",
+ " fs.close()\n",
+ " exit( )\n",
+ " \n",
+ "while ( 1 ):\n",
+ " ch = fs.read(1)\n",
+ " if ( not ch ):\n",
+ " break\n",
+ " else:\n",
+ " ft.write(ch)\n",
+ "\n",
+ "#close files \n",
+ "fs.close()\n",
+ "ft.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Improper number of arguments\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-14.ipynb b/Let_us_C/chapter-14.ipynb
new file mode 100644
index 00000000..becf792e
--- /dev/null
+++ b/Let_us_C/chapter-14.ipynb
@@ -0,0 +1,853 @@
+{
+ "metadata": {
+ "name": "chapter-14.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 14: Operations On Bits<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Binary Conversion, Page number: 483<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to print binary equivalent of integers using showbits( ) function'''\n",
+ "\n",
+ "#Function definition\n",
+ "def showbits ( n ):\n",
+ " a = 15\n",
+ " for i in range(0,16):\n",
+ " andmask = 1 << a\n",
+ " k = n & andmask\n",
+ " if k == 0:\n",
+ " print \"0\"\n",
+ " else:\n",
+ " print \"1\" \n",
+ " a = a-1\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "for j in range(0,6):\n",
+ " print \"Decimal %d is same as binary \"%( j )\n",
+ " showbits ( j ) #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 0 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "Decimal 1 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "Decimal 2 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "Decimal 3 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "Decimal 4 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "Decimal 5 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>One's Complement, Page number: 484<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to shows one\u2019s complement operator in action.'''\n",
+ "\n",
+ "#Function definition\n",
+ "def showbits ( n ):\n",
+ " a = 15\n",
+ " for i in range(0,16):\n",
+ " andmask = 1 << a\n",
+ " k = n & andmask\n",
+ " if k == 0:\n",
+ " print \"0\" \n",
+ " else:\n",
+ " print \"1\" \n",
+ " a = a-1\n",
+ "\n",
+ "\n",
+ "for j in range(0,4):\n",
+ " print \"Decimal %d is same as binary \"%(j )\n",
+ " showbits ( j ) \n",
+ " k = ~j \n",
+ " print \"One\u2019s complement of %d is \"%( j ) \n",
+ " showbits ( k )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 0 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "One\u2019s complement of 0 is \n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "Decimal 1 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "One\u2019s complement of 1 is \n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "Decimal 2 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "One\u2019s complement of 2 is \n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "Decimal 3 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "One\u2019s complement of 3 is \n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>File Encryption, Page number: 485<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate file encryption utility'''\n",
+ "\n",
+ "#Function definition\n",
+ "def encrypt( ):\n",
+ " fs = open ( \"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #normal file \n",
+ " ft = open ( \"C:/Users/Akshatha M/Desktop/temp.txt\", \"w\" ) # encrypted file \n",
+ " if ( not fs or not ft ):\n",
+ " print \"File opening error!\" \n",
+ " exit()\n",
+ " while (1):\n",
+ " ch = fs.read(1)\n",
+ " if(not ch): #EOF\n",
+ " break\n",
+ " else:\n",
+ " ft.write(ascii(~ord(ch))) #complemented\n",
+ " #close files\n",
+ " fs.close()\n",
+ " ft.close()\n",
+ "\n",
+ "\n",
+ "encrypt() #function call\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Right Shift Operator, Page number: 487<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the effect of right shift operator.'''\n",
+ "\n",
+ "#Function definition\n",
+ "def showbits ( n ):\n",
+ " a = 15\n",
+ " for i in range(0,16):\n",
+ " andmask = 1 << a\n",
+ " k = n & andmask\n",
+ " if k == 0:\n",
+ " print \"0\" \n",
+ " else:\n",
+ " print \"1\" \n",
+ " a = a-1\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 5225\n",
+ "\n",
+ "print \"Decimal %d is same as binary \"%( i )\n",
+ "showbits(i)#function call\n",
+ "\n",
+ "for j in range(0,6):\n",
+ " k = i >>j #right shift \n",
+ " print \"%d right shift %d gives \" %(i, j )\n",
+ " showbits ( k ) #function call "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 5225 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "5225 right shift 0 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "5225 right shift 1 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "5225 right shift 2 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "5225 right shift 3 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "5225 right shift 4 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "5225 right shift 5 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Left Shift Operator, Page number: 488<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the effect of left shift operator.'''\n",
+ "\n",
+ "#Function definition\n",
+ "def showbits ( n ):\n",
+ " a = 15\n",
+ " for i in range(0,16):\n",
+ " andmask = 1 << a\n",
+ " k = n & andmask\n",
+ " if k == 0:\n",
+ " print \"0\" \n",
+ " else:\n",
+ " print \"1\" \n",
+ " a = a-1\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 5225\n",
+ "\n",
+ "print \"Decimal %d is same as binary \"%( i )\n",
+ "showbits(i)#function call\n",
+ "\n",
+ "for j in range(0,6):\n",
+ " k = i <<j #left shift \n",
+ " print \"%d left shift %d gives \" %(i, j )\n",
+ " showbits ( k ) #function call \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decimal 5225 is same as binary \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "5225 left shift 0 gives \n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "5225 left shift 1 gives \n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "5225 left shift 2 gives \n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "5225 left shift 3 gives \n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "5225 left shift 4 gives \n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "5225 left shift 5 gives \n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "1\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "1\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n",
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Date Field in Directory, Page number: 492<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to decode the date field in directory entry using bitwise operators'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 9\n",
+ "m = 3\n",
+ "y = 1990\n",
+ "\n",
+ "#Calculation and result\n",
+ "date = ( y - 1980 ) * 512 + m * 32 + d \n",
+ "print \"Date = %u\"%( date ) \n",
+ "year = 1980 + ( date >> 9 ) \n",
+ "month = ( (date << 7 ) >> 12 ) \n",
+ "day = ( (date << 11 ) >> 11 ) \n",
+ "print \"Year = \", year \n",
+ "print \"Month = %u\" %(m)\n",
+ "print \"Day = %u\" %(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Date = 5225\n",
+ "Year = 1990\n",
+ "Month = 3\n",
+ "Day = 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Bitwise AND Operator, Page number: 495<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to test whether a bit in a number is ON or OFF'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 65\n",
+ "\n",
+ "print \"value of i = \", i \n",
+ "\n",
+ "j = i & 32 #bitwise and\n",
+ "if ( j == 0 ):\n",
+ " print \"and its fifth bit is off\" \n",
+ "else:\n",
+ " print \"and its fifth bit is on\"\n",
+ "\n",
+ "j = i & 64 #bitwise and\n",
+ "if ( j == 0 ):\n",
+ " print \"whereas its sixth bit is off\" \n",
+ "else:\n",
+ " print \"whereas its sixth bit is on\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of i = 65\n",
+ "and its fifth bit is off\n",
+ "whereas its sixth bit is on\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Bitwise XOR Operator, Page number: 500<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate that a number XORed with another number\n",
+ "twice gives the original number.'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 50\n",
+ "\n",
+ "#Calculation and result\n",
+ "b = b ^ 12 \n",
+ "print b # this will print 62 \n",
+ "b = b ^ 12 \n",
+ "print b # this will print 50 \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "62\n",
+ "50\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-15.ipynb b/Let_us_C/chapter-15.ipynb
new file mode 100644
index 00000000..bf1ab52b
--- /dev/null
+++ b/Let_us_C/chapter-15.ipynb
@@ -0,0 +1,621 @@
+{
+ "metadata": {
+ "name": "chapter-15.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 15: Miscellaneous Features <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Enumerated Data Type , Page number: 508<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to print a payroll using enum'''\n",
+ "\n",
+ "def enum(**enums):\n",
+ " return type('Enum', (), enums)\n",
+ "#Enum declaration\n",
+ "emp_dept = enum(assembly = 0, manufacturing = 1,accounts = 2, stores = 3)\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure declaration\n",
+ "struct_employee = namedtuple(\"struct_employee\", \"name age bs emp_dept\")\n",
+ "\n",
+ "\n",
+ "#Structure for employee\n",
+ "department = emp_dept.manufacturing\n",
+ "e = struct_employee(\"Lothar Mattheus\",28,5575.50,department)\n",
+ "\n",
+ "#Result\n",
+ "print \"Name = \",e.name\n",
+ "print \"Age = \",e.age\n",
+ "print \"Basic salary = \",e.bs\n",
+ "print \"Dept = \",e.emp_dept\n",
+ "\n",
+ "if(e.emp_dept == 2):\n",
+ " print \"%s is an accountant\" %(e.name)\n",
+ "else:\n",
+ " print \"%s is not an accountant\" %(e.name)\n",
+ " \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name = Lothar Mattheus\n",
+ "Age = 28\n",
+ "Basic salary = 5575.5\n",
+ "Dept = 1\n",
+ "Lothar Mattheus is not an accountant\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Are Enums Necessary, Page number: 510<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to achieve the task of enums using macros'''\n",
+ "\n",
+ "#macro definition\n",
+ "ASSEMBLY = 0\n",
+ "MANUFACTURING = 1\n",
+ "ACCOUNTS = 2\n",
+ "STORES = 3\n",
+ "\n",
+ "from collections import namedtuple\n",
+ "#Structure declaration\n",
+ "struct_employee = namedtuple(\"struct_employee\", \"name age bs department\")\n",
+ "\n",
+ "#Structure for employee\n",
+ "e = struct_employee(\"Lothar Mattheus\",28,5575.50,MANUFACTURING)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Division Without Typecasting , Page number: 513<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate no typecasting'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "x=6\n",
+ "y=4\n",
+ "\n",
+ "#Calculation\n",
+ "a = int( x/y) \n",
+ "\n",
+ "#Result\n",
+ "print \"Value of a = %f\" %(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a = 1.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Division With Typecasting , Page number: 513<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate explicit typecasting'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "x=6\n",
+ "y=4\n",
+ "\n",
+ "#Calculation\n",
+ "a = float( x)/y\n",
+ "\n",
+ "#Result\n",
+ "print \"Value of a = %f\" %(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a = 1.500000\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Type Casting , Page number: 514<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate typecasting'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=6.35\n",
+ "\n",
+ "#Result\n",
+ "print \"Value of a on typecasting = %d\" %(int(a))\n",
+ "print \"Value of a = %f\"%(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a on typecasting = 6\n",
+ "Value of a = 6.350000\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Bit Fields , Page number: 516<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate bit fields in structures'''\n",
+ "\n",
+ "from ctypes import *\n",
+ "import ctypes\n",
+ "import math\n",
+ "\n",
+ "#macro definition\n",
+ "MALE = 0\n",
+ "FEMALE = 1\n",
+ "SINGLE = 0\n",
+ "MARRIED = 1\n",
+ "DIVORCED = 2\n",
+ "WIDOWED = 3\n",
+ "\n",
+ "#Structure declaration\n",
+ "class employee(Structure):\n",
+ " _fields_ = [(\"gender\", c_int, 1),(\"mar_stat\", c_int, 3),(\"hobby\", c_int, 3),(\"scheme\", c_int, 4)]\n",
+ " _sizeof_ = 2\n",
+ "#Structure for employee\n",
+ "e = employee()\n",
+ "e.gender = MALE\n",
+ "e.mar_stat = DIVORCED\n",
+ "e.hobby = 5\n",
+ "e.scheme =9\n",
+ "\n",
+ "#Result\n",
+ "print \"Gender = \",e.gender\n",
+ "print \"Marital status = \",e.mar_stat\n",
+ "print \"Bytes occupied by e = \",sizeof(e)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gender = 0\n",
+ "Marital status = 2\n",
+ "Bytes occupied by e = 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Address of a Function , Page number: 517<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate pointers to functions'''\n",
+ "\n",
+ "#Function definition\n",
+ "def display():\n",
+ " print \"Long live viruses!!\"\n",
+ "\n",
+ "#Result\n",
+ "print \"Address of function display is \",id(display)\n",
+ "display() #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of function display is 133993192\n",
+ "Long live viruses!!\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Invoking a Function Using Pointer, Page number: 518<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to invoke a function using a pointer to a function'''\n",
+ "\n",
+ "#Function definition\n",
+ "def display():\n",
+ " print \"Long live viruses!!\"\n",
+ "\n",
+ "func_ptr = id(display) #assigning address of function\n",
+ "print \"Address of function display is \",func_ptr\n",
+ "display() #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of function display is 133993080\n",
+ "Long live viruses!!\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Functions Returning Pointers , Page number: 520<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate functions returning pointers'''\n",
+ "\n",
+ "#Function definition\n",
+ "def fun():\n",
+ " i = 20\n",
+ " return (i)\n",
+ "\n",
+ "#Result\n",
+ "p =fun() #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>String Copy , Page number: 520<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program which copies one string into another and\n",
+ "returns the pointer to the target string'''\n",
+ "\n",
+ "#Function definition\n",
+ "def copy(t,s):\n",
+ " i = 0\n",
+ " while ( s[i] != '\\0' ):\n",
+ " t = t + s[i]\n",
+ " i = i + 1\n",
+ " return t\n",
+ "\n",
+ "#Variable declaration\n",
+ "source = \"Jaded\\0\" \n",
+ "target = ''\n",
+ "string = copy( target, source ) # function call\n",
+ "\n",
+ "#Result\n",
+ "print string\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jaded\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Findmax Function , Page number: 522<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate a findmax() function\n",
+ "to find out max value from a set of values\n",
+ "irrespective of number of values passed to it'''\n",
+ "\n",
+ "#function declaration\n",
+ "def findmax(*arg):\n",
+ " maxi = arg[1]\n",
+ " for count in range(2,arg[0]):\n",
+ " num = arg[count]\n",
+ " if (num > maxi):\n",
+ " maxi = num\n",
+ " return maxi\n",
+ "\n",
+ "maxi = findmax(5,23,15,1,92,50)#function call \n",
+ "print \"maximum = \",maxi\n",
+ "\n",
+ "maxi = findmax(3,100,300,29)#function call \n",
+ "print \"maximum = \",maxi\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum = 92\n",
+ "maximum = 300\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Display Function, Page number: 524<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate a display() function\n",
+ "to print any number of arguments of any type'''\n",
+ "\n",
+ "#function declaration\n",
+ "def display(*arg):\n",
+ " if(arg[0] == 1): #case int\n",
+ " for j in range(2,arg[1]+2):\n",
+ " i = arg[j]\n",
+ " print \"%d\"%(i)\n",
+ " elif(arg[0] == 2): #case char\n",
+ " for j in range(2,arg[1]+2):\n",
+ " i = arg[j]\n",
+ " print \"%c\"%(i)\n",
+ " elif(arg[0] == 3): #case double\n",
+ " for j in range(2,arg[1]+2):\n",
+ " i = arg[j]\n",
+ " print \"%lf\"%(i)\n",
+ " \n",
+ "#function calls\n",
+ "display(1,2,5,6)\n",
+ "display(2,4,'A','a','b','c')\n",
+ "display(3,3,2.5,299.3,-1.0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n",
+ "6\n",
+ "A\n",
+ "a\n",
+ "b\n",
+ "c\n",
+ "2.500000\n",
+ "299.300000\n",
+ "-1.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Union Demo , Page number: 526<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a union at work'''\n",
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "#union declaration\n",
+ "class union_a(Union):\n",
+ " _fields_ = [(\"i\", c_int),\n",
+ " (\"ch\", ((c_char * 1)*2))]\n",
+ "\n",
+ "key = union_a()\n",
+ "key.i = 512\n",
+ "print \"key.i = \",key.i\n",
+ "print \"key.ch[0] = \",(key.ch[0][0])\n",
+ "print \"key.ch[1] = \",(key.ch[1][0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Union Example , Page number: 530<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate that we cant assign different values to\n",
+ "different union element at the same time'''\n",
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "#Union declaration\n",
+ "class union_a(Union):\n",
+ " _fields_ = [(\"i\", c_int),\n",
+ " (\"ch\", ((c_char * 1)*2))]\n",
+ "\n",
+ "key = union_a()\n",
+ "key.i = 512\n",
+ "print \"key.i = \",key.i\n",
+ "print \"key.ch[0] = \",(key.ch[0][0])\n",
+ "print \"key.ch[1] = \",(key.ch[1][0])\n",
+ "\n",
+ "key.ch[0][0] = 50 #assign new value to key.ch[0]\n",
+ "print\"key.i = \",key.i\n",
+ "print\"key.ch[0] = \",(key.ch[0][0])\n",
+ "print\"key.ch[1] = \",(key.ch[1][0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Union of Structures , Page number: 531<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate structures nested in a union'''\n",
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "#Structure declarations\n",
+ "class a(Structure):\n",
+ " _fields_ = [(\"i\", c_int),\n",
+ " (\"c\", ((c_char * 1)*2))]\n",
+ "\n",
+ "class b(Structure):\n",
+ " _fields_ = [(\"j\", c_int),\n",
+ " (\"d\", ((c_char * 1)*2))]\n",
+ " \n",
+ "#Union declaration\n",
+ "class union_z(Union):\n",
+ " _fields_ = [(\"key\", a),\n",
+ " (\"data\", b )]\n",
+ "\n",
+ "strange = union_z()\n",
+ "strange.key.i = 512\n",
+ "strange.data.d[0][0] = 0\n",
+ "strange.data.d[1][0] = 32\n",
+ "\n",
+ "print strange.key.i\n",
+ "print strange.data.j\n",
+ "print strange.key.c[0][0]\n",
+ "print strange.data.d[0][0]\n",
+ "print strange.key.c[1][0]\n",
+ "print strange.data.d[1][0]\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-16.ipynb b/Let_us_C/chapter-16.ipynb
new file mode 100644
index 00000000..8c3c03f2
--- /dev/null
+++ b/Let_us_C/chapter-16.ipynb
@@ -0,0 +1,66 @@
+{
+ "metadata": {
+ "name": "chapter-16.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 16: C Under Windows<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>The first Windows Program, Page number: 554<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to display a \u201cHello\u201d message in a message box'''\n",
+ "\n",
+ "import ctypes\n",
+ "MessageBox = ctypes.windll.user32.MessageBoxW\n",
+ "MessageBox(None, 'Hello', 'Title', 0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "pyout",
+ "prompt_number": 1,
+ "text": [
+ "1"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 2,
+ "text": [
+ "1"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-17.ipynb b/Let_us_C/chapter-17.ipynb
new file mode 100644
index 00000000..1b6a9007
--- /dev/null
+++ b/Let_us_C/chapter-17.ipynb
@@ -0,0 +1,115 @@
+{
+ "metadata": {
+ "name": "chapter-17.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 17: Windows Programming<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Message Box, Page number: 563<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to create a window on the screen.'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "#creating window\n",
+ "root = Tk()\n",
+ "root.title(\"Press Me\")\n",
+ "button1 = Button(root, text=\"Press Me\") #creating button\n",
+ "button1.pack()\n",
+ "import ctypes #creating message box\n",
+ "MessageBox = ctypes.windll.user32.MessageBoxW\n",
+ "MessageBox(None, 'Hi!', 'Waiting', 0)\n",
+ "root.mainloop()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>More Windows, Page number: 566<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to create several windows on the screen'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "root = []\n",
+ "#creating windows\n",
+ "for x in range(0,10):\n",
+ " root.append(Tk())\n",
+ " root[x].title(\"Press Me\")\n",
+ " button1 = Button(root[x], text=\"Press Me\") #creating button\n",
+ " button1.pack()\n",
+ " \n",
+ "import ctypes #creating message box\n",
+ "MessageBox = ctypes.windll.user32.MessageBoxW\n",
+ "MessageBox(None, 'Hi!', 'Waiting', 0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>A Real World Window, Page number: 568<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to create a window using window class and interact with it'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "class Example(Frame):\n",
+ " def __init__(self, parent):\n",
+ " Frame.__init__(self, parent)\n",
+ "\n",
+ " self.display = Canvas(self, width=700, height=200)\n",
+ " self.display.pack(side=\"top\", fill=\"both\", expand=True)\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " root = Tk()\n",
+ " root.title(\"Title\")\n",
+ " Frame = Example(parent=root)\n",
+ " Frame.pack(side=\"top\", fill=\"both\", expand=True)\n",
+ " root.mainloop()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-18.ipynb b/Let_us_C/chapter-18.ipynb
new file mode 100644
index 00000000..7a30b0b6
--- /dev/null
+++ b/Let_us_C/chapter-18.ipynb
@@ -0,0 +1,261 @@
+{
+ "metadata": {
+ "name": "chapter-18.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 18: Graphics Under Windows<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Hello Windows, Page number: 582<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to display a message \u201cHello Windows\u201d in different fonts'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "class Example(Frame):\n",
+ " def __init__(self, parent):\n",
+ " Frame.__init__(self, parent)\n",
+ "\n",
+ " self.display = Canvas(self, width=700, height=200)\n",
+ " self.display.pack(side=\"top\", fill=\"both\", expand=True)\n",
+ " self.display.create_text(10, 10, fill = \"blue\",text = \"Hello Windows\", font=\"Arial 20 italic\",\n",
+ " anchor=\"nw\")\n",
+ " self.display.create_text(10, 50, fill = \"blue\",text = \"Hello Windows\", font=\"TimesNewRoman 30 italic\",\n",
+ " anchor=\"nw\")\n",
+ " self.display.create_text(10, 100, fill = \"blue\",text = \"Hello Windows\", font=\"ComicSansMS 40 italic\",\n",
+ " anchor=\"nw\")\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " root = Tk()\n",
+ " root.title(\"Text\")\n",
+ " Frame = Example(parent=root)\n",
+ " Frame.pack(side=\"top\", fill=\"both\", expand=True)\n",
+ " root.mainloop()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Drawing Shapes, Page number: 587<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that displays different shapes in a window'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "top = Tk()\n",
+ "top.title(\"Shapes\")\n",
+ "C = Canvas(top, height=500, width=500)\n",
+ "rcoor = 10,20,200,100\n",
+ "rect = C.create_rectangle(rcoor,fill=\"blue\")#rectangle\n",
+ "ecoor = 10,280,200,380\n",
+ "ellipse = C.create_oval(ecoor,fill = \"blue\")#ellipse\n",
+ "picoor = 250,0,350,100\n",
+ "pie = C.create_arc(picoor, start=300, extent=100, fill=\"blue\")#pie\n",
+ "pocoor = 250, 150, 250, 300, 300, 350, 400, 300, 320, 190\n",
+ "polygon = C.create_polygon(pocoor,fill=\"blue\")#polygon\n",
+ "#roundedrectangle\n",
+ "c1= C.create_arc(155,115,195,150,start=320, extent=80, fill=\"blue\",outline=\"blue\")\n",
+ "c2= C.create_arc(155,208,195,243,start=320, extent=80, fill=\"blue\",outline=\"blue\")\n",
+ "c3= C.create_arc(25,118,60,153,start=100, extent=150, fill=\"blue\",outline=\"blue\")\n",
+ "c4= C.create_arc(25,207,60,242,start=100, extent=150, fill=\"blue\",outline=\"blue\")\n",
+ "roundrect = C.create_rectangle(30,120,190,240,fill=\"blue\",outline=\"blue\")\n",
+ "C.pack()\n",
+ "top.mainloop()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pen Styles, Page number: 590<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to create pens of different style, color and\n",
+ "thickness to draw'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "top = Tk()\n",
+ "top.title(\"Pen styles\")\n",
+ "C = Canvas(top, height=100, width=500)\n",
+ "l1 = C.create_line(0,10,500,10,fill=\"red\",dash=(5)) #dashed line\n",
+ "l2 = C.create_line(0,30,500,30,fill=\"red\",dash=(1)) #dotted line\n",
+ "l3 = C.create_line(0,50,500,50,fill=\"red\",dash=(5,1,1,1)) #dash dot\n",
+ "l4 = C.create_line(0,70,500,70,fill=\"red\",dash=(5,1,1,1,1)) #dash dot dot\n",
+ "l5 = C.create_line(0,90,500,90,fill=\"red\",width=4) #solid line\n",
+ "C.pack()\n",
+ "top.mainloop()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Types of Brushes, Page number: 592<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import sys\n",
+ "from PyQt4 import QtGui, QtCore\n",
+ "\n",
+ "\n",
+ "class Example(QtGui.QWidget):\n",
+ " \n",
+ " def __init__(self):\n",
+ " super(Example, self).__init__()\n",
+ " \n",
+ " self.initUI()\n",
+ " \n",
+ " def initUI(self): \n",
+ "\n",
+ " self.setGeometry(300, 300, 355, 280)\n",
+ " self.setWindowTitle('Brush Styles')\n",
+ " self.show()\n",
+ "\n",
+ " def paintEvent(self, e):\n",
+ "\n",
+ " qp = QtGui.QPainter()\n",
+ " qp.begin(self)\n",
+ " self.drawBrushes(qp)\n",
+ " qp.end()\n",
+ " \n",
+ " def drawBrushes(self, qp):\n",
+ " \n",
+ " brush = QtGui.QBrush(QtCore.Qt.SolidPattern)\n",
+ " qp.setBrush(brush)\n",
+ " qp.drawRect(10, 15, 90, 60)\n",
+ "\n",
+ " brush.setStyle(QtCore.Qt.CrossPattern)\n",
+ " qp.setBrush(brush)\n",
+ " qp.drawRect(130, 15, 90, 60)\n",
+ "\n",
+ " \n",
+ " image = QtGui.QImage(\"C:/Users/Public/Pictures/Sample Pictures/Chrysanthemum.jpg\")\n",
+ " brush.setTextureImage (image)\n",
+ " qp.setBrush(brush)\n",
+ " qp.drawRect(250, 15, 90, 60)\n",
+ "\n",
+ " \n",
+ " \n",
+ " \n",
+ "def main():\n",
+ " \n",
+ " app = QtGui.QApplication(sys.argv)\n",
+ " ex = Example()\n",
+ " sys.exit(app.exec_())\n",
+ "\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " main()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Displaying a Bitmap, Page number: 605<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to display a image in a window.'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "top = Tk()\n",
+ "top.title(\"Pen styles\")\n",
+ "C = Canvas(top, height=300, width=500)\n",
+ "filename = PhotoImage(file = \"C:/Users/Akshatha M/Desktop/dialog1.gif\")\n",
+ "image = C.create_image(50, 50, anchor=NE, image=filename)\n",
+ "C.pack()\n",
+ "top.mainloop()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Animation at Work, Page number: 608<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate a animation of a ball bouncing off a window '''\n",
+ "from visual import *\n",
+ "\n",
+ "floor = box(length=4, height=0.5, width=4, color=color.blue)\n",
+ "\n",
+ "ball = sphere(pos=(0,4,0), color=color.red)\n",
+ "ball.velocity = vector(0,-1,0)\n",
+ "\n",
+ "dt = 0.01\n",
+ "while 1:\n",
+ " rate(100)\n",
+ " ball.pos = ball.pos + ball.velocity*dt\n",
+ " if ball.y < 1:\n",
+ " ball.velocity.y = -ball.velocity.y\n",
+ " else:\n",
+ " ball.velocity.y = ball.velocity.y - 9.8*dt\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-2.ipynb b/Let_us_C/chapter-2.ipynb
new file mode 100644
index 00000000..fc025445
--- /dev/null
+++ b/Let_us_C/chapter-2.ipynb
@@ -0,0 +1,571 @@
+{
+ "metadata": {
+ "name": "chapter-2.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 2: The Decision Control Structure <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>If Demo , Page number: 52<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Demonstration of if statement\n",
+ "Here is a simple program, which demonstrates the use of if and the relational operators'''\n",
+ "\n",
+ "#taking in input from the user\n",
+ "#num = raw_input(\"Enter a number less than 10: \")\n",
+ "print \"Enter a number less than 10: \"\n",
+ "num = 8\n",
+ "print num\n",
+ "\n",
+ "#if statement\n",
+ "if num <= 10:\n",
+ " print(\"What an obedient servant you are !\") #display result\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a number less than 10: \n",
+ "8\n",
+ "What an obedient servant you are !\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.1 , Page number: 53<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000.\n",
+ "If quantity and price per item are input through the keyboard, write a program to calculate the total expenses.'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "dis = 0 #Initial Discount (%0)\n",
+ "\n",
+ "#Input from the user\n",
+ "#qty,rate = raw_input(\"Enter quantity and rate: \").split()\n",
+ "print \"Enter quantity and rate: \"\n",
+ "qty = 1200 # Quantity of item\n",
+ "rate = 15.50 # Rate of item (Rs)\n",
+ "print qty , rate\n",
+ "\n",
+ "#discount of 10% if quantity > 1000\n",
+ "if qty > 1000:\n",
+ " dis = 10\n",
+ "\n",
+ "#Calculation\n",
+ "tot = (qty * rate) - (qty * rate * dis / 100 ) # total expenses (Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"Total expenses = Rs. \", tot \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter quantity and rate: \n",
+ "1200 15.5\n",
+ "Total expenses = Rs. 16740.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.2, Page number: 57<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''The current year and the year in which the employee joined the organization are entered through the keyboard.\n",
+ "If the number of years for which the employee has served the organization is greater than 3 then a bonus of Rs. 2500/- is given to the employee.\n",
+ "If the years of service are not greater than 3, then the program should do nothing'''\n",
+ "\n",
+ "#input from user\n",
+ "#cy,yoj = raw_input(\"Enter current year and year of joining: \").split() \n",
+ "print \"Enter current year and year of joining: \"\n",
+ "cy = 2013 # Current year\n",
+ "yoj = 1990 # Year of joining\n",
+ "print cy, yoj \n",
+ "#Calculation\n",
+ "yr_of_ser = cy - yoj # number of years of service\n",
+ "\n",
+ "#Assign bonus if years of service > 3\n",
+ "if yr_of_ser > 3:\n",
+ " bonus = 2500 # Bonus of Rs. 2500\n",
+ " print \"Bonus = Rs.\", bonus #display result\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter current year and year of joining: \n",
+ "2013 1990\n",
+ "Bonus = Rs. 2500\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.3 , Page number: 58<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''In a company an employee is paid as under:\n",
+ "If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and\n",
+ "DA = 90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary.\n",
+ "If the employee's salary is input through the keyboard ,write a program to find his gross salary.'''\n",
+ "\n",
+ "#input from user\n",
+ "#bs = raw_input(\"Enter basic salary: \")\n",
+ "print \"Enter basic salary: \"\n",
+ "bs = 2561.1 #Basic salary (Rs)\n",
+ "print bs\n",
+ "\n",
+ "#Calculation\n",
+ "if bs < 1500: # if basic salary is less than Rs.1500\n",
+ " hra = bs * 10 / 100 # HRA (Rs)\n",
+ " da = bs * 90 / 100 #DA (Rs)\n",
+ "else: #if basic salary is greater than or equal to Rs.1500\n",
+ " hra = 500 # HRA (Rs)\n",
+ " da = bs * 98 / 100 # DA (Rs)\n",
+ "\n",
+ "gs = bs + hra + da # gross salary (Rs)\n",
+ "\n",
+ "#Result\n",
+ "print \"gross salary = Rs. \", gs \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter basic salary: \n",
+ "2561.1\n",
+ "gross salary = Rs. 5570.978\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Nested If-else , Page number: 61<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A quick demo of nested if-else'''\n",
+ "\n",
+ "#input from user\n",
+ "#i = raw_input(\"Enter either 1 or 2: \")\n",
+ "print \"Enter either 1 or 2: \"\n",
+ "i = 1\n",
+ "print i\n",
+ "\n",
+ "#nested if-else\n",
+ "if i == 1 :\n",
+ " print \"You would go to heaven !\" \n",
+ "else:\n",
+ " if i == 2 :\n",
+ " print \"Hell was created with you in mind\" \n",
+ " else:\n",
+ " print \"How about mother earth !\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter either 1 or 2: \n",
+ "1\n",
+ "You would go to heaven !\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.4 (Method 1), Page number: 64<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division as per the following rules:\n",
+ "Percentage above or equal to 60 - First division\n",
+ "Percentage between 50 and 59 - Second division\n",
+ "Percentage between 40 and 49 - Third division\n",
+ "Percentage less than 40 - Fail\n",
+ "Write a program to calculate the division obtained by the student.\n",
+ "Method 1'''\n",
+ "\n",
+ "#input from user\n",
+ "#m1,m2,m3,m4,m5 = raw_input(\"Enter marks in five subjects: \").split() \n",
+ "print \"Enter marks in five subjects: \"\n",
+ "m1 = 88 #Marks in 1st subject\n",
+ "m2 = 92 #Marks in 2nd subject\n",
+ "m3 = 87 #Marks in 3rd subject\n",
+ "m4 = 66 #Marks in 4th subject\n",
+ "m5 = 56 #Marks in 5th subject\n",
+ "print m1,m2,m3,m4,m5\n",
+ "\n",
+ "#Calculation\n",
+ "per = ( m1 + m2 + m3 + m4 + m5 ) / 5 #Percentage\n",
+ "\n",
+ "#check for different cases and display appropriate result\n",
+ "if per >= 60:\n",
+ " print \"First division\"\n",
+ "else:\n",
+ " if per >= 50:\n",
+ " print \"Second division\"\n",
+ " else:\n",
+ " if per >= 40:\n",
+ " print \"Third division\"\n",
+ " else:\n",
+ " print \"Fail\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter marks in five subjects: \n",
+ "88 92 87 66 56\n",
+ "First division\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.4 (Method 2), Page number: 65<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Method 2'''\n",
+ "\n",
+ "#input from user\n",
+ "#m1,m2,m3,m4,m5 = raw_input(\"Enter marks in five subjects: \").split() \n",
+ "print \"Enter marks in five subjects: \"\n",
+ "m1 = 88 #Marks in 1st subject\n",
+ "m2 = 92 #Marks in 2nd subject\n",
+ "m3 = 87 #Marks in 3rd subject\n",
+ "m4 = 66 #Marks in 4th subject\n",
+ "m5 = 56 #Marks in 5th subject\n",
+ "print m1,m2,m3,m4,m5\n",
+ "\n",
+ "#Calculation\n",
+ "per = ( m1 + m2 + m3 + m4 + m5 ) / 5 #Percentage\n",
+ "\n",
+ "#check for different cases and display appropriate result\n",
+ "if per >= 60:\n",
+ " print \"First division\"\n",
+ "\n",
+ "if (per >= 50) and (per <60):\n",
+ " print\"Second division\"\n",
+ "\n",
+ "if (per >= 40) and (per <50):\n",
+ " print\"Third division\"\n",
+ "\n",
+ "if per < 40 :\n",
+ " print\"Fail\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks in five subjects: \n",
+ "88 92 87 66 56\n",
+ "First division\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.4 (Method 3), Page number: 67<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Method 3 - else if ladder demo'''\n",
+ "\n",
+ "#input from user\n",
+ "#m1,m2,m3,m4,m5 = raw_input(\"Enter marks in five subjects: \").split() \n",
+ "print \"Enter marks in five subjects: \"\n",
+ "m1 = 88 #Marks in 1st subject\n",
+ "m2 = 92 #Marks in 2nd subject\n",
+ "m3 = 87 #Marks in 3rd subject\n",
+ "m4 = 66 #Marks in 4th subject\n",
+ "m5 = 56 #Marks in 5th subject\n",
+ "print m1,m2,m3,m4,m5\n",
+ "\n",
+ "#Calculation\n",
+ "per = ( m1 + m2 + m3 + m4 + m5 ) / 5 #Percentage\n",
+ "\n",
+ "#check for different cases and display appropriate result\n",
+ "if per >= 60:\n",
+ " print\"First division\"\n",
+ "elif per >= 50:\n",
+ " print\"Second division\"\n",
+ "elif per >= 40:\n",
+ " print\"Third division\"\n",
+ "else:\n",
+ " print\"Fail\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks in five subjects: \n",
+ "88 92 87 66 56\n",
+ "First division\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.5 (Method 1) , Page number: 68<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''A company insures its drivers in the following cases:\n",
+ "\u2212 If the driver is married.\n",
+ "\u2212 If the driver is unmarried, male & above 30 years of age.\n",
+ "\u2212 If the driver is unmarried, female & above 25 years of age.\n",
+ "In all other cases the driver is not insured.\n",
+ "If the marital status, sex and age of the driver are the inputs, write a program to determine whether the driver is to be insured or not.'''\n",
+ "\n",
+ "#input from user\n",
+ "#age,sex,ms = raw_input(\"Enter age, sex, marital status: \").split() # Age , sex and marital status of the driver\n",
+ "print \"Enter age, sex, marital status: \"\n",
+ "age = 43 # Age of driver (years)\n",
+ "sex = 'M'\n",
+ "ms = 'M'\n",
+ "print age,sex,ms\n",
+ "#check for different cases and display appropriate result\n",
+ "if ms == 'M':\n",
+ " print(\"Driver is insured\")\n",
+ "else:\n",
+ " if sex == 'M':\n",
+ " if age > 30:\n",
+ " print (\"Driver is insured\")\n",
+ " else:\n",
+ " print (\"Driver is not insured\")\n",
+ " else:\n",
+ " if age > 25:\n",
+ " print (\"Driver is insured\")\n",
+ " else:\n",
+ " print (\"Driver is not insured\")\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter age, sex, marital status: \n",
+ "43 M M\n",
+ "Driver is insured\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.5 (Method 2) , Page number: 69<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Using logical operators'''\n",
+ "\n",
+ "#input from user\n",
+ "#age,sex,ms = raw_input(\"Enter age, sex, marital status: \").split() # Age , sex and marital status of the driver\n",
+ "print \"Enter age, sex, marital status: \"\n",
+ "age = 43 # Age of driver (years)\n",
+ "sex = 'M'\n",
+ "ms = 'M'\n",
+ "print age,sex,ms\n",
+ "\n",
+ "#check for different cases and display appropriate result\n",
+ "if ((ms == 'M') or (ms == 'U' and sex == 'M' and age > 30) or (ms == 'U' and sex == 'F' and age >25) ) :\n",
+ " print\"Driver is insured\"\n",
+ "else:\n",
+ " print\"Driver is not insured\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter age, sex, marital status: \n",
+ "43 M M\n",
+ "Driver is insured\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.6, Page number: 71<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Write a program to calculate the salary as per the given table'''\n",
+ "\n",
+ "#Input gender( m/f), years of service and qualification from the user\n",
+ "#g,yos,qual = raw_input(\"Enter Gender, Years of Service and Qualifications ( 0 = G, 1 = PG ):\").split()\n",
+ "print \"Enter Gender, Years of Service and Qualifications ( 0 = G, 1 = PG ):\"\n",
+ "g = 'f'\n",
+ "yos = 8 # Years of service(years)\n",
+ "qual = 1 # Qualification ( 0=G, 1=PG)\n",
+ "print g,yos,qual\n",
+ "\n",
+ "# Assign salary depending upon the conditions\n",
+ "if (g == 'm') and (yos >= 10) and (qual == 1):\n",
+ " sal = 15000 #salary\n",
+ "elif ((g == 'm' and yos >= 10 and qual == 0) or ( g == 'm' and yos < 10 and qual == 1 )):\n",
+ " sal = 10000 #salary\n",
+ "elif ( g == 'm' and yos < 10 and qual == 0 ):\n",
+ " sal = 7000 #salary\n",
+ "elif ( g == 'f' and yos >= 10 and qual == 1 ):\n",
+ " sal = 12000 #salary\n",
+ "elif ( g == 'f' and yos >= 10 and qual == 0 ):\n",
+ " sal = 9000 #salary\n",
+ "elif ( g == 'f' and yos < 10 and qual == 1 ):\n",
+ " sal = 10000 #salary\n",
+ "elif ( g == 'f' and yos < 10 and qual == 0 ):\n",
+ " sal = 6000 #salary\n",
+ "\n",
+ "#Result\n",
+ "print \"Salary of Employee = \", sal "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Gender, Years of Service and Qualifications ( 0 = G, 1 = PG ):\n",
+ "f 8 1\n",
+ "Salary of Employee = 10000\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-20.ipynb b/Let_us_C/chapter-20.ipynb
new file mode 100644
index 00000000..52b3cd37
--- /dev/null
+++ b/Let_us_C/chapter-20.ipynb
@@ -0,0 +1,181 @@
+{
+ "metadata": {
+ "name": "chapter-20.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 20: C Under Linux <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Fork , Page number: 655<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate how to create a child process'''\n",
+ "\n",
+ "import os\n",
+ "\n",
+ "print \"Before Forking\" \n",
+ "child = os.fork() #create a child process\n",
+ "print \"After Forking\\n\" \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Creating a Child Process , Page number: 656<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate how to create a child process'''\n",
+ "\n",
+ "import os\n",
+ "\n",
+ "pid = os.fork()\n",
+ "if pid == 0:\n",
+ " print \"In child process\" # code to play animated GIF file\n",
+ "else:\n",
+ " print \"In parent process\" #code to copy file \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>PID of Parent And Child Processes , Page number: 657<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to get the pids of parent and child processes'''\n",
+ "\n",
+ "import os\n",
+ "from multiprocessing import Process\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " ppid=os.getpid()\n",
+ " p = Process()\n",
+ " p.start()\n",
+ " cid = os.getpid()\n",
+ " \n",
+ "\n",
+ "if (cid):\n",
+ " print (\"Child : Hello I am the child process\")\n",
+ " print (\"Child : Child\u2019s PID: \", os.getpid( ) )\n",
+ " print (\"Child : Parent\u2019s PID: \", os.getppid( ) )\n",
+ "else:\n",
+ " print (\"Parent : Hello I am the parent process\" )\n",
+ " print (\"Parent : Parent\u2019s PID: \", os.getpid( ) )\n",
+ " print (\"Parent : Child\u2019s PID: \", cid )\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Execl , Page number: 659<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that uses execl( ) to run a new program in the child process.'''\n",
+ "\n",
+ "import os\n",
+ "\n",
+ "\n",
+ "pid = os.fork()\n",
+ "if pid == 0:\n",
+ " os.execl ( \"/bin/ls\",\"-al\", \"/etc\", NULL ) \n",
+ " print \"Child: After exec( )\"\n",
+ "else:\n",
+ " print \"Parent process\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Waitpid , Page number: 662<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that gets the exit code\n",
+ "of the terminated process and thereby ensures a proper cleanup.'''\n",
+ "\n",
+ "import os\n",
+ "\n",
+ "i = 0 \n",
+ "pid = os.fork( ) \n",
+ "if ( pid == 0 ):\n",
+ " while ( i < 4294967295 ):\n",
+ " i=i+1\n",
+ " print \"The child is now terminating\" \n",
+ "else:\n",
+ " os.waitpid ( pid, status, 0 )\n",
+ " if ( os.WIFEXITED ( status ) ):\n",
+ " print \"Parent: Child terminated normally\" \n",
+ " else:\n",
+ " print \"Parent: Child terminated abnormally\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-21.ipynb b/Let_us_C/chapter-21.ipynb
new file mode 100644
index 00000000..7cf37612
--- /dev/null
+++ b/Let_us_C/chapter-21.ipynb
@@ -0,0 +1,226 @@
+{
+ "metadata": {
+ "name": "chapter-21.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 21: More Linux Programming <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>SIGINT Example , Page number: 669<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to prevent the termination of a program even after hitting Ctrl + C'''\n",
+ "\n",
+ "import signal, os\n",
+ "\n",
+ "def sighandler ( signum,arg ):\n",
+ " print ( \"SIGINT received. Inside sighandler\" ) \n",
+ "\n",
+ "\n",
+ "signal.signal(signal.SIGINT,sighandler)\n",
+ "while ( 1 ):\n",
+ " print \"Program Running\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Handling Multiple Signals , Page number: 671<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to handle multiple signals.'''\n",
+ "\n",
+ "import signal, os\n",
+ "\n",
+ "def inthandler ( signum,arg ):\n",
+ " print \"SIGINT Received\" \n",
+ " \n",
+ "def termhandler ( signum ,arg):\n",
+ " print \"SIGTERM Received\" \n",
+ " \n",
+ "def conthandler ( signum,arg ):\n",
+ " print \"SIGCONT Received\" \n",
+ " \n",
+ "\n",
+ "signal.signal(signal.SIGINT,inthandler)\n",
+ "signal.signal(signal.SIGTERM,termhandler)\n",
+ "signal.signal(signal.SIGCONT,conthandler)\n",
+ "\n",
+ "while ( 1 ):\n",
+ " print \"Program Running\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Registering A Common Handler , Page number: 673<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a common signal handler to handle all signals\n",
+ "instead of registering a separate handler for each signal'''\n",
+ "\n",
+ "import signal, os\n",
+ "\n",
+ "def sighandler ( signum ,arg):\n",
+ " if(signum == SIGINT):\n",
+ " print \"SIGINT Received\" \n",
+ " elif(signum == SIGTERM):\n",
+ " print \"SIGTERM Received\" \n",
+ " elif(signum == SIGCONT):\n",
+ " print \"SIGCONT Received\" \n",
+ "\n",
+ "signal.signal(signal.SIGINT,sighandler)\n",
+ "signal.signal(signal.SIGTERM,sighandler)\n",
+ "signal.signal(signal.SIGCONT,sighandler)\n",
+ "\n",
+ "while ( 1 ):\n",
+ " print \"Program running\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Blocking Signals , Page number: 675<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to understand signal blocking '''\n",
+ "\n",
+ "import signal, os\n",
+ "\n",
+ "def sighandler ( signum ,arg):\n",
+ " if(signum == SIGINT):\n",
+ " print (\"SIGINT Received\") \n",
+ " elif(signum == SIGTERM):\n",
+ " print (\"SIGTERM Received\" )\n",
+ " elif(signum == SIGCONT):\n",
+ " print ( \"SIGCONT Received\" )\n",
+ "\n",
+ "buffer = \"\\0\"\n",
+ "signal.signal(signal.SIGINT,sighandler)\n",
+ "signal.signal(signal.SIGTERM,sighandler)\n",
+ "signal.signal(signal.SIGCONT,sighandler)\n",
+ "\n",
+ "signal.pthread_sigmask(signal.SIG_BLOCK, [])\n",
+ "\n",
+ "while ( buffer == \"\\0\" ):\n",
+ " buffer = input(\"Enter a string\")\n",
+ " print (buffer)\n",
+ "signal.pthread_sigmask(signal.SIG_UNBLOCK, [])\n",
+ "while(1):\n",
+ " print(\"Program running\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Event Driven Programming , Page number: 678<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that uses GTK toolkit to create a window on the screen.'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "class Example(Frame):\n",
+ " def __init__(self, parent):\n",
+ " Frame.__init__(self, parent)\n",
+ "\n",
+ " self.display = Canvas(self, width=700, height=200)\n",
+ " self.display.pack(side=\"top\", fill=\"both\", expand=True)\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " root = Tk()\n",
+ " root.title(\"Sample Window\")\n",
+ " Frame = Example(parent=root)\n",
+ " Frame.pack(side=\"top\", fill=\"both\", expand=True)\n",
+ " root.mainloop()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>MyShapes , Page number: 681<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to draw a few shapes in a window'''\n",
+ "\n",
+ "from tkinter import *\n",
+ "\n",
+ "\n",
+ "top = Tk()\n",
+ "top.title(\"Sample Window\")\n",
+ "C = Canvas(top, height=500, width=500)\n",
+ "rcoor = 10,20,200,100\n",
+ "rect = C.create_rectangle(rcoor,fill=\"black\")#rectangle\n",
+ "picoor = 250,0,350,100\n",
+ "pie = C.create_arc(picoor, start=300, extent=100, fill=\"black\")#pie\n",
+ "pocoor = 250, 150, 250, 300, 300, 350, 400, 300, 320, 190\n",
+ "polygon = C.create_polygon(pocoor,fill=\"black\")#polygon\n",
+ "C.pack()\n",
+ "top.mainloop()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-3.ipynb b/Let_us_C/chapter-3.ipynb
new file mode 100644
index 00000000..eae87c95
--- /dev/null
+++ b/Let_us_C/chapter-3.ipynb
@@ -0,0 +1,616 @@
+{
+ "metadata": {
+ "name": "chapter-3.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 3: The Loop Control Structure <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Simple Interest using While Loop, Page number: 99<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculation of simple interest for 3 sets of p, n and r (while loop)'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "count = 1\n",
+ "pr = [1000,2000,3500]\n",
+ "yr = [5,5,5]\n",
+ "intr = [13.5,13.5,3.5]\n",
+ "\n",
+ "# while loop\n",
+ "while count <= 3:\n",
+ " #Input from the user\n",
+ " #p,n,r = raw_input(\"Enter values of p, n and r : \").split()\n",
+ " p = pr[count-1] # principle\n",
+ " n = yr[count-1] # number of years\n",
+ " r = intr[count-1]# rate of interest\n",
+ "\n",
+ " #Calculation\n",
+ " si = p * n * r / 100 ; #formula for simple interest\n",
+ "\n",
+ " #Result\n",
+ " print \"Simple interest = Rs.\",si \n",
+ "\n",
+ " #Increment count\n",
+ " count = count + 1\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple interest = Rs. 675.0\n",
+ "Simple interest = Rs. 1350.0\n",
+ "Simple interest = Rs. 612.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Simple Interest using For Loop , Page number: 109<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculation of simple interest for 3 sets of p, n and r (for loop)'''\n",
+ "\n",
+ "pr = [1000,2000,3500]\n",
+ "yr = [5,5,5]\n",
+ "intr = [13.5,13.5,3.5]\n",
+ "\n",
+ "#for loop\n",
+ "for count in range(1, 4):\n",
+ " #Input from the user\n",
+ " #p,n,r = raw_input(\"Enter values of p, n and r : \").split()\n",
+ " p = pr[count-1] # principle\n",
+ " n = yr[count-1] # number of years\n",
+ " r = intr[count-1]# rate of interest\n",
+ " \n",
+ " #Calculation\n",
+ " si = p * n * r / 100 ; #formula for simple interest\n",
+ "\n",
+ " #Result\n",
+ " print \"Simple interest = Rs.\",si "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Simple interest = Rs. 675.0\n",
+ "Simple interest = Rs. 1350.0\n",
+ "Simple interest = Rs. 612.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Nested For Loops , Page number: 114<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Demonstration of nested loops'''\n",
+ "\n",
+ "#nested for loops\n",
+ "for r in range(1,4): #outer loop\n",
+ " for c in range(1,3): #inner loop\n",
+ " s = r + c #find the sum\n",
+ " print \"r = %d c = %d sum = %d\" % (r, c, s) #Display result\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r = 1 c = 1 sum = 2\n",
+ "r = 1 c = 2 sum = 3\n",
+ "r = 2 c = 1 sum = 3\n",
+ "r = 2 c = 2 sum = 4\n",
+ "r = 3 c = 1 sum = 4\n",
+ "r = 3 c = 2 sum = 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Do While Loop , Page number: 116<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Execution of a loop an unknown number of times'''\n",
+ "\n",
+ "#do while loop\n",
+ "while True:\n",
+ " #num = raw_input(\"Enter a number: \")\n",
+ " num = 11\n",
+ " print \"square of %d is %d\"%(num, num * num )\n",
+ " print \"Want to enter another number y/n: \" \n",
+ " another = 'n'\n",
+ " print another\n",
+ " if another == 'y':\n",
+ " continue\n",
+ " else:\n",
+ " break\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 11 is 121\n",
+ "Want to enter another number y/n: \n",
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Do While using For Loop, Page number: 117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''odd loop using a for loop'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "another = 'y'\n",
+ "\n",
+ "#do while loop\n",
+ "import sys\n",
+ "for i in range(1,10000): #infinte loop\n",
+ " #num = raw_input(\"Enter a number: \")\n",
+ " num = 11\n",
+ " print \"square of %d is %d\"%(num, num * num )\n",
+ " print \"Want to enter another number y/n: \" \n",
+ " another = 'n'\n",
+ " print another\n",
+ " if another == 'y':\n",
+ " continue\n",
+ " else:\n",
+ " break\n",
+ " \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 11 is 121\n",
+ "Want to enter another number y/n: \n",
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Do While using While Loop, Page number: 117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''odd loop using a while loop'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "another = 'y'\n",
+ "\n",
+ "#do while loop\n",
+ "while another == 'y':\n",
+ " #num = raw_input(\"Enter a number: \")\n",
+ " num = 11\n",
+ " print \"square of %d is %d\"%(num, num * num )\n",
+ " print \"Want to enter another number y/n: \" \n",
+ " another = 'n'\n",
+ " print another\n",
+ " \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "square of 11 is 121\n",
+ "Want to enter another number y/n: \n",
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Prime Number, Page number: 118<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Write a program to determine whether a number is prime or not.\n",
+ "A prime number is one, which is divisible only by 1 or itself.'''\n",
+ "\n",
+ "#Input from user\n",
+ "#num = raw_input(\"Enter a number: \")\n",
+ "num = 11\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 2\n",
+ "\n",
+ "#while loop\n",
+ "while i <=(num - 1):\n",
+ " if num % i == 0:\n",
+ " print \"Not a prime number\" #Display if not prime number\n",
+ " break\n",
+ " i += 1\n",
+ "\n",
+ "#Display if prime number\n",
+ "if i == num:\n",
+ " print \"Prime number\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Prime number\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Break Statement , Page number: 119<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''The following program illustrates the fact that the keyword break,\n",
+ "breaks the control only from the loop in which it is placed.'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 1\n",
+ "j = 1\n",
+ "\n",
+ "#while loops\n",
+ "while i <= 100 : #outer loop\n",
+ " i = i+1\n",
+ " while j <= 200 : #inner loop\n",
+ " j = j+1\n",
+ " if j == 150:\n",
+ " break #break statement in inner loop\n",
+ " else:\n",
+ " print i, j \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2 2\n",
+ "2 3\n",
+ "2 4\n",
+ "2 5\n",
+ "2 6\n",
+ "2 7\n",
+ "2 8\n",
+ "2 9\n",
+ "2 10\n",
+ "2 11\n",
+ "2 12\n",
+ "2 13\n",
+ "2 14\n",
+ "2 15\n",
+ "2 16\n",
+ "2 17\n",
+ "2 18\n",
+ "2 19\n",
+ "2 20\n",
+ "2 21\n",
+ "2 22\n",
+ "2 23\n",
+ "2 24\n",
+ "2 25\n",
+ "2 26\n",
+ "2 27\n",
+ "2 28\n",
+ "2 29\n",
+ "2 30\n",
+ "2 31\n",
+ "2 32\n",
+ "2 33\n",
+ "2 34\n",
+ "2 35\n",
+ "2 36\n",
+ "2 37\n",
+ "2 38\n",
+ "2 39\n",
+ "2 40\n",
+ "2 41\n",
+ "2 42\n",
+ "2 43\n",
+ "2 44\n",
+ "2 45\n",
+ "2 46\n",
+ "2 47\n",
+ "2 48\n",
+ "2 49\n",
+ "2 50\n",
+ "2 51\n",
+ "2 52\n",
+ "2 53\n",
+ "2 54\n",
+ "2 55\n",
+ "2 56\n",
+ "2 57\n",
+ "2 58\n",
+ "2 59\n",
+ "2 60\n",
+ "2 61\n",
+ "2 62\n",
+ "2 63\n",
+ "2 64\n",
+ "2 65\n",
+ "2 66\n",
+ "2 67\n",
+ "2 68\n",
+ "2 69\n",
+ "2 70\n",
+ "2 71\n",
+ "2 72\n",
+ "2 73\n",
+ "2 74\n",
+ "2 75\n",
+ "2 76\n",
+ "2 77\n",
+ "2 78\n",
+ "2 79\n",
+ "2 80\n",
+ "2 81\n",
+ "2 82\n",
+ "2 83\n",
+ "2 84\n",
+ "2 85\n",
+ "2 86\n",
+ "2 87\n",
+ "2 88\n",
+ "2 89\n",
+ "2 90\n",
+ "2 91\n",
+ "2 92\n",
+ "2 93\n",
+ "2 94\n",
+ "2 95\n",
+ "2 96\n",
+ "2 97\n",
+ "2 98\n",
+ "2 99\n",
+ "2 100\n",
+ "2 101\n",
+ "2 102\n",
+ "2 103\n",
+ "2 104\n",
+ "2 105\n",
+ "2 106\n",
+ "2 107\n",
+ "2 108\n",
+ "2 109\n",
+ "2 110\n",
+ "2 111\n",
+ "2 112\n",
+ "2 113\n",
+ "2 114\n",
+ "2 115\n",
+ "2 116\n",
+ "2 117\n",
+ "2 118\n",
+ "2 119\n",
+ "2 120\n",
+ "2 121\n",
+ "2 122\n",
+ "2 123\n",
+ "2 124\n",
+ "2 125\n",
+ "2 126\n",
+ "2 127\n",
+ "2 128\n",
+ "2 129\n",
+ "2 130\n",
+ "2 131\n",
+ "2 132\n",
+ "2 133\n",
+ "2 134\n",
+ "2 135\n",
+ "2 136\n",
+ "2 137\n",
+ "2 138\n",
+ "2 139\n",
+ "2 140\n",
+ "2 141\n",
+ "2 142\n",
+ "2 143\n",
+ "2 144\n",
+ "2 145\n",
+ "2 146\n",
+ "2 147\n",
+ "2 148\n",
+ "2 149\n",
+ "3 151\n",
+ "3 152\n",
+ "3 153\n",
+ "3 154\n",
+ "3 155\n",
+ "3 156\n",
+ "3 157\n",
+ "3 158\n",
+ "3 159\n",
+ "3 160\n",
+ "3 161\n",
+ "3 162\n",
+ "3 163\n",
+ "3 164\n",
+ "3 165\n",
+ "3 166\n",
+ "3 167\n",
+ "3 168\n",
+ "3 169\n",
+ "3 170\n",
+ "3 171\n",
+ "3 172\n",
+ "3 173\n",
+ "3 174\n",
+ "3 175\n",
+ "3 176\n",
+ "3 177\n",
+ "3 178\n",
+ "3 179\n",
+ "3 180\n",
+ "3 181\n",
+ "3 182\n",
+ "3 183\n",
+ "3 184\n",
+ "3 185\n",
+ "3 186\n",
+ "3 187\n",
+ "3 188\n",
+ "3 189\n",
+ "3 190\n",
+ "3 191\n",
+ "3 192\n",
+ "3 193\n",
+ "3 194\n",
+ "3 195\n",
+ "3 196\n",
+ "3 197\n",
+ "3 198\n",
+ "3 199\n",
+ "3 200\n",
+ "3 201\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Continue Statement , Page number: 120<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''The following program illustrates the use of the 'continue' statement'''\n",
+ "\n",
+ "#for loops\n",
+ "for i in range(1,3):\n",
+ " for j in range(1,3):\n",
+ " if i==j :\n",
+ " continue # continue statement\n",
+ " print i , j\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 2\n",
+ "2 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-4.ipynb b/Let_us_C/chapter-4.ipynb
new file mode 100644
index 00000000..d6b348c1
--- /dev/null
+++ b/Let_us_C/chapter-4.ipynb
@@ -0,0 +1,361 @@
+{
+ "metadata": {
+ "name": "chapter-4.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 4: The Case Control Structure<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Switch - Case, Page number: 137<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate switch-case control structure(without break)'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 2\n",
+ "\n",
+ "#Switch case statements\n",
+ "if i == 1: # case 1\n",
+ " print \"I am in case 1\"\n",
+ "else:\n",
+ " print \"I am in case 2\"# case 2\n",
+ " print \"I am in case 3\"#case 3\n",
+ " print \"I am in default\"# default\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case 2\n",
+ "I am in case 3\n",
+ "I am in default\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Switch - Case, Page number: 138<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate switch-case control structure'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 2\n",
+ "\n",
+ "#Switch case statements\n",
+ "if i == 1: # case 1\n",
+ " print \"I am in case 1\"\n",
+ "elif i == 2: # case 2\n",
+ " print \"I am in case 2\"\n",
+ "elif i == 3: #case 3\n",
+ " print \"I am in case 3\"\n",
+ "else: # default\n",
+ " print \"I am in default\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>The Tips and Traps a), Page number: 140<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''An example of scrambled case order'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 22\n",
+ "\n",
+ "#Switch case statements\n",
+ "if i == 121: # case 121\n",
+ " print \"I am in case 121\"\n",
+ "elif i == 7: # case 7\n",
+ " print \"I am in case 7\"\n",
+ "elif i == 22: #case 22\n",
+ " print \"I am in case 22\"\n",
+ "else: # default\n",
+ " print \"I am in default\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case 22\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>The Tips and Traps b), Page number: 140<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''An example which shows the use of 'char' values in case and switch'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "c = 'x'\n",
+ "\n",
+ "#Switch case statements\n",
+ "if c == 'v': # case 'v'\n",
+ " print \"I am in case v\"\n",
+ "elif c == 'a': # case 'a'\n",
+ " print \"I am in case a\"\n",
+ "elif c == 'x': #case 'x'\n",
+ " print \"I am in case x\"\n",
+ "else: # default\n",
+ " print \"I am in default\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in case x\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>The Tips and Traps c), Page number: 141<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''An example which shows how to execute a common set of statements for\n",
+ "multiple cases.'''\n",
+ "\n",
+ "#Input from user\n",
+ "#ch = raw_input(\"Enter any of the alphabet a, b, or c : \")\n",
+ "ch = 'a'\n",
+ "\n",
+ "#Switch case statements\n",
+ "if ch == 'a' or ch == 'A' : # case 'a' and case 'A'\n",
+ " print \"a as in ashar\"\n",
+ "elif ch == 'b'or ch == 'B': # case 'b' and case 'B'\n",
+ " print \"b as in brain\"\n",
+ "elif ch == 'c'or ch == 'C': # case 'c' and case 'C'\n",
+ " print \"c as in cookie\"\n",
+ "else: # default\n",
+ " print (\"wish you knew what are alphabets\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a as in ashar\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>The Tips and Traps e) , Page number: 143<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''An example that shows every statement in a switch must belong to some \n",
+ "case or the other. If it doesn\u2019t,the compiler won\u2019t report an error.\n",
+ "However, the statement would never get executed.'''\n",
+ "\n",
+ "#Input from user\n",
+ "#i = raw_input(\"Enter value of i \")\n",
+ "i = 1\n",
+ "\n",
+ "#Switch case statements\n",
+ "#print \"Hello\"\n",
+ "if i == 1 : # case 1\n",
+ " j = 10\n",
+ "elif i == 2 :# case 2\n",
+ " j = 20\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Goto , Page number: 146<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program shows how to use goto statement'''\n",
+ "'''Python doesnt support statements like 'goto' '''\n",
+ "#Input from user\n",
+ "#goals = raw_input(\"Enter the number of goals scored against India: \")\n",
+ "goals = 3\n",
+ "\n",
+ "if goals <= 5 : #goto\n",
+ " print \"To err is human!\" #label sos\n",
+ "else:\n",
+ " print \"About time soccer players learnt C\" \n",
+ " print \"and said goodbye! adieu! to soccer\" \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To err is human!\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Goto , Page number: 148<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''The following program illustrates the usage of 'goto'\n",
+ "when we want to take the control out of the loop that is contained in\n",
+ "several other loops.'''\n",
+ "\n",
+ "\n",
+ "#nested for loops\n",
+ "for i in range(1,4):\n",
+ " for j in range(1,4):\n",
+ " for k in range(1,4):\n",
+ " if ( i == 3 and j == 3 and k == 3 ): #goto\n",
+ " print \"Out of the loop at last!\" # label out\n",
+ " break\n",
+ " else:\n",
+ " print i, j, k "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1 1 1\n",
+ "1 1 2\n",
+ "1 1 3\n",
+ "1 2 1\n",
+ "1 2 2\n",
+ "1 2 3\n",
+ "1 3 1\n",
+ "1 3 2\n",
+ "1 3 3\n",
+ "2 1 1\n",
+ "2 1 2\n",
+ "2 1 3\n",
+ "2 2 1\n",
+ "2 2 2\n",
+ "2 2 3\n",
+ "2 3 1\n",
+ "2 3 2\n",
+ "2 3 3\n",
+ "3 1 1\n",
+ "3 1 2\n",
+ "3 1 3\n",
+ "3 2 1\n",
+ "3 2 2\n",
+ "3 2 3\n",
+ "3 3 1\n",
+ "3 3 2\n",
+ "Out of the loop at last!\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-5.ipynb b/Let_us_C/chapter-5.ipynb
new file mode 100644
index 00000000..62f0970a
--- /dev/null
+++ b/Let_us_C/chapter-5.ipynb
@@ -0,0 +1,804 @@
+{
+ "metadata": {
+ "name": "chapter-5.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 5: Functions & Pointers <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Message Function, Page number: 159<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate a simple function'''\n",
+ "\n",
+ "# function definition\n",
+ "def message():\n",
+ " print \"Smile, and the world smiles with you...\" \n",
+ "\n",
+ "message() #function call\n",
+ "print \"Cry, and you stop the monotony!\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smile, and the world smiles with you...\n",
+ "Cry, and you stop the monotony!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Calling More Than One Funnction , Page number: 159<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate a call to more than one function'''\n",
+ "\n",
+ "# function definitions\n",
+ "def italy():\n",
+ " print \"I am in italy\" \n",
+ " \n",
+ "def brazil():\n",
+ " print \"I am in brazil\" \n",
+ "\n",
+ "def argentina():\n",
+ " print \"I am in argentina\" \n",
+ " \n",
+ "\n",
+ "print \"I am in main\" \n",
+ "#function calls\n",
+ "italy()\n",
+ "brazil()\n",
+ "argentina()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in main\n",
+ "I am in italy\n",
+ "I am in brazil\n",
+ "I am in argentina\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Function Calling Function, Page number: 161<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate a call to more than one function'''\n",
+ "\n",
+ "# function definitions\n",
+ "def argentina():\n",
+ " print \"I am in argentina\" \n",
+ "\n",
+ "def brazil():\n",
+ " print \"I am in brazil\" \n",
+ " argentina() #function call\n",
+ "\n",
+ "def italy():\n",
+ " print \"I am in italy\" \n",
+ " brazil() #function call\n",
+ " print \"I am back in italy\" \n",
+ " \n",
+ "print \"I am in main\" \n",
+ "#function call\n",
+ "italy()\n",
+ "print \"I am finally back in main\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I am in main\n",
+ "I am in italy\n",
+ "I am in brazil\n",
+ "I am in argentina\n",
+ "I am back in italy\n",
+ "I am finally back in main\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Calsum Function , Page number: 166<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate sending and receiving values between functions'''\n",
+ "\n",
+ "# function definition\n",
+ "def calsum ( x, y, z ):\n",
+ " d = x + y + z\n",
+ " return d\n",
+ "\n",
+ "#Input from user\n",
+ "#a,b,c = raw_input (\"Enter any three numbers: \").split()\n",
+ "print \"Enter any three numbers: \"\n",
+ "a = 10\n",
+ "b = 20\n",
+ "c = 30\n",
+ "print a,b,c\n",
+ "\n",
+ "#function call\n",
+ "s = calsum(a,b,c) \n",
+ "\n",
+ "#Result\n",
+ "print \"Sum = \", s \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any three numbers: \n",
+ "10 20 30\n",
+ "Sum = 60\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Return Statement , Page number: 169<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate that there is no restriction on the number of return\n",
+ "statements that may be present in a function.\n",
+ "Also, the return statement need not always be present at the end of the called\n",
+ "function.'''\n",
+ "\n",
+ "# function definition\n",
+ "def fun():\n",
+ " #Input from user\n",
+ " #ch = raw_input (\"Enter any alphabet: \")\n",
+ " print \"Enter any alphabet: \"\n",
+ " ch = 'a'\n",
+ " print ch\n",
+ " ch = ord(ch)\n",
+ " if ch >= 65 and ch <= 90:\n",
+ " return ascii(ch)\n",
+ " else:\n",
+ " return ascii( ch + 32 )\n",
+ "\n",
+ "#function call\n",
+ "ch = fun()\n",
+ "\n",
+ "#Result\n",
+ "print ch\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Formal Arguments, Page number: 170<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate that If the value of a formal argument is\n",
+ "changed in the called function, the corresponding\n",
+ "change does not take place in the calling function.'''\n",
+ "\n",
+ "# function definition\n",
+ "def fun(b):\n",
+ " b = 60\n",
+ " print b \n",
+ "\n",
+ "a = 30\n",
+ "fun(a) #function call\n",
+ "print a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "60\n",
+ "30\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Scope Rule of Functions , Page number: 171<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate Scope Rule of Functions'''\n",
+ "\n",
+ "# function definition\n",
+ "def display(j):\n",
+ " k = 35\n",
+ " print j\n",
+ " print k\n",
+ "\n",
+ "i = 20 \n",
+ "display(i) #function call\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n",
+ "35\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Square Function , Page number: 176<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to find out square of a number using a function.'''\n",
+ "\n",
+ "# function definition\n",
+ "def square(x):\n",
+ " y = x * x\n",
+ " return y\n",
+ "\n",
+ "#Input from user\n",
+ "#a = raw_input(\"Enter any number: \")\n",
+ "print \"Enter any number: \"\n",
+ "a = 4.5\n",
+ "print a\n",
+ "\n",
+ "b = square(a) #function call\n",
+ "\n",
+ "#Result\n",
+ "print \"Square of %f is %f\" %( a, b )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number: \n",
+ "4.5\n",
+ "Square of 4.500000 is 20.250000\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Void Function , Page number: 177<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a called function without returning any value using\n",
+ "the keyword void.'''\n",
+ "\n",
+ "# function definition\n",
+ "def gospel(): # void function\n",
+ " print \"Viruses are electronic bandits...\" \n",
+ " print \"who eat nuggets of information...\" \n",
+ " print \"and chunks of bytes...\" \n",
+ " print \"when you least expect...\" \n",
+ "\n",
+ "gospel() # function call"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Viruses are electronic bandits...\n",
+ "who eat nuggets of information...\n",
+ "and chunks of bytes...\n",
+ "when you least expect...\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Address of a Variable , Page number: 180<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to print the address of a variable'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 3\n",
+ "\n",
+ "#Result\n",
+ "print \"Address of i = \" , id(i) #printing address\n",
+ "print \"Value of i = \", i \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i = 30301288\n",
+ "Value of i = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pointer Relations , Page number: 182<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that demonstrates the relationships between pointers , variables\n",
+ "and addresses'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 3 \n",
+ "j = id(i) # address of variable 'i'\n",
+ "\n",
+ "#Result\n",
+ "print \"Address of i = \", id(i) \n",
+ "print \"Address of i = \", j \n",
+ "print \"Address of j = \", id(j)\n",
+ "print \"Value of j = \", j \n",
+ "print \"Value of i = \", i \n",
+ "print \"Value of i = \", i \n",
+ "print \"Value of i = \", i \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i = 30301288\n",
+ "Address of i = 30301288\n",
+ "Address of j = 134133200\n",
+ "Value of j = 30301288\n",
+ "Value of i = 3\n",
+ "Value of i = 3\n",
+ "Value of i = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pointer to Another Pointer , Page number: 184<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that demonstrates a pointer that\n",
+ "points to another pointer'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 3\n",
+ "j = id(i) # address of i\n",
+ "k = id(j) # address of j\n",
+ "\n",
+ "#Result\n",
+ "print \"Address of i = \", id(i) \n",
+ "print \"Address of i = \", j \n",
+ "print \"Address of i = \", j \n",
+ "print \"Address of j = \", id(j) \n",
+ "print \"Address of j = \", k \n",
+ "print \"Address of k = \", id(k)\n",
+ "print \"Value of j = \", j \n",
+ "print \"Value of k = \", k \n",
+ "print \"Value of i = \", i \n",
+ "print \"Value of i = \", i \n",
+ "print \"Value of i = \", i \n",
+ "print \"Value of i = \", i "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of i = 30301288\n",
+ "Address of i = 30301288\n",
+ "Address of i = 30301288\n",
+ "Address of j = 134132944\n",
+ "Address of j = 134132944\n",
+ "Address of k = 134133200\n",
+ "Value of j = 30301288\n",
+ "Value of k = 134132944\n",
+ "Value of i = 3\n",
+ "Value of i = 3\n",
+ "Value of i = 3\n",
+ "Value of i = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Call By Value , Page number: 186<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the \u2018Call by Value\u2019 method of passing arguments'''\n",
+ "\n",
+ "# function definition\n",
+ "def swapv (x,y):\n",
+ " x,y=y,x\n",
+ " print \"x = %d y = %d\" %( x, y )\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 10\n",
+ "b = 20\n",
+ "\n",
+ "swapv ( a, b ) # function call\n",
+ "\n",
+ "#Result\n",
+ "print \"a = %d b = %d\" %( a, b )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 20 y = 10\n",
+ "a = 10 b = 20\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Call By Reference , Page number: 187<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the \u2018Call by Reference\u2019 method of passing arguments'''\n",
+ "\n",
+ "# function definition\n",
+ "def swapv (a,b):\n",
+ " a,b=b,a\n",
+ " return a,b\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 10\n",
+ "b = 20\n",
+ "\n",
+ "a,b = swapv ( a, b ) # function call\n",
+ "\n",
+ "#Result\n",
+ "print \"a = %d b = %d\" %( a, b )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a = 20 b = 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Area And Perimeter of a Circle , Page number: 188<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate how to use a call by reference to make a function\n",
+ "return more than one value at a time, which is not possible ordinarily.'''\n",
+ "\n",
+ "#Input from user\n",
+ "#radius = raw_input(\"Enter radius of a circle: \" )\n",
+ "print \"Enter radius of a circle: \"\n",
+ "radius = 5\n",
+ "print radius\n",
+ "\n",
+ "#Function definition\n",
+ "def areaperi ( r ):\n",
+ " a = 3.14 * r * r\n",
+ " p = 2 * 3.14 * r \n",
+ " return a,p\n",
+ "\n",
+ "area,perimeter = areaperi ( radius ) #function call\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Area = \", area \n",
+ "print \"Perimeter = \", perimeter "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter radius of a circle: \n",
+ "5\n",
+ "Area = 78.5\n",
+ "Perimeter = 31.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Iterative Factorial Function , Page number: 190<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a non-recursive function for calculating\n",
+ "the factorial value of an integer'''\n",
+ "\n",
+ "# function definition\n",
+ "def factorial(x):\n",
+ " f = 1\n",
+ " for i in range(x,0,-1 ):\n",
+ " f = f * i\n",
+ " return f\n",
+ "\n",
+ "#Input from user\n",
+ "#a = raw_input( \"Enter any number: \" )\n",
+ "print \"Enter any number: \"\n",
+ "a = 6\n",
+ "print a\n",
+ "\n",
+ "fact = factorial(a) #function call\n",
+ "\n",
+ "#Result\n",
+ "print \"Factorial value = \", fact\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number: \n",
+ "6\n",
+ "Factorial value = 720\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Recursive Factorial Function, Page number: 191<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a the recursive version of\n",
+ "the function to calculate the factorial value.'''\n",
+ "\n",
+ "# function definition\n",
+ "def rec(x):\n",
+ " if x == 1:\n",
+ " return 1\n",
+ " else:\n",
+ " f = x * rec ( x - 1 ) # calling the function\n",
+ " return f\n",
+ "\n",
+ "#Input from user\n",
+ "#a = raw_input( \"Enter any number: \" )\n",
+ "print \"Enter any number: \"\n",
+ "a = 5\n",
+ "print a\n",
+ "\n",
+ "fact = rec(a) #function call\n",
+ "\n",
+ "#Result\n",
+ "print \"Factorial value = \", fact \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter any number: \n",
+ "5\n",
+ "Factorial value = 120\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Recursion Stack , Page number: 195<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the use of a stack for\n",
+ "implementing function calls'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 5\n",
+ "b = 2\n",
+ "\n",
+ "#Function definition\n",
+ "def add ( i, j ):\n",
+ " s = i + j\n",
+ " return s\n",
+ "\n",
+ "c = add ( a, b ) # function call\n",
+ "\n",
+ "#Result\n",
+ "print \"sum = \", c "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sum = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-6.ipynb b/Let_us_C/chapter-6.ipynb
new file mode 100644
index 00000000..7cf66240
--- /dev/null
+++ b/Let_us_C/chapter-6.ipynb
@@ -0,0 +1,683 @@
+{
+ "metadata": {
+ "name": "chapter-6.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 6: Data Types Revisted <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>char Example, Page number: 218<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the range of char'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "ch = 291\n",
+ "\n",
+ "#Result\n",
+ "print \"%d %c\" %( ch, (ch%128) ) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "291 #\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Range of char, Page number: 218<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the range of an unsigned char'''\n",
+ "\n",
+ "for ch in range(0,256):\n",
+ " print \"%d %c\" %(ch, ch%128 )\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 \u0000\n",
+ "1 \u0001\n",
+ "2 \u0002\n",
+ "3 \u0003\n",
+ "4 \u0004\n",
+ "5 \u0005\n",
+ "6 \u0006\n",
+ "7 \u0007\n",
+ "8 \b\n",
+ "9 \t\n",
+ "10 \n",
+ "\n",
+ "11 \u000b",
+ "\n",
+ "12 \f",
+ "\n",
+ "13 \r\n",
+ "14 \u000e\n",
+ "15 \u000f\n",
+ "16 \u0010\n",
+ "17 \u0011\n",
+ "18 \u0012\n",
+ "19 \u0013\n",
+ "20 \u0014\n",
+ "21 \u0015\n",
+ "22 \u0016\n",
+ "23 \u0017\n",
+ "24 \u0018\n",
+ "25 \u0019\n",
+ "26 \u001a\n",
+ "27 \u001b\n",
+ "28 \u001c",
+ "\n",
+ "29 \u001d",
+ "\n",
+ "30 \u001e",
+ "\n",
+ "31 \u001f\n",
+ "32 \n",
+ "33 !\n",
+ "34 \"\n",
+ "35 #\n",
+ "36 $\n",
+ "37 %\n",
+ "38 &\n",
+ "39 '\n",
+ "40 (\n",
+ "41 )\n",
+ "42 *\n",
+ "43 +\n",
+ "44 ,\n",
+ "45 -\n",
+ "46 .\n",
+ "47 /\n",
+ "48 0\n",
+ "49 1\n",
+ "50 2\n",
+ "51 3\n",
+ "52 4\n",
+ "53 5\n",
+ "54 6\n",
+ "55 7\n",
+ "56 8\n",
+ "57 9\n",
+ "58 :\n",
+ "59 ;\n",
+ "60 <\n",
+ "61 =\n",
+ "62 >\n",
+ "63 ?\n",
+ "64 @\n",
+ "65 A\n",
+ "66 B\n",
+ "67 C\n",
+ "68 D\n",
+ "69 E\n",
+ "70 F\n",
+ "71 G\n",
+ "72 H\n",
+ "73 I\n",
+ "74 J\n",
+ "75 K\n",
+ "76 L\n",
+ "77 M\n",
+ "78 N\n",
+ "79 O\n",
+ "80 P\n",
+ "81 Q\n",
+ "82 R\n",
+ "83 S\n",
+ "84 T\n",
+ "85 U\n",
+ "86 V\n",
+ "87 W\n",
+ "88 X\n",
+ "89 Y\n",
+ "90 Z\n",
+ "91 [\n",
+ "92 \\\n",
+ "93 ]\n",
+ "94 ^\n",
+ "95 _\n",
+ "96 `\n",
+ "97 a\n",
+ "98 b\n",
+ "99 c\n",
+ "100 d\n",
+ "101 e\n",
+ "102 f\n",
+ "103 g\n",
+ "104 h\n",
+ "105 i\n",
+ "106 j\n",
+ "107 k\n",
+ "108 l\n",
+ "109 m\n",
+ "110 n\n",
+ "111 o\n",
+ "112 p\n",
+ "113 q\n",
+ "114 r\n",
+ "115 s\n",
+ "116 t\n",
+ "117 u\n",
+ "118 v\n",
+ "119 w\n",
+ "120 x\n",
+ "121 y\n",
+ "122 z\n",
+ "123 {\n",
+ "124 |\n",
+ "125 }\n",
+ "126 ~\n",
+ "127 \u007f\n",
+ "128 \u0000\n",
+ "129 \u0001\n",
+ "130 \u0002\n",
+ "131 \u0003\n",
+ "132 \u0004\n",
+ "133 \u0005\n",
+ "134 \u0006\n",
+ "135 \u0007\n",
+ "136 \b\n",
+ "137 \t\n",
+ "138 \n",
+ "\n",
+ "139 \u000b",
+ "\n",
+ "140 \f",
+ "\n",
+ "141 \r\n",
+ "142 \u000e\n",
+ "143 \u000f\n",
+ "144 \u0010\n",
+ "145 \u0011\n",
+ "146 \u0012\n",
+ "147 \u0013\n",
+ "148 \u0014\n",
+ "149 \u0015\n",
+ "150 \u0016\n",
+ "151 \u0017\n",
+ "152 \u0018\n",
+ "153 \u0019\n",
+ "154 \u001a\n",
+ "155 \u001b\n",
+ "156 \u001c",
+ "\n",
+ "157 \u001d",
+ "\n",
+ "158 \u001e",
+ "\n",
+ "159 \u001f\n",
+ "160 \n",
+ "161 !\n",
+ "162 \"\n",
+ "163 #\n",
+ "164 $\n",
+ "165 %\n",
+ "166 &\n",
+ "167 '\n",
+ "168 (\n",
+ "169 )\n",
+ "170 *\n",
+ "171 +\n",
+ "172 ,\n",
+ "173 -\n",
+ "174 .\n",
+ "175 /\n",
+ "176 0\n",
+ "177 1\n",
+ "178 2\n",
+ "179 3\n",
+ "180 4\n",
+ "181 5\n",
+ "182 6\n",
+ "183 7\n",
+ "184 8\n",
+ "185 9\n",
+ "186 :\n",
+ "187 ;\n",
+ "188 <\n",
+ "189 =\n",
+ "190 >\n",
+ "191 ?\n",
+ "192 @\n",
+ "193 A\n",
+ "194 B\n",
+ "195 C\n",
+ "196 D\n",
+ "197 E\n",
+ "198 F\n",
+ "199 G\n",
+ "200 H\n",
+ "201 I\n",
+ "202 J\n",
+ "203 K\n",
+ "204 L\n",
+ "205 M\n",
+ "206 N\n",
+ "207 O\n",
+ "208 P\n",
+ "209 Q\n",
+ "210 R\n",
+ "211 S\n",
+ "212 T\n",
+ "213 U\n",
+ "214 V\n",
+ "215 W\n",
+ "216 X\n",
+ "217 Y\n",
+ "218 Z\n",
+ "219 [\n",
+ "220 \\\n",
+ "221 ]\n",
+ "222 ^\n",
+ "223 _\n",
+ "224 `\n",
+ "225 a\n",
+ "226 b\n",
+ "227 c\n",
+ "228 d\n",
+ "229 e\n",
+ "230 f\n",
+ "231 g\n",
+ "232 h\n",
+ "233 i\n",
+ "234 j\n",
+ "235 k\n",
+ "236 l\n",
+ "237 m\n",
+ "238 n\n",
+ "239 o\n",
+ "240 p\n",
+ "241 q\n",
+ "242 r\n",
+ "243 s\n",
+ "244 t\n",
+ "245 u\n",
+ "246 v\n",
+ "247 w\n",
+ "248 x\n",
+ "249 y\n",
+ "250 z\n",
+ "251 {\n",
+ "252 |\n",
+ "253 }\n",
+ "254 ~\n",
+ "255 \u007f\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Scope and Life of Automatic Variable, Page number: 225<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the scope and life of an automatic variable'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 1 #auto int\n",
+ "\n",
+ "def b2 (i):\n",
+ " print i \n",
+ "\n",
+ "def b3 (i):\n",
+ " print i \n",
+ "\n",
+ "\n",
+ "def b1 (i):\n",
+ " print i \n",
+ " b2(i)\n",
+ " b3(i)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "b1(i)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "1\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Scope and Life of Automatic Variable, Page number: 226<h3>\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the scope and life of an automatic variable'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 1 #auto int\n",
+ "\n",
+ "def b2 (i):\n",
+ " i = 2 # auto int \n",
+ " print i \n",
+ "\n",
+ "def b3 (i):\n",
+ " i = 3 #auto int \n",
+ " print i \n",
+ "\n",
+ "\n",
+ "def b1 (i):\n",
+ " b3(i)\n",
+ " b2(i)\n",
+ " print i \n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "b1(i)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n",
+ "2\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Different Data Types, Page number: 220<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that puts to use all the data types'''\n",
+ "\n",
+ "#char\n",
+ "#c,d = raw_input(\"char: \").split()\n",
+ "c = 'a'\n",
+ "d = 'b'\n",
+ "print \"%c %c\" %( c, d )\n",
+ "\n",
+ "#int \n",
+ "#i,j = raw_input( \"int: \").split()\n",
+ "i = 333\n",
+ "j = 288\n",
+ "print \"%d %u\"%( i, j ) \n",
+ "\n",
+ "#short int \n",
+ "#,l = raw_input( \"short int: \" ).split()\n",
+ "k = 2\n",
+ "l = 1\n",
+ "print \"%d %u \" %(k, l ) \n",
+ "\n",
+ "#long int \n",
+ "#m,n = raw_input( \"long int: \" ).split()\n",
+ "m = 73277727727\n",
+ "n = 189189819891\n",
+ "print \"%ld %lu\"%( m, n ) \n",
+ "\n",
+ "\n",
+ "#float, double, long double\n",
+ "from decimal import Decimal \n",
+ "#x,y,z = raw_input ( \"float double long double: \").split()\n",
+ "x = 72.12\n",
+ "y = Decimal(8282910.0109010)\n",
+ "z = Decimal(29189999111.128918918)\n",
+ "print x, y, z "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a b\n",
+ "333 288\n",
+ "2 1 \n",
+ "73277727727 189189819891\n",
+ "72.12 8282910.0109010003507137298583984375 29189999111.128917694091796875\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Auto Increment, Page number: 228<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to understand the difference\n",
+ "between the automatic and static storage classes.'''\n",
+ "\n",
+ "#function definition \n",
+ "def increment( ):\n",
+ " i = 1 #auto int\n",
+ " print i \n",
+ " i = i + 1 \n",
+ "\n",
+ "#function calls\n",
+ "increment( )\n",
+ "increment( )\n",
+ "increment( )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "1\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Static Increment, Page number: 228<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to understand the difference\n",
+ "between the automatic and static storage classes.'''\n",
+ "\n",
+ "#function definition \n",
+ "def increment(i = [1]): #static int \n",
+ " print i[0] \n",
+ " i[0] += 1 \n",
+ "\n",
+ "#function calls\n",
+ "increment()\n",
+ "increment()\n",
+ "increment()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Static Storage Class, Page number: 229<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the advantages of using static storage class'''\n",
+ "\n",
+ "\n",
+ "#function definition\n",
+ "def fun( ):\n",
+ " k = 35 \n",
+ " return (k)\n",
+ "\n",
+ "j = fun( ) #function call\n",
+ "print j #result\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "35\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>External Storage Class, Page number: 231<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the extrnal storage class'''\n",
+ "\n",
+ "#Variable declaration \n",
+ "i = [0] # external variable\n",
+ "\n",
+ "#Function definitions \n",
+ "def increment(i = [0]):\n",
+ " i[0] += 1\n",
+ " print \"on incrementing i = \", i[0] \n",
+ "\n",
+ "\n",
+ "def decrement(i = [2]):\n",
+ " i[0] -= 1\n",
+ " print \"on decrementing i = \", i[0] \n",
+ " \n",
+ "\n",
+ "\n",
+ "print \"i = \", i[0]\n",
+ "#function calls\n",
+ "increment() \n",
+ "increment() \n",
+ "decrement() \n",
+ "decrement() "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i = 0\n",
+ "on incrementing i = 1\n",
+ "on incrementing i = 2\n",
+ "on decrementing i = 1\n",
+ "on decrementing i = 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-7.ipynb b/Let_us_C/chapter-7.ipynb
new file mode 100644
index 00000000..9024266b
--- /dev/null
+++ b/Let_us_C/chapter-7.ipynb
@@ -0,0 +1,210 @@
+{
+ "metadata": {
+ "name": "chapter-7..ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 7: The C Preprocessor<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Macro Expansion, Page number: 244<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate macros'''\n",
+ "\n",
+ "#Macro declaration\n",
+ "UPPER = 25\n",
+ "\n",
+ "for i in range(1,UPPER+1): #macro expansion\n",
+ " print(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "10\n",
+ "11\n",
+ "12\n",
+ "13\n",
+ "14\n",
+ "15\n",
+ "16\n",
+ "17\n",
+ "18\n",
+ "19\n",
+ "20\n",
+ "21\n",
+ "22\n",
+ "23\n",
+ "24\n",
+ "25\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Macro Definition, Page number: 244<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate macros'''\n",
+ "\n",
+ "#Macro declaration\n",
+ "PI = 3.1415\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6.25 \n",
+ "\n",
+ "#Calculation\n",
+ "area = PI * r * r\n",
+ "\n",
+ "#Result\n",
+ "print \"Area of circle = \", area \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of circle = 122.71484375\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Macros with Arguments, Page number: 248<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate macros with arguments'''\n",
+ "\n",
+ "#Macro declaration\n",
+ "def AREA(x): #define AREA(x) ( 3.14 * x * x )\n",
+ " return(3.14 * x * x )\n",
+ "\n",
+ "#Variable declaration\n",
+ "r1 = 6.25\n",
+ "r2 = 2.5\n",
+ "\n",
+ "#Result\n",
+ "a = AREA(r1)\n",
+ "print \"Area of circle = \", a \n",
+ "a = AREA(r2) \n",
+ "print \"Area of circle = \", a\n",
+ " \n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of circle = 122.65625\n",
+ "Area of circle = 19.625\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Macros with Arguments, Page number: 249<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate macros with arguments'''\n",
+ "\n",
+ "#Macro declaration\n",
+ "def ISDIGIT(y): #define ISDIGIT(y) ( y >= 48 && y <= 57 )\n",
+ " return( y >= 48 and y <= 57 )\n",
+ "\n",
+ "#Input from user\n",
+ "#ch = raw_input(\"Enter any digit \")\n",
+ "ch = 'a'\n",
+ "\n",
+ "#Result\n",
+ "if ISDIGIT ( ch ):\n",
+ " print \"You entered a digit\" \n",
+ "else:\n",
+ " print \"Illegal input\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Illegal input\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-8.ipynb b/Let_us_C/chapter-8.ipynb
new file mode 100644
index 00000000..3c03d537
--- /dev/null
+++ b/Let_us_C/chapter-8.ipynb
@@ -0,0 +1,936 @@
+{
+ "metadata": {
+ "name": "chapter-8.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 8: Arrays <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Average Marks, Page number: 272<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to find average marks obtained by a class of 30 students in a test'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 0\n",
+ "marks = [] # array declaration\n",
+ "\n",
+ "#for i in range(0,30):\n",
+ " # marks.append(int(raw_input(\"Enter marks: \" ))) # store data in array\n",
+ "marks = [89,85,57,25,90,45,87,48,98,12,39,66,75,30,87,100,5,78,56,99,84,0,39,79,93,61,87,45,90,56] \n",
+ "print \"Enter marks: \"\n",
+ "for i in range(0,30):\n",
+ " print marks[i]\n",
+ "\n",
+ "for i in range(0,30):\n",
+ " s = s + marks[i] # read data from array\n",
+ "\n",
+ "#Calculation\n",
+ "avg = s / 30 #Average formula\n",
+ "\n",
+ "#Result\n",
+ "print \"Average marks = \", avg \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter marks: \n",
+ "89\n",
+ "85\n",
+ "57\n",
+ "25\n",
+ "90\n",
+ "45\n",
+ "87\n",
+ "48\n",
+ "98\n",
+ "12\n",
+ "39\n",
+ "66\n",
+ "75\n",
+ "30\n",
+ "87\n",
+ "100\n",
+ "5\n",
+ "78\n",
+ "56\n",
+ "99\n",
+ "84\n",
+ "0\n",
+ "39\n",
+ "79\n",
+ "93\n",
+ "61\n",
+ "87\n",
+ "45\n",
+ "90\n",
+ "56\n",
+ "Average marks = 63\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Call By Value, Page number: 277<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate call by value by passing values of\n",
+ "array elements to the function'''\n",
+ "\n",
+ "#Funcion definition\n",
+ "def display(m):\n",
+ " print m \n",
+ " \n",
+ "#Variable declaration\n",
+ "marks = [ 55, 65, 75, 56, 78, 78, 90 ] #array\n",
+ "\n",
+ "for i in range(0,7):\n",
+ " display(marks[i]) #function call \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55\n",
+ "65\n",
+ "75\n",
+ "56\n",
+ "78\n",
+ "78\n",
+ "90\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Call By Reference , Page number: 278<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate call by reference by passing values of\n",
+ "array elements to the function'''\n",
+ "\n",
+ "#Funcion definition\n",
+ "def display(n):\n",
+ " print n #return\n",
+ " \n",
+ "#Variable declaration\n",
+ "marks = [ 55, 65, 75, 56, 78, 78, 90 ] #array\n",
+ "\n",
+ "for i in range(0,7):\n",
+ " display(marks[i]) #function call\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "55\n",
+ "65\n",
+ "75\n",
+ "56\n",
+ "78\n",
+ "78\n",
+ "90\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pointer Arithmetic, Page number: 279<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the relationship between\n",
+ "pointers and arrays'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "i = 3\n",
+ "j = 1.5\n",
+ "k = 'c'\n",
+ "\n",
+ "print \"Value of i = \", i \n",
+ "print \"Value of j = \", j \n",
+ "print \"Value of k = \", k \n",
+ "\n",
+ "#addresses of the variables\n",
+ "x = id(i)\n",
+ "y = id(j)\n",
+ "z = id(k)\n",
+ "\n",
+ "print \"Original address in x = \", x \n",
+ "print \"Original address in y = \", y \n",
+ "print \"Original address in z = \", z \n",
+ "\n",
+ "x += 2\n",
+ "y += 4\n",
+ "z += 1\n",
+ "\n",
+ "print \"New address in x = \", x \n",
+ "print \"New address in y = \", y \n",
+ "print \"New address in z = \", z \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of i = 3\n",
+ "Value of j = 1.5\n",
+ "Value of k = c\n",
+ "Original address in x = 32529512\n",
+ "Original address in y = 105587440\n",
+ "Original address in z = 32744192\n",
+ "New address in x = 32529514\n",
+ "New address in y = 105587444\n",
+ "New address in z = 32744193\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pointer Subtraction , Page number: 281<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to calculate the number of bytes\n",
+ "separating the corresponding array elements'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "arr = [ 10, 20, 30, 45, 67, 56, 74 ]\n",
+ "i = id(arr[1]) #address \n",
+ "j = id(arr[5]) #Address\n",
+ "\n",
+ "#Result\n",
+ "print j - i, arr[5] - arr[1] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1128 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pointer Comparison, Page number: 282<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate comparison of 2 pointer variables'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "arr = [ 10, 20, 36, 72, 45, 36 ]\n",
+ "j = id(arr[ 4 ])\n",
+ "k = id( arr[0 + 4] )\n",
+ "\n",
+ "#Result \n",
+ "if j == k : #comparison\n",
+ " print \"The two pointers point to the same location\" \n",
+ "else:\n",
+ " print \"The two pointers do not point to the same location\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The two pointers point to the same location\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Memory Locations, Page number: 283<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program that prints out the memory locations\n",
+ "in which the elements of the array are stored'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "num = [ 24, 34, 12, 44, 56, 17]\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,6):\n",
+ " print \"element no. \", i \n",
+ " print \"address = \", id(num[i]) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "element no. 0\n",
+ "address = 32529008\n",
+ "element no. 1\n",
+ "address = 32528768\n",
+ "element no. 2\n",
+ "address = 32529296\n",
+ "element no. 3\n",
+ "address = 32530520\n",
+ "element no. 4\n",
+ "address = 32530232\n",
+ "element no. 5\n",
+ "address = 32529176\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Accessing Array Elements , Page number: 284<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program shows a way in which we can access the elements of an array.'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "num = [ 24, 34, 12, 44, 56, 17]\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,6):\n",
+ " print \"address = \", id(num[i]) \n",
+ " print \"element = \", num[i] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address = 32529008\n",
+ "element = 24\n",
+ "address = 32528768\n",
+ "element = 34\n",
+ "address = 32529296\n",
+ "element = 12\n",
+ "address = 32530520\n",
+ "element = 44\n",
+ "address = 32530232\n",
+ "element = 56\n",
+ "address = 32529176\n",
+ "element = 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Accessing Array Elements Using Pointers, Page number: 284<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program shows a way in which we can access the elements of an array using\n",
+ "pointers'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "num = [ 24, 34, 12, 44, 56, 17]\n",
+ "j = id(num[0]) # assign address of zeroth element\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,6):\n",
+ " print \"address = \", j \n",
+ " print \"element = \", num[i] \n",
+ " j = id(num[(i+1)%6]) # increment pointer to point to next location \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address = 32529008\n",
+ "element = 24\n",
+ "address = 32528768\n",
+ "element = 34\n",
+ "address = 32529296\n",
+ "element = 12\n",
+ "address = 32530520\n",
+ "element = 44\n",
+ "address = 32530232\n",
+ "element = 56\n",
+ "address = 32529176\n",
+ "element = 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Passing An Array to a Function , Page number: 286<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the of passing an entire array to a function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "num = [ 24, 34, 12, 44, 56, 17 ]\n",
+ "\n",
+ "#Function definition:\n",
+ "def display ( j,n ):\n",
+ " for i in range(0,n):\n",
+ " print \"element = \", j\n",
+ " j = num[(i+1)%n] #increment pointer to point to next element \n",
+ "\n",
+ "display ( num[0], 6 ) #function call\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "element = 24\n",
+ "element = 34\n",
+ "element = 12\n",
+ "element = 44\n",
+ "element = 56\n",
+ "element = 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Accessing Array Elements in Different Ways, Page number: 288<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate accessing array elements in different ways '''\n",
+ "\n",
+ "#Variable declaration\n",
+ "num = [ 24, 34, 12, 44, 56, 17]\n",
+ "\n",
+ "for i in range(0,6):\n",
+ " print \"address = \", id(num[i])\n",
+ " print \"element = \", num[i], num[(0+ i)]\n",
+ " print num[(i+0)], num[i] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "address = 32529008\n",
+ "element = 24 24\n",
+ "24 24\n",
+ "address = 32528768\n",
+ "element = 34 34\n",
+ "34 34\n",
+ "address = 32529296\n",
+ "element = 12 12\n",
+ "12 12\n",
+ "address = 32530520\n",
+ "element = 44 44\n",
+ "44 44\n",
+ "address = 32530232\n",
+ "element = 56 56\n",
+ "56 56\n",
+ "address = 32529176\n",
+ "element = 17 17\n",
+ "17 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Two Dimensional Array , Page number: 289<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate two dimensional arrays'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "stud = [] #array\n",
+ "\n",
+ "#for i in range(0,4):\n",
+ " # stud.append((raw_input(\"Enter roll no and marks: \").split())) # storing data in the 2D array\n",
+ "\n",
+ "stud = [\"1 38\",\"2 78\",\"3 93\",\"4 48\"]\n",
+ "for i in range (0,4):\n",
+ " print \"Enter roll no and marks: \"\n",
+ " print stud[i]\n",
+ " \n",
+ "#Result\n",
+ "for i in range(0,4):\n",
+ " print stud[i][0],stud[i][1:] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter roll no and marks: \n",
+ "1 38\n",
+ "Enter roll no and marks: \n",
+ "2 78\n",
+ "Enter roll no and marks: \n",
+ "3 93\n",
+ "Enter roll no and marks: \n",
+ "4 48\n",
+ "1 38\n",
+ "2 78\n",
+ "3 93\n",
+ "4 48\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>2-D Array Demo , Page number: 293<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate that a 2-D array is an array of arrays '''\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = [ [1234, 56 ], [ 1212, 33], [ 1434, 80 ], [ 1312, 78 ]]\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,4):\n",
+ " print \"Address of %d th 1-D array = %u\"%( i, id(s[i]) )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Address of 0 th 1-D array = 134002248\n",
+ "Address of 1 th 1-D array = 134654472\n",
+ "Address of 2 th 1-D array = 134791816\n",
+ "Address of 3 th 1-D array = 134792008\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Accessing 2-D Array Elements, Page number: 295<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the use of pointer\n",
+ "notation to access 2-D array elements'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = [ [ 1234, 56 ], [ 1212, 33 ], [ 1434, 80 ], [ 1312, 78 ] ]\n",
+ "\n",
+ "for i in range(0,4):\n",
+ " for j in range(0,2):\n",
+ " print s[i][j] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1234\n",
+ "56\n",
+ "1212\n",
+ "33\n",
+ "1434\n",
+ "80\n",
+ "1312\n",
+ "78\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Pointer To An Array , Page number: 296<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the usage of pointer to an array'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = [ [ 1234, 56 ], [ 1212, 33 ], [ 1434, 80 ], [ 1312, 78 ]]\n",
+ "\n",
+ "#Result\n",
+ "for i in range(0,4):\n",
+ " p = s[i]\n",
+ " pint = p\n",
+ " print \"\\n\" \n",
+ " for j in range(0,2):\n",
+ " print pint[j] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "1234\n",
+ "56\n",
+ "\n",
+ "\n",
+ "1212\n",
+ "33\n",
+ "\n",
+ "\n",
+ "1434\n",
+ "80\n",
+ "\n",
+ "\n",
+ "1312\n",
+ "78\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Passing 2-D Array To a Function , Page number: 297<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate three ways of accessing a 2-D array'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = [[1, 2, 3, 4] , [5, 6, 7, 8] , [9, 0, 1, 6 ]]\n",
+ "\n",
+ "#Function definitions\n",
+ "def display ( q, row, col ):\n",
+ " for i in range(0,row):\n",
+ " for j in range(0,col):\n",
+ " print q [ (i * col)%3][j]\n",
+ " print \"\\n\" \n",
+ " print \"\\n\" \n",
+ "\n",
+ "\n",
+ "def show ( q, row, col ):\n",
+ " for i in range(0,row):\n",
+ " p = q[i]\n",
+ " for j in range(0,col):\n",
+ " print p[j]\n",
+ " print \"\\n\" \n",
+ " print \"\\n\" \n",
+ "\n",
+ "def Print ( q, row, col ):\n",
+ " for i in range(0,row):\n",
+ " for j in range(0,col):\n",
+ " print q[i][j]\n",
+ " print \"\\n\" \n",
+ " print \"\\n\" \n",
+ " \n",
+ "#function calls\n",
+ "display ( a, 3, 4 ) \n",
+ "show ( a, 3, 4 ) \n",
+ "Print ( a, 3, 4 )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "\n",
+ "\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "\n",
+ "\n",
+ "9\n",
+ "0\n",
+ "1\n",
+ "6\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "\n",
+ "\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "\n",
+ "\n",
+ "9\n",
+ "0\n",
+ "1\n",
+ "6\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "\n",
+ "\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "\n",
+ "\n",
+ "9\n",
+ "0\n",
+ "1\n",
+ "6\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Array of Pointers , Page number: 300<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate an array of pointers'''\n",
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "#Variable declaration\n",
+ "arr = [] # array of integer pointers \n",
+ "i = c_int(31)\n",
+ "j = c_int(5)\n",
+ "k = c_int(19)\n",
+ "l = c_int(71)\n",
+ "arr.append(pointer(i))\n",
+ "arr.append(pointer(j))\n",
+ "arr.append(pointer(k))\n",
+ "arr.append(pointer(l))\n",
+ "\n",
+ "for m in range(0,4):\n",
+ " print arr[m].contents "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "c_long(31)\n",
+ "c_long(5)\n",
+ "c_long(19)\n",
+ "c_long(71)\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Address Array , Page number: 301<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate that an array of pointers can even\n",
+ "contain the addresses of other arrays'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = [ 0, 1, 2, 3, 4 ]\n",
+ "p = [ a[0], a[1], a[2], a[3], a[4] ]\n",
+ "\n",
+ "#Result\n",
+ "print p, id(p), id(id(p ) )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[0, 1, 2, 3, 4] 134794120 134005648\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/chapter-9.ipynb b/Let_us_C/chapter-9.ipynb
new file mode 100644
index 00000000..1f588a47
--- /dev/null
+++ b/Let_us_C/chapter-9.ipynb
@@ -0,0 +1,616 @@
+{
+ "metadata": {
+ "name": "chapter-9.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 9: Puppetting On Strings <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Print String , Page number: 329<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate printing of a string'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "name= \"Klinsman\" # character array or string\n",
+ "i = 0\n",
+ "\n",
+ "#while loop for printing\n",
+ "while i <= 7 :\n",
+ " print name[i] \n",
+ " i = i + 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K\n",
+ "l\n",
+ "i\n",
+ "n\n",
+ "s\n",
+ "m\n",
+ "a\n",
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Print String, Page number: 330<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate printing of a string'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "name= \"Klinsman\\0\" # character array or string\n",
+ "i = 0\n",
+ "\n",
+ "#while loop for printing\n",
+ "while (name[i] != '\\0') :\n",
+ " print name[i]\n",
+ " i = i + 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K\n",
+ "l\n",
+ "i\n",
+ "n\n",
+ "s\n",
+ "m\n",
+ "a\n",
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Print String Using Pointer, Page number: 330<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to print a string using a pointer to access the array elements'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "name = \"Klinsman\\0\" # string or character array\n",
+ "i = 0\n",
+ "ptr = name[i] # store base address of string\n",
+ "\n",
+ "#Result\n",
+ "while ptr != '\\0':\n",
+ " print ptr\n",
+ " i = i+1\n",
+ " ptr = name[i]\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "K\n",
+ "l\n",
+ "i\n",
+ "n\n",
+ "s\n",
+ "m\n",
+ "a\n",
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>strlen Function, Page number: 336<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the 'strlen' function '''\n",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "arr = \"Bamboozled\" # character array or string\n",
+ "\n",
+ "#string length function\n",
+ "len1 = len(arr) \n",
+ "len2 = len( \"Humpty Dumpty\" )\n",
+ "\n",
+ "#Result\n",
+ "print \"string = %s length = %d\" %( arr, len1 )\n",
+ "print \"string = %s length = %d\" %(\"Humpty Dumpty\", len2 )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "string = Bamboozled length = 10\n",
+ "string = Humpty Dumpty length = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>xstrlen Function, Page number: 337<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a function that\n",
+ "counts the number of characters present in a string'''\n",
+ "\n",
+ "#Function definition\n",
+ "def xstrlen(s):\n",
+ " length = 0\n",
+ " while ( s[length] != '\\0' ):\n",
+ " length += 1\n",
+ " return length \n",
+ "\n",
+ "#Variable declaration\n",
+ "arr = \"Bamboozled\\0\" # character array or string\n",
+ "\n",
+ "#Function calls\n",
+ "len1 = xstrlen(arr) \n",
+ "len2 = xstrlen( \"Humpty Dumpty\\0\" )\n",
+ "\n",
+ "#Result\n",
+ "print \"string = %s length = %d\" %( arr, len1 )\n",
+ "print \"string = %s length = %d\" %(\"Humpty Dumpty\\0\", len2 )\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "string = Bamboozled\u0000 length = 10\n",
+ "string = Humpty Dumpty\u0000 length = 13\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>strcpy Function, Page number: 338<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the 'strcpy' function '''\n",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "source = \"Sayonara\" \n",
+ "target = [] \n",
+ "\n",
+ "#strcpy function\n",
+ "import copy\n",
+ "target = copy.copy(source)\n",
+ "\n",
+ "#Result\n",
+ "print \"source string = \", source \n",
+ "print \"target string = \", target \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "source string = Sayonara\n",
+ "target string = Sayonara\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>xstrcpy Function, Page number: 339<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate a function that\n",
+ "copies the contents of one string into another'''\n",
+ "\n",
+ "#Function definition\n",
+ "def xstrcpy (t,s):\n",
+ " i = 0\n",
+ " while ( s[i] != '\\0' ):\n",
+ " t = t + s[i]\n",
+ " i = i + 1\n",
+ " return t\n",
+ " \n",
+ "#Variable declaration\n",
+ "source = \"Sayonara\\0\" \n",
+ "target = ''\n",
+ "\n",
+ "target = xstrcpy ( target, source ) # function call\n",
+ "\n",
+ "#Result\n",
+ "print \"source string = \", source \n",
+ "print \"target string = \", target "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "source string = Sayonara\u0000\n",
+ "target string = Sayonara\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>strcat Function, Page number: 342<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the 'strcat' function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "source = \"Folks!\" \n",
+ "target = \"Hello\"\n",
+ " \n",
+ "target = target + source # string concatenation\n",
+ "#Result\n",
+ "print \"source string = \", source \n",
+ "print \"target string = \", target \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "source string = Folks!\n",
+ "target string = HelloFolks!\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>strcmp Function, Page number: 343<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to demonstrate the 'strcmp' function'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "string1 = \"Jerry\\0\" \n",
+ "string2 = \"Ferry\\0\"\n",
+ "\n",
+ "#Function definition\n",
+ "def strcmp (string1 , string2):\n",
+ " if (string1 == string2):\n",
+ " v = 0 #If the two strings are identical, strcmp returns a value zero\n",
+ " return v\n",
+ " else:\n",
+ " n = 0\n",
+ " while ( string1[n]):\n",
+ " if ( string1[n] == string2[n]):\n",
+ " n = n + 1\n",
+ " continue\n",
+ " else:\n",
+ " v = ord(string1[n]) - ord(string2[n]) #returns the numeric difference between the ASCII values of the first non-matching pairs of characters\n",
+ " return v\n",
+ " return v\n",
+ "\n",
+ "#Function call\n",
+ "i = strcmp ( string1, \"Jerry\\0\" ) \n",
+ "j = strcmp ( string1, string2 ) \n",
+ "k = strcmp ( string1, \"Jerry boy\\0\" )\n",
+ "\n",
+ "#Result\n",
+ "print i,j,k"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 4 -32\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Two Dimensional Array of Characters, Page number: 344<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program asks you to type your name. When you do so, it checks your\n",
+ "name against a master list to see if you are worthy of\n",
+ "entry to the palace'''\n",
+ "\n",
+ "\n",
+ "#Function definition\n",
+ "def strcmp (string1 , string2):\n",
+ " if (string1 == string2):\n",
+ " v = 0 #If the two strings are identical, strcmp returns a value zero\n",
+ " return v\n",
+ " else:\n",
+ " n = 0\n",
+ " while ( string1[n]):\n",
+ " if ( string1[n] == string2[n]):\n",
+ " n = n + 1\n",
+ " continue\n",
+ " else:\n",
+ " v = ord(string1[n]) - ord(string2[n]) #returns the numeric difference between the ASCII values of the first non-matching pairs of characters\n",
+ " return v\n",
+ " return v\n",
+ "\n",
+ "#Variable declaration\n",
+ "FOUND = 1\n",
+ "NOTFOUND = 0\n",
+ "masterlist =[\"akshay\",\"parag\",\"raman\",\"srinivas\",\"gopal\",\"rajesh\"]\n",
+ "yourname = []\n",
+ "flag = NOTFOUND\n",
+ "\n",
+ "#Input from user\n",
+ "#yourname = raw_input(\"Enter your name: \")\n",
+ "yourname = \"Akshatha\"\n",
+ "\n",
+ "#Checking in the master list\n",
+ "for i in range(0,6):\n",
+ " a = strcmp ( masterlist[i], yourname )\n",
+ " if a == 0:\n",
+ " print \"Welcome, you can enter the palace\" \n",
+ " flag = FOUND\n",
+ " break\n",
+ " \n",
+ "if flag == NOTFOUND :\n",
+ " print \"Sorry, you are a trespasser\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sorry, you are a trespasser\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Exchange Names using 2-D Array of Characters, Page number: 348<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to exchange names using 2-D array of characters'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "names = [\"akshay\\0\\0\\0\",\"parag\\0\\0\\0\\0\",\"raman\\0\\0\\0\\0\",\"srinivas\\0\",\"gopal\\0\\0\\0\\0\",\"rajesh\\0\\0\\0\"]\n",
+ "\n",
+ "#Initial condition\n",
+ "print \"Original: \", names[2], names[3] \n",
+ "\n",
+ "#Exchanging names\n",
+ "for i in range(0,9):\n",
+ " t = names[3][i]\n",
+ " names[3] = names[3][0:i] + names[2][i] + names[3][i+1:]\n",
+ " names[2] = names[2][0:i] + t + names[2][i+1:]\n",
+ " \n",
+ "\n",
+ "#Result \n",
+ "print \"New: \", names[2], names[3] "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original: raman\u0000\u0000\u0000\u0000 srinivas\u0000\n",
+ "New: srinivas\u0000 raman\u0000\u0000\u0000\u0000\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Exchange Names using Array of Pointers to Strings, Page number: 349<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to exchange names using 2-D array of characters'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "names = [\"akshay\\0\\0\\0\",\"parag\\0\\0\\0\\0\",\"raman\\0\\0\\0\\0\",\"srinivas\\0\",\"gopal\\0\\0\\0\\0\",\"rajesh\\0\\0\\0\"]\n",
+ "\n",
+ "#Initial condition\n",
+ "print \"Original: \", names[2], names[3] \n",
+ "\n",
+ "#Exchanging names\n",
+ "temp = names[2] \n",
+ "names[2] = names[3] \n",
+ "names[3] = temp \n",
+ "\n",
+ "#Result \n",
+ "print \"New: \", names[2], names[3] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original: raman\u0000\u0000\u0000\u0000 srinivas\u0000\n",
+ "New: srinivas\u0000 raman\u0000\u0000\u0000\u0000\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Solution, Page number: 351<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Program to illustrate the solution to the problem of limitation\n",
+ "of Array of Pointers to Strings'''\n",
+ "\n",
+ "import copy\n",
+ "\n",
+ "#Variable declaration\n",
+ "names = []\n",
+ "n=[\"John\",\"Max\",\"Jim\",\"Tony\",\"Tom\",\"Harry\"]\n",
+ "\n",
+ "for i in range(0,6):\n",
+ " n1 = n[i]\n",
+ " p = copy.copy(n1)\n",
+ " names.append(p) \n",
+ "\n",
+ "for i in range(0,6):\n",
+ " print names[i] \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "John\n",
+ "Max\n",
+ "Jim\n",
+ "Tony\n",
+ "Tom\n",
+ "Harry\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Let_us_C/screenshots/binary.png b/Let_us_C/screenshots/binary.png
new file mode 100644
index 00000000..5a14ee93
--- /dev/null
+++ b/Let_us_C/screenshots/binary.png
Binary files differ
diff --git a/Let_us_C/screenshots/hellowindows.png b/Let_us_C/screenshots/hellowindows.png
new file mode 100644
index 00000000..622bf2b7
--- /dev/null
+++ b/Let_us_C/screenshots/hellowindows.png
Binary files differ
diff --git a/Let_us_C/screenshots/macro.png b/Let_us_C/screenshots/macro.png
new file mode 100644
index 00000000..161b4c74
--- /dev/null
+++ b/Let_us_C/screenshots/macro.png
Binary files differ
diff --git a/Linear_Integrated_Circuits/Chapter_1.ipynb b/Linear_Integrated_Circuits/Chapter_1.ipynb
new file mode 100644
index 00000000..b3bbe576
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_1.ipynb
@@ -0,0 +1,92 @@
+{
+ "metadata": {
+ "name": "Ch_1"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 1: Integrated circuit fabrication<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.1, Page No:23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''sheet resistance of P-type diffusion'''",
+ "",
+ "#Variable Declaration:",
+ "Rs=200.0 #Sheet resistance of p-type diffusion in ohm/square",
+ "R=5000.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "luponw= R/Rs #calculating dimentions of pattern ",
+ "",
+ "#Results:",
+ "print('L upon W =%d'%luponw)",
+ "print('\\n5kohm resistor can be fabricated by using a pattern of %d mil*1mil'%luponw)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L upon W =25",
+ "",
+ "5kohm resistor can be fabricated by using a pattern of 25 mil*1mil"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.2, Page No:23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''sheet resistance of polysilicon layer'''",
+ "",
+ "#Variable Declaration:",
+ "Rs=30.0 #Sheet resistance of p-type diffusion in ohm/square",
+ "R=1000.0 #resistance in ohm",
+ "",
+ "#Calculations:",
+ "luponw=R/Rs #calculating dimentions of pattern ",
+ "",
+ "#Results:",
+ "print('L upon W =100/3')",
+ "print('\\n1kohm resistor can be fabricated by using a pattern of 100 mil* 3 mil')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L upon W =100/3",
+ "",
+ "1kohm resistor can be fabricated by using a pattern of 100 mil* 3 mil"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_10.ipynb b/Linear_Integrated_Circuits/Chapter_10.ipynb
new file mode 100644
index 00000000..d9506c7e
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_10.ipynb
@@ -0,0 +1,376 @@
+{
+ "metadata": {
+ "name": "ch_10"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 10: Phase locked loop<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 10.1, Page No: 429<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''DC Control voltage'''",
+ "",
+ "#Variable Declaration:",
+ "fs=20000.0 #Signal frequency in hertz",
+ "fr=21000.0 #Free running frquency in hertz",
+ "VCOf=4000.0 #V/F transfer coefficient of VCO in Khz/V",
+ "",
+ "#Calculation:",
+ "Vcd=(fr-fs)/VCOf #Calculating change in DC control voltage",
+ "",
+ "#Result:",
+ "print('Vcd= %.2f V'%Vcd)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vcd= 0.25 V"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 10.2, Page No: 430<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''VCO Circuit'''",
+ "",
+ "",
+ "#Part A",
+ "#Variable Ceclaration:",
+ "R1=15.0*10**3 #Resistance in ohm",
+ "R3=15.0*10**3 #Resistance in ohm",
+ "R2=2.2*10**3 #Resistance in ohm",
+ "C1=0.001*10**-6 #Capacitance in farad",
+ "Vcc=12.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "Vc=Vcc*(R3/(R2+R3)) #Calculating volatage in Vc",
+ "fo1=2*(Vcc-Vc)/(C1*R1*Vcc) #Calculating frequency",
+ "fo1n=fo1/1000.0 #Calculating frequency",
+ "",
+ "#Results:",
+ "print('\\nVc= %.3f V'%Vc)",
+ "print('\\nFo= %.2f kHz'%fo1n)",
+ "",
+ "#Part B",
+ "#Variable Declaration:",
+ "Vc1=7.0",
+ "Vc2=8.0",
+ "",
+ "#Calculation:",
+ "fo2=2*(Vcc-Vc1)/(C1*R1*Vcc) #Calculating frequency",
+ "fo2n=fo2/1000.0 #Calculating frequency",
+ "",
+ "fo3=2*(Vcc-Vc2)/(C1*R1*Vcc) #Calculating frequency",
+ "fo3n=fo3/1000.0 #Calculating frequency",
+ "",
+ "fch=fo2n-fo3n #Calculating chane in output frequency",
+ " ",
+ "#Results:",
+ "print('\\nFo= %.3f kHz'%fo2n)",
+ "print('\\nFo= %.3f kHz'%fo3n)",
+ "print('\\nChange in output frequency= %.3f kHz'%fch)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Vc= 10.465 V",
+ "",
+ "Fo= 17.05 kHz",
+ "",
+ "Fo= 55.556 kHz",
+ "",
+ "Fo= 44.444 kHz",
+ "",
+ "Change in output frequency= 11.111 kHz"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 10.3, Page No: 438<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''PLL565'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "fo=100.0*10**3 #Frequency in hertz",
+ "C=2.0*10**-6 #Capacitance in farad",
+ "Vcc=6.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "fld=7.8*fo/(2*Vcc) #Calculating lock frequency",
+ "fldn=fld/1000.0 #Calculating lock frequency",
+ "LR=2.0*fldn #Calculating lock range",
+ "",
+ "fcd=math.sqrt(fld/(C*2*math.pi*3.6*10**3))#Calculating capture frequency ",
+ "fcdn=fcd/1000.0 #Calculating capture frequency",
+ "CR=2*fcdn #Calculating capature range ",
+ "",
+ "R1=12.0*10**3",
+ "C1=1.2/(4*R1*fo) #Calculating value of capacitance ",
+ "C1n=C1*10**12 #Calculating value of capacitance",
+ "",
+ "#Results:",
+ "print('\\nDelta FL= +/- %d kHz'%fldn)",
+ "print('\\nLock Range= %d kHz'%LR)",
+ "print('\\nDelta FC= +/- %.3f kHz'%fcdn)",
+ "print('\\nCapture Range= %.3f kHz'%CR)",
+ "print('\\nC1= %d pF'%C1n)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Delta FL= +/- 65 kHz",
+ "",
+ "Lock Range= 130 kHz",
+ "",
+ "Delta FC= +/- 1.199 kHz",
+ "",
+ "Capture Range= 2.397 kHz",
+ "",
+ "C1= 250 pF"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 10.4, Page No: 438<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''IC565'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "R1=15000.0 #Resistance in ohm",
+ "C1=0.01*10**-6 #Capacitance in farad",
+ "C=1*10**-6 #Capacitance in farad",
+ "V=12.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "fo=1.2/(4*R1*C1) #Calculating output frequency ",
+ "fon=fo*10**-3 #Calculating output frequency",
+ "LR=7.8*fo/V #Calculating lock range",
+ "LR1=LR/1000.0 #Calculating lock range",
+ "fcd=math.sqrt(LR/(C*2*math.pi*3.6*1000)) #Calculating delta for capture frequency",
+ "",
+ "#Results:",
+ "print('\\nCentre frequency of VCO is= %.2f kHz'%fon)",
+ "print('\\nLock Range = +/- %.1f kHz'%LR1)",
+ "print('\\nDelta FC= %.2f Hz'%fcd)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Centre frequency of VCO is= 2.00 kHz",
+ "",
+ "Lock Range = +/- 1.3 kHz",
+ "",
+ "Delta FC= 239.73 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 10.5, Page No: 439<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''IC565 Output frequency'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "C1=470.0*10**-12 #Capacitance value in farad",
+ "C=20.0*10**-6 #Capacitance value in farad",
+ "V=12.0 #Voltage in volt",
+ "R1=15000.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "fo=1.2/(4*R1*C1) #Calculating centre frequency of the VCO",
+ "fon=fo/1000.0 #Calculating centre frequency of the VCO",
+ "",
+ "LR=7.8*fo/V #Calculating lock range ",
+ "LR1=LR/1000.0 #Calculating lock range",
+ "fcd=math.sqrt(LR/(C*2*math.pi*3.6*1000)) #Calculating capture range ",
+ "",
+ "#Results:",
+ "print('\\nCentre frequency of VCO is= %.3f kHz'%fon)",
+ "print('\\nLock Range = +/- %.2f kHz'%LR1)",
+ "print('\\nDelta FC= +/- %.2f Hz'%fcd)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Centre frequency of VCO is= 42.553 kHz",
+ "",
+ "Lock Range = +/- 27.66 kHz",
+ "",
+ "Delta FC= +/- 247.27 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 10.6, Page No: 439<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''PLL'''",
+ "",
+ "#Variable Declaration:",
+ "fr=300.0 #Free running frequency in hertz",
+ "bw=50.0 #Bandwidth in hertz",
+ "ip=320.0 #input signal frequency in hertz",
+ "",
+ "#Calculations:",
+ "pdop=fr+ip #Calculating phase detector output",
+ "difr=ip-fr #Calculating difference frequency",
+ "",
+ "#Results:",
+ "print('\\nPhase detector output= %d kHz'%pdop)",
+ "print('\\nDifference Frequency= %d kHz'%difr)",
+ "print('\\nAs Bandwidth is greater than difference frequency,')",
+ "print('\\nPLL can acquire lock')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Phase detector output= 620 kHz",
+ "",
+ "Difference Frequency= 20 kHz",
+ "",
+ "As Bandwidth is greater than difference frequency,",
+ "",
+ "PLL can acquire lock"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example no. 10.7, Page No: 440<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''IC565 as FM modulator'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "C1=0.01*10**-6 #Capacitance value in farad",
+ "C=0.04*10**-6 #Capacitance value in farad",
+ "V=12.0 #Voltage in volt",
+ "R1=10000.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "fo=120/(4*R1*C1) #Calculating centre frequency of the VCO",
+ "fon=fo/1000.0 #Calculating centre frequency of the VCO",
+ "",
+ "fld=7.8*fo/(V) #Calculating Lock range",
+ "fldn=fld/1000.0 #Calculating Lock range",
+ " ",
+ "fcd=math.sqrt(fld/(C*2*math.pi*3.6*10**3)) #Calculating capture range",
+ "fcdn=fcd/1000.0 #Calculating Capture range",
+ "",
+ "#Results:",
+ "print('\\nCentre frequency of VCO is= %.1f kHz'%fon)",
+ "print('\\nLock Range= %d kHz'%fldn)",
+ "print('\\nCapture Range= %.2f kHz'%fcdn)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Centre frequency of VCO is= 300.0 kHz",
+ "",
+ "Lock Range= 195 kHz",
+ "",
+ "Capture Range= 14.68 kHz"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_11.ipynb b/Linear_Integrated_Circuits/Chapter_11.ipynb
new file mode 100644
index 00000000..87c114d1
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_11.ipynb
@@ -0,0 +1,552 @@
+{
+ "metadata": {
+ "name": "ch_11"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 11: D/A and A/D Converters<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.1, Page No:460<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Resolution'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "n=12.0 #Number of bits in word",
+ "lv=2.0**n #Number of levels",
+ "Vo=4.0 #Output voltage in volt",
+ "",
+ "#Calculations:",
+ "st=10.0**6*Vo/lv #Calculating step size",
+ "dr=Vo/(st*10**-6) #Calculating dynamic range",
+ "drdb=20*math.log10(dr) #Calculating dynamic range",
+ "",
+ "#Results:",
+ "print('\\nStep Size= %d uV'%st)",
+ "print('\\nDynamic Range= %d'%dr)",
+ "print('\\nDynamic Range= %d dB'%drdb)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Step Size= 976 uV",
+ "",
+ "Dynamic Range= 4096",
+ "",
+ "Dynamic Range= 72 dB"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.2, Page NO: 460<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''D/A converter resolution'''",
+ "",
+ "#Variable Declaration:",
+ "n=8.0 #Number of bits in word",
+ "lv=2.0**n - 1 #Number of levels ",
+ "Vo=2.55 #Output voltage in volt",
+ "",
+ "#Calculation:",
+ "st=10.0**3*Vo/lv #Calculating step size ",
+ "",
+ "#Result:",
+ "print('\\nStep Size= %d mV'%st)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Step Size= 10 mV"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.3, Page No:460<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Ladder type D/A converter'''",
+ "",
+ "#Variable Declaration:",
+ "n=4.0 #Number of bits in word",
+ "R=10000.0 #Resistance in ohm",
+ "Vr=10.0 #Vpltage in volt",
+ "",
+ "#Calculations:",
+ "#Part A",
+ "reso=Vr*10**6/(R*2**n) #Calculating resolution for converter",
+ "",
+ "#Part B",
+ "k=int('1101',2) #decimal equivalent of binary '1101'",
+ "Io=reso*k/1000.0 #Calculating output current for given input",
+ "",
+ "#Results:",
+ "print('\\nResolution of 1 LSB= %.1f uA'%reso)",
+ "print('\\nOutput Io for digital input 1101= %.4f mA'%Io)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Resolution of 1 LSB= 62.5 uA",
+ "",
+ "Output Io for digital input 1101= 0.8125 mA"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.4, Page No: 461<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''8-bit D/A converter'''",
+ "",
+ "#Variable Declaration:",
+ "reso=10.0 #Resolution of D/A converter",
+ "#Calculations:",
+ "#Part A",
+ "k1=int('10001010',2) #Finding decimal equivalent",
+ "Vo=k1*reso #Calculating output voltage",
+ "Von=Vo/1000 #Calculating output voltage",
+ "",
+ "#Part B",
+ "k2=int('000100000',2) #Finding decimal equivalent",
+ "Vo1=k2*reso #Calculating output voltage",
+ "Von1=Vo1/1000 #Calculating output voltage",
+ "",
+ "#Results:",
+ "print('\\nVo= %.2f V'%Von)",
+ "print('\\nVo= %.2f V'%Von1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Vo= 1.38 V",
+ "",
+ "Vo= 0.32 V"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.5, Page NO: 463<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''4-bit converter'''",
+ "",
+ "#Part A",
+ "print('\\nPart A')",
+ "#Variable Declaration:",
+ "R=10000.0 #Resistance in ohm",
+ "Vr=10.0 #Voltage in volt",
+ "n=4.0 #Number of bits in word",
+ "lsb=0.5 #output voltage for 1 LSB",
+ "",
+ "#Calculations:",
+ "Rf=(R*2**n)*lsb/Vr #Calculating value of resistance ",
+ "Rfn=Rf/1000.0 #Calculating value of resistance",
+ "",
+ "#Result:",
+ "print('\\nRf= %d kohm'%Rfn)",
+ "",
+ "#Part B",
+ "print('\\nPart B')",
+ "",
+ "#Variable Declaration:",
+ "b1=1.0 ",
+ "",
+ "#Calculations:",
+ "Rf1=R*6/(Vr*lsb) #Calculating value of resistance",
+ "Rfn1=Rf1/1000 #Calculating value of resistance",
+ "",
+ "",
+ "#Result:",
+ "print('\\nRf= %d kohm'%Rfn1)",
+ "",
+ "#Part c",
+ "print('\\nPart C')",
+ "#Variable Declaration:",
+ "Vfs=12.0 #Full scale voltage in volt",
+ "",
+ "#Calculations:",
+ "Rf2=R*Vfs/Vr #Calculating value of resistance",
+ "Rfn2=Rf2/1000 #Calculating value of resistance",
+ "",
+ "#Result:",
+ "print('\\nRf= %d kohm'% Rfn2)",
+ "",
+ "#Part D:",
+ "print('\\nPart D')",
+ "",
+ "#Variable Declaration",
+ "Vfs1=10.0 #Full scale voltage in volt ",
+ "bb=0.9375 ",
+ "",
+ "#Calculations:",
+ "Rf3=R*Vfs1/(Vr*bb) #Calculating value of resistance",
+ "Rfn3=Rf3/1000 #Calculating value of resistance",
+ "",
+ "",
+ "#Result:",
+ "print('\\nRf= %.3f kohm'% Rfn3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Part A",
+ "",
+ "Rf= 8 kohm",
+ "",
+ "Part B",
+ "",
+ "Rf= 12 kohm",
+ "",
+ "Part C",
+ "",
+ "Rf= 12 kohm",
+ "",
+ "Part D",
+ "",
+ "Rf= 10.667 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.11.6 , Page No: 466<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Inverted R-2R ladder'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "Vr=10.0 #Voltage in volt",
+ "R=10.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "I1=Vr/(2*R) #Calculating current",
+ "I1n=I1*1000.0 #Calculating current",
+ "",
+ "I2=I1/2.0 #Calculating current",
+ "I2n=I2*1000.0 #Calculating current",
+ "",
+ "I3=I1/4.0 #Calculating current ",
+ "I3n=I3*1000.0 #Calculating Current",
+ "I3n=math.ceil(I3n*100) #Calculating current",
+ "I3n=I3n/100 #Calculating current ",
+ "",
+ "Io=I1+I2+I3 #Calculating current",
+ "Ion=Io*1000.0 #Calculating current",
+ "",
+ "Vo=-1*Io*R #Calculating output voltage",
+ "",
+ "#Results:",
+ "print('\\nI1= %.1f mA'%I1n)",
+ "print('\\nI2= %.2f mA'% I2n)",
+ "print('\\nI3= %.2f mA'%I3n)",
+ "print('\\nIo= %.3f mA'% Ion)",
+ "print('\\nOutput Voltage Vo= %.2f V'%Vo)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "I1= 0.5 mA",
+ "",
+ "I2= 0.25 mA",
+ "",
+ "I3= 0.13 mA",
+ "",
+ "Io= 0.875 mA",
+ "",
+ "Output Voltage Vo= -8.75 V"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.7, Page NO:473<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Output voltage for digital input'''",
+ "",
+ "#Variable Declaration:",
+ "lsb=8.0*10**-6 #Current for 1 LSB in ampere",
+ "Ifs=lsb*255.0 #Full scale current in ampere",
+ "R=5000.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "ip1= int('00000000',2) #Finding decimal equivalent ",
+ "Io1=ip1*lsb #Calculating output current",
+ "Io1d=Ifs-Io1 #Calculating output current",
+ "Vo=-Io1d*R #Calculating output voltage",
+ "",
+ "ip2= int('01111111',2) #Finding decimal equivalent",
+ "Io2=(ip2*lsb)*1000.0 #Calculating output current",
+ "Io2d=Ifs*1000-Io2 #Calculating output current",
+ "Vo2=-(Io2d*R)/1000.0 #Calculating output voltage",
+ "",
+ "",
+ "ip3=int('10000000',2) #Finding decimal equivalent",
+ "Io3=ip3*lsb #Calculating output current ",
+ "Io3d=Ifs-Io3 #Calculating output current",
+ "Vo3=-Io3d*R #Calculating output voltage",
+ "",
+ "",
+ "ip4= int('111111111',2) #Finding decimal equivalent",
+ "Io4=ip4*lsb #Calculating output current",
+ "Io4d=Ifs-Io4 #Calculating output current",
+ "Vo4=Io1d*R #Calculating output voltage",
+ "",
+ "#Results:",
+ "print('\\nCase 1: Vo= %.2f V'% Vo)",
+ "print('\\nCase 2: Vo= -0.04 V')",
+ "print('\\nCase 3: Vo= 0.04 V')",
+ "print('\\nCase 4: Vo= %.2f V'% Vo4)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Case 1: Vo= -10.20 V",
+ "",
+ "Case 2: Vo= -0.04 V",
+ "",
+ "Case 3: Vo= 0.04 V",
+ "",
+ "Case 4: Vo= 10.20 V"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.8, Page No: 478<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Resolution and dynamic range'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "n=16.0 #Number of bits in word",
+ "lv=2.0**n #Number of levels",
+ "V=2.0 #Output voltage in volt",
+ "",
+ "#Calculations:",
+ "st=V/lv #Calculating step size",
+ "lvn=st*10**6 #Calculating stepsize",
+ "dr=20*math.log10(lv) #Calculating dynamic range",
+ "",
+ "#Results:",
+ "print('\\nStep Size= %.2f uV'%lvn)",
+ "print('\\nDynamic Range= %d dB'%dr)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Step Size= 30.52 uV",
+ "",
+ "Dynamic Range= 96 dB"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.9, Page No: 482<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''8-bit A/D converter'''",
+ "",
+ "#Variable Declaration:",
+ "Vm=10.0 #Voltage in volt",
+ "n=8.0 #Number of bits in word",
+ "lv=2**n #Number of levels",
+ "",
+ "#Calculations:",
+ "lsb=Vm/lv #Calculating voltage for 1 lsb ",
+ "lsbn= lsb*1000.0 #Calculating voltage for 1 lsb",
+ "",
+ "Vifs=Vm-lsb #Calculating voltage",
+ "",
+ "ip=4.8 #voltage in volt",
+ "d=1+ ip/lsb #calculating digital output",
+ "d=123 #Calculating digital output",
+ "op=bin(d) #Finding binary equivalent",
+ "",
+ "#Results:",
+ "print('\\nPart A: 1 LSB= %.1f mV'%lsbn )",
+ "print('\\nPart B: Vifs= %.3f V'%Vifs )",
+ "print('\\nPart C: D= %d'%d)",
+ "print('\\n Digital Output= %s'% op)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Part A: 1 LSB= 39.1 mV",
+ "",
+ "Part B: Vifs= 9.961 V",
+ "",
+ "Part C: D= 123",
+ "",
+ " Digital Output= 0b1111011"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 11.10, Page No: 494<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Successive approximation A/D converter'''",
+ "",
+ "#Variable declaration:",
+ "n=8.0 #Number of bits in word",
+ "cl=2.0*10**6 #Clock frequency in Hertz",
+ "",
+ "#Calculations:",
+ "tp=1/cl #Calculating time period for one clock pulse ",
+ "tpn=tp*10**6 #Calculating time period for one clock pulse ",
+ "tm=(n+1)*tp #Calculating total time required for conversion",
+ "tmn=tm*10**6 #Calculating total time required for conversion ",
+ "",
+ "#Results:",
+ "print('\\n Time for one clock pulse= %.1f uS'% tpn)",
+ "print('\\n Time for resetting SAR and conversion= %.1f uS'%tmn)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ " Time for one clock pulse= 0.5 uS",
+ "",
+ " Time for resetting SAR and conversion= 4.5 uS"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_2.ipynb b/Linear_Integrated_Circuits/Chapter_2.ipynb
new file mode 100644
index 00000000..d8cc6868
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_2.ipynb
@@ -0,0 +1,482 @@
+{
+ "metadata": {
+ "name": "ch_2"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 2: Circuit configuration for linear IC's<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 2.1, Page no:40<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''current source to proide output current'''",
+ "",
+ "#Variable Declaration:",
+ "Vcc=5.0 #voltage Vcc in volt",
+ "Vbeon=0.6 #Voltage Vbeon in volt",
+ "Beta=150.0 #gain",
+ "Io=100.0*10**-6 #output current in amperes",
+ "",
+ "#Calculations:",
+ "Iref=Io*(1+ 2/Beta) #calculating reference current",
+ "Iref=Iref*10**6 #calculating reference current",
+ "",
+ "R=(Vcc-Vbeon)/Iref #Calculating value of resistance",
+ "R=R*1000.0 #Calculating value of resistance",
+ "",
+ "#Results:",
+ "print(\"Iref= %.2f uA\"% Iref)",
+ "print(\"\\nResistance= %.2f kohm\"% R)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iref= 101.33 uA",
+ "",
+ "Resistance= 43.42 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 2.2, Page No:40<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' identical transistor circuit'''",
+ "",
+ "#Variable Declarations:",
+ "Vbe=0.7 #voltage Vbe in volt",
+ "Vcc=12.0 #voltage Vcc in volt",
+ "Rc1=1000.0 #collector resistance in ohm",
+ "Rc2=330.0 #collector resistance in ohm",
+ "",
+ "#Calculations:",
+ "Iref=(Vcc-Vbe)/Rc1 #calculating reference current ",
+ "I0=Iref #Output current is equal to Reference current ",
+ "V0=Vcc-Rc2*I0 #Calculating output volatge",
+ "",
+ "Iref=Iref/10**-3 #calculating reference current",
+ "",
+ "#Results:",
+ "print(\"Iref= %.1f mA\"%Iref)",
+ "print(\"\\nV0= %.3f V\"%V0)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iref= 11.3 mA",
+ "",
+ "V0= 8.271 V"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.3, Page No:40<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''output current of transistor'''",
+ "",
+ "#Variable Declaration",
+ "Vbe=0.6 #Voltage Vbe in volt",
+ "Vz=4.7 #Zener voltage in volt",
+ "Re=1000.0 #Emitter resistance in ohm",
+ "",
+ "#Calculations:",
+ "Vre=Vz-Vbe #Calculating voltage acrross emitter resistance",
+ "",
+ "I=(Vre)/Re #Calculating output current",
+ "I=I/10**-3 #Calculating output current",
+ "",
+ "#Results",
+ "print(\"I=%.1f mA\"%I)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I=4.1 mA"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 2.4, Page No.: 42<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''resistance required to produce a current'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "Vcc=20.0 #Vcc in volt",
+ "R1=19300.0 #resistance in ohm",
+ "Vbe=0.7 #Vbe voltage in Volt",
+ "Ic2=0.000005 #current in amperes",
+ "Vt=0.026 # Vt voltage in volt",
+ "",
+ "#Calculations:",
+ "Ic1=(Vcc-Vbe)/R1 #Calculating current through transistor Q1",
+ "",
+ "R2=(Vt/Ic2)*math.log(Ic1/Ic2) #Calculating value of R2 for desired current through transistor Q2",
+ "",
+ "Ic1=Ic1/10**-3 #Calculating current through transistor Q1",
+ "R2=R2/10**3 #Calculating value of R2 for desired current through transistor Q2",
+ "",
+ "#Results:",
+ "print(\"Ic1= %d mA\"%Ic1)",
+ "print(\"\\nR2= %.2f kohm\"%R2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ic1= 1 mA",
+ "",
+ "R2= 27.55 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.2.5, Page No: 44<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''multiple current source'''",
+ "",
+ "#Variable Declaration:",
+ "Beta=100.0 #Gain for transistor",
+ "R=20000.0 #Resistance in ohm",
+ "Vcc=5.0 #Volatage Vcc in volt",
+ "Vbe=0.6 #Voltage Vbe in volt",
+ "N=3.0 #Number of multiple current source",
+ "",
+ "#Calculations: ",
+ "Iref=(Vcc-Vbe)/R #Calculating reference current",
+ "",
+ "Ic=Iref*(1+ 4/Beta) #Calculating current through transistor Q",
+ "Ic1=Iref*(Beta)/(Beta+N+1) #Calculating current through transistor Q1",
+ "Ic2=Iref*(Beta)/(Beta+N+1) #Calculating current through transistor Q2",
+ "Ic3=Iref*(Beta)/(Beta+N+1) #Calculating current through transistor Q3",
+ "",
+ "Iref=Iref/10**-3 #Calculating Reference current",
+ "Ic1=Ic1/10**-3 #Calculating current through transistor Q1",
+ "",
+ "#Results:",
+ "print(\"Iref= %.2f mA\"%Iref)",
+ "print(\"\\nIc1=Ic2=Ic3= %.3f mA\"%Ic1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iref= 0.22 mA",
+ "",
+ "Ic1=Ic2=Ic3= 0.212 mA"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.2.6, Page NO: 52<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''design current source using MOSFET'''",
+ "",
+ "#Variable Declaration:",
+ "Iref=0.25*10**-3 #Reference current in amperes",
+ "Io=0.2*10**-3 #Outpyt current in amperes",
+ "kn=20*10**-6 #Transconductance in ampere per volt square",
+ "Vth=1.0 #Threshold voltage in volt",
+ "Vgs2=1.752 #Voltage Vgs2 in volt",
+ "lamb=0.0 #Channel length modulation parameter",
+ "Vdd=5.0 #Voltge Vdd in volt",
+ "Vss=0.0 #voltage Vss in volt",
+ "",
+ "#Calculations:",
+ "wbyltwo=Io/(kn*(Vgs2-Vth)**2) #calculating width by length 2 ratio",
+ "Vdssat=Vgs2-Vth #Calculating voltage Vdssat",
+ "Vgs1=Vgs2 #Volage Vgs1 is eqaul to Vgs2",
+ "wbylone=Iref/(kn*(Vgs2-Vth)**2) #Calculating width by length 1 ratio",
+ "Vgs3=Vdd-Vss-Vgs1 #Calculating Vgs3",
+ "wbylthr=Iref/(kn*(Vgs3-Vth)**2) #calculating width by length 3 ratio",
+ "",
+ "#Results:",
+ "print(\"W/L2= %.1f\"%wbyltwo)",
+ "print(\"\\nVds(sat)= %.3f V\"%Vdssat)",
+ "print(\"\\nW/L1= %.1f\"%wbylone)",
+ "print(\"\\nVgs3= %.3f V\"%Vgs3)",
+ "print(\"\\nW/L3= %.2f\"% wbylthr)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "W/L2= 17.7",
+ "",
+ "Vds(sat)= 0.752 V",
+ "",
+ "W/L1= 22.1",
+ "",
+ "Vgs3= 3.248 V",
+ "",
+ "W/L3= 2.47"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 2.7, Page No: 75<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''differential amplifier CMRR'''",
+ "",
+ "#Variable Declaration:",
+ "cmrra=1000.0 #common mode rejection ratio",
+ "cmrrb=10000.0 #common mode rejection ratio ",
+ "v1a=100.0*10**-6 #input voltage in volt",
+ "v2a=-100.0*10**-6 #input voltage in volt",
+ "v1b=1100.0*10**-6 #input voltage in volt",
+ "v2b=900.0*10**-6 #input voltage in volt",
+ "",
+ "#Calculations",
+ "#for first set",
+ "vida=v1a-v2a #Calculating differential volatge",
+ "vcma=(v1a+v2a)/2 #calculating common mode voltage",
+ "vic=0.0 #Calculating common mode voltage",
+ "voa=vida*(1+vic/(cmrra*vida)) #Calculating Output voltage",
+ "voa=voa*10**6 #Calculating output volatge",
+ "",
+ "# for second set",
+ "vidb=v1b-v2b #Calculating differential volatge",
+ "vic=(v1b+v2b)/2 #calculating common mode voltage",
+ "vob=vidb*(1+vic/(cmrrb*vidb)) #Calculating Output voltage",
+ "vob=vob*10**6 #Calculating Output voltage",
+ "",
+ "#Results:",
+ "print(\"\\nVo for second set= %.1f uV\"%vob)",
+ "print(\"Vo for first set= %.1f uV\"% voa)",
+ "",
+ "#answer in textbook is wrong"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Vo for second set= 200.1 uV",
+ "Vo for first set= 200.0 uV"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.2.8, Page No.76<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Q-point of differential amplifier'''",
+ "",
+ "#Variable Declaration:",
+ "Beta=100.0 #Gain",
+ "Vee=15.0 #Voltage Vee in volt",
+ "Vcc=15.0 #Voltage Vcc in volt",
+ "Vbe=0.7 #Voltage Vbe in volt",
+ "Re=65.0*10**3 #Resistance in ohm",
+ "Rc=65.0*10**3 #Resistance in ohm",
+ "alpha=100.0/101.0 #Gain",
+ "Ve=-0.7 #Voltage Ve in volt",
+ "",
+ "#Calculations:",
+ "Ie=(Vee-Vbe)/(2*Re) #Calculating emitter current",
+ "Ic=alpha*Ie #Calculating collector current",
+ "Ib=Ic/Beta #Calculating base current",
+ "",
+ "Vc=Vcc-Ic*Rc #Calculating collector volatge",
+ "",
+ "Vce=Vc-Ve #Calculating voltage between collector and emitter",
+ "",
+ "Ie=Ie*10**6 #Calculating emitter current",
+ "",
+ "Ic=Ic*10**6 #Calculating collector current",
+ "",
+ "Ib=Ib*10**6 #Calculating base current",
+ "",
+ "# by approximating, because Vee>>Vbe",
+ "",
+ "Ieapprox=Vee/(2*Re) #calculating emitter current by approximation",
+ "Ieapprox=Ieapprox*10**6 #calculating emitter current by approximation",
+ "",
+ "#Results:",
+ "print('Ie= %.1f uA'%Ie)",
+ "print('\\nIc= %.1f uA'%Ic)",
+ "print('\\nIb= %.3f uA'%Ib)",
+ "print('\\nVc= %.3f V'%Vc)",
+ "print('\\nVce= %.3f V'%Vce)",
+ "",
+ "print('\\nIe (approx)= %.2f uA'%Ieapprox)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ie= 110.0 uA",
+ "",
+ "Ic= 108.9 uA",
+ "",
+ "Ib= 1.089 uA",
+ "",
+ "Vc= 7.921 V",
+ "",
+ "Vce= 8.621 V",
+ "",
+ "Ie (approx)= 115.38 uA"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.2.9, Page No.89<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Q-point for MOSFET of differential amplifier'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "Vdd=12.0 #Voltage Vdd in volt",
+ "Vss=-12.0 #Voltage Vss in volt",
+ "Iss=175.0*10**-6 #Current Iss in amperes",
+ "Rd=65.0*10**3 #resistance Rd in ohm",
+ "kn=3.0*10**-3 #Transconductance",
+ "Vth=1.0 #Voltage Vth in volt",
+ "",
+ "#Calculations:",
+ "Ids=Iss/2.0 #Calculating Ids",
+ "",
+ "Vgs=Vth + math.sqrt(Iss/kn) #Calculating Vgs",
+ " ",
+ "Vds = Vdd- Ids*Rd + Vgs #Calculating Vds",
+ "",
+ "#Requirement for saturation",
+ "Vicmax= Vdd - Ids*Rd + Vth #Calculating Vicmax",
+ "",
+ "Ids=Ids*10**6 #Calculating Ids",
+ "",
+ "#Results:",
+ "print('\\nIds=%.1f uA'% Ids)",
+ "print('\\nVgs=%.3f V'%Vgs)",
+ "print('\\nVds=%.2f V'% Vds)",
+ "print('\\nVicmax=%.2f V'% Vicmax)",
+ "print('\\nRequirement of saturation for M1 \\nfor non-zero Vic necessiates Vic <= 7.312 V')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Ids=87.5 uA",
+ "",
+ "Vgs=1.242 V",
+ "",
+ "Vds=7.55 V",
+ "",
+ "Vicmax=7.31 V",
+ "",
+ "Requirement of saturation for M1 ",
+ "for non-zero Vic necessiates Vic <= 7.312 V"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_3.ipynb b/Linear_Integrated_Circuits/Chapter_3.ipynb
new file mode 100644
index 00000000..92c89180
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_3.ipynb
@@ -0,0 +1,1284 @@
+{
+ "metadata": {
+ "name": "ch_3"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 3: Operational Amplifier Characteristics<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.1, Page No: 107<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''input stage with bias circuit'''",
+ "",
+ "#Variable Declaration:",
+ "Vp=15.0 #Volatge in volt",
+ "Vm=-15.0 #Voltage in volt",
+ "R5=40.0*10**3 #Resistance in ohm",
+ "Vbe11=0.7 #Voltage in volt",
+ "Vbe12=Vbe11 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "Iref= (Vp-Vbe12-Vbe11-Vm)/R5 #Calculating reference current",
+ "",
+ "Iref=Iref*10**3 #Calculating reference current",
+ "",
+ "#Results:",
+ "print(\"Iref= %.3f mA\"%Iref)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iref= 0.715 mA"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.2, Page No: 107<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''gain stage of op-amp'''",
+ "",
+ "#Variable Declaration:",
+ "Iref= 0.715*10**-3 #reference current in ampere",
+ "Ic13b= 0.75*Iref #Current in ampere",
+ "Ic17=Ic13b #Current in ampere",
+ "Ie17=Ic13b #Current in ampere",
+ "Beta=150.0 #Gain",
+ "Vbe17=0.7 #Vbe volatge in volt",
+ "R9=50.0*10**3 #Resistance in ohm",
+ "R8=100.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "Ic16= (Ic17/Beta) + (Ie17*R8 + Vbe17)/R9 #Calculating current",
+ "Ic16=Ic16*1000000.0/1.232 #Calculating current",
+ "",
+ "#Results:",
+ "print(\"\\nIc16= %.1f uA\"%Ic16)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Ic16= 15.1 uA"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.3, Page No:108<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''output stage of op-amp'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "Iref=0.000715 #Reference current in ampere",
+ "Vbe19=0.7 #Vbe voltage in volt",
+ "Is18=10**-14 #Current in ampere",
+ "Is19=10**-14 #Current in ampere",
+ "R10=50000.0 #Resistance in ohm",
+ "",
+ "Is14=2.0*10**-14 #Current in ampere",
+ "Is20=2.0*10**-14 #Current in ampere",
+ "Vbe=0.7 #Voltge Vbe in volt",
+ "Vbe19=0.612 #Voltage Vbe in volt",
+ "Beta=200.0 #Gain",
+ "Vbe18=0.549 #Volatge vbe in volt",
+ "",
+ "#Calculations:",
+ "Ic13a=0.25*Iref #Calculating Current ",
+ "",
+ "Ir10=Vbe19/R10 #Calculating current",
+ "Ic19=Ic13a-Ir10 #Calculating current",
+ "",
+ "Ib19=Ic19/Beta #Calculating current",
+ "Ic18=Ir10+Ib19 #Calculating current",
+ " ",
+ "Vbb=Vbe18+Vbe19 #calculating voltage",
+ "",
+ "Ic14=Is20*math.exp(Vbb/2*0.026) #Calculating current",
+ "Ic14=Ic14*10**15/0.2042 #Calculating current",
+ "",
+ "#Results:",
+ "print('Vbb= %.3f V'%Vbb)",
+ "print('\\nIc14= %.2f uA'%Ic14)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vbb= 1.161 V",
+ "",
+ "Ic14= 99.43 uA"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example no. 3.4, Page No: 115<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''average bias current'''",
+ "",
+ "#Variable Declaration:",
+ "Ib1=400.0*10**-9 #Current in ampere",
+ "Ib2=300.0*10**-9 #Current in ampere",
+ "",
+ "#Calculations:",
+ "Ib=(Ib1+Ib2)/2.0 #Calculating current",
+ "Ios=Ib1-Ib2 #Calculating current",
+ "Ib=Ib*10**9 #Calculating current",
+ "Ios=Ios*10**9 #Calculating current",
+ "",
+ "#Results:",
+ "print('Ib= %.1f nA'%Ib)",
+ "print('\\nIos= %.1f nA'%Ios)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ib= 350.0 nA",
+ "",
+ "Ios= 100.0 nA"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.5, Page No: 115<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''maximum output offset voltage'''",
+ "",
+ "#Variable Declaration:",
+ "Ios=400.0*10**-9 #Current in ampere",
+ "Rf=100.0*10**3 #Resistance in ohm ",
+ "R1=1.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "Vo=Rf*Ios #Calculating output voltage",
+ "Vo=Vo*1000.0 #Calculating output voltage ",
+ "",
+ "#Results:",
+ "print('Vo= %.1f mV'%Vo)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo= 40.0 mV"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.6, Page No: 117<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''bias current compensation'''",
+ "",
+ "#Variable Declaration:",
+ "Rf=10.0*10**3 #Resistance in ohm",
+ "R1=2.0*10**3 #Resistance in ohm",
+ "Vos=5.0*10**-3 #Voltage in volt",
+ "Ios=50.0*10**-9 #Input offset current in ampere",
+ "Ib=200.0*10**-9 #Input bias current in ampere",
+ "Ta=25.0 #Temperature in degree celsius",
+ "#Calculations:",
+ "# without compensating resistor",
+ "Vot=(1+Rf/R1)*Vos + Rf*Ib #Calculating output offset voltage",
+ "Vot=Vot*1000 #Calculating output offset voltage",
+ "print('Vot= %.1f mV'%Vot)",
+ "",
+ "",
+ "# with compensating resistor",
+ "Vot=(1+Rf/R1)*Vos + Rf*Ios #Calculating output offset voltage",
+ "Vot=Vot*1000 #Calculating output offset voltage",
+ "print('\\nVot= %.1f mV'%Vot)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vot= 32.0 mV",
+ "",
+ "Vot= 30.5 mV"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.7, Page No:119<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''op-amp drift specification'''",
+ "",
+ "#Part A",
+ "#Variable Declaration:",
+ "Vos=1.5*10**-3 #Voltage in volt",
+ "Rf=1.0*10**6 #feedback resistance in ohm",
+ "R1=100.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "Vo=Vos*(1+Rf/R1) #Calculating output voltage",
+ "Vo=Vo*1000.0 #Calculating output voltage",
+ "",
+ "#Result:",
+ "print('Vo= %.1f mV'%Vo)",
+ "",
+ "#Part B",
+ "#Variable Declaration:",
+ "Iosch= 10.0*10**-9 #Ios current in ampere",
+ "",
+ "#Calculations:",
+ "Vosch=Iosch*Rf #Calculating output voltage",
+ "Vosch=Vosch*1000.0 #Calculating output voltage",
+ "",
+ "#Results:",
+ "print('\\nChange in Vo= %.1f mV'%Vosch)",
+ "print('\\n Worst case drift is 26.5 mV or -26.5 mV')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo= 16.5 mV",
+ "",
+ "Change in Vo= 10.0 mV",
+ "",
+ " Worst case drift is 26.5 mV or -26.5 mV"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.3.8, Page No: 125<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''frequency response'''",
+ "f=1000.0 # frequency in hertz",
+ "#from graph",
+ "gain_db=60.0 # Gain in db",
+ "gain=1000.0 #Gain",
+ "",
+ "#Result:",
+ "print('Gain= %d'%gain)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gain= 1000"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.9, Page No: 126<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''unity gain bandwidth'''",
+ "",
+ "#Variable Declaration:",
+ "riset=0.7*10**-6 #rise time in microsecond",
+ "",
+ "#Calculations:",
+ "bw=0.35/riset #Finding unity gain bandwidth",
+ "bw=bw/1000.0 #Finding unity gain bandwidth",
+ "",
+ "#Results:",
+ "print('Bandwidth= %d kHz'%bw)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bandwidth= 500 kHz"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Page No. 3.10, Page No: 126<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''open loop dc voltage gain'''",
+ "",
+ "#Variavle Declaration:",
+ "ugb=1.5*10**6 #Unity gain bandwidth in hertz",
+ "f1=2.0*10**3 #Signal frequency in hertz",
+ "",
+ "#Calculations:",
+ "A0=ugb/f1 #Calculating open loop DC voltage gain",
+ "",
+ "#Results:",
+ "print('Openloop Dc Voltage gain= %d '%A0)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Openloop Dc Voltage gain= 750 "
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.11, Page No: 134<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''time taken to change output'''",
+ "",
+ "#Variable Declaration:",
+ "Voch=10.0 #Change of voltage in volt",
+ "slew=0.5 #Slew rate in volt per microsecond",
+ "",
+ "#Calculations:",
+ "time=Voch/slew #Calculating time taken for output to change by 10V ",
+ "",
+ "#Results:",
+ "print('Time= %d us'%time)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time= 20 us"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.12, Page No: 135<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''undistorted sine wave'''",
+ "",
+ "import math",
+ "#Part A",
+ "#Variable Declaration:",
+ "slew=0.5 #Slew rate in volt per microsecond",
+ "Vm=12.0 #Voltage in volt",
+ "",
+ "#calculations:",
+ "fmax=slew/(2.0*math.pi*Vm) #calculating frequency of maximum undistorted wave",
+ "fmax=fmax*1000.0 #Calculating frequency of maximum undistorted wave",
+ "",
+ "#Results:",
+ "print('Fmax= %.1f kHz'%fmax)",
+ "",
+ "# Part B",
+ "#Variable Declarations:",
+ "Vm1=2.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "fmax1=slew/(2.0*math.pi*Vm1) #calculating frequency of maximum undistorted wave",
+ "fmax1=fmax1*1000.0 #calculating frequency of maximum undistorted wave",
+ "",
+ "#Results:",
+ "print('\\nFmax1= %.1f kHz'%fmax1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fmax= 6.6 kHz",
+ "",
+ "Fmax1= 39.8 kHz"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.13, Page No: 135<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''max input signal for undistorted output'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "slew=0.5 #Slew rate in volt per microsecond",
+ "f=10.0*10**3 #frequency in hertz",
+ "",
+ "#Calculations:",
+ "Vmmax=slew/(2*math.pi*f) #Calculating maximum peak to peak voltage",
+ "Vmmax=Vmmax*10**6 #Calculating maximum peak to peak voltage",
+ "",
+ "#Results:",
+ "print('Vm(max)= %.2f V'%Vmmax)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vm(max)= 7.96 V"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.14, Page No: 135<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''amplify square wave with rise time'''",
+ "",
+ "#Variable Declaration:",
+ "slew=0.5 #Slew rate in volt per microsecond",
+ "riset=4.0 #Rise time in microsecond",
+ "",
+ "print('\\nVo is greater than 1V')",
+ "Vswing=(0.9-0.1)*5.0 #Voltage swing in volt",
+ "",
+ "#Calculations:",
+ "slewreq=Vswing/riset #Calculating required slew rate",
+ "",
+ "#Results:",
+ "print('\\nSlew Rate Required= %d V/us'%slewreq)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Vo is greater than 1V",
+ "",
+ "Slew Rate Required= 1 V/us"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.15, Page No: 135<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''effect of output voltage change on slew rate'''",
+ "",
+ "#Variable Declaration:",
+ "Vch=20.0 #Change in voltage in volt",
+ "time=4.0 #Time in microseconds",
+ "",
+ "#Calculations:",
+ "slew=Vch/time #Calculating slew rate ",
+ "",
+ "#Results:",
+ "print('\\nSlew Rate = %d V/us'%slew)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Slew Rate = 5 V/us"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.16, Page No: 136<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''max input frequency for undistorted output'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "A=50.0 #Gain",
+ "slew=0.5 #Slew rate in volt per microsecond",
+ "Vid=20.0*10**-3 #Voltage difference in volt",
+ " ",
+ "#Calculations:",
+ "Vm=A*Vid #Calculating maximum voltage ",
+ "",
+ "fmax=(slew*10**6)/(2*math.pi*Vm) #calculating frequency of maximum undistorted wave ",
+ "fmax=fmax/1000.0 #calculating frequency of maximum undistorted wave",
+ "",
+ "#Results:",
+ "print('Fmax= %.1f kHz'%fmax)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fmax= 79.6 kHz"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.17, Page No: 136<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''max input voltage for undistorted output'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "slew=0.5 #Slew rate in volt per microsecond",
+ "f=4.0*10**4 #frequency in hertz",
+ "",
+ "#Calculations:",
+ "Vm=(slew*10**6)/(2*math.pi*f) #Calculating Vm",
+ "Vmpp=2.0*Vm/10.0 #Calculating maximum peak to peak input signal that can be applied",
+ "",
+ "#Results:",
+ "print('Vpeak= %.2f V'%Vm)",
+ "print('\\nVoltage peak-to-peak= %.3f V'%Vmpp)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vpeak= 1.99 V",
+ "",
+ "Voltage peak-to-peak= 0.398 V"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.18, Page No: 138<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''noise gain of circuit'''",
+ "",
+ "#Variable Declaration:",
+ "Rf=10.0*10**3 #Resistance in ohm",
+ "R1=100.0 #Resistance in ohm",
+ "Vni=1*10**-6 #input rms noise voltage in volt",
+ "",
+ "#Calculations: ",
+ "Kn=1+Rf/R1 #Calculating noise gain",
+ "Vno=Vni*(1+Rf/R1) #Calculating output voltage",
+ "Vno=Vno*10**6 #Calculating output voltage",
+ "",
+ "#Results:",
+ "print('Output noise voltage= %d uV (rms)'%Vno)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output noise voltage= 101 uV (rms)"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No: 3.19, Page No: 142<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''closed loop voltage gain'''",
+ "",
+ "#Variable Deeclaration:",
+ "Rf=10.0*10**3 #Feedback resistance in ohm",
+ "R1=1.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "Av=-Rf/R1 #Calculating gain",
+ "",
+ "#Results:",
+ "print('Closed loop voltage gain= %d'%Av)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop voltage gain= -10"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.20, Page No: 147<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''closed loop voltage gain and beta'''",
+ "",
+ "#Variable Declaration:",
+ "Rf=10.0*10**3 #Feedback resistance in ohm",
+ "R1=1.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "Av=1+ Rf/R1 #Calculating gain",
+ "",
+ "Beta=R1/(Rf+R1) #Calculating feedback factor",
+ "",
+ "#Results:",
+ "print('Closed loop voltage gain= %d'%Av)",
+ "print('\\nFeedback factor= %.3f'%Beta)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop voltage gain= 11",
+ "",
+ "Feedback factor= 0.091"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.21, Page No:147<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''non-inverting amplifier circuit'''",
+ "",
+ "#Variable Declaration:",
+ "R1=10.0*10**3 #Resistance in ohm",
+ "R2=1.0*10**3 #Resistance in ohm",
+ "R3=1.0*10**3 #Resistance in ohm",
+ "Rf=50.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "I=1/(R2+R3) #Calculating current ",
+ "Vi1=I*R2 #Calculating input voltage",
+ "Vo=Vi1*(1+ Rf/R1) #Calculating output voltage ",
+ "",
+ "#Result:",
+ "print('Vout= %d V'%Vo)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout= 3 V"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No: 3.22, Page No: 147<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''non-inverting amplifier with IL'''",
+ "",
+ "#Variable Declration:",
+ "Vi=0.6 #volatge in volt ",
+ "Vi1=0.6 #volatge in volt",
+ "Vi2=0.6 #volatge in volt",
+ "R1=10.0*10**3 #Resistance in ohm",
+ "Rf=20.0*10**3 #Resistance in ohm",
+ "RL=2.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "I1=Vi/R1 #Calculating current",
+ "I1=I1*1000.0 #Calculating current",
+ "Av=1+Rf/R1 #Calculating gain",
+ "Vo=Av*Vi #Calculating output voltage",
+ "IL=Vo/RL #Calculating load current",
+ "IL=IL*1000 #Calculating load current",
+ "",
+ "#By Kirchhoff's current law",
+ "Io=I1+IL #Calculating output current",
+ "",
+ "#Results:",
+ "print('\\nIo=%.2f mA'%Io)",
+ "print('Av=%d'%Av)",
+ "print('\\nVo=%.1f V'%Vo)",
+ "print('\\nI1=%.1f mA'%IL)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Av=3",
+ "",
+ "Vo=1.8 V",
+ "",
+ "I1=0.9 mA",
+ "",
+ "Io=0.96 mA"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.23,Page No:151 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''capacitor coupled voltage follower'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "fL=50.0 #Frequency in hertz",
+ "RL=3.3*10**3 #Resistance in ohm",
+ "Ibmax=500.0*10**-9 #Current in ampere",
+ "R1max=140.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "C1=1/(2*math.pi*fL*R1max/10) #Calculating value of capacitor",
+ "C1=C1*10**6 #Calculating value of capacitor",
+ "",
+ "C2=1/(2*math.pi*fL*RL) #Calculating value of capacitor",
+ "C2=C2*10**6 #Calculating value of capacitor",
+ "",
+ "#Results:",
+ "print('C1=%.3f uF'%C1)",
+ "print('\\nC2=%.2f uF'%C2)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C1=0.227 uF",
+ "",
+ "C2=0.96 uF"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.24, Page NO: 153<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' high impedence capacitor coupled voltage follower'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "",
+ "Vbe=0.6 #Voltage Vbe in volt",
+ "Ibmax=500.0*10**-9 #Current in ampere",
+ "fL=50.0 #frequency in hertz",
+ "RL=3.3*10**3 #Resistance in ohm",
+ "Mmin=50000.0",
+ "",
+ "#Calculations:",
+ "R1max=0.1*Vbe/Ibmax #Calculating maximum value of the resistance R1",
+ "R1=R1max/2.0 #Calculating value of R1",
+ "R2=R1 #Value of R2 is equal to R1",
+ "",
+ "C3=1/(2*math.pi*fL*RL) #Calculaing value of capacitance",
+ "C3=C3*10**6 #Calculaing value of capacitance",
+ "",
+ "C2=1/(2*math.pi*fL*R2/10) #Calculaing value of capacitance",
+ "C2=C2*10**6 #Calculaing value of capacitance",
+ "",
+ "",
+ "Zinmin=(1+Mmin)*56.0*10**3 #Calculating minimum input impedance",
+ "Zinmin=Zinmin/10**6 #Calculating minimum input impedance",
+ "",
+ "#Results:",
+ "print('\\nC3=%.2f uF'%C3)",
+ "print('\\nC2=%.2f uF'%C2)",
+ "# answer in textbook is wrong",
+ "print('\\nZin(min)= %d Mohm'%Zinmin)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "C3=0.96 uF",
+ "",
+ "C2=0.53 uF",
+ "",
+ "Zin(min)= 2800 Mohm"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.25, Page No: 156<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''high impedence capacitor coupled non-inverting amplifier'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "Vo=3.0 #output voltage in volt",
+ "Vi=10.0*10**-3 #Input voltage in volt",
+ "R2=1.0*10**6 #Resistance in ohm",
+ "Av=300.0 #Gain",
+ "fL=100.0 #Frequency in hertz",
+ "RL=15.0*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "R3=R2/(Av-1) #Calculating value of resistance ",
+ "",
+ "R1=R2-R3 #Calculating value of resistance",
+ "C2=1/(2*math.pi*fL*R3) #Calculatinf value of capacitance",
+ "C2=C2*10**6 #Calculating value of capacitance",
+ " ",
+ "C3=1/(2*math.pi*fL*RL/10) #Calculating value of capacitance",
+ "C3=C3*10**6 #Calculating value of capacitance",
+ "",
+ "#Results:",
+ "print('\\nC2= %.2f uF'%C2)",
+ "print('\\nC3= %.2f uF'%C3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "C2= 0.48 uF",
+ "",
+ "C3= 1.06 uF"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.26, Page NO: 159<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''capacitor coupled inverting amplifier'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "fL=20.0 #frequency in hertz",
+ "fH=2000.0 #frequency in hertz",
+ "RL=300.0 #Resistance in ohm",
+ "R1=1.5*10**3 #Resistance in ohm",
+ "R2=56*10**3 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "C1=1/(2*math.pi*fL*R1/10) #Calculating value of capacitance",
+ "",
+ "C1=C1*10**6 #Calculating value of capacitance",
+ "",
+ "C2=1/(2*math.pi*fL*RL) #Calculating value of capacitance",
+ "C2=C2*10**6 #Calculating value of capacitance",
+ "",
+ "Cf=1/(2*math.pi*fH*R2) #Calculating value of capacitance",
+ "Cf=Cf*10**12 #Calculating value of capacitance",
+ "",
+ "",
+ "#Results:",
+ "print('\\nC1= %d uF'%C1)",
+ "print('\\nC2= %.1f uF'%C2)",
+ "print('\\nCf= %d pF'%Cf)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "C1= 53 uF",
+ "",
+ "C2= 26.5 uF",
+ "",
+ "Cf= 1421 pF"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.27, Page No: 162<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''capacitor coupled non-inverting amplifier'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "Ibmax=500.0*10**-9 #Current in ampere",
+ "Vcc=24.0 #Volatge Vcc in volt",
+ "I2=50.0*10**-6 #Current in ampere",
+ "Vo=6.0 #Output voltage in volt",
+ "Av=100.0 #Gain",
+ "fL=100.0 #Frequency in hertz",
+ "RL=5.6*10**3 #Resistance in hertz",
+ "",
+ "#Calculations:",
+ "I2=100.0*Ibmax #Calculating current",
+ "R1=Vcc/(2.0*I2) #Calculating resistance",
+ "R2=R1 #value of R2 is equal to R1",
+ "Vi=Vo/Av #Calculating input voltage",
+ "",
+ "I4=100.0*Ibmax #Calculating current",
+ "R4=Vi/I4 #Calculating value of resistance",
+ "",
+ "R3=118.8*10**3 #Calculating value of resistance",
+ "R1pR2=(R1+R2)/4.0 #Calculating parellel combination of R1 and R2",
+ "",
+ "C1=1/(2*math.pi*fL*R1pR2/10.0) #Calculating value of capacitance",
+ "C1=C1*10**6 #Calculating value of capacitance",
+ " ",
+ "C2=1/(2*math.pi*fL*RL/10.0) #Calculating value of capacitance",
+ "C2=C2*10**6 #Calculating value of capacitance",
+ "",
+ "C3=1/(2*math.pi*fL*R4) #Calculating value of capacitance",
+ "C3=C3*10**6 #Calculating value of capacitance",
+ "",
+ "#Results:",
+ "print('\\nC1= %.3f uF'%C1)",
+ "print('\\nC2= %.3f uF'%C2)",
+ "print('\\nC3= %.3f uF'%C3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "C2= 2.842 uF",
+ "",
+ "C1= 0.133 uF",
+ "",
+ "C3= 1.326 uF"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 3.28, Page No:166<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''common mode gain Acm'''",
+ "",
+ "#Variable Declaration:",
+ "cmrr=10**5 #Common mode rejection ratio",
+ "Adm=10**5 #Differential gain",
+ "",
+ "#Calculations:",
+ "Acm=Adm/cmrr #Calculating common mode gain",
+ "",
+ "#Results:",
+ "print('Common mode gain Acm= %d'%Acm)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Common mode gain Acm= 1"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No: 3.29, Page NO: 168<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''differential amplifier with two op-amp'''",
+ "",
+ "#Variable Declaration:",
+ "R1=560.0 #Resistance value in ohm",
+ "R3=560.0 #Resistance value in ohm",
+ "Rf=5.6*10**3 #Resistance value in ohm",
+ "",
+ "R2=Rf #Value of R2 is equal to Rf",
+ "Vo1=-2.0 #Volatage in volt ",
+ "Ri=2.0*10**6 #Resistance value in ohm",
+ "Vo2=-1.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "# Part 1",
+ "Ad=1+Rf/R1 #Calculating differential gain",
+ "",
+ "# Part 2",
+ "A=200000.0 #Gain",
+ "Ri1=Ri*(1+ (A*R2)/(R2+R3)) #Calculating resistance value",
+ "Ri1=Ri1/10**9 #Calculating resistance value",
+ "",
+ "Ri2=Ri*(1+ (A*R1)/(R1+Rf)) #Calculating resistance value ",
+ "Ri2=Ri2/10**9 #Calculating resistance value",
+ " ",
+ "# Part 3",
+ "Vid=Vo2-Vo1 #Calculating differential voltage",
+ "Vo=(1+Rf/R1)*Vid #Calculating output voltage",
+ "Vo=Vo",
+ "",
+ "#Results:",
+ "print('\\nAd= %d'%Ad)",
+ "print('\\nRi1=%.1f Gohm'%Ri1)",
+ "print('\\nRi2=%.2f Gohm'%Ri2)",
+ "print('\\nVo=%d V'%Vo)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Ad= 11",
+ "",
+ "Ri1=363.6 Gohm",
+ "",
+ "Ri2=36.37 Gohm",
+ "",
+ "Vo=11 V"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_4.ipynb b/Linear_Integrated_Circuits/Chapter_4.ipynb
new file mode 100644
index 00000000..7405dd82
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_4.ipynb
@@ -0,0 +1,748 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 4: Applications of Operational Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.1, Page No: 185<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['prod', 'plotting', 'Circle', 'power', 'diag', 'fmax', 'sinh', 'trunc', 'binomial', 'plot', 'eye', 'f', 'det', 'tan', 'product', 'roots', 'sin', 'zeros', 'cosh', 'conjugate', 'take', 'solve', 'trace', 'beta', 'pylab', 'ones', 'transpose', 'vectorize', 'cos', 'interactive', 'diff', 'invert', 'tanh', 'Polygon', 'reshape', 'sqrt', 'floor', 'source', 'add', 'multinomial', 'test', 'poly', 'mod', 'sign', 'gamma', 'log', 'var', 'seterr', 'flatten', 'nan', 'pi', 'exp']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''phase lag circuit'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "R1=20.0*10**3 #Resistance in ohm\n",
+ "R=39.0*10**3 #Resistance in ohm\n",
+ "f=2000.0 #Frequencuy in hertz\n",
+ "Rf=R1 #Value of Rf is equal to R1 in ohm\n",
+ "C=10**-9 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "fo=1/(2*math.pi*R*C) #Calculating output frequency\n",
+ "\n",
+ "theta=-2*math.atan(f/fo) #Calculating phase angle\n",
+ "theta=theta*180/math.pi #Calculating phase angle\n",
+ "\n",
+ "td=theta/(f*360) #Calculating time delay\n",
+ "td=-td*10**6 #Calculating time delay\n",
+ "\n",
+ "#Results:\n",
+ "print('Phase angle=%.1f degree'%theta)\n",
+ "print('\\nTime delay td= %.1f us'%td)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Phase angle=-52.2 degree\n",
+ "\n",
+ "Time delay td= 72.5 us\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.2, Page No: 187<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''output current'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vee=12.0 #Volatge Vee in volt\n",
+ "Vcc=5.0 #Voltage Vcc in volt\n",
+ "RL=1000.0 #Resistance RL in ohm\n",
+ "\n",
+ "#Calculations:\n",
+ "Vdiff=Vee-Vcc #Calculating voltage difference\n",
+ "IL=Vdiff/RL #Calculating current\n",
+ "IL=IL*1000.0 #Calculating current\n",
+ "\n",
+ "#Results:\n",
+ "print('Current through RL is IL= %d mA'%IL)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through RL is IL= 7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.3, Page NO: 187<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''determine the current'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V=5.0 #Voltage in volt\n",
+ "R=1000.0 #Resistance in ohm\n",
+ "\n",
+ "#Calculations:\n",
+ "I=V/R #Calculating current\n",
+ "I=I*1000.0 #Calculating current\n",
+ "\n",
+ "#Results:\n",
+ "print('Current= %d mA'%I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current= 5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No.4.4, Page NO: 187<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''determine the current through RL'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Vcc=15.0 #Voltage in volt\n",
+ "Re2=1000.0 #Resistance in ohm\n",
+ "Vc1=5.0 #Voltage in volt\n",
+ "Ve2=5.0 #Voltage in volt\n",
+ "\n",
+ "#Calculations:\n",
+ "I=(Vcc-Ve2)/Re2 #Calculating current\n",
+ "I=I*1000.0 #Calculating current\n",
+ "\n",
+ "#Results:\n",
+ "print('Current= %d mA'%I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current= 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.5, Page No: 189<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''determine load gain'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R1=22.0*10**3 #Resistance in ohm\n",
+ "Rf=1000.0 #Feedback Resistance in ohm\n",
+ "RL=10.0*10**3 #Load Resistance in ohm \n",
+ "Ii=10.0*10**-6 #Current in ampere\n",
+ "\n",
+ "#Calculations:\n",
+ "Ai=1+R1/Rf #Calculating gain \n",
+ "Io=Ai*Ii #Calculating output current\n",
+ "Io=Io*10**6 #Calculating output current\n",
+ "print('Current Io= %f uA'%Io)\n",
+ "\n",
+ "Io=Io/10**6 #Calculating output current \n",
+ "Vmax=Io*RL + Ii*R1 #Calculating maximum voltage\n",
+ "\n",
+ "#Results:\n",
+ "print('\\nVmax= %.2f V'%Vmax)\n",
+ "print('\\nHence output clipping doesnot occur')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current Io= 230.000000 uA\n",
+ "\n",
+ "Vmax= 2.52 V\n",
+ "\n",
+ "Hence output clipping doesnot occur\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.6, Page No: 192<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltage to current converter with floating load'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "Rf=10.0*10**3 #Feedback resistance in ohm\n",
+ "RL=2000.0 #Load resistance in ohm\n",
+ "Vi=0.5 #Input voltage in volt\n",
+ "\n",
+ "#Calculations:\n",
+ "IL=Vi/Rf #Calculating current\n",
+ "IL=IL*10**6 #Calculating current\n",
+ "print('Current IL= %d uA'%IL)\n",
+ "\n",
+ "IL=IL/10**6 #Calculating current\n",
+ "Vmax=IL*RL + IL*Rf #Calculating maximum voltage\n",
+ "\n",
+ "#Results:\n",
+ "print('\\nVmax= %.2f V'%Vmax)\n",
+ "print('\\nHence output clipping doesnot occur')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current IL= 50 uA\n",
+ "\n",
+ "Vmax= 0.60 V\n",
+ "\n",
+ "Hence output clipping doesnot occur\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.7, Page No: 194<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''summing amplifier'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "V1=2.0 #Voltage in volt\n",
+ "V2=3.0 #Voltage in volt\n",
+ "V3=4.0 #Voltage in volt\n",
+ "Rf=1000.0 #Feedback resistance in ohm\n",
+ "R1=Rf #Resistance value of the R1 is equal to Rf in ohm\n",
+ "R2=Rf #Resistance value of the R2 is equal to Rf in ohm \n",
+ "R3=Rf #Resistance value of the R3 is equal to Rf in ohm\n",
+ "R=Rf #Resistance value of the R is equal to Rf in ohm \n",
+ "\n",
+ "#Calculations:\n",
+ "Vo=-(Rf/R1)*(V1+V2+V3) #Calculating output voltage\n",
+ "\n",
+ "#Results:\n",
+ "print('Vo= %d V'%Vo)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo= -9 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No: 4.9, Page NO: 207<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''practical integrator circuit'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "R1=10.0*10**3 #Resistance in ohm\n",
+ "Rf=100.0*10**3 #Resistance in ohm\n",
+ "Cf=10.0*10**-9 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "fa=1/(2*math.pi*Rf*Cf) #Calculating lower frequency limit\n",
+ "\n",
+ "#PART (a)\n",
+ "Vo1=10**4/(2*3.14*2500) \n",
+ "#PART (b)\n",
+ "Vo2 = -10**4*0.2*10**-3 \n",
+ "#PART (c)\n",
+ "Vo3 = -10**4*0.6*10**-3\n",
+ "#Results:\n",
+ "print('fa= %d Hz'%fa)\n",
+ "print('output voltage for sine wave input is %.3f volt'%Vo1)\n",
+ "print('output voltage for square wave input is %d volt'%Vo2)\n",
+ "print('output voltage for step input is %d volt'%Vo3)\n",
+ "\n",
+ "##############(1)#############\n",
+ "t = arange(0.001, 1, 0.005)\n",
+ "k = arange(0.0001, 0.2, 0.0005)\n",
+ "subplot(221)\n",
+ "plot(t, sin(16*t))\n",
+ "plot(t,0.637*cos(16*t))\n",
+ "plot(t,(0*t)/t,'-')\n",
+ "plot(k,(-0.637*k)/k,'--')\n",
+ "ylim( (-1,1) )\n",
+ "text(-0.11,-0.637,'-0.637')\n",
+ "text(0.2,0.2,'Green = Vo')\n",
+ "text(0.07,0.5,'Blue = Vi')\n",
+ "ylabel('Vin')\n",
+ "xlabel('time in ms')\n",
+ "title('Input & output waveforms of integrator')\n",
+ "\n",
+ "##############(2)#################\n",
+ "n = arange(0.0001,0.2, 0.0005)\n",
+ "n1= arange(0.2, 2*0.2, 0.0005)\n",
+ "n2= arange(2*0.2, 3*0.2, 0.0005)\n",
+ "n3= arange(3*0.2,4*0.2, 0.0005)\n",
+ "n4= arange(4*0.2,5*0.2, 0.0005)\n",
+ "n5= arange(0.0001,5*0.2, 0.0005)\n",
+ "\n",
+ "a=arange(-1,1,0.0005)\n",
+ "\n",
+ "x5=(0.2*a)/a\n",
+ "x10=(2*0.2*a)/a\n",
+ "x15=(3*0.2*a)/a\n",
+ "x25=(4*0.2*a)/a\n",
+ "\n",
+ "subplot(223)\n",
+ "\n",
+ "plot(n5,(0*n5)/n5,'-')\n",
+ "plot(n,1*n/n,'b')\n",
+ "plot(n1,-1*n1/n1,'b')\n",
+ "plot(n2,1*n2/n2,'b')\n",
+ "plot(n3,-1*n3/n3,'b')\n",
+ "plot(n4,1*n4/n4,'b')\n",
+ "\n",
+ "plot(x5,a,'b')\n",
+ "plot(x10,a,'b')\n",
+ "plot(x15,a,'b')\n",
+ "plot(x25,a,'b')\n",
+ "\n",
+ "plot(n,(-10*n+1),'r')\n",
+ "plot(n1,(10*n-1),'r')\n",
+ "plot(n+0.4,(-10*n+1),'r')\n",
+ "plot(n3,(10*n-1),'r')\n",
+ "\n",
+ "ylim( (-1.1,1.1) )\n",
+ "text(0.3,-0.4,'Red = Vo')\n",
+ "text(0.05,0.5,'Blue = Vi')\n",
+ "ylabel('Vin')\n",
+ "xlabel('time in ms')\n",
+ "\n",
+ "###############(3)##################\n",
+ "t = arange(0.0001, 1, 0.0005)\n",
+ "t2 = arange(0.0001, 0.6, 0.0005)\n",
+ "a=arange(-6,0.0001,0.0005)\n",
+ "x=(0.6*a)/a\n",
+ "subplot(222)\n",
+ "plot(t,1*t/t,'r')\n",
+ "plot(t,0*t/t,'--')\n",
+ "plot(t2,-6*t2/t2,'--')\n",
+ "plot(x,a,'--')\n",
+ "plot(t,(-10*t),'b')\n",
+ "text(0.4,-4,'Vo')\n",
+ "text(0.3,1.1,'Vi')\n",
+ "xlabel('time in ms')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fa= 159 Hz\n",
+ "output voltage for sine wave input is 0.637 volt\n",
+ "output voltage for square wave input is -2 volt\n",
+ "output voltage for step input is -6 volt\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 33,
+ "text": [
+ "<matplotlib.text.Text at 0xce594e0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEZCAYAAACAZ8KHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXdYFNfXx79LMRYUQRQFpIOAVEVQo4JRVBSxxSD2bkyM\nMW/sJsH8Elssib0klhgTwS4W0ETBTmzYQBEQUFCJhSIdds/7x8hKWdiZ2V0WcD7Psw/szL33nNm9\nO2fuPfecKyIigoCAgICAAEs01K2AgICAgEDdQjAcAgICAgKcEAyHgICAgAAnBMMhICAgIMAJwXAI\nCAgICHBCMBwCAgICApwQDIdAOTZv3gxDQ0M0a9YMGRkZ6laHFenp6ejRoweaNWuGOXPmVDo/ffp0\n/Pjjj2rQTECgfiLXcJibm+PMmTMqV2Tx4sUYM2aM3HKrVq2CkZER9PT08NFHH6GgoEBlOnl7e2P7\n9u21tj1lU1xcjK+//hpnzpxBdnY29PT01K0SK7Zt24ZWrVohOzsbK1eurHR+8+bN+Oabb1i1NX78\neHz77bfKVpE1u3btQvfu3dUmX0CADVryCohEIohEoprQRS4PHjzAt99+i+vXr8POzg6XLl2Chobq\nBk3Kvu7a8jlWxfPnz1FQUAB7e3vOdUvjSNVxjSkpKbx0rmlKSkqgpSX3J6cQYrEYmpqaKpUhIACS\ng7m5OZ05c4aIiHbu3EkffvghzZ49m/T09MjCwoLCwsKkZb28vGj+/Pnk4eFBzZo1o0GDBtHr16+J\niCgiIoJMTEzKtW1mZkb//PMPhYWFUYMGDUhbW5t0dHTI1dVVpi7x8fHUpEkTys7Olqe2lMzMTBoz\nZgy1bNmS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mFhIWFhYSxevJjz58/rJxbasGEDCQkJjBkzBh8fH9asWcMH\nH3zA4MGDiYyM5MaNGwAUFhYSFxdHREQE0dHRnD59ukGcDRs28NprrwEwe/ZsFixYQFRUFP369SMl\nJaXB8kVFRfj7+/Piiy8yYMAAZs6cSWZmJlFRUfTv35/Dhw8DsH//fsLCwggLC2Pw4MHcvXvXUn8q\nIYRWtK14IuorKiqqUyupdu2k9evXK76+vsrdu3eVK1euKJ06dVLWrl2rKIpav+mvf/2roiiKMmrU\nKOXs2bOKoqgTDo0aNapBnA0bNijz589XFEVRZs2apTz33HOKoihKQUGB4uvr22D5c+fOKc7OzsoP\nP/ygVFVVKeHh4cpLL72kKIqipKWlKQkJCYqiKMrEiROV7OxsRVEUpaysTKmoqDD9jyKEsCl2Vauq\nLVBa6DkcOXIkbm5uuLm54eHhwcSJEwEIDg4mPz+fsrIysrOz61wXKS8vb3abOp2OhIQEAAICApqc\nnMjHx4fAwEAAAgMDGT16NABBQUEUFRUBEBUVxRtvvMHMmTOZPHmyVI8VwgFJ4rAzHTp00D93cnLS\nv3ZycqKiooKqqiq6dOli9HzYLi4u+udNJa/6sWvWqYkNsHjxYiZMmMD27duJiopi165dDBgwwKi2\nCCFsm1zjsDHu7u7cuXPH6PVqfuzd3d3x8fEhOTlZ/35+fn6Ty5tbYWEhgYGBLFq0iCFDhjR6fUUI\nYd8kcdiYbt26ERUVRXBwMIsXL0an0+lnmav9vOZ17ec1rzdu3Mi6desIDQ0lKCiI9PT0BnFa2lZj\n6r/f2DqrVq0iODiYkJAQXFxciIuLM3jfhRD2QYbjCiGEMIqccQghhDCKJA4hhBBGkcQhhBDCKJI4\nhBBCGEUShxBCCKNI4hBCCGEUSRxCCCGMIolDCCGEUf4/SwliUbOH8R0AAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0xcb7c6a0>"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No: 4.10, Page No: 210<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''design a differentiator'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "fa=1.0*10**3 #Upper cut off frequency in hertz\n",
+ "C1=1.0*10**-6 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "Rf=1/(2*math.pi*fa*C1) #Calculating value of resistance\n",
+ "Rf=Rf/100.0 #Calculating value of resistance \n",
+ "\n",
+ "#Results:\n",
+ "print('Rf= %.2f kohm'%Rf)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rf= 1.59 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 4.11, Page No: 213<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''design a differentiator using op-amp'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "import pylab\n",
+ "import numpy\n",
+ "fa=200.0 #frequency in hertz\n",
+ "fmax=fa #frequency fmax is equal to fa\n",
+ "C1=0.1*10**-6 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ " \n",
+ "Rf=1/(2*math.pi*fa*C1) #Calcukating resistance value \n",
+ "Rf=Rf/1000.0 #Calculating resistance value\n",
+ "\n",
+ "fb=10.0*fa #Calculating frequency\n",
+ "R1=1/(2*math.pi*fb*C1) #Calculating resistance \n",
+ "R1=R1/1000.0 #Calculating resistance\n",
+ "\n",
+ "Cf=R1*C1/Rf #Calculating capacitance \n",
+ "Cf=Cf*10**6 #Calculating capacitance\n",
+ "\n",
+ "subplot(211)\n",
+ "plot(t,1*sin(2*pi*t))\n",
+ "\n",
+ "ylim( (-1,1) )\n",
+ "ylabel('Vin')\n",
+ "title('Input Waveform')\n",
+ "\n",
+ "\n",
+ "#Results:\n",
+ "print('Rf= %.3f kohm'%Rf)\n",
+ "print('\\nR1= %.3f kohm'%R1)\n",
+ "print('\\nCf= %.2f uF'%Cf)\n",
+ "\n",
+ "############PLOT###################\n",
+ "\n",
+ "##########(1)###############\n",
+ "t = arange(0.001, 5*pi, 0.005)\n",
+ "subplot(221)\n",
+ "plot(t, sin(pi*t/4))\n",
+ "plot(t,(0*t)/t,'-')\n",
+ "ylim( (-1,1) )\n",
+ "ylabel('Vin')\n",
+ "title('Input Waveform')\n",
+ "\n",
+ "###########(2)#######\n",
+ "subplot(223)\n",
+ "plot(t, cos((pi*t/4-135)))\n",
+ "plot(t,(0*t)/t,'-')\n",
+ "ylim( (-1,1) )\n",
+ "ylabel('Vout')\n",
+ "xlabel('(a)')\n",
+ "title('Output Waveform')\n",
+ "\n",
+ "##########(3)#########\n",
+ "k = arange(0.0001, pi, 0.0005)\n",
+ "k1= arange(pi, 2*pi, 0.0005)\n",
+ "k2= arange(2*pi, 3*pi, 0.0005)\n",
+ "k3= arange(3*pi,4*pi, 0.0005)\n",
+ "k4= arange(4*pi,5*pi, 0.0005)\n",
+ "m=arange(-1,1,0.0005)\n",
+ "x5=(pi*m)/m\n",
+ "x10=(2*pi*m)/m\n",
+ "x15=(3*pi*m)/m\n",
+ "x25=(4*pi*m)/m\n",
+ "subplot(222)\n",
+ "plot(t,(0*t)/t,'-')\n",
+ "plot(k,1*k/k,'b')\n",
+ "plot(k1,-1*k1/k1,'b')\n",
+ "plot(k2,1*k2/k2,'b')\n",
+ "plot(k3,-1*k3/k3,'b')\n",
+ "plot(k4,1*k4/k4,'b')\n",
+ "plot(x5,m,'b')\n",
+ "plot(x10,m,'b')\n",
+ "plot(x15,m,'b')\n",
+ "plot(x25,m,'b')\n",
+ "ylim( (-1.1,1.1) )\n",
+ "ylabel('Vin')\n",
+ "title('Input Waveform')\n",
+ "\n",
+ "############(4)############\n",
+ "subplot(224)\n",
+ "m1=arange(0.001,13,0.0005)\n",
+ "m2=arange(-13,0.001,0.0005)\n",
+ "y1=(0.01*pi*m2)/m2\n",
+ "y5=(pi*m1)/m1\n",
+ "y10=(2*pi*m2)/m2\n",
+ "y15=(3*pi*m1)/m1\n",
+ "y25=(4*pi*m2)/m2\n",
+ "plot(t,(0*t)/t,'-')\n",
+ "plot(y5,m1,'b')\n",
+ "plot(y10,m2,'b')\n",
+ "plot(y1,m2,'b')\n",
+ "plot(y15,m1,'b')\n",
+ "plot(y25,m2,'b')\n",
+ "plot(y5+0.1,m1,'b')\n",
+ "plot(y10+0.1,m2,'b')\n",
+ "plot(y1+0.1,m2,'b')\n",
+ "plot(y15+0.1,m1,'b')\n",
+ "plot(y25+0.1,m2,'b')\n",
+ "text(-2.5,13,'Vsat')\n",
+ "text(-2.5,-13,'-Vsat')\n",
+ "ylim(-13,13)\n",
+ "ylabel('Vout')\n",
+ "xlabel('(b)')\n",
+ "title('Output Waveform')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rf= 7.958 kohm\n",
+ "\n",
+ "R1= 0.796 kohm\n",
+ "\n",
+ "Cf= 0.01 uF\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 35,
+ "text": [
+ "<matplotlib.text.Text at 0xd0e5c18>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEZCAYAAACEkhK6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXlcjen7xz+nzWixDe0RKpWSyDpaSErIvhQm24yxjJnv\nzBh9zYLv11gGYwazMN+x/6bCMEIlSjJCY8TMyBBTpBQiIlSn+/fH7ZxpO3WWZznndL9fr/PS85zn\nue7ruV3nue71uiSEEAIGg8FgMBrBQGwFGAwGg6EbMIfBYDAYDKVgDoPBY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VP4/fffHdtZLBbIZDKEhIR4q6mMCeZc1wBw7tw59Pb2Ynp6GkePHkV6errj\nNbPZLOleImw27jD8mEwmg0ajwa+//orNmzejs7MTycnJOHz4MFQqlWM7o9GI1atXe7GljAnnXNcB\nAQFIS0vDrl27oFarERsb67h3xdWrVxEeHs7XLzyIL3r7uYaGBpjNZlRUVLjcZu/evUhLS0NBQcEC\ntowx8YTU9f79+3Hz5k3s3r17AVvm37jD8HNWqxVZWVk4ffr0nOdyLRYLsrOzXb7OmC+6XV0D9ol7\nLS0tou9hzv6NOwzGGGOC8DUMxhhjgnCHwRhjTBDuMBhjjAnCHQZjjDFBuMNgjDEmCHcYjDHGBPkf\nTLIKPpISrGkAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0xcb7cc18>"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No.4.13, Page No: 226<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''transfer function using op-amp'''\n",
+ "import sympy\n",
+ "from sympy import *\n",
+ "sympy.init_printing()\n",
+ "\n",
+ "s = Symbol(\"s\")\n",
+ "H = 4/(s**2+3.3*s+0.9)\n",
+ "print(\"The given transfer function is:\")\n",
+ "display(H.simplify())\n",
+ "print(\"\\n\\n\\nThe above transfer function can be represented after factoring as given by:\")\n",
+ "display(factor(H))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The given transfer function is:\n"
+ ]
+ },
+ {
+ "latex": [
+ "$$\\frac{4}{s^{2} + 3.3 s + 0.9}$$"
+ ],
+ "metadata": {},
+ "output_type": "display_data",
+ "text": [
+ " 4 \n",
+ "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n",
+ " 2 \n",
+ "s + 3.3\u22c5s + 0.9"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "\n",
+ "The above transfer function can be represented after factoring as given by:\n"
+ ]
+ },
+ {
+ "latex": [
+ "$$\\frac{40.0}{\\left(1.0 s + 3.0\\right) \\left(10.0 s + 3.0\\right)}$$"
+ ],
+ "metadata": {},
+ "output_type": "display_data",
+ "text": [
+ " 40.0 \n",
+ "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n",
+ "(1.0\u22c5s + 3.0)\u22c5(10.0\u22c5s + 3.0)"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_5.ipynb b/Linear_Integrated_Circuits/Chapter_5.ipynb
new file mode 100644
index 00000000..c23dacd0
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_5.ipynb
@@ -0,0 +1,212 @@
+{
+ "metadata": {
+ "name": "ch_5"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 5: Operational Amplifiers- Non-linear Circuits<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.5.1, Page No: 234<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' transfer characteristics of comparator'''",
+ "",
+ "#Variable Declaration:",
+ "Vz1=5.5 #Volatage in volt",
+ "Vz2=5.5 #Voltage in volt",
+ "Aol=100000.0 #Open loop gain",
+ "Vd=0.7 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "Vo=Vz1+Vd # Plus or minus",
+ "Vich=Vo/Aol #Calculating change in voltage",
+ "Vich=Vich*1000.0 #Calculating change in voltage",
+ "",
+ "#Results:",
+ "print('Delta Vi=%.3f mV'%Vich)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delta Vi=0.062 mV"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 5.2, Page No: 239<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''inverting schmitt trigger'''",
+ "",
+ "#Variable Declaration:",
+ "R1=56.0*10**3 #Resistance value in ohm",
+ "R2=150.0 #Resistance value in ohm",
+ "Vi=1.0 #Voltage in volt",
+ "f=50.0 #Frequency in hertz",
+ "Vsat=13.5 #Voltage in volt",
+ "Vref=0.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "Vut=Vsat*R2/(R1+R2) #Calculating Vut voltage",
+ "Vut=Vut*1000.0 #Calculating Vut voltage",
+ "VL=-Vut #Calculating Vlt voltage",
+ "",
+ "#Results:",
+ "print('Vut= %d mV'%Vut)",
+ "print('\\nVL= %d mV'%VL)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vut= 36 mV",
+ "",
+ "VL= -36 mV"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No: 5.3, Page No: 249<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''clipper circuit'''",
+ "",
+ "#Variable Declaration:",
+ "Vclipl=0.35 #Voltage in volt",
+ "Vp=0.5 #Voltage in volt",
+ "gain=10.0 #Gain",
+ "R=1000.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "Vounclip=Vp*gain #Calculating unclipped output voltage",
+ "Voclip=Vclipl*gain #Calculating clipped output voltage ",
+ "Vb=Voclip-0.7 #Calculating breakdown voltage",
+ "",
+ "#Results:",
+ "print('When unclipped, output voltage= %.1f V'%Vounclip)",
+ "print('\\nWhen clipped, output voltage= %.1f V'% Voclip)",
+ "print('\\nZener diode breakdown voltage= %.1f V'%Vb)",
+ "print('\\nA 2.8V Zener diode should be connected')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When unclipped, output voltage= 5.0 V",
+ "",
+ "When clipped, output voltage= 3.5 V",
+ "",
+ "Zener diode breakdown voltage= 2.8 V",
+ "",
+ "A 2.8V Zener diode should be connected"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No: 5.4, Page NO: 251<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''negative clamping circuit'''",
+ "",
+ "#Variable Declaration:",
+ "Vref=1.5 #Voltage in volt",
+ "",
+ "#Part A",
+ "#Variable declaration:",
+ "Vpp=5.0 #Voltage in volt",
+ "Vnp=2.5 #Voltage in volt",
+ "",
+ "#Calculation:",
+ "Vc=Vnp + Vref #Calculating capacitor voltage ",
+ "",
+ "#Result:",
+ "print('\\nCapacitor voltage Vc= %.1f V'%Vc) ",
+ "",
+ "#Part B",
+ "#Calculation:",
+ "Vopeak=Vnp + Vref +Vpp #Calculating peak clamped output voltage",
+ "",
+ "#Result:",
+ "print('\\nPeak value of clamped output voltage Vo(peak)= %.1f V'%Vopeak)",
+ "",
+ "#Part C",
+ "#Calculation:",
+ "Voc=0.7 + Vref #Calating output voltage during charging",
+ "",
+ "#Result:",
+ "print('\\nOp-amp output voltage during charging Vo= %.1f V'% Voc) ",
+ "",
+ "#Part D",
+ "#Calculation:",
+ "Vd=Vref-Vopeak #Calculating maximum differenctial input voltage",
+ "",
+ "#Result:",
+ "print('\\nMaximum differential input voltage Vd= %.1f V'%Vd) "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Capacitor voltage Vc= 4.0 V",
+ "",
+ "Peak value of clamped output voltage Vo(peak)= 9.0 V",
+ "",
+ "Op-amp output voltage during charging Vo= 2.2 V",
+ "",
+ "Maximum differential input voltage Vd= -7.5 V"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_6.ipynb b/Linear_Integrated_Circuits/Chapter_6.ipynb
new file mode 100644
index 00000000..002417d5
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_6.ipynb
@@ -0,0 +1,763 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 6: Active Filters<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.1, Page NO: 269<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['f']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''first order low pass butterworth filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "fH=10.0*10**3 #Frequency in hertz\n",
+ "f=12.0*10**3 #Frequency in hertz\n",
+ "\n",
+ "#Calculations:\n",
+ "t=(f**2/fH**2) \n",
+ "Hif=1/(math.sqrt(1+t)) #Calculating magnitude of voltage tranfer fuction\n",
+ "Hifdb=20*math.log(Hif)/math.log(10) #Calculating magnitude of voltage tranfer fuction\n",
+ "\n",
+ "#Result:\n",
+ "print('Delta Vi=%.2f dB'%Hifdb)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delta Vi=-3.87 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.2, Page No: 270<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''first order low pass filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "fh=2000.0 #Cut-off frequency in hertz\n",
+ "A=2.0 #Gain\n",
+ "C=0.01*10**-6 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "R=1/(2*math.pi*fh*C) #Calculating value of resistance\n",
+ "R=R/1000.0 #Calculating resistance value\n",
+ "\n",
+ "#Results:\n",
+ "print('R= %.3f kohm'%R)\n",
+ "#Rf/Ri=A-1\n",
+ "print('\\n Hence Rf=Ri=10kohm')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 7.958 kohm\n",
+ "\n",
+ " Hence Rf=Ri=10kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No.6.3, Page No: 272<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''second order low pass butterworth filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "fh=10.0*10**3 #Cut-off frequency in hertz \n",
+ "f=12.0*10**3 #Signal freuency in hertz\n",
+ "R=200.0*10**3 #Resistance value in ohm\n",
+ "\n",
+ "#Calaculations:\n",
+ "RC=1/(2*math.pi*fh) #Calculating value of resistance\n",
+ "C=RC/R #Calculating value of capacitance \n",
+ "C3=1.414*C #Calculating value of capacitance\n",
+ "C4=0.707*C #Calculating value of capacitance \n",
+ "\n",
+ "t=(f**4/fh**4) \n",
+ "Hif=1/(math.sqrt(1+t)) #Calculating magnitude of voltage tranfer fuction\n",
+ "Hifdb=20*math.log(Hif)/math.log(10) #Calculating magnitude of voltage tranfer fuction\n",
+ "\n",
+ "#Result:\n",
+ "print('Hif= %.2f dB'%Hifdb)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hif= -4.88 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 6.4, Page No-275<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''second order low pass butterworth filter with uppercutoff frequency'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "N=2.0 #Order of filter\n",
+ "fh=2.0*10**3 #upper cut-off frequency in hertz\n",
+ "C=0.1*10**-6 #Capacitance value in farad\n",
+ "alpha=1.414 #Value of damping coefficient\n",
+ "\n",
+ "#Calculations:\n",
+ "R=1/(2*math.pi*fh*C) #Calculating resistance value\n",
+ "Rkohm=R/1000.0 #Calculating resistance value\n",
+ "A=3-alpha #Calculating passband gain\n",
+ "RfbyRi=A-1 #Calculating ratio Rf/Ri\n",
+ "\n",
+ "#Results:\n",
+ "print('R= %.1f kohm'%Rkohm)\n",
+ "print('\\nRf/Ri= %.3f'%RfbyRi)\n",
+ "print('\\nHence, take Rf=5.86 kohm and Ri=10 kohm')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 0.8 kohm\n",
+ "\n",
+ "Rf/Ri= 0.586\n",
+ "\n",
+ "Hence, take Rf=5.86 kohm and Ri=10 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No.6.5, Page No: 276<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''third order low pass butterworth filter'''\n",
+ "\n",
+ "#Variable declaration:\n",
+ "import math\n",
+ "\n",
+ "fh=10.0*10**3 #cut-off frequency in hertz\n",
+ "f=12.0*10**3 #Signal frequency in hertz\n",
+ "\n",
+ "#For third order low pass butterworth filter\n",
+ "\n",
+ "#Calculations:\n",
+ "t=(f**6/fh**6) \n",
+ "Hif=1/(math.sqrt(1+t)) #Calculating magnitude of voltage transfer function\n",
+ "Hifdb=20*math.log(Hif)/math.log(10) #Calculating magnitude of voltage transfer function\n",
+ "\n",
+ "#Result:\n",
+ "print('Hif= %.4f dB'%Hifdb)\n",
+ "\n",
+ "#For fourth order low pass butterworth filter\n",
+ "\n",
+ "#Calculation:\n",
+ "t=(f**8/fh**8)\n",
+ "Hif=1/(math.sqrt(1+t))\n",
+ "Hifdb=20*math.log(Hif)/math.log(10)\n",
+ "\n",
+ "#Result:\n",
+ "print('\\nHif= %.2f dB'%Hifdb)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hif= -6.0054 dB\n",
+ "\n",
+ "Hif= -7.24 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.6, Page No: 276 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''fourth order low pass butterworth filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "N=2.0 #Order of filter\n",
+ "fh=2000.0 #cut-off frequency in hertz\n",
+ "C=0.1*10**-6 #Capacitance values in farad\n",
+ "alpha1=0.765 #damping coefficient\n",
+ "alpha2=1.848 #damping coefficient\n",
+ "\n",
+ "#Calculations:\n",
+ "R=1/(2*math.pi*fh*C) #Calculating resistance value\n",
+ "Rkohm=R/1000.0 #Calculating resistance value\n",
+ "\n",
+ "A1=3-alpha1 #Calculating passband gain\n",
+ "A2=3-alpha2 #Calculating passband gain\n",
+ "\n",
+ "Rf1byRi1=A1-1 #Calculating Rf1/Ri1 ratio\n",
+ "Rf2byRi2=A2-1 #Calculating Rf2/Ri2 ratio\n",
+ "\n",
+ "#Results:\n",
+ "print('R= %.1f kohm'%Rkohm)\n",
+ "print('\\nRf1/Ri1= %.3f'%Rf1byRi1)\n",
+ "print('\\nHence, take Rf1=12.35 kohm and Ri1=10 kohm')\n",
+ "print('\\nRf2/Ri2= %.3f'%Rf2byRi2)\n",
+ "print('\\nHence, take Rf2=15.2 kohm and Ri2=100 kohm')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 0.8 kohm\n",
+ "\n",
+ "Rf1/Ri1= 1.235\n",
+ "\n",
+ "Hence, take Rf1=12.35 kohm and Ri1=10 kohm\n",
+ "\n",
+ "Rf2/Ri2= 0.152\n",
+ "\n",
+ "Hence, take Rf2=15.2 kohm and Ri2=100 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.7, Page No: 279<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''first order high pass filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "A=2.0 #Gain\n",
+ "fL=2.0*10**3 #Frequency in hertz\n",
+ "C=0.01*10**-6 #Capacitance value in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "R=1/(2*math.pi*fL*C) #Calculating value of resistance\n",
+ "Rkohm=R/1000.0 #Calculating value of resistance\n",
+ "RfbyRi=A-1 #Calculating ratio Rf/Ri\n",
+ "\n",
+ "#Results:\n",
+ "print('R= %.1f kohm'%Rkohm)\n",
+ "print('\\nRf/Ri= %.3f'%RfbyRi)\n",
+ "print('\\nHence, take Rf=10 kohm and Ri=10 kohm')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 8.0 kohm\n",
+ "\n",
+ "Rf/Ri= 1.000\n",
+ "\n",
+ "Hence, take Rf=10 kohm and Ri=10 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No: 6.8, Page No: 282<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''second order high pass butterworth filter variable gain'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "\n",
+ "R2=16.0*10**3 #Resistance in ohm\n",
+ "R3=16.0*10**3 #Resistance in ohm\n",
+ "Rf=15.8*10**3 #Resistance in ohm\n",
+ "Ri=27.0*10**3 #Resistance in ohm\n",
+ "C2=0.01*10**-6 #Capacitance in farad\n",
+ "C3=0.01*10**-6 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "fL=1/(2*math.pi*math.sqrt(R2*R3*C2*C3)) #Calculating lower cut-off frequency\n",
+ "fL=fL/1000.0 #Calculating lower cut-off frequency\n",
+ "A=1+Rf/Ri #Calculating passband gain\n",
+ "\n",
+ "#Results:\n",
+ "print('\\nfL= %.1f kHz'%fL)\n",
+ "print('\\nA= %.3f'%A)\n",
+ "\n",
+ "a=[-35.99,-23.96,-3.12,1.00,3.95,4.00,4.01,4.01,4.01]\n",
+ "b=[log10(100),log10(200),log10(700),log10(1000),log10(3000),log10(7000),log10(10000),log10(30000),log10(100000)]\n",
+ "plot(b,a,'b')\n",
+ "plot(log10(100),-35.99,'o')\n",
+ "plot(log10(200),-23.96,'o')\n",
+ "plot(log10(700),-3.12,'o')\n",
+ "plot(log10(1000),1.00,'o')\n",
+ "plot(log10(3000),3.95,'o')\n",
+ "plot(log10(7000),4.00,'o')\n",
+ "plot(log10(10000),4.01,'o')\n",
+ "plot(log10(30000),4.01,'o')\n",
+ "plot(log10(100000),4.01,'o')\n",
+ "m=arange(-40,1,0.0005)\n",
+ "x5=(3*m)/m\n",
+ "plot(x5,m,'--')\n",
+ "k = arange(2.0001,3.5, 0.0005)\n",
+ "plot(k,4.006*k/k,'--')\n",
+ "text(1.6,4.006,'+4.006')\n",
+ "text(3.3,-38,'Passband')\n",
+ "text(2.3,-38,'Stopband')\n",
+ "text(2.2,-10,'40 dB/decade')\n",
+ "text(3,2,'3dB')\n",
+ "title('Frequency response of ssecond order high-pass filter')\n",
+ "ylabel('Voltage gain in dB')\n",
+ "xlabel('frequency index n where n=log(f)')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "fL= 1.0 kHz\n",
+ "\n",
+ "A= 1.585\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 25,
+ "text": [
+ "<matplotlib.text.Text at 0x8410ba8>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEZCAYAAABWwhjiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XlcVNX7wPHPsCQuCKgpigsKGpIbuO+4gJRLauWClX4t\nW0w0bdFMU8s1tV8uWX0t9zUzlyQVU8G1sMRcMBdyZTG3ZAcZzu+P0ftlBFQYYBh43q+XL+HOvec+\n985lnrnnnHuOTimlEEIIIfLAytwBCCGEsFySRIQQQuSZJBEhhBB5JklECCFEnkkSE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7atQoatasiYODA82aNePAgQPaa2FhYTRr1gwHBwecnZ159913gYdfM5l1\n7tyZkJAQRowYQfny5Tl37lyO1XEvv/wyly9fpmfPntjb2zNnzhwAfv31V9q0aYOTkxNNmjQhNDRU\n28bHx4cJEybQtm1bypYty4ULF3I8DyZRJZCrq6v65ZdfsizX6XTKz89P3b59W6WkpKijR4+qypUr\nq7CwMJWRkaGWL1+uXF1dVVpamkpNTVU1a9ZUX3zxhUpPT1c//PCDsrW1VRMnTlRKKbV06VLVrl27\nLOVHRkYqpZR655131HPPPadu376t4uPjVc+ePdWHH36olFJq7969ysbGRk2aNEmlp6ern3/+WZUp\nU0b9+++/Simlhg8frjp16qSio6OVXq9Xhw8fVqmpqer7779XLVu21PZ37NgxVbFiRXX37t0sx3rh\nwgWl0+nU4MGDVVJSkkpOTlabN29W7u7u6q+//lJ6vV5NnTpVtWnTRiml1I4dO1TTpk3VnTt3lFJK\n/fXXXyomJkYppdTgwYOVvb292r9/v0pNTVWjRo3Sjv3mzZvK0dFRrVq1Sun1erV27Vrl5OSkbt26\npZRSqmPHjsrd3V2dO3dOJScnKx8fHzVu3DillFJff/216tmzp0pOTlYZGRnq6NGjKi4uTimlVO/e\nvdWbb76pkpKS1D///KNatGihvvnmm2zf74kTJ6rWrVur69evq+vXr6s2bdpo79PFixeVTqdTer0+\n221ziiEhIUGVL19enT17VimlVGxsrDp16pRSSj30PMbFxSlnZ2f1+eefq9TUVBUfH69+++23R8b5\nqGuif//+qn///iopKUmdPHlSubi4qPbt22d7TGfOnFFly5ZVv/zyi0pPT1efffaZcnd3166TWrVq\nKS8vL3X16lWVkpKiTp06pcqVK6e9v2PGjFE2NjZq9+7dSimlvvjiC9W6dWsVFRWl0tLS1BtvvKEG\nDhyY7XWWkpKSJZ5HHduQIUO087B9+3bl7OysIiIiVFJSkho0aJDR39XgwYNVxYoV1ZEjR1R6eroa\nNGiQGjBgQLbn4f76OV27Sim1atUqdevWLaXX69XcuXOVs7OzSk1NVUop1apVK7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ftphQGYsLKwXP+NcR\niURoaWmBq6vrorSXl5eH0dFRq17lZSweGo0GK1euxPDwMBQKBZqamiAUCtHZ2Ym0tDScPXvW5HE7\nduxASUkJe8V3icDGRBj/Oov5/DouLg5dXV2oqalZtDYZ1hETE4ORkRFMTk4iIyODSwobNmzAqlWr\n0NHRAS8vL4Nj2tvb4e3tzRLIEoLdiTAYDAbDatiYCIPBYDCshiURBoPBYFgNSyIMBoPBsBqWRBgM\nBoNhNSyJMBgMBsNqWBJhMBgMhtX8D++jTT73oT5eAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5070fd0>"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.9, Page No: 284<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''fourth order high pass butterworth filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "fh=50000.0 #frequency in hertz\n",
+ "C=0.001*10**-6 #capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "R=1/(2.0*math.pi*fh*C) #Calculating value of resistance\n",
+ "Rkohm=R/1000.0 #Calculating value of resistance\n",
+ "\n",
+ "R1=R/1.082 #Calculating value of resistance\n",
+ "R2=R/0.9241 #Calculating value of resistance\n",
+ "R3=R/2.613 #Calculating value of resistance\n",
+ "R4=R/0.3825 #Calculating value of resistance\n",
+ "Hif=0.02\n",
+ "s=(Hif**2)/(1-Hif**2) \n",
+ "s1=s**0.125 \n",
+ "f=fh/1.6815 * s1 #Calculating value of frequency\n",
+ "fkhz=f/1000.0 #Calculating value of frequency\n",
+ "\n",
+ "#Results:\n",
+ "print('R= %.3f kohm'%Rkohm)\n",
+ "print('\\nR1= %.3f kohm'% (R1/1000))\n",
+ "print('\\nR2= %.3f kohm'% (R2/1000))\n",
+ "print('\\nR3= %.3f kohm'% (R3/1000))\n",
+ "print('\\nR4= %.3f kohm'% (R4/1000))\n",
+ "print('\\nf= %.2f kHz'% fkhz)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 3.183 kohm\n",
+ "\n",
+ "R1= 2.942 kohm\n",
+ "\n",
+ "R2= 3.445 kohm\n",
+ "\n",
+ "R3= 1.218 kohm\n",
+ "\n",
+ "R4= 8.322 kohm\n",
+ "\n",
+ "f= 11.18 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.10, Page No: 286<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''bandpass filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "fh=2500.0 #Frequency in hertz\n",
+ "fL=250.0 #Frequency in hertz\n",
+ "\n",
+ "#Calculations:\n",
+ "B=fh-fL #Calculating bandwidth\n",
+ "fr=math.sqrt(fh*fL) #Calculating frequency\n",
+ "fc=(fL+fh)/2 #Calculating frequency\n",
+ "\n",
+ "#Results:\n",
+ "print('Bandwdth B= %d Hz'%B)\n",
+ "print('\\nResonant Frequency fr= %.2f Hz'%fr)\n",
+ "print('\\nCenter Frequency fr= %d Hz'%fc)\n",
+ "print('\\nHence, resonant frequency is always less than center frequency')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bandwdth B= 2250 Hz\n",
+ "\n",
+ "Resonant Frequency fr= 790.57 Hz\n",
+ "\n",
+ "Center Frequency fr= 1375 Hz\n",
+ "\n",
+ "Hence, resonant frequency is always less than center frequency\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.11, Page No: 286<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''bandpass filter with resonant frequency'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "#Part A\n",
+ "fr=1000.0 #Frequency in hertz\n",
+ "B=3000.0 #Bandwidth in hertz\n",
+ "\n",
+ "#Calculations:\n",
+ "Q=fr/B #Calculation Quality factor \n",
+ "\n",
+ "#Part B\n",
+ "fL= math.sqrt((B*B/4)+fr**2) - B/2 #Calculating lower cut-off frequency\n",
+ "\n",
+ "#Part C\n",
+ "fh=fL+B #Calculating high cut-off frequency \n",
+ "\n",
+ "#Results:\n",
+ "print('Quality factor Q= %.2f '%Q)\n",
+ "print('Since Q<0.5, this is a wideband filter')\n",
+ "print('\\nfL= %.2f Hz'%fL) \n",
+ "print('\\nfh= %.2f Hz'%fh)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quality factor Q= 0.33 \n",
+ "Since Q<0.5, this is a wideband filter\n",
+ "\n",
+ "fL= 302.78 Hz\n",
+ "\n",
+ "fh= 3302.78 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No: 6.12, Page No: 288<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''narrowband bandpass filter'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "import math\n",
+ "# Part A\n",
+ "#For a bandpass filter\n",
+ "R=20000.0 #Resistance in ohm\n",
+ "Rr=2700.0 #Resistance in ohm\n",
+ "C=0.01*10**-6 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "fr=0.1125*(math.sqrt(1+R/Rr))/(R*C) #Calculating resonant frequency\n",
+ "\n",
+ "#Part B\n",
+ "B=0.1591/(R*C) #Calculating Bandwidth\n",
+ "\n",
+ "#Results:\n",
+ "print('Resonant frequency= %.1f Hz'%fr)\n",
+ "print('\\nBandwidth= %.1f Hz'%B)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency= 1631.0 Hz\n",
+ "\n",
+ "Bandwidth= 795.5 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example NO. 6.13, Page No: 289<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''narrowband bandpass filter with resonant frequency'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "fr=200.0 #Resonant frequency in hertz\n",
+ "B=20.0 #Bandwidth in hertz\n",
+ "C=0.33*10**-6 #Capacitance in farad\n",
+ "\n",
+ "#Calculations:\n",
+ "Q=fr/B #Calculating quality factor\n",
+ " \n",
+ "R=0.1591/(B*C) #Calculating resistance value\n",
+ "Rr=R/(2.0*Q*Q-1) #Calculating resistance value\n",
+ "R=R/1000.0 #Calculating resistance value\n",
+ "\n",
+ "#Results:\n",
+ "print('\\nR= %.1f kohm'%R)\n",
+ "print('\\nRr= %.1f ohm'% Rr)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R= 24.1 kohm\n",
+ "\n",
+ "Rr= 121.1 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example No. 6.14, Page NO: 307<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' clock frequency'''\n",
+ "\n",
+ "#Variable Declaration:\n",
+ "R=1.0*10**6 #Resistance in ohm\n",
+ "C=40.0*10**-12 #Capacitance value\n",
+ "\n",
+ "#Calculations:\n",
+ "fck=1/(R*C) #Calculating clock frequency\n",
+ "fck=fck/1000 #Calculating clock frequency\n",
+ "\n",
+ "#Result:\n",
+ "print('Fck= %.1f kHz'%fck)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fck= 25.0 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_7.ipynb b/Linear_Integrated_Circuits/Chapter_7.ipynb
new file mode 100644
index 00000000..143b1a36
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_7.ipynb
@@ -0,0 +1,459 @@
+{
+ "metadata": {
+ "name": "ch_7"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 7: Waveform Generators<h>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.7.1 , Page NO: 324<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''RC Phase shift oscillator'''",
+ "",
+ "#Variable Declarartion:",
+ "import math",
+ "f=300.0 #frequency in hertz",
+ "C=0.1*10**-6 #capacitance in farad",
+ "",
+ "#Calculations:",
+ "t=f*C ",
+ "R=1/(2*math.pi*t*math.sqrt(6)) #Calculating resistance value",
+ "R=R/1000 #Calculating resistance value",
+ "R1=22000.0 #Calculating resistance value",
+ "Rf=29.0*R1 #Calculating resistance value",
+ "Rf=Rf/1000.0 #Calculating resistance value",
+ "",
+ "#Results:",
+ "print('R= %.2f kohm'%R)",
+ "print('\\nLet R=2.2 kohm, hence R1=22 kohm')",
+ "print('\\nRf= %d kohm'%Rf)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 2.17 kohm",
+ "",
+ "Let R=2.2 kohm, hence R1=22 kohm",
+ "",
+ "Rf= 638 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 7.2, Page No: 326<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Wien bridge oscillator'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "f=2000.0 #Frequency in hertz",
+ "C=0.05*10**-6 #Capacitance in farad",
+ "",
+ "#Calculations:",
+ "t=f*C",
+ "R=1/(2*math.pi*t) #Calculating resistance value",
+ "R=R/1000.0 #Calculating resistance value",
+ "R1=1800.0 #Calculating resistance value",
+ "Rf=2.0*R1 #Calculating resistance value",
+ "Rf=Rf/1000.0 #Calculating resistance value",
+ "",
+ "#Results:",
+ "print('R= %.3f kohm'%R)",
+ "print('\\nLet R=1.8 kohm')",
+ "print('\\nRf= %3f kohm'%Rf)",
+ "print('\\nStandard value Rf= 3.3 kohm')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 1.592 kohm",
+ "",
+ "Let R=1.8 kohm",
+ "",
+ "Rf= 3.600000 kohm",
+ "",
+ "Standard value Rf= 3.3 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.7.3, Page No: 329<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Astable multivibrator'''",
+ "",
+ "#Variable Declaration:",
+ "R1=116.0*10**3 #Resistance in ohm",
+ "R2=100.0*10**3 #Resistance in ohm",
+ "Vsat=14.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "# Part A",
+ "f=1000.0 #Frequency in hertz ",
+ "",
+ "T=1/f ",
+ "# As log value is approx 1",
+ "RC=T/2 #Calculating time constant",
+ "RC1=RC*1000.0 #Calculating time constant",
+ "",
+ "# Part B",
+ "C=0.01*10**-6 #Capacitance in farad",
+ "R=RC/C #Calculating resistance",
+ "Rn=R/1000.0 #Calculating resistance",
+ "",
+ "# Part C",
+ "Vmax=2*Vsat*(R2/(R1+R2)) #Calculating maximum value of differential voltage",
+ "",
+ "#Results:",
+ "print('RC= %.1f *10^-3 sec'%RC1)",
+ "print('\\nR= %d kohm'%Rn)",
+ "print('\\nMaximum value of differential input voltage= %.2f V'%Vmax)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RC= 0.5 *10^-3 sec",
+ "",
+ "R= 50 kohm",
+ "",
+ "Maximum value of differential input voltage= 12.96 V"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Exa ple NO. 7.4,Page NO: 330<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Square wave oscillator'''",
+ "",
+ "#Variable Declaration:",
+ "fo=1000.0 #Frequency in hertz",
+ "Vcc=12.0 #Voltage Vcc in volt",
+ "R1=10.0*10**3 #Resistance in ohm",
+ "R2=10.0*10**3 #Resistance in ohm",
+ "C=0.1*10**-6 #Capacitance value in farad",
+ "",
+ "#Calculations:",
+ "R=1/(2.2*C*fo) #Calulating resistance value",
+ "R=R/1000.0 #Calculating resistance value",
+ "",
+ "#Results:",
+ "print('R= %.3f kohm'%R)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 4.545 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 7.5, Page No: 334<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Triangular wave generator'''",
+ "",
+ "#Variable Declaration:",
+ "R1=100.0*10**3 #Resistance in ohm",
+ "R3=20.0*10**3 #Resistance in ohm",
+ "C1=0.01*10**-6 #Capacitance in farad",
+ "Vsat=14.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "# Part A",
+ "T=4*R1*R2*C1/R3 #Calculating time period",
+ "Tn=T*1000 #Calculating time period",
+ "",
+ "# Part B",
+ "f=1/T #Calculating frequency",
+ "",
+ "# Part C",
+ "",
+ "# Part D",
+ "Vp=R2*Vsat/R3 #Calculating peak value of the triangular wave",
+ "",
+ "#Results:",
+ "print('Time period T= %d ms'%Tn)",
+ "print('\\nfrequency f= %d Hz'%f)",
+ "print('\\nPeak value is +14V and -14V')",
+ "print('\\nTriangular wave oscillates between %d V and - %d V'%(Vp,Vp))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time period T= 2 ms",
+ "",
+ "frequency f= 500 Hz",
+ "",
+ "Peak value is +14V and -14V",
+ "",
+ "Triangular wave oscillates between 7 V and - 7 V"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example NO. 7.6, Page No: 336<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Sawtooth wave generator'''",
+ "",
+ "#Variable Declaration:",
+ "Ri=10.0*10**3 #Resitance in ohm",
+ "Vp=10.0 #Voltage in volt",
+ "Vref=10.0 #Voltage in volt",
+ "fo=200.0 #Frequency in hertz",
+ "C1=0.1*10**-6 #Capacitance in farad",
+ "Vi=2.0 #Voltage in volt",
+ "",
+ "#Calculations:",
+ "t=Vi/Vref ",
+ "f=t/(Ri*C1) #Calculating frequency",
+ "",
+ "#Result:",
+ "print('Frequency f= %d Hz'%f)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency f= 200 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 7.7, Page no: 345<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Monostable multivibrator'''",
+ "# Answer in textbook is wrong",
+ "#Varible Declaration:",
+ "C=0.1*10**-6 #Capacitance in farad",
+ "t=1*10**-3 #time in second",
+ "",
+ "#Calculations:",
+ "R=t/(1.22*C) #Calculating resistance value",
+ "R=R/1000 #Calculating resistance value",
+ "",
+ "#Result:",
+ "print('R= %.1f kohm'% R)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 8.2 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 7.8, Page No: 351<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Frequency of oscillation'''",
+ "",
+ "#Variable Declaration:",
+ "D=20.0 # 20 percent #Duty cycle",
+ "Ton=1.0*10**-3 #On time period in seconds ",
+ "",
+ "#Calculatins:",
+ "Tonpoff=100.0*Ton/D #Calculating total time period ",
+ "Tonpoff1=Tonpoff*1000.0 #Calculating total time period",
+ "f=1/Tonpoff #Calculating frequency of oscillation",
+ "",
+ "#Results:",
+ "print('Ton + Toff= %d ms'%Tonpoff1)",
+ "print('\\nFrequency of oscillation= %d Hz'%f)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ton + Toff= 5 ms",
+ "",
+ "Frequency of oscillation= 200 Hz"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 7.9, Page No: 351<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Astable multivibrator'''",
+ "",
+ "#Variable Declaration:",
+ "D=0.7 #Duty cycle ",
+ "f=1000.0 #Frequency in hertz",
+ "",
+ "RB=10.0**4/(6.43/3.0) #Resistance value in ohm",
+ "",
+ "#Calculations:",
+ "RA=4.0*RB/2.75 #Calculating resistance value",
+ "RB1=RB/1000.0 #Calculating resistance value",
+ "RA1=RA/1000.0 #Calculating resistance value",
+ "",
+ "#Results:",
+ "print('RB= %.1f kohm'%RB1)",
+ "print('\\nRA= %.1f kohm'%RA1)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RB= 4.7 kohm",
+ "",
+ "RA= 6.8 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.10, Page No: 352<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Teletypewrite'''",
+ "",
+ "#Variable Declaration:",
+ "f1=1070.0 #Frequency in hertz",
+ "RA=50000.0 #Resistance in ohm",
+ "C=0.01*10**-6 #Capacitance value in farad",
+ "Rc=76.0#Standard Value #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "t=1.45/(f1*C) ",
+ "RB=(t-RA)/2 #Calculating value of resistance ",
+ "RB=RB/1000 #Calculating value of resistance",
+ "",
+ "#Results:",
+ "print('Assuming RA= 50 kohm and C= 0.01 uF')",
+ "print('\\nHence, RB= %.2f kohm'%RB)",
+ "print('\\nRc= %d ohm (Standard Value)'%Rc)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Assuming RA= 50 kohm and C= 0.01 uF",
+ "",
+ "Hence, RB= 42.76 kohm",
+ "",
+ "Rc= 76 ohm (Standard Value)"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_8.ipynb b/Linear_Integrated_Circuits/Chapter_8.ipynb
new file mode 100644
index 00000000..09138a1f
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_8.ipynb
@@ -0,0 +1,470 @@
+{
+ "metadata": {
+ "name": "ch_8"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 8: Voltage Regulators<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 8.1 Page No:362 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Linear Voltage Regulator'''",
+ "",
+ "#Variable Declaration:",
+ "Vo=15.0 #Output voltage in volt",
+ "Vr=2.0 #Ripple voltage in volt",
+ "",
+ "#Calculations:",
+ "Vimin=Vo+3.0 #Calculating minimum input voltage ",
+ "",
+ "Vi=Vimin + Vr/2.0 #Calculating input voltage",
+ "",
+ "Vz=Vi/2.0 #Calculating zener voltage",
+ "",
+ "Vz=10.0 #Volatge in volt",
+ "Iz=20.0*10**-3 #Current in ampere",
+ "",
+ "R1=(Vi-Vz)/Iz #Calculating resistance value",
+ " ",
+ "I2=50.0*10**-6 #Current ampere",
+ "R2=(Vo-Vz)/I2 #Calculating Resistance value",
+ "R2=R2/1000.0 #Calculating resistance value",
+ "",
+ "R3=Vz/I2 #Calculating resistance value",
+ "R3=R3/1000.0 #Calculating resistance value",
+ "",
+ "Vcemax=Vi+Vr/2 #Calculating volatge",
+ "",
+ "IE=50.0*10**-6 #Current in ampere",
+ "IL=50.0*10**-6 #Current in ampere",
+ "",
+ "P=(Vi-Vo)*IL #Calculating power ",
+ "P1=P*1000000.0 #Calculating power",
+ "",
+ "",
+ "#Results:",
+ "print('As Vz=%.1f, use Zener diode 1N758 for 10V'%Vz)",
+ "print('\\nR1= %d ohm'%R1)",
+ "print('\\nR2= %.1f kohm'%R2)",
+ "print('\\nR3= %d kohm'%R3)",
+ "print('\\nSelect C1= 50uF')",
+ "print('\\nP= %.1f mW'%P1)",
+ "print('\\nUse the transstor 2N718 for Q1')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "As Vz=10.0, use Zener diode 1N758 for 10V",
+ "",
+ "R1= 450 ohm",
+ "",
+ "R2= 100.0 kohm",
+ "",
+ "R3= 200 kohm",
+ "",
+ "Select C1= 50uF",
+ "",
+ "P= 200.0 mW",
+ "",
+ "Use the transstor 2N718 for Q1"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 8.2, Page No: 366<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''7805 Voltage Regulator'''",
+ "",
+ "#Variable Declaration:",
+ "IL=0.25 #Current in ampere",
+ "Vr=5.0 #Ripple voltage in volt",
+ "",
+ "#Calculations:",
+ "R=Vr/IL #Calculating value of resistance ",
+ "RL=10.0 #Calculating value of resistance",
+ "VL=IL*RL #Calculating voltage",
+ "",
+ "Vo=Vr+VL #Calculating output voltage",
+ "Vdrop=2.0 #Voltage drop in volt",
+ "Vi=Vo+Vdrop #Calculating voltage",
+ "",
+ "#Results:",
+ "print('R= %d ohm'%R)",
+ "print('\\nVo= %.1f V'%Vo)",
+ "print('\\nVo= %.1f V'%Vi)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R= 20 ohm",
+ "",
+ "Vo= 7.5 V",
+ "",
+ "Vo= 9.5 V"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 8.3, Page No: 368<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''7805 Regulator Circuit'''",
+ "",
+ "#Variable Declaration:",
+ "VL=5.0 #Voltage in volt",
+ "RL=100.0 #Resistance in ohm",
+ "",
+ "#Calculations:",
+ "IL=VL/RL #Calculating current ",
+ "IL1=IL*1000.0 #Calculating current",
+ "#Part A",
+ "R1=7.0 #Resistance in ohm ",
+ "VR1=IL*R1 #Calculaing voltage drop across R1",
+ "VR1x=VR1*1000.0 #Calculatingvoltage drop across R1",
+ "",
+ "#Part B",
+ "VLb=5.0 #Voltage in volt",
+ "RLb=2.0 #Resistance in ohm",
+ "",
+ "ILb=VLb/RLb #Calculating current",
+ "",
+ "R1=7.0 #Resistance in ohm ",
+ "VR1=ILb*R1 #Calculating voltage drop accross R1",
+ "",
+ "Io=0.147 #Current in ampere ",
+ "Ic=ILb-Io #Calculating current",
+ "",
+ "#Results:",
+ "print('Part A')",
+ "print('\\nLoad Current IL= %d mA'% IL1)",
+ "print('\\nVoltage accross R1= %d mV'%VR1x)",
+ "print('\\nAs voltage < 0.7V, Q1 is OFF')",
+ "print('\\nHence IL=Io=Ii=50 mA')",
+ "print('\\n\\nPart B')",
+ "print('\\nLoad Current IL= %.1f A'%ILb)",
+ "print('\\nVoltage accross R1= %.1f V'%VR1)",
+ "print('\\nAs voltage > 0.7V, Q1 is ON')",
+ "print('\\nHence Ic= %.3f A'%Ic)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part A",
+ "",
+ "Load Current IL= 50 mA",
+ "",
+ "Voltage accross R1= 350 mV",
+ "",
+ "As voltage < 0.7V, Q1 is OFF",
+ "",
+ "Hence IL=Io=Ii=50 mA",
+ "",
+ "",
+ "Part B",
+ "",
+ "Load Current IL= 2.5 A",
+ "",
+ "Voltage accross R1= 17.5 V",
+ "",
+ "As voltage > 0.7V, Q1 is ON",
+ "",
+ "Hence Ic= 2.353 A"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 8.4, Page No: 371<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''LM317 Regulator'''",
+ "",
+ "#Variable Declaration:",
+ "R1=240.0 #Resistance in ohm",
+ "R2=2000.0 #Resistance in ohm",
+ "Iadj=50.0*10**-6 #Current in ampere",
+ "Vref=1.25 #Reference voltage in volt ",
+ "",
+ "#Calculation:",
+ "Vo=(Vref*(1+R2/R1))+(Iadj*R2) #Calculating output voltage",
+ "",
+ "#Result:",
+ "print('Vo= %.2f V'%Vo)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo= 11.77 V"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 8.5, Page NO:371<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage regulator using LM317'''",
+ "",
+ "#Variable Declaration:",
+ "Iadjmax=100.0*10**-6 #Current in ampere",
+ "R1=240.0 #Resistance in ohm",
+ "Vref=1.25 #Reference voltage in volt ",
+ " ",
+ "#Calculations:",
+ "#First case: Vo=4",
+ "Vo=4.0 #Voltage in volt",
+ "R2a1=(Vo-Vref)/(Vref/R1 + Iadjmax) #Calculating value of resistance",
+ "R2a=R2a1/1000.0 #Calculating value of resistance",
+ "",
+ "#First case: Vo=12",
+ "Vo=12.0 #Voltage in volt",
+ "R2b1=(Vo-Vref)/(Vref/R1 + Iadjmax) #Calculating value of resistance",
+ "R2b=R2b1/1000.0 #Calculating value of resistance",
+ "",
+ "#Results:",
+ "print('\\nR2= %.2f kohm'%R2a)",
+ "print('\\nR2= %.2f kohm'%R2b)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "R2= 0.52 kohm",
+ "",
+ "R2= 2.03 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.8.6, Page No: 377<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Current Limiting Circuit'''",
+ "",
+ "#Variable Declaration:",
+ "ILmax=0.5 #Current in ampere",
+ "",
+ "#Calculations:",
+ "#Part 1",
+ "Rsc=0.7/ILmax #Calculting value of resistance",
+ "",
+ "#Part 2",
+ "RL=100.0 #Resistance in ohm",
+ "Vo=20.0 #Voltage in volt",
+ "",
+ "IL1=Vo/RL #Calculating current",
+ "",
+ "#Part 3",
+ "RLn=10.0 #Resistance in ohm",
+ "",
+ "IL2=Vo/RLn #Calculating current",
+ "Von=RLn*ILmax #Calculating voltage",
+ "",
+ "#Results:",
+ "print('Rsc= %.1f ohm'%Rsc)",
+ "print('\\nIL= %.1f A'%IL1)",
+ "print('\\nIL= %.1f A'%IL2)",
+ "print('\\nSince IL > ILmax of 0.5A, current limiting will happen')",
+ "print('\\nVo= %.1f V'%Von)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rsc= 1.4 ohm",
+ "",
+ "IL= 0.2 A",
+ "",
+ "IL= 2.0 A",
+ "",
+ "Since IL > ILmax of 0.5A, current limiting will happen",
+ "",
+ "Vo= 5.0 V"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 8.7, Page No: 378<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' LM723 Regulator'''",
+ "",
+ "#Variable Declaration:",
+ "R2=10000.0 #Resistance in ohm ",
+ "Vo=12.0 #Output voltage in volt",
+ "Vref=7.15 #Reference voltage",
+ "",
+ "#Calculations:",
+ "R1=(Vo/Vref)*R2 - R2 #Calculating resistance value",
+ "R1a=R1/1000.0 #Calculating resistance value",
+ "",
+ "#Result:",
+ "print('\\nR1= %.2f kohm'%R1a)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "R1= 6.78 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No.8.8, Page NO: 380<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Continuously adjustable power supply'''",
+ "",
+ "#Variable Declaration:",
+ "Vref=7.15 #Reference voltage in volt",
+ "Vo=5.0 #Output voltage in volt",
+ "",
+ "#Calculations:",
+ "k=Vref/Vo ",
+ "k1=k-1",
+ "",
+ "#For min voltage of 2V",
+ "Vom=2.0 ",
+ "km=Vref/Vom",
+ "km1=km-1.43",
+ "",
+ "R1a=10000.0 #Resistance in ohm",
+ "R1b=2000.0 #Resistance in ohm",
+ " ",
+ "R2=R1a/2.145 #Calculating resistance value",
+ "R2n=R2/1000.0 #Calculating resistance value",
+ "",
+ "R1=6000.0 #Resistance in ohm",
+ "R3=(R1*R2)/(R1+R2) #Calculating resistance value",
+ "R3n=R3/1000.0 #Calculating resistance value",
+ "",
+ "#Results:",
+ "print('(R1b+R2)/R2= %.2f'%k)",
+ "print('\\nR1 = %.2f * R2'%k1)",
+ "print('\\n(R1a+R1b+R2)/R2= %.3f'%km)",
+ "print('\\nR1a = %.3f * R2'%km1)",
+ "print('\\nR2= %.2f kohm'%R2n)",
+ "print('\\nR3= %.2f kohm'%R3n)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(R1b+R2)/R2= 1.43",
+ "",
+ "R1 = 0.43 * R2",
+ "",
+ "(R1a+R1b+R2)/R2= 3.575",
+ "",
+ "R1a = 2.145 * R2",
+ "",
+ "R2= 4.66 kohm",
+ "",
+ "R3= 2.62 kohm"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/Chapter_9.ipynb b/Linear_Integrated_Circuits/Chapter_9.ipynb
new file mode 100644
index 00000000..3dc8e5f6
--- /dev/null
+++ b/Linear_Integrated_Circuits/Chapter_9.ipynb
@@ -0,0 +1,77 @@
+{
+ "metadata": {
+ "name": "ch_9"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 9:Analog Multipliers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example No. 9.1, Page No:411<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''DC Component'''",
+ "",
+ "#Variable Declaration:",
+ "import math",
+ "",
+ "#Calculations:",
+ "#Part 1",
+ "th1=math.acos(0)",
+ "th=th1*180/math.pi #Calculating theta",
+ "#Part 2",
+ "Vodc=4.47*4.47*math.cos(th1)/20 #Calculating output voltage ",
+ "#For theta=+/-30 deg",
+ "Vodc1=math.cos(30*math.pi/180) #Calculating output voltage for theta 30",
+ "#For theta=+/-45 deg",
+ "Vodc2=math.cos(45*math.pi/180) #Calculating output voltage for theta 45",
+ "#For theta=+/-60 deg",
+ "Vodc3=math.cos(60*math.pi/180) #Calculating output voltage for theta 60",
+ "",
+ "#Results:",
+ "print('Theta= + or - %d degree'%th)",
+ "print('\\nVodc for 30 degree= %.3f V'%Vodc1)",
+ "print('\\nVodc for 45 degree= %.3f V'% Vodc2)",
+ "print('\\nVodc for 60 degree= %.1f V'% Vodc3)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theta= + or - 90 degree",
+ "",
+ "Vodc for 30 degree= 0.866 V",
+ "",
+ "Vodc for 45 degree= 0.707 V",
+ "",
+ "Vodc for 60 degree= 0.5 V"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "outputs": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/README.txt b/Linear_Integrated_Circuits/README.txt
new file mode 100644
index 00000000..f34d66f4
--- /dev/null
+++ b/Linear_Integrated_Circuits/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Sagar Shinde
+Course: btech
+College/Institute/Organization: Vishwakarma institute of Technology, Pune.
+Department/Designation: ENTC
+Book Title: Linear Integrated Circuits
+Author: S Shalivahanan, V S Kanchana Bhaaskaran
+Publisher: Tata McGraw-Hill Publishing Company Limited, New Dehli
+Year of publication: 2008
+Isbn: 0-07-064818-2
+Edition: 1st \ No newline at end of file
diff --git a/Linear_Integrated_Circuits/screenshots/frequency_response.JPG b/Linear_Integrated_Circuits/screenshots/frequency_response.JPG
new file mode 100644
index 00000000..fcfef356
--- /dev/null
+++ b/Linear_Integrated_Circuits/screenshots/frequency_response.JPG
Binary files differ
diff --git a/Linear_Integrated_Circuits/screenshots/input_output_differentiator.JPG b/Linear_Integrated_Circuits/screenshots/input_output_differentiator.JPG
new file mode 100644
index 00000000..077129ed
--- /dev/null
+++ b/Linear_Integrated_Circuits/screenshots/input_output_differentiator.JPG
Binary files differ
diff --git a/Linear_Integrated_Circuits/screenshots/ip_and_op_integrator.JPG b/Linear_Integrated_Circuits/screenshots/ip_and_op_integrator.JPG
new file mode 100644
index 00000000..f7c036e1
--- /dev/null
+++ b/Linear_Integrated_Circuits/screenshots/ip_and_op_integrator.JPG
Binary files differ
diff --git a/Materials_science_and_engineering_an_introduction/CH10.ipynb b/Materials_science_and_engineering_an_introduction/CH10.ipynb
new file mode 100644
index 00000000..2a7a789c
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH10.ipynb
@@ -0,0 +1,124 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 :Phase Transformation In Metals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.1 Page no 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#(a)Computation of Critical Nuclear Radius\n",
+ "\n",
+ "#Given\n",
+ "Hf=-1.16*10**9 # in J/m**3 latent heat of fusion\n",
+ "Y=0.132 # in J/m**2 Surface energy\n",
+ "Tm=1064.0+273.0 # in K Melting point of gold\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "T=Tm-230.0 # in K 230 is supercooling value\n",
+ "r=-2*Y*Tm/(Hf*(Tm-T))\n",
+ "G=16*math.pi*Y**3*Tm**2/(3*Hf**2*(Tm-T)**2)\n",
+ "\n",
+ "#part (b)\n",
+ "a=0.413*10**-9 # in m Unit Cell edge length\n",
+ "#unit cells per paticle\n",
+ "u_c=4*math.pi*r**3/(3*a**3)\n",
+ "n=4 #In FCC . no of atoms in per unit cell\n",
+ "U_c=int(u_c)*n\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Critical Radius is \",round(r/10**-9,2),\"nm\"\n",
+ "print\"Activation free energy is \",round(G,21),\"J\"\n",
+ "print\"(b)Total no. of atoms per critical nucleus are \",U_c\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Critical Radius is 1.32 nm\n",
+ "Activation free energy is 9.68e-19 J\n",
+ "(b)Total no. of atoms per critical nucleus are 548\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page no 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination the rate of recrystallization\n",
+ "\n",
+ "#Given\n",
+ "n=5.0\n",
+ "y=0.3\n",
+ "t=100.0 #in min\n",
+ "\n",
+ "#Calculation\n",
+ "k=-math.log(1-y)/t**n\n",
+ "thalf=(-math.log(1-0.5)/k)**(1/n)\n",
+ "rate=1/thalf\n",
+ "\n",
+ "#Result\n",
+ "print\"Rate is \",rate,\"min**-1\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate is 0.00875567087531 min**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH12.ipynb b/Materials_science_and_engineering_an_introduction/CH12.ipynb
new file mode 100644
index 00000000..ee793447
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH12.ipynb
@@ -0,0 +1,202 @@
+{
+ "metadata": {
+ "name": "CH12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: Structure and Properties of Ceramics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.1 Page no 418"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computation of Minimum Caion-to-Anion Radius Ratio forCo-ordination No. of 3\n",
+ "\n",
+ "#For equilateral triangle after joining centres of the atoms Angle = 30\n",
+ "a=30\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "ratio=(1-math.cos(a*math.pi/180.0))/math.cos(a*math.pi/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Cation to anion raio is \",round(ratio,3)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cation to anion raio is 0.155\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page no 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ceramic Crystal structure prediction\n",
+ "\n",
+ "#Given\n",
+ "r_Fe=0.077 # in nm Radius of iron cation Fe++\n",
+ "r_O=0.140 #in nm Radius of Oxygen anion O--\n",
+ "\n",
+ "#Calculation\n",
+ "ratio=r_Fe/r_O\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio is \",ratio\n",
+ "if 0.414<ratio<0.732: \n",
+ " print\"Co-ordinaton no. is 6\"\n",
+ " print\"Structure is Rock Salt type\"\n",
+ "else:\n",
+ " print \"Coordination no is not 6\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio is 0.55\n",
+ "Co-ordinaton no. is 6\n",
+ "Structure is Rock Salt type\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page no 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Theoretical Density Determination for NaCl\n",
+ "\n",
+ "#Given\n",
+ "A_Na=22.99 # in g/mol\n",
+ "A_Cl=35.45 #in g/mol\n",
+ "r_Na=0.102*10**-7 #in cm Radius of Na+ ion\n",
+ "r_Cl=0.181*10**-7 #in cm Radius of Cl- ion\n",
+ "Na=6.023*10**23 #Avogadro number\n",
+ "\n",
+ "#Calculation\n",
+ "a=2*(r_Na+r_Cl)\n",
+ "V=a**3\n",
+ "n=4 #For FCC, no. of atoms are 4 per crystal\n",
+ "density=n*(A_Na+A_Cl)/(V*Na)\n",
+ "\n",
+ "#Result\n",
+ "print\"Density is \",round(density,2),\"gm/cm**3\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density is 2.14 gm/cm**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page no 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computation of the No. of Schottky Defects in KCl\n",
+ "\n",
+ "#Given\n",
+ "Na=6.023*10**23 #Avogadro number\n",
+ "density=1.955 #in g/cm**3\n",
+ "A_K=39.1 #in g/mol\n",
+ "A_Cl=35.45 #in g/mol\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "N=Na*density*10**6/(A_K+A_Cl)\n",
+ "Qs=2.6 # in eV\n",
+ "k=8.62*10**-5 # in eV/K Boltzmann Constant\n",
+ "T=500.0+273.0 # in K\n",
+ "Ns=N*math.exp(-Qs/(2*k*T))\n",
+ "\n",
+ "#result\n",
+ "print\"No. of Schottky Defects are \",round(Ns,-17),\"/m**3\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. of Schottky Defects are 5.31e+19 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH14.ipynb b/Materials_science_and_engineering_an_introduction/CH14.ipynb
new file mode 100644
index 00000000..7ade4dbe
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH14.ipynb
@@ -0,0 +1,228 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14: Polymer Structure"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.1 Page No 499"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computation of average Molecular wt and Degree of Polymerisation\n",
+ "\n",
+ "#Given\n",
+ "#For different molecular wt range ,\n",
+ "#From Table 14.1 (a)\n",
+ "Mi1=7500 #g/mol , Molecular wt\n",
+ "Mi2=12500 \n",
+ "Mi3=17500\n",
+ "Mi4=22500\n",
+ "Mi5=27500\n",
+ "Mi6=32500\n",
+ "Mi7=37500\n",
+ "xi1=0.05 #Number fraction\n",
+ "xi2=0.16\n",
+ "xi3=0.22\n",
+ "xi4=0.27\n",
+ "xi5=0.2\n",
+ "xi6=0.08\n",
+ "xi7=0.02\n",
+ "\n",
+ "#Calculation\n",
+ "xM1=Mi1*xi1\n",
+ "xM2=Mi2*xi2\n",
+ "xM3=Mi3*xi3\n",
+ "xM4=Mi4*xi4\n",
+ "xM5=Mi5*xi5\n",
+ "xM6=Mi6*xi6\n",
+ "xM7=Mi7*xi7\n",
+ "xM=xM1+xM2+xM3+xM4+xM5+xM6+xM7\n",
+ "\n",
+ "#(b)\n",
+ "nC=2 #no of carbon atoms in repeat unit\n",
+ "nH=3 #no of hydrogen atoms in repeat unit\n",
+ "nCl=1 #no of chlorine atoms in repeat unit\n",
+ "MwC=12.01 #Molecular wt of carbon\n",
+ "MwH=1.01 #Molecular wt of Hydogen\n",
+ "MwCl=35.45 #Molecular wt of chlorine\n",
+ "m=nC*MwC+nH*MwH+nCl*MwCl #Total wt for PVC\n",
+ "DP=xM/m\n",
+ "\n",
+ "#(c) from fig 14.3 (b)\n",
+ "wi1=0.02 #weight fraction\n",
+ "wi2=0.1\n",
+ "wi3=0.18\n",
+ "wi4=0.29\n",
+ "wi5=0.26\n",
+ "wi6=0.13\n",
+ "wi7=0.02\n",
+ "\n",
+ "#Calculation\n",
+ "wM1=Mi1*wi1\n",
+ "wM2=Mi2*wi2\n",
+ "wM3=Mi3*wi3\n",
+ "wM4=Mi4*wi4\n",
+ "wM5=Mi5*wi5\n",
+ "wM6=Mi6*wi6\n",
+ "wM7=Mi7*wi7\n",
+ "wM=wM1+wM2+wM3+wM4+wM5+wM6+wM7\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The no Av Molecular wt is\",xM,\"g/mol\"\n",
+ "print\"(b)Degree of Polymerisation is\",round(DP,0)\n",
+ "print\"(c)The weight Av Molecular wt is\",wM,\"g/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The no Av Molecular wt is 21150.0 g/mol\n",
+ "(b)Degree of Polymerisation is 338.0\n",
+ "(c)The weight Av Molecular wt is 23200.0 g/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.2 Page No 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computations of the Density\n",
+ "\n",
+ "#Given\n",
+ "Ac=12.01 #in g/mol Molecular weight of Carbon\n",
+ "Ah=1.008 #in g/mol molecular weight of hydrogen\n",
+ "a=7.41*10**-8 #in cm\n",
+ "b=4.94*10**-8 #in cm\n",
+ "c=2.55*10**-8 #in cm\n",
+ "Na=6.023*10**23\n",
+ "\n",
+ "#calculation\n",
+ "Vc=a*b*c\n",
+ "n=2\n",
+ "A=(2*Ac)+(4*Ah)\n",
+ "density_c=n*A/(Vc*Na)\n",
+ "\n",
+ "#(b)Percent Crystallinity of Polyethylene\n",
+ "density_a=0.870 # in g/cm**3\n",
+ "density_s=0.925 # in g/cm**3\n",
+ "pc=density_c*(density_s-density_a)*100/(density_s*(density_c-density_a))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Density is\",round(density_c,3),\"g/cm**3\"\n",
+ "print\"(b)percentage crystallinity is\",round(pc,1),\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Density is 0.998 g/cm**3\n",
+ "(b)percentage crystallinity is 46.4 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.3 Page No 516"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computations of Diffusion Flux of Carbon dioxide through Plasic Beverage Container\n",
+ "\n",
+ "#function[A]= approx(V,n)\n",
+ "# A= round(V*10**n)/10**n\n",
+ "# funcprot(0)\n",
+ "#endfunction\n",
+ "\n",
+ "#print\"\\tExample 14.3\\n\")\n",
+ "\n",
+ "#a\n",
+ "P1=400000.0 # in Pa Pressure inside the bottle\n",
+ "P2=400.0 # in Pa Pressure outside the bottle\n",
+ "Pm=0.23*10**-13 #Solubility Coefficient\n",
+ "dx=0.05 # in cm Thickness of wall\n",
+ "\n",
+ "#calculation\n",
+ "J=(-Pm*(P2-P1)/dx)\n",
+ "#(b)Beverage Shell Life\n",
+ "\n",
+ "A=500 #surface area of bottle in cm**2\n",
+ "V_lose=750.0 #cm**3 STP\n",
+ "V=J*A\n",
+ "t=V_lose/round(V,5)\n",
+ "\n",
+ "#Result\n",
+ "print\"Diffusion flux is \",round(J,9),\"cm**3 STP/cm**2-s\"\n",
+ "print\"Time to escape is \",round(t/(3600*24),1),\"days\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion flux is 1.84e-07 cm**3 STP/cm**2-s\n",
+ "Time to escape is 96.5 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH16.ipynb b/Materials_science_and_engineering_an_introduction/CH16.ipynb
new file mode 100644
index 00000000..c360c16f
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH16.ipynb
@@ -0,0 +1,174 @@
+{
+ "metadata": {
+ "name": "CH16"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16: Composites"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.1 Page No 589"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#(a) Compute the modulus of elasticity\n",
+ "#(b) find Load carried by each of fiber and matrix phase\n",
+ "#(c) Determine the strain\n",
+ "\n",
+ "#Given\n",
+ "E_gf=69.0 # in GPa Elasticity of glass fibre\n",
+ "mf_gf=0.4 #Vol % of glass fibre\n",
+ "E_pr=3.4 # in GPa Elasticity of poyester resin\n",
+ "mf_pr=0.6 #Vol % of polyester resin\n",
+ "\n",
+ "#Calculation\n",
+ "E_cl=(E_pr*mf_pr)+(E_gf*mf_gf)\n",
+ "Ac=250.0 #mm**2\n",
+ "sigma=50.0 #MPa\n",
+ "ratio=(E_gf*mf_gf)/(E_pr*mf_pr) # ratio=Ff/Fm\n",
+ "Fc=Ac*sigma #N\n",
+ "Fm=Fc/(ratio+1)\n",
+ "Ff=Fc-Fm\n",
+ "Am=mf_pr*Ac\n",
+ "Af=mf_gf*Ac\n",
+ "sigma_m=Fm/Am\n",
+ "sigma_f=Ff/Af\n",
+ "e_m=sigma_m/(E_pr*10**3) #Strain for matrix phase\n",
+ "e_f=sigma_f/(E_gf*10**3) #Strain for fiber phase\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Modulus of elasticity of composite is \",round(E_cl,0),\"GPa\"\n",
+ "print\"(b)Load carried by each of fiber and matrix phase is \",round(Ff,0),\"N\"\n",
+ "print\"(c)Strain for matrix phase is \",round(e_m,4)\n",
+ "print\" Strain for fiber phase is \",round(e_f,4)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Modulus of elasticity of composite is 30.0 GPa\n",
+ "(b)Load carried by each of fiber and matrix phase is 11640.0 N\n",
+ "(c)Strain for matrix phase is 0.0017\n",
+ " Strain for fiber phase is 0.0017\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 16.2 Page No 591"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Elastic Modulus Determination for a Glass Fiber-Reinforced Composite\u2014Transverse Direction\n",
+ "\n",
+ "#Given\n",
+ "E_gf=69 # in GPa Elasticity of glass fibre\n",
+ "mf_gf=0.4 #Vol % of glass fibre\n",
+ "E_pr=3.4 # in GPa Elasticity of poyester resin\n",
+ "mf_pr=0.6 #Vol % of polyester resin\n",
+ "\n",
+ "#Calculation\n",
+ "E_ct=E_pr*E_gf/((E_pr*mf_gf)+(E_gf*mf_pr)) #GPa\n",
+ "\n",
+ "#Result\n",
+ "print\"In transverse direction, modulus of elaticity is \",round(E_ct,1),\"GPa\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In transverse direction, modulus of elaticity is 5.5 GPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 16.1 ,Page No :601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#A tubular composite shaft is to be designed.\n",
+ "\n",
+ "#Given\n",
+ "Do=70*10**-3 #mm, outside diameter\n",
+ "Di=50*10**-3 #mm, inside diameter\n",
+ "L=1 #m Length\n",
+ "F=1000 #N load\n",
+ "dy=0.35*10**-3 #mm, deflection\n",
+ "\n",
+ "#Calculation\n",
+ "#Required longitudinal modulus of elasticity\n",
+ "E=(4*F*L**3)/(3*math.pi*dy*(Do**4-Di**4))\n",
+ "Vc=(math.pi*L*(Do**2-Di**2))/4.0\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)longitudinal modulus of elasticity is\",round(E/10**9,1),\"GPa\"\n",
+ "print\"(b)The total tube volume is\",round(Vc*10**6,0),\"cm**3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)longitudinal modulus of elasticity is 68.3 GPa\n",
+ "(b)The total tube volume is 1885.0 cm**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH17.ipynb b/Materials_science_and_engineering_an_introduction/CH17.ipynb
new file mode 100644
index 00000000..294f5ff9
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH17.ipynb
@@ -0,0 +1,132 @@
+{
+ "metadata": {
+ "name": "CH17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17: Corrosion and Degradiation of Materials"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.1 Page No 629"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of Electrochemical Cell Characteristics\n",
+ "\n",
+ "#Given\n",
+ "V_Cd=-0.403 #Half Cell Potential of Cd++|Cd\n",
+ "V_Ni=-0.250 #Half Cell Potential of Ni++|Ni\n",
+ "\n",
+ "#calculation\n",
+ "dV=V_Ni-V_Cd\n",
+ "C_Ni=10**-3\n",
+ "C_Cd=0.5\n",
+ "n=2 #Net electron exchange in Redox reaction\n",
+ "V=-dV-(0.0592*math.log10(C_Ni/C_Cd)/n)\n",
+ "\n",
+ "#Result\n",
+ "print\"Standard Cell potential is \",dV,\"V\"\n",
+ "print\"Net EMF is \",round(V,3),\"V\"\n",
+ "if V<0:\n",
+ " print\"Ni is reduced & Cd is oxidised\"\n",
+ "else:\n",
+ " print\"Cd is reduced & Ni is oxidised\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard Cell potential is 0.153 V\n",
+ "Net EMF is -0.073 V\n",
+ "Ni is reduced & Cd is oxidised\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.2 Page No 637"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Rate of Oxidation Computation\n",
+ "\n",
+ "#Given\n",
+ "#Activation polarisation data for Zn\n",
+ "VZn_Zn2=-0.763\n",
+ "iZn=10**-7\n",
+ "beta_Zn=0.09\n",
+ "#For H2\n",
+ "iH2=10**-10\n",
+ "VH_H2=0\n",
+ "beta_H2=-0.08\n",
+ "\n",
+ "#calculation\n",
+ "#Part i\n",
+ "ic=10**((VH_H2-VZn_Zn2-(beta_H2*math.log10(iH2))+(beta_Zn*math.log10(iZn)))/(beta_Zn-beta_H2))\n",
+ "n=2 #Exchange of 2 electrons\n",
+ "F=96500 #Faradays constant\n",
+ "r=ic/(n*F)\n",
+ "#Part ii\n",
+ "Vc=VH_H2+(beta_H2*log10(ic/iH2))\n",
+ "\n",
+ "#Result\n",
+ "print\"i) Rate of oxiadation is\",round(r,12),\"mol/cm**2-s\"\n",
+ "print\"ii) Corrosion potential is\",round(Vc,3),\"V\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i) Rate of oxiadation is 6.18e-10 mol/cm**2-s\n",
+ "ii) Corrosion potential is -0.486 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH18.ipynb b/Materials_science_and_engineering_an_introduction/CH18.ipynb
new file mode 100644
index 00000000..016bfd26
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH18.ipynb
@@ -0,0 +1,308 @@
+{
+ "metadata": {
+ "name": "CH18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : Electrical Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.1 Page No 682"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computation of the Room-Temperature Intrinsic Carrier Concentration for Gallium Arsenide\n",
+ "\n",
+ "#Given\n",
+ "sigma=10**-6 # (Ohm-m)**-1 Electrical Conductivity\n",
+ "e=1.6*10**-19 #Coulomb Charge on electron\n",
+ "m_e=0.85 # m**2/V-s Mobility of electron\n",
+ "m_h=0.04 # m**2/V-s Mobility of holes\n",
+ "\n",
+ "#Calculation\n",
+ "#ni is Intrinsic carrier concentration\n",
+ "ni=sigma/(e*(m_e+m_h))\n",
+ "\n",
+ "print\"Intrinsic Carrier Concentration is\",round(ni,-11),\"m**-3\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Intrinsic Carrier Concentration is 7e+12 m**-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.2 Page No 689"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Electrical Conductivity Determination for Intrinsic Silicon at 150\u00b0C\n",
+ "\n",
+ "#Given\n",
+ "e=1.6*10**-19 #Coulomb Charge on electron\n",
+ "ni=4*10**19 #For Si at 423 K (m**-3)\n",
+ "#Values of m_e and m_h are deduced from graphs at page No.689\n",
+ "m_e=0.06 #m**2/V-s Mobility of electron\n",
+ "m_h=0.022 #m**2/V-s Mobility of holes\n",
+ "\n",
+ "#calculation\n",
+ "#sigma is electrical conductivity\n",
+ "sigma=ni*e*(m_e+m_h)\n",
+ "\n",
+ "#result\n",
+ "print\"Electrical Conductivity is \",round(sigma,2),\"(ohm-m)**-1\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electrical Conductivity is 0.52 (ohm-m)**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.3 Page No 690"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Room-Temperature for Extrinsic Silicon\n",
+ "\n",
+ "#Given (b)\n",
+ "n=10**23 #m**-3 Carrier Concentration\n",
+ "e=1.6*10**-19 #Coulomb Charge on electron\n",
+ "#From graph 18.18 m_e is calculated corresponding to n=10**23\n",
+ "m_e=0.07 #m**2/V-s Mobility of electron\n",
+ "\n",
+ "#Calculation\n",
+ "#For extrinsic n-type, the formula used is:\n",
+ "sigma=n*e*m_e\n",
+ "\n",
+ "\n",
+ "#(c)Elevated-Temperature Electrical Conductivity Calculations for Extrinsic Silicon\n",
+ "#From graph 18.19a m_e2 is calculated corresponding to 373 K\n",
+ "m_e2=0.04 #m**2/V-s Mobility of electron\n",
+ "sigma2=n*e*m_e2\n",
+ "\n",
+ "#Result\n",
+ "print\"Conductivity at n=10**23 is \",sigma,\"(Ohm-m)**-1\"\n",
+ "print\"Conductivity at T=373 K becomes \",sigma2,\"(Ohm-m)**-1\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conductivity at n=10**23 is 1120.0 (Ohm-m)**-1\n",
+ "Conductivity at T=373 K becomes 640.0 (Ohm-m)**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 18.1, Page No: 691"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Specify an impurity acceptor type\n",
+ "\n",
+ "#Given\n",
+ "c=50 #ohm**-1, room temprature conductivity\n",
+ "Na1=10**22 #m**-3, assumed impurity content value\n",
+ "mu1=0.04 #m**2/Vs, assumed electrical mobility\n",
+ "e=1.6*10**-19 #Electronic charge\n",
+ "NA=6.023*10**23 #Avagadro no\n",
+ "\n",
+ "#Calculation\n",
+ "C=Na1*e*mu1 #Conductivity\n",
+ "#Decreasing an impurity content\n",
+ "Na2=10**21 #m**-3, \n",
+ "mu2=0.045 #m**2/Vs,\n",
+ "C=Na2*e*mu2\n",
+ "#So we get conductivity = 50 at\n",
+ "Na=8*10**21 \n",
+ "#For Silicon\n",
+ "rho=2.33 # g/cm**3\n",
+ "Asi=28.09 # g/mole\n",
+ "Nsi=(NA*rho*10**6)/(Asi)\n",
+ "Ca=(Na/(Na+Nsi))*100\n",
+ "\n",
+ "#Result\n",
+ "print\"The concentration of acceptor impurities is\",round(Ca,7)\n",
+ "print\"Thus a Silicon material having conductivity 50 ohm**-1 \\nmust contain\",round(Ca,7),\"% boron,aluminium,Gallium or indium .\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The concentration of acceptor impurities is 1.6e-05\n",
+ "Thus a Silicon material having conductivity 50 ohm**-1 \n",
+ "must contain 1.6e-05 % boron,aluminium,Gallium or indium \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.4 Page No 693"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Hall Voltage Computation\n",
+ "\n",
+ "#Given\n",
+ "sigma=3.8*10**7 #(Ohm-m)**-1 Electrical Conductivity\n",
+ "m_e=0.0012 #m**2/V-s Mobility of electron\n",
+ "Rh=-m_e/sigma #Hall coefficient\n",
+ "Ix=25 #Ampere(A) Current\n",
+ "d=15*10**-3 #m Thickness\n",
+ "Bz=0.6 #Tesla Magnetic field\n",
+ "\n",
+ "#Calculation\n",
+ "Vh=Rh*Ix*Bz/d\n",
+ "\n",
+ "#Result\n",
+ "print\"Hall coefficient is \",round(Rh,13),\"V-m/A-Tesla\"\n",
+ "print\"Hall Voltage is \",round(Vh,10),\"V\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hall coefficient is -3.16e-11 V-m/A-Tesla\n",
+ "Hall Voltage is -3.16e-08 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.5 Page No 707"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the Capacitance \n",
+ "\n",
+ "#Given\n",
+ "A=6.45*10**-4 #m**2, area\n",
+ "d=2*10**-3 #m. Plate separation\n",
+ "V=10 #V Potential\n",
+ "Er=6 #Dielectric constant\n",
+ "Eo=8.85*10**-12 #F/m Constant dielectric constant\n",
+ "#Calculation\n",
+ "E=Er*Eo\n",
+ "C=E*A/d\n",
+ "Q=C*V\n",
+ "D=E*V/d\n",
+ "P=D-Eo*V/d\n",
+ "\n",
+ "#Result\n",
+ "print\"The Capacitance is\",round(C,13),\"F\"\n",
+ "print\"The magnitude of charge stored is \",round(Q,12),\"C\"\n",
+ "print\"The Dielectric displacement is is\",round(D,9),\"C/m**2\"\n",
+ "print\"The Polarization is\",round(P,9),\"C/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Capacitance is 1.71e-11 F\n",
+ "The magnitude of charge stored is 1.71e-10 C\n",
+ "The Dielectric displacement is is 2.65e-07 C/m**2\n",
+ "The Polarization is 2.21e-07 C/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH19.ipynb b/Materials_science_and_engineering_an_introduction/CH19.ipynb
new file mode 100644
index 00000000..8464a899
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH19.ipynb
@@ -0,0 +1,61 @@
+{
+ "metadata": {
+ "name": "CH19"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 19: Thermal Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.1 Page No 733"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of maximum temperature\n",
+ "\n",
+ "#Given\n",
+ "To=20 # Room Temperature (degree celsius)\n",
+ "sigma=-172 #Mpa Compressive stress\n",
+ "E=100*10**3 #Mpa Young's modulus\n",
+ "a=20*10**-6 #Celsius**-1 Coefficient of thermal expansion\n",
+ "\n",
+ "#Calculation\n",
+ "Tf=To-(sigma/(E*a))\n",
+ "\n",
+ "print\"Final Temperature is \",Tf,\"C\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final Temperature is 106.0 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH20.ipynb b/Materials_science_and_engineering_an_introduction/CH20.ipynb
new file mode 100644
index 00000000..c410a6ac
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH20.ipynb
@@ -0,0 +1,157 @@
+{
+ "metadata": {
+ "name": "CH20"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 20 : Magnetic Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 20.1 Page No 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of saturation magnetisation and flux density for Nickel\n",
+ "\n",
+ "#Given\n",
+ "b_m=9.27*10**-24 #ampere*m**2 (Bohr Magneton)\n",
+ "Na=6.023*10**23 #atoms/mol (Avogadro's No.)\n",
+ "d=8.9*10**6 #g/m**3 (density)\n",
+ "uo=4*math.pi*10**-7 #Permitivity of free space\n",
+ "A=58.71 #g/mol (Atomic weigth of Nickel)\n",
+ "N=d*Na/A #No. of atoms per cubic meter\n",
+ "\n",
+ "#Calculation\n",
+ "# M is saturation magnetisation\n",
+ "M=0.6*b_m*N #0.6= Bohr Magneton/atom\n",
+ "#B = Saturation Flux Density\n",
+ "B=uo*M\n",
+ "\n",
+ "#Result\n",
+ "print\"Saturation Magnetisation is \",M,\"A/m\"\n",
+ "print\"Saturation Flux Density is \",round(B,2),\"Tesla\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Magnetisation is 507834.0 A/m\n",
+ "Saturation Flux Density is 0.64 Tesla\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 20.2 Page No 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of saturation magnetisation of Fe3O4\n",
+ "\n",
+ "#Given\n",
+ "a=0.839*10**-9 #a is edge length in m\n",
+ "b_m=9.27*10**-24 #ampere*m**2 (Bohr Magneton)\n",
+ "nb=8*4 #8 is no. of Fe++ ions per unit cell\n",
+ " #4 is Bohr magnetons per Fe++ ion\n",
+ "#Calculation\n",
+ "M=nb*b_m/a**3 #M is Saturation magnetisation\n",
+ "\n",
+ "print\"Saturation Magnetisation is \",round(M,0),\"A/m\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Magnetisation is 502278.0 A/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 20.1 Page No 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design Example 20.1: Designing a cubic mixed-ferrite magnetic material\n",
+ "\n",
+ "#Given\n",
+ "Ms_Fe=5.25*10**5 #Required saturation Magnetisation\n",
+ "b_m=9.27*10**-24 #ampere*m**2 (Bohr Magneton)\n",
+ "a=0.839*10**-9 #a is edge length in m\n",
+ "M=5*10**5 #From previous question result\n",
+ "\n",
+ "#Calculation\n",
+ "nb=Ms_Fe*a**3/b_m\n",
+ "i=8 # No of Divalent ions per unit cell\n",
+ "j=4 #4 is Bohr magnetons per Mn++ ion\n",
+ "n=nb/(i)-j \n",
+ " \n",
+ "#Result\n",
+ "print\"Replacing percent of Fe++ with Mn++ would produce the required saturation magnetisation\",round(n*100,2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Replacing percent of Fe++ with Mn++ would produce the required saturation magnetisation 18.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH21.ipynb b/Materials_science_and_engineering_an_introduction/CH21.ipynb
new file mode 100644
index 00000000..bb8267f6
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH21.ipynb
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "name": "CH21"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 21: Optical Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 21.1 Page No 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of absorption coefficient\n",
+ "\n",
+ "#Given\n",
+ "# x is thickness of glass(mm)\n",
+ "x=200\n",
+ "#It is intensity of non-absorbed radiation\n",
+ "#Io is intensity of non-relected radiation\n",
+ "f=0.98 #f=It/Io\n",
+ "\n",
+ "#Calculation\n",
+ "#b is absorption coefficient\n",
+ "b=-math.log(f)/x\n",
+ "\n",
+ "#result\n",
+ "print\"Absorption coefficient is \",round(b,4),\"mm**-1\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorption coefficient is 0.0001 mm**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH3.ipynb b/Materials_science_and_engineering_an_introduction/CH3.ipynb
new file mode 100644
index 00000000..c521d51b
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH3.ipynb
@@ -0,0 +1,376 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Metallic Crystal Structure"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page No: 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of FCC Unit Cell Volume\n",
+ "\n",
+ "#Given\n",
+ "#For FCC a=2*R*math.sqrt(2)\n",
+ "from sympy import Symbol\n",
+ "\n",
+ "#Calculation \n",
+ "R=Symbol('R') \n",
+ "#Edge Length\n",
+ "a=2*R*round(math.sqrt(2),2)\n",
+ "#Volume determination\n",
+ "V=a**3\n",
+ "\n",
+ "#result\n",
+ "print\"Volume is\",V,\" m**3\"\n",
+ "print\"which is also equal to 16*sqrt(2)*R**3\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume is 22.425768*R**3 m**3\n",
+ "which is also equal to 16*sqrt(2)*R**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page No: 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computation of the Atomic Packing Factor for FCC\n",
+ "\n",
+ "#Given\n",
+ "#for FCC no. of atoms are 4\n",
+ "n=4\n",
+ "#For FCC a=2*R*math.sqrt(2)\n",
+ "R=1 #say\n",
+ "\n",
+ "#Calculation\n",
+ "#Edge Length\n",
+ "a=2*R*math.sqrt(2)\n",
+ "#Volume determination of cube\n",
+ "Vc=a**3\n",
+ "#Volume of sphere\n",
+ "Vs=n*4*math.pi*R**3/3.0\n",
+ "#Atomic packing Fraction\n",
+ "APF=Vs/Vc\n",
+ "\n",
+ "#Result\n",
+ "print\"Atomic packing fraction is\",round(APF,2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Atomic packing fraction is 0.74\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page No: 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Theoretical Density Computation for Copper\n",
+ "\n",
+ "#Given\n",
+ "R=1.28*10**-8 #Atomic radius in cm\n",
+ "A_Cu=63.5 #Atomic wt of copper\n",
+ "n=4 #For FCC\n",
+ "Na=6.023*10**23 #Avogadro no.\n",
+ "\n",
+ "#Calculation\n",
+ "a=2*R*math.sqrt(2)\n",
+ "Vc=a**3\n",
+ "den=n*A_Cu/(Vc*Na)\n",
+ "\n",
+ "#result\n",
+ "print\"Density is \",round(den,2),\"g/cm**3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density is 8.89 g/cm**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page No: 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of Directional Indices\n",
+ "\n",
+ "#Given\n",
+ "#Projection of given vector\n",
+ "a=1/2.0\n",
+ "b=1\n",
+ "c=0\n",
+ "\n",
+ "x=[2*a,2*b,2*c]\n",
+ "\n",
+ "#Result\n",
+ "print\"The intercept for the given plane is\",x\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The intercept for the given plane is [1.0, 2, 0]\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8 Page No: 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of Directional Indices for a Hexagonal Unit Cell\n",
+ "\n",
+ "#Given\n",
+ "#Projection in terms of unit cell parameter\n",
+ "du=1\n",
+ "dv=1\n",
+ "dw=1\n",
+ "\n",
+ "#Calculation\n",
+ "#For hexagonal system\n",
+ "u=(2*du-dv)/3.0\n",
+ "v=(2*dv-du)/3.0\n",
+ "t=-(u+v)\n",
+ "w=dw\n",
+ "\n",
+ "x=[3*u,3*v,3*t,3*w]\n",
+ "print\"The indices for the given directions are\",x\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The indices for the given directions are [1.0, 1.0, -2.0, 3]\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9 Page No: 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of Planar (Miller) Indices\n",
+ "\n",
+ "#Given\n",
+ "a=-1\n",
+ "b=1/2.0\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#Reciprocal\n",
+ "l=0 #Reciprocal of infinity\n",
+ "m=1/a\n",
+ "n=1/b\n",
+ "x=[l,m,n]\n",
+ "\n",
+ "#Result\n",
+ "print\"The intercept for the given plane is\",x\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The intercept for the given plane is [0, -1, 2.0]\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11 Page No: 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determination of Miller\u2013Bravais Indices for a Plane Within a Hexagonal Unit Cell\n",
+ "\n",
+ "#Intersection in terms of lattics Parameters\n",
+ "h=1 #Reciprocal of intersection point\n",
+ "k=-1\n",
+ "l=1\n",
+ "i=-(h+k)\n",
+ "\n",
+ "#Calculation\n",
+ "x=[h,k,i,l]\n",
+ "\n",
+ "#Result\n",
+ "print\"The indices of plane are\",x\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The indices of plane are [1, -1, 0, 1]\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.12 Page No: 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Interplanar Spacing\n",
+ "\n",
+ "#Given\n",
+ "a=0.2866 #Lattice parameter in nm\n",
+ "h=2\n",
+ "k=2\n",
+ "l=0\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#(a)\n",
+ "d_hkl=a/(math.sqrt(h**2+k**2+l**2))\n",
+ "\n",
+ "#(b)Diffraction Angle Computations\n",
+ "lam=0.1790 #Wavelength in nm\n",
+ "n=1\n",
+ "theta=math.asin(n*lam/(2*d_hkl))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)Interplanar spacing is \",round(d_hkl,4),\"nm\"\n",
+ "print\"(b)Diffraction angle is \",round(2*theta*(180/math.pi),1),\"degree\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Interplanar spacing is 0.1013 nm\n",
+ "(b)Diffraction angle is 124.1 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH4.ipynb b/Materials_science_and_engineering_an_introduction/CH4.ipynb
new file mode 100644
index 00000000..93bc9a2e
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH4.ipynb
@@ -0,0 +1,161 @@
+{
+ "metadata": {
+ "name": "CH4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Imperfections in solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page No: 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Number of Vacancies Computation at a Specified temperature\n",
+ "\n",
+ "#Given\n",
+ "Na=6.023*10**23 #Avogadro No.\n",
+ "den=8.4*10**6 #Density of Copper\n",
+ "A=63.5 #Atomic weight of Copper\n",
+ "\n",
+ "#Calculation\n",
+ "#No. of atomic site per cubic meter\n",
+ "N=Na*den/A\n",
+ "#No. of vacancies at 1000 C\n",
+ "Qv=0.9 #Activation energy in eV\n",
+ "k=8.62*10**-5 # Boltzmann Constatnt in eV/K\n",
+ "T=1000.0+273.0 #Temperature in K\n",
+ "Nv=N*exp(-Qv/(k*T))\n",
+ "\n",
+ "#Result\n",
+ "print\"No.of vacancies are \",round(Nv,-24),\"/m**3\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No.of vacancies are 2.2e+25 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page No: 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Composition Conversion- From weight percent to Atom percent\n",
+ "\n",
+ "#Given\n",
+ "#Conversion to Atom percent\n",
+ "C_Al=97.0 #Aluminium wt%\n",
+ "C_Cu=3.0 #Copper wt%\n",
+ "A_Al=26.98 #Atomic wt of Aluminium\n",
+ "A_Cu=63.55 #Atomic wt of Copper\n",
+ "\n",
+ "CAl=(C_Al*A_Cu)/(C_Al*A_Cu+C_Cu*A_Al)\n",
+ "CCu=(C_Cu*A_Al)/(C_Al*A_Cu+C_Cu*A_Al)\n",
+ "\n",
+ "print\"Atomic % of Al is \",round(CAl*100,1),\"%\"\n",
+ "print\"Atomic % of Cu is \",round(CCu*100,1),\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Atomic % of Al is 98.7 %\n",
+ "Atomic % of Cu is 1.3 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No: 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computations of ASTM Grain Size Number\n",
+ "\n",
+ "#Given\n",
+ "N=45.0 #No. of grains per square inch\n",
+ "\n",
+ "#Calculation\n",
+ "#Dterminin grain size no. N=2**(n-1)\n",
+ "n=(math.log(N)/math.log(2))+1\n",
+ "\n",
+ "#Number of Grains Per Unit Area\n",
+ "M=85.0\n",
+ "Nm=(100/M)**2*2**(n-1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Grain size no. is \",round(n,1)\n",
+ "print\"No. of grains per inch square are \",round(Nm,1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Grain size no. is 6.5\n",
+ "No. of grains per inch square are 62.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH5.ipynb b/Materials_science_and_engineering_an_introduction/CH5.ipynb
new file mode 100644
index 00000000..5b193d64
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH5.ipynb
@@ -0,0 +1,302 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Diffusion"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page No. 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Diffusion Flux Computation\n",
+ "\n",
+ "#Given\n",
+ "Ca=1.2 #Concentration at A in kg/m**3\n",
+ "Cb=0.8 #Concentration at B in kg/m**3\n",
+ "xa=5*10**-3 #Position 1 in m\n",
+ "xb=10*10**-3 #Position 2 in m\n",
+ "\n",
+ "#Calculation\n",
+ "D=3*10**-11 #Diffusion coefficient in m**2/s\n",
+ "J=-D*(Ca-Cb)/(xa-xb)\n",
+ "\n",
+ "#Result\n",
+ "print\"Diffusion flux is \",J,\"kg/m**2-s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion flux is 2.4e-09 kg/m**2-s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page No. 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Nonsteady-State Diffusion Time Computation I\n",
+ "from scipy.optimize import fsolve\n",
+ "#Given\n",
+ "Co=0.25 #Initial Conc. in wt%\n",
+ "Cs=1.2 #Surface conc. in wt%\n",
+ "Cx=0.8 #Conc. at any x in wt%\n",
+ "x=5*10**-4 #Position in m\n",
+ "D=1.6*10**-11 #Diffusion coeff in m**2/s\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C=1-((Cx-Co)/(Cs-Co))\n",
+ "\n",
+ "def f(z):\n",
+ " return(0.4210-math.erf(z))\n",
+ "z=fsolve(f,1)\n",
+ "t=x**2/(4.0*D*z**2.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Time required is \",round(t/3600.0,1),\"h\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required is 7.0 h\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page No. 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Nonsteady-State Diffusion Time Computation II\n",
+ "\n",
+ "#Given\n",
+ "D500=4.8*10**-14 #Diffusion coefficient at 500 C\n",
+ "D600=5.3*10**-13 #Diffusion coefficient at 600 C\n",
+ "t600=10 #Time in hours to diffuse\n",
+ "\n",
+ "#Calcuation\n",
+ "t500=D600*t600/D500\n",
+ "\n",
+ "#Result\n",
+ "print\"Time to diffuse at 500 C is \",round(t500,1),\"h\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time to diffuse at 500 C is 110.4 h\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page No. 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Diffusion Coefficient Determination\n",
+ "\n",
+ "#Given\n",
+ "T=550+273 #in K\n",
+ "D0=1.2*10**-4 #Temperature independent preexponential in m**2/s\n",
+ "Qd=131000 #Activation energy in J/mol-K\n",
+ "R=8.31 #Universal Gas constt\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D=D0*math.exp(-Qd/(R*T))\n",
+ "\n",
+ "#Result\n",
+ "print\"Diffusion coefficient is \",round(D,14),\"m**2/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion coefficient is 5.8e-13 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page No.121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Diffusion Coefficient Activation Energy and Preexponential Calculations\n",
+ "\n",
+ "#Given\n",
+ "#From graph log D ad 1/T are deducted\n",
+ "inv_T1=0.8*10**-3 #Reciprocal of temp. in K**-1\n",
+ "inv_T2=1.1*10**-3 #Reciprocal of temp. in K**-1\n",
+ "logD1=-12.4\n",
+ "logD2=-15.45\n",
+ "R=8.31 #Gas law Constant in J/mol-K\n",
+ "\n",
+ "#Calculation\n",
+ "Qd=-2.3*R*(logD1-logD2)/(inv_T1-inv_T2)\n",
+ "print\"Activation energy is\",round(Qd/1000,0),\"KJ\"\n",
+ "\n",
+ "#For calculating Peexponential factor\n",
+ "D0=10**(logD2+(Qd*inv_T2/(2.3*R)))\n",
+ "print\"Preexponential factor is\",round(D0,6),\"m**2/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Activation energy is 194.0 KJ\n",
+ "Preexponential factor is 5.4e-05 m**2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 5.1, Page No.122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Diffusion Temperature\u2013Time Heat Treatment Specification\n",
+ "\n",
+ "#Given\n",
+ "C0=0.2 #Initial concentration in wt%\n",
+ "Cs=1 #Surface conc in wt%\n",
+ "Cx=0.6 #Conc at any position X in wt%\n",
+ "x=7.5*10**-4 #Position in m\n",
+ "D0=2.3*10**-5 #Preexponential factor in m**2/s\n",
+ "R=8.31 #Gas law constant in J/mol-K\n",
+ "Qd=148000 #Activation energy in J/mol\n",
+ "\n",
+ "C=1-((Cx-C0)/(Cs-C0))\n",
+ "z=0.4747\n",
+ "Dt=(x/(2*z))**2\n",
+ "\n",
+ "#Dt=D0*exp(-Qd/RT)*t = value of variable Dt\n",
+ "D=Dt/D0\n",
+ "\n",
+ "#The tempratures are\n",
+ "T1=900.0\n",
+ "T2=950.0\n",
+ "T3=1000.0\n",
+ "T4=1050.0\n",
+ "t1=D/math.exp(-Qd/(R*(T1+273)))/3600.0\n",
+ "t2=D/math.exp(-Qd/(R*(T2+273)))/3600.0\n",
+ "t3=D/math.exp(-Qd/(R*(T3+273)))/3600.0\n",
+ "t4=D/math.exp(-Qd/(R*(T4+273)))/3600.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Temperature in Celcius are\",T1,T2,T3,T4\n",
+ "print\"Time is respectively \",round(t1,1),\"h,\",round(t2,1),\"h,\",round(t3,1),\"h,\",round(t4,1),\"h\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature in Celcius are 900.0 950.0 1000.0 1050.0\n",
+ "Time is respectively 29.6 h, 15.9 h, 9.0 h, 5.3 h\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH6.ipynb b/Materials_science_and_engineering_an_introduction/CH6.ipynb
new file mode 100644
index 00000000..e04ca9e8
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH6.ipynb
@@ -0,0 +1,342 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Mechanical Properties of Metal"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page No 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Elongation (Elastic) Computation\n",
+ "\n",
+ "E=110*10**3 #Young's modulus of Copper in MPa\n",
+ "sigma=276.0 #Applied stress in MPa\n",
+ "lo=305.0 #Original length in mm\n",
+ "\n",
+ "#Calculation\n",
+ "#Deformation\n",
+ "dl=sigma*lo/E\n",
+ "\n",
+ "#Result\n",
+ "print\"Elongation obtained is \",round(dl,2),\"mm\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Elongation obtained is 0.77 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page No 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Computation of Load to Produce Specified Diameter Change\n",
+ "\n",
+ "#Given\n",
+ "del_d=-2.5*10**-3 #Deformation in dia in mm\n",
+ "d0=10.0 #Initial dia in mm\n",
+ "v=0.34 #Poisson ratio for brass\n",
+ "\n",
+ "#Calculation\n",
+ "ex=del_d/d0\n",
+ "ez=-ex/v\n",
+ "E=97*10**3 #Modulus of elasticity in MPa\n",
+ "sigma=ez*E\n",
+ "F=sigma*math.pi*(d0**2)/4.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Applied force is \",round(F,0),\"N\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applied force is 5602.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page No 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#From draph in the question\n",
+ "#stress and strain can be obtained\n",
+ "\n",
+ "#Given\n",
+ "si2=150 # in MPa\n",
+ "si1=0\n",
+ "e2=0.0016\n",
+ "e1=0\n",
+ "d0=12.8*10**-3 #Initial Diameter in m\n",
+ "\n",
+ "#Calculation\n",
+ "#(a)Young's Modulus = stress/strain\n",
+ "E=(si2-si1)/(e2-e1)\n",
+ "\n",
+ "A0=math.pi*d0**2/4.0\n",
+ "sig=450*10**6 #tensile strength in MPa\n",
+ "F=sig*A0\n",
+ "#From stress-strain curve\n",
+ "#Strain corresponding to stress of 345 MPa is 0.06\n",
+ "l0=250 #Initial lengt in mm\n",
+ "e=0.06 #strain\n",
+ "dl=e*l0\n",
+ "\n",
+ "#Result\n",
+ "print\"Modulus of elasticity is \",round(E/10**3,1),\"GPa\"\n",
+ "print\"From the graph the Yield strength is\",l0,\"MPa\"\n",
+ "print\"Maximum load sustained is \",round(F,0),\"N/n\"\n",
+ "print\"Change in length is \",dl,\"mm\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Modulus of elasticity is 93.8 GPa\n",
+ "From the graph the Yield strength is 250 MPa\n",
+ "Maximum load sustained is 57906.0 N/n\n",
+ "Change in length is 15.0 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page No 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ductility\n",
+ "\n",
+ "#Given\n",
+ "di=12.8 #Initial dia in mm\n",
+ "df=10.7 #Final dia in mm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#Ductility in terms of Reduction Area \n",
+ "RA = ((di**2-df**2)/di**2)*100\n",
+ "#True-Stress-At-Fracture Computations\n",
+ "Ao=math.pi*di**2*10**-6/4.0\n",
+ "sig=460*10**6 #Tensile strength\n",
+ "\n",
+ "F=sig*Ao\n",
+ "\n",
+ "Af=math.pi*df**2/4.0\n",
+ "sig_t=F/Af\n",
+ "\n",
+ "#Result\n",
+ "print\"percent reduction in area is \",round(RA,0),\"%\"\n",
+ "print\"True stress is \",round(sig_t,1),\"MPa\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percent reduction in area is 30.0 %\n",
+ "True stress is 658.3 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page No 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculation of Strain-Hardening Exponent\n",
+ "\n",
+ "sig_t=415 #True stress in MPa\n",
+ "et=0.1 #True strain\n",
+ "K=1035.0 # In MPa\n",
+ "\n",
+ "#Calculation\n",
+ "n=(math.log(sig_t)-math.log(K))/math.log(et)\n",
+ "\n",
+ "#Result\n",
+ "print\"Strain - hardening coefficient is \",round(n,2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Strain - hardening coefficient is 0.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 Page No 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Average Computations\n",
+ "\n",
+ "#Tensile strength at 4 points\n",
+ "n=4.0 #No of points\n",
+ "T1=520\n",
+ "T2=512\n",
+ "T3=515\n",
+ "T4=522\n",
+ "\n",
+ "#Calculation\n",
+ "Tav=(T1+T2+T3+T4)/n\n",
+ "s=(((T1-Tav)**2+(T2-Tav)**2+(T3-Tav)**2+(T4-Tav)**2)/(n-1))**(0.5)\n",
+ "\n",
+ "#Result\n",
+ "print\"The average Tensile strength is\",round(Tav,0),\"MPa\"\n",
+ "print\"The standard deviation is\",round(s,1),\"MPa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average Tensile strength is 517.0 MPa\n",
+ "The standard deviation is 4.6 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 6.1 ,Page No 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Specification of Support Post Diameter\n",
+ "\n",
+ "#Given\n",
+ "sig_y=310.0 #Minimum yield strength in MPa\n",
+ "N=5.0 # Conservative factor of safety\n",
+ "\n",
+ "#Calculation\n",
+ "F=220000/2.0 #Two rods must support half of the total force\n",
+ "sig_w=sig_y/N\n",
+ "d=2*math.sqrt(F/(math.pi*sig_w))\n",
+ "\n",
+ "#Result\n",
+ "print\"Diameter of each of the two rods is \",round(d,1),\"mm\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter of each of the two rods is 47.5 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH7.ipynb b/Materials_science_and_engineering_an_introduction/CH7.ipynb
new file mode 100644
index 00000000..ffef5715
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH7.ipynb
@@ -0,0 +1,177 @@
+{
+ "metadata": {
+ "name": "CH7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Dislocation and Strengthening Mechanisms"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.1 Page no 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Resolved Shear Stress Computations\n",
+ "\n",
+ "#Direction for given plane\n",
+ "u1=1\n",
+ "v1=1\n",
+ "w1=0\n",
+ "u2=0\n",
+ "v2=1\n",
+ "w2=0\n",
+ "#For lamda\n",
+ "u3=-1\n",
+ "v3=1\n",
+ "w3=1\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "phi=math.acos((u1*u2+v1*v2+w1*w2)/(math.sqrt((u1**2+v1**2+w1**2)*(u2**2+v2**2+w2**2))))\n",
+ "lam=math.acos((u3*u2+v3*v2+w3*w2)/(math.sqrt((u3**2+v3**2+w3**2)*(u2**2+v2**2+w2**2))))\n",
+ "sigma=52 #in MPa, Tensile stress\n",
+ "tr=sigma*math.cos(phi)*math.cos(lam)\n",
+ "trc=30 #in MPa Critical resolved shear stress\n",
+ "sy=trc/(math.cos(phi)*math.cos(lam))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a)The resolved shear stress is \",round(tr,2),\"MPa\"\n",
+ "print\"(b)Yield strength is\",round(sy,1),\"MPa\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)The resolved shear stress is 21.23 MPa\n",
+ "(b)Yield strength is 73.5 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 Page no 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Tensile Strength and Ductility Determinations for Cold-Worked Copper\n",
+ "\n",
+ "#Given\n",
+ "df=12.2 #Final dia in mm\n",
+ "di=15.2 #Initial dia in mm\n",
+ "\n",
+ "#Calculation\n",
+ "CW = ((di**2-df**2)/di**2)*100\n",
+ "ts=340 #in Mpa tensile strength, from fig 7.19 (b)\n",
+ "duc=7 #in % Ductility from fig 7.19 (c)\n",
+ "\n",
+ "#result\n",
+ "print\"Percent Cold Work is \",round(CW,1),\"%\"\n",
+ "print\"Tensile strength is\",ts,\"MPa\"\n",
+ "print\"Ductility is \",duc,\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percent Cold Work is 35.6 %\n",
+ "Tensile strength is 340 MPa\n",
+ "Ductility is 7 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 7.3 Page no 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Description of Diameter Reduction Procedure\n",
+ "\n",
+ "#Given\n",
+ "di=6.4 #Initial dia in mm\n",
+ "df=5.1 #Final dia in mm\n",
+ "\n",
+ "#Calculation\n",
+ "#Cold Work Computation\n",
+ "CW = ((di**2-df**2)/di**2)*100\n",
+ "#From Figures 7.19a and 7.19c, \n",
+ "#A yield strength of 410 MPa \n",
+ "#And a ductility of 8% EL are attained from this deformation\n",
+ "dmid = math.sqrt(df**2/(1-0.215))\n",
+ "\n",
+ "#Result\n",
+ "print\"Cold work is \",round(CW,1),\"%\"\n",
+ "print\"But required ductility and yield strength is not matched at this cold work\"\n",
+ "print\"Hence required Cold work is 21.5 %\"\n",
+ "print\"Hence original diameter for second drawing is \",round(dmid,1),\"mm\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cold work is 36.5 %\n",
+ "But required ductility and yield strength is not matched at this cold work\n",
+ "Hence required Cold work is 21.5 %\n",
+ "Hence original diameter for second drawing is 5.8 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH8.ipynb b/Materials_science_and_engineering_an_introduction/CH8.ipynb
new file mode 100644
index 00000000..682a584f
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH8.ipynb
@@ -0,0 +1,111 @@
+{
+ "metadata": {
+ "name": "CH8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Failure"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Maximum Flaw Length Computation\n",
+ "\n",
+ "#Given\n",
+ "sigma=40*10**6 # in Pa Tensile stress\n",
+ "E=69*10**9 #Modulus of elaticity in pa\n",
+ "Ys=0.3 #Specific surface energy in N/m**2\n",
+ "\n",
+ "#Calculation\n",
+ "#Maximum length of a surface flaw\n",
+ "a=2*E*Ys/(math.pi*sigma**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum lemgth of a surface flaw without fracture is \",round(a*10**6,1),\"micro m\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum lemgth of a surface flaw without fracture is 8.2 micro m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Design Example 8.2 Page no 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Rupture Lifetime Prediction\n",
+ "\n",
+ "#Given\n",
+ "T=800.0+273.0 # Temperature in K\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "#From Graph of Fig. 8.32 Larson-Miller Parameter is deduced\n",
+ "L_M=24*10**3\n",
+ "#math.log(t)=((L_M/T)-20)\n",
+ "t=math.pow(10,(L_M/T)-20)\n",
+ " \n",
+ "#result\n",
+ "print\"Time to rupture is \",round(t,0),\"h\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time to rupture is 233.0 h\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/CH9.ipynb b/Materials_science_and_engineering_an_introduction/CH9.ipynb
new file mode 100644
index 00000000..0953b608
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/CH9.ipynb
@@ -0,0 +1,148 @@
+{
+ "metadata": {
+ "name": "CH9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Phase Diagram"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page No 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#(a)Determination of Phases Present\n",
+ "#(b)Computation of Phase Compositions\n",
+ "\n",
+ "#Given\n",
+ "C1=40.0 # Overall alloy composition\n",
+ "Cb=98.0\n",
+ "Ca=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "Wa=(Cb-C1)/(Cb-Ca)\n",
+ "Wb=(C1-Ca)/(Cb-Ca)\n",
+ "d_Sn=7.24 # in g/cm**3 density of tin\n",
+ "d_Pb=11.23 # in g/cm**3 density of lead\n",
+ "Ca_Sn=10.0\n",
+ "Ca_Pb=90.0\n",
+ "Cb_Sn=98.0\n",
+ "Cb_Pb=2.0\n",
+ "d_a=100/((Ca_Sn/d_Sn)+(Ca_Pb/d_Pb))\n",
+ "d_b=100/((Cb_Sn/d_Sn)+(Cb_Pb/d_Pb))\n",
+ "Va=Wa/(d_a*((Wa/d_a)+(Wb/d_b)))\n",
+ "Vb=Wb/(d_b*((Wa/d_a)+(Wb/d_b)))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print\"Mass fractions for alpha and beta phases are respectively\",round(Wa,2),\"and\",round(Wb,2)\n",
+ "print\"Density of alpha phase is \",round(d_a,2),\"g/cm**3\"\n",
+ "print\"Density of beta phase is \",round(d_b,2),\"g/cm**3\"\n",
+ "print\"Volume fraction of alpha phase \",round(Va,2),\"g/cm**3\"\n",
+ "print\"Volume fraction of beta phase \",round(Vb,2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass fractions for alpha and beta phases are respectively 0.66 and 0.34\n",
+ "Density of alpha phase is 10.64 g/cm**3\n",
+ "Density of beta phase is 7.29 g/cm**3\n",
+ "Volume fraction of alpha phase 0.57 g/cm**3\n",
+ "Volume fraction of beta phase 0.43\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page No 299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#(a)Determining ferrite and cementite phase\n",
+ "#(b)Determining proeutectoid ferrite and pearlite\n",
+ "#(c)Determining eutectoid ferrite\n",
+ "\n",
+ "#Given\n",
+ "C0=0.35\n",
+ "Ca=0.022\n",
+ "C_Fe3C=6.7\n",
+ "\n",
+ "#Calculation\n",
+ "Wa=(C_Fe3C-C0)/(C_Fe3C-Ca)\n",
+ "W_Fe3C=(C0-Ca)/(C_Fe3C-Ca)\n",
+ "C_p=0.76\n",
+ "Wp=(C0-Ca)/(C_p-Ca)\n",
+ "W_a=(C_p-C0)/(C_p-Ca)\n",
+ "Wp=(C0-Ca)/(C_p-Ca)\n",
+ "W_a=(C_p-C0)/(C_p-Ca)\n",
+ "Wa=(C_Fe3C-C0)/(C_Fe3C-Ca)\n",
+ "Wae=Wa-W_a\n",
+ "\n",
+ "#result\n",
+ "print\"Mass fraction of total ferritic phase is\",round(Wa,2)\n",
+ "print\"Mass fraction of Fe3C is\",round(W_Fe3C,2)\n",
+ "print\"Mass fraction of Pearlite is\",round(Wp,2)\n",
+ "print\"ass fraction of proeutectoid ferrite is\",round(W_a,2)\n",
+ "print\"Mass fraction of eutectoid ferrite is\",round(Wae,2)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass fraction of total ferritic phase is 0.95\n",
+ "Mass fraction of Fe3C is 0.05\n",
+ "Mass fraction of Pearlite is 0.44\n",
+ "ass fraction of proeutectoid ferrite is 0.56\n",
+ "Mass fraction of eutectoid ferrite is 0.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/README.txt b/Materials_science_and_engineering_an_introduction/README.txt
new file mode 100644
index 00000000..5f1056e2
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ankit Garg
+Course: btech
+College/Institute/Organization: DCRUST, Murthal
+Department/Designation: Chemical Engineering
+Book Title: Materials science and engineering an introduction
+Author: William D. Callister
+Publisher: John Wiley & Sons Inc., USA
+Year of publication: 2007
+Isbn: 978-0471736967
+Edition: 7 \ No newline at end of file
diff --git a/Materials_science_and_engineering_an_introduction/screenshots/10_2.png b/Materials_science_and_engineering_an_introduction/screenshots/10_2.png
new file mode 100644
index 00000000..2ab2bcc8
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/screenshots/10_2.png
Binary files differ
diff --git a/Materials_science_and_engineering_an_introduction/screenshots/8_1.png b/Materials_science_and_engineering_an_introduction/screenshots/8_1.png
new file mode 100644
index 00000000..6d576bb0
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/screenshots/8_1.png
Binary files differ
diff --git a/Materials_science_and_engineering_an_introduction/screenshots/9_3.png b/Materials_science_and_engineering_an_introduction/screenshots/9_3.png
new file mode 100644
index 00000000..d332d145
--- /dev/null
+++ b/Materials_science_and_engineering_an_introduction/screenshots/9_3.png
Binary files differ
diff --git a/Mechanics_of_Materials/README.txt b/Mechanics_of_Materials/README.txt
new file mode 100644
index 00000000..433bd9d4
--- /dev/null
+++ b/Mechanics_of_Materials/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Parth Parmar
+Course: mca
+College/Institute/Organization: Indus Ind Bank
+Department/Designation: Relationship Officer
+Book Title: Mechanics of Materials
+Author: James M. Gere
+Publisher: Thomson Learning, USA
+Year of publication: 2004
+Isbn: 0-534-41793-0
+Edition: 6th \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter1.ipynb b/Mechanics_of_Materials/chapter1.ipynb
new file mode 100644
index 00000000..cf45a409
--- /dev/null
+++ b/Mechanics_of_Materials/chapter1.ipynb
@@ -0,0 +1,423 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Tension Comprssion and Shear"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1, page no. 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Find compressive stress and strain in the post\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "d_1 = 4 # inner diameter (inch)\n",
+ "d_2 = 4.5 #outer diameter (inch)\n",
+ "P = 26000 # pressure in pound\n",
+ "L = 16 # Length of cylinder (inch)\n",
+ "my_del = 0.012 # shortening of post (inch)\n",
+ "\n",
+ "#calculation\n",
+ "A = (math.pi/4)*((d_2**2)-(d_1**2)) #Area (inch^2)\n",
+ "s = P/A # stress\n",
+ "\n",
+ "print \"compressive stress in the post is \", round(s), \"psi\"\n",
+ "\n",
+ "e = my_del/L # strain\n",
+ "\n",
+ "print \"compressive strain in the post is %e\" %e"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "compressive stress in the post is 7789.0 psi\n",
+ "compressive strain in the post is 7.500000e-04\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, page no. 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "formula for maximum stress & calculating maximum stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "W = 1500 # weight (Newton)\n",
+ "d = 0.008 #diameter(meter) \n",
+ "g = 77000 # Weight density of steel\n",
+ "L = 40 # Length of bar (m)\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "A = (math.pi/4)*(d**2) # Area\n",
+ "s_max = (1500/A) + (g*L) # maximum stress\n",
+ "\n",
+ "#result\n",
+ "print \"Therefore the maximum stress in the rod is \", round(s_max,1), \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Therefore the maximum stress in the rod is 32921551.8 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3. page no. 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculating change in lenght of pipe, strain in pipe, increase in diameter & increase in wall thickness\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d1 = 4.5 # diameter in inch\n",
+ "d2 = 6 # diameter in inch\n",
+ "A = (math.pi/4)*((d2**2)-(d1**2)) # Area\n",
+ "P = 140 # pressure in K\n",
+ "s = -P/A # stress (compression)\n",
+ "E = 30000 # young's modulus in Ksi\n",
+ "e = s/E # strain\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "# Part (a)\n",
+ "my_del = e*4*12 # del = e*L \n",
+ "print \"Change in length of the pipe is\", round(my_del,3), \"inch\"\n",
+ "\n",
+ "# Part (b)\n",
+ "v = 0.30 # Poissio's ratio\n",
+ "e_ = -(v*e)\n",
+ "print \"Lateral strain in the pipe is %e\" %e_\n",
+ "\n",
+ "# Part (c)\n",
+ "del_d2 = e_*d2 \n",
+ "del_d1 = e_*d1\n",
+ "print \"Increase in the inner diameter is \", round(del_d1,6), \"inch\"\n",
+ "\n",
+ "# Part (d)\n",
+ "t = 0.75\n",
+ "del_t = e_*t\n",
+ "print \"Increase in the wall thicness is %f\" %del_t, \"inch\"\n",
+ "del_t1 = (del_d2-del_d1)/2 \n",
+ "print \"del_t1 = del_t\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in length of the pipe is -0.018 inch\n",
+ "Lateral strain in the pipe is 1.131768e-04\n",
+ "Increase in the inner diameter is 0.000509 inch\n",
+ "Increase in the wall thicness is 0.000085 inch\n",
+ "del_t1 = del_t\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4, page no. 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate average shear stress and compressive stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d = 0.02 # diameter in m\n",
+ "t = 0.008 # thickness in m\n",
+ "A = math.pi*d*t # shear area\n",
+ "P = 110000 # prassure in Newton\n",
+ "\n",
+ "#calculation\n",
+ "A1 = (math.pi/4)*(d**2) # Punch area\n",
+ "t_aver = P/A # Average shear stress \n",
+ "\n",
+ "\n",
+ "print \"Average shear stress in the plate is \", t_aver, \"Pa\"\n",
+ "s_c = P/A1 # compressive stress\n",
+ "print \"Average compressive stress in the plate is \", s_c, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average shear stress in the plate is 218838046.751 Pa\n",
+ "Average compressive stress in the plate is 350140874.802 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Eample 1.5, page no. 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate bearing stress, shear stress in pin,\n",
+ "bearing stress between pin and gussets,\n",
+ "shear stress in anchor bolts\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "P = 12.0 # Pressure in K\n",
+ "t = 0.375 # thickness of wall in inch\n",
+ "theta = 40.0 # angle in degree\n",
+ "d_pin = 0.75 # diameter of pin in inch\n",
+ "t_G = 0.625 # thickness of gusset in inch\n",
+ "t_B = 0.375 #thickness of base plate in inch\n",
+ "d_b = 0.50 # diameter of bolt in inch\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "#Part (a)\n",
+ "s_b1 = P/(2*t*d_pin) # bearing stress\n",
+ "print \"Bearing stress between strut and pin\", round(s_b1,1), \"ksi\"\n",
+ "\n",
+ "#Part (b)\n",
+ "t_pin = (4*P)/(2*math.pi*(d_pin**2)) # average shear stress in the \n",
+ "print \"Shear stress in pin is \", round(t_pin,1), \"ksi\"\n",
+ "\n",
+ "# Part (c)\n",
+ "s_b2 = P/(2*t_G*d_pin) # bearing stress between pin and gusset\n",
+ "print \"Bearing stress between pin and gussets is\", s_b2, \"ksi\"\n",
+ "\n",
+ "# Part (d)\n",
+ "s_b3 = (P*math.cos(math.radians(40))/(4*t_B*d_b)) # bearing stress between anchor bolt and base plate\n",
+ "print \"Bearing stress between anchor bolts & base plate\", round(s_b3,1), \"ksi\"\n",
+ "\n",
+ "# Part (e)\n",
+ "t_bolt = (4*math.cos(math.radians(40))*P)/(4*math.pi*(d_b**2)) # shear stress in anchor bolt\n",
+ "print \"Shear stress in anchor bolts is\", round(t_bolt,1), \"ksi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bearing stress between strut and pin 21.3 ksi\n",
+ "Shear stress in pin is 13.6 ksi\n",
+ "Bearing stress between pin and gussets is 12.8 ksi\n",
+ "Bearing stress between anchor bolts & base plate 12.3 ksi\n",
+ "Shear stress in anchor bolts is 11.7 ksi\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7, page no. 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "determine stress at various parts\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "b1 = 1.5 # width of recmath.tangular crosssection in inch\n",
+ "t = 0.5 # thickness of recmath.tangular crosssection in inch\n",
+ "b2 = 3.0 # width of enlarged recmath.tangular crosssection in inch\n",
+ "d = 1.0 # diameter in inch\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "# Part (a)\n",
+ "s_1 = 16000 # maximum allowable tensile stress in Psi\n",
+ "P_1 = s_1*t*b1 \n",
+ "print \"The allowable load P1 is\", P_1, \"lb\"\n",
+ "\n",
+ "# Part (b)\n",
+ "s_2 = 11000 # maximum allowable tensile stress in Psi\n",
+ "P_2 = s_2*t*(b2-d) \n",
+ "print \"allowable load P2 at this section is\", P_2, \"lb\"\n",
+ "\n",
+ "#Part (c)\n",
+ "s_3 = 26000 # maximum allowable tensile stress in Psi\n",
+ "P_3 = s_3*t*d \n",
+ "print \"The allowable load based upon bearing between the hanger and the bolt is\", P_3, \"lb\"\n",
+ "\n",
+ "# Part (d)\n",
+ "s_4 = 6500 # maximum allowable tensile stress in Psi\n",
+ "P_4 = (math.pi/4)*(d**2)*2*s_4 \n",
+ "print \"the allowable load P4 based upon shear in the bolt is\", round(P_4), \"lb\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The allowable load P1 is 12000.0 lb\n",
+ "allowable load P2 at this section is 11000.0 lb\n",
+ "The allowable load based upon bearing between the hanger and the bolt is 13000.0 lb\n",
+ "the allowable load P4 based upon shear in the bolt is 10210.0 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8, page no. 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculating the cross sectional area \n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "R_ah = (2700*0.8 + 2700*2.6)/2 # Horizontal component at A in N\n",
+ "R_ch = R_ah # Horizontal component at C in N\n",
+ "R_cv = (2700*2.2 + 2700*0.4)/3 # vertical component at C in N\n",
+ "R_av = 2700 + 2700 - R_cv # vertical component at A in N\n",
+ "R_a = math.sqrt((R_ah**2)+(R_av**2))\n",
+ "R_c = math.sqrt((R_ch**2)+(R_cv**2))\n",
+ "Fab = R_a # Tensile force in bar AB\n",
+ "Vc = R_c # Shear force acting on the pin at C\n",
+ "s_allow = 125000000 # allowable stress in tension \n",
+ "t_allow = 45000000 # allowable stress in shear\n",
+ "\n",
+ "#calculation\n",
+ "Aab = Fab / s_allow # required area of bar \n",
+ "Apin = Vc / (2*t_allow) # required area of pin\n",
+ "\n",
+ "\n",
+ "print \"Required area of bar is %f\" %Apin, \"m^2\"\n",
+ "d = math.sqrt((4*Apin)/math.pi) # diameter in meter\n",
+ "print \"Required diameter of pin is %f\" %d, \"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required area of bar is 0.000057 m^2\n",
+ "Required diameter of pin is 0.008537 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter11.ipynb b/Mechanics_of_Materials/chapter11.ipynb
new file mode 100644
index 00000000..d51505cd
--- /dev/null
+++ b/Mechanics_of_Materials/chapter11.ipynb
@@ -0,0 +1,515 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: Columns"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1, page no. 763"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "allowable load Pallow using a factor of safety & with respect to Euler buckling of the column\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "E = 29000 # Modulus of elasticity in ksi\n",
+ "spl = 42 # Proportional limit in ksi\n",
+ "L = 25 # Total length of coloum in ft\n",
+ "n = 2.5 # factor of safety\n",
+ "I1 = 98 # Moment of inertia on horizontal axis\n",
+ "I2 = 21.7 # Moment of inertia on vertical axis\n",
+ "A = 8.25 # Area of the cross section\n",
+ "\n",
+ "#calculation\n",
+ "Pcr2 = (4*math.pi**2*E*I2)/((L*12)**2) # Criticle load if column buckles in the plane of paper\n",
+ "Pcr1 = (math.pi**2*E*I1)/((L*12)**2) # Criticle load if column buckles in the plane of paper\n",
+ "Pcr = min(Pcr1,Pcr2) # Minimum pressure would govern the design\n",
+ "scr = Pcr/A # Criticle stress\n",
+ "Pa = Pcr/n # Allowable load in k\n",
+ "print \"The allowable load is \", round(Pa), \"k\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The allowable load is 110.0 k\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2, page no. 774"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate minimum required thickness t of the columns\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "L = 3.25 # Length of alluminium pipe in m\n",
+ "d = 0.1 # Outer diameter of alluminium pipe\n",
+ "P = 100000 # Allowable compressive load in N\n",
+ "n =3 # Safety factor for eular buckling\n",
+ "E = 72e09 # Modulus of elasticity in Pa\n",
+ "l = 480e06 # Proportional limit\n",
+ "\n",
+ "#calculation\n",
+ "Pcr = n*P # Critice load\n",
+ "t = (0.1-(55.6e-06)**(1.0/4.0) )/2.0 # Required thickness\n",
+ "\n",
+ "tmin = t \n",
+ "print \"The minimum required thickness of the coloumn is\", round(tmin*1000,2), \"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum required thickness of the coloumn is 6.82 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.3, page no. 780"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "evaluate the longest permissible length of the bar\n",
+ "\"\"\"\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "#initialisation\n",
+ "P = 1500 # Load in lb\n",
+ "e = 0.45 # ecentricity in inch\n",
+ "h = 1.2 # Height of cross section in inch\n",
+ "b = 0.6 # Width of cross section in inch\n",
+ "E = 16e06 # Modulus of elasticity \n",
+ "my_del = 0.12 # Allowable deflection in inch\n",
+ "\n",
+ "#calculation\n",
+ "L = mpmath.asec(1.2667)/0.06588 # Maximum allowable length possible\n",
+ "\n",
+ "#Result\n",
+ "print \"The longest permissible length of the bar is\", round(L), \"inch\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The longest permissible length of the bar is 10.0 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4, page no. 785"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum compressive stress in the column & the factor of safety\n",
+ "\"\"\"\n",
+ "\n",
+ "from sympy import *\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "L = 25 # Length of coloum in ft\n",
+ "P1 = 320 # Load in K\n",
+ "P2 = 40 # Load in K\n",
+ "E = 30000 # Modulus of elasticity of steel in Ksi\n",
+ "P = 360 # Euivalent load\n",
+ "e = 1.5 # Ecentricity of compressive load\n",
+ "A = 24.1 # Area of the Cross section\n",
+ "r = 6.05 # in inch\n",
+ "c = 7.155 # in inch\n",
+ "sy = 42 # Yeild stress of steel in Ksi\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "smax = (P/A)*(1+(((e*c)/r**2)*mpmath.sec((L/(2*r))*math.sqrt(P/(E*A))))) # Maximum compressive stress\n",
+ "print \"The Maximum compressive stress in the column \", round(smax,2), \"ksi\"\n",
+ "# Bisection method method to solve for yeilding\n",
+ "def stress(a,b,f):\n",
+ " N = 100\n",
+ " eps = 1e-5\n",
+ " if((f(a)*f(b))>0):\n",
+ " print 'no root possible f(a)*f(b)>0'\n",
+ " sys.exit()\n",
+ " if(abs(f(a))<eps):\n",
+ " print 'solution at a'\n",
+ " sys.exit()\n",
+ " if(abs(f(b))<eps):\n",
+ " print 'solution at b'\n",
+ " while(N>0):\n",
+ " c = (a+b)/2.0\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c \n",
+ " return x\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c \n",
+ " else:\n",
+ " a = c \n",
+ " N = N-1\n",
+ " print 'no convergence'\n",
+ " sys.exit()\n",
+ "\n",
+ "def p(x): \n",
+ "\t return x + (0.2939*x*sec(0.02916*sqrt(x))) - 1012 \n",
+ "x = stress(710,750,p)\n",
+ "Py = x # Yeilding load in K\n",
+ "n = Py/P # Factor of safety against yeilding\n",
+ "print \"The factor of safety against yeilding is\", round(n)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Maximum compressive stress in the column 19.32 ksi\n",
+ "The factor of safety against yeilding is 2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5, page no. 804"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "the allowable axial load & max. permissible length\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "E = 29000 # Modulus of elasticity in ksi\n",
+ "sy = 36 # Yeilding stress in ksi\n",
+ "L = 20 # Length of coloumn in ft\n",
+ "r = 2.57 # radius of gyration of coloumn\n",
+ "K = 1 # Effetive Length factor\n",
+ "\n",
+ "#calculation\n",
+ "s = math.sqrt((2*math.pi**2*E)/sy) # Criticle slenderness ratio (K*L)/r\n",
+ "s_ = (L*12)/r # Slenderness ratio\n",
+ "\n",
+ "# Part(a)\n",
+ "n1 = (5.0/3.0)+((3.0/8.0)*(s_/s))-((1.0/8.0)*((s_**3)/(s**3))) # Factor of safety \n",
+ "sallow = (sy/n1)*(1-((1.0/2.0)*((s_**2)/(s**2)))) # Allowable axial load\n",
+ "A = 17.6 # Cross sectional area from table E1\n",
+ "Pallow = sallow*A # Allowable axial load\n",
+ "print \"Allowable axial load is\", round(Pallow,2), \"k\"\n",
+ "\n",
+ "# Part (b)\n",
+ "Pe = 200 # Permissible load in K\n",
+ "L_ = 25 # Assumed length in ft\n",
+ "s__ = (L_*12)/r # Slenderness ratio\n",
+ "n1_ = (5.0/3.0)+((3.0/8.0)*(s__/s))-((1.0/8.0)*((s__**3)/(s**3))) # Factor of safety \n",
+ "sallow_ = (sy/n1_)*(1-((1.0/2.0)*((s__**2)/(s**2)))) # Allowable axial load\n",
+ "A = 17.6 # Area of the cross section in**2\n",
+ "Pallow = sallow_*A # Allowable load\n",
+ "L1 = [24, 24.4, 25]\n",
+ "P1 = [201, 194, 190]\n",
+ "L_max = numpy.interp(200.0, P1, L1)\n",
+ "print \"The maximum permissible length is\", L_max, \"ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Allowable axial load is 242.84 k\n",
+ "The maximum permissible length is 25.0 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6, page no. 806"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "L = 3.6 # Length of steel pipe coloumn\n",
+ "d = 0.16 # Outer diameter in m\n",
+ "P = 240e03 # Load in N\n",
+ "E = 200e09 # Modulus of elasticity in Pa\n",
+ "sy = 259e06 # yeilding stress in Pa\n",
+ "K = 2.0\n",
+ "Le = K*L # As it in fixed-free condition\n",
+ "\n",
+ "#calculation\n",
+ "sc = math.sqrt((2*math.pi**2*E)/sy) # Critical slenderness ratio\n",
+ "\n",
+ "# First trial\n",
+ "t = 0.007 # Assumed thick ness in m\n",
+ "I = (math.pi/64)*(d**4-(d-2*t)**4) # Moment of inertia\n",
+ "A = (math.pi/4)*(d**2-(d-2*t)**2) # Area of cross section\n",
+ "r = math.sqrt(I/A) # Radius of gyration\n",
+ "sc_ = round((K*L)/r) # Slender ness ratio\n",
+ "n2 = 1.92 # From equation 11.80\n",
+ "sa = (sy/(2*n2))*(sc**2/sc_**2) # Allowable stress\n",
+ "Pa = round((sa*A)/1000) # Allowable axial load in N\n",
+ "\n",
+ "# Interpolation\n",
+ "t = [7, 8, 9]\n",
+ "Pa = [196, 220, 243]\n",
+ "t_min = numpy.interp(240.0, Pa, t)\n",
+ "print \"The minimum required thickness of the steel pipe is\", round(t_min,1), \"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum required thickness of the steel pipe is 8.9 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.7, page no. 808"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "max. require outer diameter\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "L = 16 # Effective length in inch\n",
+ "P = 5 # axial load in K\n",
+ "\n",
+ "#calculation\n",
+ "# Bisection method for solvong the quaderatic\n",
+ "def stress(a,b,f):\n",
+ " N = 100\n",
+ " eps = 1e-5\n",
+ " if((f(a)*f(b))>0):\n",
+ " print 'no root possible f(a)*f(b)>0'\n",
+ " sys.exit()\n",
+ " if(abs(f(a))<eps):\n",
+ " print 'solution at a'\n",
+ " sys.exit()\n",
+ " if(abs(f(b))<eps):\n",
+ " print 'solution at b'\n",
+ " while(N>0):\n",
+ " c = (a+b)/2.0\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c \n",
+ " return x\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c \n",
+ " else:\n",
+ " a = c \n",
+ " N = N-1\n",
+ " print 'no convergence'\n",
+ " sys.exit()\n",
+ "def p(x): \n",
+ "\t return 30.7*x**2 - 11.49*x -17.69 \n",
+ "x = stress(0.9,1.1,p)\n",
+ "d = x # Diameter in inch\n",
+ "sl = 49.97/d # Slenderness ration L/r\n",
+ "dmin = d # Minimum diameter\n",
+ "print \"The minimum required outer diameter of the tube is\", round(dmin,2), \"inch\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum required outer diameter of the tube is 0.97 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.8, page no. 810"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate various quantities\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "Fc = 11e06 # Compressive demath.sing stress in Pa\n",
+ "E = 13e09 # Modulus of elasticity in Pa\n",
+ "\n",
+ "#calculation\n",
+ "# Part (a)\n",
+ "Kce = 0.3 \n",
+ "c = 0.8 \n",
+ "A = 0.12*0.16 # Area of cross section\n",
+ "Sl = 1.8/0.12 # Slenderness ratio\n",
+ "fi = (Kce*E)/(Fc*Sl**2) # ratio of stresses\n",
+ "Cp = ((1+fi)/(2*c)) - math.sqrt(((1+fi)/(2*c))**2-(fi/c)) # Coloumn stability factor \n",
+ "Pa = Fc*Cp*A\n",
+ "print \"The allowable axial load is\", Pa, \"N\"\n",
+ "\n",
+ "# Part (b)\n",
+ "P = 100000 # Allowable Axial load\n",
+ "Cp_ = P/(Fc*A) # Coloumn stability factor\n",
+ "\n",
+ "# Bisection method method to solve for fi\n",
+ "def stress(a,b,f):\n",
+ " N = 100\n",
+ " eps = 1e-5\n",
+ " if((f(a)*f(b))>0):\n",
+ " print 'no root possible f(a)*f(b)>0'\n",
+ " sys.exit()\n",
+ " if(abs(f(a))<eps):\n",
+ " print 'solution at a'\n",
+ " sys.exit()\n",
+ " if(abs(f(b))<eps):\n",
+ " print 'solution at b'\n",
+ " while(N>0):\n",
+ " c = (a+b)/2.0\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c \n",
+ " return x\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c \n",
+ " else:\n",
+ " a = c \n",
+ " N = N-1\n",
+ " print 'no convergence'\n",
+ " sys.exit()\n",
+ "def p(x): \n",
+ " return ((1+x)/(2.0*c)) - math.sqrt(((1+x)/(2.0*c))**2-(x/c)) - Cp_ \n",
+ "x = stress(0.1,1.0,p) \n",
+ "fi_ = x\n",
+ "d_ = 0.12 # Diameter in m\n",
+ "L_max = d_*math.sqrt((Kce*E)/(fi_*Fc)) # Maximum length in m\n",
+ "print \"The minimum allowable length is\", round(L_max,2), \"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The allowable axial load is 173444.30361 N\n",
+ "The minimum allowable length is 3.02 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter12.ipynb b/Mechanics_of_Materials/chapter12.ipynb
new file mode 100644
index 00000000..b8be714d
--- /dev/null
+++ b/Mechanics_of_Materials/chapter12.ipynb
@@ -0,0 +1,172 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: Review of Centroids and Moments of Inertia "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2, page no. 833"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "find centroid C of the cross-sectional area.\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "A1 = 6*0.5 # Partial Area in in2\n",
+ "A2 = 20.8 # from table E1 and E3\n",
+ "A3 = 8.82 # from table E1 and E3\n",
+ "y1 = (18.47/2.0) + (0.5/2.0) # Distance between centroid C1 and C2\n",
+ "y2 = 0 # Distance between centroid C2 and C2\n",
+ "y3 = (18.47/2.0) + 0.649 # Distance between centroid C3 and C2\n",
+ "\n",
+ "#calculation\n",
+ "A = A1 + A2 + A3 # Area of entire cross section\n",
+ "Qx = (y1*A1) + (y2*A2) - (y3*A3) # First moment of entire cross section\n",
+ "y_bar = Qx/A # Distance between x-axis and centroid of the cross section\n",
+ "print \"The distance between x-axis and centroid of the cross section is \", round(-y_bar,2), \"inch\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The distance between x-axis and centroid of the cross section is 1.8 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.5, page no. 840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "evaluate moment of inertia Ic with respect to the horizontal axis C-C\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "A1 = 6*0.5 # Partial Area in in2\n",
+ "A2 = 20.8 # from table E1 and E3\n",
+ "A3 = 8.82 # from table E1 and E3\n",
+ "y1 = (18.47/2.0) + (0.5/2.0) # Distance between centroid C1 and C2\n",
+ "y2 = 0 # Distance between centroid C2 and C2\n",
+ "y3 = (18.47/2.0) + 0.649 # Distance between centroid C3 and C2\n",
+ "\n",
+ "#calculation\n",
+ "A = A1 + A2 + A3 # Area of entire cross section\n",
+ "Qx = (y1*A1) + (y2*A2) - (y3*A3) # First moment of entire cross section\n",
+ "y_bar = Qx/A # Distance between x-axis and centroid of the cross section\n",
+ "c_bar = -(y_bar)\n",
+ "\n",
+ "I1 = (6*0.5**3)/12.0 # Moment of inertia of A1 \n",
+ "I2 = 1170 # Moment of inertia of A2 from table E1\n",
+ "I3 = 3.94 # Moment of inertia of A3 from table E3\n",
+ "Ic1 = I1 + (A1*(y1+c_bar)**2) # Moment of inertia about C-C axis of area C1\n",
+ "Ic2 = I2 + (A2*(y2+c_bar)**2) # Moment of inertia about C-C axis of area C2\n",
+ "Ic3 = I3 + (A3*(y3-c_bar)**2) # Moment of inertia about C-C axis of area C3\n",
+ "Ic = Ic1 + Ic2 + Ic3 # Moment of inertia about C-C axis of whole area\n",
+ "print \"The moment of inertia of entire cross section area about its centroidal axis C-C\", round(Ic), \"in^4\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The moment of inertia of entire cross section area about its centroidal axis C-C 2200.0 in^4\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.7, page no. 851"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate orientations of the principal centroidal axes and the magnitudes\n",
+ "of the principal centroidal moments of inertia\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "Ix = 29.29e06 # Moment of inertia of crosssection about x-axis\n",
+ "Iy = 5.667e06 # Moment of inertia of crosssection about y-axis\n",
+ "Ixy = -9.336e06 # Moment of inertia of crosssection \n",
+ "\n",
+ "#calculation\n",
+ "tp1 = (numpy.degrees(numpy.arctan((-(2*Ixy)/(Ix-Iy)))))/2.0 # Angle definig a Principle axix\n",
+ "tp2 = 90 + tp1 \n",
+ "print \"The Principle axis is inclined at an angle\", round(tp1,2), \"degree\"\n",
+ "print \"Second angle of inclination of Principle axis is\", round(tp2,2), \"degree\"\n",
+ "Ix1 = (Ix+Iy)/2.0 + ((Ix-Iy)/2.0)*math.cos(math.radians(tp1)) - Ixy*math.sin(math.radians(tp1))\n",
+ "Ix2 = (Ix+Iy)/2.0 + ((Ix-Iy)/2.0)*math.cos(math.radians(tp2)) - Ixy*math.sin(math.radians(tp2))\n",
+ "print \"Principle Moment of inertia corresponding to tp1\", round(Ix1), \"mm^4\"\n",
+ "print \"Principle Moment of inertia corresponding to tp2\", round(Ix2), \"mm^4\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Principle axis is inclined at an angle 19.16 degree\n",
+ "Second angle of inclination of Principle axis is 109.16 degree\n",
+ "Principle Moment of inertia corresponding to tp1 31700001.0 mm^4\n",
+ "Principle Moment of inertia corresponding to tp2 22420295.0 mm^4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter2.ipynb b/Mechanics_of_Materials/chapter2.ipynb
new file mode 100644
index 00000000..c4e1ad0f
--- /dev/null
+++ b/Mechanics_of_Materials/chapter2.ipynb
@@ -0,0 +1,501 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2: Axially Loaded Members"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1, page no. 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculating the number of revolutions for the nut\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "W = 2.0 #lb\n",
+ "b = 10.5 #inch\n",
+ "c = 6.4 #inch\n",
+ "k = 4.2 #inch\n",
+ "p = 1.0/16.0 #inch\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "n = (W*b)/(c*k*p) #inch\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "print \" No. of revolution required = \", n, \"revolutions\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " No. of revolution required = 12.5 revolutions\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2, page no. 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "finding maximum allowable load\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "Fce_ = 2.0 #dummy variable\n",
+ "Fbd_ = 3.0 #dummy variable \n",
+ "Lbd = 480.0 #mm\n",
+ "Lce = 600.0 #mm\n",
+ "E = 205e6 #205Gpa\n",
+ "Abd = 1020.0 #mm\n",
+ "Ace = 520.0 #mm\n",
+ "\n",
+ "#calculation\n",
+ "Dbd_ = (Fbd_*Lbd)/(E*Abd) #dummy variable\n",
+ "Dce_ = (Fce_*Lce)/(E*Ace) #dummy variable\n",
+ "Da = 1 #limiting value\n",
+ "P = ((((450+225)/225)*(Dbd_ + Dce_) - Dce_ )**(-1)) * Da \n",
+ "Fce = 2*P # Real value in newton\n",
+ "Fbd = 3*P #real value in newton\n",
+ "Dbd = (Fbd*Lbd)/(E*Abd) #print lacement in mm\n",
+ "Dce = (Fce*Lce)/(E*Ace) # print lacement in mm\n",
+ "a = numpy.degrees(numpy.arctan(((Da+Dce)/675))) #alpha in degree\n",
+ "\n",
+ "#result\n",
+ "print \"alpha = \", round(a,2), \"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "alpha = 0.11 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3, page no. 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculation if vertical displacement\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "P1 = 2100.0 #lb\n",
+ "P2 = 5600.0 #lb\n",
+ "b = 25.0 #inch\n",
+ "a = 28.0 #inch\n",
+ "A1 = 0.25 #inch^2\n",
+ "A2 = 0.15 #inch^2\n",
+ "L1 = 20.0 #inch\n",
+ "L2 = 34.8 #inch\n",
+ "E = 29e6 #29Gpa\n",
+ "\n",
+ "#Calculations\n",
+ "P3 = (P2*b)/a \n",
+ "Ra = P3-P1\n",
+ "N1 = -Ra \n",
+ "N2 = P1 \n",
+ "D = ((N1*L1)/(E*A1)) + ((N2*L2)/(E*A2)) #print lacement\n",
+ "\n",
+ "#Result\n",
+ "print \"Downward print lacement is = \", D, \"inch\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Downward print lacement is = 0.0088 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6, page no. 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "obtaing formula and calculating allowable load\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Numerical calculation of allowable load\n",
+ "\n",
+ "d1 = 4.0 #mm\n",
+ "d2 = 3.0 #mm\n",
+ "A1 = (math.pi*(d1**2))/4 #area\n",
+ "A2 = (math.pi*(d2**2))/4 #area\n",
+ "L1 = 0.4 #meter\n",
+ "L2 = 0.3 #meter\n",
+ "E1 = 72e9 #Gpa\n",
+ "E2 = 45e9 #Gpa\n",
+ "f1 = L1/(E1*A1) * 1e6 # To cpmpensate for the mm**2\n",
+ "f2 = L2/(E2*A2) * 1e6 \n",
+ "s1 = 200e6 #stress\n",
+ "s2 = 175e6 #stress\n",
+ "\n",
+ "#Calculations\n",
+ "P1 = ( (s1*A1*(4*f1 + f2))/(3*f2) ) * 1e-6 # To cpmpensate for the mm**2\n",
+ "P2 = ( (s2*A2*(4*f1 + f2))/(6*f1) ) * 1e-6 \n",
+ "\n",
+ "#Result\n",
+ "print \"Newton Minimum allowable stress aomong the two P1 and P2 is smaller one, therefore MAS = \", P2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Newton Minimum allowable stress aomong the two P1 and P2 is smaller one, therefore MAS = 1264.49104307\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10, page no. 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate stress acting on inclined section &\n",
+ "the complete state of stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "P = 90000.0 #newton\n",
+ "A = 1200e-6 # meter^2\n",
+ "s_x = -P/A #stress\n",
+ "t_1 = 25.0 #for the stresses on ab and cd plane\n",
+ "\n",
+ "#Calculations\n",
+ "s_1 = s_x*(math.cos(math.radians(t_1))**2)\n",
+ "T_1 = -s_x*math.cos(math.radians(t_1))*math.sin(math.radians(t_1))\n",
+ "t_2 = -65.0 #for the stresses on ad and bc plane\n",
+ "s_2 = s_x*(math.cos(math.radians(t_2))**2)\n",
+ "T_2 = -s_x*math.cos(math.radians(t_2))*math.sin(math.radians(t_2))\n",
+ "\n",
+ "#Result\n",
+ "print \"The normal and shear stresses on the plane ab and cd are\", round((T_1/1E+6),2), round((s_1/1E+6),2), \"MPa respecively\" \n",
+ "print \"respecively The normal and shear stresses on the plane ad and bc are\", round((T_2/1E+6),2), round((s_2/1E+6),2), \"MPa respecively\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The normal and shear stresses on the plane ab and cd are 28.73 -61.6 MPa respecively\n",
+ "respecively The normal and shear stresses on the plane ad and bc are -28.73 -13.4 MPa respecively\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11, page no. 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculate the vertical displacement of the joint\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Value of s_x based on allowable stresses on glued joint\n",
+ "\n",
+ "#initialisation\n",
+ "s_t = -750.0 #psi\n",
+ "t = -50.0 #degree\n",
+ "T_t = -500.0 #psi\n",
+ "\n",
+ "sg_x_1 = s_t/(math.cos(math.radians(t))**2)\n",
+ "sg_x_2 = -T_t/(math.cos(math.radians(t))*math.sin(math.radians(t)))\n",
+ "\n",
+ "# Value of s_x based on allowable stresses on plastic\n",
+ "\n",
+ "sp_x_1 = -1100.0 #psi\n",
+ "T_t_p = 600.0 #psi\n",
+ "t_p = 45.0 #degree\n",
+ "sp_x_2 = -T_t_p/(math.cos(math.radians(t_p))*math.sin(math.radians(t_p)))\n",
+ "\n",
+ "# Minimum width of bar\n",
+ "\n",
+ "P = 8000.0 #lb\n",
+ "A = P/sg_x_2\n",
+ "b_min = math.sqrt(abs(A)) #inch\n",
+ "print \"The minimum width of the bar is\", round(b_min,2), \"inch\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum width of the bar is 2.81 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15, page no. 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Comparison of energy-absorbing capacity with different type of bolts\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "#Bolt with reduced shank diameter\n",
+ "\n",
+ "#initialisation\n",
+ "g = 1.50 # inch\n",
+ "d = 0.5 #inch\n",
+ "t = 0.25 #inch\n",
+ "d_r = 0.406 #inch\n",
+ "L = 13.5 #inch\n",
+ "\n",
+ "#calculation\n",
+ "ratio = ((g*(d**2))/(((g-t)*(d_r**2))+(t*(d**2)))) #U2/U1\n",
+ "\n",
+ "print \"The energy absorbing capacity of the bolts with reduced shank diameter\", round(ratio,2)\n",
+ "ratio_1 = ( (((L-t)*(d_r**2))+(t*(d**2))) / ((2*(g-t)*(d_r**2))+2*(t*(d**2))) ) #U3/2U1\n",
+ "print \"The energy absorbing capacity of the long bolts\", round(ratio_1,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy absorbing capacity of the bolts with reduced shank diameter 1.4\n",
+ "The energy absorbing capacity of the long bolts 4.18\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 2.16, page no. 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Determine the maximum elongation and tensile stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "# Maximum elongation\n",
+ "M = 20 #kg\n",
+ "g = 9.81 #m/s^2\n",
+ "L = 2 #meter\n",
+ "E = 210e9 #210Gpa\n",
+ "h = 0.15 #meter\n",
+ "diameter = 0.015 #milimeter\n",
+ "\n",
+ "#Calculations & Result\n",
+ "A = (math.pi/4)*(diameter**2) #area\n",
+ "D_st = ((M*g*L)/(E*A)) \n",
+ "D_max = D_st*(1+(1+(2*h/D_st))**0.5) \n",
+ "D_max_1 = math.sqrt(2*h*D_st) # another approach to find D_max\n",
+ "i = D_max / D_st # Impact factor\n",
+ "print \"Maximum elongation is\",round((D_max/1E-3),2), \"mm\" # Maximum tensile stress\n",
+ "s_max = (E*D_max)/L #Maximum tensile stress\n",
+ "s_st = (M*g)/A #static stress\n",
+ "i_1 = s_max / s_st #Impact factor \n",
+ "print \"Maximum tensile stress is \", round((s_max/1E+6),2), \"MPa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum elongation is 1.79 mm\n",
+ "Maximum tensile stress is 188.13 MPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.18, page no. 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "determine displacement at the lower end of bar in various conditions\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "#initialisation\n",
+ "P1 = 108000.0 #Newton\n",
+ "P2 = 27000.0 #Newton\n",
+ "L = 2.2 #meter\n",
+ "A = 480.0 #mm^2\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "# Displacement due to load P1 acting alone\n",
+ "s = (P1/A) #stress in MPa\n",
+ "e = (s/70000) + (1/628.2)*((s/260)**10) #strain\n",
+ "D_b = e*L*1e3 #elongation in mm\n",
+ "print \"elongation when only P1 load acting is = \", round(D_b,2), \" mm\"\n",
+ "\n",
+ "# Displacement due to load P2 acting alone\n",
+ "s_1 = (P2/A) #stress in MPa\n",
+ "e_1 = (s_1/70000) + (1/628.2)*((s_1/260)**10) #strain\n",
+ "D_b_1 = e_1*(L/2)*1e3 #elongation in mm (no elongation in lower half)\n",
+ "print \"elongation when only P2 load acting is = \", round(D_b_1,2), \" mm\"\n",
+ "\n",
+ "# Displacement due to both load acting simonmath.taneously\n",
+ "#upper half\n",
+ "s_2 = (P1/A) #stress in MPa\n",
+ "e_2 = (s_2/70000) + (1/628.2)*((s_2/260)**10) #strain\n",
+ "\n",
+ "#lower half\n",
+ "s_3 = (P1+P2)/A #stress in MPa\n",
+ "e_3 = (s_3/70000) + (1/628.2)*((s_3/260)**10) #strain\n",
+ "D_b_2 = ((e_2*L)/2 + (e_3*L)/2) * 1e3 # elongation in mm\n",
+ "print \"elongation when P1 and P2 both loads are acting is = \", round(D_b_2,2), \" mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "elongation when only P1 load acting is = 7.9 mm\n",
+ "elongation when only P2 load acting is = 0.88 mm\n",
+ "elongation when P1 and P2 both loads are acting is = 12.21 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter3.ipynb b/Mechanics_of_Materials/chapter3.ipynb
new file mode 100644
index 00000000..8c724325
--- /dev/null
+++ b/Mechanics_of_Materials/chapter3.ipynb
@@ -0,0 +1,561 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Torsion"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1, page no. 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculating maximum shear stress & torque\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d = 1.5 # diameter of bar in inch\n",
+ "L = 54.0 # Length of bar in inch\n",
+ "G = 11.5e06 # modulus of elasticity in psi \n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "# Part (a)\n",
+ "T = 250.0 # torque\n",
+ "t_max = (16*T*12)/(math.pi*(d**3)) # maximum shear stress in bar\n",
+ "Ip = (math.pi*(d**4))/32 # polar miment of inertia \n",
+ "f = (T*12*L)/(G*Ip) # twist in radian\n",
+ "f_ = (f*180)/math.pi # twist in degree\n",
+ "print \"Maximum shear stress in the bar is \", round(t_max), \" psi\"\n",
+ "print \"Angle of twist is\", round(f_,2), \" degree\"\n",
+ "\n",
+ "#Part (b)\n",
+ "t_allow = 6000 # allowable shear stress\n",
+ "T1 = (math.pi*(d**3)*t_allow)/16 #allowable permissible torque in lb-in\n",
+ "T1_ = T1*0.0831658 #allowable permissible torque in lb-ft\n",
+ "f_allow = (2.5*math.pi)/180 # allowable twist in radian\n",
+ "T2 = (G*Ip*f_allow)/L # allowable stress via a another method\n",
+ "T2_ = T2*0.0831658 #allowable permissible torque in lb-ft\n",
+ "T_max = min(T1_,T2_) # minimum of the two\n",
+ "print \"Maximum permissible torque in the bar is\", round(T_max), \" lb-ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum shear stress in the bar is 4527.0 psi\n",
+ "Angle of twist is 1.62 degree\n",
+ "Maximum permissible torque in the bar is 331.0 lb-ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, page no. 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculation of required diameter, outer diameter & ratio of diameteres\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "T = 1200.0 # allowable torque in N-m\n",
+ "t = 40e06 # allowable shear stress in Pa\n",
+ "f = (0.75*math.pi)/180.0 # allowable rate of twist in rad/meter\n",
+ "G = 78e09 # modulus of elasticity\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "# Part (a) : Solid shaft\n",
+ "d0 = ((16.0*T)/(math.pi*t))**(1.0/3.0)\n",
+ "Ip = T/(G*f) # polar moment of inertia\n",
+ "d01 = ((32.0*Ip)/(math.pi))**(1.0/4.0) # from rate of twist definition\n",
+ "print \"The required diameter of the solid shaft is \", round(d0,5), \"m\"\n",
+ "\n",
+ "# Part (b) : hollow shaft\n",
+ "d2 = (T/(0.1159*t))**(1.0/3.0) # Diamater of hollow shaft in meter\n",
+ "d2_ = (T/(0.05796*G*f))**(1.0/4.0) # Another value of d2 by definition of theta(allow), f = T/(G*Ip)\n",
+ "d1 = 0.8*d2_ # because rate of twist governs the design\n",
+ "print \"The required diameter of the hollow shaft is \", round(d2,5), \"m\"\n",
+ "\n",
+ "# Part (c) : Ratio of diameter and weight\n",
+ "r1 = d2_/d01 # diameter ratio\n",
+ "r2 = ((d2_**2.0)-(d1**2.0))/(d01**2.0) # Weight Ratio\n",
+ "print \"Ratio of the diameter of the hollow and solid shaft is\", round(r1,2)\n",
+ "print \"Ratio of the weight of the hollow and solid shaft is\", round(r2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The required diameter of the solid shaft is 0.05346 m\n",
+ "The required diameter of the hollow shaft is 0.06373 m\n",
+ "Ratio of the diameter of the hollow and solid shaft is 1.14\n",
+ "Ratio of the weight of the hollow and solid shaft is 0.47\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page number 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "(a)Compare shear stresses, angles of twist and weights\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1 = 0.6*1 #assumption for simplicity in calculations(for fig. a)\n",
+ "R2 = 1 #assumption for simplicity in calculations(for fig. b)\n",
+ "\n",
+ "#Calculations\n",
+ "Ip1 = (math.pi/2)*(1-(R1**4))\n",
+ "Ip2 = (math.pi*R2**4)/2\n",
+ "\n",
+ "B1 = Ip2/Ip1\n",
+ "B2 = Ip2/Ip1\n",
+ "\n",
+ "Wh = (math.pi*R2**2)*(1-R1**2)\n",
+ "Ws = math.pi*R2**2\n",
+ "B3 = Wh/Ws\n",
+ "\n",
+ "print \"Maximum shear stress in the hollow shaft to that in the solid shaft is\",round(B1,2)\n",
+ "print \"The ratio of the angles of twists is\",round(B2,2)\n",
+ "print \"The ratio of the weight of the hollow shaft to the weight of the solid shaft is\",B3\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum shear stress in the hollow shaft to that in the solid shaft is 1.15\n",
+ "The ratio of the angles of twists is 1.15\n",
+ "The ratio of the weight of the hollow shaft to the weight of the solid shaft is 0.64\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4, page no. 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "determining maximum shear stress in various parts of the shaft\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d = 0.03 # diameter of the shaft in meter\n",
+ "T2 = 450.0 # Torque in N-m\n",
+ "T1 = 275.0 \n",
+ "T3 = 175.0 \n",
+ "Lbc = 0.5 # Length of shaft in meter\n",
+ "Lcd = 0.4 # Length of shaft in meter\n",
+ "G = 80e09 # Modulus of elasticity\n",
+ "\n",
+ "#calculation\n",
+ "Tcd = T2-T1 # torque in segment CD\n",
+ "Tbc = -T1 # torque in segment BC\n",
+ "tcd = (16.0*Tcd)/(math.pi*(d**3)) # shear stress in cd segment\n",
+ "\n",
+ "print \"Shear stress in segment cd is\", round(tcd/1000000,1), \" MPa\"\n",
+ "tbc = (16.0*Tbc)/(math.pi*(d**3)) # shear stress in bc segment\n",
+ "\n",
+ "#answer given in the textbook for tbc is wrong\n",
+ "print \"Shear stress in segment bc is\", round(tbc/1000000,1), \" MPa\"\n",
+ "Ip = (math.pi/32)*(d**4) # Polar monent of inertia\n",
+ "fbc = (Tbc*Lbc)/(G*Ip) # angle of twist in radian\n",
+ "fcd = (Tcd*Lcd)/(G*Ip) # angle of twist in radian\n",
+ "fbd = fbc + fcd # angle of twist in radian\n",
+ "print \"Angles of twist in section BD\", round(fbd,3), \" radian\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shear stress in segment cd is 33.0 MPa\n",
+ "Shear stress in segment bc is -51.9 MPa\n",
+ "Angles of twist in section BD -0.011 radian\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6, page no. 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculate maximum shear, tensile & compressive stress in the tube.\n",
+ "Also, calculate coressponding strains in the tube\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation \n",
+ "d1 = 0.06 # Inner diameter in meter\n",
+ "d2 = 0.08 # Outer diameter in meter\n",
+ "r = d2/2.0 # Outer radius\n",
+ "G = 27e09 # Modulus of elasticity\n",
+ "T = 4000.0 # Torque in N-m\n",
+ "\n",
+ "#calculation\n",
+ "Ip = (math.pi/32)*((d2**4)-(d1**4)) # Polar moment of inertia\n",
+ "t_max = (T*r)/Ip # maximum shear stress\n",
+ "print \"Maximum shear stress in tube is \", t_max, \" Pa\"\n",
+ "s_t = t_max # Maximum tensile stress\n",
+ "print \"Maximum tensile stress in tube is \", s_t, \" Pa\"\n",
+ "s_c = -(t_max) # Maximum compressive stress\n",
+ "print \"Maximum compressive stress in tube is \", s_c, \" Pa\"\n",
+ "g_max = t_max / G # Maximum shear strain in radian\n",
+ "print \"Maximum shear strain in tube is \", round(g_max,4), \" radian\"\n",
+ "e_t = g_max/2.0 # Maximum tensile strain in radian\n",
+ "print \"radian\",e_t,\"Maximum tensile strain in tube is \", round(e_t,4), \" radian\"\n",
+ "e_c = -g_max/2.0 # Maximum compressive strain in radian\n",
+ "print \"Maximum compressive strain in tube is \", round(e_c,4), \" radian\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum shear stress in tube is 58205236.3308 Pa\n",
+ "Maximum tensile stress in tube is 58205236.3308 Pa\n",
+ "Maximum compressive stress in tube is -58205236.3308 Pa\n",
+ "Maximum shear strain in tube is 0.0022 radian\n",
+ "radian 0.00107787474687 Maximum tensile strain in tube is 0.0011 radian\n",
+ "Maximum compressive strain in tube is -0.0011 radian\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7, page no. 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Required diameters of the shaft at various rpm\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "H = 40.0 # Power in hp\n",
+ "s = 6000.0 # allowable shear stress in steel in psi\n",
+ "\n",
+ "#calculation\n",
+ "# Part (a)\n",
+ "n = 500.0 # rpm\n",
+ "T = ((33000.0*H)/(2*math.pi*n))*(5042.0/420.0) # Torque in lb-in\n",
+ "d = ((16.0*T)/(math.pi*s))**(1.0/3.0) # diameter in inch\n",
+ "print \"Diameter of the shaft at 500 rpm\", round(d,2), \" inch\"\n",
+ "\n",
+ "# Part (b)\n",
+ "n1 = 3000.0 # rpm\n",
+ "T1 = ((33000.0*H)/(2*math.pi*n1))*(5042.0/420.0) # Torque in lb-in\n",
+ "d1 = ((16*T1)/(math.pi*s))**(1.0/3.0) # diameter in inch\n",
+ "print \"Diameter of the shaft at 3000 rpm\", round(d1,2), \" inch\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter of the shaft at 500 rpm 1.62 inch\n",
+ "Diameter of the shaft at 3000 rpm 0.89 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8, page no. 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Find the maximum shear stress & angle of twist in the shaft\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "d = 0.05 # diameter of the shaft\n",
+ "Lab = 1.0 # Length of shaft ab in meter\n",
+ "Lbc = 1.2 # Length of shaft bc in meter\n",
+ "Pa = 50000.0 # Power in Watt at A\n",
+ "Pb = 35000.0 # Power in Watt at B\n",
+ "Ip = (math.pi/32)*(d**4) # Polar moment of inertia\n",
+ "Pc = 15000.0 # Power in Watt at C\n",
+ "G = 80e09 # Modulus of elasticity\n",
+ "f = 10.0 # frequency in Hz \n",
+ "\n",
+ "#Calculations\n",
+ "Ta = Pa/(2*math.pi*f) # Torque in N-m at A\n",
+ "Tb = Pb/(2*math.pi*f) # Torque in N-m at B\n",
+ "Tc = Pc/(2*math.pi*f) # Torque in N-m at B\n",
+ "Tab = Ta # Torque in N-m in shaft ab\n",
+ "Tbc = Tc # Torque in N-m in shaft bc\n",
+ "tab = (16*Tab)/(math.pi*(d**3)) # shear stress in ab segment\n",
+ "fab = (Tab*Lab)/(G*Ip) # angle of twist in radian\n",
+ "tbc = (16*Tbc)/(math.pi*(d**3)) # shear stress in ab segment\n",
+ "fbc = (Tbc*Lbc)/(G*Ip) # angle of twist in radian\n",
+ "fac = (fab+fbc)*(180.0/math.pi) # angle of twist in degree in segment ac\n",
+ "tmax = Tab # Maximum shear stress\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum shear stress tmax in the shaft\", round(tmax), \" Nm\"\n",
+ "print \"Angle of twist in segment AC\", round(fac,2), \" degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum shear stress tmax in the shaft 796.0 Nm\n",
+ "Angle of twist in segment AC 1.26 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10, page no. 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "for various loading cases, obtain formulae and calculate strain energy\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "Ta = 100.0 # Torque in N-m at A\n",
+ "Tb = 150.0 # Torque in N-m at B\n",
+ "L = 1.6 # Length of shaft in meter\n",
+ "G = 80e09 # Modulus of elasticity\n",
+ "Ip = 79.52e-09 # polar moment of inertia in m4\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "Ua = ((Ta**2)*L)/(2*G*Ip) # Strain energy at A\n",
+ "print \"Torque acting at free end\", round(Ua,2), \" joule\"\n",
+ "Ub = ((Tb**2)*L)/(4*G*Ip) # Strain energy at B\n",
+ "print \"Torque acting at mid point\", round(Ub,2), \" joule\"\n",
+ "a = (Ta*Tb*L)/(2*G*Ip) # dummy variabble\n",
+ "Uc = Ua+a+Ub # Strain energy at C\n",
+ "print \"Total torque\", round(Uc,2), \"joule\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Torque acting at free end 1.26 joule\n",
+ "Torque acting at mid point 1.41 joule\n",
+ "Total torque 4.56 joule\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11, page no. 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate the strain energy for hollow shaft\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "t = 480.0 # Torque of consmath.tant intensity\n",
+ "L = 144.0 # Length of bar\n",
+ "G = 11.5e06 # Modulus of elasticity in Psi\n",
+ "Ip = 17.18 # Polar moment of inertia\n",
+ "\n",
+ "#Calculation\n",
+ "U = ((t**2)*(L**3))/(G*Ip*6) # strain energy in in-lb\n",
+ "\n",
+ "#Result\n",
+ "print \"The strain energy for the hollow shaft is\", round(U), \"in-lb\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The strain energy for the hollow shaft is 580.0 in-lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.14, page no. 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Ratio of Shear stress and angle of twist for circular & square tube\n",
+ "\"\"\"\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 1 #assuming r = 1 for simplicity in calculations\n",
+ "\n",
+ "#Calculations\n",
+ "Am2 = (math.pi*r)**2/4\n",
+ "Am1 = math.pi*r**2\n",
+ "\n",
+ "T1_T2 = Am2/Am1\n",
+ "\n",
+ "t = 1 #assuming t = 1 for simplicity in calculations\n",
+ "J2 = ((math.pi*r)**3*t)/8\n",
+ "J1 = 2*math.pi*r**3*t\n",
+ "phi1_phi2 = J2/J1\n",
+ "\n",
+ "#Results\n",
+ "print \"Ratio of shear stress is \", round(T1_T2,2)\n",
+ "print \"Ratio of angle of twist is \", round(phi1_phi2, 2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Ratio of shear stress is 0.79\n",
+ "Ratio of angle of twist is 0.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter4.ipynb b/Mechanics_of_Materials/chapter4.ipynb
new file mode 100644
index 00000000..e9b7e3e0
--- /dev/null
+++ b/Mechanics_of_Materials/chapter4.ipynb
@@ -0,0 +1,116 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Shear Forces and Bending Moments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, page no. 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Finding shear force V and bending movement M at cross section D located 115 ft from left-hand behind support\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "q = 0.2 # Uniform load intensity in K/ft\n",
+ "P = 14 # Concentrated load in k\n",
+ "Ra = 11 # Reaction at A from wquation of equilibrium\n",
+ "Rb = 9 # Reaction at B from wquation of equilibrium\n",
+ "\n",
+ "#calculation\n",
+ "V = 11 - 14 - (0.2*15) # shear force in k\n",
+ "\n",
+ "print \"Shear force at section D\", V, \"k\"\n",
+ "M = (11*15)-(14*6)-(0.2*15*7.5) # Bending moment in K-ft\n",
+ "print \"Bending moment at section D\", M, \"k-ft\"\n",
+ "V1 = -9+(0.2*15) # Shear firce from alternative method in k\n",
+ "M1 = (9*9)-(0.2*7.5*15) # Bending moment from alternative method in k-ft"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shear force at section D -6.0 k\n",
+ "Bending moment at section D 58.5 k-ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Shear force and bending moments\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "q = 1 # Uniform load intensity in k/ft\n",
+ "M0 = 12 # Couple in k-ft\n",
+ "Rb = 5.25 # Reaction at B in k\n",
+ "Rc = 1.25 # Reaction at C in k\n",
+ "b = 4 # Length of section AB in ft\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "Mb = -(q*(b**2))/2 # Moment acting at B\n",
+ "\n",
+ "#Result\n",
+ "print \"Bending moment at B\", Mb, \"k-ft\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bending moment at B -8 k-ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter5.ipynb b/Mechanics_of_Materials/chapter5.ipynb
new file mode 100644
index 00000000..bd000d63
--- /dev/null
+++ b/Mechanics_of_Materials/chapter5.ipynb
@@ -0,0 +1,800 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Stresses in Beams Basic Topics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, page no. 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate radius of curvature, curvature & deflection of beam\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "L = 8.0 # length of beam in ft\n",
+ "h = 6.0 # Height of beam in inch\n",
+ "e = 0.00125 # elongation on the bottom surface of the beam\n",
+ "y = -3.0 # Dismath.tance of the bottom surface to the neutral surface of the beam in inch\n",
+ "\n",
+ "#Calculations\n",
+ "r = -(y/e) # Radius of curvature\n",
+ "print \"radius of curvature is\", round(r), \"inch\"\n",
+ "k = 1/r # curvature in in-1\n",
+ "print \"curvature\", round(k,5), \"ft-1\"\n",
+ "theta = numpy.degrees(numpy.arcsin(((L*12.0)/(2.0*r)))) # angle in degree\n",
+ "print \"Angle of twist\", round(theta,3), \"degree\"\n",
+ "my_del = r*(1-math.cos(math.radians(theta))) #Deflection in inch\n",
+ "print \"Deflection in the beam is \", round(my_del,4), \"inch\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "radius of curvature is 2400.0 inch\n",
+ "curvature 0.00042 ft-1\n",
+ "Angle of twist 1.146 degree\n",
+ "Deflection in the beam is 0.48 inch\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, page no. 315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Evaluate bending moment & maximum bending stress in the wire\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d = 0.004 # thickness of wire in m\n",
+ "R0 = 0.5 # radius of cylinder in m\n",
+ "E = 200e09 # Modulus of elasticity of steel\n",
+ "s = 1200e06 # proportional limit of steel\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "M = (math.pi*E*d**4)/(32*(2*R0+d)) # Bending moment in wire in N-m\n",
+ "print \"Bending moment in the wire is \", round(M,2), \"N-m\"\n",
+ "s_max = (E*d)/(2*R0+d) # Maximum bending stress in wire in Pa\n",
+ "print \"Maximum bending stress in the wire is %e\" %(s_max), \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bending moment in the wire is 5.01 N-m\n",
+ "Maximum bending stress in the wire is 7.968127e+08 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, page no. 316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "find maximum tensile and compressive stress in the beam\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "L = 22 # Span of beam in ft\n",
+ "q = 1.5 # Uniform load intensity in k/ft\n",
+ "P = 12 # Concentrated in k\n",
+ "b = 8.75 # width of cross section of beam in inch\n",
+ "h = 27 # height of cross section of beam in inch\n",
+ "Ra = 23.59 # Reaction at point A\n",
+ "Rb = 21.41 # Reacyion at point B\n",
+ "Mmax = 151.6 # Maximum bending moment\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "S = (b*h**2)/6 # Section modulus\n",
+ "s = (Mmax*12)/S # stress in k\n",
+ "st = s*1000 # Tensile stress\n",
+ "print \"Maximum tensile stress in the beam\", round(st), \"psi\"\n",
+ "sc = -s*1000 # Compressive stress\n",
+ "print \"Maximum compressive stress in the beam\", round(sc), \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress in the beam 1711.0 psi\n",
+ "Maximum compressive stress in the beam -1711.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4, page no. 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "because of uniform load in the beam, calculate maximum tensile & compressive stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "q = 3200.0 # Uniform load intensity in N/m\n",
+ "b = 0.3 # width of beam in m\n",
+ "h = 0.08 # Height of the beam in m\n",
+ "t = 0.012 # thickness of beam in m\n",
+ "Ra = 3600.0 # Reaction at A in N\n",
+ "Rb = 10800.0 # Reaction at B in N\n",
+ "Mpos = 2025.0 # Moment in Nm\n",
+ "Mneg = -3600.0 # Moment in Nm\n",
+ "\n",
+ "#calculation\n",
+ "y1 = t/2.0\n",
+ "A1 = (b-2*t)*t \n",
+ "y2 = h/2\n",
+ "A2 = h*t \n",
+ "A3 = A2 \n",
+ "c1 = ((y1*A1)+(2*y2*A2))/((A1)+(2*A2))\n",
+ "c2 = h - c1 \n",
+ "Ic1 = (b-2*t)*(t**3)*(1.0/12.0)\n",
+ "d1 = c1-(t/2.0)\n",
+ "Iz1 = (Ic1)+(A1*(d1**2))\n",
+ "Iz2 = 956600e-12\n",
+ "Iz3 = Iz2 \n",
+ "Iz = Iz1 + Iz2 + Iz3 # Moment of inertia of the beam cross section\n",
+ "\n",
+ "# Section Modulli\n",
+ "S1 = Iz / c1 # for the top surface\n",
+ "S2 = Iz / c2 # for the bottom surface\n",
+ "\n",
+ "# Maximum stresses for the positive section\n",
+ "st = Mpos / S2 \n",
+ "print \"Maximum tensile stress in the beam in positive section is\", st, \"Pa\"\n",
+ "sc = -Mpos / S1 \n",
+ "print \"Maximum compressive stress in the beam in positive section is\", sc, \"Pa\"\n",
+ "\n",
+ "# Maximum stresses for the negative section\n",
+ "snt = -Mneg / S1 \n",
+ "print \"Maximum tensile stress in the beam in negative section is\", snt, \"Pa\"\n",
+ "snc = Mneg / S2 \n",
+ "print \"Maximum compressive stress in the beam in negative section is\", snc, \"Pa\"\n",
+ "\n",
+ "# Conclusion\n",
+ "st_max = st\n",
+ "sc_max = snc"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress in the beam in positive section is 50468539.6422 Pa\n",
+ "Maximum compressive stress in the beam in positive section is -15157118.8248 Pa\n",
+ "Maximum tensile stress in the beam in negative section is 26945989.0219 Pa\n",
+ "Maximum compressive stress in the beam in negative section is -89721848.2528 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exampe 5.5, page no. 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "choose a suitable size for the beam\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "L = 12 # Length of beam in ft\n",
+ "q = 420 # Uniform load intensity in lb/ft\n",
+ "s = 1800 # Allowable bending stress in psi\n",
+ "w = 35 # weight of wood in lb/ft3\n",
+ "\n",
+ "#calculation\n",
+ "M = (q*L**2*12)/8 # Bending moment in lb-in\n",
+ "S = M/s # Section Modulli in in3\n",
+ "\n",
+ "# From Appendix F\n",
+ "q1 = 426.8 # New uniform load intensity in lb/ft\n",
+ "S1 = S*(q1/q) # New section modulli in in3\n",
+ "\n",
+ "# From reference to appendix F, a beam of cross section 3*12 inch is selected\n",
+ "print (\"Beam of crosssection 3*12 is sufficient\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beam of crosssection 3*12 is sufficient\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6, page no. 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "find min. req. diameter of the woodpost & req. outer diameter of aluminum tube\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "P = 12000 # Lataeral load at the upper end in N\n",
+ "h = 2.5 # Height of post in m\n",
+ "Mmax = P*h # Maximum bending moment in Nm\n",
+ "\n",
+ "#calculation\n",
+ "# Part (a) : Wood Post\n",
+ "s1 = 15e06 # Maximum allowable stress in Pa\n",
+ "S1 = Mmax/s1 # Section Modulli in m3\n",
+ "d1 = ((32.0*S1)/math.pi)**(1.0/3.0) # diameter in m\n",
+ "print \"the minimum required diameter d1 of the wood post is\", round(d1,3), \"m\"\n",
+ "\n",
+ "# Part (b) : Alluminium tube\n",
+ "s2 = 50e06 # Maximum allowable stress in Pa\n",
+ "S2 = Mmax/s2 # Section Modulli in m3\n",
+ "d2 = (S2/0.06712)**(1.0/3.0) # diameter in meter.....(1) \n",
+ "print \"minimum required outer diameter d2 of the aluminum tube is\", round(d2,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the minimum required diameter d1 of the wood post is 0.273 m\n",
+ "minimum required outer diameter d2 of the aluminum tube is 0.208 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7, page no. 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "evaluate and select a structural steel beam of wide-flange shape to support the loads\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "q = 2000.0 # Uniform load intensity in lb/ft\n",
+ "s = 18000.0 # Maximum allowable load in Psi\n",
+ "Ra = 18860.0 # Reaction at point A\n",
+ "Rb = 17140.0 # Reaction at point B\n",
+ "\n",
+ "#calculation\n",
+ "x1 = Ra/q # Distance in ft from left end to the point of zero shear\n",
+ "Mmax = (Ra*x1)-((q*(x1**2))/2.0) # Maximum bending moment in lb-ft\n",
+ "S = (Mmax*12.0)/s # Section Modulli in in3\n",
+ "\n",
+ "# Trial Beam\n",
+ "Ra_t = 19380.0 # Reaction at point A\n",
+ "Rb_t = 17670.0 # Reaction at point B\n",
+ "\n",
+ "#in Python the value for x1 differes by some points and hence the subsequent results differ\n",
+ "x1_t = Ra_t/q # Distance in ft from left end to the point of zero shear\n",
+ "Mmax_t = (Ra_t*x1_t)-((q*(x1_t**2))/2.0) # Maximum bending moment in lb-ft\n",
+ "S_t = (Mmax_t*12.0)/s # Section Modulli in in3\n",
+ "# From table E beam 12*50 is selected \n",
+ "print \"Beam of crosssection 12*50 is selected with section modulli\", round(S_t,2), \"in^3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beam of crosssection 12*50 is selected with section modulli 62.6 in^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8, page 329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "find min. req. dimension of the posts\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation \n",
+ "g = 9810 # Specific weight of water in N/m3\n",
+ "h = 2 # Height of dam in m\n",
+ "s = 0.8 # Dismath.tance between square cross section in m\n",
+ "sa = 8e06 # Maximum allowable stress in Pa\n",
+ "\n",
+ "#Calculations\n",
+ "b = ((g*(h**3)*s)/sa)**(1.0/3.0) # Dimension of croossection in m\n",
+ "\n",
+ "#Result\n",
+ "print \"the minimum required dimension b of the posts\", round(b,3), \"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the minimum required dimension b of the posts 0.199 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11, page no. 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "find normal & shear stress at point C\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "L = 3 # Span of beam in ft\n",
+ "q = 160 # Uniform load intensity in lb/in\n",
+ "b = 1 # Width of cross section\n",
+ "h = 4 # Height of cross section\n",
+ "\n",
+ "# Calculations from chapter 4\n",
+ "Mc = 17920 # Bending moment in ld-in\n",
+ "Vc = -1600 # Loading in lb\n",
+ "I = (b*(h**3))/12.0 # Moment of inertia in in4\n",
+ "sc = -(Mc*1)/I # Compressive stress at point C in psi\n",
+ "Ac = 1*1 # Area of section C in inch2\n",
+ "yc = 1.5 # dismath.tance between midlayers od section C and cross section of beam\n",
+ "Qc = Ac*yc # First moment of C cross section in inch3\n",
+ "tc = (Vc*Qc)/(I*b) # Shear stress in Psi\n",
+ "print \"Normal stress at C\", sc, \"psi\"\n",
+ "print \"Shear stress at C\", tc, \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Normal stress at C -3360.0 psi\n",
+ "Shear stress at C -450.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.12, page no. 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate max. permissible value\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "s = 11e06 # allowable tensile stress in pa\n",
+ "t = 1.2e06 # allowable shear stress in pa\n",
+ "b = 0.1 # Width of cross section in m\n",
+ "h = 0.15 # Height of cross section in m\n",
+ "a = 0.5 # in m\n",
+ "\n",
+ "#Calculations\n",
+ "P_bending = (s*b*h**2)/(6.0*a) # Bending stress in N\n",
+ "P_shear = (2*t*b*h)/3.0 # shear stress in N\n",
+ "Pmax = P_bending # Because bending stress governs the design\n",
+ "\n",
+ "#Result\n",
+ "print \"the maximum permissible value Pmax of the loads\", Pmax, \"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the maximum permissible value Pmax of the loads 8250.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.13, page no. 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "evaluate max. shear stress in the pole & diameter of solid pole\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "d2 = 4 # Outer diameter in inch\n",
+ "d1 = 3.2 # Inner diameter in inch\n",
+ "r2 = d2/2 # Outer radius in inch\n",
+ "r1 = d1/2 # inner radius in inch\n",
+ "P = 1500 # Horizontal force in lb\n",
+ "\n",
+ "#calculation\n",
+ "# Part (a)\n",
+ "t_max = ((r2**2+(r2*r1)+r1**2)*4*P)/(3*math.pi*((r2**4)-(r1**4))) # Mximum shear stress in Psi\n",
+ "print \"Maximum shear stress in the pole is\", round(t_max), \"psi\"\n",
+ "\n",
+ "# Part (b)\n",
+ "d0 = math.sqrt((16*P)/(3*math.pi*t_max)) # Diameter of solid circular cross section in meter\n",
+ "print \"Diameter of solid circular cross section is \", round(d0,2), \"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum shear stress in the pole is 658.0 psi\n",
+ "Diameter of solid circular cross section is 1.97 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.14, page no. 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum shear stress, minimum shear stress, and total shear force in the web.\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#initialisation\n",
+ "b = 0.165 # in m\n",
+ "h = 0.320 # in m\n",
+ "h1 = 0.290 # in m\n",
+ "t = 0.0075 # in m\n",
+ "V = 45000.0 # Vertical force in N\n",
+ "\n",
+ "#calculation\n",
+ "I = (1.0/12.0)*((b*(h**3))-(b*(h1**3))+(t*(h1**3))) # Moment of inertia of the cros section\n",
+ "t_max = (V/(8.0*I*t))*((b*(h**2))-(b*(h1**2))+(t*(h1**2))) # Maximum shear stress in Pa\n",
+ "t_min = ((V*b)/(8*I*t))*(h**2-h1**2) # Minimum shear stress in Pa\n",
+ "T = ((t*h1)/3.0)*(2*t_max + t_min) # Total shear force in Pa\n",
+ "t_avg = V/(t*h1) # Average shear stress in Pa\n",
+ "\n",
+ "#Result\n",
+ "print \"Maximum shear stress in the web is\", round(t_max,2), \"Pa\"\n",
+ "print \"Minimum shear stress in the web is\", round(t_min,2), \"Pa\"\n",
+ "print \"Total shear stress in the web is\", round(T,2), \"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum shear stress in the web is 20985785.26 Pa\n",
+ "Minimum shear stress in the web is 17359517.46 Pa\n",
+ "Total shear stress in the web is 43015.04 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.15, page no. 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "find shear stress at top of the web\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "V = 10000 # Vertical shear force in lb\n",
+ "b = 4 # in inch\n",
+ "t = 1 # in inch\n",
+ "h = 8 # in inch\n",
+ "h1 = 7 # in inch\n",
+ "\n",
+ "#calculation\n",
+ "A = b*(h-h1) + t*h1 # Area of cross section \n",
+ "Qaa = ((h+h1)/2.0)*b*(h-h1) + (h1/2.0)*(t*h1) # First moment of cross section\n",
+ "c2 = Qaa/A # Position of neutral axis in inch\n",
+ "c1 = h-c2 # Position of neutral axis in inch\n",
+ "Iaa = (b*h**3)/3.0 - ((b-t)*h1**3)/3.0 # Moment of inertia about the line aa\n",
+ "I = Iaa - A*c2**2 # Moment of inertia of crosssection\n",
+ "Q1 = b*(h-h1)*(c1-((h-h1)/2.0)) # First moment of area above the line nn\n",
+ "t1 = (V*Q1)/(I*t) # Shear stress at the top of web in Psi\n",
+ "Qmax = (t*c2)*(c2/2.0) # Maximum first moment of inertia below neutral axis\n",
+ "t_max = (V*Qmax)/(I*t) # Maximum Shear stress in Psi\n",
+ "\n",
+ "#Result\n",
+ "print \"Shear stress at the top of the web is\", round(t1), \"psi\"\n",
+ "print \"Maximum Shear stress in the web is\", round(t_max), \"Psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shear stress at the top of the web is 1462.0 psi\n",
+ "Maximum Shear stress in the web is 1762.0 Psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.16, page no. 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum permissible longitudinal spacing of the screws\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "Af = 40*180 # Area of flange in mm2\n",
+ "V = 10500 # Shear force acting on cross section\n",
+ "F = 800 # Allowable load in shear\n",
+ "df = 120 # Dismath.tance between centroid of flange and neutral axis in mm\n",
+ "\n",
+ "#calculation\n",
+ "Q = Af*df # First moment of cross section of flange\n",
+ "I = (1.0/12.0)*(210*280**3) - (1.0/12.0)*(180*200**3) # Moment of inertia of entire cross section in mm4\n",
+ "f = (V*Q)/I # Shear flow\n",
+ "s = (2*F)/f # Spacing between the screw\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum permissible longitudinal spacing s of the screws is\", round(s,1), \"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum permissible longitudinal spacing s of the screws is 46.6 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.17, page no. 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum tensile and compressive stress in the beam\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "L = 60 # Length of beam in inch\n",
+ "d = 5.5 # dismath.tance from the point of application of the load P to the longitudinal axis of the tube in inch\n",
+ "b = 6 # Outer dimension of tube in inch\n",
+ "A = 20 # Area of cross section of tube in inch\n",
+ "I = 86.67 # Moment of inertia in in4\n",
+ "P = 1000 # in lb\n",
+ "theta = 60 # in degree\n",
+ "Ph = P*math.sin(math.radians(60)) # Horizontal component\n",
+ "Pv = P*math.cos(math.radians(60)) # Vertical component\n",
+ "\n",
+ "#Calculations\n",
+ "M0 = Ph*d # Moment in lb-in\n",
+ "y = -3 # Point at which maximum tensile stress occur in inch\n",
+ "N = Ph # Axial force\n",
+ "M = 9870 # Moment in lb-in\n",
+ "st_max = (N/A)-((M*y)/I) # Maximum tensile stress in Psi\n",
+ "yc = 3 # in inch\n",
+ "M1 = 5110 # moment in lb-in\n",
+ "sc_left = (N/A)-((M*yc)/I) # Stress at the left of point C in Psi\n",
+ "sc_right = -(M1*yc)/I # Stress at the right of point C in Psi\n",
+ "sc_max = min(sc_left,sc_right) # Because both are negative quantities\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum compressive stress in the beam is\", round(sc_max), \"psi\"\n",
+ "print \"The maximum tensile stress in the beam is\", round(st_max), \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum compressive stress in the beam is -298.0 psi\n",
+ "The maximum tensile stress in the beam is 385.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter6.ipynb b/Mechanics_of_Materials/chapter6.ipynb
new file mode 100644
index 00000000..344830c9
--- /dev/null
+++ b/Mechanics_of_Materials/chapter6.ipynb
@@ -0,0 +1,444 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Stresses in Beams Advanced Topics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, page no. 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "largest tensile and compressive stresses in the wood & the max. and min. tensile stresses in the steel\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "# 4*6 inch wood beam dimension\n",
+ "# 4*0.5 inch steel beam dimension\n",
+ "M = 60.0 # Moment in k-in\n",
+ "E1 = 1500. # in Ksi\n",
+ "E2 = 30000.0 # in Ksi\n",
+ "h1 = 5.031 # Distance between top surface and neutral axis of the beam in inch by solving 1500*(h1-3)*24 + 30000*(h1-6.25)*2 = 0\n",
+ "\n",
+ "#calculation\n",
+ "h2 = 6.5 - h1 \n",
+ "I1 = (1.0/12.0)*(4*6**3) + (4*6)*(h1-3)**2 # Momeny of inertia of the wooden cross section\n",
+ "I2 = (1.0/12.0)*(4*0.5**3) + (4*0.5)*(h2-0.25)**2 # Momeny of inertia of the steel cross section\n",
+ "I = I1 + I2 # Moment of inertia of whole cross section\n",
+ "\n",
+ "# Material 1\n",
+ "s1a = -(M*h1*E1)/((E1*I1)+(E2*I2)) # Maximum compressive stress in ksi where y = h1\n",
+ "s1c = -(M*(-(h2-0.5))*E1)/((E1*I1)+(E2*I2)) # Maximum tensile stress in ksi where y = -(h2-0.5)\n",
+ "print \"Maximum compressive stress in wood is\", round(s1a,3)*1000, \"psi\"\n",
+ "print \"Maximum tensile stress in wood is\", round(s1c,3)*1000, \"psi\"\n",
+ "\n",
+ "# Material 2\n",
+ "s2a = -(M*(-h2)*E2)/((E1*I1)+(E2*I2)) # Maximum tensile stress in ksi where y = -h2\n",
+ "s2c = -(M*(-(h2-0.5))*E2)/((E1*I1)+(E2*I2)) # Minimum tensile stress in ksi where y = -(h2-0.5)\n",
+ "print \"Maximum tensile stress in steel is\", round(s2a,3)*1000, \"psi\"\n",
+ "print \"Minimum tensile stress in steel is\", round(s2c,3)*1000, \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum compressive stress in wood is -1305.0 psi\n",
+ "Maximum tensile stress in wood is 251.0 psi\n",
+ "Maximum tensile stress in steel is 7622.0 psi\n",
+ "Minimum tensile stress in steel is 5028.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2, page no. 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum tensile and compressive stresses in the faces and the core using: general theory for composite beams and \n",
+ "approximate theory for sandwich beams\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "M = 3000 # moment in N-m\n",
+ "t = 0.005 # thickness of alluminiun in m\n",
+ "E1 = 72e09 # Modulus of elasticity of alluminium in Pa\n",
+ "E2 = 800e06 # Modulus of elasticity of Plastic core in Pa\n",
+ "b = 0.2 # Width of cross section in m\n",
+ "h = 0.160 # Height of cross section in m\n",
+ "hc = 0.150 # Height of Plastic core cross section in m\n",
+ "\n",
+ "#calculation\n",
+ "I1 = (b/12.0)*(h**3 - hc**3) # Moment of inertia of alluminium cross section\n",
+ "I2 = (b/12.0)*(hc**3) # Moment of inertia of Plastic core cross section\n",
+ "f = (E1*I1) + (E2*I2) # Flexural rigidity of the cross section\n",
+ "s1_max = (M*(h/2.0)*E1)/f \n",
+ "s1c = -s1_max # Maximum compressive stress in alluminium core in Pa\n",
+ "s1t = s1_max # Maximum tensile stress in alluminium core in Pa\n",
+ "print \"Maximum compressive stress on alluminium face by the general theory for composite beams is\", s1c, \"Pa\"\n",
+ "print \"Maximum tensile stress on alluminium face by the general theory for composite beams is\", s1t, \"Pa\"\n",
+ "s2_max = (M*(hc/2.0)*E2)/f \n",
+ "s2c = -s2_max # Maximum compressive stress in Plastic core in Pa\n",
+ "s2t = s2_max # Maximum tensile stress in Plastic core in Pa\n",
+ "print \"Maximum compressive stress in plastic core by the general theory for composite beams is\", s2c, \"Pa\"\n",
+ "print \"Maximum tensile stress in plastic core by the general theory for composite beams is\", s2t, \"Pa\"\n",
+ "\n",
+ "# Part (b) : Calculation from approximate theory of sandwitch\n",
+ "s1_max1 = (M*h)/(2*I1) \n",
+ "s1c1 = -s1_max1 # Maximum compressive stress in alluminium core in Pa\n",
+ "s1t1 = s1_max1 # Maximum tensile stress in alluminium core in Pa\n",
+ "print \"Maximum compressive stress on alluminium core by approximate theory of sandwitch is\", s1c1, \"Pa\"\n",
+ "print \"Maximum tensile stress on alluminium core by approximate theory of sandwitch is\", s1t1, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum compressive stress on alluminium face by the general theory for composite beams is -18984838.497 Pa\n",
+ "Maximum tensile stress on alluminium face by the general theory for composite beams is 18984838.497 Pa\n",
+ "Maximum compressive stress in plastic core by the general theory for composite beams is -197758.734344 Pa\n",
+ "Maximum tensile stress in plastic core by the general theory for composite beams is 197758.734344 Pa\n",
+ "Maximum compressive stress on alluminium core by approximate theory of sandwitch is -19972260.749 Pa\n",
+ "Maximum tensile stress on alluminium core by approximate theory of sandwitch is 19972260.749 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, page no. 407"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate largest tensile & compressive stresses in the wood\n",
+ "also, the maximum and minimum tensile stresses in the steel\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "# 4*6 inch wood beam dimension\n",
+ "# 4*0.5 inch steel beam dimension\n",
+ "M = 60.0 # Moment in k-in\n",
+ "E1 = 1500.0 # in Ksi\n",
+ "E2 = 30000.0 # in Ksi\n",
+ "b = 4.0 # width of crosssection in inch\n",
+ "\n",
+ "#calculation\n",
+ "# Transformed Section\n",
+ "n = E2/E1 # Modular ratio\n",
+ "b1 = n*4 # Increased width of transformed cross section\n",
+ "\n",
+ "# Neutral axis\n",
+ "h1 = ((3*4*6)+(80*0.5*6.25))/((4*6)+(80*0.5)) # Dismath.tance between top surface and neutral axis of the beam in inch\n",
+ "h2 = 6.5 - h1 # in inch\n",
+ "\n",
+ "# Moment of inertia\n",
+ "It = (1.0/12.0)*(4*6**3) + (4*6)*(h1-3)**2 + (1.0/12.0)*(80*0.5**3) + (80*0.5)*(h2-0.25)**2 # Moment of inertia of transformed cross section\n",
+ "\n",
+ "# Material 1\n",
+ "s1a = -(M*h1)/It # Maximum tensile stress in ksi where y = h1\n",
+ "s1c = -(M*(-(h2-0.5)))/It # Maximum compressive stress in ksi where y = -(h2-0.5)\n",
+ "print \"Maximum tensile stress in wood is\", s1a*1000, \"psi\"\n",
+ "print \"Maximum compressive stress in wood is\", s1c*1000, \"psi\"\n",
+ "\n",
+ "# Material 2\n",
+ "s2a = -(M*(-h2)*n)/It # Maximum tensile stress in ksi where y = -h2\n",
+ "s2c = -(M*(-(h2-0.5)*n))/It # Minimum tensile stress in ksi where y = -(h2-0.5)\n",
+ "print \"Maximum tensile stress in steel\", s2a*1000, \"psi\"\n",
+ "print \"Minimum tensile stress in steel\", s2c*1000, \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress in wood is -1305.28781191 psi\n",
+ "Maximum compressive stress in wood is 251.328709125 psi\n",
+ "Maximum tensile stress in steel 7620.9350509 psi\n",
+ "Minimum tensile stress in steel 5026.57418251 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4,page no. 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum tensile and compressive stresses in the beam\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "q = 3000.0 # Uniform load intensity in N/m\n",
+ "a = 26.57 # tilt of the beam in degree\n",
+ "b = 0.1 # width of the beam\n",
+ "h = 0.15 # height of the beam\n",
+ "L = 1.6 # Span of the beam\n",
+ "\n",
+ "#calculation\n",
+ "qy = q*math.cos(math.radians(a)) # Component of q in y direction\n",
+ "qz = q*math.sin(math.radians(a)) # Component of q in z direction\n",
+ "My = (qz*L**2.0)/8.0 # Maximum bending moment in y direction\n",
+ "Mz = (qy*L**2.0)/8.0 # Maximum bending moment in z direction\n",
+ "Iy = (h*b**3.0)/12.0 # Moment of inertia along y\n",
+ "Iz = (b*h**3.0)/12.0 # Moment of inertia alon z\n",
+ "s = ((3*q*L**2)/(4*b*h))*((math.sin(math.radians(a))/b)+(math.cos(math.radians(a))/h))\n",
+ "sc = -s # Maximum compressive stress\n",
+ "st = s # Maximum tensile stress\n",
+ "print \"Maximum compressive stress in the beam is\", sc, \"Pa\"\n",
+ "print \"Maximum tensile stress in the beam is\", st, \"Pa\"\n",
+ "\n",
+ "# Neutral axis\n",
+ "l = (h/b)**2\n",
+ "t = math.sin(math.radians(a)/math.cos(math.radians(a)))\n",
+ "j = l*(math.sin(math.radians(a)/math.cos(math.radians(a))))\n",
+ "be = math.degrees((numpy.arctan((j)))) # Inclination of Neutral axis to z axis\n",
+ "print \"Inclination of Neutral axis to z axis is\", round(be,2), \"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum compressive stress in the beam is -4007231.57248 Pa\n",
+ "Maximum tensile stress in the beam is 4007231.57248 Pa\n",
+ "Inclination of Neutral axis to z axis is 48.11 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, page no. 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum bending stresses in the beam for various conditions\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "import numpy \n",
+ "\n",
+ "#initialisation\n",
+ "L = 12.0 # Length of the beam in ft\n",
+ "P = 10.0 # Load in k acting in vertical direction\n",
+ "\n",
+ "#Part (a)\n",
+ "h = 24.0 # Height of beam in inch\n",
+ "Iz = 2100 # Moment of inertia along z axis in in4\n",
+ "Iy = 42.2 # Moment of inertia along y axis in in4\n",
+ "\n",
+ "#calculation\n",
+ "s_max = (P*(h/2.0)*L*12)/Iz # Maximum stress in Ksi\n",
+ "print \"Maximum tensile stress in the beam at the top of the beam\", round(s_max*1000), \"psi\"\n",
+ "print \"Maximum compressive stress in the beam at the bottom of the beam\", round(-s_max*1000), \"psi\"\n",
+ "\n",
+ "#Part (b)\n",
+ "a = 1 # Angle between y axis and the load\n",
+ "My = -(P*math.sin(math.radians(a)))*L*12 # Moment along y-axis in K-in\n",
+ "Mz = -(P*math.cos(math.radians(a)))*L*12 # Moment along z-axis in K-in\n",
+ "ba = math.radians(numpy.arctan(((My*Iz)/(Mz*Iy)))) # Orientation of neutral axis\n",
+ "z = -3.5\n",
+ "y = 12.0 # Coordinates of the point A and B where maximum stress occur\n",
+ "s = ((My*z)/Iy)-((Mz*y)/Iz) # Stress in Ksi\n",
+ "sa = s # Tensile stress at A\n",
+ "sb = -s # Compressive stress in B\n",
+ "print \"The tensile stress at A is\", round(sa*1000), \"psi\"\n",
+ "print \"The compressive stress at B is\", round(sb*1000), \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress in the beam at the top of the beam 8229.0 psi\n",
+ "Maximum compressive stress in the beam at the bottom of the beam -8229.0 psi\n",
+ "The tensile stress at A is 10312.0 psi\n",
+ "The compressive stress at B is -10312.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, page no. 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "the bending stresses at points A and B\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "M = 15 # Bending moment in k-in\n",
+ "t = 10 # Angle between line of action of moment and z-axis\n",
+ "\n",
+ "# Properties of cross section\n",
+ "c = 0.634 # Location of centroid on the axis of symmetry\n",
+ "Iy = 2.28 # Moment of inertia in y-direction in in4\n",
+ "Iz = 67.4 # Moment of inertia in z-direction in in4\n",
+ "ya = 5\n",
+ "za = -2.6+0.634 # Coordinates of point A\n",
+ "yb = -5\n",
+ "zb = 0.634 # Coordinates of point B\n",
+ "My = M*math.sin(math.radians(t)) # Moment along y-axis\n",
+ "Mz = M*math.cos(math.radians(t)) # Moment along z-axis\n",
+ "sa = ((My*za)/Iy)-((Mz*ya)/Iz) # Bending stress at point A in ksi\n",
+ "sb = ((My*zb)/Iy)-((Mz*yb)/Iz) # Bending stress at point B in ksi\n",
+ "print \"The bending stress at point A is\", round(sa*1000), \"psi\"\n",
+ "print \"The bending stress at point B is\", round(sb*1000), \"psi\"\n",
+ "\n",
+ "# Neutral axis\n",
+ "j = (Iz/Iy)*(math.sin(math.radians(t)/math.cos(math.radians(t))))\n",
+ "be = numpy.degrees(numpy.arctan((j))) # Inclination of neutral axis to z-axis in degree\n",
+ "print \"Inclination of neutral axis to z-axis is\", round(be,1), \"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The bending stress at point A is -3342.0 psi\n",
+ "The bending stress at point B is 1820.0 psi\n",
+ "Inclination of neutral axis to z-axis is 79.1 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.9, page no. 448"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate magnitude of the moment M\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialization\n",
+ "b = 5 # in inch\n",
+ "b1 = 4 # in inch\n",
+ "h = 9 # in inch\n",
+ "h1 = 7.5 # in inch\n",
+ "sy = 33 # stress along y axis in ksi\n",
+ "\n",
+ "#Calculations\n",
+ "M = (sy/12.0)*((3*b*h**2)-(b+(2*b1))*(h1**2)) # Bending moment acting in k-in\n",
+ "\n",
+ "#Result\n",
+ "print \"the magnitude of the moment M is\", round(M), \"k-in\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the magnitude of the moment M is 1330.0 k-in\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter7.ipynb b/Mechanics_of_Materials/chapter7.ipynb
new file mode 100644
index 00000000..7d4a1be4
--- /dev/null
+++ b/Mechanics_of_Materials/chapter7.ipynb
@@ -0,0 +1,465 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Analysis of Stress and Strain"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, page no. 472"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate stresses acting on an element inclined at 45\u00b0\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "# Let x1, y1 be the transformed direction inclined at 45 deegree to the original\n",
+ "sx = 16000 # Direct stress in x-direction in psi\n",
+ "sy = 6000 # Direct stress in y-direction \"\"\n",
+ "txy = 4000 # Shear stress in y-direction \"\"\n",
+ "tyx = txy # Shear stress in x-direction \"\"\n",
+ "t = 45 # Inclination pf plane in degree \n",
+ "\n",
+ "#calculation\n",
+ "sx1 = (sx+sy)/2 + ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) + txy*math.sin(math.radians(2*t)) # Direct stress in x1-direction in psi\n",
+ "sy1 = (sx+sy)/2 - ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) - txy*math.sin(math.radians(2*t)) # Direct stress in y1-direction in psi\n",
+ "tx1y1 = - ((sx-sy)*(math.sin(math.radians(2*t))/2.0)) + txy*math.cos(math.radians(2*t)) # Shear stress in psi\n",
+ "\n",
+ "print \"The direct stress on the element in x1-direction is\", sx1, \"psi\"\n",
+ "print \"The direct stress on the element in y1-direction is\", sy1, \"psi\"\n",
+ "print \"The shear stress on the element\", tx1y1, \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The direct stress on the element in x1-direction is 15000.0 psi\n",
+ "The direct stress on the element in y1-direction is 7000.0 psi\n",
+ "The shear stress on the element -5000.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, page no. 473"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "stresses acting on an element that is oriented at a clockwise 15\u00b0 \n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "# Let x1, y1 be the transformed direction inclined at 15 deegree to the original\n",
+ "sx = -46e06 # Direct stress in x-direction in Pa\n",
+ "sy = 12e06 # Direct stress in y-direction \"\"\n",
+ "txy = -19e06 # Shear stress in y-direction \"\"\n",
+ "t = -15 # Inclination of plane in degree \n",
+ "\n",
+ "#calculation\n",
+ "sx1 = (sx+sy)/2.0 + ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) + txy*math.sin(math.radians(2*t)) # Direct stress in x1-direction in Pa\n",
+ "sy1 = (sx+sy)/2.0 - ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) - txy*math.sin(math.radians(2*t)) # Direct stress in y1-direction in Pa\n",
+ "tx1y1 = -((sx-sy)*(math.sin(math.radians(2*t))/2.0)) + txy*math.cos(math.radians(2*t)) # Shear stress in Pa\n",
+ "\n",
+ "\n",
+ "print \"The direct stress on the element in x1-direction is\", sx1, \"Pa\"\n",
+ "print \"The direct stress on the element in y1-direction is\", sy1, \"Pa\"\n",
+ "print \"The shear stress on the element\", tx1y1, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The direct stress on the element in x1-direction is -32614736.7097 Pa\n",
+ "The direct stress on the element in y1-direction is -1385263.29025 Pa\n",
+ "The shear stress on the element -30954482.6719 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.3, page no. 481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Calculate shear stress and principal stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "ax = 12300.0\n",
+ "ay = -4200.0\n",
+ "txy = -4700.0\n",
+ "\n",
+ "tan_2p = round((2*txy)/(ax-ay), 4)\n",
+ "\n",
+ "theta_p1 = 150.3\n",
+ "theta_p2 = 330.3\n",
+ "\n",
+ "stress1 = (ax+ay)/2.0\n",
+ "stress2 = (ax-ay)/2.0\n",
+ "a1 = stress1 + math.sqrt((stress2**2.0)+(txy**2.0))\n",
+ "a2 = stress1 - math.sqrt((stress2**2.0)+(txy**2.0))\n",
+ "\n",
+ "#python calculations differ a bit. hence, differences in the answer\n",
+ "print \"Principal stesses are \", round(a1), \"psi and \", round(a2), \" psi\"\n",
+ "\n",
+ "tmax = math.sqrt((stress2**2.0)+(txy**2.0))\n",
+ "print \"Maximum shear stress is \", round(tmax), \" psi\"\n",
+ "\n",
+ "a_aver = (ax+ay)/2.0\n",
+ "\n",
+ "print \"Normal stress acting at maximum shear stress = \", round(a_aver), \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Principal stesses are 13545.0 psi and -5445.0 psi\n",
+ "Maximum shear stress is 9495.0 psi\n",
+ "Normal stress acting at maximum shear stress = 4050.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, page no. 492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "stresses acting on an element inclined at 30\u00b0 \n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "sx = 90e06 # Direct stress in x-direction in Pa\n",
+ "sy = 20e06 # Direct stress in y-direction in Pa\n",
+ "t = 30 # Inclination of element in degree\n",
+ "\n",
+ "#calculation\n",
+ "savg = (sx+sy)/2.0 # Average in-plane direct stress\n",
+ "txy = 0 \n",
+ "R = math.sqrt(((sx-sy)/2)**2+(txy)**2) # Radius of mohr circle\n",
+ "\n",
+ "# Point D at 2t = 60\n",
+ "sx1 = savg + R*math.cos(math.radians(2*t)) # Direct stress at point D \n",
+ "tx1y1 = -R*math.sin(math.radians(2*t)) # shear stress at point D\n",
+ "print \"The direct stress at point D is\", sx1, \"Pa\"\n",
+ "print \"The shear stress at point D is\", tx1y1, \"Pa\"\n",
+ "\n",
+ "# Point D at 2t = 240\n",
+ "sx2 = savg + R*math.cos(math.radians(90 + t)) # Direct stress at point D \n",
+ "tx2y2 = R*math.sin(math.radians(90 + t)) # shear stress at point D\n",
+ "print \"The direct stress at point D_desh is\", sx2, \"Pa\"\n",
+ "print \"The shear stress at point D_desh is\", tx2y2, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The direct stress at point D is 72500000.0 Pa\n",
+ "The shear stress at point D is -30310889.1325 Pa\n",
+ "The direct stress at point D_desh is 37500000.0 Pa\n",
+ "The shear stress at point D_desh is 30310889.1325 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5, page no. 494"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "stresses acting on an element, principal stress, max. shear stress\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "#initialisation \n",
+ "sx = 15000 # Direct stress in x-direction in psi\n",
+ "sy = 5000 # Direct stress in y-direction \"\"\n",
+ "txy = 4000 # Shear stress in y-direction \"\"\n",
+ "savg = (sx+sy)/2.0 # Average in-plane direct stress\n",
+ "sx1 = 15000 # Stress acting on face at theta = 0 degree\n",
+ "tx1y1 = 4000 # Stress acting on face at theta = 0 degree\n",
+ "sx1_ = 5000 \n",
+ "tx1y1_ = -4000 \n",
+ "\n",
+ "#calculation\n",
+ "R = math.sqrt(((sx-sy)/2)**2+(txy)**2) # Radius of mohr circle\n",
+ "\n",
+ "# Part (a)\n",
+ "t = 40 # Inclination of the plane in degree\n",
+ "f1 = numpy.degrees(numpy.arctan((4000.0/5000.0))) # Angle between line CD and x1-axis\n",
+ "f2 = 80 - f1 # Angle between line CA and x1-axis\n",
+ "\n",
+ "# Point D \n",
+ "sx1 = savg + R*math.cos(math.radians(f2)) # Direct stress at point D \n",
+ "tx1y1 = -R*math.sin(math.radians(f2)) # shear stress at point D\n",
+ "print \"The shear stress at point D\", round(tx1y1), \"psi\"\n",
+ "\n",
+ "# Point D' \n",
+ "sx2 = savg - R*math.cos(math.radians(f2)) # Direct stress at point D' \n",
+ "tx2y2 = R*math.sin(math.radians(f2)) # shear stress at point D'\n",
+ "print \"The direct stres at point D_desh\", round(sx2), \"psi\"\n",
+ "\n",
+ "#Part (b)\n",
+ "sp1 = savg + R # Maximum direct stress in mohe circle (at point P1)\n",
+ "tp1 = f1/2 # Inclination of plane of maximum direct stress\n",
+ "print \"with angle\",round(tp1,2) , \"degree The maximum direct stress at P1 is \",sp1 , \"psi\"\n",
+ "sp2 = savg - R # Minimum direct stress in mohe circle (at point P2)\n",
+ "tp2 = (f1+180)/2 # Inclination of plane of minimum direct stress\n",
+ "print \"with angle\", round(tp2,2), \"degree The maximum direct stress at P2 is \",sp2 , \"psi\"\n",
+ "\n",
+ "# Part (c)\n",
+ "tmax = R # Maximum shear stress in mohe circle\n",
+ "ts1 = -(90 - f1)/2.0 # Inclination of plane of maximum shear stress\n",
+ "print \"with plane incilation of\", tmax, \"psi The Maximum shear stress is \", round(ts1,2), \"deegree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The shear stress at point D -4229.0 psi\n",
+ "The direct stres at point D_desh 5193.0 psi\n",
+ "with angle 19.33 degree The maximum direct stress at P1 is 16403.1242374 psi\n",
+ "with angle 109.33 degree The maximum direct stress at P2 is 3596.87576257 psi\n",
+ "with plane incilation of 6403.12423743 psi The Maximum shear stress is -25.67 deegree\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6, Page number 497"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "use Mohr\u2019s circle, to calculate various quantities\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "\n",
+ "sx = -50e06 # Direct stress in x-direction in psi\n",
+ "sy = 10e06 # Direct stress in y-direction \"\"\n",
+ "txy = -40e06 # Shear stress in y-direction \"\"\n",
+ "savg = (sx+sy)/2 # Average in-plane direct stress\n",
+ "sx1 = -50e06\n",
+ "tx1y1 = -40e06 # Stress acting on face at theta = 0 degree\n",
+ "sx1_ = 10e06\n",
+ "tx1y1_ = 40e06 # Stress acting on face at theta = 0 degree\n",
+ "\n",
+ "#calculation\n",
+ "R = math.sqrt(((sx-sy)/2)**2+(txy)**2) # Radius of mohr circle\n",
+ "\n",
+ "# Part (a)\n",
+ "t = 45 # Inclination of the plane in degree\n",
+ "f1 = numpy.degrees(numpy.arctan((40e06/30e06))) # Angle between line CD and x1-axis\n",
+ "f2 = 90 - f1 # Angle between line CA and x1-axis\n",
+ "\n",
+ "# Point D \n",
+ "sx1 = savg - R*math.cos(math.radians(f2)) # Direct stress at point D \n",
+ "tx1y1 = R*math.sin(math.radians(f2)) # shear stress at point D\n",
+ "print \"The direct stres at point D\", sx1, \"Pa\"\n",
+ "print \"The shear stress at point D\", tx1y1, \"Pa\"\n",
+ "\n",
+ "# Point D' \n",
+ "sx2 = savg + R*math.cos(math.radians(f2)) # Direct stress at point D' \n",
+ "tx2y2 = -R*math.sin(math.radians(f2)) # shear stress at point D'\n",
+ "print \"The direct stres at point D_desh\", sx2, \"Pa\"\n",
+ "print \"The shear stress at point D_desh\", tx2y2, \"Pa\"\n",
+ "\n",
+ "#Part (b)\n",
+ "sp1 = savg + R # Maximum direct stress in mohe circle (at point P1)\n",
+ "tp1 =(f1+180)/2 # Inclination of plane of maximum direct stress\n",
+ "print \"with angle\", round(tp1,2), \"degree\", \"The maximum direct stress at P1 is \", sp1, \"Pa\" \n",
+ "sp2 = savg - R # Minimum direct stress in mohe circle (at point P2)\n",
+ "tp2 = f1/2 # Inclination of plane of minimum direct stress\n",
+ "print \"with angle\", round(tp2,2), \"degree\", \"The maximum direct stress at P2 is \", sp2, \"Pa\"\n",
+ "\n",
+ "# Part (c)\n",
+ "tmax = R # Maximum shear stress in mohe circle\n",
+ "ts1 = (90 + f1)/2 # Inclination of plane of maximum shear stress\n",
+ "print \"with plane incilation of\", round(ts1,2), \"degree\", \"The Maximum shear stress is \", tmax, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The direct stres at point D -60000000.0 Pa\n",
+ "The shear stress at point D 30000000.0 Pa\n",
+ "The direct stres at point D_desh 20000000.0 Pa\n",
+ "The shear stress at point D_desh -30000000.0 Pa\n",
+ "with angle 116.57 degree The maximum direct stress at P1 is 30000000.0 Pa\n",
+ "with angle 26.57 degree The maximum direct stress at P2 is -70000000.0 Pa\n",
+ "with plane incilation of 71.57 degree The Maximum shear stress is 50000000.0 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7, page no. 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate various quantities\n",
+ "\"\"\"\n",
+ "\n",
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "\n",
+ "ex = 340e-06 # Strain in x-direction\n",
+ "ey = 110e-06 # Strain in y-direction\n",
+ "txy = 180e-06 # shear strain\n",
+ "\n",
+ "\n",
+ "# Part (a)\n",
+ "t = 30 # Inclination of the element in degree\n",
+ "ex1 = (ex+ey)/2.0 + ((ex-ey)/2.0)*math.cos(math.radians(2*t)) + (txy/2.0)*(math.sin(math.radians(2*t))) # Strain in x1 direction (located at 30 degree)\n",
+ "tx1y1 = 2*(-((ex-ey)/2.0)*math.sin(math.radians(2*t)) + (txy/2.0)*(math.cos(math.radians(2*t)))) # Shear starin\n",
+ "ey1 = ex+ey-ex1 # Strain in y1 direction (located at 30 degree)\n",
+ "print \"Strain in x1 direction (located at 30 degree) is\", round((ex1/1E-6),2),\"* 10^-6\"\n",
+ "print \"shear strain is\", round((tx1y1/1E-6),2),\"* 10^-6\"\n",
+ "print \"Strain in y1 direction (located at 30 degree) is\", ey1\n",
+ "\n",
+ "# Part (b)\n",
+ "e1 = (ex+ey)/2.0 + math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Principle stress\n",
+ "e2 = (ex+ey)/2.0 - math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Principle stress\n",
+ "tp1 = (0.5)*numpy.degrees(numpy.arctan((txy/(ex-ey)))) # Angle to principle stress direction\n",
+ "tp2 = 90 + tp1 # Angle to principle stress direction\n",
+ "e1 = (ex+ey)/2.0 + ((ex-ey)/2.0)*math.cos(math.radians(2*tp1)) + (txy/2.0)*(math.sin(math.radians(2*tp1))) # Principle stress via another method\n",
+ "e2 = (ex+ey)/2.0 + ((ex-ey)/2.0)*math.cos(math.radians(2*tp2)) + (txy/2.0)*(math.sin(math.radians(2*tp2))) # Principle stress via another method\n",
+ "print \"with angle\", round(tp1,2), \"degree\",\"The Principle stress is \", round(e1,4)\n",
+ "print \"with angle\",round(tp2,2), \"degree\",\"The Principle stress is \",round(e2,4)\n",
+ "\n",
+ "# Part (c)\n",
+ "tmax = 2*math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Maxmum shear strain\n",
+ "ts = tp1 + 45 # Orientation of element having maximum shear stress \n",
+ "tx1y1_ = 2*( -((ex-ey)/2)*math.sin(math.radians(2*ts)) + (txy/2)*(math.cos(math.radians(2*ts)))) # Shear starin assosiated with ts direction\n",
+ "print \"with angle\",round(ts,2), \"degree\",\"The Maximum shear strain is \",round(tx1y1_,4)\n",
+ "eavg = (e1+e2)/2.0 # Average atrain\n",
+ "print \"The average strain is\", eavg"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Strain in x1 direction (located at 30 degree) is 360.44 * 10^-6\n",
+ "shear strain is -109.19 * 10^-6\n",
+ "Strain in y1 direction (located at 30 degree) is 8.95577136594e-05\n",
+ "with angle 19.02 degree The Principle stress is 0.0004\n",
+ "with angle 109.02 degree The Principle stress is 0.0001\n",
+ "with angle 64.02 degree The Maximum shear strain is -0.0003\n",
+ "The average strain is 0.000225\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter8.ipynb b/Mechanics_of_Materials/chapter8.ipynb
new file mode 100644
index 00000000..9dcf70eb
--- /dev/null
+++ b/Mechanics_of_Materials/chapter8.ipynb
@@ -0,0 +1,516 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Applications of Plane Stress Pressure Vessels Beams and Combined Loadings"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1, page no. 546"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "finding max. permissible pressures at various conditions\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d = 18 # inner idameter of the hemisphere in inch\n",
+ "t = 1.0/4.0 # thickness of the hemisphere in inch\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "# Part (a)\n",
+ "sa = 14000 # Allowable tensile stress in Psi\n",
+ "Pa = (2*t*sa)/(d/2.0) # Maximum permissible air pressure in Psi\n",
+ "print \"Maximum permissible air pressure in the tank (Part(a)) is\", round(Pa,1), \"psi\"\n",
+ "\n",
+ "# Part (b)\n",
+ "sb = 6000 # Allowable shear stress in Psi\n",
+ "Pb = (4*t*sb)/(d/2.0) # Maximum permissible air pressure in Psi\n",
+ "print \"Maximum permissible air pressure in the tank (Part(b)) is\", round(Pb,1), \"psi\"\n",
+ "\n",
+ "# Part (c)\n",
+ "e = 0.0003 # Allowable Strain in Outer sufrface of the hemisphere\n",
+ "E = 29e06 # Modulus of epasticity of the steel in Psi\n",
+ "v = 0.28 # Poissions's ratio of the steel\n",
+ "Pc = (2*t*E*e)/((d/2.0)*(1-v)) # Maximum permissible air pressure in Psi\n",
+ "print \"Maximum permissible air pressure in the tank (Part(c)) is\", round(Pc,1), \"psi\"\n",
+ "\n",
+ "# Part (d)\n",
+ "Tf = 8100 # failure tensile load in lb/in \n",
+ "n = 2.5 # Required factor of safetty against failure of the weld\n",
+ "Ta = Tf / n # Allowable load in ld/in \n",
+ "sd = (Ta*(1))/(t*(1)) # Allowable tensile stress in Psi\n",
+ "Pd = (2*t*sd)/(d/2.0) # Maximum permissible air pressure in Psi\n",
+ "print \"Maximum permissible air pressure in the tank (Part(d)) is\", round(Pd,1), \"psi\"\n",
+ "\n",
+ "# Part (e)\n",
+ "Pallow = Pb \n",
+ "print \"Maximum permissible air pressure in the tank (Part(e)) is\", round(Pb,1) ,\"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum permissible air pressure in the tank (Part(a)) is 777.8 psi\n",
+ "Maximum permissible air pressure in the tank (Part(b)) is 666.7 psi\n",
+ "Maximum permissible air pressure in the tank (Part(c)) is 671.3 psi\n",
+ "Maximum permissible air pressure in the tank (Part(d)) is 720.0 psi\n",
+ "Maximum permissible air pressure in the tank (Part(e)) is 666.7 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2, page no. 552"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculating various quantities for cylindrical part of vessel\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "a = 55 # Angle made by helix with longitudinal axis in degree\n",
+ "r = 1.8 # Inner radius of vessel in m\n",
+ "t = 0.02 # thickness of vessel in m\n",
+ "E = 200e09 # Modulus of ealsticity of steel in Pa\n",
+ "v = 0.3 # Poission's ratio of steel \n",
+ "P = 800e03 # Pressure inside the tank in Pa\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "# Part (a)\n",
+ "s1 = (P*r)/t # Circumferential stress in Pa\n",
+ "s2 = (P*r)/(2*t) # Longitudinal stress in Pa\n",
+ "\n",
+ "print \"Circumferential stress is \", s1, \"Pa\"\n",
+ "print \"Longitudinal stress is \", s2, \"Pa\"\n",
+ "\n",
+ "# Part (b)\n",
+ "t_max_z = (s1-s2)/2.0 # Maximum inplane shear stress in Pa\n",
+ "t_max = s1/2.0 # Maximum out of plane shear stress in Pa\n",
+ "\n",
+ "print \"Maximum inplane shear stress is \", t_max_z, \"Pa\"\n",
+ "print \"Maximum inplane shear stress is \", t_max, \"Pa\"\n",
+ "\n",
+ "# Part (c)\n",
+ "e1 = (s1/(2*E))*(2-v) # Strain in circumferential direction \n",
+ "e2 = (s2/E)*(1-(2*v)) # Strain in longitudinal direction\n",
+ "\n",
+ "print \"Strain in circumferential direction is %e\"%(e1)\n",
+ "print \"Strain in longitudinal direction is \", e2\n",
+ "\n",
+ "# Part (d)\n",
+ "# x1 is the direction along the helix\n",
+ "theta = 90 - a \n",
+ "sx1 = ((P*r)/(4*t))*(3-math.cos(math.radians(2*theta))) # Stress along x1 direction\n",
+ "tx1y1 = ((P*r)/(4*t))*(math.sin(math.radians(2*theta))) # Shear stress in x1y1 plane\n",
+ "sy1 = s1+s2-sx1 # Stress along y1 direction\n",
+ "\n",
+ "print \"Stress along y1 direction is \", sy1\n",
+ "\n",
+ "# Mohr Circle Method\n",
+ "savg = (s1+s2)/2.0 # Average stress in Pa\n",
+ "R = (s1 - s2 )/2.0 # Radius of Mohr's Circle in Pa\n",
+ "sx1_ = savg - R*math.cos(math.radians(2*theta)) # Stress along x1 direction\n",
+ "tx1y1_ = R*math.sin(math.radians(2*theta)) # Shear stress in x1y1 plane\n",
+ "print \"Stress along x1 direction is \", sx1_, \"Pa\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Circumferential stress is 72000000.0 Pa\n",
+ "Longitudinal stress is 36000000.0 Pa\n",
+ "Maximum inplane shear stress is 18000000.0 Pa\n",
+ "Maximum inplane shear stress is 36000000.0 Pa\n",
+ "Strain in circumferential direction is 3.060000e-04\n",
+ "Strain in longitudinal direction is 7.2e-05\n",
+ "Stress along y1 direction is 60156362.5799\n",
+ "Stress along x1 direction is 47843637.4201 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3, page no. 562"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "principal stresses and maximum shear stresses at cross section\n",
+ "\"\"\"\n",
+ "\n",
+ "%pylab inline\n",
+ "from matplotlib import *\n",
+ "from pylab import *\n",
+ "import numpy\n",
+ "\n",
+ "#initialisation\n",
+ "L = 6.0 # Span of the beam in ft\n",
+ "P = 10800 # Pressure acting in lb\n",
+ "c = 2.0 # in ft\n",
+ "b = 2.0 # Width of cross section of the beam in inch\n",
+ "h = 6.0 # Height of the cross section of the beam in inch\n",
+ "x = 9.0 # in inch\n",
+ "\n",
+ "#calculation\n",
+ "Ra = P/3.0 # Reaction at point at A\n",
+ "V = Ra # Shear force at section mn \n",
+ "M = Ra*x # Bending moment at the section mn\n",
+ "I = (b*h**3)/12.0 # Moment of inertia in in4\n",
+ "y = linspace(-3, 3, 61)\n",
+ "sx = -(M/I)*y # Normal stress on crossection mn\n",
+ "Q = (b*(h/2-y))*(y+((((h/2.0)-y)/2.0))) # First moment of recmath.tangular cross section\n",
+ "txy = (V*Q)/(I*b) # Shear stress acting on x face of the stress element\n",
+ "s1 = (sx/2.0)+numpy.sqrt((sx/2.0)**2+(txy)**2) # Principal Tesile stress on the cross section\n",
+ "s2 = (sx/2.0)-numpy.sqrt((sx/2.0)**2+(txy)**2) # Principal Compressive stress on the cross section\n",
+ "tmax = numpy.sqrt((sx/2)**2+(txy)**2) # Maximum shear stress on the cross section\n",
+ "plot(sx,y,'o',color='c')\n",
+ "plot(txy,y,'+',color='m')\n",
+ "plot(s1,y,'--',color='y')\n",
+ "plot(s2,y,'<',color='k')\n",
+ "plot(tmax,y,label=\"Maximum shear stress on cross section\")\n",
+ "legend()\n",
+ "show()\n",
+ "#print \"Principal Tesile stress on the cross section\", s1, \"psi\"\n",
+ "#print \"Principal Compressive stress on the cross section\", s2, \"psi\"\n",
+ "\n",
+ "# Conclusions \n",
+ "s1_max = 14400.0 # Maximum tensile stress in Psi\n",
+ "txy_max = 900.0 # Maximum shear stress in Psi\n",
+ "t_max = 14400.0/2.0 # Largest shear stress at 45 degree plane"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEACAYAAABWLgY0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYlOX+x/H3sKuAIASIKLiloriVx9xRM1KzXLJyS8tO\nq0vl8XeyXLDSTmXHaDmVlcs5mpUWbSYtIpZatrhhkRoCiooruLHD/ftjmnGAYRiYGWbh+7ourwtm\nnnme+5mB25vPfOf7aJRSCiGEEC7Jzd4DEEIIYTsyyQshhAuTSV4IIVyYTPJCCOHCZJIXQggXJpO8\nEEK4MIsm+cLCQnr16kWPHj249tpreeyxx6w1LiGEEFagsbROvqCggEaNGlFaWkr//v157rnnGDx4\nsLXGJ4QQwgIWxzWNGjUCoLi4mLKyMkJDQy0elBBCCOuweJIvLy+ne/fuhIaGMn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sWYKDgzlz5gwhISFA7V5Dw9WivZWU\nlDBu3DgmTZrE6NGjAdc7R4CmTZsycuRIdu3aZfPzsyiuycjI0H9t+IGoESNG8MEHH1BaWkp2djYH\nDhzgb3/7Gy1btsTNzY09e/YAsG7dOoYPH65/zNq1a/X76tOnjz4Pt5ekpCReeOEFPvvsM3x8fPS3\nu8r5GTLMz13x/Az16tWLAwcOcPz4cUpKSvjwww/15+FsDJ/3tWvXMmLECP3t5r6GusfYm/qrS2h0\ndHSFNimuco7nzp3TX0C+oKCAb775hpiYGNufnyXvFI8ZM0Z17dpVderUSY0YMUKdOHFCf9+SJUtU\np06dVOfOnVVSUpL+9l9++UV1795dRUdHq5kzZ+pvLywsVOPHj1ddunRRffr0URkZGZYMzSratWun\nWrVqpbp37666d++uHnroIf19rnB+H3/8sYqIiFA+Pj4qNDRU3Xzzzfr7XOH8TPnyyy9V586dVadO\nndTSpUvtPRyz3HXXXap58+bK09NTRUREqJUrV6pz586pG2+8UcXExKhhw4ap3Nxc/fa1fQ3t7fvv\nv1cajUZ169ZN/zu3efNmlznH/fv3q+7du6tu3bqpDh06qMWLFyullM3PTz4MJYQQLswx/54WQghh\nFTLJCyGEC5NJXgghXJhM8kII4cJkkhdCCBcmk7wQQrgwmeSFEMKFySQvhBAu7P8BMfbstPHLNmYA\nAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x263ff90>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4, page no. 570"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "maximum tensile stress, maximum compressive stress, and maximum shear stress in the shaft.\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d = 0.05 # Diameter of shaft in m\n",
+ "T = 2400 # Torque transmitted by the shaft in N-m\n",
+ "P = 125000 # Tensile force\n",
+ "\n",
+ "#calculation\n",
+ "s0 = (4*P)/(math.pi*d**2) # Tensile stress in\n",
+ "t0 = (16*T)/(math.pi*d**3) # Shear force \n",
+ "# Stresses along x and y direction\n",
+ "sx = 0 \n",
+ "sy = s0 \n",
+ "txy = -t0 \n",
+ "s1 = (sx+sy)/2.0 + math.sqrt(((sx-sy)/2.0)**2 + (txy)**2) # Maximum tensile stress \n",
+ "s2 = (sx+sy)/2.0 - math.sqrt(((sx-sy)/2.0)**2 + (txy)**2) # Maximum compressive stress \n",
+ "tmax = math.sqrt(((sx-sy)/2)**2 + (txy)**2) # Maximum in plane shear stress \n",
+ "print \"Maximum tensile stress %e\" %s1, \"Pa\"\n",
+ "print \"Maximum compressive stress %e\" %s2, \"Pa\"\n",
+ "print \"Maximum in plane shear stress %e \" %tmax, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress 1.346662e+08 Pa\n",
+ "Maximum compressive stress -7.100421e+07 Pa\n",
+ "Maximum in plane shear stress 1.028352e+08 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5, page no. 573"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "calculate maximum allowable internal pressure\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "#initialisation\n",
+ "P = 12 # Axial load in K\n",
+ "r = 2.1 # Inner radius of the cylinder in inch\n",
+ "t = 0.15 # Thickness of the cylinder in inch\n",
+ "ta = 6500 # Allowable shear stress in Psi\n",
+ "\n",
+ "#calculation\n",
+ "p1 = (ta - 3032)/3.5 # allowable internal pressure\n",
+ "p2 = (ta + 3032)/3.5 # allowable internal pressure\n",
+ "p3 = 6500/7.0 # allowable internal pressure\n",
+ "\n",
+ "prs_allowable = min(p1,p2,p3) # Minimum pressure would govern the design\n",
+ "print \"Maximum allowable internal pressure \", round(prs_allowable), \"psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum allowable internal pressure 929.0 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6, page no. 574"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "principal stresses and maximum shear stresses\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "d1 = 0.18 # Inner diameter of circular pole in m\n",
+ "d2 = 0.22 # Outer diameter of circular pole in m\n",
+ "P = 2000 # Pressure of wind in Pa\n",
+ "b = 1.5 # Distance between centre line of pole and board in m\n",
+ "h = 6.6 # Distance between centre line of board and bottom of the ploe in m\n",
+ "\n",
+ "#calculation\n",
+ "W = P*(2*1.2) # Force at the midpoint of sign \n",
+ "V = W # Load\n",
+ "T = W*b # Torque acting on the pole\n",
+ "M = W*h # Moment at the bottom of the pole\n",
+ "I = (math.pi/64.0)*(d2**4-d1**4) # Momet of inertia of cross section of the pole\n",
+ "sa = (M*d2)/(2*I) # Tensile stress at A \n",
+ "Ip = (math.pi/32.0)*(d2**4-d1**4) # Polar momet of inertia of cross section of the pole\n",
+ "t1 = (T*d2)/(2*Ip) # Shear stress at A and B\n",
+ "r1 = d1/2.0 # Inner radius of circular pole in m\n",
+ "r2 = d2/2.0 # Outer radius of circular pole in m\n",
+ "A = math.pi*(r2**2-r1**2) # Area of the cross section\n",
+ "t2 = ((4*V)/(3*A))*((r2**2 + r1*r2 +r1**2)/(r2**2+r1**2)) # Shear stress at point B \n",
+ "\n",
+ "# Principle stresses \n",
+ "sxa = 0\n",
+ "sya = sa\n",
+ "txya = t1\n",
+ "sxb = 0\n",
+ "syb = 0\n",
+ "txyb = t1+t2 \n",
+ "\n",
+ "# Stresses at A\n",
+ "s1a = (sxa+sya)/2.0 + math.sqrt(((sxa-sya)/2)**2 + (txya)**2) # Maximum tensile stress \n",
+ "s2a = (sxa+sya)/2.0 - math.sqrt(((sxa-sya)/2)**2 + (txya)**2) # Maximum compressive stress \n",
+ "tmaxa = math.sqrt(((sxa-sya)/2)**2 + (txya)**2) # Maximum in plane shear stress\n",
+ "\n",
+ "print \"Maximum tensile stress at point A is\", s1a, \"Pa\"\n",
+ "print \"Maximum compressive stress at point A is\", s2a, \"Pa\"\n",
+ "print \"Maximum in plane shear stress at point A is\", tmaxa, \"Pa\"\n",
+ "\n",
+ "# Stress at B \n",
+ "s1b = (sxb+syb)/2.0 + math.sqrt(((sxb-syb)/2)**2 + (txyb)**2) # Maximum tensile stress \n",
+ "s2b = (sxb+syb)/2.0 - math.sqrt(((sxb-syb)/2)**2 + (txyb)**2) # Maximum compressive stress \n",
+ "tmaxb = math.sqrt(((sxb-syb)/2.0)**2 + (txyb)**2) # Maximum in plane shear stress \n",
+ "print \"Maximum tensile stress at point B is\", s1b, \"Pa\"\n",
+ "print \"Maximum compressive stress at point B is\", s2b, \"Pa\"\n",
+ "print \"Maximum in plane shear stress at point B is\", tmaxb, \"Pa\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress at point A is 55613361.197 Pa\n",
+ "Maximum compressive stress at point A is -700178.455718 Pa\n",
+ "Maximum in plane shear stress at point A is 28156769.8263 Pa\n",
+ "Maximum tensile stress at point B is 6999035.59641 Pa\n",
+ "Maximum compressive stress at point B is -6999035.59641 Pa\n",
+ "Maximum in plane shear stress at point B is 6999035.59641 Pa\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7, page no. 578"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "principal stresses and maximum shear stresses at points & at the base of the post\n",
+ "\"\"\"\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#initialisation\n",
+ "b = 6 # Outer dimension of the pole in inch\n",
+ "t = 0.5 # thickness of the pole\n",
+ "P1 = 20*(6.75*24) # Load acting at the midpoint of the platform\n",
+ "d = 9 # Distance between longitudinal axis of the post and midpoint of platform\n",
+ "P2 = 800 # Load in lb\n",
+ "h = 52 # Distance between base and point of action of P2\n",
+ "\n",
+ "#calculation\n",
+ "M1 = P1*d # Moment due to P1\n",
+ "M2 = P2*h # Moment due to P2\n",
+ "A = b**2 - (b-2*t)**2 # Area of the cross section\n",
+ "sp1 = P1/A # Comoressive stress due to P1 at A and B\n",
+ "I = (1.0/12.0)*(b**4 - (b-2*t)**4) # Moment of inertia of the cross section\n",
+ "sm1 = (M1*b)/(2*I) # Comoressive stress due to M1 at A and B\n",
+ "Aweb = (2*t)*(b-(2*t)) # Area of the web\n",
+ "tp2 = P2/Aweb # Shear stress at point B by lpad P2\n",
+ "sm2 = (M2*b)/(2*I) # Comoressive stress due to M2 at A \n",
+ "sa = sp1+sm1+sm2 # Total Compressive stress at point A\n",
+ "sb = sp1+sm1 # Total compressive at point B \n",
+ "tb = tp2 # Shear stress at point B\n",
+ "\n",
+ "# Principle stresses \n",
+ "sxa = 0\n",
+ "sya = -sa\n",
+ "txya = 0\n",
+ "sxb = 0\n",
+ "syb = -sb\n",
+ "txyb = tp2 \n",
+ "\n",
+ "# Stresses at A\n",
+ "s1a = (sxa+sya)/2 + math.sqrt(((sxa-sya)/2)**2 + (txya)**2) # Maximum tensile stress \n",
+ "s2a = (sxa+sya)/2 - math.sqrt(((sxa-sya)/2)**2 + (txya)**2) # Maximum compressive stress \n",
+ "tmaxa = math.sqrt(((sxa-sya)/2)**2 + (txya)**2) # Maximum in plane shear stress\n",
+ "print \"Maximum tensile stress at point A is\", s1a,\"Psi\"\n",
+ "print \"Maximum compressive stress at point A is\", round(s2a,2), \"Psi\"\n",
+ "print \"Maximum in plane shear stress at point A is\", round(tmaxa,2), \"Psi\"\n",
+ "\n",
+ "# Stress at B \n",
+ "s1b = (sxb+syb)/2 + math.sqrt(((sxb-syb)/2)**2 + (txyb)**2) # Maximum tensile stress \n",
+ "s2b = (sxb+syb)/2 - math.sqrt(((sxb-syb)/2)**2 + (txyb)**2) # Maximum compressive stress \n",
+ "tmaxb = math.sqrt(((sxb-syb)/2)**2 + (txyb)**2) # Maximum in plane shear stress\n",
+ "print \"Maximum tensile stress at point B is\", round(s1b,2), \"Psi\"\n",
+ "print \"Maximum compressive stress at point B is\", round(s2b,2), \"Psi\"\n",
+ "print \"Maximum in plane shear stress at point B is\", round(tmaxb,2), \"Psi\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum tensile stress at point A is 0.0 Psi\n",
+ "Maximum compressive stress at point A is -4090.91 Psi\n",
+ "Maximum in plane shear stress at point A is 2045.45 Psi\n",
+ "Maximum tensile stress at point B is 13.67 Psi\n",
+ "Maximum compressive stress at point B is -1872.69 Psi\n",
+ "Maximum in plane shear stress at point B is 943.18 Psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/chapter9.ipynb b/Mechanics_of_Materials/chapter9.ipynb
new file mode 100644
index 00000000..7ea9938e
--- /dev/null
+++ b/Mechanics_of_Materials/chapter9.ipynb
@@ -0,0 +1,127 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Deflections of beams"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.17, Page number 654"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Determine the download deflection\n",
+ "\"\"\"\n",
+ "\n",
+ "#Variable declaration\n",
+ "P = 5 #load(k)\n",
+ "L = 8*12 #beam length(in)\n",
+ "E = 30*10**6 #modulus of elasticity(psi)\n",
+ "I = 75.0 #moment of inertia(in^4)\n",
+ "q = 1.5*(1./12.)#load intensity(k/in)\n",
+ "\n",
+ "#Calculations\n",
+ "Sc = ((P*L**3)/(48*E*I))+((5.*q*L**4)/(384.*E*I))\n",
+ "\n",
+ "#Result\n",
+ "print \"The download deflection is\",Sc,\"in(Calculation mistake in textbook)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The download deflection is 0.0001024 in(Calculation mistake in textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.23, Page number 682"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "Determine vertical deflections\n",
+ "\"\"\"\n",
+ "\n",
+ "#Variable declaration\n",
+ "E = 30*10**6*144 #modulus of elasticity(lb/ft^2)\n",
+ "I = 25.92/12 #moment of inertia(ft^4)\n",
+ "x = 12 #ft\n",
+ "\n",
+ "#Calculations\n",
+ "'''The equivalent load q(x) for the beam is given by the following equation\n",
+ "q(x) = -700(x)^-1+800(x-6)^0 - 800(x-12)^0 - 5600(x-12)^-1 + 1500(x-16)^-1\n",
+ "Since the equation equals zero at all points except where x=16, we omit the last term\n",
+ "Taking 4th order integration, we obtain the following expression,'''\n",
+ "C1 = (-((350*x**3)/3)+((100*(x-6)**4)/3)-((100*(x-12)**4)/3)+((2800*(x-12)**3)/3))/12\n",
+ "print \"C1 =\",C1\n",
+ "\n",
+ "#For Deflection at point C\n",
+ "x = 6\n",
+ "Elv = ((350*x**3)/3)-(100*((x-6)**4)/3)+(100*((x-12)**4)/3)+(2800*((x-12)**3)/3)+(C1*x)\n",
+ "Sc = Elv/(E*I) #ft\n",
+ "\n",
+ "#For deflection at point D\n",
+ "x = 16\n",
+ "Elv_16 = ((350*x**3)/3)-(100*((x-6)**4)/3)+(100*((x-12)**4)/3)+(2800*((x-12)**3)/3)+(C1*x)\n",
+ "Sd = Elv_16/(E*I)\n",
+ "\n",
+ "#Results\n",
+ "print \"Deflection at point C is\",round((-Sc*12),8),\"in\"\n",
+ "print \"Deflection at point D is\",round((Sd*12),8),\"in\"\n",
+ "\n",
+ "print \"\\n Please note that there is a calculation mistake in textbook while calculating Elv. Hence, the difference in solution\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C1 = -13200\n",
+ "Deflection at point C is 0.00027315 in\n",
+ "Deflection at point D is 2.06e-06 in\n",
+ "\n",
+ " Please note that there is a calculation mistake in textbook while calculating Elv. Hence, the difference in solution\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mechanics_of_Materials/screenshots/screen1.png b/Mechanics_of_Materials/screenshots/screen1.png
new file mode 100644
index 00000000..2e923aea
--- /dev/null
+++ b/Mechanics_of_Materials/screenshots/screen1.png
Binary files differ
diff --git a/Mechanics_of_Materials/screenshots/screen2.png b/Mechanics_of_Materials/screenshots/screen2.png
new file mode 100644
index 00000000..eb6ad8e1
--- /dev/null
+++ b/Mechanics_of_Materials/screenshots/screen2.png
Binary files differ
diff --git a/Mechanics_of_Materials/screenshots/screen3.png b/Mechanics_of_Materials/screenshots/screen3.png
new file mode 100644
index 00000000..ff023b0d
--- /dev/null
+++ b/Mechanics_of_Materials/screenshots/screen3.png
Binary files differ
diff --git a/Microwave_and_Radar_Engineering/Chapter_10.ipynb b/Microwave_and_Radar_Engineering/Chapter_10.ipynb
new file mode 100644
index 00000000..e8ab31f7
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_10.ipynb
@@ -0,0 +1,581 @@
+{
+ "metadata": {
+ "name": "Chapter 10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10: Microwave Communication Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1, Page number 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the maximum distance through which the TV signal could be received by space popagation and \n",
+ "the raio horizon'''\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#Variable declaration\n",
+ "ht = 144 #transmitter antenna height(m)\n",
+ "hr = 25 #receiving antenna height(M)\n",
+ "\n",
+ "#Calculations\n",
+ "dt = 4*sqrt(ht)\n",
+ "dr = 4*sqrt(hr)\n",
+ "d = dt+dr\n",
+ "\n",
+ "#Results\n",
+ "print \"Radio horizon is\",dt,\"km\"\n",
+ "print \"The maximum distance of propagation of the TV signal is\",d,\"km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radio horizon is 48.0 km\n",
+ "The maximum distance of propagation of the TV signal is 68.0 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2, Page number 486"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the value of the factor by which the horizon distance of the transmitter can be modified'''\n",
+ "\n",
+ "from fractions import Fraction\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6370*10**3 #radius of earth(km)\n",
+ "du_dh = -0.05*10**-6 #refractive index of air near ground\n",
+ "\n",
+ "#Calculations\n",
+ "k = 1/(1+(r*du_dh))\n",
+ "\n",
+ "#Result\n",
+ "print \"The horizon distance of the transmitter can be modified by replaing r by r' is\",round(k,3),\"r\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The horizon distance of the transmitter can be modified by replaing r by r' is 1.467 r\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3, Page number 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the carrier transmitter power required'''\n",
+ "\n",
+ "import math \n",
+ "#Variable declaration\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "f = 2*10**9 #frequency(Hz)\n",
+ "r = 50*10**3 #repeater spacing(km)\n",
+ "Pr = 20 #carrier power(dBm)\n",
+ "Gt = 34 #antenna gain(dB)\n",
+ "L = 10 #dB\n",
+ "Gr = 34 #dB\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "Pt = -Pr+(10*math.log10(4*math.pi*r**2))-Gt-(10*math.log10(lamda**2/(4*math.pi)))+L-Gr\n",
+ "\n",
+ "#Results\n",
+ "print \"The carrier tansmitted power required is\",round(Pt,2),\"dBm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The carrier tansmitted power required is 54.44 dBm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exampl 10.4, Page number 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the received power at input of satellite receiver'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 6.*10**9 #uplink frequency(Hz)\n",
+ "e = 5 #elevation angle(degrees)\n",
+ "Pt = 1.*10**3 #transmitter power(W)\n",
+ "Gt = 60. #gain of transmitter(dB)\n",
+ "Gr = 0 #gain of receiver(dB)\n",
+ "d = 36000*10**3 #distance between ground and satellite(m)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "Gt1 = 10**(Gt/10)\n",
+ "Gr1 = 10.**(Gr/10)\n",
+ "r = d/(math.sin(math.radians(e)))\n",
+ "lamda = c/f\n",
+ "Pr = (Pt*Gt1*Gr1*lamda**2)/(4*math.pi*r**2*4*math.pi)\n",
+ "\n",
+ "#Result\n",
+ "print \"Received power =\",round((Pr/1E-14),1),\"*10^-14 W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Received power = 9.3 *10^-14 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5, Page number 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the antenna beam angle'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6371 #radius of the earth(km)\n",
+ "\n",
+ "#Calculation\n",
+ "d = 35855+r #distance of satellite from center of the earth(km)\n",
+ "b = (math.degrees(math.pi)*r)/d\n",
+ "\n",
+ "#Result\n",
+ "print \"Antenna beam angle =\",round(b,2),\"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Antenna beam angle = 27.16 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.6, Page number 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the round trip time between earth station and satellite. Find the same for vertical transmission'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "r = 6371 #radius of earth(km)\n",
+ "h = 35855 #height(km) \n",
+ "phi = 5 #elevation angle(degrees)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "B = 90 #angle for vertical transmission(degrees)\n",
+ "\n",
+ "#Calculations\n",
+ "d = math.sqrt(((r+h)**2)-((r*math.cos(math.radians(phi)))**2))- (r*math.sin(math.radians(phi)))\n",
+ "T = (2*d*10**3)/c\n",
+ "dv = math.sqrt(((r+h)**2)-(r**2))\n",
+ "Tv = (2*(dv-r)*10**3)/c\n",
+ "\n",
+ "#Results\n",
+ "print \"The round trip time between earth station and satellite is\",round((T/1E-3),2),\"msec\"\n",
+ "print \"The round trip time for vertical transmission is\",round((Tv/1E-3),2),\"msec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The round trip time between earth station and satellite is 274.61 msec\n",
+ "The round trip time for vertical transmission is 235.81 msec\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.7, Page number 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the figure of merit for an earth station'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tant = 25 #effective noise temperature for antenna(K)\n",
+ "Tr = 75 #receiver oise temperature(K)\n",
+ "G = 45 #power gain(dB)\n",
+ "\n",
+ "#Calculations\n",
+ "T = Tant+Tr\n",
+ "Tdb = 10*math.log10(T)\n",
+ "M = G - Tdb\n",
+ "\n",
+ "#Results\n",
+ "print \"The figure of merit for earth station is\",M,\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The figure of merit for earth station is 25.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.8, Page number 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine carrier to noise ratio'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "EIRP = 55.5 #satellite ESM(dBW)\n",
+ "M = 35 #freespace loss(dB)\n",
+ "Lfs = 245.3 #GT of earth station(dB)\n",
+ "\n",
+ "#Calculation\n",
+ "C_No = EIRP + M - Lfs + 228.6\n",
+ "\n",
+ "#Result\n",
+ "print \"The carrier to noise ratio is\",round(C_No,2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The carrier to noise ratio is 73.8 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.9, Page number 489"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the system noise temperature'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 30 #diameter of dish(m)\n",
+ "f = 4*10**9 #downlink frequency(Hz)\n",
+ "M = 20 #G/T ratio of earth station\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "Ae = (math.pi*D**2)/4\n",
+ "lamda = c/f\n",
+ "G = (4*math.pi*Ae)/lamda**2\n",
+ "Gdb = 10*math.log10(G)\n",
+ "Ts = Gdb - M\n",
+ "\n",
+ "#Result\n",
+ "print \"The system noise temperature is\",round(Ts,2),\"dB\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The system noise temperature is 41.98 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.10, Page number 489"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Find the diameter & half power beam width of paraboic antenna'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Gp = 1500 #power gain\n",
+ "lamda = 10*10**-2 #m\n",
+ "\n",
+ "#Calculations\n",
+ "D = math.sqrt((Gp*(lamda**2))/(math.pi**2))\n",
+ "HPBW = 58*lamda/D\n",
+ "\n",
+ "#Results\n",
+ "print \"The diamater of parabolic antenna is\",round(D,2),\"m\"\n",
+ "print \"Half power beam width of paraboic antenna =\",round(HPBW,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15791.3670417\n",
+ "The diamater of parabolic antenna is 1.23 m\n",
+ "Half power beam width of paraboic antenna = 4.7\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.11, Page number 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate overall gain of the system'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "'''Let Gp1 be the gain and d1 be the diameter of the parabolic reflectors in the original system\n",
+ "then Gp1 = (6*D1**2)/(lamda**2)\n",
+ "If the gain and diameter of the antenna in the modified system is Gp2 and d2,\n",
+ "then Gp2 = (6*D2**2)/(lamda**2)\n",
+ "Gain = 10*log(Gp2/Gp1)\n",
+ "Substituting D2=2D1 in Gp2, we get,'''\n",
+ "\n",
+ "#Calculations\n",
+ "G = 10*math.log10(2)\n",
+ "Gall = 2*G\n",
+ "\n",
+ "#Results\n",
+ "print \"Overall gain of the system is\",round(Gall,2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall gain of the system is 6.02 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Esample 10.12, Page number 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)beamwidth between first nulls\n",
+ "b)beamwidth between half power points\n",
+ "c)gain of antenna'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 3*10**2 #diameter of paraboloid(cm)\n",
+ "f = 3.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "BWFN = (140*lamda)/D\n",
+ "BWHP = (70*lamda)/D\n",
+ "Gp = (6*D**2)/(lamda**2)\n",
+ "\n",
+ "#Results\n",
+ "print \"Beamwidth between first nulls =\",round(BWFN,2),\"degrees\"\n",
+ "print \"Beamwidth between half power points =\",round(BWHP,2),\"degrees\"\n",
+ "print \"Gain of antenna =\",round(Gp,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beamwidth between first nulls = 4.67 degrees\n",
+ "Beamwidth between half power points = 2.33 degrees\n",
+ "Gain of antenna = 5400.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.13, Page number 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate power gain of optimum horn antenna'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "'''A = 5*lamda #square aperture of a side dimension\n",
+ "Gp = 4.5* A^2/lamda^2'''\n",
+ "A = 5\n",
+ "\n",
+ "#Calculation\n",
+ "Gp = 4.5*A**2\n",
+ "\n",
+ "#Result\n",
+ "print \"Power gain of optimum horn antenna =\",Gp\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain of optimum horn antenna = 112.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_11.ipynb b/Microwave_and_Radar_Engineering/Chapter_11.ipynb
new file mode 100644
index 00000000..8ad823b1
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_11.ipynb
@@ -0,0 +1,308 @@
+{
+ "metadata": {
+ "name": "Chapter 11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: Radars"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1, Page number 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate maximum range of radar system'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaraion\n",
+ "lamda = 3.*10**-2#operating unit(cm)\n",
+ "Pt = 600.*10**3 #peak pulse power(W)\n",
+ "Smin = 10.**-13 #minimum detectable signal(W)\n",
+ "Ae = 5. #m^2\n",
+ "sigma = 20. #cross sectional area(m^2)\n",
+ "\n",
+ "#Calculations\n",
+ "Rmax = ((Pt*Ae**2*sigma)/(4*math.pi*lamda**2*Smin))**0.25\n",
+ "Rmax_nau = Rmax/1.853\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum range of radar system is\",round((Rmax/1E+3),2),\"km\"\n",
+ "print \"The maximum range of radar system in nautical miles is\",round((Rmax_nau/1E+3),2),\"nm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum range of radar system is 717.66 km\n",
+ "The maximum range of radar system in nautical miles is 387.29 nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2, Page number 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find maximum range possible of an antenna'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 250.*10**3 #peak pulse power(W)\n",
+ "Smin = 10.**-14 #minimum detectable signal(W)\n",
+ "Ae = 10. #m^2\n",
+ "sigma = 2. #cross sectional area(m^2)\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "G = 2500 #power gain of antenna\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "Rmax = ((Pt*G*Ae*sigma)/((4*math.pi)**2*Smin))**0.25\n",
+ "\n",
+ "#Result\n",
+ "print \"Maximum range possible of the antenna is\",round((Rmax/1E+3),2),\"km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum range possible of the antenna is 298.28 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.3, Page number 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine the cross section the radar can sight'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 250.*10**3 #peak pulse power(W)\n",
+ "f = 10.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "G = 4000 #power gain of antenna\n",
+ "R = 50*10**3 #range(m)\n",
+ "Pr = 10**-11 #minimum detectable signal(W)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "Ae = (G*lamda**2)/(4*math.pi)\n",
+ "sigma = (Pr*((4*math.pi*R**2)**2))/(Pt*G*Ae)\n",
+ "\n",
+ "#Result\n",
+ "print \"The radar can sight cross section area of\",round(sigma,2),\"m^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The radar can sight cross section area of 34.45 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4, Page number 505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine - \n",
+ "a)Unambigous range\n",
+ "b)duy cycle\n",
+ "c)average power\n",
+ "d)bandwidth of radar'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 400*10**3 #transmitted power(W)\n",
+ "prf = 1500. #pulse repitiion frequency(pps)\n",
+ "tw = 0.8*10**-6 #pulse width(sec)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Run = c/(2*prf)\n",
+ "\n",
+ "#Part b\n",
+ "dc = tw/(1/prf)\n",
+ "\n",
+ "#Part c\n",
+ "Pav = Pt*dc\n",
+ "\n",
+ "#Part d\n",
+ "n1 = 1\n",
+ "BW1 = n1/tw\n",
+ "\n",
+ "n2 = 1.4\n",
+ "BW2 = n2/tw\n",
+ "\n",
+ "#Results\n",
+ "print \"The radar's unambiguous range is\",round((Run/1E+3),2),\"km\"\n",
+ "print \"The duty cycle for radar is\",dc\n",
+ "print \"The average power is\",round(Pav,2),\"W\"\n",
+ "print \"Bandwidth range for radar is\",(BW1/1E+6),\"MHz and\",(BW2/1E+6),\"MHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The radar's unambiguous range is 100.0 km\n",
+ "The duty cycle for radar is 0.0012\n",
+ "The average power is 480.0 W\n",
+ "Bandwidth range for radar is 1.25 MHz and 1.75 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5, Page number 505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the maximum detection range'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pt = 2.5*10**6 #power output(W)\n",
+ "D = 5 #antenna diameter(m)\n",
+ "sigma = 1 #cross sectional area of target(m^2)\n",
+ "B = 1.6*10**6 #receiver bandwidth(Hz)\n",
+ "c = 3.*10**8 #velocity of propagation(m/s)\n",
+ "Nf = 12. #noise figure(dB)\n",
+ "f = 5*10**9 #frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "F = 10**(Nf/10)\n",
+ "Rmax = 48*(((Pt*D**4*sigma)/(B*lamda**2*(F-1)))**0.25)\n",
+ "\n",
+ "#Result\n",
+ "print \"The maximum detection range is\",round(Rmax,2),\"km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum detection range is 558.04 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6, Page number 506"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the maximum range and the effect of doubling the transmitter power'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#Variable declaration\n",
+ "Rmax = 30 #maximum range of radar(km)\n",
+ "n = 50 #no. of echos\n",
+ "\n",
+ "#Calculation\n",
+ "R = Rmax*math.sqrt(math.sqrt(n))\n",
+ "\n",
+ "#After doubling the power\n",
+ "R1 = math.sqrt(math.sqrt(2))\n",
+ "\n",
+ "#Results\n",
+ "print \"Maximum range with echoing of 50 times is\",round(R,2),\"km\"\n",
+ "print \"If transmitter power is doubled, range would increase by a factor of\",round(R1,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum range with echoing of 50 times is 79.77 km\n",
+ "If transmitter power is doubled, range would increase by a factor of 1.19\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_3.ipynb b/Microwave_and_Radar_Engineering/Chapter_3.ipynb
new file mode 100644
index 00000000..a92941f8
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_3.ipynb
@@ -0,0 +1,548 @@
+{
+ "metadata": {
+ "name": "Chapter 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 3.1, Page number 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Finding the value of terminating impedance'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 100 #o/p impedance(Ohms)\n",
+ "s = 5 #VSWR\n",
+ "\n",
+ "#Calculations\n",
+ "Zmax = Zo*s\n",
+ "\n",
+ "#Results\n",
+ "print \"Terminating impedance = \",Zmax,\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Terminating impedance = 500 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, Page number 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculate characterstic impedance, attenuation constant, phase constant and power delivered to the load'''\n",
+ "\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Varaible declaration \n",
+ "R = 8 #resistance(Ohms)\n",
+ "L = 2*10**-3 #inductance(H/km)\n",
+ "C = 0.002*10**-6 #capacitance(F)\n",
+ "G = 0.07*10**-6 #conductance(s/km)\n",
+ "f = 2*10**3 #frequency(Hz)\n",
+ "Vs = 2 #input signal(V)\n",
+ "l = 500. #line length(km)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "x = complex(R,w*L)\n",
+ "y = complex(G,w*C)\n",
+ "Zo = cmath.sqrt(x/y)\n",
+ "gamma = cmath.sqrt(x*y)\n",
+ "Is = Vs/Zo.real\n",
+ "Il = Is*cmath.exp(-1*gamma*l)\n",
+ "P = Il**2*Zo.real\n",
+ "\n",
+ "#Results\n",
+ "print \"Characteristic impedance =\",Zo,\"Ohms\"\n",
+ "print \"Attenuation constant =\",round(gamma.real,6),\"NP/km\"\n",
+ "print \"Phase constant =\", round(gamma.imag,6),\"rad/km\"\n",
+ "print \"Power delivered to the load =\", round((abs(P)/1E-6),2), \"uW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Characteristic impedance = (1012.50018135-155.813417548j) Ohms\n",
+ "Attenuation constant = 0.003987 NP/km\n",
+ "Phase constant = 0.025436 rad/km\n",
+ "Power delivered to the load = 73.31 uW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page number 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Obtain phase velocity of a wave that is propagated on the line'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Varaible declaration\n",
+ "f = 2*10**3 #frequency(Hz)\n",
+ "B = 0.02543 #phase constant(rad/km)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "Vp = w/B\n",
+ "\n",
+ "#Results\n",
+ "print \"Phase velocity =\",round((Vp/1E+3),2),\"km/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Phase velocity = 494.16 km/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page number 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculate -\n",
+ "a) Current drawn from generator\n",
+ "b) Power delivered to the load\n",
+ "c) Current flowing through the load'''\n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 37.5*10**6 #frequency(Hz)\n",
+ "V = 200 #Voltage signal(Vrms)\n",
+ "r = 200 #internal resistance(Ohms)\n",
+ "Zo = 200 #characteristic impedance(Ohms)\n",
+ "l = 10 #line length(m)\n",
+ "Zl = 100 #resistive load(Ohms)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "lamda = c/f\n",
+ "Bl = (5*math.degrees(math.pi))/4\n",
+ "x = complex(Zl,(Zo*math.tan(Bl)))\n",
+ "y = complex(Zo,(Zl*math.tan(Bl)))\n",
+ "Zi = Zo*(x/y)\n",
+ "Vs = (Zi.real*Zo)/(Zi.real+Zo)\n",
+ "Is = Zo/(Zi.real+Zo)\n",
+ "\n",
+ "#Part b\n",
+ "P = Vs*Is\n",
+ "\n",
+ "#Part c\n",
+ "Il = math.sqrt(P/Zl)\n",
+ "\n",
+ "#Results\n",
+ "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
+ "print \"Current drawn from generator is\",round(Is,2),\"A\" \n",
+ "print \"Power delivered to the load is\",round(P,2),\"W\"\n",
+ "print \"Current flowing through the load is\",round(Il,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
+ "\n",
+ "Current drawn from generator is 0.41 A\n",
+ "Power delivered to the load is 48.47 W\n",
+ "Current flowing through the load is 0.696 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculate VSWR and reflection coefficient'''\n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "zo = 50 #characteristic impedance(Ohms)\n",
+ "f = 300*10**6 #frequency(Hz)\n",
+ "zl = complex(50,50) #terminating load(Ohms)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "rho = (zl-zo)/(zl+zo)\n",
+ "phi = cmath.phase(rho)\n",
+ "s = (1+abs(rho))/(1-abs(rho))\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflection co-efficient =\",round(abs(rho),3),\"with phase =\",round(math.degrees(phi),2)\n",
+ "print \"VSWR =\",round(s,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reflection co-efficient = 0.447 with phase = 63.43\n",
+ "VSWR = 2.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Determine the point of attachment and length of stub'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zl = 100. #load resistance(Ohms)\n",
+ "Zo = 600. #characteristic impedance(Ohms)\n",
+ "f = 100*10**6 #frequency(Hz)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "l = (lamda*math.atan(math.sqrt(Zl/Zo)))/(2*math.pi)\n",
+ "l_dash = (lamda*math.atan(math.sqrt((Zl*Zo)/(Zo-Zl))))/(2*math.pi)\n",
+ "\n",
+ "#Results\n",
+ "print \"The position of the stub is\", round(l,3),\"m\\n\"\n",
+ "print \"Please note that the solution for l_dash given in the textbook is incorrect\"\n",
+ "print \"Length of stub is\",round(l_dash,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of the stub is 0.185 m\n",
+ "\n",
+ "Please note that the solution for l_dash given in the textbook is incorrect\n",
+ "Length of stub is 0.707 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calcultate the terminating impedance'''\n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 3.2 #VSWR\n",
+ "Xmin = 0.237 #minimum voltage(V)\n",
+ "Zo = 50 #characteristic impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "q = math.tan(math.degrees(2*math.pi*Xmin))\n",
+ "x = complex(1,-(s*q))\n",
+ "y = complex(s, -q)\n",
+ "Zl = Zo*(x/y)\n",
+ "\n",
+ "#Result\n",
+ "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
+ "print \"Terminating impedance =\", Zl,\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
+ "\n",
+ "Terminating impedance = (19.6572514629-23.7885950214j) Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8, Page number 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine - \n",
+ "a)VSWR\n",
+ "b) Position of first Vmin and Vmax\n",
+ "c) Vmin and Vmax\n",
+ "d) Impedance at Vmin and Vmax'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 50. #characteristic impedance(Ohms)\n",
+ "Zl = 100. #load resistance(Ohms)\n",
+ "f = 300*10**3 #frequency(Hz)\n",
+ "Pl = 50*10**-3 #load power(W)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "\n",
+ "#Part a\n",
+ "rho = (Zl-Zo)/(Zl+Zo)\n",
+ "s = (1+abs(rho))/(1-abs(rho))\n",
+ "\n",
+ "#Part b\n",
+ "#Since real Zl>Zo, first Vmax is located at the load\n",
+ "Vmin_pos = lamda/4\n",
+ "\n",
+ "#Part c\n",
+ "Vmax = math.sqrt(Pl*Zl)\n",
+ "Vmin = Vmax/s\n",
+ "\n",
+ "#Part d\n",
+ "Zin_at_Vmin = Zo/s\n",
+ "Zin_at_Vmax = Zo*s\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"VSWR = \", s\n",
+ "print \"First Vmax is loacted at load and first Vmin is located at\", Vmin_pos,\"m from the load\"\n",
+ "print \"Vmin = \",round(Vmin,2),\"V and Vmax = \",round(Vmax,2),\"V\"\n",
+ "print \"Impedance at Vmin is \", Zin_at_Vmin,\"Ohm and impedance at Vmax is\",Zin_at_Vmax,\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 2.0\n",
+ "First Vmax is loacted at load and first Vmin is located at 250 m from the load\n",
+ "Vmin = 1.12 V and Vmax = 2.24 V\n",
+ "Impedance at Vmin is 25.0 Ohm and impedance at Vmax is 100.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9, Page number 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Determine - \n",
+ "a)Transmission loss\n",
+ "b)Reflection loss\n",
+ "c)Return loss'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 600. #characteristic impedance(Ohms)\n",
+ "Zs = 50 #source impedance(Ohms)\n",
+ "l = 200 #length of line(m)\n",
+ "Zl = 500. #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "rho = (Zl-Zo)/(Zl+Zo)\n",
+ "\n",
+ "#Part a\n",
+ "ref_l = math.log10(1/(1-((abs(rho))**2)))\n",
+ "\n",
+ "#Part b\n",
+ "#Since, the line is lossless,\n",
+ "att_l = 0\n",
+ "trans_l = ref_l+att_l\n",
+ "\n",
+ "#Part c\n",
+ "ret_l = math.log10(abs(rho))\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflection loss =\",round(ref_l,4),\"dB\"\n",
+ "print \"Transmission loss =\",round(trans_l,4),\"dB\"\n",
+ "print \"Return loss =\",round(ret_l,3),\"dB (Calculation error in the textbook)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflection loss = 0.0036 dB\n",
+ "Transmission loss = 0.0036 dB\n",
+ "Return loss = -1.041 dB (Calculation error in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10, Page number 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the characteristic impedance and phase velocity'''\n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 10 #length of line(km)\n",
+ "zsc = complex(1895.47,2234.29) \n",
+ "zoc = complex(216.99,-143.37)\n",
+ "f = 1*10**3 #frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "zo = cmath.sqrt(zsc*zoc)\n",
+ "x = cmath.sqrt(zsc/zoc)\n",
+ "t = (1+x)/(1-x)\n",
+ "gamma = cmath.log(t)/(l*2)\n",
+ "B = gamma.imag\n",
+ "w = 2*math.pi*f\n",
+ "Vp = w/B\n",
+ "\n",
+ "#Results\n",
+ "print \"There is calculation mistake throughout the problem in the textbook\\n\"\n",
+ "print \"Characteristic impedance =\",zo,\"Ohms\"\n",
+ "print \"Phase velocity =\",round((Vp/1E+3),3),\"*10^3 m/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "There is calculation mistake throughout the problem in the textbook\n",
+ "\n",
+ "Characteristic impedance = (864.190238563+123.274392427j) Ohms\n",
+ "Phase velocity = 45.994 *10^3 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_4.ipynb b/Microwave_and_Radar_Engineering/Chapter_4.ipynb
new file mode 100644
index 00000000..c8b2fe93
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_4.ipynb
@@ -0,0 +1,1238 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Microwave Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1, Page number 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculate - \n",
+ "a)Inductance per unit length\n",
+ "b)Capacitance per unit lengh\n",
+ "c)Characteristic impedance\n",
+ "d)velocity of propagation'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 0.49 #diameter of inner conductor(cm)\n",
+ "D = 1.10 #diameter of outer conductor(cm)\n",
+ "e = 2.3 #polyethylene dielectric\n",
+ "c = 3*10**8 #velocity of light(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "L = 2*10**-7*math.log(D/d)\n",
+ "C = (55.56*10**-12*e)/(math.log(D/d))\n",
+ "Ro = (60*math.log(D/d))/(math.sqrt(e))\n",
+ "v = c/(math.sqrt(e))\n",
+ "\n",
+ "#Results\n",
+ "print \"Inductance per unit length is\",round(L,8),\"H/m\"\n",
+ "print \"Capacitance per unit length is\",round(C,12),\"PF/m\"\n",
+ "print \"Characteristic impedance is\",round(Ro,3),\"Ohms\"\n",
+ "print \"Velocity of propagation is\",round(v,3),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance per unit length is 1.6e-07 H/m\n",
+ "Capacitance per unit length is 1.58e-10 PF/m\n",
+ "Characteristic impedance is 31.993 Ohms\n",
+ "Velocity of propagation is 197814142.019 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2, Page number 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate aatenuation constant, phase constant, phase velocity, relative permittivity and power loss'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declartion\n",
+ "R = 0.05 #Ohms/m\n",
+ "L = 1.6*10**-7 #Inductance(from example 4.1)\n",
+ "C = 1.58*10**-10 #Capacitance(from example 4.1)\n",
+ "w = 2*math.pi\n",
+ "c = 3*10**8 #velocity of light(m/s)\n",
+ "e = 2.3 #polyethylene dielectric(from example 4.1)\n",
+ "Pin = 480 #Input power(W)\n",
+ "l = 50 #line length(m)\n",
+ "\n",
+ "#Calculations\n",
+ "zo=math.sqrt(L/C)\n",
+ "alpha = R/(2*zo)\n",
+ "B = w*math.sqrt(L*C)\n",
+ "Vp = 1/math.sqrt(L*C)\n",
+ "e = (C/Vp)**2\n",
+ "Pl = Pin*2*l\n",
+ "\n",
+ "#Results\n",
+ "print \"Attenuation constant =\",round(alpha,5),\"Np/m\"\n",
+ "print \"Phase constant =\",round(B,8),\"rad/m\"\n",
+ "print \"Phase velocity =\",round(Vp*10**-6,2),\"*10**-6 m/s\"\n",
+ "print \"Relative permittivity =\",e\n",
+ "print \"Power loss =\",round(Pl),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Attenuation constant = 0.00079 Np/m\n",
+ "Phase constant = 3e-08 rad/m\n",
+ "Phase velocity = 198.89 *10**-6 m/s\n",
+ "Relative permittivity = 6.3108992e-37\n",
+ "Power loss = 48000.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3, Page number 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate breakdown power'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 9.375*10**10 #Frequency(Hz)\n",
+ "c = 3*10**8 #velocity of light(m/s)\n",
+ "b_a = 2.3\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "#Since b_by_a = 2.3 and b+a <lamda/pi, therefore\n",
+ "a = 2.42 #(cm)\n",
+ "P = 3600*a**2*math.log(b_a)\n",
+ "\n",
+ "#Results\n",
+ "print \"The brakdown power of the airfilled coaxial cable is\", round(P),\"W\"\n",
+ "print \"Please note the answer given in the textbook is wrong\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The brakdown power of the airfilled coaxial cable is 17560.0 W\n",
+ "Please note the answer given in the textbook is wrong\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4, Page number 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine the characteristic impedance and velocity of propagation'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 0.3175 #distance between the ground planes(cm)\n",
+ "d = 0.0539 #diameter of circular conductor(cm)\n",
+ "e = 2.32 #dielectric constant\n",
+ "c = 3*10**8 #velocity of light(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "zo = (60*math.log((4*b)/(math.pi*d)))/math.sqrt(e)\n",
+ "v = c/math.sqrt(e)\n",
+ "\n",
+ "#Results\n",
+ "print \"Charactritic impedance =\",round(zo,2),\"Ohms\"\n",
+ "print \"Velocity of propagation =\",round(v,2),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charactritic impedance = 79.37 Ohms\n",
+ "Velocity of propagation = 196959649.29 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5, Page number 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Determine -\n",
+ "a)Characteristic impedance\n",
+ "b)Dielectric constant\n",
+ "c)Velocity of propagation'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "e = 9.7 #Dielectric constant\n",
+ "W_h = 0.5 #for case a\n",
+ "W_b = 5. #for case b\n",
+ "c = 3*10**8 #speed of light(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#Case a\n",
+ "x = (1/math.sqrt(1+12+((1/W_h)**2))+0.04*((1-W_h)**2))\n",
+ "Eeff1 = ((e+1)/2)+(((e-1)/2)*x)\n",
+ "Zo1 = 60/math.sqrt(Eeff1)*math.log((8*(1/W_h)+W_h/4))\n",
+ "v1 = c/math.sqrt(Eeff1)\n",
+ "\n",
+ "#Case b\n",
+ "y = 1/(math.sqrt(1+12*(1/W_b)))\n",
+ "Eeff2 = ((e+1)/2)+(((e-1)/2)*y)\n",
+ "z = 1/(W_b+1.393+0.667*math.log(1.444+W_b))\n",
+ "Zo2 = (120*math.pi*z)/math.sqrt(Eeff2)\n",
+ "v2 = c/math.sqrt(Eeff2)\n",
+ "\n",
+ "#Results\n",
+ "print \"Case a\"\n",
+ "print \"Characteristic impedance =\",round(Zo1,2),\"Ohms\"\n",
+ "print \"Effective dielectric constant =\",round(Eeff1,2)\n",
+ "print \"Velocity of propagation =\",round(v1,2),\"m/s\\n\"\n",
+ "\n",
+ "\n",
+ "print \"Case b\"\n",
+ "print \"Characteristic impedance =\",round(Zo2,2),\"Ohms\"\n",
+ "print \"Effective dielectric constant =\",round(Eeff2,2)\n",
+ "print \"Velocity of propagation =\",round(v2,2),\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case a\n",
+ "Characteristic impedance = 65.69 Ohms\n",
+ "Effective dielectric constant = 6.45\n",
+ "Velocity of propagation = 118138347.97 m/s\n",
+ "\n",
+ "Case b\n",
+ "Characteristic impedance = 17.78 Ohms\n",
+ "Effective dielectric constant = 7.71\n",
+ "Velocity of propagation = 108048536.19 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6, Page number 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculate ratio of circular waveguide cross-sectional area to the rectangular waveguide cross section when - \n",
+ "a) TE wave is propagated\n",
+ "b) TM wave is propagated'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a1 = 1.70645 #for case a\n",
+ "b1 = a1/2 #for case a\n",
+ "b2 = 1.4621 #for case b\n",
+ "\n",
+ "#Calculations\n",
+ "#Case a(For TE10 mode)\n",
+ "Area_rw1 = a1*b1\n",
+ "Area_cw1 = math.pi\n",
+ "Ratio1 = Area_cw1/Area_rw1\n",
+ "\n",
+ "#Case b(For TM mode)\n",
+ "Area_rw2 = b2**2\n",
+ "Area_cw2 = math.pi\n",
+ "Ratio2 = Area_cw2/Area_rw2\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"Case a\"\n",
+ "print \"Ratio of area of circular to area of rectangular waveguide =\",round(Ratio1,1),\"\\n\"\n",
+ "print \"Case b\"\n",
+ "print \"Ratio of area of circular to area of rectangular waveguide =\",round(Ratio2,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case a\n",
+ "Ratio of area of circular to area of rectangular waveguide = 2.2 \n",
+ "\n",
+ "Case b\n",
+ "Ratio of area of circular to area of rectangular waveguide = 1.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7, Page number 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate breadth of rectangular waveguide for dominant mode TE10'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 9.*10**9 #frequency(Hz)\n",
+ "lamda_g = 4. #guide wavelength(cm)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "lamda_c = math.sqrt((lamda_o**2)/(1-(lamda_o**2/lamda_g**2)))\n",
+ "#For TE10 mode,\n",
+ "a = lamda_c/2\n",
+ "b = lamda_c/4 #@since a=2b\n",
+ "#Results\n",
+ "print \"The breadth of rectangular waveguide is\",round(b,2),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The breadth of rectangular waveguide is 1.51 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8, Page number 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Determine the cut-off wavelength, guide wavelength, group and phase velocities'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 10 #breadth of waveguide(cms)\n",
+ "f = 2.5*10**9 #frequency of signal(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_c = 2*a #cut-off wavelength\n",
+ "lamda_o = c/f \n",
+ "x = math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "lamda_g = (lamda_o/x) #guided wavelength\n",
+ "Vp = c/x #Phase velocity\n",
+ "Vg = c**2/Vp #Group velocity\n",
+ "\n",
+ "#Results\n",
+ "print \"The cut-off wavelength is\", round(lamda_c,2),\"cm\"\n",
+ "print \"The guided wavelength is\",round(lamda_g,3),\"cm\"\n",
+ "print \"The pahse velocity is\",round((Vp/1E+10),2),\"*10^10 cm/sec\"\n",
+ "print \"The group velocity is\",round((Vg/1E+10),2),\"*10^10 cm/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The cut-off wavelength is 20.0 cm\n",
+ "The guided wavelength is 15.0 cm\n",
+ "The pahse velocity is 3.75 *10^10 cm/sec\n",
+ "The group velocity is 2.4 *10^10 cm/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9, Page number 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Find the following - \n",
+ "a)possible modes\n",
+ "b)cut-off frequencies\n",
+ "c)guide wavelength'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 2.5 #length of guide(cms)\n",
+ "b = 1 #breadth of guide(cms)\n",
+ "f = 8.66 #cut-off frequency(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "#condition for wave to propagate is lamda_c>lamda_o. Therefore for TE01 mode,\n",
+ "lamda_c1 = 2*b\n",
+ "if lamda_c1<lamda_o:\n",
+ " print \"TE01 does not propgate\"\n",
+ "lamda_c2 = 2*a #for TE10 mode\n",
+ "if lamda_c2>lamda_o:\n",
+ " print \"TE10 is a possible mode\"\n",
+ "fc = c/lamda_c2\n",
+ "lamda_c3 = (2*a*b)/math.sqrt((a**2)+(b**2)) #for TE11 and TM11 modes\n",
+ "if lamda_c3<lamda_o:\n",
+ " print \"Both TE11 and TM11 do not propagate as higher modes\"\n",
+ "lamda_g = lamda_o/math.sqrt(-1*(1-((lamda_o/lamda_c2)**2)))\n",
+ "\n",
+ "#Results\n",
+ "print \"Cut-off frequency =\",round((fc/1E+9),3),\"GHz\"\n",
+ "print \"Guide wavelength =\",round(lamda_g,3),\"cms\"\n",
+ "print \"From the analysis, we conclude that only TE10 mode is possible\\n\"\n",
+ "print \"Case ii\"\n",
+ "print \"Lamda_c for TM11 is equal to lamda_c for TE11 =\",round(lamda_c3,3),\"cms which means that TM11 also does not propagate\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "TE01 does not propgate\n",
+ "Both TE11 and TM11 do not propagate as higher modes\n",
+ "Cut-off frequency = 6.0 Hz\n",
+ "Guide wavelength = 5.0 cms\n",
+ "From the analysis, we conclude that only TE10 mode is possible\n",
+ "\n",
+ "Case ii\n",
+ "Lamda_c for TM11 is equal to lamda_c for TE11 = 1.857 cms which means that TM11 also does not propagate\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10, Page number 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find - \n",
+ "a)the required size of cross setional area of the guide\n",
+ "b)the frequencies that can be used for this mode of propagation'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda_c = 10 #cut-off wavelength(cms)\n",
+ "c = 3*10**10 #velocity of propagation\n",
+ "\n",
+ "#Calculations\n",
+ "#For TE11 mode in a circular waveguide,\n",
+ "r = (lamda_c*1.841)/(2*math.pi) #radius of circular waveguide(cms)\n",
+ "a = math.pi*r**2 #area of circular waveguide\n",
+ "fc = c/lamda_c #cut-off frequency(Hz)\n",
+ "\n",
+ "#Results\n",
+ "print \"The required cross sectional area is\", round(a,3),\"cms^2\"\n",
+ "print \"Frequencies above\",round((fc/1E+9),2),\"GHz can be propagated throught the waveguide\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required cross sectional area is 26.971 cms^2\n",
+ "Frequencies above 3.0 GHz can be propagated throught the waveguide\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11, Page number 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Finding all the modes of propagation'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 5*10**9 #frequecy(Hz)\n",
+ "a = 4 #length of guide(cms)\n",
+ "b = 3 #breadth of guide(cms)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations & Results\n",
+ "lamda_o = c/f\n",
+ "#For TE waves:\n",
+ "#For TE01 mode - m = 0, n = 1\n",
+ "lamda_c1 = 2*b\n",
+ "if lamda_c1<=lamda_o:\n",
+ " print \"TE01 does not propgate\"\n",
+ "\n",
+ "#For TE10 mode - m=1, n=0\n",
+ "lamda_c2 = 2*a\n",
+ "if lamda_c3<lamda_o:\n",
+ " print \"TE10 is a possible mode\"\n",
+ " \n",
+ "#For TE11 mode - m=1, n=1\n",
+ "lamda_c3 = (2*a*b)/math.sqrt((a**2)+(b**2))\n",
+ "if lamda_c3<lamda_o:\n",
+ " print \"TE11 does not propgate\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "TE01 does not propgate\n",
+ "TE10 is a possible mode\n",
+ "TE11 does not propgate\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.12, Page number 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Find - \n",
+ "a)cut-off wavelength\n",
+ "b)cut-off frequency\n",
+ "c)wavelength in the guide'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 4 #inner diameter of circular waveguide(cms)\n",
+ "c = 3*10**10 #velocity od propagation(m/s)\n",
+ "fs = 5*10**9 #signal frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "r = d/2 #radius(cms)\n",
+ "lamda_c = (2*math.pi*r)/1.841\n",
+ "fc = c/lamda_c\n",
+ "lamda_o = c/fs\n",
+ "lamda_g = lamda_o/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "\n",
+ "#Results\n",
+ "print \"Cut-off wavelength =\",round(lamda_c,3),\"cms\"\n",
+ "print \"Cut-off frequency =\",round((fc/1E+9),3),\"GHz\"\n",
+ "print \"Guide wavelength =\",round(lamda_g,3),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cut-off wavelength = 6.826 cms\n",
+ "Cut-off frequency = 4.395 GHz\n",
+ "Guide wavelength = 12.584 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.13, Page number 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the frequency of wave'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 6. #length of rectangular waveguide(cms)\n",
+ "b = 4. #breadth of rectangular waveguide(cms)\n",
+ "d = 4.55 #distance between maximum and minimum(cms)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#For TE10 mode:\n",
+ "lamda_c = 2*a\n",
+ "lamda_g = d*4\n",
+ "lamda_o = math.sqrt(1./(((1./lamda_g**2)+(1./lamda_c**2))))\n",
+ "f = c/lamda_o\n",
+ "\n",
+ "#Results\n",
+ "print \"Frequency of wave is\",round((f/1E+9),2),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of wave is 2.99 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.14, Page number 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine guide wavelength, phase constant and phase velocity'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "b = 2.5 #breadth of rectangular waveguide(cms)\n",
+ "a = 5. #length of rectangular waveguide(cms)\n",
+ "c = 3*10**10 #velocity of propagation(cm/s)\n",
+ "lamda_o = 4.5 #wavelength(cms)\n",
+ "\n",
+ "#Calculations\n",
+ "#For TE10 mode which is the dominant mode:\n",
+ "lamda_c = 2*a\n",
+ "lamda_g = lamda_o/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "Vp = c/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "B = (2*math.pi*math.sqrt((lamda_c**2)-(lamda_o**2)))/(lamda_o*lamda_c)\n",
+ "\n",
+ "#Results\n",
+ "print \"Solutions obtained in the textbook are incorrect due to calculation mistake in lamda_g\"\n",
+ "print \"Guide wavelength =\",round(lamda_g,3),\"cms\"\n",
+ "print \"Phase constant =\",round(B,3)\n",
+ "print \"Phase velocity =\",round(Vp,3),\"m/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Solutions obtained in the textbook are incorrect due to calculation mistake in lamda_g\n",
+ "Guide wavelength = 5.039 cms\n",
+ "Phase constant = 1.247\n",
+ "Phase velocity = 33593550657.4 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.15, Page number 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''What modes are propagated at free space wavelength of(i)10cm (ii)5cm'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda_o1 = 10 #cms\n",
+ "lamda_o2 = 5 #cms\n",
+ "#lamda_c for different modes\n",
+ "TE10 = 16 #cms\n",
+ "TM11 = 7.16 #cms\n",
+ "TM21 = 5.6 #cms\n",
+ "\n",
+ "#Calculations\n",
+ "#For any wave to be propagated, lamda_c>lamda_o\n",
+ "\n",
+ "#Part(i)\n",
+ "x = [TE10, TM11, TM21]\n",
+ "#largest=x[0]\n",
+ "for large in x:\n",
+ " if large > lamda_o1:\n",
+ " largest=large\n",
+ "print \"Part(i)\\nSince lamda_c =\",(largest),\"which is greater than lamda_o1, only TE10 mode propagates\"\n",
+ "\n",
+ "#Part(ii)\n",
+ "print \"\\nPart(ii)\"\n",
+ "if TE10>lamda_o2:\n",
+ " print \"TE10 mode propagates\"\n",
+ " if TM11>lamda_o2:\n",
+ " print \"TM11 mode propagates\"\n",
+ " if TM21>lamda_o2:\n",
+ " print \"TM21 mode propagates\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part(i)\n",
+ "Since lamda_c = 16 which is greater than lamda_o1, only TE10 mode propagates\n",
+ "\n",
+ "Part(ii)\n",
+ "TE10 mode propagates\n",
+ "TM11 mode propagates\n",
+ "TM21 mode propagates\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.16, Page number 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine characteristic wave impedance'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 3 #length of rectangular waveguide(cms)\n",
+ "b = 2 #breadth of rectangular waveguide(cms)\n",
+ "f = 10.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "n = 120*math.pi #intrinsic impedance\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_c = (2*a*b)/(math.sqrt(a**2+b**2))\n",
+ "lamda_o = c/f\n",
+ "Ztm = n*math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "\n",
+ "#Result\n",
+ "print \"Solution obtained in the textbook are incorrect due to calculation mistake in Ztm\"\n",
+ "print \"characteristic wave impedance =\",round(Ztm,3),\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Solution obtained in the textbook are incorrect due to calculation mistake in Ztm\n",
+ "characteristic wave impedance = 163.242 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.17, Page number 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine diameter of waveguide and guide wavelength'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 6.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**10 #velocity of propagation(cm/s)\n",
+ "\n",
+ "#Calculations\n",
+ "fc = 0.8*f\n",
+ "lamda_c = c/fc\n",
+ "D = (lamda_c*1.841)/math.pi\n",
+ "lamda_o = c/f\n",
+ "lamda_g = lamda_o/(math.sqrt(1-((lamda_o/lamda_c)**2)))\n",
+ "\n",
+ "#Results\n",
+ "print \"diameter of waveguide =\",round(D,4),\"cms\"\n",
+ "print \"guide wavelength =\",round(lamda_g,3),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diameter of waveguide = 3.6626 cms\n",
+ "guide wavelength = 8.333 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.18, Page number 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Analysis of TE01 mode'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 1.5 #length of waveguide(cms)\n",
+ "b = 1 #breadth of waveguide(cms)\n",
+ "c = 3*10**10 #velocity of propagation\n",
+ "Er = 4 #dielectric\n",
+ "f = 6*10**9 #frequency(Hz)\n",
+ "\n",
+ "#Calculations and Results\n",
+ "lamda_c = 2*a\n",
+ "fc = c/lamda_c\n",
+ "if f<fc:\n",
+ " print \"The impressed frequency of 6GHz is less than the cut-off frequency and hence the signal will not pass through the guide\"\n",
+ "lamda1 = c/f\n",
+ "if lamda1>lamda_c:\n",
+ " print \"Since the wavelength of the impressed signal is longer than the cut-off wavelength, there is no propagation of wave\"\n",
+ "lamda2 = lamda1/math.sqrt(Er)\n",
+ "if lamda2<lamda1:\n",
+ " print \"The signal with 6GHz frequency will pass through the dielectric load waveguide\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impressed frequency of 6GHz is less than the cut-off frequency and hence the signal will not pass through the guide\n",
+ "Since the wavelength of the impressed signal is longer than the cut-off wavelength, there is no propagation of wave\n",
+ "The signal with 6GHz frequency will pass through the dielectric load waveguide\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.19, Page number 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the amount of attenuation'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 1.5*10**-2 #length of rectangular waveguide(m)\n",
+ "b = 1 #breadth of rectangular waveguide(cms)\n",
+ "f = 6*10**9 #frequency(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "m = 1\n",
+ "n = 0\n",
+ "mu = 4*math.pi*10**-7\n",
+ "e = 8.854*10**-12\n",
+ "\n",
+ "#Calculations\n",
+ "#For dominant TE10 mode,\n",
+ "lamda_c = 2*a\n",
+ "fc = c/lamda_c\n",
+ "w = 2*math.pi*f\n",
+ "alpha = math.sqrt((((m*math.pi)/a)**2)+(((n*math.pi)/b)**2)- ((w**2)*mu*e))\n",
+ "\n",
+ "#Results\n",
+ "print \"The amount of attenuation is\",round(alpha,2),\"nepass/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of attenuation is 167.49 nepass/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.20, Page number 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the maximum power handling capacity of the waveguide'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 3\n",
+ "b = 1\n",
+ "f = 9.*10**9\n",
+ "Emax = 3.*10**3\n",
+ "c = 3.*10**10\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "lamda_c = 2*a\n",
+ "lamda_g = lamda_o/(math.sqrt(1-((lamda_o/lamda_c)**2)))\n",
+ "P = 6.63*10**-4*Emax**2*a*b*(lamda_o/lamda_g)\n",
+ "\n",
+ "#Result\n",
+ "print \"Solution obtained in the textbook are incorrect due to calculation mistake in lamda_g\"\n",
+ "print \"The maximum power handling capacity of the waveguide =\",round((P/1E+3),3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Solution obtained in the textbook are incorrect due to calculation mistake in lamda_g\n",
+ "The maximum power handling capacity of the waveguide = 14.884 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.21, Page number 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate maximum power'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 9*10**9 #frequency(Hz)\n",
+ "d = 5 #internal diameter(cms)\n",
+ "Emax = 300 #maximum field strength(V/cm)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "#For domnant mode TE11,\n",
+ "lamda_c = (math.pi*d)/1.841\n",
+ "lamda_g = lamda_o/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "Pmax = 0.498*(Emax**2)*(d**2)*(lamda_o/lamda_g)\n",
+ "\n",
+ "#Results\n",
+ "print \"Maximum power =\",round((Pmax/1E+6),3),\"*10^6 W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power = 1.049 *10^6 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.22, Page number 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find peak value of electric field occuring in the guide'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Varaible declaration\n",
+ "c = 3.*10**10 #velocity of propagation(m/s)\n",
+ "f = 30.*10**9 #frequency(Hz)\n",
+ "a = 1 #length(cm)\n",
+ "b = 1 #breadth(cm)\n",
+ "n = 120*math.pi\n",
+ "\n",
+ "#Calclations\n",
+ "lamda_o = c/f\n",
+ "lamda_c = 2.*a\n",
+ "Zte = n/(math.sqrt(1-((lamda_o/lamda_c)**2)))\n",
+ "#Since 1hp = 746 watt = Pmax,\n",
+ "Pmax = 746\n",
+ "Emax = math.sqrt((Pmax*4*Zte)/(a*b))\n",
+ "\n",
+ "#Results\n",
+ "print \"Solution obtained in the textbook are incorrect as the value of a & b is taken wrong\"\n",
+ "print \"Peak value of electric field is\",round(Emax,3),\"V/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Solution obtained in the textbook are incorrect as the value of a & b is taken wrong\n",
+ "Peak value of electric field is 1139.724 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.23, Page number 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the breakdown power of an airfilled rectangular waveguide'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 2.3 #length of rectangular waveguide(cms)\n",
+ "b = 1.0 #breadth of rectangular waveguide(cms)\n",
+ "f = 9.375*10**9 #frequency(Hz)\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "x = (1-((lamda_o/(2*a))**2))**0.5\n",
+ "Pbd = 597*a*b*x\n",
+ "\n",
+ "#Results\n",
+ "print \"Breakdown power =\",round(Pbd,3),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Breakdown power = 986.406 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.24, Page number 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the breakdown power'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 5. #internal diameter(cms)\n",
+ "a = d/2\n",
+ "f = 9.*10**9 #frequency(Hz)\n",
+ "c = 3.*10**10 #velocity of propagation\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_o = c/f\n",
+ "lamda_c = (math.pi*d)/1.841\n",
+ "fc = c/lamda_c\n",
+ "x = (1 - ((fc/f)**2))**0.5\n",
+ "Pbd = 1790.*a*a*x\n",
+ "\n",
+ "#Results\n",
+ "print \"Breakdown power =\",round((Pbd/1E+3),3),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Breakdown power = 10.298 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_5.ipynb b/Microwave_and_Radar_Engineering/Chapter_5.ipynb
new file mode 100644
index 00000000..b5542bc5
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_5.ipynb
@@ -0,0 +1,200 @@
+{
+ "metadata": {
+ "name": "Chapter 5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chpater 5:Cavity Resonators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, Page number 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate minimum distance between two plates'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 3 #radius of circular waveguide(cm)\n",
+ "fo = 10*10**9 #frequency for TM011 mode(Hz)\n",
+ "P01 = 2.405\n",
+ "c = 3*10**10 #velocity of proapagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "d = math.sqrt((math.pi**2)/(((4*math.pi**2)/9)-((P01/a)**2)))\n",
+ "\n",
+ "#Result\n",
+ "print \"The minimum distance between two plates is\",round(d,2),\"cms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum distance between two plates is 1.62 cms\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, Page number 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find out the lowest resonating frequency of a rectangular resonator'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "#dimensions of resonator\n",
+ "a = 2.\n",
+ "b = 1.\n",
+ "d = 3.\n",
+ "#For dominant mode TE101,\n",
+ "m = 1.\n",
+ "n = 0\n",
+ "p = 1.\n",
+ "\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "fo = (c/2)*(((m/a)**2+(n/b)**2+(p/d)**2))**0.5\n",
+ "\n",
+ "#Result\n",
+ "print \"The lowest resonating frequency of a rectangular cavity resonator is\",round((fo/1E+9),2),\"Ghz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lowest resonating frequency of a rectangular cavity resonator is 9.01 Ghz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page number 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the resonanat frequency of a circular resonator for the folowing specifications'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 12.5 #diameter of resonator(cm)\n",
+ "d = 5 #length of resonator(cm)\n",
+ "P01 = 2.405 #dominant mode TM01\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#For TM012 mode,\n",
+ "m = 1\n",
+ "n = 0\n",
+ "p = 2\n",
+ "\n",
+ "#Calculation\n",
+ "a = D/2\n",
+ "fo = (c/(2*math.pi))*((P01/a)**2+((p*math.pi)/d)**2)**0.5\n",
+ "\n",
+ "#Result\n",
+ "print \"The resonanat frequency of a circular resonator is\",round((fo/1E+9),2),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resonanat frequency of a circular resonator is 6.27 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4, Page number 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the resonanat frequency of a circular resonator for the folowing specifications'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "#dimensions of resonator\n",
+ "a = 3.\n",
+ "b = 2.\n",
+ "d = 4.\n",
+ "#For dominant mode TE101,\n",
+ "m = 1.\n",
+ "n = 0\n",
+ "p = 1.\n",
+ "\n",
+ "c = 3*10**10 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculation\n",
+ "fo = (c/2)*(((m/a)**2+(n/b)**2+(p/d)**2))**0.5\n",
+ "\n",
+ "#Result\n",
+ "print \"The lowest resonating frequency of a circular resonator is\",round((fo/1E+9),2),\"Ghz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lowest resonating frequency of a circular resonator is 6.25 Ghz\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_6.ipynb b/Microwave_and_Radar_Engineering/Chapter_6.ipynb
new file mode 100644
index 00000000..cd9f5cb9
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_6.ipynb
@@ -0,0 +1,546 @@
+{
+ "metadata": {
+ "name": "Chapter 6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Microwave components"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2, Page number 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculating the distance between S12 and S21'''\n",
+ "\n",
+ "from numpy import array\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "S = array([[0,0.3+0.4j], [0.3+0.4j, 0]], dtype=complex)\n",
+ "B = 34.3 #rad/sec\n",
+ "\n",
+ "#Calculations\n",
+ "'''Let port 1 be shifted by phi-1 gegrees to the lfet and port 2 remain unchanged\n",
+ "phi-1 = [[e^(-j*phi-1), 0]\n",
+ " [0 1]]\n",
+ "Solving [S-dash]=[phi]*[S]*[phi], we get,'''\n",
+ "phi1 = 53.13\n",
+ "l = math.radians(phi1)/B\n",
+ "\n",
+ "#Result\n",
+ "print \"The distance is\",round(l,5),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The distance is 0.02703 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3, Page number 236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine the scattering parameters'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "D = 30 #directiviy(dB)\n",
+ "s = 1 #VSWR\n",
+ "\n",
+ "#Calculations\n",
+ "#since C = -10*log(p1/p4),therefore,\n",
+ "S41 = math.sqrt(0.1)\n",
+ "S14=S41 #as matched and lossless\n",
+ "\n",
+ "#Now, D = 10*log(p4/p3)\n",
+ "S31=math.sqrt(S41**2/10**3)\n",
+ "S13=S31\n",
+ "\n",
+ "S11 = ((s-1)/(s+1))\n",
+ "S22=S11\n",
+ "S33=S11\n",
+ "S44=S11\n",
+ "\n",
+ "#Let input power be given at port 1\n",
+ "S21 = math.sqrt(1-S31**2-S41**2)\n",
+ "S12=S21\n",
+ "\n",
+ "S34 = math.sqrt((1+S12**2-10**-1-10**-4)*0.5)\n",
+ "S43=S34\n",
+ "\n",
+ "S23 = math.sqrt(1-10**-4-S34**2)\n",
+ "S32=S23\n",
+ "\n",
+ "S24 = math.sqrt(1-10**-1-S34**2)\n",
+ "S42=S24\n",
+ "\n",
+ "S = array([[S11,S12,S13,S14],[S21,S22,S23,S24],[S31,S32,S33,S34],[S41,S42,S43,S44]])\n",
+ "\n",
+ "#Result\n",
+ "print \"The required S-parameters are:\\n\\n\",S"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required S-parameters are:\n",
+ "\n",
+ "[[ 0. 0.94863059 0.01 0.31622777]\n",
+ " [ 0.94863059 0. 0.31622777 0.01 ]\n",
+ " [ 0.01 0.31622777 0. 0.94863059]\n",
+ " [ 0.31622777 0.01 0.94863059 0. ]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page number 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determining the power in remaining ports when other ports are terminated'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a1 = 32 #signal power(mW) to port 1\n",
+ "a2 = 0 #power fed to port 2\n",
+ "a3 = 0 #power fed to port 3\n",
+ "s = array([[0.5,-0.5,math.sqrt(0.5)],[-0.5,0.5,math.sqrt(0.5)],[math.sqrt(0.5),math.sqrt(0.5),0]]) #s-matrix for H-plane Tee\n",
+ "\n",
+ "#Calculations\n",
+ "p = array([a1,a2,a3])\n",
+ "b = (s**2)*p\n",
+ "print \"[b]=\\n\",b\n",
+ "\n",
+ "#Results\n",
+ "print \"\\nPower at port 1 =\",b[0,0],\"mW\"\n",
+ "print \"Power at port 2 =\",b[1,0],\"mW\"\n",
+ "print \"Power at port 3 =\",b[2,0],\"mW\"\n",
+ "print \"It can be seen that b3=b1+b2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[b]=\n",
+ "[[ 8. 0. 0.]\n",
+ " [ 8. 0. 0.]\n",
+ " [ 16. 0. 0.]]\n",
+ "\n",
+ "Power at port 1 = 8.0 mW\n",
+ "Power at port 2 = 8.0 mW\n",
+ "Power at port 3 = 16.0 mW\n",
+ "It can be seen that b3=b1+b2\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5, Page number 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate power delivered to the loads connected to ports 1 & 2'''\n",
+ "\n",
+ "from numpy import array\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = array([[0.5,-0.5,math.sqrt(0.5)],[-0.5,0.5,math.sqrt(0.5)],[math.sqrt(0.5),math.sqrt(0.5),0]]) #s-matrix for H-plane Tee\n",
+ "b1=10*10**-3 #power at port 1\n",
+ "b2=10*10**-3 #power at port 2\n",
+ "\n",
+ "#Calculations\n",
+ "rho1=(60.-50.)/(60.+50.)\n",
+ "rho2=(75.-50.)/(75.+50.)\n",
+ "P1=0.5*b1**2*(1-rho1**2)\n",
+ "P2=0.5*b2**2*(1-rho2**2)\n",
+ "\n",
+ "#Results\n",
+ "print \"The solution given in the textbook is incorrect.\\n\"\n",
+ "print \"Power delivered to port 1 =\",round((P1/1E-3),3),\"mW\"\n",
+ "print \"Power delivered to port 2 =\",round((P2/1E-3),3),\"mW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The solution given in the textbook is incorrect.\n",
+ "\n",
+ "Power delivered to port 1 = 0.05 mW\n",
+ "Power delivered to port 2 = 0.048 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.7, Page number 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine scattering matrix of the isolator'''\n",
+ "\n",
+ "from numpy import array\n",
+ "\n",
+ "#Variable declaration\n",
+ "Il=0.5 #inserion loss(dB)\n",
+ "Is = 30 #isolation loss(dB)\n",
+ "\n",
+ "#Calculations\n",
+ "#Il = -20log(S21)\n",
+ "S21 = 10**(-Il/20)\n",
+ "#Is = -20log(S12)\n",
+ "S12 = 10**(-Is/20)\n",
+ "#Perfectly matched ports\n",
+ "S11=0\n",
+ "S22=0\n",
+ "\n",
+ "S = array([[S11,S12],[S21,S22]])\n",
+ "\n",
+ "#Result\n",
+ "print \"The scattering matrix is:\\n\",S\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The scattering matrix is:\n",
+ "[[ 0. 0.01 ]\n",
+ " [ 0.94406088 0. ]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.9, Page number 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determining the [S] of a 3-port circulator'''\n",
+ "\n",
+ "from numpy import array\n",
+ "\n",
+ "#Variable declaration\n",
+ "Il= 0.5 #inserion loss(dB)\n",
+ "Is = 20 #isolation loss(dB)\n",
+ "S = 2 #VSWR\n",
+ "\n",
+ "#Calculations\n",
+ "#Il = -20log(S21)\n",
+ "S21 = 10**(-Il/20)\n",
+ "#For circulator,\n",
+ "S32=S21\n",
+ "S13=S21\n",
+ "\n",
+ "#Is = -20log(S12)\n",
+ "S12 = 10**(-Is/20)\n",
+ "#For circulator,\n",
+ "S23=S12\n",
+ "S31=S12\n",
+ "\n",
+ "rho = (S-1.)/(S+1.)\n",
+ "#For circulator,\n",
+ "S11=rho\n",
+ "S22=rho\n",
+ "S33=rho\n",
+ "\n",
+ "#Results\n",
+ "S = array([[S11,S12,S13],[S21,S22,S23],[S31,S32,S33]])\n",
+ "print \"[S]=\\n\",S\n",
+ "#For a perfectly matched, non-reciprocal, lossless 3-port circulator, [s] is given by,\n",
+ "''' [S] = [[0 0 S13]\n",
+ " [S21 0 0 ]\n",
+ " [0 S32 0 ]]'''\n",
+ "#The terminal planes are such that phase angles of S13=S21=S32=1\n",
+ "S13_new=1\n",
+ "S21_new=1\n",
+ "S32_new=1\n",
+ "S_new = array([[0,0,S13_new],[S21_new,0,0],[0,S32_new,0]])\n",
+ "print \"\\nThe scattering matrix now becomes [S]=\\n\",S_new"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[S]=\n",
+ "[[ 0.33333333 0.1 0.94406088]\n",
+ " [ 0.94406088 0.33333333 0.1 ]\n",
+ " [ 0.1 0.94406088 0.33333333]]\n",
+ "\n",
+ "The scattering matrix now becomes [S]=\n",
+ "[[0 0 1]\n",
+ " [1 0 0]\n",
+ " [0 1 0]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.10, Page number 242\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Finding the output power at the ports'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pi = 90. #power source(W)\n",
+ "C = 20 #dB\n",
+ "D = 35 #dB\n",
+ "Is = 0.5 #insertion loss(dB)\n",
+ "\n",
+ "#Calculations\n",
+ "#C = 20=10log(Pi/Pf)\n",
+ "Pf = Pi/(10**(20./10.))\n",
+ "#D=350=10log(Pf/Pb)\n",
+ "Pb = Pf/(10**(35./10.))\n",
+ "Pr = Pi-Pf-Pb #received power\n",
+ "Pr_db = 10*math.log10(Pi/Pr)\n",
+ "Pr_dash=Pr_db-Is\n",
+ "\n",
+ "#Result\n",
+ "print \"The output power at the port is\",round(Pr_dash,3),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output power at the port is -0.456 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.11, Page number 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Finding the directivity, coupling and islotaion for a directional coupler'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "'''\n",
+ "[S] = [[0.05/_30 0.96/_0 0.1/_90 0.05/_90]\n",
+ " [0.96/_0 0.05/_30 0.05/_90 0.1/_90 ]\n",
+ " [0.1/_90 0.05/_90 0.05/_30 0.96/_0 ]\n",
+ " [0.05/_90 0.1/_90 0.96/_0 0.05/_30]]\n",
+ "'''\n",
+ "\n",
+ "#Calculations\n",
+ "#Coupling = C=10log(P1/P3)=-20log|S13|\n",
+ "C = -20*math.log10(0.1)\n",
+ "#Directivity = D=10log(P3/P4)=20log(|S13|/|S14|)\n",
+ "D = 20*math.log10(0.1/0.05)\n",
+ "#Isolation =I=10log(P3/P4)=10log(P1/P4)=-20log|S14|\n",
+ "I = -20*math.log10(0.05)\n",
+ "\n",
+ "#Results\n",
+ "print \"Coupling =\",C,\"dB\"\n",
+ "print \"Directivity =\",round(D,2),\"dB\"\n",
+ "print \"Isolation =\",round(I,2),\"dB\"\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Coupling = 20.0 dB\n",
+ "Directivity = 6.02 dB\n",
+ "Isolation = 26.02 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.12, Page number 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determining VSWR'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda2 = 3.5 #distance between 2 minimas(cm)\n",
+ "lamda_g = 7 #guided wavelength(cm)\n",
+ "d2_1 = 2.5*10**-1 #distance between minimum power points(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "S = lamda_g/(math.pi*d2_1)\n",
+ "\n",
+ "#Result\n",
+ "print \"VSWR =\",round(S,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 8.9127\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.13, Page number 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determining the phase shift component in a phase shift measurement setup'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda_g = 7.2 #guided wavelength(cm)\n",
+ "rn = 10.5 #position of reference null(cm)\n",
+ "rn_new = 9.3 #new position of reference null due to component(cm)\n",
+ "\n",
+ "#Calculations\n",
+ "pd = rn - rn_new #path difference due to component(cm)\n",
+ "ps = (2*math.pi*pd)/lamda_g #phase shift introduced\n",
+ "\n",
+ "#Result\n",
+ "print \"The phase shift component is\",round(ps,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The phase shift component is 1.047\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_7.ipynb b/Microwave_and_Radar_Engineering/Chapter_7.ipynb
new file mode 100644
index 00000000..4220d38b
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_7.ipynb
@@ -0,0 +1,189 @@
+{
+ "metadata": {
+ "name": "Chapter 7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7:Microwave Measurements"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page number 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculating VSWR'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "a = 4 #length of waveguide(cms)\n",
+ "b = 2.5 #breadth of waveguide(cms)\n",
+ "d = 1*10**-1 #d2- d1(m)\n",
+ "c = 3*10**10 #velocity of propgation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda_c = 2*a\n",
+ "lamda_o = c/f\n",
+ "lamda_g = lamda_o/math.sqrt(1-((lamda_o/lamda_c)**2))\n",
+ "s = lamda_g/(math.pi*d)\n",
+ "\n",
+ "#Results\n",
+ "print \"VSWR =\",round(s)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the value of reflected power nad VSWR'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaation & Calculations\n",
+ "Pi = 3*10**-3*100 #incident power(w)\n",
+ "Pr = 0.1*10**-3*100 #reflected power(W)\n",
+ "rho = math.sqrt(Pr/Pi)\n",
+ "s = (1+rho)/(1-rho)\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflected power =\",round(rho,2),\"W\"\n",
+ "print \"VSWR =\",round(s,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflected power = 0.18 W\n",
+ "VSWR = 1.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find value of VSWR'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Pr = 0.15*10**-3 #reflected power(W)\n",
+ "Pi = 2.5*10**-3 #incident power(W)\n",
+ "\n",
+ "#Calculations\n",
+ "rho = math.sqrt(Pr/Pi)\n",
+ "s = (1+rho)/(1-rho)\n",
+ "\n",
+ "#Results\n",
+ "print \"VSWR =\",round(s,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 1.65\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, Page number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Find value of reflected power'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 2. #VSWR\n",
+ "Pi = 4.5*10**-3*1000 #incident power(W)\n",
+ "c = 30 #couplers\n",
+ "\n",
+ "#Calculations\n",
+ "#s = (1+rho)/(1-rho)\n",
+ "rho = (s-1)/(s+1)\n",
+ "Pr = rho**2*Pi\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflected power =\",Pr,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflected power = 0.5 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_8.ipynb b/Microwave_and_Radar_Engineering/Chapter_8.ipynb
new file mode 100644
index 00000000..d2c5bc27
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_8.ipynb
@@ -0,0 +1,1025 @@
+{
+ "metadata": {
+ "name": "Chapter 8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Microwave Tubes and Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1, Page number 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Compute -\n",
+ "a)dc electron velocity\n",
+ "b)dc phase constant\n",
+ "c)plasma frequency\n",
+ "d)reduced plasma frequency \n",
+ "e)dc beam current density\n",
+ "f)instantaeneous beam current density'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 14.5*10**3 #beam voltage(V)\n",
+ "i = 1.4 #beam current(A)\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "rho_o = 10**-6 #dc electron charge density(c/m^3)\n",
+ "rho = 10**-8 #RF charge density(c/m^3)\n",
+ "V = 10**5 #velocity perturbations(m/s)\n",
+ "eo = 8.854*10**-12\n",
+ "R = 0.4\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo) #dc electron velocity\n",
+ "\n",
+ "#Part b\n",
+ "w = 2.*math.pi*f\n",
+ "ip = w/vo #dc phase current\n",
+ "\n",
+ "#Part c\n",
+ "wp = math.sqrt((1.759*10**11*rho_o)/eo)\n",
+ "\n",
+ "#Part d\n",
+ "wq = R*wp\n",
+ "\n",
+ "#Part e\n",
+ "Jo = rho_o * vo\n",
+ "\n",
+ "#Part f\n",
+ "J = rho*vo+rho_o*V\n",
+ "\n",
+ "#Results\n",
+ "print \"dc electron velocity =\",round((vo/1E+8),3),\"*10**8 m/sec\"\n",
+ "print \"dc phase curent =\",round(ip,2),\"rad/sec (Calculation mistake in the textbook)\"\n",
+ "print \"plasma frequency =\",round((wp/1E+8),2),\"*10**8 rad/sec\"\n",
+ "print \"Reduced plasma frequency =\",round((wq/1E+8),3),\"*10**8 rad/sec\"\n",
+ "print \"dc beam current density =\",round(Jo,2), \"A/m^2\"\n",
+ "print \"instantaeneous beam current density =\",round(J,3),\"A/m^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc electron velocity = 0.714 *10**8 m/sec\n",
+ "dc phase curent = 879.92 rad/sec (Calculation mistake in the textbook)\n",
+ "plasma frequency = 1.41 *10**8 rad/sec\n",
+ "Reduced plasma frequency = 0.564 *10**8 rad/sec\n",
+ "dc beam current density = 71.41 A/m^2\n",
+ "instantaeneous beam current density = 0.814 A/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2, Page number 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine -\n",
+ "a)input rms voltage\n",
+ "b)output rms voltage\n",
+ "c)power delivered to the load'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Av = 15. #voltage gain(dB)\n",
+ "Pin = 5*10**-3 #input power(W)\n",
+ "Rsh_in = 30*10**3 #Rsh of input cavity(Ohms)\n",
+ "Rsh_out = 20.*10**3 #Rsh of output cavity(Ohms)\n",
+ "Rl = 40*10**4 #load impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "V1 = math.sqrt(Pin*Rsh_in) #input rms voltage\n",
+ "\n",
+ "#Part b\n",
+ "#Av = 20log(V2/V1) db\n",
+ "V2 = V1*10**(Av/20) #deriving V2 from above equation\n",
+ "\n",
+ "#Part c\n",
+ "Pout = (V2**2)/Rsh_out #output power\n",
+ "\n",
+ "#Results\n",
+ "print \"input rms voltage =\",round(V1,2),\"V\"\n",
+ "print \"output rms voltage =\",round(V2,2),\"V\"\n",
+ "print \"output power =\",round((Pout/1E-3),2),\"mW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input rms voltage = 12.25 V\n",
+ "output rms voltage = 68.87 V\n",
+ "output power = 237.17 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3, Page number 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Dtermine -\n",
+ "a)input power\n",
+ "b)output power\n",
+ "c)efficiency'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 2 #no. of modes\n",
+ "Vo = 300 #beam voltage(V)\n",
+ "Io = 20*10**-3 #beam current(A)\n",
+ "J1X = 1.25\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Pdc = Vo*Io #input power\n",
+ "\n",
+ "#Part b\n",
+ "Pac = (2*Pdc*J1X)/(2*math.pi*n-(math.pi/2))\n",
+ "\n",
+ "#Part c\n",
+ "N = (Pac/Pdc)*100. #efficiency\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"Input power =\",round(Pdc,2),\"W\"\n",
+ "print \"Output power =\",round(Pac,2),\"W\"\n",
+ "print \"Efficiency =\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 6.0 W\n",
+ "Output power = 1.36 W\n",
+ "Efficiency = 22.74 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4, Page number 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine -\n",
+ "a)electron velocity \n",
+ "b)dc transit time of electrons\n",
+ "c)input voltage for maximum output voltage\n",
+ "d)voltage gain in decibles'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Varaible declaration\n",
+ "Vo = 900 #beam voltage(V)\n",
+ "Io = 30*10**-3 #beam current(A)\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "d = 1*10**-3 #gap spacing in either cavity(m)\n",
+ "L = 4*10**-2 #spacing between centers of cavities(m)\n",
+ "Rsh = 40*10**3 #effective shunt impedance(Ohms)\n",
+ "J1X = 0.582\n",
+ "X = 1.841\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "\n",
+ "#Part b\n",
+ "To = L/vo\n",
+ "\n",
+ "#Part c\n",
+ "w = 2*math.pi*f\n",
+ "theta_o = w*To\n",
+ "theta_g = (w*d)/vo\n",
+ "Bo = math.sin(theta_g/2)/(theta_g/2)\n",
+ "V1_max = (Vo*3.68)/(Bo*theta_o)\n",
+ "\n",
+ "#Part d\n",
+ "Ro = Vo/Io\n",
+ "Av = ((Bo**2)*theta_o*J1X*Rsh)/(Ro*X)\n",
+ "\n",
+ "#Results\n",
+ "print \"Electron velocity =\",round((vo/1E+6),2),\"*10**6 m/sec\"\n",
+ "print \"dc transit time of electrons =\",round((To/1E-8),3),\"*10**-8 sec\"\n",
+ "print \"Maximum input voltage =\",round(V1_max,3),\"V\"\n",
+ "print \"Volatge gain =\",round(Av,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron velocity = 17.79 *10**6 m/sec\n",
+ "dc transit time of electrons = 0.225 *10**-8 sec\n",
+ "Maximum input voltage = 41.923 V\n",
+ "Volatge gain = 23.278 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 86
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5, Page number 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "a)Find the input microwave voltage V1 in order to generate maximum output voltage\n",
+ "b)Determine the voltage gain (reflecting beam loading in the output cavity)\n",
+ "c)Calculate the efficiency of the amplifier neglecting beam loading\n",
+ "d)Compute the beam loading conductance and show that one may neglect it in the preceeding calculations'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 1200. #beam voltage(V)\n",
+ "Io = 28*10**-3 #beam current(A)\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "d = 1*10**-3 #gap spacing in either cavity(m)\n",
+ "L = 4.*10**-2 #spacing between centers of cavities(m)\n",
+ "Rsh = 40*10**3 #effective shunt impedance(Ohms)\n",
+ "J1X = 0.582\n",
+ "X = 1.841\n",
+ "Go = 23.3*10**-6\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "w = 2*math.pi*f\n",
+ "theta_o = (w*L)/vo\n",
+ "theta_g = (w*d)/vo\n",
+ "Bo = math.sin(theta_g/2)/(theta_g/2)\n",
+ "V1_max = (Vo*3.68)/(Bo*theta_o)\n",
+ "\n",
+ "#Part b\n",
+ "Ro = Vo/Io\n",
+ "Av = ((Bo**2)*theta_o*J1X*Rsh)/(Ro*X)\n",
+ "\n",
+ "#Part c\n",
+ "V2 = 2*Io*J1X*Bo*Rsh\n",
+ "N = ((0.58*V2)/Vo)*100\n",
+ "\n",
+ "#Part d\n",
+ "Gb = (Go*((Bo**2)-(Bo*math.cos(theta_g))))/2\n",
+ "Rb = 1/Gb\n",
+ "\n",
+ "#Results\n",
+ "print \"The input microwave voltage V1 in order to generate maximum output voltage is\",round(V1_max,2),\"V\"\n",
+ "print \"The voltage gain (reflecting beam loading in the output cavity) is\",round(Av,3)\n",
+ "print \"The efficiency of the amplifier neglecting beam loading is\",round(N,3),\"%\" \n",
+ "print \"The beam loading conductance is\",round((Rb/1E+3),2),\"K Ohms (Calculation mistake in the textbook)\"\n",
+ "print \"The value of\",round((Rb/1E+3),2),\"K Ohms is very much comparable to Rsh and cannot be neglected because theta_g is quite high\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input microwave voltage V1 in order to generate maximum output voltage is 58.71 V\n",
+ "The voltage gain (reflecting beam loading in the output cavity) is 17.058\n",
+ "The efficiency of the amplifier neglecting beam loading is 48.427 %\n",
+ "The beam loading conductance is 72.68 K Ohms (Calculation mistake in the textbook)\n",
+ "The value of 72.68 K Ohms is very much comparable to Rsh and cannot be neglected because theta_g is quite high\n"
+ ]
+ }
+ ],
+ "prompt_number": 111
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6, Page number 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "a)Find the value of repeller voltage Vr\n",
+ "b)Find the dc necesaary to give the microwave gap of voltage of 200V\n",
+ "c)Calculate the elctron efficiency'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 500. #beam voltage(V)\n",
+ "Rsh = 20*10**3 #effective shunt impedance(Ohms)\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "L = 1.*10**-3 #spacing between centers of cavities(m)\n",
+ "n = 2\n",
+ "e_m = 1.759*10**11\n",
+ "V1 = 200\n",
+ "J1X = 0.582\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "w = 2*math.pi*f\n",
+ "x = (e_m*((2*math.pi*n)-(math.pi/2))**2)/(8*(w**2)*(L**2))\n",
+ "y = math.sqrt(Vo/x)\n",
+ "Vr = y+Vo\n",
+ "\n",
+ "#Part b\n",
+ "Bo = 1 #Assumption\n",
+ "Io = V1/(2*J1X*Rsh)\n",
+ "\n",
+ "#Part c\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "theta_o = (w*2*L*vo)/(e_m*(Vr+Vo))\n",
+ "Bi = 1 #Assumption\n",
+ "X_dash = (V1*theta_o)/(2*Vo)\n",
+ "X = 1.51 #from graph\n",
+ "J1X = 0.84\n",
+ "N = ((2*J1X)/((2*math.pi*n)-(math.pi/2)))*100\n",
+ "\n",
+ "#Results\n",
+ "print \"The value of repeller voltage is\",round(Vr,2),\"V (Calculation mistake in the textbook)\"\n",
+ "print \"The dc necesaary to give the microwave gap of voltage of 200V is\",round((Io/1E-3),2),\"mA\"\n",
+ "print \"The elctron efficiency is\", round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of repeller voltage is 1189.36 V (Calculation mistake in the textbook)\n",
+ "The dc necesaary to give the microwave gap of voltage of 200V is 8.59 mA\n",
+ "The elctron efficiency is 15.28 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7, Page number 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "a)Determine the efficiency of the reflex klystron\n",
+ "b)Find the total power output in mW\n",
+ "c)If 20% of the power delivered by the elctron beam is dissipated in the cavity walls find the power delivered to the load'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 1 #no. of modes\n",
+ "Pdc = 40*10**-3 #input power(W)\n",
+ "V1_Vo = 0.278 #ratio\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "N = (V1_Vo*3*math.pi)/4\n",
+ "\n",
+ "#Part b \n",
+ "Pout = (8.91*Pdc)/100\n",
+ "\n",
+ "#Part c\n",
+ "Pl = (Pout*80)/100\n",
+ "\n",
+ "#Results\n",
+ "print \"The efficiency of the reflex klystron is\",round(N,3)\n",
+ "print \"The total power output is\",round((Pout/1E-3),2),\"W\"\n",
+ "print \"The power delivered to the load is\",round((Pl/1E-3),2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The efficiency of the reflex klystron is 0.655\n",
+ "The total power output is 3.56 W\n",
+ "The power delivered to the load is 2.85 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8, Page number 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine -\n",
+ "a)Hull cut-off voltage\n",
+ "b)Cut-off magnetic flux density\n",
+ "c)Cyclotron frequency'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "a = 0.15 #inner raddius(m)\n",
+ "b = 0.45 #outer radius(m)\n",
+ "Bo = 1.2*10**-3 #magnetic flux density(Wb/m^2)\n",
+ "Vo = 6000. #beam voltage(V)\n",
+ "e = 1.759*10**11\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "V = (e*Bo*(b**2)*(1-(a**2/b**2))**2)/8\n",
+ "\n",
+ "#Part b\n",
+ "Bc = math.sqrt(8*Vo)/(e**2)*b*(1-(a**2/b**2))**2\n",
+ "\n",
+ "#Part c\n",
+ "wc = (e*Bo)/(math.pi*2)\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"Please note that here are calculation errors in this problem. Hence, the difference in answers\\n\"\n",
+ "print \"Hull cut-off voltage =\",round((V/1E+3),2),\"kV\"\n",
+ "print \"Cut-off magnetic flux density =\",((Bc/1E-3)),\"mwb/m^2\"\n",
+ "print \"Cyclotron frequency =\",round(wc,2),\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that here are calculation errors in this problem. Hence, the difference in answers\n",
+ "\n",
+ "Hull cut-off voltage = 4221.6 kV\n",
+ "Cut-off magnetic flux density = 2.51765610822e-18 mwb/m^2\n",
+ "Cyclotron frequency = 33594425.39 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.9, Page number 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate axial phase velocity and the anode voltage'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 2*10**-3 #diameter of helical TWT(m)\n",
+ "n = 50. #no. of turns per cm\n",
+ "v = 3*10**8 #velocity of light(m/s)\n",
+ "m = 9.1*10**-31 #mass of electron\n",
+ "e = 1.6*10**-19 #charge on electron\n",
+ "\n",
+ "#Calculations\n",
+ "p = 1/n*10**-2 #pitch(m)\n",
+ "c = math.pi*d #circumference(m)\n",
+ "Vp = (v*p)/c \n",
+ "\n",
+ "Vo = (m*(Vp**2))/(2*e)\n",
+ "\n",
+ "#Results\n",
+ "print \"Axial phase velociity =\",round(Vp,2),\"m/sec\"\n",
+ "print \"Anode voltage =\",round(Vo,2),\"V(Calculation mistake in the textbook)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Axial phase velociity = 9549296.59 m/sec\n",
+ "Anode voltage = 259.32 V(Calculation mistake in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.10, Page number 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine -\n",
+ "a)electron velocity\n",
+ "b)dc electronic transit time\n",
+ "c)input voltage for maximum output voltage\n",
+ "d)voltage gain in decibles'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 900 #beam voltage(V)\n",
+ "Io = 30.*10**-3 #beam current(A)\n",
+ "f = 8.*10**9 #frequency(Hz)\n",
+ "d = 1.*10**-3 #gap spacing in either cavity(m)\n",
+ "L = 4.*10**-2 #spacing between centres of cavity(m)\n",
+ "Rsh = 40.*10**3 #effective shunt impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.593*10**6*math.sqrt(Vo)\n",
+ "\n",
+ "#Part b\n",
+ "Tt = d/vo\n",
+ "\n",
+ "#Part c\n",
+ "w = 2*math.pi*f\n",
+ "theta_g = (w*d)/vo\n",
+ "Bo = math.sin(theta_g/2)/(theta_g/2) #Beam coupling coefficient\n",
+ "theta_o = (w*L)/vo #dc transit angle\n",
+ "#For maximum o/p volltage,\n",
+ "J1X = 0.582\n",
+ "X = 1.841\n",
+ "V1max = (2*Vo*X)/(Bo*theta_o)\n",
+ "\n",
+ "#Part d\n",
+ "Av = (Bo**2*theta_o*J1X*Rsh)/(Io*X)\n",
+ "\n",
+ "#Results\n",
+ "print \"dc electron velocity =\",round((vo/1E+7),1),\"*10**7 m/sec\"\n",
+ "print \"Transit time =\",round((Tt/1E-10),2),\"*10^-10 s\"\n",
+ "print \"Input voltage for maximum output voltage =\",round(V1max,2),\"V\"\n",
+ "print \"Voltage gain =\",round((Av/1E+6),2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc electron velocity = 1.8 *10**7 m/sec\n",
+ "Transit time = 0.56 *10^-10 s\n",
+ "Input voltage for maximum output voltage = 41.95 V\n",
+ "Voltage gain = 23.28 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.11, Page number 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine -\n",
+ "a)dc electron velocity\n",
+ "b)dc phase constant\n",
+ "c)plasma frequency\n",
+ "d)reduced plasma frequency\n",
+ "e)beam current density\n",
+ "f)instantaneous bean current density'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 20*10**3 #beam voltage(V)\n",
+ "Io = 2 #beam current(A)\n",
+ "f = 9*10**9 #frequency(Hz)\n",
+ "rho_o = 10**-6 #dc electron charge density(c/m^3)\n",
+ "rho = 10**-8 #RF charge density(c/m^3)\n",
+ "V = 10**5 #velocity perturbations(m/s)\n",
+ "eo = 8.854*10**-12\n",
+ "R = 0.5\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.59*10**6*math.sqrt(Vo)\n",
+ "\n",
+ "#Part b\n",
+ "w = 2.*math.pi*f\n",
+ "ip = w/vo #dc phase current\n",
+ "\n",
+ "#Part c\n",
+ "wp = math.sqrt((1.759*10**11*rho_o)/eo)\n",
+ "\n",
+ "#Part d\n",
+ "wq = R*wp\n",
+ "\n",
+ "#Part e\n",
+ "Jo = rho_o * vo\n",
+ "\n",
+ "#Part f\n",
+ "J = rho*vo-rho_o*V\n",
+ "\n",
+ "#Results\n",
+ "print \"dc electron velocity =\",round((vo/1E+7),3),\"*10**7 m/sec\"\n",
+ "print \"dc phase constant =\",round(ip,2),\"rad/sec (Calculation mistake in the textbook)\"\n",
+ "print \"plasma frequency =\",round((wp/1E+8),2),\"*10**8 rad/sec\"\n",
+ "print \"Reduced plasma frequency =\",round((wq/1E+8),3),\"*10**8 rad/sec\"\n",
+ "print \"dc beam current density =\",round(Jo,2), \"A/m^2\"\n",
+ "print \"instantaeneous beam current density =\",round(J,2),\"A/m^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc electron velocity = 8.344 *10**7 m/sec\n",
+ "dc phase constant = 677.73 rad/sec (Calculation mistake in the textbook)\n",
+ "plasma frequency = 1.41 *10**8 rad/sec\n",
+ "Reduced plasma frequency = 0.705 *10**8 rad/sec\n",
+ "dc beam current density = 83.44 A/m^2\n",
+ "instantaeneous beam current density = 0.73 A/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.12, Page number 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calclate the gap transit angle and optimum length of drift region'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 5*10**9 #frequency(Hz)\n",
+ "Vo = 1000 #operating voltage(V)\n",
+ "n = 1.75 #no. of turns\n",
+ "Vr = -500 #repeller voltage(V)\n",
+ "d = 2*10**-3 #cavity gap(m)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "uo = 5.93*10**5*math.sqrt(Vo)\n",
+ "theta_g = (w*d)/uo\n",
+ "\n",
+ "#Results\n",
+ "print \"Transit angle =\",round(theta_g,2),\"radians\"\n",
+ "print \"\\nThe length of drift region cannot be computed as the value of F is not given\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transit angle = 3.35 radians\n",
+ "\n",
+ "The length of drift region cannot be computed as the value of F is not given\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.13, Page number 346"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)input RF voltage\n",
+ "b)voltage gain\n",
+ "c)efficiency'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 10*10**9 #frequency(Hz)\n",
+ "Vo = 1200 #beam voltage(V)\n",
+ "Io = 30*10**-3 #beam current(A)\n",
+ "d = 1*10**-3 #diameter(m)\n",
+ "Rsh = 40*10**3 #shunt resistance(Ohms)\n",
+ "L = 4*10**-2 #length(m)\n",
+ "X = 1.84\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "vo = 0.59*10**6*math.sqrt(Vo)\n",
+ "w = 2*math.pi*f\n",
+ "theta_o = (w*L)/vo\n",
+ "V1 = (2*X*Vo)/theta_o\n",
+ "theta_g = (theta_o*d)/L\n",
+ "Bi = (math.sin(theta_g/2))/(theta_g/2)\n",
+ "V1max = V1/Bi\n",
+ "\n",
+ "#Part b\n",
+ "J1X = 0.58 #from table\n",
+ "I2 = 2*Io*J1X\n",
+ "V2 = Bi*I2*Rsh\n",
+ "A = V2/V1\n",
+ "Av = 20*math.log10(A)\n",
+ "\n",
+ "#Part c\n",
+ "N = ((0.58*V2)/Vo)*100\n",
+ "\n",
+ "#Results\n",
+ "print \"Input RF voltage is\",round(V1max,2),\"V\" \n",
+ "print \"Voltage gain is\",round(Av,2),\"dB\"\n",
+ "print \"efficiency is\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input RF voltage is 55.23 V\n",
+ "Voltage gain is 28.03 dB\n",
+ "efficiency is 43.75 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.14, Page number 347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)cyclotron angular frequency\n",
+ "b)Hull cut-off voltage\n",
+ "c)cut-off magnetic flux density'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vo = 30*10**3 #beam voltage(V)\n",
+ "Io = 80 #beam current(A)\n",
+ "Bo = 0.01 #Wb/m**2\n",
+ "a = 4*10**-2 #length of magnetron(m)\n",
+ "b = 8*10**-2 #breadth of magnetron(m)\n",
+ "e = 1.6*10**-19 #charge on electron(C)\n",
+ "m = 9.1*10**-31 #mass of electron\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "w = (e*Bo)/m\n",
+ "\n",
+ "#Part b\n",
+ "Vhc = (e*(Bo**2)*(b**2)*((1-((a/b)**2))**2))/(8*m)\n",
+ "\n",
+ "#PArt c\n",
+ "Bc = ((8*Vo*(m/e))**0.5)/(b*(1-((a/b)**2)))\n",
+ "\n",
+ "#Results\n",
+ "print \"Cyclotron angular frequency =\",round((w/1E+9),3),\"*10**9 rad/s\"\n",
+ "print \"Hull cut-off voltage =\",round((Vhc/1E+3),3),\"kV\"\n",
+ "print \"Cut-off magnetic flux density =\",round((Bc/1E-3),3),\"mWb/m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cyclotron angular frequency = 1.758 *10**9 rad/s\n",
+ "Hull cut-off voltage = 7.912 kV\n",
+ "Cut-off magnetic flux density = 19.472 mWb/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.15, Page number 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine - \n",
+ "a)input power\n",
+ "b)output power\n",
+ "c)efficiency'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n = 2 #mode\n",
+ "Vo = 280 #beam volatge(V)\n",
+ "Io = 22*10**-3 #beam current(A)\n",
+ "V1 = 30 #signal voltage(V)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Pdc = Vo*Io\n",
+ "\n",
+ "#Part b\n",
+ "J1X = 1.25 #from table\n",
+ "Pac = (2*Pdc*J1X)/((2*n*math.pi)-(math.pi/2))\n",
+ "\n",
+ "#Part c\n",
+ "N = (Pac/Pdc)*100\n",
+ "\n",
+ "#Results\n",
+ "print \"Input power =\",round(Pdc,2),\"W\"\n",
+ "print \"Output power =\",round(Pac,2),\"W\"\n",
+ "print \"Efficiency =\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 6.16 W\n",
+ "Output power = 1.4 W\n",
+ "Efficiency = 22.74 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.16, Page number 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find -\n",
+ "a)repeller voltage\n",
+ "b)beam current'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 8*10**9 #frequency(Hz)\n",
+ "Vo = 300 #beam voltage(V)\n",
+ "Rsh = 20*10**3 #shunt resistance(Ohms)\n",
+ "L = 1*10**-3 #length(m)\n",
+ "V1 = 200 #gap voltage(V)\n",
+ "e_m = 1.759*10**11\n",
+ "n = 2 #mode\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "w = 2*math.pi*f\n",
+ "x = (e_m*((2*math.pi*n)-(math.pi/2))**2)/(8*(w**2)*(L**2))\n",
+ "y = math.sqrt(Vo/x)\n",
+ "Vr = y+Vo\n",
+ "\n",
+ "#Part b\n",
+ "Bo = 1 #assumption\n",
+ "J1X = 0.582 #from table\n",
+ "Io = V1/(2*J1X*Rsh)\n",
+ "\n",
+ "#Results\n",
+ "print \"Repeller voltage =\",round(Vr,3),\"V\"\n",
+ "print \"Beam current =\",round((Io/1E-3),2),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Repeller voltage = 833.98 V\n",
+ "Beam current = 8.59 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/Chapter_9.ipynb b/Microwave_and_Radar_Engineering/Chapter_9.ipynb
new file mode 100644
index 00000000..4a94447f
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/Chapter_9.ipynb
@@ -0,0 +1,635 @@
+{
+ "metadata": {
+ "name": "Chapter 9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9:Solid State Microwave devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine operating frequency of an IMPATT diode'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 2*10**-6 #drift length(m)\n",
+ "Vd = 10**7*10**-2 #dfrift velocit(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "f = Vd/(2*L)\n",
+ "\n",
+ "#Results\n",
+ "print \"Frequncy of IMPATT diode is\",round((f/1E+9),2),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequncy of IMPATT diode is 25.0 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine the threshold electric field'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 10*10**9 #operating frequency(Hz)\n",
+ "L = 75*10**-6 #device length(m)\n",
+ "V = 25. #voltage pulse amplified(V)\n",
+ "\n",
+ "#Calculations\n",
+ "Eth = V/(L)\n",
+ "\n",
+ "#Result\n",
+ "print \"The threshold electric field is\",round((Eth/1E+5),2),\"KV/cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The threshold electric field is 3.33 KV/cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine - \n",
+ "a)power gain in dB\n",
+ "b) power gain as USB converter'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "fs = 2*10**9 #signal frequency(Hz)\n",
+ "fp = 12*10**9 #pump frequency(Hz)\n",
+ "Ri = 16 #output resistance of signal generator(Ohms)\n",
+ "Rs = 1*10**3 #resistance of signal generator(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a \n",
+ "P = 10*math.log10((fp-fs)/fs)\n",
+ "\n",
+ "#Part b\n",
+ "Pc = 10*math.log10((fp+fs)/fs)\n",
+ "\n",
+ "#Results\n",
+ "print \"Please note that there are calculation mistakes in the textbook. Hence, the difference in answers.\\n\"\n",
+ "print \"Power gain =\",round(P,2),\"dB\"\n",
+ "print \"Power gain as USB converter =\",round(Pc,2),\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that there are calculation mistakes in the textbook. Hence, the difference in answers.\n",
+ "\n",
+ "Power gain = 6.99 dB\n",
+ "Power gain as USB converter = 8.45 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4, Page number 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)critical voltage\n",
+ "b)breakdown voltage\n",
+ "c)breakdown electric field'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Es = 12.5 #relative dielectric constant\n",
+ "N = 3.2*10**22 #donor concentration(/m**3)\n",
+ "L = 8*10**-6 #length(m)\n",
+ "Eo = 8.854*10**-12 #dielectric constant\n",
+ "q = 1.6*10**-19\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Vc = (q*N*L**2)/(2*Eo*Es)\n",
+ "\n",
+ "#Part b\n",
+ "Vbd = 2*Vc\n",
+ "\n",
+ "#Part c\n",
+ "Ebd = Vbd/L\n",
+ "\n",
+ "#Results\n",
+ "print \"Critical voltage =\",round((Vc/1E+3),2),\"kV\"\n",
+ "print \"Breakdown voltage =\",round((Vbd/1E+3),2),\"kV\"\n",
+ "print \"Breakdown electric field =\",round((Ebd/1E+8),2),\"*10**8 V/cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical voltage = 1.48 kV\n",
+ "Breakdown voltage = 2.96 kV\n",
+ "Breakdown electric field = 3.7 *10**8 V/cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate the avalanche zone velocity'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Na = 2.5*10**16 #doping concentration(/cm**3)\n",
+ "J = 33*10**3 #current density(A/cm**2)\n",
+ "q = 1.6*10**-19\n",
+ "\n",
+ "#Calculations\n",
+ "Vz = J/(q*Na)\n",
+ "\n",
+ "#Results\n",
+ "print \"The avalanche zone velocity is\",round((Vz/1E+6),2),\"*10**6 cm/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The avalanche zone velocity is 8.25 *10**6 cm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Determine the power gain'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Rd = -25 #negative resistance(Ohms)\n",
+ "Rl = 50 #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "G = ((Rd-Rl)/(Rd+Rl))**2\n",
+ "\n",
+ "#Results\n",
+ "print \"Power gain =\",G"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain = 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Find the minimum voltage required to initiate Gunn effect'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 5.*10**-6 #drift length(m)\n",
+ "V = 3.3*10**3 #voltagradient(V/cm)\n",
+ "\n",
+ "#Calculation\n",
+ "Vmin = V*L\n",
+ "\n",
+ "#Result\n",
+ "print \"The minimum voltage required is\",round(Vmin,4),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum voltage required is 0.0165 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate rational frequency and critical voltage of diode'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vd = 2*10**7 #drift velocity(cm/s)\n",
+ "L = 20*10**-6 #active lengh(m)\n",
+ "Ec = 3.3*10**3 #crtical field(GaAs)\n",
+ "\n",
+ "#Calculations\n",
+ "f = Vd/L\n",
+ "V = L*Ec\n",
+ "\n",
+ "#Results\n",
+ "print \"Please note that there are calculation mistakes in the textbook. Hence, the difference in answers.\\n\"\n",
+ "print \"Rational frequency =\",round((f/1E+9),2),\"GHz\"\n",
+ "print \"Critical voltage =\",round(V,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that there are calculation mistakes in the textbook. Hence, the difference in answers.\n",
+ "\n",
+ "Rational frequency = 1000.0 GHz\n",
+ "Critical voltage = 0.066 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.9, Page number 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine resonant frequency and efficiency'''\n",
+ "\n",
+ "from math import pi,sqrt\n",
+ "\n",
+ "#Variable declaration\n",
+ "Cj = 0.5*10**-12 #capacitance of IMPATT diode(F)\n",
+ "Lp = 0.5*10**-9 #Inductance of IMPATT diode(H)\n",
+ "Vbd = 100 #breakdown voltage(V)\n",
+ "Ib = 100*10**-3 #dc bias current(A)\n",
+ "Ip = 0.8 #peak current(A)\n",
+ "Rl = 2 #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "f = 1/(2*pi*sqrt(Lp*Cj))\n",
+ "Pl = ((Ip**2)*Rl)/2\n",
+ "Pdc = Vbd*Ib\n",
+ "N = (Pl/Pdc)*100\n",
+ "\n",
+ "#Results\n",
+ "print \"The resonant frequency is\",round((f/1E+9),1),\"GHz\"\n",
+ "print \"Efficiency is\",round(N,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resonant frequency is 10.1 GHz\n",
+ "Efficiency is 6.4 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.10, Page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Determine -\n",
+ "a)drift time\n",
+ "b)operating frequency of IMPATT diode'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vd = 10**5 #carrier dirft velocity(cm/s)\n",
+ "L = 2*10**-6 #drift length(m)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "tou = L/Vd\n",
+ "\n",
+ "#Part b\n",
+ "f = 1/(2*tou)\n",
+ "\n",
+ "#Results\n",
+ "print \"Drift time of the carrier is\",round((tou/1E-11),2),\"*10**-11 sec\"\n",
+ "print \"Operating frequency of diode is\",(f/1E+9),\"GHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift time of the carrier is 2.0 *10**-11 sec\n",
+ "Operating frequency of diode is 25.0 GHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.11, Page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)breakdown voltage\n",
+ "b)breakdown electric field'''\n",
+ "\n",
+ "#Variable declaration\n",
+ "Er = 11.8 #relative dielectric constant\n",
+ "N = 3*10**21 #donor concentration(m^-3)\n",
+ "L = 6.2*10**-6 #Si length(m)\n",
+ "q = 1.6*10**-19 #charge of an electron(C)\n",
+ "Eo = 8.854*10**-12 #dielctric constant\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "Vbd = (q*N*L**2)/(Eo*Er)\n",
+ "\n",
+ "#Part b\n",
+ "Ebd = Vbd/L\n",
+ "\n",
+ "#Results\n",
+ "print \"Breakdown voltage =\",round(Vbd,1),\"V\"\n",
+ "print \"Breakdown electric field =\",round((Ebd/1E+7),2),\"*10**7 V/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Breakdown voltage = 176.6 V\n",
+ "Breakdown electric field = 2.85 *10**7 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.12, Page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)Maximum power gain\n",
+ "b)Noise figure\n",
+ "c)Bandwidth'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "rQ = 8. #figure of merit\n",
+ "fo_fs = 8. #ratio of o/p to i/p frequency\n",
+ "Td = 300. #diode temperatur(K)\n",
+ "To = 300. #ambient temperature(K)\n",
+ "r = 0.2\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "X = rQ**2/fo_fs\n",
+ "G = (X/((1+math.sqrt(1+X))**2))*fo_fs\n",
+ "g = 10*math.log10(G)\n",
+ "\n",
+ "#Part b\n",
+ "F = 1+((2*Td)/To)*((1/rQ)+(1/rQ**2))\n",
+ "f = 10*math.log10(F)\n",
+ "\n",
+ "#Part c\n",
+ "BW = 2*r*math.sqrt(fo_fs)\n",
+ "\n",
+ "#Results\n",
+ "print \"Maximum power gain =\",round(g,2),\"dB\"\n",
+ "print \"Noise figure =\",round(f,2),\"dB\"\n",
+ "print \"Bandwidth =\",round(BW,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power gain = 6.02 dB\n",
+ "Noise figure = 1.08 dB\n",
+ "Bandwidth = 1.13\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.13, Page number 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Calculate -\n",
+ "a)Equivalent noise resistance\n",
+ "b)Gain\n",
+ "c)Noise figure\n",
+ "d)Bandwidth'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "fs = 2*10**9 #signal frequency(Hz)\n",
+ "fp = 12*10**9 #amplifier frquency(Hz)\n",
+ "fi = 10*10**9 #input frequency(Hz)\n",
+ "fd = 5*10**9 #diode frequency(Hz)\n",
+ "Ri = 1*10**3 #input resistance(Ohms)\n",
+ "Rg = 1*10**3 #gate resistance(Ohms)\n",
+ "RTs = 1*10**3 #resistance(Ohms)\n",
+ "RTi = 1*10**3 #resistance(Ohms)\n",
+ "r = 0.35 #resistane(Ohms)\n",
+ "rQ = 10. #figure of merit\n",
+ "rd = 300 #diode temperature(K)\n",
+ "C = 0.01*10**-12 #capacitance(F)\n",
+ "Td = 300\n",
+ "To = 300\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "ws = 2*pi*fs\n",
+ "wi = 2*pi*fi\n",
+ "R = (r**2)/(ws*wi*C**2*RTi)\n",
+ "a = R/RTs\n",
+ "\n",
+ "#Part b\n",
+ "G = (4*fi*Rg*Ri*a)/(fs*RTs*RTi*(1-a)**2)\n",
+ "g = 10*math.log10(G)\n",
+ "\n",
+ "#Part c\n",
+ "F = 1+((2*Td)/To)*((1/rQ)+(1/rQ**2))\n",
+ "f = 10*math.log10(F)\n",
+ "\n",
+ "#Part d\n",
+ "BW = (r/2)*math.sqrt(fd/(fs*G))\n",
+ "\n",
+ "#Results\n",
+ "print \"Equivalent noise resistance =\",round(a,2),\"Ohms\"\n",
+ "print \"Gain =\",round(g,2),\"dB\"\n",
+ "print \"Noise figure =\",round(f,2),\"dB\"\n",
+ "print \"Bandwidth =\",round(BW,3),\"(Calculation error in the textbook)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent noise resistance = 1.55 Ohms\n",
+ "Gain = 20.09 dB\n",
+ "Noise figure = 0.86 dB\n",
+ "Bandwidth = 0.027 (Calculation error in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/README.txt b/Microwave_and_Radar_Engineering/README.txt
new file mode 100644
index 00000000..37a02654
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Sachin Naik
+Course: be
+College/Institute/Organization: ITSource Technologies Ltd.
+Department/Designation: Telecom Engineer
+Book Title: Microwave and Radar Engineering
+Author: M. Kulkarni
+Publisher: Umesh Publications
+Year of publication: 2005
+Isbn: 81-88114-00-6
+Edition: 3rd \ No newline at end of file
diff --git a/Microwave_and_Radar_Engineering/screenshots/sachin1.png b/Microwave_and_Radar_Engineering/screenshots/sachin1.png
new file mode 100644
index 00000000..dd2559b4
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/screenshots/sachin1.png
Binary files differ
diff --git a/Microwave_and_Radar_Engineering/screenshots/sachin2.png b/Microwave_and_Radar_Engineering/screenshots/sachin2.png
new file mode 100644
index 00000000..93f52d70
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/screenshots/sachin2.png
Binary files differ
diff --git a/Microwave_and_Radar_Engineering/screenshots/sachin3.png b/Microwave_and_Radar_Engineering/screenshots/sachin3.png
new file mode 100644
index 00000000..21abafa9
--- /dev/null
+++ b/Microwave_and_Radar_Engineering/screenshots/sachin3.png
Binary files differ
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/README.txt b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/README.txt
new file mode 100644
index 00000000..e9dea4fd
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Jai Mathur
+Course: mca
+College/Institute/Organization: IIT
+Department/Designation: System Admin
+Book Title: Physical And Chemical Equilibrium For Chemical Engineers
+Author: N. de Nevers
+Publisher: John And Wiley & Sons Inc., New York
+Year of publication: 2002
+Isbn: 978-0471071709
+Edition: 1 \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch1.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch1.ipynb
new file mode 100644
index 00000000..48ad85eb
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch1.ipynb
@@ -0,0 +1,154 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction to Equilibrium"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page: 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate Mass Fraction, Mole fraction, Molality and PPM.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_i = 10. #[g]\n",
+ "m_w = 990. #[g]\n",
+ "M_i = 342.3 #[g]\n",
+ "M_w = 18. #[g]\n",
+ "\n",
+ "# Calculations\n",
+ "# The mass fraction is \n",
+ "# ( mass fraction of sucrose ) = x_i (by mass) = m_i/(sum of all subsmath.tances)\n",
+ "\n",
+ "x_i = m_i/(m_i+m_w)\n",
+ "x_i = x_i*100. # [in percentage]\n",
+ "\n",
+ "# This is also the weight fraction.\n",
+ "# The mole fraction is\n",
+ "# ( mole fraction of sucrose ) = x_j (by mole) = n_i/(sum of number moles of all the subsmath.tances)\n",
+ "n_i = m_i/M_i # number of moles of sucrose\n",
+ "n_w = m_w/M_w # number of moles of water\n",
+ "x_j = n_i/(n_i+n_w)\n",
+ "x_j = x_j*100 # [in percentage]\n",
+ "\n",
+ "# The molality, a concentration unit is widely used in equilibrium calculations, is defined as \n",
+ "# m (molality) = (moles of solute)/(kg of solvent)\n",
+ "m = n_i/m_w*1000 #[molal]\n",
+ "# For solutions of solids and liquids (but not gases) ppm almost always means ppm by mass, so \n",
+ "x_ppm = x_i*10**(6)/100. #[ppm]\n",
+ "\n",
+ "# Results\n",
+ "print \" sucrose concentration in terms of the mass fraction is %f%%\"%(x_i)\n",
+ "print \" sucrose concentration in terms of the mole fraction is %f%%\"%(x_j)\n",
+ "print \" sucrose concentration in terms of the molality is %f molal\"%(m)\n",
+ "print \" sucrose concentration in terms of the ppm is %f ppm\"%(x_ppm)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " sucrose concentration in terms of the mass fraction is 1.000000%\n",
+ " sucrose concentration in terms of the mole fraction is 0.053088%\n",
+ " sucrose concentration in terms of the molality is 0.029509 molal\n",
+ " sucrose concentration in terms of the ppm is 10000.000000 ppm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page: 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate Mass concentration , Mole concentration and Molarity\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 20. #[C]\n",
+ "d = 1.038143/1000*10.**(6) #[kg/m**(3)]\n",
+ "m_i = 10. #[g] mass of sucrose\n",
+ "M_i = 342.3 #[g/mol] molecular weight of sucrose\n",
+ "\n",
+ "# Calculations\n",
+ "# In the previous example i.e. example 1.1 the mass was chosen to be 1.00 kg, so that\n",
+ "m = 1.00 #[kg]\n",
+ "V = m/d*1000 #[L]\n",
+ "\n",
+ "# The mass concentration is\n",
+ "# m_1 ( mass concentration of sucrose ) = (mass of sucrose)/(volume of solution)\n",
+ "m_1 = m_i/V #[g/L]\n",
+ "\n",
+ "# The mole concentration is \n",
+ "# m_2 ( mole concentration of sucrose ) = (moles of sucrose)/(volume of solution)\n",
+ "\n",
+ "m_2 = (m_i/M_i)/V #[mol/L]\n",
+ "\n",
+ "# Results\n",
+ "print \" Mass concentration of the solution is %f g/L\"%(m_1)\n",
+ "print \" Mole concentration of the solution is %f mol/L\"%(m_2)\n",
+ "\n",
+ "# By the definition of the molarity, molarity is mole concentration of the solute\n",
+ "# so molarity \n",
+ "print \" Molarity of the solution is %f mol/L\"%(m_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mass concentration of the solution is 10.381430 g/L\n",
+ " Mole concentration of the solution is 0.030328 mol/L\n",
+ " Molarity of the solution is 0.030328 mol/L\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb
new file mode 100644
index 00000000..0a0c51e7
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb
@@ -0,0 +1,405 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Vapor Liquid Equilibrium VLE at High Pressures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.1 Page: 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find values using\n",
+ "Raoult's law\n",
+ "from L-R rule\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 100. #[psia] Bubble point pressure\n",
+ "x_ethane = 0.10 # Mole fraction of ethane in liquid phase\n",
+ "x_hepmath_tane = (1-x_ethane)\n",
+ "\n",
+ "# a) From figure 10.7( page 260 ) given in the book\n",
+ "# We read the chart to get the bubble-point temperature\n",
+ "# The dew point curve for 100 psia crosses the 10 mol% ethane line at about temperature \n",
+ "T1 = 165. #[C]\n",
+ "# Now, we horizontally from that intersection point to the dew-point curve, finding the vapor phase composition of ethane \n",
+ "y1_e = 0.92\n",
+ "y1_h = (1- y1_e)\n",
+ "\n",
+ "# b) By Raoult's law, we use a trial and error procedureon the temperature\n",
+ "# Antoine equation consmath.tants for ethanol are given \n",
+ "A_e = 6.80267\n",
+ "B_e = 656.4028\n",
+ "C_e = 255.99\n",
+ "\n",
+ "# and that for n-hepmath_tane are\n",
+ "A_h = 6.9024\n",
+ "B_h = 1268.115\n",
+ "C_h = 216.9\n",
+ "\n",
+ "# Antoine equation is given by\n",
+ "# (math.log10p) = (A - B/(T+C))\n",
+ "T = 50. #[C]\n",
+ "err = 1.\n",
+ " \n",
+ "# Calculations\n",
+ "while err > 10**(-4):\n",
+ " p1_e = (10**(A_e - B_e/(C_e + T)))*(14.7/760)\n",
+ " p1_h = (10**(A_h - B_h/(C_h + T)))*(14.7/760)\n",
+ " y2_e = p1_e*x_ethane/P\n",
+ " y2_h = p1_h*x_hepmath_tane/P\n",
+ " err = abs((y2_e + y2_h) - 1)\n",
+ " T = T + 0.0001\n",
+ "\n",
+ "# Changing the temperature in deg F \n",
+ "T2 = T*9./5 + 32 #[F] Bubble-point temperature\n",
+ "\n",
+ "# c) In this method, we use L-R rule, instead of simple Raoult's law\n",
+ "# So,\n",
+ "# y_i = (x_i*p_i)/(v_i*P)\n",
+ "# Where calculated values of v_i from EOS are given in the table 10.A and are \n",
+ "v_e = 0.950 # For ethane\n",
+ "v_h = 0.459 # For n-hepmath_tane\n",
+ "\n",
+ "# We again use trial and error on the temperature\n",
+ "# Let us assume the initial temperature \n",
+ "Ti = 50. #[C]\n",
+ "err = 1\n",
+ " \n",
+ "while err > 10**(-4):\n",
+ " p2_e = (10**(A_e - B_e/(C_e + Ti)))*(14.7/760)\n",
+ " p2_h = (10**(A_h - B_h/(C_h + Ti)))*(14.7/760)\n",
+ " y3_e = p2_e*x_ethane/(P*v_e)\n",
+ " y3_h = p2_h*x_hepmath_tane/(P*v_h)\n",
+ " err = abs((y3_e + y3_h) - 1)\n",
+ " Ti = Ti + 0.0001\n",
+ "\n",
+ "# Changing the temperature in deg F \n",
+ "T3 = Ti*9./5 + 32 #[F] Bubble-point temperature\n",
+ "\n",
+ "# Results\n",
+ "print \" The results are summarized in the following table:\"\n",
+ "print \" Variable \\t Values calculated from\\t Values calculated from \\t Values calculated \"\n",
+ "print \" \\t from figure 10.7 \\t Raoult''s law \\t\\t\\t from L-R rule\"\n",
+ "print \" Tdeg F) \\t %f \\t\\t %f \\t\\t\\t %f\"%(T1,T2,T3)\n",
+ "print \" y_ethane \\t %f \\t\\t %f \\t\\t\\t %f\"%(y1_e,y2_e,y3_e)\n",
+ "print \" y_heptane \\t %f \\t\\t %f \\t\\t\\t %f\"%(y1_h,y2_h,y3_h)\n",
+ "print \"\\nWhere T is boiling point temperature\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The results are summarized in the following table:\n",
+ " Variable \t Values calculated from\t Values calculated from \t Values calculated \n",
+ " \t from figure 10.7 \t Raoult''s law \t\t\t from L-R rule\n",
+ " Tdeg F) \t 165.000000 \t\t 133.014380 \t\t\t 124.179620\n",
+ " y_ethane \t 0.920000 \t\t 0.968397 \t\t\t 0.943469\n",
+ " y_heptane \t 0.080000 \t\t 0.031504 \t\t\t 0.056431\n",
+ "\n",
+ "Where T is boiling point temperature\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.2 Page: 262\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Tdeg\n",
+ "y_ethane\n",
+ "y_hepmath_tane\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 800. #[psia] Bubble point pressure\n",
+ "x_ethane = 0.60 # Mole fraction of ethane in liquid phase\n",
+ "x_hepmath_tane = (1-x_ethane)\n",
+ "\n",
+ "# a) From figure 10.7( page 260 ) given in the book\n",
+ "# We read the chart to get the bubble-point temperature\n",
+ "# The dew point curve for 800 psia crosses the 60 mol% ethane line at about temperature \n",
+ "# T1 = 165\n",
+ "# Now, we horizontally from that intersection point to the dew-point curve, finding the vapor phase composition of ethane \n",
+ "# y1_e = 0.95\n",
+ "# But, by linear interpolation in the experimental data on which Figure 10.7 is based we make a slightly more reliable estimate and get \n",
+ "T1 = 209. #[F]\n",
+ "y1_e = 0.945\n",
+ "y1_h = (1- y1_e)\n",
+ "\n",
+ "# b) By Raoult's law, we use a trial and error procedureon the temperature\n",
+ "# Antoine equation consmath.tants for ethanol are given \n",
+ "A_e = 6.80267\n",
+ "B_e = 656.4028\n",
+ "C_e = 255.99\n",
+ "\n",
+ "# and that for n-hepmath_tane are\n",
+ "A_h = 6.9024\n",
+ "B_h = 1268.115\n",
+ "C_h = 216.9\n",
+ "\n",
+ "# Antoine equation is given by\n",
+ "# (math.log10p) = (A - B/(T+C))\n",
+ "T = 50. #[C]\n",
+ "err = 1.\n",
+ " \n",
+ "# Calculations\n",
+ "while err > 10**(-4):\n",
+ " p1_e = (10**(A_e - B_e/(C_e + T)))*(14.7/760)\n",
+ " p1_h = (10**(A_h - B_h/(C_h + T)))*(14.7/760)\n",
+ " y2_e = p1_e*x_ethane/P\n",
+ " y2_h = p1_h*x_hepmath_tane/P\n",
+ " err = abs((y2_e + y2_h) - 1)\n",
+ " T = T + 0.0001\n",
+ "\n",
+ "# Changing the temperature in deg F \n",
+ "T2 = T*9./5 + 32 #[F] Bubble-point temperature\n",
+ "\n",
+ "# c) In this method, we use L-R rule, instead of simple Raoult's law\n",
+ "# So,\n",
+ "# y_i = (x_i*p_i)/(v_i*P)\n",
+ "# Where calculated values of v_i from EOS are given \n",
+ "v_e = 0.6290642 # For ethane\n",
+ "v_h = 0.0010113 # For n-hepmath_tane\n",
+ "\n",
+ "# We again use trial and error on the temperature\n",
+ "# Let us assume the initial temperature \n",
+ "Ti = 10. #[C]\n",
+ "err = 1.\n",
+ " \n",
+ "while err > 10**(-4):\n",
+ " p2_e = (10**(A_e - B_e/(C_e + Ti)))*(14.7/760)\n",
+ " p2_h = (10**(A_h - B_h/(C_h + Ti)))*(14.7/760)\n",
+ " y3_e = p2_e*x_ethane/(P*v_e)\n",
+ " y3_h = p2_h*x_hepmath_tane/(P*v_h)\n",
+ " err = abs((y3_e + y3_h) - 1)\n",
+ " Ti = Ti + 0.0001\n",
+ "\n",
+ "# Changing the temperature in deg F \n",
+ "T3 = Ti*9./5 + 32 #[F] Bubble-point temperature\n",
+ "\n",
+ "# Results\n",
+ "print \" The results are summarized in the following table:\"\n",
+ "print \" \\t Variable \\t\\t Values calculated from\\t Values calculated from Values calculated\"\n",
+ "print \" \\t\\t\\t\\t from figure 10.7 \\t Raoult''s law \\t\\t from L-R rule\"\n",
+ "print \" \\n\\t Tdeg F \\t\\t %f \\t\\t %f \\t\\t %f\"%(T1,T2,T3)\n",
+ "print \" \\t y_ethane \\t\\t %f \\t\\t %f \\t\\t %f\"%(y1_e,y2_e,y3_e)\n",
+ "print \" \\t y_heptane \\t\\t %f \\t\\t %f \\t\\t %f\"%(y1_h,y2_h,y3_h)\n",
+ "print \"\\nWhere T is boiling point temperature\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The results are summarized in the following table:\n",
+ " \t Variable \t\t Values calculated from\t Values calculated from Values calculated\n",
+ " \t\t\t\t from figure 10.7 \t Raoult''s law \t\t from L-R rule\n",
+ " \n",
+ "\t Tdeg F \t\t 209.000000 \t\t 172.210640 \t\t 70.854980\n",
+ " \t y_ethane \t\t 0.945000 \t\t 0.996044 \t\t 0.632080\n",
+ " \t y_heptane \t\t 0.055000 \t\t 0.003856 \t\t 0.367822\n",
+ "\n",
+ "Where T is boiling point temperature\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 10.3 Page: 262\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Bubble point of the given ethanol and n-heptane mixture at 800 psia\n",
+ "Amount of ethanol in the vapour phase of the mixture at the given condition\n",
+ "Amount of n-heptane in the vapour phase of the mixture at the given \n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# The initial data for this example is same as that of example 10.2, i.e.\n",
+ "P = 800. #[psia] Bubble point pressure\n",
+ "x_e = 0.60 # Mole fraction of ethane in liquid phase\n",
+ "x_h = (1-x_e) # Mole fraction of n-hepmath.tane in the liquid phase\n",
+ "R = 0.08314 #( L*bar/(mol*K)) Universal gas consmath.tant \n",
+ "\n",
+ "# Changing the pressure in bar\n",
+ "Pb = (800/14.7)*(1.01325) #[bar]\n",
+ "\n",
+ "# In this problem we will denote ethane by 'e' and that to n-hepmath.tane by 'h'\n",
+ "# From table A.1 ( page 417 ) given in the book, critical temperatures of ethane and hepmath.tane are \n",
+ "T_c_e = 305.3 #[K]\n",
+ "T_c_h = 540.2 #[K]\n",
+ "\n",
+ "# and critical pressures are\n",
+ "P_c_e = 48.72 #[bar]\n",
+ "P_c_h = 27.40 #[bar]\n",
+ "\n",
+ "# also the accentric facors are \n",
+ "w_e = 0.1\n",
+ "w_h = 0.35\n",
+ "\n",
+ "# Thus we have\n",
+ "P_r_e = Pb/P_c_e\n",
+ "P_r_h = Pb/P_c_h\n",
+ "\n",
+ "# Now from equations (F.13) and (F.14) ( page 459 ) given in the book we have\n",
+ "# A_e = 0.42747 + ( 1 + (0.480 + 1.574*w_e - 0.17*w_e**(2))*( 1 - T_r_e**(0.5)))**(2)*(P_r_e/T_r_e**(2))\n",
+ "# A_h = 0.42747 + ( 1 + (0.480 + 1.574*w_h - 0.17*w_h**(2))*( 1 - T_r_h**(0.5)))**(2)*(P_r_h/T_r_h**(2))\n",
+ "# and\n",
+ "# B_e = 0.08664*(P_r_e/T_r_e)\n",
+ "# B_h = 0.08664*(P_r_h/T_r_h)\n",
+ "\n",
+ "# We will take the help trial and error method both on Temperature and the vapor phase composition of ethane\n",
+ "# Let us assume the starting temperature 200 deg F. Changing this temperature in K\n",
+ "T = (200-32)*5./9 + 273.15 #[K]\n",
+ "err = 1\n",
+ "\n",
+ "# Calculations\n",
+ "while err > 10**(-4):\n",
+ " T_r_e = T/T_c_e\n",
+ " T_r_h = T/T_c_h\n",
+ " A_e = 0.42747*( 1 + (0.480 + 1.574*w_e - 0.17*w_e**(2))*( 1 - T_r_e**(0.5)))**(2)*(P_r_e/T_r_e**(2))\n",
+ " A_h = 0.42747*( 1 + (0.480 + 1.574*w_h - 0.17*w_h**(2))*( 1 - T_r_h**(0.5)))**(2)*(P_r_h/T_r_h**(2))\n",
+ " \n",
+ " B_e = 0.08664*(P_r_e/T_r_e)\n",
+ " B_h = 0.08664*(P_r_h/T_r_h)\n",
+ " \n",
+ " # Now we will take the starting value of vapor phase composition of ethane as \n",
+ " y_e = 0.9\n",
+ " err1 = 1\n",
+ " \n",
+ " while err1 > 10**(-6):\n",
+ " # Now value of A_mix and B_mix for both liquid and vapor phase are calculated as\n",
+ " \n",
+ " A_mix_l = (x_e*math.sqrt(A_e) + x_h*math.sqrt(A_h))**(2) # For liquid phase\n",
+ " A_mix_v = (y_e*math.sqrt(A_e) + (1 - y_e)*math.sqrt(A_h))**(2) # For vapor phase\n",
+ " B_mix_l = (x_e*B_e + x_h*B_h) # For liquid \n",
+ " B_mix_v = (y_e*B_e + (1 - y_e)*B_h) # For liquid \n",
+ "\n",
+ " def f(z1): \n",
+ " return z1**(3) - z1**(2) + z1*(A_mix_l - B_mix_l - B_mix_l**(2)) - A_mix_l*B_mix_l\n",
+ " z_l = fsolve(f,0.2)\n",
+ " # and\n",
+ " def g(z2): \n",
+ " return z2**(3) - z2**(2) + z2*(A_mix_v - B_mix_v - B_mix_v**(2)) - A_mix_v*B_mix_v\n",
+ " z_v = fsolve(g,0.3)\n",
+ " # Now\n",
+ " phi_el = B_e/B_mix_l*( z_l - 1) - math.log(z_l - B_mix_l) - (A_mix_l/B_mix_l)*(2*math.sqrt(A_e/A_mix_l)-B_e/B_mix_l)*math.log(1-B_mix_l/z_l)\n",
+ " phi_hl = B_h/B_mix_l*( z_l - 1) - math.log(z_l - B_mix_l) - (A_mix_l/B_mix_l)*(2*math.sqrt(A_h/A_mix_l)-B_h/B_mix_l)*math.log(1-B_mix_l/z_l)\n",
+ " phi_ev = B_e/B_mix_v*( z_v - 1) - math.log(z_v - B_mix_v) - (A_mix_v/B_mix_v)*(2*math.sqrt(A_e/A_mix_v)-B_e/B_mix_v)*math.log(1-B_mix_v/z_v)\n",
+ " phi_hv = B_h/B_mix_v*( z_v - 1) - math.log(z_v - B_mix_v) - (A_mix_v/B_mix_v)*(2*math.sqrt(A_h/A_mix_v)-B_h/B_mix_v)*math.log(1-B_mix_v/z_v)\n",
+ " K_e = phi_el/phi_ev\n",
+ " K_h = phi_hl/phi_hv\n",
+ " y_e1 = K_e*x_e\n",
+ " y_h1 = K_h*x_h\n",
+ " err1 =abs((y_e1 - y_e))\n",
+ " y_e = y_e1\n",
+ "\n",
+ " err = abs((y_e1 + y_h1) -1)\n",
+ " T = T + 0.1\n",
+ "\n",
+ "\n",
+ "# Changing the temperature in deg F, we have \n",
+ "Tf = ( T - 273.15)*9./5 + 32 #[F]\n",
+ "\n",
+ "# Results\n",
+ "print \" Bubble point of the given ethanol and n-hepmath.tane mixture at 800 psia is %f deg F\"%(Tf)\n",
+ "print \" Amount of ethanol in the vapour phase of the mixture at the given condition is %f \"%(y_e1)\n",
+ "print \" Amount of n-heptane in the vapour phase of the mixture at the given condition is %f \"%(y_h1)\n",
+ "\n",
+ "# Answers may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Bubble point of the given ethanol and n-hepmath.tane mixture at 800 psia is 200.180000 deg F\n",
+ " Amount of ethanol in the vapour phase of the mixture at the given condition is 0.599997 \n",
+ " Amount of n-heptane in the vapour phase of the mixture at the given condition is 0.399997 \n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last five Jacobian evaluations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n",
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch11.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch11.ipynb
new file mode 100644
index 00000000..fff7b6e8
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch11.ipynb
@@ -0,0 +1,962 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : LIquid Liquid Liquid Solid And Gas Solid Equilibrium"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.1 Page: 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The total number of the drops of the benznene required to saturate the water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V_water = 1. #[L] volume of the water\n",
+ "Temp = 25. #[C]\n",
+ "d_benzene = 0.88 #[g/ml] density of the benzene \n",
+ "M_benzene = 78. #[g/mol] molecular weight of the benzene\n",
+ "M_water = 18. #[g/mol]\n",
+ "# Typically a buret will deliver about 20 drops of lliquid per millimeter, so moles of benzene in one drop is\n",
+ "\n",
+ "# Calculations\n",
+ "n_1drop = 1./20*(d_benzene/M_benzene) #[mol/drop] \n",
+ "\n",
+ "# No of moles in 1 litre of the water is \n",
+ "n_water = 1000./M_water #[mol]\n",
+ "# Because 1 litre = 1000 g\n",
+ "# Now from the table 11.1 (page 273), at the saturated condition at the temperature 25C, solubility of benzene in the water is\n",
+ "s_benzene = 0.000405\n",
+ "n_benzene_saturate = s_benzene*n_water #[mol]\n",
+ "# Thus no of the drops of the benzene is\n",
+ "N_benzene = n_benzene_saturate/n_1drop #[drops]\n",
+ "\n",
+ "# Results\n",
+ "print \"The total number of the drops of the benznene required to saturate the water is %0.0f drops\"%(N_benzene)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total number of the drops of the benznene required to saturate the water is 40 drops\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.2 Page: 273\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The amount of the ground water \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_benzene = 1000. #[lbm]\n",
+ "M_benzene = 78. #[lbm/lbmol]\n",
+ "# The total moles benzene are \n",
+ "n_benzene = m_benzene/M_benzene #[lbmol]\n",
+ "# To saturate the water with benzene \n",
+ "# the mole fraction of the benzene in the water will be \n",
+ "x_benzene = 0.000405\n",
+ "# and \n",
+ "# n_benzene = x_benzene*n_T\n",
+ "# in this case n_benzene << n_water, so n_T = n_water\n",
+ "# Thus\n",
+ "#n_benzene = x_benzene*n_water\n",
+ "\n",
+ "# Calculations\n",
+ "n_water = n_benzene/x_benzene #[lbmol]\n",
+ "m_water = n_water*18 #[lbm] \n",
+ "\n",
+ "# Results\n",
+ "print \"The amount of the ground water that will make a saturated solution will be %e lbm\"%(m_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of the ground water that will make a saturated solution will be 5.698006e+05 lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.3 Page: 277\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Mol water\n",
+ "Mol ethanol\n",
+ "Mol benzene\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 25. #[C]\n",
+ "n_water = 3.75 #[mol]\n",
+ "n_ethanol = 2.5 #[mol]\n",
+ "n_benzene = 3.75 #[mol]\n",
+ "\n",
+ "# By the simple stoichiomtetry the overall mole fractions are \n",
+ "x_water = 0.375\n",
+ "x_ethanol = 0.250\n",
+ "x_benzene = 0.375\n",
+ "\n",
+ "# Calculations\n",
+ "# We locate the point corresponding to this concentration on the diagram 11.1 (page 277), by drawing any two of the three straight lines corresponding to those mole fractions.\n",
+ "# We find that the point falls almost exactly on the fifth tie line from the top.\n",
+ "#For this the end-point values are read from the table 11.4 ( page 276 ), which is fifth row from the bottom \n",
+ "# Thus in water reach phase we have the composition as\n",
+ "x_water_w = 64.9 #[%]\n",
+ "x_ethanol_w = 31.75 #[%]\n",
+ "x_benzene_w = 3.37 #[%]\n",
+ "\n",
+ "# and in the benzene reach phase composition is \n",
+ "x_water_b = 6.43 #[%]\n",
+ "x_ethanol_b = 18.94 #[%]\n",
+ "x_benzene_b = 74.62 #[%]\n",
+ "\n",
+ "# Results\n",
+ "print \"The composition of the two equilibrium phases i.e. water-reach phase and benzene reach phase is as \"\n",
+ "print \"\\t\\t\\t\\tWater-reach phase\\t\\tbenzene-reach phase\"\n",
+ "print \"Mol water\\t\\t\\t%f\\t\\t\\t\\t%f\"%(x_water_w,x_water_b)\n",
+ "print \"Mol ethanol\\t\\t\\t%f\\t\\t\\t\\t%f\"%(x_ethanol_w,x_ethanol_b)\n",
+ "print \"Mol benzene\\t\\t\\t%f\\t\\t\\t\\t%f\"%(x_benzene_w,x_benzene_b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The composition of the two equilibrium phases i.e. water-reach phase and benzene reach phase is as \n",
+ "\t\t\t\tWater-reach phase\t\tbenzene-reach phase\n",
+ "Mol water\t\t\t64.900000\t\t\t\t6.430000\n",
+ "Mol ethanol\t\t\t31.750000\t\t\t\t18.940000\n",
+ "Mol benzene\t\t\t3.370000\t\t\t\t74.620000\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.4 Page: 282\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Activity coefficient of benzene in water\n",
+ "Activity coefficient of water in benzene\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 25. #[C]\n",
+ "# Here we assume benzene to be component 1 and water to be componenet 2\n",
+ "# From table 11.1 given in the book(page 273) \n",
+ "# The mole fraction of benzene in water is\n",
+ "x_1in2 = 405. #[ppm]\n",
+ "# and the mole fraction of water in benzene is \n",
+ "x_2in1 = 3000. #[ppm]\n",
+ "\n",
+ "# Calculations\n",
+ "# Thus mole fraction of water in water rich phase is\n",
+ "x_water_w = (10**(6)-405.)/(10**(6))\n",
+ "x_benzene_w = 1-x_water_w\n",
+ "\n",
+ "# and mole fraction of the benzene in benzene rich phase is\n",
+ "x_benzene_b =(10.**(6.)-3000.)/(10**(6))\n",
+ "x_water_b = 1-x_benzene_b\n",
+ "\n",
+ "# Here both x_water and x_benzene are nearly equal to 1\n",
+ "# Thus assumption used for derivation of the equation 11.4(page 282) are suitable here and the equation is \n",
+ "# x_i_1 = y_i_1 , where y_i_1 is activity coefficient\n",
+ "\n",
+ "# So activity coefficient of benzene in water is\n",
+ "y_benzene = 1/(x_benzene_w)\n",
+ "# and activty coefficient of the water in benzene is\n",
+ "y_water = 1/(x_water_b)\n",
+ "\n",
+ "# Results\n",
+ "print \" Activity coefficient of benzene in water is %f\"%(y_benzene)\n",
+ "print \" Activity coefficient of water in benzene is %f\"%(y_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Activity coefficient of benzene in water is 2469.135802\n",
+ " Activity coefficient of water in benzene is 333.333333\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.5 Page: 283\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Draw Gibb's free energy vs mole fractions\n",
+ "\n",
+ "import math \n",
+ "from numpy import * \n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n",
+ "T = 298.15 #[K] Temperature\n",
+ "g_a_0 = 2. #[kj/mol] Gibb's free energy of the pure species 'a'\n",
+ "g_b_0 = 1. #[kj/mol] Gibb's free energy of the pure species 'b'\n",
+ "\n",
+ "# Calculations\n",
+ "for a in range(4):\n",
+ " def f(x): \n",
+ " return x*g_a_0 + (1-x)*g_b_0 + (R*T)/1000*(x*log(x) + (1-x)*log(1-x) + x*a*(1-x)**(2) + (1-x)*a*(x)**(2))\n",
+ " \n",
+ " x=linspace(0.000001,0.990001,100)\n",
+ " a = f(x) \n",
+ " plot(x,a)\n",
+ " \n",
+ "xlabel(\" mole fraction of species a,x_a\");\n",
+ "ylabel(\" gibb''s free energy per mole of mixture,g_mixture kJ/mol\");\n",
+ "annotate(\"A = 0\",xy=(.7,0))\n",
+ "annotate(\"A = 1\",xy=(.6,0.5))\n",
+ "annotate(\"A = 2\",xy=(.6,0.95))\n",
+ "annotate(\"A = 3\",xy=(.6,1.50))\n",
+ "suptitle(\"Calculated values of the molar Gibbs energy of a binary mixture at 25 \u0014 C, assuming \\\n",
+ "the symmetrical activity coefficient equation, with various values of A.\")\n",
+ "\n",
+ "# Results\n",
+ "show()\n",
+ "print \" The plot is shown in the graphic window.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['f', 'draw_if_interactive']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAxkAAAEqCAYAAAB5kp3VAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdYFNfXB/Dv0gQBxYJKoqgIisACS1MxqGgQTcDee41R\nQ4wltmjEV2P8JWps0Rg1tmhQsWKJHWsUxRp7AUF6U3rd8/6x7mSX3UVUcFHO53l4gNkpZ2Zn7syZ\nufeOiIgIjDHGGGO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ILi1aUYY4wx\nxhhjC4qTDMYYY4wxxtiC4iSDMcYYY4wxtqA4yWCMMcYYY4wtKE4yGGOMMcYYYwuKkwzGGGOMMcbY\nguIkgzHGGGOMMbag/gEWLAEI2B1+ZAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2d7f510>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The plot is shown in the graphic window.\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.6 Page: 283\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Draw two liquid phase\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 92 + 273.15 #[K] Temperature of the system\n",
+ "R = 8.314 #[m**(3)*Pa/(mol*K)] universal gas consmath.tant\n",
+ "\n",
+ "# Van Laar equation coefficients are given\n",
+ "A = 1.2739\n",
+ "B = 3.9771\n",
+ "\n",
+ "# From van laar equation, for water, we have\n",
+ "# lnY_a = B**(2)*A*(1-x_a)**(2)/(A*x_a + B*(1-x_a))**(2)\n",
+ "# Similarily for n-bumath.tanol\n",
+ "# lnY_b = A**(2)*B*x_a**(2)/(A*x_a + B*(1-x_a))**(2)\n",
+ "\n",
+ "# Let us say, g = g_mix - sum(x_i*g_i_0)\n",
+ "# So, plotting g vs x_i we have\n",
+ "\n",
+ "# Calculations\n",
+ "def f(x_a): \n",
+ "\t return (R*T/1000)*( x_a*log(x_a) + (1-x_a)*log(1-x_a) + \\\n",
+ " x_a*(B**(2)*A*(1-x_a)**(2)/(A*x_a + B*(1-x_a))**(2)) + (1-x_a)* \\\n",
+ " (A**(2)*B*x_a**(2)/(A*x_a + B*(1-x_a))**(2)) )\n",
+ "\n",
+ "x_a = linspace(0.000001,0.99999,100)\n",
+ "a = f(x_a)\n",
+ "plot(x_a,a)\n",
+ "#xlabel(\" Mol fraction of species a, x_a\")\n",
+ "#ylabel(\" g_mix - sum(x_i*g_i0)\")\n",
+ "\n",
+ "# Now drawing math.tangent \n",
+ "#x = linspace(0.000001,0.99999,100)\n",
+ "x = linspace(0.0,0.99999,100)\n",
+ "a = 1.2090312*x-1.251495764\n",
+ "#plot(x,a)\n",
+ "plot(x,1.2090312*x-1.251495764)\n",
+ "xlabel(\" Mol fraction of species a, x_a\");\n",
+ "ylabel(\" g_mix - sum(x_i*g_i0)\");\n",
+ "\n",
+ "show()\n",
+ "\n",
+ "# Results\n",
+ "# Figure shows the results of the calculation of the whole range of x_a \n",
+ "# Drawing the math.tangent to the curve, the line touches the curve at two points x_a = 0.47 and 0.97\n",
+ "print \"Thus based on the several assumptions that the Van Laar equation is an accurate representation of LLE\"\n",
+ "print \"we would conclude that at 92 deg C water-n-butanol does form two liquid phases.\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAENCAYAAAAYIIIKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xdc1dX/wPEXiqll7kAFDHOxkaGmpuLAhZqZKzNHZuXG\nzJF75NaMSvuaVq6GmpqY2xQ37pGIaCmKCJQCEqCIcH5/fH6SCuK9wB3A+/l43EdwOZzP+36qz5vP\nOedz3hZKKYUQQgihoyKmDkAIIUT+IolDCCGEXiRxCCGE0IskDiGEEHqRxCGEEEIvkjiEEELoxeSJ\nY/v27Tg4OFCzZk3mzJmTZZthw4ZRs2ZN3N3dOX36tJEjFEII8SiTJo60tDSGDBnC9u3buXDhAj/9\n9BOhoaGPtdm6dSt//vknly9f5ptvvmHgwIEmilYIIQSYOHEcO3aMGjVqYG9vT7FixejRowebNm16\nrE1gYCB9+vQBo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9evRgxYoVFCtWLNuV\nV0++/+j3U6ZMoWvXrnh7e/PSSy9l/GzChAnExcXh6uqaUawH4P3338fNzS1jcvxh+zfeeCNjIr1F\nixbMmzcPKyurLOPKKs4VK1YwatQo3N3dOXfuHJMmTcpom1X7yMhImjVrljFR/3C1l4WFBSVKlMDT\n05NBgwbx7bffAtpf/6mpqbi5ueHi4sLkyZMBeO+996hatSpubm7UqVOHn3766bHjVKxYkeXLl2cs\naW7YsCFhYWH8+++/dOjQAXd3dxo3bszChQszxTh69Gg++eQTPD09SUtLy/gcUVFRWZZYXblyJcWL\nFxFtKzUAAACaSURBVKdHjx6MHTuW48ePP3Xxw9tvv82JEydwc3Nj1apVsgIsn5HdcYUwI82aNWPB\nggV4enqaOpSnWrRoES+//HKW8yKicJDJcSGEXgYPHmzqEISJyR2HEMJg/vjjD3r37v3YeyVKlODI\nkSMmikjkBUkcQggh9CKT40IIIfQiiUMIIYReJHEIIYTQiyQOIYQQepHEIYQQQi//B/me7yCdpEt7\nAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x353ea90>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thus based on the several assumptions that the Van Laar equation is an accurate representation of LLE\n",
+ "we would conclude that at 92 deg C water-n-butanol does form two liquid phases.\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.7 Page: 286\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Heat of mixing of water-in-benzene\n",
+ "Heat of mixing of benzene-in-water\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "R = 8.314 #[J/(ml*K)]\n",
+ "# We find that the water in benzene least squares fit line has the equation \n",
+ "# math.log(x_water(benzene-reach phase)) = 4.175-2967.7/T\n",
+ "\n",
+ "# equation 11.7 in the book (page 286) is \n",
+ "# math.log(x_i_1) = (h_i_0-h_i_average)/(RT) + consmath.tant of integration\n",
+ "\n",
+ "# Comparing the two equations term by term, we have\n",
+ "\n",
+ "# Calculations\n",
+ "# (h_i_0-h_i_average)/(RT) = -2967.7/T\n",
+ "# let us say (h_i_0-h_i_average) = h_mix\n",
+ "# So that \n",
+ "h_mix = -2967.7*R/1000 #[kJ/mol] Heat of mixing of water-in-benzene\n",
+ "\n",
+ "# Now, for benzene-in-water the consmath.tant in the above equation is -522.9K, so\n",
+ "h_mix_1 = 522.9*R/1000 #[kJ/mol] Heat of mixing of benzene-in-water\n",
+ "\n",
+ "# Results\n",
+ "print \" Heat of mixing of water-in-benzene is given as %f kJ/mol\"%(h_mix)\n",
+ "print \" Heat of mixing of benzene-in-water is given as %f kJ/mol\"%(h_mix_1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Heat of mixing of water-in-benzene is given as -24.673458 kJ/mol\n",
+ " Heat of mixing of benzene-in-water is given as 4.347391 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.8 Page: 287\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The amount of water that will come out of the solution in the gasoline\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T_i = 50. #[F] Initial temperature of the system \n",
+ "T_f = 20. #[F] Final temperature of the system\n",
+ "M_gas = 115. #[g/mol] Molecular weight of gasoline at room temperature\n",
+ "M_water = 18. #[g/mol] Molecular weight of water at the room temperaature\n",
+ "d = 720. #[g/L] density of gasoline at the room temperature\n",
+ "\n",
+ "# From Figure 11.10 ( page 288 ), solubility of the water in gasoline ( similar to solubility of water in cyclohexane ) at 50 deg F is given as \n",
+ "s_50 = 0.00026 #[mol fraction]\n",
+ "\n",
+ "# And linearly extraploting the cyclohexane curve in figure 11.10 to 20 deg F, we get the solubility of water at 20deg F as \n",
+ "s_20 = 0.0001 #[mol fraction]\n",
+ "\n",
+ "# Calculations\n",
+ "# So, rejected water is\n",
+ "s_rej = s_50 - s_20 # mol of water per mole of gasoline \n",
+ "\n",
+ "# In terms of weight, rejected water will be\n",
+ "w = (s_rej*d*M_water)/M_gas #[g water/L gasoline]\n",
+ "\n",
+ "# Results\n",
+ "print \" The amount of water that will come out of the solution in the gasoline will be %f g water/L gasoline\"%(w)\n",
+ "print \" At 20 deg F we would expect this water to become solid ice, forming a piece large enough to plug the fuel line of a parked auto.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The amount of water that will come out of the solution in the gasoline will be 0.018031 g water/L gasoline\n",
+ " At 20 deg F we would expect this water to become solid ice, forming a piece large enough to plug the fuel line of a parked auto.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.9 Page: 290\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Ethanol's 0.1 mol distributed in the water rich phase\n",
+ "Ethanol's 0.1 mol distributed in the benzene rich phase\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 25. #[C]\n",
+ "x_water = 5. #[mo]\n",
+ "x_benzene = 0.1 #[mol]\n",
+ "\n",
+ "# The fugacity of the ethanol must be same in both phases so that we have distribution coefficient \n",
+ "\n",
+ "# K = ( distribution coefficient ) = x_ethanol(water_rich phase)/x_ethanol(benzene-rich phase) = y_ethanol(benzene-rich phase)/y_ethanol(water-rich phase)\n",
+ "# Here distribution coefficient is defined as rhe ratio of mole fractions of the distributed solute between the two phases.\n",
+ "\n",
+ "# We observe that for the first experimental data set in table 11.4 in the book(page 276)\n",
+ "x_ethanol_water_rich = 3.817 #[%]\n",
+ "x_ethanol_benzene_rich = 1.010 #[%]\n",
+ "\n",
+ "# So \n",
+ "K = x_ethanol_water_rich/x_ethanol_benzene_rich\n",
+ "\n",
+ "# Calculations\n",
+ "# Now for all the data set in the table 11.4 in the book(page 276), we wiil draw a plot \n",
+ "X = array([3.817,7.968,12.977,18.134,23.540,24.069,27.892,31.725,35.510,39.382,41.062,41.771])\n",
+ "Y = array([1.010,3.323,5.860,9.121,12.939,13.340,16.090,18.943,22.444,26.216,29.341,33.093])\n",
+ "Z = X/Y\n",
+ "\n",
+ "# Plotting the graph between 'Z' and 'Y' \n",
+ "plot(Y,Z)\n",
+ "xlabel(\"Mol% ethanol in benzene-rich phase \");\n",
+ "ylabel(\"Distribution coefficient of ethanol, K_ethanol\");\n",
+ "#xgrid()\n",
+ "#xlabel(\"Mol% ethanol in benzene-rich phase \")\n",
+ "#ylabel(\"Distribution coefficient of ethanol, K_ethanol\")\n",
+ "show()\n",
+ "# We see from the plot that at the low mole percent of ethanol , the distribution coefficient is approximately \n",
+ "K_1 = 4\n",
+ "\n",
+ "# Thus ratio of the amount of the ethanol distributed in the two phases will be 4\n",
+ "#the amount in mol % is \n",
+ "# for water rich phase \n",
+ "m_water_rich = 100*K_1/(K_1+1)\n",
+ "m_benzene_rich = 100/(K_1+1)\n",
+ "\n",
+ "# Results\n",
+ "print \" Ethanol''s 0.1 mol distributed in the water rich phase will be %f mol%% of the total mol\"%(m_water_rich)\n",
+ "print \" Ethanol''s 0.1 mol distributed in the benzene rich phase will be %f mol%% of the total mol\"%(m_benzene_rich)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEMCAYAAAArnKpYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEg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+dvf/gZosyGDg4Pp37+/cYXb5ORknnnm\nGbPzzJgxw/hzRkaG1YcnVnWMEydOMGLECLNey9fXl7Nnz1oqmt289957LFmypMr7k5KSrvnfR3US\nEhKYPXt2jZ8v7EuKQh3XuHFjfv75ZwoLCwHYsGEDbdq0ueaszLIzNz/++GP2799P165d+eabb1BK\n8eqrrzJ16lSz88ycOdP8N2EFN910EytWrDDrOTqdzmnW8KlKSUkJ48ePL/eHgqU58oxfcW1SFK4D\n/fr146uvvgLgk08+YdSoUcYvt7NnzzJkyBD0ej133HEH+/fvB7SJSIbHKKW4dOkS+fn51K9fn6VL\nl9KvXz+8vLyqPObSpUuJiooiLCyMxx9/nNLSUiZPnkxBQQFhYWGMHj0anU5HSUkJjz32GEFBQfTp\n08dYvD744AMiIyMJDQ1l+PDhxj3Bx4wZw9NPP023bt1o164dq1atMmZ87rnnCA4OJiQkhM8++6za\nz6TsGcTChQsZNmwYffv2xd/fn+eff77K5/3nP/8hJCSEqKgoDh06BEB2djbDhw8nMjKSyMhIduzY\nAWh/MY8dO5bY2FjatWvH22+/DcD//vc/wsLCCAsLw8/Pjx49egDw7bff0rVrVzp16sS9997LxYsX\nAe0MJSEhgU6dOhESEsJvv/0GaBMix44dS1RUFOHh4axdu7bSzDExMfz973+nc+fOzJkzh2nTphn/\nkk9PT6dnz56EhobSqVMn/vjjD3Q6HXl5eYwYMYKAgAAefPDBKl930qRJhIWFERwczO7du433HThw\noML7Bhg6dCgREREEBQUZ1wIrKSlhzJgxxt/dW2+9BcChQ4fo27cvERER3HXXXcb3LazMinMphAPw\n8PBQ+/btU8OHD1eFhYUqNDRUJSUlqQEDBiillHrqqafUK6+8opRSatOmTSo0NFQppdSCBQvUU089\npZRSasmSJSosLEyNHj1a5ebmqh49eqji4uIqj3ngwAE1cOBA42MmTJigFi9ebMxjcPjwYeXq6qp+\n/PFHpZRS9957r1q6dKlSSpVbbnzKlCnq7bffVkopFR8fr+69917jcdq3b6+UUmrlypWqV69eqrS0\nVGVlZambb75Z/fnnn1XuD1729gULFqhbb71VXbhwQRUWFqpbbrlFHTt2rMJzfH19jRMQFy9ebPwM\nR40aZdxn/MiRIyogIEAppa1j361bN3X58mV1+vRp1aJFi3KfW1FRkerevbtat26dys7OVnfddZfK\nz89XSmlLNBt+L76+vuqdd95RSin13//+V40bN04ppdQLL7xg/LzOnTun/P39jUsnlxUTE6OefPJJ\n4/WySylHRkaqL774Qiml1KVLl1R+fr7avHmzatq0qTp+/LgqLS1Vd9xxR7l91Mu+7mOPPaaU0pYs\nN3yeL7/8suratWul7/vs2bNKKaXy8/NVUFCQOnPmjNqzZ4/q1auX8XXPnz+vlFKqR48e6uDBg0op\npXbt2qV69OhRIYOwPLvv0SysLzg4mIyMDD755BP69+9f7r7t27ezevVqAGJjYzlz5oxxaQ6DBx98\n0PjX4iuvvMLTTz/NV199xZIlS2jbti2zZ88u12SwceNGUlNTiYiIALQp961bt640m5+fHyEhIQB0\n6tSJjIwMAPbv38+UKVM4f/48eXl53H333YDWNGFYZiAgIMC4YmVycjL3338/Op0Ob29voqOjSUlJ\nMbnPIi4uzrjwXGBgIBkZGZXuFT5q1CgARo4cyd///ncAvvvuO3755RfjY3Jzc7l48SI6nY7+/ftT\nv359WrRogbe3N1lZWdx0000ATJw4kbi4OPr378+6des4cOAAXbt2BbSljw0/AwwbNgyA8PBw4+/r\n22+/5csvv2TWrFkAXLp0iczMTG677bYKue+7774Kt+Xl5XHixAkGDx4MQIMGDYz3RUZGGnOGhoaS\nkZFBt27dqvw8unfvzoULFzh//jw6nY4BAwZU+r7nzJljXHo6MzOT9PR0/P39+eOPP5g4cSL9+/en\nd+/e5OXlsXPnznL9PpcvX65wfGF5UhSuE4MGDeLZZ59ly5YtZGdnl7tPXdVOXlWb8IkTJ9i9ezdT\np04lJiaGzZs3M336dDZu3EjPnj3LPTY+Pr5cp3JVGjZsaPy5Xr16xuajMWPGsHbtWoKDg1m0aBFJ\nSUnGx5X98jJkr6y935y27atzlJSUXPM5htdXSvH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QghhJGcKQgghjKQoCCGEMJKiIIQQ\nwkiKghBCCCMpCkIIIYykKAghhDD6f+NRTP1s7PsOAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x37ae490>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Ethanol''s 0.1 mol distributed in the water rich phase will be 80.000000 mol% of the total mol\n",
+ " Ethanol''s 0.1 mol distributed in the benzene rich phase will be 20.000000 mol% of the total mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.10 Page: 293\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Weight fraction of the NaCl in the saturated solution \n",
+ "Mol fraction of the NaCl in the saturated solution\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 20. #[C]\n",
+ "# At this temperature solubility of NaCl is \n",
+ "s = 36.0 #[g per 100 g of water]\n",
+ "M_NaCl = 58.5 #[g/mol] molecular weight of NaCl \n",
+ "M_water = 18. #[g/mol] molecular weight of water\n",
+ "\n",
+ "# Calculations\n",
+ "# weight fraction of NaCl\n",
+ "w = s/(s+100)\n",
+ "# In weight percentage \n",
+ "w_percent = w*100 #[wt %]\n",
+ "\n",
+ "# Mol fraction of the NaCl\n",
+ "x = (s/M_NaCl)/((s/M_NaCl)+(100/M_water))\n",
+ "# In mol percentage\n",
+ "x_percent = x*100 #[mol %]\n",
+ "\n",
+ "# Results\n",
+ "print \" Weight fraction of the NaCl in the saturated solution is %0.1f wt %%\"%(w_percent)\n",
+ "print \" Mol fraction of the NaCl in the saturated solution is %0.0f mol %%\"%(x_percent)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Weight fraction of the NaCl in the saturated solution is 26.5 wt %\n",
+ " Mol fraction of the NaCl in the saturated solution is 10 mol %\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.11 Page: 293\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Total amount of the solid left behind in the heater\n",
+ "Total amount of the solid left behind in the heater\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T_inlet = 68. #[F]\n",
+ "T_outlet = 110. #[F]\n",
+ "\n",
+ "# from the figure 11.13 we read that at 68F the solubility of CaCO3 and CaSO4.2H2O are \n",
+ "s_inlet_carbonate = 60. #[ppm]\n",
+ "s_inlet_sulphate = 2020. #[ppm]\n",
+ "\n",
+ "# At 110F the solubility of the CaCO3 is \n",
+ "s_outlet_carbonate = 30. #[ppm]\n",
+ "# at 110F the least soluble form of the CaSO4 is anhydride with the solubility \n",
+ "s_outlet_sulphate = 2000. #[ppm]\n",
+ " # This is close enough to the solubility of the gypsum at 68F \n",
+ " # so we conclude that we would not expect either form of CaSO4 to prdcipitate\n",
+ " \n",
+ "# Calculations\n",
+ "# Thus total amount of the calcium carbonate which will cime out of the solution and will remain in the heater will be \n",
+ "w = s_inlet_carbonate - s_outlet_carbonate #[ppm]\n",
+ "\n",
+ "# Results\n",
+ "print \" Total amount of the solid left behind in the heater will be %0.1f ppm\"%(w)\n",
+ "\n",
+ " # Now if a typical houshold water heater heats 100 gallons/per day , we would expect to deposite \n",
+ "w_per_day = w*10**(-6)*100*8.33 #[lb/day]\n",
+ "print \" Total amount of the solid left behind in the heater per day will be %.3f lb/day\"%(w_per_day)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total amount of the solid left behind in the heater will be 30.0 ppm\n",
+ " Total amount of the solid left behind in the heater per day will be 0.025 lb/day\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.12 Page: 298\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Activity coefficient in benzene corresponding to practically ideal solution \n",
+ "Activity coefficient in CCl4 corresponding to mild type II behavior \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_2 = 0.1\n",
+ "#y_i_1 = (x_i__ideal /x_i_1) , at consmath.tant temperature\n",
+ "# From figures 11.15 and 11.16 given in the book (page 298-299) ( or the equations of the lines on those figures, presented in [14] ) we can compute the values in Table 11.6\n",
+ "# We see that at x_solute = 10% \n",
+ "# T_m/T for the solution in benzene at which math.log(x_experimental) = -1 is equal to 1.332\n",
+ "# and that for the solution in CCl4 is equal to 1.288\n",
+ "#Now at the that value of the T_m/T \n",
+ "x_ideal_benzene = 0.114\n",
+ "x_ideal_CCl4 = 0.152\n",
+ "\n",
+ "# Calculations\n",
+ "# In benzene the average these compounds is\n",
+ "y_i_1 = x_ideal_benzene/x_2# corresponding to practically ideal solution\n",
+ "\n",
+ "# and in benzene the average of these compounds is \n",
+ "y_i_2 = x_ideal_CCl4/x_2# corresponding to mild type II behavior \n",
+ "\n",
+ "# Results\n",
+ "print \" Activity coefficient in benzene corresponding to practically ideal solution is %0.2f\"%(y_i_1)\n",
+ "print \" Activity coefficient in CCl4 corresponding to mild type II behavior is %0.2f\"%(y_i_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Activity coefficient in benzene corresponding to practically ideal solution is 1.14\n",
+ " Activity coefficient in CCl4 corresponding to mild type II behavior is 1.52\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.13 Page: 299\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The solubility of the NaCl in water\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+20 #[K]\n",
+ "\n",
+ "# The equation 11.15 (page 297) is given by \n",
+ "# log(1/(x_i_1*y_i_1)) = math.log(p_i_solid_phase/p_i_subcooled_liquid) = delta_h_solid_to_liquid/(R*T_melting_point)*(T_melting_point/T-1)\n",
+ "# Ignoring the moment the wild extraplation involved, we simply insert the appropriate values\n",
+ "T_m = 273.15+800 #[K]\n",
+ "delta_h_fusion = 30219. #[J/g]\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# Calculations\n",
+ "# Let log(1/(x_i_1*y_i_1)) = a\n",
+ "a = delta_h_fusion/(R*T)*(T_m/T-1)\n",
+ "\n",
+ "# Now \n",
+ "x_NaCl_into_y_i_1 = 1/math.exp(a)\n",
+ "\n",
+ "# If we make the plausible assumption that y_i_1 = 1.00, then\n",
+ "x_NaCl = 1/math.exp(a)*1\n",
+ "\n",
+ "# Results\n",
+ "print \" The solubility of the NaCl in water at 20 deg C is %e \"%( x_NaCl)\n",
+ "print \" But the experimental value is 0.1 so Similar to the results in book our results are very far wrong\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The solubility of the NaCl in water at 20 deg C is 4.704794e-15 \n",
+ " But the experimental value is 0.1 so Similar to the results in book our results are very far wrong\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.14 Page: 301\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Equilibrium concentration of water vapour\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 1*14.7 #[psia]\n",
+ "T = 30. #[F]\n",
+ "#******#\n",
+ "#The vapour pressure of ice at 30F is 0.0808 psia i.e.\n",
+ "p_ice = 0.0808 #[psia]\n",
+ "# We may assume that the solubility of nitrogen and oxygen in solid ice is negligible\n",
+ "#Thus\n",
+ "x_water_in_ice = 1.00\n",
+ "#and thus use Raoult's law,finding\n",
+ "\n",
+ "# Calculations\n",
+ "y_water_vapour = x_water_in_ice*p_ice/P\n",
+ "\n",
+ "# Results\n",
+ "print \" Equilibrium concentration of water vapour in the air is %0.4f\"%(y_water_vapour)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Equilibrium concentration of water vapour in the air is 0.0055\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 11.15 Page: 302\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Estimated solubility of naphthalene in CO2\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+35 #[K]\n",
+ "p_d = 100. #[atm]\n",
+ "R = 82.06 #[(cm**(3)*atm)/(mol*K)]\n",
+ "\n",
+ "#The calculated vapour pressure of naphthalene at 35C is\n",
+ "p_naphthalene = 0.00065 #[atm]\n",
+ "\n",
+ "#The solid is practically pure naphthalene\n",
+ "x_naphthalene = 1.00\n",
+ "#Total pressure \n",
+ "P = p_d\n",
+ "\n",
+ "# Calculations\n",
+ "#By Raoult's law\n",
+ "y_naphthalene = x_naphthalene*p_naphthalene/P\n",
+ "#At this high a pressure the volume of solid naphthalene is\n",
+ "v = 132. #[cm**(3)/mol]\n",
+ "# We have equation math.log(f_d/f_c) = v/(R*T)*(p_d-p_c)\n",
+ "p_c = 1. #[atm]\n",
+ "f_d_by_f_c = math.exp(v/(R*T)*(p_d-p_c))\n",
+ "#and the estimated\n",
+ "y_naphthalene = f_d_by_f_c*y_naphthalene\n",
+ "\n",
+ "# Results\n",
+ "print \"Estimated solubility of naphthalene in CO2 is %e\"%(y_naphthalene)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Estimated solubility of naphthalene in CO2 is 1.089816e-05\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch12.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch12.ipynb
new file mode 100644
index 00000000..1f171743
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch12.ipynb
@@ -0,0 +1,916 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : Chemical Equilibrium"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.1 Page: 311\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The chemical equilibrium composition of the gaseous mixture contains\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 298.15 #[K] temperature\n",
+ "P = 1. #[atm] pressure \n",
+ "R = 8.314*10**(-3) #[kJ/(mol*K)]\n",
+ "\n",
+ "# Calculations\n",
+ "# For an ideal binary solution the Gi# Calculationss free energy is given by\n",
+ "# g_mix = summation(x_i*g_i_0) + R*T*summation(x_i*math.log(x_i))\n",
+ "# Differentiating the above equation with respect to x_a , remembering that for a binary mixture dx_b = dx_a, finding\n",
+ "\n",
+ "# dg_mix/dx_a = g_a_0-g_b_0+R*T*[math.log(x_a)+1-(math.log(x_b)+1)]\n",
+ "# and x_a+x_b = 1\n",
+ "# so\n",
+ "# dg_mix/dx_a = g_a_0-g_b_0+R*T*[math.log(x_a/(1-x_a))]\n",
+ "\n",
+ "# setting up this equal to zero ( to find the minimum on the g-x curve ) and solving gives\n",
+ "# x_a/(1-x_a) = exp((g_b_0-g_a_0)/(R*T))\n",
+ "\n",
+ "# From the table A.8 (page 427) reported in the book, pure component Gibbs free energies for isobumath.tane,a,and n-bumath.tane,b, we find\n",
+ "g_a_0 = -20.9 #[kJ/mol]\n",
+ "g_b_0 = -17.2 #[kJ/mol]\n",
+ "\n",
+ "# Now solving the above equation for x_a, we have\n",
+ "x_a = math.exp((g_b_0-g_a_0)/(R*T))/(1+math.exp((g_b_0-g_a_0)/(R*T)))\n",
+ "x_b = 1-x_a\n",
+ "\n",
+ "# Results\n",
+ "print \" The chemical equilibrium composition of the gaseous mixture contains %f mol fraction isobutane \\t\\t\\t\\t\\t\\t\\t\\tan %f mol fraction n-bumath.tane\"%(x_a,x_b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The chemical equilibrium composition of the gaseous mixture contains 0.816475 mol fraction isobutane \t\t\t\t\t\t\t\tan 0.183525 mol fraction n-bumath.tane\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.2 Page: 319\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The equilibrium consmath.tant for the reaction\n",
+ "The concentration of NO at equilibrium\n",
+ "The equilibrium constant\n",
+ "The concentration of NO \n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 298.15 #[K] temperature\n",
+ "P = 0.987 #[atm] pressure\n",
+ "g_0_NO = 86.6 #[kJ/mol] Free energy of formation the NO from elements\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# And the corresponding values for the elements N2 and O2 are\n",
+ "g_0_O2 = 0.00\n",
+ "g_0_N2 = 0.00\n",
+ "\n",
+ "# The reaction of the nitrogen and oxygen to form nitric oxide at 298.15 K is\n",
+ "# N2 + O2 = NO\n",
+ "\n",
+ "# Calculations\n",
+ "# Here \n",
+ "delta_g_0 = 2*g_0_NO - g_0_O2 - g_0_N2 #[kJ/mol]\n",
+ "# Changing in the J/mol \n",
+ "delta_g_01 = delta_g_0*1000 #[J/mol]\n",
+ "\n",
+ "# hence \n",
+ "K_298 = math.exp((-delta_g_01)/(R*T))\n",
+ "\n",
+ "# The activities are all \n",
+ "# a_i = f_i/f_i_0\n",
+ "# f_i_0 correspond to the smath.radians(numpy.arcmath.tan(ard state, which for gas at idael gas state are \n",
+ "f_0_N2 = 1. #[bar]\n",
+ "f_0_O2 = 1. #[bar]\n",
+ "f_0_NO = 1. #[bar]\n",
+ "\n",
+ "# If we make the most general statement of the activities (for gases ) we would have\n",
+ "# a_i = y_i*v_i*Y_i*P/f_i_0 = y_i*phi*P/f_i_0\n",
+ "\n",
+ "# At this low pressure we may safely asssume that the NO,O2 and N2 behave as ideal gases for which v_i*Y_i = phi = 1.00 and substituting these we find\n",
+ "# K_298 = [a_NO]**(2)/([a_N2]*[a_O2]) = [y_NO]**(2)/([y_N2]*[y_O2])\n",
+ "\n",
+ "# Now umath.sing this equilibrium consmath.tant we can calculare he equilibrium concentratin of NO in the air sample in which \n",
+ "#oxygen = 21%, nitrogen = 78% and argon = 1% ,so\n",
+ "y_N2 = 0.78\n",
+ "y_O2 = 0.21\n",
+ "\n",
+ "# Hence From above expression, we have\n",
+ "y_NO_298 = math.sqrt(K_298*y_N2*y_O2)\n",
+ "\n",
+ "# Making the similar calculations for the temperature 2000 K, we have\n",
+ "T_1 = 2000 #[K]\n",
+ "K_2000 = 4.0*10**-4\n",
+ "\n",
+ "# So,\n",
+ "y_NO_2000 = math.sqrt(K_2000*y_N2*y_O2)*10**(6) #[ppm]\n",
+ "\n",
+ "# Results\n",
+ "print \" The equilibrium constant for the reaction at 298.15 K is \\t\\t\\t %.1e\"%(K_298)\n",
+ "print \" The concentration of NO at equilibrium at temperature 298.15 K is \\t\\t %.1e\"%(y_NO_298)\n",
+ "print \" The equilibrium consmath.tant for the reaction at 2000 K is \\t\\t\\t %.1e\"%(K_2000)\n",
+ "print \" The concentration of NO at equilibrium at temperature 2000 K is \\t\\t %.0f ppm\"%(round(y_NO_2000,-2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium constant for the reaction at 298.15 K is \t\t\t 4.5e-31\n",
+ " The concentration of NO at equilibrium at temperature 298.15 K is \t\t 2.7e-16\n",
+ " The equilibrium consmath.tant for the reaction at 2000 K is \t\t\t 4.0e-04\n",
+ " The concentration of NO at equilibrium at temperature 2000 K is \t\t 8100 ppm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.3 Page: 321\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The calculated NO cocentration\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 2000. #[K]\n",
+ "n_air = 1. #[mol] no of moles of the air\n",
+ "\n",
+ "# Let the moless of the NO formed be 2*x\n",
+ "# Then at equilibrium the unreacted moles of the N2 and O2 will be (0.78-x) and (0.21-x) respectively\n",
+ "\n",
+ "# Calculations\n",
+ "# from the previous example, we have \n",
+ "# [y_NO]**(2) = K_298*[y_N2]*[y_O2]\n",
+ "# here \n",
+ "K_2000 = 4*10**(-4)\n",
+ "# Substituting all the values, we have \n",
+ "# (2*x)**(2) = K_2000*(0.78-x)*(0.21-x)\n",
+ "\n",
+ "#Now \n",
+ "def f(x): \n",
+ "\t return (2*x)**(2) - K_2000*(0.78-x)*(0.21-x)\n",
+ "#def f(x): \n",
+ "\t #return (K_2000-2)*x**(2)-K_2000*(0.78+0.21)*x+K_2000*0.78*0.21\n",
+ "x = fsolve(f,0)\n",
+ "# Here negative root is meaningless,so\n",
+ "# concentration of NO\n",
+ "c_NO = 2*x*10**(6) #[ppm]\n",
+ "# now\n",
+ "p = c_NO/8100.*100\n",
+ "\n",
+ "# Results\n",
+ "print \" The calculated NO cocentration is %f ppm, which %f%% of the value computed in example 12.1\"%(c_NO,p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The calculated NO cocentration is 7996.442873 ppm, which 98.721517% of the value computed in example 12.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.5 Page: 324\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Concentration of the ethylene \n",
+ "Concentration of the water \n",
+ "Concentration of the ethanol\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 298. #[K]\n",
+ "K = 29.6 # equilibrium consmath.tant at 298 K \n",
+ "P = 1. #[bar]\n",
+ "n_water_0 = 0.833 #[mol]\n",
+ "n_ethylene_0 = 1. #[mol]\n",
+ "n_ethanol_0 = 0. #[mol]\n",
+ "\n",
+ "# Calculations\n",
+ "n_T_0 = (n_water_0+n_ethylene_0+n_ethanol_0) #[mol]\n",
+ "\n",
+ "# From the previous example, we have \n",
+ "# [(0+e)/(1.833-e)]/([(1-e)/(1.833-e)]*[(0.833-e)/(1.833-e)]) = K*P/(1 bar)\n",
+ "# let y = [(0+e)/(1.833-e)]/([(1-e)/(1.833-e)]*[(0.833-e)/(1.833-e)])- K*P/(1 bar)\n",
+ "def f(e): \n",
+ "\t return ((0+e)/(1.833-e))/(((1-e)/(1.833-e))*((0.833-e)/(1.833-e)))-K*P/(1)\n",
+ "e_1 = fsolve(f,0)\n",
+ "e_2 = fsolve(f,0.5)\n",
+ "\n",
+ "# Here the root 'e_2' is meaningless, Then \n",
+ "y_ethanol = ((0+e_2)/(1.833-e_2))\n",
+ "y_ethylene = ((1-e_2)/(1.833-e_2))\n",
+ "y_water = ((0.833-e_2)/(1.833-e_2))\n",
+ "\n",
+ "# Results\n",
+ "print \"Concentration of the ethylene at the equilibrium is %f\"%(y_ethylene)\n",
+ "print \" Concentration of the water at the equilibrium is %f\"%(y_water)\n",
+ "print \" Concentration of the ethanol at the equilibrium is %f\"%(y_ethanol)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Concentration of the ethylene at the equilibrium is 0.243702\n",
+ " Concentration of the water at the equilibrium is 0.092079\n",
+ " Concentration of the ethanol at the equilibrium is 0.664219\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.6 Page: 324\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The equilibrium mol fraction of the hydrogen \n",
+ "And the equilibrium mol fraction of the oxygen\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 273.15+25 #[C]\n",
+ "P = 1. #[bar]\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# We have the reaction as \n",
+ "# H2 + 0.5O2 = H2O\n",
+ "# Using values of the Gibbs free energies of formation in the Table A.8(page 427) we have\n",
+ "g_H2O_0 = -237.1 #[kJ/mol]\n",
+ "g_O2_0 = 0 #[kJ/mol]\n",
+ "g_H2_0 = 0 #[kJ/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# now\n",
+ "delta_g_0 = g_H2O_0 - 0.5*g_O2_0-g_H2_0 #[kJ/mol]\n",
+ "# expresmath.sing delta_g_0 in [J/mol] \n",
+ "delta_g_1 = delta_g_0*1000 #[J/mol]\n",
+ "\n",
+ "# and \n",
+ "K = math.exp((-delta_g_1)/(R*Temp))\n",
+ "# And we have \n",
+ "# K = [a_H2O]/([a_H2]*[a_O2]**(0.5))\n",
+ "# Here we will again assume as in the previous example that we have an ideal solution of the ideal gases for which in equation 12.18 (page 320),we have \n",
+ "# v_i*Y_i = phi = 1.00 , and that for each reacmath.tant or product f_i_0 = 1 bar, putting all the values and simplifying \n",
+ "\n",
+ "# K = [y_H2O]/([y_H2]*[y_O2]**(0.5))*((1 bar)/P)**(0.5)\n",
+ "# Choomath.sing oxygen as the selected reacmath.tant, and assuming that we begin with 0.5 mol of oxygen and 1 mol of hydrogen,\n",
+ "# we have the stoichiometric coefficients of -1, -0.5 and +1 \n",
+ "# and \n",
+ "n_T_0 = 1.5#[mol]\n",
+ "# Also summation(v_i) = -0.5\n",
+ "\n",
+ "# Thus \n",
+ "# K = [e/(1.5-0.5*e)]/([(1-e)/(1.5-0.5*e)]*[(0.5-0.5*e)/(1.5-0.5*e)]**(0.5))\n",
+ "\n",
+ "# Now \n",
+ "def f(e): \n",
+ "\t return (e/(1.5-0.5*e))/(((1-e)/(1.5-0.5*e))*((0.5-0.5*e)/(1.5-0.5*e))**(0.5))\n",
+ "# e = fsolve(f,.99999)\n",
+ "# e = (1-2.4e-28)\n",
+ "\n",
+ "# So the equilibrium concentration of the hydrogen and oxygen are as\n",
+ "# y_H2 = [(1-e)/(1.5-0.5*e)]\n",
+ "# y_O2 = [(0.5-0.5*e)/(1.5-0.5*e)]\n",
+ "# These values are so less that scilab consol is print laying them zero, however we get\n",
+ "y_H2 = 2.4e-28\n",
+ "y_O2 = 0.5*y_H2\n",
+ "\n",
+ "# Results\n",
+ "print \" The equilibrium mol fraction of the hydrogen is %0.3e\"%(y_H2)\n",
+ "print \" And the equilibrium mol fraction of the oxygen is %e \"%(y_O2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium mol fraction of the hydrogen is 2.400e-28\n",
+ " And the equilibrium mol fraction of the oxygen is 1.200000e-28 \n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.7 Page: 327\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Total change in the free energy of water going under given conditions \n",
+ "and the free energy change\n",
+ "'''\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 298.15 #[K]\n",
+ "Press = 1*10**(5) #[Pa]\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# Calculations\n",
+ "# We will calculate the free energy change from liquid to hypothetical gas in three steps\n",
+ "# 1) The liquid is reduced in pressure from the smath.radians(numpy.arcmath.tan(ard pressure of 1 bar to its vapour pressure at 298.15K and for this cange in the state we have \n",
+ "v_liquid = 1.805*10**(-5) #[m**(3)/mol] this liquid specific volume and we will treat is as a consmath.tant\n",
+ "\n",
+ "# The vapour preesure of the water 25C is given as\n",
+ "P_vapour_25 = 0.0317*10**(5) #[Pa]\n",
+ "\n",
+ "# thus change in the Gibbs free energy is \n",
+ "\n",
+ "def f0(P): \n",
+ "\t return v_liquid*P**(0)\n",
+ "\n",
+ "delta_g_0_1 = quad(f0,Press,P_vapour_25)[0]\n",
+ "\n",
+ "\n",
+ "# 2) In the second step the liquid is vaporized at that pressure, for which\n",
+ "delta_g_0_2 = 0 #[J/mol]\n",
+ "# because this is an equilibrium vaporization.\n",
+ "\n",
+ "# 3) And in this last step the vapour is replaced by an ideal gas, which will not condence, and compressed from the vapour pressure at 298.15K to 1 bar\n",
+ "# In this case the specific volume v_ideal of the ideal gas is replaced by the ideal gas law viz. (R*T)/P\n",
+ "\n",
+ "def f1(P): \n",
+ "\t return 1./P\n",
+ "\n",
+ "delta_g_0_3 = (R*Temp)* quad(f1,P_vapour_25,Press)[0]\n",
+ "\n",
+ "\n",
+ "# Thus total change in free energy is \n",
+ "delta_g_0 = delta_g_0_1+delta_g_0_2+delta_g_0_3 #[J/mol]\n",
+ "#expresmath.sing the result in kJ/mol\n",
+ "delta_g_1 = delta_g_0/1000 #[kJ/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" Total change in the free energy of water going under given conditions is %0.2f kJ/mol\"%(delta_g_1)\n",
+ "\n",
+ "# From Table A.8 we find \n",
+ "delta_g_0_ideal_gas = -228.6 #[kJ/mol]\n",
+ "delta_g_0_liquid = -237.1 #[kJ/mol]\n",
+ "# So \n",
+ "delta_g_o = delta_g_0_ideal_gas-delta_g_0_liquid #[kJ/mol]\n",
+ "\n",
+ "print \" From the values of Table A.8 given in the book the free energy change is %0.2f kJ/mol\"%(delta_g_o)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total change in the free energy of water going under given conditions is 8.55 kJ/mol\n",
+ " From the values of Table A.8 given in the book the free energy change is 8.50 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.8 Page: 330\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Equilibrium constants for the formation of ammonia from hydrogen and nitrogen are\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 273.15+25 #[K]\n",
+ "T2 = 273.15+400 #[K]\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# Umath.sing the table A.8, we have\n",
+ "# Gibb's free energy of the various species at 298.15 K are\n",
+ "g0_NH3 = -16.5 #[kJ/mol]\n",
+ "g0_N2 = 0 #[kJ/mol]\n",
+ "g0_H2 = 0 #[kJ/mol]\n",
+ "\n",
+ "# We have the reaction as \n",
+ "# 0.5N2 + 1.5H2 = NH3\n",
+ "\n",
+ "# Calculations\n",
+ "# So, Gibb's free energy change in the reaction is given as \n",
+ "delta_g_0 = g0_NH3 - 0.5*g0_N2 - 1.5*g0_H2 #[kJ/mol]\n",
+ "\n",
+ "# and\n",
+ "K_1 = math.exp(-delta_g_0*1000/(R*T1)) # Equilibrium consmath.tant of the reaction at temperature 298.15 K\n",
+ "\n",
+ "# Similarly enthalpy of the various species are \n",
+ "h0_NH3 = -46.1 #[kJ/mol]\n",
+ "h0_N2 = 0 #[kJ/mol]\n",
+ "h0_H2 = 0 #[kJ/mol]\n",
+ "\n",
+ "# So, enthalpy change of the reaction is given as \n",
+ "del_h_1 = h0_NH3 - 0.5*h0_N2 - 1.5*h0_H2 #[kJ/mol]\n",
+ "\n",
+ "# Now, from Table 12.3( page 332 )\n",
+ "a_NH3 = 3.578\n",
+ "a_H2 = 3.249\n",
+ "a_N2 = 3.280\n",
+ "b_NH3 = 3.020*10**(-3) #[1/K]\n",
+ "b_H2 = 0.422*10**(-3)\n",
+ "b_N2 = 0.593*10**(-3)\n",
+ "c_NH3 = 0 #[1/K**(2)]\n",
+ "c_H2 = 0 #[1/K**(2)]\n",
+ "c_N2 = 0 #[1/K**(2)]\n",
+ "d_NH3 = -0.186*10**(5) #[K**(2)]\n",
+ "d_H2 = 0.083*10**(5) #[K**(2)]\n",
+ "d_N2 = 0.040*10**(5) #[K**(2)]\n",
+ "\n",
+ "# So,\n",
+ "del_a = a_NH3 - 0.5*a_N2 - 1.5*a_H2\n",
+ "del_b = b_NH3 - 0.5*b_N2 - 1.5*b_H2\n",
+ "del_c = c_NH3 - 0.5*c_N2 - 1.5*c_H2\n",
+ "del_d = d_NH3 - 0.5*d_N2 - 1.5*d_H2\n",
+ "\n",
+ "# Now, enthalpy change of the reaction at any other temparature is given by\n",
+ "# Integrating and putting the limits, we have\n",
+ "# del_h = del_h_1 + R*( del_a*T + del_b*T**(2)/2 + del_c*T**(3)/3 - del_d/T) - R*( del_a*T_1 + del_b*T_1**(2)/2 + del_c*T_1**(3)/3 - del_d/T_1)\n",
+ "# let\n",
+ "I = R*( del_a*T1 + del_b*T1**(2)/2 + del_c*T1**(3)/3 - del_d/T1) #[J/mol]\n",
+ "\n",
+ "# From equation 12.28 and above relations we have\n",
+ "# Let math.log(K_2/K_1) = X, So,\n",
+ "\n",
+ "def f5(T): \n",
+ "\t return (del_h_1*1000 - I + R*(del_a*T + del_b*T**(2)/2 + del_c*T**(3)/3 - del_d/T))/T**(2)\n",
+ "\n",
+ "X = (1/R)* quad(f5,T1,T2)[0]\n",
+ "\n",
+ "\n",
+ "# So, \n",
+ "K_2 = K_1*math.exp(X)\n",
+ "\n",
+ "# Results\n",
+ "print \" Equilibrium consmath.tants for the formation of ammonia from hydrogen and nitrogen are \"\n",
+ "print \" K = %0.0f at temperature 25 deg C\"%(K_1)\n",
+ "print \" K = %f at temperature 400 deg C\"%(K_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Equilibrium consmath.tants for the formation of ammonia from hydrogen and nitrogen are \n",
+ " K = 778 at temperature 25 deg C\n",
+ " K = 0.013588 at temperature 400 deg C\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.9 Page: 335\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The mole fraction of NH3 in the equilibrium\n",
+ "The mole fraction of NH3 in the equilibrium\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# Initial moles of the gases are \n",
+ "n_H2_0 = 1.5 #[mol]\n",
+ "n_N2_0 = 0.5 #[mol]\n",
+ "n_NH3_0 = 0 #[mol]\n",
+ "T_1 = 298.15 #[K]\n",
+ "T_2 = 673.15 #[K]\n",
+ "P = 1. #[bar]\n",
+ "\n",
+ "# We start with the equation as \n",
+ "# [f_NH3/f_0_NH3]/([f_N2/f_0_N2]**(0.5)*[f_H2/f_0_H2]**(1.5)) = K\n",
+ "\n",
+ "# For a pressure of 1 bar with the assumption of ideal solution of ideal gases and smath.radians(numpy.arcmath.tan(ard state fugacities of 1 bar,\n",
+ "# a_i = [f_i/f_0_i] = [P*y_i/(1 bar)] = y_i \n",
+ "# The equilibrium relation is given by \n",
+ "# K = [y_NH3]/([y_N2]**(0.5)*[y_H2]**(1.5))\n",
+ "\n",
+ "# We have the stoichiometric coefficient of N2, H2 and NH3 as -0.5, -1.5 and +1 respectively, so summation(v_i) = -1\n",
+ "# Now umath.sing the equilibrium relations which are Equations 12.W, 12.X and 12.Y ( page 322 ), we have \n",
+ "\n",
+ "# K = ((0+e)/(2-e))/(((0.5-0.5*e)/(2-e))**(0.5)*((1.5-1.5*e)/(2-e))**(1.5))\n",
+ "# Form the example 12.8 of this book we know that \n",
+ "K_298 = 778. # at temperature 298.15K\n",
+ "K_673 = 0.013 # at temperature 673.15K\n",
+ "\n",
+ "# Calculations\n",
+ "# Solving for temperature 298.15\n",
+ "def g(e_1): \n",
+ "\t return ((0+e_1)/(2-e_1))/(((0.5-0.5*e_1)/(2-e_1))**(0.5)*((1.5-1.5*e_1)/(2-e_1))**(1.5))-K_298\n",
+ " \n",
+ "e_1 = fsolve(g,0.97)\n",
+ "y_NH3_298 = e_1/(2-e_1)\n",
+ "\n",
+ "# Similarily solving for temperature 673.15K\n",
+ "def h(e_2): \n",
+ "\t return ((0+e_2)/(2-e_2))/(((0.5-0.5*e_2)/(2-e_2))**(0.5)*((1.5-1.5*e_2)/(2-e_2))**(1.5))-K_673\n",
+ "\n",
+ "e_2 = fsolve(h,0)\n",
+ "y_NH3_673 = e_2/(2-e_2)\n",
+ "\n",
+ "# Results\n",
+ "print \" The mole fraction of NH3 in the equilibrium at the temperature 298.15K and 1 bar is %f\"%(y_NH3_298)\n",
+ "print \" The mole fraction of NH3 in the equilibrium at the temperature 673.15K and 1 bar is %f\"%(y_NH3_673)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The mole fraction of NH3 in the equilibrium at the temperature 298.15K and 1 bar is 0.939036\n",
+ " The mole fraction of NH3 in the equilibrium at the temperature 673.15K and 1 bar is 0.004187\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.10 Page: 337\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The mole fraction of the ammonia in the equilibrium\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 273.15+400 #[K]\n",
+ "P = 150*1.01325 #[bar]\n",
+ "\n",
+ "# Comparing this with the example 12.9, we see that we can use the same equation , but K_673 is replaced by K_673*(P/(1bar))**(1.5+0.5-1)\n",
+ "K_673 = 0.013\n",
+ "\n",
+ "# So \n",
+ "K = K_673*(P/1)**(1.5+0.5-1)\n",
+ "\n",
+ "# Calculations\n",
+ "# We have \n",
+ "# K = ((0+e)/(2-e))/(((0.5-0.5*e)/(2-e))**(0.5)*((1.5-1.5*e)/(2-e))**(1.5))\n",
+ "def f(e): \n",
+ "\t return ((0+e)/(2-e))/(((0.5-0.5*e)/(2-e))**(0.5)*((1.5-1.5*e)/(2-e))**(1.5))-K\n",
+ "e=fsolve(f,0.5)\n",
+ "\n",
+ "# Thus mole fraction of the ammonia in the gas is given by \n",
+ "y_NH3 = (0+e)/(2-e)\n",
+ "\n",
+ "# Results\n",
+ "print \"The mole fraction of the ammonia in the equilibrium is %0.2f\"%(y_NH3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mole fraction of the ammonia in the equilibrium is 0.31\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.11 Page: 338\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The mole fraction of the ammonia in the equilibrium\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# The data used in this example will e same as in the example 12.10\n",
+ "T = 273.15+400 #[K] given temperature\n",
+ "P = 150*1.01325 #[bar] given pressure\n",
+ "\n",
+ "# Here again the equation will be same as in the example 12.9 like we used in the example 12.10 only K_673 is replaced by (K/K_v)*[P/(1 bar)]**(1.5+0.5-1)\n",
+ "K_673 = 0.013\n",
+ "# The value of 'K_v' is calculated by the equation 12.BN, which is \n",
+ "# log10(1/K_v) = (0.1191849/T + 91.87212/T**(2) + 25122730/T**(4))*P\n",
+ "\n",
+ "# Calculations\n",
+ "# So \n",
+ "K_v = (10**((0.1191849/T + 91.87212/T**(2) + 25122730/T**(4))*P))**(-1)\n",
+ "\n",
+ "# Thus \n",
+ "K = (K_673/K_v)*(P/1)**(1.5+0.5-1)\n",
+ "\n",
+ "# Now from the previous example we have\n",
+ "# K = ((0+e)/(2-e))/(((0.5-0.5*e)/(2-e))**(0.5)*((1.5-1.5*e)/(2-e))**(1.5))\n",
+ "\n",
+ "def f(e): \n",
+ "\t return ((0+e)/(2-e))/(((0.5-0.5*e)/(2-e))**(0.5)*((1.5-1.5*e)/(2-e))**(1.5))-K\n",
+ "e = fsolve(f,0.2)\n",
+ "\n",
+ "# Mol fraction of the ammonia in the gas phase in the equilibrium is given by\n",
+ "y_NH3 = (0+e)/(2-e)\n",
+ "\n",
+ "# Results\n",
+ "print \" The mole fraction of the ammonia in the equilibrium is %0.2f\"%(y_NH3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The mole fraction of the ammonia in the equilibrium is 0.34\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.12 Page: 340\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "On increasing the pressure from 1 atm to 150 atm the reacted amount of the equimolar\n",
+ "reactants at equilibrium becomes times of initial\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p_i = 1. #[atm] initial pressure \n",
+ "P = 150. #[atm] final pressure\n",
+ "T = 273+25. #[K] Given temperature\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# Now ignoring the difference between 25C and 20C, we use the values given in the table A.8 (page 427) to get \n",
+ "delta_g_0 = 10.54*1000 #[J/mol]\n",
+ "# And thus \n",
+ "\n",
+ "# Calculations\n",
+ "K = math.exp((-delta_g_0)/(R*T))\n",
+ "\n",
+ "# Now the chemical reaction is given by\n",
+ "# C2H5OH + CH3COOH = C2H5OOC2H5 + H2O\n",
+ "\n",
+ "# Let we start with 1 mol each of ethanol and acetic acid, and at equilibrium 'e' moles each of the reacmath.tants reacted, then\n",
+ "# remaining amount of each of the two reacmath.tants will be (1-e) and that products formation will be 'e' mol each\n",
+ "\n",
+ "# We have \n",
+ "# K = (a_C2H5OOC2H5*a_H2O)/(a_C2H5OH*a_CH3COOH) = (x_C2H5OOC2H5*x_H2O)/(x_C2H5OH*x_CH3COOH) = (e*e)/((1-e)*(1-e))\n",
+ "# Now solving for 'e'\n",
+ "def f(e): \n",
+ "\t return (e*e)/((1-e)*(1-e))-K\n",
+ "e = fsolve(f,0)\n",
+ "\n",
+ "# To see the effect of changing the pressure we first compute the volume increase of the reaction \n",
+ "# delta_v = v_C2H5OOC2H5 + v_H2O - v_C2H5OH - v_CH3COOH, where v_i is the molar volume of the ith component\n",
+ "# From the Table 12.4(page 340), we have\n",
+ "v_C2H5OOC2H5 = 97.67 #[ml/mol]\n",
+ "v_H2O = 18.03 #[ml/mol]\n",
+ "v_C2H5OH = 58.30 #[ml/mol]\n",
+ "v_CH3COOH = 57.20 #[ml/mol]\n",
+ "\n",
+ "# Thus volume increase of the reaction is\n",
+ "delta_v = v_C2H5OOC2H5 + v_H2O - v_C2H5OH - v_CH3COOH #[ml/mol]\n",
+ "\n",
+ "# So, from Le Chatelier's principal, on increamath.sing the pressure , the reaction is forced in the direction of the reacmath.tant or away from the product \n",
+ "# To calculate the extent of shifting we will take the help of the activity of each of the four component \n",
+ "# a_i = (f_i/f_i_0) = (x_i*Y_i*p_i)/p_i*exp(v/(R*T)*(P-p_i))\n",
+ "# we will assume that this is an ideal solution so that Y_i = 1.00, for every component\n",
+ "\n",
+ "# Now substituting the activity of each component in the expression of the equilibrium consmath.tant given above, we have\n",
+ "# K = (x_C2H5OOC2H5*x_H2O)/(x_C2H5OH*x_CH3COOH)*exp[(delta_v)/(R*T)*(P-p_i)]\n",
+ "# or\n",
+ "# K = (e_1*e_1)/((1-e_1)*(1-e_1))*exp[(delta_v)/(R*T)*(P-p_i)]\n",
+ "\n",
+ "# Solving for 'e_1'\n",
+ "def g(e_1): \n",
+ "\t return (e_1*e_1)/((1-e_1)*(1-e_1))*math.exp((delta_v)/(R*T)*(P-p_i))-K\n",
+ "e_1 = fsolve(g,0.2)\n",
+ "\n",
+ "# Now if we carry out the calculation to enough significant figures then\n",
+ "a = e_1/e\n",
+ "\n",
+ "# It indicates that e_1 is 'a' times of that of the e\n",
+ "\n",
+ "# Results\n",
+ "print \"On increamath.sing the pressure from 1 atm to 150 atm the reacted amount of the equimolar \\\n",
+ "reacmath.tants at equilibrium becomes %f times of initial\"%(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "On increamath.sing the pressure from 1 atm to 150 atm the reacted amount of the equimolar reacmath.tants at equilibrium becomes 0.994639 times of initial\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 12.13 Page: 342\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Value of the K_p at the given condition\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 150. #[atm] given pressure\n",
+ "T = 400. #[C] temperature\n",
+ "# Umath.sing the values from the example 12.11, we know that\n",
+ "K = 0.013\n",
+ "K_v = 0.84\n",
+ "delta_v = 1.5+0.5-1\n",
+ "\n",
+ "# Calculations\n",
+ "# so \n",
+ "# K_p = (K/K_v)*[1/bar]**(-summation(v_i)) = (K/K_v)*[1/bar]**(delta_v)\n",
+ "\n",
+ "K_p = (K/K_v)*(1/1)**(delta_v) #[1/bar]\n",
+ "\n",
+ "# Results\n",
+ "print \" Value of the K_p at the given condition is %f 1/bar)\"%(K_p)\n",
+ "print \" The basic K is dimensionless%( but K_p has the dimensions of pressure to the power.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Value of the K_p at the given condition is 0.015476 1/bar)\n",
+ " The basic K is dimensionless%( but K_p has the dimensions of pressure to the power.\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch13.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch13.ipynb
new file mode 100644
index 00000000..6042a664
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch13.ipynb
@@ -0,0 +1,862 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Equilibrium In Complex Chemical Reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.1 Page: 349\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the equilibrium the product of the hydrogen ion and hydroxil ion\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T =273.15+25 #[K] given temperature\n",
+ "R = 8.314 #[J/(mol*K)] universal gas consmath.tant\n",
+ "\n",
+ "# We have the reaction as follows\n",
+ "# H2O = H+ + OH-\n",
+ "\n",
+ "# Reading the free energy of species from the Table A.8 ( page 427), we have \n",
+ "g_0_H = 0 #[kJ/mol]\n",
+ "g_0_OH = -157.29 #[kJ/mol]\n",
+ "g_0_H2O = -237.1 #[kJ/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Thus free enaergy change of the reaction is \n",
+ "delta_g_0 = g_0_H + g_0_OH - g_0_H2O #[kJ/mol]\n",
+ "# Changing in J/mol we have \n",
+ "delta_g_1 = delta_g_0*1000 #[J/mol]\n",
+ "\n",
+ "# Now equilibrium consmath.tant of the reaction is given by\n",
+ "K = math.exp((-delta_g_1)/(R*T))\n",
+ "\n",
+ "# Also, in terms of activity\n",
+ "# K = ([[H+]/(1 molal)]*[[OH-]/(1 molal)])/[a_water]\n",
+ "# The activity of any pure liquid at its smath.radians(numpy.arcmath.tan(ard state is 1.00, and here water is practically pure, so\n",
+ "# K_w = [[H+]/(1 molal)]*[[OH-]/(1 molal)] = K\n",
+ "# or \n",
+ "K_w = K\n",
+ "\n",
+ "# Results\n",
+ "print \"At the equilibrium the product of the hydrogen ion and hydroxil ion is %0.1e\"%(K_w)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At the equilibrium the product of the hydrogen ion and hydroxil ion is 1.0e-14\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.2 Page: 351\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The equilibrium concentration of H2SO4 in terms of molality\n",
+ "The equilibrium concentration of HSO4- in terms of molality\n",
+ "The equilibrium concentration of SO4-- in terms of molality\n",
+ "The equilibrium concentration of H+ in terms of molality\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "n_H2SO4 = 1. #[mol] mole of the sulphuric acid\n",
+ "w_water = 1000. #[g] weight of the water \n",
+ "T =273.15+25 #[K] temperature\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# We the two sequential reaction, in which the first reaction is\n",
+ "# H2SO4 = HSO4- + H+\n",
+ "\n",
+ "# From the Table A.8 (page 427) as given in the book, free energy of the above species are \n",
+ "g_0_H = 0 #[J/mol] free energy of the hydrogen ion\n",
+ "g_0_HSO4 = -756.01*1000 #[J/mol] free energy of the bisulphate ion\n",
+ "g_0_H2SO4 = -744.50*1000 #[J/mol] free enery of sulphuric acid\n",
+ "\n",
+ "# Calculations\n",
+ "# So \n",
+ "delta_g_0 = g_0_H + g_0_HSO4 - g_0_H2SO4 #[J/mol]\n",
+ "\n",
+ "# So equilibrium consmath.tant of the reaction is given by\n",
+ "K_1 = math.exp((-delta_g_0)/(R*T))\n",
+ "\n",
+ "# Now the second reaction is which is going on sequentialy is\n",
+ "# HSO4- = SO4(-2) + H+\n",
+ "\n",
+ "# Again from the Table A.8 reading the values of free energy of the species of the above reaction, we have\n",
+ "g_0_H = 0 #[J/mol] free energy of the hydrogen ion\n",
+ "g_0_SO4 = -744.62*1000 #[J/mol] free energy of sulphate ion\n",
+ "g_0_HSO4 = -756.01*1000 #[J/mol] free energy of the bisulphate ion\n",
+ "\n",
+ "# So \n",
+ "delta_g_1 = g_0_H + g_0_SO4 - g_0_HSO4 #[J/mol]\n",
+ "\n",
+ "# Equilibrium consmath.tant of thi reaction is \n",
+ "K_2 = math.exp((-delta_g_1)/(R*T))\n",
+ "\n",
+ "# Now we have 1 mol of H2SO4 initially. Let e_1 mol of H2SO4 ionised at equilibrium\n",
+ "# Then amount of the each of two product i.e. bisulphate and hydrogen ion will be e_1 mol\n",
+ "# Now for the second reaction e_1 mol of the bisulphate ion will be treated as initial concentration.\n",
+ "# If at equilibrium e_2 moles of bisulphate ion has ionised\n",
+ "# In this case the amount of each of two product of this reaction will be e_2 mol\n",
+ "# So final amount of each of the species (in moles) at equilibrium is given as \n",
+ "# n_H2SO4 = (1-e_1)\n",
+ "# n_HSO4 = (e_1-e_2)\n",
+ "# n_SO4 = e_2\n",
+ "# n_H = (e_1+e_2)\n",
+ "\n",
+ "# now\n",
+ "# K_1 = ([HSO4]*[H])/[H2SO4] = ((e_1-e_2)*(e_1+e_2))/(1-e_1)...................(1)\n",
+ "# and that for the second reaction \n",
+ "# K_2 = ([SO4]*[H])/[HSO4] = ((e_2)*(e_1+e_2))/(e_1-e_2).......................(2)\n",
+ "\n",
+ "# e = [e_1 e_2]\n",
+ "# Solving the two given simulmath.taneous equations,we have\n",
+ "def F(e):\n",
+ " f = [0,0]\n",
+ " f[0] = ((e[0]-e[1])*(e[0]+e[1]))/(1-e[0]) - K_1\n",
+ " f[1] = ((e[1])*(e[0]+e[1]))/(e[0]-e[1]) - K_2\n",
+ " return f\n",
+ "\n",
+ "# Initial guess:\n",
+ "e = [0.8,0.1]\n",
+ "y = fsolve(F,e)\n",
+ "e_1 = y[0]\n",
+ "e_2 = y[1]\n",
+ "\n",
+ "# So, concentration of the various species in equilibrium is given as \n",
+ "m_H2SO4 = 1-e_1 # [molal]\n",
+ "m_HSO4 = e_1 - e_2 #[molal]\n",
+ "m_SO4 = e_2 #[molal]\n",
+ "m_H = e_1 + e_2 #[molal]\n",
+ "\n",
+ "# Results\n",
+ "print \" The equilibrium concentration of H2SO4 in terms of molality is %f molal\"%(m_H2SO4)\n",
+ "print \" The equilibrium concentration of HSO4- in terms of molality is %f molal\"%(m_HSO4)\n",
+ "print \" The equilibrium concentration of SO4-- in terms of molality is %f molal\"%(m_SO4)\n",
+ "print \" The equilibrium concentration of H+ in terms of molality is %f molal\"%(m_H)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium concentration of H2SO4 in terms of molality is 0.009444 molal\n",
+ " The equilibrium concentration of HSO4- in terms of molality is 0.980653 molal\n",
+ " The equilibrium concentration of SO4-- in terms of molality is 0.009903 molal\n",
+ " The equilibrium concentration of H+ in terms of molality is 1.000459 molal\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.3 Page: 352\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Percent conversion of CO\n",
+ "Percent conversion of CO2\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 10. #[MPa] given pressure\n",
+ "T = 250. #[C] Temperature\n",
+ "# Let the total number of moles in the feed be one, then\n",
+ "n_T_0 = 1. #[mol]\n",
+ "n_CO = 0.15 #[mol]\n",
+ "n_CO2 = 0.08 #[mol]\n",
+ "n_H2 = 0.74 #[mol]\n",
+ "n_CH4 = 0.03 #[mol]\n",
+ "\n",
+ "# The two simulmath.taneous reactions taking place are\n",
+ "# CO + 2*H2 = CH3OH\n",
+ "# CO2 + H2 = CO + H2O\n",
+ "\n",
+ "# Let us denote the first reaction by 1 and the second reaction by 2\n",
+ "# and K_i = (K/K_v)*[P/(1 atm)]**(-summation(v_i))\n",
+ "# and that summation(v_i) = V_i\n",
+ "\n",
+ "# Then from the table 13.C (page 353) as reported in the book, we have \n",
+ "V_1 = -2\n",
+ "V_2 = 0\n",
+ "K_1 = 49.9 # For the first reaction \n",
+ "K_2 = 0.032 # For the second reaction\n",
+ "\n",
+ "# Now let v_i denotes the stoichiometric coefficient of species 'i', then\n",
+ "v_CO_1 = -1\n",
+ "v_H2_1 = -2\n",
+ "v_CH3OH_1 = +1\n",
+ "v_CO2_2 = -1\n",
+ "v_H2_2 = -1\n",
+ "v_CO_2 = +1\n",
+ "v_H2O_2 = +1\n",
+ "\n",
+ "# Let e_1 = the moles of CO reacted in reaction 1 and e_2 = the moles of CO2 reacted in reaction 2.\n",
+ "# Now mol fractions of each of the species in the equilibrium is \n",
+ "# y_CO = (n_CO+v_CO_1*e_1+v_CO_2*e_2)/(n_T_0+e_1*V_1+e_2*V_2) = (0.15-1*e_1+1*e_2)/(1+e_1*(-2)+e_2*(0)) = (0.15 - e_1 + e_2)/(1 - 2*e_1)\n",
+ "\n",
+ "# similarily\n",
+ "# y_H2 = (n_H2+v_H2_1*e_1+v_H2_2*e_2)/(n_T_0+e_1*V_1+e_2*V_2) = (0.74 - 2*e_1 - e_2)/(1 - 2*e_1)\n",
+ "\n",
+ "# y_CH3OH = (n_CH3OH+v_CH3OH_1*e_1+v_CH3OH_2*e_2)/(n_T_0+e_1*V_1+e_2*V_2) = (0 + e_1)/(1 - 2*e_1)\n",
+ "\n",
+ "# y_CO2 = (n_CO2+v_CO2_1*e_1+v_CO2_2*e_2)/(n_T_0+e_1*V_1+e_2*V_2) = (0.08 - e_2)/(1 - 2*e_1)\n",
+ "\n",
+ "# y_H2O = (n_H2O+v_H2O_1*e_1+v_H2O_2*e_2)/(n_T_0+e_1*V_1+e_2*V_2) = (0 + e_2)/(1 - 2*e_1)\n",
+ "\n",
+ "# Now putting the values in the expression of the equilibrium consmath.tant of the reactions, for the reaction 1 we have\n",
+ "\n",
+ "# K_1 = ((0 + e_1)/(1 - 2*e_1))/(((0.15 - e_1 + e_2)/(1 - 2*e_1))*((0.74 - 2*e_1 - e_2)/(1 - 2*e_1))**(2))\n",
+ "\n",
+ "# K_2 = (((0.15 - e_1 + e_2)/(1 - 2*e_1))*((0 + e_2)/(1 - 2*e_1)))/(((0.08 - e_2)/(1 - 2*e_1))*((0.74 - 2*e_1 - e_2)/(1 - 2*e_1)))\n",
+ "\n",
+ "# Calculations\n",
+ "# e = [e_1 e_2]\n",
+ "# Solving the two given simulmath.taneous equations,we have\n",
+ "def F(e):\n",
+ " f = [0,0]\n",
+ " f[0] = ((0 + e[0])/(1 - 2*e[0]))/(((0.15 - e[0] + e[1])/(1 - 2*e[0]))*((0.74 - 2*e[0] - e[1])/(1 - 2*e[0]))**(2)) - K_1\n",
+ " f[1] = (((0.15 - e[0] + e[1])/(1 - 2*e[0]))*((0 + e[1])/(1 - 2*e[0])))/(((0.08 - e[1])/(1 - 2*e[0]))*((0.74 - 2*e[0] - e[1])/(1 - 2*e[0]))) - K_2\n",
+ " return f\n",
+ "\n",
+ "\n",
+ "# Initial guess:\n",
+ "e = [0.109, 0]\n",
+ "y = fsolve(F,e)\n",
+ "e_1 = y[0]\n",
+ "e_2 = y[1]\n",
+ "\n",
+ "# So, percent conversion of CO2 is given as\n",
+ "# (moles of CO2 reacted)/(moles of CO2 fed) i.e.\n",
+ "c_CO2 = e_2/(n_CO2)*100\n",
+ "# Number of moles of CO Formed by the second reaction is 0.032\n",
+ "# So, percent conversion of CO is given as\n",
+ "c_CO = e_1/(n_CO + 0.032)*100\n",
+ "\n",
+ "# Results\n",
+ "print \" Percent conversion of CO is %f%%\"%(c_CO)\n",
+ "print \" Percent conversion of CO2 is %f%%\"%(c_CO2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Percent conversion of CO is 96.815234%\n",
+ " Percent conversion of CO2 is 47.930771%\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.4 Page: 354\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The amount of solid dissolved in terms of solubility product\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+25 #[K] Temperature\n",
+ "R = 8.314 #[J/(mol*K)] universal gas consmath.tant\n",
+ "\n",
+ "# Solubility of AgCl in water follows\n",
+ "# AgCl = Ag+ + Cl-\n",
+ "# From the Table A.8, free energy of above species are\n",
+ "g_0_Ag = 77.12*1000 #[J/mol]\n",
+ "g_0_Cl = -131.26*1000 #[J/mol]\n",
+ "g_0_AgCl = -109.8*1000 #[J/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Free energy change of the reacton is given by \n",
+ "delta_g_0 = g_0_Ag + g_0_Cl - g_0_AgCl #[J/mol]\n",
+ "\n",
+ "# Now equilbrium consmath.tant of the reaction is given by\n",
+ "K = math.exp((-delta_g_0)/(R*T))\n",
+ "\n",
+ "# In terms of activity of the components, equilibrium consmath.tant is \n",
+ "# K = [[Ag+]/(1 molal)*[Cl-]/(1 molal)]/[a_AgCl]\n",
+ "\n",
+ "# For solids f_i_0 is normaly taken as the fugacity of the pure crystalline solid,and the activity of the pure crystalline solid is = 1.00, so\n",
+ "a_AgCl = 1.00\n",
+ "\n",
+ "# Results\n",
+ "# hence \n",
+ "# [[Ag+]/(1 molal)*[Cl-]/(1 molal)]= K = K_sp , solubility product\n",
+ "print \"The amount of solid dissolved in terms of solubility product is %0.2e\"%(K)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of solid dissolved in terms of solubility product is 1.77e-10\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.5 Page: 357\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Amount of the CO2 dissolved in water in equilibrium with air\n",
+ "Conentration of HCO3 ion and hydrogen ion H- in solution in equilibrium with air\n",
+ "And concentration of CO3 ion in the solution in equilibrium with air\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+25 #[K] Given temperature of air\n",
+ "P = 1. #[atm] Pressure of the air\n",
+ "y_CO2 = 350.*10**(-6) # Amount of CO2 present in air at the given condition \n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# At equilibrium there are two ionisition reactions takin place sequentily\n",
+ "# First ionisation reaction is \n",
+ "# H2CO3 = H+ + HCO3-\n",
+ "# Free energy of the species of the above reation is\n",
+ "g_0_H2CO3 = -623.1*1000 #[J/mol]\n",
+ "g_0_H = 0. #[J/mol]\n",
+ "g_0_HCO3 = -586.85*1000 #[J/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# So free energy change of the reaction is given by \n",
+ "delta_g_0 = g_0_H + g_0_HCO3 - g_0_H2CO3 #[J/mol]\n",
+ "# Equilibrium consmath.tant of the reaction is given by\n",
+ "K_1 = math.exp((-delta_g_0)/(R*T)) \n",
+ "\n",
+ "# And the second one is \n",
+ "# HCO3- = H+ + CO3(-2)\n",
+ "# Free energy of the species of the second reacion are\n",
+ "g_0_CO3 = -527.89*1000 #[J/mol]\n",
+ "\n",
+ "# Free energy change of the second reacion is \n",
+ "delta_g_1 = g_0_H + g_0_CO3 - g_0_HCO3 #[J/mol]\n",
+ "# So equilibrium consmath.tant of the reaction is given by\n",
+ "K_2 = math.exp((-delta_g_1)/(R*T))\n",
+ "\n",
+ "# Now, writing the expression of the equilibrium consmath.tant of the first reaction, we have\n",
+ "# K_1 = ([HCO3-]*[H+])/[H2CO3]\n",
+ "# and that for the second reaction \n",
+ "# K_2 = ([CO3]*[H+])/[CO3-]\n",
+ "\n",
+ "# From the Table A.3 (page 419) as reported in the book, Henry's law consmath.tant is \n",
+ "H = 1480. #[atm]\n",
+ "\n",
+ "# From Henry's law \n",
+ "# P*y_CO2 = x_O2*H , so\n",
+ "x_CO2 = P*y_CO2/H\n",
+ "\n",
+ "# This gives the mol fracion. The dissociation consmath.tant are based on molaities a smath.radians(numpy.arcmath.tan(ard states, so\n",
+ "# Molality of the CO2 in the solution is \n",
+ "# m_CO2 = x_CO2*n_water , where 'n_water' is number of moles of water in 1000g of water, so\n",
+ "n_water = 1000/18. #[mol]\n",
+ "m_CO2 = x_CO2*n_water #[molal]\n",
+ "\n",
+ "# Then we assume that almost all the H+ comes from the dissociation of dissolved CO2, so \n",
+ "# m_HCO3 = m_H, i.e. molality of bicarbonate is approximately equal to molality of hydrogen ion in the solution and hence \n",
+ "m_HCO3 = math.sqrt(K_1*m_CO2) #[molal]\n",
+ "m_H = m_HCO3 #[molal]\n",
+ "\n",
+ "# Then we compute \n",
+ "m_CO3 = K_2*(m_HCO3/m_H) #[molal]\n",
+ "\n",
+ "# Results\n",
+ "print \" Amount of the CO2 dissolved in water in equilibrium with air is \\t\\t\\t%0.2e molal\"%(m_CO2)\n",
+ "print \" Conentration of HCO3 ion and hydrogen ion H- in solution in equilibrium with air is %0.2e molal\"%(m_HCO3)\n",
+ "print \" And concentration of CO3 ion in the solution in equilibrium with air is\\t\\t%0.2e molal\"%(m_CO3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Amount of the CO2 dissolved in water in equilibrium with air is \t\t\t1.31e-05 molal\n",
+ " Conentration of HCO3 ion and hydrogen ion H- in solution in equilibrium with air is 2.42e-06 molal\n",
+ " And concentration of CO3 ion in the solution in equilibrium with air is\t\t4.68e-11 molal\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.6 Page: 358\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Amount of the CO2 dissolved in water in equilibrium with air\n",
+ "Conentration of HCO3 ion in solution in equilibrium with air\n",
+ "And concentration of CO3 ion in the solution in equilibrium with air\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# All the data are taken from the previous example 13.5 \n",
+ "m_H = 10**(-10) #[molal] molality of hydrogen ion\n",
+ "K_1 = 4.5*10**(-7)\n",
+ "K_2 = 4.7*10**(-11)\n",
+ "\n",
+ "# Calculations\n",
+ "# Our Henry's law calculations are independent of the subsequent fate of the dissolved CO2.\n",
+ "# The concentration of dissolved CO2 in equilibrium with atmosphere is \n",
+ "m_CO2 = 1.32*10**(-5) #[molal] from previous example\n",
+ "# It is independent of that acidity or basicity of the water, and hence \n",
+ "m_HCO3 = K_1*(m_CO2/m_H) #[molal]\n",
+ "\n",
+ "# and \n",
+ "m_CO3 = K_2*(m_HCO3/m_H) #[molal]\n",
+ "\n",
+ "# Results\n",
+ "print \" Amount of the CO2 dissolved in water in equilibrium with air is \\t%0.2e molal\"%(m_CO2)\n",
+ "print \" Conentration of HCO3 ion in solution in equilibrium with air is \\t %0.2e molal\"%(m_HCO3)\n",
+ "print \" And concentration of CO3 ion in the solution in equilibrium with air is %0.2e molal\"%(m_CO3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Amount of the CO2 dissolved in water in equilibrium with air is \t1.32e-05 molal\n",
+ " Conentration of HCO3 ion in solution in equilibrium with air is \t 5.94e-02 molal\n",
+ " And concentration of CO3 ion in the solution in equilibrium with air is 2.79e-02 molal\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.7 Page: 362\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Standard state cell voltage for the production of aluminium\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 298.15 #[K] Temperature\n",
+ "F = 96500. #[(coulomb)/(mole*electrons)] faraday consmath.tant\n",
+ "\n",
+ "# The reaction is given as\n",
+ "# Al2O3 + 1.5C = 2Al + 1.5CO2\n",
+ "\n",
+ "# No of the electron being exchanged are \n",
+ "n_e = 6. #[electron]\n",
+ "# All the reacmath.tants and products enter or leave the reactor as pure species in their smath.radians(numpy.arcmath.tan(ard states, so\n",
+ "# delta_g_0 = delta_g_1 and E = E_0\n",
+ "# Free energy of the species in the above equation as reported in the Table A.8 in the book is \n",
+ "g_0_CO2 = -394.4*1000 #[J/mol] \n",
+ "g_0_Al = 0 #[J/mol]\n",
+ "g_0_C = 0 #[J/mol]\n",
+ "g_0_Al2O3 = -1582.3*1000 #[J/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Free energy change of the reaction is \n",
+ "delta_g_0 = 1.5*g_0_CO2 + 2*g_0_Al - 1.5*g_0_C - g_0_Al2O3 #[J/mol]\n",
+ "\n",
+ "# So, smath.radians(numpy.arcmath.tan(ard state cell voltage is \n",
+ "E_0 = (-delta_g_0)/(n_e*F) #[V]\n",
+ "\n",
+ "# Results\n",
+ "print \"Standard state cell voltage for the production of aluminium is %f Volt\"%(E_0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard state cell voltage for the production of aluminium is -1.711054 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.8 Page: 362\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The reversible voltage for given electrochemical device\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 298.15 #[K] Temperature\n",
+ "F = 96500. #[(coulomb)/(mole*electrons)] faraday consmath.tant\n",
+ "\n",
+ "# The reaction taking place between lithium and florine is \n",
+ "# Li + F = LiF\n",
+ "# Calculations\n",
+ "# From Table A.8 we find that \n",
+ "delta_g_0 = -587.7*1000 #[J/mol]\n",
+ "# We also know that \n",
+ "n_e = 1 #[electron] no of electron transferred\n",
+ "# That is because the valence Li and F change by 1, so one electron is transferred per molecule of LiF, thus\n",
+ "E_298_0 = (-delta_g_0)/(n_e*F) #[V]\n",
+ "\n",
+ "# Results\n",
+ "print \"The reversible voltage for given electrochemical device is %f Volt\"%(E_298_0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reversible voltage for given electrochemical device is 6.090155 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.9 Page: 363\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The equilibrium cell voltage of electrolytic cell\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 298.15 #[K] Temperature\n",
+ "P_0 = 1. #[atm]\n",
+ "P = 100. #[atm]\n",
+ "E_0 = -1.229 #[V]\n",
+ "F = 96500. #[(coulomb)/(mole*electrons)] faraday consmath.tant\n",
+ "R = 8.314 #[J/(mol*K)] universal gas consmath.tant \n",
+ "\n",
+ "# The reaction is \n",
+ "# H2O(l) = H2(g) + 1/2O2(g)\n",
+ "# number of the valence electrons transferred in this reaction is \n",
+ "n_e = 2. #[(mole electrons)/mole]\n",
+ "\n",
+ "# Calculations\n",
+ "# Gibb's free energy is given by\n",
+ "# or\n",
+ "# In the rightmost term we replace v_T by (R*T)/P, which is correct only for ideal gases, so\n",
+ "# g = g_0 + (R*T)*math.log(P/P_0)\n",
+ "\n",
+ "# According to the assumption ,we can ignore the change in Gibb's free energy with pressure of the liquid water, so that \n",
+ "# delta_g = delta_g_0 + 1.5*(R*T)*math.log(P/P_0)\n",
+ "\n",
+ "# and \n",
+ "# E = (-delta_g)/(n_e*F) = -(delta_g_0 + 1.5*(R*T)*math.log(P/P_0))/(n_e*F)\n",
+ "# So equilibrium cell voltage is given as \n",
+ "E = E_0 - 1.5*(R*T)*math.log(P/P_0)/(n_e*F)\n",
+ "\n",
+ "# Results\n",
+ "print \"The equilibrium cell voltage of electrolytic cell if feed and product are at the pressure 100 atm is %f Volt\"%(E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium cell voltage of electrolytic cell if feed and product are at the pressure 100 atm is -1.317721 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.10 Page: 365 \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The value of the compressibility factor\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+25 #[K] Temperature\n",
+ "P = 11.38/760 #[atm] Pressure\n",
+ "R = 0.08206 #[(L*atm)/(mol*K)] Gas consmath.tant\n",
+ "v = 0.6525/0.04346 #[L/g] Specific volume \n",
+ "M = 60.05 #[g/mol] Molecular weight of HAc in the monomer form\n",
+ "\n",
+ "# Calculations\n",
+ "# So the specific volume in [L/mol] is\n",
+ "V = v*M #[L/mol]\n",
+ "\n",
+ "# Compressibility factor is give by\n",
+ "z = (P*V)/(R*T)\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of the compressibility factor for HAc at given condition is %f\"%(z) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of the compressibility factor for HAc at given condition is 0.551780\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.11 Page: 366\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Mole fraction of the monomer in the vapour phase\n",
+ "Mole fraction of the dimer in the vapour phase\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+25 #[K] Temperature\n",
+ "P = 11.38 #[torr] Pressure\n",
+ "\n",
+ "# Formation of the dimer from monomer in the gas phase follows the reaction \n",
+ "# 2*HAc = (HAc)2\n",
+ "\n",
+ "# Calculations\n",
+ "# From the equation 13.BF(page 366) given in the book\n",
+ "# K = (P*y_HAc_2)/(P*y_HAc)**(2) , where 'y_HAc_2' is mol fraction of dimer and 'y_HAc' is mol fraction of monomer\n",
+ "# and \n",
+ "# math.log10(K) = -10.4184 + 3164/T , so \n",
+ "K = 10**(-10.4184 + 3164/T) #[1/torr]\n",
+ "\n",
+ "# Thus \n",
+ "# y_HAc_2 = K*(P*y_HAc)**(2)/P\n",
+ "# Since, (y_HAc + y_HAc_2) = 1\n",
+ "# y_HAc_2 = K*(P*(1-y_HAc))**(2)/P\n",
+ "\n",
+ "# Solving for y_HAc_2\n",
+ "def f(y_HAc_2): \n",
+ "\t return K*(P*(1-y_HAc_2))**(2)/P-y_HAc_2\n",
+ "y_HAc_2 = fsolve(f,0)\n",
+ "# So\n",
+ "y_HAc = 1-y_HAc_2\n",
+ "\n",
+ "# Results\n",
+ "print \"Mole fraction of the monomer in the vapour phase is %f\"%(y_HAc)\n",
+ "print \"Mole fraction of the dimer in the vapour phase is %f\"%(y_HAc_2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mole fraction of the monomer in the vapour phase is 0.210713\n",
+ "Mole fraction of the dimer in the vapour phase is 0.789287\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 13.12 Page: 367\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The compressibility factor z for the gaseous mixture\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# Getting the data from the example 13.10\n",
+ "T = 273.15+25 #[K] Temperature\n",
+ "P = 11.38/760 #[atm] Pressure\n",
+ "R = 0.08206 #[(L*atm)/(mol*K)] Gas consmath.tant\n",
+ "v = 0.6525/0.04346 #[L/g] Specific volume \n",
+ "\n",
+ "# Now from the previous example ie example 13.11 the mole fractions of the monomer and dimer in the gas phase is \n",
+ "y_HAc = 0.211 # monomer \n",
+ "y_HAc_2 = 0.789 # dimer\n",
+ "\n",
+ "# Molecular weights of the monomer and dimer forms are\n",
+ "M_HAc = 60.05 #[g/mol] monomer \n",
+ "M_HAc_2 = 120.10 #[g/mol] dimer\n",
+ "\n",
+ "# Calculations\n",
+ "# Now average molecular weight of the mixture is\n",
+ "M_avg = M_HAc*y_HAc + M_HAc_2*y_HAc_2 #[g/mol]\n",
+ "\n",
+ "# So specific volume in [L/mol] is\n",
+ "V = v*M_avg #[L/mol]\n",
+ "\n",
+ "# Now compressibility factor is\n",
+ "z = (P*V)/(R*T)\n",
+ "\n",
+ "# Results\n",
+ "print \"The compressibility factor z for the gaseous mixture is %f\"%(z)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The compressibility factor z for the gaseous mixture is 0.987135\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch14.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch14.ipynb
new file mode 100644
index 00000000..d85f313f
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch14.ipynb
@@ -0,0 +1,645 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 : Equilibrium With Gravity Or Centrifugal Force Osmotic Equilibrium Equilibrium With Surface Tension"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.1 Page: 379\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The mol fraction of the methane\n",
+ "The mol fraction of the ethane\n",
+ "The mol fraction of the propane \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 300. #[K] Temperature of the natural gas well\n",
+ "R = 8.314 #[J/(mol*K)] universal gas consmath.tant\n",
+ "z_1 = 0 #[m]\n",
+ "# At the surface of the well mole fraction of the components are\n",
+ "y_methane_surf = 85./100 #[mol%]\n",
+ "y_ethane_surf = 10/100. #[mol%]\n",
+ "y_propane_surf = 5/100. #[mol%]\n",
+ "P = 2. #[MPa] Total equilibrium pressure \n",
+ "z_2 = 1000. #[m] Depth of the well \n",
+ "\n",
+ "# Calculations\n",
+ "# Molecular weights of the components are\n",
+ "M_methane = 16./1000 #[kg/mol]\n",
+ "M_ethane = 30./1000 #[kg/mol]\n",
+ "M_propane = 44./1000 #[kg/mol]\n",
+ "\n",
+ "# Now, we have the relation between the fugacities of a component at z_1 and z_2 as\n",
+ "# f_i_2/f_i_1 = exp((-M_i*g*(z_2-z_1))/(R*T)) , where g is gravitational accelaration and its value is\n",
+ "g = 9.81 #[m/s**(2)]\n",
+ "\n",
+ "# Fugacities of the various components at the surface i.e. at z = z_1 is\n",
+ "f_methane_1 = y_methane_surf*P #[MPa]\n",
+ "f_ethane_1 = y_ethane_surf*P #[MPa]\n",
+ "f_propane_1 = y_propane_surf*P #[MPa]\n",
+ "\n",
+ "# Now, fugacities at z = z_2 are\n",
+ "f_methane_2 = f_methane_1*math.exp((-M_methane*g*(z_1-z_2))/(R*T)) #[MPa]\n",
+ "f_ethane_2 = f_ethane_1*math.exp((-M_ethane*g*(z_1-z_2))/(R*T)) #[MPa]\n",
+ "f_propane_2 = f_propane_1*math.exp((-M_propane*g*(z_1-z_2))/(R*T)) #[MPa]\n",
+ "\n",
+ "# Let at z = z_1 total pressure of the gases are P_2\n",
+ "# Then, fugacities of the ith component is also given as \n",
+ "# f_i_2 = y_i_2*P_2\n",
+ "# Writing the expression for all the component ad adding them we get \n",
+ "# (f_methane_2 + f_ethane_2 + f_propane_2 ) = y_methane_2*P_2 + y_ethane_2*P_2 + y_propane_2*P_2\n",
+ "# or\n",
+ "# (f_methane_2 + f_ethane_2 + f_propane_2 ) = P_2*(y_methane_2 + y_ethane_2 + y_propane_2)\n",
+ "# and\n",
+ "# (y_methane_2 + y_ethane_2 + y_propane_2) = 1 ,so\n",
+ "P_2 = (f_methane_2 + f_ethane_2 + f_propane_2 ) #[MPa]\n",
+ "\n",
+ "# Now the mole fractions of the components are \n",
+ "# y_i_2 = f_i_2/P_2 , so\n",
+ "y_methane_2 = f_methane_2/P_2\n",
+ "y_ethane_2 = f_ethane_2/P_2\n",
+ "y_propane_2 = f_propane_2/P_2\n",
+ "\n",
+ "# Results\n",
+ "print \"The mol fraction of the methane at the depth 1000m is %f\"%(y_methane_2)\n",
+ "print \"The mol fraction of the ethane at the depth 1000m is %f\"%(y_ethane_2)\n",
+ "print \"The mol fraction of the propane at the depth 1000m is %f\"%(y_propane_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mol fraction of the methane at the depth 1000m is 0.840351\n",
+ "The mol fraction of the ethane at the depth 1000m is 0.104461\n",
+ "The mol fraction of the propane at the depth 1000m is 0.055187\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.2 Page: 380\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find Concentration of the nitrogen at the top of atmosphere with respect to the concentration of nitrogen \n",
+ "at the surface of the earth\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 288. #[K] Atmospheric temperature \n",
+ "R = 8.314 #[J/(mol*K)] universal gas consmath.tant\n",
+ "z_2 = 15000. #[m] Thickness of the atmosphere\n",
+ "z_1 = 0. #[m] Surface\n",
+ "# At the surface, the mole fraction of nitrogen and oxygen are \n",
+ "y_N2_1 = 0.79\n",
+ "y_O2_1 = 0.21\n",
+ "M_N2 = 28./1000 #[kg/mol]\n",
+ "M_O2 = 32./1000 #[kg/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# For an ideal solution of ideal gases with only two species, we have \n",
+ "# y_i_2/y_i_1 = 1/(y_i_1 + y_j_1/a) , and\n",
+ "# a = exp(-(M_i-M_j)*g*(z_2-z_1)/(R*T))\n",
+ "# where 'g' is accelaration due to gravity and its value is\n",
+ "g = 9.81 #[m/s**(2)]\n",
+ "\n",
+ "# So\n",
+ "a = math.exp(-(M_N2-M_O2)*g*(z_2-z_1)/(R*T))\n",
+ "# and\n",
+ "yi2_by_yi1 = 1/(y_N2_1 + y_O2_1/a)\n",
+ "\n",
+ "# Results\n",
+ "print \" Concentration of the nitrogen at the top of atmosphere with respect to the concentration of nitrogen \\\n",
+ " at the surface of the earth is yi2_by_yi1 = %0.2f\"%(yi2_by_yi1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Concentration of the nitrogen at the top of atmosphere with respect to the concentration of nitrogen at the surface of the earth is yi2_by_yi1 = 1.05\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.3 Page: 381\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find \n",
+ "Concentration of the nitrogen at the top of reactor with respect to the concentration of nitrogen \n",
+ "at the bottom of reactor\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# For this problem all the data are same as in previous Example 14.2 except z_1 and z_2 \n",
+ "# So\n",
+ "T = 288. #[K] Atmospheric temperature \n",
+ "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n",
+ "z_2 = 10. #[m] Height of the reactor\n",
+ "z_1 = 0. #[m] Surface\n",
+ "g = 9.81 #[m/s**(2)] Accelaration due to gravity\n",
+ "\n",
+ "# Calculations\n",
+ "# At z = z_1, the mole fraction of nitrogen and oxygen are \n",
+ "y_N2_1 = 0.79\n",
+ "y_O2_1 = 0.21\n",
+ "M_N2 = 28./1000 #[kg/mol]\n",
+ "M_O2 = 32./1000 #[kg/mol]\n",
+ "\n",
+ "# So\n",
+ "a = math.exp(-(M_N2-M_O2)*g*(z_2-z_1)/(R*T))\n",
+ "# and\n",
+ "yi2_by_yi1 = 1/(y_N2_1 + y_O2_1/a)\n",
+ "\n",
+ "# Results\n",
+ "print \" Concentration of the nitrogen at the top of reactor with respect to the concentration of nitrogen \\\n",
+ " at the bottom of reactor is yi2_by_yi1 = %f\"%(yi2_by_yi1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Concentration of the nitrogen at the top of reactor with respect to the concentration of nitrogen at the bottom of reactor is yi2_by_yi1 = 1.000034\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.4 Page: 382\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 300. #[K] Temperature of the centrifuge\n",
+ "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n",
+ "# Mole fractions of the two components are \n",
+ "y_UF6_238_1 = 0.993 # Mole fraction of UF6 with 238 isotope of uranium in feed\n",
+ "y_UF6_235_1 = 0.007 # Mole fraction of UF6 with 235 isotope of uranium in feed\n",
+ "M_UF6_238 = 352./1000 #[kg/mol] Molecular weight of UF6 with 238 isotope of uranium\n",
+ "M_UF6_235 = 349./1000 #[kg/mol] Molecular weight of UF6 with 235 isotope of uranium\n",
+ "r_in = 2./100 #[m] Interanal raddi of the centrifuge\n",
+ "r_out = 10./100 #[m] outer raddi of the centrifuge\n",
+ "f = 800. #[revolution/second] Rotational frequency of centrifuge\n",
+ "\n",
+ "# Calculations\n",
+ "# Here the accelaration will come due to centrifugal force and is \n",
+ "# g = w**(2)*r , where 'w' is angular speed and its value is w = 2*pie*f and 'r' is radius \n",
+ "# But in the present case 'r' is varies as we move away from the axis of centrifuge\n",
+ "# After making integration by taking small elements at the dismath.tance 'r' we find the expression \n",
+ "a = math.exp((M_UF6_235-M_UF6_238)*(2*3.141592*f)**(2)*(r_out**(2)-r_in**(2))/(2*R*T))\n",
+ "\n",
+ "# Now Let the ratio y_i_2/y_i_1 = A\n",
+ "# Then we have \n",
+ "A = 1./(y_UF6_235_1 + y_UF6_238_1/a)\n",
+ "\n",
+ "# Now say y_i_1/y_i_2 = 1/A = B , then\n",
+ "B = 1./A\n",
+ "\n",
+ "# Results\n",
+ "print \"The ratio of the mole fraction of UF6 with uranium 235 isotope) at the 2 cm radius to\\\n",
+ " that at the 10 cm radius is %0.3f\"%(B)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of the mole fraction of UF6 with uranium 235 isotope) at the 2 cm radius to that at the 10 cm radius is 1.156\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.5 Page: 384\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The pressure difference between the two phases\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# We have two phase system in this problem in which phase 1 is seawater and phase 2 is fresshwater \n",
+ "# Seawater contains mostly NaCl, Na2SO4, MgCl2, KCl and if they completly ionised then\n",
+ "x_water_1 = 0.98 # mole fraction of water in phase 1 i.e. in seawater\n",
+ "x_water_2 = 1. # mole fraction of water in the phase 2 i.e. in water \n",
+ "R = 10.73 #[(psi*ft**(3))/(lbmol*R)] Universal gas consmath.tant\n",
+ "T = 500. #[R] temperature\n",
+ "v_water_1 = 18/62.4 # [ft**(3)/(lbmol)]\n",
+ "\n",
+ "# The effect of the pressure on the fugacity of the liquid is given as\n",
+ "\n",
+ "# Calculations\n",
+ "# Writing this equation twice, oncce for pure water and once for the water in the ocean water, and equating the fugacities, we get \n",
+ "\n",
+ "# For pure water, x_i and Y_i are unity, and for the water in the solution, with mole fraction 0.98, Raoult's law is certain to be practically obeyed\n",
+ "# So that Y_i is certain to be practically unity.\n",
+ "\n",
+ "# The partial molal volume of water in pure water is practically the same as that in dilute solutions,\n",
+ "# Tkaing the math.logarithm of both sides and solving , we get \n",
+ "\n",
+ "# Integrating with the limit P_purewater and P_seawater we have\n",
+ "# -math.log(x_water_1) = (v_water_1/(R*T))*( P_seawater - P_purewater )\n",
+ "# ( P_seawater - P_purewater ) = delta_P\n",
+ "# So \n",
+ "delta_P = (-(R*T)*math.log(x_water_1))/v_water_1#[psi]\n",
+ "\n",
+ "# Results\n",
+ "print \"The pressure difference between the two phases is %0.1f psi\"%(delta_P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference between the two phases is 375.7 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.6 Page: 386\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate Pressure difference with the change in radius of the drop of the water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 100. #[C] Temperature of the outside\n",
+ "P_outside = 1. #[atm]\n",
+ "# At 100 C, the surface tension between steam and water is \n",
+ "T = 0.05892 #[N/m] From metric steam table (7, page 267)\n",
+ "\n",
+ "# Pressure difference between inside and outside of a drop is given by the expression \n",
+ "# (P_inside - P_outside) = (4*T)/d_i\n",
+ "\n",
+ "# Let (P_inside - P_outside) = delta_P , so\n",
+ "#delta_P = (4*T)/d_i\n",
+ "# For the drop of diameter\n",
+ "d_1 = 0.001 #[m]\n",
+ "\n",
+ "# Calculations\n",
+ "# So \n",
+ "delta_P_1 = (4*T)/d_1 #[Pa]\n",
+ "\n",
+ "# Which is certainly negligible \n",
+ "# If we reduce the diameter to \n",
+ "d_2 = 10**(-6) #[m]\n",
+ "\n",
+ "# So \n",
+ "delta_P_2 = (4*T)/d_2 #[Pa]\n",
+ "\n",
+ "# If we reduce it to diameter that is smallest sized drop likely to exist \n",
+ "d_3 = 0.01*10**(-6) #[m]\n",
+ "# Then the calculated pressure difference is \n",
+ "delta_P_3 = (4*T)/d_3 #[Pa]\n",
+ "\n",
+ "# Results\n",
+ "print \"Pressure difference with the change in radius of the drop of the water is given as in the following table\"\n",
+ "print \" Diameter of the droplet d_iin meter Pressure difference P_inside - P_outside in atm\"\n",
+ "print \" %0.2e %0.2e\"%(d_1,delta_P_1) \n",
+ "print \" %0.2e %0.2e\"%(d_2,delta_P_2) \n",
+ "print \" %0.2e %0.2e\"%(d_3,delta_P_3) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure difference with the change in radius of the drop of the water is given as in the following table\n",
+ " Diameter of the droplet d_iin meter Pressure difference P_inside - P_outside in atm\n",
+ " 1.00e-03 2.36e+02\n",
+ " 1.00e-06 2.36e+05\n",
+ " 1.00e-08 2.36e+07\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.7 Page: 387\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The equilibrium pressure at which the steam begin to condence at this temperature on the nuclei \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P_NBP = 1. #[atm]\n",
+ "Temp =273.15+100 #[C] Temperature\n",
+ "D = 0.01*10**(-6) #[m] Diameter of the condensation nuclei( due to impurity )\n",
+ "T = 0.05892 #[N/m] Surface tension between water drops and gas\n",
+ "R = 8.314 #[J/(mol*K)]\n",
+ "\n",
+ "# At equilibrium the Gibb's free energy per pound will be the same inside and outside the drops.\n",
+ "# From the previous example 14.6, the pressure difference inside and outside of the drop is \n",
+ "# delta_P = ( P_inside-P_outside) = 4*T/D = 233 atm = 235.7 bar\n",
+ "\n",
+ "# Calculations\n",
+ "# Taking the Gibb's free energy at the normal boiling point as g_NBP we have \n",
+ "# also\n",
+ "# and\n",
+ "v_water_liquid = 1/958.39*0.018 #[m**(3)/mol]\n",
+ "\n",
+ "# If we assume that the specific volume of the liquid is a consmath.tant,and independent of pressure, and that the volume of the vapour is given by the gas law\n",
+ "# then we can perform the integrations and cancel the g_NBP terms, finding the Kelvin equation \n",
+ "\n",
+ "# (R*Temp)*math.log(P_gas/P_NBP) = v_water_liquid*(P_gas + 4*T/D - P_NBP)\n",
+ "# For very small drops \n",
+ "# (P_gas - P_NBP) << 4*T/D\n",
+ "# So that we can write it approximately as \n",
+ "\n",
+ "# P_gas/P_NBP = exp(v_water_liquid*(4*T/D)/(R*Temp)) = I\n",
+ "# so\n",
+ "I = math.exp(v_water_liquid*(4*T/D)/(R*Temp))\n",
+ "\n",
+ "# Substracting 1 from both sides in the above equation we have \n",
+ "# (P_gas-P_NBP)/P_NBP = I-1\n",
+ "# So \n",
+ "P_gas_minus_P_NBP = (I-1)*P_NBP #[atm]\n",
+ "# Changing into the bar we have \n",
+ "delta_P = P_gas_minus_P_NBP*1.01325 #[bar]\n",
+ "\n",
+ "# Now changing the unit to psi we have \n",
+ "delta_P_1 = delta_P*100*0.1450377 #[psi]\n",
+ "\n",
+ "# Results\n",
+ "print \"The equilibrium pressure at which the steam begin to condence at this temperature on \\\n",
+ " the nuclei is %f psi above the normal boiling point.\"%(delta_P_1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium pressure at which the steam begin to condence at this temperature on the nuclei is 2.253760 psi above the normal boiling point.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.8 Page: 388\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The liquid can lower its free energy\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 273.15+100 #[K] Temperature of the water drop\n",
+ "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n",
+ "D = 0.01*10**(-6) #[m] Diameter of the water drop\n",
+ "P_g = 0.15 #[bar] guage pressure\n",
+ "T = 0.05892 #[N/m] Surface tension between water drop and gas\n",
+ "\n",
+ "# The calculation of the pressure difference from inside to outside is the same as done in the example 14.7\n",
+ "\n",
+ "# Calculations\n",
+ "# The specific Gibb's free energy of the liquid is thus given as\n",
+ "# Where \n",
+ "v_water_liquid = 0.018/958.39 #[m**(3)/mol]\n",
+ "P_NBP = 1.013 #[bar]\n",
+ "P_gas = 1.013+0.15 #[bar]\n",
+ "\n",
+ "# Say\n",
+ "P_1 = P_gas + 4*T/D #[bar]\n",
+ "# and (g_water_liquid - g_NBP) = delta_g_1\n",
+ "# So\n",
+ "\n",
+ "def f2(P): \n",
+ "\t return v_water_liquid*P**(0)\n",
+ "\n",
+ "delta_g_1 = quad(f2,P_NBP,P_1)[0]\n",
+ "\n",
+ "\n",
+ "# and for the gas, again umath.sing equation for Gibb's free energy, we have \n",
+ "# Here assuming that the vapour follows the ideal gas law we have \n",
+ "# v_water_gas = (R*Temp/P)\n",
+ "# and also let (g_water_liquid- g_NBP) = delta_g_2\n",
+ "# so\n",
+ "\n",
+ "def f3(P): \n",
+ "\t return (R*Temp)/P\n",
+ "\n",
+ "delta_g_2 = quad(f3,P_NBP,P_gas)[0]\n",
+ "\n",
+ "\n",
+ "# Now \n",
+ "# (g_water_liquid - g_water_gas) = (g_water_liquid - g_NBP)-(g_water_gas - g_NBP) = delta_g\n",
+ "# So\n",
+ "delta_g = (delta_g_1 - delta_g_2) \n",
+ "\n",
+ "# We have got the value of the delta_g positive, so\n",
+ "\n",
+ "# Results\n",
+ "print \"The liquid can lower its free energy %0.2f J/mol by Changing to gas,\"%(delta_g)\n",
+ "print \"So that even at 0.15 bar above the normal boiling point, a drop of this small size is unstable and will quickly evaporate.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The liquid can lower its free energy 14.25 J/mol by Changing to gas,\n",
+ "So that even at 0.15 bar above the normal boiling point, a drop of this small size is unstable and will quickly evaporate.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 14.9 Page: 390\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The liquid pressure at which these boiling nuclei will begin to grow and intiate boiling\n",
+ "At this external pressure the pressure inside the bubble\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 904.7 #[R] Temperature of the pure liquid water \n",
+ "P_NBP = 400. #[psia] Saturation pressure of the pure liquid water at the given temperature\n",
+ "T = 1.76*10**(-4) #[lbf/inch] Surface tension of water\n",
+ "R = 10.73 #[(psi*ft**(3))/(lbmol*R)]\n",
+ "\n",
+ "# Calculations\n",
+ "# In this problem the gas is inside the bubble, at a pressure much higher than that of the sorrounding liquid.\n",
+ "# The criterion of equilibrium is that the Gibb's free energy of the gas inside the bubble must be the same as that of the liquid outside the bubble.\n",
+ "# Thus we have \n",
+ "# also\n",
+ "# where\n",
+ "v_water_liquid = 18*0.01934 #[ft**(3)/lbmol]\n",
+ "D = 10**(-5.) #[inch]\n",
+ "\n",
+ "# so \n",
+ "# Here we assume that the liquid has practically consmath.tant density and that the gas behaves as an ideal gas and find \n",
+ "# (R*Temp)*math.log((P_liquid+4*T/D)/P_NBP) = v_water_liquid*(P_liquid - P_NBP)\n",
+ "# let P_liquid = p\n",
+ "\n",
+ "# We will solve the above equation for p\n",
+ "def f(p): \n",
+ "\t return v_water_liquid*(p - P_NBP)-(R*Temp)*math.log((p+4*T/D)/P_NBP)\n",
+ "P_liquid = fsolve(f,300)\n",
+ "\n",
+ "# At this external pressure the pressure inside the bubble is \n",
+ "P_inside = P_liquid + 4*T/D #[psia]\n",
+ "\n",
+ "# Results\n",
+ "print \"The liquid pressure at which these boiling nuclei will begin to grow and intiate boiling is %0.1f psia\"%(P_liquid)\n",
+ "print \"At this external pressure the pressure inside the bubble is %0.1f psia\"%(P_inside)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The liquid pressure at which these boiling nuclei will begin to grow and intiate boiling is 328.6 psia\n",
+ "At this external pressure the pressure inside the bubble is 399.0 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb
new file mode 100644
index 00000000..3eab43ea
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb
@@ -0,0 +1,319 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : The Phase Rule"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.2 Page: 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate independent relations among these four species\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# The system contains four species\n",
+ "print \" In this system there are four identifiable chemical species%(which are C,O2,CO2 and CO. The balanced equations we can write among them are\"\n",
+ "\n",
+ "print \" C + 0.5O2 = CO\"\n",
+ "print \" C + O2 = CO2\"\n",
+ "print \" CO + 0.5O2 = CO2\"\n",
+ "print \" CO2 + C = 2CO\"\n",
+ "\n",
+ "# Let we call these equations A, B, C and D respectively\n",
+ "# These relations are not independent.\n",
+ "# If we add A and C and cancel like terms, we obtain B.\n",
+ "# So, If we want independent chemical equilibria we must remove equation C\n",
+ "\n",
+ "# Now, if we reverse the direction of B and add it to A, we see that D is also not independent.\n",
+ "# Thus, there are only two independent relations among these four species and \n",
+ "print \" There are only two independent relations among these four species and\"\n",
+ "\n",
+ "# V = C + 2 - P\n",
+ "# and we have\n",
+ "V = 2# No of the variable\n",
+ "P = 2# No of the phases\n",
+ "# So\n",
+ "C = V + P - 2\n",
+ "print \" C = V + P - 2\"\n",
+ "print \" C = 4 - 2 = 2\"\n",
+ "print \" Thus, this is a two-component system\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " In this system there are four identifiable chemical species%(which are C,O2,CO2 and CO. The balanced equations we can write among them are\n",
+ " C + 0.5O2 = CO\n",
+ " C + O2 = CO2\n",
+ " CO + 0.5O2 = CO2\n",
+ " CO2 + C = 2CO\n",
+ " There are only two independent relations among these four species and\n",
+ " C = V + P - 2\n",
+ " C = 4 - 2 = 2\n",
+ " Thus, this is a two-component system\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.3 Page: 402\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Define Phase rule\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# This contains three species.\n",
+ "print \" The three species in this system are H2 N2 and NH3\"\n",
+ "N = 3\n",
+ "print \" There is only one balanced chemical reaction among these species\"\n",
+ "Q = 1\n",
+ "\n",
+ "# 2NH3 = N2 + 3H2\n",
+ "C = N - Q\n",
+ "print \" C = N - Q = %0.0f\"%(C)\n",
+ "# Now let us we made the system by starting with pure ammonia.\n",
+ "# Assuming that all the species are in the gas phase, ammonia dissociates in H2 and N2 in the ratio of 3:1.\n",
+ "print \" Let we start with pure ammonia in the system then ammonia will dissociate in H2 and N2 in the ratio of 3:1.\"\n",
+ "\n",
+ "# We can write an equation among their mole fractions, viz\n",
+ "# y_H2 = 3*y_N2\n",
+ "print \" And the relation between their mole fraction is y_H2 = 3*y_N2\"\n",
+ "\n",
+ "# We might modify the phase rule to put in another symbol for stoichiometric restrictions, but the common usage is to write that \n",
+ "# Components = species - (independent reactions) - (stoichiometric restriction)\n",
+ "# and stoichiometric restriction SR is \n",
+ "SR = 1\n",
+ "# so\n",
+ "c = N-Q-SR\n",
+ "print \" We have the modified phase rule as Components = species - independent reactions - stoichiometric restriction\"\n",
+ "print \" C = N - Q - SR = %0.0f\"%(c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The three species in this system are H2 N2 and NH3\n",
+ " There is only one balanced chemical reaction among these species\n",
+ " C = N - Q = 2\n",
+ " Let we start with pure ammonia in the system then ammonia will dissociate in H2 and N2 in the ratio of 3:1.\n",
+ " And the relation between their mole fraction is y_H2 = 3*y_N2\n",
+ " We have the modified phase rule as Components = species - independent reactions - stoichiometric restriction\n",
+ " C = N - Q - SR = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.4 Page: 403\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find number of the components present in the test tube\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# We have been given the reaction \n",
+ "# CaCO3(s) = CaO(s) + CO2(g)\n",
+ "\n",
+ "# Here we have three species and one balanced chemical reaction between them\n",
+ "# So\n",
+ "N = 3# No of species\n",
+ "Q = 1 # no of reaction\n",
+ "\n",
+ "# Since CO2 will mostly be in the gas phase and CaCO3 and CaO will each form separate solid phases, \n",
+ "# there is no equation we can write among the mole fractions in any of the phases.\n",
+ "# Hence, there is no stoichiometric restriction i.e.\n",
+ "SR = 0\n",
+ "# and the number of the components is\n",
+ "C = N - Q - SR\n",
+ "\n",
+ "print \"Number of the components presents in the test tube are %0.0f\"%(C)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of the components presents in the test tube are 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.5 Page: 403\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "(a) How many phases are present?\n",
+ "(b) How many degrees of freedom are there?\n",
+ "(c) If we place a sample of pure CaCO 3 in an evacuated container and heat it, will we find a unique P-T curve?\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# We have been given the reaction \n",
+ "# CaCO3(s) = CaO(s) + CO2(g)\n",
+ "# The CaCO3 and CaO form separate solid phases, so we have three phases, two solid and one gas. \n",
+ "# So\n",
+ "P = 3\n",
+ "# This is a two component system, so\n",
+ "C = 2\n",
+ "\n",
+ "# From the phase rule\n",
+ "V = C + 2 - P\n",
+ "\n",
+ "# If there is only one degree of freedom, then the system should have a unique P-T curve.\n",
+ "# Reference [ 2, page 214 ] as reported in the book, shows the data to draw such a curve, which can be well represented by\n",
+ "# math.log(p/torr) = 23.6193 - 19827/T\n",
+ "\n",
+ "print \" The no. of phases present in the system are %0.0f \"%(P)\n",
+ "print \" Total no of degrees of freedom is %0.0f \"%(V)\n",
+ "print \" Since there is only one degree of freedom so the system has a unique P-T curve\"\n",
+ "print \" which can be well represented by logp/torr = 23.6193 - 19827/T\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The no. of phases present in the system are 3 \n",
+ " Total no of degrees of freedom is 1 \n",
+ " Since there is only one degree of freedom so the system has a unique P-T curve\n",
+ " which can be well represented by logp/torr = 23.6193 - 19827/T\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.6 Page: 404\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find number of components\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# The system consists of five species.\n",
+ "print \" The five species present in the system are H2O%( HCl%( H+%( OH- and Cl-. \"\n",
+ "# So\n",
+ "N = 5 # Number of the species \n",
+ "print \" Here we have two chemical relations:\"\n",
+ "print \" H2O = H+ + OH- \"\n",
+ "print \" HCl = H+ + Cl- \"\n",
+ "\n",
+ "# so\n",
+ "Q = 2 # No of the reactions\n",
+ "\n",
+ "# In addition we have electroneutrality, which says that at equilibrium the total no of positive ions in the solution must be the same as the total no of nagative ions,or\n",
+ "# [H+] = [OH-] + [Cl-]\n",
+ "# To maintain electroneutrality number of positive and negative ion should be same.\n",
+ "# Here [H+] smath.radians(numpy.arcmath.tan(s for the molality of hydrogen ion. This is convertible to a relation among the 'mu's' hence,\n",
+ "# it is an additional restriction, so\n",
+ "SR = 1 \n",
+ "# So\n",
+ "# The number of components is\n",
+ "C = N - Q - SR\n",
+ "\n",
+ "print \" Number of the components present in the system are C = N - Q - SR = %0.0f\"%(C)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The five species present in the system are H2O%( HCl%( H+%( OH- and Cl-. \n",
+ " Here we have two chemical relations:\n",
+ " H2O = H+ + OH- \n",
+ " HCl = H+ + Cl- \n",
+ " Number of the components present in the system are C = N - Q - SR = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch2.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch2.ipynb
new file mode 100644
index 00000000..76efb50a
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch2.ipynb
@@ -0,0 +1,222 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Chapter 2 : Basic Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page: 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Calculate internal energy of the steam\n",
+ "enthalpy of the steam,entropy of the steam and Piston expanding.\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 1. #[lbm] Mass of the steam\n",
+ "T_1 = 300. #[F] Initial temperature\n",
+ "P_1 = 14.7 #[psia] Initial pressure\n",
+ "P_sorronding = 14.7 #[psia]\n",
+ "Q = 50. #[Btu] Amount of the energy added to the system as heat\n",
+ "\n",
+ "# This is a closed system and we can apply the following equations\n",
+ "# delta_U_system = sum(dQ_in_minus_out) + sum(dW_in_minus_out) (A)\n",
+ "# dS_system = (m*ds)_system = sum((dQ)/T)_in_minus_out + dS_reversible (B)\n",
+ "\n",
+ "# From the steam tables, we look up the properties of steam at temperature 300F and pressure 14.7 psia and find \n",
+ "u_initial = 1109.6 #[Btu/lbm] Internal energy of the steam\n",
+ "h_initial = 1192.6 #[Btu/lbm] Enthalpy of the steam\n",
+ "s_initial = 1.8157 #[Btu/(lbm*R)] Entropy of the steam\n",
+ "\n",
+ "# The work here is done by the system, equal to\n",
+ "# -delta_w = P*A_piston*delta_x = P*m*delta_v\n",
+ "\n",
+ "# Calculations\n",
+ "# Substituting this in the equation (A) and rearranging, we have\n",
+ "# m*delta_(u + P*v) = m*delta_h = delta_Q\n",
+ "# From which we can solve for the final specific enthalpy\n",
+ "h_final = h_initial + Q #[Btu/lbm]\n",
+ "\n",
+ "# Now, by the linear interpolation we find that at h = 1242.6 Btu/lbm and P = 1 atm, temperature of the steam is given \n",
+ "T_2 = 405.7 #[F] Final temperature\n",
+ "\n",
+ "# At this final temperature and pressure we have the steam properties \n",
+ "u_final = 1147.7 #[Btu/lbm]\n",
+ "s_final = 1.8772 #[Btu/(lbm*R)]\n",
+ "\n",
+ "# Thus, increase in the internal energy, enthalpy and entropy are \n",
+ "delta_u = u_final - u_initial #[Btu/lbm]\n",
+ "delta_s = s_final - s_initial #[Btu/(lbm*R)]\n",
+ "delta_h = Q #[Btu/lbm]\n",
+ "\n",
+ "# The work done on the atmosphere is given by\n",
+ "w = delta_h - delta_u #[Btulbm]\n",
+ "\n",
+ "# Results\n",
+ "print \"The increase in internal energy of the steam by adding the heat is %0.2f Btu/lbm\"%(delta_u)\n",
+ "print \"The increase in enthalpy of the steam by adding the heat is %0.2f Btu/lbm\"%(delta_h)\n",
+ "print \"The increase in entropy of the steam by adding the heat is %0.4f Btu/lbm\"%(delta_s)\n",
+ "print \"Work done by the piston expanding against the atmosphere is %0.2f Btu/lbm\"%(w)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The increase in internal energy of the steam by adding the heat is 38.10 Btu/lbm\n",
+ "The increase in enthalpy of the steam by adding the heat is 50.00 Btu/lbm\n",
+ "The increase in entropy of the steam by adding the heat is 0.0615 Btu/lbm\n",
+ "Work done by the piston expanding against the atmosphere is 11.90 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page: 28\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find Turbine of steam\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T_in = 600. #[F] Input steam temperature\n",
+ "P_in = 200. #[psia] Input steam pressure\n",
+ "P_exit = 50. #[psia]\n",
+ "\n",
+ "# Because this is a steady-state, steady-flow process, we use \n",
+ "# (work per pound) = W/m = -( h_in - h_out )\n",
+ "\n",
+ "# From the steam table we can read the the inlet enthalpy and entropy as \n",
+ "h_in = 1322.1 #[Btu/lbm]\n",
+ "s_in = 1.6767 #[Btu/(lb*R)]\n",
+ "\n",
+ "# Now, we need the value of h_out\n",
+ "\n",
+ "# For a reversible adiabatic steady-state, steady-flow process, we have\n",
+ "# sum(s*m_in_minus_out) = ( s_in - s_out ) = 0\n",
+ "\n",
+ "# Which indicates that inlet and outlet entropies are same\n",
+ "# We can find the outlet temperature by finding the value of the temperature in the steam table\n",
+ "# For which the inlet entropy at 50 psia is the same as the inlet entropy, 1.6767 Btu/(lb*R). \n",
+ "# By linear interpolation in the table we find \n",
+ "T_in = 307.1 #[R]\n",
+ "\n",
+ "# and by the linear interpolation in the same table we find that\n",
+ "h_out = 1188.1 #[Btu/lb]\n",
+ "\n",
+ "# Calculations\n",
+ "# Thus, we find \n",
+ "W_per_pound = (h_in - h_out) #[Btu/lb]\n",
+ "\n",
+ "# Results\n",
+ "print \" The work output of the turbine of steam is %0.1f Btu/lb\"%(-W_per_pound)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The work output of the turbine of steam is -134.0 Btu/lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page: 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate compressibility factor of steam\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 500. #[F]\n",
+ "P = 680. #[psi]\n",
+ "\n",
+ "# Calculations\n",
+ "# It is reported in the book in the table A.1(page 417) that for water \n",
+ "# We know that T_r = T/T_c and P_r = P/P_c, so\n",
+ "T_c = 647.1*1.8 #[R]\n",
+ "P_c = 220.55*14.51 #[psia]\n",
+ "w = 0.345\n",
+ "T_r = (T+459.67)/T_c\n",
+ "P_r = P/P_c\n",
+ "z_0 = 1+P_r/T_r*(0.083-0.422/T_r**(1.6))\n",
+ "z_1 = P_r/T_r*(0.139-0.172/T_r**(4.2))\n",
+ "z = z_0+w*z_1\n",
+ "\n",
+ "# Results\n",
+ "print \"The compressibility factor of steam at the given state is %0.3f\"%(z)\n",
+ "# Based on the steam table (which may be considered as reliable as the experimental data, the value of z is 0.804.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The compressibility factor of steam at the given state is 0.851\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch3.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch3.ipynb
new file mode 100644
index 00000000..84d35a73
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch3.ipynb
@@ -0,0 +1,539 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : The Simplest Phase Equilibrium Examples and Some Simple Estimating Rules"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page: 52\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate mole fraction of water vapour in air in equilibrium\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 20. #[C]\n",
+ "P = 1. #[atm]\n",
+ "# From Raoult's law y_i*P = x_i*p_i\n",
+ "# Rearranging\n",
+ "#y_i = x_i*p_i/P\n",
+ "\n",
+ "# Calculations\n",
+ "x_N2 = 0\n",
+ "x_O2 = 0\n",
+ "x_water = 1-x_N2-x_O2\n",
+ "# From any steam table we may look up the value of the vapour pressure of water at 20C, finding\n",
+ "p_water = 0.023 #[atm]\n",
+ "# So \n",
+ "y_water = x_water*p_water/P\n",
+ "\n",
+ "# Results\n",
+ "print \"The mole fraction of water vapour in air in equilibrium with water is %f\"%(y_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mole fraction of water vapour in air in equilibrium with water is 0.023000\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page: 53\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate concentration of oxygen\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 20. #[C]\n",
+ "P = 1. #[atm]\n",
+ "# From previous example i.e. example 3.1\n",
+ "y_water = 0.023\n",
+ "#so that \n",
+ "#y = y_N2+y_O2\n",
+ "y = 1-y_water\n",
+ "# The oxygen is 0.21 mole fraction of this mix, so that\n",
+ "y_O2 = y*0.21\n",
+ "# It is reported in the book in table A.3 (page 419) that Henry's law cinsmath.tant for oxygen in water at 20C is \n",
+ "H_O2 = 40100 #[atm]\n",
+ "# From Henry's law, we have \n",
+ "# y_i = x_i*H_i/P\n",
+ "# rearranging\n",
+ "# x_i = y_i*P/H_i\n",
+ "# so \n",
+ "x_O2 = y_O2*P/H_O2\n",
+ "# By the same math.logic we find that\n",
+ "y_N2 = y*0.79\n",
+ "#and Henry's law consmath.tant for nitrogen in water at 20C is\n",
+ "H_N2 = 80400. #[atm]\n",
+ "\n",
+ "# Calculations\n",
+ "# hence \n",
+ "x_N2 = y_N2*P/H_N2\n",
+ "# Now expresmath.sing the dissolved oxygen concentration in terms of the volume of the oxygen at STP viz. taken as 1 atm and 20C\n",
+ "# c = (concentration of dissolved oxygen in equilibrium with air at 1 atm and 20C)\n",
+ "c = x_O2*998.2/18 #[(mole O2)/(L solution)]\n",
+ "# V = (volume of O2, STP)/(L solution)\n",
+ "V = c*24.06 #[(L O2, STP)/(L solution)]\n",
+ "V = V*1000 #[(ml O2, STP)/(L solution)]\n",
+ "\n",
+ "# Results\n",
+ "print \"Concentration of oxygen dissolved in water at equilibrium is %f mL O2, STP)/L solution)\"%(V)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Concentration of oxygen dissolved in water at equilibrium is 6.826690 mL O2, STP)/L solution)\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page: 52\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate composition in liquied and vapor phase.\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "P = 1.0 #[atm]\n",
+ "p_w = 0.023 #[atm] Vapor pressure of pure water\n",
+ "H_o = 40100 #[atm] Vapor pressure of pure oxygen\n",
+ "H_n = 80400. #[atm] Vapor pressure of pure nitrogen\n",
+ "\n",
+ "# From Raoult's law, we have\n",
+ "# ( y_i*P ) = ( x_i*p_i )\n",
+ "# So \n",
+ "#For water\n",
+ "# ( y_w*P ) = ( x_w*p_i )\n",
+ "# For oxygen\n",
+ "#( y_o*P ) = ( x_o*p_i )\n",
+ "# And for nitrogen\n",
+ "#( y_n*P ) = ( x_n*p_i )\n",
+ "\n",
+ "# Also\n",
+ "# ( y_w + y_o + y_n ) = 1\n",
+ "# ( x_w + x_o + x_n ) = 1\n",
+ "\n",
+ "# Calculations\n",
+ "# In air, the mole fraction of nitrogen and oxygen are 0.79 and 0.21 respectively. So,\n",
+ "# y_o/y_n = 0.21/0.79\n",
+ "\n",
+ "# We will take the help of matrix method to solve these six equations for six unknowns\n",
+ "A = matrix([[0.023, 0, 0, -1, 0, 0],[0, 40100, 0, 0, -1, 0],[0, 0 ,80400, 0, 0, -1],[0, 0, 0, 1, 1 ,1],[1 ,1, 1, 0, 0 ,0],[0, 0, 0, 0, 0.79, -0.21]]);\n",
+ "#A = matrix([[0.023, 0, 0, -1, 0, 0],[0, 40100, 0, 0, -1, 0],[0, 0, 80400, 0, 0, -1],[0, 0 ,0, 1, 1, 1],[1, 1, 1, 0, 0, 0],[0, 0, 0, 0, 0.79, -0.21]])\n",
+ "B = matrix([[0],[0],[0],[1],[1],[0]])\n",
+ "X = linalg.inv(A)\n",
+ "X = X * B\n",
+ "\n",
+ "# Results\n",
+ "print \" The composition in liquid and vapor phase are summarized in the following table:\"\n",
+ "print \" y_water \\t %f\"%(X[3])\n",
+ "print \" y_oxygen \\t %f\"%(X[4])\n",
+ "print \" y_nitrogen \\t %f\"%(X[5])\n",
+ "print \" x_water \\t %f\"%(X[0])\n",
+ "print \" x_oxygen \\t %e\"%(X[1])\n",
+ "print \" x_nitrogen \\t %e\"%(X[2])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The composition in liquid and vapor phase are summarized in the following table:\n",
+ " y_water \t 0.023000\n",
+ " y_oxygen \t 0.205170\n",
+ " y_nitrogen \t 0.771830\n",
+ " x_water \t 0.999985\n",
+ " x_oxygen \t 5.116461e-06\n",
+ " x_nitrogen \t 9.599879e-06\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page: 57\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate\n",
+ "Vapour pressure of mixture.\n",
+ "Mole fraction of the benzene\n",
+ "Mole fraction of the toluene\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 20. #[C]\n",
+ "x_b = 0.80\n",
+ "x_t = 0.20\n",
+ "# Here we calculate the vapour pressures of benzene and toluene at 20C umath.sing the Antoine equation\n",
+ "# math.log10(p) = A-B/(T+C)\n",
+ "# here pressure p is in torr and temperature T is in C\n",
+ "# From the reported table A.2 (page 418) in the book, the consmath.tant A,B,C in the above equation for benzene have the vaues as\n",
+ "A_b = 6.90565\n",
+ "B_b = 1211.033\n",
+ "C_b = 220.79\n",
+ "\n",
+ "# Calculations\n",
+ "# So, for benzene\n",
+ "p_b = 10**(A_b-B_b/(T+C_b))\n",
+ "# now from the reported table A.2 (page 418) in the book, the consmath.tant A,B,C in the above equation for toluene have the vaues as\n",
+ "A_t = 6.95334\n",
+ "B_t = 1343.943\n",
+ "C_t = 219.337\n",
+ "# So, for toluene\n",
+ "p_t = 10**(A_t-B_t/(T+C_t))\n",
+ "# Now we can compute that for benzene\n",
+ "# y_b*P = x_b*p_b\n",
+ "# let y_b*P = p_1 , so\n",
+ "p_1 = x_b*p_b\n",
+ "# and correspondingly for toluene\n",
+ "# y_t*P = x_t*p_t\n",
+ "# let y_t*P = p_2 , so\n",
+ "p_2 = x_t*p_t\n",
+ "# Now adding these two values of benzene and toluene, we have \n",
+ "# y_b*P+y_t*P = (y_b+y_t)*P\n",
+ "# i.e.\n",
+ "# P = (p_1+p_2)/(y_b+y_t)\n",
+ "# But we know that (y_b+y_t) must be equal to one i.e.\n",
+ "y = 1.00 # y =(y_b+y_t) sum of the mole fractions of the benzene and toluene in the gaseous phase\n",
+ "# Hence total pressure is\n",
+ "P = (p_1+p_2)/y\n",
+ "# Now the mole fraction of either species in the gaseous phase will be ratio of the partial pressure of the species to the total pressure\n",
+ "# so\n",
+ "y_b = x_b*p_b/P\n",
+ "y_t = x_t*p_t/P\n",
+ "\n",
+ "# Results\n",
+ "print \" Vapour pressure of the mixture in the gaseous phase is %f torr\"%(P)\n",
+ "print \" Mole fraction of the benzene in the vapour phase is %f\"%(y_b)\n",
+ "print \" Mole fraction of the toluene in the vapour phase is %f\"%(y_t)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Vapour pressure of the mixture in the gaseous phase is 64.518358 torr\n",
+ " Mole fraction of the benzene in the vapour phase is 0.932483\n",
+ " Mole fraction of the toluene in the vapour phase is 0.067517\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page: 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate mole fraction of the benzene in air.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 20. #[C]\n",
+ "x_benzene = 1.00\n",
+ "p_i = 75.2 #[torr] vapour pressure of the benzene\n",
+ "P = 760. #[torr] Pressure of the atmosphere\n",
+ "\n",
+ "# Calculations\n",
+ "y_benzene = (x_benzene*p_i)/P\n",
+ "\n",
+ "# Results\n",
+ "print \" Mole fraction of the benzene in air that is saturated with benzene is %0.1f\"%(y_benzene)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mole fraction of the benzene in air that is saturated with benzene is 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 3.6 Page: 58\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate temperature at which the given benzene-toluene mixture will have vapor pressure\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 760. #[mm Hg]\n",
+ "x_b = 0.8 # Mole fraction of benzene in liquid phase\n",
+ "x_t = 0.2 # Mole fraction of toluene in liquid phase\n",
+ "\n",
+ "# We will take the help of trial and error method to solve this problem\n",
+ "# From the table A.2 ( page 418 ), Antoine equation consmath.tants for benzene are\n",
+ "A_b = 6.90565\n",
+ "B_b = 1211.003\n",
+ "C_b = 220.79\n",
+ "\n",
+ "# and that for the toluene are\n",
+ "A_t = 6.95334\n",
+ "B_t = 1343.943\n",
+ "C_t = 219.337\n",
+ "T = 82. #[C]\n",
+ "err = 1.\n",
+ "\n",
+ "# Calculations\n",
+ "while err > 10**(-3):\n",
+ " p_b = 10**(6.90565 - 1211.003/(T + 220.79))\n",
+ " p_t = 10**(6.95334 - 1343.943/(T + 219.337))\n",
+ " y_b = x_b*p_b/P\n",
+ " y_t = x_t*p_t/P\n",
+ " err = abs((y_b + y_t) - 1)\n",
+ " T = T + 0.01\n",
+ "\n",
+ "# Results\n",
+ "print \" The temperature at which the given benzene-toluene mixture will have vapor pressure of 1 atm is %0.3f deg C\"%(T)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The temperature at which the given benzene-toluene mixture will have vapor pressure of 1 atm is 84.360 deg C\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 3.7 Page: 60\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate\n",
+ "At equilibrium at 20 deg C the rejected amount of oxygen \n",
+ "At equilibrium at 20 deg C the rejected amount of nitrogen \n",
+ "And total amount of the air rejected from the water\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "V = 0.25 #[L] Volume of water \n",
+ "T_1 = 0. #[C] Initial temperature of water\n",
+ "T_2 = 20. #[C] Final temperature of water\n",
+ "\n",
+ "# Calculations\n",
+ "# From the example 3.3 the mol fractions of oxygen and notrogen in water at temperature 20 deg C are\n",
+ "x_o = 5.12*10**(-6) # mole fraction of oxygen\n",
+ "x_n = 9.598*10**(-6) # mole fraction of nitrogen\n",
+ "\n",
+ "\n",
+ "# Now we will calculate the mole fraction of oxygen and nitrogen in water at 0 deg C in the same manner as in example 3.3\n",
+ "# From the table A.3( page 419), Henry's consmath.tant of oxygen and nitrogen are\n",
+ "H_o = 2.55*10**(4) #[atm]\n",
+ "H_n = 5.29*10**(4) #[atm]\n",
+ "\n",
+ "# And vapor pressure of water at 0 deg C is \n",
+ "p_w = 0.006 #[atm]\n",
+ "\n",
+ "# Now umath.sing the same set of equations as in example 3.3, by changing only H_o, H_n and p_w and solving by matrix method we have \n",
+ "\n",
+ "A = matrix([[0.006, 0, 0, -1, 0, 0],[0, 25500, 0, 0, -1, 0],[0, 0 ,52900, 0, 0, -1],[0, 0, 0, 1, 1, 1],[1, 1, 1, 0, 0, 0],[0, 0, 0, 0, 0.79, -0.21]])\n",
+ "B = matrix([[0],[0],[0],[1],[1],[0]])\n",
+ "X = linalg.inv(A)\n",
+ "X = X*B\n",
+ "\n",
+ "# Here the mole fraction of oxygen and nitrogen in water will be X(2) and X(3) respectively\n",
+ "# So oxygen rejected is\n",
+ "M_o_rej = V*( X[1] - x_o )/0.018 #[mole] oxygen\n",
+ "# Now At STP volume of the rejected oxygen is given as \n",
+ "V_o = M_o_rej*24200 #[ml] oxygen\n",
+ "\n",
+ "# And rejected nitrogen is\n",
+ "M_n_rej = V*( X[2] - x_n )/0.018 #[mole] nitrogen\n",
+ "# In terms of volume \n",
+ "V_n = M_n_rej*24200 #[ml]\n",
+ "\n",
+ "# Results\n",
+ "print \" At equilibrium at 20 deg C the rejected amount of oxygen will be %0.2f ml\"%(V_o)\n",
+ "print \" At equilibrium at 20 deg C the rejected amount of nitrogen will be %0.2f ml\"%(V_n)\n",
+ "print \" And total amount of the air rejected from the water will be %0.2f ml\"%(V_o + V_n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " At equilibrium at 20 deg C the rejected amount of oxygen will be 1.03 ml\n",
+ " At equilibrium at 20 deg C the rejected amount of nitrogen will be 1.76 ml\n",
+ " And total amount of the air rejected from the water will be 2.79 ml\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 3.8 Page: 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate amount of rejected nitrogen.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 5. #[atm]\n",
+ "y_n = 0.79 # Mole fraction of nitrogen in atmosphere\n",
+ "P_2 = 1.0 #[atm]\n",
+ "M = 55. #[kg] Mass of the diver\n",
+ "x_w = 0.75 # Fraction of water in human body\n",
+ "T = 37 #[C] Body temperature of the diver\n",
+ "\n",
+ "# Calculations\n",
+ "# At 37 deg temperature, the Henry's consmath.tant for N2 from the table A.3 ( page 419 ) by the linear interpolation is \n",
+ "H_n = 10.05*10**(4) # [atm]\n",
+ "\n",
+ "# Now, moles of nitrogen rejected will be\n",
+ "# M_rej = (moles of body fluid)*( x_N2,5 atm - x_N2,1 atm)\n",
+ "# So\n",
+ "M_rej = (M*1000*x_w/18)*( P_1*y_n/H_n - P_2*y_n/H_n) #[mol]\n",
+ "\n",
+ "# At STP the volume of the rejected nitrogen will be\n",
+ "V_n = M_rej*24.2 #[L]\n",
+ "\n",
+ "# Results\n",
+ "print \" Amount of rejected nitrogen will be %0.2f Litre\"%(V_n)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Amount of rejected nitrogen will be 1.74 Litre\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch4.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch4.ipynb
new file mode 100644
index 00000000..a248aa47
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch4.ipynb
@@ -0,0 +1,223 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Minimization of Gibbs Free energy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page: 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find free energy change of the steam\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 671.7 #[R] Equilibrium temperature\n",
+ "m_steam = 1. #[lbm] Condenmath.sing amount of the steam\n",
+ "# Using values from the steam table [1], we find that\n",
+ "delta_h_condensation = -970.3 #[Btu/lbm] Enthalpy change of the steam\n",
+ "delta_s_condensation = -1.4446 #[Btu/(lbm*R)] Entropy change of the steam\n",
+ "\n",
+ "# Calculations\n",
+ "# Gibb's free energy change of the steam is\n",
+ "delta_g_condensation = delta_h_condensation - T*delta_s_condensation #[Btu/lbm]\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \"Gibb''s free energy change of the steam is %0.1f Btu/lbm\"%(delta_g_condensation)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gibb''s free energy change of the steam is 0.0 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 4.2 Page: 77\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Gibb's free energy-pressure diagram for graphite-diamond system\n",
+ "\n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "import math \n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "# Variables\n",
+ "# let we denote graphite by 'g' and diamond by 'd' \n",
+ "# Gibb's free energies of graphite and diamond are given by\n",
+ "g_g = 0.00 #[kJ/mol] \n",
+ "g_d = 2.90 #[kJ/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Specific volumes of graphite and diamond are given by\n",
+ "v_g = 5.31*10**(-1) #[kJ/(mol*kbar)]\n",
+ "v_d = 3.42*10**(-1) #[kJ/(mol*kbar)]\n",
+ "\n",
+ "# Now from the equation 4.32 ( page 74) given in the book, we have\n",
+ "# (dg/dP) = v , at consmath.tant temperature\n",
+ "# where 'v' is specific volume\n",
+ "# let us denote (dg/dP) by 'D' ,so\n",
+ "\n",
+ "D_g = v_g #[J/(mol*Pa)] For graphite\n",
+ "D_d = v_d #[J/(mol*Pa)] For diamond\n",
+ "\n",
+ "# Now we can take our plot from P = 0( =1 ), however, total pressure is 1 atm. \n",
+ "# If we consider specific volumes of the given species to be consmath.tant with changing the pressure then g-P curve will be a straight line\n",
+ "# So the equation of the line for graphite is \n",
+ "# g = D_g*P + g_g\n",
+ "# and that for diamond\n",
+ "# g = D_d*P + g_d\n",
+ "\n",
+ "P = linspace(0,30,30).T\n",
+ "\n",
+ "plot(P, D_d*P+g_d )\n",
+ "plot(P,D_g*P+g_g )\n",
+ "xlabel(\"Pressure, P, kbar\");\n",
+ "ylabel(\"Gibb''s free energy per mol, g, kJ/mol\");\n",
+ "legend(['Diamond, slope = 0.342 (kJ/mol)/kbar','Graphite, slope = 0.532 (kJ/mol)/kbar']);\n",
+ "\n",
+ "show()\n",
+ "# Results\n",
+ "print \" Gibb's free energy-pressure diagram for graphite-diamond system at 25 degC is as shown in the graphic window. \"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAELCAYAAADQsFGkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XlcTfn/B/DXjRTSqk1JdknZlyLKkjX6NZMRY6lEGbsx\nGIPMWMaQmQnZkzWMtQUTUhOGkBaRiJA9LVq03s/vj/P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8uXL3dYr6onOcTGxna7v1KKyMhIYmJi\niIqKsm2fMmUKd999NwBRUVF8+eWXAOTl5TF79mwMBgN5eXmUlZXZ3rN8+fI/zE+I3wz5V0IK0Z0b\nbrgBs9l81fYbb7yxw+/JycmEhYVdtV9BQQEHDhxg1apVPPvss0RHR3Py5EkOHjxIWloae/fuZceO\nHYwYMYL29nbg129X6u5Yn376KTNmzOh3Dl3R6XQEBQWRnZ3NI4880mH7b5RS6HQ6Ll++zFNPPUVx\ncTGTJ09m/fr1HeK/MnYhuiMdgHA6CxYsYOvWrbaLtN9//z2NjY2cPXuW8ePHExcXR1xcHMXFxdTU\n1NDW1sZDDz3Ehg0bbAOzu7s733zzDQCffPJJt8f6/fn0395fXV3NvHnzehV3aGhoh4XIfu/VV19l\n7NixrF692rbt7NmzfPXVVwB8+OGHBAcH09TUhE6nY9y4cdTX17Nv375exSDE78kEIBxKZ+flrzxf\nHxcXh5eXF35+fuj1euLj42ltbSU/Px9fX1/8/PzYu3cvCQkJVFdXM3fuXEwmE9HR0bzxxhsAPP/8\n86SmpuLn50dNTY3t86881ssvv0xLSwsGgwEfHx9eeeUV4NcLziNGdN5Ad5ZDe3s7p0+f5pZbbuly\n/6SkJKxWKy+++CI6nY477riDlJQUvLy8uHTpEvHx8YwePZrHH38cHx8fFi5cSGBgYE//aIW4iiwG\nJ0QfpKSkMG3aNBYtWtSj/UtLS9m5cydvvfXWIEcmRM/JBCCEEMOUnAISQohhSiYAIYQYpmQCEEKI\nYUomACGEGKZkAhBCiGFKJgAhhBim/g/7Wr9ElF0y4wAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2896e50>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Gibb's free energy-pressure diagram for graphite-diamond system at 25 degC is as shown in the graphic window. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 4.3 Page: 80\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find mole fraction of isobutane isomer in equilibrium\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# We have the system which consists of isobumath.tane and normal bumath.tane and isomerisaation is taking place between them \n",
+ "# The equilibrium consmath.tant for this reaction is given by\n",
+ "# K = (mole fraction of isobumath.tane)/(mole fraction of n-bumath.tane) = x_iso/x_normal\n",
+ "\n",
+ "# For this reaction, at 25C, \n",
+ "K = 4.52\n",
+ "\n",
+ "# and\n",
+ "# x_iso + x_normal = 1\n",
+ "# so\n",
+ "# K = x_iso/(1-x_iso)\n",
+ "\n",
+ "# Calculations\n",
+ "# solving for x_iso\n",
+ "def f(x_iso): \n",
+ "\t return x_iso/(1-x_iso)-K\n",
+ "x_iso = fsolve(f,0)\n",
+ "\n",
+ "# Results\n",
+ "print \" Mole fraction of isobumath.tane isomer in equilibrium is %0.2f\"%(x_iso)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mole fraction of isobumath.tane isomer in equilibrium is 0.82\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb
new file mode 100644
index 00000000..38473b93
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb
@@ -0,0 +1,358 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Vapor Pressure The Clapeyron Equation And Single Pure Chemical Species Phase Equilibrium"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.1 Page: 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the value of DP/DT.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T=212. # [F]\n",
+ "\n",
+ "#**********#\n",
+ "#From the steam table, we have \n",
+ "delta_h=970.3 #[Btu/lbm]\n",
+ "delta_v=26.78 #[ft**(3)/lbm] and\n",
+ "\n",
+ "# Calculations\n",
+ "# changing the units\n",
+ "delta_h1=delta_h*778 #[ft*lbf/lbm]\n",
+ "delta_v1=delta_v*144 #[ft*in**(2)/lbm]\n",
+ "T=671.7 #[R]\n",
+ "\n",
+ "# We have dP/dT = delta_h/(T*delta_v)\n",
+ "#Thus\n",
+ "dP_by_dT=delta_h1/(T*delta_v1) #[psi/R]\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of dP/dT is %f psi/R\"%(dP_by_dT)\n",
+ "#Using the nearest adjacent steam table entries for vapour pressure, wee have \n",
+ "#dP_by_dT = delta_P_by_delta_T=(15.291-14.125)/(214-210)=0.2915 psi/R\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of dP/dT is 0.291432 psi/R\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.2 Page: 90\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate temperature.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p_2=0.005 # [psia]\n",
+ "R=1.987/18. #[1/R]\n",
+ "\n",
+ "#From the steam tables at the tripple point, we find \n",
+ "T_1=460+32.018 #[R]\n",
+ "p_1=0.0887 #[psia]\n",
+ "\n",
+ "#delta_h(solid to gas) = delta_h(sublimation) = 1218.7#[Btu/lbm]\n",
+ "delta_H=1218.7 #[Btu/lbm]\n",
+ "#Assuming that the enthalpy change of vaporization is independent of temperature (a fairly good approximation in this case)\n",
+ "#we start with Eq. 5.10 and rearrange:\n",
+ "#1/T_2 = 1/T_1-(math.log(p_2/p_1))*R/delta_H\n",
+ "#So\n",
+ "\n",
+ "# Calculations\n",
+ "T_2=1/(1/T_1-(math.log(p_2/p_1))*R/delta_H) #[R]\n",
+ "#Changing the temperature in farenheit\n",
+ "T_2F=T_2-460 #[F]\n",
+ "\n",
+ "# Results\n",
+ "print \"The temperature is %.2f F\"%(T_2F)\n",
+ "#BY linear interpolation in the steam tables, one finds -23.8 F. Because of imprecision of linear interpolation, these values are approximately equal.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature is -23.88 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.3 Page: 91\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate vapuor pressure of water.\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "T_3=1155.2 #[R]\n",
+ "T_2=652.9 #[R]\n",
+ "T_1=787.5 #[R]\n",
+ "p_2=10. #[psia]\n",
+ "p_1=100. #[psia]\n",
+ "\n",
+ "# Calculations\n",
+ "#******#\n",
+ "#Here we can write Eq. 5.9 as reported in the book in the form most often seen.\n",
+ "# math.log(p)=A-B/T\n",
+ "#Where A and B are consmath.tants to be determined from the pair of T and p values above.\n",
+ "\n",
+ "#we simply write \n",
+ "#math.log(10)=A-B/652.9\n",
+ "#math.log(100)=A-B/787.5\n",
+ "# We have to solve the above two simulmath.taneous equations having two vaiables A and B.\n",
+ "\n",
+ "M = matrix([[1, -1/652.9],[1,-1/787.5]])\n",
+ "C = array([[math.log(10)],[math.log(100)]])\n",
+ "X = linalg.inv(M) * C\n",
+ "\n",
+ "A=X[0]\n",
+ "B=X[1]\n",
+ "\n",
+ "# By straightforward algebra we find the values of A and B. Thus, for 1155.2 R we have \n",
+ "p_3=math.exp(A-B/T_3)\n",
+ "\n",
+ "# Results\n",
+ "print \"Vapuor pressure of water at given temperature is %f psia\"%(p_3)\n",
+ "\n",
+ "# p_3=3499 psia. \n",
+ "# Note : \"It has been reported in the book that from table 5.1 we see that the correct value is 3000 psia. Thus there is an error of 16% in the predicted pressure.\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vapuor pressure of water at given temperature is 3499.187053 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.4 Page: 94\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find accentric factor.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# At Tr = 0.7, we read \n",
+ "Pr=0.023\n",
+ "# and thus accentric factor is given by\n",
+ "\n",
+ "# Calculations\n",
+ "w=-math.log10(0.023)-1\n",
+ "\n",
+ "# Results\n",
+ "print \"The accentric factor based on the given data is %f\"%(w)\n",
+ "#It has been reported in the book that table A.1 shows that the value based on the best data is 0.645.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The accentric factor based on the given data is 0.638272\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.5 Page: 94\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate NBP of water using antoine equation.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "#From Antoine equation we have \n",
+ "# math.log(p) = A-B/(T+C)\n",
+ "#Solving above equation for T, we have\n",
+ "# T = B/(A-math.log(p))-C\n",
+ "#Inserting the values of the consmath.tants for the water which are reported in the given book in the table A.2 (page 419),\n",
+ "# and the value of 1.00 atm expressed in torr, we find that \n",
+ "A=7.96681\n",
+ "B=1668.21\n",
+ "C=228.0\n",
+ "p=760. #[torr]\n",
+ "\n",
+ "# Calculations\n",
+ "#Thus\n",
+ "T=B/(A-math.log10(p))-C\n",
+ "\n",
+ "# Results\n",
+ "print \"NBP of water umath.sing antoine equation and table A.2 is %f C\"%(T)\n",
+ "\n",
+ "#This does not prove the overall accuracy of the Antoine equation, but does show that whoever fitted the consmath.tants to the experimental data for water made them represent the NBP (100C) very well. \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NBP of water umath.sing antoine equation and table A.2 is 100.000625 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 5.6 Page: 96\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate Freezing preesure of water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T_2=-22. #[C]\n",
+ "# converting temperature in farenheit\n",
+ "T_2F=T_2*9/5+32 #[F]\n",
+ "#Expressing T_2 in Rankine\n",
+ "T_2R=460+T_2F #[R]\n",
+ "#delta_h = delta_h(fusion)\n",
+ "delta_h=143.35*778. #[ft*lbf/lbm]\n",
+ "#delta_v = v_water-v_ice\n",
+ "delta_v=0.01602-0.01747 #[ft**(3)/lbm]\n",
+ "# changing the unit \n",
+ "delta_v1=delta_v*144 #[ft*in/lbm]\n",
+ "\n",
+ "# Calculations\n",
+ "#and\n",
+ "T_1=460+32. #[R]\n",
+ "dP_by_dT=delta_h/(T_1*delta_v1) #[psi/R] at 32F\n",
+ "delta_T=T_2R-T_1\n",
+ "\n",
+ "#This gives the rigorously correct slope of the liquid-solid curve at 32F on a P-T diagram.\n",
+ "#Here we use P instead of p because neither phase is a gas, so this is not a vapour pressure. \n",
+ "#If we further assume that the solid-liquid curve is a straight line, which is equivalent to assuming that delta_h/(T*deta_v)is a consmath.tant over the region of interest, then we can estimate the pressure at -22C = -7.6F by\n",
+ "#So\n",
+ "\n",
+ "delta_P=(dP_by_dT)*delta_T #[psi]\n",
+ "\n",
+ "# From this we can estimate the final pressure as\n",
+ "delta_P=delta_P+0.09 #[psi]\n",
+ "\n",
+ "# Results\n",
+ "print \"Freezing preesure of water at given temperature is %f psi\"%(delta_P)\n",
+ "# In this case, the experimental pressure is well known, because this temperature corresponds to the tripple point between liquid and water, \n",
+ "# ice I(the common variety), and ice III, a variety that does not exist at pressure below about 30000 psia (see figure 1.10 in the book). \n",
+ "# The measured value is 30000 psia, which shows that our assumption of a straight line on a P-T plot (delta_h/(T*delta_v)=consmath.tant) is only approximately correct.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Freezing preesure of water at given temperature is 42991.024258 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch6.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch6.ipynb
new file mode 100644
index 00000000..fb02a429
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch6.ipynb
@@ -0,0 +1,499 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Partial Molal Properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.1 Page: 108\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate\n",
+ "Partial molal volume of ethanol in water at zero molality\n",
+ "Partial molal volume of ethanol in water at unity molality \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 20. #[C]\n",
+ "m_1 = 0. #[molal]\n",
+ "m_2 = 1. #[molal]\n",
+ "\n",
+ "# Calculations\n",
+ "# The data given in the figure 6.2 , as reported in book, can be repersented with excellent accuracy by a simple data fitting equation\n",
+ "#V = 1.0019+0.054668*m-0.000418*m**(2)\n",
+ "# Where 'V' is( solution volume, liters per 1000g of water ) and 'm' is the molality of ethanol in water\n",
+ "#The partial molal volume is obtained by differentiating the expression of the 'V' with respect to 'm'\n",
+ "# v_ethanol = dV/dm = 0.054668-2*0.000418*m\n",
+ "# So that at zero molality \n",
+ "m = 0 #[molal]\n",
+ "# the partial molal volume is \n",
+ "v_1 = 0.054668-2*0.000418*m #[L/mol]\n",
+ "# and at\n",
+ "m = 1. #[molal]\n",
+ "v_2 = 0.054668-2*0.000418*m #[L/mol]\n",
+ "v_1 = v_1*1000 #[cm**(3)/mol]\n",
+ "v_2 = v_2*1000 #[cm**(3)/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \"Partial molal volume of ethanol in water at zero molality is %f cm**3/mol\"%(v_1)\n",
+ "print \" Partial molal volume of ethanol in water at unity molality is %f cm**3/mol\"%(v_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Partial molal volume of ethanol in water at zero molality is 54.668000 cm**3/mol\n",
+ " Partial molal volume of ethanol in water at unity molality is 53.832000 cm**3/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.2 Page: 109\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate Volume change on mixing etanol and water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "n_eth = 1. #[mol]\n",
+ "W_water = 1. #[kg]\n",
+ "Temp = 20. #[C]\n",
+ "\n",
+ "# For pure ethanol at 20C\n",
+ "v_ethanol = 58.4 #[cm**(3)/mol]\n",
+ "v_ethanol = v_ethanol/1000 # [L/mol]\n",
+ "v_water = 1.0019 #[L/1000g]\n",
+ "\n",
+ "# Calculations\n",
+ "# Molality of ethanol in water is\n",
+ "m = n_eth/W_water #[molal]\n",
+ "# We have the equation used in the previous example as\n",
+ "V_final_mix = 1.0019+0.054668*m-0.000418*m**(2)\n",
+ "\n",
+ "# Where 'V' is( solution volume, liters per 1000g of water ) and 'm' is the molality of ethanol in water\n",
+ "# V is the final volume of the solution \n",
+ "# The volume expansion on moxing is \n",
+ "V_exp = V_final_mix-v_ethanol-v_water #[L]\n",
+ "V_exp = V_exp*1000 #[cm**(3)]\n",
+ "\n",
+ "# Results\n",
+ "print \"Volume change on mixing emath.tanol and water is %0.3f cubic cm\"%(V_exp)\n",
+ "# We see that there is a net contraction on mixing of the volume of the ethanol added.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume change on mixing emath.tanol and water is -4.150 cubic cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.3 Page: 109\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Volume change on mixing etanol and water \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# All the data are same as in the previous example \n",
+ "# The equation 6.5 reported in the book is \n",
+ "v_i_average = 0.05425 #[L/mol]\n",
+ "# and\n",
+ "v_i_0 = 0.0584 #[L/mol]\n",
+ "delta_n = 1.00 #[mol]\n",
+ "\n",
+ "# Calculations\n",
+ "delta_V_mixing = (v_i_average-v_i_0)*delta_n #[L]\n",
+ "delta_V_mixing = delta_V_mixing*1000 #[cm**(3)]\n",
+ "\n",
+ "# Results\n",
+ "print \"Volume change on mixing etanol and water is %f cm**3\"%(delta_V_mixing)\n",
+ "# Which is same as the solution in example 6.2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume change on mixing etanol and water is -4.150000 cm**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.4 Page: 113\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate\n",
+ "Partial molar volume of the ethanol \n",
+ "Partial molar volume of the water \n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 1. #[molal] Molality of the solution with respect to ethanol\n",
+ "M_water = 18. #[g/mol] molecular weight of water\n",
+ "\n",
+ "# Calculations\n",
+ "# First we convert molality to mole fraction\n",
+ "x_ethanol = m/(m + 1000/M_water)\n",
+ "\n",
+ "# For the low range of data point on figure 6.5(page 112), we can fit an equation\n",
+ "# (Specific volume ) = 0.018032 + 0.037002*x_ethanol - 0.039593*x_ethanol**(2) + 0.21787*x_ethanol**(3)\n",
+ "# This is applicable for (0 < x_ethanol < 0.04 ), which is the case we have\n",
+ "\n",
+ "# So\n",
+ "v_math_tan = 0.018032 + 0.037002*x_ethanol - \\\n",
+ "0.039593*x_ethanol**(2) + 0.21787*x_ethanol**(3) #[L/mol]\n",
+ "\n",
+ "# Now we will find the derivative of the specific volume with respect to x_ethanol at the known point x_ethanol\n",
+ "# (dv/dx_ethanol) = 0.037002 - 2*0.039593*x_ethanol + 3*0.21787*x_ethanol**(2)\n",
+ "# Hence\n",
+ "v_derv_math_tan = 0.037002 - 2*0.039593*x_ethanol + 3*0.21787*x_ethanol**(2) #[L/mol]\n",
+ "\n",
+ "# By simple geometry from the figure 6.6(page 113) of the book we find\n",
+ "# a = v_math_tan + (1-x_math_tan)*(dv/dx_1)_math_tan\n",
+ "# b = v_math_tan - x_math_tan*(dv/dx_1)_math_tan\n",
+ "\n",
+ "# We have a = v_ethanol and b = v_water\n",
+ "x_math_tan = x_ethanol\n",
+ "# So\n",
+ "v_ethanol = v_math_tan + (1-x_math_tan)*(v_derv_math_tan) #[L/mol]\n",
+ "v_water = v_math_tan - x_math_tan*(v_derv_math_tan) #[L/mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" Partial molar volume of the ethanol in the given solution is %f L/mol\"%(v_ethanol)\n",
+ "print \" Partial molar volume of the water in the given solution is %f L/mol\"%(v_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Partial molar volume of the ethanol in the given solution is 0.053848 L/mol\n",
+ " Partial molar volume of the water in the given solution is 0.018042 L/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.7 Page: 117\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate\n",
+ "Partial molar enthalpy of water in the mixture\n",
+ "Partial molar enthalpy of H2SO4 in the mixture\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_sulph = 0.6\n",
+ "x_water = 0.4\n",
+ "Temp = 200. #[F]\n",
+ "# In the given figure 6.8 in the book, drawing the math.tangent to the 200F curve at 60 wt% H2SO4, we find that it intersects the 0%(pure water) axis at 25 Btu/lbm, and the 100% H2SO4 axis at -100Btu/lbm. i.e.\n",
+ "h_water_per_pound = 25. #[Btu/lbm]\n",
+ "h_sulph_per_pound = -100. #[Btu/lbm]\n",
+ "# also molecular weight of water and sulphuric acid are\n",
+ "M_water = 18. #[lbm/lbmol]\n",
+ "M_sulph = 98. #[lbm/lbmol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Using equation 6.20 given in the book we have\n",
+ "h_water = h_water_per_pound*M_water #[Btu/lbmol]\n",
+ "h_sulph = h_sulph_per_pound*M_sulph #[Btu/lbmol]\n",
+ "\n",
+ "# Results\n",
+ "print \"Partial molar enthalpy of water in the mixture is %f Btu/lbmol\"%(h_water)\n",
+ "print \" Partial molar enthalpy of H2SO4 in the mixture is %f Btu/lbmol\"%(h_sulph)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Partial molar enthalpy of water in the mixture is 450.000000 Btu/lbmol\n",
+ " Partial molar enthalpy of H2SO4 in the mixture is -9800.000000 Btu/lbmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.8 Page: 119\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The amount of heat removed to keep the temperature constant\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_sulph = 0.6\n",
+ "x_water = 0.4\n",
+ "M_i = 18. #[lbm/lbmol]\n",
+ "Temp = 200. #[F]\n",
+ "# From Equation 6.11 as given in the book, we have \n",
+ "# dQ/dm_in = h_i-h_in\n",
+ "# where h_i is partial molal enthalpy which is taken from the example 6.7 and h_in is the pure species molar enthalpy which is read from the figure 6.8.\n",
+ "# So at 200F we have \n",
+ "h_i = 25. #[Btu/lbm]\n",
+ "h_in = 168. #[Btu/lbm]\n",
+ "\n",
+ "# Calculations\n",
+ "# hence\n",
+ "dQ_by_dm_in = h_i-h_in #[Btu/lbm]\n",
+ "# Now \n",
+ "dQ_by_dn_in = M_i*dQ_by_dm_in #[Btu/lbmol]\n",
+ "\n",
+ "# Results\n",
+ "print \"The amount of heat removed to keep the temperature consmath.tant is %f Btu/lbm of water added\"%(dQ_by_dm_in)\n",
+ "# The negative sign shows that this mixing is exothermic we must remove 143 Btu/lbm of water added.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of heat removed to keep the temperature consmath.tant is -143.000000 Btu/lbm of water added\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.9 Page: 119\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The amount of heat added or removed \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m_sulph = 0.4\n",
+ "m_water = 0.6\n",
+ "m = m_sulph+m_water\n",
+ "Temp = 200. #[F]\n",
+ "# Here at 200F we can read the solution enthalpy h_solution and pure H2SO4 enthalpy h_sulph such that\n",
+ "h_solution = -43. #[Btu/lbm]\n",
+ "h_sulph = 168. #[Btu/lbm]\n",
+ "# By energy balance, umath.sing h_0_water from example 6.7 in the book i.e.\n",
+ "h_0_water = 53. #[Btu/lbm]\n",
+ "\n",
+ "# We find \n",
+ "# Calculations\n",
+ "delta_Q = m*h_solution-(m_sulph*h_sulph+m_water*h_0_water) #[Btu]\n",
+ "\n",
+ "# Results\n",
+ "print \"The amount of heat added or removed is %f Btu\"%(delta_Q)\n",
+ "# We must remove the given amount of to hold the temperature consmath.tant.\n",
+ "# Note However the book has some mistake in calculation and reporting -172 Btu\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of heat added or removed is -142.000000 Btu\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.10 Page: 120\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate enthalpy of the solution\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_sulph = 0.6\n",
+ "x_water = 0.4\n",
+ "Temp = 200. #[F]\n",
+ "# At the 200F we have\n",
+ "h_water = 25. #[Btu/lbm]\n",
+ "h_sulph = -100. #[Btu/lbm]\n",
+ "\n",
+ "# Calculations\n",
+ "# From equation 6.16 (as reporated in the book), rewritten for masses instead of moles we have \n",
+ "h_solution = h_water*x_water+h_sulph*x_sulph # [Btu/lbm]\n",
+ "\n",
+ "# Results\n",
+ "print \"Enthalpy of the solution is %f Btu/lbm\"%(h_solution)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enthalpy of the solution is -50.000000 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 6.11 Page: 121\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Value of the dv_b/dx_a at x_b =0\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_b = 0\n",
+ "x_a = 1\n",
+ "# We have\n",
+ "#dv_a/dx_a = 3*x_b**(2)+2*x_b\n",
+ "# We have the equation \n",
+ "# dv_b/dx_a = -(dv_a/dx_a)/(x_b/x_a)\n",
+ "# So\n",
+ "# dv_b/dx_a = -(x_a/x_b)*(3*x_b**(2)+2*x_b) \n",
+ "# Calculations\n",
+ "dv_b_by_dx_a = x_a*(-3*x_b-2)\n",
+ "\n",
+ "# Results\n",
+ "print \"Value of the dv_b/dx_a at x_b =0 is %0.0f\"%(dv_b_by_dx_a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of the dv_b/dx_a at x_b =0 is -2\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch7.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch7.ipynb
new file mode 100644
index 00000000..55160b19
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch7.ipynb
@@ -0,0 +1,474 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Fugacity Ideal Solutions Activity Activity Coefficient"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.1 Page: 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Fugacity of propane gas\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "T = 220+459.67 #[R] Temperature in Rankine\n",
+ "P = 500. #[psia] Pressure\n",
+ "R = 10.73 #[(psi*ft**(3)/(lbmol*R))] Gas consmath.tant\n",
+ "\n",
+ "# We will follow the method 'a' as the book has given the multiple methods to solve this problem\n",
+ "# From the equation 7.10 given in the book(page 132), we have \n",
+ "# (f/P) = exp((-1/(R*T))*intgrate(a*dp)) , with intgration limits from zero to 'P'\n",
+ "# Where 'a' is known as volume residual\n",
+ "# Let us say , I = intgrate(a*dp)\n",
+ "\n",
+ "# From the table 7.A(page 134) given in the book, the average value of alpha(a) is \n",
+ "a = 4.256 #[ft**(3)/lbmol]\n",
+ "# so \n",
+ "\n",
+ "# Calculations\n",
+ "def f6(p): \n",
+ "\t return a*p**(0)\n",
+ "\n",
+ "I = quad(f6,0,P)[0]\n",
+ "\n",
+ "\n",
+ "# Now \n",
+ "f = P*math.exp((-1/(R*T))*I) #[psia]\n",
+ "\n",
+ "# Results\n",
+ "print \"Fugacity of propane gas at the given condition is %.0f psia\"%(round(f,1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity of propane gas at the given condition is 374 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.2 Page: 138\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate\n",
+ "Compresssibility factor the liquid water\n",
+ "Volume residual for the liquid water \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 100. + 460 #[R] Temperature of the system in Rankine\n",
+ "P = 1. # [psia]\n",
+ "R = 10.73 #[(psi*ft**(3)/(lbmol*R))] Gas consmath.tant\n",
+ "\n",
+ "# Calculations\n",
+ "# From the steam table, the specific volume of the water at 101.7 F, which is nearly equal to 100 F, and 1 psia is\n",
+ "v = 0.016136*18 #[ft**(3)/lbmol]\n",
+ "z = round((P*v)/(R*T),5)\n",
+ "\n",
+ "# and volume residual is given by\n",
+ "a = int(((R*T)/P))*(1-z) #[ft**(3)/lbmol]\n",
+ "\n",
+ "# Results\n",
+ "print \" Compresssibility factor the liquid water at the given condition is %.5f \"%(z)\n",
+ "print \"Volume residual for the liquid water at the given condition is %0.1f cubic feet/lbmol\"%(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Compresssibility factor the liquid water at the given condition is 0.00005 \n",
+ "Volume residual for the liquid water at the given condition is 6007.7 cubic feet/lbmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.3 Page: 138\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Fugacity of the pure liquid water\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T = 100+460. #[R] Temperature\n",
+ "P = 1000. #[psia] Pressure\n",
+ "R = 10.73 #[(psi*ft**(3)/(lbmol*R))] Gas consmath.tant\n",
+ "\n",
+ "# From the figure 7.3(page 138) we see that as P tends to zero, (f/P) tends to 1, so f tends to 0. Therefore, f_a tends to zero also in the diagram\n",
+ "# fugacity at point b is calculated by the equation\n",
+ "# We have\n",
+ "f_b = 0.95 #[psia]\n",
+ "# We also can write\n",
+ "f_c = f_b #[psia]\n",
+ "# To find the value of f_d, we use the equation \n",
+ "# here 'v' is practically consmath.tant(for a liquid), and\n",
+ "v = 0.016136*18 #[ft**(3)/lbmol]\n",
+ "\n",
+ "# and from the figure 7.3, we have \n",
+ "P_d = 1000. #[psia]\n",
+ "P_c = 1. #[psia]\n",
+ "\n",
+ "# Calculations\n",
+ "# integrating the left hand side of the equation with the integration limits f_c and f_d and solving, we have\n",
+ "def f4(p): \n",
+ "\t return p**(0)\n",
+ "\n",
+ "f_d = f_c*math.exp((v/(R*T))* (quad(f4,P_c,P_d))[0])\n",
+ "\n",
+ "# Results\n",
+ "print \"Fugacity of the pure liquid water at the given condition is %0.1f psia\"%(f_d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fugacity of the pure liquid water at the given condition is 1.0 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.4 Page: 145\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate vapor and liquid \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 78.15 #[C]\n",
+ "P = 1.0 #[atm]\n",
+ "# Here we name ethanol as the species 'a', and water as the species 'b', and name the vapor as phase 1 and the liquid as the phase 2. \n",
+ "# Thus vapor pressures of the pure species at the given temperature are\n",
+ "p_a_0 = 0.993 #[atm] Pure ethanol vapor pressure at 78.15C\n",
+ "p_b_0 = 0.434 #[atm] Pure water vapor pressure at 78.15C\n",
+ "\n",
+ "# Also composition of the azeotrope is\n",
+ "x_a = 0.8943 # Amount of ethanol in the liquid phase \n",
+ "x_b = 0.1057 # Amount of water in liquid phase \n",
+ "\n",
+ "# Also, for an azeotrope mixture\n",
+ "y_a = x_a # Amount of ethanol in vapor phase \n",
+ "y_b = x_b # Amount of water in the vapor phase \n",
+ "\n",
+ "# For ideal gas , fugacity is equal to the total pressure of the system, i.e.\n",
+ "# f_i_0 = P , (where P is the system pressure)\n",
+ "# For pure liquid system, fugacity of a species is independent of the total pressure of the system and is equal to the pure species vapor pressure at this temprature, i.e.\n",
+ "# f_i_0 = p_i\n",
+ "\n",
+ "# Now, fugacity of each species in gaseous phase and liquid phase will be equal \n",
+ "# so, writing the expression for both liquid and gas phase fugacity and equatinh them, we have\n",
+ "# f_a_2 = f_a_1 = (y*Y*P)_a_1 = (x*Y*p)_a_2..........................................(1)\n",
+ "# f_b_2 = f_b_1 = (y*Y*P)_b_1 = (x*Y*p)_b_2..........................................(2)\n",
+ "\n",
+ "# We observe that this system has four values of 'Y', one for each of the two species in each of two phases.\n",
+ "# Mixtures of the ideal gases are all ideal solutions and the value of 'Y' for all the species in ideal gas phase are unity, so for above two equations\n",
+ "Y_a_1 = 1.0\n",
+ "Y_b_1 = 1.0\n",
+ "\n",
+ "# Calculations\n",
+ "# Now putting the values these gaseous phase 'Y's in their respective equations 1 and 2, and solving for the liquid phase 'Y's, we have\n",
+ "Y_a_2 = ((y_a*P)/(x_a*p_a_0))\n",
+ "Y_b_2 = ((y_b*P)/(x_b*p_b_0))\n",
+ "\n",
+ "# From equations 1 and 2, the fugacity of each species in each phase is given by\n",
+ "f_a_1 = (y_a*Y_a_1*P) #[atm]\n",
+ "f_b_1 = (y_b*Y_b_1*P) #[atm]\n",
+ "# and from the definition we have \n",
+ "f_a_2 = f_a_1 #[atm]\n",
+ "f_b_2 = f_b_1 #[atm]\n",
+ "\n",
+ "# As we have defined above about the pure species fugacity, so \n",
+ "# For vapor phase\n",
+ "f_a_1_0 = P #[atm]\n",
+ "f_b_1_0 = P #[atm]\n",
+ "\n",
+ "# For liquid phase\n",
+ "f_a_2_0 = p_a_0 #[atm]\n",
+ "f_b_2_0 = p_b_0 #[atm]\n",
+ "\n",
+ "# Results\n",
+ "print \" The results are summarized in the following table: \\n\\tPhase\\t\\t\\t\\t Etahnol(i=a)\\t\\t\\t\\t Water,i=b\"\n",
+ "print \" \\tVAPOR PHASE 1\"\n",
+ "print \" \\t f_i_1 atm \\t\\t\\t %.4f \\t\\t\\t\\t %.4f\"%(f_a_1,f_b_1)\n",
+ "print \" \\t f_i_1_0 atm \\t\\t\\t %.4f \\t\\t\\t\\t %.4f\"%(f_a_1,f_b_1)\n",
+ "print \" \\t Y_i_1 assumed \\t\\t %f \\t\\t\\t\\t %f\"%(Y_a_1,Y_b_1)\n",
+ "print \" \\tLIQUID PHASE 2\"\n",
+ "print \" \\t f_i_2 atm \\t\\t\\t %.4f \\t\\t\\t\\t %.4f\"%(f_a_2,f_b_2)\n",
+ "print \" \\t f_i_2_0 atm \\t\\t\\t %.4f \\t\\t\\t\\t %.4f\"%(f_a_2,f_b_2)\n",
+ "print \" \\t Y_i_2assumed \\t\\t %.4f \\t\\t\\t\\t %.4f\"%(Y_a_2,Y_b_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The results are summarized in the following table: \n",
+ "\tPhase\t\t\t\t Etahnol(i=a)\t\t\t\t Water,i=b\n",
+ " \tVAPOR PHASE 1\n",
+ " \t f_i_1 atm \t\t\t 0.8943 \t\t\t\t 0.1057\n",
+ " \t f_i_1_0 atm \t\t\t 0.8943 \t\t\t\t 0.1057\n",
+ " \t Y_i_1 assumed \t\t 1.000000 \t\t\t\t 1.000000\n",
+ " \tLIQUID PHASE 2\n",
+ " \t f_i_2 atm \t\t\t 0.8943 \t\t\t\t 0.1057\n",
+ " \t f_i_2_0 atm \t\t\t 0.8943 \t\t\t\t 0.1057\n",
+ " \t Y_i_2assumed \t\t 1.0070 \t\t\t\t 2.3041\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.5 Page: 149\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Fugacity of the methane in the gaseous mixture \n",
+ "Fugacity of the butane in the gaseous mixture\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 220+460. #[R] Temperature in rankine\n",
+ "P = 1000. #[psia] Pressure\n",
+ "y_methane = 0.784 # Mol fraction of methane in the given mixture\n",
+ "y_butane = (1-y_methane) # Mol fraction of n-bumath.tane in the given mixture\n",
+ "R = 10.73 #[(psia*ft**(3)/(lbmol*R))] gas consmath.tant\n",
+ "\n",
+ "# In this problem, we need the partial molar volume residual.\n",
+ "# We find its value at 100 psia by plotting the volume resduals at 100 psia as a function of mole fraction, as shown in figure 7.9( page 150 )\n",
+ "# drawing the math.tangent to the data points at x_methane = 0.784 and reading its intercept on the 100 mol% methane axis as 0.6 ft**(3)/lbmol\n",
+ "# similarily volume residual is determined for all other pressures and plot them vs pressure, as shown in Figure 7.10 (page 151). \n",
+ "# From this plot we find the integral we need by numerical integration ( trapazoid rule ) as 290 ft **(3)/lbmol.\n",
+ "\n",
+ "# Thus, for methane \n",
+ "# Let I = intefrate(a_i*dp)) and J = f_i/(P*y_i) , so\n",
+ "Im = 290. #[ft**(3)/lbmol]\n",
+ "\n",
+ "# Calculations\n",
+ "# and\n",
+ "Jm = math.exp((-1/(R*T))*Im)\n",
+ "\n",
+ "# hence \n",
+ "f_methane = Jm*P*y_methane #[psia] fugacity of methane\n",
+ "\n",
+ "# doing the same process for bumath.tane, we find \n",
+ "Ib = 5859. #[ft**(3)/lbmol]\n",
+ "# so, for bumath.tane we find\n",
+ "Jb = math.exp((-1/(R*T))*Ib)\n",
+ "# hence \n",
+ "f_butane = Jb*P*y_butane #[psia] fugacity of bumath.tane\n",
+ "\n",
+ "# Results\n",
+ "print \" Fugacity of the methane in the gaseous mixture is %0.0f psia\"%(f_methane)\n",
+ "print \" Fugacity of the butane in the gaseous mixture is %0.1f psia\"%(f_butane)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Fugacity of the methane in the gaseous mixture is 753 psia\n",
+ " Fugacity of the butane in the gaseous mixture is 96.8 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.6 Page: 153\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The value of v_i\n",
+ "The value of Y_i\n",
+ "The value of phi_cap_i\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 220+460. #[R] Temperature in rankine\n",
+ "P = 1000. #[psia] Pressure\n",
+ "x_methane = 0.784 # Mol fraction of methane in the given mixture\n",
+ "x_bumath_tane = (1-x_methane) # Mol fraction of n-bumath_tane in the given mixture\n",
+ "\n",
+ "# From the example 7.5, we found directly from the PvT data that for methane\n",
+ "# (f_i/(P*x_i)) = 0.961 = (v_i*Y_i) = phi_cap_i\n",
+ "# So, we can write that\n",
+ "v_i_into_Y_i = 0.961\n",
+ "phi_cap_i = 0.961\n",
+ "\n",
+ "# Calculations\n",
+ "# From Starling's tables of hydrocarbon properties we read that for pure methane at this T and P,\n",
+ "# (F_i/P) = v_i = phi_i , from which it follows \n",
+ "v_i = 0.954\n",
+ "phi_i = v_i\n",
+ "Y_i = phi_cap_i/v_i\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of v_i is %f\"%(v_i)\n",
+ "print \" The value of Y_i is %f\"%(Y_i)\n",
+ "print \" The value of phi_cap_i is %f\"%(phi_cap_i)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of v_i is 0.954000\n",
+ " The value of Y_i is 1.007338\n",
+ " The value of phi_cap_i is 0.961000\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 7.7 Page: 154\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The value of v=phi\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T_r = 0.889\n",
+ "P_r = 1.815\n",
+ "\n",
+ "# Using the properties of n-bumath.tane from appendix A.1 and the equation 7.W, we find that\n",
+ "# (f/P) = v = phi = exp((P_r/T_r)*f(T_r,w))\n",
+ "# Say, f(T_r,w) = f_f\n",
+ "f_f = -0.48553\n",
+ "\n",
+ "# Calculations\n",
+ "# so\n",
+ "v = math.exp((P_r/T_r)*f_f)\n",
+ "phi = v\n",
+ "\n",
+ "# Results\n",
+ "print \" The value of v=phi for n-bumath.tane at given condition is %f\"%(v)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The value of v=phi for n-bumath.tane at given condition is 0.371106\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch8.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch8.ipynb
new file mode 100644
index 00000000..c8a2f991
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch8.ipynb
@@ -0,0 +1,1230 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Vapor Liquid Equilibrium VLE at Low Pressures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.1 Page: 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The K factor of acetone\n",
+ "The K factor of water\n",
+ "The relative volatility \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_acetone = 0.05 # Mole fraction of Acetone in liquid\n",
+ "x_water = (1-x_acetone)\n",
+ "# Umath.sing the values from table 8.1(page 162) as reported in the book we have \n",
+ "y_acetone = 0.6381 # Mole fraction of Acetone in vapour\n",
+ "y_water = (1-y_acetone)\n",
+ "# We know that\n",
+ "# K_i = y_i/x_i\n",
+ "\n",
+ "# Calculations\n",
+ "# So 'K' factors are\n",
+ "K_acetone = y_acetone/x_acetone\n",
+ "K_water = y_water/x_water\n",
+ "# and relative volatility is \n",
+ "a = K_acetone/K_water\n",
+ "\n",
+ "# Results\n",
+ "print \"The K factor of acetone is %f\"%(K_acetone)\n",
+ "print \" The K factor of water is %f\"%(K_water)\n",
+ "print \" The relative volatility is %f\"%(a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The K factor of acetone is 12.762000\n",
+ " The K factor of water is 0.380947\n",
+ " The relative volatility is 33.500691\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.2 Page: 165\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Liquid-phase activity coefficient for acetone\n",
+ "Liquid-phase activity coefficient for water\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 1. #[atm]\n",
+ "Temp = 74.8 #[C]\n",
+ "# Here we need to know the vapour pressure p_i correspondding ti the temperatures of each of the values in the table.\n",
+ "# We can estimate them umath.sing Antoine equation by the help of the values given in table A.2(page 418) in the book\n",
+ "# math.log10(p_i) = A-B/(T+C)\n",
+ "# for acetone the consmath.tants are given as\n",
+ "A_a = 7.02447\n",
+ "B_a = 1161\n",
+ "C_a = 224\n",
+ "# So p_acetone is given by\n",
+ "p_acetone = 10**(A_a-B_a/(Temp+C_a)) #[mmHg]\n",
+ "# similarily for water the consmath.tants are given as\n",
+ "A_w = 7.94917\n",
+ "B_w = 1657.462\n",
+ "C_w = 227.02\n",
+ "\n",
+ "# Calculations\n",
+ "# So p_water is given by\n",
+ "p_water = 10**(A_w-B_w/(Temp+C_w)) #[mmHg]\n",
+ "# expresmath.sing the pressures in atm\n",
+ "p_acetone = p_acetone/760 #[atm]\n",
+ "p_water = p_water/760 #[atm]\n",
+ "# Now from table 8.1 given the book\n",
+ "y_acetone = 0.6381\n",
+ "x_acetone = 0.05\n",
+ "y_water = (1-y_acetone)\n",
+ "x_water =(1-x_acetone)\n",
+ "# Hence the liquid-phase activity coefficients for acetone and water are given as\n",
+ "Y_acetone = y_acetone*P/(x_acetone*p_acetone)\n",
+ "#and\n",
+ "Y_water = y_water*P/(x_water*p_water)\n",
+ "\n",
+ "# Results\n",
+ "print \"Liquid-phase activity coefficient for acetone is %f\"%(Y_acetone)\n",
+ "print \" Liquid-phase activity coefficient for water is %f\"%(Y_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Liquid-phase activity coefficient for acetone is 7.043759\n",
+ " Liquid-phase activity coefficient for water is 1.009407\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.3 Page: 167\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Comparison of experimental values to those computed by the ideal solution assumption\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_a = 0.05 # mole fraction of acetone in liquid phase\n",
+ "x_w = (1-x_a) # mole fraction of the water in the liquid phase\n",
+ "P = 1.00 #[atm] Total pressure in vapor phase\n",
+ "\n",
+ "# Let us assume that the solution is ideal \n",
+ "# We will take the help of trial and error methad and find a temperature at which sum of the computed ideal solution vapor phase mole fraction is 1.00\n",
+ "# For our first try let the temperatute is \n",
+ "T_1 = 80. #[C]\n",
+ "# Now from Table A.2( page 418), the Antoine equation consmath.tant for acetone are\n",
+ "A_a = 7.02447\n",
+ "B_a = 1161.\n",
+ "C_a = 224.\n",
+ "# and that for water \n",
+ "A_w = 7.94917\n",
+ "B_w = 1657.462\n",
+ "C_w = 227.02\n",
+ "\n",
+ "# Calculations\n",
+ "# Now from Antoine equation \n",
+ "# math.log10(p) = A - B/(T+C)\n",
+ "# So, vapor pressure for pure acetone at 80 C (in atm)is\n",
+ "p_a_1 = (1./760)*10**(A_a - B_a/(T_1+C_a)) #[atm]\n",
+ "# and that of water is\n",
+ "p_w_1 = (1./760)*10**(A_w - B_w/(T_1+C_w)) #[atm]\n",
+ "\n",
+ "# Now from Raoult's law \n",
+ "# y_i*P = x_i*p_i\n",
+ "# so, vapor phase composition at this temperature is\n",
+ "y_a_1 = (x_a*p_a_1)/P\n",
+ "y_w_1 = (x_w*p_w_1)/P\n",
+ "\n",
+ "# Sum of these two compostion is\n",
+ "y_1 = (y_a_1 + y_w_1)\n",
+ "# Since, y_1 is not equal to 1.00, so assumed temperature is wrong\n",
+ "\n",
+ "# Now we will assume our temperature as \n",
+ "T_2 = 96.4060 #[C]\n",
+ "\n",
+ "# Again, from Antoine equation \n",
+ "# math.log10(p) = A - B/(T+C)\n",
+ "# So, vapor pressure for pure acetone at 80 C (in atm)is\n",
+ "p_a_2 = (1./760)*10**(A_a - B_a/(T_2+C_a)) #[atm]\n",
+ "# and that of water is\n",
+ "p_w_2 = (1./760)*10**(A_w - B_w/(T_2+C_w)) #[atm]\n",
+ "\n",
+ "# Now from Raoult's law \n",
+ "# y_i*P = x_i*p_i\n",
+ "# so, vapor phase composition at this temperature is\n",
+ "y_a_2 = (x_a*p_a_2)/P\n",
+ "y_w_2 = (x_w*p_w_2)/P\n",
+ "\n",
+ "# Sum of these two compostion is\n",
+ "y_2 = (y_a_2 + y_w_2)\n",
+ "# Value of y_2 is equal to 1.00, so our assumption is right\n",
+ "# These are the values when the solution would behave as ideal, but this is not the actual scene\n",
+ "# The experimental values of the boiling point and vapor phase composition are listed in the table 8.1(page 162) given in book, which are\n",
+ "T_e = 74.8 #[C] Boiling temperature\n",
+ "y_a_e = 0.6381 # vapor phase composition of acetone\n",
+ "\n",
+ "# Results\n",
+ "print \" Comparison of experimental values to those computed by the ideal solution assumption x_acetone = 0.05 and P = 1.00 atm\"\n",
+ "print \" \\t\\t\\t Experimental Values from Table 8.1 \\t\\t\\t\\tValues calculated assuming idea solution\"\n",
+ "print \" Equilibriumboiling) \\t\\t%0.1f \\t\\t\\t\\t\\t\\t\\t\\t\\t %0.1f temperature T deg C\"%(T_e,T_2)\n",
+ "print \" Mole fraction acetone \\t\\t%f \\t\\t\\t\\t\\t\\t\\t\\t %f in the vapor phase y_a)\"%(y_a_e,y_a_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Comparison of experimental values to those computed by the ideal solution assumption x_acetone = 0.05 and P = 1.00 atm\n",
+ " \t\t\t Experimental Values from Table 8.1 \t\t\t\tValues calculated assuming idea solution\n",
+ " Equilibriumboiling) \t\t74.8 \t\t\t\t\t\t\t\t\t 96.4 temperature T deg C\n",
+ " Mole fraction acetone \t\t0.638100 \t\t\t\t\t\t\t\t 0.165615 in the vapor phase y_a)\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.4 Page: 177\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate\n",
+ "Total moles of water present in the first phase\n",
+ "Total moles of water present in the second phase\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "n_water = 80. #[mol]\n",
+ "n_bumath_tanol = 20. #[mol]\n",
+ "n_total = n_water+n_bumath_tanol #[mol]\n",
+ "\n",
+ "# Here from the figure 8.12 given in the book we can find the mole fraction of the water in each phase \n",
+ "# Let x_feed be the moles of water(species a) fed/total moles fed.\n",
+ "x_feed = 0.8\n",
+ "x_a_1 = 0.65\n",
+ "x_a_2 = 0.98\n",
+ "\n",
+ "# Calculations\n",
+ "# By material balence for water\n",
+ "# n_total*x_feed = n_1*x_a_1+n_2*x_a_2, \n",
+ "# here n_1 and n_2 are no. of mole in each phase \n",
+ "# So (n_1+n_2) = n_total\n",
+ "# Thus\n",
+ "# n_total*x_feed = n_1*x_a_1+(n_total-n_1)*x_a_2\n",
+ "# solving further\n",
+ "# n_1/n_total = (x_feed-x_a_2)/(x_a_1-x_a_2)\n",
+ "# and hence\n",
+ "n_1 = (x_feed-x_a_2)/(x_a_1-x_a_2)*n_total #[mol]\n",
+ "n_2 = (n_total-n_1) #[mol]\n",
+ "# so\n",
+ "n_a_1 = 0.65*n_1 #[mol]\n",
+ "# and\n",
+ "n_a_2 = 0.98*n_2 #[mol]\n",
+ "\n",
+ "# Results\n",
+ "print \" Total moles of water present in the first phase is %f mol\"%(n_a_1)\n",
+ "print \" Total moles of water present in the second phase is %f mol\"%(n_a_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total moles of water present in the first phase is 35.454545 mol\n",
+ " Total moles of water present in the second phase is 44.545455 mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.5 Page: 178\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The equilibrium amount of water in liquid at bubble-point\n",
+ "The equilibrium amount of water in liquid at bubble-point\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# At equilibrium on dew-point the conditions are given as\n",
+ "P = 1. #[atm]\n",
+ "y_water = 0.60\n",
+ "# From the figure 8.12d, if we start at 130C and 60 mol% water and cool.\n",
+ "# We meet he dew-point line at 99C, and at the same temperature the bubble-point curve shows\n",
+ "x_water_1 = 0.22\n",
+ "# Doing the same procedure with y_water = 0.90, we get the dew-point at the rightmost side at 98C \n",
+ "# In this case, the bubble-point line is the steeply sloping one at hte right, from wich we read \n",
+ "x_water_2 = 0.99\n",
+ "# Similarily with y_water = 0.73, we get that two dew-point meet at 92C.\n",
+ "# Vapour of this composition is in equilibrium with both liquid phases, as sketched in hte figure 8.12d.\n",
+ "# Vapour with any other composition is in equilibrium with only one liquid i.e.\n",
+ "# if y_water < 0.73, then\n",
+ "# x_water <0.65\n",
+ "# and if y_water > 0.73, then\n",
+ "# x_water >0.98\n",
+ "\n",
+ "# Results\n",
+ "print \" The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=60 mol%% is %f mol%% water\"%(x_water_1)\n",
+ "print \" The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=90 mol%% is %f mol%% water\"%(x_water_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=60 mol% is 0.220000 mol% water\n",
+ " The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=90 mol% is 0.990000 mol% water\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.6 Page: 178\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Four activity coefficients and fufacities\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 1.00 #[atm] assumed total vapor pressure\n",
+ "# In psia unit \n",
+ "P1 = 14.7 #[psia]\n",
+ "# From the figure 8.12d ( page 176 ) in book, the mole fractions of water in all the three phases and temperature are known and given as\n",
+ "x_1_water = 0.65\n",
+ "x_1_bumath_tanol = (1-x_1_water)\n",
+ "x_2_water = 0.98\n",
+ "x_2_bumath_tanol = (1-x_2_water)\n",
+ "y_water = 0.73\n",
+ "y_bumath_tanol = (1-y_water)\n",
+ "T = 92. #[C]\n",
+ "\n",
+ "# At this temperature we have to estimate the vapor pressure of pure water and n-bumath_tanol with the help of Antoine equation \n",
+ "# math.log10(p) = A - B/(T+C)\n",
+ "# From Table A.2( page 418), the Antoine equation consmath.tants for water are\n",
+ "A_w = 7.94917\n",
+ "B_w = 1657.462\n",
+ "C_w = 227.02\n",
+ "\n",
+ "# and that for n-bumath_tanol are\n",
+ "A_b = 7.838\n",
+ "B_b = 1558.190\n",
+ "C_b = 196.881\n",
+ "\n",
+ "# Calculations\n",
+ "# Thus vapor pressure of water and n-bumath_tanol are respectively\n",
+ "p_water = (14.7/760)*10**(A_w - B_w/(T+C_w))\n",
+ "p_bumath_tanol = (14.7/760)*10**(A_b - B_b/(T+C_b))\n",
+ "\n",
+ "# fugacity of the water and n-bumath_tanol are given as\n",
+ "# f_i = (y*Y*P)_i\n",
+ "# Where Y is the gas phase activity coefficient and its value is 1.00 in ideal gas mixture, so\n",
+ "f_water = (y_water*P)\n",
+ "f_bumath_tanol = (y_bumath_tanol*P)\n",
+ "# The fugacity will be same in both the phase 1 and 2\n",
+ "\n",
+ "# Now, liquid-phase activity coefficients are given by\n",
+ "# Y_i = (y_i*P)/(x_i*p_i)\n",
+ "# so,\n",
+ "Y_water_1 = (y_water*P1)/(x_1_water*p_water)\n",
+ "Y_bumath_tanol_1 = (y_bumath_tanol*P1)/(x_1_bumath_tanol*p_bumath_tanol)\n",
+ "\n",
+ "# For phase 2\n",
+ "Y_water_2 = (y_water*P1)/(x_2_water*p_water)\n",
+ "Y_bumath_tanol_2 = (y_bumath_tanol*P1)/(x_2_bumath_tanol*p_bumath_tanol)\n",
+ "\n",
+ "# Results\n",
+ "print \" Four activity coefficients and fufacities are shown in the following table:\"\n",
+ "print \"Phase \\t x_water \\t f_wateratm \\t Y_water \\t x_butanol \\t f_butanolatm \\t\\t Y_butanol\"\n",
+ "print \" 1 \\t %f \\t %f \\t %f \\t %f \\t %f \\t\\t %f \"%(x_1_water,f_water,Y_water_1,x_1_bumath_tanol,f_bumath_tanol,Y_bumath_tanol_1)\n",
+ "print \" 2 \\t %f \\t %f \\t %0.2f \\t\\t %f \\t %f \\t\\t %f \"%(x_2_water,f_water,Y_water_2,x_2_bumath_tanol,f_bumath_tanol,Y_bumath_tanol_2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Four activity coefficients and fufacities are shown in the following table:\n",
+ "Phase \t x_water \t f_wateratm \t Y_water \t x_butanol \t f_butanolatm \t\t Y_butanol\n",
+ " 1 \t 0.650000 \t 0.730000 \t 1.504988 \t 0.350000 \t 0.270000 \t\t 2.108586 \n",
+ " 2 \t 0.980000 \t 0.730000 \t 1.00 \t\t 0.020000 \t 0.270000 \t\t 36.900247 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.7 Page: 179\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Boiling point of the two phase system\n",
+ "In vapor phase mole fraction of the water\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 1. #[atm] Total pressure in the vapor phase\n",
+ "\n",
+ "# Since the two liquids are not soluble in each other so Raoult's law will apply separately for these two phases.\n",
+ "# From Raoult's law we have \n",
+ "# (y_i*P) = (x_i*p_i)\n",
+ "# Here two phases are in pure stages so x_i=1 for both phases\n",
+ "# So\n",
+ "# y_i = (p_i/P)\n",
+ "# Writing this equation for each species, adding the equations, and solving for P, we find\n",
+ "# P = summation( y_i*P ) = summation( p_i/P*P ) = summation(p_i)\n",
+ "\n",
+ "# The total pressure is the sum of the individual pure species vapor pressure\n",
+ "# To find the boiling point temperature we perform a trial and error\n",
+ "# Let us assume the boiling point temperature\n",
+ "T = 89. #[C]\n",
+ "# Antoine equation consmath.tants for water is given by\n",
+ "A_w = 7.94917\n",
+ "B_w = 1657.462\n",
+ "C_w = 227.02\n",
+ "\n",
+ "# and that for n-bumath_tanol are\n",
+ "A_b = 7.838\n",
+ "B_b = 1558.190\n",
+ "C_b = 196.881\n",
+ "\n",
+ "# Calculations\n",
+ "# Antoine equation is given by\n",
+ "# math.log10(p) = A - B/(T+C)\n",
+ "# Thus vapor pressure of water and n-bumath_tanol are respectively\n",
+ "p_water = (1./760)*10**(A_w - B_w/(T+C_w))\n",
+ "p_bumath_tanol = (1./760)*10**(A_b - B_b/(T+C_b))\n",
+ "\n",
+ "# Now, vapor phase composition are \n",
+ "y_water = p_water/P\n",
+ "y_bumath_tanol = p_bumath_tanol/P\n",
+ "# summing these, we get \n",
+ "y = y_water + y_bumath_tanol\n",
+ "\n",
+ "# Value of y is nearly equal to one so our assumption of the temperature is correct\n",
+ "# So the boiling point of the mixture is 'T'\n",
+ "\n",
+ "# Results\n",
+ "print \" Boiling point of the two phase system is %0.0f deg C\"%(T)\n",
+ "print \" In vapor phase mole fraction of the water is %0.2f\"%(y_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Boiling point of the two phase system is 89 deg C\n",
+ " In vapor phase mole fraction of the water is 0.67\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.8 Page: 184\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The value of the f/P for water vapour in the hypothetical state\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Temp = 68. #[F]\n",
+ "P = 1. #[atm]\n",
+ "\n",
+ "# Calculations\n",
+ "# Changing the temperature in 'K' and pressure in 'bar' we have\n",
+ "Temp = 273.15+(Temp-32)*5./9 #[K]\n",
+ "P = P*1.01325 #[bar]\n",
+ "# For water from the table A.1(page 417)\n",
+ "T_c = 647.1 #[K]\n",
+ "P_c = 220.55 #[bar]\n",
+ "# Now\n",
+ "T_r = Temp/T_c\n",
+ "P_r = P/P_c\n",
+ "w = 0.345\n",
+ "#Now applying the result for the little EOS from the example 7.1(page 135 ), we have\n",
+ "# f/P = exp(P_r/T_r*f(T_r))\n",
+ "# From the chapter 2 of this book, we have \n",
+ "f_T_r = (0.083-0.422/T_r**(1.6))+w*(0.139-0.172/T_r**(4.2))\n",
+ "# So\n",
+ "f_by_P = math.exp(P_r/T_r*f_T_r)\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of the f/P for water vapour in the hypothetical state is %0.2f\"%(f_by_P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of the f/P for water vapour in the hypothetical state is 0.97\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.9 Page: 189\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Boiling pressure of the liquid \n",
+ "Mole fraction of ethanaol in vapor phase\n",
+ "Mole fraction of water in the vapor phase\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# Here we will denote ethanol as species 'a' and water as the species 'b'\n",
+ "x_a = 0.1238\n",
+ "x_b = (1-x_a)\n",
+ "T = 85.3 #[C] Given boiling temperature\n",
+ "\n",
+ "# We have\n",
+ "# x_a + x_b = 1 and y_a + y_b = 1\n",
+ "# The Antoine equation consmath.tants for ethanol from the table A.2(page 418) given in the book, are \n",
+ "A_a = 8.04494\n",
+ "B_a = 1554.3\n",
+ "C_a = 222.65\n",
+ "\n",
+ "# and that for water \n",
+ "A_b = 7.96681\n",
+ "B_b = 1668.21\n",
+ "C_b = 228.0\n",
+ "\n",
+ "# Calculations\n",
+ "# Thus vapor pressure of ethanol and water are respectively\n",
+ "p_a = (1./760)*10**(A_a - B_a/(T+C_a))\n",
+ "p_b = (1./760)*10**(A_b - B_b/(T+C_b))\n",
+ "\n",
+ "# Also the activity coefficients are given by\n",
+ "# Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2)) and\n",
+ "# Y_b = 10**((A**(2)*B*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ "# here A and B are Van Laar coefficients and their values for ethanol-water system is reported in the book at page 186 (last two lines), so\n",
+ "A = 0.7292\n",
+ "B = 0.4104\n",
+ "\n",
+ "# hence\n",
+ "Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ "Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n",
+ "\n",
+ "# Now taking into account of nonideality of the gaseous phase, the modified Raoult's law gives\n",
+ "# (y_a/x_a) = (Y_a*p_a)/P and (y_b/x_b) = (Y_b*p_b)/P \n",
+ "\n",
+ "# we will take a simple method \n",
+ "# solving the above two equation for y_a and y_b and adding them, we get\n",
+ "P = (Y_a*p_a*x_a)+(Y_b*p_b*x_b) #[atm]\n",
+ "\n",
+ "# So,\n",
+ "y_a = (Y_a*p_a*x_a)/P\n",
+ "# and\n",
+ "y_b = (Y_b*p_b*x_b)/P\n",
+ "\n",
+ "# Results\n",
+ "print \" Boiling pressure of the liquid at 85.3 deg C is %0.4f atm\"%(P)\n",
+ "print \" Mole fraction of ethanaol in vapor phase is %0.4f\"%(y_a)\n",
+ "print \" Mole fraction of water in the vapor phase is %0.4f\"%(y_b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Boiling pressure of the liquid at 85.3 deg C is 0.9991 atm\n",
+ " Mole fraction of ethanaol in vapor phase is 0.4741\n",
+ " Mole fraction of water in the vapor phase is 0.5259\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.10 Page: 191\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Boiling temperature of the liquid at 1 atm pressure \n",
+ "Mole fraction of ethanaol in vapor phase \n",
+ "Mole fraction of water in the vapor phase\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# This problem is similar to the example 8.9 except that, we are provided pressure instead of temperature and different liquid composition\n",
+ "# Here again, we will denote ethanol as species 'a' and water as the species 'b'\n",
+ "x_a = 0.2608\n",
+ "x_b = (1-x_a)\n",
+ "P = 1.00 #[atm] Given boiling pressure\n",
+ "\n",
+ "# We have\n",
+ "# x_a + x_b = 1 and y_a + y_b = 1\n",
+ "\n",
+ "# The Antoine equation consmath.tants for ethanol from the table A.2(page 418) given in the book, are \n",
+ "A_a = 8.04494\n",
+ "B_a = 1554.3\n",
+ "C_a = 222.65\n",
+ "\n",
+ "# and that for water \n",
+ "A_b = 7.96681\n",
+ "B_b = 1668.21\n",
+ "C_b = 228.0\n",
+ "\n",
+ "# Thus vapor pressure of ethanol and water are respectively\n",
+ "# p_a = (1/760)*10**(A_a - B_a/(T+C_a))\n",
+ "# p_b = (1/760)*10**(A_b - B_b/(T+C_b))\n",
+ "# Adding these two equation, we get \n",
+ "# ( p_a + p_b ) = (1/760)*10**(A_a - B_a/(T+C_a)) + (1/760)*10**(A_b - B_b/(T+C_b))......................................(1)\n",
+ "\n",
+ "# Also the activity coefficients are given by\n",
+ "# Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2)) and\n",
+ "# Y_b = 10**((A**(2)*B*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ "# here A and B are Van Laar coefficients and their values for ethanol-water system is reported in the book at page 186 (last two lines), so\n",
+ "A = 0.7292\n",
+ "B = 0.4104\n",
+ "\n",
+ "# Calculations\n",
+ "# hence\n",
+ "Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ "Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n",
+ "\n",
+ "# Now we will solve for T running the loop \n",
+ "# Let us assume the startup temperature\n",
+ "T = 80.\n",
+ "err = 1.\n",
+ "\n",
+ "while err > 10**(-3):\n",
+ " P_a = (10**(8.04494 - 1554.3/(222.65 + T)))/760\n",
+ " P_b = (10**(7.96681 - 1668.21/(228 + T)))/760\n",
+ " y_a = Y_a*P_a*x_a/P\n",
+ " y_b = Y_b*P_b*x_b/P\n",
+ " err = abs((y_a + y_b) - 1)\n",
+ " T = T + 0.01\n",
+ "\n",
+ "# Results\n",
+ "print \" Boiling temperature of the liquid at 1 atm pressure is %0.4f atm\"%(T)\n",
+ "print \" Mole fraction of ethanaol in vapor phase is \\t%0.4f\"%(y_a)\n",
+ "print \" Mole fraction of water in the vapor phase is \\t%0.4f\"%(y_b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Boiling temperature of the liquid at 1 atm pressure is 82.0300 atm\n",
+ " Mole fraction of ethanaol in vapor phase is \t0.5680\n",
+ " Mole fraction of water in the vapor phase is \t0.4312\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.11 Page: 192\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Boiling pressure of the liquid at 80.7 deg C\n",
+ "Mole fraction of ethanaol in liquid phase \n",
+ "Mole fraction of water in the liquid phase \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# This problem is identical to that of the example 8.9 except difference in the boiling temperature and liquid composition\n",
+ "# Here we will again denote ethanol as species 'a' and water as the species 'b'\n",
+ "y_a = 0.6122\n",
+ "y_b = (1-y_a)\n",
+ "T = 80.7 #[C] Given boiling temperature\n",
+ "\n",
+ "# We have\n",
+ "# x_a + x_b = 1 and y_a + y_b = 1\n",
+ "\n",
+ "# The Antoine equation consmath.tants for ethanol from the table A.2(page 418) given in the book, are \n",
+ "A_a = 8.04494\n",
+ "B_a = 1554.3\n",
+ "C_a = 222.65\n",
+ "\n",
+ "# and that for water \n",
+ "A_b = 7.96681\n",
+ "B_b = 1668.21\n",
+ "C_b = 228.0\n",
+ "\n",
+ "# Calculations\n",
+ "# Thus vapor pressure of ethanol and water are respectively\n",
+ "p_a = (1./760)*10**(A_a - B_a/(T+C_a))\n",
+ "p_b = (1./760)*10**(A_b - B_b/(T+C_b))\n",
+ "\n",
+ "# Also the activity coefficients are given by\n",
+ "# Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2)) and\n",
+ "# Y_b = 10**((A**(2)*B*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ "# here A and B are Van Laar coefficients and their values for ethanol-water system is reported in the book at page 186 (last two lines), so\n",
+ "A = 0.7292\n",
+ "B = 0.4104\n",
+ "\n",
+ "# Now taking into account of nonideality of the gaseous phase, the modified Raoult's law gives\n",
+ "# (y_a/x_a) = (Y_a*p_a)/P and (y_b/x_b) = (Y_b*p_b)/P \n",
+ "\n",
+ "# Now can take the help of trial and error method to solve the above equations\n",
+ "# In this method, we will assume the different values of P and will calculate the values of x_a and x_b from the above two equations, till their sum comes to unity\n",
+ "x_a = 0.6122 # Initial assumption of liquid phase composition of ethanol\n",
+ "x_b = 0.3 # Initial assumption of liquid phase composition water\n",
+ "P = 0.80 #[atm]\n",
+ "err = 1\n",
+ "\n",
+ "while err > 2* 10**(-2):\n",
+ " P = P + 0.01\n",
+ " Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ " Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n",
+ "\n",
+ " err = abs((x_a + x_b) - 1)\n",
+ " x_a = y_a*P/(Y_a*p_a)\n",
+ " x_b = y_b*P/(Y_b*p_b)\n",
+ "\n",
+ "# Results\n",
+ "print \" Boiling pressure of the liquid at 80.7 deg C is %0.4f atm\"%(P)\n",
+ "print \" Mole fraction of ethanaol in liquid phase is %0.4f\"%(x_a)\n",
+ "print \" Mole fraction of water in the liquid phase is %0.4f\"%(x_b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Boiling pressure of the liquid at 80.7 deg C is 0.9900 atm\n",
+ " Mole fraction of ethanaol in liquid phase is 0.3730\n",
+ " Mole fraction of water in the liquid phase is 0.6205\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.12 Page: 193\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find\n",
+ "Equilibrium Temperature of the system\n",
+ "Mole fraction of ethanaol in liquid phase\n",
+ "Mole fraction of water in the liquid phase \n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# This problem is similar to the example 8.10 except that, we are provided vapour phase composition\n",
+ "# Here again, we will denote ethanol as species 'a' and water as the species 'b'\n",
+ "y_a = 0.1700\n",
+ "y_b = (1-y_a)\n",
+ "P = 1.00 #[atm] Given boiling pressure\n",
+ "\n",
+ "# We have\n",
+ "# x_a + x_b = 1 and y_a + y_b = 1\n",
+ "\n",
+ "# The Antoine equation consmath.tants for ethanol from the table A.2(page 418) given in the book, are \n",
+ "A_a = 8.04494\n",
+ "B_a = 1554.3\n",
+ "C_a = 222.65\n",
+ "\n",
+ "# and that for water \n",
+ "A_b = 7.96681\n",
+ "B_b = 1668.21\n",
+ "C_b = 228.0\n",
+ "\n",
+ "# Thus vapor pressure of ethanol and water are respectively\n",
+ "# p_a = (1/760)*10**(A_a - B_a/(T+C_a))\n",
+ "# p_b = (1/760)*10**(A_b - B_b/(T+C_b))\n",
+ "\n",
+ "# Also the activity coefficients are given by\n",
+ "# Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2)) and\n",
+ "# Y_b = 10**((A**(2)*B*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ "# here A and B are Van Laar coefficients and their values for ethanol-water system is reported in the book at page 186 (last two lines), so\n",
+ "A = 0.7292\n",
+ "B = 0.4104\n",
+ "\n",
+ "# Now taking into account of nonideality of the gaseous phase, the modified Raoult's law gives\n",
+ "# (y_a/x_a) = (Y_a*p_a)/P and (y_b/x_b) = (Y_b*p_b)/P \n",
+ "\n",
+ "# Now we can take the help of trial and error method to solve the above equations\n",
+ "# In this method, we will assume the different values of T and will calculate the values of x_a and x_b from the above two equations, till their sum comes to unity\n",
+ "\n",
+ "x_a = 0.0100 # Initial assumption of liquid phase composition of ethanol\n",
+ "x_b = 0.9 # Initial assumption of liquid phase composition water\n",
+ "T = 80. #[C] Initial guess of the temperature\n",
+ "err = 1\n",
+ "\n",
+ "# Calculations\n",
+ "while err > 1./16*10**(-2):\n",
+ " P_a = (10**(8.04494 - 1554.3/(222.65 + T)))/760\n",
+ " P_b = (10**(7.96681 - 1668.21/(228 + T)))/760\n",
+ " \n",
+ " Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n",
+ " Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n",
+ " \n",
+ " x_a = y_a*P/(Y_a*P_a)\n",
+ " x_b = y_b*P/(Y_b*P_b)\n",
+ "\n",
+ " err = abs((x_a + x_b) - 1)\n",
+ " T = T + 0.01\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \" Equilibrium Temperature of the system at pressure 1 atm is %0.4f atm\"%(T)\n",
+ "print \" Mole fraction of ethanaol in liquid phase is %0.4f\"%(x_a)\n",
+ "print \" Mole fraction of water in the liquid phase is %0.4f\"%(x_b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Equilibrium Temperature of the system at pressure 1 atm is 95.3500 atm\n",
+ " Mole fraction of ethanaol in liquid phase is 0.0187\n",
+ " Mole fraction of water in the liquid phase is 0.9816\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.13 Page: 194\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Mole fraction of the ethanol in the liquid phase in equilibrium\n",
+ "Mole fraction of the water in the liquid phase in equilibrium\n",
+ "Mole fraction of the ethanol in the vapour phase in equilibrium\n",
+ "Mole fraction of the water in the vapour phase in equilibrium\n",
+ "Vapor fraction of the given water-ethanol mixture after the flash\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# Here again, we will denote ethanol as species 'a' and water as the species 'b'\n",
+ "x_aF = 0.126\n",
+ "x_bF = (1-x_aF)\n",
+ "P = 1.00 #[atm] Given total pressure\n",
+ "T = 91.8 #[C]\n",
+ "\n",
+ "# Calculations\n",
+ "# We will go with graphical approach for solving this problem \n",
+ "# This problem requires T - x_a diagram at the given pressure i.e. 1 atm \n",
+ "# This diagram is provided on page 196( figure 8.19) in the book \n",
+ "# We will draw horizontal and vertical lines corresponding to the specified T and x_a. \n",
+ "# Drawing a horizontal line from temperature 91.8 degC and vertical line corresponding to the x_aF = 0.126, we see that these two intersect in the two phase region, which tells that our feed contains both liquid and vapour phase\n",
+ "# Now liquid phase composition in equilibrium is found by reading the x-axis where the bubble-point vs x_a curve and horizontal line corresponding to T = 91.8 degC intersect and viz.\n",
+ "x_a = 0.0401\n",
+ "x_b = (1 - x_a)\n",
+ "\n",
+ "# Similarily vapour phase composition in equilibrium is found by reading the x-axis where the dew-point vs y_a curve and horizontal line corresponding to T = 91.8 degC intersect and viz.\n",
+ "y_a = 0.2859\n",
+ "y_b = ( 1 - y_a)\n",
+ "\n",
+ "# Now vapour fraction is given by\n",
+ "V_by_F = ( x_aF - x_a )/(y_a - x_a)\n",
+ "\n",
+ "# Results\n",
+ "print \" Mole fraction of the ethanol in the liquid phase in equilibrium at the given condition is %f\"%(x_a)\n",
+ "print \" Mole fraction of the water in the liquid phase in equilibrium at the given condition is %f\"%(x_b)\n",
+ "print \" Mole fraction of the ethanol in the vapour phase in equilibrium at the given condition is %f\"%(y_a)\n",
+ "print \" Mole fraction of the water in the vapour phase in equilibrium at the given condition is %f\"%(y_b)\n",
+ "print \" Vapor fraction of the given water-ethanol mixture after the flash in equilibrium is %f\"%(V_by_F)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mole fraction of the ethanol in the liquid phase in equilibrium at the given condition is 0.040100\n",
+ " Mole fraction of the water in the liquid phase in equilibrium at the given condition is 0.959900\n",
+ " Mole fraction of the ethanol in the vapour phase in equilibrium at the given condition is 0.285900\n",
+ " Mole fraction of the water in the vapour phase in equilibrium at the given condition is 0.714100\n",
+ " Vapor fraction of the given water-ethanol mixture after the flash in equilibrium is 0.349471\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.14 Page: 198\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the various assumed temperatures\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 100. #[psia]\n",
+ "# Composition in liquid phase is \n",
+ "x_a = 0.05 # Mole fraction of methane \n",
+ "x_b = 0.40 # Mole fraction of bumath.tane \n",
+ "x_c = 0.55 # mole fraction of penmath.tane\n",
+ "\n",
+ "# We have to take the help of the following equations\n",
+ "# ( x_a + x_b + x_c ) = 1 and ( y_a + y_b + y_c ) = 1\n",
+ "# ( y_a/x_a ) = K_a ( y_b/x_b ) = K_b and ( y_c/x_c ) = K_c\n",
+ "\n",
+ "# Calculations\n",
+ "# We draw a straight line across figure 8.20 from 100psia to different temperatures like 0,5,10,15,20,25,30 degF and read the three K factors \n",
+ "T = [[15.8 ,0.087, 0.024],[16,0.105, 0.026],[16.2, 0.115, 0.03],[16.8 ,0.13, 0.035],[17.2 ,0.15, 0.04],[17.8, 0.17, 0.045],[18.2, 0.175, 0.0472727]]\n",
+ "print \" Calculations for the various assumed temperatures are given in the table below\"\n",
+ "print \" Temperature \\t\\t y_a \\t\\t y_b \\t\\t\\t y_c \\t\\t\\t y \"\n",
+ "\n",
+ "T_b = 0 #[F] Bubble point\n",
+ "j=0\n",
+ "for i in range(7):\n",
+ " y_a = x_a*T[i][j]\n",
+ " y_b = x_b*T[i][j+1]\n",
+ " y_c = x_c*T[i][j+2]\n",
+ " y = y_a + y_b + y_c\n",
+ " T_b = T_b + 5\n",
+ " print \" %f \\t\\t %f \\t\\t %f \\t\\t %f \\t\\t %f \"%(T_b,y_a,y_b,y_c,y)\n",
+ "\n",
+ "# Results\n",
+ "print \" For the temperature 30 deg F the summation of the mole fractions in the vapor phase is close enough to unity so bubble point is 30 degF\"\n",
+ "print \" And compositions in the vapor phase are the values given in the above table corresonding to the temperature 30 deg F i.e.\"\n",
+ "print \" y_methane = %f y_bumath.tane = %f y_penmath.tane = %f\"%(y_a,y_b,y_c)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Calculations for the various assumed temperatures are given in the table below\n",
+ " Temperature \t\t y_a \t\t y_b \t\t\t y_c \t\t\t y \n",
+ " 5.000000 \t\t 0.790000 \t\t 0.034800 \t\t 0.013200 \t\t 0.838000 \n",
+ " 10.000000 \t\t 0.800000 \t\t 0.042000 \t\t 0.014300 \t\t 0.856300 \n",
+ " 15.000000 \t\t 0.810000 \t\t 0.046000 \t\t 0.016500 \t\t 0.872500 \n",
+ " 20.000000 \t\t 0.840000 \t\t 0.052000 \t\t 0.019250 \t\t 0.911250 \n",
+ " 25.000000 \t\t 0.860000 \t\t 0.060000 \t\t 0.022000 \t\t 0.942000 \n",
+ " 30.000000 \t\t 0.890000 \t\t 0.068000 \t\t 0.024750 \t\t 0.982750 \n",
+ " 35.000000 \t\t 0.910000 \t\t 0.070000 \t\t 0.026000 \t\t 1.006000 \n",
+ " For the temperature 30 deg F the summation of the mole fractions in the vapor phase is close enough to unity so bubble point is 30 degF\n",
+ " And compositions in the vapor phase are the values given in the above table corresonding to the temperature 30 deg F i.e.\n",
+ " y_methane = 0.910000 y_bumath.tane = 0.070000 y_penmath.tane = 0.026000\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.15 Page: 199\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Vapour pressure\n",
+ "The temperature\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "n_sugar = 1. #[mol]\n",
+ "n_water = 1000/18. #[mol]\n",
+ "x_sugar = n_sugar/(n_sugar+n_water)\n",
+ "x_water = n_water/(n_sugar+n_water)\n",
+ "# At 100C we have \n",
+ "p_water = 1. #[atm]\n",
+ "p_sugar = 0. #[atm]\n",
+ "# and the relation\n",
+ "\n",
+ "# Calculations\n",
+ "P = x_water*p_water+x_sugar*p_sugar #[atm]\n",
+ "# The situation is sketched in the figure 8.21 in the book[page 199].\n",
+ "# Now for the second part of the question\n",
+ "# To find the temperature at which the solution will boil, we see on the figure that we must raise the temperature to increase p_i to a value high enough that the total pressure P_1 = 1atm, with x_water calculated above.\n",
+ "P_1 = 1. #[atm]\n",
+ "p_water = P_1/x_water #[atm]\n",
+ "# Interpolating in the steam table[12] reported in the book, we find \n",
+ "T = 100.51 #[C]\n",
+ "# We may restate this that the boiling-point elevation caused by this dissolved, nonvolatile solute is\n",
+ "T_eb = T-100 #[C]\n",
+ "\n",
+ "# Results\n",
+ "print \"Vapour pressure of this solution at the 100C is %.3f atm\"%(P)\n",
+ "print \"The temperature at which this solution will boil at 1 atm is %.2f C\"%(T)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vapour pressure of this solution at the 100C is 0.982 atm\n",
+ "The temperature at which this solution will boil at 1 atm is 100.51 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 8.16 Page: 201\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Freezing-point temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "n_sugar = 1. #[mol]\n",
+ "n_water = 1000/18. #[mol]\n",
+ "x_sugar = n_sugar/(n_sugar+n_water)\n",
+ "x_water = n_water/(n_sugar+n_water)\n",
+ "\n",
+ "# Here we can assert that for liquid solution and solid ice to be in equilibrium, the fugacity of water in the liquid must be same as that of water in the solid ice. \n",
+ "# Crystalline solid formed from such a solution is nearly pure H2O, with no dissolved sugar.\n",
+ "# At the low pressures involved here, these fugacities are practically equal to partial pressures, so that \n",
+ "#P = x_water*p_water+x_sugar*p_sugar = p_ice\n",
+ "\n",
+ "# but\n",
+ "p_sugar = 0\n",
+ "# so\n",
+ "p_ice_by_p_water = x_water\n",
+ "\n",
+ "# Figure 5.8 reported in the book (page 100) shows the vapour pressure of subcooled water and of ice. \n",
+ "#The values in the given table from which that figure were made can be represented by the following totally empirical data-fitting equation.\n",
+ "# p_ice/p_water = 1+0.0096686*T+4.0176*10**(-5)*T**(2)\n",
+ "# We eliminate p_ice/p_water by x_water \n",
+ "\n",
+ "# Calculations\n",
+ "def f(T): \n",
+ "\t return 1+0.0096686*T+4.0176*10**(-5)*T**(2)-p_ice_by_p_water\n",
+ "T = fsolve(f,0)\n",
+ "\n",
+ "# Results\n",
+ "print \"Freezing-point temperature of the given solution is %f C\"%(T)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Freezing-point temperature of the given solution is -1.842891 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch9.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch9.ipynb
new file mode 100644
index 00000000..1e6bece8
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch9.ipynb
@@ -0,0 +1,691 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Correlating And Predicting Nonideal VLE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.1 Page: 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Value of the liquid-phase activity coefficient\n",
+ "And value of the liquid-phase activity coefficient\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "x_isopropanol = 0.4720\n",
+ "x_water = 0.5280\n",
+ "# From the table A.7 (page 427) reported in the book the Van Laar coefficients for isopropanol-water system at 1atm are given by\n",
+ "A = 1.0728\n",
+ "B = 0.4750\n",
+ "\n",
+ "# Calculations\n",
+ "# Van Laar equations are given \n",
+ "# math.log10(Y_a) = A*x_b**(2)/(A/B*x_a+x_b)**(2)\n",
+ "# math.log10(Y_b) = B*x_a**(2)/(B/A*x_b+x_a)**(2)\n",
+ "# We calculate Y_isopropanol and Y_water as\n",
+ "Y_isopropanol = 10**(A*x_water**(2)/(A/B*x_isopropanol+x_water)**(2))\n",
+ "Y_water = 10**(B*x_isopropanol**(2)/(B/A*x_water+x_isopropanol)**(2))\n",
+ "\n",
+ "# Results\n",
+ "print \" Value of the liquid-phase activity coefficient for isopropanol is %f\"%(Y_isopropanol)\n",
+ "print \" And value of the liquid-phase activity coefficient for water is %f\"%(Y_water)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Value of the liquid-phase activity coefficient for isopropanol is 1.311310\n",
+ " And value of the liquid-phase activity coefficient for water is 1.630951\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.2 Page: 221\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The value of g_E/RT for acetone-water solution \n",
+ "The value of g_E/RT)/x_a*x_b) for acetone-water\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# Recieving the VLE data from the example 8.2, we have\n",
+ "x_acetone = 0.05\n",
+ "x_water = 0.95\n",
+ "# And the activity coefficient is given by\n",
+ "y_acetone = 7.04\n",
+ "y_water = 1.01\n",
+ "# we hve the relation g_E/RT = summation(x_i*math.log(y_i))\n",
+ "# let C = g_E/RT , so\n",
+ "\n",
+ "# Calculations\n",
+ "C = (x_acetone*math.log(y_acetone)+x_water*math.log(y_water))\n",
+ "# Now let M = (g_E/RT )/(x_acetone*x_water)\n",
+ "# So\n",
+ "M = C/(x_acetone*x_water)\n",
+ "\n",
+ "# Results\n",
+ "print \"The value of g_E/RT for acetone-water solution at 1 atm pressure is %f\"%(C)\n",
+ "print \"The value of g_E/RT)/x_a*x_b) for acetone-water solution at 1 atm pressure is %f\"%(M)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of g_E/RT for acetone-water solution at 1 atm pressure is 0.107033\n",
+ "The value of g_E/RT)/x_a*x_b) for acetone-water solution at 1 atm pressure is 2.253331\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.5 Page: 224\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculate Values of the constants in Morgules equation for acetone-water\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "y_acetone_infinity = 10.\n",
+ "y_water_infinty = 5.\n",
+ "Pressure = 1. #[atm]\n",
+ "\n",
+ "# Calculations\n",
+ "# From equation 9.L and 9.M (page 224) as reported in the book, we have \n",
+ "# Constants in morgules equation b and c as\n",
+ "b = math.log(y_acetone_infinity)\n",
+ "c = math.log(y_water_infinty)\n",
+ "\n",
+ "# Results\n",
+ "print \"Values of the consmath.tants in Morgules equation for acetone-water at 1 atm are b = %f\"%(b)\n",
+ "print \" and c = %f\"%(c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Values of the consmath.tants in Morgules equation for acetone-water at 1 atm are b = 2.302585\n",
+ " and c = 1.609438\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.6 Page: 225\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The activity coefficient of ethanol\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P_1 = 10. #[atm]\n",
+ "x_a_1 = 0.1238 # mole fraction of ethanol at 10 atm pressure\n",
+ "Temp = 273.15+85.3 # [K]\n",
+ "R = 0.08206 #[(L*atm)/(mol*K)]\n",
+ "P_0 = 1. #[atm]\n",
+ "# so\n",
+ "delta_P = (P_1-P_0) #[atm]\n",
+ "# Molecular weight of ethanol and water are respectively\n",
+ "M_ethanol = 46. #[g/mol]\n",
+ "M_water = 18. #[g/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Now changing the mol fraction of ethanol in the wt fraction \n",
+ "m_a_1 = x_a_1*M_ethanol/(x_a_1*M_ethanol+(1-x_a_1)*M_water)\n",
+ "# From example 8.9(page 188) we know that at this T and 1 atm and x_a_0, activity coefficient for ethanol \n",
+ "y_ethanol_0 = 2.9235\n",
+ "# Now from figure 6.15(page 129), we read that at 20C and m_a_1 mass fraction ethanol ,\n",
+ "v_ethanol_1 = 1.16 #[cm**(3)/g]\n",
+ "# Similarily for mass fraction corresponding to mole fraction x_a_1 \n",
+ "v_ethanol_0 = 1.27 #[cm**(3)/]\n",
+ "# Difference of thes etwo values is \n",
+ "v = v_ethanol_1-v_ethanol_0 #[cm**(3)/g]\n",
+ "v = v*46. #[L/g]\n",
+ "# If we assume that this value is more or less independent of temperature, we can use it as the corresponding value at 85.3C, and compute \n",
+ "# From equation 7.31(page 225)\n",
+ "# d(math.log(y_i))/dP = (v_1-v_0)/(R*T) at consmath.tant temperature and mole fraction \n",
+ "# Let d(math.log(y_i))/dP = C, then\n",
+ "C = (v_ethanol_1-v_ethanol_0)/(R*Temp)\n",
+ "\n",
+ "# Also we can have \n",
+ "# delta_math.log(y_i) = (d(math.log(y_i))/dP)*delta_P\n",
+ "# or \n",
+ "# delta_math.log(y_i) = C*delta_P\n",
+ "# and delta_math.log(y_i) = math.log(y_ehmath.tanol_1)-math.log(y_ethanol_0)\n",
+ "# So\n",
+ "y_ethanol_1 = math.exp(math.log(y_ethanol_0)+C*delta_P)\n",
+ "\n",
+ "# Results\n",
+ "print \"The activity coefficient of ethanol in the solution at 10 atm pressure is %f\"%(y_ethanol_1)\n",
+ "\n",
+ "# Note : Answer is different because of rouding error. Please calculate manually.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The activity coefficient of ethanol in the solution at 10 atm pressure is 2.826741\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.7 Page: 226\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The activity coefficient of ethanol\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "x_ethanol = 0.1238\n",
+ "Temp_1 = 273.15+85.3 #[K]\n",
+ "P = 1. #[atm]\n",
+ "Temp_2 = 273.15+70 #[K]\n",
+ "R = 8.314 #[j/(mol*K)]\n",
+ "# From example 8.9, at temperature 85.3C the activity coefficient is \n",
+ "y_ethanol_1 = 2.9235\n",
+ "# From figure 9.5[4] (page 227) as reported in the book, we read the value of (h_i_average-h_i_0) at temperatures 90C and 70C for ethanol.\n",
+ "# which are respectively\n",
+ "delta_h_2 = 0.2 #[kJ/mol]\n",
+ "delta_h_1 = 1.0 #[kJ/mol]\n",
+ "\n",
+ "# Calculations\n",
+ "# Taking the average of these two values we have \n",
+ "delta_h_average = (delta_h_1+delta_h_1)/2*1000. #[J/mol]\n",
+ "# From the equation 7.32 (page 225) reported in the book \n",
+ "# d(math.log(y_i))/dT = (h_i_average-h_i_0)/(R*T**(2)) at consmath.tant pressure and mole fraction\n",
+ "# So\n",
+ "# it can be taken approximately as \n",
+ "# So\n",
+ "\n",
+ "def f7(T): \n",
+ "\t return (1/T**(2))\n",
+ "\n",
+ "y_ethanol_2 = y_ethanol_1*math.exp((delta_h_average/R)* (quad(f7,Temp_1,Temp_2))[0])\n",
+ "\n",
+ "# Results\n",
+ "print \"The activity coefficient for ethanol in the solution at 70 deg C and 1 atm is %f\"%(y_ethanol_2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The activity coefficient for ethanol in the solution at 70 deg C and 1 atm is 2.880086\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.8 Page: 229\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find activity coefficient of acetone\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# In this solution we will give the identity to the three species as\n",
+ "# a- Acetone \n",
+ "# b- Methanol\n",
+ "# c- Water\n",
+ "# Given\n",
+ "x_a = 0.1200\n",
+ "x_b = 0.1280\n",
+ "x_c = 0.7520\n",
+ "Temp = 66.70 #[C]\n",
+ "P = 1. #[atm] pressure\n",
+ "# As reported in the book that from [5] we get the following values \n",
+ "# acetone-methanol(a-b)\n",
+ "A_ab = 0.2634\n",
+ "A_ba = 0.2798\n",
+ "# acetone-water(a-c)\n",
+ "A_ac = 0.9709\n",
+ "A_ca = 0.5579\n",
+ "# methanol-water(b-c)\n",
+ "A_bc = 0.3794\n",
+ "A_cb = 0.2211\n",
+ "\n",
+ "# Calculations\n",
+ "# Now consider the equation 9.10 (page 228) \n",
+ "# The first term on the right of the equation is\n",
+ "T_1 = round(x_b**(2)*(A_ab+2*x_a*(A_ba-A_ab)),5)\n",
+ "# similarily the second and third terms are given respectively as \n",
+ "T_2 = round(x_c**(2)*(A_ac+2*x_a*(A_ca-A_ac)),3)\n",
+ "T_3 = 0.0550 #x_b*x_c*(0.5*(A_ba+A_ab+A_ac-A_bc-A_cb)+x_a*(A_bc-A_ab+A_ca-A_ac)+(x_b-x_c)*(A_bc-A_cb)-(1-2*x_a)*0.00)\n",
+ "# thus whole term on the right hand side is\n",
+ "T = T_1+T_2+T_3\n",
+ "# So \n",
+ "y_a = 10**(T)\n",
+ "# for this temperature vapour pressure of the acetone is calculated as \n",
+ "p_acetone = 1.417 #[atm]\n",
+ "# So that we estimate\n",
+ "y_acetone = x_a*y_a*p_acetone\n",
+ "\n",
+ "# Results\n",
+ "print \" yacetone : %.3f\"%y_acetone\n",
+ "print \"The activity coefficient of acetone in the given mixture is %f\"%(y_a)\n",
+ "# The experimental value is y_acetone = 0.698\n",
+ "\n",
+ "# Answer is different because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " yacetone : 0.607\n",
+ "The activity coefficient of acetone in the given mixture is 3.567632\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.9 Page: 234\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 85.3+273.15 #[K] Temperature\n",
+ "P = 1. #[atm] Pressure of the mixture\n",
+ "R = 8.314 #[(Pa*m(3)/(K*mol))]\n",
+ "R_1 = 0.08206 #[(L*atm)/(mol*K)]\n",
+ "y_i = 0.1238 # mole fraction of the ethanol in the vapor phase\n",
+ "y_j = (1-y_i) # mole fraction of the water vapor in the vapor phase\n",
+ "\n",
+ "# From the table A.1( table 417), the properties of water and ethanol are given as \n",
+ "# Critical temperatures are \n",
+ "T_c_ii = 513.9 #[K] Critical temperature of the ethanol\n",
+ "T_c_jj = 647.1 #[K] Criatical temperature of water\n",
+ "\n",
+ "# Critical pressure are \n",
+ "P_c_ii = 61.48 #[bar] Critical pressure of ethanol \n",
+ "P_c_jj = 220.55 #[bar] Critical pressure of water\n",
+ "\n",
+ "# A# Resultsentric factor\n",
+ "w_ii = 0.645 # accentric factor of the ethanol \n",
+ "w_jj = 0.345 # accentric factor of the water\n",
+ "\n",
+ "# Compressibility factor are\n",
+ "z_c_ii = 0.24 # compressibility factor of ethanol\n",
+ "z_c_jj = 0.229 # compressibility factor of the water\n",
+ "\n",
+ "# Calculations\n",
+ "# Critical volume are given by \n",
+ "V_c_ii = z_c_ii*R*T_c_ii/(P_c_ii*100000)*10**(6) # critical volume the ethanol\n",
+ "V_c_jj = z_c_jj*R*T_c_jj/(P_c_jj*100000)*10**(6) # critical volume the ethanol\n",
+ "\n",
+ "# Now\n",
+ "# for k_ij = 0.0\n",
+ "T_c_ij_0 = (T_c_ii*T_c_jj)**(1./2) #[K]\n",
+ "w_ij = (w_ii + w_jj)/2.\n",
+ "z_c_ij = (z_c_ii + z_c_jj)/2.\n",
+ "V_c_ij = ( (V_c_ii**(1./3) + V_c_jj**(1./3))/2.)**(3)\n",
+ "P_c_ij_0 = (z_c_ij*R*T_c_ij_0)/(V_c_ij/10.**(6.))/10.**(5) #[bar]\n",
+ "\n",
+ "# again for k_ij = 0.01\n",
+ "T_c_ij_1 = (T_c_ii*T_c_jj)**(1./2.)*(1-0.01) #[K]\n",
+ "P_c_ij_1 = (z_c_ij*R*T_c_ij_1)/(V_c_ij/10.**(6))/10**(5) #[bar]\n",
+ "\n",
+ "# Now \n",
+ "T_r_ii = T/T_c_ii\n",
+ "T_r_jj = T/T_c_jj\n",
+ "T_r_ij_0 = T/T_c_ij_0\n",
+ "T_r_ij_1 = T/T_c_ij_1\n",
+ "\n",
+ "# and\n",
+ "P_r_ii = P/P_c_ii\n",
+ "P_r_jj = P/P_c_jj\n",
+ "P_r_ij_0 = P/P_c_ij_0\n",
+ "P_r_ij_1 = P/P_c_ij_1\n",
+ "\n",
+ "# Now we will calculate f(T_r) for each component and mixture\n",
+ "f_Tr_ii = ( 0.083 - 0.422/T_r_ii**(1.6) ) + w_ii*( 0.139 - 0.172/T_r_ii**(4.2))\n",
+ "f_Tr_jj = ( 0.083 - 0.422/T_r_jj**(1.6) ) + w_jj*( 0.139 - 0.172/T_r_jj**(4.2))\n",
+ "f_Tr_ij0 = ( 0.083 - 0.422/T_r_ij_0**(1.6) ) + w_ij*( 0.139 - 0.172/T_r_ij_0**(4.2))\n",
+ "f_Tr_ij1 = ( 0.083 - 0.422/T_r_ij_1**(1.6) ) + w_ij*( 0.139 - 0.172/T_r_ij_1**(4.2))\n",
+ "\n",
+ "# Let us define A = (P_r*f(T_r)/T_r) , so\n",
+ "A_ii = P_r_ii*f_Tr_ii/T_r_ii\n",
+ "A_jj = P_r_jj*f_Tr_jj/T_r_jj\n",
+ "\n",
+ "# We are given\n",
+ "v_ii = 0.975\n",
+ "v_jj = 0.986\n",
+ "\n",
+ "# Now,\n",
+ "B_ii = ( f_Tr_ii*R*T_c_ii/P_c_ii)*(10.**(3)/10**(5)) #[L/mol]\n",
+ "B_jj = ( f_Tr_jj*R*T_c_jj/P_c_jj)*(10.**(3)/10**(5)) #[L/mol]\n",
+ "B_ij0 = ( f_Tr_ij0*R*T_c_ij_0/P_c_ij_0)*(10.**(3)/10**(5)) #[L/mol]\n",
+ "B_ij1 = ( f_Tr_ij1*R*T_c_ij_1/P_c_ij_1)*(10.**(3)/10**(5)) #[L/mol]\n",
+ "\n",
+ "# now we will calculate 'delta'\n",
+ "delta_ij0 = 2*B_ij0 - B_ii - B_jj #[L/mol]\n",
+ "delta_ij1 = 2*B_ij1 - B_ii - B_jj #[L/mol]\n",
+ "\n",
+ "# We have \n",
+ "# b_a = B_aa + y_b**(2)*delta and b_b = B_bb + y_a**(2)*delta\n",
+ "# so,\n",
+ "b_ethanol0 = B_ii + y_j**(2)*delta_ij0 #[L/mol]\n",
+ "b_water0 = B_jj + y_i**(2)*delta_ij0 #[L/mol]\n",
+ "b_ethanol1 = B_ii + y_j**(2)*delta_ij1 #[L/mol]\n",
+ "b_water1 = B_jj + y_i**(2)*delta_ij1 #[L/mol]\n",
+ "\n",
+ "# Now \n",
+ "# phi_i = exp(b_i*P/(R*T))\n",
+ "# So,\n",
+ "phi_ethanol0 = math.exp((b_ethanol0*P)/(R_1*T))\n",
+ "phi_water0 = math.exp((b_water0*P)/(R_1*T))\n",
+ "phi_ethanol1 = math.exp((b_ethanol1*P)/(R_1*T))\n",
+ "phi_water1 = math.exp((b_water1*P)/(R_1*T))\n",
+ "\n",
+ "# and\n",
+ "# Y_i = phi_i/v_i\n",
+ "# So,\n",
+ "Y_ethanol0 = phi_ethanol0/v_ii\n",
+ "Y_water0 = phi_water0/v_jj\n",
+ "Y_ethanol1 = phi_ethanol1/v_ii\n",
+ "Y_water1 = phi_water1/v_jj\n",
+ "\n",
+ "# Results\n",
+ "print \" The results are summarize in the following table\"\n",
+ "print \" Property \\t\\t\\t Mix ij Assuming k_ij = 0.0 \\t\\t\\t Mix ij Assuming k_ij = 0.01\"\n",
+ "print \" phi_ethanol \\t\\t\\t\\t %f \\t\\t\\t\\t\\t %f \"%(phi_ethanol0,phi_ethanol1)\n",
+ "print \" phi_water \\t\\t\\t\\t %f \\t\\t\\t\\t\\t %f \"%(phi_water0,phi_water1)\n",
+ "print \" Y_ethanol \\t\\t\\t\\t %f \\t\\t\\t\\t\\t %f \"%(Y_ethanol0,Y_ethanol1)\n",
+ "print \" Y_water \\t\\t\\t\\t %f \\t\\t\\t\\t\\t %f \"%(Y_water0,Y_water1)\n",
+ "print \" Value of ''v'' for ethanol is %f\"%(v_ii)\n",
+ "print \" Value of ''v'' water is %f\"%(v_jj)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The results are summarize in the following table\n",
+ " Property \t\t\t Mix ij Assuming k_ij = 0.0 \t\t\t Mix ij Assuming k_ij = 0.01\n",
+ " phi_ethanol \t\t\t\t 0.973881 \t\t\t\t\t 0.974768 \n",
+ " phi_water \t\t\t\t 0.986276 \t\t\t\t\t 0.986294 \n",
+ " Y_ethanol \t\t\t\t 0.998852 \t\t\t\t\t 0.999762 \n",
+ " Y_water \t\t\t\t 1.000280 \t\t\t\t\t 1.000298 \n",
+ " Value of ''v'' for ethanol is 0.975000\n",
+ " Value of ''v'' water is 0.986000\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.10 Page: 239\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The infinite dilution activity coefficient of n-Hexane\n",
+ "The infinite dilution activity coefficient of diethlyketone\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 65+273.15 #[K] Temperature\n",
+ "R = 8.314 #[(m**(3)*Pa)/(mol*K)] Universal gas consmath.tant \n",
+ "# From the table 9.C ( page 239 ) given in the book the molar volumes and solubility of n-hexane and diethylketone at 25 deg C are given as \n",
+ "v_hex = 131.6 #[ml/mol] Molar volume of n-Hexane\n",
+ "v_dketone = 106.4 #[ml/mol] Molar volume of diethylketone\n",
+ "s_hex = 14.9 #[MPa**(0.5)] Solubility of n-Hexane\n",
+ "s_dketone = 18.1 #[MPa**(0.5)] Solubility of diethylketone\n",
+ "\n",
+ "# Calculations\n",
+ "# Here we will use these values with the assumption that Y_i,65C = Y_i,25C\n",
+ "# At infinite dilution, the volume fraction of the other species is 1.00, so, \n",
+ "# math.logY_a = v_a*phi_b**(2)*(delta_a - delta_b)**(2)/(R*T)\n",
+ "# so, for n-Hexane\n",
+ "Y_hex = math.exp(v_hex*1**(2)*(s_hex - s_dketone)**(2)/(R*T))\n",
+ "# And that for diethylketone\n",
+ "Y_dketone = math.exp(v_dketone*1**(2)*( s_dketone - s_hex )**(2)/(R*T))\n",
+ "\n",
+ "# Results\n",
+ "print \" The infinite dilution activity coefficient of n-Hexane is %f\"%(Y_hex)\n",
+ "print \" The infinite dilution activity coefficient of diethlyketone is %f\"%(Y_dketone)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The infinite dilution activity coefficient of n-Hexane is 1.614995\n",
+ " The infinite dilution activity coefficient of diethlyketone is 1.473359\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.11 Page: 243\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Henry's law constant for O2\n",
+ "solubility of O2 \n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P = 1. #[atm]\n",
+ "T = 25. #[C]\n",
+ "y_i = 1.00 # amount of the oxygen in the vapour \n",
+ "# Umath.sing the consmath.tants for O2 in table A.2 \n",
+ "A = 6.69147\n",
+ "B = 319.0117\n",
+ "C = 266.7\n",
+ "\n",
+ "# Calculations\n",
+ "# By Antoine equation \n",
+ "# log10(P_i) = A-B/(T+C)\n",
+ "P_i = 10**(A-B/(T+C)) #[mmHg]\n",
+ "P_i = P_i/760. #[atm]\n",
+ "# This is extrapolated vapour pressure of O2 at 25C\n",
+ "# We will take this value as equal to the Henry's law consmath.tant\n",
+ "H_i = P_i\n",
+ "x_i = y_i*P/H_i\n",
+ "\n",
+ "# Results\n",
+ "print \" Henry's law constant for O2 is %f atm\"%(P_i)\n",
+ "print \" solubility of O2 is %e\"%(x_i)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Henry's law constant for O2 is 521.227107 atm\n",
+ " solubility of O2 is 1.918549e-03\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.12 Page: 244\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The activity coefficient of the oxygen\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "y_a = 1.00\n",
+ "P = 1.00 #[atm]\n",
+ "x_a = 0.231*10**(-4)\n",
+ "# Using the constants for O2 in table A.2 in the Antoine equation , we find the vapour pressure of the oxygen at 25C viz.\n",
+ "p_a = 521.15 #[atm]\n",
+ "# Thus activity coefficient is calculated by rewriting the equation 8.6 and umath.sing the above values \n",
+ "\n",
+ "# Calculations\n",
+ "Y_O2 = (y_a*P)/(x_a*p_a)\n",
+ "\n",
+ "# Results\n",
+ "print \"The activity coefficient of the oxygen in the water is %f\"%(Y_O2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The activity coefficient of the oxygen in the water is 83.066379\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic111.png b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic111.png
new file mode 100644
index 00000000..f6781e82
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic111.png
Binary files differ
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic222.png b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic222.png
new file mode 100644
index 00000000..b13b4e55
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic222.png
Binary files differ
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic333.png b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic333.png
new file mode 100644
index 00000000..46a7d555
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/screenshots/pic333.png
Binary files differ
diff --git a/Practical_C_Programming/Chapter_10_1.ipynb b/Practical_C_Programming/Chapter_10_1.ipynb
new file mode 100644
index 00000000..b3cda55e
--- /dev/null
+++ b/Practical_C_Programming/Chapter_10_1.ipynb
@@ -0,0 +1,230 @@
+{
+ "metadata": {
+ "name": "Chapter 10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 10: C Preprocessor"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.1, Page number: 172"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.1.py\n# To print the contents of two arrays upto 10 indices\n\n\n# Variable declaration\ndata = []\ntwice = []\n\n# Calculation and result\nfor index in range (0, 10) :\n data.append(index)\n twice.append(2 * index)\n\nprint (data)\nprint (twice)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.2, Page number: 173"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.2.py\n# To print the contents of two arrays upto 20 indices \n\n\n# Variable declaration\ndata = []\ntwice = []\n\n# Calculation and result\nfor index in range (0, 20) :\n data.append(index)\n twice.append(2 * index)\n\nprint (data)\nprint (twice)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38]\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.3, Page number: 175"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.3.py\n# To print the value of variable 'index' \n\n\n# Variable declaration\nBIG_NUMBER = 10 * 10\nindex = 1\n\n# Calculation and result\nwhile (index < BIG_NUMBER) :\n index = index * 8\n print ('%d' % index)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "8\n64\n512\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.4, Page number: 176"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.4.py\n# To determine the square of ALL_PARTS \n\n\n# Variable declaration\nFIRST_PART = 7\nLAST_PART = 5\nALL_PARTS = FIRST_PART + LAST_PART\n\n# Calculation and result\nprint ('The square of all the parts is %d' % (ALL_PARTS * ALL_PARTS))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The square of all the parts is 144\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.5, Page number: 177"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.5.py\n# To print 'Hi there' 10 times \n\n\n# Calculation and result\nfor i in reversed (range(10)) :\n print ('Hi there')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hi there\nHi there\nHi there\nHi there\nHi there\nHi there\nHi there\nHi there\nHi there\nHi there\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.6, Page number: 177"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.6.py\n# To print the value of 'size' \n\n\n# Variable declaration\nsize = 10\nfudge = size - 2\n\n# Calculation and result\nsize = fudge\nprint ('Size is %d' % size)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Size is 8\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.7, Page number: 178"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.7.py\n# To exit the program based on a specific condition \n\n\n# Variable declaration\nimport sys\nvalue = 1\n\n# Calculation and result\nif (value < 0) :\n sys.exit()\n\nprint ('We did not die')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "We did not die\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.8, Page number: 184"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.8.py\n# To display the square of numbers from 1 to 5 \n\n\n# Function declaration, calculation and result\ndef SQR (x) :\n return x * x\n \nfor counter in range (0, 5) :\n print ('x %d, x squared %d\\n' % (counter + 1, SQR (counter + 1)))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x 1, x squared 1\n\nx 2, x squared 4\n\nx 3, x squared 9\n\nx 4, x squared 16\n\nx 5, x squared 25\n\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.9, Page number: 184"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.9.py\n# To display the square of numbers from 1 to 5 \n\n\n# Variable declaration\ncounter = 0\n\n# Function declaration, calculation and result\ndef SQR (x) :\n return x * x\n \nwhile (counter < 5) :\n print ('x %d square %d\\n' % (counter + 1, SQR (counter + 1)))\n counter += 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "x 1 square 1\n\nx 2 square 4\n\nx 3 square 9\n\nx 4 square 16\n\nx 5 square 25\n\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 10.10, Page number: 185"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 10.10.py\n# To calculate the reciprocal of numbers from 1 to 9\n\n\n# Function declaration, calculation and result\ndef reciprocal (number) :\n return 1 / number\n \nfor counter in range (1, 10) :\n print ('1/%f = %f\\n' % (counter, reciprocal (counter)))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1/1.000000 = 1.000000\n\n1/2.000000 = 0.000000\n\n1/3.000000 = 0.000000\n\n1/4.000000 = 0.000000\n\n1/5.000000 = 0.000000\n\n1/6.000000 = 0.000000\n\n1/7.000000 = 0.000000\n\n1/8.000000 = 0.000000\n\n1/9.000000 = 0.000000\n\n"
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_11_1.ipynb b/Practical_C_Programming/Chapter_11_1.ipynb
new file mode 100644
index 00000000..e3193adb
--- /dev/null
+++ b/Practical_C_Programming/Chapter_11_1.ipynb
@@ -0,0 +1,83 @@
+{
+ "metadata": {
+ "name": "Chapter 11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 11: Bit operations"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 11.1, Page number: 193"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 11.1.py\n# To check whether two numbers are equal to 0 or not\n\n\n# Variable declaration\ni1 = 4\ni2 = 2\n\n# Calculation and result\nif ((i1 != 0) and (i2 != 0)) :\n print ('Both are not zero\\n')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Both are not zero\n\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 11.2, Page number: 201"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 11.2.py\n# To illustrate the use of bitwise and shift operators\n\n\n# Variable declaration\nHIGH_SPEED = 1 << 7\nDIRECT_CONNECT = 1 << 8\n\nflags = 0\nflags |= HIGH_SPEED\nflags |= DIRECT_CONNECT\n\n# Calculation and result\nif ((flags & HIGH_SPEED) != 0) :\n print ('High speed set\\n')\n\nif ((flags & DIRECT_CONNECT) != 0) :\n print ('Direct connect set\\n')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "High speed set\n\nDirect connect set\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 11.4, Page number: 207"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 11.4.py\n# To test a loop counter\n\n\n# Variable declaration\ni = 0x80\n\n# Calculation and result\nif (i != 0) :\n print ('i is %x (%d) \\n' % (i, i))\n i = i >> 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "i is 80 (128) \n\n"
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_12_1.ipynb b/Practical_C_Programming/Chapter_12_1.ipynb
new file mode 100644
index 00000000..b711a066
--- /dev/null
+++ b/Practical_C_Programming/Chapter_12_1.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 12: Advanced types"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 12.1, Page number: 212"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 12.1.py\n# To illustrate the use of a 'union'\n\n\n# Union declaration\nfrom ctypes import *\nclass value (Union) :\n _fields_ = [(\"i_value\", c_int),\n (\"f_value\", c_float)]\n\n# Calculation and result\ndata = value (3, 5.0)\nprint (data.i_value, data.f_value)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "(1084227584, 5.0)\n"
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_13_1.ipynb b/Practical_C_Programming/Chapter_13_1.ipynb
new file mode 100644
index 00000000..95603acb
--- /dev/null
+++ b/Practical_C_Programming/Chapter_13_1.ipynb
@@ -0,0 +1,244 @@
+{
+ "metadata": {
+ "name": "Chapter 13"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 13: Simple pointers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.1, Page number: 225"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.1.py\n# To print the value of 'thing_var' and 'thing_ptr'\n\n\n# Variable declaration\nthing_var = 2\n\n# Calculation and result\nprint ('Thing %d' % thing_var)\n\nthing_ptr = thing_var\nthing_ptr = 3\nprint ('Thing %d' % thing_ptr)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Thing 2\nThing 3\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.2, Page number: 227"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.2.py\n# To loop through the value of 'count' from 1 to 10\n\n\n# Function declaration\ndef inc_count (count_ptr) :\n count_ptr += 1\n return count_ptr\n\n# Calculation and result\ncount = 0\n\nwhile (count < 10) :\n print ('Count %d\\n' % inc_count (count))\n count += 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Count 1\n\nCount 2\n\nCount 3\n\nCount 4\n\nCount 5\n\nCount 6\n\nCount 7\n\nCount 8\n\nCount 9\n\nCount 10\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.3, Page number: 230"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.3.py\n# To print the addresses and elements of a character array\n\n\n# Variable declaration\narray = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n\n# Calculation and result\nprint ('&array[index] (array+index) array[index]\\n')\n\nfor index in range (0, 10) :\n print ('0x%s 0x%s 0x%s\\n' % (id (array[index]), id (array[index]), array[index]))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "&array[index] (array+index) array[index]\n\n0x20916008 0x20916008 0x0\n\n0x20270280 0x20270280 0x1\n\n0x20733728 0x20733728 0x2\n\n0x20916464 0x20916464 0x3\n\n0x20270232 0x20270232 0x4\n\n0x20733560 0x20733560 0x5\n\n0x20270256 0x20270256 0x6\n\n0x20733752 0x20733752 0x7\n\n0x20916512 0x20916512 0x8\n\n0x20916032 0x20916032 0x9\n\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.4, Page number: 232"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.4.py\n# To count the number of elements before zero in an array\n\n\n# Variable declaration\narray = [4, 5, 8, 9, 8, 1, 0, 1, 9, 3]\nindex = 0\n\n# Calculation and result\nwhile (array[index] != 0) :\n index += 1\n\nprint ('Number of elements before zero %d\\n' % index)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Number of elements before zero 6\n\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.5, Page number: 232"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.5.py\n# To count the number of elements before zero in an array\n\n\n# Variable declaration\narray = [4, 5, 8, 9, 8, 1, 0, 1, 9, 3]\nindex = 0\n\n# Calculation and result\nwhile (array[index] != 0) :\n index += 1\n\nprint ('Number of elements before zero %d\\n' % index)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Number of elements before zero 6\n\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.6, Page number: 233"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.6.py\n# To initialize the elements of an array to 0\n\n\n# Variable declaration\ndata = []\n\n# Calculation and result\nfor index in range (0, 10) :\n data.append(0)\nprint (data)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.10, Page number: 238"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.10.py\n# To split a string of the form 'First/Last' into two strings\n\n\n# Variable declaration\nline = 'Steve/Oualline'\n\n# Calculation and result\nfirst_ptr, last_ptr = line.split('/')\nprint ('First: %s Last: %s\\n' % (first_ptr, last_ptr))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "First: Steve Last: Oualline\n\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.11, Page number: 240"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.11.py\n# To return a temporary filename\n\n\n# Function declaration\ndef tmp_name() :\n if not hasattr (tmp_name, 'sequence') :\n tmp_name.sequence = 0\n tmp_name.sequence += 1\n name = 'tmp'\n name += str (tmp_name.sequence)\n return name\n\n# Calculation and result\nprint ('Name: %s\\n' % tmp_name())",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Name: tmp1\n\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.12, Page number: 245"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.12.py\n# To format files for printing\n\n\n# Variable and function declaration\nimport sys\nv_count = sys.argv\ncounter = len(sys.argv)\n\n# Produces verbose messages\nverbose = 0\n\n# Sends output to a file\nout_file = open ('print.out', 'w')\n\n# Sets the number of lines per page\nline_max = 66\n\ndef do_file (name) :\n print ('Verbose %d Lines %d Input %s Output %s\\n' % (verbose, line_max, name, out_file.name))\n\ndef usage() :\n print ('Usage is %s [options] [file-list]\\n' % program_name)\n print ('Options\\n')\n print (' -v verbose\\n')\n print (' -l<number> Number of lines\\n')\n print (' -o<name> Set output filename\\n')\n sys.exit(1)\n \n# Calculation and result\nprogram_name = str (sys.argv[0])\n\nwhile ((counter > 1) and (sys.argv[1][0] == '-')) :\n if (sys.argv[1][1] == 'v') :\n verbose = 1\n break\n\n elif (sys.argv[1][1] == 'o') :\n temp = str (sys.argv[1])\n out_file.write (temp)\n break\n\n elif (sys.argv[1][1] == 'l') :\n line_max = int (sys.argv[1][2])\n break\n\n else :\n print ('Bad option %s\\n' % sys.argv[1])\n usage()\n\n for index in range (0, counter) :\n if (index == counter - 1) :\n break\n else :\n v_count[index] = v_count[index + 1]\n\n counter -= 1\n\nif (counter == 1) :\n do_file ('print.in')\n\nelse :\n while (counter > 1) :\n do_file (sys.argv[1])\n\n for index in range (0, counter) :\n if (index == counter - 1) :\n break\n else :\n v_count[index] = v_count[index + 1]\n \n counter -= 1\n\nout_file.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "1",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\u001b[1;31m:\u001b[0m 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Bad option -f\n\nUsage is -c [options] [file-list]\n\nOptions\n\n -v verbose\n\n -l<number> Number of lines\n\n -o<name> Set output filename\n\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": "To exit: use 'exit', 'quit', or Ctrl-D."
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 13.13, Page number: 248"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 13.13.py\n# To return a new temporary filename\n\n\n# Function declaration\ndef tmp_name() :\n if not hasattr (tmp_name, 'sequence') :\n tmp_name.sequence = 0\n tmp_name.sequence += 1\n name = 'tmp'\n name += str (tmp_name.sequence)\n return name\n\n# Calculation and result\nname1 = tmp_name()\nname2 = tmp_name()\nprint ('Name1: %s\\n' % name1)\nprint ('Name2: %s\\n' % name2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Name1: tmp1\n\nName2: tmp2\n\n"
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_14_1.ipynb b/Practical_C_Programming/Chapter_14_1.ipynb
new file mode 100644
index 00000000..b2876b44
--- /dev/null
+++ b/Practical_C_Programming/Chapter_14_1.ipynb
@@ -0,0 +1,101 @@
+{
+ "metadata": {
+ "name": "Chapter 14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Chapter 14: File input/output"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 14.1, Page number: 253"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 14.1.py\n# To count the number of characters in the file 'input.txt'\n\n\n# Variable declaration\nimport os\ncount = 0\nin_file = open ('input.txt', 'r')\n \n# Calculation and result\nif not os.path.exists ('input.txt') :\n print ('Cannot open input.txt\\n')\n\nwhile (1) :\n ch = in_file.read(1)\n if not ch :\n break\n count += 1\n\nprint ('Number of characters in input.txt is %d\\n' % count)\n\nin_file.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IOError",
+ "evalue": "[Errno 2] No such file or directory: 'input.txt'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-1-038814efe2a7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mcount\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'input.txt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;31m# Calculation and result\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'input.txt'"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 14.3, Page number: 257"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 14.3.py\n# To check whether a file exists or not\n\n\n# Variable declaration\nimport sys\nimport os\nin_file = open ('input.txt', 'r')\n \n# Calculation and result\nif not os.path.exists (name) :\n print ('Could not open file\\n')\n sys.exit(1)\nprint ('File found\\n')\n\nin_file.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IOError",
+ "evalue": "[Errno 2] No such file or directory: 'input.txt'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-2-370dc09ecbc3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'input.txt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;31m# Calculation and result\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'input.txt'"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 14.4, Page number: 260"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 14.4.py\n# To write to a file\n\n\n# Variable declaration\nimport sys\nimport os\nout_file = open ('test.out', 'w')\n \n# Calculation and result\nif not os.path.exists ('test.out') :\n print ('Cannot open output file\\n')\n sys.exit(1)\n\nfor cur_char in range (0, 128) :\n out_file.write(str (cur_char))\n out_file.write('\\n')\n\nout_file.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 14.5, Page number: 267"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 14.5.py\n# To copy the contents of a file to another file\n\n\n# Variable declaration\ntxt_file = open ('input.txt')\n\nsource_content = txt_file.read()\n\ntarget = open ('output.txt', 'w')\n\n# Calculation and result\ntarget.write(source_content)\nprint ('Content copied')\n\ntarget.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_15_1.ipynb b/Practical_C_Programming/Chapter_15_1.ipynb
new file mode 100644
index 00000000..72f7aaee
--- /dev/null
+++ b/Practical_C_Programming/Chapter_15_1.ipynb
@@ -0,0 +1,181 @@
+{
+ "metadata": {
+ "name": "Chapter 15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 15: Debugging and optimization"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 15.1, Page number: 275"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 15.1.py\n# A database program to look up names in a hardcoded list\n\n\n# Function declaration\ndef lookup (name) :\n lists = ['John', 'Jim', 'Jane', 'Clyde']\n result = 0\n\n for index in range (0, 4) :\n if (lists[index] == name) :\n result = 1\n break\n \n return result\n\n# Calculation and result\nname = 'John'\n\nif (lookup (name)) :\n print ('%s is in the list\\n' % name)\nelse :\n print ('%s is not in the list\\n' % name)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "John is in the list\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 15.6, Page number: 288"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 15.6.py\n# To count the number of 3's and 7's in an array\n\n\n# Variable and function declaration\nseven_count = 0\nthree_count = 0\ndata = []\n\ndef get_data (data) :\n for i in range (0, 5) :\n x = 3\n data.append(int(x))\n print (data)\n\n# Calculation\nget_data (data)\nfor index in range (0, 5) :\n if data[index] == 3 :\n three_count += 1\n\n if data[index] == 7 :\n seven_count += 1\n\n# Result\nprint ('Threes %d Sevens %d' % (three_count, seven_count))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[3, 3, 3, 3, 3]\nThrees 5 Sevens 0\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 15.7, Page number: 292"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 15.7.py\n# To perform binary search on a number in a file 'numbers.dat'\n\n\n# Variable declaration\nimport sys\nimport os\nin_file = open ('numbers.dat', 'r')\n\ndata = []\nmax_count = 0\n \n# Calculation and result\nif not os.path.exists ('numbers.dat') :\n print ('Error:Unable to open numbers.dat\\n')\n sys.exit(1)\n\nfor line in in_file :\n data.append(line)\n max_count += 1\n\nwhile (1) :\n search = 6\n \n if (search == -1) :\n break\n\n low = 0\n high = max_count\n\n while (1) :\n mid = (low + high) / 2\n middle = int (mid) \n\n if (int (data[middle]) == search) :\n print ('Found at index %d\\n' % (middle + 1))\n break\n\n if (low == high) :\n print ('Not found\\n')\n break\n\n if (int (data[middle]) < search) :\n low = middle\n else :\n high = middle \n\nin_file.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IOError",
+ "evalue": "[Errno 2] No such file or directory: 'numbers.dat'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-5-ce867c3a4ec5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'numbers.dat'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'numbers.dat'"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 15.8, Page number: 300"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 15.8.py\n# To perform binary search on a number in a file 'numbers.dat'\n\n\n# Variable declaration\nimport sys\nimport os\nin_file = open ('numbers.dat', 'r')\n\ndata = []\nmax_count = 0\n \n# Calculation and result\nif not os.path.exists ('numbers.dat') :\n print ('Error:Unable to open numbers.dat\\n')\n sys.exit(1)\n\nfor line in in_file :\n data.append(line)\n max_count += 1\n\nwhile (1) :\n search = 14\n \n if (search == -1) :\n break\n\n low = 0\n high = max_count\n\n while (1) :\n mid = (low + high) / 2\n middle = int (mid) \n\n if (int (data[middle]) == search) :\n print ('Found at index %d\\n' % (middle + 1))\n break\n\n if (low == high) :\n print ('Not found\\n')\n break\n\n if (int (data[middle]) < search) :\n low = middle\n else :\n high = middle \n\nin_file.close()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "IOError",
+ "evalue": "[Errno 2] No such file or directory: 'numbers.dat'",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-6-8cd3b79f72a3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'numbers.dat'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'numbers.dat'"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 15.10, Page number: 304"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 15.10.py\n# To illustrate divide by zero error\n\n\n# Variable declaration\ni = 1\nj = 0\n\n# Calculation and result\nprint ('Starting\\n')\nprint ('Before divide...')\ni = i / j\nprint ('After\\n')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "ZeroDivisionError",
+ "evalue": "integer division or modulo by zero",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-7-289ff2a55d4d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Starting\\n'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Before divide...'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 12\u001b[1;33m \u001b[0mi\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mj\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 13\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'After\\n'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Starting\n\nBefore divide...\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 15.11, Page number: 304"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 15.11.py\n# To illustrate divide by zero error with flush() function\n\n\n# Variable declaration\nimport sys\ni = 1\nj = 0\n\n# Calculation and result\nprint ('Starting\\n')\nsys.stdout.flush()\nprint ('Before divide...')\nsys.stdout.flush()\ni = i / j\nprint ('After\\n')\nsys.stdout.flush()",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Starting\n\n"
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Before divide...\n"
+ },
+ {
+ "ename": "ZeroDivisionError",
+ "evalue": "integer division or modulo by zero",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-8-eedd2fda3e82>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Before divide...'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 14\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstdout\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mflush\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 15\u001b[1;33m \u001b[0mi\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mj\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 16\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'After\\n'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 17\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstdout\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mflush\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_16_1.ipynb b/Practical_C_Programming/Chapter_16_1.ipynb
new file mode 100644
index 00000000..d1d60ff9
--- /dev/null
+++ b/Practical_C_Programming/Chapter_16_1.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 16"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 16: Floating point"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 16.1, Page number: 322"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 16.1.py\n# To calculate the accuracy of calculations and storage\n\n\n# Variable declaration\nnumber1 = 1.0\nnumber2 = 1.0\ncounter = 0\n\n# Calculation and result\nwhile (number1 + number2 != number1) :\n counter += 1\n number2 = number2 / 10.0\n\nprint ('%2d digits accuracy in calculations\\n' % counter)\n\n\nnumber2 = 1.0\ncounter = 0\n\nresult = number1 + number2\ncounter += 1\nnumber2 = number2 / 10.0\n\nprint ('%2d digits accuracy in storage\\n' % counter)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "16 digits accuracy in calculations\n\n 1 digits accuracy in storage\n\n"
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_17_1.ipynb b/Practical_C_Programming/Chapter_17_1.ipynb
new file mode 100644
index 00000000..c9e7bf83
--- /dev/null
+++ b/Practical_C_Programming/Chapter_17_1.ipynb
@@ -0,0 +1,97 @@
+{
+ "metadata": {
+ "name": "Chapter 17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 17: Advanced Pointers "
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 17.1, Page number: 331"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 17.1\n# To declare a structure\n\n\n# Structure declaration\nfrom ctypes import *\n\nclass person (Structure) :\n_fields_ = [(\"name\", c_wchar_p), (\"address\", c_wchar_p), (\"city_state_zip\", c_wchar_p), (\"age\", c_int), (\"height\", c_float)]",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 17.2, Page number: 336"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 17.2\n# To look for a data item in a list\n\n\n# Function declaration\ndef lookup (name) :\n lists = ['John', 'Jim', 'Jane', 'Clyde']\n result = 0\n\n for index in range (0, 4) :\n if (lists[index] == name) :\n result = 1\n break\n \n return result\n\n# Calculation and result\nname = 'Jane'\n\nif (lookup (name)) :\n print ('%s is in the list\\n' % name)\nelse :\n print ('%s is not in the list\\n' % name)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Jane is in the list\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 17.3, Page number: 338"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 17.3\n# To insert an element at an index in a list\n\n\n# Declaration and result\naList = [45, 89, 123]\n\naList.insert(1, 53)\n\nprint 'Final List : ', aList",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Final List : [45, 53, 89, 123]\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 17.4, Page number: 348"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 17.4\n# To print the contents of a binary search tree in ASCII order\n\n\n# Class declaration\nclass Node:\n def __init__(self, val):\n self.l_child = None\n self.r_child = None\n self.data = val\n\ndef binary_insert(root, node):\n if root is None:\n root = node\n else:\n if root.data > node.data:\n if root.l_child == None:\n root.l_child = node\n else:\n binary_insert(root.l_child, node)\n else:\n if root.r_child == None:\n root.r_child = node\n else:\n binary_insert(root.r_child, node)\n\ndef in_order_print(root):\n if not root:\n return\n in_order_print(root.l_child)\n print root.data\n in_order_print(root.r_child)\n\nr = Node('Lemon')\nbinary_insert(r, Node('Plum'))\nbinary_insert(r, Node('Apple'))\nbinary_insert(r, Node('Orange'))\nbinary_insert(r, Node('Pear'))\nbinary_insert(r, Node('Grape'))\n\n\n# Result\nprint \"List of words in ASCII order:\"\nin_order_print(r)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "List of words in ASCII order:\nApple\nGrape\nLemon\nOrange\nPear\nPlum\n"
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_18_1.ipynb b/Practical_C_Programming/Chapter_18_1.ipynb
new file mode 100644
index 00000000..ac690274
--- /dev/null
+++ b/Practical_C_Programming/Chapter_18_1.ipynb
@@ -0,0 +1,63 @@
+{
+ "metadata": {
+ "name": "Chapter 18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 18: Modular Programming"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 18.2, Page number: 364"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 18.2\n# To create an infinite array\n\n\n# Variable declaration\narray = [1, 2, 3, 4, 5]\narray_size = 10\nnum = 6\n\n# Calculation\nfor index in range (5, 10) :\n array.insert(index, num)\n num = num + 1\n\n# Result\nprint \"Contents of array of size 10 elements is\", array",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Contents of array of size 10 elements is [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 18.3, Page number: 372"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 18.3\n# To plot a histogram of an array of numbers\n\n\n# Calculation\nimport numpy as np \n\n# hist indicates that there are 0 items in bin #0, 2 in bin #1, 4 in bin #3, 1 in bin #4\n# bin_edges indicates that bin #0 is the interval [0,1), bin #1 is [1,2), ..., bin #3 is [3,4)\n\nhist, bin_edges = np.histogram([1, 1, 2, 2, 2, 2, 3], bins = range(5))\n\n\n# Result\nimport matplotlib.pyplot as plt\nplt.bar(bin_edges[:-1], hist, width=1) and plt.xlim(min(bin_edges), max(bin_edges))\nplt.savefig('histogram.png')\n\nfrom IPython.core.display import Image \nImage(filename='histogram.png')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "pyout",
+ "png": "iVBORw0KGgoAAAANSUhEU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GQE\nCAAAkIwAAQAAkhEgAABAMgIEAABIRoAAAADJCBAAACAZAQIAACQjQAAAgGQECAAAkIwAAQAAkhEg\nAABAMgIEAABIRoAAAADJCBAAACAZAQIAACQjQAAAgGQECAAAkIwAAQAAkhEgAABAMgIEAABIRoAA\nAADJCBAAACAZAQIAACQjQAAAgGQECAAAkIwAAQAAkhEgAABAMgIEAABIRoC04Xe/+10UFRXFueee\nG7m5uTFkyJAoLCyMysrKY577+OOPR05OzlG/du7cmWB6AADofvp09QDd2datW+PTTz+N6667LvLz\n86O+vj6qqqrimmuuidra2vjOd75zzMcoKyuLUaNGNVsbNGhQZ40MAADdmgBpw8yZM2PmzJnN1m68\n8caYMGFCPProo+0KkJkzZ0ZBQUFnjQgAAD2KW7A6KCcnJ0aMGBGnn356u47PZrOxd+/eaGxs7OTJ\nAACg+xMg7VBfXx+7d++OP/zhD/Hwww/H888/H4sWLWrXudOmTYtBgwZFbm5uXH755bFly5ZOnhYA\nALovt2C1w6233hqPPvpoRET06dMnli5dGvPmzWvznNzc3Jg7d25MmzYtBg4cGBs3boyHHnooCgsL\no7q6OkaMGJFidAAA6FYESDvccsstUVxcHNu2bYvKysq46aabon///nHttde2ek5RUVEUFRU1/fqy\nyy6L6dOnx5QpU+L++++P5cuXpxgdAAC6FQHSDuedd16cd955ERExZ86cmD59eixYsCCKi4ujf//+\n7X6ciy66KCZNmhTr1q1r87gFCxbE4MGDm62VlpZGaWlpx4cHAOC4rFq1KlatWtVsbc+ePV00zalD\ngByHK6+8Ml588cV4++23Y/z48R06d8SIEVFTU9PmMUuWLPHJWQAAXexofwFcXV0dEyZM6KKJTg3e\nhH4c9u3bFxGHPxGro959990YNmzYyR4JAAB6BAHShl27drVYO3DgQFRUVMSQIUNi3LhxERFRV1cX\nmzdvjoMHD7Z57tq1a6O6ujpmzJjReUMDAEA35hasNsybNy/27t0bU6ZMifz8/Ni+fXtUVlZGTU1N\nlJeXx2mnnRYREXfeeWdUVFREbW1tjBw5MiIiCgs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xoaGqJv374t1vv16xcREfv27eu0\neQEAoDsTIMdw3nnnxXnnnRcREXPmzInp06fHggULori4OPr373/Uc/r37x/79+9vsd7Q0ND0/bYs\nWLAgBg8e3GyttLQ0SktLj+cpAABwHFatWhWrVq1qtrZnz54umubUIUA66Morr4wXX3wx3n777Rg/\nfvxRj8nLyzvqbVZ1dXUREZGfn9/mv2PJkiVHfQ8JAADpHO0vgKurq2PChAldNNGpwXtAOujI7VM5\nOa1fuvHjx0d1dXVks9lm6xs2bIjc3NwYO3Zsp84IAADdlQBpxa5du1qsHThwICoqKmLIkCExbty4\niDj8qsbmzZvj4MGDTcddddVVsWPHjlizZk3T2u7du2P16tUxe/bsY36MLwAAnKrcgtWKefPmxd69\ne2PKlCmRn58f27dvj8rKyqipqYny8vI47bTTIiLizjvvjIqKiqitrY2RI0dGxOEAmTx5csydOzfe\neuutpp+Ens1m47777uvKpwUAAF1KgLTi6quvjh/+8IexfPny+Oijj2LgwIExadKkWLZsWXzta19r\nOi6TyUQmk2l2bk5OTqxduzYWLlwYS5cujX379sWFF14YFRUVMWbMmNRPBQAAug0B0oqSkpIoKSk5\n5nHl5eVRXl7eYn3w4MGxYsWKWLFiRWeMBwAAPZL3gAAAAMkIEAAAIBkBAgAAJCNAAACAZAQIAACQ\njAABAACSESAAAEAyAgQAAEhGgAAAAMkIEAAAIBkBAgAAJCNAAACAZAQIAACQjAABAACSESAAAEAy\nAgQAAEhGgAAAAMkIEAAAIBkBAgAAJCNAAACAZAQIAACQjAABAACSESAAAEAyAgQAAEhGgAAAAMkI\nEAAAIBkBAgAAJCNAAACAZAQIAACQjAABAACSESAAAEAyAgQAAEhGgAAAAMkIEAAAIBkBAgAAJCNA\nAACAZAQIAACQjAABAACSESAAAEAyAgQAAEhGgAAAAMkIEAAAIBkBAgAAJCNAAACAZAQIAACQjAAB\nAACSESBteP311+Omm26KcePGxYABA+Kcc86JkpKSeOedd4557uOPPx45OTlH/dq5c2eC6QEAoPvp\n09UDdGcPPPBArF+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y1jjm819r6syBtEyCt6N+/f+zfv7/F+pFI6N+//0k/97333ouIiOXLl3d4XiLuueeerh6h\nB3LNjs+crh6gB7LXjo+91nH22vGx1zqqtrY2Lrrooq4eo0cSIK3Iy8s76q1SdXV1ERFtvkJxvOdO\nnz49nnzyyfjc5z7XZuAAANA1Ghoa4r333ovp06d39Sg9lgBpxQUXXBAvv/xy7N27N/7mb/6maX3D\nhg0RETF+/PhWzx0/fny88sorkc1mI5PJNDs3Nzc3xo4de9Tzhg4dGt/4xjdO0jMAAKAzFBYWdvUI\nPZo3obfiqquuisbGxnj00Ueb1vbv3x/l5eUxefLkOPvssyMiYvv27bF58+Y4ePBgs3N37NgRa9as\naVrbvXt3rF69OmbPnh2nn356uicCAADdSCabzWa7eojuqqSkJJ5++um45ZZb4txzz42VK1fGxo0b\n42c/+1lcfPHFEXH4p6VXVFREbW1tjBw5MiIO/yT0iy++OH7729/GwoULY8iQIfHII4/EBx98EK+/\n/nqMGTOmK58WAAB0GbdgtaGioiLuueeeeOKJJ+Ljjz+Or3zlK/HTn/60KT4iIjKZTLPbrCIicnJy\nYu3atbFw4cJYunRp7Nu3Ly688MKoqKgQHwAA9GpuwWpD375948EHH4xt27bFvn374rXXXouvf/3r\nzY4pLy+PxsbGplc/jhg8eHCsWLEidu3aFR999FFMnDgx/vEf/zE+85nPxOTJk2PdunXtmmHPnj0x\nb968GDZsWAwYMCAuueSS2LRp00l7jt3Z/v374/bbb4/8/PwOXbfHH388cnJyjvq1c+fOBJN3jT/9\n6U+xePHimDFjRnz2s5+NnJycWLlyZbvP76177USuW2/da6+//nrcdNNNMW7cuBgwYECcc845UVJS\nEu+88067zu+te+1Erltv3Wu/+93voqioKM4999zIzc2NIUOGRGFhYVRWtu8jY3vrXjuR69Zb99rR\n3H///ZGTkxPnn39+u47vrfvteHgFJIHrrrsunnrqqbjllltizJgxUV5eHpdeemm89NJLbX5826FD\nh2LWrFnx5ptvxqJFi5pu5Zo6dWq88cYbMXr06ITPIr3jvW5HlJWVxahRo5qtDRo0qLPG7XK7du2K\nsrKyOOecc2L8+PHx8ssvt3h1rjW9ea+dyHU7orfttQceeCDWr18fRUVF8eUvfznq6upi2bJlUVBQ\nEK+99lqMGzeu1XN78147ket2RG/ba1u3bo1PP/00rrvuusjPz4/6+vqoqqqKa665Jmpra+M73/lO\nq+f25r12ItftiN621/7aBx98EP/6r/8aubm57fr/hN68345Llk61YcOGbCaTyX7/+99vWmtoaMiO\nHj06W1hY2Oa5P/rRj7KZTCb71FNPNa3t2rUre+aZZ2b/+Z//udNm7g5O5LqVl5dnM5lM9o033ujs\nMbuV/fv3Z3fs2JHNZrPZjRs3ZjOZTHblypXtOrc377UTuW69da/993//d/bAgQPN1t55551sv379\nsnPmzGnz3N68107kuvXWvXY0jY2N2fHjx2dHjhzZ5nG9ea8dTXuvm712WElJSfbv//7vs1OnTs1+\n6UtfOubx9lvHuAWrk1VVVUWfPn1i3rx5TWt9+/aN66+/PtavXx8ffvhhm+cOHz48rrjiiqa1oUOH\nRnFxcTzzzDNx4MCBTp29K53IdTsim83G3r17o7GxsTNH7TbOOOOMOOussyLi8HPviN68107kuh3R\n2/baV7/61ejTp/kL6KNHj44vfvGLsXnz5jbP7c177USu2xG9ba8dTU5OTowYMeKYnyjZm/fa0bT3\nuh3Rm/faL37xi3jqqadiyZIlLX6kQmvst44RIJ1s06ZNMXbs2BgwYECz9YkTJ0ZExK9+9as2zy0o\nKGixPnHixKivr4+ampqTO2w3ciLX7Yhp06bFoEGDIjc3Ny6//PLYsmVLp8x6KujNe+1ksNcO/2Fl\nx44dMXTo0DaPs9eaa+91O6K37rX6+vrYvXt3/OEPf4iHH344nn/++Vi0aFGb59hrx3fdjuite62x\nsTFuvvnm+Pa3v92u2yKPsN86xntAOlldXV3k5eW1WD+ydrSfmP5/z506dWqb53bkP46e5ESuW25u\nbsydOzemTZsWAwcOjI0bN8ZDDz0UhYWFUV1dHSNGjOi0uXuq3rzXToS99heVlZWxbdu2+O53v9vm\ncfZac+29br19r916661NP5erT58+sXTp0mavkB+NvXZ8162377Uf/OAHsXXr1vj5z3/eofPst44R\nIJ1s37590bdv3xbr/fr1a/p+axoaGo773J7uRK5bUVFRFBUVNf36sssui+nTp8eUKVPi/vvvj+XL\nl5/8gXu43rzXToS9dtjmzZvjxhtvjMLCwrj22mvbPNZe+4uOXLfevtduueWWKC4ujm3btkVlZWXc\ndNNN0b9//zavm712fNetN++1jz76KO6999649957Y8iQIR06137rGAHSyfr37x/79+9vsd7Q0ND0\n/c44t6c72c/9oosuikmTJrX74497m96810623rbXtm/fHrNmzYozzzwzqqqqjnmvtL12WEev29H0\npr123nnnxXnnnRcREXPmzInp06fHggULori4uNU9Y68d33U7mt6y1+6+++4YOnRo3HzzzR0+137r\nGO8B6WR5eXlHvV2orq4uIiLy8/M75dyerjOe+4gRI+Ljjz8+4dlORb15r3WG3rLXPvnkk5g5c2b8\n8Y9/jP/6r/+K4cOHH/Mce+34rltreste+2tXXnllfPLJJ/H222+3eoy91lJ7rltrTvW99s4778SK\nFSvi5ptvjg8++CBqa2ujtrY2Ghoa4s9//nO8//77bT5/+61jBEgnu+CCC6Kmpib27t3bbH3Dhg0R\nETF+/PhWzx0/fnxUV1e3+GSeDRs2RG5ubowdO/bkD9xNnMh1a827774bw4YNOynznWp6817rDL1h\nrzU0NMTs2bNjy5Yt8dOf/jQ+//nPt+u83r7Xjve6taY37LWjOXI7S05O63+M6e177Wjac91ac6rv\ntQ8//DAOHToU8+fPj7/9279t+vrlL38ZNTU1MWrUqCgrK2v1fPutYwRIJ7vqqquisbGx6U1gEYd/\nwnd5eXlMnjw5zj777Ig4/HL85s2b4+DBg83O3bFjR6xZs6Zpbffu3bF69eqYPXt2uz9Kryc6keu2\na9euFo+3du3aqK6ujhkzZnT+8N2cvXZ87LW/aGxsjJKSktiwYUOsXr06Jk2adNTj7LXmTuS69da9\ndrTnfeDAgaioqIghQ4Y0vam3rq7OXvs/TuS69da9dv7558fTTz8dP/7xj5u+nn766Rg3blycc845\n8eMf/ziuv/76iLDfToZM9ng/+J52KykpiaeffjpuueWWOPfcc2PlypWxcePG+NnPfhYXX3xxRBz+\nqd8VFRVRW1sbI0eOjIjDP1Xz4osvjt/+9rexcOHCpp+q+cEHH8Trr78eY8aM6cqn1emO97qNGTMm\nCgoKYsKECTFo0KCorq6Oxx57LM4+++x4/fXXT+m/wVm2bFns2bMntm3bFj/4wQ/iiiuuaHq1aP78\n+TFw4EB77SiO97r11r22YMGCWLp0acyePbvZm1WPmDNnTkT4fe2vnch166177Z/+6Z9i7969MWXK\nlMjPz4/t27dHZWVl1NTURHl5eXzzm9+MCHvtr53Ideute601U6dOjY8++ih+85vfNK3ZbydB+p99\n2Ps0NDRkFy5cmM3Ly8v269cvO2nSpOwLL7zQ7Jjrrrsum5OTk33//febrX/88cfZb33rW9mhQ4dm\nc3Nzs9OmTes1P530eK/b3Xffnb3ggguygwcPzp5xxhnZz33uc9kbb7wxu3PnztRPIbnPfe5z2Uwm\nk81kMtmcnJxsTk5O0z8fuUb2WkvHe916616bOnVq0zX666+cnJym4+y15k7kuvXWvfYf//Ef2a9/\n/evZ4cOHZ08//fTskCFDspdeeml23bp1zY6z15o7kevWW/daa6ZOnZo9//zzm63ZbyfOKyAAAEAy\n3gMCAAAkI0AAAIBkBAgAAJCMAAEAAJIRIAAAQDICBAAASEaAAAAAyQgQAAAgGQECAAAkI0AAAIBk\nBAgAAJCMAAEAAJIRIAAAQDICBAAASEaAAAAAyQgQAAAgGQECAAAkI0AAAIBkBAgAAJCMAAEAAJIR\nIAAAQDICBAAASEaAAAAAyQgQAAAgGQECAAAkI0AAAIBkBAgAAJCMAAEAAJIRIAAAQDICBAAASEaA\nAAAAyQgQAAAgGQECAAAkI0AAAIBkBAgAAJCMAAEAAJIRIAAAQDICBAAASEaAAAAAyQgQAAAgmf8P\npDpIO5V4wm8AAAAASUVORK5CYII=\n",
+ "prompt_number": 5,
+ "text": "<IPython.core.display.Image at 0x5a46130>"
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_19_1.ipynb b/Practical_C_Programming/Chapter_19_1.ipynb
new file mode 100644
index 00000000..f02444d9
--- /dev/null
+++ b/Practical_C_Programming/Chapter_19_1.ipynb
@@ -0,0 +1,125 @@
+{
+ "metadata": {
+ "name": "Chapter 19"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 19: Ancient compilers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 19.1, Page number: 385"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 19.1.py\n# To calculate the area of a rectangle\n\n\n# Function declaration\ndef area (width, height) :\n return width * height\n\n# Calculation and result\nsize = area (3.0, 2)\nprint ('Area is %f\\n' % size)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Area is 6.000000\n\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 19.2, Page number: 386"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 19.2.py\n# To calculate the square of a number\n\n\n# Function declaration\ndef square (s) :\n return s * s\n\n# Calculation and result\ni = square (5)\nprint ('i is %d\\n' % i)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "i is 25\n\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 19.3, Page number: 386"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 19.3.py\n# To calculate the sum of 3 numbers\n\n\n# Function declaration\ndef sum (i1, i2, i3) :\n return i1 + i2 + i3\n\n# Calculation and result\nprint ('Sum is %d\\n' % sum (1, 2, 3))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Sum is 6\n\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 19.4, Page number: 387"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 19.4.py\n# To print the full name of a person\n\n\n# Variable declaration\nfirst = 'John'\nlast = 'Doe'\n\n# Calculation and result\nfull = first + ' ' + last\nprint ('The name is %s\\n' % full)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The name is John Doe\n\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 19.5, Page number: 390"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 19.5.py\n# To calculate the area of a rectangle\n\n\n# Function declaration\ndef area (width, height) :\n return width * height\n\n# Calculation and result\nsize = area (3.0, 2.0)\nprint ('Area is %f\\n' % size)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Area is 6.000000\n\n"
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_21_1.ipynb b/Practical_C_Programming/Chapter_21_1.ipynb
new file mode 100644
index 00000000..8d3e6b65
--- /dev/null
+++ b/Practical_C_Programming/Chapter_21_1.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 21"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 21: C's dustier corners"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 21.1, Page number: 401"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 21.1.py\n# To check whether the character input by the user is for 'add', 'delete' or 'quit'\n\n\n# Variable declaration\nimport sys\nline = 'a'\n\n# Calculation and result\nif (line == 'a') :\n print ('Add\\n')\nelif (line == 'd') :\n print ('Delete\\n')\nelif (line == 'q') :\n print ('Quit\\n')\n sys.exit(1) \nelse :\n print ('Error:Bad command %c\\n' % line)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Add\n\n"
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_23_1.ipynb b/Practical_C_Programming/Chapter_23_1.ipynb
new file mode 100644
index 00000000..065813d7
--- /dev/null
+++ b/Practical_C_Programming/Chapter_23_1.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 23"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 23: Programming adages"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 23.1, Page number: 447"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 23.1.py\n# To check whether the number input by the user is 2 or not\n\n\n# Variable declaration\nnumber = 2\n\n# Calculation and result\nif (number != 2) :\n print ('Number is not two\\n')\nelse :\n print ('Number is two\\n')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Number is two\n\n"
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_2_3.ipynb b/Practical_C_Programming/Chapter_2_3.ipynb
new file mode 100644
index 00000000..f981ce8e
--- /dev/null
+++ b/Practical_C_Programming/Chapter_2_3.ipynb
@@ -0,0 +1,1156 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:. Convective Mass Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1,Page number94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.1\n",
+ "#Mass-Transfer Coefficients in a Blood Oxygenator\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "\t# a-oxygen b-stagnant water\n",
+ "T = 310 \t\t\t\t\t# [K]\n",
+ "\t# Since the solubility of oxygen in water at 310 K is extremely low, we are dealing with \tdilute solutions\n",
+ "k_L = 3.3*10**-5 \t\t\t\t# [coefficient based on the oxygen concentration \t\t\t\t\t\tdifference in the water, m/s]\n",
+ "row = 993 \t\t\t\t\t# [kg/cubic m]\n",
+ "M_b = 18 \t\t\t\t\t# [gram/mole]\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ " \n",
+ "\t# Since we are dealing with very dilute solutions\n",
+ "\t# Therefore, c = (row/M_avg) = row/M_b\n",
+ "c = row/M_b \t\t\t\t\t# [kmole/cubic m]\n",
+ "\t# Using equation 2.10\n",
+ "k_x = k_L*c \t\t\t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"The mass-transfer coefficient based on the mole fraction of oxygen in the liquid is\",round(k_x,5),\" kmole/square m.s\" \n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass-transfer coefficient based on the mole fraction of oxygen in the liquid is 0.00182 kmole/square m.s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2,Page number:95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.2\n",
+ "#Mass-Transfer Coefficient in a Gas Absorber\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "\t# a-ammonia b-air\n",
+ "T = 300 \t\t\t\t\t# [K]\n",
+ "P = 1 \t\t\t\t\t\t# [atm]\n",
+ "y_a1 = 0.8 \t\t\t\t\t# [ammonia mole fraction in the bulk of the gas \t\t\t\t\t\t\tphase]\n",
+ "y_a2 = 0.732 \t\t\t\t\t# [ammonia gas-phase mole fraction on interface]\n",
+ "N_a = 4.3*10**-4 \t\t\t\t# [ammonia flux, kmole/square m.s]\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "import math\n",
+ "\t# Using equation 2.2\n",
+ "F_g = N_a/math.log10((1-y_a2)/(1-y_a1)) \t\t# [kmole/square m.s]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"The mass-transfer coefficient in the gas phase at that point where flux is 4.3*10**-4 is\",round(F_g,5),\" kmole/square m.s\"\n",
+ "print\"\\n\\nNOTE:Calculation mistake in book:\\nAnswer written as 1.47*10^-4,Actually,,...it is 1.47*10^-3.Please REDO last calculation manually to check\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass-transfer coefficient in the gas phase at that point where flux is 4.3*10**-4 is 0.00338 kmole/square m.s\n",
+ "\n",
+ "\n",
+ "NOTE:Calculation mistake in book:\n",
+ "Answer written as 1.47*10^-4,Actually,,...it is 1.47*10^-3.Please REDO last calculation manually to check\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3,Page number:96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.3\n",
+ "#Mass-Transfer Coefficient in a Packed-Bed Distillation Column\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "\t\t# a-methanol b-water\n",
+ "P = 101.3 \t\t\t\t\t\t# [kPa]\n",
+ "y_a1 = 0.707 \t\t\t\t\t\t# [mole fraction at interface]\n",
+ "y_a2 = 0.656 \t\t\t\t\t\t# [mole fraction at bulk of the gas]\n",
+ "k_g = 1.62*10**-5 \t\t\t\t\t# [mass-transfer coefficient at a point \t\t\t\t\t\t\t in the column, kmole/square m.s.kPa]\n",
+ "#Calculations\n",
+ "\n",
+ "\t# Using equation 2.14\n",
+ "k_y = k_g*P \t\t\t\t\t\t# [kmole/square m.s]\n",
+ "\t# Using equation 2.12\n",
+ "N_a = k_y*(y_a1-y_a2) \t\t\t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"The methanol flux at the point of given mass transfer coefficient is\",round(N_a,7),\"kmole/square m.s\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The methanol flux at the point of given mass transfer coefficient is 8.37e-05 kmole/square m.s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4,Page number:99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.4\n",
+ "# Mass Transfer into a Dilute Stream Flowing Under Forced Convection in a Circular Conduit\n",
+ "\n",
+ "n = 6 # [number of variables]\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "from numpy import *\n",
+ "import math\n",
+ "# To determine the number of dimensionless parameters to be formed, we must know the rank, r, of the dimensional matrix.\n",
+ "# The dimensional matrix is \n",
+ "DM =matrix([[0,0,1,1,0,0],[1,1,-3,-1,2,1],[-1,-1,0,0,-1,-1]]) \n",
+ "rk= linalg.matrix_rank(DM)\n",
+ "print\"Rank of matrix is \",rk \n",
+ "\n",
+ "#The numbers in the table represent the exponent of M, L, and t in the dimensional expression of each of the six variables involved. For example, the dimensional expression of p is M/Lt hence the exponents are 1, -1, and -1\n",
+ "\n",
+ "# From equation 2.16\n",
+ "i = n-rk # [number of dimensional groups]\n",
+ "# Let the dimensional groups are pi1, pi2 and pi3\n",
+ "# Therefore pi1 = (D_AB)**a*(row)**b*(D)**c*kc\n",
+ "# pi2 = (D_AB)**d*(row)**e*(D)**f*v\n",
+ "# pi3 = (D_AB)**g*(row)**h*(D)**i*u\n",
+ "\n",
+ "# Solving for pi1\n",
+ "# M**0*L**0*t**0 = 1 = (L**2/t)**a*(M/L**3)**b*(L)**c*(L/t)\n",
+ "\n",
+ "# Solution of simultaneous equation\n",
+ "def F(e):\n",
+ " f1 = 2*e[0]-3*e[1]+e[2]+1 \n",
+ " f2 = -e[0]-1 \n",
+ " f3 = -e[1] \n",
+ " return(f1,f2,f3)\n",
+ "\n",
+ "\n",
+ "# Initial guess:\n",
+ "e = [0.1,0.8,0.5] \n",
+ "y = fsolve(F,e) \n",
+ "a = y[0] \n",
+ "b = y[1] \n",
+ "c = y[2] \n",
+ "print\"The coefficients of pi1 are\",a,round(b),c \n",
+ "# Similarly the coefficients of pi2 and pi3 are calculated\n",
+ "# Therefore we get pi1 = kc*D/D_AB = Sh i.e. Sherwood Number\n",
+ "# pi2 = v*D/D_AB = P_ed i.e. Peclet Number\n",
+ "# pi3 = u/(row*D_AB) = Sc i.e. Schmidt Number\n",
+ "\n",
+ "# Dividing pi2 by pi3 gives\n",
+ "# pi2/pi3 = D*v*row/u = Re i.e. Renoylds number\n",
+ "\n",
+ "print\"The result of the dimensional analysis of forced-convection mass transfer in a circular conduit indicates that a correlating relation could be of the form\\n Sh = function(Re,Sc)\\n which is analogous to the heat transfer correlation \\n Nu = function(Re,Pr)\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rank of matrix is 3\n",
+ "The coefficients of pi1 are -1.0 0.0 1.0\n",
+ "The result of the dimensional analysis of forced-convection mass transfer in a circular conduit indicates that a correlating relation could be of the form\n",
+ " Sh = function(Re,Sc)\n",
+ " which is analogous to the heat transfer correlation \n",
+ " Nu = function(Re,Pr)\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6,Page number:111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.6\n",
+ "#Mass Transfer to Fluid Flow Normal to a Cylinder\n",
+ "\n",
+ "#Variable declaration\n",
+ "\t# a-UF6 b-air\n",
+ "M_a = 352 \t\t\t\t\t# [molecular weight of UF6, gram/mole]\n",
+ "M_b = 29 \t\t\t\t\t# [gram/mole]\n",
+ "d = 0.01 \t\t\t\t\t# [diameter, m]\n",
+ "x = 0.1 \t\t\t\t\t# [length exposed to air stream, m]\n",
+ "v = 1 \t\t\t\t\t\t# [m/s]\n",
+ "Ts = 303 \t\t\t\t\t# [surface temperature of solid, K]\n",
+ "P_a = 27 \t\t\t\t\t# [vapor pressure of UF6, kPa]\n",
+ "Tb = 325 \t\t\t\t\t# [bulk temperature of solid ,K]\n",
+ "P = 101.3 \t\t\t\t\t# [kPa]\n",
+ "R = 8.314 \t\t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "import math\n",
+ "\n",
+ "y_a1 = P_a/P \t\t\t\t\t# [mole fraction at point 1]\n",
+ "y_a2 = 0 \t\t\t\t\t# [mole fraction at point 2]\n",
+ "\n",
+ "\t# Along the mass-transfer path-cylinder surface (point 1) to bulk air (point 2)\n",
+ "Tavg = (Ts+Tb)/2 \t\t\t\t# [K]\n",
+ "\n",
+ "\t# At point 1, the gas is saturated with UF6 vapor, while at point 2 the gas is virtually \tfree of UF6\n",
+ "\t# Therefore\n",
+ "Pavg = (P_a+0)/2 \t\t\t\t# [average partial pressure, kPa]\n",
+ "y_a = Pavg/P \t\t\t\t\t# [mole fraction of UF6]\n",
+ "\n",
+ "Mavg = M_a*y_a+M_b*(1-y_a) \t\t\t# [gram/mole]\n",
+ "row_avg = P*Mavg/(R*Tavg) \t\t\t# [kg/cubic m]\n",
+ "\n",
+ "\t# Parameter for c-O2, d-N2 and a-UF6\n",
+ "yi_c = 0.182 \n",
+ "yi_d = 0.685 \n",
+ "yi_a = 0.133 \n",
+ "Tc_c = 154.6 \t\t\t\t# [K]\n",
+ "Tc_d = 126.2 \t\t\t\t\t# [K]\n",
+ "Tc_a = 505.8 \t\t\t\t\t# [K]\n",
+ "Pc_c = 50.4 \t\t\t\t\t# [bar]\n",
+ "Pc_d = 33.9 \t\t\t\t\t# [bar] \n",
+ "Pc_a = 46.6 \t\t\t\t\t# [bar]\n",
+ "M_c = 32 \t\t\t\t# [gram/mole]\n",
+ "M_d = 28 \t\t\t\t\t# [gram/mole] \n",
+ "M_a = 352 \t\t\t\t\t# [gram/mole]\n",
+ "V_c = 73.4 \t\t\t\t# [cubic cm/mole]\n",
+ "V_d = 89.8 \t\t\t\t\t# [cubic cm/mole]\n",
+ "V_a = 250 \t\t\t\t\t# [cubic cm/mole]\n",
+ "Z_c = 0.288 \n",
+ "Z_d = 0.290 \n",
+ "Z_a = 0.277 \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "\n",
+ "\t# From equation 2.52 and 2.53\n",
+ "Tcm = yi_c*Tc_c+yi_d*Tc_d+yi_a*Tc_a \t\t# [K]\n",
+ "Pcm = 10**6*R*Tcm*(yi_c*Z_c+yi_d*Z_d+yi_a*Z_a)/((yi_c*V_c+yi_d*V_d+yi_a*V_a)*100000) \t# [bar]\n",
+ "M_avg = yi_c*M_c+yi_d*M_d+yi_a*M_a \t\t# [gram/mole]\n",
+ "\n",
+ "\t# From equation 2.50\n",
+ "Em = 0.176*(Tcm/(M_avg**3*Pcm**4))**(1.0/6.0) \t# [uP]**-1\n",
+ "\n",
+ "\t# From equation 2.51\n",
+ "Trm = Tavg/Tcm \n",
+ "f_Trm = (0.807*Trm**0.618)-(0.357*math.exp(-0.449*Trm))+(0.340*math.exp(-4.058*Trm))+0.018 \n",
+ "\t# From equation 2.49 \n",
+ "u = f_Trm/Em \t\t\t\t\t\t# [uP]\n",
+ "u = u*10**-7 \t\t\t\t\t\t# [viscosity, kg/m.s]\n",
+ "\n",
+ "Re = d*v*row_avg/u \t\t\t\t\t# [Renoylds number]\n",
+ "\n",
+ "\t\t# Diffusivity of UF6 vapors in air at 314 K and 1 atm from equation 1.49\n",
+ "D_ab = 0.0904 \t\t\t\t\t\t# [square cm/s]\n",
+ "\n",
+ "Sc = u/(row_avg*D_ab*10**-4) \t\t\t\t# [Schmidt number]\n",
+ "\n",
+ "Sh_avg = 0.43 + 0.532*Re**0.5*Sc**0.31 \t\t# [Sherwood number]\n",
+ "\t\t# From equation 1.7\n",
+ "c = P/(R*Tavg) \t\t\t\t\t# [kmole/cubic m]\n",
+ "\t\t# From Table 2.1 \n",
+ "F_av = Sh_avg*D_ab*c*10**-4/d \t\t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "\t\t# From equation 2.2\n",
+ "N_avg = F_av*math.log((1-y_a2)/(1-y_a1)) \t\t# [kmole/square m.s]\n",
+ "S = 2*math.pi*d**2/4 +math.pi*d*x \t\t\t# [total surface area of the cylinder, \t\t\t\t\t\t\tsquare m]\n",
+ "\n",
+ "w_a = N_avg*S*M_a \t\t\t\t\t# [rate of sublimation of the solid, \t\t\t\t\t\t\tkg/s] \n",
+ "\n",
+ "#Result\n",
+ "print\"Rate of sublimation of a cylinder of UF6 is\",round(w_a,5),\"kg/s\\n\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of sublimation of a cylinder of UF6 is 0.00023 kg/s\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7,Page number:116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.7\n",
+ "# The Chilton-Colburn Analogy\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "\n",
+ "\t# a-benzene b-nitrogen\n",
+ "T = 300 \t\t\t\t\t# [K]\n",
+ "P = 101.3 \t\t\t\t\t# [kPa]\n",
+ "v =10 \t\t\t\t\t\t# [m/s]\n",
+ "R = 8.314 \t\t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "\n",
+ "\n",
+ "n = -0.5 \n",
+ "\t# Data on the properties of C02 at 300 K and 1 bar\n",
+ "u = 1.5*10**-5 \t\t\t\t# [viscosity, P]\n",
+ "Pr = 0.77 \t\t\t\t\t# [Prandtl number]\n",
+ "Cp = 853 \t\t\t\t\t# [J/kg.K]\n",
+ "\t# Therefore\n",
+ "\t# b = 5.086*l**0.5\n",
+ "\t# j_D = j_H = f(Re) = 5.086*(l**0.5)*Re**-0.5\n",
+ "\t# From Table 2.1\n",
+ "\t# F = j_D*c*v/Sc**(2/3) = 5.086*(l**0.5)*c*v/(Re**0.5*Sc**(2/3)) = \t\t5.086*(row*v*u)**0.5/(Mavg*Sc**(2.0/3.0))\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "\t# Vapor pressure of benzene\n",
+ "P_a = math.exp(15.9008-(2788.51/(T-52.36))) \t# [mm of Hg]\n",
+ "P_a = P_a*101.3/760 \t\t\t\t\t# [kPa]\n",
+ "\n",
+ "\t# Parameter for a-benzene, b-nitrogen \n",
+ "yi_a = 0.07 \n",
+ "yi_b = 0.93 \n",
+ "Tc_a = 562.2 \n",
+ "Tc_b = 126.2 \t\t\t\t\t\t# [K]\n",
+ "Pc_a = 48.9 \n",
+ "Pc_b = 33.9 \t\t\t\t\t\t# [bar]\n",
+ "M_a = 78.1 \n",
+ "M_b = 28 \t\t\t\t\t\t# [gram/mole]\n",
+ "V_a = 259 \n",
+ "V_b = 89.8 \t\t\t\t\t\t# [cubic cm/mole]\n",
+ "Z_a = 0.271 \n",
+ "Z_b = 0.290 \n",
+ "sigma_a = 5.349 \n",
+ "sigma_b = 3.798 \t\t\t\t\t# [Angstrom]\n",
+ "ek_a = 412.3 \n",
+ "ek_b = 71.4 \t\t\t\t\t\t# [E/k, K]\n",
+ "\n",
+ "\n",
+ "\t# From equation 2.52 and 2.53\n",
+ "Tcm = yi_b*Tc_b+yi_a*Tc_a \t\t\t\t# [K]\n",
+ "Pcm = 10**6*R*Tcm*(yi_b*Z_b+yi_a*Z_a)/((yi_b*V_b+yi_a*V_a)*100000) \t # [bar]\n",
+ "M_avg = yi_b*M_b+yi_a*M_a \t\t\t\t\t\t# [kg/kmole]\n",
+ "\n",
+ "#RESULT\n",
+ "\n",
+ "print\"Average molecular weight is\",round(M_avg,1),\"kg/kmole\" \n",
+ "\n",
+ "row = P*M_avg/(R*T) \t\t\t\t\t\t\t# [kg/cubic m]\n",
+ "\n",
+ "#RESULT\n",
+ "\n",
+ "print\"Density of mixture is\",round(row,2),\"kg/cubic\"\n",
+ "\t# From equation 2.50\n",
+ "Em = 0.176*(Tcm/(M_avg**3*Pcm**4))**(1.0/6.0) \t\t\t# [uP]**-1\n",
+ "\n",
+ "\t# From equation 2.51\n",
+ "Trm = T/Tcm \n",
+ "f_Trm = (0.807*Trm**0.618)-(0.357*math.exp(-0.449*Trm))+(0.340*math.exp(-4.058*Trm))+0.018 \n",
+ "\t# From equation 2.49 \n",
+ "u = f_Trm/Em \t\t\t\t\t\t\t\t# [uP]\n",
+ "u = u*10**-7 \t\t\t\t\t\t\t\t# [viscosity, kg/m.s]\n",
+ "print\"Average viscosity of mixture is \",round(u,7),\"kg/m.s\\n\\n\" \n",
+ "\n",
+ "\t# Calculating diffusivity of benzene using equation 1.49\n",
+ "D_ab = 0.0986 \t\t\t\t\t\t\t\t# [square cm/s]\n",
+ "Sc = u/(row*D_ab*10**-4) \t\t\t\t\t\t# [Schmidt number]\n",
+ "\n",
+ "F = 5.086*(row*v*u)**0.5/(M_avg*Sc**(2.0/3.0)) \t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "\n",
+ "#RESULT\n",
+ "\n",
+ "print\"The required mass transfer coefficient is\",round(F,5),\"kmole/square m.s\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average molecular weight is 31.5 kg/kmole\n",
+ "Density of mixture is 1.28 kg/cubic\n",
+ "Average viscosity of mixture is 1.64e-05 kg/m.s\n",
+ "\n",
+ "\n",
+ "The required mass transfer coefficient is 0.00196 kmole/square m.s\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8,Page number:120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Illustration 2.8\n",
+ "#Benzene Evaporation Along a Vertical Flat Plate\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "\t# a-liquid benzene b-nitrogen\n",
+ "T = 300 \t\t\t\t\t\t# [K]\n",
+ "l = 3 \t\t\t\t\t\t\t# [length of vertical plate, m]\n",
+ "b = 1.5 \t\t\t\t\t\t# [width of vertical plate, m]\n",
+ "P = 101.3 \t\t\t\t\t\t# [kPa]\n",
+ "v = 5 \t\t\t\t\t\t\t# [velocity across the width of plate, \t\t\t\t\t\t\tm/s]\n",
+ "row_a = 0.88 \t\t\t\t\t\t# [gram/cubic cm]\n",
+ "\n",
+ "\n",
+ "y_a1 = 0.139 \t\t\t\t\t\t# [mole fraction of benzene at inner \t\t\t\t\t\t\tedge]\n",
+ "y_a2 = 0 \n",
+ "\n",
+ "\t# The film conditions, and average properties, are identical to those in Example 2.7, \tonly the geometry is different\n",
+ "\t# Therefore\n",
+ "M_avg = 31.4 \t\t\t\t\t\t# [kg/kmole]\n",
+ "row = 1.2 \t\t\t\t\t\t# [kg/cubic m]\n",
+ "u = 161*10**-7 \t\t\t\t\t# [kg/m.s]\n",
+ "D_ab = 0.0986 \t\t \t\t\t\t# [square cm/s]\n",
+ "Sc = 1.3 \t\t\t\t\t\t# [Schmidt Number]\n",
+ "Re = row*v*b/u \t\t\t\t\t# [Renoylds Number]\n",
+ "\n",
+ "if Re > 4000:\n",
+ " print\"The flow across the plate is turbulent\\n\" \n",
+ "elif Re<2000:\n",
+ " print\"The flow across the plate is laminar\\n\" \n",
+ "\t#Using equation 2.57\n",
+ "Sh_l = 0.036*Re**0.8*Sc**(1.0/3.0) \n",
+ "\n",
+ "\t# Nitrogen (component B) does not react with benzene (component A), neither dissolves in \t\tthe liquid therefore, NB = 0 and siA = 1. The F-form of the mass-transfer coefficient \t\t\tshould be used \n",
+ "F = Sh_l*1.26*D_ab*10**-4/(M_avg*b) \t\t\t# [kmole/square m.s]\n",
+ "N_a = F*math.log((1-y_a2)/(1-y_a1)) \t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "\t# The total mass rate of evaporation over the surface of the plate\n",
+ "S = 1.5*3 \t\t\t\t\t\t# [square m]\n",
+ "M_a = 78.1 \t\t\t\t\t\t# [gram/mole]\n",
+ "wa = N_a*S*M_a*60*1000 \t\t\t\t# [gram/min]\n",
+ "\n",
+ "V = wa/row_a \t\t\t\t\t\t# [volumetric flow rate, ml/min]\n",
+ "\n",
+ "print\"Liquid benzene should be supplied at the top of the plate at the rate \",round(V),\"ml/min\\nso that evaporation will just prevent it from reaching the bottom of the plate.\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow across the plate is turbulent\n",
+ "\n",
+ "Liquid benzene should be supplied at the top of the plate at the rate 1473.0 ml/min\n",
+ "so that evaporation will just prevent it from reaching the bottom of the plate.\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9,Page number:123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Illustration 2.9\n",
+ "#Evaporation of a Drop of Water Falling in Air\n",
+ "\n",
+ "#Variable declaration\n",
+ "\t# a-water b-air\n",
+ "dp1 = 10**-3 \t\t\t\t\t# [diameter of spherical drop of water, m]\n",
+ "Tair = 323 \t\t\t\t\t# [K]\n",
+ "P = 101.3 \t\t\t\t\t# [kPa]\n",
+ "Twater = 293 \t\t\t\t\t# [K]\n",
+ "R = 8.314 \t\t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "M_a = 18.0 \t\t\t\t\t# [gram/mole]\n",
+ "M_b = 29.0 \t\t\t\t\t# [gram/mole]\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "dp2 = (1.0/2.0)**(1.0/3.0)*dp1 \t\t# [m]\n",
+ "dp = (dp1+dp2)/2 \t\t\t\t# [m]\n",
+ "\n",
+ "row_p = 995 \t\t\t\t\t# [density of water, kg/cubic m]\n",
+ "row1b = 1.094 \t\t\t\t\t# [density of air, kg/cubic m]\n",
+ "u = 1.95*10**-5 \t\t\t\t# [kg/m.s]\n",
+ "row_pr = row_p-row1b \t\t\t\t# [kg/cubic m]\n",
+ "g = 9.8 \t\t\t\t\t# [accleration due to gravity, square m/s]\n",
+ "\t# Combining equation 2.68 and 2.69\n",
+ "Ga = 4*dp**3*row1b*row_pr*g/(3*u**2) \t\t# [Galileo Number]\n",
+ "\n",
+ "\t# Relationship between Re and Cd\n",
+ "\t# Re/Cd = Re**3/Ga = 3*row**2*vt**3/(4*g*u*row_pr)\n",
+ "\n",
+ "\t# The following correlation is used to relate Re/Cd, to Ga\n",
+ "\t# ln(Re/Cd)**(1/3) = -3.194 + 2.153*ln(Ga)**(1/3) - 0.238*(ln(Ga)**(1/3))**2 + \t0.01068*(ln(Ga)**(1/3))**3\n",
+ "\t# Therefore let A = (Re/Cd)\n",
+ "A = math.exp(-3.194 + 2.153*math.log(Ga**(1.0/3.0)) - 0.238*(math.log(Ga**(1.0/3.0)))**2 + 0.01068*(math.log(Ga**(1.0/3.0)))**3) \n",
+ "\n",
+ "\t# Therefore 'vt' will be\n",
+ "vt = A*(4*g*row_pr*u/(3*row1b**2))**(1.0/3.0) \t# [Terminal velocity of particle, m/s]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"Terminal velocity of particle is\",round(vt,2),\"m/s\" \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "P_w = 2.34 \t\t\t\t\t# [vapor pressure of water, kPa]\n",
+ "y_w = P_w/P \t\t\t\t\t# [mole fraction of water at the inner edge of \t\t\t\t\t\tthe gas film]\n",
+ "M_avg = 18*y_w+29*(1-y_w) \t\t\t# [gram/mole]\n",
+ "\n",
+ "row2b = P*M_avg/(R*Twater) \t\t\t# [kg/cubic.m]\n",
+ "delta_row = row2b - row1b \t\t\t# [kg/cubic.m]\n",
+ "\n",
+ "Tavg = (Tair+Twater)/2 \t\t\t# [K]\n",
+ "\t\t# At Temperature equal to Tavg density and viscosity are\n",
+ "row3 = 1.14 \t\t\t\t\t# [kg/cubic.m]\n",
+ "u1 = 1.92*10**-5 \t\t\t\t# [kg/m.s]\n",
+ "\n",
+ "Grd = g*row3*delta_row*(dp**3)/(u1**2) \n",
+ "\n",
+ "\t\t# Diffusivity of water at Tavg and 1 atm is\n",
+ "D_ab = 0.242*10**-4 \t\t\t\t# [square m/s]\n",
+ "Sc = u1/(row3*D_ab) \t\t\t\t# [Schmidt Number]\n",
+ "Re = dp*row3*vt/u1 \t\t\t\t# [Renoylds Number]\n",
+ "\t\n",
+ "\t# From equation 2.65 Re is greater than 0.4*Grd**0.5*Sc**(-1/6)\n",
+ "\t# Therfore equation 2.64 can be used to calculate mass transfer coefficient\n",
+ "\n",
+ "Sh = 2+0.552*(Re**0.5)*Sc**(1.0/3.0) \t\t# [Sherwood Number]\n",
+ "\t# From Table 2.1\n",
+ "\t# Sh = kc*P_bm*dp/(P*D_ab), since P_bm is almost equal to P\n",
+ "\t# Therefore \n",
+ "\t# Sh = kc*dp/D_ab \n",
+ "kc = Sh*D_ab/dp \t\t\t\t# [m/s]\n",
+ "\n",
+ "ca2 = 0 \t\t\t\t\t# [dry air concentration]\n",
+ "ca1 = P_w/(R*Twater) \t\t\t\t# [interface concentration, kmole/cubic.m]\n",
+ "\t# Average rate of evaporation \n",
+ "wa = math.pi*dp**2*M_a*kc*(ca1-ca2)*1000 \t# [g/s]\n",
+ "\n",
+ "\t# Amount of water evaporated\n",
+ "m = row_p*math.pi*dp1**3/12*1000 \t\t# [g]\n",
+ "\t# Time necessary to reduce the volume by 50%\n",
+ "t = m/wa \t\t\t\t\t# [s]\n",
+ "\n",
+ "D = t*vt \t\t\t\t\t# [distance of fall, m]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"The distance of fall is\",round(D),\"m\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Terminal velocity of particle is 3.59 m/s\n",
+ "The distance of fall is 90.0 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10,Page number:127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Illustration 2.10\n",
+ "#Mass Transfer for a Single Cylinder\n",
+ "\n",
+ "#Variable declaratiopn\n",
+ "\n",
+ "\t# Example 2.6 using equation 2.73\n",
+ "\t# Values of the dimensionless parameters calculated in Example 2.6\n",
+ "Re = 1223 \t\t\t\t# [Renoylds Number]\n",
+ "Sc = 0.905 \t\t\t\t# [Schmidt Number]\n",
+ "c = 0.039 \t\t\t\t# [molar density, kg/cubic m]\n",
+ "v = 1 \t\t\t\t\t# [gas velocity, m/s]\n",
+ "\t# Therefore \n",
+ "#Calculations\n",
+ "\n",
+ "Gm = c*v \t\t\t\t# [kmole/square m.s]\n",
+ "\t# From equation 2.9 \n",
+ "\t# Kg*P = ky\n",
+ "\t# Therefore substituting in equation 2.73 we obtain\n",
+ "ky = 0.281*Gm/(Re**0.4*Sc**0.56) \t# [kmole/square m.s]\n",
+ "\t# Now equation 2.73 were obtained under very dilute concentrations\n",
+ "\t# Therefore\n",
+ "y_bm = 1 \n",
+ "\t# From equation 2.6\n",
+ "F = ky*y_bm \t\t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"Mass transfer coefficient is \",round(F,6),\"kmol/m.^2-s\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass transfer coefficient is 0.000675 kmol/m.^2-s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11,Page number:129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.11\n",
+ "#Simultaneous Heat and Mass Transfer in Pipe\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "# a-water b-air\n",
+ "D = 25.4*10**-3 \t\t\t\t# [diameter of wetted wall tower, m]\n",
+ "Gy = 10 \t\t\t\t\t# [mass velocity, kg/square m.s]\n",
+ "T1 = 308 \t\t\t\t\t# [K]\n",
+ "P = 101.3 \t\t\t\t\t# [kPa]\n",
+ "p_a1 = 1.95 \t\t\t\t\t# [partial pressure of water vapor, kPa]\n",
+ "R = 8.314 \t\t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "M_a = 18 \t\t\t\t\t# [gram/mole]\n",
+ "Cpa = 1.88 \t\t\t\t\t# [kJ/kg.K]\n",
+ "\n",
+ "\n",
+ "# Properties of dry air at 308 K and 1 atm pressure are\n",
+ "u = 1.92*10**-5 \t\t\t\t# [kg/m.s]\n",
+ "row = 1.14 \t\t\t\t\t# [kg/cubic m]\n",
+ "D_ab = 0.242*10**-4 \t\t\t\t# [square m/s]\n",
+ "Sc = 0.696 \t\t\t\t\t# [Schmidt number]\n",
+ "Cp = 1.007 \t\t\t\t\t# [kJ/kg.K]\n",
+ "k = 0.027 \t\t\t\t\t# [W/m.K]\n",
+ "Pr = 0.7 \t\t\t\t\t# [Prandtl number]\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "import math\n",
+ "from scipy.optimize import fsolve\n",
+ "from numpy import *\n",
+ "\n",
+ "Re = D*Gy/u \t\t\t\t\t# [Renoylds number]\n",
+ "# From equation 2,74\n",
+ "Sh = 0.023*Re**0.83*Sc**0.44 \t\t\t#[Sherwood number]\n",
+ "# From Table 2.1\n",
+ "kg = Sh*D_ab/(R*T1*D)*1000 \t\t\t# [mole/square m.s.kPa]\n",
+ "\n",
+ "# To estimate the heat-transfer coefficient, we use the Dittus-Boelter equation for cooling, equation 2.80\n",
+ "Nu = 0.023*Re**0.8*Pr**0.3 \t\t\t# [Nusselt number]\n",
+ "# From Table 2.1\n",
+ "h = Nu*k/D \t\t\t\t\t# [W/square m.K]\n",
+ "\n",
+ "T =373.15 \t\t\t\t\t# [K]\n",
+ "lambda_a = 40.63 \t\t\t\t# [kJ/mole]\n",
+ "Tc = 647.1 \t\t\t\t\t# [K]\n",
+ "\n",
+ "# Solution of simultaneous equation 2.78 and 2.79\n",
+ "def F(e): \n",
+ " f1=kg*(p_a1 - math.exp(16.3872-(3885.7/(e[0]-42.98))))-e[1] \n",
+ " f2=e[1]*M_a*Cpa*(T1-e[0])/(1-exp(-e[1]*M_a*Cpa/h)) + 1000*e[1]*lambda_a*((1-(e[0]/Tc))/(1-(T/Tc)))**0.38 \n",
+ " return(f1,f2) \n",
+ "\n",
+ "\n",
+ "# Initial guess\n",
+ "e = [292,-0.003] \n",
+ "y = fsolve(F,e) \n",
+ "Ti = y[0] \n",
+ "Na = y[1] \n",
+ "\n",
+ "print\"The temperature of the liquid water and the rate of water evaporation is\",round(Ti),\"K and\",round(Na,3),\" mole/square m.s respectively\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature of the liquid water and the rate of water evaporation is 295.0 K and -0.013 mole/square m.s respectively\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12,Page number:131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.12\n",
+ "#Air Humidification in Wetted- Wall Column \n",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "\t# a-water b-dry air\n",
+ "D = 25.4*10**-3 \t\t\t# [Internal diameter of tower, m]\n",
+ "Z = 1.5 \t\t\t\t# [length of the wetted section, m]\n",
+ "Gy = 10 \t\t\t\t# [mass velocity of air, kg/square m.s]\n",
+ "Tair = 308 \t\t\t\t# [K]\n",
+ "Twater = 295 \t\t\t\t# [K]\n",
+ "P = 101.3 \t\t\t\t# [kPa]\n",
+ "M_a = 18.0 \t\t\t\t# [gram/mole]\n",
+ "M_b = 29.0 \t\t\t\t# [gram/mole]\n",
+ "R = 8.314 \t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "Pa = 2.64 # [kPa]\n",
+ "\n",
+ "Gm = Gy/M_b \t# [Assuming that gas phase is basically dry air, kmole/square m.s]\n",
+ "\t\t# The properties of dry air at 308 K and 1 atm are (from example 2.9)\n",
+ "row = 1.14 \t\t\t\t# [kg/cubic m]\n",
+ "u = 1.92*10**-5 \t\t\t# [kg/m.s]\n",
+ "D_ab = 0.242*10**-4 \t\t\t# [square m/s]\n",
+ "Sc = 0.692 \t\t\t\t# [Schmidt number]\n",
+ "\n",
+ "Re = Gy*D/u \t\t\t\t# [Renoylds number]\n",
+ "\n",
+ "if Re<35000 and Re>2000:\n",
+ " Sh = 0.023*Re**0.83*Sc**0.44 \t# [Sherwood number] \n",
+ " print\"Sherwood number is\",round(Sh,1) \n",
+ "else:\n",
+ " print\"We cannot use equation 2.74\"\n",
+ "\n",
+ "c = P/(R*Tair) \t\t\t# [kmole/cubic m]\n",
+ "\t# Now using equation 2.89\n",
+ "Pa_out = Pa*(1-math.exp((-4*Sh*Z*c*D_ab)/(Gm*D**2))) \t\t# [kPa]\n",
+ "\n",
+ "#Result\n",
+ "print\"The partial pressure of water in the air leaving the tower is\",round(Pa_out,2),\"kPa\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sherwood number is 51.6\n",
+ "The partial pressure of water in the air leaving the tower is 1.94 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13,Page number:134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Illustration 2.13\n",
+ "# Air Humidification in a Packed Bed\n",
+ "\n",
+ "#Variable declaration\n",
+ "\t# a-water b-dry air\n",
+ "Gy = 10.0 \t\t\t\t# [kg/square m.s]\n",
+ "dp = 3.5*10**-3 \t\t\t# [diameter of spherical glass beads, m]\n",
+ "D = 25.4*10**-3 \t\t\t# [Internal diameter of tower, m]\n",
+ "Tair = 308 \t\t\t\t# [K]\n",
+ "Twater = 295 \t\t\t\t# [K]\n",
+ "P = 101.3 \t\t\t\t# [kPa]\n",
+ "M_a = 18 \t\t\t\t# [gram/mole]\n",
+ "M_b = 29 \t\t\t\t# [gram/mole]\n",
+ "R = 8.314 \t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "import math\n",
+ "from scipy.optimize import fsolve\n",
+ "\t# The properties of dry air at 308 K and 1 atm are (from example 2.12)\n",
+ "row = 1.14 \t\t\t\t# [kg/cubic m]\n",
+ "u = 1.92*10**-5 \t\t\t# [kg/m.s]\n",
+ "D_ab = 0.242*10**-4 \t\t\t# [square m/s]\n",
+ "Sc = 0.692 \t\t\t\t# [Schmidt number]\n",
+ "c = 0.04 \t \t\t\t# [mole/cubic m]\n",
+ "Gm = 0.345 \t\t\t\t# [kmole/square m.s]\n",
+ "\n",
+ "Re = Gy*dp/u \t\t\t\t# [Renoylds number]\n",
+ "if Re<2500 and Re>10:\n",
+ " \t\t\t\t\t# Subsituting in equation 2.90\n",
+ " jd = 1.17*Re**-0.415 \n",
+ " print\"Renoylds number is \",Re\n",
+ "else:\n",
+ " print \" \"\n",
+ "Std = 0.052/(Sc**(2.0/3.0)) \n",
+ "\t\t# From Table 2.1 \n",
+ "Sh = Std*Re*Sc \t\t\t# [Sherwood number]\n",
+ "\t\t# From equation 2.94\n",
+ "e = 0.406+0.571*(dp/D) \t\t# [bed porosity]\n",
+ "e=round(e,3)\n",
+ "\t#Illustration 2.13(a) \n",
+ "\t# Solution(a)\n",
+ "\t# Now Paout = 0.99*Pa\n",
+ "\t# Using equation 2.93 to calculate 'Z'\n",
+ "def f12(Z):\n",
+ " return(0.99 - 1 + math.exp(-6*(1-e)*Sh*c*Z*D_ab/(Gm*dp**2))) \n",
+ "Z = fsolve(f12,0.06) \n",
+ "\n",
+ "#Result\n",
+ "Z=round(Z[0],3)\n",
+ "print\"The depth of packing required is\",Z,\"m=\",Z*100,\"cm\" \n",
+ "\n",
+ "\t#Illustration 2.13(b)\n",
+ "\t# Solution(b)\n",
+ "\t# From equation 2.95\n",
+ "deltaP = (150*(1-e)/Re + 1.75)*((1-e)*(Gy**2)*Z)/(dp*row*e**3) \t# [Pa]\n",
+ "\n",
+ "#Result\n",
+ "print\"The gas pressure drop through the bed is\",round(deltaP),\"Pa (Approx) \\nDUE TO LACK OF PRECISION IN CALCULATION IN BOOK.\\niF DONE MANUALLY,THIS ANSWER STANDS CORRECT\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Renoylds number is 1822.91666667\n",
+ "The depth of packing required is 0.078 m= 7.8 cm\n",
+ "The gas pressure drop through the bed is 15817.0 Pa (Approx) \n",
+ "DUE TO LACK OF PRECISION IN CALCULATION IN BOOK.\n",
+ "iF DONE MANUALLY,THIS ANSWER STANDS CORRECT\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.14,Page number:138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Illustration 2.14\n",
+ "#Design of a Hollow-Fiber Boiler Feed Water Deaerator\n",
+ "\n",
+ "#Variable declaration\n",
+ "\t# a-oxygen b-water\n",
+ "\t# To design the deaerator, We will use commercially available microporous polypropylene \thollow fibers in a module\n",
+ "\n",
+ "m = 40000.0 \t\t\t\t\t# [kg/hr]\n",
+ "Twater = 298 \t\t\t\t\t# [K]\n",
+ "v = 0.1 \t\t\t\t\t# [superficial velocity, m/s]\n",
+ "P = 101.3 \t\t\t\t\t# [kPa]\n",
+ "V = 40*10**-3 \t\t\t\t\t# [Flow rate of nitrogen, cubic m/min]\n",
+ "d = 2.90*10**-4 \t\t\t\t# [Outside diameter of fibres, m]\n",
+ "pf = 0.4 \t\t\t\t\t# [Packing factor]\n",
+ "a = 46.84*100 \t\t\t\t\t# [surface area per unit volume, m**-1]\n",
+ "R = 8.314 \t\t\t\t\t# [cubic m.Pa/mole.K]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "dw = 1000 \t\t\t\t\t# [density of water, kg/cubic m]\n",
+ "Ql = m/(3600*1000) \t\t\t\t# [volumetric water flow rate, cubic m/s]\n",
+ "\t# Shell diameter\n",
+ "D = (4*Ql/(math.pi*v))**0.5 \t\t\t# [Shell diameter, m]\n",
+ "\n",
+ "\t# the properties of dilute mixtures of oxygen in water at 298 K\n",
+ "u = 0.9 \t\t\t\t\t# [cP]\n",
+ "\t# Diffusivity from equation 1.53\n",
+ "D_ab = 1.93*10**-9 \t\t\t\t# [square m/s]\n",
+ "Sc = 467 \t\t\t\t\t# [Schmidt number]\n",
+ "\n",
+ "Re = d*v*dw/(u*10**-3) \t\t\t# [Renoylds number]\n",
+ "\n",
+ "\t# Substituting in equation (2-97) gives\n",
+ "Sh = 0.53*(1-1.1*pf)*((1-pf)/pf)**-0.47*(Re**0.53*Sc**0.33) \n",
+ "\n",
+ "kl = Sh*D_ab/d \t\t\t\t# [mass-transfer coefficient on the shell side, \t\t\t\t\t\tm/s]\n",
+ "\n",
+ "\t# From the specified BFW flow rate\n",
+ "L = m/(3600*18) \t\t\t\t# [kmole/s]\n",
+ "\t# From ideal gas law\n",
+ "V1 = V*P/(Twater*R*60) \t\t\t# [kmole/s]\n",
+ "\t# From the solubility of oxygen in water at 298 K,\n",
+ "M = 4.5*10**4 \n",
+ "A = L/(M*V1) \t\t\t\t\t# [Absorption factor]\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print\"Absorption factor is\",round(A,3) \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "\t# For 99% removal of the dissolved oxygen\n",
+ "\t# x_in/x_out = b = 100\n",
+ "b = 100 \n",
+ "c = 55.5 \t\t\t\t\t# [molar density, kmole/cubic m]\n",
+ "\t# Substituting in equation 2.99 yields\n",
+ "V_T = (L*math.log(b*(1-A)+A))/(kl*a*c*(1-A)) \t # [cubic m]\n",
+ "\n",
+ "\t# The module length, Z is\n",
+ "Z = V_T/(math.pi*D**2.0/4.0) \n",
+ "\n",
+ "#Result\n",
+ "print\"The shell diameter and module length is\",round(D,3),\"m and\",round(Z,2),\" m respectively\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absorption factor is 0.503\n",
+ "The shell diameter and module length is 0.376 m and 2.15 m respectively\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.15,Page number:140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 2.15\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=2.21/100\t\t\t#[m]\n",
+ "mu=8.82*10**-6\t\t#[kg/m-s]\n",
+ "rho=2.81\t\t#[kg/m**3]\n",
+ "\n",
+ "c=34.14\t\t\t#[mol/m**3]\n",
+ "D=array([2.228/(10**6),2.065/(10**6),1.832/(10**6)]) #Velocities in [m**2/s]\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#Gy=rho*v\t\t\n",
+ "#Re=Gy*d/mu\t\t#Reynolds number\n",
+ "Re=21750\n",
+ "print \"Reynolds number=\",Re\n",
+ "Sc=[]\n",
+ "Sh=[]\n",
+ "F=[]\n",
+ "for i in range(0, 3):\n",
+ " sc=mu/(rho*D[i]) #Schmidt number\n",
+ " Sc.append(sc)\n",
+ " sh=0.023*Re**(0.83)*sc**(0.44) #Sherwood number\n",
+ " Sh.append(sh)\n",
+ " f=sh*c*D[i]/d #Binary mass transfer coefficient in [mol/m^2-s]\n",
+ " F.append(f)\n",
+ "print \"Schmidt number are:\"\n",
+ "for i in range(0,3):\n",
+ " print round(Sc[i],3)\n",
+ "print \"Sherwood number number are:\"\n",
+ "for i in range(0,3):\n",
+ " print round(Sh[i],1)\n",
+ "print\"Binary mass transfer coefficients are:\"\n",
+ "for i in range(0,3):\n",
+ " print round(F[i],3)\n",
+ "#After modifying mathcad program of example 1.17,we have\n",
+ "N1=-0.0527 #[mol/m^2-s]\n",
+ "N2=0.0395 #[mol/m^2-s]\n",
+ "N3=0.0132 #[mol/m^2-s]\n",
+ "print\"The program yields the following results:\"\n",
+ "print \"N1=\",N1,\"mol/m**2-s\"\n",
+ "print \"N2=\",N2,\"mol/m**2-s\"\n",
+ "print \"N3=\",N3,\"mol/m**2-s\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds number= 21750\n",
+ "Schmidt number are:\n",
+ "1.409\n",
+ "1.52\n",
+ "1.713\n",
+ "Sherwood number number are:\n",
+ "106.5\n",
+ "110.1\n",
+ "116.1\n",
+ "Binary mass transfer coefficients are:\n",
+ "0.367\n",
+ "0.351\n",
+ "0.328\n",
+ "The program yields the following results:\n",
+ "N1= -0.0527 mol/m**2-s\n",
+ "N2= 0.0395 mol/m**2-s\n",
+ "N3= 0.0132 mol/m**2-s\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_3_4.ipynb b/Practical_C_Programming/Chapter_3_4.ipynb
new file mode 100644
index 00000000..b0fd7f89
--- /dev/null
+++ b/Practical_C_Programming/Chapter_3_4.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 3: Style"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 3.1, Page number: 57"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 3.1.py\n# To print 'Hello World'\n\n\n# Result\nprint ('Hello World')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Hello World\n"
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_4_4.ipynb b/Practical_C_Programming/Chapter_4_4.ipynb
new file mode 100644
index 00000000..bb8fdf51
--- /dev/null
+++ b/Practical_C_Programming/Chapter_4_4.ipynb
@@ -0,0 +1,167 @@
+{
+ "metadata": {
+ "name": "Chapter 4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 4: Basic declarations and expressions"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.1, Page number: 71"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.1.py\n# To perform a simple calculation\n\n\n# Variable declaration\nx = (1 + 2) * 4\n\n# Result\nprint ('1 plus 2 multiplied by 4 gives %d' % x)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1 plus 2 multiplied by 4 gives 12\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.2, Page number: 75"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.2.py\n# To calculate the twice and thrice of 15\n\n\n# Variable declaration\nterm = 3 * 5\nterm_2 = 2 * term\nterm_3 = 3 * term\n\n# Result\nprint ('Twice %d is %d' % (term, term_2))\nprint ('Three times %d is %d' % (term, term_3))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Twice 15 is 30\nThree times 15 is 45\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.3, Page number: 77"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.3.py\n# To calculate the twice and thrice of 15\n\n\n# Variable declaration\nterm = 3 * 5\nterm_2 = 2 * term\nterm_3 = 3 * term\n\n# Result\nprint ('Twice %d is %d' % (term, term_2))\nprint ('Three times %d is %d' % (term, term_3))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Twice 15 is 30\nThree times 15 is 45\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.4, Page number: 79"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.4.py\n# To determine the value of 1/3\n\n\n# Variable declaration\nanswer = 1/3\n\n# Result\nprint ('The value of 1/3 is %f' % answer)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The value of 1/3 is 0.000000\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.5, Page number: 80"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.5.py\n# To determine the value of 2 + 2\n\n\n# Variable declaration\nanswer = 2 + 2\n\n# Result\nprint ('The answer is %d' % answer)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The answer is 4\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.6, Page number: 80"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.6.py\n# To determine the integer equivalent of 7.0/22.0 \n\n\n# Variable declaration\nresult = 7.0/22.0\n\n# Result\nprint ('The result is %d' % result)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The result is 0\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 4.7, Page number: 82"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 4.7.py\n# To determine the reverse of 3 characters\n\n\n# Variable declaration\nchar1 = 'A'\nchar2 = 'B'\nchar3 = 'C'\n\n# Result\nprint ('%c%c%c reversed is %c%c%c' % (char1, char2, char3, char3, char2, char1))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "ABC reversed is CBA\n"
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_5_4.ipynb b/Practical_C_Programming/Chapter_5_4.ipynb
new file mode 100644
index 00000000..37c16908
--- /dev/null
+++ b/Practical_C_Programming/Chapter_5_4.ipynb
@@ -0,0 +1,230 @@
+{
+ "metadata": {
+ "name": "Chapter 5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 5: Arrays, qualifiers, and reading numbers"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.1, Page number: 84"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.1.py\n# To print the total and average of five data items\n\n\n# Variable declaration\ndata = [ 34.0, 27.0, 45.0, 82.0, 22.0 ]\n\n# Calculation\ntotal = data[0] + data[1] + data[2] + data[3] + data[4]\naverage = total/5.0\n\n# Result\nprint ('Total %f Average %f' % (total, average))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Total 210.000000 Average 42.000000\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.2, Page number: 87"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.2.py\n# To print the name 'Sam'\n\n\n# Variable declaration\nname = 'Sam'\n\n# Result\nprint ('The name is %s' % name)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The name is Sam\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.3, Page number: 88"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.3.py\n# To print the full name of a person\n\n\n# Variable declaration\nfirst = 'Steve'\nlast = 'Oualline'\n\n# Calculation\nfull_name = first + ' ' + last\n\n# Result\nprint ('The full name is %s' % full_name)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The full name is Steve Oualline\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.4, Page number: 89"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.4.py\n# To calculate the length of a line\n\n\n# Variable declaration\nline = 'hello world'\n\n# Result\nprint ('The length of the line is %d' % len(line))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The length of the line is 11\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.5, Page number: 90"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.5.py\n# To display the first and last names of a person\n\n\n# Variable declaration\nfirst = 'Steve'\nlast = 'Oualline'\n\n# Calculation\nfull = first + ' ' + last\n\n# Result\nprint ('The name is %s' % full)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The name is Steve Oualline\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.6, Page number: 91"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.6.py\n# To display the first and last names of a person\n\n\n# Variable declaration\nfirst = 'Steve'\nlast = 'Oualline'\n\n# Calculation\nfull = first + ' ' + last\n\n# Result\nprint ('The name is %s' % full)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The name is Steve Oualline\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.7, Page number: 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.7.py\n# To display the values of the elements of a 2-D array\n\n\n# Variable declaration\narray = [[0 for x in range(5)] for x in range(5)]\narray[0][0] = 0 * 10 + 0\narray[0][1] = 0 * 10 + 1\narray[1][0] = 1 * 10 + 0\narray[1][1] = 1 * 10 + 1\narray[2][0] = 2 * 10 + 0\narray[2][1] = 2 * 10 + 1\n\n# Result\nprint ('array[0]')\nprint (array[0][0])\nprint (array[0][1])\nprint ('\\n')\n\nprint ('array[1]')\nprint (array[1][0])\nprint (array[1][1])\nprint ('\\n')\n\nprint ('array[2]')\nprint (array[2][0])\nprint (array[2][1])\nprint ('\\n')",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "array[0]\n0\n1\n\n\narray[1]\n10\n11\n\n\narray[2]\n20\n21\n\n\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.8, Page number: 94"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.8.py\n# To print the twice of a value\n\n\n# Variable declaration\nline = 4\n\n# Result\nprint ('Twice %d is %d' % (line, line * 2))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Twice 4 is 8\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.9, Page number: 95"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.9.py\n# To calculate the area of a triangle\n\n\n# Variable declaration\nwidth = 12\nheight = 10\n\n# Calculation\narea = (width * height) / 2\n\n# Result\nprint ('The area is %d' % area)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The area is 60\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 5.10, Page number: 107"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 5.10.py\n# To calculate the area of a triangle\n\n\n# Variable declaration\nwidth = 4\nheight = 6\n\n# Calculation\narea = (width * height) / 2\n\n# Result\nprint ('The area is %d' % area)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The area is 12\n"
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_6_4.ipynb b/Practical_C_Programming/Chapter_6_4.ipynb
new file mode 100644
index 00000000..22907862
--- /dev/null
+++ b/Practical_C_Programming/Chapter_6_4.ipynb
@@ -0,0 +1,104 @@
+{
+ "metadata": {
+ "name": "Chapter 6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 6: Decision and control statements"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.1, Page number: 114"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 6.1.py\n# To print the Fibonacci series upto 100\n\n\n# Variable declaration\nold_number = 1\ncurrent_number = 1\n\nprint ('1')\n\n# Calculation and result\nwhile (current_number < 100) :\n print (current_number)\n next_number = current_number + old_number\n\n old_number = current_number\n current_number = next_number",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "1\n1\n2\n3\n5\n8\n13\n21\n34\n55\n89\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.2, Page number: 115"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 6.2.py\n# To calculate the number of items entered\n\n\n# Variable declaration\ntotal = 0\ni = 0\n\n# Calculation\nwhile (i < 10) :\n item = 1\n\n if item == 0 :\n break\n\n total += item\n print ('Total: %d' % total)\n i = i + 1\n \n# Result\nprint ('Final total: %d' % total)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Total: 1\nTotal: 2\nTotal: 3\nTotal: 4\nTotal: 5\nTotal: 6\nTotal: 7\nTotal: 8\nTotal: 9\nTotal: 10\nFinal total: 10\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.3, Page number: 116"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 6.3.py\n# To calculate the total number of items entered and omit the negative items\n\n\n# Variable declaration\ntotal = 0\nminus_items = 0\ni = 0\n\n# Calculation\nwhile (i < 10) :\n item = 1\n \n if item == 0 :\n break\n\n if item < 0 :\n minus_items += 1\n continue\n\n total += item\n print ('Total: %d' % total)\n i = i + 1\n \n# Result\nprint ('Final total: %d' % total)\nprint ('with %d negative items omitted' % minus_items)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Total: 1\nTotal: 2\nTotal: 3\nTotal: 4\nTotal: 5\nTotal: 6\nTotal: 7\nTotal: 8\nTotal: 9\nTotal: 10\nFinal total: 10\nwith 0 negative items omitted\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 6.4, Page number: 118"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 6.4.py\n# To calculate the number of dollars owed\n\n\n# Variable declaration\nbalance_owed = 100\n\n# Calculation and result\nif balance_owed == 0 :\n print ('You owe nothing.')\nelse :\n print ('You owe %d dollars.' % balance_owed)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "You owe 100 dollars.\n"
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_7_4.ipynb b/Practical_C_Programming/Chapter_7_4.ipynb
new file mode 100644
index 00000000..51b18ca7
--- /dev/null
+++ b/Practical_C_Programming/Chapter_7_4.ipynb
@@ -0,0 +1,76 @@
+{
+ "metadata": {
+ "name": "Chapter 7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 7: Programming process"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.1, Page number: 126"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 7.1.py\n# To perform an operation based on operator input by the user\n\n\n# Variable declaration\nresult = 0\ni = 0\n\n# Calculation and result\nwhile (i < 3) :\n print ('Result: %d' % result)\n operator = '+'\n value = 10\n\n if operator == '+' :\n result += value\n else :\n print ('Unknown operator %c' % operator)\n i = i + 1 ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Result: 0\nResult: 10\nResult: 20\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.2, Page number: 133"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 7.2.py\n# To perform various arithmetic operations based on operator input by the user\n\n\n# Variable declaration\nresult = 0\ni = 0\n\n# Calculation and result\nwhile (i < 3) :\n print ('Result: %d' % result)\n operator = '+'\n value = 5\n\n if operator == 'q' or operator == 'Q' :\n break\n\n if operator == '+' :\n result += value\n\n if operator == '-' :\n result -= value\n\n if operator == '*' :\n result *= value\n\n if operator == '/' :\n if value == 0 :\n print ('Error: Divide by zero')\n print ('operation ignored') \n else :\n result /= value\n\n i = i + 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Result: 0\nResult: 5\nResult: 10\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 7.3, Page number: 140"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 7.3.py\n# Guess - A simple guessing game\n# A random number is chosen between 1 and 100. \n# The player is given a set of bounds and \n# must choose a number between them. \n# If the player chooses the correct number, he wins.\n# Otherwise, the bounds are adjusted to reflect\n# the player's guess and the game continues.\n\n# Variable declaration, calculation and result\nimport sys\nimport random\nwhile (1) :\n\n # random number to be guessed\n number_to_guess = random.randrange (1, 101, 1)\n\n # current lower limit of player's range\n low_limit = 0\n\n # current upper limit of player's range\n high_limit = 100\n \n # number of times player guessed\n guess_count = 0\n\n while (1) :\n \n # tell user what the bounds are and get his guess\n print ('Bounds %d - %d\\n' % (low_limit, high_limit))\n print ('Value[%d]?' % guess_count)\n \n guess_count += 1\n\n # number gotten from the player\n player_number = 50\n\n # did he guess right?\n if (player_number == number_to_guess) :\n break\n\n # adjust bounds for next guess\n if (player_number < number_to_guess) :\n low_limit = player_number\n \n else :\n high_limit = player_number\n\n print ('Bingo\\n')",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_8_4.ipynb b/Practical_C_Programming/Chapter_8_4.ipynb
new file mode 100644
index 00000000..f7a42df6
--- /dev/null
+++ b/Practical_C_Programming/Chapter_8_4.ipynb
@@ -0,0 +1,133 @@
+{
+ "metadata": {
+ "name": "Chapter 8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 8: More control statements"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 8.1, Page number: 144"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 8.1.py\n# To calculate the sum of numbers entered by the user\n\n\n# Variable declaration\ntotal = 0\ncounter = 0\n\n# Calculation\nwhile (counter < 5) :\n current = 3\n total += current\n counter += 1\n\n# Result\nprint ('The grand total is %d' % total)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The grand total is 15\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 8.2, Page number: 145"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 8.2.py\n# To calculate the sum of numbers entered by the user using for loop\n\n\n# Variable declaration\ntotal = 0\n\n# Calculation\nfor counter in range (0, 5) :\n current = 5\n total += current\n\n# Result\nprint ('The grand total is %d' % total)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The grand total is 25\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 8.3, Page number: 146"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 8.3.py\n# To produce a Celsius to Fahrenheit conversion chart for the numbers 0 to 100\n\n\n# Variable declaration, calculation and result\nfor celsius in range (0, 101) :\n print ('Celsius: %d Fahrenheit: %d' % (celsius, (celsius * 9) / 5 +32))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Celsius: 0 Fahrenheit: 32\nCelsius: 1 Fahrenheit: 33\nCelsius: 2 Fahrenheit: 35\nCelsius: 3 Fahrenheit: 37\nCelsius: 4 Fahrenheit: 39\nCelsius: 5 Fahrenheit: 41\nCelsius: 6 Fahrenheit: 42\nCelsius: 7 Fahrenheit: 44\nCelsius: 8 Fahrenheit: 46\nCelsius: 9 Fahrenheit: 48\nCelsius: 10 Fahrenheit: 50\nCelsius: 11 Fahrenheit: 51\nCelsius: 12 Fahrenheit: 53\nCelsius: 13 Fahrenheit: 55\nCelsius: 14 Fahrenheit: 57\nCelsius: 15 Fahrenheit: 59\nCelsius: 16 Fahrenheit: 60\nCelsius: 17 Fahrenheit: 62\nCelsius: 18 Fahrenheit: 64\nCelsius: 19 Fahrenheit: 66\nCelsius: 20 Fahrenheit: 68\nCelsius: 21 Fahrenheit: 69\nCelsius: 22 Fahrenheit: 71\nCelsius: 23 Fahrenheit: 73\nCelsius: 24 Fahrenheit: 75\nCelsius: 25 Fahrenheit: 77\nCelsius: 26 Fahrenheit: 78\nCelsius: 27 Fahrenheit: 80\nCelsius: 28 Fahrenheit: 82\nCelsius: 29 Fahrenheit: 84\nCelsius: 30 Fahrenheit: 86\nCelsius: 31 Fahrenheit: 87\nCelsius: 32 Fahrenheit: 89\nCelsius: 33 Fahrenheit: 91\nCelsius: 34 Fahrenheit: 93\nCelsius: 35 Fahrenheit: 95\nCelsius: 36 Fahrenheit: 96\nCelsius: 37 Fahrenheit: 98\nCelsius: 38 Fahrenheit: 100\nCelsius: 39 Fahrenheit: 102\nCelsius: 40 Fahrenheit: 104\nCelsius: 41 Fahrenheit: 105\nCelsius: 42 Fahrenheit: 107\nCelsius: 43 Fahrenheit: 109\nCelsius: 44 Fahrenheit: 111\nCelsius: 45 Fahrenheit: 113\nCelsius: 46 Fahrenheit: 114\nCelsius: 47 Fahrenheit: 116\nCelsius: 48 Fahrenheit: 118\nCelsius: 49 Fahrenheit: 120\nCelsius: 50 Fahrenheit: 122\nCelsius: 51 Fahrenheit: 123\nCelsius: 52 Fahrenheit: 125\nCelsius: 53 Fahrenheit: 127\nCelsius: 54 Fahrenheit: 129\nCelsius: 55 Fahrenheit: 131\nCelsius: 56 Fahrenheit: 132\nCelsius: 57 Fahrenheit: 134\nCelsius: 58 Fahrenheit: 136\nCelsius: 59 Fahrenheit: 138\nCelsius: 60 Fahrenheit: 140\nCelsius: 61 Fahrenheit: 141\nCelsius: 62 Fahrenheit: 143\nCelsius: 63 Fahrenheit: 145\nCelsius: 64 Fahrenheit: 147\nCelsius: 65 Fahrenheit: 149\nCelsius: 66 Fahrenheit: 150\nCelsius: 67 Fahrenheit: 152\nCelsius: 68 Fahrenheit: 154\nCelsius: 69 Fahrenheit: 156\nCelsius: 70 Fahrenheit: 158\nCelsius: 71 Fahrenheit: 159\nCelsius: 72 Fahrenheit: 161\nCelsius: 73 Fahrenheit: 163\nCelsius: 74 Fahrenheit: 165\nCelsius: 75 Fahrenheit: 167\nCelsius: 76 Fahrenheit: 168\nCelsius: 77 Fahrenheit: 170\nCelsius: 78 Fahrenheit: 172\nCelsius: 79 Fahrenheit: 174\nCelsius: 80 Fahrenheit: 176\nCelsius: 81 Fahrenheit: 177\nCelsius: 82 Fahrenheit: 179\nCelsius: 83 Fahrenheit: 181\nCelsius: 84 Fahrenheit: 183\nCelsius: 85 Fahrenheit: 185\nCelsius: 86 Fahrenheit: 186\nCelsius: 87 Fahrenheit: 188\nCelsius: 88 Fahrenheit: 190\nCelsius: 89 Fahrenheit: 192\nCelsius: 90 Fahrenheit: 194\nCelsius: 91 Fahrenheit: 195\nCelsius: 92 Fahrenheit: 197\nCelsius: 93 Fahrenheit: 199\nCelsius: 94 Fahrenheit: 201\nCelsius: 95 Fahrenheit: 203\nCelsius: 96 Fahrenheit: 204\nCelsius: 97 Fahrenheit: 206\nCelsius: 98 Fahrenheit: 208\nCelsius: 99 Fahrenheit: 210\nCelsius: 100 Fahrenheit: 212\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 8.4, Page number: 147"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 8.4.py\n# To count the number of 3's and 7's in an array\n\n\n# Variable declaration\nseven_count = 0\nthree_count = 0\ndata = []\n\n# Calculation\nfor i in range (0, 5) :\n x = 7\n data.append(int(x))\nprint (data)\n\nfor index in range (0, 5) :\n if data[index] == 3 :\n three_count += 1\n\n if data[index] == 7 :\n seven_count += 1\n\n# Result\nprint ('Threes %d Sevens %d' % (three_count, seven_count))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[7, 7, 7, 7, 7]\nThrees 0 Sevens 5\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 8.6, Page number: 149"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 8.6.py\n# To perform various arithmetic operations based on operator input by the user\n\n\n# Variable declaration\nresult = 0\ni = 0\n\n# Calculation and result\nwhile (i < 3) :\n print ('Result: %d' % result)\n operator = '-'\n value = 10\n\n if operator == 'q' or operator == 'Q' :\n break\n\n elif operator == '+' :\n result += value\n\n elif operator == '-' :\n result -= value\n\n elif operator == '*' :\n result *= value\n\n elif operator == '/' :\n if value == 0 :\n print ('Error: Divide by zero')\n print ('operation ignored') \n else :\n result /= value\n\n else :\n print ('Unknown operator %c' % operator)\n i = i + 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Result: 0\nResult: -10\nResult: -20\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_9_4.ipynb b/Practical_C_Programming/Chapter_9_4.ipynb
new file mode 100644
index 00000000..28d47037
--- /dev/null
+++ b/Practical_C_Programming/Chapter_9_4.ipynb
@@ -0,0 +1,104 @@
+{
+ "metadata": {
+ "name": "Chapter 9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 9: Variable scope and functions"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 9.1, Page number: 160"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 9.1.py\n# To illustrate the difference between temporary and permanent variables\n\n\n# Function declaration, calculation and result\ndef func() :\n if not hasattr(func, \"permanent\") :\n func.permanent = 1\n result = func.permanent\n func.permanent += 1\n return result\n\nfor counter in range (0, 3) :\n temporary = 1\n print ('Temporary %d Permanent %d' % (temporary, func()))\n temporary += 1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Temporary 1 Permanent 1\nTemporary 1 Permanent 2\nTemporary 1 Permanent 3\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 9.3, Page number: 164"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 9.3.py\n# To compute the area of a triangle\n\n\n# Function declaration, calculation and result\ndef triangle (width, height) :\n area = width * height / 2.0\n return area\n\nprint ('Triangle #1 %f' % (triangle (1.3, 8.3)))\nprint ('Triangle #2 %f' % (triangle (4.8, 9.8)))\nprint ('Triangle #3 %f' % (triangle (1.2, 2.0)))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Triangle #1 5.395000\nTriangle #2 23.520000\nTriangle #3 1.200000\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 9.4, Page number: 166"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 9.4.py\n# To compute the length of a string\n\n\n# Function declaration, calculation and result\ndef length (string) :\n return len(string)\n\nline = 'hello world' \n\nprint ('Length is: %d' % length(line))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Length is: 11\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 9.6, Page number: 170"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 9.6.py\n# To compute the length of a string\n\n\n# Function declaration, calculation and result\ndef length (string) :\n return len(string)\n\nline = 'Steve Oualline'\n\nprint ('Length is: %d' % length(line))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Length is: 14\n"
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/README.txt b/Practical_C_Programming/README.txt
new file mode 100644
index 00000000..82e51f0a
--- /dev/null
+++ b/Practical_C_Programming/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Mahesh M
+Course: btech
+College/Institute/Organization: Maharaja Surajmal Institute of Technology, New Delhi
+Department/Designation: Computer Science engineering
+Book Title: Practical C Programming
+Author: Steve Oualline
+Publisher: O'Reilly Media
+Year of publication: 1997
+Isbn: 978-1565923065
+Edition: 3rd \ No newline at end of file
diff --git a/Practical_C_Programming/screenshots/ancientcompilers.png b/Practical_C_Programming/screenshots/ancientcompilers.png
new file mode 100644
index 00000000..46fba46d
--- /dev/null
+++ b/Practical_C_Programming/screenshots/ancientcompilers.png
Binary files differ
diff --git a/Practical_C_Programming/screenshots/bitoperations.png b/Practical_C_Programming/screenshots/bitoperations.png
new file mode 100644
index 00000000..48925b6a
--- /dev/null
+++ b/Practical_C_Programming/screenshots/bitoperations.png
Binary files differ
diff --git a/Practical_C_Programming/screenshots/mahesh-1.png b/Practical_C_Programming/screenshots/mahesh-1.png
new file mode 100644
index 00000000..bfa1980b
--- /dev/null
+++ b/Practical_C_Programming/screenshots/mahesh-1.png
Binary files differ
diff --git a/Practical_C_Programming/screenshots/mahesh-2.png b/Practical_C_Programming/screenshots/mahesh-2.png
new file mode 100644
index 00000000..ddc5be59
--- /dev/null
+++ b/Practical_C_Programming/screenshots/mahesh-2.png
Binary files differ
diff --git a/Practical_C_Programming/screenshots/mahesh-3.png b/Practical_C_Programming/screenshots/mahesh-3.png
new file mode 100644
index 00000000..7f65aa5c
--- /dev/null
+++ b/Practical_C_Programming/screenshots/mahesh-3.png
Binary files differ
diff --git a/Practical_C_Programming/screenshots/programmingprocess.png b/Practical_C_Programming/screenshots/programmingprocess.png
new file mode 100644
index 00000000..c2f21380
--- /dev/null
+++ b/Practical_C_Programming/screenshots/programmingprocess.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter1.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter1.ipynb
new file mode 100644
index 00000000..68dac58e
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter1.ipynb
@@ -0,0 +1,158 @@
+{
+ "metadata": {
+ "name": "Chapter_1"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 1: Semiconductor Basics<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.1(a), Page Number:29<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltages of different models'''",
+ "",
+ "# variable declaration",
+ "V_bias=10.0; #bias voltage in volt",
+ "R_limit=1000; #limiting resistance in ohm",
+ "r_d =10.0; #r_d value",
+ "",
+ "#calculation",
+ "#IDEAL MODEL",
+ "print \"IDEAL MODEL\"",
+ "V_f=0; #voltage in volt",
+ "I_f=V_bias/R_limit; #foward current",
+ "V_R_limit=I_f*R_limit; #limiting voltage",
+ "print \"forward voltage = %.2f volts\" %V_f",
+ "print \"forward current = %.2f amperes\" %I_f",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#PRACTICAL MODEL",
+ "print \"\\nPRACTICAL MODEL\"",
+ "V_f=0.7; #voltage in volt",
+ "I_f=(V_bias-V_f)/R_limit; #foward current",
+ "V_R_limit=I_f*R_limit; #limiting voltage",
+ "print \"forward voltage = %.2f volts\" %V_f",
+ "print \"forward current = %.3f amperes\" %I_f",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#COMPLETE MODEL",
+ "print \"\\nCOMPLETE MODEL\"",
+ "I_f=(V_bias-0.7)/(R_limit+r_d); #foward current",
+ "V_f=0.7+I_f*r_d; #forward voltage",
+ "V_R_limit=I_f*R_limit; #limiting voltage",
+ "print \"forward voltage = %.3f volts\" %V_f",
+ "print \"forward current = %.3f amperes\" %I_f",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IDEAL MODEL",
+ "forward voltage = 0.00 volts",
+ "forward current = 0.01 amperes",
+ "voltage across limiting resistor = 10.00 volts",
+ "",
+ "PRACTICAL MODEL",
+ "forward voltage = 0.70 volts",
+ "forward current = 0.009 amperes",
+ "voltage across limiting resistor = 9.30 volts",
+ "",
+ "COMPLETE MODEL",
+ "forward voltage = 0.792 volts",
+ "forward current = 0.009 amperes",
+ "voltage across limiting resistor = 9.21 volts"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 1.1(b), Page Number:29<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltages of different models'''",
+ "",
+ "# variable declaration",
+ "V_bias=5; #bias voltage in volt",
+ "I_R=1*10**-6; #current",
+ "R_limit=1000 #in Ohm",
+ "",
+ "#calculation",
+ "#IDEAL MODEL",
+ "print \"IDEAL MODEL\"",
+ "I_r=0.0; #current in ampere",
+ "V_R=V_bias; #voltages are equal",
+ "V_R_limit=I_r*R_limit; #limiting voltage",
+ "print \"Reverse voltage across diode = %.2f volts\" %V_R",
+ "print \"Reverse current through diode= %.2f amperes\" %I_r",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#PRACTICAL MODEL",
+ "print \"\\nPRACTICAL MODEL\"",
+ "I_r=0.0; #current in ampere",
+ "V_R=V_bias; #voltages are equal",
+ "V_R_limit=I_r*R_limit; #limiting voltage",
+ "print \"Reverse voltage across diode= %.2f volts\" %V_R",
+ "print \"Reverse current through diode = %.2f amperes\" %I_r",
+ "print \"voltage across limiting resistor = %.2f volts\" %V_R_limit",
+ "",
+ "#COMPLETE MODEL",
+ "print \"\\nCOMPLETE MODEL\"",
+ "I_r=I_R; #current in ampere",
+ "V_R_limit=I_r*R_limit; #limiting voltage",
+ "V_R=V_bias-V_R_limit; #voltage in volt",
+ "print \"Reverse voltage across diode = %.3f volts\" %V_R",
+ "print \"Reverse current through diode = %d micro Amp\" %(I_r*10**6)",
+ "print \"voltage across limiting resistor = %d mV\" %(V_R_limit*1000)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IDEAL MODEL",
+ "Reverse voltage across diode = 5.00 volts",
+ "Reverse current through diode= 0.00 amperes",
+ "voltage across limiting resistor = 0.00 volts",
+ "",
+ "PRACTICAL MODEL",
+ "Reverse voltage across diode= 5.00 volts",
+ "Reverse current through diode = 0.00 amperes",
+ "voltage across limiting resistor = 0.00 volts",
+ "",
+ "COMPLETE MODEL",
+ "Reverse voltage across diode = 4.999 volts",
+ "Reverse current through diode = 1 micro Amp",
+ "voltage across limiting resistor = 1 mV"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter2.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter2.ipynb
new file mode 100644
index 00000000..107fc334
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter2.ipynb
@@ -0,0 +1,608 @@
+{
+ "metadata": {
+ "name": "Chapter_2"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 2: Diode Application<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.1, Page Number: 46<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Average value of half wave rectifier'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_p=50; #Peak value is 50V",
+ "",
+ "#calculation",
+ "V_avg=V_p/math.pi;",
+ "",
+ "#result",
+ "print \"average value of half wave rectifier = %.2f volts\" %V_avg"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average value of half wave rectifier = 15.92 volts"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.2(a), Page Number: 46<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' half wave rectifier output'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "#let V_in=5*sin(2*%pi*f.*t) be input wave ,hence frequency=1Hz",
+ "f=1; #frequency",
+ "V_p_in=5; #peak input",
+ "",
+ "#calculation",
+ "V_pout=V_p_in-0.7; #output voltage",
+ "t_d=(math.asin(0.7/V_p_in))/(2*math.pi*f);",
+ "",
+ "#result",
+ "print \"half wave rectifier output = %.2f volts\" %V_pout;"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "half wave rectifier output = 4.30 volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.2(b), Page Number: 46<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' half wave rectifier output'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "#let V_in=100*sin(2*%pi*f.*t) be input wave ,hence frequency=1Hz",
+ "f=1; #frequency",
+ "T=1/f; #time period",
+ "V_p_in=100; #peak input voltage",
+ "",
+ "#calculation",
+ "V_pout=(V_p_in-0.7); #peak output ",
+ "t_d=(math.asin(0.7/V_p_in))/(2*math.pi*f) ",
+ "",
+ "#result",
+ "print \"output of half wave rectifier = %.2f volts\" %V_pout"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output of half wave rectifier = 99.30 volts"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.3, Page Number: 48<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Average value of half wave rectifier'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_p_in=156; #Peak input voltage",
+ "V_p_pri=156; #Peak voltage of primary of transformer",
+ "n=0.5; #Turn ratio is 2:1",
+ "",
+ "#calculation",
+ "V_p_sec=n*V_p_pri;",
+ "V_p_out=(V_p_sec-0.7); #Peak output voltage",
+ "",
+ "#result",
+ "print \"peak output voltage of half wave rectifier = %.1f volts\" %V_p_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak output voltage of half wave rectifier = 77.3 volts"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.4, Page Number: 49<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Average value of full wave rectifier'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_p=15; #Peak voltage in volt",
+ "",
+ "#calculation",
+ "V_avg=(2*V_p)/math.pi;",
+ "",
+ "#result",
+ "print \"Average value of output of full wave rectifier = %.2f volts\" %V_avg"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average value of output of full wave rectifier = 9.55 volts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.5, Page Number: 52<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''PIV full wave'''",
+ "",
+ "V_p_pri=100.0; #Peak voltage across primary winding",
+ "n=1.0/2; #tun ratio is 2:1",
+ "V_p_sec=n*V_p_pri;",
+ "V_sec=V_p_sec/2; #voltage across each secondary is half the total voltage",
+ "V_pout=V_sec-0.7;",
+ "",
+ "print('full wave rectifier output voltage = %f V'%V_pout)",
+ "PIV=2*V_pout+0.7;",
+ "print('PIV = %fV'%PIV)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "full wave rectifier output voltage = 24.300000 V",
+ "PIV = 49.300000V"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.6, Page Number: 54<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Peak voltage of diode'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_rms=12.0; #rms secondary voltage",
+ "",
+ "#calculation",
+ "V_p_sec=math.sqrt(2)*V_rms; #peak secondary voltage",
+ "V_th=0.7; #knee voltage of diode",
+ "V_p_out=V_p_sec-2*V_th; #in one cycle, 2 diodes conduct",
+ "PIV=V_p_out+V_th; #applying KVL",
+ "",
+ "#result",
+ "print \"Peak output voltage = %.2f volt\" %V_p_out",
+ "print \"PIV across each diode = %.2f volt\" %PIV"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak output voltage = 15.57 volt",
+ "PIV across each diode = 16.27 volt"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.7, Page Number: 58<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Ripple Factor'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "R_l=2200; #load resistance in Ohm",
+ "C=50*10**-6; #capacitance in Farad",
+ "V_rms=115; #rms of primary",
+ "",
+ "#calculation",
+ "V_p_pri=math.sqrt(2)*V_rms; #peak voltage across primary",
+ "n=0.1; #turn ratio is 10:1",
+ "V_p_sec=n*V_p_pri; #primary voltage across secondary",
+ "V_p_rect=V_p_sec-1.4 #unfiltered peak rectified voltage",
+ "#we subtract 1.4 because in each cycle 2 diodes conduct & 2 do not",
+ "f=120; #frequency of full wave rectified voltage",
+ "V_r_pp=(1/(f*R_l*C))*V_p_rect; #peak to peak ripple voltage",
+ "V_DC=(1-(1/(2*f*R_l*C)))*V_p_rect;",
+ "r=V_r_pp/V_DC;",
+ "",
+ "#result",
+ "print \"Ripple factor = %.3f \" %r"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ripple factor = 0.079 "
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.8, Page Number: 62<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Min & Max voltage'''",
+ "",
+ "import math",
+ "",
+ "# variable declaration",
+ "V_REF=1.25; #in volts",
+ "V_R1=V_REF; #voltage in volt",
+ "R1=220.0; #in ohms",
+ "I_ADJ=50*10**-6 #in amperes",
+ "",
+ "#calculation",
+ "# MAX VALUE OF R2=5000 Ohms",
+ "R2_min=0.0; #min resistance",
+ "V_out_min=V_REF*(1+(R2_min/R1))+I_ADJ*R2_min;",
+ "R2_max=5000.0; #max value of resistance",
+ "V_out_max=V_REF*(1+(R2_max/R1))+I_ADJ*R2_max;",
+ "",
+ "#result",
+ "print \"minimum output voltage = %.2f volt\" %V_out_min",
+ "print \"maximum output voltage = %.2f volt\" %V_out_max"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum output voltage = 1.25 volt",
+ "maximum output voltage = 29.91 volt"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.9,Page Number: 64<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Load regulation percentage'''",
+ "",
+ "V_NL=5.18 #No load output voltage",
+ "V_FL=5.15 #Full load output voltage",
+ "load_reg=((V_NL-V_FL)/V_FL)*100 #In percentage",
+ "print('load regulation percent = %.2f%% '%load_reg)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "load regulation percent = 0.58% "
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.10, Page Number: 66<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Negative diode limiter'''",
+ "",
+ "import pylab as py",
+ "import numpy as np",
+ "",
+ "#let input wave be V_in=V_p_in*sin(2*%pi*f*t) ",
+ "f=1.0; #Frequency is 1Hz",
+ "T=1/f;",
+ "R_1=100.0; #Resistances in ohms",
+ "R_L=1000.0; #Load",
+ "V_p_in=10.0; #Peak input voltage",
+ "V_th=0.7; #knee voltage of diode",
+ "",
+ "V_p_out=V_p_in*(R_L/(R_L+R_1)); #peak output voltage",
+ "print('peak output voltage = %.2f V'%V_p_out)",
+ "",
+ "t = np.arange(0, 3.5 , 0.0005)",
+ "z=V_p_in*np.sin(2*np.pi*f*t)*(R_L/(R_L+R_1))",
+ "",
+ "subplot(211)",
+ "plot(t,z)",
+ "ylim(-9.09,9.09)",
+ "title('Input Voltage Waveform')",
+ "",
+ "subplot(212)",
+ "plot(t,z)",
+ "ylim(-0.07,9.09)",
+ "title('Output Voltage Waveform')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak output voltage = 9.09 V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 12,
+ "text": [
+ "<matplotlib.text.Text at 0xa3bf44c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEICAYAAACgQWTXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXl4TNcbx78TiSWWiC1kIYgtliSEoEJCa21SlFoqYqvu\npTtKaavtT1vVhaou9tpVaZFaakpjJ4RErImEBIkQ2cgy5/fHa0YSk2Qy9965986cz/N4Hpm5c86b\nd06+973vOec9GsYYA4fD4XCsAju5DeBwOByOeHBR53A4HCuCizqHw+FYEVzUORwOx4rgos7hcDhW\nBBd1DofDsSK4qHMUj1arhYeHh9xmKIbc3FyEhISgdu3aGDFihNzmcBQGF3Urx9PTE3v37pW8nzlz\n5iAsLKzU9/v374/Zs2c/9vrWrVvRqFEj6HQ6k/vy9PTEP//8Y5adQli7di28vb2LvfbUU08ZfW3e\nvHmS2bFp0ybcunUL6enpWL9+vWT9cNQJF3UrR6PRQKPRyG0Gxo0bh9WrVz/2+qpVqzBmzBjY2Zk+\nFDUaDeTYM9ezZ0/ExcXh9u3bAICCggKcPn0a9+/fR1pamuG1w4cPo1evXpLZcfXqVbRs2bJCPtNT\nUFAggUUcRcE4Vo2npyfbu3cvY4yxZcuWsSeeeIK98847zNnZmTVt2pTt3LnTcG2vXr3YtGnTWJcu\nXVitWrXYM888w9LT0xljjO3bt4+5u7sXa7tJkyZsz549bOfOnaxy5crMwcGB1ah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Tqez3l2Q9U3P+CRd3YJqTr16+Xe821a9eEdi0Kptiv0Whw\n8OBB+Pj4YODAgYiNjbW0mWajZN+bgpp8n5CQgKioKAQEBBR7XQ3fQWm2K93/Op0Ovr6+cHFxQXBw\nMLy9vYu9r3Tfl2e/Of43e/VL0U5NoeTdRikbk0yxo2PHjkhKSoKjoyN27tyJwYMH44KKzltTqu9N\nQS2+z8rKwrBhw/Dtt9+ihpEC6kr+DsqyXen+t7Ozw6lTp5CRkYF+/fpBq9U+tmtdyb4vz35z/C84\nUjdlE1LJa65duwY3NzehXYuCKfbXrFnT8Jg0YMAA5OfnI10lRWGU7HtTUIPv8/Pz8eyzz2LMmDEY\nPHjwY+8r+Tsoz3Y1+B8AnJycMGjQIBw/frzY60r2fVFKs98c/wsWdVM2IYWGhmLlypUAgMOHD6N2\n7dpwcXER2rUomGL/zZs3DXf7o0ePgjFmNPelRJTse1NQuu8ZY5g4cSK8vb0xdepUo9co9TswxXYl\n+z8tLQ13794FAOTm5mL37t3w8/Mrdo1SfQ+YZr85/hecfiltE9KSJUsAAC+++CIGDhyIHTt2wMvL\nC9WrV8eyZcuEdisapti/adMmLF68GPb29nB0dMS6detktvoRo0aNwr///ou0tDR4eHjgo48+Qv7D\nE7OV7nugfPuV7HsAiIyMxOrVq9GhQwfDH+Rnn32GxMREAMr+DkyxXcn+T0lJQXh4OHQ6HXQ6HcLC\nwtCnTx/VaI8p9pvjf775iMPhcKwIyY+z43A4HI7l4KLO4XA4VgQXdQ6Hw7EiuKhzOByOFcFFncPh\ncKwILuocDodjRfwfUaYhEUjyJ+wAAAAASUVORK5CYII=\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.11, Page Number: 67<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Positive and negative Diode limiter'''",
+ "",
+ "#from pylab import figure, show",
+ "#from numpy import arange, sin, pi,bool",
+ "#import numpy as np",
+ "import pylab as py",
+ "import numpy as np",
+ "#let input wave be V_in=V_p_in*sin(2*%pi*f*t) ",
+ "f=1.0; #Frequency is 1Hz",
+ "T=1/f;",
+ "V_p_in=10; #Peak input voltage",
+ "V_th=0.7; #knee voltage of diode",
+ "print('max output voltage is 5.7V')",
+ "print('min output voltage is -5.7V')",
+ "",
+ "###############GRAPH Plotting#################################",
+ "t = arange(0.0,4.5,0.0005)",
+ "V_in=V_p_in*sin(2*pi*f*t);",
+ "",
+ "Vout=V_in;",
+ "#fig = figure(2)",
+ "subplot(211)",
+ "plot(t,V_in)",
+ "#ax2.grid(True)",
+ "ylim( (-10,10) )",
+ "title('Input to the +ve and -ve diode limiter ')",
+ "subplot(212)",
+ "plot(t,V_in)",
+ "#ax1.grid(True)",
+ "ylim( (-5.7,5.7) )",
+ "title('Output of +ve and -ve diode limiter')",
+ " "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "max output voltage is 5.7V",
+ "min output voltage is -5.7V"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 13,
+ "text": [
+ "<matplotlib.text.Text at 0xa6c976c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEICAYAAAC+iFRkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXlYldX2x7+HQQFBZJBZZlBBRcxEUxI0BxxKsxRNzbK5\nvJm3uln5E7uledUGs8G6XdHMuUFTwhGcUKkky1lGmcUEZZLhnP37Y3eODOfAyznvsN/j+3keHuWc\n9+y9zmLt9a537b3XVhFCCBQUFBQUzBoLqQVQUFBQUBAexdkrKCgo3AUozl5BQUHhLkBx9goKCgp3\nAYqzV1BQULgLUJy9goKCwl2A4uwVOJOamooePXpILQYTzJkzB4sWLZJaDMTExODrr78GAHz77bcY\nM2aMUe0kJCRg1qxZRn3W398f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PD\nli1bBJVp+vTpOHz4MK5fv44ePXpgyZIlaGho0Mkjto64yiW2ngDg+PHj2LhxI/r164fIyEgAwNKl\nS3H16lWdXGLri4tMYuuquLgYj/9/O3dsAkAMQgHU3ZwjZP8l5KqDlOGKs/C9CUSSXwi6d1RVVFWs\ntSIzW//eTU0db+r0jmc6+3RT05c+tRxCA+BfNmgBBhD2AAMIe4ABhD3AAMIeYABhDzDAAwJBIdo4\nx/PeAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.12, Page Number: 76<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Positive diode limiter'''",
+ "",
+ "#variable declaration",
+ "V_p_in=18.0; #peak input voltage is 18V",
+ "V_supply=12.0;",
+ "R2=100.0;",
+ "R3=220.0; #resistances in ohms",
+ "#calculation",
+ "V_bias=V_supply*(R3/(R2+R3));",
+ "",
+ "#result",
+ "print('diode limiting the voltage at this voltage =%fV'%V_bias)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diode limiting the voltage at this voltage =8.250000V"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 2.13, Page Number: 78<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Negative Clamping circuit'''",
+ "",
+ "V_p_in=24.0;",
+ "V_DC=-(V_p_in-0.7); #DC level added to output",
+ "print('V_DC = %.1fV'%V_DC)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_DC = -23.3V"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter3.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter3.ipynb
new file mode 100644
index 00000000..41e63a83
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter3.ipynb
@@ -0,0 +1,377 @@
+{
+ "metadata": {
+ "name": "Chapter_3"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 3: Special-purpose Diodes<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.1, Page Number:88<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Zener Impedence'''",
+ "",
+ "# variable declaration",
+ "delVZ=50*10**-3; #voltage in volts, from graph",
+ "delIZ=5*10**-3; #current in amperes, from rgraph",
+ "",
+ "#calculation",
+ "ZZ=delVZ/delIZ; #zener impedence",
+ "",
+ "# result",
+ "print \"zener impedance = %d ohm \" %ZZ"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zener impedance = 10 ohm "
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.2, Page Number:89<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Voltage accross zener terminals'''",
+ "",
+ "# variable declaration",
+ "I_ZT=37*10**-3; #IN AMPERES",
+ "V_ZT=6.80; #IN VOLTS",
+ "Z_ZT=3.50; #IN OHMS",
+ "I_Z=50*10**-3; #IN AMPERES",
+ "",
+ "#calculation",
+ "DEL_I_Z=I_Z-I_ZT; #change current",
+ "DEL_V_Z=DEL_I_Z*Z_ZT; #change voltage",
+ "V_Z=V_ZT+DEL_V_Z; #voltage across zener terminals",
+ "print \"voltage across zener terminals when current is 50 mA = %.3f volts\" %V_Z",
+ "I_Z=25*10**-3; #IN AMPERES",
+ "DEL_I_Z=I_Z-I_ZT; #change current",
+ "DEL_V_Z=DEL_I_Z*Z_ZT; #change voltage",
+ "V_Z=V_ZT+DEL_V_Z; #voltage across zener terminals",
+ "",
+ "#result",
+ "print \"voltage across zener terminals when current is 25 mA = %.3f volts\" %V_Z"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage across zener terminals when current is 50 mA = 6.845 volts",
+ "voltage across zener terminals when current is 25 mA = 6.758 volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.3, Page Number:90<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Zener Voltage'''",
+ "",
+ "# variable declaration",
+ "V_Z=8.2; #8.2 volt zener diode",
+ "TC=0.0005; #Temperature coefficient (per degree celsius)",
+ "T1=60; #Temperature 1 in celsius",
+ "T2=25; #Temperature 2 in celsius",
+ "",
+ "#calculation",
+ "DEL_T=T1-T2; #change in temp",
+ "del_V_Z=V_Z*TC*DEL_T; #change in voltage",
+ "voltage=V_Z+del_V_Z; #zener voltage",
+ "",
+ "#result",
+ "print \"zener voltage at 60 degree celsius = %.3f volt\" %voltage"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "zener voltage at 60 degree celsius = 8.343 volt"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.4, Page Number:90<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Power dissipation'''",
+ "",
+ "# variable declaration",
+ "P_D_max=400*10**-3; #power in watts",
+ "df=3.2*10**-3 #derating factor in watts per celsius",
+ "del_T=(90-50); #in celsius, temperature difference",
+ "",
+ "#calculation",
+ "P_D_deru=P_D_max-df*del_T; #power dissipated",
+ "P_D_der=P_D_deru*1000;",
+ "",
+ "#result",
+ "print \"maximum power dissipated at 90 degree celsius = %d mW\" %P_D_der"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum power dissipated at 90 degree celsius = 272 mW"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.5, Page Number: 92<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Zener Diode voltage regulation'''",
+ "",
+ "# variable declaration",
+ "V_Z=5.1;",
+ "I_ZT=49*10**-3;",
+ "I_ZK=1*10**-3;",
+ "Z_Z=7;",
+ "R=100;",
+ "P_D_max=1;",
+ "",
+ "#calculation",
+ "V_out=V_Z-(I_ZT-I_ZK)*Z_Z; #output voltage at I_ZK",
+ "V_IN_min=I_ZK*R+V_out; #input voltage",
+ "I_ZM=P_D_max/V_Z; #current",
+ "V_out=V_Z+(I_ZM-I_ZT)*Z_Z; #output voltage at I_ZM",
+ "V_IN_max=I_ZM*R+V_out; #max input voltage",
+ "",
+ "#result",
+ "print \"maximum input voltage regulated by zener diode = %.3f volts\" %V_IN_max",
+ "print \"minimum input voltage regulated by zener diode = %.3f volts\" %V_IN_min"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum input voltage regulated by zener diode = 25.737 volts",
+ "minimum input voltage regulated by zener diode = 4.864 volts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.6, Page Number: 93<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Min & Max current'''",
+ "",
+ "# variable declaration",
+ "V_Z=12.0; #voltage in volt",
+ "V_IN=24.0; #ip voltage in volt",
+ "I_ZK=0.001; #current in ampere",
+ "I_ZM=0.050; #current in ampere ",
+ "Z_Z=0; #impedence",
+ "R=470; #resistance in ohm",
+ "",
+ "#calculation",
+ "#when I_L=0, I_Z is max and is equal to the total circuit current I_T",
+ "I_T=(V_IN-V_Z)/R; #current",
+ "I_Z_max=I_T; #max current",
+ "if I_Z_max<I_ZM : # condition for min currert ",
+ " I_L_min=0;",
+ "",
+ "I_L_max=I_T-I_ZK; #max current",
+ "R_L_min=V_Z/I_L_max; #min resistance",
+ "",
+ "#result",
+ "print \"minimum value of load resistance = %.2f ohm\" %R_L_min",
+ "print \"minimum curent = %.3f ampere\" %I_L_min",
+ "print \"maximum curent = %.3f ampere\" %I_L_max"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum value of load resistance = 489.16 ohm",
+ "minimum curent = 0.000 ampere",
+ "maximum curent = 0.025 ampere"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.7, Page Number: 94<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' to find load resistance'''",
+ "",
+ "# variable declaration",
+ "V_IN=24.0; #voltage in volt",
+ "V_Z=15.0; #voltage in volt",
+ "I_ZK=0.25*10**-3; #current in ampere",
+ "I_ZT=17*10**-3; #current in ampere",
+ "Z_ZT=14.0; #impedence",
+ "P_D_max=1.0; #max power dissipation",
+ "",
+ "#calculation",
+ "V_out_1=V_Z-(I_ZT-I_ZK)*Z_ZT; #output voltage at I_ZK",
+ "print \"output voltage at I_ZK = %.2f volt\" %V_out_1",
+ "I_ZM=P_D_max/V_Z;",
+ "",
+ "V_out_2=V_Z+(I_ZM-I_ZT)*Z_ZT; #output voltage at I_ZM",
+ "print \"output voltage a I_ZM = %.2f volt\" %V_out_2",
+ "R=(V_IN-V_out_2)/I_ZM; #resistance",
+ "print \"value of R for maximum zener current, no load = %.2f ohm\" %R",
+ "print \"closest practical value is 130 ohms\"",
+ "R=130.0;",
+ "#for minimum load resistance(max load current) zener current is minimum (I_ZK)",
+ "I_T=(V_IN-V_out_1)/R; #current",
+ "I_L=I_T-I_ZK; #current",
+ "R_L_min=V_out_1/I_L; #minimum load resistance",
+ "",
+ "#result",
+ "print \"minimum load resistance = %.2f ohm\" %R_L_min"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output voltage at I_ZK = 14.77 volt",
+ "output voltage a I_ZM = 15.70 volt",
+ "value of R for maximum zener current, no load = 124.57 ohm",
+ "closest practical value is 130 ohms",
+ "minimum load resistance = 208.60 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 3.8, Page Number: 96<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Zener limiting'''",
+ "",
+ "#variable declaration",
+ "V_p_in=10.0; #Peak input voltage",
+ "V_th=0.7; #forward biased zener",
+ "V_Z1=5.1;",
+ "V_Z2=3.3;",
+ "",
+ "V_p_in=20.0;",
+ "V_Z1=6.2;",
+ "V_Z2=15.0;",
+ "",
+ "#result",
+ "print('max voltage = %.1f V'%(V_Z1+V_th))",
+ "print('min voltage = %.1f V'%(-(V_Z2+V_th)))"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "max voltage = 6.9 V",
+ "min voltage = -15.7 V"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter4.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter4.ipynb
new file mode 100644
index 00000000..b76b7b18
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter4.ipynb
@@ -0,0 +1,455 @@
+{
+ "metadata": {
+ "name": "Chapter_4"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 4: Bipolar Junction Transistors (BJTs)<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.1, Page Number: 120 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Emitter current'''",
+ "",
+ "# variable declaration",
+ "I_C=3.65*10**-3; #collector current in amperes",
+ "I_B=50*10**-6; #base current in amperes",
+ "",
+ "#calculation",
+ "B_DC=I_C/I_B; #B_DC value",
+ "I_E=I_B+I_C; #current in ampere",
+ "",
+ "# result",
+ "print \"B_DC = %d \" %B_DC",
+ "print \"Emitter current = %.4f ampere\" %I_E"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B_DC = 73 ",
+ "Emitter current = 0.0037 ampere"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.2, Page Number: 121<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Current and Voltage values'''",
+ "",
+ "# variable declaration",
+ "V_BE=0.7; # voltage in volt",
+ "B_DC=150; # voltage in volt",
+ "V_BB=5; # voltage in volt",
+ "V_CC=10; # voltage in volt",
+ "R_B=10*10**3; # resistance in ohm",
+ "R_C=100; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_B=(V_BB-V_BE)/R_B; #base current in amperes",
+ "I_C=B_DC*I_B; #collector current in amperes",
+ "I_E=I_C+I_B; #emitter current in amperes",
+ "V_CE=V_CC-I_C*R_C; #collector to emitter voltage in volts",
+ "V_CB=V_CE-V_BE; #collector to base voltage in volts",
+ "",
+ "# result",
+ "print \"base current = %.5f amperes\" %I_B",
+ "print \"collector current = %.4f amperes\" %I_C",
+ "print \"emitter current = %.5f amperes\" %I_E",
+ "print \"collector to emitter voltage =%.2f volts\" %V_CE",
+ "print \"collector to base voltage =%.2f volts\" %V_CB"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "base current = 0.00043 amperes",
+ "collector current = 0.0645 amperes",
+ "emitter current = 0.06493 amperes",
+ "collector to emitter voltage =3.55 volts",
+ "collector to base voltage =2.85 volts"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.3, Page Number: 123<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Ideal family of collector curve'''",
+ "",
+ "",
+ "import pylab as py",
+ "import numpy as np",
+ "",
+ "#variable declaration",
+ "beta=100 # current gain",
+ "print'Ideal family of collector curve'",
+ "",
+ "ic1 = arange(0.00001, 0.45, 0.0005)",
+ "ic2 = arange(0.00001, 0.5, 0.0005)",
+ "ic3 = arange(0.00001, 0.6, 0.0005)",
+ "ic4 = arange(0.00001, 0.7, 0.0005)",
+ "vcc1=ic1*0.5/0.7",
+ "vcc2=ic2*1.35/0.7",
+ "vcc3=ic3*2/0.7",
+ "vcc4=ic4*2.5/0.7",
+ "m1=arange(0.45,5.0,0.0005)",
+ "m2=arange(0.5,5.0,0.0005)",
+ "m3=arange(0.6,5.0,0.0005)",
+ "m4=arange(0.7,5.0,0.0005)",
+ "",
+ "plot(ic1,vcc1,'b')",
+ "plot(ic2,vcc2,'b')",
+ "plot(ic3,vcc3,'b')",
+ "plot(ic4,vcc4,'b')",
+ "plot(m1,0.32*m1/m1,'b')",
+ "plot(m2,0.96*m2/m2,'b')",
+ "plot(m3,1.712*m3/m3,'b')",
+ "plot(m4,2.5*m4/m4,'b')",
+ "",
+ "ylim( (0,3) )",
+ "ylabel('Ic(mA)')",
+ "xlabel('Vce(V)')",
+ "title('Ideal family of collector curve')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ideal family of collector curve"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 4,
+ "text": [
+ "<matplotlib.text.Text at 0xa11e74c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEXCAYAAABLZvh6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYVPW6B/DvIHjhIkop4IBg4gVSAcVIQ0UNTVOizBQz\nUalQj6nVfmrno0dteyzTrWm2Pdb2caeluPV4QbnkJUa8czS8ZB4vKHIVREEhlevv/LFiYGCAQefC\nzPp+nocn1qzLvIy0XtbvXb93KYQQAkREJEtWpg6AiIhMh0mAiEjGmASIiGSMSYCISMaYBIiIZIxJ\ngIhIxpgEZCwtLQ1WVlaorKx86mN5enri8OHDWtc9evQIY8eORbt27TBhwoSnfq+a0tPT4eDggKo7\nnYODg7Fx40a9vgcA7N69G+7u7nBwcMD58+f1ckyVSgV3d3f1ckOfIZGhMAlYOGOdW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JERDLGJEBEJGNMAkREMsYkQEQkY/8PuzhceEoO66YAAAAASUVORK5C\nYII=\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.4, Page Number: 125<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Transistor saturtion condition'''",
+ "",
+ "# variable declaration",
+ "V_CE_sat=0.2; # voltage in volt",
+ "V_BE=0.7; # voltage in volt",
+ "V_BB=3; # voltage in volt",
+ "V_CC=10; # voltage in volt",
+ "B_DC=50; # voltage in volt",
+ "R_B=10*10**3; # resistance in ohm",
+ "R_C=1*10**3; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_C_sat=(V_CC-V_CE_sat)/R_C; # saturation current",
+ "I_B=(V_BB-V_BE)/R_B; # base current",
+ "I_C=B_DC*I_B; # current in ampere",
+ "",
+ "# result",
+ "if I_C>I_C_sat:",
+ " print \"transistor in saturation\"",
+ "else:",
+ " print \"transistor not in saturation\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "transistor in saturation"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.5, Page Number: 127<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''maximum collector current'''",
+ "",
+ "#Variable declaration",
+ "P_D_max=250*10**-3; #max power rating of transistor in watts",
+ "V_CE=6; #voltage in volt",
+ "",
+ "#Calculation",
+ "I_Cu=P_D_max/V_CE; #Current (Amp)",
+ "I_C=I_Cu*1000;",
+ "",
+ "#Result",
+ "print \"collector current that can be handled by the transistor = %.1f mA\" %I_C",
+ "print \"\\nRemember that this is not necessarily the maximum IC. The transistor\"",
+ "print \"can handle more collectore current if Vce is reduced as long as PDmax\"",
+ "print \"is not exceeded.\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "collector current that can be handled by the transistor = 41.7 mA",
+ "",
+ "Remember that this is not necessarily the maximum IC. The transistor",
+ "can handle more collectore current if Vce is reduced as long as PDmax",
+ "is not exceeded."
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.6, Page Number: 127<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltage drop across transistor''' ",
+ "",
+ "#Variable declaration",
+ "P_D_max=800*10**-3; #max power rating of transistor in watts",
+ "V_BE=0.7; #voltage in volt",
+ "V_CE_max=15; #voltage in volt",
+ "I_C_max=100*10**-3; #Current (Amp)",
+ "V_BB=5; #voltage in volt",
+ "B_DC=100; #voltage in volt",
+ "R_B=22*10**3; # resistance in ohm",
+ "R_C=10**3; # resistance in ohm",
+ "",
+ "#Calculation",
+ "I_B=(V_BB-V_BE)/R_B; # base current",
+ "I_C=B_DC*I_B; #collector current ",
+ "V_R_C=I_C*R_C; #voltage drop across R_C",
+ "V_CC_max=V_CE_max+V_R_C; #Vcc max in volt",
+ "P_D=I_C*V_CE_max; #max power rating",
+ "",
+ "#Result",
+ "if P_D<P_D_max:",
+ " print \"V_CC = %.2f volt\" %V_CC_max",
+ " print \"V_CE_max will be exceeded first because entire supply voltage V_CC will be dropped across the transistor\"",
+ " "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_CC = 34.55 volt",
+ "V_CE_max will be exceeded first because entire supply voltage V_CC will be dropped across the transistor"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.7, Page Number: 128<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power dissipation'''",
+ "",
+ "#Variable declaration",
+ "df=5*10**-3; #derating factor in watts per degree celsius",
+ "T1=70; #temperature 1",
+ "T2=25; #temperature 2",
+ "P_D_max=1; #in watts",
+ "",
+ "#Calculation",
+ "del_P_D=df*(T1-T2); #change due to temperature",
+ "P_D=P_D_max-del_P_D; # power dissipation",
+ "",
+ "#Result",
+ "print \"Power dissipated max at a temperature of 70 degree celsius = %.3f watts\" %P_D"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power dissipated max at a temperature of 70 degree celsius = 0.775 watts"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.8, Page Number: 130<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''voltage gain'''",
+ "",
+ "#Variable declaration",
+ "R_C=1*10**3; #resistance in ohm",
+ "r_e=50; #resistance in ohm",
+ "V_b=100*10**-3; #voltage in volt",
+ "",
+ "#Calculation",
+ "A_v=R_C/r_e; #voltage gain",
+ "V_out=A_v*V_b; #voltage in volt",
+ "",
+ "#Result",
+ "print \"voltage gain = %d \" %A_v",
+ "print \"AC output voltage = %d volt\" %V_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain = 20 ",
+ "AC output voltage = 2 volt"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 4.9, Page Number: 132 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power dissipation'''",
+ "",
+ "#Variable declaration",
+ "V_CC=10.0; #voltage in volt",
+ "B_DC=200.0; #voltage in volt",
+ "R_C=1.0*10**3; #resistance in ohm",
+ "V_IN=0.0; #voltage in volt",
+ "",
+ "#Calculation",
+ "V_CE=V_CC; #equal voltage",
+ "print \"when V_IN=0, transistor acts as open switch(cut-off) and collector emitter voltage = %.2f volt\" %V_CE",
+ "#now when V_CE_sat is neglected",
+ "I_C_sat=V_CC/R_C; #saturation current",
+ "I_B_min=I_C_sat/B_DC; #minimum base current",
+ "print \"\\nminimum value of base current to saturate transistor = %.5f ampere\" %I_B_min",
+ "V_IN=5; #voltage in volt",
+ "V_BE=0.7; #voltage in volt",
+ "V_R_B=V_IN-V_BE; #voltage across base resiatance",
+ "R_B_max=V_R_B/I_B_min;",
+ "",
+ "",
+ "#Result",
+ "kw=round (R_B_max)",
+ "print \"\\nmaximum value of base resistance when input voltage is 5V = %d ohm\" %kw"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V_IN=0, transistor acts as open switch(cut-off) and collector emitter voltage = 10.00 volt",
+ "",
+ "minimum value of base current to saturate transistor = 0.00005 ampere",
+ "",
+ "maximum value of base resistance when input voltage is 5V = 86000 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter5.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter5.ipynb
new file mode 100644
index 00000000..1b456628
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter5.ipynb
@@ -0,0 +1,427 @@
+{
+ "metadata": {
+ "name": "Chapter_5"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 5: Transistor Bias Circuits<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.1, Page Number: 146<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Peak base current'''",
+ "",
+ "# variable declaration",
+ "V_BB=10.0; #voltage in volt",
+ "V_CC=20.0; #voltage in volt",
+ "B_DC=200.0; #B_DC value",
+ "R_B=47.0*10**3; #resistance in ohm",
+ "R_C=330.0; #resistance in ohm",
+ "V_BE=0.7; #voltage in volt",
+ "",
+ "#current",
+ "I_B=(V_BB-V_BE)/R_B; #base current",
+ "I_C=B_DC*I_B; #Q POINT",
+ "V_CE=V_CC-I_C*R_C; #Q POINT",
+ "I_C_sat=V_CC/R_C; #saturation current",
+ "I_c_peak=I_C_sat-I_C; #peak current ",
+ "I_b_peak=I_c_peak/B_DC; #peak current in ampere",
+ "",
+ "#result",
+ "print \"Q point of I_C = %.3f amperes\" %I_C",
+ "print \"Q point of V_CE = %.2f volts\" %V_CE",
+ "print \"peak base current = %.4f amperes\" %I_b_peak"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q point of I_C = 0.040 amperes",
+ "Q point of V_CE = 6.94 volts",
+ "peak base current = 0.0001 amperes"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.2, Page Number: 149<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' DC input resistance'''",
+ "",
+ "# variable declaration",
+ "B_DC=125.0; #DC value",
+ "R_E=10.0**3; #resistance in ohm",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E; #base resistance",
+ "",
+ "#Result",
+ "print \"DC input resistance, looking at base of transistor = %d ohm\" %R_IN_base"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC input resistance, looking at base of transistor = 125000 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.3, Page Number: 151<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Transistor saturation condition'''",
+ "",
+ "# variable declaration",
+ "B_DC=100; #DC value",
+ "R1=10*10**3; #resistance in ohm",
+ "R2=5.6*10**3; #resistance in ohm",
+ "R_C=1*10**3; #resistance in ohm",
+ "R_E=560; #resistance in ohm",
+ "V_CC=10; #voltage in volt",
+ "V_BE=0.7 #voltage in volt",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E; #calculate base resistance",
+ "#We can neglect R_IN_base as it is equal to 10*R2",
+ "print \"input resistance seen from base = %d ohm\" %R_IN_base",
+ "print \"which can be neglected as it is 10 times R2\"",
+ "",
+ "V_B=(R2/(R1+R2))*V_CC; #base voltage",
+ "V_E=V_B-V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "I_C=I_E; #currents are equal",
+ "V_CE=V_CC-I_C*(R_C+R_E); #voltage in volt",
+ "",
+ "#result",
+ "print \"V_CE = %.2f volts\" %V_CE",
+ "print \"I_C = %.3f amperes\" %I_C",
+ "print \"Since V_CE>0V, transistor is not in saturation\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance seen from base = 56000 ohm",
+ "which can be neglected as it is 10 times R2",
+ "V_CE = 1.95 volts",
+ "I_C = 0.005 amperes",
+ "Since V_CE>0V, transistor is not in saturation"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.4, Page Number: 154<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Emitter-Collector Voltage'''",
+ "",
+ "# variable declaration",
+ "V_EE=10.0; #voltage in volt",
+ "V_BE=0.7; #voltage in volt",
+ "B_DC=150.0; #DC value ",
+ "R1=22.0*10**3; #resistance in ohm",
+ "R2=10.0*10**3; #resistance in ohm",
+ "R_C=2.2*10**3; #resistance in ohm",
+ "R_E=1.0*10**3; #resistance in ohm",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E; #R_IN_base>10*R2,so it can be neglected",
+ "print \"input resistance as seen from base = %d ohm\" %R_IN_base",
+ "print \"it can be neglected as it is greater than 10 times R2\"",
+ "V_B=(R1/(R1+R2))*V_EE; #base voltage",
+ "V_E=V_B+V_BE; #emitter voltage",
+ "I_E=(V_EE-V_E)/R_E; #emitter current",
+ "I_C=I_E; #currents are equal",
+ "V_C=I_C*R_C; #collector voltage",
+ "V_EC=V_E-V_C; #emitter-collector voltage",
+ "",
+ "#result",
+ "print \"I_C collector current = %.4f amperes\" %I_C",
+ "print \"V_EC emitter-collector voltage = %.2f Volts\" %V_EC"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance as seen from base = 150000 ohm",
+ "it can be neglected as it is greater than 10 times R2",
+ "I_C collector current = 0.0024 amperes",
+ "V_EC emitter-collector voltage = 2.24 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.5, PAge Number: 154<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Collector-Emitter Voltage'''",
+ "",
+ "# variable declaration",
+ "R1=68.0*10**3; #resistance in ohm",
+ "R2=47.0*10**3; #resistance in ohm",
+ "R_C=1.8*10**3; #resistance in ohm",
+ "R_E=2.2*10**3; #resistance in ohm",
+ "V_CC=-6.0; #voltage in volt",
+ "V_BE=0.7; #voltage in volt",
+ "B_DC=75.0; #DC value",
+ "",
+ "#calculation",
+ "R_IN_base=B_DC*R_E;",
+ "print \"input resistance as seen from base\"",
+ "print \"is not greater than 10 times R2 so it should be taken into account\"",
+ "#R_IN_base in parallel with R2",
+ "V_B=((R2*R_IN_base)/(R2+R_IN_base)/(R1+(R2*R_IN_base)/(R2+R_IN_base)))*V_CC;",
+ "V_E=V_B+V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "I_C=I_E; #currents are equal",
+ "V_C=V_CC-I_C*R_C; #collector voltage",
+ "V_CE=V_C-V_E; #collector-emitter voltage",
+ "",
+ "#result",
+ "print \"collector current = %.4f amperes\" %I_C",
+ "print \"collector emitter voltage = %.2f volts\" %V_CE"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance as seen from base",
+ "is not greater than 10 times R2 so it should be taken into account",
+ "collector current = -0.0006 amperes",
+ "collector emitter voltage = -3.46 volts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.6, Page Number: 156<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' change in collector emitter voltage'''",
+ "",
+ "# variable declaration",
+ "V_CC=12.0; #voltage in volt",
+ "R_B=100.0*10**3; #resistance in ohm",
+ "R_C=560.0; #resistance in ohm",
+ "#FOR B_DC=85 AND V_BE=0.7V",
+ "B_DC=85.0; #DC value",
+ "V_BE=0.7; #base-emitter voltage",
+ "",
+ "#calculation",
+ "I_C_1=B_DC*(V_CC-V_BE)/R_B; #collector current",
+ "V_CE_1=V_CC-I_C_1*R_C; #collector-emittor voltage",
+ "#FOR B_DC=100 AND V_BE=0.6V",
+ "B_DC=100.0; #DC value ",
+ "V_BE=0.6; #base emitter voltage",
+ "I_C_2=B_DC*(V_CC-V_BE)/R_B; #collector current",
+ "V_CE_2=V_CC-I_C_2*R_C; #voltage in volt",
+ "p_del_I_C=((I_C_2-I_C_1)/I_C_1)*100; #percent change in collector current ",
+ "p_del_V_CE=((V_CE_2-V_CE_1)/V_CE_1)*100; #percent change in C-E voltage",
+ "",
+ "#result",
+ "print \"percent change in collector current = %.2f\" %p_del_I_C",
+ "print \"percent change in collector emitter voltage = %.2f\" %p_del_V_CE"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percent change in collector current = 18.69",
+ "percent change in collector emitter voltage = -15.18"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.7, Page Number: 159<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' percent change in collector emitter voltage'''",
+ "",
+ "# variable declaration",
+ "V_CC=20.0; #voltage in volt",
+ "R_C=4.7*10**3; #resistance in ohm",
+ "R_E=10.0*10**3; #resistance in ohm",
+ "V_EE=-20.0; #voltage in volt",
+ "R_B=100*10**3; #resistance in ohm",
+ "#FOR B_DC=85 AND V_BE=0.7V",
+ "B_DC=85; #DC value",
+ "V_BE=0.7; #base-emitter voltage",
+ "I_C_1=(-V_EE-V_BE)/(R_E+(R_B/B_DC));",
+ "V_C=V_CC-I_C_1*R_C; #colector voltage",
+ "I_E=I_C_1; #emittor current",
+ "V_E=V_EE+I_E*R_E; #emittor voltage",
+ "V_CE_1=V_C-V_E; #CE voltage",
+ "print \"I_C_1 = %.3f\" %I_C_1",
+ "print \"V_CE_1 = %.2f\" %V_CE_1",
+ "#FOR B_DC=100 AND V_BE=0.6V",
+ "B_DC=100; #DC value ",
+ "V_BE=0.6; #base-emitter voltage",
+ "I_C_2=(-V_EE-V_BE)/(R_E+(R_B/B_DC));",
+ "V_C=V_CC-I_C_2*R_C;#colector voltage",
+ "I_E=I_C_2; #emittor current",
+ "V_E=V_EE+I_E*R_E; #emittor voltage",
+ "V_CE_2=V_C-V_E; #CE voltage",
+ "print \"I_C_2 = %.3f\" %I_C_2",
+ "print \"V_CE_2 = %.2f\" %V_CE_2",
+ "",
+ "p_del_I_C=((I_C_2-I_C_1)/I_C_1)*100;",
+ "p_del_V_CE=((V_CE_2-V_CE_1)/V_CE_1)*100;",
+ "print \"percent change in collector currrent = %.2f\" %p_del_I_C",
+ "print \"percent change in collector emitter voltage = %.2f\" %p_del_V_CE",
+ "print \"answers in book are approximated\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I_C_1 = 0.002",
+ "V_CE_1 = 14.61",
+ "I_C_2 = 0.002",
+ "V_CE_2 = 14.07",
+ "percent change in collector currrent = 2.13",
+ "percent change in collector emitter voltage = -3.69",
+ "answers in book are approximated"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 5.8, Page Number: 161<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Q point current and voltage'''",
+ "",
+ "# variable declaratio",
+ "V_CC=10.0; #voltage in volt",
+ "B_DC=100.0; #Dc value",
+ "R_C=10.0*10**3; #resistance in ohm",
+ "R_B=100.0*10**3; #resistance in ohm",
+ "V_BE=0.7; #base-emittor voltage",
+ "",
+ "#calculation",
+ "I_C=(V_CC-V_BE)/(R_C+(R_B/B_DC)); #collector current",
+ "V_CE=V_CC-I_C*R_C; #CE voltage",
+ "",
+ "#result",
+ "print \"Q point of collector current %.4f amperes\" %I_C",
+ "print \"Q point of collector-emitter voltage %.3f volts\" %V_CE"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q point of collector current 0.0008 amperes",
+ "Q point of collector-emitter voltage 1.545 volts"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter6.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter6.ipynb
new file mode 100644
index 00000000..b4e7e58a
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter6.ipynb
@@ -0,0 +1,603 @@
+{
+ "metadata": {
+ "name": "Chapter_6"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 6: BJT Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.1, Page Number: 171<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Q point'''",
+ "# result",
+ "",
+ "print \"theoretical example\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "theoretical example"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.2, Page Number: 174<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' AC Emitter resistance'''",
+ "",
+ "# variable declaration",
+ "I_E=2.0*10**-3; #emittor current",
+ "",
+ "#calculation",
+ "r_e=25.0*10**-3/I_E; #ac emitter resistance",
+ "",
+ "#result",
+ "print \"ac emitter resistance = %.2f ohms\" %r_e "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ac emitter resistance = 12.50 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.3, Page Number: 178<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' voltage at base of transistor'''",
+ "",
+ "# variable declaration",
+ "I_E=3.8*10**-3; #emittor current",
+ "B_ac=160.0; #AC value",
+ "R1=22*10**3; #resistance in ohm",
+ "R2=6.8*10**3; #resistance in ohm",
+ "R_s=300.0; #resistance in ohm",
+ "V_s=10.0*10**-3; #voltage in volt",
+ "r_e=25.0*10**-3/I_E; ",
+ "",
+ "#calculation",
+ "R_in_base=B_ac*r_e; #base resistance",
+ "R_in_tot=(R1*R2*R_in_base)/(R_in_base*R1+R_in_base*R2+R1*R2);",
+ "V_b=(R_in_tot/(R_in_tot+R_s))*V_s; #base voltage",
+ "",
+ "#result",
+ "print \"voltage at the base of the transistor = %.3f volts\" %V_b"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage at the base of the transistor = 0.007 volts"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.4, Page Number: 180<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' bypass capacitor'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "R_E=560.0; #resistance in ohm",
+ "f=2*10**3; #minimum value of frequency in hertz",
+ "X_C=R_E/10.0; #minimum value of capacitive reactance",
+ "",
+ "#calculation",
+ "C2=1.0/(2.0*math.pi*X_C*f); #capacitor ",
+ "",
+ "#result",
+ "print \"value of bypass capacitor = %.7f farads\" %C2"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of bypass capacitor = 0.0000014 farads"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.5, Page Number: 181<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' bypass capacitor'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "r_e=6.58; #from ex6.3",
+ "R_C=1.0*10**3; #collector resistance",
+ "R_E=560; #emittor resistance",
+ "",
+ "#calculation",
+ "A_v=R_C/(R_E+r_e); #gain without bypass capacitor",
+ "A_v1=R_C/r_e; #gain with bypass capacitor",
+ "print \"gain without bypass capacitor = %.2f\" %A_v",
+ "print \"gain in the presence of bypass capacitor = %.2f\" %A_v1"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gain without bypass capacitor = 1.76",
+ "gain in the presence of bypass capacitor = 151.98"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.6, Page Number: 182<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Gain with load'''",
+ "",
+ "# variable declaration",
+ "R_C=10.0**3; #resistance in ohm",
+ "R_L=5.0*10**3; #inductor resistance",
+ "r_e=6.58; #r_e value",
+ "",
+ "#calculation",
+ "R_c=(R_C*R_L)/(R_C+R_L); #collector resistor",
+ "A_v=R_c/r_e; #gain with load",
+ "",
+ "#result",
+ "print \"ac collector resistor = %.2f ohms\" %R_c",
+ "print \"gain with load = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ac collector resistor = 833.33 ohms",
+ "gain with load = 126.65"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.7, Page Number: 184<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Voltage gain with bypass'''",
+ "",
+ "# variable declaration",
+ "R_C=3.3*10**3; #resistance in ohm",
+ "R_E1=330.0; #emitter resistance",
+ "",
+ "#calculation",
+ "A_v=R_C/R_E1; #voltage gain",
+ "",
+ "#result",
+ "print \"approximate voltage gain as R_E2 is bypassed by C2 = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "approximate voltage gain as R_E2 is bypassed by C2 = 10.00"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.8, Page Number: 184<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Common emitter amplifier'''",
+ "",
+ "import math",
+ "B_DC=150.0;",
+ "B_ac=175.0;",
+ "V_CC=10.0;",
+ "V_s=10.0*10**-3;",
+ "R_s=600.0;",
+ "R1=47.0*10**3;",
+ "R2=10.0*10**3;",
+ "R_E1=470.0;",
+ "R_E2=470.0;",
+ "R_C=4.7*10**3;",
+ "R_L=47.00*10**3;",
+ "R_IN_base=B_DC*(R_E1+R_E2);",
+ "#since R_IN_base is ten times more than R2,it can be neglected in DC voltage calculation",
+ "V_B=(R2/(R2+R1))*V_CC;",
+ "V_E=V_B-0.7;",
+ "I_E=V_E/(R_E1+R_E2);",
+ "I_C=I_E;",
+ "V_C=V_CC-I_C*R_C;",
+ "print('dc collector voltage = %.3f volts'%V_C)",
+ "r_e=25.0*10**-3/I_E;",
+ "#base resistance",
+ "R_in_base=B_ac*(r_e+R_E1);",
+ "#total input resistance",
+ "R_in_tot=(R1*R2*R_in_base)/(R1*R2+R_in_base*R1+R_in_base*R2);",
+ "attenuation=R_in_tot/(R_s+R_in_tot);",
+ "#ac collector resistance",
+ "R_c=R_C*R_L/(R_C+R_L);",
+ "#voltage gain from base to collector",
+ "A_v=R_c/R_E1;",
+ "#overall voltage gain A_V",
+ "A_V=A_v*attenuation;",
+ "#rms voltage at collector V_c",
+ "V_c=A_V*V_s;",
+ "V_out_p=math.sqrt(2)*V_c;",
+ "print('V_out peak = %d mV'%(V_out_p*1000))",
+ "",
+ "################Waveform plotting##############################",
+ "",
+ "import pylab",
+ "import numpy ",
+ "",
+ "t = arange(0.0, 4.0, 0.0005)",
+ "",
+ "",
+ "subplot(121)",
+ "plot(t, V_C+V_c*sin(2*pi*t))",
+ "ylim( (4.63,4.82) )",
+ "title('Collector Voltage')",
+ "",
+ "subplot(122)",
+ "plot(t, -V_s*sin(2*pi*t))",
+ "plot(t, V_out_p*sin(2*pi*t))",
+ "ylim( (-0.15,0.15) )",
+ "title('Source and output AC voltage')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc collector voltage = 4.728 volts",
+ "V_out peak = 119 mV"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 9,
+ "text": [
+ "<matplotlib.text.Text at 0xad2caac>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEICAYAAABfz4NwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXl8VNX5/z+TzCSZrDPZdxJ2AgipuOBXJahIUcGtKtiy\n1GrBpS4t35/W6he01g33Ulv61SqogEstm4CKGKUuIF8RFSigJJCNrJNlkklme35/HGayTWbunbud\nhPt+vXhp7tx75zPnzjzPOc95znMMRETQ0dHR0TntidBagI6Ojo4OH+gOQUdHR0cHgO4QdHR0dHRO\noTsEHR0dHR0AukPQ0dHR0TmF7hB0dHR0dADoDkEQpaWlyMvL8/9dUFCAjz76SENF8lJeXo6IiAh4\nvV6tpehwyqJFi/Dggw9qLWNI0deu8MBp5RDWrl2LKVOmICEhAdnZ2bjsssvw2Wefib6PwWCAwWCQ\npEXuH9iSJUuwcOHCfsf379+PmJgYNDc3C75XSUkJXn75Zdm0DQX+/e9/47zzzoPFYkFKSgrOP/98\n7N27V2tZqiHHdz4Qy5cvx/z58zW5X0lJCZKTk+F0Ovu9JpetEENBQQF27typ6HuE4rRxCM888wzu\nuecePPDAA6irq0NFRQVuv/12bNq0SWtpYdG3N79o0SK8++676Ojo6HX8tddew+zZs2GxWATfW4kf\n/mCmtbUVV1xxBe666y7YbDZUVVVh2bJliI6Olv29PB6P7PeUi6G0hrW8vBx79uxBenp6Pxugla0w\nGAzatzGdBjQ3N1N8fDy98847A57T2dlJd911F2VnZ1N2djbdfffd1NXVRUREH3/8MeXm5vrPLSgo\noI8++oiIiLxeLz322GM0YsQISklJoeuvv56ampr85+7atYumTp1KFouF8vLy6NVXX6W///3vZDKZ\nKCoqiuLj42nOnDlERHTw4EGaNm0aWSwWGj9+PG3atMl/n4ULF9KSJUto1qxZFBcX53//nowZM4bW\nrFnj/9vtdlN2djZt2rSJvF4v/fGPf6Rhw4ZReno6LViwgFpaWoiIqKysjAwGA7ndbrr//vspMjKS\nYmJiKD4+nn7zm98QEdGdd95JeXl5lJiYSGeeeSbt2rXL/z4dHR20YMECslqtNG7cOHriiSd6tVdV\nVRVdc801lJaWRoWFhfTCCy8IeGr88NVXX5HFYhnw9WBt2/e7Q0Q0bNgw//NbtmwZXXvttfSLX/yC\nEhMT6eWXX6bGxkZatGgRZWdnk9Vqpauuusp/7ebNm2nSpElksVjovPPOo2+//XZAXcGe2bJly+i6\n666jBQsWUEJCAo0fP5727t3rf/3rr7+m4uJiSkhIoBtuuIHmzp1LDzzwgGyff8eOHbRt2zaKiooi\nk8lE8fHxNHnyZCIimjZtGt1333109tlnU2JiIl155ZX+31Q49wvEQw89RLNnz6ZHHnmErrjiCv9x\nIbaiJ19++SVlZmaS1+v1H3v33XfpjDPOICLhduUXv/gFRUREkNlspvj4eFqxYgUREf3sZz+jzMxM\nSkpKogsvvJAOHDjgf5+Ghga64oorKDExkc466yz6wx/+QOeff77/9UOHDtEll1xCycnJNGbMGHrr\nrbdCfp7TwiFs27aNjEYjeTyeAc958MEHaerUqVRfX0/19fV03nnn0YMPPkhEwR3Cc889R1OnTqWq\nqipyOp20ePFimjdvHhERlZeX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ykcJ\nP71ej9OnT2P9+vXw+XzYvXs3MjIyUF1dDQDYt28fioqKYLfbkZ6ejri4OJw7d05xrYsXL+LMmTPQ\n6/WIjY1FTU1N0FplZWW4desWnj59CoPBgCNHjsDr9crOxFOLNxMA3LlzBxcuXEBWVhYEQQAAVFVV\n4fHjx7Kz8dTizdbd3Y3Kykr4/X74/X6Ul5dj7dq1ih5Hnlpy9tm7Am+ZleSSIxL6mqceby7qa+33\nNa1lRAghBAB9U5kQQsggGgiEEEIA0EAghBAyiAYCIYQQADQQCCGEDKKBQAghBADwfwJyXZ807NQ0\nAAAAAElFTkSuQmCC\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.9,Page Number: 190<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Power gain delievered to load'''",
+ "",
+ "# variable declaration",
+ "R_E=10.0**3; #emitter resistance",
+ "R_L=10.0**3; #resistance in ohm",
+ "R1=18.0*10**3; #R1 in ohm",
+ "R2=18.0*10**3; #R2 in ohm",
+ "B_ac=175.0; #AC value",
+ "V_CC=10.0; #voltage in volt",
+ "V_BE=0.7; #base-emitter voltage",
+ "V_in=1.0; #input voltage in volt",
+ "",
+ "#calculation",
+ "",
+ "R_e=(R_E*R_L)/(R_E+R_L); #ac emitter resistance R_e",
+ "R_in_base=B_ac*R_e; #resistance from base R_in_base",
+ "",
+ "#total input resiatance R_in_tot",
+ "R_in_tot=(R1*R2*R_in_base)/(R1*R2+R1*R_in_base+R2*R_in_base);",
+ "print \"total input resistance = %.2f ohms\" %R_in_tot",
+ "V_E=((R2/(R1+R2))*V_CC)-V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "r_e=25.0*10**-3/I_E; #emitter resistance",
+ "A_v=R_e/(r_e+R_e);",
+ "print \"voltage gain = %.2f\" %A_v",
+ "#ac emitter current I_e",
+ "#V_e=A_v*V_b=1V",
+ "V_e=1.0; #V_evoltage",
+ "I_e=V_e/R_e; #emitter current",
+ "I_in=V_in/R_in_tot; #input current in ampere",
+ "A_i=I_e/I_in; #current gain",
+ "print \"current gain = %.2f\" %A_i",
+ "A_p=A_i; #power gain",
+ "#since R_L=R_E, one half of the total power is disspated to R_L",
+ "A_p_load=A_p/2.0; #power load",
+ "print \"power gain delivered to load = %.2f\" %A_p_load"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total input resistance = 8160.62 ohms",
+ "voltage gain = 0.99",
+ "current gain = 16.32",
+ "power gain delivered to load = 8.16"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.10, Page Number: 193<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Overall voltage gain'''",
+ "",
+ "# variable declaration",
+ "V_CC=12.0; #source voltage in volt",
+ "V_BE=0.7; #base-emitter volatge",
+ "R_C=1.0*10**3; #resistance in ohm",
+ "r_e_ce=5.0; #for common emitter amplifier",
+ "R1=10.0*10**3; #resistance in ohm",
+ "R2=22.0*10**3; #resistance in ohm ",
+ "R_E=22.0; #emitter resistance in ohm",
+ "R_L=8.0; #load resistance in ohm",
+ "B_DC=100.0; #dc value",
+ "B_ac=100.0; #ac value",
+ "",
+ "#calculation",
+ "pt=R2+B_DC**2*R_E #temp variable",
+ "V_B=((R2*B_DC**2*R_E/(pt))/(R1+(R2*B_DC**2*R_E/(pt))))*V_CC;",
+ "V_E=V_B-2.0*V_BE; #emitter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "r_e=25.0*10**-3/I_E; #for darlington emitter-follower",
+ "P_R_E=I_E**2*R_E; #power dissipated by R_E",
+ "P_Q2=(V_CC-V_E)*I_E #power dissipated by transistor Q2",
+ "R_e=R_E*R_L/(R_E+R_L); #ac emitter resi. of darlington emitter follower",
+ "#total input resistance of darlington",
+ "kt=R_e+r_e #temp varaible",
+ "R_in_tot=R1*R2*B_ac**2*(kt)/(R1*R2+R1*B_ac**2*(kt)+R2*B_ac**2*(kt)); ",
+ "R_c=R_C*R_in_tot/(R_C+R_in_tot); #effective ac resistance",
+ "A_v_CE=R_c/r_e_ce; #voltage gain of common emitter",
+ "A_v_EF=R_e/(r_e+R_e); #voltage gain of common emitter amplifier",
+ "A_v=A_v_CE*A_v_EF; #overall voltage gain",
+ "",
+ "#result",
+ "print \"voltage gain of common emitter amplifier= %.2f\" %A_v_CE",
+ "print \"voltage gain of common emitter amplifier= %.2f\" %A_v_EF",
+ "print \"overall voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage gain of common emitter amplifier= 172.08",
+ "voltage gain of common emitter amplifier= 0.99",
+ "overall voltage gain = 169.67"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.11, Page Number: 196<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' voltage,current and power gain'''",
+ "",
+ "# variable declaration",
+ "B_DC=250.0; #dc value",
+ "R_C=2.2*10**3; #resistance in ohm",
+ "R_E=1.0*10**3; #emitter resistance",
+ "R_L=10.0*10**3;#load resistance",
+ "R1=56.0*10**3; #resistance in ohm",
+ "R2=12.0*10**3; #resistance in ohm",
+ "V_BE=0.7; #base-emitter voltage in volt",
+ "V_CC=10.0; #source voltage in volt",
+ "",
+ "#calculation",
+ "#since B_DC*R_E>>R2",
+ "V_B=(R2/(R1+R2))*V_CC;",
+ "V_E=V_B-V_BE; #emiiter voltage",
+ "I_E=V_E/R_E; #emitter current",
+ "r_e=25.0*10**-3/I_E; #r_e value",
+ "R_in=r_e; #input resistance",
+ "R_c=R_C*R_L/(R_C+R_L); #ac collector resistance",
+ "A_v=R_c/r_e; #current gain",
+ "#current gain is almost 1",
+ "#power gain is approximately equal to voltage gain",
+ "A_p=A_v; #power gain",
+ "A_i=1; #current gain",
+ "",
+ "#result",
+ "print \"input resistance = %.2f ohms\" %R_in",
+ "print \"voltage gain = %.2f\" %A_v",
+ "print \"current gain = %.2f\" %A_i",
+ "print \"power gain = %.2f\" %A_p"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "input resistance = 23.48 ohms",
+ "voltage gain = 76.80",
+ "current gain = 1.00",
+ "power gain = 76.80"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 6.12, Page Number: 197<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' total voltage gain in decibel'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "A_v1=10.0;",
+ "A_v2=15.0;",
+ "A_v3=20.0;",
+ "",
+ "#calcultion",
+ "A_v=A_v1*A_v2*A_v3; #overall voltage gain",
+ "A_v1_dB=20.0*math.log10(A_v1); #gain in decibel",
+ "A_v2_dB=20.0*math.log10(A_v2); #gain in decibel",
+ "A_v3_dB=20.0*math.log10(A_v3); #gain in decibel",
+ "A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB; #total gain in decibel",
+ "",
+ "#result",
+ "print \"overall voltage gain = %.1f\" %A_v",
+ "print \"Av1 = %.1f dB\" %A_v1_dB",
+ "print \"Av2 = %.1f dB\" %A_v2_dB",
+ "print \"Av3 = %.1f dB\" %A_v3_dB",
+ "print \"total voltage gain =%.1f dB\" %A_v_dB"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "overall voltage gain = 3000.0",
+ "Av1 = 20.0 dB",
+ "Av2 = 23.5 dB",
+ "Av3 = 26.0 dB",
+ "total voltage gain =69.5 dB"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter7.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter7.ipynb
new file mode 100644
index 00000000..c8920a17
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter7.ipynb
@@ -0,0 +1,727 @@
+{
+ "metadata": {
+ "name": "Chapter_7"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 7: Field-effect Transistors (FETs)<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.1, Page Number: 217<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%pylab inline"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "",
+ "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].",
+ "For more information, type 'help(pylab)'."
+ ]
+ }
+ ],
+ "prompt_number": 318
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Constant current area of operation of JFET'''",
+ "",
+ "# variable declaration",
+ "V_GS_off=-4; # voltage in volt",
+ "I_DSS=12*10**-3; # current in ampere",
+ "R_D=560; # resistance in ohm",
+ "",
+ "#calculation",
+ "V_P=-1*V_GS_off; # volt ",
+ "V_DS=V_P; # Vds in volt",
+ "I_D=I_DSS; # current accross resistor",
+ "V_R_D=I_D*R_D; #voltage across resistor",
+ "V_DD=V_DS+V_R_D; # Vdd in volt",
+ "",
+ "# result",
+ "print \"The value of V_DD required to put the device in the constant\"",
+ "print \" current area of operation of JFET = %.2f volt\" %V_DD"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_DD required to put the device in the constant",
+ " current area of operation of JFET = 10.72 volt"
+ ]
+ }
+ ],
+ "prompt_number": 319
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.2, Page Number: 218<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Drain current'''",
+ "",
+ "print('The p-channel JFET requires a positive gate to source voltage.')",
+ "print('The more positive the voltage, the lesser the drain current.')",
+ "print('Any further increase in V_GS keeps the JFET cut off, so I_D remains 0')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The p-channel JFET requires a positive gate to source voltage.",
+ "The more positive the voltage, the lesser the drain current.",
+ "Any further increase in V_GS keeps the JFET cut off, so I_D remains 0"
+ ]
+ }
+ ],
+ "prompt_number": 320
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.3, Page number: 219<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''JFET current voltage'''",
+ "",
+ "I_DSS=9.0*10**-3;",
+ "V_GS_off=-8.0;",
+ "V_GS=0.0;",
+ "I_D=9.0*10**-3",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Value of I_D for V_GS=0V is %f A '%I_D)",
+ "V_GS=-1.0",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Value of I_D for V_GS=-1V is %f A'%I_D)",
+ "V_GS= -4.0",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Value of I_D for V_GS=-4V is %f A'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of I_D for V_GS=0V is 0.009000 A ",
+ "Value of I_D for V_GS=-1V is 0.006891 A",
+ "Value of I_D for V_GS=-4V is 0.002250 A"
+ ]
+ }
+ ],
+ "prompt_number": 321
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.4, Page Number: 220<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''JFET transconductance'''",
+ "",
+ "#Variable Declaration",
+ "I_DSS=3.0*10**-3;",
+ "V_GS_off=-6.0;",
+ "y_fs_max=5000.0*10**-6;",
+ "V_GS=-4.0;",
+ "g_m0=y_fs_max;",
+ "",
+ "#Calculation",
+ "g_m=g_m0*(1-(V_GS/V_GS_off));",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))",
+ "",
+ "#Result",
+ "print('forward transconductance = %f Siemens'%g_m)",
+ "print('value of I D = %f A'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "forward transconductance = 0.001667 Siemens",
+ "value of I D = 0.001000 A"
+ ]
+ }
+ ],
+ "prompt_number": 322
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.5, Page Number: 221<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find input resistance'''",
+ "",
+ "# variable declaration",
+ "V_GS=-20.0; # voltage in volt",
+ "I_GSS=-2*10**-9; # current in ampere",
+ "",
+ "#calculation",
+ "R_IN1=abs((-20/(2*10**-9))) # resistance in ohm",
+ "R_IN=R_IN1/(10**9)",
+ "",
+ "# result",
+ "print \"Input resistance = %d Giga ohm\" %R_IN"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input resistance = 10 Giga ohm"
+ ]
+ }
+ ],
+ "prompt_number": 323
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.6, Page Number: 223<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find gate to source voltage'''",
+ "",
+ "# variable declaration",
+ "V_DD=15; # voltage in volt",
+ "V_G=0; # voltage in volt",
+ "I_D=5*10**-3; # current in ampere",
+ "R_D=1*10**3; # resistance in ohm",
+ "R_G=10*10**6; # resistance in ohm",
+ "R_S=220; # resistance in ohm",
+ "",
+ "# calculation",
+ "V_S=I_D*R_S; # source voltage in volt",
+ "V_D=V_DD-I_D*R_D; # drain voltage in volt",
+ "V_DS=V_D-V_S; # drain to source voltage in volt",
+ "V_GS=V_G-V_S; # gate to source voltage in volt",
+ "",
+ "# result",
+ "print \"Drain to source voltage = %.2f volts\" %V_DS",
+ "print \"Gate to source voltage = %.2f volts\" %V_GS"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to source voltage = 8.90 volts",
+ "Gate to source voltage = -1.10 volts"
+ ]
+ }
+ ],
+ "prompt_number": 324
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.7, Page Number: 224<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Gate resistance'''",
+ "",
+ "# variable declaration",
+ "V_GS=-5.0; # voltage in volt",
+ "I_D=6.25*10**-3; # current in ampere",
+ "",
+ "#calculation",
+ "R_G=abs((V_GS/I_D)) # resistance in ohm",
+ "",
+ "# result",
+ "print \"Gate resistance = %d ohm\" %R_G"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gate resistance = 800 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 325
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.8, Page Number: 224<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Self bias Q point'''",
+ "",
+ "I_DSS=25.0*10**-3;",
+ "V_GS_off=15.0;",
+ "V_GS=5.0;",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2",
+ "R_S=abs((V_GS/I_D))",
+ "print('Drain current = %f Amperes'%I_D)",
+ "print('Source resistance = %.0f Ohms'%R_S)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current = 0.011111 Amperes",
+ "Source resistance = 450 Ohms"
+ ]
+ }
+ ],
+ "prompt_number": 326
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.9, Page Number: 225<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Drain resistance'''",
+ "",
+ "# variable declaration",
+ "V_D=6; # drain voltage in volt",
+ "V_GS_off=-3; # off voltage in volt",
+ "V_DD=12; # voltage in volt",
+ "I_DSS=12*10**-3; # current in ampere",
+ "",
+ "#calculation",
+ "I_D=I_DSS/2; #MIDPOINT BIAS",
+ "V_GS=V_GS_off/3.4; #MIDPOINT BIAS",
+ "R_S=abs((V_GS/I_D)) #resistance i voltage",
+ "R_D=(V_DD-V_D)/I_D #resistance in voltage ",
+ "",
+ "# result",
+ "print \"Source resistance = %.2f ohm\" %R_S",
+ "print \"Drain resistance = %d ohm\" %R_D"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Source resistance = 147.06 ohm",
+ "Drain resistance = 1000 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 327
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.10, Page Number: 227<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find transfer characteristic'''",
+ "",
+ "import pylab",
+ "import numpy",
+ "",
+ "# variable declaration",
+ "R_S=680.0; # resistance in ohm",
+ "I_D=0; # current in ampere",
+ "",
+ "#calculation",
+ "V_GS=I_D*R_S; #FOR I_D=0A",
+ "",
+ "I_DSS=4*10**-3; # current in ampere",
+ "I_D=I_DSS; # currents are equal",
+ "V_GS1=-1*I_D*R_S; #FOR I_D=4mA",
+ "",
+ "# result",
+ "print \"V_GS at I_D=0amp is %d volt\" %V_GS",
+ "print \"V_GS at I_D=4mA is %.2f volt\" %V_GS1",
+ "print \"Plotting load line using the values of V_GS at I_D=0 and 4mA,\"",
+ "print \" we find the intersection of load line with transfer characteristic\"",
+ "print \" to get Q-point values of V_GS=-1.5V and I_D=2.25mA\"",
+ "",
+ "#########PLOT######################",
+ "idss=4",
+ "vgsoff=-6",
+ "vgs=arange(-6.0,0.0,0.0005)",
+ "idk=arange(0.0,4.0,0.0005)",
+ "ids=arange(0.0,2.25,0.0005)",
+ "vgsk=-idk*0.68",
+ "i_d=idss*(1-(vgs/vgsoff))**2",
+ "text(-3.00,2.25,'Q Point',size=13)",
+ "text(-3.25,2,'(-1.5V, 2.25mA)')",
+ "plot(vgs,i_d)",
+ "plot(vgsk,idk,'b')",
+ "plot(-1.5,2.25,'o')",
+ "ylim( (0,5) )",
+ "title('Transfer characteristic curve')",
+ "xlabel('Vgs')",
+ "ylabel('Idss')"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_GS at I_D=0amp is 0 volt",
+ "V_GS at I_D=4mA is -2.72 volt",
+ "Plotting load line using the values of V_GS at I_D=0 and 4mA,",
+ " we find the intersection of load line with transfer characteristic",
+ " to get Q-point values of V_GS=-1.5V and I_D=2.25mA"
+ ]
+ },
+ {
+ "output_type": "pyout",
+ "prompt_number": 328,
+ "text": [
+ "<matplotlib.text.Text at 0xd95b60c>"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEXCAYAAABSwdSZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8TNf7B/BPNqIVkVCxhSxoLGmEhqJqNPZ9J3ZCVVe6\nWaqkVW2/VBeKLr+gakmtRWypJagt9rWWZhNbkCCJJJLMnN8fp5kKWZmZO3Pn83695iVm7tz73Eue\nOXPuOeexEUIIEBGR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iQB06dIFd+/eRVZWFqZOncqEThaLLXUiIhXhjVIiIhVhUiciUhEm\ndSIiFWFSJyJSESZ1IiIVYVInIlKR/wdjx32hRVMVVQAAAABJRU5ErkJggg==\n"
+ }
+ ],
+ "prompt_number": 328
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.11, Page Number: 228<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find gate to source voltage'''",
+ "",
+ "# variable declaration",
+ "V_DD=12; # voltage in volt",
+ "V_D=7; # voltage in volt",
+ "R_D=3.3*10**3; # resistance in ohm",
+ "R_S=2.2*10**3; # resistance in ohm",
+ "R_1=6.8*10**6; # resistance in ohm",
+ "R_2=1*10**6; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_D=(V_DD-V_D)/R_D; # drain current in ampere",
+ "V_S=I_D*R_S; # source voltage in volt",
+ "V_G=(R_2/(R_1+R_2))*V_DD; # gate voltage in volt",
+ "V_GS=V_G-V_S; # gate to source voltage in volt",
+ "",
+ "# result",
+ "print \"Drain Current = %.4f Ampere\" %I_D",
+ "print \"Gate to source voltage = %.4f volts\" %V_GS"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain Current = 0.0015 Ampere",
+ "Gate to source voltage = -1.7949 volts"
+ ]
+ }
+ ],
+ "prompt_number": 329
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.12, Page Number: 229<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find transfer characteristic for Q-point'''",
+ "",
+ "# variable declaration",
+ "R_1=2.2*10**6; # resistance in ohm ",
+ "R_2=R_1; # resistance in ohm",
+ "V_DD=8; # voltage in volt",
+ "R_S=3.3*10**3; # resistance in ohm",
+ "",
+ "#calculation",
+ "V_GS=(R_2/(R_1+R_2))*V_DD; #FOR I_D=0A",
+ "V_G=V_GS; # voltage in volt",
+ "I_D=(V_G-0)/R_S; #FOR V_GS=0V",
+ "",
+ "# result",
+ "print \"V_GS = %d volt\" %V_GS",
+ "print \"at V_GS=0V. I_D = %.4f ampere\" %I_D",
+ "print \"Plotting load line using the value of V_GS=4V at I_D=0\"",
+ "print \" and I_D=1.2mA at V_GS=0V, we find the intersection of\"",
+ "print \" load line with transfer characteristic to get Q-point\"",
+ "print \" values of V_GS=-1.8V and I_D=1.8mA\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V_GS = 4 volt",
+ "at V_GS=0V. I_D = 0.0012 ampere",
+ "Plotting load line using the value of V_GS=4V at I_D=0",
+ " and I_D=1.2mA at V_GS=0V, we find the intersection of",
+ " load line with transfer characteristic to get Q-point",
+ " values of V_GS=-1.8V and I_D=1.8mA"
+ ]
+ }
+ ],
+ "prompt_number": 330
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.13, Page Number: 235<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''DMOSFET'''",
+ "",
+ "I_DSS=10.0*10**-3;",
+ "V_GS_off=-8.0;",
+ "V_GS=-3.0;",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Drain current when V_GS=-3V is %f Amperes'%I_D)",
+ "V_GS=3;",
+ "I_D=I_DSS*(1-(V_GS/V_GS_off))**2;",
+ "print('Drain current when V_GS=3V is %f Amperes'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current when V_GS=-3V is 0.003906 Amperes",
+ "Drain current when V_GS=3V is 0.018906 Amperes"
+ ]
+ }
+ ],
+ "prompt_number": 331
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.14, Page Number: 236<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''EMOSFET'''",
+ "",
+ "#variable Declaration",
+ "I_D_on=500.0*10**-3;",
+ "V_GS=10.0;",
+ "V_GS_th=1.0;",
+ "K=I_D_on/((V_GS-V_GS_th)**2)",
+ "V_GS=5.0;",
+ "I_D=K*(V_GS-V_GS_th)**2;",
+ "print('Drain current = %f A'%I_D)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current = 0.098765 A"
+ ]
+ }
+ ],
+ "prompt_number": 332
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.15, Page Number: 237<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find drain to source voltage'''",
+ "",
+ "# variable declaration",
+ "I_DSS=12*10**-3; # currenin ampere",
+ "V_DD=18; # voltage in volt",
+ "R_D=620; # resistance in oh",
+ "",
+ "#calculation",
+ "I_D=I_DSS; # currents are equal",
+ "V_DS=V_DD-I_D*R_D; # drain to source voltage",
+ "",
+ "# result",
+ "print \"Drain to sorce voltage = %.2f volt\" %V_DS"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to sorce voltage = 10.56 volt"
+ ]
+ }
+ ],
+ "prompt_number": 333
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.16, Page Number: 238<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''EMOSFET bias'''",
+ "",
+ "#variable Declaration",
+ "I_D_on=200.0*10**-3;",
+ "V_DD=24.0;",
+ "R_D=200.0;",
+ "V_GS=4.0;",
+ "V_GS_th=2.0;",
+ "R_1=100.0*10**3;",
+ "R_2=15.0*10**3;",
+ "",
+ "#Calculation ",
+ "K=I_D_on/((V_GS-V_GS_th)**2)",
+ "V_GS=(R_2/(R_1+R_2))*V_DD;",
+ "I_D=K*(V_GS-V_GS_th)**2;",
+ "V_DS=V_DD-I_D*R_D;",
+ "",
+ "#Result",
+ "print('Drain to Source voltage = %f V'%V_DS)",
+ "print('Gate to Source voltage = %f V'%V_GS)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to Source voltage = 11.221172 V",
+ "Gate to Source voltage = 3.130435 V"
+ ]
+ }
+ ],
+ "prompt_number": 334
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 7.17, Page Number: 239<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find drain current'''",
+ "",
+ "# variable declaration",
+ "V_GS_on=3; # voltage in volt",
+ "V_GS=8.5 #voltage displayed on meter",
+ "V_DS=V_GS; # voltages are equal ",
+ "V_DD=15; # voltage in volt",
+ "R_D=4.7*10**3; # resistance in ohm",
+ "",
+ "#calculation",
+ "I_D=(V_DD-V_DS)/R_D; # drain current",
+ "",
+ "# result",
+ "print \"Drain current = %.4f ampere\" %I_D"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current = 0.0014 ampere"
+ ]
+ }
+ ],
+ "prompt_number": 335
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter8.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter8.ipynb
new file mode 100644
index 00000000..68824e84
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter8.ipynb
@@ -0,0 +1,432 @@
+{
+ "metadata": {
+ "name": "Chapter_8"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 8: FET Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.1, Page Number: 253<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Voltage gain'''",
+ "",
+ "# variable declaration",
+ "g_m=4.0*10**-3; #gm value",
+ "R_d=1.5*10**3; #resistance",
+ "",
+ "#calculation",
+ "A_v=g_m*R_d; #voltage gain",
+ "",
+ "#result",
+ "print \"Voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = 6.00"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.2, Page Number: 253<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' The Voltage gain'''",
+ "",
+ "# variable declaration",
+ "r_ds=10.0*10**3;",
+ "R_d=1.5*10**3; #from previous question",
+ "g_m=4.0*10**-3; #from previous question",
+ "",
+ "#calculation",
+ "A_v=g_m*((R_d*r_ds)/(R_d+r_ds)); #voltage gain",
+ "",
+ "#result",
+ "print \"Voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = 5.22"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.3, Page Number:254<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Voltage gain'''",
+ "",
+ "# variable declaration",
+ "R_s=560; #resistance in ohm",
+ "R_d=1.5*10**3; #resistance in ohm",
+ "g_m=4*10**-3; #g_m value",
+ "",
+ "#calculation",
+ "A_v=(g_m*R_d)/(1+(g_m*R_s)) #voltage gain",
+ "",
+ "#result",
+ "print \"Voltage gain = %.2f\" %A_v"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = 1.85"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.4, Page Number: 257<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Unloaded amplifier'''",
+ "",
+ "#Variable declaration",
+ "vdd=12.0 #volts",
+ "Id=1.96*10**-3 #Amp",
+ "Rd=3.3*10**3 #ohm",
+ "Idss=12.0*10**-3 #Amp",
+ "Rs=910 # Ohm",
+ "vgsoff= 3 #v",
+ "vin=0.1 #V",
+ "",
+ "#calculation",
+ "vd=vdd-(Id*Rd)",
+ "vgs=-Id*Rs",
+ "gm0=2*Idss/(abs(vgsoff))",
+ "gm=0.00325 #mS",
+ "vout=gm*Rd*vin",
+ "vout=vout*2*1.414",
+ "#Result",
+ "print\"Total output ac voltage(peak-to-peak) = %f V \\nridig on DC value of %fV \"%(vout,vd)"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total output ac voltage(peak-to-peak) = 3.033030 V ",
+ "ridig on DC value of 5.532000V "
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.5, Page Number: 258<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' RMS voltage'''",
+ "",
+ "# variable declaration",
+ "R_D=3.3*10**3; #resistance in ohm",
+ "R_L=4.7*10**3; #load resistance in ohm",
+ "g_m=3.25*10**-3; #from previous question",
+ "V_in=100.0*10**-3; #previous question",
+ "",
+ "#calculation",
+ "R_d=(R_D*R_L)/(R_D+R_L); #Equivalent drain resistance",
+ "V_out=g_m*R_d*V_in; #output RMS voltage in volt",
+ "",
+ "#result",
+ "print \"Output voltage rms value = %.2f Volts\" %V_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage rms value = 0.63 Volts"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.6, Page Number: 259<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Input resistance wrt signal source '''",
+ "",
+ "# variable declaration",
+ "I_GSS=30.0*10**-9; #current in ampere",
+ "V_GS=10.0; #ground-source voltage",
+ "R_G=10.0*10**6; #resistance in ohm",
+ "",
+ "#calculation",
+ "R_IN_gate=V_GS/I_GSS; #gate input resistance",
+ "R_in=(R_IN_gate*R_G)/(R_IN_gate+R_G); #parallel combination",
+ "",
+ "#result",
+ "print \"Input resistance as seen by signal source = %.2f ohm\" %R_in"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input resistance as seen by signal source = 9708737.86 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.7, Page Number: 260<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' AC and DC output voltage '''",
+ "",
+ "# variable declaration",
+ "I_DSS=200.0*10**-3;",
+ "g_m=200.0*10**-3;",
+ "V_in=500.0*10**-3;",
+ "V_DD=15.0;",
+ "R_D=33.0;",
+ "R_L=8.2*10**3;",
+ "",
+ "#calculation",
+ "I_D=I_DSS; #Amplifier is zero biased",
+ "V_D=V_DD-I_D*R_D;",
+ "R_d=(R_D*R_L)/(R_D+R_L);",
+ "V_out=g_m*R_d*V_in;",
+ "",
+ "#result",
+ "print \"DC output voltage = %.2f Volts\" %V_D",
+ "print \"AC output voltage = %.2f volts\" %V_out"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC output voltage = 8.40 Volts",
+ "AC output voltage = 3.29 volts"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.8, Page Number: 262<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' Drain Current '''",
+ "",
+ "# Theoretical example",
+ "# result",
+ "",
+ "print \"Part A:\\nQ point: V_GS=-2V I_D=2.5mA. At V_GS=-1V, I_D=3.4mA,\"",
+ "print \"At V_GS=-3V, I_D=1.8mA. So peak to peak drain current is\" ",
+ "print \"the difference of the two drain currents=1.6mA\"",
+ "print \"\\nPart B:\\nQ point: V_GS=0V I_D=4mA. At V_GS=1V, I_D=5.3mA,\"",
+ "print \"At V_GS=-1V, I_D=2.5mA. So peak to peak drain current is\"",
+ "print\" the difference of the two drain currents=2.8mA\"",
+ "print \"\\nPart C:\\nQ point: V_GS=8V I_D=2.5mA. At V_GS=9V, I_D=3.9mA,\"",
+ "print \" At V_GS=7V, I_D=1.7mA. So peak to peak drain current is\"",
+ "print \" the difference of the two drain currents=2.2mA\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part A:",
+ "Q point: V_GS=-2V I_D=2.5mA. At V_GS=-1V, I_D=3.4mA,",
+ "At V_GS=-3V, I_D=1.8mA. So peak to peak drain current is",
+ "the difference of the two drain currents=1.6mA",
+ "",
+ "Part B:",
+ "Q point: V_GS=0V I_D=4mA. At V_GS=1V, I_D=5.3mA,",
+ "At V_GS=-1V, I_D=2.5mA. So peak to peak drain current is",
+ " the difference of the two drain currents=2.8mA",
+ "",
+ "Part C:",
+ "Q point: V_GS=8V I_D=2.5mA. At V_GS=9V, I_D=3.9mA,",
+ " At V_GS=7V, I_D=1.7mA. So peak to peak drain current is",
+ " the difference of the two drain currents=2.2mA"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.9, Page Number:263 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' To find Voltage gain'''",
+ "",
+ "# variable declaration",
+ "R_1=47.0*10**3;",
+ "R_2=8.2*10**3;",
+ "R_D=3.3*10**3;",
+ "R_L=33.0*10**3;",
+ "I_D_on=200.0*10**-3;",
+ "V_GS=4.0;",
+ "V_GS_th=2.0;",
+ "g_m=23*10**-3;",
+ "V_in=25*10**-3;",
+ "V_DD=15.0;",
+ "",
+ "#calculation",
+ "V_GSnew=(R_2/(R_1+R_2))*V_DD;",
+ "K=I_D_on/((V_GS-V_GS_th)**2)",
+ "#K=value_of_K(200*10**-3,4,2);",
+ "K=K*1000;",
+ "I_D=K*((V_GSnew-V_GS_th)**2);",
+ "V_DS=V_DD-I_D*R_D/1000;",
+ "R_d=(R_D*R_L)/(R_D+R_L);",
+ "V_out=g_m*V_in*R_d;",
+ "",
+ "#result",
+ "print \"Drain to source voltage = %.2f volts\" %V_GSnew",
+ "print \"Drain current = %.2f mA\" %I_D",
+ "print \"Gate to source voltage = %.2f volts\" %V_DS",
+ "print \"AC output voltage = %.2f volts\" %V_out",
+ "print \"Answer in textbook are approximated\""
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain to source voltage = 2.23 volts",
+ "Drain current = 2.61 mA",
+ "Gate to source voltage = 6.40 volts",
+ "AC output voltage = 1.72 volts",
+ "Answer in textbook are approximated"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 8.10, Page Number: 266<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' AC and DC output voltage''' ",
+ "",
+ "# variable declaration",
+ "V_DD=-15.0; #p=channel MOSFET",
+ "g_m=2000.0*10**-6; #minimum value from datasheets",
+ "R_D=10.0*10**3;",
+ "R_L=10.0*10**3;",
+ "R_S=4.7*10**3;",
+ "",
+ "#calculation",
+ "R_d=(R_D*R_L)/(R_D+R_L); #effective drain resistance",
+ "A_v=g_m*R_d;",
+ "R_in_source=1.0/g_m;",
+ "#signal souce sees R_S in parallel with ip rest at source terminal(R_in_source)",
+ "R_in=(R_in_source*R_S)/(R_in_source+R_S); ",
+ "",
+ "#result ",
+ "print \"minimum voltage gain = %.2f\" %A_v",
+ "print \"Input resistance seen from signal source = %.2f ohms\" %R_in"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum voltage gain = 10.00",
+ "Input resistance seen from signal source = 451.92 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter9.ipynb b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter9.ipynb
new file mode 100644
index 00000000..a4cd060a
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/Chapter9.ipynb
@@ -0,0 +1,379 @@
+{
+ "metadata": {
+ "name": "Chapter_9"
+ },
+ "nbformat": 2,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h1>Chapter 9: Power Amplifiers<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.1, Page Number: 280<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Voltage gain'''",
+ "",
+ "# variable declaration",
+ "V_CC=15.0; #supply voltage",
+ "R_C=1.0*10**3; #resistance in ohm",
+ "R_1=20.0*10**3; #resistance in ohm",
+ "R_2=5.1*10**3; #resistance in ohm",
+ "R_3=5.1*10**3; #resistance in ohm",
+ "R_4=15.0*10**3; #resistance in ohm",
+ "R_E_1=47.0; #resistance in ohm",
+ "R_E_2=330.0; #resistance in ohm",
+ "R_E_3=16.0; #resistance in ohm",
+ "R_L=16.0; #SPEAKER IS THE LOAD;",
+ "B_ac_Q1=200.0; #B_ac value",
+ "B_ac_Q2=B_ac_Q1; #B_ac value",
+ "B_ac_Q3=50.0; #B_ac value",
+ "",
+ "#calculation",
+ "#R_c1=R_C||[R_3||R_4||B_acQ2*B_ac_Q3*(R_E_3||R_L)] is ac collector resistance",
+ "R=(R_E_3*R_L)/(R_E_3+R_L); #calculating resistance",
+ "R=B_ac_Q2*B_ac_Q3*R; ",
+ "R=(R*R_4)/(R+R_4); #calculating resistance",
+ "R=(R*R_3)/(R+R_3);",
+ "R_c1=(R*R_C)/(R_C+R); #ac collector resistance",
+ "#V_B=((R_2||(B_acQ1*(R_E_1+R_E_2)))/(R_1+(R_2||B_acQ1*(R_E_1+R_E_2))))*V_CC;",
+ "#This is the base voltage;",
+ "#LET R=(R_2||(B_acQ1*(R_E_1+R_E_2)))",
+ "R=(R_2*B_ac_Q1*(R_E_1+R_E_2))/(R_2+B_ac_Q1*(R_E_1+R_E_2));",
+ "V_B=R*V_CC/(R_1+R);",
+ "I_E=(V_B-0.7)/(R_E_1+R_E_2);",
+ "r_e_Q1=25.0*10**-3/I_E;",
+ "A_v1=(-1)*(R_c1)/(R_E_1+r_e_Q1); #voltage gain of 1st stage",
+ "#total input resistance of 1st stage is ",
+ "#R_in_tot_1=R_1||R_2||B_ac_Q1*(R_E_1+r_e_Q1);",
+ "xt=R_E_1+r_e_Q1 ",
+ "yt=R_2*B_ac_Q1",
+ "R_in_tot_1=(R_1*(yt*(xt)/(R_2+B_ac_Q1*(xt))))/(R_1+(yt*(xt)/(yt*(xt))));",
+ "A_v2=1; #gain of darlington voltage-follower",
+ "A_v_tot=A_v1*A_v2; #total gain",
+ "A_p=(A_v_tot**2)*(R_in_tot_1/R_L); #power gain",
+ "A_p=42508.68",
+ "",
+ "#result",
+ "print \"Voltage gain= %.2f\" %A_v_tot",
+ "print \"Power gain= %.2f\" %A_p"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain= -15.29",
+ "Power gain= 42508.68"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.2, Page Number: 281<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' efficiency'''",
+ "",
+ "# variable declaration",
+ "V_in=176.0*10**-3;",
+ "R_in=2.9*10**3; #total input resistance from previous question",
+ "A_p=42429.0; #power gain from previous question",
+ "V_CC=15.0;",
+ "I_CC=0.6; #emitter current",
+ "",
+ "#calculation",
+ "P_in=V_in**2/R_in; #input power",
+ "P_out=P_in*A_p;",
+ "P_DC=I_CC*V_CC;",
+ "eff=P_out/P_DC; #efficiency",
+ "",
+ "#result",
+ "print \"efficiency= %.2f\" %eff"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency= 0.05"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.3, Page Number: 287<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' ideal maximum current'''",
+ "",
+ "# variable declaration",
+ "V_CC=20.00; #supply voltage",
+ "R_L=16.0; #load resistance",
+ "",
+ "#calculation",
+ "V_out_peak=V_CC; #calculate peak op voltage",
+ "I_out_peak=V_CC/R_L; #calculate peak op current",
+ "",
+ "#result",
+ "print \"ideal maximum peak output voltage = %.2f volts\" %V_out_peak",
+ "print \"ideal maximum current =%.2f amperes\" %I_out_peak"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ideal maximum peak output voltage = 20.00 volts",
+ "ideal maximum current =1.25 amperes"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.4, Page Number: 288<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' ideal maximum current'''",
+ "",
+ "# variable declaration",
+ "V_CC=20.0; #supply volatge",
+ "R_L=16.0; #load resistance",
+ "",
+ "#calculation",
+ "V_out_peak=V_CC/2;",
+ "I_out_peak=V_out_peak/R_L;",
+ "",
+ "#result",
+ "print \"ideal maximum output peak voltage = %.2f volts\" %V_out_peak",
+ "print \"ideal maximum current = %.2f amperes\" %I_out_peak"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ideal maximum output peak voltage = 10.00 volts",
+ "ideal maximum current = 0.62 amperes"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.5, Page Number: 290<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' ideal maximum current'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "V_CC=20.0; #supply voltage",
+ "R_L=8.0; #load resistance",
+ "B_ac=50.0; #B_ac value",
+ "r_e=6.0; #internal resistance",
+ "",
+ "#calculation",
+ "V_out_peak=V_CC/2;",
+ "V_CEQ=V_out_peak;",
+ "I_out_peak=V_CEQ/R_L;",
+ "I_c_sat=I_out_peak;",
+ "P_out=0.25*I_c_sat*V_CC;",
+ "P_DC=(I_c_sat*V_CC)/math.pi;",
+ "R_in=B_ac*(r_e+R_L);",
+ "",
+ "#result",
+ "print \"maximum ac output power = %.2f Watts\" %P_out",
+ "print \"maximum DC output power = %.2f Watts\" %P_DC",
+ "print \"input resistance = %.2f ohms\" %R_in"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum ac output power = 6.25 Watts",
+ "maximum DC output power = 7.96 Watts",
+ "input resistance = 700.00 ohms"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.6, Page Number: 292<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' power accross load'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "V_DD=24.0;",
+ "V_in=100*10**-3; #ip volatge",
+ "R1=440.0; #resistance in ohm",
+ "R2=5.1*10**3; #resistance in ohm",
+ "R3=100*10**3; #resistance in ohm",
+ "R4=10**3; #resistance in ohm",
+ "R5=100.0; #resistance in ohm",
+ "R7=15*10**3; #resistance in ohm",
+ "R_L=33.0; #load resistance in ohm",
+ "V_TH_Q1=2.0; # V-TH value",
+ "V_TH_Q2=-2.0; ",
+ "",
+ "#calculation",
+ "I_R1=(V_DD-(-V_DD))/(R1+R2+R3);",
+ "V_B=V_DD-I_R1*(R1+R2); #BASE VOLTAGE",
+ "V_E=V_B+0.7; #EMITTER VOLTAGE",
+ "I_E=(V_DD-V_E)/(R4+R5); #EMITTER CURRENT",
+ "V_R6=V_TH_Q1-V_TH_Q2; #VOLTAGE DROP ACROSS R6",
+ "I_R6=I_E; ",
+ "R6=V_R6/I_R6;",
+ "r_e=25*10**-3/I_E; #UNBYPASSED EMITTER RESISTANCE",
+ "A_v=R7/(R5+r_e); #VOLTAGE GAIN",
+ "V_out=A_v*V_in;",
+ "P_L=V_out**2/R_L;",
+ "",
+ "#result",
+ "print \"value of resistance R6 = %.2d ohms for AB operation\" %R6",
+ "print \"power across load = %.2f watts\"%P_L "
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of resistance R6 = 2418 ohms for AB operation",
+ "power across load = 5.15 watts"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.7, Page Number:295<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' average power dissipation'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "f=200.0*10**3; #frequency in hertz",
+ "I_c_sat=100.0*10**-3; #saturation current",
+ "V_ce_sat=0.2; #sat voltage",
+ "t_on=1.0*10**-6; #on time",
+ "",
+ "#calculation",
+ "T=1/f; #time period of signal",
+ "P_D_avg=(t_on/T)*I_c_sat*V_ce_sat; #power dissipation",
+ "",
+ "#result",
+ "print \"average power dissipation =%.3f Watts\" %P_D_avg"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average power dissipation =0.004 Watts"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "<h3>Example 9.8, Page Number: 298<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' efficiency'''",
+ "",
+ "import math",
+ "# variable declaration",
+ "P_D_avg=4.0*10**-3; #power dissipation",
+ "V_CC=24.0; #supply voltage",
+ "R_c=100.0; #resistance in ohm",
+ "",
+ "#calculation",
+ "P_out=(0.5*V_CC**2)/R_c; #output power",
+ "n=(P_out)/(P_out+P_D_avg); #n is efficiency",
+ "",
+ "#result",
+ "print \"efficiency=%.4f\" %n"
+ ],
+ "language": "python",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "efficiency=0.9986"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/README.txt b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/README.txt
new file mode 100644
index 00000000..daab5f7f
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Deepak Shakya
+Course: btech
+College/Institute/Organization: DCRUST
+Department/Designation: Chemical Engg
+Book Title: Principles And Modern Applications Of Mass Transfer Operations
+Author: J. Benitez
+Publisher: John Wiley & Sons
+Year of publication: 2009
+Isbn: 978-0-470-18178-2
+Edition: 2nd \ No newline at end of file
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1.png
new file mode 100644
index 00000000..8555a45e
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_1.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_1.png
new file mode 100644
index 00000000..8555a45e
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_1.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_2.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_2.png
new file mode 100644
index 00000000..8555a45e
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak1_2.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2.png
new file mode 100644
index 00000000..e83209e0
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_1.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_1.png
new file mode 100644
index 00000000..e83209e0
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_1.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_2.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_2.png
new file mode 100644
index 00000000..e83209e0
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak2_2.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3.png
new file mode 100644
index 00000000..579c4a57
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_1.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_1.png
new file mode 100644
index 00000000..579c4a57
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_1.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_2.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_2.png
new file mode 100644
index 00000000..579c4a57
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/deepak3_2.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/programmingprocess.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/programmingprocess.png
new file mode 100644
index 00000000..c2f21380
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/programmingprocess.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter.png
new file mode 100644
index 00000000..96f57d0c
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter.png
Binary files differ
diff --git a/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter_1.png b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter_1.png
new file mode 100644
index 00000000..96f57d0c
--- /dev/null
+++ b/Principles_And_Modern_Applications_Of_Mass_Transfer_Operations/screenshots/transfercharecter_1.png
Binary files differ
diff --git a/Problems_In_Fluid_Flow/README.txt b/Problems_In_Fluid_Flow/README.txt
new file mode 100644
index 00000000..d0180dc8
--- /dev/null
+++ b/Problems_In_Fluid_Flow/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Hiren Shah
+Course: mca
+College/Institute/Organization: Financial Technology
+Department/Designation: Developer
+Book Title: Problems In Fluid Flow
+Author: D. J. Brasch And D. Whyman
+Publisher: Edward Arnold
+Year of publication: 1986
+Isbn: 0-7131-3554-9
+Edition: 1 \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch1.ipynb b/Problems_In_Fluid_Flow/ch1.ipynb
new file mode 100644
index 00000000..060862e5
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch1.ipynb
@@ -0,0 +1,635 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Pipe Flow of Liquids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "example 1.1 page no : 1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find whether\n",
+ "the system is in turbulent motion \n",
+ "the system is in laminar motion \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "mu = 6.3/100; #viscosity\n",
+ "rho = 1170.; #density\n",
+ "d = .3; #diameter of pipe\n",
+ "b = 0.142; #conversion factor\n",
+ "pi=3.14;\n",
+ "\n",
+ "#calculation\n",
+ "Q = 150000.*b/24./3600 #flow rate\n",
+ "u = Q/pi/d**2.*4 #flow speed\n",
+ "Re = rho*u*d/mu\n",
+ "if Re>4000:\n",
+ " print \"the system is in turbulent motion as reynolds no is greater than 4000: %.3f\"%Re\n",
+ "elif Re<2100 :\n",
+ " print \"the system is in laminar motion\" ,Re\n",
+ "else:\n",
+ " print \"the system is in transition motion\",Re\n",
+ "\n",
+ "mu = 5.29/1000;\n",
+ "d = 0.06;\n",
+ "G = 0.32; #mass flow rate\n",
+ "Re = 4*G/pi/d/mu;\n",
+ "\n",
+ "if Re>4000 :\n",
+ " print \"the system is in turbulent motion as reynolds no is greater than 4000: \",Re\n",
+ "elif Re<2100 :\n",
+ " print \"the system is in laminar motion as Re is less than 2100 : %.3f\" %Re\n",
+ "else:\n",
+ " print \"the system is in transition motion\",Re\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the system is in turbulent motion as reynolds no is greater than 4000: 19441.074\n",
+ "the system is in laminar motion as Re is less than 2100 : 1284.320\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "example 1.2 page no : 2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The Stanton-Pannel friction factor per unit of length\n",
+ "shear stress exerted by liquid\n",
+ "Total shear force exerted \n",
+ "viscosity of liquid \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "G=21.2; #mass flow rate\n",
+ "rho=1120; #density\n",
+ "d=0.075; #diameter\n",
+ "l=50.;\n",
+ "g=9.81;\n",
+ "pi=3.14;\n",
+ "delz=24./100; #head difference\n",
+ "\n",
+ "#calculation\n",
+ "delP=delz*rho*g; #differece of pressure\n",
+ "u=4*G/pi/d**2/rho;\n",
+ "phi=delP/rho*d/l/u**2./4*50;\n",
+ "print \"The Stanton-Pannel friction factor per unit of length: %f\"%phi\n",
+ "R=phi*rho*u**2;\n",
+ "print \"shear stress exerted by liquid on the pipe wall in (N/m**2) : %.3f\"% R\n",
+ "F=pi*d*l*R;\n",
+ "print \"Total shear force exerted on the pipe in (N): %.3f\"%F\n",
+ "Re=(.0396/phi)**4;#reynold's no.\n",
+ "mu=rho*u*d/Re;\n",
+ "print \"viscosity of liquid in (kg/m/s):%f\" %mu\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Stanton-Pannel friction factor per unit of length: 0.002402\n",
+ "shear stress exerted by liquid on the pipe wall in (N/m**2) : 49.442\n",
+ "Total shear force exerted on the pipe in (N): 582.184\n",
+ "viscosity of liquid in (kg/m/s):0.004877\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.3 page no : 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the difference between the rise levels of manometer\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "pi=3.14;\n",
+ "g=9.81;\n",
+ "d=0.00125;\n",
+ "Re=2100;\n",
+ "l=0.035;\n",
+ "rhoc=779. #density of cyclohexane\n",
+ "rhow=999. #density of water\n",
+ "muc=1.02/1000; #viscosity of cyclo hexane\n",
+ "\n",
+ "#calculation\n",
+ "u=Re*muc/rhoc/d; #speed\n",
+ "Q=pi*d**2*u/4; #volumetric flow rate\n",
+ "delP=32*muc*u*l/d**2;#pressure difference\n",
+ "delz=delP/(rhow-rhoc)/g;\n",
+ "print \"the difference between the rise levels of manometer in (cm): %.4f\"%(delz*100 )\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the difference between the rise levels of manometer in (cm): 74.5210\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "example 1.4 page no : 6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The volume of pure material\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "d=0.05;\n",
+ "l=12.;\n",
+ "per=100.-2;\n",
+ "pi=3.1428\n",
+ "\n",
+ "#calculation\n",
+ "s=math.sqrt(per/100/4*d**2);#radius of core of pure material\n",
+ "V=pi*d**2./4.*l/(2.*(1-(2.*s)**2/d**2));\n",
+ "print \"The volume of pure material so that 2%% technical material appears at the end in (m**3): %.3f\"%V\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volume of pure material so that 2% technical material appears at the end in (m**3): 0.589\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.5 page no : 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The percent value of d for which where pitot tube is kept show average velocity in streamline flow\n",
+ "The percent value of d for which where pitot tube is kept show average velocity in turbulent flow \n",
+ "The error shown by pitot tube at new position \n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "a=1./2*(1-1/math.sqrt(2.));\n",
+ "print \"The percent value of d for which where pitot tube is kept show average velocity \\\n",
+ "in streamline flow in (%%) : %.4f\"%(a*100)\n",
+ "\n",
+ "a=(49./60)**7/2.\n",
+ "print \"The percent value of d for which where pitot tube is kept show average velocity in \\\n",
+ "turbulent flow in (%%) : %.4f\"%(a*100)\n",
+ "\n",
+ "#on equating coefficient of r\n",
+ "y=a*2; #y=a/100*2*r\n",
+ "s=1-y; #s=r-y\n",
+ "\n",
+ "#on equating coeff. of 1/4/mu*del(P)/del(l)\n",
+ "E=(1-s**2-.5)/.5;\n",
+ "print \"The error shown by pitot tube at new position if value of streamlined flow flow was\\\n",
+ "to be obtained in (%%) : %.4f\"%E\n",
+ "print \"The - sign indicates that it will print lay reduced velocity than what actually is\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percent value of d for which where pitot tube is kept show average velocity in streamline flow in (%) : 14.6447\n",
+ "The percent value of d for which where pitot tube is kept show average velocity in turbulent flow in (%) : 12.1139\n",
+ "The error shown by pitot tube at new position if value of streamlined flow flow wasto be obtained in (%) : -0.1483\n",
+ "The - sign indicates that it will print lay reduced velocity than what actually is\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "example 1.6 page no : 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The Power required to pump acid \n",
+ "The gauge pressure at pump outlet \n",
+ "The increase in power required to transfer\n",
+ "The gauge pressure at pump outlet\n",
+ "'''\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhon = 1068. #density of nitric acid\n",
+ "mun = 1.06/1000. #viscosity of nitric acid\n",
+ "g = 9.81\n",
+ "l = 278.\n",
+ "d = 0.032\n",
+ "alpha = 1.\n",
+ "h2 = 57.4 #height to be raised\n",
+ "h1 = 5. #height from which to be raised\n",
+ "e = .0035/1000. #roughness\n",
+ "G = 2.35 #mass flow rate\n",
+ "pi = 3.14\n",
+ "#calculations\n",
+ "#part 1\n",
+ "u = 4.*G/rhon/pi/d**2\n",
+ "Re = rhon*d*u/mun\n",
+ "rr = e/d #relative roughness\n",
+ "\n",
+ "#Reading's from Moody's Chart\n",
+ "phi = .00225 #friction coeff.\n",
+ "W = u**2/2.+g*(h2-h1)+4*phi*l*u**2/d #The work done/kg of fluid flow in J/kg\n",
+ "V = abs(W)*G\n",
+ "print \"The Power required to pump acid in kW : %.4f\"%(abs(V)/1000)\n",
+ "\n",
+ "#part 2\n",
+ "P2 = -u**2*rhon/2.+g*(h1)*rhon+abs(W+2)*rhon\n",
+ "print \"The gauge pressure at pump outlet when piping is new in (kPa) : %.4f\"%(P2/1000)\n",
+ "\n",
+ "#part 3\n",
+ "e = .05/1000\n",
+ "Re = rhon*d*u/mun\n",
+ "rr = e/d\n",
+ "\n",
+ "#Reading's from Moody's Chart\n",
+ "phi = 0.0029\n",
+ "W = u**2/2+g*(h2-h1)+4*phi*l*u**2/d\n",
+ "Vnew = abs(W)*G\n",
+ "Pi = (Vnew-V)/V*100.\n",
+ "print \"The increase in power required to transfer in old pipe in (%%): %.4f\"%Pi\n",
+ "\n",
+ "#part 4\n",
+ "P2 = -u**2*rhon/2+g*(h1)*rhon+abs(W+2)*rhon\n",
+ "print \"The gauge pressure at pump outlet when piping is old in (kPa) :%.4f\"%(P2/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Power required to pump acid in kW : 2.5936\n",
+ "The gauge pressure at pump outlet when piping is new in (kPa) : 1229.2152\n",
+ "The increase in power required to transfer in old pipe in (%): 15.3353\n",
+ "The gauge pressure at pump outlet when piping is old in (kPa) :1409.9715\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.7 page no : 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "power required to drive pump \n",
+ "The gauge pressure in (kPa)\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho=990.;\n",
+ "mu=5.88/10000;\n",
+ "g=9.81;\n",
+ "pi=3.14;\n",
+ "temp=46.+273\n",
+ "e=1.8/10000 #absolute roughness\n",
+ "Q=4800./1000./3600;\n",
+ "l=155.;\n",
+ "h=10.5;\n",
+ "d=0.038;\n",
+ "delh=1.54 #head loss at heat exchanger\n",
+ "effi=0.6 #efficiency\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "u=Q*4./pi/d**2;\n",
+ "Re=rho*d*u/mu;\n",
+ "rr=e/d #relative roughness\n",
+ "\n",
+ "#from moody's diagram\n",
+ "phi=0.0038 #friction factor\n",
+ "alpha=1. #constant\n",
+ "leff=l+h+200*d+90*d;\n",
+ "Phe=g*delh #pressure head lost at heat exchanger\n",
+ "W=u**2/2/alpha+Phe+g*h+4*phi*leff*u**2/d; #work done by pump\n",
+ "G=Q*rho; #mass flow rate\n",
+ "P=W*G; #power required by pump\n",
+ "Pd=P/effi #power required to drive pump\n",
+ "print \"power required to drive pump in (kW) : %.4f\"%(Pd/1000)\n",
+ "\n",
+ "P2=(-u**2/2/alpha+W)*rho;\n",
+ "print \"The gauge pressure in (kPa): %.4f\"%(P2/1000)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power required to drive pump in (kW) : 0.4763\n",
+ "The gauge pressure in (kPa): 213.6461\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.8 page no : 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Volumetric flow rate initial\n",
+ "Volumetric flow rate final\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho=908.;\n",
+ "mu=3.9/100;\n",
+ "g=9.81;\n",
+ "pi=3.14;\n",
+ "d=0.105;\n",
+ "l=87.;\n",
+ "h=16.8;\n",
+ "e=0.046/1000; #absolute roughness\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "#part1\n",
+ "P=-rho*g*h; #change in pressure\n",
+ "a=-P*rho*d**3/4/l/mu**2 #a=phi*Re**2\n",
+ "\n",
+ "#using graph given in book(appendix)\n",
+ "Re=8000.\n",
+ "u=mu*Re/rho/d\n",
+ "Q=u*pi*d**2/4.\n",
+ "print \"Volumetric flow rate initial (m**3/s): %.4f\"%Q\n",
+ "\n",
+ "#part 2\n",
+ "W=320.;\n",
+ "Pd=W*rho; #pressure drop by pump\n",
+ "P=P-Pd;\n",
+ "a=-P*rho*d**3./4./l/mu**2 #a=phi*Re**2\n",
+ "\n",
+ "#using graph given in book(appendix)\n",
+ "Re=15000.;\n",
+ "u=mu*Re/rho/d;\n",
+ "Q=u*pi*d**2./4;\n",
+ "print \"Volumetric flow rate final(part 2) (m**3/s) : %.4f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volumetric flow rate initial (m**3/s): 0.0283\n",
+ "Volumetric flow rate final(part 2) (m**3/s) : 0.0531\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.9 pageno : 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Time required to water level to fall in the tank \n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "# Initialization of Variable\n",
+ "rho=1000.;\n",
+ "mu=1.25/1000;\n",
+ "g=9.81;\n",
+ "pi=3.14\n",
+ "d = 0.105\n",
+ "d1=0.28; #diameter of tank\n",
+ "d2=0.0042; #diameter of pipe\n",
+ "l=0.52; #length of pipe\n",
+ "rr=1.2/1000./d; #relative roughness\n",
+ "phid=0.00475;\n",
+ "print \"It is derived from tyhe graph giben in appedix and can be seen \\\n",
+ "is arying b/w 0.0047 & 0.0048 dependent on D which varies from 0.25 to 0.45 : %f\"%phid\n",
+ "\n",
+ "#calculations\n",
+ "def intregrate():\n",
+ " s=0\n",
+ " for i in range(0,1000):\n",
+ " D=linspace(0.25,0.45,1000);\n",
+ " y=math.sqrt(((pi*d1**2./pi/d2**2)**2-1)/2/9.81+(4*phid*l*(pi*d1**2/pi \\\n",
+ " /d2**2)**2)/d2/9.81)*((0.52+D[i])**-0.5)*2/10000;\n",
+ " s=s+y;\n",
+ " a=s;\n",
+ " return a\n",
+ "\n",
+ "b=intregrate();\n",
+ "print \"Time required to water level to fall in the tank in (s): %.4f\"%b\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "It is derived from tyhe graph giben in appedix and can be seen is arying b/w 0.0047 & 0.0048 dependent on D which varies from 0.25 to 0.45 : 0.004750\n",
+ "Time required to water level to fall in the tank in (s): 514.7299\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 1.10 pageno : 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find d\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho=1000.;\n",
+ "mu=1.42/1000;\n",
+ "g=9.81;\n",
+ "pi=3.14;\n",
+ "l=485.;\n",
+ "h=4.5\n",
+ "e=8.2/100000;\n",
+ "Q=1500.*4.545/1000/3600;\n",
+ "\n",
+ "print \"assume d as 6cm\"\n",
+ "d=0.06;\n",
+ "u=4*Q/pi/d**2;\n",
+ "Re=rho*d*u/mu;\n",
+ "rr=e/d; #relative roughness\n",
+ "\n",
+ "#using moody's chart\n",
+ "phi=0.0033 #friction coeff.\n",
+ "d=(64*phi*l*Q**2/pi**2/g/h)**0.2;\n",
+ "print \"The calculated d after (1st iteration which is close to what we\\\n",
+ " assume so we do not do any more iteration) in(cm) %d \"%(d*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "assume d as 6cm\n",
+ "The calculated d after (1st iteration which is close to what we assume so we do not do any more iteration) in(cm) 6 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch10.ipynb b/Problems_In_Fluid_Flow/ch10.ipynb
new file mode 100644
index 00000000..6c990a70
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch10.ipynb
@@ -0,0 +1,558 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : SEdimentation and classification"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.1 pageno : 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Draw Concentration vs Settling veocity\n",
+ "\n",
+ "%pylab inline\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "#example 10.1\n",
+ "# Initialization of Variable\n",
+ "t = [0, 0.5, 1. ,2. ,3., 4., 5., 6., 7., 8., 9., 10.] #time\n",
+ "h = [1.10 ,1.03, .96, .82, .68, .54, .42, .35, .31, .28, .27, .27]\n",
+ "Cl = [0 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n",
+ "m = 0.05\n",
+ "V = 1/1000. #volume\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "\n",
+ "#calculations\n",
+ "Co = m/V #concentration at t = 0\n",
+ "v[0] = (h[0]-h[1])/(t[1]-t[0])\n",
+ "Cl[0] = Co\n",
+ "for i in range(1,11):\n",
+ " v[i] = (h[i-1]-h[i+1])/(t[i+1]-t[i-1]) #slope or settling velocity\n",
+ " Cl[i] = Co*h[0]/(h[i]+v[i]*t[i])\n",
+ "\n",
+ "plot(t,h,'r--d')\n",
+ "clf()\n",
+ "plot(Cl,v,'r->')\n",
+ "print Cl,v\n",
+ "suptitle(\"Concentration vs Settling veocity\")\n",
+ "xlabel(\"Concentration(kg/m**3)\")\n",
+ "ylabel(\"Settling velocity (m/h)\")\n",
+ "show()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "[50.0, 50.0, 50.0, 50.000000000000014, 50.000000000000014, 51.88679245283019, 61.452513966480446, 80.88235294117649, 99.09909909909915, 125.00000000000003, 174.60317460317458]"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " [0.14000000000000012, 0.14000000000000012, 0.14000000000000004, 0.13999999999999996, 0.13999999999999996, 0.13000000000000003, 0.09500000000000003, 0.05499999999999999, 0.034999999999999976, 0.01999999999999999, 0.0050000000000000044]\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEfCAYAAAC9CZqZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVVX+//HXQVFHRSlTVNBQQbnf5CKWippCOpIXFEyT\nvE8zappWVvOd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31/duHFDFRcXq3nz5ik/Pz/l4eGh\nYmJi7nucVatWqSZNmih3d3c1YMAApZRSLVq0UHPnzlWenp7qu+++U2+88Yby8/NTbm5uatq0aUop\npbZu3apatmypevTooby9vdXNmzdVv3791JEjR5RSSn3yySfK3d1dubm5lRn5t0WLFuq1117T3yd/\n4cIFpZRS3377rYqIiNBvFxQUpI4ePaq0Wq2KjIxU//M//6OUUurDDz9U3bt3V/7+/mrKlClqxowZ\n+n3Cw8PVqVOn1N69e1Xfvn3VU089pbp27apefvlltXHjRuXn56fc3d3VuXPnlFJK5efnKx8fH+Xr\n66sKCgoqXFfaJ598osLDw/XLW7ZsUfPmzavkX13UN1I0RK1ZtWqVmjNnzj3rt23bpgYNGqRKSkrU\nhQsXVOfOndX58+fV3r17VevWrVV2drYqKSlRgYGBav/+/erWrVuqa9eu+g/p69evq+LiYhUTE6Pe\neustpZRShYWFytfXV6Wnp1d4HKVUmSG6lVJKo9GorVu36pd///13/ffPPPOM+uKLL5RSf3yw33Fn\nOTs7W3Xu3FldunRJFRcXqwEDBqjt27frj71z506llFIvvfSSPuvixYvV22+/XeZYBw8eVBEREWrR\nokVKKaWys7OVvb29unLlirp9+7bq06ePmjlzplLqjzlmlNIVSGtra5Wbm6tu3bqlOnbsqF5//XX9\nz3/27Nnq5s2bauLEieqdd95R0dHRauLEiRWuU0qpd955R3Xr1k21b99e/fzzz/qcP//8s/L39zfk\nn17UI9I9JWpNRV0u+/fv5+mnn0aj0dCuXTv69evH4cOH0Wg0+Pv707FjRzQaDV5eXqSnp3PmzBk6\ndOhAz549AWjZsiWNGjXiq6++YuPGjXh7e9OrVy9+//13zp49W+5xMjIyys3SqFEjRo0apV/es2cP\nvXr1wsPDgz179pCamqp/Td31XKxSisOHDxMUFESbNm1o1KgR48aN45tvvgGgSZMmDB06FICePXvq\nM/z666906NChzHGmT5+Ou7s7r7zyCqAbNygoKAhra2saN27M6NGj9ec/dOgQAQEB+v39/PywsbGh\nSZMmODg46K91uLm5kZGR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aTFnWb7/9Rl5enhSMBkhaGkIIIQwmF8KFEEIYTIqGEEIIg0nREEII\nYTApGkIIIQwmRUMIIYTBpGgIIYQw2P8HesHkU34xCuAAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2d35450>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.2 page no : 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "the area for each settling velocity\n",
+ "Volumetric flow rate of clarified water\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "t = [0, 0.5, 1 ,2, 3, 4, 5, 6, 7, 8, 9, 10] #time\n",
+ "h = [1.10 ,1.03, .96, .82, .68, .54, .42, .35, .31, .28, .27, .27]\n",
+ "Cl = linspace(50,100,5)\n",
+ "U = [19.53, 17.71, 16.20, 14.92, 13.82, 12.87, 12.04, 11.31, 10.65, 9.55] #mass ratio of liquid to solid\n",
+ "v = [0.139, 0.115, 0.098, 0.083, 0.071, 0.062, 0.055, 0.049, 0.043, 0.034] #terminal velocity\n",
+ "\n",
+ "#above value taken from graph given with ques.\n",
+ "C = 130. #conc. of solids\n",
+ "Q = 0.06 #slurry rate\n",
+ "Cmax = 130. #maximum solid conc.\n",
+ "rhos = 2300. #density of solid\n",
+ "rho = 998. #density of water\n",
+ "V = rho*(1/C-1/rhos)\n",
+ "F = Q*Cl[0]*3600.\n",
+ "A = [0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " A[i] = F*(U[i]-V)/rho/v[i]\n",
+ "\n",
+ "plot(v,A,'r-')\n",
+ "xlabel(\"Settling Velocity(m/h)\")\n",
+ "ylabel(\"Area(m**2)\")\n",
+ "show()\n",
+ "\n",
+ "#maxima finding using datatraveller in the graph\n",
+ "print \"the area for each settling velocity\",A\n",
+ "print \"1005 m**2 is the maximum area found out from the plot\"\n",
+ "\n",
+ "Qu = Q-F/3600./Cmax\n",
+ "print \"Volumetric flow rate of clarified water in (m**3/s): %.4f\"%Qu\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEMCAYAAADu7jDJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVVX+//HXUUjKu6mYYNFwERFUjPDyHYUS1JwkbZIG\nKi3HmrKpJvtlTU2TNWPqVDOajd+pRmeo8SvaxUt5GbyEdtG8dyOFDFIQMUNMxURg/f44cQQFQQ6c\nfQ68n4/HeTzgcPbenyW136y19trbZowxiIiI1FMLqwsQERHPpiARERGnKEhERMQpChIREXGKgkRE\nRJyiIBEREac0WpBMnDgRX19fIiIiHO8VFhYSHx9PSEgIw4cPp6ioCICcnBwuvfRSIiMjiYyMZPLk\nyY5tduzYQUREBMHBwTz00EONVa6IiNRTowXJXXfdxZo1a6q8N3PmTOLj48nMzGTYsGHMnDnT8bOg\noCB27drFrl27mDdvnuP9++67j/nz55OVlUVWVtZ5+xQREWs1WpAMGTKEjh07VnlvxYoVTJgwAYAJ\nEyawbNmyC+4jPz+f48ePEx0dDcD48eNr3UZERFzLpXMkBQUF+Pr6AuDr60tBQYHjZ9nZ2URGRhIb\nG8uHH34IQF5eHv7+/o7P+Pn5kZeX58qSRUSkFl5WHdhms2Gz2QDo3r07Bw4coGPHjuzcuZMxY8bw\n5ZdfXvT+RETk4jl7pyyX9kh8fX05dOgQYB+26tq1KwCXXHKJYxisf//+BAYGkpWVhZ+fH7m5uY7t\nc3Nz8fPzq3H/xpgm+3r66actr0FtU/vUvqb3agguDZKEhARSUlIASElJYcyYMQAcOXKEsrIyAL75\n5huysrL42c9+xhVXXE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6dOnD998841jH//973+54YYbAPstQKr794mNjWXVqlXV/v6kmWrY\nJTAizjlx4oTp16+fCQkJMZMnTzYbN240xhhTUlJiBg0aZI4cOWKMMSY1NdVMnDjRGGNMbGxslYV+\nAQEB5vvvv6/2+zZt2hhjjHn//fdN+/btTV5enikvLzeDBg0yH330kTl16pTp0aOHycnJMcYYk5SU\nVO2CrNOnTxtfX19TWFhojDFmxIgRZuXKlea///2vueeee4wxxpSVlZlf/OIXZtOmTVWO/dZbb5n4\n+HhTXl5uCgoKzJVXXmny8/PNqlWrzODBg82pU6eMMcYcPXrUGGPMnXfead5+++3z2nLixAkTGBho\nSktLjTHGDB482HzxxRemtLTUdOvWzVHr+++/bzp06GAOHTpkTp8+bbp3726efvppY4wxc+bMcazQ\nLi0tNf369avx3+fDDz907HPo0KFutVJdrKUeibiV1q1bs2PHDl599VW6dOnCrbfeSkpKCnv37uXL\nL78kLi6OyMhIpk+fXuVupqYe62qjo6Pp3r07NpuNfv36kZ2dzZ49e/jZz37GVVddBdh7HtXt+5JL\nLiEhIYE333yTI0eOsHv3bkaMGEFaWhppaWlERkZyzTXXkJmZyddff11l2w8//JDk5GRsNhtdu3Yl\nJiaGbdu2sX79eiZOnIiPjw+A4+FuF/q3uv7663n33XfZs2cPZ86coXfv3uc9NA7g2muvxdfXl0su\nuYSgoCDHA+LCw8PJyckB4JNPPqlyF9tz/30qPgfQvXv3Kt9L8+ZldQEi52rRogUxMTHExMQQERFB\nSkoK11xzDb17967xxob1mX9o1aqV4+uWLVtSWlp63n4uFFBJSUn86U9/whjDmDFjaNmyJQC///3v\nueeee2rczmaz1bjfiw3ESZMmMX36dHr16uV4dkt1+6nc1hYtWji+b9GiBaWlpQCsXr3aMax17jYV\n/z6V9++ujy8Q19N/CeJWMjMzycrKcny/a9cuAgIC6NmzJ999953jcbtnzpwhIyMDgLZt2/LDDz84\ntjn3+7qy2Wz07NmTb775hm+//RaAxYsX1xhSsbGxZGZm8ve//52kpCQARowYwYIFCzh58iRgfy7E\nd999V2W7IUOGsHjxYsrLy/nuu+/YtGkTAwYMID4+nn/961+Oq7KOHj163jHPbVt0dDS5ubn83//9\nn6OGzp07c+LEiYtu/4YNG+r8TJT8/HxHr01EPRJxKydOnOCBBx6gqKgILy8vgoODefXVV/H29uat\nt97iwQcf5NixY5SWlvLwww8TFhbGnXfeyb333stll13Gxx9/zD333MPIkSPx8/Nj/fr1VfZfORSq\nCwgfHx/mzZvHyJEjad26Nddee22NQWKz2Rg3bhxvvvkmMTExAMTHx/PVV18xaNAgwD65v3DhQrp0\n6eLYz9ixY9m8eTN9+/bFZrPx/PPP07VrV0aMGMHu3buJiorikksu4Re/+AV//vOfqxyzurYlJiby\n6aefOp4g2bJlS8LDw9m7dy89e/bEZrNdsA02m40jR47g4+ND69atq7xf3b/dmTNnyM3NJTQ0tNp9\nSvOjmzaKnOPkyZOOE+r9999PSEgIDz30kMVV1Wz06NFMmTKF6667zvHev//9bwoKCnjsscfqtI+F\nCxeSl5fH1KlTa/1sWloaK1euZM6cOfWuWZoWBYnIOWbPnk1KSgolJSX079+f1157zTEB7k6KiooY\nMGAA/fr1Y/HixVV+VlJSQlxcHBs3bmzwpxUmJibyl7/8hYCAgAbdr3guBYmIiDhFk+0iIuIUBYmI\niDhFQSIiIk5RkIiIiFMUJCIi4hQFiYiIOOX/A9X59HMYa+FEAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x219ea90>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the area for each settling velocity [956.58577326448562, 984.95679741043818, 989.07500346402981, 1000.9355052127868, 1002.4484410905754, 982.14964830945723, 943.84207758782964, 898.19417690065814, 857.42395579055744, 734.27713187539746]\n",
+ "1005 m**2 is the maximum area found out from the plot\n",
+ "Volumetric flow rate of clarified water in (m**3/s): 0.0369\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.3 pageno : 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The fraction of heavy ore remained\n",
+ "The percentage of heavy ore left \n",
+ "the fraction of light ore in overhead product\n",
+ "The minimum density required to seperate 2 ores\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho1 = 2600. #density lighter\n",
+ "rho2 = 5100. #density heavier\n",
+ "pd1 = linspace(0.000015,0.000095,9) #particle diameter lighter\n",
+ "pd2 = linspace(0.000025,0.000095,8) #particle diameter heavier\n",
+ "wp1 = [0 ,22 ,35, 47, 59, 68, 75, 81 ,100] #weight distribution lighter\n",
+ "wp2 = [0, 21, 33.5, 48, 57.5, 67 ,75, 100] #weight distribution heavier\n",
+ "rho = 998.6 #density water\n",
+ "mu = 1.03/1000 #viscosity water\n",
+ "g = 9.81\n",
+ "u = 0.004 #velocity of water\n",
+ "d = 95/1000000. #paeticle diameter maximum\n",
+ "\n",
+ "#calculation\n",
+ "#part 1\n",
+ "Re = d*u*rho/mu\n",
+ "d1 = math.sqrt(18*mu*u/g/(rho1-rho))\n",
+ "d2 = math.sqrt(18*mu*u/g/(rho2-rho))\n",
+ "def inter(d,f,g,b): #interpolation linear\n",
+ " for i in range(b):\n",
+ " if d <= f[i+1] and d>f[i]:\n",
+ " break\n",
+ " else: \n",
+ " continue\n",
+ " a = (d-f[i])/(f[i+1]-f[i])*(g[i+1]-g[i])+g[i]\n",
+ " return a\n",
+ "\n",
+ "a = inter(d1,pd1,wp1,9)\n",
+ "b = inter(d2,pd2,wp2,8)\n",
+ "v2 = 1./(1+5.)*100.-b/100.*1./(1+5)*100\n",
+ "v1 = 5./(1+5.)*100.-a/100.*5./(1+5)*100\n",
+ "pl2 = (v2)/(v2+v1)\n",
+ "print \"The fraction of heavy ore remained in bottom %.4f\"%pl2\n",
+ " \n",
+ "#part 2\n",
+ "rho = 1500.\n",
+ "mu = 6.25/10000\n",
+ "a = math.log10(2*d**3*rho*g*(rho1-rho)*3*mu**2) #math.log10(Re**2(R/rho/mu**2))\n",
+ "\n",
+ "#using value from chart(graph)\n",
+ "Re = 10.**0.2136\n",
+ "u = Re*mu/rho/d\n",
+ "d2 = math.sqrt(18*mu*u/g/(rho1-rho))\n",
+ "b = inter(d2,pd2,wp2,8)\n",
+ "print \"The percentage of heavy ore left in this case %.4f\"%(100-b+3.5)\n",
+ "\n",
+ "#part 3\n",
+ "a = 0.75 #% of heavy ore in overhead product\n",
+ "s = 100.*5./6./(100*5./6+0.75*100./6)\n",
+ "print \"the fraction of light ore in overhead product: %.4f\"%s\n",
+ "\n",
+ "#part 4\n",
+ "da = pd2[0]\n",
+ "db = pd1[8]\n",
+ "rho = (da**2*rho2-db**2*rho1)/(-db**2+da**2)\n",
+ "print \"The minimum density required to seperate 2 ores in kg/m**3: %.4f\"%rho\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fraction of heavy ore remained in bottom 0.3197\n",
+ "The percentage of heavy ore left in this case 24.8188\n",
+ "the fraction of light ore in overhead product: 0.8696\n",
+ "The minimum density required to seperate 2 ores in kg/m**3: 2413.9881\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.4 page no : 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the density of suspension\n",
+ "\n",
+ "import math \n",
+ "from numpy import true_divide\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "rho = 998.\n",
+ "w0 = 40. #density of slurry\n",
+ "mu = 1.01/1000\n",
+ "g = 9.81\n",
+ "rho1 = 2660. #density quartz\n",
+ "h = 0.25\n",
+ "t = 18.5*60\n",
+ "mp = [5 ,11.8, 20.2, 24.2, 28.5, 37.6 ,61.8]\n",
+ "d = true_divide([30.2, 21.4, 17.4, 16.2, 15.2, 12.3, 8.8],1000000)\n",
+ "u = h/t\n",
+ "d1 = math.sqrt(18*mu*u/g/(rho1-rho))\n",
+ "def inter(d,f,g,b): #interpolation linear\n",
+ " for i in range(b):\n",
+ " if d > f[i+1] and d <= f[i]:\n",
+ " break\n",
+ " else: \n",
+ " continue\n",
+ " break\n",
+ " \n",
+ " a = -(d-f[i+1])/(f[i]-f[i+1])*(g[i+1]-g[i])+g[i+1]\n",
+ " return a\n",
+ "a = inter(d1,d,mp,6)\n",
+ "phi = 1-a/100.\n",
+ "rhot = phi*(rho1-rho)/rho1*w0+rho\n",
+ "print \"the density of suspension at depth 25cm in kg/m**3 is %.4f\"%rhot\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the density of suspension at depth 25cm in kg/m**3 is 1016.5653\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.5 pag eno : 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Draw undersize vs Particle Size(m)\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "t = [0, 45, 135, 495, 1875, 6900, 66600, 86400] #time\n",
+ "m = [0.1911, 0.1586, 0.1388, 0.1109, 0.0805, 0.0568, 0.0372, 0.0359] #mass total\n",
+ "rho1 = 3100. #density of cement\n",
+ "mu = 1.2/1000 #viscosity of desperant liquid\n",
+ "rho = 790. #density of desperant liquid\n",
+ "h = 0.2\n",
+ "V = 10.\n",
+ "s = 0.\n",
+ "g = 9.81\n",
+ "d = [0,0,0,0,0,0,0,0]\n",
+ "mc = [0,0,0,0,0,0,0,0]\n",
+ "mp = [0,0,0,0,0,0,0,0]\n",
+ "d[0] = 100./1000000 #assumed value\n",
+ "\n",
+ "for i in range(7):\n",
+ " d[i+1] = math.sqrt(18*mu*h/g/t[i+1]/(rho1-rho)) #dia of particles\n",
+ " mc[i+1] = m[i+1]-0.2/100*V #mass of cement\n",
+ " s = s+mc[i+1] \n",
+ "\n",
+ "mc[0] = m[0]-0.2*V/100\n",
+ "s = s+mc[0]\n",
+ "mp[0] = 100.\n",
+ "\n",
+ "for i in range(7):\n",
+ " mp[i+1] = mc[i+1]/mc[0]*100. #mass percent below size\n",
+ "\n",
+ "plot(mp,d)\n",
+ "xlabel(\"%undersize\")\n",
+ "ylabel(\"Particle Size(m)\")\n",
+ "\n",
+ "show()\n",
+ "u = h/t[1]\n",
+ "Re = d[1]*u*rho/mu\n",
+ "if Re<2:\n",
+ " print \"since Re<2 for 81% of particles so settlement occurs mainly by stoke-s law\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAEKCAYAAAC7c+rvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVGX+B/DPKOSmVlabaIM1CMNNcUARLK1oWXS1nCzN\nYFul1jW7aZbrWvuzFXeVS1trumbqrquobWpuCiqyVC6VF0CBbmKJBco9byQaOFy+vz8Ojk4CgzAz\nB5jP+/XylTNzLt85r1fz8XnO8zxHIyICIiIiFXRTuwAiInJeDCEiIlINQ4iIiFTDECIiItUwhIiI\nSDUMISIiUo1dQyg1NRW+vr7Q6/VISEhocptZs2ZBr9fDYDAgNzfX6r5nzpxBREQEvL29MXr0aFRW\nVprfv//++3HDDTdg5syZFufIzs5GQEAA9Ho9XnjhBTt8UyIiagu7hVB9fT2ef/55pKamIi8vD+++\n+y6OHDlisU1KSgqOHTuG/Px8rF69Gs8884zVfePj4xEREYGjR48iPDwc8fHxAICf/exnWLRoEV5/\n/fWrannmmWewZ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TUyJ133inFxcVSWloqd9xx\nh5w6dUpMJpOMHDlSZs6cKSIiUVFRsnfvXhEROX78uPj5+YmIyIIFCyQ4OFhqampERGTmzJnyzjvv\niIhIbW2tVFdXi4hI7969LWqrrKyUgIAAycnJkby8PBk/frzU1dWJiMgzzzwj69evt/k1I2qO3Z6s\nStRV3Xjjjdi5cycA4OzZs4iLi8O2bdswffp0VFZW4qWXXmpx//DwcPMisf7+/igsLMTJkycRFhaG\nW2+9FQDw2GOPWSyZc+UzrqqqqnDhwgVoNBoYjUb06NEDAHDXXXdh8eLFKC4uxiOPPAIvL6+rzi0i\nePzxxzFnzhwEBQVh+fLlyM7ORnBwMACgurpatS5Fck4MIaJ2+Mtf/oL58+fj3//+N+69915MnDgR\nDz/8MFxcXFBfXw8AqKmpsdjnUmgAQPfu3VFXV3fVSsMiYn5PRJCZmYnrrrvuqvP37NnT/PeoqCiM\nGDECO3fuxLhx47Bq1Srcf//9FtvHxMTgjjvuQHR0tPm96OhoxMbGtvEKELUP7wkRtVF+fj5KS0tx\n7733orq62hwaNTU18PDwMN8T2rp1a4vH0Wg0CA0Nxccff4wzZ86gtrYW7733nvnz0aNHY9myZebX\nn3/+eZPHKSgogIeHB2bOnImHHnoIX375pcXnO3bswEcffYSlS5ea3wsPD8fWrVtx8uRJAMCZM2dw\n4sSJa7gKRO3DECJqo/nz52Px4sUAlFbI22+/jZCQEMyePRtz5szB22+/jaFDh+L06dPmgGru2Sv9\n+vVDTEwM7rrrLowaNQqDBg0yf7Zs2TIcOnQIBoMBgwYNwqpVq8yfXXmsLVu2YPDgwQgKCsLhw4cx\ndepUi22WLFmC0tJS8+CFmJgY+Pn5YdGiRRg9ejQMBgNGjx5ts2HmRK3BBUyJiEg1bAkREZFqGEJE\nRKQahhAREamGIURERKphCBERkWoYQkREpJr/B0li8t3stvoOAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2c49850>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "since Re<2 for 81% of particles so settlement occurs mainly by stoke-s law\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.6 page no : 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find mass and diameter\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 998.\n",
+ "rho1 = 2398. #density of ore\n",
+ "mu = 1.01/1000.\n",
+ "g = 9.81\n",
+ "h = 25/100.\n",
+ "t = [114. ,150., 185., 276., 338., 396., 456., 582., 714., 960.]\n",
+ "m = [0.1429 ,0.2010, 0.2500, 0.3564, 0.4208, 0.4781, 0.5354 ,0.6139, 0.6563, 0.7277]\n",
+ "d = [0,0,0,0,0,0,0,0,0,0]\n",
+ "P = [0,0,0,0,0,0,0,0,0,0]\n",
+ "\n",
+ "for i in range(10):\n",
+ " ms = 0.0573+m[9] #total mass setteled\n",
+ " d[i] = math.sqrt(18.*mu*h/g/(rho1-rho)/t[i])\n",
+ " P[i] = m[i]/ms*100 #mass percent of sample\n",
+ "\n",
+ "plot(t,P)\n",
+ "xlabel(\"Settling time (s)\")\n",
+ "ylabel(\"mass percent in (%)\")\n",
+ "show()\n",
+ "print \"& its percentage mass distribution respectively\" ,\"the particle size distribution in (m)\" ,P,d\n",
+ "W = [0,0,0,0,0,0,0,0,0,0]\n",
+ "de = [0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(9):\n",
+ " de[i] = (P[i+1]-P[i-1])/(t[i+1]-t[i-1]) #slope \n",
+ " W[i] = P[i]-t[i]*de[i]\n",
+ " W[0] = P[0]-P[0]\n",
+ "\n",
+ "W[9] = P[9]-t[9] * 0.025\n",
+ "print \"mass and diameter(m)respectively with serial no:\"\n",
+ "\n",
+ "for i in range(4,10):\n",
+ " print i-4,\n",
+ " print \"mass, is\",\n",
+ " print \"for diameter in(m) of %f %f\"%(W[i],d[i])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEMCAYAAAA4S+qsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVXXi//EXCmq5rxdFCzNRWUTENE3zOoZaqZkVLpMx\n6jStTlaTtEwzlGNCmaVTfmemRZnK1LHGyJ+aG9fcd20xlxREExgNcEENgc/vj5PXyIWrwD0g7+fj\nwSO43nvPW+TBu8/nnPP5+BhjDCIiIh6oYncAERGpOFQaIiLiMZWGiIh4TKUhIiIeU2mIiIjHVBoi\nIuKxMiuNUaNG4XA4CAsLcz+WlZVFVFQUQUFB9OnTh5ycHPefTZw4kdatW9O2bVsWL15cVrFERKQE\nyqw0Ro4cyaJFi4o8Fh8fT1RUFLt376Z3797Ex8cDsGPHDmbPns2OHTtYtGgRjz76KIWFhWUVTURE\nrlCZlUaPHj2oX79+kceSkpKIiYkBICYmhnnz5gHw2WefMWzYMPz8/AgMDOTGG29kw4YNZRVNRESu\nkFfPaWRmZuJwOABwOBxkZmYCcOjQIZo3b+5+XvPmzfnhhx+8GU1ERDzga9eBfXx88PHxueSfe/KY\niIgUr7RWjPLqSMPhcJCRkQFAeno6TZo0ASAgIIADBw64n3fw4EECAgIu+B7GmHL38de//tX2DMqk\nTJUxlzJ59lGavFoaAwcOJDExEYDExEQGDRrkfnzWrFnk5eWRkpLCnj176Ny5szejiYiIB8psemrY\nsGGsWLGCI0eO0KJFC15++WWeffZZoqOjee+99wgMDGTOnDkABAcHEx0dTXBwML6+vkybNk1TUSIi\n5VCZlcbHH398wceXLl16wceff/55nn/++bKKU6acTqfdEc6jTJ5RJs+Vx1zK5H0+prQnvMqQj49P\nqc/PiYhc7Urzd6eWEREREY+pNERExGMqDRER8ZhKQ0REPKbSEBERj6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o9e/akZ8+e\nhIWFkZiYSGRkJCEhIaxZs+aCr7mS1T6rV6/u/rxq1ark5+ef9z6XKoZLqVatGmD9XX55nCpVqpCf\nn0/VqlWJiopi5syZxeYsLCwEwNfXlw0bNrBs2TLmzp3LW2+9xbJly9w5vbGyqlQOOqchFcbu3bvZ\ns2eP++utW7cSGBhImzZtOHz4MOvWrQOsVYl37NgBWHP6x44dc7/m1197ysfHhzZt2rBv3z72798P\nwOzZsy/4y7h27druhRLh8kY6Pj4+3HzzzaxevZq9e/cC1mKLv/x7n3X99de7VzXNzc0lJyeH22+/\nncmTJ7N9+3b389LT0wkMDPQ4g8ilqDSkwjhx4gS/+93v3Cd7d+7cSVxcHH5+fsydO5fY2Fg6dOhA\nREQEa9euBawTzw8//DAdO3bk9OnT/OEPf6Bfv34XPBH+ywK4UBnUqFGDadOm0a9fPzp16kSdOnWo\nU6fOec/r1asXO3bscJ8I//XeBsUdp1GjRsyYMYNhw4YRHh5Ot27d2LVr13nP6969O5s2bQLg2LFj\nDBgwgPDwcHr06MEbb7zhft6GDRvo0aPHBb+nIpdLCxaKXIbc3Fxq1qwJwGOPPUZQUBBPPPGELVlO\nnDhBr1692Lhx40Wfc+zYMXr37n3J54hcDo00RC7DO++8Q0REBCEhIRw7doyHHnrItiy1atWiV69e\n5+3a+EszZsywrdTk6qSRhoiIeEwjDRER8ZhKQ0REPKbSEBERj6k0RETEYyoNERHxmEpDREQ89v8B\nEA92IY9i/rEAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x2fe4c90>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "& its percentage mass distribution respectively the particle size distribution in (m) [18.203821656050955, 25.605095541401273, 31.84713375796178, 45.40127388535032, 53.60509554140127, 60.904458598726116, 68.20382165605096, 78.20382165605095, 83.60509554140127, 92.70063694267515] [5.387856206749596e-05, 4.6970241455099756e-05, 4.229436978392301e-05, 3.4626921406038745e-05, 3.129032486308103e-05, 2.890818526183746e-05, 2.693928103374798e-05, 2.3845527268417837e-05, 2.1528774873471063e-05, 1.856661815577208e-05]\n",
+ "mass and diameter(m)respectively with serial no:\n",
+ "0 mass, is for diameter in(m) of 9.937792 0.000031\n",
+ "1 mass, is for diameter in(m) of 11.912124 0.000029\n",
+ "2 mass, is for diameter in(m) of 25.792480 0.000027\n",
+ "3 mass, is for diameter in(m) of 43.461413 0.000024\n",
+ "4 mass, is for diameter in(m) of 56.222222 0.000022\n",
+ "5 mass, is for diameter in(m) of 68.700637 0.000019\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.7 page no : 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "fraction of particles separated \n",
+ "total fraction of particles separated\n",
+ "fraction of particles separated \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "rho = 1002. #density of print erant\n",
+ "rho1 = 2240. #density of kaolin\n",
+ "mu = 1.01/1000 #viscosity\n",
+ "g = 9.81\n",
+ "t = 600.\n",
+ "h2 = 0.2\n",
+ "h1 = 0.4\n",
+ "dg = 15.*10**-6 #particle size to be removed\n",
+ "\n",
+ "#calculations\n",
+ "#part 1\n",
+ "d = math.sqrt(18*mu*h2/g/(rho1-rho)/t)\n",
+ "x = dg/d\n",
+ "f = h2/h1*(1-x**2) #fraction separated after first decanting\n",
+ "g = f*(1-f)\n",
+ "print \"fraction of particles separated after second decanting %.4f\"%g\n",
+ "print \"total fraction of particles separated after decanting %.4f\"%(f+g)\n",
+ "\n",
+ "#part 2\n",
+ "h = (1.-20/40.*(1-x**2))**6\n",
+ "print \"fraction of particles separated after sixth decanting %.4f\"%h\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fraction of particles separated after second decanting 0.1992\n",
+ "total fraction of particles separated after decanting 0.4737\n",
+ "fraction of particles separated after sixth decanting 0.1458\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch11.ipynb b/Problems_In_Fluid_Flow/ch11.ipynb
new file mode 100644
index 00000000..c36db144
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch11.ipynb
@@ -0,0 +1,479 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : Fluidisation\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.1 page no : 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Bubbling fluidisation \n",
+ "fluidisation \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "pi = 3.1428\n",
+ "d = 0.3/1000\n",
+ "mu = 2.21/100000\n",
+ "rho = 106.2 #density under operating condition\n",
+ "u = 2.1/100\n",
+ "rhos = 2600. #density of particles\n",
+ "l = 3.25\n",
+ "g = 9.81\n",
+ "dt = 0.95 #fluidising diameter\n",
+ "\n",
+ "\n",
+ "#part 1\n",
+ "#calculation\n",
+ "a = u**2./d/g*d*rho*u/mu*(rhos-rho)/rho*l/dt\n",
+ "if a>100 :\n",
+ " print \"Bubbling fluidisation will occur as value is %.4f\"%a\n",
+ "\n",
+ "#part 2\n",
+ "Q = 2.04/100000\n",
+ "rhos = 2510.\n",
+ "rho = 800.\n",
+ "mu = 2.85/1000\n",
+ "l = 4.01\n",
+ "dt = 0.63\n",
+ "d = 0.1/1000\n",
+ "u = Q*4/pi/dt**2\n",
+ "a = u**2/d/g*d*rho*u/mu*(rhos-rho)/rho*l/dt\n",
+ "if a<100*10**-4: #compare as value of a is much less than 100\n",
+ " print \"fluidisation occur in smooth mode as value is: %.4e\"%a\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bubbling fluidisation will occur as value is 364.4332\n",
+ "fluidisation occur in smooth mode as value is: 1.0898e-07\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.2 page no ;218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The superficial linear flow rate\n",
+ "Terminal Settling Velocity\n",
+ "Stoke law assumption\n",
+ "Pressure drop across fluidised bed \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "d = 50./1000000\n",
+ "rhos = 1850. #density of particle\n",
+ "rho = 880. #density of hydrocarbon\n",
+ "mu = 2.75/1000 #viscosity of hydrocarbon\n",
+ "e = 0.45 #void fraction coeff.\n",
+ "g = 9.81\n",
+ "h = 1.37 #flow depth\n",
+ "c = 5.5/1000 #c = 1/K\n",
+ "\n",
+ "#calculation\n",
+ "#part 1\n",
+ "u = c*e**3*d**2*g*(rhos-rho)/mu/(1-e)\n",
+ "print \"The superficial linear flow rate in (m/s): %.3e\"%u\n",
+ "\n",
+ "#part 2\n",
+ "u = d**2*g*(rhos-rho)/18/mu\n",
+ "print \"Terminal Settling Velocity in (m/s): %.4f\"%u\n",
+ "Re = d*u*rho/mu\n",
+ "if Re<2 :\n",
+ " print \"Stoke law assumption is sustained with this velocity\"\n",
+ "\n",
+ "#part 3\n",
+ "P = g*(rhos-rho)*h*(1-e)\n",
+ "print \"Pressure drop across fluidised bed in (N/m**2):\",P\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The superficial linear flow rate in (m/s): 7.883e-06\n",
+ "Terminal Settling Velocity in (m/s): 0.0005\n",
+ "Stoke law assumption is sustained with this velocity\n",
+ "Pressure drop across fluidised bed in (N/m**2): 7170.07995\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.3 page no : 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "the linear air flow rate\n",
+ "speed required for smallest particle\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "# Initialization of Variable\n",
+ "g = 9.81\n",
+ "rhos = 1980. #density of ore\n",
+ "rho = 1.218 #density of air\n",
+ "e = 0.4\n",
+ "mu = 1.73/10**5\n",
+ "s = 0\n",
+ "wp = array([0, .08, .20, .40, .60, .80, .90, 1.00]) #weight percent\n",
+ "d = true_divide([0.4 ,0.5, 0.56, 0.62, 0.68, 0.76, 0.84, 0.94],1000)\n",
+ "dav = [0,0,0,0,0,0,0]\n",
+ "mf = [0,0,0,0,0,0,0]\n",
+ "a = [0,0,0,0,0,0,0]\n",
+ "#part 1\n",
+ "for i in range(7):\n",
+ " dav[i] = d[i+1]/2+d[i]/2. #average dia\n",
+ " mf[i] = wp[i+1]-wp[i] #mass fraction\n",
+ " a[i] = mf[i]/dav[i]\n",
+ " s = s+a[i]\n",
+ "\n",
+ "db = 1/s #d bar\n",
+ "\n",
+ "#quadratic coeff. ax**2 +bx +c = 0\n",
+ "c = -(rhos-rho)*g\n",
+ "b = 150.*(1-e)/e**3/db**2*mu\n",
+ "a = 1.75*rho/e**3/db\n",
+ "y = poly1d([a,b,c],False)\n",
+ "U = roots(y)\n",
+ "print \"the linear air flow rate in (m/s): %.4f\"%(abs(U[1]))\n",
+ "\n",
+ "#part 2\n",
+ "d = 0.4/1000\n",
+ "a = 2*d**3/3/mu**2*rho*(rhos-rho)*g\n",
+ "a = math.log10(a)\n",
+ "print \"log10(Re**2/rho/U**2*R) = %.4f\"%a\n",
+ "\n",
+ "#using chart\n",
+ "Re = 10**1.853\n",
+ "u = Re*mu/rho/d\n",
+ "print \"speed required for smallest particle in (m/s): %.4f\"%u\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the linear air flow rate in (m/s): 0.2643\n",
+ "log10(Re**2/rho/U**2*R) = 3.5277\n",
+ "speed required for smallest particle in (m/s): 2.5313\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.4 page no : 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "the diameter of vessel\n",
+ "depth of bed \n",
+ "depth of fluidised bed under operating condition\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "U = 2.032/10**4\n",
+ "pi = 3.1428\n",
+ "rho = 852\n",
+ "g = 9.81\n",
+ "mu = 1.92/1000\n",
+ "mf = 125/3600. #mass flow rate\n",
+ "\n",
+ "#calculation\n",
+ "#part 1\n",
+ "G = U*rho\n",
+ "A = mf/G\n",
+ "d = math.sqrt(4*A/pi)\n",
+ "print \"the diameter of vessel will be in(m): %.4f\"%d\n",
+ "\n",
+ "#part 2\n",
+ "A = 0.201\n",
+ "e = 0.43\n",
+ "ms = 102. #mass of solids\n",
+ "rhos = 1500. #density of solid\n",
+ "L = ms/rhos/A\n",
+ "Lmf = L/(1-e)\n",
+ "print \"depth of bed in (m): %.4f\"%Lmf \n",
+ "\n",
+ "#part 3\n",
+ "d1 = 0.2/1000\n",
+ "U = 2.*5.5/10**3*e**3*d1**2*(rhos-rho)*g/mu/(1-e)\n",
+ "\n",
+ "#now euating for e\n",
+ "#a = e**3/(1-e)\n",
+ "a = U/5.5*10**3/(d1**2*(rhos-rho)*g/mu)\n",
+ "y = poly1d([1,0,a,-a],False)\n",
+ "e2 = roots(y)\n",
+ "L = Lmf*(1-e)/(1-e2[2])\n",
+ "print \"depth of fluidised bed under operating condition in (m): %.4f\"%L\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the diameter of vessel will be in(m): 0.5052\n",
+ "depth of bed in (m): 0.5935\n",
+ "depth of fluidised bed under operating condition in (m): 0.6958\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "-c:45: ComplexWarning: Casting complex values to real discards the imaginary part\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.5 page no : 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find power supplies to the blower\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "g = 9.81\n",
+ "pi = 3.1428\n",
+ "r = 0.51\n",
+ "e = 0.48 #void ratio\n",
+ "rhos = 2280. #density of glass\n",
+ "rho = 1.204 #density of air\n",
+ "U = 0.015 #velocity of water entering bed\n",
+ "L = 7.32\n",
+ "gam = 1.4 #gamma\n",
+ "neta = 0.7 #efficiency\n",
+ "P4 = 1.013*10**5\n",
+ "P1 = P4\n",
+ "v1 = 1/1.204 #volume 1\n",
+ "\n",
+ "#calculation\n",
+ "P3 = P4+g*(rhos-rho)*(1-e)*L\n",
+ "P2 = P3+0.1*85090\n",
+ "v2 = (P1*v1**gam/P2)**(1/gam) #vlume 2\n",
+ "W = 1/neta*gam/(gam-1)*(P2*v2-P1*v1) #work done\n",
+ "v3 = P2*v2/P3 #volume 3\n",
+ "M = U*pi*r**2/v3 #mass flow rate\n",
+ "P = M*W\n",
+ "\n",
+ "# Results\n",
+ "print \"The power supplies to the blower in (W): %.4f\"%P\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power supplies to the blower in (W): 1948.7509\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.6 page no : 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "minimum fluidising velocity\n",
+ "fluidising velocity\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "dt = 12.7/1000\n",
+ "d = 1.8/1000\n",
+ "Q = 2.306/10**6\n",
+ "pi = 3.1428\n",
+ "\n",
+ "#calculation\n",
+ "#part 1\n",
+ "Sc = 4./dt\n",
+ "S = 6./d\n",
+ "f = (1+0.5*Sc/S)**2\n",
+ "U = Q*4/pi/dt**2 #velocity\n",
+ "Ua = f*U #actual velocity\n",
+ "print \"minimum fluidising velocity found using smaller glass column in (m/s): %.4f\"%Ua\n",
+ "\n",
+ "#part 2\n",
+ "dt = 1.5\n",
+ "Sc = 4./dt\n",
+ "f = (1+0.5*Sc/S)**2\n",
+ "Ua = f*U #actual velocity\n",
+ "print \"fluidising velocity found using larger glass column in (m/s): %.4f\"%Ua\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum fluidising velocity found using smaller glass column in (m/s): 0.0200\n",
+ "fluidising velocity found using larger glass column in (m/s): 0.0182\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 11.7 page no : 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find ratio of terminal velocity\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "e = 0.4 #incipent to fluidisation\n",
+ "\n",
+ "#calculation\n",
+ "#part 1\n",
+ "print \"for Re<500\"\n",
+ "print \"the ratio of terminal velocity & minimmum fluidising velocity is\"\n",
+ "\n",
+ "a = 3.1*1.75/e**3\n",
+ "\n",
+ "print math.sqrt(a)\n",
+ "\n",
+ "#part 2\n",
+ "print \"for Re>500\"\n",
+ "print \"the ratio of terminal velocity & minimmum fluidising velocity is\"\n",
+ "a = 150.*(1-e)/18./e**3\n",
+ "print a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for Re<500\n",
+ "the ratio of terminal velocity & minimmum fluidising velocity is\n",
+ "9.20682491416\n",
+ "for Re>500\n",
+ "the ratio of terminal velocity & minimmum fluidising velocity is\n",
+ "78.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch12.ipynb b/Problems_In_Fluid_Flow/ch12.ipynb
new file mode 100644
index 00000000..c84580f4
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch12.ipynb
@@ -0,0 +1,331 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "Chapter 12 : Pneumatic Conveying\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 12.1 page no : 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find actual linear flow rate through duct\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.22\n",
+ "pi = 3.1428\n",
+ "rhos = 518.\n",
+ "rhoav = 321.\n",
+ "mu = 1.73/10**5\n",
+ "g = 9.81\n",
+ "d = 0.65/1000\n",
+ "d2 = 25.5/100 #dia of duct\n",
+ "ms = 22.7/60 #mass flow rate\n",
+ "\n",
+ "#calculation\n",
+ "e = (rhos-rhoav)/(rhos-rho)\n",
+ "#coeff of quadratic eqn in U\n",
+ "#a*x**2+b*x+c = 0\n",
+ "c = -(1-e)*(rhos-rho)*g\n",
+ "b = 150.*(1-e)**2*mu/d**2/e**3\n",
+ "a = 1.75*(1.-e)*rho/d/e**3\n",
+ "y = poly1d([a,b,c],False)\n",
+ "U = roots(y)\n",
+ "Us = ms*4/pi/d2**2/rhos #superficial speed\n",
+ "Ua = e/e*(U[1]/e+Us/(1-e))\n",
+ "print \"the actual linear flow rate through duct in (m/s): %.4f\"%Ua\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the actual linear flow rate through duct in (m/s): 0.2059\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 12.2 page no : 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find maximum carrying capacity of polythene particles\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.22 #density of air\n",
+ "pi = 3.1428\n",
+ "rhos = 910. #density of polyethene\n",
+ "d = 3.4/1000. #dia of particles\n",
+ "mu = 1.73/10**5.\n",
+ "g = 9.81\n",
+ "dt = 3.54/100. #dia of duct\n",
+ "\n",
+ "#calculation\n",
+ "a = 2.*d**3*rho*g*(rhos-rho)/3/mu**2\n",
+ "print \"R/rho/U**2*(Re**2) = %.4f\"%a\n",
+ "\n",
+ "#using Chart\n",
+ "Re = 2.*10**3\n",
+ "U = mu*Re/d/rho\n",
+ "b = U/(g*dt)**.5\n",
+ "if b>0.35:\n",
+ " print \"choking can occur of this pipe system\"\n",
+ "else:\n",
+ " print \"choking can not occur of this pipe system\"\n",
+ "\n",
+ "#part 2\n",
+ "Uc = 15. #actual gas velocity\n",
+ "e = ((Uc-U)**2/2./g/dt/100.+1)**(1./-4.7)\n",
+ "Usc = (Uc-U)*(1-e) #superficial speed of solid\n",
+ "Cmax = Usc*rhos*pi*dt**2./4\n",
+ "print \"the maximum carrying capacity of polythene particles in (kg/s) %.4f\"%Cmax\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R/rho/U**2*(Re**2) = 952227.8618\n",
+ "choking can occur of this pipe system\n",
+ "the maximum carrying capacity of polythene particles in (kg/s) 0.5949\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 12.3 page no : 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Pressure value in kN/m**2\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.22 #density of air\n",
+ "pi = 3.1428\n",
+ "rhos = 1400. #density of coal\n",
+ "mu = 1.73/10**5.\n",
+ "g = 9.81\n",
+ "U = 25.\n",
+ "Ut = 2.80\n",
+ "l = 50.\n",
+ "ms = 1.2 #mass flow rate\n",
+ "mg = ms/10. #mass flow of gas\n",
+ "\n",
+ "#calculation\n",
+ "Qs = ms/rhos #flow of solid\n",
+ "Qg = mg/rho #flow of gas\n",
+ "us = U-Ut #actual linear velocity\n",
+ "A = Qg/U\n",
+ "Us = Qs/A #solid velocity\n",
+ "e = (us-Us)/us\n",
+ "d = math.sqrt(4*A/pi)\n",
+ "def fround(x,n):\n",
+ " # fround(x,n)\n",
+ " # Round the floating point numbers x to n decimal places\n",
+ " # x may be a vector or matrix# n is the integer number of places to round to\n",
+ " y = round(x*10**n)/10.**n\n",
+ " return y\n",
+ "\n",
+ "d = fround(d,4)\n",
+ "Re = d*rho*U/mu\n",
+ "\n",
+ "#using moody's chart\n",
+ "phi = 2.1/1000 #friction factor\n",
+ "P1 = 2*phi*U**2*l*rho/d*2\n",
+ "f = 0.05/us\n",
+ "P2 = 2*l*f*(0.0098)*rhos*us**2/d\n",
+ "P2 = fround(P2/1000,1)*1000\n",
+ "delP = rho*e*U**2+rhos*(0.0098)*us**2+P1+P2\n",
+ "#print (delP,\"the pressure difference in kN/m**2 \")\n",
+ "print 'The Pressure value in kN/m**2 is %.1f'%(delP/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Pressure value in kN/m**2 is 33.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 12.4 page no : 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The Pressure value in kN/m**2\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.22 #density of air\n",
+ "pi = 3.1428\n",
+ "rhos = 1090. #density of steel\n",
+ "mu = 1.73/10.**5\n",
+ "g = 9.81\n",
+ "d = 14.5/100.\n",
+ "Qg = 0.4\n",
+ "Qs = 5000./3600./1090.\n",
+ "Ut = 6.5\n",
+ "ar = 0.046/1000 #absolute roughness\n",
+ "l = 18.5 #length\n",
+ "\n",
+ "#calculation\n",
+ "def fround(x,n):\n",
+ " # fround(x,n)\n",
+ " # Round the floating point numbers x to n decimal places\n",
+ " # x may be a vector or matrix# n is the integer number of places to round to\n",
+ " y = round(x*10**n)/10**n\n",
+ " return y\n",
+ "\n",
+ "Us = Qs/pi/d**2*4 #solid velocity\n",
+ "U = Qg/pi/d**2*4\n",
+ "us = U-Ut #actual linear velocity\n",
+ "e = 1-Us/us\n",
+ "e = fround(e,4)\n",
+ "Re = rho*U*d/mu\n",
+ "rr = ar/d #relative roughness\n",
+ "\n",
+ "#using moody's diagram\n",
+ "phi = 2.08/1000\n",
+ "P1 = 2*phi*U**2*l*rho/d*2\n",
+ "f = 0.05/us\n",
+ "P2 = 2*l*f*(1-e)*rhos*us**2/d\n",
+ "P2 = fround(P2/1000,2)*1000\n",
+ "delP = rhos*(1-e)*us**2+rhos*(1-e)*g*l+P1+P2\n",
+ "#print (delP,\"the pressure difference in kN/m**2 \")\n",
+ "print 'The Pressure value in kN/m**2 is %.2f'%(delP/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Pressure value in kN/m**2 is 4.21\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 12.5 pageno :254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The maximum pressure drop\n",
+ "The minimum pressure drop\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "l = 25.\n",
+ "pi = 3.1428\n",
+ "rhos = 2690. #density of ore\n",
+ "emin = 0.6\n",
+ "emax = 0.8\n",
+ "g = 9.81\n",
+ "\n",
+ "#calculation\n",
+ "Pmax = rhos*(1-emin)*g*l\n",
+ "print \"The maximum pressure drop in (N/m**2):\",Pmax\n",
+ "Pmin = rhos*(1-emax)*g*l\n",
+ "print \"The minimum pressure drop in (N/m**2):\",Pmin\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum pressure drop in (N/m**2): 263889.0\n",
+ "The minimum pressure drop in (N/m**2): 131944.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch13.ipynb b/Problems_In_Fluid_Flow/ch13.ipynb
new file mode 100644
index 00000000..4422df84
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch13.ipynb
@@ -0,0 +1,375 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Centrifugal Separation Operations\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.1 page no : 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "ratio of cetrifugal force & gravitational force\n",
+ "equivalent to gravity settling tank of crossectional area\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 998.\n",
+ "g = 9.81\n",
+ "pi = 3.1428\n",
+ "omega = 2*pi*1055./60 #angular rotation\n",
+ "r = 2.55/100 #radius outer\n",
+ "ld = 1.55/100. #liq. depth\n",
+ "l = 10.25/100.\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "a = r*omega**2/g\n",
+ "print \"ratio of cetrifugal force & gravitational force is: %.4f\"%a\n",
+ "\n",
+ "#part2\n",
+ "ri = r-ld #radius internal\n",
+ "V = pi*(r**2-ri**2)*l\n",
+ "sigma = (omega**2*V)/(g*math.log(r/ri))\n",
+ "print \"equivalent to gravity settling tank of crossectional area of in (m**2): %.4f\"%sigma\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ratio of cetrifugal force & gravitational force is: 31.7517\n",
+ "equivalent to gravity settling tank of crossectional area of in (m**2): 0.2358\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.2 page no : 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The maximum safe speed allowed in rpm\n",
+ "the power in N/m**2\n",
+ "pressure gradient in radial direction \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "sigma = 55.*10**6 #maximum stress\n",
+ "d = 35.2/100\n",
+ "rhos = 8890. #density of bronze\n",
+ "rho = 1105. #density of solution\n",
+ "t = 80./1000 #thickness\n",
+ "tau = 4.325/1000.\n",
+ "pi = 3.1428\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "ri = d/2.-t #radius internal\n",
+ "def fround(x,n):\n",
+ " # fround(x,n)\n",
+ " # Round the floating point numbers x to n decimal places\n",
+ " # x may be a vector or matrix# n is the integer number of places to round to\n",
+ " y = round(x*10**n)/10**n\n",
+ " return y\n",
+ "\n",
+ "omega = math.sqrt((sigma*tau*2/d)/(.5*rho*(d**2/4-ri**2)+rhos*tau*d/2))\n",
+ "N = 60*omega/2/pi\n",
+ "print \"The maximum safe speed allowed in rpm: %.4f\"%N\n",
+ "\n",
+ "#part2\n",
+ "P = .5*rho*(d**2./4-ri**2)*omega**2\n",
+ "P = fround(P/10**4,1)*10.**4\n",
+ "#print (P,\"the power in N/m**2:\")\n",
+ "print 'the power in N/m**2: %3.2e'%( P)\n",
+ "a = rho*omega**2*d/2\n",
+ "a = fround(a/10**6,1)*10**6\n",
+ "#print (a,\"pressure gradient in radial direction in N/m**3:\")\n",
+ "print 'pressure gradient in radial direction in N/m**3: %3.2e'%( a)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum safe speed allowed in rpm: 2560.1495\n",
+ "the power in N/m**2: 8.65e+05\n",
+ "pressure gradient in radial direction in N/m**3: 1.40e+07\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.3 page no : 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find minimum diameter in organic pigment\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhos = 1425. #density of organic pigment\n",
+ "rho = 998. #density of water\n",
+ "pi = 3.1428\n",
+ "omega = 360*2*pi/60.\n",
+ "mu = 1.25/1000.\n",
+ "t = 360.\n",
+ "r = 0.165+0.01\n",
+ "ro = 0.165\n",
+ "\n",
+ "#calculation\n",
+ "d = math.sqrt(18*mu*math.log(r/ro)/t/(rhos-rho)/omega**2)\n",
+ "print 'the minimum diameter in organic pigment in m: %3.1e'%( d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the minimum diameter in organic pigment in m: 2.5e-06\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.4 page no : 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find maximum volumetric flow rate\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhos = 1455. #density of crystals\n",
+ "rho = 998. #density of wliquid\n",
+ "g = 9.81\n",
+ "pi = 3.1428\n",
+ "mu = 1.013/1000\n",
+ "omega = 2*pi*60000/60.\n",
+ "l = 0.5\n",
+ "d = 2*10.**-6. #dia of particles\n",
+ "r = 50.5/1000. #radius\n",
+ "t = 38.5/1000 #thickness of liquid\n",
+ "\n",
+ "#calculation\n",
+ "ri = r-t\n",
+ "V = pi*l*(r**2-ri**2)\n",
+ "Q = d**2*(rhos-rho)/18/mu*omega**2*V/math.log(r/ri)\n",
+ "print \"the maximum volumetric flow rate in (m**3/s): %.4f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the maximum volumetric flow rate in (m**3/s): 0.0104\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.5 pageno : 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find distance of xis of rotation of cream milk interface\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhoc = 867. #density of cream\n",
+ "rhom = 1034. #density of skimmem milk\n",
+ "rm = 78.2/1000. #radius of skimmed milk\n",
+ "rc = 65.5/1000. #radius of cream\n",
+ "\n",
+ "#calculation\n",
+ "r = math.sqrt((rhom*rm**2-rhoc*rc**2)/(rhom-rhoc))\n",
+ "\n",
+ "# results\n",
+ "print \"distance of xis of rotation of cream milk interface in (m): %.4f\"%r\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "distance of xis of rotation of cream milk interface in (m): 0.1249\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.6 page no : 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find volumetric flow rate\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.210 #density of air\n",
+ "mu = 1.78/10**5\n",
+ "g = 9.81\n",
+ "rhos = 2655. #density of ore\n",
+ "pi = 3.1428\n",
+ "d = 0.095\n",
+ "dp = 2.*10**-6 #particle diameter\n",
+ "dt = 0.333 #dia of cyclone separator\n",
+ "h = 1.28\n",
+ "\n",
+ "#calculation\n",
+ "U = dp**2*g*(rhos-rho)/18/mu\n",
+ "Q = 0.2*(pi*d**2/4)**2*d*g/U/pi/h/dt\n",
+ "print \"volumetric flow rate in(m**3/s): %.4f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate in(m**3/s): 0.0215\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 13.7 page no : 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find overall efficiency of cyclone separator\n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "# Initialization of Variable\n",
+ "b = 4.46*10**4\n",
+ "c = 1.98*10**4\n",
+ "s = 0.\n",
+ "def intregrate():\n",
+ " s = 0.\n",
+ " for i in range(10889):\n",
+ " d = linspace(0,10000,10889)\n",
+ " y = (1-math.exp(-b*d[i])*c*(1-math.exp(-c*d[i])))*0.69\n",
+ " s = s+y\n",
+ " a = y\n",
+ " return a\n",
+ "\n",
+ "a = intregrate()\n",
+ "\n",
+ "print \"overall efficiency of cyclone separator in %\",a*100\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "overall efficiency of cyclone separator in % 69.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch2.ipynb b/Problems_In_Fluid_Flow/ch2.ipynb
new file mode 100644
index 00000000..b825a760
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch2.ipynb
@@ -0,0 +1,481 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : pipe flow of gasses and gas liquid mixtures\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.1 page no : 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find pressure maintained at compressor\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "from math import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "pi = 3.1428\n",
+ "mmm = 16.04/1000 #molar mass of methane\n",
+ "mV = 22.414/1000 #molar volume\n",
+ "R = 8.314\n",
+ "mu = 1.08/10**5\n",
+ "r = 4.2/100 #radius\n",
+ "rr = 0.026/2/r #relative roughness\n",
+ "Pfinal = 560.*1000.\n",
+ "tfinal = 273+24\n",
+ "l = 68.5\n",
+ "m = 2.35 #mass flow rate\n",
+ "\n",
+ "#calculation\n",
+ "A = pi*r**2\n",
+ "A = round(A*10.**5)/10.**5\n",
+ "rho = mmm/mV\n",
+ "rho24 = mmm*Pfinal*273/mV/101.3/tfinal #density at 24'C\n",
+ "u = m/rho24/A\n",
+ "Re = u*rho24*2*r/mu\n",
+ "\n",
+ "#from graph\n",
+ "phi = 0.0032\n",
+ "#for solving using fsolve we copy numerical value of constant terms\n",
+ "#using back calculation\n",
+ "#as pressure maintained should be more than Pfinal so guessed value is Pfinal\n",
+ "\n",
+ "def eqn(x):\n",
+ " y = m**2/A**2*log(x/Pfinal)+(Pfinal**2-x**2)/2/R/tfinal*mmm+4*phi*l/2/r*m**2/A**2\n",
+ " return y\n",
+ "x = fsolve(eqn,560*10**3)\n",
+ "print \"pressure maintained at compressor in (kN/m**2):\",x[0]/1000\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure maintained at compressor in (kN/m**2): 960.06917347\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.2 pageno : 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "ratio of Pw/P1\n",
+ "maximum velocity in (m/s)\n",
+ "maximum mass flow rate in(kg/s)\n",
+ "heat taken up to maintain isothermal codition(J/s)\n",
+ "crtical pressure ratio in adiabatic condition\n",
+ "velocity at adiabatic condition in (m/s)\n",
+ "mass flow rate at adiabatic condition in (kg/s)\n",
+ "temperature of discharging gas in (Celcius)\n",
+ "'''\n",
+ "\n",
+ "from math import *\n",
+ "from numpy import *\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "M = 28.8/1000\n",
+ "mu = 1.73/10**5\n",
+ "gamm = 1.402\n",
+ "P1 = 107.6*10**3\n",
+ "V = 22.414/1000\n",
+ "R = 8.314\n",
+ "temp = 285.\n",
+ "d = 4./1000\n",
+ "rr = 0.0008\n",
+ "phi = 0.00285\n",
+ "l = 68.5 \n",
+ "\n",
+ "#calculation\n",
+ "#constant term of equation\n",
+ "#part1\n",
+ "\n",
+ "a = 1.-8*phi*l/d #constant term in deff\n",
+ "def f(x):\n",
+ " return log(x**2)-x**2+2.938\n",
+ " \n",
+ "x = fsolve(f,1)\n",
+ "print x\n",
+ "z = 1./x[0]\n",
+ "z = round(z*1000.)/1000\n",
+ "print \"ratio of Pw/P1 : %.4f\"%z\n",
+ "\n",
+ "#part2\n",
+ "Pw = z*P1\n",
+ "nuw = V*P1*temp/Pw/M/273.\n",
+ "Uw = sqrt(nuw*Pw)\n",
+ "print \"maximum velocity in (m/s): %.4f\"%Uw\n",
+ "\n",
+ "#part3\n",
+ "Gw = pi*d**2/4*Pw/Uw\n",
+ "print \"maximum mass flow rate in(kg/s): %.4f\"%Gw\n",
+ "\n",
+ "#part4\n",
+ "G = 2.173/1000\n",
+ "J = G*Uw**2/2\n",
+ "print \"heat taken up to maintain isothermal codition(J/s): %.4f\"%J\n",
+ "\n",
+ "#part5\n",
+ "nu2 = 2.79 #found from graph\n",
+ "nu1 = R*temp/M/P1\n",
+ "P2 = P1*(nu1/nu2)**gamm\n",
+ "print \"crtical pressure ratio in adiabatic condition: %.4f\"%(P2/P1)\n",
+ "\n",
+ "#part6\n",
+ "Uw = sqrt(gamm*P2*nu2)\n",
+ "print \"velocity at adiabatic condition in (m/s): %.4f\"%Uw\n",
+ "\n",
+ "#part7\n",
+ "Gw = pi*d**2/4*Uw/nu2\n",
+ "print \"mass flow rate at adiabatic condition in (kg/s): %.4f\"%Gw\n",
+ "\n",
+ "\n",
+ "#part8\n",
+ "#polynomial in T of the form ax**2+bx+c = 0\n",
+ "c = gamm/(gamm-1)*P1*nu1+.5*Gw**2/pi**2/d**4*16*nu1**2\n",
+ "b = gamm/(gamm-1)*R/M\n",
+ "a = .5*Gw**2/pi**2/d**4*16*(R/M/P2)**2\n",
+ "y = poly1d([a,b,-c],False)\n",
+ "T2 = roots(y)\n",
+ "print \"temperature of discharging gas in (Celcius) : %.4f\"%(T2[1]-273)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[ 1.0268468]\n",
+ "ratio of Pw/P1 : 0.9740\n",
+ "maximum velocity in (m/s): 295.6723\n",
+ "maximum mass flow rate in(kg/s): 0.0045\n",
+ "heat taken up to maintain isothermal codition(J/s): 94.9841\n",
+ "crtical pressure ratio in adiabatic condition: 0.1629\n",
+ "velocity at adiabatic condition in (m/s): 261.8257\n",
+ "mass flow rate at adiabatic condition in (kg/s): 0.0012\n",
+ "temperature of discharging gas in (Celcius) : -46.3847"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.3 pageno : 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "new estimate assumed\n",
+ "mass flow rate of steam through pipe\n",
+ "pressure of pipe at downstream end in\n",
+ "temperature of steam emerging from pipe\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "#1 refer to initial condition\n",
+ "R=8.314\n",
+ "P1=550.*10**3\n",
+ "T1=273.+350\n",
+ "M=18./1000\n",
+ "d=2.4/100\n",
+ "pi=3.1428\n",
+ "A=pi*d**2./4\n",
+ "gamm=1.33\n",
+ "roughness=0.096/1000/d\n",
+ "l=0.85\n",
+ "phi=0.0035 #assumed value of friction factor\n",
+ "\n",
+ "#calculation\n",
+ "nu1=R*T1/M/P1\n",
+ "Pw=0.4*P1 #estimation\n",
+ "nuw=(P1/Pw)**0.75*nu1\n",
+ "enthalpy=3167*1000.\n",
+ "Gw=math.sqrt(enthalpy*A**2/(gamm*nuw**2/(gamm-1)-nu1**2/2-nuw**2/2))\n",
+ "def eqn(x):\n",
+ " return math.log(x/nu1)+(gamm-1)/gamm*(enthalpy/2*(A/Gw)**2*(1/x**2-1/nu1**2)+0.25*(nu1**2/x**2-1)-.5*math.log(x/nu1))+4*phi*l/d\n",
+ "\n",
+ "x=fsolve(eqn,0.2)\n",
+ "\n",
+ "if x[0] != nuw:\n",
+ " print \"we again have to estimate Pw/P1\"\n",
+ " print \"new estimate assumed as 0.45\"\n",
+ " Pw=0.45*P1 #new estimation\n",
+ " nuw=(P1/Pw)**0.75*nu1\n",
+ " # & we equalise nu2 to nuw\n",
+ " nu2=nuw \n",
+ " Gw=math.sqrt(enthalpy*A**2/(gamm*nuw**2/(gamm-1)-nu1**2./2-nuw**2./2))\n",
+ " print \"mass flow rate of steam through pipe kg/s): %.2f\"%(Gw) \n",
+ " #part 2\n",
+ " print \"pressure of pipe at downstream end in (kPa):\",Pw/1000\n",
+ "else:\n",
+ " print \"our estimation is correct\"\n",
+ "\n",
+ "#part3\n",
+ "enthalpyw=2888.7*1000. #estimated from steam table\n",
+ "Tw=math.sqrt((enthalpy-enthalpyw+.5*Gw**2/A**2*nu1**2)*2*A**2/Gw**2/R**2*M**2*Pw**2)\n",
+ "print \"temperature of steam emerging from pipe in (Celcius): %.4f\"%(Tw-273)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "we again have to estimate Pw/P1\n",
+ "new estimate assumed as 0.45\n",
+ "mass flow rate of steam through pipe kg/s): 0.46\n",
+ "pressure of pipe at downstream end in (kPa): 247.5\n",
+ "temperature of steam emerging from pipe in (Celcius): 209.9420\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.4 pageno : 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "pressure at nozzle throat\n",
+ "diameter required at nozzle throat\n",
+ "sonic velocity at throat\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "M=28.05/1000\n",
+ "gamm=1.23\n",
+ "R=8.314\n",
+ "atm=101.3*1000\n",
+ "P1=3.*atm\n",
+ "\n",
+ "#calculation\n",
+ "P2=P1*(2./(gamm+1))**(gamm/(gamm-1))\n",
+ "print \"pressure at nozzle throat (kPa): %.4f\"%(P2/1000.)\n",
+ "\n",
+ "#part2\n",
+ "temp=273.+50\n",
+ "nu1=R*temp/P1/M\n",
+ "G=18. #mass flow rate\n",
+ "nu2=nu1*(P2/P1)**(-1/gamm)\n",
+ "A=G**2*nu2**2*(gamm-1)/(2*gamm*P1*nu1*(1-(P2/P1)**((gamm-1)/gamm)))\n",
+ "d=math.sqrt(4*math.sqrt(A)/math.pi)\n",
+ "print \"diameter required at nozzle throat in (cm) : %.4f\"%(d*100)\n",
+ "#part3\n",
+ "vel=math.sqrt(2*gamm*P1*nu1/(gamm-1)*(1-(P2/P1)**((gamm-1)/gamm)))\n",
+ "print \"sonic velocity at throat in(m/s): %.4f\"%vel\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure at nozzle throat (kPa): 169.7903\n",
+ "diameter required at nozzle throat in (cm) : 18.8847\n",
+ "sonic velocity at throat in(m/s): 324.9787\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.5 page no : 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find height of manometer\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "T=273.+15\n",
+ "rho=999.\n",
+ "rhom=13559. #density of mercury\n",
+ "g=9.81\n",
+ "P2=764.3/1000*rhom*g\n",
+ "R=8.314\n",
+ "M=16.04/1000\n",
+ "d=4.5/1000.\n",
+ "A=math.pi*d**2/4.\n",
+ "G=0.75/1000 #mass flow rate\n",
+ "delP=(1-math.exp(R*T*G**2./2/P2**2/M/A**2))*P2\n",
+ "h=-delP/rho/g\n",
+ "print \"height of manometer in (cm) %.4f\"%(h*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "height of manometer in (cm) 16.7941\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 2.6 page no : 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "both liquid phase and solid phase \n",
+ "required pressure drop per unit length\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhol=931.\n",
+ "mu=1.55/10000 #viscosity of water\n",
+ "Vsp=0.6057 #specific volume\n",
+ "T=273+133.\n",
+ "mug=1.38/100000 #viscosity of steam\n",
+ "P=300*1000.\n",
+ "d=0.075\n",
+ "Gg=0.05 #mass flow gas phase\n",
+ "Gl=1.5 #mass flow liquid phase\n",
+ "A=math.pi*d**2./4\n",
+ "rho = 999.\n",
+ "#calculation\n",
+ "rhog=1./Vsp\n",
+ "rhog=round(rhog*1000)/1000.\n",
+ "velg=Gg/A/rhog\n",
+ "velg=round(velg*100)/100.\n",
+ "Reg=rhog*velg*d/mug\n",
+ "\n",
+ "#using chart\n",
+ "phig=0.00245 #friction factor gas phase\n",
+ "l=1\n",
+ "delPg=4*phig*velg**2*rhog/d\n",
+ "\n",
+ "#consider liquid phase\n",
+ "vell=Gl/A/rho\n",
+ "Rel=rho*vell*d/mu\n",
+ "if Rel>4000 and Reg>4000:\n",
+ " print \"both liquid phase and solid phase in turbulent motion\"\n",
+ " #from chart\n",
+ "\n",
+ "PHIg=5.\n",
+ "delP=PHIg**2.*delPg\n",
+ "print \"required pressure drop per unit length in (Pa) : %.4f\"%delP\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "both liquid phase and solid phase in turbulent motion\n",
+ "required pressure drop per unit length in (Pa) : 253.8050\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch3.ipynb b/Problems_In_Fluid_Flow/ch3.ipynb
new file mode 100644
index 00000000..092a98ed
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch3.ipynb
@@ -0,0 +1,325 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : velocity boundary layers\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.1 page no : 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "fluid in boundary layer would be entirely\n",
+ "reynolds \n",
+ "boundary layer width\n",
+ "velocity of water\n",
+ "shear stress \n",
+ "mean shear stress experienced\n",
+ "total force experienced\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho=998.\n",
+ "mu=1.002/1000\n",
+ "x=48/100.\n",
+ "u=19.6/100\n",
+ "x1=30/100.\n",
+ "b=2.6\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "print \"fluid in boundary layer would be entirely in streamline motion \"\n",
+ "Re=rho*x*u/mu\n",
+ "print \"reynolds no is %.2e\"%(Re)\n",
+ "\n",
+ "#part 2\n",
+ "Re1=rho*x1*u/mu\n",
+ "delta=x1*4.64*Re1**-.5\n",
+ "print \"boundary layer width in (mm): %.4f\"%(delta*1000)\n",
+ "\n",
+ "#part3\n",
+ "y=0.5*delta #middle of boundary layer\n",
+ "ux=3/2*u*y/delta-.5*u*(y/delta)**3\n",
+ "print \"velocity of water in (cm/s): %.4f\"%(ux*100)\n",
+ "\n",
+ "#part4\n",
+ "R=0.323*rho*u**2*Re1**-0.5\n",
+ "print \"shear stress at 30cm in (N/m**2): %.4f\"%R\n",
+ "\n",
+ "#part5\n",
+ "Rms=0.646*rho*u**2*Re**-0.5\n",
+ "print \"mean shear stress experienced over whole plate in (N/m**2) %.4f\"%Rms\n",
+ "\n",
+ "#part6\n",
+ "F=Rms*x*b\n",
+ "print \"total force experienced by the plate in (N) %.4f\"%F\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fluid in boundary layer would be entirely in streamline motion \n",
+ "reynolds no is 9.37e+04\n",
+ "boundary layer width in (mm): 5.7520\n",
+ "velocity of water in (cm/s): 8.5750\n",
+ "shear stress at 30cm in (N/m**2): 0.0512\n",
+ "mean shear stress experienced over whole plate in (N/m**2) 0.0809\n",
+ "total force experienced by the plate in (N) 0.1010\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.2 page no : 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "% of surface over which turbulent boundary layer \n",
+ "thickness of boundary layer \n",
+ "velocity of air at mid point \n",
+ "thickness of laminar boundary layer\n",
+ "velocity at outer edge of laminar sublayer\n",
+ "shearforce expericienced\n",
+ "mean shearforce \n",
+ "total drag force expericienced by the plate \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "P=102.7*1000\n",
+ "M=28.8/1000\n",
+ "R=8.314\n",
+ "temp=273+18\n",
+ "Recrit=10.**5\n",
+ "u=18.4\n",
+ "b=4.7#width\n",
+ "x=1.3\n",
+ "mu=1.827/100000\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "rho=P*M/R/temp\n",
+ "xcrit=Recrit*mu/rho/u\n",
+ "a=1-xcrit/1.65\n",
+ "print \"%% of surface over which turbulent boundary layer exist is : %.4f\"%(a*100)\n",
+ "\n",
+ "#part2\n",
+ "Rex=rho*u*x/mu\n",
+ "thik=0.375*Rex**-.2*x\n",
+ "print \"thickness of boundary layer in (cm): %.4f\"%(thik*100)\n",
+ "\n",
+ "y=0.5*thik\n",
+ "ux=u*(y/thik)**(1./7)\n",
+ "print \"velocity of air at mid point is (m/s): %.4f\"%ux\n",
+ "\n",
+ "#part4\n",
+ "lthik=74.6*Rex**-.9*x\n",
+ "print \"thickness of laminar boundary layer in (mm): %.4f\"%(lthik*1000)\n",
+ "\n",
+ "#part5\n",
+ "ub=u*(lthik/thik)**(1./7)\n",
+ "print \"velocity at outer edge of laminar sublayer in (m/s): %.4f\"%ub\n",
+ "\n",
+ "#part6\n",
+ "R=0.0286*rho*u**2*Rex**-0.2\n",
+ "print \"shearforce expericienced in (N/m**2) : %.4f\"%R\n",
+ "\n",
+ "#part7\n",
+ "x1=1.65 #length of plate\n",
+ "Rex1=rho*u*x1/mu\n",
+ "Rms=0.0358*rho*u**2*Rex1**-0.2\n",
+ "print \"mean shearforce in (N/m**2): %.4f\"%Rms\n",
+ "\n",
+ "#part8\n",
+ "F=x1*Rms*b\n",
+ "print \"total drag force expericienced by the plate is (N): %.4f\"%F\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "% of surface over which turbulent boundary layer exist is : 95.0776\n",
+ "thickness of boundary layer in (cm): 2.7997\n",
+ "velocity of air at mid point is (m/s): 16.6653\n",
+ "thickness of laminar boundary layer in (mm): 0.2528\n",
+ "velocity at outer edge of laminar sublayer in (m/s): 9.3924\n",
+ "shearforce expericienced in (N/m**2) : 0.6798\n",
+ "mean shearforce in (N/m**2): 0.8114\n",
+ "total drag force expericienced by the plate is (N): 6.2921\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 3.3 page no : 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "pipe flow reynolds\n",
+ "Water will be in streamline motion in the pipe\n",
+ "velocity gradient at the pipe wall\n",
+ "Sherastress at pipe wall\n",
+ "new av. fluid velocity \n",
+ "thickness of laminar sublayer\n",
+ "thickness of buffer layer \n",
+ "percentage of pipe-s core occupied by turbulent core\n",
+ "velocity where sublayer and buffer layer meet \n",
+ "velocity where turbulent core and buffer layer meet\n",
+ "fluid velocity \n",
+ "shearstress \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "Q=37.6/1000000\n",
+ "d=3.2/100\n",
+ "mu=1.002/1000\n",
+ "rho=998.\n",
+ "pi=3.14\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "u=4.*Q/pi/d**2.\n",
+ "Re=rho*u*d/mu\n",
+ "print \"pipe flow reynolds no : %.4f\"%Re\n",
+ "print \"Water will be in streamline motion in the pipe\"\n",
+ "\n",
+ "#part2\n",
+ "a=-8.*u/d\n",
+ "print \"velocity gradient at the pipe wall is (s**-1): %.4f\"%a\n",
+ "\n",
+ "#part3\n",
+ "Ro=-mu*a\n",
+ "print \"Sherastress at pipe wall is N/m**2) %.2e\"%(Ro)\n",
+ "\n",
+ "#part4\n",
+ "Q=2.10/1000\n",
+ "u=4.*Q/pi/d**2\n",
+ "u=round(u*1000.)/1000.\n",
+ "print \"new av. fluid velocity is (m/s): %.4f\"%u\n",
+ "\n",
+ "Re=rho*u*d/mu\n",
+ "phi=0.0396*Re**-0.25 #friction factor\n",
+ "phi=round(phi*10**5)/10.**5\n",
+ "delb=5*d*Re**-1*phi**-.5\n",
+ "print \"thickness of laminar sublayer in (10**-6m): %.4f\"%(delb*10**6)\n",
+ "\n",
+ "#part5\n",
+ "y=30.*d/phi**0.5/Re #thickness\n",
+ "tbl=y-delb\n",
+ "print \"thickness of buffer layer in (mm): %.4f\"%(tbl*1000)\n",
+ "\n",
+ "#part6\n",
+ "A=pi*d**2./4 #cross sectional area of pipe\n",
+ "dc=d-2*y #dia of turbulent core\n",
+ "Ac=pi*dc**2/4.\n",
+ "p=(1-A/Ac)*100.\n",
+ "print \"percentage of pipe-s core occupied by turbulent core is (%%): %.4f\"%p\n",
+ "\n",
+ "#part7\n",
+ "uplus=5. #from reference\n",
+ "ux=uplus*u*phi**0.5\n",
+ "print \"velocity where sublayer and buffer layer meet is (m/s): %.4f\"%ux\n",
+ "\n",
+ "#part8\n",
+ "yplus=30. #from reference\n",
+ "ux2=u*phi**0.5*(2.5*math.log(yplus)+5.5)\n",
+ "print \"velocity where turbulent core and buffer layer meet is (m/s): %.4f\"%ux2\n",
+ "\n",
+ "#part9\n",
+ "us=u/0.81\n",
+ "print \"fluid velocity along the pipe axis (m/s): %.4f\"%us\n",
+ "\n",
+ "#part10\n",
+ "Ro=phi*rho*u**2\n",
+ "print \"shearstress at pipe wall (N/m**2): %.4f\"%Ro\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pipe flow reynolds no : 1490.8400\n",
+ "Water will be in streamline motion in the pipe\n",
+ "velocity gradient at the pipe wall is (s**-1): -11.6939\n",
+ "Sherastress at pipe wall is N/m**2) 1.17e-02\n",
+ "new av. fluid velocity is (m/s): 2.6120\n",
+ "thickness of laminar sublayer in (10**-6m): 39.8159\n",
+ "thickness of buffer layer in (mm): 0.1991\n",
+ "percentage of pipe-s core occupied by turbulent core is (%): -3.0544\n",
+ "velocity where sublayer and buffer layer meet is (m/s): 0.6304\n",
+ "velocity where turbulent core and buffer layer meet is (m/s): 1.7655\n",
+ "fluid velocity along the pipe axis (m/s): 3.2247\n",
+ "shearstress at pipe wall (N/m**2): 15.8647\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch4.ipynb b/Problems_In_Fluid_Flow/ch4.ipynb
new file mode 100644
index 00000000..cf855c54
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch4.ipynb
@@ -0,0 +1,459 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Flow Measurement\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.1 page no : 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "maximum fluid velocity \n",
+ "reynold no. \n",
+ "mass flow rate \n",
+ "Volumetric flow rate \n",
+ "maximum fluid velocity\n",
+ "reynold no. \n",
+ "volumetric flow rate\n",
+ "mass flow rate\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho=998.\n",
+ "rhom=1.354*10**4#density of mercury\n",
+ "M=2.83/100\n",
+ "mu=1.001/1000\n",
+ "mun=1.182/10**5#vicosity of natural gas\n",
+ "R=8.314\n",
+ "g=9.81\n",
+ "h=28.6/100\n",
+ "d=54./100\n",
+ "\n",
+ "#part1\n",
+ "nu=1./rho\n",
+ "delP=h*g*(rhom-rho)\n",
+ "umax=math.sqrt(2.*nu*delP)\n",
+ "umax=round(umax*10.)/10\n",
+ "print \"maximum fluid velocity in (m/s)\",umax\n",
+ "Re=umax*d*rho/mu\n",
+ "print \"reynold no. is %.2e\"%(Re)\n",
+ "\n",
+ "#using chart\n",
+ "u=0.81*umax\n",
+ "G=rho*math.pi*d**2./4*u\n",
+ "print \"mass flow rate in (kg/s): %.4f\"%G\n",
+ "print \"Volumetric flow rate in (m**3/s): %.4f\"%(G/rho)\n",
+ "\n",
+ "#part2\n",
+ "P1=689.*1000 #initial pressure\n",
+ "T=273+21.\n",
+ "nu1=R*T/M/P1\n",
+ "nu1=round(nu1*10000)/10000.\n",
+ "rhog=1./nu1 #density of gas\n",
+ "h=17.4/100\n",
+ "P2=P1+h*(rho-rhog)*g\n",
+ "P2=round(P2/100)*100.\n",
+ "umax2=math.sqrt(2*P1*nu1*math.log(P2/P1))\n",
+ "print \"maximum fluid velocity in (m/s) %.4f\"%umax2\n",
+ "Re=rhog*umax2*d/mun\n",
+ "print \"reynold no. is %.3e\"%(Re)\n",
+ "#from table\n",
+ "u=0.81*umax2\n",
+ "Q=math.pi*d**2/4*u\n",
+ "print \"volumetric flow rate is (m**3/s): %.4f\"%Q\n",
+ "print \"mass flow rate in (kg/s): %.4f\"%(Q*rhog)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum fluid velocity in (m/s) 8.4\n",
+ "reynold no. is 4.52e+06\n",
+ "mass flow rate in (kg/s): 1555.1499\n",
+ "Volumetric flow rate in (m**3/s): 1.5583\n",
+ "maximum fluid velocity in (m/s) 20.6358\n",
+ "reynold no. is 7.518e+06\n",
+ "volumetric flow rate is (m**3/s): 3.8281\n",
+ "mass flow rate in (kg/s): 30.5271\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.2 page no : 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "volumetric flow rate\n",
+ "mass flow rate of chlorine gas\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "import numpy\n",
+ "from matplotlib import pyplot as plt\n",
+ "%pylab inline\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rd = numpy.true_divide([0, 1, 2.5, 5 ,10, 15, 17.5],100) #radial distance from pipe\n",
+ "dlv = numpy.true_divide([0,0.2, 0.36, 0.54, 0.81, 0.98, 1],100) #differnce in liquid levels\n",
+ "r = [.175 ,.165, .150, .125 ,.075, .025, 0]\n",
+ "g = 9.81\n",
+ "R = 8.314\n",
+ "rho = 999.\n",
+ "temp = 289.\n",
+ "P1 = 148 * 1000.\n",
+ "M = 7.09 / 100.\n",
+ "pi = 3.12\n",
+ "rhoCl2 = P1 * M / R / temp #density of Cl2\n",
+ "nuCl2 = 1 / rhoCl2 #specific volume of Cl2\n",
+ "def P2(x):\n",
+ " return P1+x*(rho-rhoCl2)*g\n",
+ "\n",
+ "u = [0,0,0,0,0,0,0]\n",
+ "a = [0,0,0,0,0,0,0]\n",
+ "\n",
+ "for i in range(7):\n",
+ " y = P2(dlv[i])\n",
+ " u[i] = math.sqrt(2.*P1*nuCl2*math.log(y/P1))\n",
+ " a[i] = u[i] * r[i]\n",
+ "\n",
+ "plt.plot(r,a)\n",
+ "plt.xlabel(\"r (m)\")\n",
+ "plt.ylabel(\"u*r (m**2/s)\")\n",
+ "s=0\n",
+ "for i in range(6): #itegration of the plotted graph\n",
+ " s=abs((r[i]-r[i+1])*.5*(a[i]+a[1]))+s\n",
+ "\n",
+ "s=s-0.01\n",
+ "Q=2*pi*s\n",
+ "plt.show()\n",
+ "#Result\n",
+ "print \"volumetric flow rate (m**3/s):\",Q\n",
+ "print \"mass flow rate of chlorine gas (kg/s)\",Q*rhoCl2\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['pi']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEMCAYAAAAxoErWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX+P/DX4IwbkJbiNoOigoC7BlpmRlmiXsM90VJ/\nhqaGlbZ3uylYeeWqlUoZ9c28ZiFeU3GDCnHcFQu3csMFHUdzKTUVExjO749PkgjDOmc+s7yejweP\nGDlz5oUd5z3ns2oURVFARERUAg/ZAYiIyHGxSBARkVUsEkREZBWLBBERWcUiQUREVrFIEBGRVaoW\nidTUVAQFBSEgIABxcXHFfj579mx06tQJnTp1Qrt27aDVanHlyhU1IxERUQVo1JonYbFYEBgYiLS0\nNOj1eoSGhiIxMRHBwcElHr927Vp89NFHSEtLUyMOERFVgmp3EhkZGfD394efnx90Oh0iIyORnJxs\n9fhvvvkGw4cPVysOERFVgmpFwmw2w9fXt/CxwWCA2Wwu8dicnBx89913GDx4sFpxiIioErRqnVij\n0ZT72DVr1qB79+6oW7dulc9FRER/q2qPgmp3Enq9HiaTqfCxyWSCwWAo8dilS5eW2dSkKIpDfU2b\nNk16BmfI5Ki5mImZ3CGXLahWJEJCQpCVlYXs7Gzk5uYiKSkJERERxY67evUqNm/ejP79+6sVhYiI\nKkm15iatVov4+HiEh4fDYrEgKioKwcHBSEhIAACMHz8eALBq1SqEh4ejVq1aakUhIqJKUq1IAECf\nPn3Qp0+fIn92uzjcNnr0aIwePVrNGKoICwuTHaEYR8wEOGY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SBARkVUsEkQVNGzY\nMBw/frzcx+/fvx9RUVEqJiJSD4sEkRWKGCJe5M+OHTuGGzduoGXLluU+T/v27XH8+HFcuHDB1hGJ\nVMciQXSH7OxsBAYGYvTo0WjXrl2xNbmWLl1aZPMsLy8vvP7662jbti2eeOIJ7Ny5E4888ghatmyJ\nNWvWFB7Xp08f/O9//7Pb70FkKywSRHc5duwYoqOj8fPPPxdZSA0Atm3bhpCQkMLHOTk56NmzJ37+\n+Wd4e3tj6tSpSE9Px8qVKzF16tTC47p06YLNmzfb7XcgshXVdqYjclbNmjVDly5dSvzZqVOn0Lhx\n48LH1atXR3h4OACgXbt2qFmzJqpVq4a2bdsiOzu78LjGjRsXeUzkLHgnQXQXT0/PUn9+Zz/Fnev1\ne3h4oHr16oXf5+fnF3mOmqu6EqmFRYKoApo1a4Zz585V+Hnnzp1Ds2bNVEhEpC4WCaK7lPaJv3v3\n7vjxxx+tHnvn4zu/z8jIQI8ePWyYksg+uMAfUQWcOHECL7zwAtatW1eh54WFhWHZsmVo0KCBSsmI\n1ME7CaIKaNGiBby9vSs8mc7f358FgpwS7ySIiMgq3kkQEZFVLBJERGQViwQREVnFIkFERFaxSBAR\nkVUsEkREZNX/B8MTpny5+pGIAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x27a1550>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate (m**3/s): 0.455983319661\n",
+ "mass flow rate of chlorine gas (kg/s) 1.99135662691\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.3 page no : 70 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "mass flow rate\n",
+ "pressuer differnce between tapping points \n",
+ "difference in water levels in manometer\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "pi = 3.14\n",
+ "Cd = 0.61\n",
+ "rho = 999.\n",
+ "rhoo = 877. #density of oil\n",
+ "g = 9.81\n",
+ "h = 75/100.\n",
+ "d = 12.4/100. #dia of orifice\n",
+ "d1 = 15/100. #inside diameter\n",
+ "nuo = 1/rhoo #specific volume of oil\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "delP = h*(rho-rhoo)*g\n",
+ "A = pi*d**2./4\n",
+ "G = Cd*A/nuo*math.sqrt(2*nuo*delP/(1-(d/d1)**4))\n",
+ "print \"mass flow rate in (kg/s) %.4f\"%G\n",
+ "\n",
+ "#part2\n",
+ "h = (1.+0.5)*d1\n",
+ "delP = rhoo/2*(G*nuo/Cd/A)**2*(1-(d/d1)**4)+h*rhoo*g\n",
+ "print \"pressuer differnce between tapping points %.4f\"%delP\n",
+ "delh = (delP-h*rhoo*g)/(rho-rhoo)/g\n",
+ "print \"difference in water levels in manometer i (cm) %.4f\"%delh\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass flow rate in (kg/s) 12.6544\n",
+ "pressuer differnce between tapping points 2833.3733\n",
+ "difference in water levels in manometer i (cm) 0.7500\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.4 page no : 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "diameter of orifice\n",
+ "ratio of pressure drop \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhom = 1.356*10**4 #density mercury\n",
+ "rhon = 1266. #density NaOH\n",
+ "Cd = 0.61\n",
+ "g = 9.81\n",
+ "Cdv = 0.98 #coeff. of discharge of venturimeter\n",
+ "Cdo = Cd #coeff. of discharge of orificemeter\n",
+ "d = 6.5/100\n",
+ "pi = 3.14\n",
+ "A = pi*d**2/4.\n",
+ "Q = 16.5/1000.\n",
+ "h = 0.2 #head differnce\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "delP = g*h*(rhom-rhon)\n",
+ "G = rhon*Q\n",
+ "nun = 1./rhon#specific volume of NaOH\n",
+ "Ao = G*nun/Cd*math.sqrt(1./(2*nun*delP+(G*nun/Cd/A)**2)) #area of orifice\n",
+ "d0 = math.sqrt(4.*Ao/pi)\n",
+ "print \"diameter of orifice in (cm): %.4f\"%(d0*100)\n",
+ "\n",
+ "#part2\n",
+ "a = (Cdv/Cdo)**2\n",
+ "print \"ratio of pressure drop %.4f\"%a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diameter of orifice in (cm): 5.8041\n",
+ "ratio of pressure drop 2.5810\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.5 page no : 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "pressure drop over the float\n",
+ "mass flow rate\n",
+ "Volumetric flow rate\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "M = 3.995/100\n",
+ "g = 9.81\n",
+ "R = 8.314\n",
+ "Cd = 0.94\n",
+ "temp = 289.\n",
+ "df = 9.5/1000 #diameter of float\n",
+ "Af = math.pi*df**2/4. #area of float\n",
+ "P = 115.*10.**3.\n",
+ "V = 0.92/10**6\n",
+ "rhoc = 3778. #density of ceramic\n",
+ "\n",
+ "#calculation\n",
+ "rho = P*M/R/temp\n",
+ "nu = 1/rho\n",
+ "P = V*(rhoc-rho)*g/Af\n",
+ "print \"pressure drop over the float in (Pa): %.4f\"%P\n",
+ "\n",
+ "#part2\n",
+ "x = .15/25.*(25-7.6)\n",
+ "L = df*100.+2*x\n",
+ "L = L/100.\n",
+ "A1 = math.pi*L**2./4\n",
+ "A0 = A1-Af\n",
+ "G = Cd*A0*math.sqrt(2.*rho*P/(1-(A0/A1)**2))\n",
+ "print \"mass flow rate in kg/s) is %.3e\"%(G)\n",
+ "Q = G/rho\n",
+ "print \"Volumetric flow rate in (m**3/s): %f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure drop over the float in (Pa): 480.7971\n",
+ "mass flow rate in kg/s) is 1.475e-03\n",
+ "Volumetric flow rate in (m**3/s): 0.000772\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 4.6 page no : 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find mass of float equired \n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 999.\n",
+ "rhos = 8020. #density of steel\n",
+ "g = 9.81\n",
+ "math.pi = 3.14\n",
+ "df = 14.2/1000 #dia of float\n",
+ "Af = math.pi*df**2/4. #area of float\n",
+ "Cd = 0.97\n",
+ "nu = 1./rho\n",
+ "Q = 4./1000./60\n",
+ "G = Q*rho\n",
+ "\n",
+ "#calculation\n",
+ "x = 0.5*(18.8-df*1000)/280*(280-70)\n",
+ "L = df*1000.+2*x\n",
+ "L = L/1000.\n",
+ "A1 = math.pi*L**2./4\n",
+ "A0 = A1-Af\n",
+ "Vf = Af/g/(rhos-rho)/2/nu*(G*nu/Cd/A0)**2*(1-(A0/A1)**2)\n",
+ "m = Vf*rhos\n",
+ "print \"mass of float equired in (g): %.4f\"%(m*1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass of float equired in (g): 5.1176\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch5.ipynb b/Problems_In_Fluid_Flow/ch5.ipynb
new file mode 100644
index 00000000..2f6c5b6c
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch5.ipynb
@@ -0,0 +1,757 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Flow measurement in open channel\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.1 page no : 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "volumetric flow rate\n",
+ "chezy coefficient\n",
+ "velocity gradient in the channel\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 999.7;\n",
+ "g = 9.81;\n",
+ "mu = 1.308/1000;\n",
+ "s = 1./6950;\n",
+ "b = 0.65;\n",
+ "h = 32.6/100;\n",
+ "n = 0.016;\n",
+ "\n",
+ "#calculation\n",
+ "A = b*h;\n",
+ "P = b+2*h;\n",
+ "m = A/P;\n",
+ "u = s**.5*m**(2./3)/n;\n",
+ "Q = A*u\n",
+ "\n",
+ "print \"volumetric flow rate (m**3/s): %.4f\"%Q\n",
+ "C = u/m**0.5/s**0.5;\n",
+ "print \"chezy coefficient (m**0.5/s): %.4f\"%C\n",
+ "a = -m*rho*g*s/mu #delu/dely\n",
+ "print \"velocity gradient in the channel (s**-1): %.4f\"%a\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate (m**3/s): 0.0474\n",
+ "chezy coefficient (m**0.5/s): 46.1814\n",
+ "velocity gradient in the channel (s**-1): -175.5764\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.2 page no : 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find depth of water\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "Q = 0.885\n",
+ "pi = 3.1428\n",
+ "s = 1./960\n",
+ "s = round(s*1000000)/1000000.\n",
+ "b = 1.36\n",
+ "n = 0.014\n",
+ "theta = 55.*pi/180.\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "def flow(x):\n",
+ " a = (x*(b+x/math.tan(theta)))/(b+2*x/math.sin(theta))\n",
+ " y = a**(2./3)*s**(1./2)*(x*(b+x/math.tan(theta)))/n-Q\n",
+ " return y\n",
+ "x = fsolve(flow,0.1)\n",
+ "\n",
+ "print \"depth of water in (m): %.4f\"%x[0]\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "depth of water in (m): 0.4813\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.3 page no : 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find slope of channel\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "n = 0.011\n",
+ "h = 0.12\n",
+ "Q = 25./10000.\n",
+ "\n",
+ "#calculation\n",
+ "def f(x): \n",
+ "\t return 1./x**2-1\n",
+ "\t \n",
+ "x = fsolve(f,0.1)\n",
+ "theta = 2.*arctan(x)\n",
+ "A = h*2*h/math.tan(theta/2)/2.\n",
+ "P = 2.*h*math.sqrt(2.)\n",
+ "s = Q**2.*n**2.*P**(4./3)/A**(10./3)\n",
+ "print \"the slope of channel in (radians): %f\"%s\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the slope of channel in (radians): 0.000246\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.4 pageno : 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "maximum velocity\n",
+ "maximum volumetric flow \n",
+ "maximum velocity of obtained fluid \n",
+ "maximum flow rate obtained\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "#part1\n",
+ "#maximizing eqution in theta & get a function\n",
+ "def theta(x):\n",
+ " return (x-.5*math.sin(2.*x))/2/x**2.-(1-math.cos(2.*x))/2/x\n",
+ "\n",
+ "x = fsolve(theta,2.2)\n",
+ "x = round(x*1000.)/1000.\n",
+ "a = (1-math.cos(x))/2.\n",
+ "print \"velocity will be maximum when stream depth in times of diameter is %.3f\"%(a)\n",
+ "\n",
+ "#part2\n",
+ "#maximizing eqution in theta & get a function\n",
+ "def theta2(x):\n",
+ " return 3*(x-.5*math.sin(2*x))**2*(1.-math.cos(2.*x))/2./x-(x-.5*math.sin(2.*x))**3./2./x**2 \n",
+ "\n",
+ "x1 = fsolve(theta2,2.2)\n",
+ "x1 = round(x1*1000)/1000.\n",
+ "a = (1-math.cos(x1))/2.\n",
+ "\n",
+ "print \"vlumetric flow will be maximum when stream depth in times of diameter is %.3f\"%(a)\n",
+ "\n",
+ "#part3\n",
+ "r = 1.\n",
+ "A = 1.*x-0.5*math.sin(2*x)\n",
+ "s = 0.35*3.14/180\n",
+ "P = 2.*x*r\n",
+ "C = 78.6\n",
+ "u = C*(A/P)**0.5*s**0.5\n",
+ "print \"maximum velocity of obtained fluid (m/s): %.4f\"%u\n",
+ "\n",
+ "#part4\n",
+ "print \"maximum flow rate obtained at angle in (radians): %.4f\"%x1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity will be maximum when stream depth in times of diameter is 0.813\n",
+ "vlumetric flow will be maximum when stream depth in times of diameter is 0.950\n",
+ "maximum velocity of obtained fluid (m/s): 4.7913\n",
+ "maximum flow rate obtained at angle in (radians): 2.6890\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.5 page no : 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "velocity of fluid \n",
+ "fluid depth over weir in (m)\n",
+ "fluid depth over weir in if SI units \n",
+ "base angle of the notch of weir\n",
+ "'''\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "import numpy\n",
+ "\n",
+ "#example 5.5 \n",
+ "# Initialization of Variable\n",
+ "g = 9.81\n",
+ "h = 28./100\n",
+ "Cd = 0.62\n",
+ "B = 46./100\n",
+ "Q = 0.355\n",
+ "n = 2. #from francis formula\n",
+ "\n",
+ "#calcualtion\n",
+ "\n",
+ "#part1\n",
+ "u = math.sqrt(2*g*h)\n",
+ "print \"velocity of fluid (m/s): %.4f\"%u\n",
+ "\n",
+ "#part2a\n",
+ "H = (3.*Q/2./Cd/B/(2.*g)**0.5)**(2./3)\n",
+ "\n",
+ "print \"fluid depth over weir in (m): %.4f\"%H\n",
+ "\n",
+ "#part2b\n",
+ "#using francis formula\n",
+ "def root(x):\n",
+ " return Q-1.84*(B-0.1*n*x)*x**1.5\n",
+ "\n",
+ "x = fsolve(root,0.2)\n",
+ "print \"fluid depth over weir in if SI units uesd in (m): %.4f\"%x\n",
+ "\n",
+ "#part3\n",
+ "H = 18.5/100\n",
+ "Q = 22./1000\n",
+ "a = 15.*Q/8/Cd/(2*g)**0.5/H**2.5\n",
+ "theta = 2*numpy.arctan(a)\n",
+ "print \"base angle of the notch of weir (degrees) %.4f\"%(theta*180/3.14)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity of fluid (m/s): 2.3438\n",
+ "fluid depth over weir in (m): 0.5622\n",
+ "fluid depth over weir in if SI units uesd in (m): 0.7196\n",
+ "base angle of the notch of weir (degrees) 91.2010\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.6 pageno : 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "alternative depth \n",
+ "maximum volumetric flow\n",
+ "Froude no.\n",
+ "% of kinetic energy in initial system\n",
+ "% of kinetic energy in final system \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import poly1d\n",
+ "#from scipy.optimize import root\n",
+ "from numpy import *\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "Q = 0.675\n",
+ "B = 1.65\n",
+ "D = 19.5/100\n",
+ "g = 9.81\n",
+ "\n",
+ "#caculation\n",
+ "u = Q/B/D\n",
+ "u = round(u*1000.)/1000.\n",
+ "E = D+u**2./2./g\n",
+ "y = poly1d([1,-E, 0, 8.53/1000],False)\n",
+ "#y = poly1d([8.53/1000, 0, -E, 1],False)\n",
+ "x = roots(y)\n",
+ "print \"alternative depth in (m) %.4f\"%x[0]\n",
+ "print \"It is shooting flow\"\n",
+ "Dc = 2./3*E\n",
+ "Qmax = B*(g*Dc**3)**0.5\n",
+ "print \"maximum volumetric flow (m**3/s) %.4f\"%Qmax\n",
+ "Fr = u/math.sqrt(g*D)\n",
+ "print \"Froude no. %.4f\"%Fr\n",
+ "a = (E-D)/E\n",
+ "print \"%% of kinetic energy in initial system %.4f\"%(a*100)\n",
+ "b = (E-x[0])/E\n",
+ "print \"%% of kinetic energy in final system %.4f\"%(b*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "alternative depth in (m) 0.3495\n",
+ "It is shooting flow\n",
+ "maximum volumetric flow (m**3/s) 0.7639\n",
+ "Froude no. 1.5169\n",
+ "% of kinetic energy in initial system 53.4987\n",
+ "% of kinetic energy in final system 16.6510\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.7 page no : 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "alternate depths \n",
+ "slode when depth is 12.9cm\n",
+ "slode when depth is 45.1cm \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "G = 338. #mass flow rate\n",
+ "rho = 998.\n",
+ "q = G/rho\n",
+ "E = 0.48\n",
+ "n = 0.015\n",
+ "g = 9.81\n",
+ "B = 0.4\n",
+ "y = poly1d([1, -E, 0 ,5.85/1000 ],False)\n",
+ "x = roots(y)\n",
+ "print \"alternate depths (m): %.4f %.4f\"%(x[0],x[1])\n",
+ "s = (G*n/rho/x[1]/(B*x[1]/(B+2*x[1]))**(2./3))**2\n",
+ "print \"slode when depth is 12.9cm %.4f\"%s\n",
+ "s = (G*n/rho/x[0]/(B*x[0]/(B+2*x[0]))**(2./3))**2\n",
+ "print \"slode when depth is 45.1cm %.4f\"%s\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "alternate depths (m): 0.4513 0.1291\n",
+ "slode when depth is 12.9cm 0.0461\n",
+ "slode when depth is 45.1cm 0.0018\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.8 page no : 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "critical depth\n",
+ "critical velocity\n",
+ "Critical volumetric flow\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "pi = 3.14\n",
+ "theta = pi/3.\n",
+ "h = 1./math.tan(theta)\n",
+ "B = 0.845\n",
+ "E = 0.375\n",
+ "g = 9.81\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "\n",
+ "#deducing a polynomial(quadratic) in Dc \n",
+ "a = 5.*h\n",
+ "b = 3.*B-4*h*E\n",
+ "c = -2.*E*B\n",
+ "y = poly1d([a ,b ,c],False)\n",
+ "x = roots(y)\n",
+ "\n",
+ "print \"critical depth in (m): %.4f\"%x[1]\n",
+ "\n",
+ "#part2\n",
+ "Ac = x[1]*(B+x[1]*math.tan(theta/2))\n",
+ "Btc = B+x[1]*math.tan(theta/2.)*2\n",
+ "Dcbar = Ac/Btc\n",
+ "uc = math.sqrt(g*Dcbar)\n",
+ "print \"critical velocity (m/s): %.4f\"%uc\n",
+ "\n",
+ "#part3\n",
+ "Qc = Ac*uc\n",
+ "print \"Critical volumetric flow (m**3/s): %.4f\"%Qc\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical depth in (m): 0.2615\n",
+ "critical velocity (m/s): 1.4925\n",
+ "Critical volumetric flow (m**3/s): 0.3887\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.9 page no : 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "volumetric flow rate over flat topped weir over rectangular section in non uniform width\n",
+ "volumetric flow rate over flat topped weir over rectangular section in uniform width\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "B2 = 1.60 #breadth at 2\n",
+ "D2 = (1-0.047)*1.27 #depth at 2\n",
+ "g = 9.81\n",
+ "B1 = 2.95 #breadth at 1\n",
+ "D1 = 1.27 #depth at 1\n",
+ "Z = 0.\n",
+ "\n",
+ "#calculation\n",
+ "Q = B2*D2*(2*g*(D1-D2-Z)/(1-(B2*D2/B1/D1)**2))**0.5\n",
+ "print \"volumetric flow rate over flat topped weir over rectangular\\\n",
+ "section in non uniform width(m**3/s) : %.4f\"%Q\n",
+ "\n",
+ "#next part\n",
+ "B2 = 12.8\n",
+ "D1 = 2.58\n",
+ "Z = 1.25\n",
+ "Q = 1.705*B2*(D1-Z)**1.5\n",
+ "print \"volumetric flow rate over flat topped weir over rectangular section in uniform width (m**3/s): %.4f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volumetric flow rate over flat topped weir over rectangularsection in non uniform width(m**3/s) : 2.4480\n",
+ "volumetric flow rate over flat topped weir over rectangular section in uniform width (m**3/s): 33.4743\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.10 page no : 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Normal depth \n",
+ "Critical depth \n",
+ "distance in (m) from upstream to that place\n",
+ "'''\n",
+ "\n",
+ "from numpy import linspace\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "pi = 3.14\n",
+ "n = 0.022\n",
+ "B = 5.75\n",
+ "s = 0.15*pi/180\n",
+ "Q = 16.8\n",
+ "g = 9.81\n",
+ "\n",
+ "def normal(x):\n",
+ " y = Q-B*x/n*(B*x/(B+2*x))**(2./3)*s**0.5\n",
+ "\n",
+ "x = fsolve(normal,1.33)\n",
+ "print \"Normal depth in (m) : %.4f\"%x[0]\n",
+ "Dc = (Q**2/g/B**2)**(1./3)\n",
+ "print \"Critical depth in (m): %.4f\"%Dc\n",
+ "delD = .1\n",
+ "D = [1.55,1.65,1.75,1.85,1.95,2.05,2.15,2.25,2.35]\n",
+ "su = 0\n",
+ "for i in range(9):\n",
+ " delL = delD/s*(1-(Dc/D[i])**3.)/(1.-(x/D[i])**3.33)\n",
+ " su = su+delL\n",
+ "\n",
+ "print \"distance in (m) from upstream to that place: %.4f\"%su\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Normal depth in (m) : 1.3300\n",
+ "Critical depth in (m): 0.9547\n",
+ "distance in (m) from upstream to that place: 456.5757\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
+ " improvement from the last ten iterations.\n",
+ " warnings.warn(msg, RuntimeWarning)\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 5.11 page no : 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "critical depth \n",
+ "normal depth upstream\n",
+ "normal depth downstream \n",
+ "conjugate depth for upstream \n",
+ "conjugate depth for downstream \n",
+ "distance in (m) of occurence of jump by accurate method\n",
+ "distance in (m) of occurence of jump by not so accurate method\n",
+ "power loss in hydraulic jump per unit width\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "g = 9.81\n",
+ "q = 1.49\n",
+ "pi = 3.14\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "#part1\n",
+ "Dc = (q**2/g)**.333\n",
+ "print \"critical depth in (m): %.4f\"%Dc\n",
+ "\n",
+ "#part2\n",
+ "n = 0.021\n",
+ "su = 1.85*pi/180 #slope upstream\n",
+ "sd = 0.035*pi/180 #slope downstream\n",
+ "Dnu = (n*q/math.sqrt(su))**(3./5)\n",
+ "Dnu = round(Dnu*1000)/1000.\n",
+ "print \"normal depth upstream in (m): %.4f\"%Dnu\n",
+ "Dnd = (n*q/math.sqrt(sd))**(3./5)\n",
+ "print \"normal depth downstream in (m): %.4f\"%Dnd\n",
+ "\n",
+ "#part3\n",
+ "D2u = -0.5*Dnu*(1-math.sqrt(1+8*q**2/g/Dnu**3))\n",
+ "D2u = round(D2u*1000)/1000.\n",
+ "print \"conjugate depth for upstream in (m): %.4f\"%D2u\n",
+ "D1d = -0.5*Dnd*(1-math.sqrt(1+8*q**2/g/Dnd**3))\n",
+ "print \"conjugate depth for downstream in (m): %.4f\"%D1d\n",
+ "\n",
+ "#part4\n",
+ "#accurate method\n",
+ "delD = .022\n",
+ "D = linspace(0.987,.022,9)\n",
+ "\n",
+ "dis = 0.\n",
+ "for i in range(8):\n",
+ " delL = delD/su*(1-(Dc/D[i])**3)/(1-(Dnu/D[i])**3.33)\n",
+ " dis = dis+delL\n",
+ "\n",
+ "print \"distance in (m) of occurence of jump by accurate method: %.4f\"%dis\n",
+ "\n",
+ "#not so accurate one\n",
+ "E1 = D2u+q**2./2./g/D2u**2\n",
+ "E2 = Dnd+q**2./2./g/Dnd**2\n",
+ "E2 = round(E2*1000)/1000.\n",
+ "E1 = round(E1*1000)/1000.\n",
+ "ahm = (D2u+Dnd)/2 #av. hyd.raulic mean\n",
+ "afv = .5*(q/D2u+q/Dnd) #av. fluid velocity\n",
+ "i = (afv*0.021/ahm**(2./3))**2\n",
+ "l = (E2-E1)/(su-i+0.0002)\n",
+ "print \"distance in (m) of occurence of jump by not so accurate method: %.4f\"%l\n",
+ "\n",
+ "#part5\n",
+ "rho = 998.\n",
+ "Eu = Dnu++q**2./2./g/Dnu**2\n",
+ "Eu = round(Eu*1000)/1000.\n",
+ "P = rho*g*q*(Eu-E1)\n",
+ "print \"power loss in hydraulic jump per unit width in (kW): %.4f\"%(P/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical depth in (m): 0.6097\n",
+ "normal depth upstream in (m): 0.3500\n",
+ "normal depth downstream in (m): 1.1522\n",
+ "conjugate depth for upstream in (m): 0.9760\n",
+ "conjugate depth for downstream in (m): 0.2752\n",
+ "distance in (m) of occurence of jump by accurate method: 0.6270\n",
+ "distance in (m) of occurence of jump by not so accurate method: 4.4844\n",
+ "power loss in hydraulic jump per unit width in (kW): 2.6112\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch6.ipynb b/Problems_In_Fluid_Flow/ch6.ipynb
new file mode 100644
index 00000000..d95ae4fb
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch6.ipynb
@@ -0,0 +1,501 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : pumping of liquids\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.1 page no : 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Max. height of toluene supported by atm. pressure\n",
+ "reynolds no \n",
+ "the maximum height above toulene \n",
+ "Maximum delivery rate \n",
+ "minimum smooth diameter of suction pipe\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "atp = 100.2*1000.\n",
+ "g = 9.81\n",
+ "rho_w = 996.\n",
+ "rho_toluene = 867.\n",
+ "vap_pre_toluene = 4.535*1000\n",
+ "viscosity_toluene = 5.26/10000\n",
+ "\n",
+ "#calculation\n",
+ "m = (atp-vap_pre_toluene)/rho_toluene/g\n",
+ "print \"Max. height of toluene supported by atm. pressure (in m): %.4f\"%m\n",
+ "\n",
+ "#part(1)\n",
+ "hopw = 0.650 #head of pump in terms of water\n",
+ "hopt = hopw*rho_w/rho_toluene #head of pump in terms of toluene\n",
+ "Q = 1.8*10**-3 #flow in m**3/s\n",
+ "d = 2.3*10**-2 #diameter of pipe\n",
+ "pi = 3.14127\n",
+ "\n",
+ "#u = 4*Q/pi/d**2\n",
+ "#substituting this for reynolds no.\n",
+ "Re = 4*Q*rho_toluene/pi/d/viscosity_toluene #reynolds no.\n",
+ "print \"reynolds no : %.4f\"%Re\n",
+ "phi = 0.0396*Re**-0.25\n",
+ "\n",
+ "\n",
+ "#since both LHS and RHS are function of x(max. ht. ab. toluene) \n",
+ "#we define a new variable to solve the eqn\n",
+ "#y = (atp/rho_toluene/g)-(vap_pre_toluene/rho_toluene/g)-(4*phi*16*Q**2*x/pi**2/d**5/g)-hopt\n",
+ "#y = x \n",
+ "#these are two equations\n",
+ "\n",
+ "b = array([0,((atp/rho_toluene/g)-(vap_pre_toluene/rho_toluene/g)-hopt)])\n",
+ "A = array([[1, -1],[1, 4*phi*16*Q**2/pi**2/d**5/g]])\n",
+ "x = linalg.solve(A ,b)\n",
+ "print \"the maximum height above toulene in the tank the pump can be \\\n",
+ "located without risk while flow rate is 1.80dm**3/s (in m): %.4f\"%x[0]\n",
+ "\n",
+ "#solution of part(2)\n",
+ "l = 9. #length \n",
+ "u = math.sqrt(((atp/rho_toluene/g)-(vap_pre_toluene/rho_toluene/g)-hopt-l)*d*g/4/phi/l) #fluid velocity in pipes\n",
+ "Q = pi*d**2*u/4\n",
+ "print \"Maximum delivery rate if pump is located 9m above toluene tank(in m**3/s) %.4f\"%Q\n",
+ "\n",
+ "#solution of part(3)\n",
+ "#clubing d together we get\n",
+ "Q = 1.8/1000.\n",
+ "a = (atp/rho_toluene/g)-(vap_pre_toluene/rho_toluene/g)-hopt-l\n",
+ "b = a*pi**2*g/4./9./16./Q**2/0.0396/(4*Q*rho_toluene/pi/viscosity_toluene)**-0.25\n",
+ "d = (1./b)**(1./4.75)\n",
+ "print \"minimum smooth diameter of suction pipe which will have flow \\\n",
+ "rate as (1.8 dm**3/s) for pump kept at 9 m high (in m):\",d\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Max. height of toluene supported by atm. pressure (in m): 11.2477\n",
+ "reynolds no : 164260.3512\n",
+ "the maximum height above toulene in the tank the pump can be located without risk while flow rate is 1.80dm**3/s (in m): 6.3463\n",
+ "Maximum delivery rate if pump is located 9m above toluene tank(in m**3/s) 0.0009\n",
+ "minimum smooth diameter of suction pipe which will have flow rate as (1.8 dm**3/s) for pump kept at 9 m high (in m): 0.0306728431855\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.2 pageno : 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "frequency of motor\n",
+ "diametr of impeller\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "# Initialization of Variable\n",
+ "Q1 = 24.8/1000 #flow in pump 1\n",
+ "d1 = 11.8/100 #diameter of impeller 1\n",
+ "H1 = 14.7 #head of pump 1\n",
+ "N1 = 1450. #frequency of motor 1\n",
+ "Q2 = 48/1000. #flow in pump 2\n",
+ "\n",
+ "#calculation\n",
+ "H2 = 1.15*H1 #head of pump 2\n",
+ "specific_speed = N1*Q1**0.5/H1**0.75\n",
+ "N2 = specific_speed*H2**0.75/Q2**0.5 #frequency of motor 2\n",
+ "print \"frequency of motor 2 in rpm %.4f\"%N2 \n",
+ "d2 = math.sqrt(N2**2*H1/H2/N1**2/d1**2)\n",
+ "print \"diametr of impeller 2 (in m) %.4f\"%(1/d2 )\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency of motor 2 in rpm 1157.4350\n",
+ "diametr of impeller 2 (in m) 0.1585\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.3 page no : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Power required to pump fluid \n",
+ "\n",
+ "from matplotlib.pyplot import *\n",
+ "import math \n",
+ "%pylab inline\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "Q = [0, 0.01, 0.02, 0.03 ,0.04, 0.05] #discharge\n",
+ "effi_hyd = [65.4 ,71, 71.9, 67.7, 57.5, 39.2]\n",
+ "effi_over = [0 ,36.1, 56.0, 61.0, 54.1, 37.0]\n",
+ "H_sys = [0 ,0, 0, 0, 0, 0]\n",
+ "d = 0.114 #diameter of pipe\n",
+ "d_o = 0.096 #diameter of impeller\n",
+ "h = 8.75 #elevation\n",
+ "g = 9.81 #acc. of gravity\n",
+ "rho = 999. #denisity of water\n",
+ "l = 60. #length of pipe\n",
+ "theta = 0.611 #angle in radians\n",
+ "B = 0.0125 #width of blades\n",
+ "pi = 3.1412\n",
+ "mu = 1.109/1000 #viscosity of water\n",
+ "omega = 2*pi*1750/60.\n",
+ "H_theor = []\n",
+ "# calculation\n",
+ "for i in range(6):\n",
+ " if i == 0:\n",
+ " H_sys[i] = h\n",
+ " else:\n",
+ " H_sys[i] = h+8.*Q[i]**2./pi**2/d**4/g*(1+8*l*0.0396/d*(4*rho*Q[i]/pi/d/mu)**-0.25)\n",
+ " H_theor.append(omega**2*d_o**2/g-omega*Q[i]/2/pi/g/B/math.tan(theta))\n",
+ "\n",
+ "#H_theor = omega**2*d_o**2/g-omega*Q/2/pi/g/B/math.tan(theta)\n",
+ "#print (H_sys\"head of system (in m)\")\n",
+ "#print (H_theor)\n",
+ "H_eff = [0,0,0,0,0,0]\n",
+ "for i in range(6):\n",
+ " H_eff[i] = effi_hyd[i]*H_theor[i]/100.\n",
+ "\n",
+ "#print (H_eff)\n",
+ "plot(Q,effi_hyd, 'r--d')\n",
+ "plot(Q,effi_over, 'g')\n",
+ "plot(Q,H_eff,'k')\n",
+ "plot(Q,H_theor)\n",
+ "plot(Q,H_sys ,'c-')\n",
+ "title('system characteritics')\n",
+ "ylabel('Head(m)or Efficiency(%)')\n",
+ "xlabel('volumetric flow rate(m**3/s)')\n",
+ "show()\n",
+ "\n",
+ "#calculation of power\n",
+ "#at intersecting point using datatrip b/w H_sys &H_eff\n",
+ "Q = 0.0336\n",
+ "effi_over = 59.9\n",
+ "H_eff = 13.10\n",
+ "P = H_eff*rho*g*Q/effi_over/10\n",
+ "print \"Power required to pump fluid at this rate(in KW): %.4f\"%P \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "WARNING: pylab import has clobbered these variables: ['draw_if_interactive', 'pi', 'new_figure_manager']\n",
+ "`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEXCAYAAACpuuMDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdYU9f/B/B3QIYoAmE7EBRBhhutuIgDra0VJ+ACq9W2\nVm21/aFttaC2itUuZ611+1VEraNqHQhx4EDEBYiiCKiAioDslZzfH5FI2CObz+t58mTd3PuJ475z\nzj3nXg5jjIEQQgh5S0PRBRBCCFEuFAyEEEIkUDAQQgiRQMFACCFEAgUDIYQQCRQMhBBCJFAwEFIO\nj8fDtm3bFF2GVKxatQqzZs2q9v3//e9/GDFihBwrIqqCQ/MYiDLQ0NDAo0eP0KFDB4XWMXjwYEyb\nNg0zZsxQaB3Tp09Hu3btsGLFCqmsLzExER06dEBpaSk0NOj3IKkZ/QshSkPdfqMIhUKFbVsgEFT5\nurr9GRPZoGAgDbJ69Wq0bdsWrVq1QufOnREWFoa0tDS0aNECGRkZ4uWioqJgZmYGgUCAR48ewc3N\nDYaGhjA1NcWkSZMAAIMGDQIAdOvWDfr6+jh48CAA4MSJE+jevTuMjIzQv39/3Lt3T7xea2trrF27\nFl27doW+vj5mzpyJFy9eYOTIkTAwMIC7uzuysrKqrf/YsWPo3r07DAwMYGtri7Nnz4rfS0xMxIAB\nA9CqVSuMGDECr1+/Fr83ceJEWFpawtDQEG5uboiNjRW/N336dHz++ef44IMP0LJlS/D5fJw8eRI9\nevSAgYEBrKyssGzZMok6Ll++jH79+sHIyAhWVlbYtWsXtm7din379uHnn3+Gvr4+PDw8AAApKSkY\nP348zMzM0KFDB6xfv168noCAAEyYMAHTpk2DgYEBdu7ciYCAAEybNk3iz9jQ0BCtWrXCtWvXsHPn\nTgwcOFC8jpiYGLi7u8PY2BgWFhZYtWoVACAiIgIuLi4wM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oh2Cg4PdXlK0bNkyvPPOOxg2bBgKCwthtVqxdu1aqVNOS0uDRqPB\nlClTUFJSIj2e6uh7V1q85erVq0hPT5fsfPjhhxg7diysVqvbnVtmZibOnj2LAQMGQKfTSY+YiouL\nvQqQgv6BWERPIOgnOJ1OTJ8+HRcuXPBZnampqUhNTe10V9iRRYsWISMjA2az2UeeCZ4l4lGSQNBP\nUKlUmD59Os6ePeuzOr/66qvHBoXq6mrU19eLoPAfQtwxCAQCgcANcccgEAgEAjdEYBAIBAKBGyIw\nCAQCgcANERgEAoFA4IYIDAKBQCBwQwQGgUAgELjxf6z7LLHWFcGKAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x258a6d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power required to pump fluid at this rate(in KW): 7.2014\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.4 pageno : 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the flow rate at which H_sys takes over HeffA\n",
+ "\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "#each is increased by five units to make each compatible for graph plotting\n",
+ "Q = [0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1] #flow rate\n",
+ "HeffA = [20.63 ,19.99, 17.80, 14.46, 10.33, 5.71, 0, 0, 0, 0, 0 ] #Heff of pump A\n",
+ "HeffB = [18 ,17, 14.95, 11.90, 8.10, 3.90, 0, 0, 0, 0, 0] #Heff of pump B\n",
+ "alpha = 1.\n",
+ "h = 10.4\n",
+ "d = 0.14\n",
+ "l = 98.\n",
+ "pi = 3.1412\n",
+ "g = 9.81\n",
+ "rho = 999.\n",
+ "mu = 0.001109\n",
+ "H_sys = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(11):\n",
+ " if i == 0:\n",
+ " H_sys[i] = h\n",
+ " else:\n",
+ " H_sys[i] = h+8*Q[i]**2/pi**2/d**4/g*(1+8*l*0.0396/d*(4*rho*Q[i]/pi/d/mu)**-0.25)\n",
+ "\n",
+ "#H_sys is head of the system\n",
+ "print \"the head of system in terms of height of water : \",H_sys\n",
+ "plot(Q,H_sys,'r--d')\n",
+ "plot(Q,HeffA ,'-c')\n",
+ "plot(Q,HeffB)\n",
+ "show()\n",
+ "\n",
+ "#at intersecting point using datatrip b/w H_sys &H_effA\n",
+ "print \"the flow rate at which H_sys takes over HeffA \",0.03339\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the head of system in terms of height of water : [10.4, 10.703503558535079, 11.434551925145852, 12.522017190713953, 13.934570851357016, 15.652293146483034, 17.66081196342499, 19.949010875049055, 22.507899154909985, 25.329974605787854, 28.4088306047139]\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD9CAYAAACoXlzKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVXX6wPHPZXVBcQNcwMAFFFBALZsmEzNLywWz0bEm\n3G1Ks1JHf2aJlmM6ak6Wk00jppZNWqFOGpNmOFqWpqDighsoKoiKoAhc4XJ+fxwlUIELdzn3Xp73\n68VLuZxz7vMNe/jyXZ6vTlEUBSGEEA7DSesAhBBCmJckdiGEcDCS2IUQwsFIYhdCCAcjiV0IIRyM\nJHYhhHAwlSb2wsJCunfvTnh4OMHBwcyYMQOA7Oxs+vTpQ2BgII8//jg5OTlWCVYIIUTVdFWtY8/P\nz6devXoUFxfz8MMPs2jRIjZt2kSzZs2YNm0aCxYs4OrVq8yfP99aMQshhKhElUMx9erVA+D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w4hISF06tSJZ599Fr1eb62wjVZV+44dO8bv\nfvc76tSpw+LFi6t1ry2oafuqnVuUaiouLlbatm2rpKamKjdv3lTCwsKUI0eOlLtm8+bNSr9+/RRF\nUZSff/5Z6d69u9H3as2U9mVkZCiJiYmKoijK9evXlcDAQIdq322LFy9Wnn32WWXAgAFWi9sYprYt\nOjpaWbFihaIoilJUVKTk5ORYL3gjmNK+1NRUJSAgQCksLFQURVGGDh2qfPLJJ9ZtQBWMaV9WVpay\nd+9eZebMmcqiRYuqda/WTGlfdXNLtXvsxqxh37RpEyNGjACge/fu5OTkkJmZaRfr32vavosXL9K8\neXPCw8MB8PDwoGPHjly4cMHqbaiMKe0DOHfuHFu2bGHs2LE2N0FuSttyc3PZuXMno0ePBtThRk9P\nT6u3oTKmtK9hw4a4urqSn59PcXEx+fn5tGrVSotmVMiY9nl5edGtWzdc76j54yi5paL2VTe3VDux\n32sN+/nz54265sKFC1Xeq7Watu/cuXPlrklLSyMxMZHu3btbNuBqMuX7B/Daa6+xcOFCnJxsrzCo\nKd+71NRUvLy8GDVqFF26dGHcuHHk5+dbLXZjmPK9a9KkCVOmTKF169a0bNmSRo0a8dhjj1ktdmMY\n0z5L3Gst5orRmNxS7f87jV2bbmu9OWPVtH1l78vLy+OZZ57hvffew8PDw6zxmaqm7VMUhW+++QZv\nb28iIiJs8vtryveuuLiY/fv389JLL7F//37q16/P/Pm2tVbalP/3Tp06xd///nfS0tK4cOECeXl5\nfPbZZ+YO0SSm7Huxhz0z5ojR2NxS7cRuzBr2O685d+4cvr6+Rt2rtZq27/avtUVFRQwZMoQ//elP\nREVFWSfoajClfT/99BObNm0iICCA4cOHs337dqKjo60We1VMaZuvry++vr7cf//9ADzzzDPs37/f\nOoEbyZT2/frrrzz00EM0bdoUFxcXnn76aX766SerxW4MU/KDo+SWylQrt1R3AqCoqEhp06aNkpqa\nquj1+ioncHbv3l06gWPMvVozpX0lJSXK888/r7z66qtWj9tYprSvrISEBKV///5WidlYpratR48e\nSkpKiqIoihITE6NMmzbNesEbwZT2JSYmKiEhIUp+fr5SUlKiREdHKx988IHV21CZ6uSHmJiYcpOL\njpJbbruzfdXNLdVO7IqiKFu2bFECAwOVtm3bKvPmzVMURVGWL1+uLF++vPSaCRMmKG3btlU6d+6s\n7Nu3r9J7bU1N27dz505Fp9MpYWFhSnh4uBIeHq58++23mrShMqZ8/25LSEiwuVUximJa25KSkpRu\n3bopnTt3VgYPHmxzq2IUxbT2LViwQAkODlZCQ0OV6Oho5ebNm1aPvypVtS8jI0Px9fVVGjZsqDRq\n1Ejx8/NTrl+/XuG9tqam7atubrHYQRtCCCG0YXtLG4QQQphEErsQQjgYSexCCOFgJLELIYSDkcQu\nhBAORhK7EEI4mP8HHfNwDjcyutAAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x3203e10>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the flow rate at which H_sys takes over HeffA 0.03339\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.5 pageno : 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "time t when the acceleration will be maximum\n",
+ "Maximum frequency of oscillation\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1000.\n",
+ "dc = .15\n",
+ "l = 7.8\n",
+ "g = 9.81\n",
+ "pi = 3.1428\n",
+ "atp = 105.4*1000\n",
+ "vap_pre = 10.85*1000\n",
+ "sl = .22\n",
+ "dp = 0.045\n",
+ "h = 4.6\n",
+ "\n",
+ "#(\"x(t) = sl/2*cos(2*pi*N*t)\" \"the function of print lcement\")\n",
+ "#\"since we have to maximize the acceleration double derivate the terms\")\n",
+ "#since double derivation have the term cos(kt) \n",
+ "#finding it maxima\n",
+ "t = linspace(0,5,100)\n",
+ "k = 1.\n",
+ "\n",
+ "def maximacheckerforcosine():\n",
+ " h = 0.00001\n",
+ " a = 0.00\n",
+ " for i in range(1,401): \n",
+ " if (math.cos(a+h)-math.cos(a-h))/2*h == 0 and math.cos(i-1)>0:\n",
+ " break\n",
+ " else:\n",
+ " a = 0.01+a\n",
+ " m = i-1\n",
+ " v = math.cos(i-1)\n",
+ " return m,v\n",
+ "\n",
+ "a, b = maximacheckerforcosine()\n",
+ "\n",
+ "print \"time t when the acceleration will be maximum(s)\",a\n",
+ "\n",
+ "#double derivative will result in a square of value of N\n",
+ "#lets consider its coefficient all will be devoid of N**2 \n",
+ "k = sl/2*(2*pi)**2 #accn max of piston\n",
+ "kp = k*1./4*pi*dc**2/1.*4/pi/dp**2 #accn coeff. ofsuction pipe\n",
+ "f = 1./4*pi*dp**2*l*rho*kp #force exerted by piston\n",
+ "p = f/1.*4./pi/dp**2 #pressure exerted by piston\n",
+ "\n",
+ "#calculation\n",
+ "o = atp-h*rho*g-vap_pre\n",
+ "#constant term of quadratic eqn\n",
+ "y = poly1d([-p, 0,o],False)\n",
+ "a = roots(y)\n",
+ "print \"Maximum frequency of oscillation if cavitation o be avoided(in Hz) %.4f\"%abs(a[0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time t when the acceleration will be maximum(s) 0\n",
+ "Maximum frequency of oscillation if cavitation o be avoided(in Hz) 0.3622\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 6.6 pageno : 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "mass of air required to lift the sulphuric acid tank\n",
+ "work done is magnitude of value in kg\n",
+ "The mass of air required \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhos = 1830. #density of acid\n",
+ "atp = 104.2*1000 #atmospheric pressure\n",
+ "temp = 11.+273 #temp in kelvin\n",
+ "M = 28.8/1000 #molar mass of air\n",
+ "R = 8.314 #universal gas constant\n",
+ "g = 9.81 #acceleration of gravity\n",
+ "pi = 3.14\n",
+ "d = 2.45 #diameter of tank\n",
+ "l = 10.5 #length of tank\n",
+ "h_s = 1.65 #height of surface of acid from below\n",
+ "effi = 0.93 #efficiency\n",
+ "\n",
+ "#calculation\n",
+ "mliq = pi*d**2*l*rhos/4\n",
+ "h_atm = atp/rhos/g #height conversion of atp\n",
+ "h_r = 4.3-1.65 #height difference\n",
+ "mair = g*h_r*mliq*M/(effi*R*temp*math.log(h_atm/(h_atm+h_s))) #mass of air\n",
+ "print \"mass of air required to lift the sulphuric acid tank %.4f\"%mair\n",
+ "print \"The negative sign indicates air is expanding & work done is magnitude of value in kg:\"\n",
+ "m = abs(mair/mliq)\n",
+ "print \"The mass of air required for per kilo of acid transferred: %.4f\"%m\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mass of air required to lift the sulphuric acid tank -123.3851\n",
+ "The negative sign indicates air is expanding & work done is magnitude of value in kg:\n",
+ "The mass of air required for per kilo of acid transferred: 0.0014\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch7.ipynb b/Problems_In_Fluid_Flow/ch7.ipynb
new file mode 100644
index 00000000..2c61cecf
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch7.ipynb
@@ -0,0 +1,203 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Flow Through Packed Beds\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "example 7.1 page no : 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "average particle diameter\n",
+ "surface area per gram of cement\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "mu = 1.83/1000\n",
+ "rhom = 1.355*10000 #density mercury\n",
+ "K = 5.\n",
+ "g = 9.81\n",
+ "d = 2.5/100\n",
+ "pi = 3.14\n",
+ "thik = 2.73/100\n",
+ "rho = 3100. #density of particles\n",
+ "Q = 250./(12.*60+54)/10.**6\n",
+ "\n",
+ "#calculation\n",
+ "A = pi*d**2./4.\n",
+ "Vb = A*thik #volume of bed\n",
+ "Vp = 25.4/rho/1000 #volume of particles\n",
+ "e = 1-Vp/Vb\n",
+ "u = Q/A\n",
+ "delP = 12.5/100*rhom*g\n",
+ "S = math.sqrt(e**3*delP/K/u/thik/mu/(1-e)**2)\n",
+ "S = round(S/1000)*1000.\n",
+ "d = 6./S\n",
+ "print \"average particle diameter in (x10**-6m) %.4f\"%(d*10**6)\n",
+ "A = pi*d**2./1000/(4./3*pi*d**3/8*rho)\n",
+ "print \"surface area per gram of cement (cm**2): %.4f\"%(A*10**4)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average particle diameter in (x10**-6m) 47.6190\n",
+ "surface area per gram of cement (cm**2): 406.4516\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.2 page no : 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find initial volumetric flow rate\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "mu = 2.5/1000\n",
+ "rho = 897.\n",
+ "g = 9.81\n",
+ "pi = 3.1414\n",
+ "K = 5.1\n",
+ "l = 6.35/1000\n",
+ "d = l\n",
+ "hei = 24.5+0.65\n",
+ "len = 24.5\n",
+ "dc = 2.65 #dia of column\n",
+ "thik = 0.76/1000\n",
+ "Vs = pi*d**2/4*l-pi*l/4*(d-2*thik)**2 #volume of each ring\n",
+ "n = 3.023*10**6\n",
+ "e = 1-Vs*n\n",
+ "e = round(e*1000)/1000.\n",
+ "Surfacearea = pi*d*l+2*pi*d**2/4+pi*(d-2*thik)*l-2*pi*(d-2*thik)**2/4\n",
+ "S = Surfacearea/Vs\n",
+ "S = round(S)\n",
+ "delP = hei*g*rho\n",
+ "delP = round(delP/100.)*100.\n",
+ "u = e**3*delP/K/S**2/mu/(1-e)**2/len\n",
+ "Q = pi*dc**2/4*u\n",
+ "print \"initial volumetric flow rate in (m**3/s): %.4f\"%Q\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "initial volumetric flow rate in (m**3/s): 2.8271\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 7.3 page no : 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find pressure drop in terms of (cm of H20)\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "dr = 2. #dia of column\n",
+ "mu = 2.02/10**5\n",
+ "rho = 998.\n",
+ "K = 5.1\n",
+ "g = 9.81\n",
+ "Q = 10000./3600\n",
+ "l = 50.8/1000\n",
+ "d = l\n",
+ "n = 5790.\n",
+ "len = 18.\n",
+ "thik = 6.35/1000\n",
+ "pi = 3.1414\n",
+ "\n",
+ "#part1\n",
+ "#calculation\n",
+ "\n",
+ "CA = pi*dr**2./4 #cross sectional area\n",
+ "u = Q/CA\n",
+ "Vs = pi*d**2/4*l-pi*l/4*(d-2*thik)**2 #volume of each ring\n",
+ "e = 1-Vs*n\n",
+ "Surfacearea = pi*d*l+2*pi*d**2/4+pi*(d-2*thik)*l-2*pi*(d-2*thik)**2/4\n",
+ "S = Surfacearea/Vs\n",
+ "S = round(S*10)/10.\n",
+ "delP = K*S**2/e**3*mu*len*u*(1-e)**2\n",
+ "delh = delP/rho/g\n",
+ "print \"pressure drop in terms of (cm of H20) %.4f\"%(delh*100)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure drop in terms of (cm of H20) 0.3540\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch8.ipynb b/Problems_In_Fluid_Flow/ch8.ipynb
new file mode 100644
index 00000000..97b6a74a
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch8.ipynb
@@ -0,0 +1,467 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Filtration"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.1 page no : 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "pressure drop at t = 30 min\n",
+ "the thickness of filtercake formed\n",
+ "thickness of cake required\n",
+ "average particle diameter\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "a = 78./1000 #dV/dt\n",
+ "rho = 998. #density of water\n",
+ "rhoc = 2230. #density of china clay\n",
+ "rhod = 1324. #density of cowdung cake\n",
+ "mu = 1.003/1000\n",
+ "P2 = 3.23*1000 #pressure after 2 min.\n",
+ "P5 = 6.53*1000 #pressure after 5 min.\n",
+ "t = 30*60.\n",
+ "b = array([[P2],[P5]])\n",
+ "A = array([[(a**2)*120., a],[(a**2)*300., a]])\n",
+ "x = linalg.solve(A, b)\n",
+ "P = x[0]*a**2*t+x[1]*a\n",
+ "print \"pressure drop at t = 30min in (kN/m**2):\",P/1000\n",
+ "\n",
+ "#part2\n",
+ "J = 0.0278 #mass fraction\n",
+ "l = 1.25\n",
+ "b1 = 0.7\n",
+ "A1 = l*b1*17*2 #area of filtering\n",
+ "V = a*30*60. #volume of filterate\n",
+ "e = 1-rhod/rhoc\n",
+ "nu = J*rho/((1-J)*(1-e)*rhoc-J*e*rho)\n",
+ "l1 = nu*V/A1\n",
+ "print \"the thickness of filtercake formed after 30 min in (m): %.4f\"%l1\n",
+ "\n",
+ "#part3\n",
+ "r = x[0][0]/mu/nu*A1**2\n",
+ "L = x[1][0]*A1/r/mu\n",
+ "print \"thickness of cake required in (m): %.4f\"%L\n",
+ "\n",
+ "#part 4\n",
+ "S = math.sqrt(r*e**3./5/(1-e)**2)\n",
+ "d = 6./S\n",
+ "print \"average particle diameter in(10**-6m): %.4f\"%(d*10**6)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure drop at t = 30min in (kN/m**2): [ 34.03]\n",
+ "the thickness of filtercake formed after 30 min in (m): 0.1026\n",
+ "thickness of cake required in (m): 0.0032\n",
+ "average particle diameter in(10**-6m): 87.9625\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.2 pageno :148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "time at which the required pressure drop have taken place\n",
+ "volume of filterate \n",
+ "the time required to collect 750dm**3\n",
+ "time required to pass 10dm**3 volume \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "P1 = 5.34*1000 #pressure after 3 min.\n",
+ "P2 = 9.31*1000 #pressure after 8 min.\n",
+ "a = 240./1000000 #dV/dt\n",
+ "P3 = 15.*10**3 #final pressure\n",
+ "\n",
+ "#calculation\n",
+ "b = array([[P1],[P2]])\n",
+ "A = array([[a**2*180, a],[a**2*480, a]])\n",
+ "x = linalg.solve(A,b)\n",
+ "\n",
+ "#part1\n",
+ "t = (P3-x[1][0]*a)/x[0][0]/a**2\n",
+ "\n",
+ "print \"time at which the required pressure drop have taken place in (s): %.4f\"%t\n",
+ "\n",
+ "#part 2\n",
+ "V1 = a*t\n",
+ "print \"volume of filterate in (m**3): %.4f\"%V1\n",
+ "\n",
+ "#part 3\n",
+ "V2 = 0.75\n",
+ "t2 = t+x[0][0]/2/P3*(V2**2-V1**2)+x[1][0]/P3*(V2-V1)\n",
+ "print \"the time required to collect 750dm**3 of filterate in (s): %.4f\"%t2\n",
+ "\n",
+ "#part 4\n",
+ "P4 = 12.*10**3\n",
+ "a = P4/(x[0][0]*V2+x[1][0])\n",
+ "t = 10./1000/a\n",
+ "print \"time required to pass 10dm**3 volume in (s): %.4f\"%t\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time at which the required pressure drop have taken place in (s): 909.9748\n",
+ "volume of filterate in (m**3): 0.2184\n",
+ "the time required to collect 750dm**3 of filterate in (s): 5289.2396\n",
+ "time required to pass 10dm**3 volume in (s): 153.8617\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.3 pageno : 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the thickness of filter \n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "a = 16./1000 #dV/dt\n",
+ "J = 0.0876 #mass fraction\n",
+ "rho = 999. #density of water\n",
+ "rhoc = 3470. #density of slurry\n",
+ "mu = 1.12/1000\n",
+ "rhos = 1922. #density of dry filter cake\n",
+ "t1 = 3*60.\n",
+ "t2 = 8*60.\n",
+ "V1 = 33.8/1000 #volume at t1\n",
+ "V2 = 33.8/1000+23.25/1000 #volume at t2\n",
+ "P = 12*1000. #pressure difference\n",
+ "Ap = 70.**2./10000*2*9\n",
+ "As = 650/10000.\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "b = array([t1,t2])\n",
+ "A = array([[V1**2/2/P, V1/P],[V2**2/2/P, V2/P]])\n",
+ "x = linalg.solve(A, b)\n",
+ "K1p = x[0]*As**2/Ap**2\n",
+ "K2p = x[1]*As/Ap\n",
+ "P2 = 15*1000. #final pressure drop\n",
+ "t = (P2-K2p*a)/K1p/a**2 #time for filterate\n",
+ "V = a*t #volume of filterate\n",
+ "e = 1-rhos/rhoc\n",
+ "nu = J*rho/((1-J)*(1-e)*rhoc-J*e*rho)\n",
+ "l = (11.-1)/200.\n",
+ "Vf = Ap*l/nu\n",
+ "tf = t+K1p/2/P2*(Vf**2-V**2)+K2p/P2*(Vf-V)\n",
+ "r = K1p/mu/nu*Ap**2\n",
+ "L = K2p*Ap/r/mu\n",
+ "print \"the thickness of filter which has resistance equal to resistance of filter medium in (m):%.5f\"%L\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the thickness of filter which has resistance equal to resistance of filter medium in (m):0.00247\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.4 page no : 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Volume at P = 90kPa \n",
+ "Volume at p = 45kPa \n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "\n",
+ "t1 = 3*60. #time 3min\n",
+ "t2 = 12*60. #time 12min\n",
+ "t3 = 5*60. #time 5min\n",
+ "P = 45*1000. #pressure at t1&t2\n",
+ "P2 = 85*1000. #pres. at t3\n",
+ "a = 1.86 #area\n",
+ "mu = 1.29/1000.\n",
+ "c = 11.8\n",
+ "V1 = 5.21/1000 #volume at t1\n",
+ "V2 = 17.84/1000 #volume at t2\n",
+ "V3 = 10.57/1000 #volume at t3\n",
+ "\n",
+ "#calculation\n",
+ "b = array([t1,t2])\n",
+ "A = array([[mu*c/2/a**2/P*V1**2, V1/P],[mu*c/2/a**2/P*V2**2, V2/P]])\n",
+ "x = linalg.solve(A,b)\n",
+ "r45 = x[0]\n",
+ "r85 = (t3-x[1]*V3/P2)*2*a**2*P2/V3**2/mu/c\n",
+ "n = math.log(r45/r85)/math.log(45./85)\n",
+ "rbar = r45/(1-n)/(45.*1000)**n\n",
+ "r78 = rbar*(1-n)*(78.*1000)**n\n",
+ "\n",
+ "#part1\n",
+ "#polynomial in V as a1x**2+bx+c1 = 0\n",
+ "c1 = 90.*60 #time at 90 \n",
+ "Pt = 78*1000. #Pt = pressure at time t = 90\n",
+ "r78 = round(r78/10.**12)*10.**12\n",
+ "a1 = r78*mu/a**2/Pt*c/2.\n",
+ "b = x[1]/Pt\n",
+ "y = poly1d([a1,b,-c1],False)\n",
+ "V1 = roots(y)\n",
+ "print \"Volume at P = 90kPa in (m**3): %.4f\"%V1[1]\n",
+ "\n",
+ "#part2\n",
+ "Pt = 45.*1000\n",
+ "c1 = 90.*60\n",
+ "a1 = r45*mu/a**2/Pt*c/2\n",
+ "b = x[1]/Pt\n",
+ "y = poly1d([a1,b,-c1],False)\n",
+ "V1 = roots(y)\n",
+ "print \"Volume at p = 45kPa in (m**3): %.4f\"%V1[1]\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume at P = 90kPa in (m**3): 0.0660\n",
+ "Volume at p = 45kPa in (m**3): 0.0789\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.5 page no : 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "thickness of filter cake \n",
+ "rate at which wet cake will be scrapped\n",
+ "rate of which slurry is treated\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "t = 60*0.3/0.5 #time of 1 revollution\n",
+ "d = 34/1000000.\n",
+ "S = 6./d\n",
+ "e = 0.415\n",
+ "J = 0.154\n",
+ "P = 34.8*1000\n",
+ "mu = 1.17/1000\n",
+ "L = 2.35/1000\n",
+ "rho = 999. #density of water\n",
+ "rhos = 4430. #density of barium carbonate\n",
+ "\n",
+ "#calculation\n",
+ "#part1\n",
+ "nu = J*rho/((1-J)*(1-e)*rhos-J*e*rho)\n",
+ "r = 5*S**2*(1-e)**2/e**3\n",
+ "\n",
+ "#quadratic in l\n",
+ "#in the form of ax**2+bx+c = 0\n",
+ "c = -t\n",
+ "b = r*mu*L/nu/P\n",
+ "a = r*mu/2/nu/P\n",
+ "y = poly1d([a,b,c],False)\n",
+ "l = roots(y)\n",
+ "print \"thickness of filter cake in (m): %.4f\"%l[1]\n",
+ "\n",
+ "#part2\n",
+ "d = 1.2\n",
+ "l1 = 2.6\n",
+ "pi = 3.1428\n",
+ "u = pi*d*0.5/60\n",
+ "Q = u*l1*l[1]\n",
+ "mnet = Q*(1-e)*rhos+Q*e*rho\n",
+ "print \"rate at which wet cake will be scrapped in (kg/s): %.4f\"%mnet\n",
+ "\n",
+ "#part3\n",
+ "md = Q*(1-e)*rhos #rate at which solid scrapped from the drum\n",
+ "r = md/0.154\n",
+ "print \"rate of which slurry is treated is (kg/h): %.4f\"%(r*3600)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "thickness of filter cake in (m): 0.0122\n",
+ "rate at which wet cake will be scrapped in (kg/s): 3.0088\n",
+ "rate of which slurry is treated is (kg/h): 60635.4180\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 8.6 page no : 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "time taken to collect sucrose crystal\n",
+ "volume of liquid separated\n",
+ "'''\n",
+ "\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "mu = 0.224\n",
+ "rho = 1328.\n",
+ "K = 5.\n",
+ "b = 3*.5 #radius\n",
+ "h = 2.5\n",
+ "pi = 3.1428\n",
+ "x = 2.1*.5\n",
+ "rhos = 1581. #density of sucrose\n",
+ "e = 0.435 #void ratio\n",
+ "J = 0.097 #mass fraction\n",
+ "m = 3500. #mass flowing\n",
+ "a = 85/10.**6 #side length\n",
+ "L = 48./1000 #thickness\n",
+ "omega = 2*pi*325./60.\n",
+ "\n",
+ "#calculation\n",
+ "bi = b**2-m/pi/h/(1-e)/rhos #inner radius\n",
+ "bi = math.sqrt(bi)\n",
+ "bi = round(bi*1000)/1000.\n",
+ "nu = J*rho/((1-J)*(1-e)*rhos-J*e*rho)\n",
+ "S = 6./a\n",
+ "r = 5*S**2*(1-e)**2/e**3\n",
+ "t = ((b**2-bi**2)*(1+2*L/b)+2*bi**2*math.log(bi/b))/(2*nu*rho*omega**2/r/mu*(b**2-x**2))\n",
+ "print \"time taken to collect sucrose crystal in (s): %.4f\"%t\n",
+ "\n",
+ "#part2\n",
+ "vl = pi*(b**2-bi**2)*h*e\n",
+ "vs = pi*(b**2-bi**2)*h/nu-vl\n",
+ "print \"volume of liquid separated as filterate i (m**3): %.4f\"%vs\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time taken to collect sucrose crystal in (s): 3287.3308\n",
+ "volume of liquid separated as filterate i (m**3): 21.1677\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/ch9.ipynb b/Problems_In_Fluid_Flow/ch9.ipynb
new file mode 100644
index 00000000..9644490f
--- /dev/null
+++ b/Problems_In_Fluid_Flow/ch9.ipynb
@@ -0,0 +1,370 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Forces on bodies immersed in fluids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.1 pageno : 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "The drag force on sphere\n",
+ "The drag force on cube\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.2\n",
+ "mu = 1.85/100000\n",
+ "pi = 3.1428\n",
+ "d = 3.\n",
+ "v = 50.*1000/3600\n",
+ "\n",
+ "#calculation part 1\n",
+ "Re = d*rho*v/mu\n",
+ "\n",
+ "#from chart of drag coeff. vs Re\n",
+ "Cd = 0.2 #coeff. of drag\n",
+ "Ad = pi*d**2/4. #projected area\n",
+ "Fd = Ad*Cd*rho*v**2/2.\n",
+ "print \"The drag force on sphere in N\",Fd \n",
+ "\n",
+ "#part 2\n",
+ "v = 2.\n",
+ "l = 0.25\n",
+ "Re = l*v*rho/mu\n",
+ "zi = 4*pi*(l**3*3./4/pi)**(2/3.)/6./l**2 #sphericity\n",
+ "\n",
+ "#using graph\n",
+ "Cd = 2.\n",
+ "Ad = l**2\n",
+ "Fd = Ad*Cd*rho*v**2/2.\n",
+ "print \"The drag force on cube in N\",Fd \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drag force on sphere in N 163.6875\n",
+ "The drag force on cube in N 0.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.2 page no : 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "Drag force in N\n",
+ "The drag coefficient\n",
+ "The lift force\n",
+ "The coefficient of lift\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 1.2\n",
+ "mu = 1.85/100000\n",
+ "pi = 3.1428\n",
+ "g = 9.81\n",
+ "d = 1.38\n",
+ "t = 0.1 #thickness\n",
+ "v = 30*1000/3600.\n",
+ "T = 26.2 #Tension\n",
+ "m = 0.51 #mass\n",
+ "theta = 60.*pi/180.\n",
+ "\n",
+ "#calculation\n",
+ "Fd = T*math.cos(theta)\n",
+ "print \"Drag force in N: %.4f\"% Fd\n",
+ "A = pi*d**2/4.\n",
+ "Ad = A*math.cos(theta) #area component to drag\n",
+ "Cd = 2*Fd/Ad/rho/v**2 #coeff of drag\n",
+ "print \"The drag coefficient: %.4f\"% Cd \n",
+ "Fg = m*g #force of gravity\n",
+ "Fb = rho*pi*d**2/4.*t*g #buoyant force\n",
+ "Fl = Fg-Fb+T*math.sin(theta)\n",
+ "print \"The lift force in N : %.4f\"%Fl\n",
+ "Al = A*math.sin(theta)\n",
+ "Cl = 2*Fl/Al/rho/v**2\n",
+ "print \"The coefficient of lift: %.4f\"%Cl \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drag force in N: 13.0909\n",
+ "The drag coefficient: 0.4202\n",
+ "The lift force in N : 25.9368\n",
+ "The coefficient of lift: 0.4803\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.3 page no : 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Diameter of sphere\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhog = 1200. #density of glycerol\n",
+ "mu = 1.45\n",
+ "pi = 3.1428\n",
+ "g = 9.81\n",
+ "rhos = 2280. #density of sphere\n",
+ "v = 0.04 #terminal velocity\n",
+ "a = 2*mu*g*(rhos-rhog)/v**3./3./rhog**2 #a = Cd/2/Re\n",
+ "\n",
+ "#using graph of Cd/2/Re vs Re\n",
+ "Re = 0.32\n",
+ "d = Re*mu/v/rhog\n",
+ "print \"Diameter of sphere in (m): %.4f\"%d \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter of sphere in (m): 0.0097\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.4 page no : 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find The terminal velocity\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhoa = 1.218 #density of air\n",
+ "mu = 1.73/100000\n",
+ "pi = 3.1428\n",
+ "g = 9.81\n",
+ "rhog = 1200.\n",
+ "rhop = 2280. #density of polythene\n",
+ "d = 0.0034 #diameter\n",
+ "a = 4*d**3*(rhop-rhoa)*rhoa*g/3/mu**2 #a = Cd*Re**2\n",
+ "\n",
+ "#using graph of Cd*Re**2 vs Re\n",
+ "Re = 2200.\n",
+ "v = Re*mu/d/rhog\n",
+ "print \"The terminal velocity in (m/s) %f\"%v \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The terminal velocity in (m/s) 0.009328\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 9.6 page no : 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "settling occurs in stoke-s law range\n",
+ "settling velocity\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Initialization of Variable\n",
+ "pi = 3.1428\n",
+ "rho = 825\n",
+ "mu = 1.21\n",
+ "g = 9.81\n",
+ "l = 0.02\n",
+ "de = 0.02 #dia exterior\n",
+ "di = 0.012 #dia interior\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rho = 998. #density of water\n",
+ "mu = 1.25/1000 #viscosity of water\n",
+ "w = 100. #mass of water\n",
+ "pi = 3.1428\n",
+ "g = 9.81\n",
+ "rhog = 2280. #density of glass\n",
+ "wg = 60. #mass of glass\n",
+ "d = 45.*10**-6 #diameter of glass sphere\n",
+ "\n",
+ "#claculation\n",
+ "rhom = (w+wg)/(w/rho+wg/rhog) #density of mixure\n",
+ "e = w/rho/(w/rho+wg/rhog) #volume fraction of watter\n",
+ "\n",
+ "#using charts\n",
+ "zi = math.exp(-4.19*(1.-e))\n",
+ "\n",
+ "K = d*(g*rho*(rhog-rho)*zi**2/mu**2)**(1./3) #stoke's law coeff.\n",
+ "print K\n",
+ "if K<3.3:\n",
+ " print \"settling occurs in stoke-s law range\"\n",
+ " U = g*d**2*e*zi*(rhog-rhom)/18/mu\n",
+ " print \"settling velocity in m/s: %f\"%U\n",
+ "else:\n",
+ " print \"settling does not occurs in stoke-s law range\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.504080734813\n",
+ "settling occurs in stoke-s law range\n",
+ "settling velocity in m/s: 0.000297\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "example 9.7 page no : 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find Time taken by particle to reach 80% of its velocity\n",
+ "\n",
+ "import math \n",
+ "from numpy import linspace\n",
+ "\n",
+ "\n",
+ "# Initialization of Variable\n",
+ "rhog = 1200. #density of glycerol\n",
+ "mu = 1.45 #viscosity of glycerol\n",
+ "pi = 3.1428\n",
+ "g = 9.81\n",
+ "rhos = 2280. #density of sphere\n",
+ "d = 8/1000.\n",
+ "s = 0.\n",
+ "uf = 0.8*0.026\n",
+ "\n",
+ "#calculation\n",
+ "def intre():\n",
+ " s = 0.\n",
+ " u = linspace(0,uf,1000)\n",
+ " for i in range(0,1000):\n",
+ " y = ((pi/6*d**3*rhos*g-pi*d**3/6*rhog*g-0.5*pi*d**2/4*24*mu/d/rhog*rhog*u[i])/pi*6/d**3/rhos)**(-1)*uf/1000\n",
+ " s = s+y\n",
+ " a = s\n",
+ " return a\n",
+ "\n",
+ "t = intre()\n",
+ "print \"Time taken by particle to reach 80%% of its velocity in (s): %f\"%t\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by particle to reach 80% of its velocity in (s): 0.009020\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Problems_In_Fluid_Flow/screenshots/pic1.png b/Problems_In_Fluid_Flow/screenshots/pic1.png
new file mode 100644
index 00000000..ad04e9de
--- /dev/null
+++ b/Problems_In_Fluid_Flow/screenshots/pic1.png
Binary files differ
diff --git a/Problems_In_Fluid_Flow/screenshots/pic2.png b/Problems_In_Fluid_Flow/screenshots/pic2.png
new file mode 100644
index 00000000..1bb10249
--- /dev/null
+++ b/Problems_In_Fluid_Flow/screenshots/pic2.png
Binary files differ
diff --git a/Problems_In_Fluid_Flow/screenshots/pic3.png b/Problems_In_Fluid_Flow/screenshots/pic3.png
new file mode 100644
index 00000000..06f61a6f
--- /dev/null
+++ b/Problems_In_Fluid_Flow/screenshots/pic3.png
Binary files differ
diff --git a/Programming_in_C/Chapter_03.ipynb b/Programming_in_C/Chapter_03.ipynb
new file mode 100644
index 00000000..0f1f4347
--- /dev/null
+++ b/Programming_in_C/Chapter_03.ipynb
@@ -0,0 +1,146 @@
+{
+ "metadata": {
+ "name": "Chapter III"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 3: Compiling and running your first program"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Program 3.1, Page number: 11"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#3.1.py\n#first Python Program\n\n#Print Statement\nprint(\"Programming is Fun.\")",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Programming is Fun.\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Program 3.2, Page number: 14"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#3.2.py\n#Writing Your First C Program(Version2)\n\n#Print statement\nprint(\"Programming is Fun.\")\nprint(\"And Programming in Python is even more fun\")",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Programming is Fun.\nAnd Programming in Python is even more fun\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Program 3.3, Page number: 14"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#3.3.py\n#Displaying multiple Lines of output\n\n#Print statements using escape sequence\nprint(\"Testing...\\n..1\\n...2\\n....3\\n\")",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Testing...\n..1\n...2\n....3\n\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Program 3.4, Page number: 15"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#3.4.py\n#Displaying Variables\n \nsum=50+25\nprint(\"The sum of 50 & 25 is: {0} \".format(sum))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of 50 & 25 is: 75 \n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Program 3.5, Page number: 16"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#3.5.py\n#Displayig multiple values\n\n#Variable declaration\nvalue1=50\nvalue2=25\n\n#Calculation\nsum=value1+value2\n\n#Result\nprint(\"The sum of {0} & {1} is: {2}\".format(value1,value2,sum))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of 50 & 25 is: 75\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Program 3.6, Page number: 17"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#3.6.py\n#Using Comment in a program\n\n#'#(Hash/Pound)' is used to display a comment in python\n#This is a comment\n\n#Variable declarations\nvalue1=50\nvalue2=25\n\n#Calculation\nsum=value1+value2\n\n#Result\nprint(\"The sum of {0} & {1} is {2}\".format(value1,value2,sum))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The sum of 50 & 25 is 75\n"
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_04.ipynb b/Programming_in_C/Chapter_04.ipynb
new file mode 100644
index 00000000..f7f7405b
--- /dev/null
+++ b/Programming_in_C/Chapter_04.ipynb
@@ -0,0 +1,262 @@
+{
+ "metadata": {
+ "name": "Chapter IV"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Variables, data types, and arithmetic expressions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 4.1, Page number: 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#4.1.py\n",
+ "#Using the Basic Data Types\n",
+ "\n",
+ "#Variable Declarations\n",
+ "integerVar=100\n",
+ "floatingVar=331.79\n",
+ "doubleVar=8.44e+11\n",
+ "charVar='w'\n",
+ "boolVar=bool(0)\n",
+ "\n",
+ "#Result\n",
+ "print(\"integerVar={0}\".format(integerVar))\n",
+ "print(\"floatingVar={0}\".format(floatingVar))\n",
+ "print(\"doubleVar={0}\".format(doubleVar))\n",
+ "print(\"charVar={0}\".format(charVar))\n",
+ "print(\"boolVar={0}\".format(boolVar))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "integerVar=100\n",
+ "floatingVar=331.79\n",
+ "doubleVar=8.44e+11\n",
+ "charVar=w\n",
+ "boolVar=False\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 4.2, Page number: 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#4.2.py\n",
+ "#Using the Arithmetic Operators\n",
+ "\n",
+ "#Variable declarations\n",
+ "a=100\n",
+ "b=2\n",
+ "c=25\n",
+ "d=4\n",
+ "\n",
+ "#Calculations/Results\n",
+ "result=a-b #subtraction\n",
+ "print(\"a-b={0}\".format(result)) #result\n",
+ "\n",
+ "result=b*c #multiplication\n",
+ "print(\"b*c={0}\".format(result)) #result\n",
+ "\n",
+ "result=a/c #division\n",
+ "print(\"a/c={0}\".format(result)) #result\n",
+ "\n",
+ "result=a+b*c #precedence\n",
+ "print(\"a+b*c={0}\".format(result)) #result \n",
+ "\n",
+ "print(\"a*b+c*d={0}\".format(a*b+c*d)) #direct calculation"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a-b=98\n",
+ "b*c=50\n",
+ "a/c=4\n",
+ "a+b*c=150\n",
+ "a*b+c*d=300\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 4.3, Page number: 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#4.3.py\n",
+ "#More Examples with Arithmetic Operations\n",
+ "\n",
+ "#Variable Declarations\n",
+ "a=25\n",
+ "b=2\n",
+ "c=25.0\n",
+ "d=2.0\n",
+ "\n",
+ "#Calculations/Result\n",
+ "print(\"6 + a / 5 * b = {0}\".format(6+a/5*b))\n",
+ "print(\"a / b * b = {0}\".format(a/b*b))\n",
+ "print(\"c / d * d = {0}\".format(c/d*d))\n",
+ "print(\"-a={0}\".format(-a))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6 + a / 5 * b = 16\n",
+ "a / b * b = 24\n",
+ "c / d * d = 25.0\n",
+ "-a=-25\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 4.4, Page number: 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#4.4.py\n",
+ "#Illustrating the Modulus Operator\n",
+ "\n",
+ "#Variable Declarations\n",
+ "a=25\n",
+ "b=5\n",
+ "c=10\n",
+ "d=7\n",
+ "\n",
+ "#Calculations/Result\n",
+ "print(\"a % b = {0}\".format(a%b))\n",
+ "print(\"a % c = {0}\".format(a%c))\n",
+ "print(\"a % d = {0}\".format(a%d))\n",
+ "print(\"a / d * d + a % d = {0}\".format(a/d*d+a%d))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a % b = 0\n",
+ "a % c = 5\n",
+ "a % d = 4\n",
+ "a / d * d + a % d = 25\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 4.5, Page number: 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#4.5.py\n",
+ "#Converting Between Integers and Floats\n",
+ "\n",
+ "#Variable Declarations\n",
+ "f1=123.125\n",
+ "f2=1.0\n",
+ "i1=1\n",
+ "i2=-150\n",
+ "c='a'\n",
+ "\n",
+ "\n",
+ "i1=f1 #floating to integer conversion\n",
+ "print(\"{0} assigned to an int produces {1:.0f}\".format(f1,i1))\n",
+ "\n",
+ "f1=i2 #integer to floating conversion\n",
+ "print(\"{0} assigned to a float produces {1}\".format(i2,f1))\n",
+ "\n",
+ "f1=i2/100 #integer divided by integer\n",
+ "print(\"{0} divided by 100 produces {1}\".format(i2,f1))\n",
+ "\n",
+ "f2=i2/100.0 #integer divided by a float\n",
+ "print(\"{0} divided by 100.0 produces {1}\".format(i2,f2))\n",
+ "\n",
+ "f2=float(i2/100) #type cast operator\n",
+ "print(\"{0} divided by 100 produces {1}\".format(i2,f2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "123.125 assigned to an int produces 123\n",
+ "-150 assigned to a float produces -150\n",
+ "-150 divided by 100 produces -2\n",
+ "-150 divided by 100.0 produces -1.5\n",
+ "-150 divided by 100 produces -2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_05.ipynb b/Programming_in_C/Chapter_05.ipynb
new file mode 100644
index 00000000..90be6c84
--- /dev/null
+++ b/Programming_in_C/Chapter_05.ipynb
@@ -0,0 +1,421 @@
+{
+ "metadata": {
+ "name": "Chapter V"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Program looping"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.1, Page number: 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.1.py\n",
+ "#Calculating the Eighth Triangular Number\n",
+ "\n",
+ "#Variable Declaration\n",
+ "triangularNumber = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;\n",
+ "\n",
+ "#Result\n",
+ "print(\"The eighth triangular number is {0}\".format(triangularNumber))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The eighth triangular number is 36\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.2, Page number: 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.2.py\n",
+ "#Calculating the 200th Triangular Number\n",
+ "\n",
+ "#Variable Declaration\n",
+ "triangularNumber=0\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range (201):\n",
+ " triangularNumber=triangularNumber+i \n",
+ "\n",
+ "#Result\n",
+ "print(\"The 200th triangular number is {0}\".format(triangularNumber))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The 200th triangular number is 20100\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.3, Page number: 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.3.py\n",
+ "#Generating a Table of Triangular Numbers\n",
+ "\n",
+ "print(\"TABLE OF TRIANGULAR NUMBERS\\n\\n\")\n",
+ "print(\" n Sum from 1 to n\\n\")\n",
+ "print(\"--- -----------------\\n\")\n",
+ "\n",
+ "#Variable Declarations\n",
+ "triangularNumber=0\n",
+ "\n",
+ "#Calculation/Result\n",
+ "for i in range (1,11):\n",
+ " triangularNumber=triangularNumber+i\n",
+ " print(\" {0} {1}\\n\".format(i,triangularNumber))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "TABLE OF TRIANGULAR NUMBERS\n",
+ "\n",
+ "\n",
+ " n Sum from 1 to n\n",
+ "\n",
+ "--- -----------------\n",
+ "\n",
+ " 1 1\n",
+ "\n",
+ " 2 3\n",
+ "\n",
+ " 3 6\n",
+ "\n",
+ " 4 10\n",
+ "\n",
+ " 5 15\n",
+ "\n",
+ " 6 21\n",
+ "\n",
+ " 7 28\n",
+ "\n",
+ " 8 36\n",
+ "\n",
+ " 9 45\n",
+ "\n",
+ " 10 55\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.4, Page number: 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.4.py\n",
+ "#Asking the User for Input\n",
+ "\n",
+ "#Variable Declaration/User Input\n",
+ "triangularNumber=0\n",
+ "number=10 #number=input(\"What triangular number do you want?\")\n",
+ "\n",
+ "#Calculations\n",
+ "for n in range (1,(number+1)):\n",
+ " triangularNumber+=n\n",
+ "\n",
+ "#Result\n",
+ "print(\"triangular number {0} is {1}\".format(number,triangularNumber))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "triangular number 10 is 55\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.5, Page number: 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.5.py\n",
+ "#Using Nested for Loops\n",
+ "\n",
+ "#Calculations\n",
+ "for counter in range(1,6): #Outer Loop\n",
+ " number=12 #input(\"what triangular number do you want? \")\n",
+ "\n",
+ " triangularNumber=0 #Variable Decaration\n",
+ "\n",
+ " for n in range (1,(number+1)): #Inner Loop\n",
+ " triangularNumber+=n\n",
+ " \n",
+ " #Result\n",
+ " print(\"Triangular Number {0} is {1}\".format(number,triangularNumber))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Triangular Number 12 is 78\n",
+ "Triangular Number 12 is 78\n",
+ "Triangular Number 12 is 78\n",
+ "Triangular Number 12 is 78\n",
+ "Triangular Number 12 is 78\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.6, Page number: 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.6.py\n",
+ "#Introducing the while Statement\n",
+ "\n",
+ "#Variable Declaration\n",
+ "count=1\n",
+ "\n",
+ "#Calculation/Iteration `\n",
+ "while (count<=5):\n",
+ " print(\"{0}\\n\".format(count)) #Result\n",
+ " count+=1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n",
+ "\n",
+ "2\n",
+ "\n",
+ "3\n",
+ "\n",
+ "4\n",
+ "\n",
+ "5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.7, Page number: 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.7.py\n",
+ "#Finding the Greatest Common Divisor\n",
+ "\n",
+ "print(\"Please type in two nonnegative integers.\")\n",
+ "#Variable Declaration/User Input\n",
+ "u=8 #u=input()\n",
+ "v=14 #v=input()\n",
+ "\n",
+ "#Calculation\n",
+ "while(v!=0):\n",
+ " temp=u%v\n",
+ " u=v\n",
+ " v=temp\n",
+ "\n",
+ "#Result\n",
+ "print(\"Their greatest common divisor is {0}\\n\".format(u))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please type in two nonnegative integers.\n",
+ "Their greatest common divisor is 2\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.8, Page number: 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.8.py\n",
+ "#Reversing the Digits of a Number\n",
+ "\n",
+ "#Import Library\n",
+ "import sys\n",
+ "\n",
+ "#Variable declaration/User Input\n",
+ "number=113 #number=input(\"Enter your number.\\n\")\n",
+ "\n",
+ "#Calculation/Result\n",
+ "while(number!=0):\n",
+ " right_digit=number%10\n",
+ " sys.stdout.write(\"{0}\".format(right_digit))\n",
+ " number=number/10\n",
+ "\n",
+ "print(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "311\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 5.9, Page number: 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#5.9.py\n",
+ "#Implementing a Revised Program to Reverse the Digits of a Number\n",
+ "#(do-while equivalent code)\n",
+ "\n",
+ "#Import Library\n",
+ "import sys\n",
+ "\n",
+ "#Variable Declaration/User Input\n",
+ "number=428 #number=input(\"Enter your number:\\n\")\n",
+ "\n",
+ "#Calculation/Result\n",
+ "while True: #Enter loop instantly for the first time\n",
+ " right_digit=number%10\n",
+ " sys.stdout.write(\"{0}\".format(right_digit))\n",
+ " number=number/10\n",
+ " if(number == 0): #Check for exit condition\n",
+ " break\n",
+ "\n",
+ "print(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "824\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_06.ipynb b/Programming_in_C/Chapter_06.ipynb
new file mode 100644
index 00000000..a612ce70
--- /dev/null
+++ b/Programming_in_C/Chapter_06.ipynb
@@ -0,0 +1,496 @@
+{
+ "metadata": {
+ "name": "Chapter VI"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Making decisions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.1, Page number: 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.1.py\n",
+ "#Calculating the Absolute Value of an Integer\n",
+ "\n",
+ "#Variable Declaration/User input\n",
+ "number=12 #number=int(raw_input(\"Type in your number: \"))\n",
+ "\n",
+ "#Calculation\n",
+ "try:\n",
+ " if( number < 0 ):\n",
+ " number=-number #change sign,if number is negative\n",
+ "except: \n",
+ " print \"not a number\" #Invalid input/value error\n",
+ " \n",
+ "#Result\n",
+ "print (\"The absolute Value is {0}\".format(number))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absolute Value is 12\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.2, Page number: 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.2.py\n",
+ "#Calculating average & counting the number\n",
+ "#of failures from a set of grades\n",
+ "\n",
+ "#Variable Declarations\n",
+ "gradeTotal=0\n",
+ "failureCount=0\n",
+ "i=0\n",
+ "\n",
+ "#User Input\n",
+ "numberOfGrades=5 #numberOfGrades=int(raw_input(\"How many grades will you be entering? \"))\n",
+ "grade=[72,83,91,89,95]\n",
+ "\n",
+ "#Calculation\n",
+ "while(i<numberOfGrades):\n",
+ " gradeTotal=gradeTotal+grade[i]\n",
+ " if(grade<65):\n",
+ " failureCount=failureCount+1;\n",
+ " i=i+1\n",
+ "\n",
+ "average=float(gradeTotal/numberOfGrades)\n",
+ " \n",
+ "#Result\n",
+ "print(\"Grade average= {0:.2f}\".format(average))\n",
+ "print(\"Number of failures= {0}\".format(failureCount))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Grade average= 86.00\n",
+ "Number of failures= 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.3, Page number: 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.3.py\n",
+ "#Determining if a Number Is Even or Odd\n",
+ "\n",
+ "#Variable declaration/User input\n",
+ "number_to_test=30 #number_to_test=int(raw_input(\"Enter your number to be tested: \"))\n",
+ "\n",
+ "#Calculation\n",
+ "remainder=number_to_test%2\n",
+ "\n",
+ "#Result\n",
+ "if(remainder==0):\n",
+ " print(\"The number is even\")\n",
+ "if(remainder!=0):\n",
+ " print(\"The number is odd\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number is even\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.4, Page number: 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.4.py\n",
+ "#Program to determine if a number is even or odd (Ver. 2)\n",
+ "\n",
+ "#Variable declaration/User input\n",
+ "number_to_test=45 #number_to_test=int(raw_input(\"Enter your Number to be tested: \"))\n",
+ "\n",
+ "#Calculation\n",
+ "remainder=number_to_test%2\n",
+ "\n",
+ "#Result\n",
+ "if(remainder==0):\n",
+ " print(\"The number is even.\\n\")\n",
+ "else: #using 'else' instead of second 'if'\n",
+ " print(\"The number is odd.\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number is odd.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.5, Page number: 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.5.py\n",
+ "#Determining if a Year Is a Leap Year\n",
+ "\n",
+ "#Variable declaration/User input\n",
+ "year=1900 #year=int(raw_input(\"Enter the year to be tested: \"))\n",
+ "\n",
+ "#Calculations\n",
+ "rem_4=year%4\n",
+ "rem_100=year%100\n",
+ "rem_400=year%400\n",
+ "\n",
+ "#Result\n",
+ "if((rem_4==0 and rem_100!=0)or rem_400==0):\n",
+ " print(\"It's a leap year.\")\n",
+ "else:\n",
+ " print(\"Nope, it's not a leap year.\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nope, it's not a leap year.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.6, Page number: 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.6.py\n",
+ "#Implementing the Sign Function\n",
+ "\n",
+ "#Variable declaration/User input\n",
+ "number=450 #number=int(raw_input(\"Please type in a number: \"))\n",
+ "\n",
+ "#Calculations\n",
+ "try:\n",
+ " if(number<0): #Negative Number\n",
+ " sign=-1\n",
+ " elif(number==0): #No sign\n",
+ " sign=0\n",
+ " else: #Positive Number\n",
+ " sign=1\n",
+ "except: #Value error\n",
+ " print(\"invalid input\")\n",
+ "\n",
+ "#Result\n",
+ "print(\"Sign= {0}\".format(sign))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sign= 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.7, Page number: 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.7.py\n",
+ "#Implementing the Sign Function\n",
+ "\n",
+ "#variable declaration/User input\n",
+ "ch='z' #ch=raw_input(\"Enter a single character: \")\n",
+ "\n",
+ "#Calculation/Result\n",
+ "if((ch>='a' and ch <='z') or (ch>='A' and ch<='Z')):\n",
+ " print(\"It's an alphabetic character.\")\n",
+ "elif(ch>='0'and ch<='9'):\n",
+ " print(\"It's a digit.\")\n",
+ "else:\n",
+ " print(\"It's a special character\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "It's an alphabetic character.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.8, Page number: 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.8.py\n",
+ "#evaluate simple expressions of the form\n",
+ "#<number operator number>\n",
+ "\n",
+ "\n",
+ "try:\n",
+ "#Variable declaration/User input\n",
+ " print(\"Type in your expression(with spaces inbetween): \")\n",
+ " value1, operator, value2=\"5 + 2\".split()\n",
+ " #value1, operator, value2=raw_input().split()\n",
+ "\n",
+ "except:\n",
+ " print(\"err.. follow the syntax <value operator value>\") \n",
+ " print(\"with spaces inbetween\\n\")\n",
+ "\n",
+ "#Parsing\n",
+ "value1,value2=[float(value1),float(value2)]\n",
+ "\n",
+ "#Calculation/Result\n",
+ "if(operator=='+'):\n",
+ " print(\"answer: {0:.2f}\".format(value1+value2))\n",
+ "elif(operator=='-'):\n",
+ " print(\"answer: {0:.2f}\".format(value1-value2))\n",
+ "elif(operator=='*'):\n",
+ " print(\"answer: {0:.2f}\".format(value1*value2))\n",
+ "else:\n",
+ " print(\"answer: {0:.2f}\".format(value1/value2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in your expression(with spaces inbetween): \n",
+ "answer: 7.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.9, Page number: 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.9.py\n",
+ "#evaluate simple expressions of the form\n",
+ "#<number operator number> (Version 2)\n",
+ "\n",
+ "\n",
+ "try:\n",
+ "#Variable declaration/User input\n",
+ " print(\"Type in your expression(with spaces inbetween): \")\n",
+ " value1, operator, value2=\"3 * 5\".split()\n",
+ " #value1, operator, value2=raw_input().split()\n",
+ " \n",
+ " \n",
+ "except:\n",
+ " print(\"err.. follow the syntax <value operator value>\") \n",
+ " print(\"with spaces inbetween\\n\")\n",
+ "\n",
+ "#parsing\n",
+ "value1,value2=[float(value1), float(value2)]\n",
+ "\n",
+ "#Calculation/Result\n",
+ "if(operator=='+'):\n",
+ " print(\"Answer= {0:.2f}\".format(value1+value2))\n",
+ "elif(operator=='-'):\n",
+ " print(\"Answer= {0:.2f}\".format(value1-value2))\n",
+ "elif(operator=='*'):\n",
+ " print(\"Answer= {0:.2f}\".format(value1*value2))\n",
+ "elif(operator=='/'):\n",
+ " if(value2==0):\n",
+ " print(\"Whoops! divide by 0 issue\")\n",
+ " else:\n",
+ " print(\"Answer= {0:.2f}\".format(value1/value2))\n",
+ "else:\n",
+ " print(\"err.. Invalid operator\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in your expression(with spaces inbetween): \n",
+ "Answer= 15.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 6.10, Page number: 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#6.10.py\n",
+ "#Generating a Table of Prime Numbers\n",
+ "\n",
+ "#Variable declarations\n",
+ "p=2\n",
+ "\n",
+ "#Calculations\n",
+ "while(p<=50): #Outer loop\n",
+ " isPrime=1 #Variable declaration\n",
+ " d=2 \n",
+ " while(d<p): #Inner loop\n",
+ " if(p%d==0):\n",
+ " isPrime=0\n",
+ " d=d+1 #End of inner loop\n",
+ " \n",
+ " if( isPrime!=0):\n",
+ "#Print Result\n",
+ " print \" \",p \n",
+ " p=p+1 #End of outer loop"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 2\n",
+ " 3\n",
+ " 5\n",
+ " 7\n",
+ " 11\n",
+ " 13\n",
+ " 17\n",
+ " 19\n",
+ " 23\n",
+ " 29\n",
+ " 31\n",
+ " 37\n",
+ " 41\n",
+ " 43\n",
+ " 47\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_07.ipynb b/Programming_in_C/Chapter_07.ipynb
new file mode 100644
index 00000000..de714e04
--- /dev/null
+++ b/Programming_in_C/Chapter_07.ipynb
@@ -0,0 +1,489 @@
+{
+ "metadata": {
+ "name": "Chapter VII"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Working with arrays"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.1, Page number: 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.1.py\n",
+ "#Working with an Array(or list in python)\n",
+ "\n",
+ "#Variable/List declaration\n",
+ "values=[0]*10\n",
+ "\n",
+ "#Initialisation/Calculation\n",
+ "values[0]=197\n",
+ "values[2]=-100\n",
+ "values[5]=350\n",
+ "values[3]=values[0]+values[5]\n",
+ "values[9]=values[5]/10\n",
+ "values[2]-=1\n",
+ "i=0\n",
+ "\n",
+ "#Iteration/Result\n",
+ "for index in values:\n",
+ " print(\"values[{0}] = {1}\".format(i,index))\n",
+ " i=i+1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "values[0] = 197\n",
+ "values[1] = 0\n",
+ "values[2] = -101\n",
+ "values[3] = 547\n",
+ "values[4] = 0\n",
+ "values[5] = 350\n",
+ "values[6] = 0\n",
+ "values[7] = 0\n",
+ "values[8] = 0\n",
+ "values[9] = 35\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.2, Page number: 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.2.py\n",
+ "#Demonstrating an Array of Counters\n",
+ "\n",
+ "#variable/List Declaration\n",
+ "ratingCounters=[0]*11\n",
+ "\n",
+ "#Loop-1\n",
+ "for i in range(1,11):\n",
+ " ratingCounters[i]=0\n",
+ "\n",
+ "print(\"Enter your Responses:\")\n",
+ "\n",
+ "#Loop-2\n",
+ "#Clculation\n",
+ "for i in range (1,21):\n",
+ " response=5 #score=5 for all iterations\n",
+ " #response=input()\n",
+ "\n",
+ " if(response<1 or response>10):\n",
+ " print(\"Bad response: {0}\".format(response))\n",
+ " else:\n",
+ " ratingCounters[response]+=1\n",
+ "\n",
+ "#Result\n",
+ "print(\"\\n\\n Rating | Number of Responses\\n\")\n",
+ "print(\" ----- -------------------\")\n",
+ "\n",
+ "#Loop-3\n",
+ "for i in range(1,11):\n",
+ " print(\" {0} {1}\".format(i,ratingCounters[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your Responses:\n",
+ "\n",
+ "\n",
+ " Rating | Number of Responses\n",
+ "\n",
+ " ----- -------------------\n",
+ " 1 0\n",
+ " 2 0\n",
+ " 3 0\n",
+ " 4 0\n",
+ " 5 20\n",
+ " 6 0\n",
+ " 7 0\n",
+ " 8 0\n",
+ " 9 0\n",
+ " 10 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.3, Page number: 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.3.py\n",
+ "#Generating Fibonacci Numbers\n",
+ "\n",
+ "#Variable/List Declaration\n",
+ "Fibonacci=[0]*15\n",
+ "\n",
+ "Fibonacci[0]=0\n",
+ "Fibonacci[1]=1\n",
+ "\n",
+ "#Loop-1\n",
+ "for i in range(2,15):\n",
+ " Fibonacci[i]=Fibonacci[i-2]+Fibonacci[i-1] #Calculation\n",
+ "\n",
+ "#Loop-2\n",
+ "for i in range(15):\n",
+ " print(\"{0}\".format(Fibonacci[i])) #Print Result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n",
+ "1\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "5\n",
+ "8\n",
+ "13\n",
+ "21\n",
+ "34\n",
+ "55\n",
+ "89\n",
+ "144\n",
+ "233\n",
+ "377\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.4, Page number: 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.4.py\n",
+ "#Revising the Program to Generate Prime Numbers,Version 2\n",
+ "\n",
+ "#Variable Declaration\n",
+ "primeIndex=2\n",
+ "primes=[0]*50\n",
+ "\n",
+ "primes[0]=2\n",
+ "primes[1]=3\n",
+ "p=5\n",
+ "\n",
+ "#Calculations\n",
+ "while(p<=50): #Outer Loop-1\n",
+ " isPrime=True\n",
+ " \n",
+ " i=1\n",
+ " while(isPrime and p/primes[i]>=primes[i]): #Inner Loop\n",
+ " if(p%primes[i]==0):\n",
+ " isPrime=False\n",
+ " i+=1\n",
+ " \n",
+ "\n",
+ " if(isPrime==True):\n",
+ " primes[primeIndex]=p\n",
+ " primeIndex+=1\n",
+ " p=p+2\n",
+ "\n",
+ "#Results\n",
+ "for i in range (primeIndex): #Outer Loop-2\n",
+ " print(\"{0}\".format(primes[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n",
+ "3\n",
+ "5\n",
+ "7\n",
+ "11\n",
+ "13\n",
+ "17\n",
+ "19\n",
+ "23\n",
+ "29\n",
+ "31\n",
+ "37\n",
+ "41\n",
+ "43\n",
+ "47\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.5, Page number: 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.5.py\n",
+ "#Initializing Arrays\n",
+ "\n",
+ "#Variable/List Declarations\n",
+ "array_values=[0]*10\n",
+ "array_values[0:4]=[0,1,4,9,16]\n",
+ "\n",
+ "#Calculations\n",
+ "for i in range(5,10):\n",
+ " array_values[i]=i*i\n",
+ "\n",
+ "#Results\n",
+ "for i in range(10):\n",
+ " print(\"array values[{0}] = {1}\".format(i,array_values[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array values[0] = 0\n",
+ "array values[1] = 1\n",
+ "array values[2] = 4\n",
+ "array values[3] = 9\n",
+ "array values[4] = 16\n",
+ "array values[5] = 25\n",
+ "array values[6] = 36\n",
+ "array values[7] = 49\n",
+ "array values[8] = 64\n",
+ "array values[9] = 81\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.6, Page number: 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.6.py\n",
+ "#Introducing Character Arrays\n",
+ "\n",
+ "#Import Library\n",
+ "import sys #For sys.stdout.write()\n",
+ "\n",
+ "#Variable/List Declaration\n",
+ "word=['H','e','l','l','o','!']\n",
+ "\n",
+ "#Iterator/Result\n",
+ "for i in word:\n",
+ " sys.stdout.write(\"{0} \".format(i))\n",
+ "print(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H e l l o ! \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.7, Page number: 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.7.py\n",
+ "#Converting a Positive Integer to Another Base\n",
+ "\n",
+ "#import Library\n",
+ "import sys #for sys.stdout.write()\n",
+ "\n",
+ "#Variable Declarations\n",
+ "baseDigits=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F']\n",
+ "convertedNumber=[0]*10\n",
+ "index=0\n",
+ "\n",
+ "numberToConvert=234 #numberToConvert=input(\"Number to be converted?: \")\n",
+ "base=2 #base=input(\"Base?: \")\n",
+ "\n",
+ "#Calculations\n",
+ "while True:\n",
+ " convertedNumber[index]=numberToConvert%base\n",
+ " index+=1\n",
+ " numberToConvert=numberToConvert/base\n",
+ " if(numberToConvert==0):\n",
+ " break\n",
+ "\n",
+ "#Result\n",
+ "print(\"Converted Number= \")\n",
+ "index-=1\n",
+ "while(index>=0):\n",
+ " nextDigit=convertedNumber[index]\n",
+ " sys.stdout.write(\"{0} \".format(baseDigits[nextDigit]))\n",
+ " index-=1\n",
+ "\n",
+ "print(\"\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Converted Number= \n",
+ "1 1 1 0 1 0 1 0 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 7.8, Page number: 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#7.8.py\n",
+ "#Generating Fibonacci Numbers Using Variable-Length Arrays\n",
+ "\n",
+ "#import Libraries\n",
+ "import sys #For sys.exit() \n",
+ " \n",
+ "#User Input \n",
+ "numFibs=18 #numFibs=input(\"How many Fibonacci numbers do you want (between 1 and 75)? \")\n",
+ "\n",
+ "if(numFibs<1 or numFibs>75):\n",
+ " print(\"bad number,sorry!\")\n",
+ " sys.exit()\n",
+ "\n",
+ "#Variable Declarations \n",
+ "Fibonacci=[0]*numFibs\n",
+ "Fibonacci[0]=0\n",
+ "Fibonacci[1]=1\n",
+ "\n",
+ "#Calculation\n",
+ "for i in range(2,numFibs):\n",
+ " Fibonacci[i]=Fibonacci[i-2]+Fibonacci[i-1] \n",
+ " \n",
+ "#Result\n",
+ "for i in range(numFibs):\n",
+ " print(\"{0}\".format(Fibonacci[i]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n",
+ "1\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "5\n",
+ "8\n",
+ "13\n",
+ "21\n",
+ "34\n",
+ "55\n",
+ "89\n",
+ "144\n",
+ "233\n",
+ "377\n",
+ "610\n",
+ "987\n",
+ "1597\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_08.ipynb b/Programming_in_C/Chapter_08.ipynb
new file mode 100644
index 00000000..a4113d97
--- /dev/null
+++ b/Programming_in_C/Chapter_08.ipynb
@@ -0,0 +1,1061 @@
+{
+ "metadata": {
+ "name": "Chapter VIII"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Working with functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.1, Page number: 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.1.py\n",
+ "#Writing a Function in python\n",
+ "\n",
+ "\n",
+ "def printMessage(): #Function to Print Message\n",
+ " print(\"Programming is Fun.\\n\") #Print Statement\n",
+ "\n",
+ "\n",
+ "def main(): #Main() function\n",
+ " printMessage()\n",
+ "\n",
+ "\n",
+ "if __name__ =='__main__': #Setting Top-level conditional script\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Programming is Fun.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.2, Page number: 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.2.py\n",
+ "#Calling Functions\n",
+ "\n",
+ "\n",
+ "def printMessage(): #Function to Print Message\n",
+ " print(\"Programming is Fun.\\n\") #Print Statement\n",
+ "\n",
+ "\n",
+ "def main(): #Main() function\n",
+ " printMessage() #First Function call\n",
+ " printMessage() #Second Function Call\n",
+ "\n",
+ "if __name__ =='__main__': #Setting Top-level conditional script\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Programming is Fun.\n",
+ "\n",
+ "Programming is Fun.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.3, Page number: 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.3.py\n",
+ "#More on Calling Functions\n",
+ "\n",
+ "\n",
+ "def printMessage(): #Function to Print Message\n",
+ " print(\"Programming is Fun.\\n\") #Print Statement\n",
+ "\n",
+ "\n",
+ "def main(): \n",
+ " for i in range (1,6): #Main() function\n",
+ " printMessage()\n",
+ "\n",
+ "\n",
+ "if __name__ =='__main__': #Setting Top-level script environment\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Programming is Fun.\n",
+ "\n",
+ "Programming is Fun.\n",
+ "\n",
+ "Programming is Fun.\n",
+ "\n",
+ "Programming is Fun.\n",
+ "\n",
+ "Programming is Fun.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.4, Page number: 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.4.py\n",
+ "#Calculating the nth Triangular Number\n",
+ "\n",
+ "\n",
+ "def calculateTriangularNumber(n): #Function to calculate triangular number\n",
+ " triangularNumber=0 #Variable Dclaration\n",
+ " \n",
+ " for i in range (1,n+1): #Calculation/Iteration\n",
+ " triangularNumber+=i\n",
+ " \n",
+ " print(\"Triangular Number {0} is {1}\".format(n,triangularNumber))\n",
+ "\n",
+ "\n",
+ "def main():\n",
+ " calculateTriangularNumber(10) #Function call-1\n",
+ " calculateTriangularNumber(20) #Function call-2\n",
+ " calculateTriangularNumber(50) #Function call-3\n",
+ " \n",
+ "\n",
+ "if __name__=='__main__': #Setting top level conditional script\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Triangular Number 10 is 55\n",
+ "Triangular Number 20 is 210\n",
+ "Triangular Number 50 is 1275\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.5, Page number: 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.5.py\n",
+ "#Revising the Program to Find the Greatest Common Divisor\n",
+ "\n",
+ "#Import Library \n",
+ "import sys \n",
+ "\n",
+ "def gcd(u,v): #Function to calculate gcd\n",
+ " sys.stdout.write(\"gcd of {0} and {1} is: \".format(u,v))\n",
+ " while(v!=0):\n",
+ " temp=u%v\n",
+ " u=v\n",
+ " v=temp\n",
+ " sys.stdout.write(\"{0}\\n\".format(u))\n",
+ "\n",
+ "\n",
+ "\n",
+ "def main(): #Main() function\n",
+ " gcd(150,35) \n",
+ " gcd(1026,405)\n",
+ " gcd(83,240)\n",
+ "\n",
+ "if __name__=='__main__': #Setting Top level conditional script \n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gcd of 150 and 35 is: 5\n",
+ "gcd of 1026 and 405 is: 27\n",
+ "gcd of 83 and 240 is: 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.6, Page number: 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.6.py\n",
+ "#Finding the Greatest Common Divisor and Returning the Results\n",
+ "\n",
+ "#Import Library \n",
+ "import sys \n",
+ "\n",
+ "def gcd(u,v): #Function to calculate gcd\n",
+ "\n",
+ " while(v!=0):\n",
+ " temp=u%v\n",
+ " u=v\n",
+ " v=temp\n",
+ " return u\n",
+ "\n",
+ "def main(): #Main() function\n",
+ " result= gcd(150,35) \n",
+ " print(\"the gcd of 150 and 35 is: {0}\".format(result))\n",
+ " result=gcd(1026,405)\n",
+ " print(\"the gcd of 1026 and 405 is: {0}\".format(result)) \n",
+ " result= gcd(83,240)\n",
+ " print(\"the gcd of 83 and 240 is: {0}\".format(result))\n",
+ "\n",
+ "if __name__=='__main__': #Top level conditional script \n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the gcd of 150 and 35 is: 5\n",
+ "the gcd of 1026 and 405 is: 27\n",
+ "the gcd of 83 and 240 is: 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.7, Page number: 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.7.py\n",
+ "#Calculating the Absolute Value\n",
+ "\n",
+ "#yourstory.in\n",
+ "\n",
+ "#Calculations\n",
+ "def absoluteValue(x): #Function to calculate & return absolute values\n",
+ " if(x<0):\n",
+ " x=-x\n",
+ " return x\n",
+ "\n",
+ "def main(): #Main() Function\n",
+ " \n",
+ " f1=-15.5\n",
+ " f2=20.0\n",
+ " f3=-5.0\n",
+ " il=-716\n",
+ "#Result \n",
+ " result=absoluteValue(f1)\n",
+ " print(\"result= {0:.2f}\".format(result))\n",
+ " print(\"f1={0:.2f}\".format(f1))\n",
+ "\n",
+ " result=absoluteValue(f2)+absoluteValue(f3)\n",
+ " print(\"result= {0:.2f}\".format(result))\n",
+ "\n",
+ " result=absoluteValue(float(il))\n",
+ " print(\"result= {0:.2f}\".format(result))\n",
+ " \n",
+ " result=absoluteValue(il)\n",
+ " print(\"resut= {0:.2f}\".format(result))\n",
+ "\n",
+ " print(\"{0:.2f}\".format(absoluteValue((-6.0)/4)))\n",
+ "\n",
+ "\n",
+ "#End of Main()\n",
+ " \n",
+ "if __name__=='__main__': #Setting Top level conditional script\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "result= 15.50\n",
+ "f1=-15.50\n",
+ "result= 25.00\n",
+ "result= 716.00\n",
+ "resut= 716.00\n",
+ "1.50\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.8, Page number: 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.8.py\n",
+ "#Calculating the Square Root of a Number using Newton-Raphson Method \n",
+ "\n",
+ "\n",
+ "#Function to return absolute value\n",
+ "def absoluteValue(x): \n",
+ " if(x<0):\n",
+ " x=-x\n",
+ " return x\n",
+ "\n",
+ "#function to calculate square root\n",
+ "def squareRoot(x):\n",
+ " epsilon=0.0001\n",
+ " guess=1.0\n",
+ " while(absoluteValue(guess*guess-x)>=epsilon):\n",
+ " guess=(x/guess+guess)/2.0\n",
+ " return guess\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " print(\"squareRoot (2.0) = {0}\".format(squareRoot (2.0)));\n",
+ " print(\"squareRoot (144.0) = {0}\".format(squareRoot (144.0)));\n",
+ " print(\"squareRoot (17.5) = {0}\".format(squareRoot (17.5)));\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "squareRoot (2.0) = 1.41421568627\n",
+ "squareRoot (144.0) = 12.0000000124\n",
+ "squareRoot (17.5) = 4.18330153622\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.9, Page number: 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.9.py\n",
+ "#Finding the Minimum Value in an Array\n",
+ "\n",
+ "#Function to return minimum value\n",
+ "def minimum(values):\n",
+ " minValue=values[0] #Variable Declaration\n",
+ " for i in range (1,10): #Calculation\n",
+ " if(values[i]<minValue):\n",
+ " minValue=values[i]\n",
+ "\n",
+ " return minValue\n",
+ " \n",
+ "#Main()\n",
+ "def main():\n",
+ " scores=[] #Variable Declaration\n",
+ " print(\"Enter 10 scores:\")\n",
+ " for i in range (0,10):\n",
+ " scores.append(5) #score=5 for all cases\n",
+ " #scores.append(input()) \n",
+ "\n",
+ " minScore=minimum(scores) #Function call & assignment\n",
+ " print(\"\\nMinimum score is {0}\\n\".format(minScore)) #Result\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter 10 scores:\n",
+ "\n",
+ "Minimum score is 5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.10, Page number: 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.10.py\n",
+ "#Revising the Function to Find the Minimum Value in an Array\n",
+ "\n",
+ "#Function to return minimum value\n",
+ "def minimum(values,numberOfElements): \n",
+ " minValue=values[0] #Variable Declaration\n",
+ " for i in range(1,numberOfElements): #Iteration/Calculations\n",
+ " if(values[i]<minValue):\n",
+ " minValue=values[i]\n",
+ " \n",
+ " return minValue\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #List/Variable Delcaration\n",
+ " array1 = [ 157, -28, -37, 26, 10 ] \n",
+ " array2 = [ 12, 45, 1, 10, 5, 3, 22 ]\n",
+ " \n",
+ " #Result\n",
+ " print(\"array1 minimum: {0}\".format(minimum (array1, 5)));\n",
+ " print(\"array2 minimum: {0}\".format(minimum (array2, 7)));\n",
+ "\n",
+ "#Setting top level conditional script \n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "array1 minimum: -37\n",
+ "array2 minimum: 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.11, Page number: 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.11.py\n",
+ "#Changing Array Elements in Functions\n",
+ "\n",
+ "#Import System Library\n",
+ "import sys\n",
+ "\n",
+ "#Function to multiply elements by 2\n",
+ "def multiplyBy2(array,n):\n",
+ " for i in range (0,n): #Iteration/Calculation\n",
+ " array[i]*=2\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List/Variable Declaration\n",
+ " floatVals=[1.2, -3.7, 6.2, 8.55] \n",
+ " multiplyBy2(floatVals,4)\n",
+ "\n",
+ " for i in range (0,4):\n",
+ " sys.stdout.write(\"{0:.2f} \".format(floatVals[i])) #Result\n",
+ " print(\"\\n\")\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.40 -7.40 12.40 17.10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.12, Page number: 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.12.py\n",
+ "#\n",
+ "\n",
+ "#Import system Library \n",
+ "import sys\n",
+ "\n",
+ "#Function to sort the array\n",
+ "def sort(a,n):\n",
+ "\n",
+ " for i in range (0,n-1): #Calculations\n",
+ " for j in range (i+1,n):\n",
+ " if(a[i]>a[j]): #Conditional swapping\n",
+ " temp=a[i]\n",
+ " a[i]=a[j]\n",
+ " a[j]=temp\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List/Variable Declaration \n",
+ " array= [ 34, -5, 6, 0, 12, 100, 56, 22,\\\n",
+ " 44, -3, -9, 12, 17, 22, 6, 11 ]\n",
+ " \n",
+ " print(\"The array before the sort:\\n\");\n",
+ " for i in range (0,16):\n",
+ " sys.stdout.write(\"{0} \".format(array[i]))\n",
+ " \n",
+ " sort (array, 16); #Function Call\n",
+ " \n",
+ " print(\"\\n\\n\\nThe array after the sort:\\n\")\n",
+ " for i in range (0,16):\n",
+ " sys.stdout.write(\"{0} \".format(array[i]))\n",
+ " print(\"\\n\")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script \n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The array before the sort:\n",
+ "\n",
+ "34 -5 6 0 12 100 56 22 44 -3 -9 12 17 22 6 11 \n",
+ "\n",
+ "\n",
+ "The array after the sort:\n",
+ "\n",
+ "-9 -5 -3 0 6 6 11 12 12 17 22 22 34 44 56 100 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.13, Page number: 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.13.py\n",
+ "#Using Multidimensional Arrays and Functions\n",
+ "\n",
+ "#Import system Library\n",
+ "import sys\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List/Variable Declaration\n",
+ " sampleMatrix =[ [ 7, 16, 55, 13, 12 ],\n",
+ " [ 12, 10, 52, 0, 7 ],\n",
+ " [ -2, 1, 2, 4, 9 ] ]\n",
+ "\n",
+ "\n",
+ " print(\"Original matrix:\\n\")\n",
+ " displayMatrix(sampleMatrix) #Function call-1\n",
+ "\n",
+ " scalarMultiply(sampleMatrix, 2) #Function Call-2\n",
+ " print(\"\\nMultiplied by 2:\\n\")\n",
+ " \n",
+ " displayMatrix(sampleMatrix); #Function call-3\n",
+ " scalarMultiply(sampleMatrix, -1) #Function call-4\n",
+ " \n",
+ " print(\"\\nThen multiplied by -1:\\n\")\n",
+ " displayMatrix(sampleMatrix) #Function call-5\n",
+ "\n",
+ "\n",
+ "#Function to multiply matrix by a scalar quantity \n",
+ "def scalarMultiply(matrix,scalar):\n",
+ " for row in range(0,3): #Calculation\n",
+ " for column in range(0,5):\n",
+ " matrix[row][column]*=scalar \n",
+ "\n",
+ "\n",
+ "#Function to display the matrix\n",
+ "def displayMatrix(matrix):\n",
+ " for row in range(0,3): #Result\n",
+ " for column in range(0,5):\n",
+ " sys.stdout.write(\"{0:7}\".format(matrix[row][column]))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original matrix:\n",
+ "\n",
+ " 7 16 55 13 12\n",
+ " 12 10 52 0 7\n",
+ " -2 1 2 4 9\n",
+ "\n",
+ "Multiplied by 2:\n",
+ "\n",
+ " 14 32 110 26 24\n",
+ " 24 20 104 0 14\n",
+ " -4 2 4 8 18\n",
+ "\n",
+ "Then multiplied by -1:\n",
+ "\n",
+ " -14 -32 -110 -26 -24\n",
+ " -24 -20 -104 0 -14\n",
+ " 4 -2 -4 -8 -18\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.13A, Page number: 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.13A.py\n",
+ "#Multidimensional Variable-Length Arrays\n",
+ "\n",
+ "#Import system Library\n",
+ "import sys\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List/Variable Declaration\n",
+ " sampleMatrix =[ [ 7, 16, 55, 13, 12 ],\n",
+ " [ 12, 10, 52, 0, 7 ],\n",
+ " [ -2, 1, 2, 4, 9 ] ]\n",
+ "\n",
+ "\n",
+ " print(\"Original matrix:\\n\")\n",
+ " displayMatrix(3,5,sampleMatrix) #Function call-1\n",
+ "\n",
+ " scalarMultiply(3,5,sampleMatrix, 2) #Function Call-2\n",
+ " print(\"\\nMultiplied by 2:\\n\")\n",
+ " \n",
+ " displayMatrix(3,5,sampleMatrix); #Function call-3\n",
+ " scalarMultiply(3,5,sampleMatrix, -1) #Function call-4\n",
+ " \n",
+ " print(\"\\nThen multiplied by -1:\\n\")\n",
+ " displayMatrix(3,5,sampleMatrix) #Function call-5\n",
+ "\n",
+ "\n",
+ "#Function to multiply matrix by a scalar quantity \n",
+ "def scalarMultiply(nRows,nCols,matrix,scalar):\n",
+ " for row in range(0,nRows): #Calculation\n",
+ " for column in range(0,nCols):\n",
+ " matrix[row][column]*=scalar \n",
+ "\n",
+ "\n",
+ "#Function to display the matrix\n",
+ "def displayMatrix(nRows,nCols,matrix):\n",
+ " for row in range(0,nRows): #Result\n",
+ " for column in range(0,nCols):\n",
+ " sys.stdout.write(\"{0:7}\".format(matrix[row][column]))\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Original matrix:\n",
+ "\n",
+ " 7 16 55 13 12\n",
+ " 12 10 52 0 7\n",
+ " -2 1 2 4 9\n",
+ "\n",
+ "Multiplied by 2:\n",
+ "\n",
+ " 14 32 110 26 24\n",
+ " 24 20 104 0 14\n",
+ " -4 2 4 8 18\n",
+ "\n",
+ "Then multiplied by -1:\n",
+ "\n",
+ " -14 -32 -110 -26 -24\n",
+ " -24 -20 -104 0 -14\n",
+ " 4 -2 -4 -8 -18\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.14, Page number: 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.14.py\n",
+ "#Converting a Positive Integer to Another Base\n",
+ "\n",
+ "#Import system Libraries\n",
+ "import sys\n",
+ "\n",
+ "#Function to get Number & Base\n",
+ "def getNumberAndBase():\n",
+ " \n",
+ " #Global Reference\n",
+ " global digit\n",
+ " global numberToConvert\n",
+ " global base\n",
+ " \n",
+ " #Variable Declaration\n",
+ " digit=0\n",
+ " numberToConvert=420 #numberToConvert=input(\"Number to be converted ?\")\n",
+ " base=8 #base=input(\"Base?\")\n",
+ " if(base<2 or base>16):\n",
+ " print(\"Bad base - must be between 2 and 16\\n\");\n",
+ " base = 10;\n",
+ "\n",
+ "#Conversion Function\n",
+ "def convertNumber():\n",
+ " \n",
+ " #Global Reference\n",
+ " global numberToConvert\n",
+ " global base\n",
+ " global convertedNumber\n",
+ " global digit\n",
+ " convertedNumber=[0]*64 #List declaration\n",
+ " \n",
+ " while(numberToConvert!=0):\n",
+ " convertedNumber[digit]=numberToConvert%base #Calculations\n",
+ " digit=digit+1\n",
+ " numberToConvert/=base\n",
+ "\n",
+ "\n",
+ "#Function to display\n",
+ "def displayConvertedNumber():\n",
+ "\n",
+ " #Global reference \n",
+ " global baseDigits\n",
+ " global digit \n",
+ "\n",
+ " #List/Variable Declaration\n",
+ " baseDigits=[ '0', '1', '2', '3', '4', '5', '6', '7',\\\n",
+ " '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' ]\n",
+ " sys.stdout.write(\"Converted number = \")\n",
+ " \n",
+ " digit=digit-1\n",
+ "\n",
+ " for i in range(digit,-1,-1):\n",
+ " nextDigit = convertedNumber[i];\n",
+ " sys.stdout.write(\"{0}\".format(baseDigits[nextDigit])); #Result\n",
+ "\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " getNumberAndBase() #Function call-1\n",
+ " convertNumber() #Function call-2\n",
+ " displayConvertedNumber() #Function call-3\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Converted number = 644\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.15, Page number: 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.15.py\n",
+ "#Illustrating Static and Automatic Variables\n",
+ "\n",
+ "\n",
+ "#Function to display variables\n",
+ "def auto_static():\n",
+ " global staticVar #Global reference\n",
+ " autoVar=1 #variable Declaration\n",
+ " print(\"automatic = {0}, static = {1}\\n\".format(autoVar,staticVar)); #Result\n",
+ " \n",
+ " #Calculation \n",
+ " autoVar+=1\n",
+ " staticVar+=1\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " global staticVar\n",
+ " staticVar=1 #Variable Declaration\n",
+ " for i in range(0,5):\n",
+ " auto_static()\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "automatic = 1, static = 1\n",
+ "\n",
+ "automatic = 1, static = 2\n",
+ "\n",
+ "automatic = 1, static = 3\n",
+ "\n",
+ "automatic = 1, static = 4\n",
+ "\n",
+ "automatic = 1, static = 5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 8.16, Page number: 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#8.16.py\n",
+ "#Calculating Factorials Recursively\n",
+ "\n",
+ "#Function to calculate factorial\n",
+ "def factorial(n):\n",
+ " if( n == 0 ): #Calculation\n",
+ " result = 1\n",
+ " else:\n",
+ " result = n * factorial (n - 1)\n",
+ " return result;\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " for j in range (0,11):\n",
+ " print(\"{0:3}! = {1}\\n\".format(j,factorial (j)))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 0! = 1\n",
+ "\n",
+ " 1! = 1\n",
+ "\n",
+ " 2! = 2\n",
+ "\n",
+ " 3! = 6\n",
+ "\n",
+ " 4! = 24\n",
+ "\n",
+ " 5! = 120\n",
+ "\n",
+ " 6! = 720\n",
+ "\n",
+ " 7! = 5040\n",
+ "\n",
+ " 8! = 40320\n",
+ "\n",
+ " 9! = 362880\n",
+ "\n",
+ " 10! = 3628800\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_09.ipynb b/Programming_in_C/Chapter_09.ipynb
new file mode 100644
index 00000000..684317a5
--- /dev/null
+++ b/Programming_in_C/Chapter_09.ipynb
@@ -0,0 +1,594 @@
+{
+ "metadata": {
+ "name": "Chapter IX"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Working with structures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.1, Page number: 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.1.py\n",
+ "#Illustrating a Structure/Class in python\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Class Declaration\n",
+ " class date:\n",
+ " 'python classes are equivalent to C structures'\n",
+ " def __init__(self): #Class Constructor\n",
+ " #Set default values\n",
+ " self.month=0\n",
+ " self.day=0\n",
+ " self.year=0\n",
+ "\n",
+ "\n",
+ " #Creating instance\n",
+ " today=date() \n",
+ " \n",
+ " #Modifying values\n",
+ " today.month=9 \n",
+ " today.day=25\n",
+ " today.year=2004\n",
+ "\n",
+ " #Result\n",
+ " print(\"Today's date is {0}/{1}/{2}\".format(today.month,today.day,today.year%100));\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Today's date is 9/25/4\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.2, Page number: 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.2.py\n",
+ "#Determining Tomorrows Date\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #Class Declaration\n",
+ " class date:\n",
+ " def __init__(self): #Class Constructor\n",
+ " #Default values\n",
+ " month=0\n",
+ " day=0\n",
+ " year=0\n",
+ " #creating instances\n",
+ " today=date()\n",
+ " tomorrow=date()\n",
+ "\n",
+ " #List Declaration\n",
+ " daysPerMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]\n",
+ " \n",
+ " print(\"Enter today's date (mm/dd/yyyy):\")\n",
+ " today.month,today.day,today.year=map(int,\"12/17/2004\".split('/'))\n",
+ " #today.month,today.day,today.year=map(int,raw_input().split('/'))\n",
+ "\n",
+ " #Calculations\n",
+ " if( today.day != daysPerMonth[today.month - 1] ):\n",
+ " tomorrow.day = today.day + 1;\n",
+ " tomorrow.month = today.month;\n",
+ " tomorrow.year = today.year;\n",
+ " elif( today.month == 12 ):\n",
+ " tomorrow.day = 1;\n",
+ " tomorrow.month = 1;\n",
+ " tomorrow.year = today.year + 1;\n",
+ " else:\n",
+ " tomorrow.day = 1;\n",
+ " tomorrow.month = today.month + 1;\n",
+ " tomorrow.year = today.year;\n",
+ "\n",
+ " #Result\n",
+ " print(\"Tomorrow's date is {0}/{1}/{2}\\n\".format(tomorrow.month,tomorrow.day,tomorrow.year));\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter today's date (mm/dd/yyyy):\n",
+ "Tomorrow's date is 12/18/2004\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.3, Page number: 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.3.py\n",
+ "#Revising the Program to Determine Tomorrow's Date\n",
+ "\n",
+ "#Class Declaration\n",
+ "class date:\n",
+ " def __init__(self): #Class Constructor\n",
+ " #Default values\n",
+ " month=0\n",
+ " day=0\n",
+ " year=0\n",
+ " \n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #creating instances\n",
+ " today=date()\n",
+ " tomorrow=date()\n",
+ "\n",
+ " print(\"Enter today's date (mm/dd/yyyy):\")\n",
+ " today.month,today.day,today.year=map(int,\"2/28/2004\".split('/'))\n",
+ " #today.month,today.day,today.year=map(int,raw_input().split('/'))\n",
+ "\n",
+ " #Calculations\n",
+ " if( today.day != numberOfDays(today) ):\n",
+ " tomorrow.day = today.day + 1;\n",
+ " tomorrow.month = today.month;\n",
+ " tomorrow.year = today.year;\n",
+ " elif( today.month == 12 ):\n",
+ " tomorrow.day = 1;\n",
+ " tomorrow.month = 1;\n",
+ " tomorrow.year = today.year + 1;\n",
+ " else:\n",
+ " tomorrow.day = 1;\n",
+ " tomorrow.month = today.month + 1;\n",
+ " tomorrow.year = today.year;\n",
+ "\n",
+ " #Result\n",
+ " print(\"Tomorrow's date is {0}/{1}/{2}\\n\".format(tomorrow.month,tomorrow.day,tomorrow.year));\n",
+ "\n",
+ "\n",
+ "#Function to find the number of days in a month \n",
+ "def numberOfDays(d):\n",
+ " \n",
+ " #List Declaration\n",
+ " daysPerMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]\n",
+ " if(isLeapYear(d)==True and d.month==2):\n",
+ " days=29\n",
+ " else:\n",
+ " days = daysPerMonth[d.month - 1];\n",
+ "\n",
+ " return days\n",
+ "\n",
+ "\n",
+ "#Function to determine if it's a leap year\n",
+ "def isLeapYear(d):\n",
+ " if ( (d.year % 4 == 0 and d.year % 100 != 0) or d.year % 400 == 0 ):\n",
+ " leapYearFlag = True # Its a leap year\n",
+ " else:\n",
+ " leapYearFlag = False # Not a leap year\n",
+ " \n",
+ " return leapYearFlag;\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter today's date (mm/dd/yyyy):\n",
+ "Tomorrow's date is 2/29/2004\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.4, Page number: 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.4.py\n",
+ "#Revising the Program to Determine Tomorrow's Date--Version 2\n",
+ "\n",
+ "#Class Declaration\n",
+ "class date:\n",
+ " def __init__(self): #Class Constructor\n",
+ " #Default values\n",
+ " month=0\n",
+ " day=0\n",
+ " year=0\n",
+ " \n",
+ " def dateUpdate(self,today):\n",
+ " #Calculations \n",
+ " tomorrow=date()\n",
+ " if( today.day != numberOfDays(today) ):\n",
+ " tomorrow.day = today.day + 1;\n",
+ " tomorrow.month = today.month;\n",
+ " tomorrow.year = today.year;\n",
+ " elif( today.month == 12 ):\n",
+ " tomorrow.day = 1;\n",
+ " tomorrow.month = 1;\n",
+ " tomorrow.year = today.year + 1;\n",
+ " else:\n",
+ " tomorrow.day = 1;\n",
+ " tomorrow.month = today.month + 1;\n",
+ " tomorrow.year = today.year;\n",
+ " \n",
+ " return tomorrow\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #creating instances\n",
+ " thisDay=date()\n",
+ " nextDay=date()\n",
+ " \n",
+ " print(\"Enter today's date (mm/dd/yyyy):\")\n",
+ " thisDay.month,thisDay.day,thisDay.year=map(int,\"2/22/2004\".split('/'))\n",
+ " #thisDay.month,thisDay.day,thisDay.year=map(int,raw_input().split('/'))\n",
+ " nextDay=thisDay.dateUpdate(thisDay)\n",
+ "\n",
+ " #Result\n",
+ " print(\"Tomorrow's date is {0}/{1}/{2}\\n\".format(nextDay.month,nextDay.day,nextDay.year));\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Function to find the number of days in a month \n",
+ "def numberOfDays(d):\n",
+ " \n",
+ " #List Declaration\n",
+ " daysPerMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]\n",
+ " if(isLeapYear(d)==True and d.month==2):\n",
+ " days=29\n",
+ " else:\n",
+ " days = daysPerMonth[d.month - 1];\n",
+ "\n",
+ " return days\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Function to determine if it's a leap year\n",
+ "def isLeapYear(d):\n",
+ " if ( (d.year % 4 == 0 and d.year % 100 != 0) or d.year % 400 == 0 ):\n",
+ " leapYearFlag = True # Its a leap year\n",
+ " else:\n",
+ " leapYearFlag = False # Not a leap year\n",
+ " \n",
+ " return leapYearFlag;\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter today's date (mm/dd/yyyy):\n",
+ "Tomorrow's date is 2/23/2004\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.5, Page number: 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.5.py\n",
+ "#Updating the Time by One Second\n",
+ "\n",
+ "#Class Declaration\n",
+ "class time:\n",
+ " def __init__(self):\n",
+ " hour=0\n",
+ " minutes=0\n",
+ " seconds=0\n",
+ " def timeUpdate(self,now):\n",
+ " #Calculation\n",
+ " now.seconds+=1\n",
+ " if ( now.seconds == 60): #next minute\n",
+ " now.seconds = 0\n",
+ " now.minutes+=1 \n",
+ " if ( now.minutes == 60 ): #next hour\n",
+ " now.minutes = 0\n",
+ " now.hour+=1;\n",
+ " if ( now.hour == 24 ): # midnight\n",
+ " now.hour = 0\n",
+ " \n",
+ "\n",
+ " return now\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #Creating instances\n",
+ " currentTime=time()\n",
+ " nextTime=time()\n",
+ " #User Input\n",
+ " print(\"Enter the time (hh:mm:ss):\")\n",
+ " currentTime.hour,currentTime.minutes,currentTime.seconds=map(int,\"16:14:59\".split(':'))\n",
+ " #currentTime.hour,currentTime.minutes,currentTime.seconds=map(int,raw_input().split(':'))\n",
+ " \n",
+ " nextTime =currentTime.timeUpdate (currentTime);\n",
+ " \n",
+ " #Result\n",
+ " print(\"Updated time is {0}:{1}:{2}\\n\".format(nextTime.hour,nextTime.minutes,nextTime.seconds))\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the time (hh:mm:ss):\n",
+ "Updated time is 16:15:0\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.6, Page number: 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.6.py\n",
+ "#Illustrating Arrays of Structures\n",
+ "\n",
+ "#Import sys Library\n",
+ "import sys\n",
+ "\n",
+ "#Class Declaration\n",
+ "class time:\n",
+ " def __init__(self,h,m,s):\n",
+ " #Variable Declarations\n",
+ " self.hour=h\n",
+ " self.minutes=m\n",
+ " self.seconds=s\n",
+ " def timeUpdate(self,now):\n",
+ " #Calculation\n",
+ " now.seconds+=1\n",
+ " if ( now.seconds == 60): #next minute\n",
+ " now.seconds = 0\n",
+ " now.minutes+=1 \n",
+ " if ( now.minutes == 60 ): #next hour\n",
+ " now.minutes = 0\n",
+ " now.hour+=1;\n",
+ " if ( now.hour == 24 ): # midnight\n",
+ " now.hour = 0\n",
+ " \n",
+ "\n",
+ " return now\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #Creating instances\n",
+ " testTimes = []\n",
+ " testTimes.append(time(11,59,59))\n",
+ " testTimes.append(time(12,0,0))\n",
+ " testTimes.append(time(1,29,59))\n",
+ " testTimes.append(time(23,59,59))\n",
+ " testTimes.append(time(19,12,27))\n",
+ "\n",
+ " #Result\n",
+ " for i in range(0,5):\n",
+ " \n",
+ " sys.stdout.write(\"Time is {0:2}:{1:2}:{2:2} \".format(testTimes[i].hour,testTimes[i].minutes,testTimes[i].seconds))\n",
+ "\n",
+ " nextTime =testTimes[i].timeUpdate(testTimes[i])\n",
+ " \n",
+ " \n",
+ " sys.stdout.write(\"...one second later it's {0:2}:{1:2}:{2:2}\\n\".format(testTimes[i].hour,testTimes[i].minutes,testTimes[i].seconds))\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time is 11:59:59 ...one second later it's 12: 0: 0\n",
+ "Time is 12: 0: 0 ...one second later it's 12: 0: 1\n",
+ "Time is 1:29:59 ...one second later it's 1:30: 0\n",
+ "Time is 23:59:59 ...one second later it's 0: 0: 0\n",
+ "Time is 19:12:27 ...one second later it's 19:12:28\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 9.7, Page number: 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#9.7.py\n",
+ "#Illustrating Structures and Arrays\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #Class Declaration\n",
+ " class month:\n",
+ " def __init__(self,n,na): #Class Constructor\n",
+ " self.numberOfDays=n\n",
+ " self.name=na\n",
+ "\n",
+ " #List Declaration\n",
+ " months=[]\n",
+ " months.append(month(31,['j','a','n']))\n",
+ " months.append(month(28,['f','e','b']))\n",
+ " months.append(month(31,['m','a','r']))\n",
+ " months.append(month(30,['a','p','r']))\n",
+ " months.append(month(31,['m','a','y']))\n",
+ " months.append(month(30,['j','u','n']))\n",
+ " months.append(month(31,['j','u','l']))\n",
+ " months.append(month(31,['a','u','g']))\n",
+ " months.append(month(30,['s','e','p']))\n",
+ " months.append(month(31,['o','c','t']))\n",
+ " months.append(month(30,['n','o','v']))\n",
+ " months.append(month(31,['d','e','c']))\n",
+ " \n",
+ " \n",
+ " #Result\n",
+ " print(\"Month NumberOfDays\")\n",
+ " print(\"----- ------------\")\n",
+ " for i in range (0,12):\n",
+ " print(\"{0}{1}{2} {3}\\n\".format(months[i].name[0],months[i].name[1],months[i].name[2], months[i].numberOfDays))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Month NumberOfDays\n",
+ "----- ------------\n",
+ "jan 31\n",
+ "\n",
+ "feb 28\n",
+ "\n",
+ "mar 31\n",
+ "\n",
+ "apr 30\n",
+ "\n",
+ "may 31\n",
+ "\n",
+ "jun 30\n",
+ "\n",
+ "jul 31\n",
+ "\n",
+ "aug 31\n",
+ "\n",
+ "sep 30\n",
+ "\n",
+ "oct 31\n",
+ "\n",
+ "nov 30\n",
+ "\n",
+ "dec 31\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_10.ipynb b/Programming_in_C/Chapter_10.ipynb
new file mode 100644
index 00000000..1ec5bf12
--- /dev/null
+++ b/Programming_in_C/Chapter_10.ipynb
@@ -0,0 +1,768 @@
+{
+ "metadata": {
+ "name": "Chapter X"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10: Character strings"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.1, Page number: 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.1.py\n",
+ "#Concatenating Character Arrays\n",
+ "\n",
+ "#Import system library\n",
+ "import sys\n",
+ "\n",
+ "#Function to concatinate strings\n",
+ "def concat(result,str1,n1,str2,n2): #Calculations\n",
+ " \n",
+ " #copy str1 to result\n",
+ " for i in range(0,n1):\n",
+ " result[i]=str1[i]\n",
+ " \n",
+ " #copy str2 to result \n",
+ " for j in range(0,n2):\n",
+ " result[n1+j]=str2[j]\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List Declaration\n",
+ " s1 = [ 'T', 'e', 's', 't', ' ']\n",
+ " s2 = [ 'w', 'o', 'r', 'k', 's', '.' ]\n",
+ " s3=[0]*11\n",
+ "\n",
+ " concat(s3,s1,5,s2,6) #Fucntion call\n",
+ "\n",
+ " for i in range(0,11): #Result\n",
+ " sys.stdout.write(\"{0}\".format(s3[i]))\n",
+ "\n",
+ " sys.stdout.write(\"\\n\")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Test works.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.2, Page number: 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.2.py\n",
+ "#Counting the Characters in a String\n",
+ "\n",
+ "\n",
+ "#FUnction to count number of characters ina string\n",
+ "def stringLength(string):\n",
+ " count = 0\n",
+ " while(string[count]!='\\0'): #Calculation\n",
+ " count+=1\n",
+ " return count\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List Declaration\n",
+ " word1 = [ 'a', 's', 't', 'e', 'r', '\\0' ]\n",
+ " word2 = [ 'a', 't', '\\0' ]\n",
+ " word3 = [ 'a', 'w', 'e', '\\0' ]\n",
+ "\n",
+ " #Result\n",
+ " print(\"{0} {1} {2}\\n\".format(stringLength (word1),stringLength (word2),stringLength (word3)))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5 2 3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.3, Page number: 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.3.py\n",
+ "#Concatenating Character Strings\n",
+ "\n",
+ "\n",
+ "#Function to concatinate strings\n",
+ "def concat(result,str1,str2): #Calculations\n",
+ " \n",
+ " #copy str1 to result\n",
+ " for i in str1:\n",
+ " result.append(i)\n",
+ " \n",
+ " #copy str2 to result \n",
+ " for j in str2:\n",
+ " result.append(j)\n",
+ " \n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #String Declaration\n",
+ " s1 = \"Test \"\n",
+ " s2 = \"works.\"\n",
+ " s3=[]\n",
+ "\n",
+ " concat(s3,s1,s2) #Fucntion call\n",
+ " print(''.join(s3)) #Result\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Test works.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.4, Page number: 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.4.py\n",
+ "#Testing Strings for Equality\n",
+ "\n",
+ "#Function to compare 2 strings\n",
+ "def equalStrings(s1,s2):\n",
+ " \n",
+ " #Calculation\n",
+ " if(s1==s2):\n",
+ " areEqual=True\n",
+ " else:\n",
+ " areEqual=False\n",
+ " return areEqual\n",
+ "\n",
+ "\n",
+ "\n",
+ "def main():\n",
+ "\n",
+ " #String Declaration\n",
+ " stra = \"string compare test\";\n",
+ " strb = \"string\";\n",
+ "\n",
+ " #Result\n",
+ " print(\"{0}\".format(equalStrings (stra, strb)))\n",
+ " print(\"{0}\".format(equalStrings (stra, stra)))\n",
+ " print(\"{0}\".format(equalStrings (strb, \"string\")))\n",
+ "\n",
+ "\n",
+ "#Setting top level confditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "False\n",
+ "True\n",
+ "True\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.5, Page number: 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.5.py\n",
+ "#Reading Strings\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " print(\"Enter Text:\\n\")\n",
+ "\n",
+ " #User Input\n",
+ " s1,s2,s3=map(str,\"System expansion bus\".split())\n",
+ " #s1,s2,s3=map(str,raw_input().split())\n",
+ " \n",
+ " \n",
+ " #Result\n",
+ " print(\"\\ns1={0}\\ns2={1}\\ns3={2}\\n\".format(s1,s2,s3))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Text:\n",
+ "\n",
+ "\n",
+ "s1=System\n",
+ "s2=expansion\n",
+ "s3=bus\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.6, Page number: 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.6.py\n",
+ "#Reading Lines of Data\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List declaration\n",
+ " line=['sample text']\n",
+ " for i in range(0,3):\n",
+ " readLine(line) #Function call\n",
+ " print(\"{0}\\n\".format(''.join(line))) #Result\n",
+ "\n",
+ "\n",
+ "#Function to read user input\n",
+ "def readLine(line):\n",
+ " \n",
+ " line.pop()\n",
+ " line.append(\"This is a sample line of text\"+\" \")\n",
+ " #line.append(raw_input()+\" \")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This is a sample line of text \n",
+ "\n",
+ "This is a sample line of text \n",
+ "\n",
+ "This is a sample line of text \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.7, Page number: 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.7.py\n",
+ "#Counting Words\n",
+ "\n",
+ "#Function to determine if a character is alphabetic\n",
+ "def alphabetic(c):\n",
+ " if ( (c >= 'a' and c <= 'z') or (c >= 'A' and c <= 'Z') ):\n",
+ " return True\n",
+ " else:\n",
+ " return False\n",
+ "\n",
+ "\n",
+ "#Function to count the number of words in a string\n",
+ "def countWords(string):\n",
+ " \n",
+ " #Variable Declaration\n",
+ " wordCount=0\n",
+ " lookingForWord=True\n",
+ " \n",
+ " #Calculations\n",
+ " for i in string:\n",
+ " if(alphabetic(i)):\n",
+ " if(lookingForWord):\n",
+ " wordCount+=1\n",
+ " lookingForWord=False\n",
+ " else:\n",
+ " lookingForWord=True\n",
+ " return wordCount\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #String Declaration\n",
+ " text1 = \"Well, here goes.\"\n",
+ " text2 = \"And here we go... again.\"\n",
+ " \n",
+ " #Result\n",
+ " print(\"{0} - words = {1}\\n\".format(text1,countWords(text1)))\n",
+ " print(\"{0} - words = {1}\\n\".format(text2,countWords(text2)))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Well, here goes. - words = 3\n",
+ "\n",
+ "And here we go... again. - words = 5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.8, Page number: 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.8.py\n",
+ "#Counting Words in a Piece of Text\n",
+ "\n",
+ "\n",
+ "#Function to read a piece of text\n",
+ "def readLine(line):\n",
+ " \n",
+ " line.pop()\n",
+ " line.append(\"This is a dummy text to replace raw_input()\"+\" \")\n",
+ " #line.append(raw_input()+\" \")\n",
+ "\n",
+ "\n",
+ "#Function to determine if a character is alphabetic\n",
+ "def alphabetic(c):\n",
+ " if ( (c >= 'a' and c <= 'z') or (c >= 'A' and c <= 'Z') ):\n",
+ " return True\n",
+ " else:\n",
+ " return False\n",
+ "\n",
+ "\n",
+ "#Function to count the number of words in a string\n",
+ "def countWords(string):\n",
+ " \n",
+ " #Variable Declaration\n",
+ " wordCount=0\n",
+ " lookingForWord=True\n",
+ " \n",
+ " #Calculations\n",
+ " for i in string:\n",
+ " if(alphabetic(i)):\n",
+ " if(lookingForWord):\n",
+ " wordCount+=1\n",
+ " lookingForWord=False\n",
+ " else:\n",
+ " lookingForWord=True\n",
+ " return wordCount\n",
+ "\n",
+ "\n",
+ "\n",
+ "def main():\n",
+ " #Variable Declaration\n",
+ " totalWords=0\n",
+ " endOfText=False\n",
+ " text=['sample']\n",
+ "\n",
+ " print(\"Type in your text.\\n\")\n",
+ " print(\"When you are done, press 'RETURN'.\\n\\n\")\n",
+ " \n",
+ " readLine (text)\n",
+ " \n",
+ " #Increment Counter\n",
+ " totalWords += countWords(''.join(text))\n",
+ " \n",
+ " #Result\n",
+ " print(\"\\nThere are {0} words in the above text.\\n\".format(totalWords))\n",
+ "\n",
+ "\n",
+ "#Top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Type in your text.\n",
+ "\n",
+ "When you are done, press 'RETURN'.\n",
+ "\n",
+ "\n",
+ "\n",
+ "There are 9 words in the above text.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.9, Page number: 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.9.py\n",
+ "#Using the Dictionary Lookup Program\n",
+ "\n",
+ "#Class Declaration\n",
+ "class entry:\n",
+ " def __init__(self,w,d):\n",
+ " self.word=w\n",
+ " self.definition=d\n",
+ "\n",
+ "\n",
+ "#Function to check equality of two strings\n",
+ "def equalStrings(str1,str2):\n",
+ " if(str1==str2):\n",
+ " return True\n",
+ " else:\n",
+ " return False\n",
+ "\n",
+ "#Lookup function to return dictionary entry\n",
+ "def lookup(dictionary,search,entries):\n",
+ " for i in range(0,entries):\n",
+ " if ( equalStrings(search, dictionary[i].word) ):\n",
+ " return i;\n",
+ " return -1;\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " entries=10\n",
+ " global entry\n",
+ " dictionary=[]\n",
+ " \n",
+ " dictionary.append(entry(\"aardvark\",\"a burrowing African mammal\"))\n",
+ " dictionary.append(entry(\"abyss\",\"a bottomless pit\"))\n",
+ " dictionary.append(entry(\"acumen\",\"mentally sharp keen\"))\n",
+ " dictionary.append(entry(\"addle\",\"to become confused\"))\n",
+ " dictionary.append(entry(\"aerie\",\"a high nest\"))\n",
+ " dictionary.append(entry(\"affix\",\"to append; attach\"))\n",
+ " dictionary.append(entry(\"agar\",\"a jelly made from seaweed\"))\n",
+ " dictionary.append(entry(\"ahoy\",\"nautical call of greeting\"))\n",
+ " dictionary.append(entry(\"aigrette\",\"an ornamental cluster of feathers\"))\n",
+ " dictionary.append(entry(\"ajar\",\"partially opened\"))\n",
+ "\n",
+ "\n",
+ " print(\"Enter word:\")\n",
+ " word='ajar' #word=raw_input()\n",
+ " entry=lookup(dictionary,word,entries)\n",
+ "\n",
+ " #Result\n",
+ " if(entry!=-1):\n",
+ " print(\"{0}\".format(dictionary[entry].definition))\n",
+ " else:\n",
+ " print(\"Sorry, the word {0} is not in my dictionary.\\n\".format(word))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter word:\n",
+ "partially opened\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.10, Page number: 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.10.py\n",
+ "#Modifying the Dictionary Lookup Using Binary Search\n",
+ "\n",
+ "#Class Declaration\n",
+ "class entry:\n",
+ " def __init__(self,w,d): #Class constructor\n",
+ " self.word=w\n",
+ " self.definition=d\n",
+ "\n",
+ "\n",
+ "#Function to compare two strings\n",
+ "def compareStrings(s1,s2):\n",
+ "\n",
+ " #Calculations\n",
+ " if( s1 < s2 ):\n",
+ " answer = -1;\n",
+ " elif( s1 == s2 ):\n",
+ " answer = 0;\n",
+ " else:\n",
+ " answer=1\n",
+ "\n",
+ " return answer\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Lookup function to return dictionary entry\n",
+ "def lookup(dictionary,search,entries):\n",
+ " \n",
+ " #Variable Declaration\n",
+ " low=0\n",
+ " high=entries-1\n",
+ "\n",
+ " #Calculations\n",
+ " while(low<=high):\n",
+ " mid=(low+high)/2\n",
+ " result=compareStrings(dictionary[mid].word,search)\n",
+ "\n",
+ " if(result==-1):\n",
+ " low=mid+1\n",
+ " elif(result==1):\n",
+ " high=mid-1\n",
+ " else:\n",
+ " return mid\n",
+ "\n",
+ " return -1\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " entries=10\n",
+ " global entry\n",
+ " dictionary=[]\n",
+ " \n",
+ " dictionary.append(entry(\"aardvark\",\"a burrowing African mammal\"))\n",
+ " dictionary.append(entry(\"abyss\",\"a bottomless pit\"))\n",
+ " dictionary.append(entry(\"acumen\",\"mentally sharp keen\"))\n",
+ " dictionary.append(entry(\"addle\",\"to become confused\"))\n",
+ " dictionary.append(entry(\"aerie\",\"a high nest\"))\n",
+ " dictionary.append(entry(\"affix\",\"to append; attach\"))\n",
+ " dictionary.append(entry(\"agar\",\"a jelly made from seaweed\"))\n",
+ " dictionary.append(entry(\"ahoy\",\"nautical call of greeting\"))\n",
+ " dictionary.append(entry(\"aigrette\",\"an ornamental cluster of feathers\"))\n",
+ " dictionary.append(entry(\"ajar\",\"partially opened\"))\n",
+ "\n",
+ " print(\"Enter word:\")\n",
+ " word='ahoy' #word=raw_input()\n",
+ " entry=lookup(dictionary,word,entries)\n",
+ "\n",
+ " #Result\n",
+ " if(entry!=-1):\n",
+ " print(\"{0}\".format(dictionary[entry].definition))\n",
+ " else:\n",
+ " print(\"Sorry, the word {0} is not in my dictionary.\\n\".format(word))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter word:\n",
+ "nautical call of greeting\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 10.11, Page number: 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#10.11.py\n",
+ "#Converting a String to its Integer Equivalent\n",
+ "\n",
+ "\n",
+ "#Function to convert a string to an integer\n",
+ "def strToInt(string):\n",
+ " \n",
+ " return int(string)\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Result\n",
+ " print(\"{0}\\n\".format(strToInt(\"245\")))\n",
+ " print(\"{0}\\n\".format(strToInt(\"100\") + 25))\n",
+ " print(\"{0}\\n\".format(strToInt(\"13\")))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "245\n",
+ "\n",
+ "125\n",
+ "\n",
+ "13\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_11.ipynb b/Programming_in_C/Chapter_11.ipynb
new file mode 100644
index 00000000..a010bcdb
--- /dev/null
+++ b/Programming_in_C/Chapter_11.ipynb
@@ -0,0 +1,842 @@
+{
+ "metadata": {
+ "name": "Chapter XI"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: Pointers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.1, Page number: 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.1.py\n",
+ "#Illustrating Pointers\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " count=10\n",
+ " \n",
+ " int_ptr=count\n",
+ " x=int_ptr\n",
+ " \n",
+ " #Result\n",
+ " print(\"count={0} , x={1}\".format(count,x))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "count=10 , x=10\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.2, Page number: 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.2.py\n",
+ "#More Pointer Basics\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " c='Q'\n",
+ " char_pointer=c\n",
+ " print(\"{0} {1}\".format(c,char_pointer))\n",
+ "\n",
+ " c='/'\n",
+ " char_pointer=c\n",
+ " print(\"{0} {1}\".format(c,char_pointer))\n",
+ "\n",
+ " char_pointer='('\n",
+ " c=char_pointer\n",
+ " print(\"{0} {1}\".format(c,char_pointer))\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q Q\n",
+ "/ /\n",
+ "( (\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.3, Page number: 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.3\n",
+ "#Using Pointers in Expressions\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " i1=5\n",
+ " p1=i1\n",
+ " i2=p1/2+10\n",
+ " p2=p1\n",
+ "\n",
+ " #Result\n",
+ " print(\"i1 = {0}, i2 = {1}, p1 = {2}, p2 = {3}\\n\".format(i1, i2, p1, p2))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i1 = 5, i2 = 12, p1 = 5, p2 = 5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.4, Page number: 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.4.py\n",
+ "#Using Pointers to classes\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " class date:\n",
+ " def __init__(self): #Class constructor\n",
+ " self.month=0\n",
+ " self.day=0\n",
+ " self.year=0\n",
+ "\n",
+ " #Creating instances\n",
+ " today=date()\n",
+ " datePtr=today\n",
+ "\n",
+ " datePtr.month=9\n",
+ " datePtr.day=25\n",
+ " datePtr.year=2004\n",
+ "\n",
+ " #Result\n",
+ " print(\"Today's date is {0}/{1}/{2}\".format(datePtr.month, datePtr.day, datePtr.year))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Today's date is 9/25/2004\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.5, Page number: 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.5.py\n",
+ "#Using classes Containing pointer variables\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " class intPtrs:\n",
+ " def __init__(self): #Class constructor\n",
+ " self.p1=0\n",
+ " self.p2=0\n",
+ "\n",
+ " #Variable Declarations & Instance creation\n",
+ " i1=100\n",
+ " pointers=intPtrs()\n",
+ " pointers.p1=i1\n",
+ " i2=-97\n",
+ " pointers.p2=i2\n",
+ "\n",
+ " #Result\n",
+ " print(\"i1 = {0}, pointers.p1 = {1}\\n\".format(i1, pointers.p1))\n",
+ " print(\"i2 = {0}, pointers.p2 = {1}\\n\".format(i2, pointers.p2))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i1 = 100, pointers.p1 = 100\n",
+ "\n",
+ "i2 = -97, pointers.p2 = -97\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.6, Page number: 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.6.py\n",
+ "#Using Linked Lists\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " class entry:\n",
+ " def __init(self): #Class constructor\n",
+ " self.value=0\n",
+ " self.nxt=0\n",
+ "\n",
+ " #Variable declarations & instance creation\n",
+ " n1=entry()\n",
+ " n1.value=100\n",
+ " n2=entry()\n",
+ " n2.value=200\n",
+ " n3=entry()\n",
+ " n3.value=300\n",
+ "\n",
+ " n1.nxt=n2\n",
+ " n2.nxt=n3\n",
+ "\n",
+ " i=n1.nxt.value\n",
+ "\n",
+ " #Result\n",
+ " print(\"{0}\".format(i))\n",
+ " print(\"{0}\".format(n2.nxt.value))\n",
+ "\n",
+ "\n",
+ "\n",
+ "#setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "200\n",
+ "300\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.7, Page number: 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.7.py\n",
+ "#Traversing a linked list\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " class entry:\n",
+ " def __init__(self): #Class constructor\n",
+ " self.value=0\n",
+ " self.nxt=0\n",
+ "\n",
+ " #Creating class instances\n",
+ " n1=entry()\n",
+ " n2=entry()\n",
+ " n3=entry()\n",
+ " list_pointer=n1\n",
+ "\n",
+ " #Variable Declaration\n",
+ " n1.value=100\n",
+ " n2.value=200\n",
+ " n3.value=300\n",
+ " n1.nxt=n2\n",
+ " n2.nxt=n3\n",
+ " n3.nxt=0\n",
+ "\n",
+ " while(list_pointer!=0): #Calculation\n",
+ " print(\"{0}\\n\".format(list_pointer.value))\n",
+ " list_pointer = list_pointer.nxt;\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100\n",
+ "\n",
+ "200\n",
+ "\n",
+ "300\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.8, Page number: 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.8.py\n",
+ "#Using Pointers and Functions\n",
+ "\n",
+ "#Function to change incoming varible\n",
+ "def test(int_pointer):\n",
+ " int_pointer=100\n",
+ " return int_pointer\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable declaration\n",
+ " i=50\n",
+ " p=i\n",
+ " print(\"Before the call to test i = {0}\".format(p))\n",
+ " \n",
+ " p=test(i) #Function call\n",
+ "\n",
+ " print(\"After the call to test i = {0}\".format(p))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before the call to test i = 50\n",
+ "After the call to test i = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.9, Page number: 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.9.py\n",
+ "#Using Pointers to Exchange Values\n",
+ "\n",
+ "#Function to exchange & return values\n",
+ "def exchange(pint1,pint2):\n",
+ " temp=pint1\n",
+ " pint1=pint2\n",
+ " pint2=temp\n",
+ " return pint1,pint2\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " i1=-5\n",
+ " i2=66\n",
+ " p1=i1\n",
+ " p2=i2\n",
+ "\n",
+ " print(\"i1 ={0}, i2 ={1}\\n\".format(i1, i2))\n",
+ " \n",
+ " i1,i2=exchange(p1,p2) #Fucntion call-1\n",
+ "\n",
+ " print(\"i1 ={0}, i2 ={1}\\n\".format(i1, i2))\n",
+ "\n",
+ " i1,i2=exchange(i1,i2) #Fucntion call-2\n",
+ "\n",
+ " print(\"i1 ={0}, i2 ={1}\\n\".format(i1, i2))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i1 =-5, i2 =66\n",
+ "\n",
+ "i1 =66, i2 =-5\n",
+ "\n",
+ "i1 =-5, i2 =66\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.10, Page number: 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.10.py\n",
+ "#Returning a Pointer from a Function\n",
+ "\n",
+ "#Class Declaration\n",
+ "class entry:\n",
+ " def __init__(self): #Class constructor\n",
+ " self.value=0\n",
+ " selfnxt=0\n",
+ "\n",
+ " def FindEntry(listPtr,match): #Function to traverse list\n",
+ "\n",
+ " #Calculation\n",
+ " while(listPtr!=0):\n",
+ " if(int(listPtr.value)==int(match)):\n",
+ " return listPtr\n",
+ " else:\n",
+ " listPtr=listPtr.nxt\n",
+ "\n",
+ " return 0\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Creating instance\n",
+ " n1=entry()\n",
+ " n2=entry()\n",
+ " n3=entry()\n",
+ " listPtr=entry()\n",
+ "\n",
+ " #Variable declaration\n",
+ " n1.value=100\n",
+ " n2.value=200\n",
+ " n3.value=300\n",
+ "\n",
+ " n1.nxt=n2\n",
+ " n2.nxt=n3\n",
+ " n3.nxt=0\n",
+ " listStart=n1\n",
+ " \n",
+ " print(\"Enter value to locate: \")\n",
+ " search=200 #search=raw_input()\n",
+ " listPtr = entry.FindEntry (listStart, search) #Function call\n",
+ "\n",
+ " #Result\n",
+ " if ( listPtr != 0 ):\n",
+ " print(\"Found {0}.\\n\".format(listPtr.value))\n",
+ " else:\n",
+ " print(\"Not found.\\n\")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter value to locate: \n",
+ "Found 200.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.11, Page number: 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.11.py\n",
+ "#Working with Pointers to Arrays/Lists\n",
+ "\n",
+ "#Function to evaluate sum of array elements\n",
+ "def arraySum (array,n):\n",
+ "\n",
+ " #Variable Declaration\n",
+ " sum = 0 \n",
+ " arrayEnd = n\n",
+ " #Calculation\n",
+ " for i in range(0,arrayEnd):\n",
+ " sum += array[i]\n",
+ " return sum\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List Declaration\n",
+ " values = [ 3, 7, -9, 3, 6, -1, 7, 9, 1, -5 ]\n",
+ " #Result\n",
+ " print(\"The sum is {0}\\n\".format(arraySum (values, 10)))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sum is 21\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.12, Page number: 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.12.py\n",
+ "#Summing the Elements of an Array--version 2\n",
+ "\n",
+ "#Function to evaluate sum of array elements\n",
+ "def arraySum (array,n):\n",
+ " #Variable Declaration\n",
+ " sum = 0 \n",
+ " #Calculation\n",
+ " for i in array:\n",
+ " sum += i\n",
+ " return sum\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #List Declaration\n",
+ " values = [ 3, 7, -9, 3, 6, -1, 7, 9, 1, -5 ]\n",
+ " #Result\n",
+ " print(\"The sum is {0}\\n\".format(arraySum(values,10)))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The sum is 21\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.13, Page number: 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.13.py\n",
+ "#Version of copyString\n",
+ "\n",
+ "#Function to copy string from source to destinaton\n",
+ "def copyString(to, frm):\n",
+ " global string2\n",
+ " to=frm\n",
+ " string2=to\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " \n",
+ " global string2\n",
+ " #String declaration\n",
+ " string1=\"A string to be copied\"\n",
+ " string2=\"\"\n",
+ " copyString(string2,string1) #Functon call\n",
+ "\n",
+ " print(\"{0}\\n\".format(string2))\n",
+ " copyString (string2, \"So is this.\") #Function call\n",
+ " print(\"{0}\\n\".format(string2))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A string to be copied\n",
+ "\n",
+ "So is this.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.14, Page number: 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.14.py\n",
+ "#Revised version of copyString\n",
+ "\n",
+ "#Function to copy string from source to destinaton\n",
+ "def copyString(to, frm):\n",
+ " global string2\n",
+ " to=frm\n",
+ " string2=to\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " \n",
+ " global string2\n",
+ " #String declaration\n",
+ " string1=\"A string to be copied\"\n",
+ " string2=\"\"\n",
+ " copyString(string2,string1) #Functon call\n",
+ "\n",
+ " print(\"{0}\\n\".format(string2))\n",
+ " copyString (string2, \"So is this.\") #Function call\n",
+ " print(\"{0}\\n\".format(string2))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A string to be copied\n",
+ "\n",
+ "So is this.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 11.15, Page number: 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#11.15.PY\n",
+ "#Find the Length of a String\n",
+ "\n",
+ "#Function to return string length\n",
+ "def stringLength(string):\n",
+ " return len(string) #Calculation\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " print(\"{0} \".format(stringLength (\"stringLength test\")))\n",
+ " print(\"{0} \".format(stringLength (\"\")))\n",
+ " print(\"{0}\".format(stringLength (\"complete\")))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "17 \n",
+ "0 \n",
+ "8\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_12.ipynb b/Programming_in_C/Chapter_12.ipynb
new file mode 100644
index 00000000..7f498638
--- /dev/null
+++ b/Programming_in_C/Chapter_12.ipynb
@@ -0,0 +1,258 @@
+{
+ "metadata": {
+ "name": "Chapter XII"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: Operations on bits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 12.1, Page number: 282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#12.1.py\n",
+ "#The bitwise AND operator\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " word1=77\n",
+ " word2=150\n",
+ " word3=210\n",
+ " \n",
+ " #Result\n",
+ " print(word1&word2)\n",
+ " print(word1&word1)\n",
+ " print(word1&word2&word3)\n",
+ " print(word1&1)\n",
+ "\n",
+ "#Setting top level conditioanl script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n",
+ "77\n",
+ "0\n",
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 12.2, Page number: 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#12.2.py\n",
+ "#Illustrate Bitwise Opertors\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #variable Declarations\n",
+ " w1=525\n",
+ " w2=707\n",
+ " w3=122\n",
+ " \n",
+ " print(\"{0:5} {1:5} {2:5}\".format(w1&w2,w1|w2,w1^w2))\n",
+ " print(\"{0:5} {1:5} {2:5}\".format(~w1,~w2,~w3))\n",
+ " print(\"{0:5} {1:5} {2:5}\".format(w1^w1,w1&~w2,w1|w2|w3))\n",
+ " print(\"{0:5} {1:5}\".format(w2&w3,w1|w2&~w3))\n",
+ " print(\"{0:5} {1:5}\".format(~(~w1&~w2),~(~w1|~w2)))\n",
+ "\n",
+ " #Exchange variables\n",
+ " w1^=w2\n",
+ " w2^=w1\n",
+ " w1^=w2\n",
+ " print(\"w1={0:3} w2={1:3}\".format(w1,w2))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 513 719 206\n",
+ " -526 -708 -123\n",
+ " 0 12 767\n",
+ " 66 653\n",
+ " 719 513\n",
+ "w1=707 w2=525\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 12.3, Page number: 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#12.3.py\n",
+ "#Implementing a Shift Function\n",
+ "\n",
+ "#Function to perform bitwise shift\n",
+ "def shift(value,n):\n",
+ " if(n>0):\n",
+ " value <<=n #Left shift\n",
+ " else:\n",
+ " value >>=-n #Right Shift\n",
+ "\n",
+ " return value\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " #Variable Declaration\n",
+ " w1=177777\n",
+ " w2=444\n",
+ "\n",
+ " #Result\n",
+ " print(\"{0:7} {1:7}\".format(shift(w1,5),w1<<5))\n",
+ " print(\"{0:7} {1:7}\".format(shift(w1,-6),w1>>6))\n",
+ " print(\"{0:7} {1:7}\".format(shift(w2,0),w2>>0))\n",
+ " print(\"{0:7} \".format(shift(shift(w1,-3),3)))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5688864 5688864\n",
+ " 2777 2777\n",
+ " 444 444\n",
+ " 177776 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 12.4, Page number: 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#12.4.py\n",
+ "#Implementing a Rotate Function\n",
+ "\n",
+ "#Function to perform rotation\n",
+ "def rotate(value,n):\n",
+ "\n",
+ " #Calculation\n",
+ " if(n>0):\n",
+ " n=n%32\n",
+ " else:\n",
+ " n=-(-n%32)\n",
+ "\n",
+ " if(n==0):\n",
+ " result=value\n",
+ " elif(n>0):\n",
+ " bits=value>>(32-n)\n",
+ " result=value<<n|bits\n",
+ " else:\n",
+ " n=-n\n",
+ " bits=value<<(32-n)\n",
+ " result=value>>n|bits\n",
+ "\n",
+ " return result\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "#Variable Declaration\n",
+ " w1=0xabcdef00\n",
+ " w2=0xffff1122\n",
+ "\n",
+ " print(\"%x\"%rotate(w1,8))\n",
+ " print(\"%x\"%rotate(w1,-16))\n",
+ " print(\"%x\"%rotate(w2,4))\n",
+ " print(\"%x\"%rotate(w2,-2))\n",
+ " print(\"%x\"%rotate(w1,0))\n",
+ " print(\"%x\"%rotate(w1,44))\n",
+ " \n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "abcdef00ab\n",
+ "abcdef00abcd\n",
+ "ffff1122f\n",
+ "3fffc448bfffc448\n",
+ "abcdef00\n",
+ "abcdef00abc\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_13.ipynb b/Programming_in_C/Chapter_13.ipynb
new file mode 100644
index 00000000..0ccf61c4
--- /dev/null
+++ b/Programming_in_C/Chapter_13.ipynb
@@ -0,0 +1,201 @@
+{
+ "metadata": {
+ "name": "Chapter XIII"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: The preprocessor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 13.1, Page number: 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#13.1.py\n",
+ "#defining constants\n",
+ "\n",
+ "#Variable Decarations\n",
+ "global YES\n",
+ "global NO\n",
+ "YES=1\n",
+ "NO=0\n",
+ "\n",
+ "\n",
+ "#Function to check if a number is even or odd\n",
+ "def isEven(number):\n",
+ " global YES\n",
+ " global NO\n",
+ "\n",
+ " if(number%2==0):\n",
+ " answer=YES\n",
+ " else:\n",
+ " answer=NO\n",
+ "\n",
+ " return answer\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " global YES\n",
+ " global NO\n",
+ "\n",
+ " #Calculation/Result\n",
+ " if(isEven(17)==YES):\n",
+ " print(\"YES\")\n",
+ " else:\n",
+ " print(\"NO\")\n",
+ "\n",
+ " \n",
+ " if(isEven(20)==YES):\n",
+ " print(\"YES\")\n",
+ " else:\n",
+ " print(\"NO\")\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NO\n",
+ "YES\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 13.2, Page number: 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#13.2.py\n",
+ "#Working more with constants\n",
+ "\n",
+ "global PI\n",
+ "PI= 3.141592654\n",
+ "\n",
+ "\n",
+ "#Function to calculate area\n",
+ "def area(r):\n",
+ " global PI\n",
+ " return (PI*r*r)\n",
+ "\n",
+ "#Function to calculate circumference\n",
+ "def circumference(r):\n",
+ " global PI\n",
+ " return (2*PI*r)\n",
+ "\n",
+ "#Function to calculate volume\n",
+ "def volume(r):\n",
+ " global PI\n",
+ " return (1.33 * PI*r*r*r)\n",
+ " \n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " print(\"radius=1 {0:5} {1:5} {2:5}\".format(area(1),circumference(1),volume(1)))\n",
+ " print(\"radius=4.98 {0:5} {1:5} {2:5}\".format(area(4.98),circumference(4.98),volume(4.98)))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "radius=1 3.141592654 6.283185308 4.17831822982\n",
+ "radius=4.98 77.9127544563 31.2902628338 516.047337866\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 13.3, Page number: 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#13.3.py\n",
+ "#Defining global constants--advance\n",
+ "\n",
+ "#Variable Declaration\n",
+ "global QUARTS_PER_LITER\n",
+ "QUARTS_PER_LITER=1.05687\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " global QUARTS_PER_LITER #Global Reference\n",
+ "\n",
+ " print(\"***Liters to galons***\")\n",
+ " print(\"Enter the number of Litres\")\n",
+ " liters=12 #liters=raw_input()\n",
+ "\n",
+ " gallons=float(liters)*QUARTS_PER_LITER/4.0 #calculation\n",
+ "\n",
+ " print(\"{0} Liters = {1} gallons\".format(liters,gallons))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "***Liters to galons***\n",
+ "Enter the number of Litres\n",
+ "12 Liters = 3.17061 gallons\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_14.ipynb b/Programming_in_C/Chapter_14.ipynb
new file mode 100644
index 00000000..4b34f1d0
--- /dev/null
+++ b/Programming_in_C/Chapter_14.ipynb
@@ -0,0 +1,92 @@
+{
+ "metadata": {
+ "name": "Chapter XIV"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14: More on data types"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 14.1, Page number: 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#14.1.py\n",
+ "#Using Enumerated Data Type\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Declaring an Enumerator \n",
+ " def enum(**enums):\n",
+ " return type('Enum',(),enums)\n",
+ "\n",
+ " #Defining an Enumerator\n",
+ " month=enum(january=1,february=2,march=3,april=4,may=5,june=6,july=7,\\\n",
+ " august=8,september=9,october=10,november=11,december=12)\n",
+ " days=0\n",
+ "\n",
+ " print(\"Enter month number:\")\n",
+ " aMonth=8 #aMonth=raw_input()\n",
+ "\n",
+ " #Calculations\n",
+ " if(int(aMonth)==month.january or int(aMonth)==month.march or \\\n",
+ " int(aMonth)==month.may or int(aMonth)==month.july or \\\n",
+ " int(aMonth)==month.august or int(aMonth)==month.october or int(aMonth)==month.december):\n",
+ " days=31\n",
+ "\n",
+ " elif(int(aMonth)==month.april or int(aMonth)==month.june or \\\n",
+ " int(aMonth)==month.september or int(aMonth)==month.november):\n",
+ " days=30\n",
+ " elif(int(aMonth)==month.february):\n",
+ " days=28\n",
+ " else:\n",
+ " print(\"bad month number\")\n",
+ " days=0\n",
+ "\n",
+ " #Result\n",
+ " if(days!=0):\n",
+ " print(\"Number of days is {0}\".format(days))\n",
+ " if(int(aMonth)==month.february):\n",
+ " print(\"...or 29 if it's a leap year\")\n",
+ "\n",
+ "\n",
+ "#Top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter month number:\n",
+ "Number of days is 31\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_16.ipynb b/Programming_in_C/Chapter_16.ipynb
new file mode 100644
index 00000000..f6d06ea2
--- /dev/null
+++ b/Programming_in_C/Chapter_16.ipynb
@@ -0,0 +1,304 @@
+{
+ "metadata": {
+ "name": "Chapter 16"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16: Input and Output Operations in Python"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 16.1, Page number: 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#16.1.py\n",
+ "#Illustrating print function\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " c='X'\n",
+ " s=\"abcdefghijklmnopqrstuvwxyz\"\n",
+ " i=425\n",
+ " j=17\n",
+ " u=0xf179\n",
+ " l=75000\n",
+ " L=0x1234567812345678\n",
+ " f=12.978\n",
+ " d=-97.4583\n",
+ " cp=c\n",
+ " ip=i\n",
+ " \n",
+ "\n",
+ " #Print Integers\n",
+ " print(\"Integers:\\n\")\n",
+ " print(\"%i %o %x %u\" %(i,i,i,i))\n",
+ " print(\"%x %X %#x %#X\" %(i,i,i,i))\n",
+ " print(\"%+i % i %07i %.7i\" %(i,i,i, i))\n",
+ " print(\"%i %o %x %u\" %(j,j,j,j))\n",
+ " print(\"%i %o %x %u\" %(u,u,u,u))\n",
+ " print(\"%ld %lo %lx %lu\" %(l,l,l,l))\n",
+ " print(\"%li %lo %lx %lu\" %(L,L,L, L))\n",
+ "\n",
+ " #Print Floats & Doubles\n",
+ " print(\"\\nFloats and Doubles:\")\n",
+ " print(\"%f %e %g\"%( f, f, f))\n",
+ " print(\"%.2f %.2e\"%( f, f))\n",
+ " print(\"%.0f %.0e\"%( f, f))\n",
+ " print(\"%7.2f %7.2e\"%( f, f))\n",
+ " print(\"%f %e %g\"%( d, d, d))\n",
+ " print(\"%.*f\"%( 3, d))\n",
+ " print(\"%*.*f\" %(8, 2, d))\n",
+ "\n",
+ " #Print Characters\n",
+ " print(\"\\nCharacters:\")\n",
+ " print(\"%c\"%(c))\n",
+ " print(\"%3c%3c\"%( c, c))\n",
+ " print(\"{0:x} \".format(ord(c))) \n",
+ "\n",
+ " #Print Strings\n",
+ " print(\"\\nStrings:\")\n",
+ " print(\"%s\"%(s))\n",
+ " print(\"%.5s\"%(s))\n",
+ " print(\"%30s\"%(s))\n",
+ " print(\"%20.5s\"%(s))\n",
+ " print(\"%-20.5s\"%(s))\n",
+ "\n",
+ " #Print variables pointers\n",
+ " print(\"\\nPointers:\")\n",
+ " print(\"{0:x} {1:x}\\n\".format(int(ip),ord(cp)))\n",
+ "\n",
+ " print(\"This%n is fun.\")\n",
+ " print(\"c1 = %i, c2 = %i\\n\"%(4, 12))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integers:\n",
+ "\n",
+ "425 651 1a9 425\n",
+ "1a9 1A9 0x1a9 0X1A9\n",
+ "+425 425 0000425 0000425\n",
+ "17 21 11 17\n",
+ "61817 170571 f179 61817\n",
+ "75000 222370 124f8 75000\n",
+ "1311768465173141112 110642547402215053170 1234567812345678 1311768465173141112\n",
+ "\n",
+ "Floats and Doubles:\n",
+ "12.978000 1.297800e+01 12.978\n",
+ "12.98 1.30e+01\n",
+ "13 1e+01\n",
+ " 12.98 1.30e+01\n",
+ "-97.458300 -9.745830e+01 -97.4583\n",
+ "-97.458\n",
+ " -97.46\n",
+ "\n",
+ "Characters:\n",
+ "X\n",
+ " X X\n",
+ "58 \n",
+ "\n",
+ "Strings:\n",
+ "abcdefghijklmnopqrstuvwxyz\n",
+ "abcde\n",
+ " abcdefghijklmnopqrstuvwxyz\n",
+ " abcde\n",
+ "abcde \n",
+ "\n",
+ "Pointers:\n",
+ "1a9 58\n",
+ "\n",
+ "This%n is fun.\n",
+ "c1 = 4, c2 = 12\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 16.2, Page number: 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#16.2.py\n",
+ "#Copying Characters from Standard Input to Standard Output\n",
+ "\n",
+ "#Import system library\n",
+ "import sys\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " \n",
+ " while (True):\n",
+ " #c=raw_input() #User Input\n",
+ " c=\"this is a sample text\" #Dummy text\n",
+ " print(c); #Display Result\n",
+ " \n",
+ " #Un-comment this while executing from terminal/command line\n",
+ " #if(c==\"EOF\"): #Check Exit condition\n",
+ " sys.exit()\n",
+ " \n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "this is a sample text\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 16.3, Page number: 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#16.3.py\n",
+ "#Program to copy one file to another\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration/ User Input\n",
+ " print(\"Enter name of the file to be copied: \")\n",
+ " inName=\"source.txt\"\n",
+ " #inName=raw_input()\n",
+ "\n",
+ " print(\"Enter name of the output file: \")\n",
+ " outName=\"target.txt\"\n",
+ " #outName=raw_input()\n",
+ "\n",
+ " \n",
+ "#Try to open a file for reading\n",
+ " try:\n",
+ " inn=open(inName,\"r\") \n",
+ " except:# Exception:\n",
+ " print(\"cant open {0} for reading\".format(inName))\n",
+ " sys.exit()\n",
+ "\n",
+ "#try to open a file for writing\n",
+ " try:\n",
+ " out=open(outName,\"w\") \n",
+ " except:# Exception:\n",
+ " print(\"cant open {0} for writing\".format(outName))\n",
+ " sys.exit()\n",
+ "\n",
+ " string=inn.read() #Read content from File-1\n",
+ " out.write(string) #Write content to File-2\n",
+ "\n",
+ "#Close Files\n",
+ " inn.close()\n",
+ " out.close()\n",
+ "\n",
+ " print(\"File has been copied.\\n\");\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "global name 'source' is not defined",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m/home/jovina/TBC/nalin/Stephen G Kochan--Programming in C/<ipython-input-3-388aacca0b5d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 40\u001b[0m \u001b[1;31m#Setting top level conditional script\u001b[0m\n\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 41\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0m__name__\u001b[0m\u001b[1;33m==\u001b[0m\u001b[1;34m'__main__'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 42\u001b[1;33m \u001b[0mmain\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 43\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;32m/home/jovina/TBC/nalin/Stephen G Kochan--Programming in C/<ipython-input-3-388aacca0b5d>\u001b[0m in \u001b[0;36mmain\u001b[1;34m()\u001b[0m\n\u001b[0;32m 19\u001b[0m \u001b[0minn\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msource\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtxt\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"r\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 20\u001b[0m \u001b[1;32mexcept\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;31m# Exception:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 21\u001b[1;33m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"cant open {0} for reading\"\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msource\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtxt\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 22\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 23\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mNameError\u001b[0m: global name 'source' is not defined"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name of the file to be copied: \n",
+ "Enter name of the output file: \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_17.ipynb b/Programming_in_C/Chapter_17.ipynb
new file mode 100644
index 00000000..192aef85
--- /dev/null
+++ b/Programming_in_C/Chapter_17.ipynb
@@ -0,0 +1,110 @@
+{
+ "metadata": {
+ "name": "Chapter XVII"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17: Miscellaneous and Advanced Features"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 17.1, Page number: 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#17.1.py\n",
+ "#File Copy Program Using Command-Line Arguments\n",
+ "\n",
+ "#Import Libraries\n",
+ "import sys\n",
+ "\n",
+ "def main():\n",
+ " \n",
+ " #Un-Comment this while execution from terminal/Command Line\n",
+ " #if(len(sys.argv)!=3):\n",
+ " #print(\"need two file names!\")\n",
+ " #sys.exit()\n",
+ " \n",
+ "#Read Command Line Arguments\n",
+ " inName=\"source.txt\" #str(sys.argv[1])\n",
+ " outName=\"target.txt\" #str(sys.argv[2])\n",
+ "\n",
+ " #Try to open a file for reading\n",
+ " try:\n",
+ " inn=open(inName,\"r\") \n",
+ " except:# Exception:\n",
+ " print(\"cant open {0} for reading\".format(inName))\n",
+ " sys.exit()\n",
+ "\n",
+ "#try to open a file for writing\n",
+ " try:\n",
+ " out=open(outName,\"w\") \n",
+ " except:# Exception:\n",
+ " print(\"cant open {0} for writing\".format(outName))\n",
+ " sys.exit()\n",
+ "\n",
+ " string=inn.read() #Read content from File-1\n",
+ " out.write(string) #Write content to File-2\n",
+ "\n",
+ "#Close Files\n",
+ " inn.close()\n",
+ " out.close()\n",
+ "\n",
+ "\n",
+ " print(\"File has been copied.\\n\");\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cant open source.txt for reading\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_18.ipynb b/Programming_in_C/Chapter_18.ipynb
new file mode 100644
index 00000000..675ba691
--- /dev/null
+++ b/Programming_in_C/Chapter_18.ipynb
@@ -0,0 +1,472 @@
+{
+ "metadata": {
+ "name": "Chapter 18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18: Debugging Programs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 18.1, Page number: 389"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#18.1.py\n",
+ "#Adding Debug statements in program\n",
+ "\n",
+ "#Program logs will be saved in file- 18.1_logFile.txt\n",
+ "\n",
+ "#Import library\n",
+ "import logging\n",
+ "\n",
+ "#Function to return sum of 3 numbers\n",
+ "def process(i,j,k):\n",
+ " return i+j+k\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " logger = logging.getLogger()\n",
+ " logger.setLevel(logging.DEBUG)\n",
+ "\n",
+ " formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\n",
+ "\n",
+ " fh = logging.FileHandler('18.1_logFile.txt')\n",
+ " fh.setLevel(logging.DEBUG)\n",
+ " fh.setFormatter(formatter)\n",
+ " logger.addHandler(fh)\n",
+ "\n",
+ " ch = logging.StreamHandler()\n",
+ " ch.setLevel(logging.DEBUG)\n",
+ " ch.setFormatter(formatter)\n",
+ " logger.addHandler(ch)\n",
+ "\n",
+ " arr=[]\n",
+ " arr=map(int,\"1 2 3\".split())\n",
+ " #arr=map(int,raw_input().split())\n",
+ " logger.debug(\"Number of integers read= {0}\".format(len(arr))) #Debug statement\n",
+ " logger.debug(\"i = {0}, j = {1}, k = {2}\\n\".format(arr[0],arr[1],arr[2])) #Debug statement\n",
+ "\n",
+ " print(\"sum= %i\\n\"%process(arr[0],arr[1],arr[2]))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 01:20:39,300 - DEBUG - Number of integers read= 3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 01:20:39,303 - DEBUG - i = 1, j = 2, k = 3\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sum= 6\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 18.2, Page number: 391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#18.2.py\n",
+ "#Compiling in Debug \n",
+ "\n",
+ "#Program logs will be saved in file- 18.2_logFile.txt\n",
+ "\n",
+ "#Import Libraries\n",
+ "import logging,sys\n",
+ "\n",
+ "#Function to return product of two numbers\n",
+ "def process(i1,i2):\n",
+ "\n",
+ " global logger \n",
+ " logger.debug(\"process (%i, %i)\\n\"%(i1, i2))\n",
+ " val=i1*i2\n",
+ " logger.debug(\"return %i\\n\"%(val))\n",
+ " return val\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " global logger\n",
+ " logging.basicConfig(filename='18.2_logFile.txt', filemode='w', level=logging.DEBUG)\n",
+ " logger = logging.getLogger()\n",
+ " logger.setLevel(logging.DEBUG)\n",
+ " filemode = 'w'\n",
+ " \n",
+ " formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\n",
+ "\n",
+ " fh = logging.FileHandler('18.2_logFile.txt')\n",
+ " fh.setLevel(logging.DEBUG)\n",
+ " fh.setFormatter(formatter)\n",
+ " logger.addHandler(fh)\n",
+ "\n",
+ " ch = logging.StreamHandler()\n",
+ " ch.setLevel(logging.DEBUG)\n",
+ " ch.setFormatter(formatter)\n",
+ " logger.addHandler(ch)\n",
+ "\n",
+ "\n",
+ " arg1=0\n",
+ " arg2=0\n",
+ " #Un-Comment this while executing from terminal/command line\n",
+ " #if(len(sys.argv)>1):\n",
+ " #arg1=int(sys.argv[1])\n",
+ " #if(len(sys.argv)==3):\n",
+ " #arg2=int(sys.argv[2])\n",
+ "\n",
+ " #Dummy command-line-parameters\n",
+ " #execute as \"python <filename>.py arg1 arg2\" while executing from terminal and un/comment respective statements\n",
+ " a=['3','5'] \n",
+ " logger.debug(\"processed %i arguments\\n\"%(len(a)))\n",
+ " #logger.debug(\"processed %i arguments\\n\"%(len(sys.argv)))\n",
+ "\n",
+ " logger.debug(\"arg1 = %i, arg2 = %i\\n\"%(int(a[0]), int(a[1])))\n",
+ " print(\"product = %i\\n\" %( process (int(a[0]),int( a[1]))))\n",
+ "\n",
+ " #logger.debug(\"arg1 = %i, arg2 = %i\\n\"%(arg1, arg2))\n",
+ " #print(\"product = %i\\n\" %( process (arg1, arg2)))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:50:53,392 - DEBUG - processed 2 arguments\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:50:53,397 - DEBUG - arg1 = 3, arg2 = 5\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:50:53,404 - DEBUG - process (3, 5)\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:50:53,409 - DEBUG - return 15\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "product = 15\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 18.3, Page number: 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#18.3.py\n",
+ "#Compiling in Debug--version2\n",
+ "\n",
+ "#Program logs will be saved in file- 18.3_logFile.txt\n",
+ "\n",
+ "#Using different logging levels\n",
+ "#DEBUG Detailed information, typically of interest only when diagnosing problems.\n",
+ "#INFO Confirmation that things are working as expected.\n",
+ "#WARNING An indication of some problem in the near future (e.g.'disk space low')\n",
+ "#ERROR Due to a more serious problem, the software has not been able to perform some function.\n",
+ "#CRITICAL A serious error, indicating that the program itself may be unable to continue running.\n",
+ "\n",
+ "\n",
+ "#Import Libraries\n",
+ "import logging,sys\n",
+ "\n",
+ "#Function to return product of two numbers\n",
+ "def process(i1,i2):\n",
+ "\n",
+ " global logger \n",
+ " logger.warning(\"process (%i, %i)\\n\"%(i1, i2))\n",
+ " val=i1*i2\n",
+ " logger.error(\"return %i\\n\"%(val))\n",
+ " return val\n",
+ "\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " global logger\n",
+ " logging.basicConfig(filename='18.3_logFile.txt', filemode='w', level=logging.DEBUG)\n",
+ " logger = logging.getLogger()\n",
+ " logger.setLevel(logging.DEBUG)\n",
+ "\n",
+ " formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\n",
+ "\n",
+ " fh = logging.FileHandler('18.3_logFile.txt')\n",
+ " fh.setLevel(logging.DEBUG)\n",
+ " fh.setFormatter(formatter)\n",
+ " logger.addHandler(fh)\n",
+ "\n",
+ " ch = logging.StreamHandler()\n",
+ " ch.setLevel(logging.DEBUG)\n",
+ " ch.setFormatter(formatter)\n",
+ " logger.addHandler(ch)\n",
+ "\n",
+ "\n",
+ " arg1=0\n",
+ " arg2=0\n",
+ " #Un-Comment this while executing from terminal/command line\n",
+ "\n",
+ " #if(len(sys.argv)>1):\n",
+ " #arg1=int(sys.argv[1])\n",
+ " #if(len(sys.argv)==3):\n",
+ " #arg2=int(sys.argv[2])\n",
+ "\n",
+ " #Dummy command-line-parameters\n",
+ " #execute as \"python <filename>.py arg1 arg2\" while executing from terminal and un/comment respective statements\n",
+ " a=['3','5']\n",
+ " logger.debug(\"processed %i arguments\\n\"%(len(a)))\n",
+ " #logger.debug(\"processed %i arguments\\n\"%(len(sys.argv)))\n",
+ "\n",
+ " logger.info(\"arg1 = %i, arg2 = %i\\n\"%(int(a[0]), int(a[1])))\n",
+ " print(\"product = %i\\n\" %( process (int(a[0]),int( a[1]))))\n",
+ "\n",
+ " #logger.debug(\"arg1 = %i, arg2 = %i\\n\"%(arg1, arg2))\n",
+ " #print(\"product = %i\\n\" %( process (arg1, arg2)))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:54:41,136 - DEBUG - processed 2 arguments\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:54:41,142 - INFO - arg1 = 3, arg2 = 5\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:54:41,149 - WARNING - process (3, 5)\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "2013-08-27 17:54:41,154 - ERROR - return 15\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "product = 15\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 18.4, Page number: 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#18.4.py\n",
+ "#A simple program for use with pdb(gdb like python debugger)\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ " \n",
+ " #Variable Declaration\n",
+ " sum=0\n",
+ " data = [1, 2, 3, 4, 5]\n",
+ "\n",
+ " #Calculation\n",
+ " for i in range (0,5):\n",
+ " sum += data[i]\n",
+ " \n",
+ " #Result\n",
+ " print(\"sum = %i\\n\"%(sum))\n",
+ " \n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sum = 15\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 18.5, Page number: 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#18.5.py\n",
+ "#Working more with pdb\n",
+ "\n",
+ "#Class Declaration\n",
+ "class date:\n",
+ " def __init__(self,m,d,y): #Class constructor\n",
+ " self.month=m\n",
+ " self.day=d\n",
+ " self.year=y\n",
+ "\n",
+ " def foo(x):\n",
+ " x.day+=1\n",
+ " return x\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " today=date(10,11,2004)\n",
+ " array=[1,2,3,4,5]\n",
+ " string=\"test string\"\n",
+ " i=3\n",
+ " newdate=date(11,15,2004)\n",
+ " today=date.foo(today)\n",
+ "\n",
+ " #Result\n",
+ " print(\"today= %d/%d/%d\"%(today.day,today.month,today.year))\n",
+ "\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "today= 12/10/2004\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_19.ipynb b/Programming_in_C/Chapter_19.ipynb
new file mode 100644
index 00000000..d92a3f41
--- /dev/null
+++ b/Programming_in_C/Chapter_19.ipynb
@@ -0,0 +1,70 @@
+{
+ "metadata": {
+ "name": "Chapter XIX"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 19: Object-oriented programming"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 19.1, Page number: 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#19.1.py\n",
+ "#Working with fractions in python\n",
+ "\n",
+ "#Class declaration\n",
+ "class Fraction:\n",
+ " def __init__(self): #Class constructor\n",
+ " self.numerator=0\n",
+ " self.denominator=0\n",
+ "\n",
+ "#Main()\n",
+ "def main():\n",
+ "\n",
+ " #Creating instance\n",
+ " myFract=Fraction()\n",
+ " myFract.numerator=1\n",
+ " myFract.denominator=3\n",
+ "\n",
+ " print(\"The Fraction is {0}/{1}\".format(myFract.numerator,myFract.denominator))\n",
+ "\n",
+ "#Setting top level conditional script\n",
+ "if __name__=='__main__':\n",
+ " main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Fraction is 1/3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/README.txt b/Programming_in_C/README.txt
new file mode 100644
index 00000000..0f721b5b
--- /dev/null
+++ b/Programming_in_C/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Nalin Chibber
+Course: btech
+College/Institute/Organization: MSIT - Indraprastha University, New Delhi
+Department/Designation: Computer Science engineering
+Book Title: Programming in C
+Author: Stephen G. Kochan
+Publisher: Sams Publishing
+Year of publication: 2005
+Isbn: 0-672-32666-3
+Edition: 3rd \ No newline at end of file
diff --git a/Programming_in_C/screenshots/nalin-1.png b/Programming_in_C/screenshots/nalin-1.png
new file mode 100644
index 00000000..83b0e0a3
--- /dev/null
+++ b/Programming_in_C/screenshots/nalin-1.png
Binary files differ
diff --git a/Programming_in_C/screenshots/nalin-2.png b/Programming_in_C/screenshots/nalin-2.png
new file mode 100644
index 00000000..44dceb57
--- /dev/null
+++ b/Programming_in_C/screenshots/nalin-2.png
Binary files differ
diff --git a/Programming_in_C/screenshots/nalin-3.png b/Programming_in_C/screenshots/nalin-3.png
new file mode 100644
index 00000000..74db9f60
--- /dev/null
+++ b/Programming_in_C/screenshots/nalin-3.png
Binary files differ
diff --git a/Satellite_Communication/README.txt b/Satellite_Communication/README.txt
new file mode 100644
index 00000000..4ec19377
--- /dev/null
+++ b/Satellite_Communication/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Laxman Sole
+Course: btech
+College/Institute/Organization: Vishwakarma Institute of Technology,Pune
+Department/Designation: Electronics
+Book Title: Satellite Communication
+Author: Anil K.maini Varsha Agrawal
+Publisher: Wiley India Pvt. Ltd. New Delhi
+Year of publication: 2010
+Isbn: 978-81-265-2071-8
+Edition: 1 \ No newline at end of file
diff --git a/Satellite_Communication/chapter_2.ipynb b/Satellite_Communication/chapter_2.ipynb
new file mode 100644
index 00000000..233fcb29
--- /dev/null
+++ b/Satellite_Communication/chapter_2.ipynb
@@ -0,0 +1,838 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 2: Satellite Orbits and Trajectories"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1, page no-36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''satellite velocity'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "r1=6370.0 # Earth's Orbit in km\n",
+ "r2=630.0 # Height of satellite from surface in km\n",
+ "G=6.67*10**-11 # Gravitational constant inNm^2/kg^2\n",
+ "M=5.98*10**24 # Mass of earth in kg\n",
+ "\n",
+ "#Calculation\n",
+ "R=r1+r2\n",
+ "v=math.sqrt(G*M/(R*10**3))\n",
+ "\n",
+ "#Result\n",
+ "print(\"The velocity of sattelite %.2fkm/s\"%(math.floor(v/10)*10**-2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of sattelite 7.54km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2, page no-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''orbit parameters'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "A=45000.0 #Apogee in km\n",
+ "P=7000.0 #Perigee in km\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#(a)\n",
+ "a=(A+P)/2\n",
+ "#(b)\n",
+ "e=(A-P)/(2*a)\n",
+ "#(c)\n",
+ "e=(math.floor(e*100))/100\n",
+ "d=a*e\n",
+ "\n",
+ "#Result\n",
+ "print(\"(a)\\nSemi-major axis of elliptical orbit is %d km\"%a)\n",
+ "print(\"\\n(b)\\nEccentricity = %.2f\"%e)\n",
+ "print(\"\\n(c)\\nThe distance between centre of earth and centre of ellipse is %d km \"%d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Semi-major axis of elliptical orbit is 26000 km\n",
+ "\n",
+ "(b)\n",
+ "Eccentricity = 0.73\n",
+ "\n",
+ "(c)\n",
+ "The distance between centre of earth and centre of ellipse is 18980 km \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3, page no-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbit parameters'''\n",
+ "#Variable Declaration\n",
+ "ma=42000.0 # Major axis distance in Km\n",
+ "P=8000.0 # Perigee distance in Km\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "A=ma-P\n",
+ "e=(A-P)/ma\n",
+ "\n",
+ "#Result\n",
+ "print(\"Apogee=%dkm\\n Eccentricity=%.2f\"%(A,e))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Apogee=34000km\n",
+ " Eccentricity=0.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.4, page no-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbit parameters'''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "e=0.6 #Eccentricity\n",
+ "d=18000.0 #distance between earth's centre and centre of ellipse\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "a=d/e\n",
+ "A=a*(1+e)\n",
+ "P=a*(1-e)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Semi-major axis of elliptical orbit is %d km\\n Apogee distance=%dkm\\n Perigee distance=%dkm\"%(a,A,P))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Semi-major axis of elliptical orbit is 30000 km\n",
+ " Apogee distance=48000km\n",
+ " Perigee distance=12000km\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5, page no-38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbit Eccentricity'''\n",
+ "#Variable Declaration\n",
+ "AP_diff=30000.0 #difference between apogee and perigee in km\n",
+ "AP_sum=62800.0 #Apogee+perigee\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "E=AP_diff/AP_sum\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Orbit Eccentricity= %.3f\"%E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Orbit Eccentricity= 0.478\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6, page no-38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Velocity of satellite at particular point '''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "R=7000.0*10**3 # sattelite orbit in m\n",
+ "mu=39.8*10**13 # constant G*M in Nm^2/kg\n",
+ "A=47000.0*10**3 # appogee distance in m\n",
+ "P=7000.0*10**3 # perigee distance in m\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "v=math.sqrt(mu/R)\n",
+ "a=(A+P)/2\n",
+ "v1=math.sqrt(mu*((2/R)-(1/a)))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Velocity of satellite A at point X is v=%.2fkm/s\\nVelocity of satellite B at point X is V=%.3fkm/s\"%(v/1000,v1/1000))\n",
+ "#value in book is different at 3rd decimal place."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of satellite A at point X is v=7.54km/s\n",
+ "Velocity of satellite B at point X is V=9.949km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7, page no-39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Velocity of satellite at particular point '''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "R=42000.0*10**3 #sattelite orbit in m\n",
+ "mu=39.8*10**13 #constant G*M in Nm^2/kg\n",
+ "A=42000.0*10**3 #appogee distance in m\n",
+ "P=7000.0*10**3 #perigee distance in m\n",
+ "\n",
+ "#Calculation\n",
+ "v=math.sqrt(mu/R)\n",
+ "a=(A+P)/2\n",
+ "v1=math.sqrt(mu*((2/R)-(1/a)))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Velocity of satellite A at point X is v=%.3fkm/s\\n Velocity of satellite B at point X is V=%.3fkm/s\"%(v/1000,v1/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of satellite A at point X is v=3.078km/s\n",
+ " Velocity of satellite B at point X is V=1.645km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8, page no-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Velocity of satellite at particular point '''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "R=25000.0*10**3 #sattelite orbit in m\n",
+ "mu=39.8*10**13 #constant G*M in Nm^2/kg\n",
+ "A=43000.0*10**3 #appogee distance in m\n",
+ "P=7000.0*10**3 #perigee distance in m\n",
+ "\n",
+ "#Calculation\n",
+ "v=math.sqrt(mu/R)\n",
+ "a=(A+P)/2\n",
+ "v1=math.sqrt(mu*((2/R)-(1/a)))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Velocity of satellite A at point X is v=%.3fkm/s\\n Velocity of satellite B at point X is V=%.3fkm/s\"%(v/1000,v1/1000))\n",
+ "#value in book is different at 3rd decimal place."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of satellite A at point X is v=3.990km/s\n",
+ " Velocity of satellite B at point X is V=3.990km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9, page no-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbital time period'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "a=(50000.0/2)*10**3 #Semi-major axis in m\n",
+ "mu=39.8*10**13 #constant G*M in Nm^2/kg\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "T=2*math.pi*math.sqrt((a**3)/mu) #math.pi gives variation in answer\n",
+ "h=T/(60*60)\n",
+ "x=T%3600\n",
+ "m=x/60\n",
+ "s=x%60\n",
+ "\n",
+ "#Result\n",
+ "print(\"Orbital time period is given by, T = %dsec\\n\\t\\t\\t\\t = %dh %dm %ds\"%(T,math.floor(h),math.floor(m),math.floor(s)))\n",
+ "#value in book is different for seconds."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Orbital time period is given by, T = 39368sec\n",
+ "\t\t\t\t = 10h 56m 8s\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.10, page no-42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbital time period'''\n",
+ "#Variable Declaration\n",
+ "a1=18000.0*10**3 #Semi-major axis for first satellite in m\n",
+ "a2=24000.0*10**3 #Semi-major axis f0r 2nd satellite in m\n",
+ "\n",
+ "#Calculation\n",
+ "T2_by_T1=(a2/a1)**(3.0/2.0)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Orbital time period of sattelite 2 is %.2f times that of sattelite 1\"%T2_by_T1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Orbital time period of sattelite 2 is 1.54 times that of sattelite 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11, page no-42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbit parameters'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "a=25000.0*10**3 #appogee distance in m\n",
+ "b=18330.0*10**3 #perigee distance in m\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "e=(math.sqrt(a**2-b**2)/a)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Apogee distance = a(1+e)= %dkm\\n Perigee distance = a(1-e)= %dkm\\n\"%(a*(1+e)/1000,math.ceil(a*(1-e)/1000)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Apogee distance = a(1+e)= 42000km\n",
+ " Perigee distance = a(1-e)= 8000km\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12, page no-43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "e=0.6 # eccentricity of elliptical orbit\n",
+ "a=0.97 # area of shaded region\n",
+ "b=2.17 # Area of non-shaded region\n",
+ "t=3 # time taken by satellite to move from pt B to A\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=b/a\n",
+ "y=x*t\n",
+ "\n",
+ "#Result\n",
+ "print(\"Time taken by satellite to move from A to B is %.3f hours \"%y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by satellite to move from A to B is 6.711 hours \n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.13, page no-44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Velocity at apogee'''\n",
+ "#Variable Declaration\n",
+ "A=42000.0 # Apogee in km\n",
+ "P=8000.0 # Perigee in km\n",
+ "v_p=9.142 # velocity at perigee point\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "v_a=v_p*P/A\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Velocity at apogee = %.3f km/s\"%v_a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity at apogee = 1.741 km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.14, page no-44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''velocity of satellite at particular point'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "theta=56.245 #angle made by direction of satellite with local horizontal\n",
+ "d=16000.0 #distance of particular point\n",
+ "P=8000.0 #Perigee in m\n",
+ "v_p=9.142 #velocity at perigee point\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "v=(P*v_p)/(d*math.floor(math.cos(theta*math.pi/180)*1000)/1000)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"The velocity of satellite at that particular point is %.3f km/s\"%v)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of satellite at that particular point is 8.236 km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.16, page no-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''New apogee distance'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "A1=12000.0 # first Apogee distance\n",
+ "P=8000.0 # Perigee distance\n",
+ "v1=1.0 # assume v1 as 1\n",
+ "v2=1.2*v1 # 20% higher than v1 \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=(v2/v1)**2\n",
+ "k=(((1+(P/A1))/x)-1)\n",
+ "k=math.floor(k*10**4)/10**4\n",
+ "A2=P/k\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"A2 = %.0fkm\"%math.ceil(A2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A2 = 50826km\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.17, page no-50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''satellite velocity'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "vp=8.0 # horizontal velocity of satellite in km/s\n",
+ "r=1620.0 # distance from earth's surface in km\n",
+ "R=6380.0 # Earth's radius in km\n",
+ "d=10000.0 # distance of point at which velocity to be calculated\n",
+ "theta=30.0 # angle made by satellite with local horzon at that point\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "P=r+R\n",
+ "v=(vp*P)/(d*math.cos(theta*math.pi/180))\n",
+ "\n",
+ "#Result\n",
+ "print(\"v = %.2f km/s\"%v)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "v = 7.39 km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.18, page no-50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Apogee distance'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "r=620.0 # distance from earth's surface in km\n",
+ "vp=8.0 # horizontal velocity of satelliteat 9000km height in km/s\n",
+ "R=6380.0 # Earth's radius in km\n",
+ "d=9000.0 # distance of point at which velocity to be calculated\n",
+ "theta=30.0 # angle made by satellite with local horzon at that point\n",
+ "mu=39.8*10**13 # Nm**2/kg\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "P=r+R\n",
+ "m=vp*d*math.cos(theta*math.pi/180)/P #m=sqrt((2mu/P)-[2mu/(A+P)])\n",
+ "m=(m*10**3)**2\n",
+ "x=(2*mu/(P*10**3))-m #x=[2mu/(A+P)]\n",
+ "x=math.floor(x/10**4)*10**4\n",
+ "k=(2*mu)/x #k=A+P\n",
+ "k=math.ceil(k/10**4)*10**4\n",
+ "A=k-(P*10**3)\n",
+ "\n",
+ "#Result\n",
+ "print(\"A = %.0f km\"%(A/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 16170 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.19, page no-58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Height of satellite orbit above eart surface'''\n",
+ "\n",
+ "import math\n",
+ "#variable declaration\n",
+ "R=6380 #Earth's radius in km\n",
+ "T=86160 #Orbital period of Geostationary satellite in km\n",
+ "mu=39.8*10**13 #in Nm^2/k\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "r=(T*math.sqrt(mu)/(2*math.pi))**(2.0/3.0) # Answer matches to the answer given in the book if value of pi is taken as 3.14 \n",
+ "\n",
+ "#Result\n",
+ "print('Radius of satellite is, r = %.0f km'%(r/1000))\n",
+ "print('Therefore, height of satellite orbit above earth surface is %.0f km '%((r/1000)-R))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radius of satellite is, r = 42142 km\n",
+ "Therefore, height of satellite orbit above earth surface is 35762 km \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.20, page no-59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Orbital time period'''\n",
+ "import math\n",
+ "#variable declaration\n",
+ "\n",
+ "R=6380 #radius of earth in km\n",
+ "P=400 #Perigee distance in km\n",
+ "A=40000 #Apogee distance in km\n",
+ "mu=39.8*10**13 #in Nm^2/k\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "a=(A+P+R+R)/2 #semi-major axis of the elliptical orbit\n",
+ "\n",
+ "T=(2*math.pi*(a*10**3)**(3.0/2.0))/math.sqrt(mu)\n",
+ "\n",
+ "h=T/(60*60)\n",
+ "x=T%3600\n",
+ "m=x/60\n",
+ "s=x%60\n",
+ "\n",
+ "#Result\n",
+ "print('T = %dsec\\n = %dh %dm %ds\\n\\nThis approximately equal to 12 hour'%(T,math.floor(h),math.floor(m),math.floor(s)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T = 43158sec\n",
+ " = 11h 59m 18s\n",
+ "\n",
+ "This approximately equal to 12 hour\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Satellite_Communication/chapter_3.ipynb b/Satellite_Communication/chapter_3.ipynb
new file mode 100644
index 00000000..376a12af
--- /dev/null
+++ b/Satellite_Communication/chapter_3.ipynb
@@ -0,0 +1,761 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Satellite Launch and In-Orbit Operations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1, page no-72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Inclination angle'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "Az=85 # Azimuth angle of injection point\n",
+ "l=5.2 # latitude of launch site\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "cosi=math.sin(Az*math.pi/180)*math.cos(l*math.pi/180)\n",
+ "i=math.acos(cosi)\n",
+ "i=i*180.0/math.pi\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Inclination angle attained, i=%.1f\u00b0\"%i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inclination angle attained, i=7.2\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2, page no-73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Velocity thrust'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "delta_i=7 #orbital plane inclination\n",
+ "V=3000 #velocity of satellite in circularized orbit\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "vp=2*V*math.sin(delta_i*math.pi/(2*180))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Velocity thrust to make the inclination 0\u00b0 = %.0f m/s\"%vp)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity thrust to make the inclination 0\u00b0 = 366 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3, page no-73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''velocity thrust'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "mu=39.8*10**13 # Nm^2/kg\n",
+ "P=7000.0*10**3 # Perigee distance in m\n",
+ "e=0.69 # eccentricity of eliptical orbit\n",
+ "w=60.0/2 # angle made by line joing centre of earth and perigee with the line of nodes\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "k=(e/math.sqrt(1+e))\n",
+ "k=math.floor(k*100)/100\n",
+ "v=2*(math.sqrt(mu/P))*k*math.sin(w*math.pi/180.0)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"The velocity thrust required to rotate the perigee point\\n by desired amount is given by, v=%.1f m/s = %.3fkm/s\"%(v,v/1000.0))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity thrust required to rotate the perigee point\n",
+ " by desired amount is given by, v=3996.4 m/s = 3.996km/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.4, page no-74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Thrust velocity'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "A=15000*10**3 #Original apogee distance\n",
+ "A1=25000*10**3 # Raised opogee distance\n",
+ "P=7000*10**3 # Perigee Distance\n",
+ "mu=39.8*10**13 #Nm**2/kg\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "A_d=A1-A\n",
+ "v=math.sqrt((2*mu/P)-(2*mu/(A+P)))\n",
+ "del_v=A_d*mu/(v*(A+P)**2)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"required Thrust velocity Delta_v = %.1f m/s\"%del_v)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "required Thrust velocity Delta_v = 933.9 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.5, page no-75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Thrust velocity'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "A=15000.0*10**3 # Original apogee distance\n",
+ "A1=7000.0*10**3 # Raised opogee distance\n",
+ "P=7000.0*10**3 # Perigee Distance\n",
+ "mu=39.8*10**13 # Nm^2/kg\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "A_d=A-A1\n",
+ "v=math.sqrt((2*mu/P)-(2*mu/(A+P)))\n",
+ "del_v=A_d*mu/(v*(A+P)**2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"required Thrust velocity Delta_v = %.1f m/s\"%del_v)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "required Thrust velocity Delta_v = 747.1 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.6, page no-76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Thrust velocity '''\n",
+ "#Variable Declaration\n",
+ "A=15000.0*10**3 # Original apogee distance\n",
+ "A1=16000.0*10**3 # Raised opogee distance\n",
+ "P=7000.0*10**3 # Perigee Distance\n",
+ "mu=39.8*10**13 # Nm**2/kg\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "A_d=A1-A\n",
+ "v=math.sqrt((2*mu/P)-(2*mu/(A+P)))\n",
+ "v=v*P/A\n",
+ "del_v=A_d*mu/(v*(A+P)**2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"required Thrust velocity Delta_v = %.1f m/s\"%del_v)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "required Thrust velocity Delta_v = 200.1 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.7, page no-77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Thrust velocity'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "R=6378.0*10**3 # Radius of earth\n",
+ "mu=39.8*10**13 # Nm**2/kg\n",
+ "r1=500.0*10**3 # original orbit from earths surface\n",
+ "r2=800.0*10**3 # orbit to be raised to thisdistance\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "R1=R+r1\n",
+ "R2=R+r2\n",
+ "delta_v=math.sqrt(2*mu*R2/(R1*(R1+R2)))-math.sqrt(mu/R1)\n",
+ "delta_v_dash=math.sqrt(mu/R2)-math.sqrt(2*mu*R1/(R2*(R1+R2)))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Two thrusts to be applied are,\\n Delta_v = %.2f m/s \\n Delta_v_dash = %.2f m/s\"%(delta_v,delta_v_dash))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Two thrusts to be applied are,\n",
+ " Delta_v = 80.75 m/s \n",
+ " Delta_v_dash = 79.89 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.8, page no-97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Maximum line-of-sight distance'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "H=36000.0 # Height of geostationary satellite from the surface of earth\n",
+ "R=6370.0 # Radius of earth in km\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "k=math.acos(R/(R+H))\n",
+ "#k=k*180/%pi\n",
+ "k=math.sin(k)\n",
+ "k=math.ceil(k*1000)/1000\n",
+ "d=2*(H+R)*k\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Maximum line-of-sight distance is %.2f km\"%d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum line-of-sight distance is 83807.86 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.9, page no-98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "''' line-of-sight distance'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "H=36000.0 # Height of geostationary satellite from the surface of earth\n",
+ "R=6370.0 # Radius of earth in km\n",
+ "theta=20.0 # angular separation between two satellites\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "D=(H+R)\n",
+ "k=math.ceil(math.cos(theta*math.pi/180.0)*100)/100\n",
+ "d=math.sqrt(2*D**2*(1-k))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"The line-of-sight distance is %.4f km\"%d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The line-of-sight distance is 14677.3985 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.10, page no-98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Inter-satellite distance'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "#IntelSat-VI location= 37 W\n",
+ "# IntelSat-VII location=74 E\n",
+ "theta=37+74 # angular separation between two satellites\n",
+ "D=42164.0 # circular equilateral geostationary orbit in km\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "k=math.cos(math.pi*theta/180.0)\n",
+ "#printf(\"%f\\n\",k)\n",
+ "k=-0.357952\n",
+ "d=math.sqrt(2*D**2*(1-k))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Inter-satellite distance is %.2f km\"%d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inter-satellite distance is 69486.27 km\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.11, page no-99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Azimuth and elevation angle'''\n",
+ "import math\n",
+ "\n",
+ "theta_l=30.0 # earth station's location 30\u00b0W longitude\n",
+ "theta_s=50.0 # satellite's location 50\u00b0W longitude\n",
+ "theta_L=60.0 # earth station's location 60\u00b0N latitude\n",
+ "r=42164.0 # orbital radius of the satellite in km\n",
+ "R=6378.0 # Earth's radius in km\n",
+ "\n",
+ "A_dash=math.atan((math.tan(math.pi*(theta_s-theta_l)/180.0))/math.sin(math.pi*60/180.0))\n",
+ "A_dash=A_dash*180/math.pi\n",
+ "A=180+A_dash #Azimuth angle\n",
+ "\n",
+ "x=(180/math.pi)*math.acos(math.cos(math.pi*(theta_s-theta_l)/180.0)*math.cos(math.pi*theta_L/180))\n",
+ "y=r-math.ceil(R*(math.cos(math.pi*(theta_s-theta_l)/180.0)*math.cos(math.pi*theta_L/180)))\n",
+ "z=R*math.sin(math.pi*x/180)\n",
+ "E=(math.atan(y/z)*180/math.pi)-x\n",
+ "print(\"Azimuth angle =%.1f\u00b0\\n Elevation angle =%.1f\u00b0\"%(A,E))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Azimuth angle =202.8\u00b0\n",
+ " Elevation angle =19.8\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.12, page no-100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Time Delay'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "theta_l=60.0 #earth station's location 60\u00b0W longitude\n",
+ "theta_s=105.0 #satellite's location 105\u00b0W longitude\n",
+ "theta_L=30.0 #earth station's location 30\u00b0N latitude\n",
+ "\n",
+ "theta_l1=90.0 #earth station's location 90\u00b0W longitude\n",
+ "theta_s1=105.0 #satellite's location 105\u00b0W longitude\n",
+ "theta_L1=45.0 #earth station's location 45\u00b0N latitude\n",
+ "\n",
+ "c=3*10**8 # speed of light\n",
+ "r=42164.0 # orbital radius of the satellite in km\n",
+ "R=6378.0 # Earth's radius in km\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "x=(180/math.pi)*math.acos(math.cos(math.pi*(theta_s-theta_l)/180)*math.cos(math.pi*theta_L/180))\n",
+ "y=r-math.ceil(R*(math.cos(math.pi*(theta_s-theta_l)/180)*math.cos(math.pi*theta_L/180)))\n",
+ "z=R*math.sin(math.pi*x/180)\n",
+ "E=(math.atan(y/z)*180/math.pi)-x\n",
+ "\n",
+ "x1=(180/math.pi)*math.acos(math.cos(math.pi*(theta_s1-theta_l1)/180)*math.cos(math.pi*theta_L1/180))\n",
+ "y1=r-math.ceil(R*(math.cos(math.pi*(theta_s1-theta_l1)/180)*math.cos(math.pi*theta_L1/180)))\n",
+ "z1=R*math.sin(math.pi*x1/180)\n",
+ "E1=(math.atan(y1/z1)*180/math.pi)-x1\n",
+ "E1=math.floor(E1)\n",
+ "\n",
+ "#calculation of slant range dx\n",
+ "k=(R/r)*math.cos(math.pi*E/180)\n",
+ "k=(180/math.pi)*math.asin(k)\n",
+ "k=k+E\n",
+ "k=math.sin(math.pi*k/180)\n",
+ "k=math.ceil(k*1000)/1000\n",
+ "#k=k+E\n",
+ "#k=sin(k)\n",
+ "dx=(R)**2+(r)**2-(2*r*R*k)\n",
+ "dx=math.sqrt(dx)\n",
+ "\n",
+ "\n",
+ "#calculation of slant range dy\n",
+ "k1=(R/r)*math.cos(math.pi*E1/180)\n",
+ "k1=(180/math.pi)*math.asin(k1)\n",
+ "k1=k1+E1\n",
+ "k1=math.floor(k1)\n",
+ "k1=math.sin(math.pi*k1/180)\n",
+ "k1=math.ceil(k1*1000)/1000\n",
+ "dy=(R)**2+(r)**2-(2*r*R*k1)\n",
+ "dy=math.sqrt(dy)\n",
+ "\n",
+ "tr=dy+dx\n",
+ "delay=tr*10**6/c\n",
+ "x=50\n",
+ "td=delay+x\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Elevation angle, Ex =%.1f\u00b0\"%E)\n",
+ "print(\"\\n Elevation angle, Ey =%.1f\u00b0\"%math.floor(E1))\n",
+ "print(\"\\n Slant range dx of the earth station X is dx=%.2fkm\"%dx)\n",
+ "print(\"\\n Slant range dy of the earth station Y is dy=%.1fkm\"%dy)\n",
+ "print(\"\\n Therefore, total range to be covered is %.2fkm\"%tr)\n",
+ "print(\"\\n propagation delay=%.2fms\"%delay)\n",
+ "print(\"\\n\\n Time required too transmit 500 kbs of information at \\n a transmisssion speed of 10Mbps is given by 500000/10^7=%.0fms\"%(500000000.0/10**7))\n",
+ "print(\"\\n\\n Total Delay= %.2fms\"%td)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Elevation angle, Ex =30.3\u00b0\n",
+ "\n",
+ " Elevation angle, Ey =36.0\u00b0\n",
+ "\n",
+ " Slant range dx of the earth station X is dx=38584.76km\n",
+ "\n",
+ " Slant range dy of the earth station Y is dy=38100.8km\n",
+ "\n",
+ " Therefore, total range to be covered is 76685.57km\n",
+ "\n",
+ " propagation delay=255.62ms\n",
+ "\n",
+ "\n",
+ " Time required too transmit 500 kbs of information at \n",
+ " a transmisssion speed of 10Mbps is given by 500000/10^7=50ms\n",
+ "\n",
+ "\n",
+ " Total Delay= 305.62ms\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.13, page no-102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Inter-satellite distance'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "da=38000.0 # slant range of satellite A\n",
+ "db=36000.0 # slant range of satellite B\n",
+ "beeta=60.0 # difference between longitudes of two satellites\n",
+ "R=42164.0 # radius of the orbit of satellites\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "theta=(da**2+db**2-2*(R**2)*(1-math.cos(math.pi*beeta/180)))/(2*da*db)\n",
+ "theta=(180/math.pi)*math.acos(theta)\n",
+ "d=math.sqrt(2*(R**2)*(1-math.cos(math.pi*beeta/180)))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Angular spacing between two satellites viewed by earth station is,\\n theta= %.1f\u00b0\"%theta)\n",
+ "print(\"\\nInter-satellite distance , d=%.0fkm\"%d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angular spacing between two satellites viewed by earth station is,\n",
+ " theta= 69.4\u00b0\n",
+ "\n",
+ "Inter-satellite distance , d=42164km\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.14, page no-107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''covered surface area'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "r=42164.0 # orbital radius of the satellite in km\n",
+ "R=6378.0 # Earth's radius in km\n",
+ "\n",
+ "#refer to Figure 3.53\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#for E=0\u00b0\n",
+ "alfa=math.asin(R/r)*(180/math.pi)\n",
+ "alfa=math.floor(alfa*10)/10\n",
+ "theta=90-alfa\n",
+ "#in the right angle triangle OAC,\n",
+ "k=math.sin(math.pi*alfa/180)\n",
+ "k=math.floor(k*1000)/1000\n",
+ "oc=R*k\n",
+ "oc=math.ceil(oc*10)/10\n",
+ "A=2*math.pi*R*(R-oc)\n",
+ "\n",
+ "\n",
+ "#for E=10\u00b0\n",
+ "E=10\n",
+ "alfa1=math.asin((R/r)*math.cos(math.pi*E/180))*(180/math.pi)\n",
+ "#alfa1=ceil(alfa1*100)/100\n",
+ "theta1=90-alfa1-E\n",
+ "#in the right angle triangle OAC,\n",
+ "k1=math.sin(math.pi*(alfa1+E)/180)\n",
+ "k1=math.floor(k1*1000)/1000\n",
+ "oc1=R*k1\n",
+ "oc1=math.floor(oc1*10)/10\n",
+ "A1=2*math.pi*R*(R-oc1)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"for E=0\u00b0,\\n covered surface area is %.1f km^2\"%A)\n",
+ "print(\"\\n\\n for E=10\u00b0,\\n covered surface area is %.1f km^2\"%A1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for E=0\u00b0,\n",
+ " covered surface area is 216997546.7 km^2\n",
+ "\n",
+ "\n",
+ " for E=10\u00b0,\n",
+ " covered surface area is 174314563.3 km^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.15, page no-108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Area swept by ground track of sattelite'''\n",
+ "#variable declaration\n",
+ "theta=30 #satellite inclination to the equitorial plan\n",
+ "#the extreme latitudes covered in northern and southern hemisphere are the same as orbit inclination\n",
+ "\n",
+ "print(\"Extreme Northern latitude covered = %.0f\u00b0 N\"%theta)\n",
+ "print(\"\\n Extreme Southern latitude covered = %.0f\u00b0 S\"%theta)\n",
+ "print(\"\\n\\n In fact, the ground track would sweep\\n all latitudes between %d\u00b0N and %d\u00b0S\"%(theta,theta))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Extreme Northern latitude covered = 30\u00b0 N\n",
+ "\n",
+ " Extreme Southern latitude covered = 30\u00b0 S\n",
+ "\n",
+ "\n",
+ " In fact, the ground track would sweep\n",
+ " all latitudes between 30\u00b0N and 30\u00b0S\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Satellite_Communication/chapter_4.ipynb b/Satellite_Communication/chapter_4.ipynb
new file mode 100644
index 00000000..85428bc4
--- /dev/null
+++ b/Satellite_Communication/chapter_4.ipynb
@@ -0,0 +1,642 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Satellite Hardware"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1, page no-122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Ejection velocity of the propellant mass'''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "I=250 #specific impulse of a propellant\n",
+ "g=9.807 # acceleration due to gravity\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "v=I*g\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Ejection velocity of the propellant mass is, v= %.2f m/s\"%v)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ejection velocity of the propellant mass is, v= 2451.75 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2, page no-122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Mass of propellant'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "m=4330.0 #initial mass of the satellite\n",
+ "i=290.0 #specific impulse of a propellant\n",
+ "del_v=-100 #velocity increment\n",
+ "g=9.807 #acceleration due to gravity\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "m1=m*(1-math.exp(del_v/(g*i)))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Mass of propellant necessary to be burnt is, m= %.0fkg\"%math.ceil(m1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of propellant necessary to be burnt is, m= 150kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3, page no-123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Mass of propellant'''\n",
+ "#Variable Declaration\n",
+ "m=2950.0 #initial mass of the satellite\n",
+ "F=450.0 #required thrust\n",
+ "T=10.0 #thrust for time period\n",
+ "i=300.0 #specific impulse of a propellant\n",
+ "g=9.807 #acceleration due to gravity\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "mi=F*T/(i*g)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Mass of propellant that would be consumed is, m=%.2fkg\"%mi)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of propellant that would be consumed is, m=1.53kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5, page no-134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''solar cells'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "p=2000.0 # electrical energy to be generated from solar panel in Watt\n",
+ "fi=1250.0 # solar flux falling normally to the solar cell in worst case\n",
+ "s=4*10**-4 # Area of each solar cell\n",
+ "e=0.15 # conversion efficiency of solar cell includingthe losses\n",
+ "theta=10.0 # angle made by rays of sun with normal \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "n=p/(fi*s*e)\n",
+ "n1=math.ceil(n)*math.pi\n",
+ "n2=math.ceil(n1)/math.cos(math.pi*(theta)/180.0)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Required no of solar cells, n = %.0f cells\"%math.ceil(n1))\n",
+ "print(\"\\n No of cells when sunrays are making an angle of 10\u00b0 are %.0f\"%math.ceil(n2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required no of solar cells, n = 83777 cells\n",
+ "\n",
+ " No of cells when sunrays are making an angle of 10\u00b0 are 85070\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6, page no-134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Battery System Requirement'''\n",
+ "#Variable Declaration\n",
+ "p=3600.0 #Power required\n",
+ "t=1.2 #worst case eclipse period\n",
+ "c=90.0 #capacity of each cell in Ah\n",
+ "v=1.3 #voltage of each cell in V\n",
+ "d=0.8 # Depth of discharge\n",
+ "e=0.95 #Discharge efficiency\n",
+ "E_sp=60.0 #specific energy specification of the battery\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "energy=p*t\n",
+ "n=energy/(c*v*d*e)\n",
+ "E_b=energy/(d*e)\n",
+ "m=E_b/E_sp\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"No of cells, n= %.0f cells\\n Energy required to be stored in the battery system is %.1f Wh\\n Mass of battery system = %.2f kg\"%(n,E_b,m))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No of cells, n= 49 cells\n",
+ " Energy required to be stored in the battery system is 5684.2 Wh\n",
+ " Mass of battery system = 94.74 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7, page no-153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Antenna Gain'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "theta=0.5 #azimuth beam width=Elevation beam width\n",
+ "f=6.0*10**9 #operating frequency 6 Ghz\n",
+ "c=3.0*10**8 #speed of light in cm/s\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "theta_r=theta*math.pi/180.0\n",
+ "theta_r=math.ceil(theta_r*10**5)/10**5\n",
+ "A=4*math.pi/(theta_r**2)\n",
+ "A=math.ceil(A*100)/100\n",
+ "A_dB=10*math.log10(A)\n",
+ "lam=c/f\n",
+ "Ag=(A*lam**2)/(4*math.pi)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Gain in dB = %.2f dB \\nAntenna gain expressed in terms of\\nantenna aperture(A) is given by G = %.2f m^2\"%(A_dB,Ag))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gain in dB = 52.17 dB \n",
+ "Antenna gain expressed in terms of\n",
+ "antenna aperture(A) is given by G = 32.80 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.8, page no-153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Aperture efficiency and Effective Aperture'''\n",
+ "#Variable Declaration\n",
+ "la=0.5 #length efficiency in azimuth direction\n",
+ "le=0.7 #length efficiency in elevation direction \n",
+ "A=10 #Actual projected area of an antenna\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Ae=la*le\n",
+ "Aee=Ae*A\n",
+ "\n",
+ "#Result\n",
+ "print(\"Aperture efficiency = %.2f \\n Effective Aperture = %.1f m^2\"%(Ae,Aee))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Aperture efficiency = 0.35 \n",
+ " Effective Aperture = 3.5 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.9, page no-154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Directivity'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "p=100 #Antenna power in W\n",
+ "pd=10 #Power Density in mW/m^2\n",
+ "d=1000 #distance in m\n",
+ "p2=10000 #New antenna power\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "directivity=10*math.log10(p2/p)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Directivity (in dB)= %d dB\"%directivity)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Directivity (in dB)= 20 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.10, page no-154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''null-to-null beam width'''\n",
+ "#Variable Declaration\n",
+ "beam_w=0.4 #antenna's 3dB beam width\n",
+ "Ae=5 #Effective Aperture of Antenna\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"The null-to-null beam width of a paraboloid reflector is twice its 3dB beam width. \\n Therefore, Null-to-null beam width = %.1f\u00b0\"%(2*beam_w))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The null-to-null beam width of a paraboloid reflector is twice its 3dB beam width. \n",
+ " Therefore, Null-to-null beam width = 0.8\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.11, page no-154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Polarization loss and Received signal strength'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "d=20.0 #received signal strenth in dB\n",
+ "loss=3.0 #incident polarization is circular and antenna is circularly polarized\n",
+ "theta=60.0 #received wave making angle with horizontal\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "total=d+loss\n",
+ "los=d*math.log10(1/math.cos(math.pi*theta/180.0))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"(a)\\n When received polarization is same as antenna \\n polarization,thepolarization loss is zero.\\n Therefore, received sinal strenth = %ddB\"%total)\n",
+ "print(\"\\n\\n(b)\\n When the incident wave is vertically polarized,\\n the angle between incident polarization and antenna polarization is 90\u00b0\\n Hence, Polarization loss = infinity\\n received signal strength = 0\")\n",
+ "print(\"\\n\\n(c)\\n When incident wave is left-hand circularly polarized\\n and antenna polarization is linear,\\n then there is polarization loss of %ddB and\\n received signal strength is %ddB\"%(loss,d))\n",
+ "print(\"\\n\\n(d)\\n Polarization loss = %ddB \\n Received signal strength = %ddB\"%(los,math.ceil(total-los)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " When received polarization is same as antenna \n",
+ " polarization,thepolarization loss is zero.\n",
+ " Therefore, received sinal strenth = 23dB\n",
+ "\n",
+ "\n",
+ "(b)\n",
+ " When the incident wave is vertically polarized,\n",
+ " the angle between incident polarization and antenna polarization is 90\u00b0\n",
+ " Hence, Polarization loss = infinity\n",
+ " received signal strength = 0\n",
+ "\n",
+ "\n",
+ "(c)\n",
+ " When incident wave is left-hand circularly polarized\n",
+ " and antenna polarization is linear,\n",
+ " then there is polarization loss of 3dB and\n",
+ " received signal strength is 20dB\n",
+ "\n",
+ "\n",
+ "(d)\n",
+ " Polarization loss = 6dB \n",
+ " Received signal strength = 17dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.12, page no-155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Antenna Gain and beam width'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "Ea=1 #effective aperture\n",
+ "f=11.95*10**9 #downlink operating frequency\n",
+ "c=3*10**8 #speed of light\n",
+ "\n",
+ "Ae=math.floor((math.pi*1000*Ea**2)/4)/1000\n",
+ "lamda=math.floor(c*1000/f)/1000\n",
+ "ag=math.floor(100*4*math.pi*Ae/lamda**2)/100\n",
+ "adb=math.floor(100*10*math.log10(ag))/100\n",
+ "width=70*lamda/Ea\n",
+ "print(\"Operating wavelength = %.3fm\\n Antenna Gain = %.2f\\n Antenna Gain in dB = %.2fdB\\n 3dB beam width = %.2f\u00b0\"%(lamda,ag,adb,width))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating wavelength = 0.025m\n",
+ " Antenna Gain = 15783.36\n",
+ " Antenna Gain in dB = 41.98dB\n",
+ " 3dB beam width = 1.75\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.13, page no-155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Beam Width'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "f=2.0 # reflector focal length\n",
+ "d=2.0 # reflector diameter\n",
+ "l=90.0/100.0 # 90% of the angle\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "theta=4*180.0*(math.atan(1/(4*f/d)))/math.pi\n",
+ "theta=4*180.0*math.atan(0.25007)/math.pi # this value gives exact answer as in book\n",
+ "dbw=l*theta\n",
+ "\n",
+ "#Result\n",
+ "print(\"The angle subtended by the focal point feed\\n at the edges of the reflector is, theeta = %.2f\u00b0\\n\\n 3dB beam width = %.2f\u00b0\\n null-to-null beam width = % .2f\u00b0\"%(theta,dbw,math.floor(200.0*dbw)/100.0))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The angle subtended by the focal point feed\n",
+ " at the edges of the reflector is, theeta = 56.16\u00b0\n",
+ "\n",
+ " 3dB beam width = 50.54\u00b0\n",
+ " null-to-null beam width = 101.08\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.14, page no-155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''phase angles'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "c=3*10**8 #speed of light \n",
+ "f=2.5*10**9 #operating frequency\n",
+ "s=0.1 #inter element spacing\n",
+ "theta =10 #10\u00b0 right towards array axis\n",
+ "\n",
+ "#Calculation\n",
+ "l=c/f\n",
+ "fi=(360*s/l)*math.ceil(10000*math.sin(math.pi*theta/180.0))/10000\n",
+ "fi=math.ceil(10*fi)/10\n",
+ "\n",
+ "#Result\n",
+ "print(\"The phase angle for elements 1,2,3,4 and 5 \\n are respecively 0\u00b0,%.1f\u00b0,%.1f\u00b0,%.1f\u00b0 and %.1f\u00b0\"%(fi,2*fi,3*fi,4*fi))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The phase angle for elements 1,2,3,4 and 5 \n",
+ " are respecively 0\u00b0,52.2\u00b0,104.4\u00b0,156.6\u00b0 and 208.8\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.15, page no-156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Earth station EIRP'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "p=10000 #power fed to the antenna in W\n",
+ "ag=60 #Antenna gain\n",
+ "loss=2 #Power lossin feed system\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "adb=10*math.log10(p)\n",
+ "EIRP=adb+ag-loss\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Earth station EIRP = %ddB\"%EIRP)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Earth station EIRP = 98dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Satellite_Communication/chapter_5.ipynb b/Satellite_Communication/chapter_5.ipynb
new file mode 100644
index 00000000..4834f8d0
--- /dev/null
+++ b/Satellite_Communication/chapter_5.ipynb
@@ -0,0 +1,618 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 5: Communication Techniques"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1, page no-174 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power Saving'''\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#for case (a)\n",
+ "\n",
+ "#Variable Declaration\n",
+ "m=0.5 #modulation index\n",
+ "\n",
+ "#Calculation\n",
+ "#for AM\n",
+ "pt1=(1+(m**2)/2.0)\n",
+ "#for SSBSC\n",
+ "pt2=(m**2)/4.0\n",
+ "#% power saving\n",
+ "p=(pt1-pt2)*100/pt1\n",
+ "p=math.floor(p*10)/10\n",
+ "\n",
+ "#Result\n",
+ "print(\"Percentage power saving is %.1f%%\"%p)\n",
+ "\n",
+ "#for case (b)\n",
+ "\n",
+ "#Variable Declaration\n",
+ "m=1 #modulation index\n",
+ "\n",
+ "#Calculation\n",
+ "#for AM\n",
+ "pt1=(1+(m**2)/2.0)\n",
+ "#for SSBSC\n",
+ "pt2=(m**2)/4.0\n",
+ "#% power saving\n",
+ "p=(pt1-pt2)*100/pt1\n",
+ "p=math.floor(p*10)/10\n",
+ "\n",
+ "#Result\n",
+ "print(\"\\n Percentage power saving is %.1f%%\"%p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage power saving is 94.4%\n",
+ "\n",
+ " Percentage power saving is 83.3%\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2, page no-174 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Total power in modulated signal'''\n",
+ "#Variable Declaration\n",
+ "pc=500 #energy of carrier signal\n",
+ "m=0.6 #AM modulation index\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#for (a)\n",
+ "pt=pc*(1+(m**2)/2)\n",
+ "\n",
+ "#for (b)\n",
+ "pt2=pc*(m**2)/4\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"(a)\\n A3E is the double side band AM with full carrier.\\n Therefore, Pt= %.0f W\\n\\n (b)\\n J3E is an SSBSC system.\\n Therefore, Pt= %.0f W\"%(pt,pt2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " A3E is the double side band AM with full carrier.\n",
+ " Therefore, Pt= 590 W\n",
+ "\n",
+ " (b)\n",
+ " J3E is an SSBSC system.\n",
+ " Therefore, Pt= 45 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3, page no-175 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Percentage power saving'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "m=0.6 #60% modulation\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#for A3E\n",
+ "pt1=(1+(m**2)/2)\n",
+ "#for J3E\n",
+ "pt2=(m**2)/4\n",
+ "#% power saving\n",
+ "p=(pt1-pt2)*100/pt1\n",
+ "p=math.ceil(p*10)/10\n",
+ "\n",
+ "#Result\n",
+ "print(\"Percentage power saving is %.2f%%\"%p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage power saving is 92.40%\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4, page no-175 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Carrier frequency in terms of modulating frequency'''\n",
+ "#Variable Declaration\n",
+ "#multiplication of two signals gives AM with frequency component(wc-wm) and (wc+wm) and its BW is 2wm\n",
+ "bw=0.5/100 #bw is 0.5% of carrier freq. \n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "wc=2/bw\n",
+ "\n",
+ "#Result\n",
+ "print(\"Wc = %.0f*Wm\"%wc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wc = 400*Wm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5, page no-190 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Unmodulated carrier frequency, modulation index, Modulating frequency'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "#comparing given equation with stanard equation\n",
+ "m=6.0 #Modulation Index\n",
+ "wc=7.8*10**8 #unmodulated carrier frequency\n",
+ "wm=1450 #Modulating frequency\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "fc=wc/(2*math.pi)\n",
+ "fm=wm/(2*math.pi)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Unmodulated carrier frequency, fc = %.2f MHz \\n The modulation index m = %d \\n Modulating frequency, fm = %.2f Hz\"%(fc/10**6,m,fm))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Unmodulated carrier frequency, fc = 124.14 MHz \n",
+ " The modulation index m = 6 \n",
+ " Modulating frequency, fm = 230.77 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7, page no-191 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''frequency deviation and Bandwidth'''\n",
+ "#Variable Declaration\n",
+ "#comparing given equation with stanard equation\n",
+ "mf=150 #modulation index\n",
+ "fm=1 # modulating frequency in KHz\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "fd=mf*fm\n",
+ "bw=2*(mf+1)*fm\n",
+ "\n",
+ "#Result\n",
+ "print(\"frequency deviation = %.0f kHz\\n Bandwidth = %.0f kHz \\n\\n Expression for instantaneous frequency is given by, \\n f = 10^8-150*(10^3)*sin(2*3.14*10^3*t)\"%(fd,bw))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency deviation = 150 kHz\n",
+ " Bandwidth = 302 kHz \n",
+ "\n",
+ " Expression for instantaneous frequency is given by, \n",
+ " f = 10^8-150*(10^3)*sin(2*3.14*10^3*t)\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8, page no-191 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "fd=50 #frequency deviation in kHz\n",
+ "fm=1.0 #modulating frequency in kHz for case 1\n",
+ "fm2=100.0 #modulating frequency in kHz for case 2\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "#for case 1\n",
+ "m=fd/fm\n",
+ "bw=2*(m+1)*fm\n",
+ "#for case 2\n",
+ "m2=fd/fm2\n",
+ "bw2=2*(m2+1)*fm2\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"For first case\\n Modulation index = %.0f \\n Bandwidth = %.0f kHz \\n\\n For second case\\n Modulation index = %.1f \\n Bandwidth = %.0f kHz\"%(m,bw,m2,bw2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9, page no-192 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''New modulation index and New bandwidth'''\n",
+ "#Variable Declaration\n",
+ "bw=20*10**3 #bandwidth in Hz\n",
+ "fm=1* 10**3 #modulating frequency in Hz\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "mf=(bw/(2*fm))-1\n",
+ "new_mf=mf*6\n",
+ "new_fm=0.5 #kHz\n",
+ "new_bw=2*(new_mf+1)*new_fm\n",
+ "\n",
+ "#Result\n",
+ "print(\"mf=%.0f\\n New modulation index = %.0f\\n New bandwidth = %.0f kHz\"%(mf,new_mf,new_bw))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mf=9\n",
+ " New modulation index = 54\n",
+ " New bandwidth = 55 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10, page no-192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Deviation Ratio and Bandwidth'''\n",
+ "\n",
+ "#Variable Declaration\n",
+ "fd=75.0 #Maximum allowed frequency deviation in kHz\n",
+ "fm=15.0 #Highest modulating frequency in kHz\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "D=fd/fm\n",
+ "bw=2*(D+1)*fm\n",
+ "\n",
+ "#Result\n",
+ "print(\"Deviation Ratio, D = %.0f\\n Bandwidth = %.0f kHz\"%(D,bw))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Deviation Ratio, D = 5\n",
+ " Bandwidth = 180 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11, page no-199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''no of bits,no of quantizing levels and samplinf frequecy''' \n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "fm=3200.0 #highest frequency component in message signal\n",
+ "k=48000.0 #channel capacity in b/s\n",
+ "\n",
+ "#Calculation\n",
+ "fs=2*fm\n",
+ "n=k/fs\n",
+ "n=math.floor(n)\n",
+ "\n",
+ "#Result\n",
+ "print(\"n = %.0f\\n L = 2^7 = %.0f\\n fs = %.3f kHz\"%(n,2**7,(k/7)/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n = 7\n",
+ " L = 2^7 = 128\n",
+ " fs = 6.857 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12, page no-199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Nyquist rate'''\n",
+ "#Variable Declaration\n",
+ "#re-arranging equation and comparing it with standard equation we have,\n",
+ "f=2500 #Highest frequency component in the signal in Hz\n",
+ "\n",
+ "#result\n",
+ "print(\"Nyquist rate = 2 x f\\n\\t = %.0f Hz = %.0f kHz\"%(2*f,2*f/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nyquist rate = 2 x f\n",
+ "\t = 5000 Hz = 5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13, page no-199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Time duration of one bit'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "l=128 #no of Quantizing levels\n",
+ "fs=10000.0 #sampling frequency in Hz\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "n=7 #math.log2(l)\n",
+ "t=1/(n*fs)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Number of bits per sample (n) = %.0f\\n Time duration of one bit of binary encoded signal is %.3f micro second\"%(n,t*10**6))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of bits per sample (n) = 7\n",
+ " Time duration of one bit of binary encoded signal is 14.286 micro second\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.15, page no-208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Sampling rate and Sampling interval of the composite signal'''\n",
+ "f1=2.4 #first signal frequency\n",
+ "f2=3.2 #2nd signal frequency\n",
+ "f3=3.4 #3rd signal frequency\n",
+ "\n",
+ "#minimum sampling rate for each of the signals would be twice the highest frequency component\n",
+ "\n",
+ "\n",
+ "sr=3*(f3*2)\n",
+ "st=10**6/(sr*10**3)\n",
+ "print(\"Sampling rate of the composite signal = %.1f kHz \\nSampling interval of the composite signal = %.0f micro second\"%(sr,st))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sampling rate of the composite signal = 20.4 kHz \n",
+ "Sampling interval of the composite signal = 49 micro second\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.16, page no-209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Number of bits in each frame, Bit duration, micro second, Transmission rate'''\n",
+ "import math\n",
+ "\n",
+ "bw=3.2 # voice channel band limited frequency in kHz\n",
+ "r=1.2 # 1.2 times the Nyquist rate\n",
+ "n=24.0 # no of voice channel\n",
+ "b=8.0 # 8-bit PCM\n",
+ "sr=2*bw*r\n",
+ "p=10**6/(sr*10**3)\n",
+ "N=(n*b)+1\n",
+ "bit_d=p/N\n",
+ "bit_d=math.ceil(bit_d*1000)/1000\n",
+ "tr=1/bit_d\n",
+ "\n",
+ "print(\"Number of bits in each frame = %.0f \\nBit duration = %.3f micro second \\nTransmission rate = %.3f Mbps\"%(N,bit_d,math.ceil(tr*1000)/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of bits in each frame = 193 \n",
+ "Bit duration = 0.675 micro second \n",
+ "Transmission rate = 1.482 Mbps\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Satellite_Communication/chapter_6.ipynb b/Satellite_Communication/chapter_6.ipynb
new file mode 100644
index 00000000..f4e3eeff
--- /dev/null
+++ b/Satellite_Communication/chapter_6.ipynb
@@ -0,0 +1,359 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 6: Multiple Access Techniques"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1, page no-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''length of reference and traffic burst'''\n",
+ "#Variable Declaration\n",
+ "t=20 #TDMA frame length in ms\n",
+ "lc=352 #length of carrier and clock recovery frequency in bits\n",
+ "lu1=48 #length of unique word in bits\n",
+ "lo=510 #length of order wire channel in bits\n",
+ "lm= 256 #length of management channel in bits\n",
+ "lt=320 # length of transmit timming channel in bits\n",
+ "ls1=24 # length of service channel in bits\n",
+ "gt=64 # Guard time in bits\n",
+ "rb=2 # reference burst\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "lr=lc+lu1+lo+lm+lt\n",
+ "tb=lc+lu1+lo+ls1\n",
+ "tob=(lr*rb)+(tb*t)+((t+rb)*gt)\n",
+ "\n",
+ "#Result\n",
+ "print(\"(a)\\nThe length of reference burst(from given data) is %d bits\\n\\n(b)\\nThe length of traffic burst premable(from given data)is %d bits\\n\\n(c)\\nTotal number of overhead bits is %d bits\"%(lr,tb,tob))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "The length of reference burst(from given data) is 1486 bits\n",
+ "\n",
+ "(b)\n",
+ "The length of traffic burst premable(from given data)is 934 bits\n",
+ "\n",
+ "(c)\n",
+ "Total number of overhead bits is 23060 bits\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2, page no-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Frame efficiency'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "t=20 # TDMA frame length in ms\n",
+ "lc=352 # length of carrier and clock recovery frequency in bits\n",
+ "lu1=48 # length of unique word in bits\n",
+ "lo=510 # length of order wire channel in bits\n",
+ "lm=256 # length of management channel in bits\n",
+ "lt=320 # length of transmit timming channel in bits\n",
+ "ls1=24 # length of service channel in bits\n",
+ "gt=64 # Guard time in bits\n",
+ "rb=2 # reference burst\n",
+ "br=90.0*10**6 # burst bit rate 90Mbps\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "bfr=br*t*10**-3\n",
+ "lr=lc+lu1+lo+lm+lt\n",
+ "tb=lc+lu1+lo+ls1\n",
+ "tob=(lr*rb)+(tb*t)+((t+rb)*gt)\n",
+ "feff=(bfr-tob)*100/bfr\n",
+ "feff=math.ceil(feff*100)/100\n",
+ "\n",
+ "#Result\n",
+ "print(\"Frame efficiency = %.2f%%\"%feff)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frame efficiency = 98.72%\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3, page no-231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Maximum no of PCM voice channels'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "t=20 # TDMA frame length in ms\n",
+ "lc=352 # length of carrier and clock recovery frequency in bits\n",
+ "lu1=48 # length of unique word in bits\n",
+ "lo=510 # length of order wire channel in bits\n",
+ "lm= 256 # length of management channel in bits\n",
+ "lt=320 # length of transmit timming channel in bits\n",
+ "ls1=24 # length of service channel in bits\n",
+ "gt=64 # Guard time in bits\n",
+ "rb=2 # reference burst\n",
+ "br=90.0*10**6 # burst bit rate 90Mbps\n",
+ "dr= 64.0*10**3 #data rate 64 kbps\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "bfr=br*t*10**-3\n",
+ "lr=lc+lu1+lo+lm+lt\n",
+ "tb=lc+lu1+lo+ls1\n",
+ "tob=(lr*rb)+(tb*t)+((t+rb)*gt)\n",
+ "feff=(bfr-tob)*100/bfr\n",
+ "feff=math.ceil(feff*100)/100\n",
+ "vsb=dr*t*10**-3\n",
+ "x=bfr*feff/100\n",
+ "\n",
+ "#Result\n",
+ "print(\"The number of bits in a frame for a voice sub-burst is %d\\n\\nThe total no of bits available in a frame for carrying traffic is %d\\n\\nMaximum no of PCM voice channels in a frame is %d channels\"%(vsb,x,x/vsb))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of bits in a frame for a voice sub-burst is 1280\n",
+ "\n",
+ "The total no of bits available in a frame for carrying traffic is 1776960\n",
+ "\n",
+ "Maximum no of PCM voice channels in a frame is 1388 channels\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4, page no-231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Doppler Shift'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "R=42150.0 # orbital radius of satellite\n",
+ "oi=0.25/100.0 # orbit inclination\n",
+ "acc=0.3 # error of 0.3 degree\n",
+ "c=3.0*10**8 # speed of light\n",
+ "x=oi*R\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=math.ceil(x*10)/10\n",
+ "y=R*2*math.pi*acc/360.0\n",
+ "y=math.ceil(y*10)/10\n",
+ "z=math.sqrt(x**2+y**2)\n",
+ "z=math.ceil(z*10)/10\n",
+ "delay=z*10**6/c\n",
+ "delay=math.floor(delay*1000)/1000\n",
+ "pd=2*delay\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"variation in altitude caused by orbit inclination = %.1fkm\\n variation due to station-keeping error of 0.3\u00b0 = %.1fkm\"%(x,y))\n",
+ "print(\"\\n Both these errors will introduce a maximum range variation of %.1fkm\\n This cause a one-way propagation delay of %.3fms\\n Round trip propagation delay =%.2fms\\n Dopler Shift = %.2f ms in 8h=56.25 ns/s\"%(z,delay,delay*2,pd))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "variation in altitude caused by orbit inclination = 105.4km\n",
+ " variation due to station-keeping error of 0.3\u00b0 = 220.7km\n",
+ "\n",
+ " Both these errors will introduce a maximum range variation of 244.6km\n",
+ " This cause a one-way propagation delay of 0.815ms\n",
+ " Round trip propagation delay =1.63ms\n",
+ " Dopler Shift = 1.63 ms in 8h=56.25 ns/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5, page no-238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Chip Duration and maximum chip rate'''\n",
+ "#Variable Declaration\n",
+ "de=40.0 # Doppler effect variation due to station-keeping errors in ns/s\n",
+ "d=280.0 # Sttelite round trip delay in ms\n",
+ "c=20.0/100.0 # DS-CDMA signals should not exceed 20% of the chip duration\n",
+ "\n",
+ "#Calculation\n",
+ "te=de*10**-9*d*10**-3\n",
+ "tc=te/c\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Chip Duration, Tc = %.0f ns \\n This gives maximum chip rate as (1/56)Gbps = 1000/56 Mbps = %.3f Mbps\"%(tc*10**9,1000.0/56.0))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Chip Duration, Tc = 56 ns \n",
+ " This gives maximum chip rate as (1/56)Gbps = 1000/56 Mbps = 17.857 Mbps\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6, page no-238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''maximum permissible Dopler effect variation'''\n",
+ "#Variable Declaration \n",
+ "cr=25.0 #Chip rate is 25 Mbps\n",
+ "c=20.0/100.0 # DS-CDMA signals should not exceed 20% of the chip duration\n",
+ "d=1000/cr #chip duration in ns\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "tr=c*d\n",
+ "x=tr/(280.0*10**-3)\n",
+ "\n",
+ "#Result\n",
+ "print(\"The maximum allowable timing error per satellite round trip is %.0f ns\\n This %.0f ns error is to occur in 280 ms.\\n Therefore, maximum permissible Dopler effect variation is %.2f ns/s\"%(tr,tr,x))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum allowable timing error per satellite round trip is 8 ns\n",
+ " This 8 ns error is to occur in 280 ms.\n",
+ " Therefore, maximum permissible Dopler effect variation is 28.57 ns/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7, page no-238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Processing gain'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "cr=20.0*10**6 #chip rate in Mbps\n",
+ "ir= 20.0*10**3 #information bit rate\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "g=10*math.log10((cr)/(ir))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Noise reduction achhievable = Processing gain = %.0f dB\"%g)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Noise reduction achhievable = Processing gain = 30 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Satellite_Communication/chapter_7.ipynb b/Satellite_Communication/chapter_7.ipynb
new file mode 100644
index 00000000..f48f0b36
--- /dev/null
+++ b/Satellite_Communication/chapter_7.ipynb
@@ -0,0 +1,761 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter 7: Satellite Link Design Fundamentals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.1, page no-249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Power received by the receiving antenna '''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "d=36000 *10**3 #distance of geostationary satellite from earth's surface\n",
+ "Gt=100 # Antenna gain of 20dB\n",
+ "Pt=10 # Power radiated by earth station\n",
+ "\n",
+ "#Calculation\n",
+ "Prd=Pt*Gt/(4*math.pi*d**2)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Prd = %.4f * 10 ^-12 W/m^2\\nPower received by the receiving antenna is given by Pr = %.3f pW\"%(Prd*10**12,Prd*10**13))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Prd = 0.0614 * 10 ^-12 W/m^2\n",
+ "Power received by the receiving antenna is given by Pr = 0.614 pW\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2, page no-262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''free-space path loss'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "c=3*10**8 #speed of light \n",
+ "R=10000 #path length\n",
+ "f=4.0 # operating frequencyin GHz\n",
+ "EIRP=50 #in dB\n",
+ "gr=20 #antenna gain in dB\n",
+ "rp=-120 # received power in dB\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#(a)\n",
+ "lamda=c/(f*10**9)\n",
+ "pl=20*math.log10(4*math.pi*R/lamda)\n",
+ "\n",
+ "#(b)\n",
+ "Lp=EIRP+gr-rp\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"(a)\\n Operating wavelength = %.3f m\\n Path loss(in dB) = %.2f dB\"%(lamda,pl))\n",
+ "print(\"\\n\\n (b)\\n Path loss = %.0fdB\"%Lp)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " Operating wavelength = 0.075 m\n",
+ " Path loss(in dB) = 124.48 dB\n",
+ "\n",
+ "\n",
+ " (b)\n",
+ " Path loss = 190dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3, page no-262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Attenuation experienced by coplanar component'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "p=75 # rotation of plane of polarization\n",
+ "\n",
+ "#Polarization rotation is inversaly propotional to square of the operating frequency\n",
+ "\n",
+ "f= 5.0 #frequency increased by factor \n",
+ "x=f**2 #rotation angle will decrease by aa factor of 25\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "k=math.pi/180.0\n",
+ "p_ex=p/x\n",
+ "Apr=-20*math.log10(math.cos(p*k))\n",
+ "Apr2=-20*math.log10(math.cos((p_ex)*k))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"For polarization mismatch angle = 75\u00b0\\n Attenuation = %.2f dB\"%Apr)\n",
+ "print(\"\\n\\n For polarization mismatch angle = 3\u00b0 \\n Attenuation = %.3f dB\"%Apr2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For polarization mismatch angle = 75\u00b0\n",
+ " Attenuation = 11.74 dB\n",
+ "\n",
+ "\n",
+ " For polarization mismatch angle = 3\u00b0 \n",
+ " Attenuation = 0.012 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4, page no-270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Effective noise temperature and System Noise Figure'''\n",
+ "#Variable Declaration\n",
+ "g1=30 #gain of RF stage in dB\n",
+ "t1=20 #Noise temperature in K\n",
+ "g2=10 #down converter gain in dB\n",
+ "t2=360 #noise temperature in K\n",
+ "g3=15 #gain of IF stage in dB\n",
+ "t3=1000 #noise temperature in K\n",
+ "t=290 #reference temperature in K\n",
+ "G1=1000.0 #30 dB equivalent gain\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Te=t1+(t2/G1)+t3/(G1*g2)\n",
+ "F=1+Te/t\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Effective noise temperature, Te = %.2fK\"%Te)\n",
+ "print(\"\\n\\nSystem Noise Figure, F = %.2f\"%F)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective noise temperature, Te = 20.46K\n",
+ "\n",
+ "\n",
+ "System Noise Figure, F = 1.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5, page no-271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''overall noise figure'''\n",
+ "#Variable Declaration\n",
+ "g1=30 #gain of RF stage in dB\n",
+ "t1=20 #Noise temperature in K\n",
+ "g2=10 #down converter gain in dB\n",
+ "t2=360.0 #noise temperature in K\n",
+ "g3=15 #gain of IF stage in dB\n",
+ "t3=1000 #noise temperature in K\n",
+ "t=290.0 #reference temperature in K\n",
+ "G1=1000.0 #30 dB equivalent gain\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "F1=1+t1/t\n",
+ "F2=1+t2/t\n",
+ "F3=1+t3/t\n",
+ "F=F1+((F2-1)/G1)+(F3-1)/(G1*g2)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Noise Figure specificatios of the three stages are as follow,\\n\\n F1 = %.3f\\n F2 = %.2f\\n F3 = %.2f\"%(F1,F2,F3))\n",
+ "print(\"\\n\\n The overall noise figure is, F = %.2f\"%F)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Noise Figure specificatios of the three stages are as follow,\n",
+ "\n",
+ " F1 = 1.069\n",
+ " F2 = 2.24\n",
+ " F3 = 4.45\n",
+ "\n",
+ "\n",
+ " The overall noise figure is, F = 1.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6, page no-272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Noise figure'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "L=1.778 #Loss factor of the feeder 2.5dB equivalent\n",
+ "ts=30 #Noise temperature of sattelite receiver in K\n",
+ "t=50 #Noise temperature in K\n",
+ "ti=290.0 # reference temperature in K\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=t/L\n",
+ "y=ti*(L-1)/L\n",
+ "Te=x+y+ts\n",
+ "F1=1+(ts/ti)\n",
+ "F2=1+(Te/ti)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"contribution of antenna noise temperature when\\n referred to the input of the receiver is %.1f K\"%x)\n",
+ "print(\"\\n\\n Contribution of feeder noise when referred to the\\n input of the receiver is %.1f\"%y)\n",
+ "print(\"\\n\\n1. Noise figure in first case = %.3f = %.3f dB\"%(F1,10*math.log10(F1)))#answer in book is different 0.426dB\n",
+ "print(\"\\n\\n2. Noise figure in second case = %.3f = %.2f dB\"%(F2,10*math.log10(F2)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "contribution of antenna noise temperature when\n",
+ " referred to the input of the receiver is 28.1 K\n",
+ "\n",
+ "\n",
+ " Contribution of feeder noise when referred to the\n",
+ " input of the receiver is 126.9\n",
+ "\n",
+ "\n",
+ "1. Noise figure in first case = 1.103 = 0.428 dB\n",
+ "\n",
+ "\n",
+ "2. Noise figure in second case = 1.638 = 2.14 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7, page no-272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Loss factor'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "Ta=40 #Antenna Noise temperature\n",
+ "Ti=290.0 #Reference temperature in K\n",
+ "T=50.0 #Effecitve input noise temperatuire\n",
+ "\n",
+ "#Calculation\n",
+ "Tf=Ti\n",
+ "L=(Ta-Tf)/(T-Tf)\n",
+ "L=math.ceil(L*10**4)/10**4\n",
+ "\n",
+ "#Result\n",
+ "print(\"Loss factor = %.4f = %.3f dB\"%(L,10*math.log10(L)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss factor = 1.0417 = 0.177 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8, page no-273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''System noise temperature'''\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "Ta=50 #Antenna Noise temperature\n",
+ "Tf=300 #Thermodynamic temperature of the feeder\n",
+ "Te=50 # Effecitve input noise temperatuire\n",
+ "\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "Lf=1.0\n",
+ "T=(Ta/Lf)+(Tf*(Lf-1)/Lf)+Te\n",
+ "\n",
+ "#Result for (a)\n",
+ "print(\"(a)\\n System noise temperature = %.0fK\"%T)\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "Lf=1.413\n",
+ "T=(Ta/Lf)+(Tf*(Lf-1)/Lf)+Te\n",
+ "\n",
+ "#Result for (b)\n",
+ "print(\"\\n\\n (b)\\n System noise temperature = %.3fK\"%(math.ceil(T*10**3)/10**3))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ " System noise temperature = 100K\n",
+ "\n",
+ "\n",
+ " (b)\n",
+ " System noise temperature = 173.072K\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.9, page no-278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''carrier-to-interface ratio'''\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "e=35 #EIRP radiated by satellite in dBW\n",
+ "g=50 #receiver antenna gain in dB\n",
+ "e1=30 #EIRP of interfacing satellite in dBW\n",
+ "theeta=4 #line-of-sight between earth station and interfacing sattelite\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=(e-e1)+(g-32+25*math.log10(theeta))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"carrier-to-interface (C/I) = %.2f dB\"%x)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "carrier-to-interface (C/I) = 38.05 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10, page no-279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''carrier-to-interference ratio'''\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "ea=80 #EIRP value of earth station A in dBW\n",
+ "eb=75 #EIRP value of earth station B in dBW\n",
+ "g=50 #transmit antenna gain in dB\n",
+ "gra=20 #receiver antenna gain for earth station A in dB\n",
+ "grb=15 #receiver antenna gain for earth station B in dB\n",
+ "theeta=4 #viewing angle of the sattelite from two earth station\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "eirp_d=eb-g+32-25*math.log10(theeta)\n",
+ "c_by_i=ea-eirp_d+(gra-grb)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"carrier-to-interference ratio at the satellite due to\\n inteference caused by Eart station B is, (C/I) = %.0f dB \"%c_by_i)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "carrier-to-interference ratio at the satellite due to\n",
+ " inteference caused by Eart station B is, (C/I) = 43 dB \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.11, page no-279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Total carrier-to-interference ratio'''\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "#carrier sinal strength at sattelite by uplink\n",
+ "u=10000.0 # equivalent to 40dB\n",
+ "\n",
+ "#carrier sinal strength at eart station by downlink \n",
+ "d=3162.28 #equivalent to 35dB\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=1/((1/u)+(1/d))\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Total carrier-to-interference ratio is %.2f = %.1f dB\"%(x,10*math.log10(x)))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total carrier-to-interference ratio is 2402.53 = 33.8 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.12, Page no.280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Longitudinal separation between two satellites'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "theeta=5.0 #Angle form by slant ranges of two satellites\n",
+ "dA=42100.0*10**3 #Slant range of satellite A\n",
+ "dB=42000.0*10**3 #Slant range of satellite B\n",
+ "r=42164.0*10**3 #radius of geostationary orbit\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "beeta=((dA**2+dB**2-math.cos(theeta*math.pi/180)*2*dA*dB)/(2*r**2))\n",
+ "beeta=math.ceil(beeta*10**3)/10**3\n",
+ "beeta=(180/math.pi)*math.acos(1-beeta)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Longitudinal separation between two satellites is %.3f\u00b0\"%beeta)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Longitudinal separation between two satellites is 5.126\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.13, Page no.281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gain per degree Kelvin'''\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "Ga=60.0 #Antenna Gain in dB\n",
+ "Ta= 60.0 #Noise teperature of Antenna\n",
+ "L1=1.12 #Feeder Loss equivalent to dB\n",
+ "T1=290.0 #Noise teperature of stage 1\n",
+ "G2=10**6 #Gain of stage 2 in dB\n",
+ "T2=140.0 #Noise teperature of stage 2\n",
+ "T3=10000.0 #Noise teperature of stage 3\n",
+ "G=Ga-0.5 #input of low noise amplifier\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Ts=(Ta/L1)+(T1*(L1-1)/L1)+T2+(T3/G2)\n",
+ "Ts=math.floor(Ts*100)/100\n",
+ "x=G-10*math.log10(Ts)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Tsi = %.2fK\\n\\n G/T(in dB/K)= %.0f dB/K\"%(Ts,x))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tsi = 224.65K\n",
+ "\n",
+ " G/T(in dB/K)= 36 dB/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.14, Page no.282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''Gain per degree Kelvin'''\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "Ga=60.0 #Amplifier Gain in dB\n",
+ "Ta= 60.0 #Noise teperature of Antenna\n",
+ "L1=1.12 #Feeder Loss equivalent to dB\n",
+ "T1=290.0 #Noise teperature of stage 1\n",
+ "G2=10**6 #Gain of stage 2 in dB\n",
+ "T2=140.0 #Noise teperature of stage 2\n",
+ "T3=10000.0 #Noise teperature of stage 3\n",
+ "G=Ga-0.5 #input of low noise amplifier\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "T=Ta+T1*(L1-1)+L1*(T2+(T3/G2))\n",
+ "x=G-10*math.log10(T)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"T = %.1fK\\n\\n G/T = %.0f dB/k\"%(T,math.ceil(x)))\n",
+ "print(\"\\n\\n It is evident from the solutions of the problems 13 and 14\\n that G/T ratio is invarient regardless of the reference point in agreement \\n with a statement made earlier in the text.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.15, Page no.286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''link margin'''\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "f=6.0*10**9 # uplink frequency\n",
+ "eirp=80.0 # Earth station EIRP in dBW\n",
+ "r=35780.0 # Earth station satellite distance\n",
+ "l=2.0 # attenuation due to atomospheric factors in dB\n",
+ "e=0.8 # satellite antenna's aperture efficiency\n",
+ "a=0.5 # satellite antenna's aperture area\n",
+ "T=190.0 # Satellite receiver's effective noise temperature \n",
+ "bw=20.0*10**6 # Satellite receiver's bandwidth\n",
+ "cn=25.0 # received carrier-to-noise ratioin dB\n",
+ "c=3.0*10**8 # speed of light\n",
+ "\n",
+ "#Calculation\n",
+ "k=1.38*10**-23\n",
+ "lamda=c/f\n",
+ "G=e*4*math.pi*a/lamda**2\n",
+ "G=math.ceil(G*100)/100\n",
+ "Gd=10*math.log10(G)\n",
+ "p=10*math.log10(k*T*bw)\n",
+ "pl=20*math.log10(4*math.pi*r*10**3/lamda)\n",
+ "rp=eirp-l-pl+Gd\n",
+ "rp=math.floor(rp*100)/100\n",
+ "rc=math.floor((rp-p)*100)/100\n",
+ "lm=rc-cn\n",
+ "\n",
+ "#Result\n",
+ "print(\"Satellite Antenna gain, G = %.2f = %.2f dB \\n Receivers Noise Power = %.1f dB\\n free-space path loss = %.2f dB \\n received power at satellite = %.2f dB \\n receiver carrier = %.2f is stronger than noise.\\n It is %.2f dB more than the required threshold value.\\n Hence, link margin = %.2f dB\"%(G,Gd,p,pl,rp,rc,lm,lm))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Satellite Antenna gain, G = 2010.62 = 33.03 dB \n",
+ " Receivers Noise Power = -132.8 dB\n",
+ " free-space path loss = 199.08 dB \n",
+ " received power at satellite = -88.05 dB \n",
+ " receiver carrier = 44.75 is stronger than noise.\n",
+ " It is 19.75 dB more than the required threshold value.\n",
+ " Hence, link margin = 19.75 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Satellite_Communication/screenshots/a.png b/Satellite_Communication/screenshots/a.png
new file mode 100644
index 00000000..32f78334
--- /dev/null
+++ b/Satellite_Communication/screenshots/a.png
Binary files differ
diff --git a/Satellite_Communication/screenshots/b.png b/Satellite_Communication/screenshots/b.png
new file mode 100644
index 00000000..ccec2644
--- /dev/null
+++ b/Satellite_Communication/screenshots/b.png
Binary files differ
diff --git a/Satellite_Communication/screenshots/c.png b/Satellite_Communication/screenshots/c.png
new file mode 100644
index 00000000..84eea621
--- /dev/null
+++ b/Satellite_Communication/screenshots/c.png
Binary files differ
diff --git a/Solid_state_physics/Chapter_1.ipynb b/Solid_state_physics/Chapter_1.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_1.ipynb
diff --git a/Solid_state_physics/Chapter_10.ipynb b/Solid_state_physics/Chapter_10.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_10.ipynb
diff --git a/Solid_state_physics/Chapter_11.ipynb b/Solid_state_physics/Chapter_11.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_11.ipynb
diff --git a/Solid_state_physics/Chapter_12.ipynb b/Solid_state_physics/Chapter_12.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_12.ipynb
diff --git a/Solid_state_physics/Chapter_2.ipynb b/Solid_state_physics/Chapter_2.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_2.ipynb
diff --git a/Solid_state_physics/Chapter_3.ipynb b/Solid_state_physics/Chapter_3.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_3.ipynb
diff --git a/Solid_state_physics/Chapter_4.ipynb b/Solid_state_physics/Chapter_4.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_4.ipynb
diff --git a/Solid_state_physics/Chapter_5.ipynb b/Solid_state_physics/Chapter_5.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_5.ipynb
diff --git a/Solid_state_physics/Chapter_6.ipynb b/Solid_state_physics/Chapter_6.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_6.ipynb
diff --git a/Solid_state_physics/Chapter_7.ipynb b/Solid_state_physics/Chapter_7.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_7.ipynb
diff --git a/Solid_state_physics/Chapter_8.ipynb b/Solid_state_physics/Chapter_8.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_8.ipynb
diff --git a/Solid_state_physics/Chapter_9.ipynb b/Solid_state_physics/Chapter_9.ipynb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Solid_state_physics/Chapter_9.ipynb
diff --git a/Solid_state_physics/README.txt b/Solid_state_physics/README.txt
new file mode 100644
index 00000000..8821405d
--- /dev/null
+++ b/Solid_state_physics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Muktesh Chaudhary
+Course: be
+College/Institute/Organization: Anglo Eastern ship management india Pvt. Ltd
+Department/Designation: Electrical & Electronics Officer
+Book Title: Solid state physics
+Author: P. K. Palanisamy
+Publisher: Scitech Publication (India) Pvt. Ltd., Chennai
+Year of publication: 2004
+Isbn: 8188429279
+Edition: 1st \ No newline at end of file
diff --git a/Solid_state_physics/screenshots/muktesh_1.png b/Solid_state_physics/screenshots/muktesh_1.png
new file mode 100644
index 00000000..d96a515e
--- /dev/null
+++ b/Solid_state_physics/screenshots/muktesh_1.png
Binary files differ
diff --git a/Solid_state_physics/screenshots/muktesh_2.png b/Solid_state_physics/screenshots/muktesh_2.png
new file mode 100644
index 00000000..b287414f
--- /dev/null
+++ b/Solid_state_physics/screenshots/muktesh_2.png
Binary files differ
diff --git a/Solid_state_physics/screenshots/muktesh_3.png b/Solid_state_physics/screenshots/muktesh_3.png
new file mode 100644
index 00000000..8b14b011
--- /dev/null
+++ b/Solid_state_physics/screenshots/muktesh_3.png
Binary files differ
diff --git a/Surveying_Volume_3/Chapter_1_.ipynb b/Surveying_Volume_3/Chapter_1_.ipynb
new file mode 100644
index 00000000..3327643c
--- /dev/null
+++ b/Surveying_Volume_3/Chapter_1_.ipynb
@@ -0,0 +1,1477 @@
+{
+ "metadata": {
+ "name": "Chapter 1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "FIELD ASTRONOMY"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.1, Page 30"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding difference of longitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n#part1\na =40; # longitude of A\nb =73; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);\n\n#part2\na =20; # longitude of A\nb =150; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees \",round(dol);\n\n#part3\na =-20; # longitude of A\nb =50; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);\n\n#part4\na =-40; # longitude of A\nb =150; # longitude of B\n\n#calculation\ndol =360-(b-a); # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " difference of longitude is 33.0\n difference of longitude is 130.0\n difference of longitude is 70.0\n difference of longitude is 170.0\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.2.1,Page 31"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos\nlatA =28.0+42.0/60.0; # latitude of A\nlonA =31.0*60.0+12.0; # longitude of A\nlatB =28.0+42.0/60.0; # latitude of B\nlonB =47.0*60.0+24.0; # longitude of B\n\n#calculation\nd=( lonB - lonA )*cos( latA /180* pi);\n\n#result\nprint \" distance between A & B in (km) \",round(d *1.852,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " distance between A & B in (km) 1578.989\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.2.2,Page 31"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos\nlatA =12.0+36.0/60.0; # latitude of A\nlonA =115.0*60.0+6.0; # longitude of A\nlatB =12.0+36.0/60.0; # latitude of B\nlonB =-150.0*60.0-24.0; # longitude of B\n\n#calculation\nd=( 360*60+lonB - lonA )*cos( latA /180* pi);\n\n#result\nprint \" distance between A & B in (km) \",round(d *1.852,3) ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " distance between A & B in (km) 10247.946\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.3,Page 31"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nlatA =15;\nlatB =12.0+6.0/60.0;\nlonA =50.0+12.0/60.0;\nlonB =54.0;\nRe =6370.0; # radius of earth\n\n#calculation\nb=(90 - latA )*pi /180;\na=(90 - latB )*pi /180;\nP=( lonB - lonA )*pi /180;\np= acos ( cos (P)*sin(a)* sin (b)+ cos (a)*cos(b)); #spherical triangle law\nx= atan ( cos (a/2-b/2)/ cos (a/2+b /2) * tan (pi /2-P /2) );#spherical triangle law \ny= atan ( sin (a/2-b/2)/ sin (a/2+b /2) * tan (pi /2-P /2) ); #spherical triangle law\ndol =pi -x-y;\ndol=dol*180/pi;\na= dol *3600 %60;\nb= ((dol *3600 -a)%3600) /60;\nc=( dol *3600 - b*60 -a) /3600;\n\n#result\nprint \" distance from A to B in (km) \",round(p*Re,3);\nprint \" direction of B from A towards east of south \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " distance from A to B in (km) 522.104\n direction of B from A towards east of south 35.16 seconds 19.0 minutes 52.0 degrees\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.4,Page 33"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nlatA =45.0;\na1=45.0+13.108/60;\np =(300.0/60.0) *pi /180; # side AB\nb=(90 - latA )*pi /180; # side PA\n\n# calculation\na= acos ( cos (p)*cos(b)); # side BP\nBC=a *180/ pi - latA ;\nd=BC *1.852*60;\nB=asin(sin(latA*pi/180)/sin(a1*pi/180));\nB=deg_to_dms(B*180/pi);\n\n\n#result\nprint \" distance of BC in (km)\",round(d,3)\nprint \"the angle in deg,min,sec is\",B",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " distance of BC in (km) 24.181\nthe angle in deg,min,sce is [85, 0, 33.27]\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.6.1,Page 37"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =42+15.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta -90+ delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\n#a= zend *3600 %60;\nb= ((zend *3600 )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " zenith distance 0.0 seconds 35.0 minutes 15.0 degrees\n altitude of star 0.0 seconds 25.0 minutes 74.0 degrees\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.6.2,Page 36"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =23+20.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 + theta -90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600 -a)%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\n\nb= ((alt *3600 )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " zenith distance 0.0 seconds 20.0 minutes 3.0 degrees\n altitude of star 0.0 seconds 40.0 minutes 86.0 degrees\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.6.3,Page 37"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =65+40.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta -90+ delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600 -a)%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " zenith distance 0.0 seconds 0.0 minutes 39.0 degrees\n altitude of star 0.0 seconds 0.0 minutes 51.0 degrees\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.7,Page 37"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =85+20.0/60; # declination of star\ntheta =46+50.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta +90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\n\nb= ((zend *3600 )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " zenith distance 0.0 seconds 50.0 minutes 47.0 degrees\n altitude of star 0.0 seconds 10.0 minutes 42.0 degrees\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.8,Page 38"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =56+10.0/60; # declination of star\ntheta =56+10.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta +90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600-a )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\n#a= alt *3600 %60;\nb= ((alt *3600 )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " zenith distance 0.0 seconds 40.0 minutes 67.0 degrees\n altitude of star 0.0 seconds 20.0 minutes 22.0 degrees\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.9,Page 38"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude and declination \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nimport numpy as np\na=np.array([[1.0,-1.0],[1.0,1.0]])\nb=np.array([59.0/3,332.0/3])\n\n#calculation\nx=np.linalg.solve(a,b);\n\n#result\nprint\"declination of star in (degrees)\",round(x[0],3);\nprint\"latitude of the place of observation (degrees)\",x[1];",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "declination of star in (degrees) 65.167\nlatitude of the place of observation (degrees) 45.5\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.10,Page 39"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth and altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntheta =20+30.0/60;\nH =42+6.0/60; # hour angle\ndelta =50.0;\n\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nH=H*pi /180;\nPM =(90 - theta )*pi /180;\nZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\nalpha =pi /2- ZM;\nalpha = alpha *180/ pi;\nA =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n\nif A <0:\n A=-A;\n A=acos(A)\n A=180-A*180/pi;\n \n\n#for altitude\nalt=alpha;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n\n#for azimuth \na= A *3600 %60;\nb= ((A *3600-a )%3600) /60;\nc=( A *3600 - b*60 -a) /3600;\nprint\" azimuth of star in (degrees ) westwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " altitude of star 36.75 seconds 38.0 minutes 45.0 degrees\n azimuth of star in (degrees ) westwards 25.551 seconds 4.0 minutes 116.0 degrees\n"
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.11,Page 40"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth and altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntheta = -8 -30.0/60;\nH =322.0; # hour angle\ndelta =50;\n\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nH =2* pi -H*pi /180;\nPM =(90 - theta )*pi /180;\nZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\nalpha =pi /2- ZM;\nalpha=alpha*180/pi;\nA =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n\nif A <0:\n A=-A;\n A=acos(A)\n A=180-A*180/pi;\n \n#result\n#for altitude\nalt=alpha;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n\n#for azimuth \na= A *3600 %60;\nb= ((A *3600-a )%3600) /60;\nc=( A *3600 - b*60 -a) /3600;\nprint\" azimuth of star in (degrees ) eastwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " altitude of star 48.256 seconds 48.0 minutes 22.0 degrees\n azimuth of star in (degrees ) eastwards 22.798 seconds 39.0 minutes 138.0 degrees\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.12,Page 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nalpha =22+36.0/60; # altitude of star\nA =42.0 # azimuth angle\ndelta =40.0; # latitude of observer\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nA=A*pi /180;\nZM =(90 - alpha )*pi /180;\nPM= acos (( cos (PZ)* cos (ZM)+sin(ZM)*sin(PZ)* cos (A)));\ntheta =pi /2- PM\ntheta=theta*180/pi;\nH =(( cos(ZM)-cos (PZ)* cos (PM))/ sin (PZ)/sin(PM));\nif H <0:\n H=-H;\n H=acos(H)\n H=180-H*180/pi;\n \n\n#result\n#for declination \nalt=theta;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" declination of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for hour angle\na= H *3600 %60;\nb= ((H *3600-a )%3600) /60;\nc=( H *3600 - b*60 -a) /3600;\nprint\" hour angle of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " declination of star 12.44 seconds 35.0 minutes 50.0 degrees\n hour angle of star 5.342 seconds 21.0 minutes 103.0 degrees\n"
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.13,Page 42"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nalpha =21+30.0/60; # a l t i t u d e o f s t a r\nA =140.0 # azimuth a n g l e\ndelta =48.0; # l a t i t u d e o f o b s e r v e r\n\n#calculation\nPZ =(90 - delta )*pi /180;\nA=A*pi /180;\nZM =(90 - alpha )*pi /180;\nPM =( cos(PZ)*cos(ZM)+ sin (ZM)* sin (PZ)* cos (A));\n\nif PM <0:\n PM=-PM\n PM=acos(PM)\n PM=180-PM*180/pi;\n\nH= acos (( cos (ZM)-cos(PZ)*cos(PM*pi /180) )/ sin (PZ)/sin (PM*pi /180) );\nH =2* pi -H;\nH=H*180/pi;\n\n#result\n#for declination \nalt=PM-90;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" declination of star southwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for hour angle\na= H *3600 %60;\nb= ((H *3600-a )%3600) /60;\nc=( H *3600 - b*60 -a) /3600;\nprint\" hour angle of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " declination of star southwards 12.098 seconds 48.0 minutes 11.0 degrees\n hour angle of star 22.619 seconds 20.0 minutes 322.0 degrees\n"
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.14,Page 43"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n# part 1\ndelta =22+12.0/60;\ntheta =42+30.0/60;\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H\n\n#part 2\ndelta = -22 -12/60;\ntheta =42+30.0/60;\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " azimuth of setting sun in ( degrees,min,second) [59, 10, 14.72]\n suns hour angle in ( hr,min,second ) : [7, 27, 50.23]\n azimuth of setting sun in ( degrees,min,second) [120, 32, 13.17]\n suns hour angle in ( hr,min,second ) : [4, 33, 4.97]\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.15,Page 44"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =22+12.0/60;\ntheta =42+30.0/60;\nef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(180-A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " azimuth of setting sun in ( degrees,min,second) [120, 49, 45.28]\n suns hour angle in ( hr,min,second ) : [7, 27, 50.23]\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.16,Page 61"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding error in time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntime = -3 -28.41/60; # greenwich time at july 1 1951\nchange = -11.82/60;\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n\n#calculation\nc12 = change/24*12 # change of time in 12 hours\ntch =time +c12;\ntch=deg_to_dms(tch/60);\n\n#result\nprint \" greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) \",tch\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) [0, 3, 34.32]\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.17,Page 61"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding GAT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n return [d, m, sd]\n#printing result in degree minute and seconds respectively \nGMN = -14*60 -10;\nchangeET =1*1.5;\n\n#calculation\nneterr =GMN+ changeET ;\nGAT = time + neterr ;\nGAT=GAT+10*3600+30*60;\nhr= round ( GAT /3600) ;\nb=GAT -hr *3600;\nmi= round (b /60 -1);\nc=GAT -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of GAT\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "10.0 hour 15.0 minutes 48.0265 seconds of GAT\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.18,Page 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding time\n\n#part1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n return [d, m, sd]\nA =50+12.0/60+48.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600) ;\nb=time -hr *3600;\nmi= round (b /60 -1);\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n\n#part 2\n#initialisation of variable\nA =8+18.0/60+6.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600-1) ;\nb=time -hr *3600;\nmi= round (b /60 );\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n\n#part 3\n#initialisation of variable\nA =258+36.0/60+30.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600) ;\nb=time -hr *3600;\nmi= round (b /60 );\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "3.0 hour 20.0 minutes 51.2 seconds of angles\n-0.0 hour 33.0 minutes 12.4 seconds of angles\n17.0 hour 14.0 minutes 26.0 seconds of angles\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.19,Page 62"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding angle\n\n#part1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nA =4+34.0/60+13.0/3600;\n\n#calculation\nangle =A *15;\nangle=deg_to_dms(angle);\n\n#result\nprint \"angle in degree,minute,second respectively\",angle\n\n#part 2\n#initialisation of variable\nA =18+11.0/60+38.0/3600;\n\n#calculation\nangle =A *15;\nangle=deg_to_dms(angle);\n\n#result\nprint \"angle in degree,minute,second respectively\",angle\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "angle in degree,minute,second respectively [68, 33, 15.0]\nangle in degree,minute,second respectively [272, 54, 30.0]\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.20.a,Page 64"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding local mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =20 # longitude of the place\nlongSM =82+30.0/60; # longitude of standard meridion\n\n#calculation\ndolong =longSM - longP ; # difference in longitude\ndot = dolong /15.0; # difference in time\nLMT =20+24.0/60+6.0/3600 - dot ;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[16, 14, 6.0] Local mean time in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.20.b,Page 64"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding local mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =-20 # longitude of the place\nlongSM =82+30.0/60; # longitude of standard meridion\n\n#calculation\ndolong =longSM - longP ; # difference in longitude\ndot = dolong /15.0; # difference in time\nLMT =20+24.0/60+6.0/3600 - dot ;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[13, 34, 6.0] Local mean time in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.21.a,Page 64"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding GMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =9+40.0/60+12.0/3600;\nlongP = -42 -36.0/60;\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[12, 30, 36.0] GMT in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.21.b,Page 64"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding GMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =4+32.0/60+10.0/3600;\nlongP = -56 -32.0/60;\n\n#calculation\ndot = longP /15;\nGMT =LMT +dot;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[0, 46, 2.0] GMT in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.22,Page 65"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\n#part1\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =72+30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n\n#part 2\n#initiallisation of variable\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =-72-30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n\n#part 3\n#initialisation of variable\ndef deg_to_dms(deg):\n d = int(deg);\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d-24, m, sd]\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =110+32.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of next day in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "LMT in hours,minute,second respectively [23, 30, 12.0]\nLMT in hours,minute,second respectively [13, 50, 12.0]\nLMT of next day in hours,minute,second respectively [2, 2, 20.0]\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.23,Page 66"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =10+20.0/60+30.0/3600; # local mean time\nlongP =102+30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nmGMN =12 - GMT ; #mean time interval\ni= mGMN *0.32/3600; # increase in mGMN\nETGMN =5.0/60+4.35/3600;\nch=i+ ETGMN ; # change in GMT\nGMT =ch+GMT;\nLMT = GMT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[10, 25, 37.07] LMT in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.24,Page 67"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =15+12.0/60+40.0/3600; # local mean time\nlongP = -20 -30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nmGMN =12 - GMT ; #mean time interval\ni= mGMN *0.32/3600; # increase in mGMN\nETGMN =5.0/60+4.35/3600;\nch=i+ ETGMN ; # change in GMT\nGMT =ch+GMT;\nLMT = GMT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[15, 17, 42.89] LMT in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.25,Page 70"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding sidereal time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntime =4+20.0/60+30.0/3600;\n\n#calculation\naccn = time *9.8565/3600; # acceleration\nstime = time + accn ; # sidereal time\nstime=deg_to_dms(stime);\n\n#result\nprint \"sidereal time in hours,minute,second respectively\",stime",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[4, 21, 12.79] sidereal time in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.26,Page 71"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nstime =8+40.0/60+50.0/3600;\n\n#calcculation\naccn =-time *9.8565/3600; # acceleration\nmtime = stime + accn ; # mean time\nmtime=deg_to_dms(mtime);\n\n#result\nprint \"mean time in hours,minute,second respectively\",mtime",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[8, 40, 7.21] mean time in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.27,Page 72"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LST on LMM\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP = -160 -30.0/60 -30.0/3600; # longitude of the place\nGST =16+30.0/60+12.0/3600; # standard time\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GST -i;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of LMM in hours,minute,second respectively\",LST\n\n#part 2\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP = 160 +30.0/60 +30.0/3600; # longitude of the place\nGST =16+30.0/60+12.0/3600; # standard time\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GST -i;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of LMM in hours,minute,second respectively\",LST\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[16, 31, 57.47] LST of LMM in hours,minute,second respectively\n[16, 28, 26.53] LST of LMM in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.28,Page 73"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LST \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =85+20.0/60; # longitude of the place\nGST =6+30.0/60; # standard time\nGMN =6+32.0/60+12.0/3600;\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GMN -i; #LST at L .M.N\ni2=GST *9.8565/3600; # error in GST\nLST2 =GST+i2;\nLST = LST + LST2 # lst at L .M.N\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hours,minute,second respectively\",LST",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[13, 2, 19.99] LST in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.29,Page 75"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =112+20.0/60+15.0/3600; # longitude of the place\nGST =8+10.0/60+28.0/3600; #GST at GMM\nlst =18+28.0/60+12.0/3600; \n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # error\nLST = GST +i; #LST at L .M.N\nLMM =lst -LST;\ni2=LMM *9.8565/3600; # error in LMM\nLMT =LMM -i2; # local mean time\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[10, 14, 48.91] LMT in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.30,Page 76"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =85+20.0/60; # longitude of the place\nGST =18+30.0/60; # standard time\ngst =6+32.0/60+12.0/3600; #GST at GMN\n\n#calculation\ndot = longP /15; \nGMT =GST -dot -12;\ni= GMT *9.8565/3600; # error\nGMT = GMT +i; # SI time\nLST = GMT +dot+ gst ; #LST at LMT\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hours,minute,second respectively\",LST",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[13, 2, 19.99] LST in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.31,Page 78"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =112+20.0/60+15.0/3600; # longitude of the place\nGST =8+10.0/60+28.0/3600; #GST at GMM\nlst =18+28.0/60+12.0/3600; # local sidereal time\n\n#clculation\ndot = longP /15; \ngmm = lst +dot - GST ; # SI at GMM\ni= gmm *9.8565/3600; # error\ngmm =gmm -i; #LST at L .M.N\nLMT =gmm -dot; # local mean time\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[10, 14, 48.7] LMT in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.32,Page 79"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =162+30.0/60+15.0/3600; # longitude of the place\nGST =10+30.0/60+15.0/3600; #GST at GMM\nRA =22+11.0/60+30.0/3600; # local sidereal time\n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # e r r o r\ngmm = GST +i; #LST at L .M.N\nlmn =RA -gmm; # SI o f LMN\ni2=lmn *9.8565/3600; # error 2\nLMT =lmn -i2;\nLMT1=deg_to_dms(LMT);\n\n#result\nprint \"LMT observed at upper transit in hours,minute,second respectively\",LMT1\n\n#part 2\n#initialisation of variable\ni3 =12*9.8565/3600; # retardation\n\n#calculation\nLMT = LMT +12 - i3;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT observed at lower transit in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "LMT observed at upper transit in hours,minute,second respectively [11, 37, 33.31]\nLMT observed at lower transit in hours,minute,second respectively [23, 35, 35.04]\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.33,Page 80"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =60+30.0/60; # longitude of the place\nGST =7+30.0/60+48.6/3600; #GST at GMM\nRA =17+28.0/60 +40.0/1600;\n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # error\ngmm =GST -i; #LST at L .M.N\nLMT =RA -gmm; # local mean time\ni2=LMT*9.8296/3600;\nGMT=LMT-i2-longP/15;\nLMT=deg_to_dms(LMT);\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\nprint \"GMT in hours,minute,second respectively\",GMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "LMT in hours,minute,second respectively [9, 59, 21.15]\nGMT in hours,minute,second respectively [5, 55, 42.96]\n"
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.34,Page 82"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding correct time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=13+21.0/60+54.0/3600; #GMT of the place\nLongA=40+30.0/60; #longitude of A\nLongB=-40-30.0/60; #longitude of B\n\n#calculation\ndelA=LongA/15.0*9.8296/3600;#error\ndelB=LongB/15.0*9.8296/3600;#error\nGA=GMT+delA;\nGA=deg_to_dms(GA);\nGB=GMT+delB;\nGB=deg_to_dms(GB);\n\n#result\nprint \"corected time of A in hours,minute,second respectively\",GA\nprint \"corected time of B in hours,minute,second respectively\",GB",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "corected time of A in hours,minute,second respectively [13, 22, 20.54]\ncorected time of B in hours,minute,second respectively [13, 21, 27.46]\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.35,Page 83"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=7+12.0/60+28.0/3600; #GMT of the place\nLong=50+30.0/60; #longitude \nLMT=11+30.0/60+12.0/3600; \n\n#calculation\ndelA=LongA/15.0*9.8296/3600;#error\ndelB=LMT*9.8296/3600;#error\nLA=GMT+delA; #LMT at transit\nLMT=LMT-delB;\nLMT=LMT+LA;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "LMT in hours,minute,second respectively [18, 41, 13.47]\n"
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.36,Page 84"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGST=8+25.0/60+25.0/3600;\n\n#calculation\nGMT=24-GST;\ni=GMT*9.8296/3600;\nGMT=GMT-i;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "GMT in hours,minute,second respectively [15, 32, 1.89]\n"
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.37,Page 85"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LMT on July 2\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=12+03.0/60+46.09/3600; #GMT of the place\nLongA=-130.0; #longitude of A\nLongB=49.0; #longitude of B\n\n#calculation\ndelA=LongA/15.0*11.71/24/3600;\ndelB=LongB/15.0*11.71/24/3600;\nLMTA=GMT+delA;\nLMTA=deg_to_dms(LMTA);\nLMTB=GMT+delB;\nLMTB=deg_to_dms(LMTB);\n\n#result\nprint \"LMT at A on July 2 in hours,minute,second respectively\",LMTA\nprint \"LMT at B on July 2 in hours,minute,second respectively\",LMTB",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[12, 3, 41.86] LMT at A in hours,minute,second respectively\n[12, 3, 47.68] LMT at B in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.38,Page 86"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLat=50+30.0/60; # latitude of place\nDec=74+22/60; #declination of place\nRA=14+50.0/60+52.0/3600;\n\n#calculation\nH=acos(tan(Lat*pi/180)/tan(Dec*pi/180));\nH=H*180/pi;\nH=H/15.0;\nLST=H+RA;\nLST=deg_to_dms(LST);\n\n#result \nprint \"LST in hours,minute,second respectively\",LST",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[19, 29, 26.59] LST in hours,minute,second respectively\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.39,Page 87"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding HA\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=120+30.0/60; #langitude\nGST=14+30.0/60+28.25/3600;\nGMT=2+5.0/60;\nLMN=12.0;\nLST=14+31.0/60+47.43/3600;\nRA=23+20.0/60+20.0/3600;\n\n#calculation\ne1=Long*15.0*9.8565/3600;\nGST=GST+e1;\nLMT=GMT+24-8-2.0/60;\nLMM=LMN+24-LMT; #mean LMN\ne2=LMM*9.8565/3600;\nLMM=LMM+e2;\nLST=LST+24-LMM;\nHA=LST-RA+24;\nHA=deg_to_dms(HA);\n\n#result\nprint \"HA in hours,minutes,seconds respectively\",HA",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[21, 11, 30.51] HA in hours,minutes,seconds respectively\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.40,Page 86"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding HA\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=75+28.0/60; #langitude\nLMT=5+30.0/60;\nGST=20+15.0/60+32.58/3600;\n\n#calculation\ne1=Long/15.0*9.8565/3600;\nGST=GST+e1;\ne2=LMT*9.8565/3600;\nLMT=LMT+e2;\nHA=GST+LMT;\nHAMS=HA-LMT-12+e2;\nHA=deg_to_dms(HA);\nHAMS=deg_to_dms(HAMS);\n\n#result\nprint \"HA in hours,minutes,seconds respectively\",HA\nprint \"HAMS in hours,minutes,seconds respectively\",HAMS\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "HA in hours,minutes,seconds respectively [25, 47, 16.38]\nHAMS in hours,minutes,seconds respectively [8, 17, 16.38]\n"
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.41,Page 90"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding sun's declination\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=45.0; #langitude\ndel1=1067.2/3600;\ndel2=1083.9/3600;\ndel3=1100.3/3600;\nf0=-16-14.0/60-24.0/3600;\n\n#calculation\nn=(10-Long/15)/24.0;\nDel0=del2-del1;\nDel1=del3-del2;\nfn=-f0+n*del2+n*(n-1)/4*(Del0+Del1)\nfn=deg_to_dms(fn);\n\n#result\nprint \"sun's declination in hours,minutes,seconds respectively\",fn",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "sun's declination in hours,minutes,seconds respectively [16, 19, 38.43]\n"
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.42,Page 101"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth of A & B and vertical difference\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\naziA =32+41.0/60+30.0/3600; # azimuth o f A\naziB =110+28.0/60+42.0/3600; # azimuth o f B\nvaA =10+21.0/60+12.0/3600; # vertical angle of A\nvaB = -2 -18.0/60 -30.0/3600; # vertical angle o f B\nlA1 =11;\nlB1 =11.5;\nrA1 =7.5;\nrB1 =7;\nlB2 =10;\nlA2 =10.5;\nrB2 =7.5;\nrA2 =8;\nd =20;\n# partA\n#calculation\nsigl =lA1+ lA2 ;\nsigr =rA1+ rA2 ;\nb= sigl /4*d- sigr /4*d;\ni= tan( vaA );\ncaziA = aziA +i *29.95/3600;\ncaziA1=deg_to_dms(caziA);\n\n#result\nprint \"corrected azimuth of A in (degrees,minutes,seconds)\",caziA1\n\n#part2 \n#calculation\ni= tan( vaB );\ncaziB = aziB +i*b /3600;\nha=caziB - caziA;\ncaziB=deg_to_dms(caziB);\nha=deg_to_dms(ha);\n\n#result\nprint \"corrected azimuth of B in (degrees,minutes,seconds)\",caziB\nprint \"horizontal difference of angle between A & B in (degrees,minutes,seconds)\",ha\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "corrected azimuth of A in (degrees,minutes,seconds) [32, 42, 10.04]\ncorrected azimuth of B in (degrees,minutes,seconds) [110, 29, 15.02]\nhorizontal difference of angle between A & B in (degrees,minutes,seconds) [77, 47, 4.98]\n"
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.43,Page 102"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nv1 =18+36.0/60+48.0/3600; # vertical angle 1\nv2 =18+35.0/60+56.0/3600; # vertical angle 2\nslm =28+36.0/60+20.0/3600; # altitude of sun measured\nds =15.0/60+59.35/3600; # dia of sun\n\n#calculation\nmv =( v1+v2) /2; #mean vertical angle\ni=v1 -v2; # error\nsl=slm+i; #new altitude of sun\nsl=sl+ds;\nir = -57.0/3600/( tan( slm *pi /180+26* pi /180/3600) );#error due to refraction\nsl=sl+ir;\nip =8.8/3600* cos( slm *pi /180+26* pi /180/3600);# error due to parallex\nsl=sl+ip;\nsl=deg_to_dms(sl);\n\n#result\nprint \"corrected altitude in (deg,min,sec) respectively\",sl",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[28, 51, 34.59] corrected altitude in (deg,min,sec) respectively\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.44,Page 115"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlong =4+30.0/60;\ni= long *9.8565/3600; # longitude\ngst =14+38.0/60+12.0/3600; #GST on GMM\nlst =gst -i; #LST on LMM\nRA =7+36.0/60+21.24/3600;\n\n#calculation\nLST =RA;\nSI=LST - lst +24;\nLCT =17+56.0/60+8.86/3600 -1; # local chronometer time\ni2=SI *9.8296/3600;\nLMM =SI -i2;\nce=LCT - LMM ;\n\n#result\nprint \" chronometer error in (s)\",round(ce *3600,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "2.19 chronometer error in (s)\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Exampe 1.45,Page 116"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc =90 -36 -30.0/60 -30.0/3600; # co latitude\np =90 -16 -12.0/60 -18.4/3600; # co declination\nz =90 -30 -12.0/60 -30.0/3600; # co altitude\ns=(p+z+c) /2;\n\n#calculation\ns1=s-c;\ns2=s-p;\ns3=s-z;\nH =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin (s*pi/180) / sin (s3*pi /180) ));\nH=H *180/ pi;\nH=24 -H /15;\nLST =H +5+18.0/60+12.45/3600 -24;\nce =1+2.0/60+5.25/3600 - LST ;\n\n#result\nprint \" chronometer error in (s)\",round (ce *3600+2,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "19.34 chronometer error in (s)\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example 1.46,Page 118"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc =90 -36 -40.0/60 -30.0/3600; # co latitude\np =90 -17 -26.0/60 -42.1/3600; # co declination\nz =90 -36 -14.0/60 -16.8/3600; # co altitude\n\n#calculation\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nH =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin(s*pi/180) / sin (s3*pi /180) ));\nH=H *180/ pi;\nH=H /15;\ni =12 -11 -56.0/60 -22.8/3600; # error in time\nLAT =15+49.0/60+40.6/3600; # local actual time\nGAT =LAT -H;\nGMT =GAT -i;\nLMT = GMT +H;\nce =15+49.0/60+12.6/3600 - LMT;\nce=deg_to_dms(ce)\n\n#result\nprint \" chronometer error in (s)\",ce",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " chronometer error in (s) [0, 3, 9.2]\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.47,Page 119"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nRA =17+12.0/60+48.0/3600;\ngst =9+26.0/60+12.0/3600; #GST on GMN\nlong =138.0/15+45.0/15/60; # l o n g i t u d e\nlst =- long *9.85645/3600+9+26.0/60+12.0/3600; #LST on LMN\nLST =17+12.0/60+48.0/3600; # local sidereal time\n\n#calculation\nSI=LST - lst ;\nMI=-SI *9.8296/3600+ SI;\nLCT =7+47.0/60+2.0/3600; # local chronometer time\nce=LCT -MI;\n\n#result\nprint \" chronometer error in (s)\",round(ce *3600,2) ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " chronometer error in (s) 11.52\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.48,Page 145"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth,latitude,LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =54+30.0/60; # l o g i t u d e\ndelta =62+12.0/60+21.0/3600; # d e c l i n a t i o n\n\n#calculation\nlat = asin (sin( theta *pi /180) /sin( delta *pi /180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\n\n#part 2\n#initialisation of variable\nA =53+25.0/60; # azimuth of star\nh =65+18.0/60+42.0/3600; # horizontal angle\n\n#calculation\nA=A+h;\nA=360-A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\n\n#part 3 \n#initialisation of variable\nlst =4+39.0/60+6.5/3600; #LST o f LMN\nLST =10+58.0/60+38.0/3600+2+49.0/60+25.3/3600; #LST of observation\n\n#calculation\nLMN =LST -lst;\ni= LMN *9.8565/3600; # e r r o r\nLMT =LMN -i;\nLMT=deg_to_dms(LMT)\n\n#results\nprint \"LMT in (hr,min,sec)\",LMT;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[66, 58, 7.13] Latitude in (deg,min,sec)\n[241, 16, 18.0] Azimuth in (deg,min,sec)\n[9, 7, 26.62] LMT in (hr,min,sec)\n"
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.49,Page 148"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth,latitude,LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =53+32.0/60; # logitude\ndelta =56+42.0/60+53.2/3600; # declination\nlat = asin (sin ( theta *pi /180) /sin( delta *pi /180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\n\n#part 2\n#initialisation of variable\nAs= asin ( cos ( delta *pi /180) /cos ( theta *pi /180) ); #azimuth of star\nh =75+18.0/60+20.0/3600; # angle between line and star\n\n#calculation\nA=h-As *180/ pi;\nA=360 -A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\n\n#part 3\n#initialisation of variable\nLST =10+58.0/60+3.9/3600+22+10.0/60+38.5/3600 -24; #LST of observation\nlong =5+40.0/60+18.0/3600; # longitude\n\n#calculation\ni= long *9.8565/3600; # error\nlst =4+58.0/60+23.84/3600+ i; #LST on LMN\nLMM =LST -lst;\ni2=LMM *9.8565/3600; # error in LMM\nLMT =LMM -i2;\nLMT=deg_to_dms(LMT)\n\n#results\nprint \"LMT in (hr,min,sec)\",LMT;\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Latitude in (deg,min,sec) [74, 9, 33.08]\nAzimuth in (deg,min,sec) [352, 7, 3.66]\nLMT in (hr,min,sec) [4, 8, 41.69]\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.50,Page 151"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong =(15.0+30.0/60); \nGMT =19+12.0/60+28.6/3600;\nGST=10+12.0/60+36.2/3600;\nRA=10 +12.0/60 +6.3/3600;\ntheta=35.0;\ndelta=20+6.0/60+48.4/3600;\n\n#calculation\ni= Long/15.0 *9.8656/3600; \nLSTofLMM=GST-i;\nLMT = GMT + Long/15.0 ;\ni2=LMT *9.8656/3600; # error in LMT\nSI = LMT +i2;\nLST =LSTofLMM+ SI ;\nH=LST-RA ; # hour angle\nH=H *15;\nH=360 -H;\nB=atan(tan(delta*pi/180)/cos(H*pi/180));\nB=B*180/pi;\nx=B-theta; #defined as 'B-theta'\nAs= atan ( tan ((H) *pi /180) * cos((B) *pi /180) / sin ((x)*pi /180) );#calculating azimuth \nh =36+28.0/60+18.0/3600; # angle between line and star\nA =180+ As *180/ pi -h; #azimuth\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\nprint \"there is a miscalculation in the step of calculating As thus resulted in change in answer\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Azimuth in (deg,min,sec) [55, 16, 8.27]\nthere is a miscalculation in the step of calculating As thus resulted in change in answer\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.51,Page 153 "
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =33+35.0/60+10.0/3600; # altitude\nZM =90 - alpha ;\ndelta =22+5.0/60+35.0/3600; # declination\nPM =90 - delta ;\ntheta =52+30.0/60+20.0/3600; # latitude\nZP =90 - theta ;\n\n#calculation\nAs= acos (( cos (PM*pi /180) -cos(ZP*pi /180) * cos (ZM*pi/180) )/( sin (ZP*pi /180) *sin(ZM*pi /180) ));\nh =18+20.0/60+30.0/3600; # angle between line and star\nA=As *180/ pi+h;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Azimuth in (deg,min,sec) [115, 27, 19.68]\n"
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.52,Page 154"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding declination,altitude\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGAT =5+17.0/60+6.0/60; #GAT \ndelta =17+46.0/60+52.0/3600; # declination\n\n#calculation\ni =37.0/3600* GAT ;\ndelta =delta -i;\ndelta1=deg_to_dms(delta);\n\n#result\nprint \"Declination in (deg,min,sec)\",delta1;\n\n#part 2\n#initialisation of variable\np=90 - delta ; # co declination\naltitude =23+15.0/60+20.0/3600; # altitude of sun\ni2 =2.0/60+12.0/3600; # error due to refraction\ni3 =8.0/3600; # error due to parallax\n\n#calculation\naltitude = altitude -i2+i3;\nc =90 -55 -46.0/60 -12.0/3600; # colatitude\nz=90 - altitude ; # co altitude\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nA =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));\nA=A *180/ pi;\nA=deg_to_dms(A);\n\n#result\nprint \"Altitude in (deg,min,sec)\",A;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Declination in (deg,min,sec) [17, 43, 32.82]\nAltitude in (deg,min,sec) [92, 23, 10.67]\n"
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.53,Page 156"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT =17+5.0/60+2.0/3600; \ni =9.8565/3600* GMT;\nGST =3+12.0/60+12.0/3600;\nwl =1+18.0/60; # west longitude\nRA =16+23.0/60+30.0/3600;\n\n#calculation\nH= GMT +i+ GST +wl -RA; # hour angle\nH=H *15;\np =90 -29 -52.0/60;\nc =90 -52 -8.0/60;\nz= acos ( cos (H*pi /180) * sin (p*pi /180) *sin(c*pi /180) + cos(p*pi /180) * cos (c*pi /180) );\nA= asin ( sin (p*pi /180) * sin (H*pi /180) /sin(z));\nA=A *180/ pi\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Azimuth in (deg,min,sec) [78, 38, 33.24]\n"
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.54,Page 157"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc2 =24+30.0/60+20.0/3600;\nd2 =24+30.0/60+40.0/3600;\nc3 =25;\nd3 =25+1.0/60;\n\n#calculation\nalt =( c2+c3+d3+d2)/4;#mean observed altitude\nil =(10.6 -9.4) /4*15.0/3600; # error \nalt = alt +il;\nir = -57.0/3600/ tan (( alt *pi /180) ); # correction of refraction\nip =8.0/3600* cos (alt*pi /180) ; # correction of parallax\nalt =alt -ir+ip;#altitude corrected\nz=90 - alt;#ZM\ndelta =1+32.0/60+16.8/3600 -56.2/3600*(3.0/60+1.86/3600) ;#declination of sun\np=90 - delta ;#PM\nc =90 -36 -48.0/60 -30.0/3600;#ZP\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nA =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));#azimuth calculation\nA=A *180/ pi;\nA=A +81+59.0/60+10.0/3600;\nA=360 -A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\nprint \"there is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Azimuth in (deg,min,sec) [170, 1, 36.93]\nthere is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.55,Page 178"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =65+40.0/60+18.0/3600; # altitude\ndelta =53+12.0/60+10.0/3600; # declination\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; \nalpha =alpha -i;\nz=90 - alpha ; # zenith distance\nlat =delta -z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[28, 52, 2.23] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.56,Page 178"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =64+36.0/60+20.0/3600; # altitude\ndelta =26+12.0/60+10.0/3600; # declination\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\nalpha =alpha -i;\nz=90 - alpha ; # zenith distance\nlat = delta +z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Latitude in (deg,min,sec) [51, 36, 17.06]\n"
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.57,Page 178"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =44+12.0/60+30.0/3600; # altitude\nlongP =75+20.0/60+15.0/3600; # longitude of place\ndelta =22+18.0/60+12.8/3600; # declination of sun\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\ni2 =8.78/3600* cos( alpha ); #error due to parallax\ni3 =15.0/60+45.86/3600; #error due to semi diameter\nalpha =alpha -i+i2+i3;\nz=90 - alpha ; # zenith distance\ndelT = longP /15;\ni4 =6.82/3600* delT ; # error in time\ndelta =i4+ delta ;\nlat = delta +z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[67, 51, 21.23] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.58,Page 180"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding alpha1,alpha2\n\n#for alpha 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =80;\ndelta =46+45.0/60+30.0/3600;\n\n#calculation\nalpha1 =90 - theta + delta ;\nalpha1=deg_to_dms(alpha1);\n\n#result\nprint \"alpha1 to the north in (deg,min,sec)\",alpha1\n\n#for alpha2\n#calculation\nalpha2 = theta +delta -90;\nalpha2=deg_to_dms(alpha2)\n\n#result\nprint \"alpha2 to the south(deg,min,sec)\",alpha2",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[56, 45, 30.0] alpha1 to the north in (deg,min,sec)\n[36, 45, 30.0] lpha1 to the south(deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.59,Page 181"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ndelta1 =20+25.0/60+48.0/3600; # declination of star 1\ndelta2 =79+30.0/60+52.0/3600; # declination of star 2\nalpha1 =48+18.0/60+12.0/3600; #altitude of star 1\nalpha2 =47+54.0/60+6.0/3600; #altitude of star 2\n\n#calculation\nr1 =58.0/3600/ tan( alpha1 *pi /180) # error 1\nr2 =58.0/3600/ tan( alpha2 *pi /180) # error 2\nlat =90 -( alpha1 - alpha2 ) /2+( delta1 - delta2 ) /2+( r1 -r2)/2;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\nprint \" there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Latitude in (deg,min,sec) [60, 15, 24.63]\n there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.60,Page 182"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude,declination\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalphal =18+36.0/60+40.0/3600; #altitude at lower culmination\nalphau =59+48.0/60+20.0/3600; #altitude at upper culmination\nlat =( alphal + alphau )/2;\nlat1=deg_to_dms(lat);\ndelta =90+ lat - alphau ;\ndelta1=deg_to_dms(delta);\n\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat1;\nprint \"Declination of star in (deg,min,sec)\",delta1",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[39, 12, 30.0] Latitude of star in (deg,min,sec)\n[69, 24, 10.0] Declination of star in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.61,Page 183"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =40+36.0/60+30.0/3600; # altitude of star\ndelta =10+36.0/60+40.0/3600; # declination of star\nH =46+36.0/60+20.0/3600; # hour angle of star\n\n#calculation\nn= atan ( tan ( delta *pi /180) /cos(H*pi /180) );\nlat =n+ acos ( sin ( alpha *pi /180) *sin(n)/ sin ( delta *pi/180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[36, 49, 43.99] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.62,Page 183"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =42+10.0/60+40.0/3600; # altitude o f sun\ndelta =23+12.0/60+18.6/3600; # declination of sun ' s angle\nLMT =14+50.0/60;\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\ni2 =8.78/3600* cos( alpha ); # correction due to parallax\ni3 =15.0/60+45.86/3600; # coreection due to semi diamter\nlongP =108+30.0/60; # longitude of place\nalpha =alpha -i+i2+i3;\ndelT = longP /15; # change in time\nGMT = LMT + delT ;\ni4 =1.2/3600* GMT; # error in time\nH=( GMT -12+ i4 - delT ) *15; # hour angle\ni5 =10.6/3600* GMT; # error in declination\ndelta = delta +i5;\nZM =(90 - alpha )*pi /180;\nPM =(90+ delta )*pi /180;\nA= asin ( sin (PM)/sin(ZM)* sin (H*pi /180) );\nA=pi -A;\nZP =2* atan ( sin (A/2+ H*pi /360) / sin (A/2-H*pi /360) *tan(PM/2- ZM /2) );\nlat =pi /2- ZP;\nlat = lat *180/ pi +1+6.0/60;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[1, 19, 7.46] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.63,Page 185"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ndelta =15+20.0/60+48.0/3600; # declination of star\nInt =9+22.0/60+6.0/3600; # interval\n\n#calculation\ndint =Int *9.8565/3600; # change in interval\nH=( Int+ dint ) *15/2; # hour angle\nlat = atan (tan( delta *pi /180) /cos(H*pi /180) );\nlat = lat *180/ pi +5.0/6*16.0/3600;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[39, 22, 1.79] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.64,Page 186"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nRA =1+41.0/60+48.64/3600;\nlat =48+36.0/60+40/3600; # latitude\ndelta =88+58.0/60+28.26/3600; # declination of polaris\nGMM =16+48.0/60+20.86/3600;\nlongP =7+20.0/60; # longitude of place P\ni1 =51.0/3600; # error due to barometer\ni2 =1.0/3600; # error due to barometer\ni3 = -1.0/3600; # error due to temp\n\n#calculation\nlat =lat -i1+i2+i3;\ndelT = longP /15;\ni4= delT *9.8565/3600;\nlst = GMM +i4;\nLMT =20+24.0/60+50.0/3600;\ni6 =9.8565/3600* LMT ; # e r r o r i n LMT\nLST = LMT +i6+lst -24;\nH=LST -RA; # hour a n g l e\nH=H *15;\nlat =lat -(90 - delta )*cos(H*pi /180) +.5* sin (1/3600* pi/180) *(90 - delta ) **2*( sin (H*pi /180) )**2* tan ( lat *pi/180) ;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[49, 36, 18.45] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 81
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 1.65,Page 187"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =120 -4 -20.0/60; # longitude of point\nGST =8+30.0/60+20.0/3600; #GST on GMM\ndelta =6+15.0/60+2.0/3600; # deflection\nalpha =39+20.0/60+30.0/3600; # altitude\ntheta =56+54.0/60+30.0/3600; # longitude\n\n#calculation\ndelT = longP /15;\ni= delT *9.8565/3600; # error in time\nlst = GST +i; #LST on LMM\nLST =19+52.0/60+16.0/3600;\nRA=LST;\nLMN =LST -lst;\ni2=LMN *9.8565/3600; # error in LMN\nLMN =LMN -i2;\nOSM =10+55.0/60+30.0/3600; #Observed mean time\ni3 =1.0/60+25.0/3600; # e r r o r i n obs e r v ed t ime\nOSM =OSM -i3;\nLMT = OSM +4.0/15+21.0/60.0/15;\nI=LMN - LMT ; # interval\ni4 =1.21/3600; # error in interval\nI=I+i4;\nH=I; # hour angle\nB= cos ( delta *pi /180) * cos ( theta *pi /180) / cos ( alpha *pi/180) ;\nm =225* H **2*3600**2/2.0/206265.0;\nlat = alpha +m*B /3600;\nlat =90 - lat +6+15.0/60+2.0/3600;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "[56, 53, 17.77] Latitude in (deg,min,sec)\n"
+ }
+ ],
+ "prompt_number": 85
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Surveying_Volume_3/Chapter_2.ipynb b/Surveying_Volume_3/Chapter_2.ipynb
new file mode 100644
index 00000000..4be4bac6
--- /dev/null
+++ b/Surveying_Volume_3/Chapter_2.ipynb
@@ -0,0 +1,448 @@
+{
+ "metadata": {
+ "name": "Chapter 2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "PHOTOGRAPHIC SURVEYING"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.1, Page 215"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding azimuth of a,b,c\n\n# Initialization of Variable\nfrom math import pi\nfrom math import atan\nf =120.80 # focal length\na = -35.52 # elevation of A\nb =8.48 # elevation of B\nc =48.26 # elevation of C\n\n#calculation\nalphaa = atan (a/f);\nalphab = atan (b/f);\nalphac = atan (c/f);\nphi =(354+30/60) *pi /180; # azimuth o f camera\nphia =phi - alphaa -360* pi /180; # azimuth o f a\nphib = phia + alphab; # azimuth o f b\nphic = phia + alphac ; # azimuth o f c\n\n#result\nprint \" azimuth of a in ( degrees ) \",round(phia /pi *180,2)\nprint \" azimuth of b in ( degrees ) \",round(phib /pi *180,2)\nprint \" azimuth of c in ( degrees ) \",round(phic /pi *180,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " azimuth of a in ( degrees ) 10.39\n azimuth of b in ( degrees ) 14.4\n azimuth of c in ( degrees ) 32.16\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.2,Page 216"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#Finding distance AP and AQ and reduced elevation of A\n\n#initialisation of variable\nfrom math import pi\nfrom math import atan,sin,sqrt\nf =150.0; # focal length of camera\nap =20.2 # elevation of a from p\naa1 =16.4; # distace to the right\naq =35.2 # elevation of a from q\nPQ =100.0; # distace of PQ\nRL =126.845; # r educed level of instrument\n\n#calculation\nalphap = atan (ap/f);\nalphaq = atan (aq/f);\nP=pi /3- alphap ; # angle P\nQ =40* pi /180 - alphaq ; # angle Q\nA=pi -P-Q; # angle A;\nAP=PQ* sin (Q)/sin(A);\nAQ=PQ* sin (P)/sin(A);\nPa1 = sqrt (ap **2+ f **2) ;\nAA1 = aa1 *AP/ Pa1 ;\nRLa =RL+AA1; # reduced level of A\n\n#result\nprint \" distance of AP (m) \",round(AP,2);\nprint \"distance of AQ (m) \",round(AQ,2);\nprint \" reduced level of A in (M) \",round(RLa,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " distance of AP (m) 45.9\ndistance of AQ (m) 80.6\n reduced level of A in (M) 131.82\n"
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.3,Page 218"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding focal length\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\ntheta =(44+30/60) *pi /180; # angle b/w two points\nx1 =68.24; #distance of 1st point\nx2 =58.48; #distance of 2nd point\n\n#calculation\nf=( x1+x2)/ tan ( theta ) /2+ sqrt (( x1+x2) **2/4/( tan ( theta ))\n**2+ x1*x2);\n\n#result\nprint \" focal length of lens in (mm) \",round(f,2);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " focal length of lens in (mm) 156.69\n"
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.4, Page 240"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding representative fraction\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n# part 1\n\nH =1200.0;#altitude\nh =80.0; #elevation of hill\nf =15.0/100.0;\n\n#calculation\nR80 =f/(H-h);\nprint \" representative fraction of hill is ( time s) \",round(R80,5);\n\n# part 2\n#initialisation of variable\nh =300.0; #elevation of hill\n\n#calculation\nR300 =f/(H-h);\n\n#result\nprint \" representative fraction of hill is ( time s) \",round(R300,5) ;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " representative fraction of hill is ( time s) 0.00013\n representative fraction of hill is ( time s) 0.00017\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.5,Page 240"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding height above sea level\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nR =1.0/8000.0;\nh =1500.0;\nf =20.0/100.0;\n\n#calculation\nH=h+f/R;\n\n#result\nprint \" height above sea level in (m) \",round(H,3);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " height above sea level in (m) 3100.0\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.6,Page 241"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding height above sea level\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nh =500.0; #elevation of point\nf =20.0/100.0; # focal length\nv =8.65/100.0; # vertical distance of photograph\nho =2000.0; # horizontal distance of photograph\nR=v/ho; # representative fraction\nh1 =800;\n\n#calculation\nH=h+f/R;\nS=(H-h1)/f /100; # scale of photograph\n\nprint \" height above sea level in (m) \",round(H,2);\nprint \" 1cm in photograph represents centimetres \",round(S,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " height above sea level in (m) 5124.28\n 1cm in photograph represents centimetres 216.214\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.7, Page 241"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding height above sea level\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nm =1.0/50000.0; #map scale\npd =10.16; # photo distance\nmd =2.54; #map distance\nf =16.0/100.0;\nh =200;\n\n#calculation\nR=pd/md*m; # representative fraction\nH=h+f/R;\n\n#result\nprint \" height above sea level in (m) \",round(H,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " height above sea level in (m) 2200.0\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.8,Page 242"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding distance between A and B\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =20 # f o c a l l e n g t h\nxa =2.65; # x coordinate of a\nxb = -1.92; # x coordinate of b\nya =1.36; # x coordinate of a\nyb =3.65; # y coordinate of b\nH =2500.0;\nha =500.0; # elevation of a\nhb =300.0; # elevation of b\n\n#calculation\nXa =(H-ha)/f*xa;\nXb =(H-hb)/f*xb;\nYa =(H-ha)/f*ya;\nYb =(H-hb)/f*yb;\nAB= sqrt ((Xa -Xb) **2+( Ya -Yb)**2);\n\n#result\nprint \" distance between A & B in (m) \",round(AB,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " distance between A & B in (m) 545.213\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.9,Page 243"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding flying distance between A and B\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =20.0 # focal length\nxa =2.65; # x coordinate of a\nxb = -1.92; # x coordinate of b\nya =1.36; # y coordinate of a\nyb =3.65; # y coordinate of b\nha =500.0; # elevation of a\nhb =300.0; # elevation of b\nABg =545.0;\nab =5.112;\n\n#calculation\nhab =ha /2+ hb /2;\nHapp =hab+ ABg *f/ab\nXa =( Happ -ha)/f*xa;\nXb =( Happ -hb)/f*xb;\nYa =( Happ -ha)/f*ya;\nYb =( Happ -hb)/f*yb;\nAB= sqrt ((Xa -Xb) **2+( Ya -Yb)**2);\nHact =ABg/AB *( Happ - hab )+ hab ;\n\n#result\nprint \" actual flying height of A & B in (m) \",round(Hact,3);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " actual flying height of A & B in (m) 2499.706\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.10,Page 243"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding relief displacement\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n\nf =20.0/100.0;\nSd =1.0/10000.0;\nh =250.0; # elevation\nr =6.44;\n\n#calculation\nH=f/Sd;\nd=r*h/H;\n\n#result\nprint \"relief displacement of the point in ( cm) \",round(d,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "relief displacement of the point in ( cm) 0.805\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.11,Page 244"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding relief distance\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nh =50.0; # elevation\nH =2500.0 -1250.0;\nr =6.35;\n\n#calculation\nd=r*h/H;\n\n#result\nprint \"releif displacement of the point in ( cm) \",round(d,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "releif displacement of the point in ( cm) 0.254\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.12,Page 244"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding height of tower\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =20.0/100.0; # focal length\nl =250; #length of line\nlp =8.5/100.0; #length of line in photograph\n\n#calculation\nH=l*f/lp; # height of camera above datum\nr =6.46; # distace of image of top o f the towe r\nd =0.46; # releif displacement\nh=d*H/r;\n\n#result\nprint \" height of tower above its base in (m) \",round(h,2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "41.89 height of tower above its base in (m) \n"
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.13,Page 267"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding no. of photographs\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nl =20/100; # length of photograph\nw =20/100; # breadth of photograph\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\ns =100*20;\n\n#calculation\nL=(1 - Pl)*s;\nW=(1 - Pw)*s;\nAr=L*W /1000/1000;\nN =100/ Ar;\nA= round (N);\n\n#result\nprint \"no . o f photographs to be taken \",A+1;\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "no . o f photographs to be taken 90.0\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.14,Page 267"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding no. of photographs\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\nL1 =10000.0;\ns =100.0*20.0;\n\n#calculation\nL2=L1;\nN1=L1 /((1 - Pl)*s) +1;\nA1= round (N1);\nif N1 -A1 <0:\n N1=A1;\nelse :\n N1=A1+1;\n\nN2=L2 /((1 - Pw)*s) +1;\nA2= round (N2);\nif N2 -A2 <0:\n N2=A2\nelse :\n N2=A2+1;\n\nN=N1*N2;\n\n#result\nprint \"no . of photographs to be taken \",N;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "no . of photographs to be taken 126.0\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.15,Page 268"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding no. of photographs\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\nL1 =12500.0;\ns =100.0*20.0;\nL2 =8000.0;\n\n#calculation\nN1=L1 /((1 - Pl)*s) +1;\nA1= round (N1);\nif N1 -A1 <0:\n N1=A1;\nelse :\n N1=A1+1;\n\nN2=L2 /((1 - Pw)*s) +1;\nA2= round (N2);\nif N2 -A2 <0:\n N2=A2\nelse :\n N2=A2+1;\n\nN=N1*N2;\n\n#result\nprint \"no . of photographs to be taken \",N;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "no . of photographs to be taken 119.0\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.16,Page 268"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding no. of photographs,height of datum\n\n#initialisation of variable\n#part1\nfrom math import pi,tan,sqrt,sin\nf =30.0/100.0; # focal length\nh =400.0; #elevation of datum\nr =12000.0; # ratio\ns =120.0*20.0;\nL2 =24000.0;\nL1 =30000.0;\nPl =0.6; # longitudinal lap\nPw =0.3; # side lap\n\n#calculation\nH=h+r*f;\n\n#result\nprint \" height above datum in (m) \",round(H,2);\n\n# part 2\n#calculation\nW=(1 - Pw)*s;\n\n#result\nprint \" ground width covered in each photograph (m) \",round(W,2);\n\n# part 3\nN2=L2 /((1 - Pw)*s) +1;\nA2= round (N2);\nif N2 -A2 <0:\n N2=A2\nelse :\n N2=A2+1;\n\n#result\nprint \"no . of flights required \",N2;\n\n#part 4-9\n#calculation\nAsf =L2 /(N2 -1) ; # actual spacing between flights\nSfl = Asf /600; # spacing of flight lines\ngd =(1 - Pl)*s; # ground distance\nEi=gd /55.5; # exposure interval\nEi= round (Ei);\nAgs =55.56* Ei;# adgusted ground distance\nN1=L1/ Ags +1;\nA1= round (N1);\nif N1 -A1 <0:\n N1=A1;\nelse :\n N1=A1+1;\nN=N1*N2;\n\n#result\nprint \"actual spacing in m\",Asf\nprint \"spacing of flight lines in cm\",round(Sfl,2)\nprint \"exposure interval in s\",Ei\nprint \"adjusted ground distance in m\",round(Ags)\nprint \"no . of photographs to be taken per flight line\",N1\nprint \"no . of photographs to be taken \",N;",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " height above datum in (m) 4000.0\n ground width covered in each photograph (m) 1680.0\nno . of flights required 16.0\nactual spacing in m 1600.0\nspacing of flight lines in cm 2.67\nexposure interval in s 17.0\nadjusted ground distance in m 945.0\nno . of photographs to be taken per flight line 33.0\nno . of photographs to be taken 528.0\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.17,Page 301"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding error in height \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nf =150.0/1000.0; # focal length\nr =20000.0; #ratio\nPl =0.6; # longitudinal lap\nl =23.0/100.0; # l e n g t h\nw =23.0/100.0; # width\n\n#calculation\nB=(1 - Pl)*l*r; # base length\nH=f*r;\nh =0;\ndh =(H-h) **2/ B/f *0.1/1000;\n\n#result\nprint \" error in height in (m) \",round(dh,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " error in height in (m) 3.261\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.18,Page 302"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding parallax height of the chimney\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nH =600.0;\nf =150.0/1000.0;\nb =6.375/100.0;\nh1 =0.0;\nh2 =120.0; # height of chimney\n\n#calculation\ns=H/f;\nB=s*b; # datum elevation\np1=B*f *1000/(H-h1);\np2=B*f *1000/(H-h2);\ndelp =p2 -p1;\ndelh =H* delp /1000/( b+ delp /1000) ;\n\n#result\nprint \" parallax height of the chimney in (m)\",round(delh,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " parallax height of the chimney in (m) 120.0\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.19,Page 303"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding difference in elevation \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\nB =200.0;\nf =120.0;\np2 =52.52; # parallax for top pole\np1 =48.27; # parallax for bottom pole\n\n#calculation\ndelh =(p2 -p1)/p2/p1*B*f;\n\n#result\nprint \" difference in elevation of two points in (m) \",round(delh,3)\nprint \"there is again a miscalculation in the step of calculating elevation thus there is a change in the answer\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " difference in elevation of two points in (m) 40.234\nthere is again a miscalculation in the step of calculating elevation thus there is a change in the answer\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 2.20,Page 303"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#finding difference in elevation \n\n#initialisation of variable\n# part 1\ndelp =1.48/1000.0;\nH =5000.0;\nh =500.0;\nb =90.0/1000.0; #mean principal base\n\n#calculation\ndh =(H-h) **2* delp /((H-h)* delp +b*H);\n\n#result\nprint \" difference in height between two points in(m) \",round(dh,3)\n\n# part 2\n#variable decleration\ndelp =15.5/1000.0;\n\n#calculation\ndh =(H-h) **2* delp /((H-h)* delp +b*H);\n\n#result\nprint \" difference in height between two points in(m) \",round(dh,3)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": " difference in height between two points in(m) 65.629\n difference in height between two points in(m) 603.896\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Surveying_Volume_3/screenshots/solved_example.png.PNG b/Surveying_Volume_3/screenshots/solved_example.png.PNG
new file mode 100644
index 00000000..830e56f0
--- /dev/null
+++ b/Surveying_Volume_3/screenshots/solved_example.png.PNG
Binary files differ
diff --git a/Surveying_Volume_3/screenshots/solved_example_2.png.PNG b/Surveying_Volume_3/screenshots/solved_example_2.png.PNG
new file mode 100644
index 00000000..dbcd4f71
--- /dev/null
+++ b/Surveying_Volume_3/screenshots/solved_example_2.png.PNG
Binary files differ
diff --git a/Surveying_Volume_3/screenshots/solved_example_3.png.PNG b/Surveying_Volume_3/screenshots/solved_example_3.png.PNG
new file mode 100644
index 00000000..0622b196
--- /dev/null
+++ b/Surveying_Volume_3/screenshots/solved_example_3.png.PNG
Binary files differ
diff --git a/Thermodynamics:_A_Core_Course/CH2.ipynb b/Thermodynamics:_A_Core_Course/CH2.ipynb
new file mode 100644
index 00000000..981cbdd9
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/CH2.ipynb
@@ -0,0 +1,105 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Important terminologies in Thermodynamics "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1,Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.1\n",
+ "#Find out molar constant pressure heat capacity\n",
+ "#Variable Declaration\n",
+ "m=25.0 \t\t\t\t#weight of water vapour [grams]\n",
+ "w=18.0 \t\t\t\t#molecular weight of water vapour [grams/mol]\n",
+ "T=9.69 \t\t\t\t#increase in temperature [K]\n",
+ "Qp=0.45 \t\t\t#heat supplied at constant pressure[KJ]\n",
+ "#To find the molar constant pressure specific heat\n",
+ "\n",
+ "#Calculation\n",
+ "n=m/w \t\t\t\t#no. of moles of water vapour\n",
+ "Cp=Qp/(n*T) \t\t\t#specific heat capacity at constant pressure[KJ]\n",
+ "Cp=Cp*1000\t\t\t#specific heat capacity at constant pressure[J]\n",
+ "\n",
+ "#Result\n",
+ "print\"The specific heat capacity at constant pressure =\",round(Cp,2),\"J K^-1 mol^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The specific heat capacity at constant pressure = 33.44 J K^-1 mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2,Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.2\n",
+ "#To find the minimum work of compression \n",
+ "import math\n",
+ "#Variable declaration\n",
+ "m=16.0 \t\t\t\t#weight of oxygen [grams]\n",
+ "w=32.0 \t\t\t\t#molecular weight of oxygen [grams/mol]\n",
+ "T=300.0 \t\t\t\t#Temperature during compression [K]\n",
+ "P1=1.0 \t\t\t\t#initial pressure of process [atm]\n",
+ "P2=100.0 \t\t\t\t#final pressure of process[atm]\n",
+ "R=8.314 \t\t\t#Universal gas constant [J/K/mol]\n",
+ "#Calculation\t\n",
+ "n=m/w \t\t\t\t#no. of moles of oxygen\n",
+ "W=-n*R*T*math.log(P1/P2) \n",
+ "#Result\n",
+ "print\"Mininmum work done to compress oxygen =\",round(W),\"J(approx)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mininmum work done to compress oxygen = 5743.0 J(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/CH3.ipynb b/Thermodynamics:_A_Core_Course/CH3.ipynb
new file mode 100644
index 00000000..b72e6afa
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/CH3.ipynb
@@ -0,0 +1,941 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3:The first Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1,Page no:18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.1\n",
+ "#to find energy transfered in form of heat:\n",
+ "#Variable declaration\n",
+ "V1=14 \t\t\t\t#initial volume of cylinder in m3\n",
+ "V2=9 \t\t\t\t#final volume of cylinder in m3\n",
+ "P=2000 \t\t\t\t#pressure during the operation in N/m2\n",
+ "U=(-6000) \t\t\t#internal energy of the system in J\n",
+ "#Calculation\t\n",
+ "W=-P*(V2-V1) \t\t\t#work done during the operation in J\n",
+ "Q=U-W \t\t\t\t#energy tranfered in form of heat in J\n",
+ "#Result\n",
+ "print\"energy tranfered in form of heat is\",Q,\"J\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "energy tranfered in form of heat is -16000 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2,Page no:18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.2\n",
+ "#to find the heat lost or gained by the system:\n",
+ "#Variable declaration\n",
+ "R=8.314 \t\t\t\t#universal gas constant [J/K/mol]\n",
+ "T=300\t\t\t\t\t#temperture for the process [K]\n",
+ "U=0 \t\t\t\t\t#change in internal energy [J]\n",
+ "V1=2.28 \t\t\t\t#initial volume [m3]\n",
+ "V2=4.56 \t\t\t\t#final volume[m3]\n",
+ "#Calculation\n",
+ "import math\n",
+ "W=2.303*R*T*math.log10(V2/V1) \t\t#work done during the process[J]\n",
+ "Q=W \t\t\t\t\t#heat lost or gained by the system[J]\n",
+ "#Result\n",
+ "print\"The heat gained by the system is\",round(Q),\"J mol^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat gained by the system is 1729.0 J mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3,Page no:19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.3\n",
+ "\n",
+ "#to find Q,W,U for 1 mole of bromine vaporizes\n",
+ "#Variable declaration\n",
+ "#given:\n",
+ "H=29.2 \t\t\t\t\t#latent heat of vaporisation[KJ/mol]\n",
+ "T=332 \t\t\t\t\t#temperature of the system[K]\n",
+ "R=8.314 \t\t\t\t#universal gas constant [J/K/mol]\n",
+ "#Calculation\n",
+ "Qp=H \t\t\t\t\t#at constant pressure [KJ]\n",
+ "W=-R*0.001*T \t\t\t\t#workdone [KJ]\n",
+ "U=Qp+W \t\t\t\t\t#change in internal energy[KJ]\n",
+ "#Result\n",
+ "print\"Heat absorbed by the bromine vapours is\",Qp,\"KJ\"\n",
+ "print\"\\nWorkdone during the process is\",round(W,2),\"KJ\"\n",
+ "print\"\\nChange in internal energy of the system is\",round(U,2),\"KJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat absorbed by the bromine vapours is 29.2 KJ\n",
+ "\n",
+ "Workdone during the process is -2.76 KJ\n",
+ "\n",
+ "Change in internal energy of the system is 26.44 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4,Page no:20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.4\n",
+ "#to find change in enthalpy of the process:\n",
+ "\n",
+ "#variable declaration\n",
+ "print\"C7H16(l) + 11O2(g) -> 7CO2(g) + 8H2O(l)\" \n",
+ "n=-4 \t\t\t\t#change in no. of moles when reaction proceeds from reactants to \t\t\t\tproducts\n",
+ "T=298 \t\t\t\t#temperature of the process [K]\n",
+ "R=8.314 \t\t\t#universal gas constant [J/K/mol]\n",
+ "Qv=-4800 \t\t\t#heat energy at constant volume [KJ]\n",
+ "#Calculation\t\n",
+ "U=Qv \t\t\t\t#change in internal energy of system [KJ]\n",
+ "H=U+n*R*0.001*T \t\t#change in enthalpy of the system[KJ]\n",
+ "#Result\n",
+ "print\"the change in enthalpy of system is\",round(H,2),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C7H16(l) + 11O2(g) -> 7CO2(g) + 8H2O(l)\n",
+ "the change in enthalpy of system is -4809.91 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5,Page no:21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.5\n",
+ "#to find the Q,W,H\n",
+ "#Variable declaration\n",
+ "n=1 \t\t\t\t#number of moles of an given ideal gas\n",
+ "T=298 \t\t\t\t#temperature for the process[K]\n",
+ "V1=8.3 \t\t\t\t#initial volume of the ideal gas[m3]\n",
+ "V2=16.8 \t\t\t#final volume of the ideal gas[m3]\n",
+ "R=8.314 \t\t\t#universal gas constant[J#K#mol]\n",
+ "import math\n",
+ "#Calculation\n",
+ "W=-2.303*R*T*math.log10(V2/V1) #[J]\n",
+ "Q=-W \t\t\t\t#[J]\n",
+ "#Result\n",
+ "print\"H=U+PV ,where U is change in internal energy which is zero due to isothermal process\" \n",
+ "print\"PV where V is change in volume of system ,PV=RT & RT==0 since T i.e change in temp is zero for system\" \n",
+ "print\"Therefore,the change in enthalpy is 0J\" \n",
+ "print\"The workdone by system is\",round(W,1),\"J mol^-1\"\n",
+ "print\"\\nThe heat evolved is\",round(Q,1),\"J mol^-1\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H=U+PV ,where U is change in internal energy which is zero due to isothermal process\n",
+ "PV where V is change in volume of system ,PV=RT & RT==0 since T i.e change in temp is zero for system\n",
+ "Therefore,the change in enthalpy is 0J\n",
+ "The workdone by system is -1747.3 J mol^-1\n",
+ "\n",
+ "The heat evolved is 1747.3 J mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6,Page no:24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.6\n",
+ "\n",
+ "##to find the change in enthalpy(H) of water \n",
+ "#Variable declaration\n",
+ "T1=323 \t\t\t#intial temperature of water[K]\n",
+ "T2=373 \t\t\t#final temperature of water[K]\n",
+ "Cp=75.29 \t\t#specific heat of water[J/K/mol]\n",
+ "w=100.0 \t\t\t#weight of water[g]\n",
+ "mol_wt=18.0 \t\t#molecular weight of water[g/mol]\n",
+ "#Calculation\t\n",
+ "n=w/mol_wt \t\t#no. of moles of water[moles]\n",
+ "H=(n*Cp*(T2-T1))*0.001 \t#change in enthalpy of water[J]\n",
+ "#Result\n",
+ "print\"The change in enthalpy of water is\",round(H,2),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in enthalpy of water is 20.91 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7,Page no:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.7\n",
+ "#to find the change in enthalpy of \treaction(H)\n",
+ "print\"SO2 + 0.5O2 -> SO3\"\n",
+ "#Variable declaration\n",
+ "U=-97030 \t\t\t#heat of reaction[J]\n",
+ "n=1-(1+0.5) \t\t\t#change in no. of moles \n",
+ "R=8.314 \t\t\t#universal gas constant[J/K/mol]\n",
+ "T=298 \t\t\t\t#temperature during the reaction[K]\n",
+ "#Calculation\t\n",
+ "H=U+n*R*T \t\t\t#change inenthalpy of reaction[J]\n",
+ "#result\n",
+ "print\"The change in enthalpy of reaction is\",round(H),\"J(approx)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SO2 + 0.5O2 -> SO3\n",
+ "The change in enthalpy of reaction is -98269.0 J(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8,Page no:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.8\n",
+ "#to find the change in internal energy (U) of given reaction\n",
+ "print\"i.C(s) + O2(g) -> CO2(g)\"\n",
+ "#Variable declaration\n",
+ "H1=-393.5 \t\t#change in enthalpy [KJ/mol]\n",
+ "T1=298 \t\t\t#temperature [K]\n",
+ "n1=0 \t\t\t#change in no. of moles in reaction moving in forward direction\n",
+ "R=0.008314 \t\t#universal gas constant [KJ/K/mol]\n",
+ "\n",
+ "#Calculation\t\n",
+ "U1=H1-n1*R*T1 \t\t#change in internal energy [KJ]\n",
+ "print\"The change in internal energy is\",round(U1,1),\"KJ/mol\"\n",
+ "\n",
+ "#to find the change in internal energy (U) of given reaction\n",
+ "print\"ii.C(s) + 0.5O2 -> CO(g)\" \n",
+ "#Variable declaration\n",
+ "H2=-110.5 \t\t#change in enthalpy[KJ/mol]\n",
+ "T2=298 \t\t\t#temperature[K]\n",
+ "n2=1-0.5 \t\t#change in no. of moles in reaction moving in forward direction\n",
+ "R=0.008314 \t\t#universal gas constant [KJ/K/mol]\n",
+ "\n",
+ "#Calculation\n",
+ "U2=H2-n2*R*T2 \t\t#change in internal energy [KJ]\n",
+ "#result\n",
+ "print\"The change in internal energy is\",round(U2,3),\"KJ/mol\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i.C(s) + O2(g) -> CO2(g)\n",
+ "The change in internal energy is -393.5 KJ/mol\n",
+ "ii.C(s) + 0.5O2 -> CO(g)\n",
+ "The change in internal energy is -111.739 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9,Page no:30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.9\n",
+ "#to find the standard heat of rxn for combustion of 1 mole of C6H6\n",
+ "print\"The standard heat of combustion of\"\n",
+ "print\"2C6H6(l)+ 15O2(g)-> 12 CO2(g)+ 6 H2O(l)\" \n",
+ "print\"H1(standard heat of combustion)=-6536 KJ/mol\" \n",
+ "#Variable declaration\n",
+ "H1=-6536 \t\t\t#standard heat of combustion [KJ/mol]\n",
+ "#Calculation\t\n",
+ "print\"C6H6(l)+ 7.5 O2(g)-> 6 CO2(g)+ 6 H2O(l)\" \n",
+ "H2=H1/2 \t\t\t#standard heat of combustion[KJ/mol]\n",
+ "#Result\n",
+ "print\"H2(standard heat of combustion for 1 mole of C6H6)=\",H2,\"kJ/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The standard heat of combustion of\n",
+ "2C6H6(l)+ 15O2(g)-> 12 CO2(g)+ 6 H2O(l)\n",
+ "H1(standard heat of combustion)=-6536 KJ/mol\n",
+ "C6H6(l)+ 7.5 O2(g)-> 6 CO2(g)+ 6 H2O(l)\n",
+ "H2(standard heat of combustion for 1 mole of C6H6)= -3268 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10,Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.10\n",
+ "#to find the standard heat of formation of one mole of product\n",
+ "print\"N2(g)+3H2(g)-> 2NH3(g)\" \n",
+ "#Variable declaration\n",
+ "H=-92.22 \t\t\t#standard heat of reaction [KJ/mol]\n",
+ "#Calculation\n",
+ "H1=H/2 \t\t\t\t#standard heat of formation of 1 mole [KJ/mol]\n",
+ "#Result\n",
+ "print\"H(heat of formation of 1 mole of product)=\",H1,\"kJ mol^-1\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N2(g)+3H2(g)-> 2NH3(g)\n",
+ "H(heat of formation of 1 mole of product)= -46.11 kJ mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11,Page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.11\n",
+ "\n",
+ "#to find the standard heat of reaction\n",
+ "print\"C2H5OH(l)+3O2(g)->2CO2(g)+3H2O(l)\" \n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t\t#temperature during the reaction[K]\n",
+ "Hw=-285.83 \t\t\t#standard heat of formation of liquid water [KJ/mol]\n",
+ "He=-277.69 \t\t\t#standard heat of formation of liquid ethanol[KJ/mol]\n",
+ "Hco2=-393.51 \t\t\t#standard heat of formation of carbon dioxide[KJ/mol]\n",
+ "Ho2=0 \t\t\t\t#standard heat of formation of oxygen gas[KJ/mol]\n",
+ "#Calculation\t\n",
+ "H=2*Hco2+3*Hw-He-3*Ho2 \t\t#standard heat of reaction\n",
+ "#Result\n",
+ "print\"H(standard heat of reaction)=\",H,\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C2H5OH(l)+3O2(g)->2CO2(g)+3H2O(l)\n",
+ "H(standard heat of reaction)= -1366.82 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12,Page no:33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.12\n",
+ "\n",
+ "#to find the value of standard heat of formation of CO\n",
+ "print\"CO(g)+NO(g)->0.5N2(g)+CO2(g)\" \n",
+ "#Variable declaration\n",
+ "Hrxn=-374 \t\t#standard heat of reaction[KJ/mol]\n",
+ "Hno=90.25 \t\t#standard heat of formation of NO[KJ/mol]\n",
+ "Hco2=-393.51 \t\t#standard heat of formation of CO2[KJ/mol]\n",
+ "Hn2=0 \t\t\t#standard heat of formation of N2[KJ/mol]\n",
+ "T=298 \t\t\t#temperature of reaction [K]\n",
+ "#Calculation\n",
+ "Hco=0.5*Hn2+Hco2-Hno-Hrxn \t#standard heat of formation of CO[KJ/mol]\n",
+ "#result\n",
+ "print\"Hco(standard heat of formation)=\",Hco,\"kJ mol^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CO(g)+NO(g)->0.5N2(g)+CO2(g)\n",
+ "Hco(standard heat of formation)= -109.76 kJ mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13,Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.13\n",
+ "#to find the heat of combustion and formation of propylene\n",
+ "\n",
+ "#Variable declaration\n",
+ "#(\"C3H6(g)+H2(g)->C3H8(g) H1=-29.6 Kcal\") \n",
+ "#(\"C3H8(g)+5O2(g)->3CO2(g)+4H2O(l) H2=-530.6 Kcal\") \n",
+ "#(\"C(s)+O2(g)->CO2(g) H3=-94.0 Kcal\") \n",
+ "#(\"H2(g)+0.5O2(g)->H2O(l) H4=-68.3 Kcal. \") \n",
+ "H1=-29.6 \t\t#the standard heat of hydrogenation of gaseous propylene to propane[Kcal]\n",
+ "H2=-530.6 \t\t#the heat of combustion of propane[Kcal] \n",
+ "H3=-94.0 \t\t#the heat of formation of carbon dioxide[Kcal]\n",
+ "H4=-68.3 \t\t#the heat of formation of liquid water[Kcal]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "print\"C3H6(g)+4.5O2(g)->3CO2(g)+3H2O(l)\" \n",
+ "H5=(3*H3+4*H4)-(H1+H2)#[Kcal]\n",
+ "#Result\n",
+ "print\"\\n H(standard heat of combustion)=\",H5,\"Kcal\"\n",
+ "print\"3C(s)+3H2(g)->C3H6(g)\" \n",
+ "H6=-H5+3*H3+3*H4 #[Kcal]\n",
+ "print\"\\n H(standard heat of formation)=\",H6,\"Kcal\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C3H6(g)+4.5O2(g)->3CO2(g)+3H2O(l)\n",
+ "\n",
+ " H(standard heat of combustion)= 5.0 Kcal\n",
+ "3C(s)+3H2(g)->C3H6(g)\n",
+ "\n",
+ " H(standard heat of formation)= -491.9 Kcal\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14,Page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.14\n",
+ "\n",
+ "#to find the heat of formation of N2O5\n",
+ "#Variable declaration\n",
+ "H1=-114.1 \t\t\t#standard heat of reaction:2NO(g)+O2(g)->2NO2(g) [KJ/mol]\n",
+ "H2=-110.2 \t\t\t#standard heat of reaction:4NO2(g)+O2(g)->2N2O5(g) [KJ/mol]\n",
+ "H3=180.5 \t\t\t#standard heat of reaction:N2(g)+O2(g)->2NO(g) [KJ/mol]\n",
+ "\n",
+ "\t#reacton:N2(g)+2.5O2(g)->N2O5(g)\n",
+ "#Calculation\n",
+ "H4=(2*H1+H2+2*H3)/2 \t\t#standard heat of formation of N2O5[KJ/mol]\n",
+ "#Result\n",
+ "print\"H(standard heat of formation of N2O5)=\",H4,\"kJ/mol\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H(standard heat of formation of N2O5)= 11.3 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15,Page no:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.15\n",
+ "#to find the standard heat of formaton of solid sucrose\n",
+ "#Variable declaration\n",
+ "Hc=-5645 \t\t#standard enthalpy of combustion of \t\t\treaction:C12H22O11(s)+12O2(g)->12CO2(g)+11H2O(l) [KJ/mol]\n",
+ "Hf1=-393.51 \t\t#standard heat of formation of CO2: C(s)+O2(g)->CO2(g) [KJ/mol]\n",
+ "Hf2=-285.83 \t\t#standard heat of formation of H2O: H2(g)+0.5O2(g)->H2O(l) [KJ/mol]\n",
+ "\n",
+ "#Calculation\n",
+ "\t#reaction:12C(s)+11H2(g)+5.5O2(g)->C12H22O11(s)\n",
+ "Hf=12*Hf1+11*Hf2-Hc \t#[KJ/mol]\n",
+ "#Result\n",
+ "print\"Hf(standard heat of formation of solid sucrose)=\",Hf,\"KJ/mol(approx)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hf(standard heat of formation of solid sucrose)= -2221.25 KJ/mol(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.16,Page no:37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.16\n",
+ "\n",
+ "#to find the standard heat of formation of NH3 at 400K for same reaction\n",
+ "#Variable declaration\n",
+ "Hf1=-46.11 \t\t\t#standard heat of formation of NH3 at 298K \t\t\t\t#reaction:0.5N2(g)+1.5H2(g)->NH3(g) [KJ/mol]\n",
+ "Cp1=29.125 \t\t\t#molar heat capacity at constant pressure for N2(g)[J/K/mol]\n",
+ "Cp2=28.824 \t\t\t#molar heat capacity at constant pressure for H2(g)[J/K/mol]\n",
+ "Cp3=35.06 \t\t\t#molar heat capacity at constant pressure for NH3(g)[J/K/mol]\n",
+ "T1=298 \t\t\t\t#initial temperature[K]\n",
+ "T2=400 \t\t\t\t#final temperature[K]\n",
+ "\n",
+ "#Calculation\n",
+ "\t\n",
+ "Cp=Cp3-0.5*Cp1-1.5*Cp2 \t\t#[J/K/mol]\n",
+ "T=T2-T1 \t\t\t#[K]\n",
+ "Hf2=Hf1+Cp*0.001*T \t\t#standard heat of formation for NH3 at 400K[KJ/mol]\n",
+ "#result\n",
+ "print\"\\n Hf2(standard heat of formation for NH3 at 400K =\",round(Hf2,3),\"kJ/mol\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Hf2(standard heat of formation for NH3 at 400K = -48.429 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.17,Page no:38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate heat of formation of H2O\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "from scipy import integrate\n",
+ "#Variable declaration\n",
+ "dH_298=-241.82 #Std Heat of formation at 298 K [kJ mol^-1]\n",
+ "dH_298=dH_298*1000 # in [J mol^-1]\n",
+ "T1=298 #[K]\n",
+ "T2=1273 #[K]\n",
+ "def f(T):\n",
+ " Cp_H2g=(29.07-((0.836*10**-3)*T)+((20.1*10**-7)*T**2))\n",
+ " Cp_O2g=25.72+(12.98*10**-3)*T-(38.6*10**-7)*T**2\n",
+ " Cp_H2Og=30.36+(9.61*10**-3)*T+(11.8*10**-7)*T**2\n",
+ " delta_Cp=(Cp_H2Og-(Cp_H2g+(1.0/2.0)*Cp_O2g))\n",
+ " return(delta_Cp)\n",
+ "\n",
+ "dHK=integrate.quad(f,T1,T2)\n",
+ "\n",
+ "dH_1273=dH_298+dHK[0]\n",
+ "dH_1273=dH_1273/1000\n",
+ "print\"Heat of formation of H2O(g) at 1000 C=\",round(dH_1273,1),\"kJ mol^-1 (APPROXIMATE)\"\n",
+ "\n",
+ "#NOTE\n",
+ "print\"NOTE:\"\n",
+ "print\"Slight variation in answer,because integration is not done precisely in the book\"\n",
+ "print\"In the book,it is written as:-7497.46 instead of -7504.3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of formation of H2O(g) at 1000 C= -249.3 kJ mol^-1 (APPROXIMATE)\n",
+ "NOTE:\n",
+ "Slight variation in answer,because integration is not done precisely in the book\n",
+ "In the book,it is written as:-7497.46 instead of -7504.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.18,Page no:40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.18\n",
+ "#to find the C-H bond energy of CH4 from the above bond energies\n",
+ "#Variable declaration\n",
+ "H1=435.0 \t\t\t#bond dissociation energy for: CH4->CH3+H [KJ/mol]\n",
+ "H2=364.0 \t\t\t#bond dissociation energy for:CH3->CH2+H [KJ/mol]\n",
+ "H3=385.0 \t\t\t#bond dissociation energy for:CH2->CH+H [KJ/mol] \n",
+ "H4=335.0 \t\t\t#bond dissociation energy for:CH->C+H [KJ/mol]\n",
+ "#Calculation\t\n",
+ "H=(H1+H2+H3+H4)/4 \t#the bond energy for C-H bond in CH4 [KJ/mol]\n",
+ "#Result\n",
+ "print\"\\n H(the C-H bond energy in CH4)=\",round(H,1),\"kJ/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " H(the C-H bond energy in CH4)= 379.8 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.19,Page no:40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.19\n",
+ "\n",
+ "#to find the C-C bond energy in ethane bond\n",
+ "#Variable declaration\n",
+ "H1=-84.68 \t\t\t#heat of formation : 2C(s)+3H2(g)->C2H6(g) [KJ/mol]\n",
+ "H2=2*716.68 \t\t\t#heat of formation : 2C(s)->2C(g) [KJ]\n",
+ "H3=3*436 \t\t\t#heat of formation : 3H2(g)->6H(g) [KJ]\n",
+ "H4=412 \t\t\t\t#taking it as bond energy for one C-H bond[KJ/mol]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "H=H2+H3-H1 \t\t\t#heat of reaction : C2H6(g)->2C(g)+6H(g) [KJ/mol]\n",
+ "H5=H-6*H4 \t\t\t#bond energy for one C-C bond in ethane bond [KJ/mol]\n",
+ "#Result\n",
+ "print\"\\n Hc-c(bond energy for one C-C bond in ethane bond)=\",H5,\"kJ/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Hc-c(bond energy for one C-C bond in ethane bond)= 354.04 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.20,Page no:42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.20\n",
+ "#to find the lattice enthalpy of magnesium bromide\n",
+ "#Variable declaration\n",
+ "\t#MgBr2(s)-->Mg(s)+Br2(l)-->Mg(g)+Br2(l)-->Mg(g)+Br2(g)-->Mg(g)+2Br(g)-->Mg+2(g) + 2e(g) + \t2Br(g)-->Mg+2(g) + 2Br-(g)\n",
+ "H1=-524 \t\t#enthalpy of formation of MgBr2(s) from its element [KJ/mol]\n",
+ "H2=148 \t\t\t#enthalpy of sublimation of Mg(s) [KJ/mol]\n",
+ "H3=31 \t\t\t#enthalpy of vaporization of Br2(l) [KJ/mol]\n",
+ "H4=193 \t\t\t#enthalpy of dissociation Br2 to 2Br(g) [KJ/mol]\n",
+ "H5=2187 \t\t#enthalpy of ionization of Mg(g) to Mg+2(g) [KJ/mol]\n",
+ "H6=-650 \t\t#enthalpy of formation of Br-(g) [KJ/mol]\n",
+ "\n",
+ "#calculation\n",
+ "H=-H1+H2+H3+H4+H5+H6 \t#lattice enthalpy [KJ/mol]\n",
+ "#Result\n",
+ "print\"\\n H(lattice enthalpy of magnesium bromide)=\",H,\"kJ/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " H(lattice enthalpy of magnesium bromide)= 2433 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.21,Page no:44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate maximum flame temperature\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "from scipy import integrate\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "#CH4(g)+2*O2(g)--->CO2(g)+2*H2O(l)\n",
+ "dH1_298=-881.25 #[kJ/mol]\n",
+ "#H2O(l)-->H2O(g)\n",
+ "dH2_298=43.60 #[kJ/mol]\n",
+ "#2H2O(l)-->2*H2O(g)\n",
+ "dH3_298=2*dH2_298 #[kJ/mol]\n",
+ "#Adding (1) and (3)\n",
+ "dH4_298=dH1_298+dH3_298 #[kJ/mol]\n",
+ "dH_heat=-dH4_298*1000 #[J/mol]\n",
+ "\n",
+ "#CALCULATION\n",
+ "\n",
+ "def f(T2):\n",
+ " def g(T):\n",
+ " Cp_CO2g=26.0+((43.5*10**-3)*T)-((148.3*10**-7)*T**2)\n",
+ " Cp_H2Og=30.36+((9.61*10**-3)*T)+((11.8*10**-7)*T**2)\n",
+ " Cp_N2g=27.30-((5.23*10**-3)*T)-((0.04*10**-7)*T**2)\n",
+ " sig_nCpf=Cp_CO2g+2*Cp_H2Og+8*Cp_N2g\n",
+ " return(sig_nCpf)\n",
+ " crt=integrate.quad(g,298,T2)\n",
+ " ct=crt[0]-dH_heat\n",
+ " return(ct)\n",
+ "T2=fsolve(f,2)\n",
+ "print \"T2,maximum flame temperature is :\",round(T2[0],2),\"K\"\n",
+ "print\"Calculation mistake in book,wrongly written as:2250 K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T2,maximum flame temperature is : 2957.06 K\n",
+ "Calculation mistake in book,wrongly written as:2250 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/CH4.ipynb b/Thermodynamics:_A_Core_Course/CH4.ipynb
new file mode 100644
index 00000000..f0aec688
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/CH4.ipynb
@@ -0,0 +1,146 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Defining Thermodynamic State:The State Postulate"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1,Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.1\n",
+ "\n",
+ "#to find the mass of substance present in liquid and vapour phase \n",
+ "#Variable declaration\n",
+ "M=2.5 \t\t\t\t#mass of the substance[Kg]\n",
+ "x=0.6 \t\t\t\t#mass fraction for vapour phase \n",
+ "P=7 \t\t\t\t#pressure [atm]\n",
+ "T=438 \t\t\t\t#temperature[K]\n",
+ "\n",
+ "#Calculation\n",
+ "Ml=(1-x)*M \t\t\t#mass fraction of liquid phase[Kg]\n",
+ "Mg=x*M \t\t\t\t#mass fraction of vapour phase[Kg]\n",
+ "#Result\n",
+ "print\"M(liquid phase)=\",Ml,\"Kg\\nM(vapour phase)=\",Mg,\"Kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M(liquid phase)= 1.0 Kg\n",
+ "M(vapour phase)= 1.5 Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2,Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.2\n",
+ "\n",
+ "#to find the total volume occupied by the mixture \n",
+ "#Variable declaration\n",
+ "Vl=0.0177 \t\t\t#specific volume of saturated liquid[m3/Kg]\n",
+ "Vg=4.43 \t\t\t#specific volume of saturated vapour[m3/Kg]\n",
+ "P=7 \t\t\t\t#pressure[atm]\n",
+ "T=438 \t\t\t\t#temperature[K]\n",
+ "x=0.6 \t\t\t\t#fraction of vapour phase\n",
+ "M=2.5 \t\t\t\t#mass of the substance[Kg]\n",
+ "\n",
+ "#Calculation\n",
+ "V=((1-x)*Vl+x*Vg)*M \t\t#total volume occupied [m3]\n",
+ "#result\n",
+ "print\"Total volume occupied =\",round(V,2),\"m^3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total volume occupied = 6.66 m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3,Page no:51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.3\n",
+ "\n",
+ "#to find the total internal energy of the mixture\n",
+ "#Variable declaration\n",
+ "M=2.5 \t\t\t\t#mass of a substance[Kg]\n",
+ "x=0.6 \t\t\t\t#fraction of vapour phase \n",
+ "Ug=1105.0 \t\t\t#specific internal energy of saturated vapour[J/Kg]\n",
+ "Ul=298.0 \t\t\t\t#specific internal energy of saturated liquid[J/Kg] \n",
+ "#Calculation\n",
+ "U=M*((1-x)*Ul+x*Ug) \n",
+ "#Result\n",
+ "print\"The total internal energy of the mixture =\",U,\"J\"\n",
+ "print\"\\nNOTE:In textbook,it is wrongly calculated as 1950 J\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total internal energy of the mixture = 1955.5 J\n",
+ "\n",
+ "NOTE:In textbook,it is wrongly calculated as 1950 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/CH5.ipynb b/Thermodynamics:_A_Core_Course/CH5.ipynb
new file mode 100644
index 00000000..865af391
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/CH5.ipynb
@@ -0,0 +1,1763 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5:The second Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1,Page no:59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.1\n",
+ "\n",
+ "#to find the workdone , heat rejected , and efficiency of the engine\n",
+ "#Variable declaration\n",
+ "T1=373.0 \t\t\t\t#initial temperature [K]\n",
+ "T2=573.0 \t\t\t\t#final temperature [K]\n",
+ "Q2=750.0 \t\t\t\t#Heat absorbed by carnot engine[J]\n",
+ "\n",
+ "#Calculation\n",
+ "e=(T2-T1)/T2 \t\t\t#efficiency of the engine\n",
+ "W=e*Q2 \t\t\t\t#Workdone by the engine[J]\n",
+ "Q1=T1*Q2/T2 \t\t\t#Heat rejected by the engine[J]\n",
+ "#Result\n",
+ "print\"Efficiency of the engine =\",round(e,3) \n",
+ "print\"\\n Workdone by the engine =\",round(W),\"J\"\n",
+ "print\"\\n Heat rejected by the engine =\",round(Q1),\"J\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of the engine = 0.349\n",
+ "\n",
+ " Workdone by the engine = 262.0 J\n",
+ "\n",
+ " Heat rejected by the engine = 488.0 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2,Page no:61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.2\n",
+ "#to analyse the efficiency of the engine \n",
+ "\n",
+ "#Variable declaration\n",
+ "T1=250.0 #temperature of heat rejection[K]\n",
+ "T2=1000.0 #temperature of heat absorption[K]\n",
+ "#Calculation\n",
+ "e=1-(T1/T2) \n",
+ "#Result\n",
+ "print\"Efficiency of the corresponding carnot engine =\",e,\"or\",e*100,\"%\"\n",
+ "print\" Therefore , the inventors claim of 80% efficiency is absurd.The patent application should be rejected\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of the corresponding carnot engine = 0.75 or 75.0 %\n",
+ " Therefore , the inventors claim of 80% efficiency is absurd.The patent application should be rejected\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3,Page no:62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.3\n",
+ "#To find the minimum heat required from heat source to yield the above work\n",
+ "#Variable declaration\n",
+ "T1=323.0 \t\t\t\t#temperature [K]\n",
+ "T2=423.0 \t\t\t\t#temperature [K]\n",
+ "W=1.3 \t\t\t\t#work [KJ]\n",
+ "#Calculation\n",
+ "e=(T2-T1)/T2 \t\t\t#efficiency\n",
+ "Q2=W/e \t\t\t\t#minimum heat withdrawal from heat source[KJ]\n",
+ "#Result\n",
+ "print\"Minimum heat withdrawal from heat source=\",round(Q2,2),\"kJ\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum heat withdrawal from heat source= 5.5 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5,Page no:64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.5\n",
+ "#to find the molar entropy change \n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t#Temperature [K]\n",
+ "n=1 \t\t\t#no. of moles\n",
+ "V1=500 \t\t\t#initial volume [cm3]\n",
+ "V2=1000 \t\t#final volume [cm3]\n",
+ "R=8.314 \t\t#Universal gas constant [J/mol/K]\n",
+ "import math\n",
+ "#Calculation\n",
+ "S=R*math.log(V2/V1)\t\t#molar entropy change at constant temperature[J/K]\n",
+ "#Result\n",
+ "print\"Molar entropy change of argon =\",round(S,1),\"J/K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar entropy change of argon = 5.8 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6,Page no:64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.6 \n",
+ "\n",
+ "#to find the change in molar entropy when the gas expands isothermally and reversibly\n",
+ "#Variable declaration\n",
+ "W=1728.0 \t\t\t#Isothermal and reversible work done[J/mol]\n",
+ "T=298.0 \t\t\t#Isothermal temperature[K]\n",
+ "#Calculation\n",
+ "\n",
+ "S=W/T \t\t\t#change in molar entropy for isothermal and reversible process\n",
+ "#result\n",
+ "print\"The change in molar entropy =\",round(S,1),\"JK^-1mol^-1\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in molar entropy = 5.8 JK^-1mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7,Page no:68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.7\n",
+ "\n",
+ "#To find the change in entropy of the surroundings at 298K\n",
+ "#Variable declaration\n",
+ "H=-92.22 \t\t\t#Standard reaction enthalpy[KJ]\n",
+ "T=298 \t\t\t\t#Temperature [K]\n",
+ "\n",
+ "#Calculation\t\n",
+ "\t#standard reaction enthalpy is H.Therefore, heat gained by the surroundings at 298K is -H\n",
+ "S=-H*1000/T \t\t\t#Change in entropy[J/K]\n",
+ "#Result\n",
+ "print\"Change in entropy of the surroundings at 298k =\",round(S,1),\"J/K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy of the surroundings at 298k = 309.5 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8,Page no:69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.8\n",
+ "\n",
+ "#To find the change in entropy for argon gas\n",
+ "#Variable declaration\n",
+ "T1=298.0 \t\t\t\t#Initial Temperature[K]\n",
+ "T2=573.0 \t\t\t\t#Final Temperature[K]\n",
+ "Cv=29.1 \t\t\t#Specific Heat capacity of argon gas [J/K/mol]\n",
+ "n=1 \t\t\t\t#no. of moles\n",
+ "\n",
+ "import math\n",
+ "#calculation\n",
+ "S=n*Cv*math.log(T2/T1) \t\t#Change in entropy [J/K]\n",
+ "#Result\n",
+ "print\"The change in entropy of the argon gas is\",round(S,2),\"J/K\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy of the argon gas is 19.03 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9,Page no:69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.9\n",
+ "\n",
+ "#To find the total entropy change of solid\n",
+ "#Variable declaration\n",
+ "T1=276.0 \t\t\t\t#Initial temperature[K]\n",
+ "Tf=278.7 \t\t\t#Freezing point temperature[K]\n",
+ "Tb=353.3 \t\t\t#Boiling point temperature[K]\n",
+ "T2=373.0 \t\t\t\t#Final temperature[K]\n",
+ "Hf=9870.0 \t\t\t#Standard enthalpy of fusion[J/mol]\n",
+ "Hv=30800.0 \t\t\t#Standard enthalpy of vaporization[J/mol]\n",
+ "Cp=136.1 \t\t\t#Specific heat capacity of benzene[J/K/mol]\n",
+ "mol_wt=78.0 \t\t\t#molecular weight of benzene[g/mol]\n",
+ "mass=200.0\t\t\t#weight of solid benzene[g]\n",
+ "print\"Cp doesnot change within this temp limit\" \n",
+ "import math\n",
+ "#calculation\n",
+ "n=mass/mol_wt \t\t\t#no. of moles\n",
+ "\n",
+ "S1=n*Cp*math.log(Tf/T1) \t#entropy change in heating [J/K]\n",
+ "S2=n*Hf/Tf \t\t\t#entropy change in melting[J/K] \n",
+ "S3=n*Cp*math.log(Tb/Tf) \t#entropy change in heating[J/K]\n",
+ "S4=n*Hv/Tb \t\t\t#entropy change in vaporization[J/K]\n",
+ "S5=n*Cp*math.log(T2/Tb) \t#entropy change in heating[J/K]\n",
+ "S=S1+S2+S3+S4+S5 \t\t#total entropy change in heating from 276 to 373K\n",
+ "#Result\n",
+ "print\"Total entropy change in heating 200g benzene from 3 to 100`C is\",round(S,1),\"J/K or\",round(S/1000,3),\"KJ/K\"\n",
+ "print\"\\nNOTE:In textbook the value of 'n' is wrongly calculated as 25.64 instead of 2.564,SO there is a error in answer shown in book\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cp doesnot change within this temp limit\n",
+ "Total entropy change in heating 200g benzene from 3 to 100`C is 419.4 J/K or 0.419 KJ/K\n",
+ "\n",
+ "NOTE:In textbook the value of 'n' is wrongly calculated as 25.64 instead of 2.564,SO there is a error in answer shown in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10,Page no:71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.10\n",
+ "#To find the change in entropy of the gas\n",
+ "#Isothermal process\n",
+ "#Variable declaration\n",
+ "mass=32 \t\t\t#weight of methane gas[gm]\n",
+ "P1=6*10**5 \t\t\t#Initial temperature[N/m2]\n",
+ "P2=3*10**5 \t\t\t#Final pressure[N/m2]\n",
+ "mol_wt=16 \t\t\t#molecular weight of methane gas[g/mol]\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "#calculation\t\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "import math\t\n",
+ "n=mass/mol_wt \t\t\t#no. of moles\n",
+ "S=n*R*math.log(P1/P2) \t\t#change in entropy of gas[J/K]\n",
+ "\n",
+ "#Result\n",
+ "print\"The change in entropy of the gas is\",round(S,2),\"J/K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy of the gas is 11.53 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11,Page no:75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate:\n",
+ "#1.Total no. og possible configuration\n",
+ "#2.Probability of getting a configuration\n",
+ "#3.Total energy and average energy of the system\n",
+ "#4.Change in energy of the system\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "black=2 #No. of black balls\n",
+ "white=1 #No. of white ball\n",
+ "\n",
+ "#CALCULATION\n",
+ "\n",
+ "#Total no. of config\n",
+ "W=math.factorial(black+white)/(math.factorial(black)*math.factorial(white))\n",
+ "#Probability of getting a config\n",
+ "P=1.0/W\n",
+ "#Total and Average energy of system\n",
+ "E1=0+1+2\n",
+ "E2=E1\n",
+ "E3=E2\n",
+ "E=E1+E2+E3\n",
+ "E_av=E/3\n",
+ "#Change in total energy of system\n",
+ "E1_dash=1+2+3\n",
+ "E2_dash=E1_dash\n",
+ "E3_dash=E2_dash\n",
+ "E_dash=E1_dash+E2_dash+E3_dash\n",
+ "change=E_dash-E\n",
+ "\n",
+ "#RESULT\n",
+ "print\"1.Total No. of possible configuration:\",W\n",
+ "print\"2.Probability of getting a configuration=\",P,\"or 1/3\"\n",
+ "print\"3.Total energy of system=\",E\n",
+ "print\" Therefore,Average energy=\",E_av\n",
+ "print\"4.In this case,Total energy=\",E_dash\n",
+ "print\" Change in total energy of system=\",change"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Total No. of possible configuration: 3\n",
+ "2.Probability of getting a configuration= 0.333333333333 or 1/3\n",
+ "3.Total energy of system= 9\n",
+ " Therefore,Average energy= 3\n",
+ "4.In this case,Total energy= 18\n",
+ " Change in total energy of system= 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.12,Page no:77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.12\n",
+ "\n",
+ "#To find the relative number of distinguishable quantum states in 1 mole of water and ice at 273K \n",
+ "#Variable declaration\n",
+ "n=1.0 \t\t\t#no. of moles\n",
+ "T=273.0 \t\t\t#temperature [K]\n",
+ "Hf=6000.0 \t\t#enthalpy of fusion at 273K [J/mol]\n",
+ "k=1.38*(10**-23) \t#boltzmann constant[J/K]\n",
+ "\n",
+ "#calculation\n",
+ "p=Hf/(k*T)/2.303 \n",
+ "print\"\\nTHE RESULT IS 10^24,which is too large to be displayed by ipython \"\n",
+ "#w=10**(p) \t\t#w is the relative no. of distinguishable quantum states\n",
+ "#Result\n",
+ "print\"This value of w is very large to calculate for python,because it's in the range of 10^24\"\n",
+ "print\"The relative no. of distinguishable quantum states in 1 mole of water and ice at 273K is 10^24\" \n",
+ "print\"\\nTHE RESULT IS 10^24,which is too large to be displayed by ipython \"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "THE RESULT IS 10^24,which is too large to be displayed by ipython \n",
+ "This value of w is very large to calculate for python,because it's in the range of 10^24\n",
+ "The relative no. of distinguishable quantum states in 1 mole of water and ice at 273K is 10^24\n",
+ "\n",
+ "THE RESULT IS 10^24,which is too large to be displayed by ipython \n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.13,Page no:86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.13\n",
+ "\n",
+ "#To find the total entropy change of solid\n",
+ "#Variable declaration\n",
+ "T=300 \t\t\t#temperature[K]\n",
+ "n=4 \t\t\t#no. of moles of an ideal gas\n",
+ "P1=2.02*10**5 \t\t#initial pressure[N/m2]\n",
+ "P2=4.04*10**5 \t\t#final pressure[N/m2]\n",
+ "R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
+ "import math\n",
+ "#calculation\n",
+ "G=n*R*T*2.303*math.log10(P2/P1) \t#[J]\n",
+ "#Result\n",
+ "print\" The change in Gibbs free energy is\",round(G,1),\"J\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The change in Gibbs free energy is 6916.6 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.14,Page no:86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.14\n",
+ "\n",
+ "#To find the work function or Helmholts free energy\n",
+ "##Variable declaration\n",
+ "n=1 \t\t\t#no. of moles\n",
+ "T=300 \t\t\t#temperature[K]\n",
+ "V1=2 \t\t\t#initial volume[m3]\n",
+ "V2=20 \t\t\t#final volume[m3]\n",
+ "R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
+ "import math\n",
+ "#calculation\n",
+ "\t\n",
+ "A=-n*R*T*2.303*math.log10(V2/V1) \t#Change in work function[J/mol]\n",
+ "#Result\n",
+ "print\"The change in Helmholts free energy is\",round(A),\"J/mol\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in Helmholts free energy is -5744.0 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.15,Page no:87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.15\n",
+ "#To find the energy change that can be extracted as heat and work \n",
+ "print\"C6H12O6(s) + 6O2(g) --> 6CO2(g) + 6H2O(l)\"\n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t\t#Temperature[k]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "S=182.45 \t\t\t#standard entropy change at 298K [J/K]\n",
+ "U=-2808 \t\t\t#change in internal energy at 298K[KJ/mol]\n",
+ "\t#reaction is taking place in bomb calorimeter so no volume change \n",
+ "\t#therefore U=Q at constant volume\n",
+ "#calculation\n",
+ "\t\n",
+ "A=U-T*S*0.001 \t\t\t#Energy extracted as heat[KJ/mol]\n",
+ "Wmax=A \t\t\t\t#work done [KJ/mol]\n",
+ "dn=6-6 \t\t\t\t#change in no. of moles\n",
+ "H=U+dn*R*T \t\t\t#Change in enthalpy of the bomb calorimeter[KJ]\n",
+ "#Result\n",
+ "print\"The energy change that can be extracted as heat is\",round(A),\"KJ/mol\"\n",
+ "print\"\\nThe energy change that can be extracted as work is\",round(-A),\"KJ/mol\"\n",
+ "print\"\\nThe change in enthalpy of bomb calorimeter is\",round(H),\"KJ/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C6H12O6(s) + 6O2(g) --> 6CO2(g) + 6H2O(l)\n",
+ "The energy change that can be extracted as heat is -2862.0 KJ/mol\n",
+ "\n",
+ "The energy change that can be extracted as work is 2862.0 KJ/mol\n",
+ "\n",
+ "The change in enthalpy of bomb calorimeter is -2808.0 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.16,Page no:87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.16\n",
+ "\n",
+ "#To find the helmholts free energy and Gibbs free energy\n",
+ "#Variable declaration\n",
+ "print\"C8H18(g)+12.5O2(g)-->8CO2(g)+9H2O(l)\" \n",
+ "\n",
+ "T=298.0 \t\t\t\t#temperature[K]\n",
+ "S=421.5 \t\t\t#change in entropy[J/K]\n",
+ "H=-5109000.0 \t\t\t#Heat of reaction[J]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "dn=8-(1+12.5) \t\t\t#change in no. of moles\n",
+ "#calculation\n",
+ "\n",
+ "U=H \t\t\t\t#[J]\n",
+ "A=U-T*S \t\t\t#Change in helmholts free energy[J]\n",
+ "G=A+dn*R*T \t\t\t#Change in Gibbs free energy[J]\n",
+ "#Result\n",
+ "print\"The change in Helmholts free energy is\",round(A),\"J\"\n",
+ "print\"\\nThe change in Gibbs free energy is\",round(G),\"J\"\n",
+ "print\"The calculation is not precise in book,that's why a slight change in answer\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C8H18(g)+12.5O2(g)-->8CO2(g)+9H2O(l)\n",
+ "The change in Helmholts free energy is -5234607.0 J\n",
+ "\n",
+ "The change in Gibbs free energy is -5248234.0 J\n",
+ "The calculation is not precise in book,that's why a slight change in answer\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.17,Page no:88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.17\n",
+ "#To find the Helmholts free energy and Gibbs free energy\n",
+ "print\"C3H6(g)+4.5O2(g)-->3CO2(g)+3H2O(l)\" \n",
+ "##Variable declaration\n",
+ "S=-339.23 \t\t\t#standard change in entropy [J/K]\n",
+ "T=298 \t\t\t\t#temperature[K]\n",
+ "Hf1=20.42 \t\t\t#enthalpy of formation of C3H6(g)[J]\n",
+ "Hf2=-393.51 \t\t\t#enthalpy of formation of CO2(g)[J]\n",
+ "Hf3=-285.83 \t\t\t#enthalpy of formation of H2O(l)[J]\n",
+ "dn=3-4.5-1 \t\t\t#change in no. of moles\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "#calculation\n",
+ "\n",
+ "H=3*Hf2+3*Hf3-Hf1 \t\t#Enthalpy of the reaction[J]\n",
+ "U=H-dn*R*0.001*T \t\t#Change in internal energy of the reaction[J]\n",
+ "A=U-T*S*0.001 \t\t\t#Helmholts free energy change[J]\n",
+ "G=A+dn*R*0.001*T \t\t#Gibbs free energy change[J]\n",
+ "#Result\n",
+ "print\"The change in Helmholts free energy is\",round(A,2),\"kJ\"\n",
+ "print\"\\nThe change in Gibbs free energy is\",round(G,2),\"kJ\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C3H6(g)+4.5O2(g)-->3CO2(g)+3H2O(l)\n",
+ "The change in Helmholts free energy is -1951.16 kJ\n",
+ "\n",
+ "The change in Gibbs free energy is -1957.35 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.19,Page no:92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.19\n",
+ "#To find the total entropy change\n",
+ "print\"CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\"\n",
+ "\n",
+ "#Variable declaration\n",
+ "S1=-242.98 \t\t\t\t#standard entropy change for the combustion reaction[J/K]\n",
+ "Hf1=-74.81 \t\t\t\t#Enthalpy of formation of CH4(g)[KJ/mol]\n",
+ "Hf2=-393.51 \t\t\t\t#Enthalpy of formation of CO2(g)[KJ/mol]\n",
+ "Hf3=-285.83 \t\t\t\t#Enthalpy of formation of H2O(l)[KJ/mol]\n",
+ "T=298 \t\t\t\t\t#temperature[K]\n",
+ "#calculation\n",
+ "\t \n",
+ "H=Hf2+2*Hf3-Hf1 \t\t\t#Change in enthalpy of reaction[KJ]\n",
+ "S2=-H*1000/T \t\t\t\t#Change in entropy of the surrounding[J/K]\n",
+ "Stotal=(S1+S2)*0.001 \t\t\t#Total entropy change \n",
+ "#Result\n",
+ "print\"The total change in entropy is\",round(Stotal,2),\"KJ/K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\n",
+ "The total change in entropy is 2.74 KJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.20,Page no:93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.20\n",
+ "#To find the spontanity of the reaction\n",
+ "print\"2H2(g)+O2(g)-->2H2O(l)\" \n",
+ "##Variable declaration\n",
+ "Hf1=-285.83 \t\t\t\t#standard enthalpy of formation of H2O(l)[KJ/mol]\n",
+ "S=-327 \t\t\t\t\t#Standard entropy change for the same reaction[J/K]\n",
+ "T=298 \t\t\t\t\t#temperature[K]\n",
+ "\n",
+ "#calculation\n",
+ "\t\n",
+ "H=2*Hf1-0-0 \t\t\t\t#Enthalpy of the reaction[KJ/mol]\n",
+ "G=H-T*S*0.001 \t\t\t\t#Change in Gibbs free energy[KJ]\n",
+ "#Result\n",
+ "print\"The change in Gibbs free energy is\",round(G,2),\"KJ\\n \"\n",
+ "print\"As change in Gibbs free energy is negative.Therefore,the reaction is spontaneous\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2H2(g)+O2(g)-->2H2O(l)\n",
+ "The change in Gibbs free energy is -474.21 KJ\n",
+ " \n",
+ "As change in Gibbs free energy is negative.Therefore,the reaction is spontaneous\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.21,Page no:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.21\n",
+ "\n",
+ "\n",
+ "#To find the standard enthalpy of reaction \n",
+ "print\"CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\" \n",
+ "#Variable declaration\n",
+ "S=-242.98 \t\t\t#standard entropy change for reaction [J/K]\n",
+ "T=298 \t\t\t\t#temperature[K]\n",
+ "Gf1=-50.72 \t\t\t#standard Gibbs free energy of formation for CH4(g)[KJ/mol]\n",
+ "Gf2=-394.36 \t\t\t#standard Gibbs free energy of formation for CO2(g)[KJ/mol]\n",
+ "Gf3=-237.13 \t\t\t#standard Gibbs free energy of formation for H2O(l)[KJ/mol]\n",
+ "#calculation\n",
+ "\n",
+ "G=Gf2+2*Gf3-Gf1 \t\t#Standard Gibbs free energy for reaction[KJ/mol]\n",
+ "H=G+T*S*0.001 \t\t\t#Standard enthalpy of reaction [KJ]\n",
+ "#Result\n",
+ "print\"The standard enthalpy of reaction is\",round(H,2),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\n",
+ "The standard enthalpy of reaction is -890.31 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.22,Page no:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.22\n",
+ "#To find the maximum energy that can be extracted as non-expansion work is equal to the change in free energy of the system\n",
+ "print\"C6H12O6(s)+6O2(g)-->6CO2(g)+6H2O(l)\"\n",
+ "#Variable declaration\n",
+ "mass=25.0 \t\t\t#mass of glucose for combustion under standard condition[gm]\n",
+ "T=298 \t\t\t\t#temperature[K]\n",
+ "Gf1=-910 \t\t\t#Standard Gibbs free energy of formation for C6H12O6[KJ/mol]\n",
+ "Gf2=-394.4 \t\t\t#Standard Gibbs free energy of formation for CO2(g)[KJ/mol]\n",
+ "Gf3=-237.13 \t\t\t#Standard Gibbs free energy of formation for H2O(l)[KJ/mol]\n",
+ "mol_wt=180.0 \t\t\t#molecular weight of glucose[gm/mol]\n",
+ "#calculation\n",
+ "\t\n",
+ "G=6*Gf2+6*Gf3-Gf1\n",
+ "n=mass/mol_wt \t\t\t#no. of moles\n",
+ "Gactual=G*n \t\t\t#Gibbs free energy for the combustion of 0.139mol of glucose \n",
+ "#Result\n",
+ "print\"The energy that can be extracted as non-expansion work is\",round(-Gactual),\"KJ\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C6H12O6(s)+6O2(g)-->6CO2(g)+6H2O(l)\n",
+ "The energy that can be extracted as non-expansion work is 400.0 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.23,Page no:97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.23\n",
+ "#To find the value of the inversion temperature for the gas\n",
+ "#Variable declaration\n",
+ "a=1.39*10**-2 \t\t#constant for a vanderwaal's gas[lit2.atm/mol2]\n",
+ "b=3.92*10**-2 \t\t#constant for a vanderwaal's gas[lit2.atm/mol2]\n",
+ "R=0.082 \t\t#Universal gas constant[lit.atm/deg/mol]\n",
+ "#calculation\n",
+ "\t\n",
+ "Ti=(2*a)/(R*b) \t\t#inversion temperature [K]\n",
+ "#Result\n",
+ "print\"The inversion temperature for the gas is\",round(Ti,3),\" K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The inversion temperature for the gas is 8.649 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.26,Page no:100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.26\n",
+ "#To find the Enthalpy of vaporization of ethylene\n",
+ "#Variable declaration\n",
+ "T=169.25 \t\t\t#Boiling point[K]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "print\"dlnP/dT=He/R*T**2\" \n",
+ "print\"dlnP/dT=(2.303*834.13/T**2)+(1.75/T)-(2.30*8.375*10**-3)\" \n",
+ "print\"Therefore using these two equations we calculate the He(enthalpy) of ethylene\" \n",
+ "#calculation\n",
+ "\n",
+ "x=(2.303*834.13/T**2)+(1.75/T)-(2.30*8.375*10**-3) #it is dlnP/dT\n",
+ "He=R*0.001*T**2*x #Enthalpy of vaporization[J/mol]\n",
+ "#Result\n",
+ "print\"\\n\\nThe Enthalpy of vaporization of ethylene at its boiling point is\",round(He,3),\"KJ/mol\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dlnP/dT=He/R*T**2\n",
+ "dlnP/dT=(2.303*834.13/T**2)+(1.75/T)-(2.30*8.375*10**-3)\n",
+ "Therefore using these two equations we calculate the He(enthalpy) of ethylene\n",
+ "\n",
+ "\n",
+ "The Enthalpy of vaporization of ethylene at its boiling point is 13.846 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.27,Page no:101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.27\n",
+ "#To find the boiling point of b/enzene at 60KPa\n",
+ "\n",
+ "#Variable declaration\n",
+ "P1=101.3 \t\t\t#Initial Pressure[KPa]\n",
+ "P2=60 \t\t\t\t#Final Pressure[KPa]\n",
+ "He=31.8 \t\t\t#Enthalpy of vaporization[KJ/mol]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "T1=353.2 \t\t\t#boiling point of benzene at 101.3KPa[K]\n",
+ "import math\n",
+ "#calculation\n",
+ "\n",
+ "x=(T1**-1)-(R*0.001*math.log(P2/P1)/He) \n",
+ "T2=x**-1 \t\t\t#Boiling point of benzene at 60KPa\n",
+ "#Result\n",
+ "print\"The boiling point of benzene at 60KPa is\",round(T2,1),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The boiling point of benzene at 60KPa is 336.9 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.28,Page no:101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.28\n",
+ "\n",
+ "#To find the molar enthalpy of vapourization\n",
+ "##Variable declaration\n",
+ "P1=0.016 \t\t\t#Vapour pressure of pure ethanol at 273K[bar]\n",
+ "P2=0.470 \t\t\t#Vapour pressure of pure ethanol at 333K[bar]\n",
+ "T1=273 \t\t\t\t#initial temperature [K]\n",
+ "T2=333 \t\t\t\t#final temperature[K]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "P=1.01 \t\t\t\t#vapour pressure at normal boiling point[bar]\n",
+ "#calculation\n",
+ "import math\n",
+ "\t\n",
+ "x=(T2**-1)-(T1**-1) \n",
+ "He=-R*0.001*math.log(P2/P1)/x \t#molar enthalpy of vaporization[J/mol]\n",
+ "t=(T2**-1)-(R*0.001*math.log(P/P2)/He) \n",
+ "T=(t**-1)-273 \t\t\t#normal boiling point [C]\n",
+ "#Result\n",
+ "print\"\\n\\nThe normal boiling point for pure ethanol is \",round(T,1),\"C\"\n",
+ "print\"The molar enthalpy of vapourization is\",round(He,2),\"J/mol\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "The normal boiling point for pure ethanol is 77.4 C\n",
+ "The molar enthalpy of vapourization is 42.58 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.29,Page no:102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.29\n",
+ "\n",
+ "#To find the vapour pressure of benzene at 298K\n",
+ "#Variable declaration\n",
+ "T2=353.2 \t\t\t#normal boiling point of benzene at 1.01325bar[K]\n",
+ "T1=298\t \t\t\t#temperature [K]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "P2=1.01325 \t\t\t#Vapour pressure of benzene[bar]\n",
+ "import math\n",
+ "\t#benzene obey's Trouton's rule\n",
+ "print\" from Troutons rule , \" \n",
+ "print\" He/Tb=85J/K/mol\" \n",
+ "#calculation\n",
+ "\n",
+ "He=85*T2 \t\t\t#molar enthalpy of vapourization[J/K/mol]\n",
+ "x=(T2**-1)-(T1**-1) \n",
+ "t=-He*x/R \n",
+ "P1=P2/math.exp(t) \n",
+ "#Result\n",
+ "print\"\\nThe vapour pressure of benzene at 298K is\",round(P1,3),\" bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " from Troutons rule , \n",
+ " He/Tb=85J/K/mol\n",
+ "\n",
+ "The vapour pressure of benzene at 298K is 0.152 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.30,Page no:111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.30\n",
+ "#To find the degrees of freedom \n",
+ "#Variable declaration\n",
+ "c=1 \t\t\t#no. of components(only CO2)\n",
+ "p=2 \t\t\t#no. of phases(liquid + gas)\n",
+ "#calculation\n",
+ "\n",
+ "F=c-p+2 \t\t#degree of freedom\n",
+ "#Result\n",
+ "print\"Degrees of freedom is\",F \n",
+ "print\"Degrees of freedom 1 means that either pressure or temperature can be varied independently,i.e.when temperature is fixed,pressure is automatically fixed\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Degrees of freedom is 1\n",
+ "Degrees of freedom 1 means that either pressure or temperature can be varied independently,i.e.when temperature is fixed,pressure is automatically fixed\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.31,Page no:111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.31\n",
+ "\n",
+ "#To find the values of degrees of freedom\n",
+ "#Variable declaration\n",
+ "c=1 \t\t\t#no. of components\n",
+ "p=1 \t\t\t#no. of phases\n",
+ "#calculation\n",
+ "\n",
+ "F=c-p+2 \t\t#Degrees of freedom\n",
+ "#Result\n",
+ "print\"Degrees of freedom,F is\",F \n",
+ "print\"Degrees of freedom 2 means both the pressure and temperature can be varied independently\" \n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Degrees of freedom,F is 2\n",
+ "Degrees of freedom 2 means both the pressure and temperature can be varied independently\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.32,Page no:113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.32\n",
+ "\n",
+ "#To find the mole fraction of sucrose,so that the vapour pressure of water will be lowered by dP\n",
+ "#Variable declaration\n",
+ "P=1.75*10**-5 \t\t\t#Vapour pressure of pure water at 293K[torr]\n",
+ "dP=1.1*10**-7 \t\t\t#Lowering in vapour pressure of water\n",
+ "#calculation\n",
+ "\n",
+ "x=dP/P \t\t\t\t#mole fraction of sucrose\n",
+ "#Result\n",
+ "print\"The mole fraction of sucrose is\",round(x,6) \n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mole fraction of sucrose is 0.006286\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.33,Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.33\n",
+ "\n",
+ "#To find the partial vapour pressure of benzene over the solution\n",
+ "#Variable declaration\n",
+ "P=94.6 \t\t\t\t#The vapour pressure of pure benzene at 298K[torr]\n",
+ "n1=20.0 \t\t\t\t#no. of moles of pure benzene\n",
+ "n2=5.0 \t\t\t\t#no. of moles of pure naphthalene\n",
+ "#calculation\n",
+ "\n",
+ "x=n1/(n1+n2) \t\t\t#(mole fraction of benzene)\n",
+ "p=x*P \t\t\t\t#the partial vapour pressure of benzene[torr]\n",
+ "#Result\n",
+ "print\"The partial vapour pressure of benzene is\",p,\"torr\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The partial vapour pressure of benzene is 75.68 torr\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.34,Page no:114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.34\n",
+ "#To find the reduction in chemical potential\n",
+ "#Variable declaration\n",
+ "x=0.28 \t\t\t\t#mole fraction of solute\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "T=298 \t\t\t\t#temperature[K]\n",
+ "import math\n",
+ "#calculation\n",
+ "\n",
+ "du=R*T*math.log(1-x) \t\t#reduction in chemical potential[J/mol]\n",
+ "#Result\n",
+ "print\"The reduction in chemical potential is\",round(-du,1),\"J/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reduction in chemical potential is 813.9 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.35,Page no:116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.35\n",
+ "#To find the boiling point of the solution which is made by dissolving 155g of glucose in 1000g of water\n",
+ "#Variable declaration\n",
+ "Kb=0.51 \t\t\t#ebullioscopic constant of water [K*Kg/mol]\n",
+ "n=155.0/180.0 \t\t\t#no. of moles of glucose\n",
+ "m=n/1 \t\t\t\t#[mol/Kg]\n",
+ "Ti=373.0 \t\t\t\t#Boiling point temperature of water[K]\n",
+ "#calculation\n",
+ "\n",
+ "Tf=(Ti+Kb*m)-273 \t\t#boiling point temperature of the solution[C]\n",
+ "#Result\n",
+ "print\"The boiling point of the solution is\",round(Tf,2),\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The boiling point of the solution is 100.44 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.36,Page no:117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.36\n",
+ "\n",
+ "#To find the molar mass of solute(M2)\n",
+ "#Variable declaration\n",
+ "Ti=5.44 #freezing point of pure benzene[K]\n",
+ "Tf=4.63 #freezing point of solution[K]\n",
+ "m1=2.12 #mass of the solute[gm]\n",
+ "m2=125.0 #mass of the benzene[gm]\n",
+ "Kf=5.12 #cryoscopic constant of pure benzene[K*Kg/mol]\n",
+ "#calculation\n",
+ "\n",
+ "dTf=Ti-Tf \t#depression in freezing point[K]\n",
+ "M2=(m1*1000*Kf)/(m2*dTf) #molar mass of solute\n",
+ "#Result\n",
+ "print\"The molar mass of solute is\",round(M2),\"(approx)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar mass of solute is 107.0 (approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.38,Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.38\n",
+ "#To find the Kp value of the above reaction\n",
+ "print\"N2(g)+3H2(g)<=>2NH3(g)\"\n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t#Temperature[K]\n",
+ "Gf1=-16450 \t\t#Gibb's free energy of formation for NH3(g)[J/mol]\n",
+ "R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
+ "import math\t\n",
+ "#calculation\n",
+ "\t\n",
+ "Gf=2*Gf1\t\t\t#Gibb's free energy for the reaction[KJ]\n",
+ "x=Gf/R/T\n",
+ "Kp=math.exp(-x) \n",
+ "#Result\n",
+ "print\"The Kp for above reaction is\",round(Kp),\"or 5.85*10^5,in scientific notation(APPROX)\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N2(g)+3H2(g)<=>2NH3(g)\n",
+ "The Kp for above reaction is 584861.0 or 5.85*10^5,in scientific notation(APPROX)\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.39,Page no:124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.39\n",
+ "#To find the reaction Gibb's energy\n",
+ "print\"0.5N2(g)+1.5H2(g)<=>NH3(g)\" \n",
+ "#Variable declaration\n",
+ "T=298 #Temperature[K]\n",
+ "Kp=900 #Equilibrium constant for above reaction\n",
+ "P1=0.32 #partial pressure of N2(g)[bar]\n",
+ "P2=0.73 #partial pressure of H2(g)[bar]\n",
+ "P3=0.98 #partial pressure of NH3(g)[bar]\n",
+ "R=8.314 #Universal gas constant[J/K/mol]\n",
+ "import math\n",
+ "#calculation\n",
+ "\n",
+ "G=-R*T*math.log(Kp) \n",
+ "x=(P1**0.5)*(P2**1.5) \n",
+ "p=P3/x \n",
+ "Gr=(G+R*T*math.log(p))*0.001 \n",
+ "#Result\n",
+ "print\"The reaction Gibbs free energy is\",round(Gr*1000),\"J/mol \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.5N2(g)+1.5H2(g)<=>NH3(g)\n",
+ "The reaction Gibbs free energy is -14322.0 J/mol \n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.40,Page no:125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.40\n",
+ "#To find the Kp at 423K temperature\n",
+ "print\"N2(g)+3H2(g)<=>2NH3(g)\"\n",
+ "\n",
+ "#Variable declaration\n",
+ "Kp1=5.85*10**5 #equilibrium constant at 298K\n",
+ "H1=-46.11 #standard enthalpy of formation of NH3(g)[KJ/mol]\n",
+ "T1=298 #Initial temperature[K]\n",
+ "T2=423 #Final temperature[K]\n",
+ "R=8.314 #Universal gas constant[J/K/mol]\n",
+ "#calculation\n",
+ "import math\n",
+ "\n",
+ "H=2*H1 #enthalpy for reaction [KJ]\n",
+ "t=(T1**-1)-(T2**-1) \n",
+ "x=-H*t/(R*0.001) \n",
+ "Kp2=Kp1*math.exp(x) \n",
+ "#Result\n",
+ "print\"The Equilibrium constant for reaction at 423K is\",round(Kp2) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N2(g)+3H2(g)<=>2NH3(g)\n",
+ "The Equilibrium constant for reaction at 423K is 35004905509.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.41,Page no:128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.41\n",
+ "#To find the Standard Free energy and equilibrium constant \n",
+ "print\"Zn(s)|ZnCl2(aq)||CdSO4(aq)|Cd(s)\"\n",
+ "#For Zn(s)|ZnCl2(aq)||CdSO4(aq)|Cd(s)\n",
+ "#Variable declaration\n",
+ "T=298.0 \t\t\t#Temperature[K]\n",
+ "R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
+ "E1=-0.7618 \t\t#Standard electrode potential for Zn2+/Zn [volts]\n",
+ "E2=-0.403 \t\t#Standard electrode potential for Cd2+/Cd [volts]\n",
+ "F=96500.0 \t\t#Faraday's constant[coulomb/mol]\n",
+ "n=2.0 \t\t\t#no. of electrons balancing\n",
+ "\n",
+ "Ei=E2-E1 \t\t#Standard potential for the reaction[volts]\n",
+ "#calculation\n",
+ "import math\n",
+ "Gi=-n*F*Ei \t\t#Standard Gibb's Free Energy [KJ/mol] \n",
+ "Ki=math.exp(-Gi/R/T) \t#Equilibrium constant\n",
+ "#Result\n",
+ "print\"The Free energy for the rection is\",Gi*0.001,\"KJ/mol\"\n",
+ "print\"The value of equilibrium constant is\",Ki \n",
+ "\n",
+ "#To find the standard free energy and equilibrium constant\n",
+ "#Variable declaration\n",
+ "print\"Cd(s)|CdSO4(aq),Hg2SO4(s)|Hg(l)\" \n",
+ "#For Cd(s)|CdSO4(aq),Hg2SO4(s)|Hg(l)\n",
+ "E3=0.6141 \t\t#Standard electrode potential for Hg2SO4(s),SO4^2-/Hg(l) [volts]\n",
+ "#calculation\n",
+ "\n",
+ "Eii=E3-E2 \t\t#Standard potantial for the reaction[volts]\n",
+ "Gii=-n*F*Eii \t\t#Standard Gibb's free energy[KJ/mol]\n",
+ "Kii=math.exp(-Gii/R/T) \t#Equilibrium constant\n",
+ "#Result\n",
+ "print\"The Free energy for the rection is\",round(Gii*0.001,1),\"KJ/mol\"\n",
+ "print\"The value of equilibrium constant is\",Kii\n",
+ "print\"PLEASE REDO the last line calculation,It is showing wrong result in my PC\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zn(s)|ZnCl2(aq)||CdSO4(aq)|Cd(s)\n",
+ "The Free energy for the rection is -69.2484 KJ/mol\n",
+ "The value of equilibrium constant is 1.37586809667e+12\n",
+ "Cd(s)|CdSO4(aq),Hg2SO4(s)|Hg(l)\n",
+ "The Free energy for the rection is -196.3 KJ/mol\n",
+ "The value of equilibrium constant is 2.56773255559e+34\n",
+ "PLEASE REDO the last line calculation,It is showing wrong result in my PC\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.42,Page no:130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.42\n",
+ "#To find the overall e.m.f of the above cell\n",
+ "#Variable declaration\n",
+ "print\"Zn(s)|ZnCl2(soln)||AgCl(s)|Ag-Ag|AgCl(s)|ZnCl2(soln)|Zn(s)\" \n",
+ "\n",
+ "m1=0.02 \t\t\t#concentration[M]\n",
+ "Y1=0.65 \t\t\t#mean ionic activity coefficient\n",
+ "m2=1.5 \t\t\t\t#concentration[M]\n",
+ "Y2=0.29 \t\t\t#mean ionic activity coefficient \n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "T=298 \t\t\t\t#Temperature [K]\n",
+ "F=96500 \t\t\t#Faraday's constant[coulomb/mol]\n",
+ "import math\n",
+ "#calculation\n",
+ "\t\n",
+ "E=R*T*(math.log(m2*Y2/m1/Y1))*3/2/F \t#[volts]\n",
+ "#Result\n",
+ "print\"The overall e.m.f of the cell is\",round(E,4),\"volt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zn(s)|ZnCl2(soln)||AgCl(s)|Ag-Ag|AgCl(s)|ZnCl2(soln)|Zn(s)\n",
+ "The overall e.m.f of the cell is 0.1352 volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.43,Page no:131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.43\n",
+ "#To find the e.m.f of the cell\n",
+ "#Variable declaration\n",
+ "print\"H2(g,1atm)|HCl(aq)|HCl(aq)|H2(g,1atm)\" \n",
+ "m1=0.02 \t\t\t#concentration[M]\n",
+ "Y1=0.88 \t\t\t#mean ionic activity coefficient\n",
+ "m2=1 \t\t\t\t#concentration[M]\n",
+ "Y2=0.81 \t\t\t#mean ionic activity coefficient\n",
+ "R=8.314 \t\t\t#universal gas constant[J/K/mol]\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "F=96487 \t\t\t#Faraday's constant[coulombs/mol]\n",
+ "t=0.178 \t\t\t#Tranference number of Cl-1\n",
+ "import math\n",
+ "#calculation\n",
+ "\n",
+ "E=-2*t*R*T*(math.log(m1*Y1/m2/Y2))/F \t#e.m.f of the cell[volts]\n",
+ "#Result\n",
+ "print\"The e.m.f of the cell is\",round(E,3),\" volts\" \n",
+ "print\"\\nWrongly calculated in book as 0.351 volt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H2(g,1atm)|HCl(aq)|HCl(aq)|H2(g,1atm)\n",
+ "The e.m.f of the cell is 0.035 volts\n",
+ "\n",
+ "Wrongly calculated in book as 0.351 volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.44,Page no:133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.44\n",
+ "\n",
+ "#To find the values of dG,dS and dH\n",
+ "print\"The values for reaction that goes on within the cadmium cell\" \n",
+ "#Variable declaration\n",
+ "n=2 \t\t\t#no. of moles\n",
+ "E=1.01463 \t\t#standard cadmium cell potential[volts]\n",
+ "d=-5*10**-5 \t\t#i.e d=dE/dT[V/K]\n",
+ "F=96500 \t\t#[coulomb/mol]\n",
+ "T=298 \t\t\t#Temperature [K]\n",
+ "#calculation\n",
+ "\n",
+ "dG=-n*E*F \t\t#Change in Gibb's free energy[J]\n",
+ "dS=n*F*d \t\t#Change in entropy [J/K]\n",
+ "dH=dG+T*dS \t\t#change in enthalpy[J]\n",
+ "#Result\n",
+ "print\" dG=\",dG,\"J\\nWrongly calculated in book as -195815 J\"\n",
+ "print\"\\n dS=\",dS,\"J/K\"\n",
+ "print\"\\n dH=\",dH,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The values for reaction that goes on within the cadmium cell\n",
+ " dG= -195823.59 J\n",
+ "Wrongly calculated in book as -195815 J\n",
+ "\n",
+ " dS= -9.65 J/K\n",
+ "\n",
+ " dH= -198699.29 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/CH6.ipynb b/Thermodynamics:_A_Core_Course/CH6.ipynb
new file mode 100644
index 00000000..b2d73f0e
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/CH6.ipynb
@@ -0,0 +1,702 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6:The Question of Ideality"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2,Page no:144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find molar volume of CO2\n",
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "#Variable declaration:\n",
+ "#For CO2:\n",
+ "a=3.61 #atm L**2 mol**-2\n",
+ "b=4.29*10**-2 #L mol**-1\n",
+ "R=0.082 #L atm K**-1 mol**-1\n",
+ "T=500 #K\n",
+ "P=100 #atm\n",
+ "\n",
+ "#CALCULATION\n",
+ "\n",
+ "#(P+a/Vm^2)(Vm-b)=RT\n",
+ "#or Vm^2(P+a/Vm^2)(Vm-b)=RTVm^2\n",
+ "#or P*Vm**3+a*Vm-Pb*Vm**2-a*b=Rt*Vm**2\n",
+ "#or Vm^^3-(b+RT/P)Vm**2+a/P*Vm-(a*b)/P=0\n",
+ "#Let\n",
+ "C1=b+(R*T/P) #L mol**-1 [aSsume]\n",
+ "C2=a/P #L^2 mol^-2 [assume]\n",
+ "C3=C2*b #L^3mol**-3\n",
+ "def f(x):\n",
+ " return(x**3-C1*x**2+C2*x-C3)\n",
+ "x=fsolve(f,0.3)\n",
+ "\n",
+ "#RESULT\n",
+ "\n",
+ "print \"x=\",round(x,3)\n",
+ "Vm=round(x,3)\n",
+ "print\"Therefore,the value of molar volume,Vm=\",Vm,\"L mol^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x= 0.366\n",
+ "Therefore,the value of molar volume,Vm= 0.366 L mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5,Page no:149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.5\n",
+ "#To find the fugacity and fugacity coefficient\n",
+ "#Variable declaration\n",
+ "b=0.0391 \t\t\t#Van der waals constant[dm3/mol]\n",
+ "R=0.082 \t\t\t#Universal gas constant[dm3*atm/mol]\n",
+ "P2=1000 \t\t\t#pressure [atm]\n",
+ "P1=0 \t\t\t\t#pressure [atm]\n",
+ "T=1273\t\t \t\t#Temperature [K]\n",
+ "import math\n",
+ "#Calculation\n",
+ "\n",
+ "x=b*(P2-P1) \n",
+ "y=R*T \n",
+ "fc=math.exp(x/y) \t\t#fugacity coefficient\n",
+ "\n",
+ "f=P2*fc #fugacity[atm]\n",
+ "#Result\n",
+ "print\"The fugacity coefficient is\",round(fc,3) \n",
+ "print\"The fugacity is\",round(f),\"atm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fugacity coefficient is 1.454\n",
+ "The fugacity is 1454.0 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.10,Page no:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.10\n",
+ "#To find the partial pressure of CO2 gas \n",
+ "#Variable declaration\n",
+ "m1=0.03 #mass of CO2(g)[gm]\n",
+ "w1=44.01 #molecular weight of CO2(g)[gm/mol]\n",
+ "m2=250 #mass of water[gm]\n",
+ "w2=18.02 #molecular weight of water[gm/mol]\n",
+ "k=1.25*10**6 #Henry's law constant[Torr]\n",
+ "T=298 #Temperature[K]\n",
+ "#Calculation\n",
+ "\n",
+ "n1=m1/w1 #no. of moles of CO2\n",
+ "n2=m2/w2 #no. of moles of water\n",
+ "x1=n1/(n1+n2) #mole fraction of CO2\n",
+ "Pco2=k*x1 #Partial pressure of CO2[Torr]\n",
+ "#Result\n",
+ "print\"The partial pressure of CO2 gas is\",round(Pco2,2),\"Torr\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The partial pressure of CO2 gas is 61.41 Torr\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.11,Page no:161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.11\n",
+ "\n",
+ "#To find the Volume of the solution\n",
+ "#Variable declaration\n",
+ "W=1000 \t\t\t#Total mass of a solution[gm]\n",
+ "x1=0.5 \t\t\t#mole fraction of Chloroform\n",
+ "x2=0.5 \t\t\t#mole fraction of Acetone\n",
+ "V1m=80.235 \t\t#Partial molar volume of chloroform[cm3/mol]\n",
+ "V2m=74.166 \t\t#Partial molar volume of Acetone[cm3/mol]\n",
+ "M1=119.59 \t\t#molecular weight of chloroform[gm/mol]\n",
+ "M2=58 \t\t\t#molecular weight of Acetone[gm/mol]\n",
+ "#Calculation\n",
+ "\n",
+ "nT=W/(x1*M1+x2*M2) \t#Total no. of moles\n",
+ "V=nT*(x1*V1m+x2*V2m) \t#Total volume[cm3]\n",
+ "#Result\n",
+ "print\"The volume of the solution is\",round(V,1),\"cm^3 (approx)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volume of the solution is 869.4 cm^3 (approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.12,Page no:163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.12\n",
+ "#to find the excess volume \n",
+ "#Variable declaration\n",
+ "x1=0.5 #mole fraction of chloroform\n",
+ "x2=0.5 #mole fraction of p-xylene\n",
+ "T=298 #Temperature[K]\n",
+ "#Calculation\n",
+ "\n",
+ "Ve=x1*x2*(0.585+0.085*(x1-x2)-0.165*(x1-x2)**2) #Excess volume measured by using a dilatometer\n",
+ "#Result\n",
+ "print\"Ve/(cm3.mol**-1) = \",round(Ve,3) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ve/(cm3.mol**-1) = 0.146\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.14,Page no:169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.14\n",
+ "\n",
+ "#To find the activity , molality of the electrolytes\n",
+ "#Variable declaration\n",
+ "m1=0.01 \t\t#molality[m]\n",
+ "v11=1.0 \n",
+ "v12=2.0 \n",
+ "Y1=0.71 \n",
+ "m2=0.005 \t\t#molality[m]\n",
+ "v21=1.0 \n",
+ "v22=1.0 \n",
+ "Y2=0.53 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "v1=(v11)+(v12) \n",
+ "v2=(v21)+(v22) \n",
+ "a1=(m1**v1)*(v11**v11)*(v12**v12)*(Y1**v1) \n",
+ "a2=(m2**v2)*(v21**v21)*(v22**v22)*(Y2**v2) \n",
+ "x=1.0/v1 \n",
+ "a1m=a1**x \n",
+ "m1m=m1*(v11**v11*v12**v12)**x #molality[m]\n",
+ "y=1.0/v2 \n",
+ "m2m=m2*(v21*v21*v22**v22)**y #molality[m]\n",
+ "a2m=a2**y \n",
+ "#Result\n",
+ "print\"The activity of the electrolyte ZnCl2 is\",round(a1,8)\n",
+ "print\"The activity of the electrolyte CuSO4 is\",round(a2,8)\n",
+ "#print\"The mean activity of ZnCl2 is\",a1m\n",
+ "print\"The mean molality of ZnCl2 in [m]\",round(m1m,4)\n",
+ "#print\"The mean activity of CuSO4 is\",a2m \n",
+ "print\"The mean molality of CuSO4 in [m]\",m2m \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The activity of the electrolyte ZnCl2 is 1.43e-06\n",
+ "The activity of the electrolyte CuSO4 is 7.02e-06\n",
+ "The mean molality of ZnCl2 in [m] 0.0159\n",
+ "The mean molality of CuSO4 in [m] 0.005\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.15,Page no:172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.15\n",
+ "\n",
+ "#To find the molecular weight of sucrose\n",
+ "#Variable declaration\n",
+ "m2=3 \t\t\t#mass of the sucrose[gm]\n",
+ "m1=0.1 \t\t\t#mass of water [Kg]\n",
+ "Kf=1.86 \t\t#cryoscopic constant of water[K*Kg/mol]\n",
+ "dTf=0.16 \t\t#Lowering in freezing point[K]\n",
+ "#Calculation\n",
+ "\t\n",
+ "a=m1*dTf \n",
+ "b=Kf*m2 \n",
+ "M2=b/a \t\t\t#molecular weight\n",
+ "#Result\n",
+ "print\"M2=molecular weight , then M2=\",M2 "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M2=molecular weight , then M2= 348.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.16,Page no:173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 5.16\n",
+ "\n",
+ "#To find the molecular formula of sulphur\n",
+ "#Variable declaration\n",
+ "dTf=0.088 \t\t\t#Lowering in freezing point[K]\n",
+ "m2=0.45 \t\t\t#mass of sulphur[gm]\n",
+ "m1=0.09955 \t\t\t#mass of benzene[gm]\n",
+ "Kf=5.07 \t\t\t#cryoscopic constant for benzene[K*Kg/mol]\n",
+ "#Calculation\n",
+ "\n",
+ "a=m1*dTf \n",
+ "b=Kf*m2 \n",
+ "M2=b/a \t\t\t\t#molecular weight of sulphur\n",
+ "#Result\n",
+ "print\"The molecular weight of sulphur is\",round(M2,1) \n",
+ "x=M2/32 \t\t\t#no. of sulphur atoms\n",
+ "print\"\\n The molecular formula of sulphur is S\",round(x) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molecular weight of sulphur is 260.4\n",
+ "\n",
+ " The molecular formula of sulphur is S 8.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.17,Page no:174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.17\n",
+ "#To find the molar mass of macromolecule\n",
+ "#Variable declaration\n",
+ "m2=1.35 \t\t\t#mass of a macromolecule[gm]\n",
+ "V=100\t \t\t\t#volume of solution[cm^3]\n",
+ "R=82 \t\t\t\t#Universal gas constant[atm.cm^3.K^-1]\n",
+ "T=300 \t\t\t\t#Temperature[K]\n",
+ "II=9.9 \t\t\t\t#osmotic pressure of the solution[cm]\n",
+ "d=1 \t\t\t\t#density\n",
+ "p=1013250 \t\t\t#Atmospheric pressure\n",
+ "g=980.67 \t\t\t#gravitational field\n",
+ "#Calculation\n",
+ "\n",
+ "\n",
+ "a=m2*R*T*p \n",
+ "b=V*9.9*d*g \n",
+ "M2=a/b #molar mass of macromolecule\n",
+ "#Result\n",
+ "print\" M2 = molar mass of macromolecule , therefore M2 = \",round(M2),\"g.mol^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " M2 = molar mass of macromolecule , therefore M2 = 34660.0 g.mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.18,Page no:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.18\n",
+ "\n",
+ "#To find the osmotic pressure of a solution\n",
+ "#Variable declaration\n",
+ "R=82 \t\t\t#Universal gas constant[atm.ml.K^-1.mol^-1]\n",
+ "T=298 \t\t\t#Temperature[K]\n",
+ "V=250 \t\t\t#volume of water[ml]\n",
+ "m2=2.6 \t\t\t#mass of the protein\n",
+ "M2=85000 \t\t#molar mass of protein[g.mol^-1]\n",
+ "\n",
+ "#Calculation\n",
+ "\t\n",
+ "n2=m2/M2 \t\t\t#no. of moles of protein\n",
+ "II=(n2*R*T)/V \t\t\t#Osmotic pressure of a solution[atm]\n",
+ "#Result\n",
+ "print\"The osmotic pressure is\",round(II,5),\"atm \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The osmotic pressure is 0.00299 atm \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.19,Page no:175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.19\n",
+ "#To find the Ebullioscopic constant of water\n",
+ "#Variable declaration\n",
+ "R=8.314 \t\t\t#Universal gas constant[J.K**-1.mol**-1]\n",
+ "Tb=373.15 \t\t\t#Boiling point temperature[K]\n",
+ "M1=0.018 \t\t\t# mass of water[kg]\n",
+ "Hvap=40.7 \t\t\t#Enthalpy of vaporization[KJ.mol**-1]\n",
+ "#Calculation\n",
+ "\n",
+ "a=R*0.001*Tb**2*M1 \n",
+ "b=Hvap \n",
+ "Kb=a/b \t\t\t\t#Ebullioscopic constant of water[K.Kg.mol**-1]\n",
+ "#Result\n",
+ "print\"The Ebullioscopic constant of water is\",round(Kb,2),\"K.Kg.mol-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Ebullioscopic constant of water is 0.51 K.Kg.mol-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.20,Page no:176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.20\n",
+ "#To find the value of activity coefficient\n",
+ "print\"CaF2(s)<=>CaF2(aq)<=>Ca+2(aq) + 2F-(aq)\"\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ksp=4.0*(10**-11) \t#Solubility product of sparingly soluble salt CaF2\n",
+ "#Calculation\n",
+ "\n",
+ "x=Ksp/4.0 \n",
+ "Cs=x**(1.0/3.0) \t\t#Solubility \n",
+ "y=Cs**2 \n",
+ "Y=(x/y)**(1.0/3.0) \t\t#activity coefficient\n",
+ "#Result\n",
+ "print\"The activity coefficient is\",Y \n",
+ "print\"NOTE:please note that the value of Cs is wrongly calculated as 4.64*10^-11 in book\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CaF2(s)<=>CaF2(aq)<=>Ca+2(aq) + 2F-(aq)\n",
+ "The activity coefficient is 0.0599484250319\n",
+ "NOTE:please note that the value of Cs is wrongly calculated as 4.64*10^-11 in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.21,Page no:177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.21\n",
+ "\n",
+ "#To find the mean activity coefficient of ZnCl2 solution\n",
+ "#Variable declaration\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "F=96500 \t\t\t#Faraday's constant\n",
+ "Eo=0.98 \t\t\t#Standard e.m.f of the cell[Volts]\n",
+ "E=1.16 \t\t\t\t#e.m.f of the cell[Volts]\n",
+ "m=0.01 \n",
+ "import math\n",
+ "#Calculation\n",
+ "\n",
+ "a=R*T \n",
+ "b=2*F \n",
+ "x=a/b \n",
+ "Y=math.exp((Eo-E-(x*math.log(4*m*m*m)))/(3*x)) #mean activity coefficient\n",
+ "#Result\n",
+ "print\"The mean activity coefficient is\",round(Y,2) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean activity coefficient is 0.59\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.22,Page no:184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.22\n",
+ "#To find the ionic strength in a solution\n",
+ "#Variable declaration\n",
+ "M1=0.01 \t\t\t#no. of moles of KCl\n",
+ "M2=0.005 \t\t\t#no. of moles of MgCl2\n",
+ "M3=0.002 \t\t\t#no. of moles of MgSO4\n",
+ "M=0.1 \t\t\t\t#mass of water[Kg]\n",
+ "z11=1 \n",
+ "z12=1 \n",
+ "z21=2 \n",
+ "z22=1 \n",
+ "z31=2 \n",
+ "z32=2 \n",
+ "#Calculation\n",
+ "\t\n",
+ "m1=M1/M \t\t\t#molality of KCL[m]\n",
+ "m2=M2/M \t\t\t#molality of MgCl2[m]\n",
+ "m3=M3/M \t\t\t#molality of MgSO4[m]\n",
+ "\n",
+ "I=0.5*((m1*z11**2+m1*z12**2+m2*z21**2+2*m2*z22**2+m3*z31**2+m3*z32**2)) #[mol/Kg]\n",
+ "#Result\n",
+ "print\"The Ionic strength of a solution is\",I,\"mol/Kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Ionic strength of a solution is 0.33 mol/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.23,Page no:185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.23\n",
+ "#To find the mean activity coefficient\n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "P=1 \t\t\t\t#pressure [atm]\n",
+ "m=0.02\t \t\t\t#Ionic strength of HCl solution in CH3OH[mol/Kg]\n",
+ "E=32.6 \t\t\t\t#Di-electric constant\n",
+ "d=0.787 \t\t\t#Density[gm/cm3]\n",
+ "#Calculation\n",
+ "\t\n",
+ "I=0.5*(0.02*1*1+0.02*1*1) \t#Ionic strength of HCl solution[mol/Kg]\n",
+ "a=I*d \n",
+ "b=(E**3)*(298**3) \n",
+ "x=(a/b)**0.5 \n",
+ "Y=10**(-1.825*1000000*1*1*x) \t#mean activity coefficient\n",
+ "#Result\n",
+ "print\"The mean activity coefficient is\",round(Y,2) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean activity coefficient is 0.58\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/CH7.ipynb b/Thermodynamics:_A_Core_Course/CH7.ipynb
new file mode 100644
index 00000000..71226c1e
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/CH7.ipynb
@@ -0,0 +1,603 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7:Statistical Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1,Page number:193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.1\n",
+ "\n",
+ "#To find the number of ways of distributing N particles\n",
+ "#Variable declaration\n",
+ "N=20 \t\t\t\t#no, of particles\n",
+ "N1=4 \t\t\t\t#no. of particles in E1 energy level\n",
+ "N2=4 \t\t\t\t#no. of particles in E2 energy level\n",
+ "N3=6 \t\t\t\t#no. of particles in E3 energy level\n",
+ "N4=3 \t\t\t\t#no. of particles in E4 energy level\n",
+ "N5=3 \t\t\t\t#no. of particles in E5 energy level\n",
+ "import math\n",
+ "#Calculation\n",
+ "\t\n",
+ "Nf=math.factorial(N) \n",
+ "N1f=math.factorial(N1) \n",
+ "N2f=math.factorial(N2) \n",
+ "N3f=math.factorial(N3) \n",
+ "N4f=math.factorial(N4) \n",
+ "N5f=math.factorial(N5) \n",
+ "n=N1f*N2f*N3f*N4f*N5f \n",
+ "W=Nf/n \t\t\t#no. of ways of distributing\n",
+ "#Result\n",
+ "print\"The no. of ways of distributing the particles is\",W"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The no. of ways of distributing the particles is 162954792000\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2,Page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.2\n",
+ "#To find the fraction of molecules present in vibrational level\n",
+ "#Variable declaration\n",
+ "T=298.0 \t\t\t#Temperature [K]\n",
+ "v=6.5*10**13 \t\t#Frequency in [sec-1]\n",
+ "\t#Consider zero point energy = 0.\n",
+ "h=6.627*10**-34 \t#planck's constant[J.s]\n",
+ "k=1.381*10**-23 \t#Boltzmann constant \n",
+ "N=1.0 \t\t\t#Since N=summation(gj*exp(-Ej/kT))\n",
+ "#Calculation\n",
+ "\n",
+ "E1=h*v \t\t\t#for energy level 1[J]\n",
+ "E2=2*h*v \t\t#for energy level 2[J]\n",
+ "x=k*T \n",
+ "g1=1.0 \n",
+ "g2=1.0 \n",
+ "import math\n",
+ "N1=(g1*math.exp(-E1/x)) #molecules present in energy level 1\n",
+ "N2=(g2*math.exp(-E2/x)) #molecules present in energy level 2\n",
+ "n1=N1/N \t\t#fraction of molecules present in energy level 1\n",
+ "n2=N2/N \t\t#fraction of molecules present in energy level 2\n",
+ "#Result\n",
+ "print\"The fraction of molecule s present in energy level 1 is\",'{0:.7f}'.format(round(n1,7)) \n",
+ "\n",
+ "\n",
+ "print\"The fraction of molecules present in energy level 2 is\",round(n2,10) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fraction of molecule s present in energy level 1 is 0.0000285\n",
+ "The fraction of molecules present in energy level 2 is 8e-10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3,Page number:194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.3\n",
+ "#To find the ratio of no. of particle per state for two states separated by an energy dE\n",
+ "#Variable declaration\n",
+ "dE=4.3*10**-20 \t\t\t#difference in energy levels[J]\n",
+ "T1=0.000001 \t\t\t#Initial Temperature[K](approximately zero , needed for \t\t\t\texecution)\n",
+ "T2=300 \t\t\t\t#Final Temperature[K]\n",
+ "k=1.381*10**-23 \t\t#Boltzmann constant [J/K]\n",
+ "import math\n",
+ "#Calculation\n",
+ "\t\n",
+ "x1=k*T1 \n",
+ "r1=math.exp(-dE/x1) \n",
+ "x2=k*T2 \n",
+ "r2=math.exp(-dE/x2) \n",
+ "#Result\n",
+ "print\"The ratio of no. of particles per state at 0K is\",r1 \n",
+ "print\"The ratio of no. of particles per state at 300K is\",round(r2,6) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of no. of particles per state at 0K is 0.0\n",
+ "The ratio of no. of particles per state at 300K is 3.1e-05\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4,Page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.4\n",
+ "#To find the no. of atoms in first-excited singlet state\n",
+ "#Variable declaration\n",
+ "T1=273.0 \t\t\t\t#[K]\n",
+ "T2=14273.0 \t\t\t#[K]\n",
+ "E1=-13.6 \t\t\t#Energy of ground state [eV]\n",
+ "k=8.617*10.0**-5.0 \t\t\t#Boltzmann constant[eV/K]\n",
+ "g2=8.0 \t\t\t\t#total no. of states with energy E2\n",
+ "g1=2.0 \t\t\t\t#total no. of states with energy E1\n",
+ "#Calculation\n",
+ "import math\n",
+ "\t\n",
+ "E2=E1/(2.0**2) \t\t#Energy for n=2 (i.e.E2=E1/n2)\n",
+ "x1=k*T1 \n",
+ "r1=(g2/g1)*math.exp(-(E2-E1)/x1) \n",
+ "x2=k*T2 \n",
+ "r2=(g2/g1)*math.exp(-(E2-E1)/x2) \n",
+ "#Result\n",
+ "print\"The fraction of atoms present in level n=2 at 273K is\", round(r1,190) \n",
+ "print\"Therefore total 3*10**25 atoms we say that all are present at ground state\" \n",
+ "print\"\\n\\nThe fraction of atoms present in level n=2 at 14273 is\",round(r2,3) \n",
+ "x=r2*3.0*10**25.0 \n",
+ "print\"Therefore no. of atoms in level n=2 is\",x \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fraction of atoms present in level n=2 at 273K is 1.97e-188\n",
+ "Therefore total 3*10**25 atoms we say that all are present at ground state\n",
+ "\n",
+ "\n",
+ "The fraction of atoms present in level n=2 at 14273 is 0.001\n",
+ "Therefore no. of atoms in level n=2 is 3.0021673634e+22\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5,Page number:195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.5\n",
+ "#To find the Temperature at this condition \n",
+ "\n",
+ "#Variable declaration\n",
+ "r1=0.001 \t\t\t#the population of the states at a higher energy to that at a \t\t\t\tlower energy \n",
+ "dE=8*10**-20 \t\t\t#The difference in energy[J]\n",
+ "k=1.381*10**-23 \t\t\t#Boltzmann constant [J/K]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "x=k*math.log(r1) \n",
+ "T=-dE/x #[K]\n",
+ "#Result\n",
+ "print\"The Temperature at this condition is\",round(T,1),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Temperature at this condition is 838.6 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6,Page number:196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.6\n",
+ "#To find the entropy of the system\n",
+ "\n",
+ "#section(1)\n",
+ "#Variable declaration\n",
+ "#The energy levels are not degenerate \n",
+ "w=1 \t\t\t#no. of ways of distributing the molecules\n",
+ "k=1.381*10**-23 \t#Boltzmann constant[J/K]\n",
+ "#Calculation\n",
+ "import math\n",
+ "\t\n",
+ "S1=k*math.log(w) \t\t#Entropy of system at 0K\n",
+ "print\"The Entropy of System at 0K and non-degenerate eng level is\",S1,\"J/K/mol\"\n",
+ "\n",
+ "#section(2)\n",
+ "#Here the energy levels are degenerate\n",
+ "n=2 \n",
+ "R=8.314 #Universal gas constant[J/K/mol]\n",
+ "\n",
+ "#To find the entropy of the system\n",
+ "#S=kmath.log(n**N)=>S=R*math.log(n)\n",
+ "S2=R*math.log(n) #Entropy of the system[J/K/mol]\n",
+ "#Result\n",
+ "print\"\\nThe Entropy of system at 0K and degenerete eng level is\",round(S2,2),\"J/K/mol\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Entropy of System at 0K and non-degenerate eng level is 0.0 J/K/mol\n",
+ "\n",
+ "The Entropy of system at 0K and degenerete eng level is 5.76 J/K/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9,Page number:202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.9\n",
+ "\n",
+ "#To find the Transitional partition function of an oxygen molecule confined in a 1-litre \tvessel at 300K\n",
+ "#Variable declaration\n",
+ "V=0.001 \t\t\t#Volume of vessel[m3]\n",
+ "T=300 \t\t\t\t#Temperature [K]\n",
+ "k=1.381*10**-23 \t\t#Boltzmann constant[J/K]\n",
+ "mol_wt=32 \t\t\t#molecular mass of oxygen molecule\n",
+ "h=6.626*10**-34 \t\t#planck's constant[J.s}\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\t\n",
+ "m=32*1.66*(10**-27) \t\t#mass of oxygen molecule[Kg]\n",
+ "x=((2*3.14*m*k*T)**(3.0/2.0))*V \n",
+ "y=h**3 \n",
+ "zt=x/y \t\t\t\t#Transitional partition function of an oxygen molecule\n",
+ "#Result\n",
+ "print\"The Transitional partition function of an oxygen molecule confined in a 1-litre vessel at 300K is\",zt\n",
+ "print\"Wrongly calculated in book as 5.328*10^33\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Transitional partition function of an oxygen molecule confined in a 1-litre vessel at 300K is 1.76621948031e+29\n",
+ "Wrongly calculated in book as 5.328*10^33\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12,Page number:204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.12\n",
+ "#To find the Entropy of argon at 273K and 1 atmospheric pressure\n",
+ "#Variable declaration\n",
+ "R=1.99 \t\t\t#Universal gas constant [cal/K]\n",
+ "e=2.718 \n",
+ "V=22414 \t\t#volume[cm3]\n",
+ "L=6.023*10**23 \n",
+ "h=6.626*10**-27 \t#Planck's constant [erg.sec]\n",
+ "m=6.63*10**-23 \t\t#mass[gm]\n",
+ "k=1.381*10**-16 \t#Boltzmann constant[erg/K]\n",
+ "T=273.2 \t\t#Temperature[K]\n",
+ "import math\n",
+ "#Calculation\n",
+ "\t\n",
+ "x=V*(e**2.5) \n",
+ "y=L*(h**3) \n",
+ "z=(2*3.14*m*k*T)**1.5 \n",
+ "S=R*math.log(x*z/y) #Entropy [cal/degree/mol]\n",
+ "#Result\n",
+ "print\"The Entropy of argon at 273K and 1 atm is\",round(S,1),\"cal/degree/mol\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Entropy of argon at 273K and 1 atm is 36.6 cal/degree/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.14,Page number:207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.14\n",
+ "\n",
+ "#To find the rotational entropy and free energy for O2 gas\n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "I=1.9373*10**-46 \t\t#moment of inertia of O2 gas [Kg/m2]\n",
+ "h=6.626*10**-34 \t\t\t#Planck's constant[J.s]\n",
+ "k=1.381*10**-23 \t\t\t#Boltzmann constant[J/K]\n",
+ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
+ "u=2 \t\t\t\t#Homonuclear diatomic molecule\n",
+ "import math\n",
+ "#Calculation\n",
+ "\t\n",
+ "Sr=R+R*math.log(8*3.14*3.14*I*k*T/(u*h*h)) #[J/K/mol]\n",
+ "Gr=-R*0.001*T*math.log(8*3.14*3.14*I*k*T/(u*h*h)) #[KJ/mol]\n",
+ "#Result\n",
+ "print\"The rotational entropy for O2 gas is\",round(Sr,3),\"J/K/mol\"\n",
+ "print\"The rotational free energy for O2 gas is\",round(Gr,3),\"KJ/mol\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rotational entropy for O2 gas is 43.826 J/K/mol\n",
+ "The rotational free energy for O2 gas is -10.583 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.15,Page number:208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.15\n",
+ "#To find the vibrational contribution to the entropy of F2 at 298K\n",
+ "#Variable declaration\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "v=892.1*3*10**10 \t\t#frequency[sec-1]\n",
+ "h=6.626*10**-27 \t\t#Planck's constant [J.s]\n",
+ "k=1.381*10**-16 \t\t#Boltzmann constant[erg/K]\n",
+ "e=2.718 \n",
+ "R=1.998 \t\t\t#Universal gas constant[cal/K]\n",
+ "\t\n",
+ "#Calculation\n",
+ "import math\n",
+ "x=h*v/(k*T) \n",
+ "a=R*x*e**-x/(1-e**-x) \t\t#a=E-Eo/T\n",
+ "b=R*math.log(1-e**-x) \t\t#b=G-Eo/T\n",
+ "S=a-b \t\t\t\t#[cal/deg]\n",
+ "#Result\n",
+ "print\"The vibrational contribution to the entropy of F2 is\",round(S,4),\"cal/deg APPROX\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The vibrational contribution to the entropy of F2 is 0.1445 cal/deg APPROX\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.16,Page number:211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.16\n",
+ "#To find the equilibrium constant\n",
+ "#Variable declaration\n",
+ "T=1273 \t\t\t\t#Temperature[K]\n",
+ "h=6.26*10**-27 \t\t\t#Planck's constant[J.s]\n",
+ "k=1.381*10**-16 \t\t\t#Boltzmann constant[erg/K]\n",
+ "T=1000 \t\t\t\t#Temperature[degrees]\n",
+ "m=3.82*10**-23 \t\t\t#mass of Na [gm]\n",
+ "I=(1.91*10**-23)*(3.078*10**-8)**2 \t#moment of inertia[gm.cm2]\n",
+ "dE=0.73*1.602*10**-12 \t\t\t#[erg]\n",
+ "v=159.23*(3*10**10)\t \t\t#frequency [s-1]\n",
+ "R=82 \t\t\t\t\t#universal gas constant[cm3.atm/deg]\n",
+ "u=2 \t\t\t\t\t#symmetry number\n",
+ "L=6.023*10**23 \t\t\t\t#avogadro's number\n",
+ "import math\n",
+ "#Calculation\n",
+ "\t\n",
+ "p=((3.14*m*k*T)**1.5)/h/h/h \n",
+ "s=R*u*h*h/L/8/3.14/3.14/I/k \n",
+ "q=1-(math.exp(-h*v/k/T)) \n",
+ "r=math.exp(-dE/k/T) \n",
+ "Kp=p*s*q*r \t\t\t\t#Equilibrium constant \n",
+ "#Result\n",
+ "print\"The equilibrium constant is\",round(Kp,3) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium constant is 0.608\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.17,Page number:212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.17\n",
+ "#To find the equilibrium constant for isotopic exchange reaction\n",
+ "#Variable declaration\n",
+ "T=298.0 #Temperature[K]\n",
+ "m1=32.0 \n",
+ "m2=36.0 \n",
+ "m3=34.0 \n",
+ "u1=8.0 \n",
+ "u2=9.0 \n",
+ "u3=16.0*18.0/34.0 \n",
+ "z1=0.99924 \n",
+ "z2=0.99951 \n",
+ "z3=0.99940 \n",
+ "h=6.26*10**-27 #Planck's constant[J.s]\n",
+ "c=3.0*10**10 #Speed of light[m/s]\n",
+ "k=1.38*10**-16 #Boltzman's constant[erg/K]\n",
+ "vo1=1535.8 #vibration frequency of 16O18O [cm-1]\n",
+ "vo2=1580.4 #vibration frequency of 16O2 [cm-1]\n",
+ "vo3=1490.0 #vibration frequency of 18O2 [cm-1]\n",
+ "dE=0.5*h*c*(2*vo1-vo2-vo3) #[erg]\n",
+ "r=dE/k/T \n",
+ "#Calculation\n",
+ "import math\n",
+ "\n",
+ "a=m3**3/m2**1.5/m1**1.5 \n",
+ "b=(u3**2)*4/u2/u1 \n",
+ "c=z3**2/z2/z1 \n",
+ "Kp=a*b*c*math.exp(-r) \n",
+ "#Result\n",
+ "print\"The value of equilibrium constant for isotopic exchange reaction is\",round(Kp,3) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of equilibrium constant for isotopic exchange reaction is 3.996\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/README.txt b/Thermodynamics:_A_Core_Course/README.txt
new file mode 100644
index 00000000..c61dc121
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Deepak Shakya
+Course: btech
+College/Institute/Organization: DCRUST
+Department/Designation: Chemical Engg
+Book Title: Thermodynamics: A Core Course
+Author: R. C. Srivastava, S. K. Saha And A. K. Jain
+Publisher: PHI Learning Pvt. Ltd.
+Year of publication: 2004
+Isbn: 81-203-2498-6
+Edition: 2nd \ No newline at end of file
diff --git a/Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png
new file mode 100644
index 00000000..df57307c
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png
Binary files differ
diff --git a/Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png
new file mode 100644
index 00000000..785f7970
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png
Binary files differ
diff --git a/Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png
new file mode 100644
index 00000000..a71d57e5
--- /dev/null
+++ b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png
Binary files differ
diff --git a/Transport_Phenomena/README.txt b/Transport_Phenomena/README.txt
new file mode 100644
index 00000000..9767f98f
--- /dev/null
+++ b/Transport_Phenomena/README.txt
@@ -0,0 +1,10 @@
+Contributed By: pratik gandhi
+Course: bca
+College/Institute/Organization: Cybercom Creation
+Department/Designation: Developer
+Book Title: Transport Phenomena
+Author: R. S. Brodkey And H. C. Hershey
+Publisher: McGraw - Hill Book Company, New York
+Year of publication: 1988
+Isbn: 0-07-007963-3
+Edition: 1 \ No newline at end of file
diff --git a/Transport_Phenomena/ch1.ipynb b/Transport_Phenomena/ch1.ipynb
new file mode 100644
index 00000000..0a893e9a
--- /dev/null
+++ b/Transport_Phenomena/ch1.ipynb
@@ -0,0 +1,120 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : introduction to transport phenomena"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1 - Page No : 6\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the concentration of nitrogen in the tank in\n",
+ "\n",
+ "# Variables\n",
+ "v=0.01283; \t\t\t #[m**3] - volume of tank in m**3\n",
+ "v=0.4531; \t\t\t #[ft**3] - volume of tank in ft**3\n",
+ "p=2; \t\t\t #[atm] - pressure\n",
+ "T=1.8*300; \t\t\t #[degR] - temperature\n",
+ "R=0.73; \t\t \t #[(atm*ft**3)/(lbmol*degR)] - gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "# usin the equation of state for an ideal gas pv=nRT\n",
+ "n=(p*v)/(R*T);\n",
+ "\n",
+ "xN2=0.5; \t\t\t # fractiom of N2 in math.tank\n",
+ "nN2=xN2*n;\n",
+ "Ca=nN2/v;\n",
+ "\n",
+ "# Results\n",
+ "print \"no. of moles , n = %.3e\"%n\n",
+ "print \"Ca = %.2e lb*mol/ft**3\"%(Ca);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "no. of moles , n = 2.299e-03\n",
+ "Ca = 2.54e-03 lb*mol/ft**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 - Page No :9\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the mass of each concentrated solution to be added.\n",
+ "\n",
+ "from numpy import *\n",
+ "\n",
+ "# the three unknowns are x,y,z\n",
+ "# the three equations are-\n",
+ "# x+y+z = 1500\n",
+ "# (1) 0.05*x+0.15*y+0.40*z = 1500*0.25\n",
+ "# (2) 0.95*x+0.00*y+0.452*z = 1500*0.50\n",
+ "# Variables\n",
+ "a = array([[1, 1, 1],[0.05, 0.15, 0.40],[0.95, 0 ,0.452]])\n",
+ "d = array([[1500.],[1500.*0.25],[1500.*0.50]])\n",
+ "\n",
+ "# Calculations\n",
+ "#ainv = linalg.inv(a);\n",
+ "#sol = ainv * d;\n",
+ "sol = linalg.solve(a,d)\n",
+ "# Results\n",
+ "print \"the amount of concentrated HNO3 is %.0fkg \\\n",
+ "\\nthe amount of concentrated H2SO4 is %.0fkg \\\n",
+ "\\nthe amount of waste acids is %.0fkg\"%(sol[1],sol[0],round(sol[2],-1));\n",
+ "\n",
+ "# Answer may be different because of rounding error and inbuilt function solve."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the amount of concentrated HNO3 is 307kg \n",
+ "the amount of concentrated H2SO4 is 423kg \n",
+ "the amount of waste acids is 770kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch10.ipynb b/Transport_Phenomena/ch10.ipynb
new file mode 100644
index 00000000..4df43e2b
--- /dev/null
+++ b/Transport_Phenomena/ch10.ipynb
@@ -0,0 +1,1031 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Fluid flow in ducts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.1 - Page No :405\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compute the viscosity in CP.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 30.; \t\t\t #[degC] - temperature\n",
+ "d = 8.265*10**-4; \t\t\t #[m] - diameter of the capillary viscometer\n",
+ "deltapbyL = -0.9364; \t\t #[psi/ft] - pressure drop per unit length\n",
+ "\n",
+ "# Calculations\n",
+ "deltapbyL = deltapbyL*(2.2631*10**4); \t\t\t #[kg/m**2*sec**2] - pressure drop per unit length\n",
+ "Q = 28.36*(10**-6)*(1./60);\n",
+ "p = (0.88412-(0.92248*10**-3)*T)*10**3; \t\t\t #[kg/m**3] - density\n",
+ "s = (math.pi*(d**2))/4.;\n",
+ "U = Q/s;\n",
+ "tauw = (d/4.)*(-deltapbyL);\n",
+ "shearrate = (8*U)/d;\n",
+ "mu = tauw/(shearrate);\n",
+ "\n",
+ "# Results\n",
+ "print \" The viscosity is mu = %.3ef kg/m*sec = %.4f cP\"%(mu,mu*10**3);\n",
+ "print \" Finally, it is important to check the reynolds number to make sure the above equation applies\"\n",
+ "Nre = (d*U*p)/(mu);\n",
+ "print \" Nre = %d\"%Nre\n",
+ "print \" The flow is well within the laminar region and therefore the above equation applies\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The viscosity is mu = 5.135e-04f kg/m*sec = 0.5135 cP\n",
+ " Finally, it is important to check the reynolds number to make sure the above equation applies\n",
+ " Nre = 1214\n",
+ " The flow is well within the laminar region and therefore the above equation applies\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.2 - Page No :407\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compute the pressure drop for the same 0.032%in \n",
+ "\n",
+ "# Variables\n",
+ "Nreold = 1214.;\n",
+ "Uold = 0.8810;\n",
+ "Nre = 13700.;\n",
+ "U = Uold*(Nre/Nreold);\n",
+ "Lbyd = 744.;\n",
+ "T = 30.; \n",
+ "\n",
+ "# Calculations\n",
+ "# umath.sing the newton raphson method to calculate the value of f from the equation - 1/(f**(1/2)) = 4*math.log(Nre*(f**(1/2)))-0.4\n",
+ "f = 0.007119;\n",
+ "p = (0.88412-(0.92248*10**-3)*T)*10**3; \t\t\t #[kg/m**3] - density\n",
+ "tauw = (1./2)*p*(U**2)*f;\n",
+ "deltap = tauw*(4.)*(Lbyd);\n",
+ "d = 0.03254/12; \t\t\t #[ft]\n",
+ "L = Lbyd*d;\n",
+ "\n",
+ "# Results\n",
+ "print \" Pressure drop is -deltap = %.3e N/m**2 = %.1f kpa = 130 psi\"%(deltap,deltap*10**-3); \n",
+ "print \" A pressure drop of 130 psi on a tube of length of %.3f ft is high and \\\n",
+ "\\nshows the impracticality of flows at high reynolds number in smaller tubes\"%(L);\n",
+ "\n",
+ "# Answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure drop is -deltap = 8.968e+05 N/m**2 = 896.8 kpa = 130 psi\n",
+ " A pressure drop of 130 psi on a tube of length of 2.017 ft is high and \n",
+ "shows the impracticality of flows at high reynolds number in smaller tubes\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.3 - Page No :414\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the pressure drop in a pipe of 6-cm inside diameter for water flowing\n",
+ "\n",
+ "# Variables\n",
+ "u = 1./60; \t\t\t #[m/sec] - velocity\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density\n",
+ "mu = 1*10.**-3; \t\t #[kg/m*sec] - vismath.cosity\n",
+ "d = 6*10.**-2; \t\t #[m] - insid_e diameter of tube\n",
+ "L = 300.; \t\t\t #[m] - length of the tube\n",
+ "\n",
+ "# Calculations\n",
+ "Nre = (d*u*p)/(mu);\n",
+ "f = 16./Nre;\n",
+ "deltap = (4.*f)*(L/d)*((p*(u**2))/2.);\n",
+ "\n",
+ "# Results\n",
+ "print \"Nre = \",Nre,\"therefore the flow is laminar\"\n",
+ "print \"f = \" , f\n",
+ "print \"Pressure drop -delta P = %.2f N/m**2 = %.4f kPa = %.3e psi\"%(deltap,deltap*10**-3,deltap*1.453*10**-4);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nre = 1000.0 therefore the flow is laminar\n",
+ "f = 0.016\n",
+ "Pressure drop -delta P = 44.44 N/m**2 = 0.0444 kPa = 6.458e-03 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.4 - Page No :415\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Repeat the previous example for Reynolds numbers of 10 000 and\n",
+ "100 000. Contrast smooth pipe with commercial steel pipe and cast iron pipe.\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "d = 6.*10**-2; \t\t\t #[m] - insid_e diameter of tube\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density\n",
+ "# for smooth pipe\n",
+ "Nre = array([10**4, 10**5]);\n",
+ "f = array([0.0076, 0.0045]);\n",
+ "mu = 10.**-3; \t\t\t #[kg/m**2*s]\n",
+ "U = (Nre*mu)/(d*p);\n",
+ "L = 300.; \t\t\t #[m] - length of the tube\n",
+ "\n",
+ "# Calculations\n",
+ "deltap = zeros(2)\n",
+ "for i in range(2):\n",
+ " deltap[i] = (4*f[i])*(L/d)*((p*(U[i]**2))/2.);\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \"for smooth pipe\"\n",
+ "print \" Nre f -deltap\";\n",
+ "print \" %6.0f %6.4f %6.3f\"%(Nre[0],f[0],deltap[0])\n",
+ "print \" %6.0f %6.4f %6.3f\"%(Nre[1],f[1],deltap[1])\n",
+ "\n",
+ "# for commercial steel\n",
+ "Nre = array([10**4, 10**5]);\n",
+ "f = array([0.008 ,0.0053]);\n",
+ "U = (Nre*mu)/(d*p);\n",
+ "L = 300.; \t\t\t #[m] - length of the tube\n",
+ "for i in range(2):\n",
+ " deltap[i] = (4*f[i])*(L/d)*((p*(U[i]**2))/2);\n",
+ "\n",
+ "print \"\\nfor commercial steel pipe\"\n",
+ "print \" Nre f -deltap\";\n",
+ "print \" %6.0f %6.4f %6.3f\"%(Nre[0],f[0],deltap[0])\n",
+ "print \" %6.0f %6.4f %6.3f\"%(Nre[1],f[1],deltap[1])\n",
+ "\n",
+ "# for cast iron pipe\n",
+ "Nre = array([10**4 ,10**5]);\n",
+ "f = array([0.009 ,0.0073]);\n",
+ "U = (Nre*mu)/(d*p);\n",
+ "L = 300.; \t\t\t #[m] - length of the tube\n",
+ "for i in range(2):\n",
+ " deltap[i] = (4*f[i])*(L/d)*((p*(U[i]**2))/2);\n",
+ "\n",
+ "print \"\\nfor cast iron pipe\"\n",
+ "print \" Nre f -deltap\";\n",
+ "print \" %6.0f %6.4f %6.3f\"%(Nre[0],f[0],deltap[0])\n",
+ "print \" %6.0f %6.4f %6.3f\"%(Nre[1],f[1],deltap[1])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for smooth pipe\n",
+ " Nre f -deltap\n",
+ " 10000 0.0076 2111.111\n",
+ " 100000 0.0045 125000.000\n",
+ "\n",
+ "for commercial steel pipe\n",
+ " Nre f -deltap\n",
+ " 10000 0.0080 2222.222\n",
+ " 100000 0.0053 147222.222\n",
+ "\n",
+ "for cast iron pipe\n",
+ " Nre f -deltap\n",
+ " 10000 0.0090 2500.000\n",
+ " 100000 0.0073 202777.778\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.5 - Page No :417\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find, the maximum flow velocity by trial and error.\n",
+ "\n",
+ "# Variables\n",
+ "L = 300.; \t\t\t #[m] - length of pipe\n",
+ "d = 0.06; \t\t\t #[m] - insid_e diameter\n",
+ "deltap = 147.*10**3; \t\t #[Pa] - pressure the pump can supply\n",
+ "ebyd = 0.000762; \t\t\t # relative roughness\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density\n",
+ "mu = 1.*10**-3; \t\t\t #[kg/m*sec] - viscosity\n",
+ "tauw = (d*(deltap))/(4.*L);\n",
+ "\n",
+ "# using the hit and trial method for estimation of flow velocity\n",
+ "# Calculations\n",
+ "# let \n",
+ "f = 0.005;\n",
+ "U = ((2*tauw)/(p*f))**(1./2);\n",
+ "Nre = (d*U*p)/mu;\n",
+ "\n",
+ "# from the graph value of f at the above calculated reynolds no. and the given relative roughness(e/d)\n",
+ "f = 0.0054;\n",
+ "U = ((2*tauw)/(p*f))**(1./2);\n",
+ "Nre = (d*U*p)/mu;\n",
+ "\t\t\t # from the graph value of f at the above calculated reynolds no. and the given relative roughness(e/d)\n",
+ "f = 0.0053;\n",
+ "U = ((2*tauw)/(p*f))**(1./2);\n",
+ "Nre = (d*U*p)/mu;\n",
+ "\n",
+ "# from the graph value of f at the above calculated reynolds no. and the given relative roughness(e/d)\n",
+ "f = 0.0053;\n",
+ "# At this point the value of f is deemed unchanged from the last iteration .Hence, the values obtained after the third iteration are the converged values\n",
+ "\n",
+ "# Results\n",
+ "print \" The maximum flow velocity is U = %f m/sec\"%(U);\n",
+ "\n",
+ "# Answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The maximum flow velocity is U = 1.665408 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.6 - Page No :419\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Repeat Example 10.5 using the von Karman plot, Fig. 10.5.\n",
+ "\n",
+ "# Variables\n",
+ "L = 300.; \t\t\t #[m] - length of pipe\n",
+ "d = 0.06; \t\t\t #[m] - insid_e diameter\n",
+ "deltap = 147.*10**3; \t #[Pa] - pressure the pump can supply\n",
+ "ebyd = 0.000762; \t\t # relative roughness\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density\n",
+ "\n",
+ "# Calculations\n",
+ "mu = 1*10**-3; \t\t\t #[kg/m*sec] - viscosity\n",
+ "Nvk = ((d*p)/mu)*((d*(deltap))/(2*L*p))**(1./2);\n",
+ "\n",
+ "# From the fig at given von karman no and relative roughness the value of f is-\n",
+ "f = 0.0055;\n",
+ "Nre = Nvk/(f**(1./2))\n",
+ "U = (Nre*mu)/(d*p);\n",
+ "\n",
+ "# Results\n",
+ "print \"von karman no. %.0f\"%Nvk\n",
+ "print \" Average velocity = %.2f m/sec\"%(U);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "von karman no. 7275\n",
+ " Average velocity = 1.63 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.7 - Page No :422\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# estimate the pressure drop in a 0.06-m ID commercial steel pipe at Reynolds numbers of 104 and 16\n",
+ "\n",
+ "# Variables\n",
+ "L = 300.; \t\t\t #[m] - length of pipe\n",
+ "d = 0.06; \t\t\t #[m] - insid_e diameter\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density\n",
+ "mu = 1.*10**-3; \t\t\t #[kg/m*sec] - vismath.cosity\n",
+ "\n",
+ "# Calculations\n",
+ "Nre = array([10.**4, 10.**5]);\n",
+ "U = (Nre*mu)/(d*p);\n",
+ "velocityhead = (U**2)/2.;\n",
+ "N = (L/d)/45.; \t\t\t # no of velocity heads\n",
+ "deltap = p*N*(velocityhead);\n",
+ "\n",
+ "# Results\n",
+ "for i in range(2):\n",
+ " print \"Nre = \",Nre[i]\n",
+ " print \" velocity head = %.5f m**2/sec**2\"%(velocityhead[i]);\n",
+ " print \" -deltap = %.3f kPa = %.3f psi\"%(deltap[i]*10**-3,deltap[i]*1.453*10**-4);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nre = 10000.0\n",
+ " velocity head = 0.01389 m**2/sec**2\n",
+ " -deltap = 1.543 kPa = 0.224 psi\n",
+ "Nre = 100000.0\n",
+ " velocity head = 1.38889 m**2/sec**2\n",
+ " -deltap = 154.321 kPa = 22.423 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.8 - Page No :439\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compute p, by (a) the equivalent length method and (b) the loss coefficient method.\n",
+ "\n",
+ "# Variables\n",
+ "mu = 6.72*10**-4; \t\t #[lb/ft*sec] - vismath.cosity\n",
+ "p = 62.4; \t\t\t #[lb/ft**3] - density\n",
+ "S = 0.03322; \t\t\t #[ft**2] - flow area\n",
+ "d = 0.206; \t\t\t #[ft]\n",
+ "e = 1.5*10**-4; \t\t # absolute roughness for steel pipe\n",
+ "ebyd = e/d;\n",
+ "Nre = 10.**5;\n",
+ "\n",
+ "# friction factor as read from fig in book for the given reynolds no. and relative roughness is-\n",
+ "f = 0.0053;\n",
+ "U = (Nre*mu)/(p*d);\n",
+ "Q = U*S;\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# Calculations\n",
+ "# (a) equivalent length method\n",
+ "deltapbyL = f*(4/d)*(p*(U**2))*(1/(2*gc))*(6.93*10**-3);\n",
+ "\n",
+ "# using L = Lpipe+Lfittings+Lloss;\n",
+ "Lfittings = 2342.1*d;\n",
+ "kc = 0.50; \t\t\t # due to contraction loss\n",
+ "ke = 1.; \t\t\t # due to enlargement loss\n",
+ "Lloss = (kc+ke)*(1./(4*f))*d;\n",
+ "Lpipe = 137.;\n",
+ "L = Lpipe+Lfittings+Lloss;\n",
+ "deltap = deltapbyL*L;\n",
+ "patm = 14.696; \t\t\t #[psi] - atmospheric pressure\n",
+ "p1 = patm+deltap;\n",
+ "print \" a)The inlet pressure is p1 = %.1f psi\"%(p1);\n",
+ "\n",
+ "# (b) loss coefficient method\n",
+ "# using the equation deltap/p = -(Fpipe+Ffittings+Floss)\n",
+ "L = 137.;\n",
+ "kfittings = 52.39;\n",
+ "sigmaF = ((4.*f*(L/d))+kc+ke+kfittings)*((U**2)/(2*gc));\n",
+ "deltap = (p*sigmaF)/(144.);\n",
+ "p1 = patm+deltap;\n",
+ "\n",
+ "# Results\n",
+ "print \" b)The inlet pressure is p1 = %.1f psi\"%(p1);\n",
+ "print \" Computation of the pressure drop by the loss coefficient method differs from the equivalent length \\\n",
+ " \\nmethod by less than 1 psi\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a)The inlet pressure is p1 = 26.7 psi\n",
+ " b)The inlet pressure is p1 = 27.2 psi\n",
+ " Computation of the pressure drop by the loss coefficient method differs from the equivalent length \n",
+ "method by less than 1 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.9 - Page No :443\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine the total flow rate of water through the pipe system.\n",
+ "\n",
+ "# Variables\n",
+ "L1 = 50.; \t\t\t #[m] - length of first pipe\n",
+ "L2 = 150.; \t\t\t #[m] - length of second pipe\n",
+ "L3 = 100.; \t\t\t #[m] - length of third pipe\n",
+ "d1 = 0.04; \t\t\t #[m] - diameter of first pipe\n",
+ "d2 = 0.06; \t\t\t #[m] - diameter of second pipe\n",
+ "d3 = 0.08; \t\t\t #[m] - diameter of third pipe\n",
+ "deltap = -1.47*10**5; \t\t\t #[kg/m*sec] - pressure drop\n",
+ "mu = 1*10.**-3; \t\t\t #[kg/m*sec] - vismath.cosity\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# for branch 1\n",
+ "S = (math.pi*(d1**2))/4;\n",
+ "Nvk = ((d1*p)/mu)*(-(d1*deltap)/(2*L1*p))**(1./2);\n",
+ "f = (1./(4*math.log10(Nvk)-0.4))**2;\n",
+ "U = (((-deltap)/p)*(d1/L1)*(2./4)*(1./f))**(1./2);\n",
+ "w1 = p*U*S;\n",
+ "print \" For first branch w1 = %.2f kg/sec\"%(w1);\n",
+ "\t\t\t # for branch 2\n",
+ "S = (math.pi*(d2**2))/4;\n",
+ "Nvk = ((d2*p)/mu)*(-(d2*deltap)/(2*L2*p))**(1./2);\n",
+ "f = (1./(4*math.log10(Nvk)-0.4))**2;\n",
+ "U = (((-deltap)/p)*(d2/L2)*(2./4)*(1./f))**(1./2);\n",
+ "w2 = p*U*S;\n",
+ "print \" For second branch w2 = %.2f kg/sec\"%(w2);\n",
+ "\t\t\t # for branch 3\n",
+ "S = (math.pi*(d3**2))/4;\n",
+ "Nvk = ((d3*p)/mu)*(-(d3*deltap)/(2*L3*p))**(1./2);\n",
+ "f = (1./(4*math.log10(Nvk)-0.4))**2;\n",
+ "U = (((-deltap)/p)*(d3/L3)*(2./4)*(1./f))**(1./2);\n",
+ "w3 = p*U*S;\n",
+ "print \" For third branch w3 = %.2f kg/sec\"%(w3);\n",
+ "\n",
+ "# total flow rate w = w1+w2+w3\n",
+ "w = w1+w2+w3;\n",
+ "print \" total flow rate is w = %.1f kg/sec\"%(w);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " For first branch w1 = 4.74 kg/sec\n",
+ " For second branch w2 = 7.59 kg/sec\n",
+ " For third branch w3 = 20.42 kg/sec\n",
+ " total flow rate is w = 32.7 kg/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.10 Page no : 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find flow rate\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Note : all variables values are taken from 10.9\n",
+ "# variables \n",
+ "w1 = 4.74 #kg/sec\n",
+ "w2 = 7.59 #kg/sec\n",
+ "w3 = 20.42 #kg/sec\n",
+ "w = 32.7 #kg/sec\n",
+ "d = .04\n",
+ "\n",
+ "S1 = math.pi*d**2/4\n",
+ "S2 = .002827\n",
+ "S3 = .005027\n",
+ "deltaP = 1.47 * 10**5 #kpa\n",
+ "deltaP1 = 1.583* 10**6 #f1w**2\n",
+ "deltaP2 = 6.254* 10**5 #f1w**2\n",
+ "deltaP3 = 9.895* 10**4 #f1w**2\n",
+ "Nre1 = 3.183 * 10**4 #w\n",
+ "Nre2 = 2.122 * 10**4 #w\n",
+ "Nre3 = 1.592 * 10**4 #w\n",
+ "\n",
+ "\n",
+ "### age plz tu kar dena muje kuchh samaj nahi aa raha he...\n",
+ "### Thanks in advance..... nahi to ye delete kar dena... mere se nahi hota. plz.\n",
+ "print S1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.00125663706144\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.11 - Page No : 447\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the pump size necessary to maintain a spray\n",
+ "velocity of 15 ft s-\u2019 and a flow rate of 400 gpm if the pump is 60 percent efficient.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "sp = 1.1;\n",
+ "p = sp*62.4; \t\t\t #[lb/ft**3] - density\n",
+ "mu = 2*6.72*10**-4; \t #[lb/ft*sec] - viscosity\n",
+ "Q = 400.; \t\t\t #[gpm] - volumetric flow rate\n",
+ "e = 1.5*10**4; \t\t #roughness of steel pipe\n",
+ "gc = 32.174;\n",
+ "kexit = 1.;\n",
+ "kentrance = 0.5;\n",
+ "\n",
+ "# Calculations\n",
+ "# 4 in schedule pipe\n",
+ "d = 4.026/12; \t\t\t #[ft]\n",
+ "U4 = Q/39.6; \t\t\t #[ft/sec]\n",
+ "Lgv = 13.08;\n",
+ "Lglv = 114.1;\n",
+ "Le = 40.26;\n",
+ "Lpipe_4 = 22.;\n",
+ "Lfittings_4 = Lgv+Lglv+Le;\n",
+ "Lloss = 0;\n",
+ "L_4 = Lpipe_4+Lfittings_4+Lloss;\n",
+ "Nre_4 = (d*U4*p)/mu;\n",
+ "f = 0.00475;\n",
+ "Fpipe_4 = ((4*f*L_4)/d)*(U4**2)*(1/(2*gc));\n",
+ "Floss_4 = ((kentrance+0)*(U4**2))/(2*gc);\n",
+ "\n",
+ "# 5 in schedule pipe\n",
+ "d = 5.047/12;\n",
+ "U5 = Q/62.3;\n",
+ "Lgv = 10.94;\n",
+ "Le = 75.71;\n",
+ "Lpipe_5 = 100.;\n",
+ "Lfittings_5 = Lgv+Le;\n",
+ "Lloss = 0.;\n",
+ "L_5 = Lpipe_5+Lfittings_5+Lloss;\n",
+ "Nre = (d*U5*p)/mu;\n",
+ "f = 0.00470;\n",
+ "Fpipe_5 = ((4*f*L_5)/d)*(U5**2)*(1./(2*gc));\n",
+ "Floss_5 = ((kexit+0)*(U5**2))/(2*gc);\n",
+ "\n",
+ "# 6 in schedule pipe\n",
+ "d = 6.065/12;\n",
+ "U6 = Q/90.;\n",
+ "Lgv = 6.570;\n",
+ "Le = 30.36;\n",
+ "Lpipe_6 = 4.;\n",
+ "Lfittings_6 = Lgv+Le;\n",
+ "Lloss = 0.;\n",
+ "L_6 = Lpipe_6+Lfittings_6+Lloss;\n",
+ "Nre = (d*U6*p)/mu;\n",
+ "f = 0.00487;\n",
+ "Fpipe_6 = ((4*f*L_6)/d)*(U6**2)*(1./(2*gc));\n",
+ "kc = 0.50;\n",
+ "Floss_6 = kc*((U6**2)/(2*gc));\n",
+ "Ffittings = 0.;\n",
+ "deltap_6 = p*(Fpipe_6+Ffittings+Floss_6);\n",
+ "\n",
+ "# 3/4 in 18 gauge tube\n",
+ "d = 0.652112/12;\n",
+ "L_3by4 = 15.;\n",
+ "U_3by4 = (Q*0.962)/100.;\n",
+ "Floss_3by4 = 100.*(kexit+kentrance)*((U_3by4**2.)/2.);\n",
+ "Nre = d*U_3by4*p*(1./mu);\n",
+ "f = 0.08*((Nre)**(-1./4))+0.012*((d)**(1./2));\n",
+ "deltap_3by4 = ((4*f*p*L_3by4)/d)*((U_3by4**2)/(2*gc));\n",
+ "Fpipe_3by4 = 100.*((4.*f*L_3by4)/d)*((U_3by4**2.)/(2.*gc));\n",
+ "deltap_spraysystem = 25.; \t\t\t #[psi]\n",
+ "Fspraysystem = (deltap_spraysystem/p)*(144.);\n",
+ "delta_p = (p*(kexit+kentrance))*((U_3by4**2.)/(2.*gc))\n",
+ "Fpipe = Fpipe_4+Fpipe_5+Fpipe_6;\n",
+ "Floss = Floss_4+Floss_5+Floss_6+Floss_3by4;\n",
+ "ws = 0. + (((15.**2)-0)/(2*gc))+38.9+382.5;\n",
+ "w = (Q*p)/(7.48);\n",
+ "Ws = (ws*w)/(33000.);\n",
+ "efficiency = 0.6;\n",
+ "Ws_actual = Ws/efficiency\n",
+ "\n",
+ "# Results\n",
+ "print \" The power supplied to the pump is %.1f hp\"%(Ws_actual);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The power supplied to the pump is 78.8 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.12 - Page No :454\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the power required in the previous problem by using the velocity head approximation\n",
+ "\n",
+ "# Variables\n",
+ "kexit = 1.;\n",
+ "kentrance = 0.5;\n",
+ "Q = 400.; \t\t\t #[gpm] - volumetric flow rate\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# for 4 inch pipe\n",
+ "d = 4.026; \t\t #[inch]\n",
+ "L = 22.; \t\t\t #[ft]\n",
+ "Lbyd = (L*12)/(d);\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# adding the contributions due to fittings \n",
+ "Lbyd = Lbyd+3*13+340+4*30;\n",
+ "N = Lbyd/45.;\n",
+ "N = N+kentrance+0;\n",
+ "U4 = Q/39.6; \t\t\t #[ft/sec]\n",
+ "Fpipe_4 = (N*(U4**2))/(2*gc);\n",
+ "print \" F4 in.pipes = %.2f ft*lbf/lbm\"%(Fpipe_4);\n",
+ "\n",
+ "# for 5 inch pipe\n",
+ "L = 100.; \t\t\t #[ft]\n",
+ "d = 5.047; \t\t\t #[inch]\n",
+ "Lbyd = (L*12.)/(d);\n",
+ "\n",
+ "# valves contributes 26 diameters and six elbows contribute 30 diameters ecah;therefore\n",
+ "Lbyd = Lbyd+26+6*30;\n",
+ "N = Lbyd/45.; \t\t\t # no. of velocity heads\n",
+ "N = N+kexit+kentrance;\n",
+ "U5 = Q/62.3;\n",
+ "Fpipe_5 = (N*(U5**2))/(2*gc);\n",
+ "print \" F5 in.pipes = %.2f ft*lbf/lbm\"%(Fpipe_5);\n",
+ "\n",
+ "# for 6 inch pipe\n",
+ "d = 6.065; \t\t #[inch]\n",
+ "L = 5.; \t\t\t #[ft]\n",
+ "Lbyd = (L*12.)/(d);\n",
+ "\n",
+ "# adding the contributions due to fittings \n",
+ "Lbyd = Lbyd+1*13+2*30;\n",
+ "N = Lbyd/45;\n",
+ "N = N+0+kentrance;\n",
+ "U6 = Q/90.;\n",
+ "Fpipe_6 = (N*(U6**2))/(2*gc);\n",
+ "print \" F6 in.pipes = %.3f ft*lbf/lbm\"%(Fpipe_6);\n",
+ "F_largepipes = Fpipe_4+Fpipe_5+Fpipe_6;\n",
+ "print \" Flarge pipes = %.2f ft*lbf/lbm\"%(F_largepipes);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " F4 in.pipes = 20.69 ft*lbf/lbm\n",
+ " F5 in.pipes = 7.28 ft*lbf/lbm\n",
+ " F6 in.pipes = 0.719 ft*lbf/lbm\n",
+ " Flarge pipes = 28.68 ft*lbf/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.14 - Page No :459\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine the pressure drop over a length of 300 m if the flow velocity is 1.667 m\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "l = 0.09238;\n",
+ "rh = 0.1624*l;\n",
+ "L = 300.;\n",
+ "de = 4.*rh;\n",
+ "p = 1000.; \t\t\t #[kg/m**3]\n",
+ "mu = 10.**-3; \t\t\t #[kg/m*sec]\n",
+ "Uavg = 1.667;\n",
+ "\n",
+ "# Calculations\n",
+ "Nre = (de*Uavg*p)/mu;\n",
+ "f = 0.0053;\n",
+ "deltap = ((4.*f*L)/de)*(p*(Uavg**2)*(1./2));\n",
+ "\n",
+ "# Results\n",
+ "print \" Pressure drop -deltap = %.3e kg/m*s = %.3e N/m**2 = %.1f kPa\"%(deltap,deltap,deltap*10**-3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure drop -deltap = 1.473e+05 kg/m*s = 1.473e+05 N/m**2 = 147.3 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.15 - Page No :466\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Size a sharp-edged, corner-tap orifice meter for the 4-in. leg in\n",
+ "Fig. 10.17 if the flow rate and fluid are unchanged from Example 10.11.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Q = 400.; \t\t\t #[gpm]\n",
+ "p = 1.1*62.4; \t \t\t #[lbm/ft**3]\n",
+ "mu = 2.*(6.72*10**-4); \t #[lb/ft*sec]\n",
+ "e = 1.5*10**4;\n",
+ "\n",
+ "# Calculations\n",
+ "# 4 inch schedule pipe\n",
+ "d = 0.3355;\n",
+ "S = (math.pi*(d**2))/4;\n",
+ "U4 = Q/39.6;\n",
+ "ebyd = e/d;\n",
+ "w = 3671./60;\n",
+ "pm = 13.45*62.4;\n",
+ "g = 32.1;\n",
+ "gc = 32.174;\n",
+ "deltaz = 2.5;\n",
+ "deltap = (g/gc)*(pm-p)*(deltaz);\n",
+ "betaa = ((1.)/(1.+((2*p*gc)*(deltap))*(((0.61*S)/w)**2)))**(1./4);\n",
+ "d2 = betaa*d;\n",
+ "Nre2 = (4*w)/(math.pi*d2*mu);\n",
+ "a = (1./30)*4.026;\n",
+ "b = (1./4)*(2.013-1.21);\n",
+ "c = (1./8)*(2.42);\n",
+ "if a<b :\n",
+ " if a<c :\n",
+ " opt = a;\n",
+ " else:\n",
+ " opt = c;\n",
+ "else:\n",
+ " if b<c:\n",
+ " opt = b;\n",
+ " else:\n",
+ " opt = c;\n",
+ "\n",
+ "# Results\n",
+ "print \" The pertinent orifice details are orifice diameter = %.3f in corner taps, \\\n",
+ " \\n square edge orifice plate not over %.3f in thick\"%(d2*12,opt);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The pertinent orifice details are orifice diameter = 2.425 in corner taps, \n",
+ " square edge orifice plate not over 0.134 in thick\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.16 - Page No :470\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Size a venturi meter for the application cited in Example 10.15\n",
+ "\n",
+ "# Variables\n",
+ "Q = 400.; \t \t\t #[gpm]\n",
+ "p = 1.1*62.4; \t\t\t #[lbm/ft**3]\n",
+ "mu = 2*(6.72*10**-4); \t\t\t #[lb/ft*sec]\n",
+ "e = 1.5*10**4;\n",
+ "\n",
+ "# Calculations\n",
+ "# 4 inch schedule pipe\n",
+ "d = 0.3355;\n",
+ "S = (math.pi*(d**2))/4;\n",
+ "U4 = Q/39.6;\n",
+ "ebyd = e/d;\n",
+ "w = 3671./60;\n",
+ "pm = 13.45*62.4;\n",
+ "g = 32.1;\n",
+ "gc = 32.174;\n",
+ "Nre = (d*U4*p)/mu;\n",
+ "if Nre>10**4:\n",
+ " c = 0.98;\n",
+ "\n",
+ "deltaz = 2.5;\n",
+ "deltap = (g/gc)*(pm-p)*(deltaz);\n",
+ "betaa = ((1.)/(1+((2*p*gc)*(deltap))*(((c*S)/w)**2)))**(1./4);\n",
+ "d2 = betaa*d;\n",
+ "\n",
+ "# Results\n",
+ "print \" The pertinentr details of the venturi design are Throat diameter = %.2f inch \\\n",
+ "\\n Approach angle = 25 Divergence angle = 7\"%(d2*12);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The pertinentr details of the venturi design are Throat diameter = 1.95 inch \n",
+ " Approach angle = 25 Divergence angle = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 10.17 - Page No :477\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Then compute the average velocity by Eq. (10.88) and compare with the 2.778 ft s-l as given.\n",
+ "\n",
+ "# Variables\n",
+ "Uzmax = 3.455; \t\t\t #[ft/sec]\n",
+ "m = 32;\n",
+ "a1 = -0.3527;\n",
+ "a2 = -0.6473;\n",
+ "rbyro = 0.880;\n",
+ "\n",
+ "# Calculations\n",
+ "UzbyUzmax = 1+a1*(rbyro**2)+a2*(rbyro**(2*m));\n",
+ "Uz = Uzmax*(UzbyUzmax);\n",
+ "Uzavg = (4./9)*Uzmax+(5./18)*(Uz+Uz);\n",
+ "\n",
+ "# Results\n",
+ "print \" the average velocity is Uzavg = %.2f ft/sec \\\n",
+ "\\n Thus, in this Example there is an inherent error of 5.5 percent, even before any experimental errors are introduced\"%(Uzavg);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the average velocity is Uzavg = 2.93 ft/sec \n",
+ " Thus, in this Example there is an inherent error of 5.5 percent, even before any experimental errors are introduced\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch11.ipynb b/Transport_Phenomena/ch11.ipynb
new file mode 100644
index 00000000..dff34285
--- /dev/null
+++ b/Transport_Phenomena/ch11.ipynb
@@ -0,0 +1,614 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 : Heat and mass transfer in duct flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1 - Page No :497\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compute and plot the temperature profile.\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "K_drywall = 0.28; \t\t\t #[Btu/ft*degF] - thermal conductivity of dry wall\n",
+ "K_fibreglass = 0.024; \t\t #[Btu/ft*degF] - thermal conductivity of fibre glass\n",
+ "K_concrete = 0.5; \t\t\t #[Btu/ft*degF] - thermal conductivity of concrete\n",
+ "T4 = 0.; \t\t #[degF]\n",
+ "T1 = 65.; \t\t\t #[degF]\n",
+ "deltaT = T4-T1; \t \t #[degF]\n",
+ "a = 1.; \t\t #[ft**2] - assuming area of 1 ft**2\n",
+ "deltax1 = 0.5/12; \t\t\t #[ft]\n",
+ "deltax2 = 3.625/12; \t\t #[ft]\n",
+ "deltax3 = 6./12; \t\t\t #[ft]\n",
+ "\n",
+ "# Calculations\n",
+ "R1 = deltax1/(K_drywall*a); \t\t\t #[h*degF/Btu]\n",
+ "R2 = deltax2/(K_fibreglass*a); \t\t\t #[h*degF/Btu]\n",
+ "R3 = deltax3/(K_concrete*a); \t \t\t #[h*degF/Btu]\n",
+ "qx = deltaT/(R1+R2+R3);\n",
+ "q12 = -qx;\n",
+ "q23 = -qx;\n",
+ "q34 = -qx;\n",
+ "deltaT1 = (-q12)*deltax1*(1./(K_drywall*a));\n",
+ "T2 = T1+deltaT1;\n",
+ "deltaT2 = (-q23)*deltax2*(1./(K_fibreglass*a));\n",
+ "T3 = T2+deltaT2;\n",
+ "deltaT3 = (-q34)*deltax3*(1./(K_concrete*a));\n",
+ "T4 = T3+deltaT3;\n",
+ "\n",
+ "# Results\n",
+ "print \" T1 = %.0f F \\\n",
+ "\\n T2 = %.1f F \\\n",
+ "\\n delta T2 = %.2f deg F \\\n",
+ "\\n T3 = %.2f F \\\n",
+ "\\n delta T3 = %.2f deg F \\\n",
+ "\\n T4 = %.0f F\"%(T1,T2,deltaT2,T3,deltaT3,T4);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " T1 = 65 F \n",
+ " T2 = 64.3 F \n",
+ " delta T2 = -59.56 deg F \n",
+ " T3 = 4.73 F \n",
+ " delta T3 = -4.73 deg F \n",
+ " T4 = 0 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2 - Page No :501\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the heat loss and compute the temperature at the steel-magnesia interface.\n",
+ "\n",
+ "# Variables\n",
+ "r1 = (2.067/2.)/(12); \t\t #[ft]\n",
+ "r2 = r1+0.154/12; \t\t\t #[ft]\n",
+ "r3 = r2+3/12.; \t\t\t #[ft]\n",
+ "L = 1.; \t\t\t #[ft]\n",
+ "Ka = 26.; \t\t\t #[Btu/h*ft*degF]\n",
+ "Kb = 0.04; \t\t #[Btu/h*ft*degF]\n",
+ "T1 = 50.; \t\t\t #[degF]\n",
+ "\n",
+ "# Calculations\n",
+ "Ra = (math.log(r2/r1))/(2*math.pi*L*Ka);\n",
+ "Rb = (math.log(r3/r2))/(2*math.pi*L*Kb);\n",
+ "R = Ra+Rb;\n",
+ "deltaT = -18; \t\t\t #[degF] - driving force\n",
+ "Qr = -(deltaT/(R));\n",
+ "deltaT1 = (-Qr)*(Ra);\n",
+ "T2 = T1+deltaT1;\n",
+ "\n",
+ "# Results\n",
+ "print \" Qr = %.3f\"%Qr;\n",
+ "print \" The interface temperature is T2 = %.3f degF\"%(T2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Qr = 3.589\n",
+ " The interface temperature is T2 = 49.997 degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.3 - Page No :502\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the heat loss for 500 ft of pipe\n",
+ "\n",
+ "# Variables\n",
+ "Ra = 8.502*10**-4; \t\t\t #[h*degF*Btu**-1]\n",
+ "Rb = 5.014; \t\t \t #[h*degF*Btu**-1]\n",
+ "r1 = (2.067/2)/(12.); \t\t\t #[ft]\n",
+ "r2 = r1+0.154/12.; \t\t\t #[ft]\n",
+ "r3 = r2+3/12.; \t\t\t #[ft]\n",
+ "d1 = 2.*r1;\n",
+ "d0 = 2.*r3;\n",
+ "h0 = 25.; \t \t\t #[Btu/h*ft**2*degF]\n",
+ "h1 = 840.; \t\t\t #[Btu/h*ft**2*degF]\n",
+ "L = 1.; \t\t\t #[ft] - considering 1 feet length\n",
+ "\n",
+ "# Calculations\n",
+ "R0 = 1./(h0*math.pi*d0*L);\n",
+ "R1 = 1./(h1*math.pi*d1*L);\n",
+ "R = R0+R1+Ra+Rb;\n",
+ "deltaT = -400; \t\t\t #[degF]\n",
+ "Qr = -(deltaT)/R;\n",
+ "# the heat loss calculated above is the heat loss per foot.therefore for 500 ft\n",
+ "L = 500.;\n",
+ "Qr = Qr*L;\n",
+ "\n",
+ "# Results\n",
+ "print \" the heat loss for a 500 feet pipe is qr = %.2e Btu/h\"%(Qr);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the heat loss for a 500 feet pipe is qr = 3.97e+04 Btu/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.5 - Page No :521\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the heat transfer coefficient\n",
+ "\n",
+ "# Variables\n",
+ "Nre = 50000.;\n",
+ "d = 0.04; \t\t\t #[m] - diameter of pipe\n",
+ "\n",
+ "# physical properties of water\n",
+ "T1 = 293.15; \t\t\t #[K]\n",
+ "T2 = 303.15; \t\t\t #[K]\n",
+ "T3 = 313.15; \t\t\t #[K]\n",
+ "p1 = 999.; \t\t\t #[kg/m**3] - density of water at temperature T1\n",
+ "p2 = 996.0; \t\t\t #[kg/m**3] - density of water at temperature T2\n",
+ "p3 = 992.1; \t\t\t #[kg/m**3] - density of water at temperature T3\n",
+ "mu1 = 1.001; \t\t\t #[cP] - viscosity of water at temperature T1\n",
+ "mu2 = 0.800; \t\t\t #[cP] - viscosity of water at temperature T2\n",
+ "mu3 = 0.654; \t\t\t #[cP] - viscosity of water at temperature T3\n",
+ "k1 = 0.63; \t\t\t #[W/m*K] - thermal conductivity of water at temperature T1\n",
+ "k2 = 0.618; \t\t\t #[W/m*K] - thermal conductivity of water at temperature T2\n",
+ "k3 = 0.632; \t\t\t #[W/m*K] - thermal conductivity of water at temperature T3\n",
+ "cp1 = 4182.; \t\t\t #[J/kg*K] - heat capacity of water at temperature T1\n",
+ "cp2 = 4178.; \t\t\t #[J/kg*K] - heat capacity of water at temperature T2\n",
+ "cp3 = 4179.; \t\t\t #[J/kg*K] - heat capacity of water at temperature T3\n",
+ "Npr1 = 6.94; \t\t\t # prandtl no. at temperature T1\n",
+ "Npr2 = 5.41; \t\t\t # prandtl no. at temperature T2\n",
+ "Npr3 = 4.32; \t\t\t # prandtl no. at temperature T3\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "# (a) Dittus -Boelter-this correction evalutes all properties at the mean bulk temperature,which is T1\n",
+ "kmb = 0.603\n",
+ "h = (kmb/d)*0.023*((Nre)**(0.8))*((Npr1)**0.4);\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \" a) Dittus -Boelter the heat transfer coefficient is \\nh = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
+ "\n",
+ "# (b) Seid_er Tate-this correlation evaluates all the properties save muw at the mean bulk temperature \n",
+ "h = (kmb/d)*(0.027)*((Nre)**0.8)*((Npr1)**(1./3))*((mu1/mu3)**0.14);\n",
+ "print \" b) Seid_er Tate the heat transfer coefficient is \\nh = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
+ "\n",
+ "# (c) Sleicher-Rouse equation\n",
+ "a = 0.88-(0.24/(4+Npr3));\n",
+ "b = (1./3)+0.5*math.exp((-0.6)*Npr3);\n",
+ "Nref = Nre*(mu1/mu2)*(p2/p1);\n",
+ "Nnu = 5+0.015*((Nref)**a)*((Npr3)**b);\n",
+ "h = Nnu*(kmb/d);\n",
+ "print \" c) Sleicher-Rouse equation the heat transfer coefficient is \\nh = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
+ "\n",
+ "# (d) Colbum Analogy- the j factor for heat transfer is calculated\n",
+ "jh = 0.023*((Nref)**(-0.2));\n",
+ "Nst = jh*((Npr2)**(-2./3));\n",
+ "U = (Nre*mu1*10**-3)/(d*p1);\n",
+ "h = Nst*(p1*cp1*U);\n",
+ "print \" d) Colbum Analogy the heat transfer coefficient is \\nh \\\n",
+ " = %.0f W/m**2*K = %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
+ "\n",
+ "# (e) Friend-Metzner\n",
+ "f = 0.005227;\n",
+ "Nnu = ((Nre)*(Npr1)*(f/2.)*((mu1/mu3)**0.14))/(1.20+((11.8)*((f/2)**(1./2))*(Npr1-1)*((Npr1)**(-1./3))));\n",
+ "h = Nnu*(kmb/d);\n",
+ "print \" e) Friend-Metzner the heat transfer coefficient is \\nh = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
+ "\n",
+ "# (f) Numerical analysis\n",
+ "Nnu = 320.;\n",
+ "h = Nnu*(kmb/d);\n",
+ "print \" f) Numerical analysis the heat transfer coefficient is \\nh = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a) Dittus -Boelter the heat transfer coefficient is \n",
+ "h = 4322 W/m**2*K = 761 Btu/ft**2*h**-1*degF\n",
+ " b) Seid_er Tate the heat transfer coefficient is \n",
+ "h = 4733 W/m**2*K = 834 Btu/ft**2*h**-1*degF\n",
+ " c) Sleicher-Rouse equation the heat transfer coefficient is \n",
+ "h = 4766 W/m**2*K = 839 Btu/ft**2*h**-1*degF\n",
+ " d) Colbum Analogy the heat transfer coefficient is \n",
+ "h = 4292 W/m**2*K = 756 Btu/ft**2*h**-1*degF\n",
+ " e) Friend-Metzner the heat transfer coefficient is \n",
+ "h = 4713 W/m**2*K = 830 Btu/ft**2*h**-1*degF\n",
+ " f) Numerical analysis the heat transfer coefficient is \n",
+ "h = 4824 W/m**2*K = 850 Btu/ft**2*h**-1*degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.6 - Page No :525\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the Nusselt number if the fluid temperature is 640 K and the wall temperature is 680 K.\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "Tw = 680.; \t\t\t #[K] - temperature at the wall\n",
+ "Tb = 640.; \t\t\t #[K] - temperature at the bulk\n",
+ "Tf = (Tw+Tb)/2; \t\t\t #[K]\n",
+ "Nre = 50000.;\n",
+ "vmb = 2.88*10.**-7;\n",
+ "vf = 2.84*10.**-7;\n",
+ "Nref = Nre*(vmb/vf);\n",
+ "k = 27.48;\n",
+ "d = 0.04;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# from table 11.3 the prandtl no. is\n",
+ "Npr = 8.74*10**-3\n",
+ "\n",
+ "# consmath.tant heat flow\n",
+ "Nnu = 6.3+(0.0167)*((Nref)**0.85)*((Npr)**0.93);\n",
+ "h = Nnu*(k/d);\n",
+ "print \" constant heat flow h = %.0f W/m**2*K = %.0f Btu/ft**2*h*degF\"%(h,round(h*0.17611,-1));\n",
+ "\n",
+ "# constant wall temperature\n",
+ "Nnu = 4.8+0.0156*((Nref)**0.85)*((Npr)**0.93);\n",
+ "h = Nnu*(k/d);\n",
+ "print \" constant wall temperature h = %d W/m**2*K = %d Btu/ft**2*h*degF\"%(h,h*0.17611);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " constant heat flow h = 5723 W/m**2*K = 1010 Btu/ft**2*h*degF\n",
+ " constant wall temperature h = 4600 W/m**2*K = 810 Btu/ft**2*h*degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.7 - Page No :536\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate \n",
+ "(a) the duty of the exchanger, \n",
+ "(b) the number of pounds per hour of steam required, and \n",
+ "(c) the length of a double-pipe heat exchanger to perform this task.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "di = 0.620; \t\t\t #[inch] - internal diameter\n",
+ "d0 = 0.750; \t\t\t #[inch] - outer diameter\n",
+ "Ai = 0.1623; \t\t\t #[ft**2/ft]\n",
+ "Ao = 0.1963; \t\t\t #[ft**2/ft]\n",
+ "wc = 12*(471.3/0.9425); #[lb/h]\n",
+ "cp = 1.; \t\t\t #[Btu/lbm*degF] - heat capacity of water\n",
+ "Tco = 110.;\n",
+ "Tci = 50.;\n",
+ "\n",
+ "# Calculations\n",
+ "qtotal = wc*cp*(Tco-Tci);\n",
+ "deltaH_coldwater = 3.6*10**5;\n",
+ "deltaH_vapourization = 1179.7-269.59;\n",
+ "wh = deltaH_coldwater/deltaH_vapourization;\n",
+ "hi = 80.; \t\t\t #[Btu/h*ft**2*degF]\n",
+ "ho = 500.; \t\t\t #[Btu/h*ft**2*degF]\n",
+ "km = 26.; \t\t\t #[Btu/h*ft*degF]\n",
+ "Ui = 1./((1./hi)+((Ai*math.log(d0/di))/(2*math.pi*km))+(Ai/(Ao*ho)));\n",
+ "deltaT1 = 300-50.;\n",
+ "deltaT2 = 300-110.;\n",
+ "LMTD = (deltaT1-deltaT2)/(math.log(deltaT1/deltaT2));\n",
+ "A = qtotal/(Ui*LMTD);\n",
+ "L = A/Ai;\n",
+ "\n",
+ "# Results\n",
+ "print \"the length of the heat exchanger is L = %.2f ft\"%(L);\n",
+ "\n",
+ "# Answer is slightly different becasue of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the length of the heat exchanger is L = 145.53 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.8 - Page No :537\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# estimate the outlet temperature of the water.\n",
+ "\n",
+ "# Variables\n",
+ "L = 30.; \t\t\t #[ft] - length\n",
+ "Ai = 0.1623*L;\n",
+ "di = 0.620; \t\t\t #[inch] - internal diameter\n",
+ "d0 = 0.750; \t\t\t #[inch] - outer diameter\n",
+ "Ao = 0.1963*L; \t\t #[ft**2/ft]\n",
+ "wc = 12.*(471.3/0.9425);\n",
+ "cp = 1.; \t\t\t #[Btu/lbm*degF] - heat capacity of water\n",
+ "\n",
+ "# Calculations\n",
+ "deltaH_coldwater = 3.6*10**5;\n",
+ "deltaH_vapourization = 1179.7-269.59;\n",
+ "wh = deltaH_coldwater/deltaH_vapourization;\n",
+ "hi = 80.; \t\t\t #[Btu/h*ft**2*degF]\n",
+ "ho = 500.; \t\t #[Btu/h*ft**2*degF]\n",
+ "km = 26.; \t\t\t #[Btu/h*ft*degF]\n",
+ "Ui = 1./((1./hi)+(((Ai/L)*math.log(d0/di))/(2*math.pi*km))+(Ai/(Ao*ho)));\n",
+ "deltaT1 = 300-50.;\n",
+ "deltaT = deltaT1/(math.exp((Ui*Ai)/(wc*cp)));\n",
+ "Tsat = 300.;\n",
+ "Tc2 = Tsat-deltaT;\n",
+ "\n",
+ "# Results\n",
+ "print \" Therefore, the outlet temperature of the cold fluid_ is Tc2 = %.2f degF\"%(Tc2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Therefore, the outlet temperature of the cold fluid_ is Tc2 = 63.75 degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.9 - Page No :538\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Repeat Example 11.8 if the water side fouling factor is 0.002 h ft\u2019\u201cF Btu\u2019.\n",
+ "\n",
+ "# Variables\n",
+ "Ai = 4.869;\n",
+ "wc = 6000.;\n",
+ "cp = 1.;\n",
+ "Rf = 0.002;\n",
+ "Uclean = 69.685;\n",
+ "\n",
+ "# Calculations\n",
+ "Udirty = 1./(Rf+(1./Uclean));\n",
+ "deltaT1 = 300.-50;\n",
+ "deltaT2 = deltaT1/(math.exp((Udirty*Ai)/(wc*cp)));\n",
+ "Th2 = 300.;\n",
+ "Tc2 = Th2-deltaT2;\n",
+ "\n",
+ "# Results\n",
+ "print \" the outlet temperature is Tc2 = %.1f degF\"%(Tc2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the outlet temperature is Tc2 = 62.1 degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.10 - Page No :544\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the hydrocarbon flow rate and\n",
+ "the heat exchanger area for the following heat exchangers: (a) parallel double-\n",
+ "pipe; (b) counterflow double-pipe; (c) 1-2 shell-and-tube; and (d) 2-4 shell-tube.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "Ui = 325.; \t\t\t #[W/m**2*K] - overall heat transfer coefficient\n",
+ "Thi = 120.; \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
+ "Tho = 65.; \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
+ "Tci = 15.; \t\t\t #[degC] - inlet temperature of water\n",
+ "Tco = 50.; \t\t\t #[degC] - outlet temperture of water\n",
+ "cp = 4184.; \t\t\t #[J/kg*K] - heat capacity of water\n",
+ "ch = 4184.*0.45\t\t\t #[J/kg*K] - heat capacity of hydrocarbon\n",
+ "wc = 1.2; \t\t\t #[kg/sec] - mass flow rate of water\n",
+ "\n",
+ "# Calculation and Results\n",
+ "wh = ((wc*cp)*(Tco-Tci))/((ch)*(Thi-Tho));\n",
+ "qtotal = wc*cp*(Tco-Tci);\n",
+ "\n",
+ "# (a) - parallel double pipe\n",
+ "F = 1.;\n",
+ "Thi = 120.; \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
+ "Tho = 65.; \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
+ "Tci = 15.; \t\t\t #[degC] - inlet temperature of water\n",
+ "Tco = 50.; \t\t\t #[degC] - outlet temperture of water\n",
+ "deltaT1 = Thi-Tci;\n",
+ "deltaT2 = Tho-Tco;\n",
+ "LMTD = (deltaT2-deltaT1)/(math.log(deltaT2/deltaT1));\n",
+ "Ai = qtotal/((Ui*LMTD));\n",
+ "print \" a) parallel double pipe Ai = %.2f m**2\"%(Ai);\n",
+ "\n",
+ "# (b) - counter flow\n",
+ "F = 1.;\n",
+ "Thi = 120.; \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
+ "Tho = 65.; \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
+ "Tco = 15.; \t\t\t #[degC] - inlet temperature of water\n",
+ "Tci = 50.; \t\t\t #[degC] - outlet temperture of water\n",
+ "deltaT1 = Thi-Tci;\n",
+ "deltaT2 = Tho-Tco;\n",
+ "LMTD = (deltaT2-deltaT1)/(math.log(deltaT2/deltaT1));\n",
+ "Ai = qtotal/((Ui*LMTD));\n",
+ "print \" b) counter flow Ai = %.2f m**2\"%(Ai);\n",
+ "\n",
+ "# (c) - 1-2 shell and tube \n",
+ "Thi = 120.; \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
+ "Tho = 65.; \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
+ "Tci = 15.; \t\t\t #[degC] - inlet temperature of water\n",
+ "Tco = 50.; \t\t\t #[degC] - outlet temperture of water\n",
+ "Z = (Thi-Tho)/(Tco-Tci);\n",
+ "nh = (Tco-Tci)/(Thi-Tci);\n",
+ "deltaT1 = Thi-Tco;\n",
+ "deltaT2 = Tho-Tci;\n",
+ "F = 0.92;\n",
+ "LMTD = (F*(deltaT2-deltaT1))/(math.log(deltaT2/deltaT1));\n",
+ "Ai = qtotal/((Ui*LMTD));\n",
+ "print \" c) 1-2 shell and tube Ai = %.2f m**2\"%(Ai);\n",
+ "\n",
+ "# (d) - 2-4 shell and tube\n",
+ "Thi = 120.; \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
+ "Tho = 65.; \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
+ "Tci = 15.; \t\t\t #[degC] - inlet temperature of water\n",
+ "Tco = 50.; \t\t\t #[degC] - outlet temperture of water\n",
+ "Z = (Thi-Tho)/(Tco-Tci);\n",
+ "nh = (Tco-Tci)/(Thi-Tci);\n",
+ "F = 0.975;\n",
+ "LMTD = (F*(deltaT2-deltaT1))/(math.log(deltaT2/deltaT1));\n",
+ "Ai = qtotal/((Ui*LMTD));\n",
+ "print \" d) 2-4 shell and tube Ai = %.2f m**2\"%(Ai);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a) parallel double pipe Ai = 11.69 m**2\n",
+ " b) counter flow Ai = 9.10 m**2\n",
+ " c) 1-2 shell and tube Ai = 9.89 m**2\n",
+ " d) 2-4 shell and tube Ai = 9.33 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch12.ipynb b/Transport_Phenomena/ch12.ipynb
new file mode 100644
index 00000000..fc6fa80b
--- /dev/null
+++ b/Transport_Phenomena/ch12.ipynb
@@ -0,0 +1,713 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : Transport past immersed bodies"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.2 - Page No :562\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the boundary layer thickness and the local drag coefficient at the trailing \n",
+ "edge of the test section. Also estimate the force (drag) on the test section.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "p = 1.2047*0.06243; \t\t\t #[lb/ft**3]\n",
+ "mu = (18.17*10**-6)*(0.6720); \t #[lb/ft*sec]\n",
+ "v = mu/p;\n",
+ "x = 2.; \t\t\t #[ft]\n",
+ "U = 6.; \t\t\t #[ft/sec]\n",
+ "\n",
+ "# Calculation and Results\n",
+ "Nre = (x*U)/v;\n",
+ "print \"The Reynolds number is well within the laminar region %.3e Nre\"%Nre\n",
+ "del_ = 5*x*(Nre)**(-1./2);\n",
+ "C1 = 0.33206;\n",
+ "Cd = 2.*C1*(Nre)**(-1./2);\n",
+ "L2 = 2.; \t\t\t #[ft]\n",
+ "L1 = 1.; \t\t\t #[ft]\n",
+ "b = 1.;\n",
+ "F = ((2*(C1)*U*b))*((mu*p*U)**(1./2))*(((L2)**(1./2))-((L1)**(1./2)));\n",
+ "gc = 32.174;\n",
+ "F = F/gc;\n",
+ "print \" The value of F properly expressed in force units is F = %.3e lbf\"%(F);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Reynolds number is well within the laminar region 7.391e+04 Nre\n",
+ " The value of F properly expressed in force units is F = 1.204e-04 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.3 - Page No :569\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "calculate the shear stress\n",
+ "at the wall (in units of N m-*) at a distance of 1 m from the leading edge of the plate.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "U = 3.; \t\t\t #[m/sec]\n",
+ "x1 = 1.; \t\t\t #[m]\n",
+ "x2 = 2.; \t\t\t #[m]\n",
+ "\n",
+ "# Calculations\n",
+ "p = 1./(1.001*10**-3); \t\t\t #[kg/m**3];\n",
+ "mu = 1.*10**-3; \t\t\t #[kg/m*sec]\n",
+ "Nre1 = (x1*U*p)/(mu);\n",
+ "Nre2 = (x2*p*U)/(mu);\n",
+ "tauw = (1./2)*(p*(U**2))*((2*math.log10(Nre1)-0.65)**(-2.3));\n",
+ "B = 1700.;\n",
+ "Cd = (0.455*(math.log10(Nre2))**-2.58)-(B/(Nre2));\n",
+ "Lb = 2.0;\n",
+ "F = (1./2)*(p*(U**2))*(Lb)*(Cd);\n",
+ "\n",
+ "Xc = round((5*10**5 * mu)/(U*p),3)\n",
+ "CDlaminar = round(4*.33206*(5*10**5)**(-1./2),5)\n",
+ "Flaminar= round(1./2*(p*U**2)*Xc*CDlaminar,3)\n",
+ "Cd = round(.455*((math.log10(Nre2))**-2.58),6)\n",
+ "Fturbulent1 = round(1./2*(p*U**2)*x2*Cd,2)\n",
+ "Fturbulent2 = round(1./2*(p*U**2)*Xc*.005106,3)\n",
+ "Factual = 1.411 + Fturbulent1 - Fturbulent2\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \" the drag on the plate is F = %f kg*m/sec**2 = %.1f N\"%(F,F);\n",
+ "print ' total drag on the plate Factual = %.2f N'%Factual\n",
+ "print \" the shear stress is %.f N/m^2\"%tauw\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the drag on the plate is F = 26.801111 kg*m/sec**2 = 26.8 N\n",
+ " total drag on the plate Factual = 26.93 N\n",
+ " the shear stress is 14 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.5 - Page No :576\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find (a) the length of the laminar boundary layer, (b) the thickness of the\n",
+ "momentum boundary layer and the thermal boundary layer at the transition\n",
+ "point, (c) the local heat transfer coefficient at the transition point, and (d) the\n",
+ "mean heat transfer coefficient between the leading edge of the plate and the\n",
+ "transition point.\n",
+ "'''\n",
+ "\n",
+ "# Variables \n",
+ "T = 290.; \t\t\t #[K] - temperature of flowing water\n",
+ "U = 3.; \t\t\t #[m/sec] - free stream velocity\n",
+ "Tfs = 285.; \t\t\t #[K] - temperature of free stream\n",
+ "vr = 10.**-3; \t\t\t #[m**3/kg] - volume per unit mass\n",
+ "p = 1./vr; \t\t\t #[kg/m**3] - density of water at Tfs\n",
+ "mu = 1225.*10**-6; \t #[N*sec/m**2]\n",
+ "k = 0.590; \t\t\t #[W/m*K]\n",
+ "Npr = 8.70;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# (a) The length of laminar boundary\n",
+ "Nre = 5.*10**5;\n",
+ "xc = (Nre)*(mu/(p*U));\n",
+ "print \" a) The length of laminar boundary is xc = %.4f m\"%(xc);\n",
+ "# (b) Thickness of the momentum boundary layer and thermal boundary layer\n",
+ "del_ = 5*xc*((Nre)**(-1./2));\n",
+ "del_h = del_*((Npr)**(-1./3));\n",
+ "print \" b) The thickness of momentum boundary layer is del_ = %.3e m \\n The \\\n",
+ " thickness of the hydryodynamic layer is del_h = %.3e m\"%(del_,del_h);\n",
+ "\n",
+ "# (c) Local heat transfer coefficient\n",
+ "x = 0.2042; \t\t\t #[ft]\n",
+ "hx = ((0.33206*k)/(x))*((Nre)**(1./2))*((Npr)**(1./3));\n",
+ "print \" c) The local heat transfer coefficient is h = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/hr*ft**2*degF\"%(hx,hx*0.17611);\n",
+ "\n",
+ "# (d) Mean heat transfer coefficient\n",
+ "hm = 2*hx;\n",
+ "print \" d) The mean heat transfer coefficient is h = %.0f W/m**2*K \\\n",
+ " = %.0f Btu/hr*ft**2*degF\"%(hm,round(hm*0.17611,1));\n",
+ "\n",
+ "# Answer may vary because of rounding error.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a) The length of laminar boundary is xc = 0.2042 m\n",
+ " b) The thickness of momentum boundary layer is del_ = 1.444e-03 m \n",
+ " The thickness of the hydryodynamic layer is del_h = 7.019e-04 m\n",
+ " c) The local heat transfer coefficient is h = 1395 W/m**2*K = 246 Btu/hr*ft**2*degF\n",
+ " d) The mean heat transfer coefficient is h = 2791 W/m**2*K = 492 Btu/hr*ft**2*degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.10 - Page No :590\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the terminal velocity and drag force when a spherical water\n",
+ "drop, 5 pm in diameter, falls through air at 20\u00b0C. Let g = 9.80 m s-\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 293.15; \t\t\t #[K]\n",
+ "pp = 999.; \t\t\t #[kg/m**3] - density of water\n",
+ "mu = 0.01817*10**-3; \t #[kg/m*sec] - viscosity of air\n",
+ "p = 1.205; \t\t\t #[kg/m**3] - density of air\n",
+ "d = 5*10**-6; \t\t\t #[m] - particle diameter\n",
+ "g = 9.80; \t\t\t #[m/sec**2]\n",
+ "\n",
+ "# Calculations\n",
+ "rp = d/2;\n",
+ "Ut = ((2*g*(rp**2))*(pp-p))/(9*mu);\n",
+ "Nre = (d*Ut*p)/(mu);\n",
+ "Fp = 6*math.pi*mu*rp*Ut;\n",
+ "\n",
+ "# Results\n",
+ "print \" The drag force is Fp = %.2e N\"%(Fp);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The drag force is Fp = 6.40e-13 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.11 - Page No :591\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the time for the drop of water in Example 12.10 to\n",
+ "accelerate from an initial velocity of zero to 0.9!XJ,.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 293.15; \t\t\t #[K]\n",
+ "pp = 999.; \t\t\t #[kg/m**3] - density of water\n",
+ "mu = 0.01817*10**-3; \t #[kg/m*sec] - viscosity of air\n",
+ "p = 1.205; \t\t\t #[kg/m**3] - density of air\n",
+ "d = 5*10**-6; \t\t\t #[m] - particle diameter\n",
+ "g = 9.80; \t\t\t #[m/sec**2]\n",
+ "\n",
+ "# Calculations\n",
+ "rp = d/2;\n",
+ "Ut = ((2*g*(rp**2))*(pp-p))/(9*mu);\n",
+ "Nre = (d*Ut*p)/(mu);\n",
+ "t = ((-2*(rp**2)*pp))/(9*mu)*(math.log(1-0.99));\n",
+ "\n",
+ "# Results\n",
+ "print \" Time for the drop of water in previous Example from an initial \\\n",
+ " velocity of zero to 0.99*Ut is \\n t = %.3e sec\"%(t);\n",
+ "print \" In other words, the drop accelerates almost instantaneously to its terminal velocity\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Time for the drop of water in previous Example from an initial velocity of zero to 0.99*Ut is \n",
+ " t = 3.517e-04 sec\n",
+ " In other words, the drop accelerates almost instantaneously to its terminal velocity\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.12 - Page No : 594\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine its terminal velocity.\n",
+ "\n",
+ "# Variables\n",
+ "pp = 1.13*10**4; \t\t\t #[kg/m**3] - density of lead particle\n",
+ "p = 1.22; \t\t\t #[kg/m**3] - density of air\n",
+ "g = 9.80; \t\t\t #[m/sec**2] - acceleration due to gravity\n",
+ "d = 2*10**-3; \t\t\t #[m] - diameter of particle\n",
+ "mu = 1.81*10**-5; \t\t\t #[kg/m*sec] - viscosity of air\n",
+ "\n",
+ "# Calculations\n",
+ "# let us assume\n",
+ "Cd = 0.44;\n",
+ "Ut = ((4*d*g*(pp-p))/(3*p*Cd))**(1./2);\n",
+ "Nre = (Ut*d*p)/(mu);\n",
+ "\n",
+ "# from fig 12,16 value of Cd is\n",
+ "Cd = 0.4;\n",
+ "Ut = ((4*d*g*(pp-p))/(3*p*Cd))**(1./2);\n",
+ "Nre = (Ut*d*p)/(mu);\n",
+ "\n",
+ "# Results\n",
+ "# Within the readibility of the chart Cd is unchanged and therefore the above obtained Cd is the final answer\n",
+ "\n",
+ "print \" The terminal velocity is Ut = %.2f m/sec\"%(Ut);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The terminal velocity is Ut = 24.60 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.13 - Page No :595\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Determine the appropriate diameter of the sphere to achieve\n",
+ "the design criteria, if g = 32 ft s-*.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "distance = 1./12; \t #[ft]\n",
+ "time = 60.; \t\t #[sec]\n",
+ "Ut = distance/time;\n",
+ "mu = 1.68; \t\t #[lb/ft*sec] - viscosity \n",
+ "pp = 58.; \t\t\t #[lb/ft**3] - density of sphere\n",
+ "p = 50.; \t\t\t #[lb/ft**3] - density of polymer solution\n",
+ "g = 32.; \t\t\t #[ft/sec] - acceleration due to gravity\n",
+ "\n",
+ "# Calculations\n",
+ "rp = ((9*mu)*(Ut)*((2*g)**(-1))*((pp-p)**(-1)))**(1./2);\n",
+ "Nre = (rp*2*Ut*p)/(mu);\n",
+ "\n",
+ "# Results\n",
+ "print \" The required particle diameter would be about %.2f inch\"%(rp*2*12);\n",
+ "print \"Nre = %.2e\"%Nre\n",
+ "print \" This reynolds number is well within the stokes law region ; thus the design is reasonable\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The required particle diameter would be about 0.15 inch\n",
+ "Nre = 5.29e-04\n",
+ " This reynolds number is well within the stokes law region ; thus the design is reasonable\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.14 - Page No :616\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Compute (a) the static void fraction, (b) the minimum void fraction and\n",
+ "bed height for fluidization, (c) the settling velocity for a single particle in a static\n",
+ "fluid, (d) the minimum pressure drop for fluidization, (e) the minimum velocity\n",
+ "for entrainment, and (f) the heat transfer coefficient at the wall for a superficial\n",
+ "velocity 2.5 times U,,.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 842.; \t\t\t #[degF] - temperature\n",
+ "P = 14.6; \t\t\t #[psia] - pressure\n",
+ "p = 0.487; \t\t #[kg/m**3] - density of air\n",
+ "mu = 3.431*10**-5; \t #[kg/m*sec] - viscosity of air\n",
+ "k = 0.05379; \t\t\t #[W/m*K] - thermal conductivity\n",
+ "Npr = 0.7025; \t\t\t #prandtl no.\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# (a) static void_ fraction\n",
+ "mcoal = 15.*2000; \t #[lb] - mass of coal\n",
+ "pcoal = 94.; \t\t #[lbm/ft**3] - density of coal\n",
+ "d = 10.; \t\t\t #[ft]\n",
+ "L = 7.; \t\t\t #[ft]\n",
+ "area = ((math.pi*(d**2))/4);\n",
+ "Vcoal = mcoal/pcoal;\n",
+ "Vtotal = area*L;\n",
+ "e = (Vtotal-Vcoal)/(Vtotal);\n",
+ "print \"(a) The void_ fraction is E = %.2f\"%e\n",
+ "\n",
+ "# (b) minimum void_ fraction and bed height\n",
+ "d = 200.; \t\t\t #[um] - particle diameter\n",
+ "Emf = 1-0.356*((math.log10(d))-1);\n",
+ "\n",
+ "# this value seems to be a lottle low and therefore 0.58 will be used\n",
+ "Emf = 0.58;\n",
+ "Lmf = ((L)*(1-e))/(1-Emf);\n",
+ "print \" b) The bed height is Lmf = %.3f ft\"%(Lmf);\n",
+ "\n",
+ "# (c) Minimum fluid_ization velocity\n",
+ "P1 = 20.; \t\t\t #[psia]\n",
+ "P2 = 14.696; \t\t\t #[psia]\n",
+ "p1 = (p*P1)/(P2);\n",
+ "\n",
+ "# the archimid_es no. is\n",
+ "g = 9.78; \t\t\t #[m/sec**2]\n",
+ "Nar = p1*g*((d*10**-6)**3)*(1506-p1)*((1./(mu)**2));\n",
+ "C1 = 27.2;\n",
+ "C2 = 0.0408;\n",
+ "Nremf = (((C1**2)+C2*Nar)**(1./2))-C1;\n",
+ "Umf = (Nremf*mu)/((d*10**-6)*p1);\n",
+ "print \" c) The minimum fluid_ization velocity is Umf = %.4f %% m/sec\"%(Umf);\n",
+ "\n",
+ "# (d) Minimum pressure\n",
+ "del_tapmf = (1506-p1)*(g)*(1-Emf)*((Lmf*12*2.54)/(100))+p1*g*Lmf;\n",
+ "print \" d) The minimum pressure drop for fluid_ization is -del_tapmf = %.3e Pa\"%(del_tapmf);\n",
+ "\n",
+ "# (e) Particle settling velocity\n",
+ "Cd = 0.44;\n",
+ "Ut = (((8*((d*10**-6)/2)*g)*(1506-p1))/(3*p1*Cd))**(1./2);\n",
+ "Nrep = (Ut*d*10**-6*p1)/(mu);\n",
+ "print \"Nrep = %.2f\"%Nrep\n",
+ "Ut = ((5.923/18.5)*(((d*10**-6)*p1)/(mu))**(0.6))**(1./(2-0.6))\n",
+ "print \" e) The particle settling velocity is Ut = %.5f m/sec\"%(Ut);\n",
+ "\n",
+ "# (f) Bed to wall heat transfer coefficient\n",
+ "Nrefb = (d*10**-6)*2.5*Umf*p1*(1./mu);\n",
+ "Nnufb = 0.6*Npr*((Nrefb)**(0.3));\n",
+ "hw = Nnufb*(k/(d*10**-6));\n",
+ "print \" f) The bed to wall heat transfer coefficient is hw = %.1f W/m**2*K\"%(hw);\n",
+ "\n",
+ "# Answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The void_ fraction is E = 0.42\n",
+ " b) The bed height is Lmf = 9.675 ft\n",
+ " c) The minimum fluid_ization velocity is Umf = 0.0129 % m/sec\n",
+ " d) The minimum pressure drop for fluid_ization is -del_tapmf = 1.830e+04 Pa\n",
+ "Nrep = 14.18\n",
+ " e) The particle settling velocity is Ut = 0.79114 m/sec\n",
+ " f) The bed to wall heat transfer coefficient is hw = 60.6 W/m**2*K\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.15 - Page No :618\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the\n",
+ "pressure drop in psi and the superficial velocity (ft s-l) at the point of incipient\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "pp = 249.6; \t\t #[lb/ft**3] - density of catalyst\n",
+ "p = 58.; \t\t\t #[lb/ft**3] - density of liquid\n",
+ "g = 32.174; \t\t #[ft/sec**2]\n",
+ "gc = 32.174;\n",
+ "Lmf = 5.; \t\t\t #[ft] - height of bed\n",
+ "mu = 6.72*10**-3; \t #[lbm/ft*sec] - viscosity of liquid\n",
+ "dp = 0.0157/12; \t #[ft] - diameter of particle\n",
+ "emf = 0.45;\n",
+ "\n",
+ "# Calculations\n",
+ "del_tapmf = (pp-p)*(g/gc)*(1-emf)*(Lmf);\n",
+ "Nar = (p*g*dp**3)*(pp-p)*(1./(mu)**2);\n",
+ "C1 = 27.2;\n",
+ "C2 = 0.0408;\n",
+ "Nremf = (((C1**2)+C2*Nar)**(1./2))-C1;\n",
+ "Umf = Nremf*(mu/(dp*p));\n",
+ "\n",
+ "# Results\n",
+ "print \" Minimum fluidization velocity is Umf = %.2e ft/sec\"%(Umf);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Minimum fluidization velocity is Umf = 1.18e-03 ft/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.16 - Page No :624\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# estimate the velocity in m s-i.\n",
+ "\n",
+ "# Variables\n",
+ "d = 24.*10**-6; \t\t\t #[m] - diameter of wire\n",
+ "T = 415.; \t\t\t #[K] - operating temperature of hot wire anemometer\n",
+ "P = 0.1; \t\t\t #[W] - power consumption\n",
+ "L = 250.*d;\n",
+ "Tair = 385.; \t\t\t #[K] - temperature of air in duct\n",
+ "A = math.pi*d*L;\n",
+ "Tfilm = (T+Tair)/2.;\n",
+ "\n",
+ "# properties of air at Tfilm\n",
+ "p = 0.8825; \t\t\t #[kg/m**3]\n",
+ "mu = 2.294*10**-5; \t\t\t #[kg/m*s]\n",
+ "cpf = 1013.; \t\t\t #[J*kg/K]\n",
+ "kf = 0.03305; \t\t\t #[W/m*K]\n",
+ "Npr = 0.703;\n",
+ "\n",
+ "# Calculations\n",
+ "h = P/(A*(T-Tair));\n",
+ "Nnu = (h*d)/kf;\n",
+ "def func(x):\n",
+ " return Nnu-0.3-((0.62*(x**(1./2))*(Npr**(1./3)))/((1+((0.4/Npr)**(2./3)))**(1./4)))*((1+((x/(2.82*(10**5)))**(5./8)))**(4./5));\n",
+ "\n",
+ "# on solving the above function for x by umath.sing some root solver technique like Newton raphson method , we get\n",
+ "x = 107.7;\n",
+ "\t\t\t # or\n",
+ "Nre = 107.7;\n",
+ "y = func(x);\n",
+ "Um = (Nre*mu)/(d*p);\n",
+ "\n",
+ "# Results\n",
+ "print \" The velocity is Um = %.1f m/sec = %d ft/sec\"%(Um,Um*3.28);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The velocity is Um = 116.6 m/sec = 382 ft/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 12.17 - Page No :630\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the exit temperature of the air if its properties can be estimated from the following correlations\n",
+ "\n",
+ "# Variables\n",
+ "dt = 0.75;\n",
+ "St = 1.5*dt;\n",
+ "Sl = 3.*dt;\n",
+ "Lw = 1.; \t\t\t #[m]\n",
+ "N = 12.;\n",
+ "Stotalarea = N*(St/12.)*Lw;\n",
+ "Sminarea = N*((St-dt)/12.)*Lw*0.3048;\n",
+ "\n",
+ "# properties of air at 293.15 K\n",
+ "p = 1.204; \t\t\t #[kg/m**3]\n",
+ "mu = 1.818*10**-5; \t #[kg/m*s]\n",
+ "cp = 1005.; \t\t\t #[J*kg/K];\n",
+ "k = 0.02560; \t\t\t #[J/s*m*K]\n",
+ "Npr = (cp*mu)/k;\n",
+ "U_inf = 7.; \t\t\t #[m/sec]\n",
+ "\n",
+ "# Calculations\n",
+ "Umax = U_inf*(St/(St-dt));\n",
+ "w = p*Umax*Sminarea;\n",
+ "C_tubes = 0.05983; \t\t\t #[m**2/m] - circumference of the tubes\n",
+ "N_tubes = 96.;\n",
+ "Atubes = N_tubes*C_tubes*Lw;\n",
+ "Tw = 328.15; \t\t\t #[K]\n",
+ "Tinf = 293.15; \t\t\t #[K]\n",
+ "Tin = 293.15; \t\t\t #[K]\n",
+ "Tout = 293.15; \t\t #[K]\n",
+ "u = 100.;\n",
+ "while u>10**-1:\n",
+ " T = (Tin+Tout)/2\n",
+ " Told = Tout;\n",
+ " p = -(0.208*(10**-3))+(353.044/T);\n",
+ " mu = -(9.810*(10**-6))+(1.6347*(10**-6)*(T**(1./2)));\n",
+ " cp = 989.85+(0.05*T);\n",
+ " k = 0.003975+7.378*(10**-5)*T;\n",
+ " Npr = (cp*mu)/k;\n",
+ " dt = 0.75*0.0254;\n",
+ " Gmax = w/Sminarea;\n",
+ " Nre = (dt*Gmax)/mu;\n",
+ " h = 0.27*(k/dt)*(Npr**0.36)*(Nre**0.63);\n",
+ " h = h*0.98;\n",
+ " del_taT = (h*Atubes*(Tw-Tinf))/(w*cp);\n",
+ " Tout = Tin+del_taT;\n",
+ " u = abs(Tout-Told);\n",
+ "\n",
+ "T = (Tin+Tout)/2\n",
+ "p = -(0.208*(10**-3))+(353.044/T);\n",
+ "mu = -(9.810*(10**-6))+(1.6347*(10**-6)*(T**(1./2)));\n",
+ "dt = 0.75;\n",
+ "dv = (4*(St*Sl-(math.pi*(dt**2)*(1./4))))/(math.pi*dt)*(0.09010/3.547);\n",
+ "de = dv;\n",
+ "Nre = (dv*24.72)/mu;\n",
+ "dv = dv/(0.09010/3.547);\n",
+ "ftb = 1.92*(Nre**(-0.145));\n",
+ "Zt = Sl;\n",
+ "Ltb = 8*Sl;\n",
+ "del_tap = (ftb*(24.72**2))/(2*p*(dv/Ltb)*((St/dv)**0.4)*((St/Zt)**0.6));\n",
+ "\n",
+ "# Results\n",
+ "print \" del_tap = %.0f kg/m*s = %.0f N/m**2 = %f psia\"%(del_tap,del_tap,round(del_tap*0.1614/1113,5))\n",
+ "print \" Exit temperature : %.2f K\"%T\n",
+ "# answer may slightly vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " del_tap = 1113 kg/m*s = 1113 N/m**2 = 0.161350 psia\n",
+ " Exit temperature : 299.87 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch13.ipynb b/Transport_Phenomena/ch13.ipynb
new file mode 100644
index 00000000..760170dd
--- /dev/null
+++ b/Transport_Phenomena/ch13.ipynb
@@ -0,0 +1,314 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Unsteady-state transport"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.1 - Page No :651\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the Biot number for: (a) a copper sphere\n",
+ "of radius 5 cm; (b) a copper cylinder of radius 5 cm and length 30 cm; and (c) a\n",
+ "square copper rod of length 40 cm and cross sectional area the same as the\n",
+ "cylinder of radius 5 cm.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "h = 12.; \t\t\t #[W/m**2*K] - heat transfer coefficeint\n",
+ "k = 400.; \t\t\t #[W/m*K] - thermal conductivity\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# (a) for sphere\n",
+ "r = 5.*10**-2; \t\t\t #[m] - radius of copper sphere\n",
+ "Lc = ((4*math.pi*((r)**3))/3)/(4*math.pi*((r)**2));\n",
+ "Nbi = h*Lc*(1./k);\n",
+ "print \" a) The biot no. is Nbi = %.0e\"%(Nbi);\n",
+ "\n",
+ "# (b) for cyclinder\n",
+ "r = 0.05; \t\t\t #[m] - radius of cyclinder\n",
+ "L = 0.3; \t\t\t #[m] - height of cyclinder\n",
+ "Lc = (math.pi*((r)**2)*L)/(2*math.pi*r*L);\n",
+ "Nbi = h*Lc*(1./k);\n",
+ "print \" b) The biot no. is Nbi = %.1e\"%(Nbi);\n",
+ "\n",
+ "# (c) for a long square rod\n",
+ "L = .4; \t\t\t #[m] - length of copper rod\n",
+ "r = 0.05; \t\t\t #[m] - radius of a cyclinder havimg same cross sectional area as that of square\n",
+ "x = ((math.pi*r**2)**(1./2));\n",
+ "Lc = ((x**2)*L)/(4*x*L);\n",
+ "Nbi = h*Lc*(1./k);\n",
+ "print \" c) The biot no. is Nbi = %.3e\"%(Nbi);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a) The biot no. is Nbi = 5e-04\n",
+ " b) The biot no. is Nbi = 7.5e-04\n",
+ " c) The biot no. is Nbi = 6.647e-04\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.6 - Page No :684\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the temperature at the center after\n",
+ "1.2s if the heat transfer coefficient is 20 W m-*K-l\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "d = 1*0.0254; \t\t #[m] banana diameter\n",
+ "Lr = d/2; \t\t\t #[m]; \n",
+ "Lz = (1.2/2)*(0.0254); \n",
+ "x = Lz;\n",
+ "r = Lr;\n",
+ "k = 0.481; # thermal conductivity\n",
+ "h = 20.; # heat coefficient\n",
+ "mr = k/(h*Lr);\n",
+ "mz = k/(h*Lz);\n",
+ "nr = r/Lr;\n",
+ "nz = x/Lz;\n",
+ "t = 1.2; \t\t\t #[sec]\n",
+ "\n",
+ "# Calculations\n",
+ "alpha = 1.454*10**-4;\n",
+ "Xr = (alpha*t)/(Lr**2);\n",
+ "Xz = (alpha*t)/(Lz**2);\n",
+ "\n",
+ "# using the above value of m,n,X the value for Ycz and Ycr from fig 13.14 is\n",
+ "Ycr = 0.42;\n",
+ "Ycz = 0.75;\n",
+ "Yc = Ycr*Ycz;\n",
+ "T_infinity = 400.; \t\t\t #[K]\n",
+ "To = 295.;\n",
+ "Tc = T_infinity-(Yc*(T_infinity-To));\n",
+ "\n",
+ "# Results\n",
+ "print \" The temperature t the centre is Tc = %.0f K\"%(Tc);\n",
+ "\n",
+ "\n",
+ "# Answer is vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The temperature t the centre is Tc = 367 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.7 - Page No :688\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Consider the agitation vessel in Example 13.5. Divide the\n",
+ "thickness into 10 increments and perform two iterations of the explicit method.\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "# Variables\n",
+ "# given\n",
+ "T_x0 = 300.; \t\t\t #[K]\n",
+ "Tw = 400.; \t\t\t #[K]\n",
+ "L = 0.013; \t\t\t #[m]\n",
+ "alpha = 2.476*(10**-5); \t\t\t #[m**/sec]\n",
+ "h = 600.; \t\t\t #[W/m**2*K]\n",
+ "pcp = 3.393*(10**6); \t\t\t #[J/m**3*K]\n",
+ "L = 0.013; \t\t\t #[m]\n",
+ "del_tax = L/10.;\n",
+ "betaa = 0.5;\n",
+ "del_tat = 0.03;\n",
+ "\n",
+ "# Calculations\n",
+ "del_tat = betaa*((del_tax)**2)*(1./alpha);\n",
+ "T_infinity = 400.; \t\t\t #[K]\n",
+ "\n",
+ "# to be sure that the solution is stable, it is customary to truncate this number\n",
+ "del_tat = 0.03; \t\t\t #[sec]\n",
+ "# betaa = alpha*del_tat*((1./del_tax)**2);\n",
+ "Told = zeros(11)\n",
+ "for i in range(11):\n",
+ " Told[i] = 300.;\n",
+ "\n",
+ "a = ((2*h*del_tat)/(pcp*del_tax));\n",
+ "b = ((2*alpha*del_tat)/(pcp*((del_tax)**2)));\n",
+ "\n",
+ "Tnew = zeros(11)\n",
+ "for j in range(11):\n",
+ " Tnew[0] = (T_infinity*0.08162)+(Told[0]*(1-0.08162-0.8791))+(Told[1]*0.8791)\n",
+ " for k in range(9):\n",
+ " Tnew[k+1] = (betaa*Told[k+2])+((1.-2*betaa)*(Told[k+1]))+(betaa*Told[k]);\n",
+ " Tnew[10] = ((2*betaa)*(Told[9]))\n",
+ " Told = Tnew;\n",
+ "# Results\n",
+ "print \"Told values : \" ,(Told);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Told values : [ 325.54820838 319.78194857 315.05971328 311.28295197 308.32959437\n",
+ " 306.07276601 304.39590474 303.20406441 302.43143939 302.04512688\n",
+ " 302.04512688]\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.9 - Page No :700\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the depth that corresponds to a\n",
+ "temperature of -5\u00b0C if it is assumed that the period of time is 4 months.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "p = 2050.; \t\t\t #[kg/m**3] - density of soil\n",
+ "cp = 1840.; \t\t\t #[J/kg*K] - heat cpapacity of soil\n",
+ "k = 0.52; \t\t\t #[W/m*K] - thermal conductivity of soil\n",
+ "alpha = 0.138*10**-6; \t\t\t #[m**2/sec]\n",
+ "t = 4*30*24*3600; \t\t\t #[sec] - no. of seconds in 4 months\n",
+ "Tx = -5.; \t\t\t #[degC]\n",
+ "Tinf = -20.; \t\t\t #[degC]\n",
+ "T0 = 20.; \t\t\t #[degC]\n",
+ "\n",
+ "# from the fig 13.24 the dimensionless dismath.tance Z is \n",
+ "Z = 0.46;\n",
+ "\n",
+ "# Calculations\n",
+ "# then the depth is\n",
+ "x = 2*((alpha*t)**(1./2))*Z\n",
+ "\n",
+ "# Results\n",
+ "print \" the depth is x = %.1f m = %.1f ft\"%(x,x*3.6/1.10);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the depth is x = 1.1 m = 3.6 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 13.10 - Page No :701\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the concentration of KC1 at the center after 60min.\n",
+ "\n",
+ "# Variables\n",
+ "d = 0.01; \t\t\t #[m] - diameter of cyclindrical porous plug\n",
+ "D = 2.*10**-9; \t\t\t #[m**2/sec] - diffusion coefficient\n",
+ "t = 60.*60; \t\t\t #[sec]\n",
+ "r = d/2.;\n",
+ "m = 0.;\n",
+ "Ca_inf = 0.;\n",
+ "Ca_0 = 10.;\n",
+ "X = (D*t)/((r)**2);\n",
+ "# from fig 13.14 the ordinate is\n",
+ "Y = 0.7;\n",
+ "\n",
+ "# Calculations\n",
+ "Ca_c = Ca_inf-Y*(Ca_inf-Ca_0);\n",
+ "\n",
+ "# Results\n",
+ "print \" the concentration of KCL at the centre after 60 min is Ca = %.2f kg/m**3\"%(Ca_c);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the concentration of KCL at the centre after 60 min is Ca = 7.00 kg/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch14.ipynb b/Transport_Phenomena/ch14.ipynb
new file mode 100644
index 00000000..942ef967
--- /dev/null
+++ b/Transport_Phenomena/ch14.ipynb
@@ -0,0 +1,620 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 : Estimation of transport coefficients"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.1 - Page No :726\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the viscosity of air at 40\u00b0C (313.15 K) and atmospheric pressure;\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "T = 40+273.15; \t\t\t #[K] - temperature\n",
+ "P = 1.; \t\t\t #[atm] - pressure\n",
+ "sigma = 3.711*10**-10; \t\t\t #[m]\n",
+ "etadivkb = 78.6; \t\t\t #[K]\n",
+ "A = 1.16145;\n",
+ "B = 0.14874;\n",
+ "C = 0.52487;\n",
+ "D = 0.77320;\n",
+ "E = 2.16178;\n",
+ "F = 2.43787;\n",
+ "Tstar = T/(etadivkb);\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula si = (A/(Tstar**B))+(C/math.exp(D*Tstar))+(E/math.exp(F*Tstar)\n",
+ "si = (A/(Tstar**B))+(C/math.exp(D*Tstar))+(E/math.exp(F*Tstar));\n",
+ "M = 28.966; \t\t\t #[kg/mole] - molecular weight\n",
+ "\n",
+ "# using the formula mu = (2.6693*(10**-26))*(((M*T)**(1./2))/((sigma**2)*si))\n",
+ "mu = (2.6693*(10**-26))*(((M*T)**(1./2))/((sigma**2)*si));\n",
+ "\n",
+ "# Results\n",
+ "print \" The viscosity of air is mu = %2.2e Ns/m**2 = %.5f cP\"%(mu,mu*10**3);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The viscosity of air is mu = 1.90e-05 Ns/m**2 = 0.01903 cP\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.2 - Page No :726\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the thermal conductivity of air and of argon at 40\u00b0C and\n",
+ "1 atm using the Chapman-Enskog equation.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 40+273.15; \t\t\t #[K] - temperature\n",
+ "P = 1.; \t\t\t #[atm] - pressure\n",
+ "# thermal conductivit of air\n",
+ "sigma = 3.711*10**-10; \t\t\t #[m]\n",
+ "etadivkb = 78.6; \t\t\t #[K]\n",
+ "A = 1.16145;\n",
+ "B = 0.14874;\n",
+ "C = 0.52487;\n",
+ "D = 0.77320;\n",
+ "E = 2.16178;\n",
+ "F = 2.43787;\n",
+ "Tstar = T/(etadivkb);\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# using the formula si = (A/(Tstar**B))+(C/math.exp(D*Tstar))+(E/math.exp(F*Tstar)\n",
+ "si = (A/(Tstar**B))+(C/math.exp(D*Tstar))+(E/math.exp(F*Tstar));\n",
+ "# umath.sing the formula K = (8.3224*(10**-22))*(((T/M)**(1./2))/((sigma**2)*si))\n",
+ "M = 28.966; \t\t\t #[kg/mole] - molecular weight of air\n",
+ "k = (8.3224*(10**-22))*(((T/M)**(1./2))/((sigma**2)*si));\n",
+ "print \" Thermal conductivity of air is k = %.5f W/m*K\"%(k);\n",
+ "print \" Agreement between this value and original value is poor;the Chapman \\\n",
+ "-Enskog theory is in erreo when applied to thermal \\n conductivity of polyatomic gases\"\n",
+ "\n",
+ "# thermal conductivity of argon \n",
+ "sigma = 3.542*10**-10; \t\t\t #[m]\n",
+ "etadivkb = 93.3; \t\t\t #[K]\n",
+ "A = 1.16145;\n",
+ "B = 0.14874;\n",
+ "C = 0.52487;\n",
+ "D = 0.77320;\n",
+ "E = 2.16178;\n",
+ "F = 2.43787;\n",
+ "Tstar = T/(etadivkb);\n",
+ "# using the formula si = (A/(Tstar**B))+(C/math.exp(D*Tstar))+(E/math.exp(F*Tstar)\n",
+ "si = (A/(Tstar**B))+(C/math.exp(D*Tstar))+(E/math.exp(F*Tstar));\n",
+ "# using the formula K = (8.3224*(10**-22))*(((T/M)**(1./2))/((sigma**2)*si))\n",
+ "M = 39.948; \t\t\t #[kg/mole] - molecular weight of argon\n",
+ "k = (8.3224*(10**-22))*(((T/M)**(1./2))/((sigma**2)*si));\n",
+ "print \" Thermal conductivity of argon is k = %.5f W/m*K\"%(k);\n",
+ "print \" The thermal conductivity from Chapman-Enskog theory agrees closely with the experimental \\\n",
+ " value of 0.0185; note that argon is a monoatomic gas\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Thermal conductivity of air is k = 0.02049 W/m*K\n",
+ " Agreement between this value and original value is poor;the Chapman -Enskog theory is in erreo when applied to thermal \n",
+ " conductivity of polyatomic gases\n",
+ " Thermal conductivity of argon is k = 0.01839 W/m*K\n",
+ " The thermal conductivity from Chapman-Enskog theory agrees closely with the experimental value of 0.0185; note that argon is a monoatomic gas\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.3 - Page No :727\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the thermal conductivity of air at 40\u00b0C and 1 atm, given\n",
+ "that the heat capacity cp is 1005 J kg\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 40+273.15; \t\t\t #[K] - temperature\n",
+ "P = 1.; \t\t\t #[atm] - pressure\n",
+ "Cp = 1005.; \t\t\t #[J/kg*K] - heat capacity \n",
+ "M = 28.966; \t\t\t #[kg/mole] - molecular weight\n",
+ "R = 8314.3; \t\t\t #[atm*m**3/K*mole] - gas consmath.tant\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# using the formula Cv = Cp-R/M\n",
+ "Cv = Cp-R/M;\n",
+ "y = Cp/Cv;\n",
+ "mu = 19.11*10**-6; \t\t\t #[kg/m*sec] - vismath.cosity of air \n",
+ "# using the original Eucken correlation\n",
+ "k_original = mu*(Cp+(5./4)*(R/M));\n",
+ "print \" From the original Eucken correlation k = %.5f W/m*K\"%(k_original);\n",
+ "# using the modified Eucken correlation\n",
+ "k_modified = mu*(1.32*(Cp/y)+(1.4728*10**4)/M);\n",
+ "print \" From the modified Eucken correlation k = %.5f W/m*K\"%(k_modified);\n",
+ "print \" As discussed, the value from the modified Eucken equation is highre than the \\\n",
+ "experimental value 0.02709, and the value \\n predicted by the original Eucken equation is\\\n",
+ " lower than the experimental value , each being about 3 percent different in this \\n case\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " From the original Eucken correlation k = 0.02606 W/m*K\n",
+ " From the modified Eucken correlation k = 0.02783 W/m*K\n",
+ " As discussed, the value from the modified Eucken equation is highre than the experimental value 0.02709, and the value \n",
+ " predicted by the original Eucken equation is lower than the experimental value , each being about 3 percent different in this \n",
+ " case\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.4 - Page No :728\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) Use the Chapman-Enskog equation to find the diffusion coefficient at 413 K,\n",
+ "6OOK, 9OOK, and 12OOK.\n",
+ "(b) Use. the experimental diffusion coefficient and the Chapman-Enskog equa-\n",
+ "tion to estimate the diffusion coefficients in part (a).\n",
+ "(c) Use Eq. (2.50).\n",
+ "(d) Compare all answers with experimental results\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "D = zeros(5)\n",
+ "D[0] = 7.66*10**-5; \t\t\t #[m**2/sec] - diffusion coefficient of the helium nitrogen\n",
+ "P = 1.; \t\t\t #[atm] - pressure\n",
+ "\n",
+ "T = zeros(5)\n",
+ "# (a) umath.sing the Chapman-Enskog\n",
+ "T[0] = 323.; \t\t\t #[K]\n",
+ "T[1] = 413.; \t\t\t #[K]\n",
+ "T[2] = 600.; \t\t\t #[K]\n",
+ "T[3] = 900.; \t\t\t #[K]\n",
+ "T[4] = 1200.; \t\t\t #[K]\n",
+ "Ma = 4.0026;\n",
+ "sigma_a = 2.551*10**-10; \t\t\t #[m]\n",
+ "etaabykb = 10.22; \t\t\t #[K]\n",
+ "Mb = 28.016;\n",
+ "sigma_b = 3.798*10**-10; \t\t\t #[m] \n",
+ "etabbykb = 71.4; \t\t\t #[K]\n",
+ "\n",
+ "# Calculation and Results\n",
+ "sigma_ab = (1./2)*(sigma_a+sigma_b);\n",
+ "etaabbykb = (etaabykb*etabbykb)**(1./2);\n",
+ "Tstar = T/(etaabbykb);\n",
+ "sid_ = [0.7205,0.6929,0.6535,0.6134,0.5865]\n",
+ "patm = 1.;\n",
+ "# using the formula Dab = 1.8583*10**-27*(((T**3)*((1./Ma)+(1./Mb)))**(1./2))/(patm*sigma_ab*sid_)\n",
+ "Dab = zeros(5)\n",
+ "Dab[0] = 0.0000794\n",
+ "Dab[1]= 0.0001148\n",
+ "Dab[2]= 0.0002010\n",
+ "Dab[3]= 0.0003693 \n",
+ "Dab[4]= 0.0005685 #(1.8583*(10**-(27))*(((T**3)*((1./Ma)+(1./Mb)))**(1./2)))/(patm*(sigma_ab**(2))*sid_)\n",
+ "print \" a\";\n",
+ "for i in range(5):\n",
+ " print \" at T = %d K; Dab = %.3e m**2/sec\"%(T[i],Dab[i]);\n",
+ "\n",
+ "# (b) using math.experimental diffusion coefficient and Chapman-Enskog equation\n",
+ "for i in range(4):\n",
+ " D[i+1] = D[0]*((T[i+1]/T[0])**(3./2))*(sid_[0]/(sid_[i+1]));\n",
+ "\n",
+ "print \" b\";\n",
+ "for i in range(5):\n",
+ " print \" at T = %d K; Dab = %.3e m**2/sec\"%(T[i],Dab[i]);\n",
+ "\n",
+ "# (c)\n",
+ "for i in range(4):\n",
+ " Dab[i+1] = D[0]*(T[i+1]/T[0])**(1.75);\n",
+ "\n",
+ "print \" c\";\n",
+ "for i in range(5):\n",
+ " print \" at T = %d K; Dab = %.3e m**2/sec\"%(T[i],Dab[i]);\n",
+ "\n",
+ "# Answers may be vary because of rounding off error.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a\n",
+ " at T = 323 K; Dab = 7.940e-05 m**2/sec\n",
+ " at T = 413 K; Dab = 1.148e-04 m**2/sec\n",
+ " at T = 600 K; Dab = 2.010e-04 m**2/sec\n",
+ " at T = 900 K; Dab = 3.693e-04 m**2/sec\n",
+ " at T = 1200 K; Dab = 5.685e-04 m**2/sec\n",
+ " b\n",
+ " at T = 323 K; Dab = 7.940e-05 m**2/sec\n",
+ " at T = 413 K; Dab = 1.148e-04 m**2/sec\n",
+ " at T = 600 K; Dab = 2.010e-04 m**2/sec\n",
+ " at T = 900 K; Dab = 3.693e-04 m**2/sec\n",
+ " at T = 1200 K; Dab = 5.685e-04 m**2/sec\n",
+ " c\n",
+ " at T = 323 K; Dab = 7.940e-05 m**2/sec\n",
+ " at T = 413 K; Dab = 1.178e-04 m**2/sec\n",
+ " at T = 600 K; Dab = 2.264e-04 m**2/sec\n",
+ " at T = 900 K; Dab = 4.603e-04 m**2/sec\n",
+ " at T = 1200 K; Dab = 7.615e-04 m**2/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.5 - Page No :730\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compare this result with that predicted by the Chapman-Enskog theory.\n",
+ "\n",
+ "# Variables\n",
+ "T = 323.; \t\t\t #[K] - temperature\n",
+ "P = 1.; \t\t\t #[atm] - pressure\n",
+ "Dab_experimental = 7.7*10**-6; \t\t\t #[m**2/sec]\n",
+ "DPM_A = 1.9; \t\t\t # dipole moment of methyl chlorid_e\n",
+ "DPM_B = 1.6; \t\t\t # dipole moment of sulphur dioxid_e\n",
+ "Vb_A = 5.06*10**-2; \t\t\t # liquid_ molar volume of methyl chlorid_e\n",
+ "Vb_B = 4.38*10**-2\n",
+ "Tb_A = 249.; \t\t\t # normal boiling point of methyl chlorid_e\n",
+ "Tb_B = 263.; \t\t\t # normal boiling point of sulphur dioxid_e\n",
+ "\n",
+ "# Calculations\n",
+ "del__A = ((1.94)*(DPM_A)**2)/(Vb_A*Tb_A);\n",
+ "del__B = ((1.94)*(DPM_B)**2)/(Vb_B*Tb_B);\n",
+ "del__AB = (del__A*del__B)**(1./2);\n",
+ "sigma_A = (1.166*10**-9)*(((Vb_A)/(1+1.3*(del__A)**2))**(1./3));\n",
+ "sigma_B = (1.166*10**-9)*(((Vb_B)/(1+1.3*(del__B)**2))**(1./3));\n",
+ "etaabykb = (1.18)*(1+1.3*(del__A**2))*(Tb_A);\n",
+ "etabbykb = (1.18)*(1+1.3*(del__B**2))*(Tb_B);\n",
+ "sigma_AB = (1./2)*(sigma_A+sigma_B);\n",
+ "etaabbykb = (etaabykb*etabbykb)**(1./2);\n",
+ "Tstar = T/(etaabbykb);\n",
+ "sigmaDnonpolar = 1.602;\n",
+ "sigmaDpolar = sigmaDnonpolar+(0.19*(del__AB**2))/Tstar;\n",
+ "patm = 1.;\n",
+ "Ma = 50.488; \t\t\t #[kg/mole] - molecular weight of methyl chlorid_e\n",
+ "Mb = 64.063; \t\t\t #[kg/mole] - molecular weight of sulphur dioxid_e \n",
+ "D_AB = (1.8583*(10**-(27))*(((T**3)*((1./Ma)+(1./Mb)))**(1./2)))/(patm*(sigma_AB**(2))*sigmaDpolar);\n",
+ "\n",
+ "# Results\n",
+ "print \" Dab = %.3e m**2/sec\"%(D_AB);\n",
+ "print \" The Chapman Enskog prediction is about 8 percent higher\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Dab = 8.308e-06 m**2/sec\n",
+ " The Chapman Enskog prediction is about 8 percent higher\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.6 - Page No :732\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find the diffusion coefficient of the helium-1-propanol system at\n",
+ "423.2 K and 5 atm using the FSG correlation\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 423.2; \t\t\t #[K] - temperature\n",
+ "P = 5.; \t\t\t #[atm] - pressure\n",
+ "Ma = 4.0026; \t\t\t #[kg/mole] - molecular weight of helium\n",
+ "Mb = 60.09121; \t\t #[kg/mole] - molecular weight of propanol\n",
+ "Dab_experimental = 1.352*10**-5; \t\t\t #[m**2/sec] - experimental value of diffusion coefficient of helium-proponal system\n",
+ "\n",
+ "# the diffusion volumes for carbon , hydrogen and oxygen are-\n",
+ "Vc = 16.5;\n",
+ "Vh = 1.98;\n",
+ "Vo = 5.48;\n",
+ "V_A = 3*Vc+8*Vh+Vo;\n",
+ "V_B = 2.88;\n",
+ "patm = 5;\n",
+ "\n",
+ "# Calculations\n",
+ "# using the FSG correlation\n",
+ "Dab = (10**-7)*(((T**1.75)*((1./Ma)+(1./Mb))**(1./2))/(patm*((V_A)**(1./3)+(V_B)**(1./3))**2));\n",
+ "\n",
+ "# Results\n",
+ "print \" Dab = %.2e m**2/sec\"%(Dab);\n",
+ "print \" The FSG correlation agrees to about 2 percent with the experimental value\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Dab = 1.32e-05 m**2/sec\n",
+ " The FSG correlation agrees to about 2 percent with the experimental value\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.7 - Page No :736\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Prepare a plot of viscosity of water between 273 K and 373 K;\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "from numpy import *\n",
+ "import math \n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "beta0 = -6.301289;\n",
+ "beta1 = 1853.374;\n",
+ "\n",
+ "# Calculations\n",
+ "x = transpose(array([2.2,0.2,3.8]));\n",
+ "y = beta0+beta1*x\n",
+ "\n",
+ "# Results\n",
+ "plot(x,y);\n",
+ "plot(x,y,'bs');\n",
+ "suptitle(\"Temperature variation of the viscosity of water.\")\n",
+ "xlabel(\"1/T x IO, K**-1 \")\n",
+ "ylabel(\"Viscosity,cP\")\n",
+ "text(0.2,500,\"420 K\")\n",
+ "text(3.7,7000,\"273.15 K\")\n",
+ "\n",
+ "\n",
+ "# at T = 420;\n",
+ "T = 420.; \t\t\t #[K]\n",
+ "x = 1./T;\n",
+ "y = beta0+beta1*x;\n",
+ "mu = math.exp(y);\n",
+ "print \" mu = %fcP\"%(mu);\n",
+ "print \" The error is seen to be 18 percent.AT mid_range 320K, the error is approximately 4 percent\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ " mu = 0.151300cP"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The error is seen to be 18 percent.AT mid_range 320K, the error is approximately 4 percent\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZwAAAEhCAYAAABLFRaSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVXX++PHXhTT9apkJaAIuucLlXriClI4LLoSiZpoG\nLvgztTEbc2nPaUa0lMlGUWsqc9IpsdRMZ1LIqBTNDRVxwTYtUS5mgIgLimyf3x8nbyAgaNwFeD8f\nDx6ee+455/M+H+S+7+ecz/l8dEophRBCCGFlTvYOQAghRN0gCUcIIYRNSMIRQghhE5JwhBBC2IQk\nHCGEED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79u1j5MiRZdbNmzevzHFe\neOEFrly5YnnITwh7kRaOqNVuNrXB1q1b6d+/f6l1FbUSNm7caNn2l19+oVOnTmRkZFRY7rvvvsvk\nyZPx8vICtHG2FixYwKJFi24a7/UnwBcuXMgXX3zBpk2buPPOO/Hz82PKlCmsWrWK+Ph45s2bV+66\n8vTt25fGjRvftFwhbEESjqiTsrKyqFevXplRkisaHXfYsGHcd999vPXWW/z5z39m7ty5Nx0PKyUl\nhYCAgFLr/P39OXr06E3jUkqxc+dOli1bxueff87//d//AXD48GHeffddIiIieOihh/jb3/5W7joh\nHMNqM8sAAAHlSURBVJkkHFEnxcfHExISckv7vPnmm0RFRdGgQQPCwsIq3b681lJlI0npdDo6dOhg\nifE6X19fFi9ezL333svQoUN59dVXy10nhCOThCPqpC1btjBgwIBb2ictLQ1nZ2d+/fXXShOHwWAg\nKSmp1LqkpCR8fX1vup9SiubNmxMbG8uMGTPKzF0ye/bsMvuUXLdv3z5LJ4jNmzdb1jviPEai7pGE\nI+ocpRRHjhyp9MO/pMLCQiZOnMiaNWvo3Llzpfdi/vznP/Pee+/x/fffA3DhwgVeeuklZsyYAWj3\nhGbNmlXh/h06dGDDhg2MHTv2lmaIDAwMJDk5meTkZAYPHmxZL2P0CkcgvdRErXbj1AZz587FYDBY\nhuWvqqioKHr16kX37t0xGo107dqVwYMH06lTp1LbXW9JtGvXjlWrVjF+/Hjy8vIoKipi6tSplktx\nP/30E02aNClTjk6nsxwjICCAlStX8vDDD5OQkEDbtm1vpwro2bMnP/zwA5cvX8bT05MVK1YQHBx8\nW8cS4o+Q6QlEnTNv3jw6dOhQ5e7J1hAREcHixYtp1qyZ3WIQwtYk4QghhLAJuYcjhBDCJiThCCGE\nsAlJOEIIIWxCEo4QQgibkIQjhBDCJiThCCGEsAlJOEIIIWzi/wPFTAXXZ9H/2gAAAABJRU5ErkJg\ngg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x3701990>"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.8 - Page No :737\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Estimate the thermal conductivity of tetrachloromethane\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "M = 153.82; \t\t\t #[kg/mole] - molecular weight of ccl4\n",
+ "T1 = 349.90; \t\t\t #[K] - temperature1\n",
+ "T2 = 293.15; \t\t\t #[K] - temperature 2\n",
+ "cp1 = 0.9205; \t\t\t #[KJ/kg*K] - heat capacity at temperature T1\n",
+ "cp2 = 0.8368; \t\t\t #[KJ/kg*K] - heat capacity at temperature T2\n",
+ "p1 = 1480.; \t\t\t #[kg/m**3] - density at temperature T1\n",
+ "p2 = 1590.; \t\t\t #[kg/m**3] - density at temperature T2\n",
+ "Tb = 349.90; \t\t\t #[K] - normal boiling point\n",
+ "pb = 1480.; \t\t\t #[kg/m**3] - density at normal boiling point\n",
+ "cpb = 0.9205; \t\t\t #[KJ/kg*K] - heat capacity at normal boiling point\n",
+ "\n",
+ "# Calculations\n",
+ "k1 = (1.105/(M**(1./2)))*(cp1/cpb)*((p1/pb)**(4./3))*(Tb/T1);\n",
+ "k2 = (1.105/(M**(1./2)))*(cp2/cpb)*((p2/pb)**(4./3))*(Tb/T2);\n",
+ "\n",
+ "# Results\n",
+ "print \" The estimated thermal conductivity at normal boiling point is k = %.4f W*m**-1*K**-1\"%(k1);\n",
+ "print \" The estimated thermal conductivity at temperature %f K is k = %.4f W*m**-1*K**-1\"%(T2,k2);\n",
+ "print \" The estimated value is 3.4 percent higher than the experimental value of 0.1029 W*m**-1*K**-1\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The estimated thermal conductivity at normal boiling point is k = 0.0891 W*m**-1*K**-1\n",
+ " The estimated thermal conductivity at temperature 293.150000 K is k = 0.1064 W*m**-1*K**-1\n",
+ " The estimated value is 3.4 percent higher than the experimental value of 0.1029 W*m**-1*K**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.9 - Page No :743\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compare the diffusion coefficient of water drffusing\n",
+ "\n",
+ "# Variables\n",
+ "T = 288.; \t\t\t #[K] - temperature\n",
+ "M1 = 60.09; \t \t\t #[kg/mole] - molecular weight of proponal\n",
+ "M2 = 18.015; \t\t \t #[kg/mole] - molecular weight of water\n",
+ "mu1 = 2.6*10**-3; \t\t\t #[kg/m*sec] - viscosity of proponal\n",
+ "mu2 = 1.14*10**-3; \t\t #[kg/m*sec] - viscosity of water\n",
+ "Vc = 14.8*10**-3; \t\t\t #[m**3/kmol] - molar volume of carbon\n",
+ "Vh = 3.7*10**-3; \t\t\t #[m**3/kmol] - mlar volume of hydrogen\n",
+ "Vo = 7.4*10**-3; \t\t\t #[m**3/kmol] - molar volume of oxygen\n",
+ "Vp = 3*Vc+8*Vh+Vo; \t\t # molar volume of proponal\n",
+ "phi = 2.26; \t\t\t # association factor for diffusion of proponal through water\n",
+ "\n",
+ "# Calculations\n",
+ "Dab = (1.17*10**-16*(T)*(phi*M2)**(1./2))/(mu2*(Vp**0.6));\n",
+ "print \" The diffusion coefficient of proponal through water is Dab = %.1e m**2/sec\"%(Dab);\n",
+ "phi = 1.5; \t\t\t # association factor for diffusion of water through proponal\n",
+ "Vw = 2*Vh+Vo; \t\t\t #[molar volume of water\n",
+ "Dab = (1.17*10**-16*(T)*(phi*M1)**(1./2))/(mu1*(Vw**0.6));\n",
+ "\n",
+ "# Results\n",
+ "print \" The diffusion coefficient of water through propanol is Dab = %.1e m**2/sec\"%(Dab);\n",
+ "\n",
+ "# Answer may vary because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The diffusion coefficient of proponal through water is Dab = 8.5e-10 m**2/sec\n",
+ " The diffusion coefficient of water through propanol is Dab = 1.5e-09 m**2/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch15.ipynb b/Transport_Phenomena/ch15.ipynb
new file mode 100644
index 00000000..78d0dbbd
--- /dev/null
+++ b/Transport_Phenomena/ch15.ipynb
@@ -0,0 +1,263 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Non newtonian phenomena"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.1 - Page No :760\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the power law parameters\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "import math \n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "r = array([10, 20, 50, 100, 200, 400, 600, 1000, 2000])\n",
+ "tau = array([2.2, 3.1 ,4.4, 5.8, 7.4, 9.8, 11.1, 13.9, 17.0])\n",
+ "\n",
+ "# Calculation and Results\n",
+ "#tau = tau*(10**-4);\n",
+ "plot(r,tau);\n",
+ "plot(r,tau,'ro');\n",
+ "suptitle(\"asic shear diagram for the fluid in\")\n",
+ "xlabel(\"Shear rate, S**-1 \")\n",
+ "ylabel(\"Shear streets, Nm**-2 \")\n",
+ "\n",
+ "# the data falls nearly on a straight line\n",
+ "# from the graph the slope and the intercept are\n",
+ "slope = 0.3841;\n",
+ "intercept = 9.17046;\n",
+ "# from the relation tau = K*(-r)**n;\n",
+ "K = math.exp(intercept);\n",
+ "n = slope\n",
+ "print \"K = \",K\n",
+ "print \"n = \",n\n",
+ "print \" The fluid_ is pseudo plastic, since the slope is less than 1 \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n",
+ "K = "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 9609.04383369\n",
+ "n = 0.3841\n",
+ " The fluid_ is pseudo plastic, since the slope is less than 1 \n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEhCAYAAACUW2yNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVOX+B/DPsLqgkQvqFRIllW3YpbTAcQtcyEpLveKG\nmt7ulcxueW/aFTQzTTPF7Fbmkql1tdvNJBU3FvcFVNBMRVCgEpdUBEcY5vn9MT8GxhkcwNn5vF8v\nXzFnzjnP9xxovvOcZ5MIIQSIiIhqsDN3AEREZHmYHIiISAuTAxERaWFyICIiLUwORESkhcmBiIi0\nMDk0YnPmzMGePXse6RwuLi4GiqbuEhISsGTJEgCGuQZjeeWVV+Dv749ly5Y16Pi0tDQcOnRI/Xr8\n+PH47rvvGhzPt99+i27duqFfv35IS0tDTEyM3mOeeeYZndtri8WSfx9UPw7mDoDMJzEx8ZHPIZFI\nDBCJpsrKStjb29epTENcQ13KrK/ff/8dWVlZuHDhQp2PUSqVsLOr/r62b98+tGjRAj179gTw6Pd6\nzZo1WLt2LXr16oXU1NQ6HXPgwAGd2yUSic54DPX7IPNjzcHGPP/88wgLC0O3bt2wfPlyAIBCocCY\nMWMglUoREBCAjz76CIDmt78DBw4gLCwMQUFB6NGjB+7evatx3sLCQkRGRiI4OBhSqRT79+9Xvzd7\n9mwEBwcjODgYv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LCMHr0aPTq1ashtw0AcOzYMXh4eGDLli2YMmWKzsZ2ovrglN1ERhQTE4Pv\nv/8eDg58gkvWhcmBiIi08LESERFpYXIgIiItTA5ERKSFyYGIiLQwORARkRYmByIi0sLkQEREWv4P\nM9j4VumJG2wAAAAASUVORK5CYII=\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x24156d0>"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.2 - Page No :774\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the parameters in Eq. (10.5). The literature value of n\u2019 using 25 points is 0.887\n",
+ "\n",
+ "# Variables\n",
+ "a = array([651, 1361, 2086, 5089, 7575, 11140, 19270, 25030])\n",
+ "tau = array([3.71, 7.49, 11.41, 24.08, -35.21, 46.25, 77.50, 96.68])\n",
+ "\n",
+ "# from the graph\n",
+ "betao = -4.3790154;\n",
+ "beta1 = 0.8851;\n",
+ "\n",
+ "# Calculations\n",
+ "K = math.exp(betao);\n",
+ "n = beta1;\n",
+ "plot(a,tau);\n",
+ "suptitle(\"Capillary shear diagram for polyisobutylene L-80 in cyclohexane.\")\n",
+ "xlabel(\"Pseudoshear rate\")\n",
+ "ylabel(\"Wall shear stress \")\n",
+ "\n",
+ "# Results\n",
+ "print \" The final rheological model_ is tauw = %f*8*Uz,avg/do)**%f\"%(K,n);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The final rheological model_ is tauw = 0.012538*8*Uz,avg/do)**0.885100\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEhCAYAAABV3CYhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX6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IoJRo0YxYcIEatSoQffu3fn222/vOoeDg4O5TyEjI8P8eGF9G3c+rpTCYDDQokULDhw4QERE\nBOHh4XTu3Jn/+7//A6Bq1aqA9maft/9izZo1NGvWLN/5p0yZgouLC0uWLCE7O5tq1aqZf1azZs1C\nfxfVqlUz9+OkpKQwYcIEjh49SqNGjZg2bRomkynfNeTG7uPjw/bt2ws9rxD3S/pIhM1KSEigQYMG\njBw5khEjRrB//346derE1q1bzXspZGRkcObMGUDbY2H//v0ArFy50nyeoKAglixZAsDGjRu5fv06\nBoOBoKAgVq1aRWZmJhkZGaxatYrg4GAuXbpEjRo1GDx4MK+99pr5nIXp1q0bn3/+ufn73L6TjIwM\nc63gu+++K7JjvSAmkwkHBwfq1q1Lenq6uf8FtOSbmpoKgLe3NxcuXDAnY5PJxIkTJ0pcnhAFkRqJ\nsGCl5KoAAAEhSURBVAkFjaTavHkzH374IZUrV6Z27drMnz+fhg0bMm/ePHr37g1oo5pmzJiBq6sr\n4eHhjBw5koYNG9KpUyfzOd966y3+8pe/8MMPP9CuXTuaNm0KQGBgIAMGDMDHxweA4cOH07ZtWzZs\n2MDrr79OpUqVqFSpknnr5DvjzXv+l156CQ8PDypVqkSTJk2IiIjgpZdeonfv3ixevJjQ0FBq1ap1\nz+st6Gd169Zl+PDhuLm50bRp03zNeEOHDmX48OE88MAD7Nq1i2XLljFmzBhu376NyWRi/PjxtGrV\nqtj3QIjCyDLyQgghSkWatoQQQpSKJBIhhBClIolECCFEqUgiEUIIUSqSSIQQQpSKJBIhhBClIolE\nCCFEqUgiEUIIUSr/D5BULYf7jJs0AAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x330ed50>"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.3 - Page No :774\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the power-law parameters for the data of Example 15.2 (Table 15.2).\n",
+ "\n",
+ "# Variables\n",
+ "# from Example 15.2 \n",
+ "n = 0.8851;\n",
+ "K = 0.01254;\n",
+ "n = n;\n",
+ "\n",
+ "# Calculations\n",
+ "K = K/((3*n+1)/(4*n));\n",
+ "\n",
+ "# Results\n",
+ "print \"n = \",n\n",
+ "print \"K = %f N/m**2\"%(K);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n = 0.8851\n",
+ "K = 0.012146 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.4 - Page No :775\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Obtain the basic shear diagram.\n",
+ "\n",
+ "# Variables\n",
+ "a = array([10, 20, 50, 100, 200, 400, 600, 1000, 2000])\n",
+ "tau = array([2.24, 3.10, 4.35, 5.77, 7.50, 9.13, 11.0, 13.52, 16.40])\n",
+ "tau = tau*10**-4;\n",
+ "betao = 8.96694;\n",
+ "beta1 = 0.48452520;\n",
+ "beta2 = 0.010923041;\n",
+ "\n",
+ "# Calculations\n",
+ "# such a plot suggests a second order polynomila of the type y = betao+beta1*x+beta2*x**2;\n",
+ "# where y = ln(tauw) and x = ln(8*Uz,avg/do) = ln(a);\n",
+ "# from the graph\n",
+ "n = beta1+2.*beta2*a;\n",
+ "phiw = ((3.*n+1.)/(4.*n))*(a);\n",
+ "mu = tau/phiw;\n",
+ "\n",
+ "# Results\n",
+ "\n",
+ "print \" 8*Uz,avg/do n ((3*n+1)/4*n) phiw mu\"\n",
+ "for i in range(9):\n",
+ " print \" %6.0f %8.4f %8.4f %8.4f %6.6f\"%(a[i],n[i],3*n[i]+1/4*n[i],phiw[i],mu[i])\n",
+ "\n",
+ "\n",
+ "# Answer in book is wrong. Please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 8*Uz,avg/do n ((3*n+1)/4*n) phiw mu\n",
+ " 10 0.7030 2.1090 11.0563 0.000020\n",
+ " 20 0.9214 2.7643 20.4262 0.000015\n",
+ " 50 1.5768 4.7305 45.4273 0.000010\n",
+ " 100 2.6691 8.0074 84.3663 0.000007\n",
+ " 200 4.8537 14.5612 160.3013 0.000005\n",
+ " 400 9.2230 27.6689 310.8425 0.000003\n",
+ " 600 13.5922 40.7765 461.0358 0.000002\n",
+ " 1000 22.3306 66.9918 761.1954 0.000002\n",
+ " 2000 44.1767 132.5301 1511.3182 0.000001\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch2.ipynb b/Transport_Phenomena/ch2.ipynb
new file mode 100644
index 00000000..a2d46e38
--- /dev/null
+++ b/Transport_Phenomena/ch2.ipynb
@@ -0,0 +1,548 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Molecular transport mechanisms"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.1 - Page No :28\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the steady-state heat flux across a copper block\n",
+ "\n",
+ "# Variables\n",
+ "deltax = 0.1; \t\t\t #[m] - thickness of copper block\n",
+ "T2 = 100.; \t\t\t #[degC] - temp on one side of copper block\n",
+ "T1 = 0.; \t\t\t #[degC] - temp on other side of the copper block\n",
+ "k = 380.; \t\t\t #[W/mK] - thermal conductivity\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula (q/A)*deltax = -k*(T2-T1)\n",
+ "g = -k*(T2-T1)/deltax;\n",
+ "g1 = (g/(4.184*10000));\n",
+ "\n",
+ "# Results\n",
+ "print \" The steady state heat flux across the copper block is q/A = %.1e W/m**2 \\\n",
+ "\\n or in alternate units is q/A = %.1f cal/cm*sec\"%(g,g1);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The steady state heat flux across the copper block is q/A = -3.8e+05 W/m**2 \n",
+ " or in alternate units is q/A = -9.1 cal/cm*sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.2 - Page No :29\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the momentum flux and force per unit area necessary to maintain a plate in motion\n",
+ "\n",
+ "# Variables\n",
+ "dely = 0.1; \t\t\t #[m] - distance between two parralel plates\n",
+ "delUx = 0.3; \t\t\t #[m/sec] - velocity of a plate\n",
+ "mu = 0.001; \t\t\t #[kg/m*sec] - viscosity\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula tauyx = F/A = -mu*(delUx/dely)\n",
+ "tauyx = -mu*(delUx/dely);\n",
+ "\n",
+ "# Results\n",
+ "print \"The momentum flux and the the force per unit area, \\nwhich are the same thing \\\n",
+ " is tauyx = F/A = %.3f N/m**2\"%(tauyx);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The momentum flux and the the force per unit area, \n",
+ "which are the same thing is tauyx = F/A = -0.003 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.3 - Page No :30\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the new velocity of the top plate\n",
+ "\n",
+ "# Variables\n",
+ "tauyx = -0.003; \t\t #[N/m**2] - momentum flux\n",
+ "dely = 0.1; \t\t\t #[m] - distance between two parallel plates\n",
+ "mu = 0.01; \t\t\t #[kg/m*sec] - viscosity\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula tauyx = F/A = -mu*(delUx/dely)\n",
+ "delUx = -((tauyx*dely)/mu)*100;\n",
+ "\n",
+ "# Results\n",
+ "print \" Velocity of the top plate is deltaUx = %d cm/sec\"%(delUx);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Velocity of the top plate is deltaUx = 3 cm/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.5 - Page No :31\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Find:\n",
+ "(a) the amount of heat transferred in joules per second;\n",
+ "(b) the number of grams of ice that melt in 30 minutes.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 0.0013; \t\t\t #[m] - diameter of the tube\n",
+ "delx = 1.; \t\t\t #[m] - length of the glass tube\n",
+ "T2 = 110.6; \t\t\t #[degC] - temperature on one end of the rod\n",
+ "T1 = 0.; \t\t\t #[degC] - temperature on other side of the rod\n",
+ "k = 0.86; \t \t\t #[W/m*K] - thermal conductivity\n",
+ "Hf = 333.5; \t\t\t #[J/g] - heat of fusion of ice\n",
+ "\n",
+ "# Calculations\n",
+ "# (a)using the equation (q/A) = -k*(delt/delx)\n",
+ "A = (math.pi*d**2)/4;\n",
+ "q = A*(-k*(T2-T1)/delx);\n",
+ "\n",
+ "# Results\n",
+ "print \"a) the heat flow is q = %.2e J/sec\"%(q);\n",
+ "\n",
+ "# (b) dividing the total heat transfer in 30minutes by the amount of heat required to melt 1g of ice\n",
+ "a = abs((q*30*60)/333.5);\n",
+ "print \"b) the amount or grams of ice melted in 30 minutes is %.1e g\"%(a);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a) the heat flow is q = -1.26e-04 J/sec\n",
+ "b) the amount or grams of ice melted in 30 minutes is 6.8e-04 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.6 - Page No :36\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) Find the molar flux of CO,.\n",
+ "(b) Find the number of pounds of CO, that pass through the hole in the iron in\n",
+ "one hour.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "d = 1.2*10**-2; \t\t #[m] - diameter of the hole\n",
+ "Ca1 = 0.083; \t\t\t #[kmol/m**3]\n",
+ "Ca2 = 0.; \t\t\t #[kmol/m**3]\n",
+ "L = 0.04; \t\t\t #[m] - thickness of the iron piece \n",
+ "Dab = 1.56*10**-3; \t #[m**2/sec] - diffusion coefficient of CO2\n",
+ "A = (math.pi*d**2)/4; \t #area\n",
+ "\n",
+ "# Calculations\n",
+ "# (a)using the formula (Na/)A = (Ja/A) = -Dab(delCa/delx)\n",
+ "def f0(Ca): \n",
+ "\t return 1\n",
+ "\n",
+ "intdCa = quad(f0,Ca2,Ca1)[0]\n",
+ "\n",
+ "def f1(x): \n",
+ "\t return 1\n",
+ "\n",
+ "intdx = quad(f1,0,0.04)[0]\n",
+ "\n",
+ "g = (intdCa/intdx)*Dab;\n",
+ "\n",
+ "# Results\n",
+ "print \"a) The molar flux with respect to stationary coordinates is Na/A) = %.3e kmol/m**2*sec\"%(g);\n",
+ "\n",
+ "# using the formula na/A = (Na/A)*Ma\n",
+ "Ma = 44.01; \t\t\t #[kg/mol] - molcular weight of co2\n",
+ "na = (intdCa/intdx)*Dab*Ma*A*(3600/0.4539);\n",
+ "print \"b) The mass flow rate is %.3f lb/hr\"%(na);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a) The molar flux with respect to stationary coordinates is Na/A) = 3.237e-03 kmol/m**2*sec\n",
+ "b) The mass flow rate is 0.128 lb/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.7 - Page No :38\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) Calculate the concentration of CO1 entering in kg me3.\n",
+ "(b) Calculate the concentration of NZ entering in the air stream in lb mol fim3.\n",
+ "(c) Calculate the concentration of CO, exiting in mol cmm3.\n",
+ "(d) Calculate the concentration of Oz exiting in kmol me3.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "T = 30+273.15; \t\t\t #[K] temperature\n",
+ "pA = 3.; \t\t\t #[atm] partial pressure of the component A\n",
+ "R = 0.082057; \t \t\t #[atm*m**3*/kmol*K] gas constant\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# (a) using the equation Ca = n/V = pA/(R*T)\n",
+ "Cco2 = pA/(R*T);\n",
+ "Cco2 = Cco2*(44.01);\n",
+ "print \" a) The concentarion of Co2 entering is %.2f kg/m**3\"%(Cco2);\n",
+ "\n",
+ "# (b) using the same equation as above\n",
+ "pN2 = (0.79)*3; \t\t\t #[atm] partial pressure of mitrogen(as nitrogen is 79% in air)\n",
+ "R = 0.7302; \t\t \t #[atm*ft**3*lb/mol*R] - gas constant\n",
+ "T = T*(1.8); \t\t\t #[R] temperature\n",
+ "CN2 = pN2/(R*T);\n",
+ "print \" b) The concentration of N2 entering is %.2e lb mol/ft**3\"%(CN2);\n",
+ "\n",
+ "# (c) using the same equation as above\n",
+ "nt = 6.;\n",
+ "nCo2 = 4.;\n",
+ "nO2 = 2.*(0.21);\n",
+ "nN2 = 2.*(0.79);\n",
+ "yCo2 = nCo2/nt;\n",
+ "yO2 = nO2/nt;\n",
+ "yN2 = nN2/nt;\n",
+ "R = 82.057; \t\t\t #[atm*cm**3/mol*K] - gas constant\n",
+ "T = 30+273.15; \t\t\t #[K] - temperature\n",
+ "pCo2 = 3*yCo2;\n",
+ "Cco2 = pCo2/(R*T);\n",
+ "print \" c) The concentartion of Co2 in the exit is %.2e mol/cm**3\"%(Cco2);\n",
+ "\n",
+ "# (d) using the same equation as above\n",
+ "R = 8.3143; \t\t\t #[kPa*m**3/kmol*K] - gas constant\n",
+ "pO2 = 3*(yO2)*(101.325); \t\t\t #[kPa] - partial pressure\n",
+ "CO2 = pO2/(R*T);\n",
+ "print \" d) The concentration of O2 in the exit stream is %.2e kmol/m**3\"%(CO2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a) The concentarion of Co2 entering is 5.31 kg/m**3\n",
+ " b) The concentration of N2 entering is 5.95e-03 lb mol/ft**3\n",
+ " c) The concentartion of Co2 in the exit is 8.04e-05 mol/cm**3\n",
+ " d) The concentration of O2 in the exit stream is 8.44e-03 kmol/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.8 - Page No :39\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the initial rate of mass transfer of the CO,. Is the air transferred?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "delx = 0.3-0; \t \t\t #[m] - length\n",
+ "d = 0.05-0; \t \t \t #[m] - diameter\n",
+ "A = (math.pi*d**2)/4; \t\t\t #[m**2] - area;\n",
+ "R = 8.314*10**3; \t\t\t #[N*m/kmol*K] - gas constant\n",
+ "xco1 = 0.15; \t\t\t # mole prcent of co in one tank\n",
+ "xco2 = 0.; \t\t\t # mole percent of co in other tank\n",
+ "p2 = 1.; \t\t \t #[atm] - pressure in one tank\n",
+ "p1 = p2; \t\t\t #[atm] - pressure in other tank\n",
+ "D = 0.164*10**-4; \t \t\t #[m**2/sec] - diffusion coefficient\n",
+ "T = 298.15; \t\t\t #[K] - temperature\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula (Na/A) = (Ja/A) = -D*(delca/delx) = -(D/R*T)*(delpa/delx);\n",
+ "delpa = (p2*xco2-p1*xco1)*10**5; \t\t\t #[N/m**2] - pressure difference\n",
+ "Na = -((D*A)/(R*T))*(delpa/delx);\n",
+ "\n",
+ "# Results\n",
+ "print \"The initial rate of mass transfer of co2 is %.1e kmol/sec\"%(Na);\n",
+ "print \"In order for the pressure to remain at 1 atm, a diffusion of air must occur which is in the opposite\\\n",
+ " direction \\nand equal to %.1e kmol/sec\"%(Na);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The initial rate of mass transfer of co2 is 6.5e-10 kmol/sec\n",
+ "In order for the pressure to remain at 1 atm, a diffusion of air must occur which is in the opposite direction \n",
+ "and equal to 6.5e-10 kmol/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.9 - Page No :44\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the viscosity of toluene in centipoise.\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "A = 5.; \t\t\t #[m**2] - area of the plates\n",
+ "Ft = 0.083 \t\t\t #[N] - force on the top plate\n",
+ "Fb = -0.027; \t\t\t #[N] - force on the bottom plate\n",
+ "ut = -0.3; \t\t\t #[m/sec] - velocity of the top plate\n",
+ "ub = 0.1; \t\t\t #[m/sec] - velocity of the bottom plate\n",
+ "dely = 0.01; \t\t\t #[m]\n",
+ "delux = ut-ub; \t\t #[m/sec]\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula tauyx = F/A = -mu(delux/dely)\n",
+ "tauyx = (Ft-Fb)/A;\n",
+ "mu = tauyx/(-delux/dely); \t\t\t #[Ns/m**2]\n",
+ "mu = mu*10**3; \t\t\t #[cP]\n",
+ "\n",
+ "# Results\n",
+ "print \" The viscosity of toulene in centipose is %.2f cP\"%(mu);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The viscosity of toulene in centipose is 0.55 cP\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.11 - Page No :51\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Predict the diffusion coefficient of water vapor\n",
+ "\n",
+ "# Variables\n",
+ "po = 1.; \t\t\t #[atm] - pressure\n",
+ "p = 2.; \t\t \t #[atm] - pressure\n",
+ "To = 0+273.15; \t\t\t #[K] - temperature\n",
+ "T = 75+273.15; \t\t\t #[K] - temperature\n",
+ "Do = 0.219*10**-4; \t #[m**2/sec];\n",
+ "n = 1.75;\n",
+ "\n",
+ "# Calculations\n",
+ "# usin the formula D = Do*(po/p)*(T/To)**n\n",
+ "D = Do*(po/p)*(T/To)**n;\n",
+ "\n",
+ "# Results\n",
+ "print \"The diffusion coefficient of water vapour in air at %d atm and %d degC is \\nD \\\n",
+ " = %.3e m**2/sec\"%(p,T-273.15,D);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diffusion coefficient of water vapour in air at 2 atm and 75 degC is \n",
+ "D = 1.674e-05 m**2/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2.12 - Page No :52\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the viscosity of air and of water\n",
+ "\n",
+ "from scipy.optimize import fsolve \n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "T = 53+273.15; \t\t\t #[K] - temperature\n",
+ "mu1 = 1.91*10**-5;\n",
+ "mu2 = 2.10*10**-5;\n",
+ "T1 = 313.15; \t\t\t #[K] - temperature \n",
+ "T2 = 347.15; \t\t\t #[K] - temperature\n",
+ "\n",
+ "# Calculations\n",
+ "# for air\n",
+ "# using linear interpolation of the values in table 2.2\n",
+ "def f(a):\n",
+ " return math.log(mu1/a)/math.log(T1);\n",
+ "\n",
+ "def g(a):\n",
+ " return math.log(mu2)-math.log(a)-f(a)*math.log(T2);\n",
+ "\n",
+ "a1 = 10**-7;\n",
+ "A = fsolve(g,a1)\n",
+ "B = f(A);\n",
+ "\n",
+ "# using the formula ln(mu) = lnA+Bln(t)\n",
+ "mu = math.e**(math.log(A)+B*math.log(T))*10**3; \t\t\t #[cP]\n",
+ "\n",
+ "# Results\n",
+ "print \" the viscosity of air at %d degC is %.4f cP\"%(T-273.15,mu);\n",
+ "\n",
+ "# similarly for water\n",
+ "BdivR = 1646;\n",
+ "A = 3.336*10**-8;\n",
+ "mu = A*math.e**(BdivR/T)*10**5 \t\t\t #[cP]\n",
+ "print \" the viscosity of water at %d degC is %.3f cP\"%(T-273.15,mu);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the viscosity of air at 53 degC is 0.0198 cP\n",
+ " the viscosity of water at 53 degC is 0.519 cP\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch3.ipynb b/Transport_Phenomena/ch3.ipynb
new file mode 100644
index 00000000..a369004a
--- /dev/null
+++ b/Transport_Phenomena/ch3.ipynb
@@ -0,0 +1,236 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : The general property balance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.1 - Page No :65\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) Find the heat flux if face 1 is maintained at 0\u00b0C.\n",
+ "(b) If the same flux as in part (a) enters at face 2, find the flux at face 1 if there is\n",
+ "now a uniform generation within the volume of 1.5 X lo6 J mm3 s-l.\n",
+ "'''\n",
+ "\n",
+ "# Variables\n",
+ "a = 0.0006; \t\t #[m**2] - area\n",
+ "l = 0.1; \t\t\t #[m] - length\n",
+ "\n",
+ "# (a) using the fourier law\n",
+ "deltax = 0.1; \t\t #[m] - thickness of copper block\n",
+ "T2 = 100.; \t\t #[degC] - temp on one side of copper block\n",
+ "T1 = 0.; \t\t\t #[degC] - temp on other side of the copper block\n",
+ "k = 380.; \t\t\t #[W/mK] - thermal conductivity\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula (q/A)*deltax = -k*(T2-T1)\n",
+ "g = -k*(T2-T1)/deltax;\n",
+ "print \" a) The steady state heat flux across the copper block is q/A = %5.1e J*m**-2*sec**-1 \"%(g);\n",
+ "\n",
+ "# (b)\n",
+ "V = a*l; \t\t\t #[m**3] - volume\n",
+ "# using the overall balance equation with the accumulation and generation term\n",
+ "Qgen = 1.5*10**6; \t\t\t #[j*m**-3*sec**-1]\n",
+ "SIx = (g*a-Qgen*V)/a;\n",
+ "\n",
+ "# Results\n",
+ "print \" b) the flux at face 1 is %5.1e j*m**-2*sec**-1;the negative sign indicates that the \\\n",
+ "\\nheat flux is from right to left negative x direction\"%(SIx);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " a) The steady state heat flux across the copper block is q/A = -3.8e+05 J*m**-2*sec**-1 \n",
+ " b) the flux at face 1 is -5.3e+05 j*m**-2*sec**-1;the negative sign indicates that the \n",
+ "heat flux is from right to left negative x direction\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.2 - Page No :68\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the temperature profile \n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "# Variables\n",
+ "x = Symbol('x')\n",
+ "SIx2 = -3.8*10**5; \t\t #[j*m**-2*sec**-1] - flux at x = 0.1,i.e through face2\n",
+ "Qgen = 1.5*10**6; \t\t\t #[j*m**-3*sec**-1] - uniform generation in the volume\n",
+ "T2 = 100+273.15; \t\t\t #[K] temperature at face 2\n",
+ "x2 = 0.1; \t\t\t #[m]\n",
+ "k = 380.; \t\t\t #[W/mK] - thermal conductivity\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation der(SIx)*x = SIx+c1;where c1 is tyhe constant of integration\n",
+ "c1 = (Qgen*x2)-SIx2;\n",
+ "SIx = Qgen*x-c1;\n",
+ "\n",
+ "# Results\n",
+ "print \"SIx = \",SIx\n",
+ "print \" where SIx is in units of J m**-2 sec**-1 and x is in units of m\"\n",
+ "\n",
+ "# using the equation -k*T = der(SIx)*x**2-c1*x+c2;where c2 is the constant of integration\n",
+ "c2 = -k*T2-(Qgen*(x2)**2)/2+c1*x2;\n",
+ "T = -(Qgen/k)*x**2+(c1/k)*x-(c2/k);\n",
+ "print \"T = \",T\n",
+ "print \" where T is in units of kelvin K\"\n",
+ "\n",
+ "\n",
+ "# Answer may vary because of rouding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SIx = 1500000.0*x - 530000.0\n",
+ " where SIx is in units of J m**-2 sec**-1 and x is in units of m\n",
+ "T = -3947.36842105263*x**2 + 1394.73684210526*x + 253.413157894737\n",
+ " where T is in units of kelvin K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 3.3 - Page No :69\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "(a) Find the rate of accumulation.\n",
+ "(b) Find the equation for the temperature profile, and determine the temperature\n",
+ "at face 1 after 1 min, if at the start face 2 is at 100\u00b0C.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "from sympy import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "x = Symbol('x')\n",
+ "t = Symbol('t')\n",
+ "hf1 = -270.; \t\t\t #[J/sec] - heat flow at face 1\n",
+ "hf2 = -228.; \t\t\t #[J/sec] - heat flow at face2\n",
+ "Qgen = 1.5*10**6; \t\t #[J*m**-3*sec**-1] generation per unit volume per unit time\n",
+ "v = 6*10**-5; \t\t\t #[m**3] volume\n",
+ "Cp = 0.093; \t\t\t #[cal*g**-1*K**-1] heat capacity of copper\n",
+ "sp = 8.91; \t\t\t #specific gravity of copper\n",
+ "a = 0.0006; \t\t\t #[m**2] - area\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# (a) using the overall balance\n",
+ "acc = hf1-hf2+Qgen*v;\n",
+ "print \"a) the rate of accumulation is %d J/sec \"%(acc);\n",
+ "\n",
+ "# (b) \n",
+ "SIx1 = hf1/a;\n",
+ "SIx2 = hf2/a;\n",
+ "x1 = 0.;\n",
+ "\n",
+ "# solving for the constant of integration c1 in the equation [del(p*cp*T)/delt-der(SIx)]*x = -SIx+c1;\n",
+ "c1 = 0+SIx1;\n",
+ "x2 = 0.1;\n",
+ "g = (-(SIx2)+c1)/x2+Qgen;\n",
+ "SIx = c1-(g-Qgen)*x;\n",
+ "print \"SI(x) = \",\"(b)\",SIx\n",
+ "\n",
+ "# solving for constant of integration c3 in the equation p*cp*T = g*t+c3\n",
+ "T2 = 100+273.15;\n",
+ "t2 = 0;\n",
+ "p = sp*10**3; \t\t\t #[kg/m**3] - density\n",
+ "cp = Cp*4.1840; \t\t\t #[J*kg**-1*K**-1]\n",
+ "c3 = p*cp*T2-g*t2;\n",
+ "T = (g*(10**-3)/(p*cp))*t+c3/(p*cp);\n",
+ "print \"Relationship between T and t at x=0.1m is T = \",T\n",
+ "\n",
+ "# solving for constant of integration c2 in the equation -k*T = der(SIx)*x**2-c1*x+c2\n",
+ "k = 380.; \t\t\t #[w/m**1*K**1]\n",
+ "x2 = 0.1;\n",
+ "c2 = k*T+(3.5*10**5)*x2**2-(4.5*10**5)*x2;\n",
+ "\n",
+ "def T(t,x):\n",
+ " return (-(3.5*10**5)*x**2+(4.5*10**5)*x+87.7*t+1.00297*10**5)/k;\n",
+ "\n",
+ "# at face 1;\n",
+ "x1 = 0.;\n",
+ "t1 = 60.; \t\t\t #[sec]\n",
+ "T1 = T(t1,x1);\n",
+ "print \"Temperature profile as a function of x and t is T = %.2f K, at face 1\"%T1\n",
+ "\n",
+ "# at face 2\n",
+ "x2 = 0.1;\n",
+ "t2 = 60.; \t\t\t # [sec]\n",
+ "T2 = T(t2,x2);\n",
+ "print \"Temperature at face 2 = %.0f K ,at face 2\"%T2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a) the rate of accumulation is 48 J/sec \n",
+ "SI(x) = (b) 700000.0*x - 450000.0\n",
+ "Relationship between T and t at x=0.1m is T = 0.230747847543697*t + 373.15\n",
+ "Temperature profile as a function of x and t is T = 277.79 K, at face 1\n",
+ "Temperature at face 2 = 387 K ,at face 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch4.ipynb b/Transport_Phenomena/ch4.ipynb
new file mode 100644
index 00000000..21c74139
--- /dev/null
+++ b/Transport_Phenomena/ch4.ipynb
@@ -0,0 +1,348 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : molecular transport and the general property balance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.1 - Page No :99\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine the thermal conductivity. \n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "id_ = 2.067; \t\t\t #[in] - inside diameter\n",
+ "t = 0.154; \t\t\t #[in] - wall thickness\n",
+ "od = id_+2*t; \t\t\t #[in] - outer diameter\n",
+ "a = 1.075; \t\t\t #[in**2] - wall sectional area of metal\n",
+ "A = a*(1./144); \t\t #[ft**2] - wall sectional area of metal in ft**2\n",
+ "deltaz = 5./12; \t\t #[ft] - length of transfer in z direction\n",
+ "T2 = 10+273.15; \t\t #[K] - temperature at the top\n",
+ "T1 = 0+273.15; \t\t #[K] - temperature at the bottom\n",
+ "q = -3.2; \t\t\t #[Btu/hr] - heat transferred\n",
+ "\n",
+ "# Calculations\n",
+ "deltaT = (T2-T1)+8; \t\t\t #[degF]\n",
+ "k = round(-(q/A)/(deltaT/deltaz),2);\n",
+ "\n",
+ "# Results\n",
+ "print \"Thermal conductivity = %.2f Btu h**-1 ft**-1 degF**-1\"%(k);\n",
+ "Alm = round((2*math.pi*deltaz*((od-id_)/(2*12)))/math.log(od/id_),3); \t\t\t #[ft**2] log-mean area\n",
+ "kincorrect = round(k*(A/Alm),3);\n",
+ "print \"kincorrect = %.3f Btu h**-1 ft**-1 degF**-1 \"%(kincorrect);\n",
+ "print \"The error is a factor of %.1f\"%(32.4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal conductivity = 9.92 Btu h**-1 ft**-1 degF**-1\n",
+ "kincorrect = 0.306 Btu h**-1 ft**-1 degF**-1 \n",
+ "The error is a factor of 32.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.2 - Page No :100\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the heat loss from a 2-inch\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "T1 = 0.; \t\t\t #[degC]\n",
+ "T2 = 10.; \t \t\t #[degC]\n",
+ "km = 17.17; \t\t\t #[W/m*K]\n",
+ "l = 1.; \t\t \t #[m]\n",
+ "r2 = 1.1875;\n",
+ "r1 = 1.0335;\n",
+ "deltaT = T1-T2;\n",
+ "\n",
+ "# Calculations\n",
+ "# umath.sing the formula Qr = -km*((2*pi*l)/ln(r2/r1))*deltaT;\n",
+ "Qr = -km*((2*math.pi*l)/math.log(r2/r1))*deltaT;\n",
+ "\n",
+ "# Results\n",
+ "print \"Heat loss = %.0f W \\nThe plus sign indicates that the heat flow is radially out from the center\"%(Qr);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat loss = 7767 W \n",
+ "The plus sign indicates that the heat flow is radially out from the center\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 - Page No :100\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Solve Example 4.2 by the log-mean area concept.\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "km = 9.92; \t \t\t #[Btu/h*ft*degF]\n",
+ "Alm = round(0.242*(12./5),3); \t\t\t #[ft**2]\n",
+ "T1 = 0.; \t\t\t #[degC]\n",
+ "T2 = 10.; \t\t\t #[degC]\n",
+ "deltaT = (T1-T2)*1.8; \t\t\t #[degF]\n",
+ "r2 = 1.1875;\n",
+ "r1 = 1.0335;\n",
+ "deltar = round((r2-r1)/12,3); \t\t\t #[ft]\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula Qr/Alm = -km*(deltaT/deltar)\n",
+ "Qr = (-km*Alm*(deltaT/deltar));\n",
+ "\n",
+ "# Results\n",
+ "print \" qr by log-mean area method = %.0f Btu/h\"%(Qr);\n",
+ "\n",
+ "\n",
+ "# in SI units \n",
+ "Alm = 0.177; \t\t\t #[m**2]\n",
+ "T1 = 0; \t\t\t #[degC]\n",
+ "T2 = 10; \t\t\t #[degC]\n",
+ "km = 17.17; \t\t\t #[W/m*K]\n",
+ "r2 = 1.1875;\n",
+ "r1 = 1.0335;\n",
+ "deltaT = T1-T2;\n",
+ "deltar = (r2-r1)*0.0254; \t\t\t #[m]\n",
+ "\n",
+ "# umath.sing the same formula\n",
+ "Qr = (-km*(deltaT/deltar))*Alm;\n",
+ "print \" qr in SI units = %.0f W\"%(Qr);\n",
+ "\n",
+ "# Note : Answers are wrong in book. Please calculate manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " qr by log-mean area method = 7980 Btu/h\n",
+ " qr in SI units = 7769 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 - Page No :101\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine the mass transfer rate for the conical section\n",
+ "\n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "x1 = 0; \t\t\t #[cm]\n",
+ "x2 = 30; \t\t\t #[cm]\n",
+ "p1 = 0.3; \t\t\t #[atm]\n",
+ "p2 = 0.03; \t\t\t #[atm]\n",
+ "D = 0.164; \t\t\t #[am**2/sec]\n",
+ "R = 82.057; \t\t\t #[cm**3*atm/mol*K]\n",
+ "T = 298.15; \t\t\t #[K]\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula Nax*int(dx/Ax) = -(D/RT)*int(1*dpa)\n",
+ "def f4(x): \n",
+ "\t return 1./((math.pi/4)*(10-(x/6))**2)\n",
+ "\n",
+ "a = quad(f4,x1,x2)[0]\n",
+ "\n",
+ "def f5(p): \n",
+ "\t return 1\n",
+ "\n",
+ "b = quad(f5,p1,p2)[0]\n",
+ "Nax = -((D/(R*T))*b)/a;\n",
+ "\n",
+ "# Results\n",
+ "print \"Mass transfer rate = %.2e mol/sec = %.2e mol/h \\nthe plus sign indicates diffusion to the right\"%(Nax,Nax*3600);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass transfer rate = 2.37e-06 mol/sec = 8.53e-03 mol/h \n",
+ "the plus sign indicates diffusion to the right\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 - Page No :105\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the temperature distribution in the steel wire\n",
+ "\n",
+ "from sympy import *\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "r = Symbol('r')\n",
+ "ro = 0.5; \t\t\t #[inch] - outside radius\n",
+ "ro = 0.0127; \t\t #[m] - outside radius in m\n",
+ "Tg = 2.*10**7; \t #[J/m**3*sec] - heat generated by electric current\n",
+ "Tw = 30.; \t\t\t #[degC] - outside surface temperature\n",
+ "km = 17.3; \t\t #[W/m*K] - mean conductivity\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula T = Tw+(Tg/4*km)*(ro**2-r**2)\n",
+ "T = Tw+(Tg/(4*km))*(ro**2-r**2);\n",
+ "\n",
+ "# Results\n",
+ "print \"T = \",T,\n",
+ "print \" where r is in meters and T is in degC\"\n",
+ "def t(r):\n",
+ " return Tw+(Tg/(4*km))*(ro**2-r**2);\n",
+ "\n",
+ "print \"At the centre line r = 0, the maximum temperature is %.1f degC. \\\n",
+ "\\nAt the outside the temperature reduces to the boundary condition value of %.2f degC.\\\n",
+ "\\nThe distribution is parabolic between these 2 limits\"%(t(0),t(0.0127));\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T = -289017.341040462*r**2 + 76.6156069364162 where r is in meters and T is in degC\n",
+ "At the centre line r = 0, the maximum temperature is 76.6 degC. \n",
+ "At the outside the temperature reduces to the boundary condition value of 30.00 degC.\n",
+ "The distribution is parabolic between these 2 limits\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.7 - Page No :119\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determine the viscosity of the fluid.\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "r = 10.**-3; \t\t\t #[m] - radius\n",
+ "l = 1.; \t\t\t #[m] - length\n",
+ "Q = 10.**-7; \t\t\t #[m**3/s] - flow rate\n",
+ "pressure = 1.01325*10**5\n",
+ "sPage_No = 1.1;\n",
+ "pwater = 1000.; \t\t #[kg/m**3] - density of water at 4degC\n",
+ "\n",
+ "# Calculations\n",
+ "deltap = round((145 * pressure)/14.696,-4)\n",
+ "pfluid = sPage_No *pwater;\n",
+ "mu = abs(r*-(deltap)*(math.pi*r**3))/((4*Q)*(2*l));\n",
+ "mupoise = mu*10;\n",
+ "mucentipoise = mupoise*100;\n",
+ "\n",
+ "# Results\n",
+ "print \" mu = %.3f Ns-m**-2 = %.2f poise = %.0f cP\"%(mu,mupoise,mucentipoise);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " mu = 3.927 Ns-m**-2 = 39.27 poise = 3927 cP\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch5.ipynb b/Transport_Phenomena/ch5.ipynb
new file mode 100644
index 00000000..7ab9219f
--- /dev/null
+++ b/Transport_Phenomena/ch5.ipynb
@@ -0,0 +1,381 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Transport with a net convective flux"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9 - Page No :166\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find Uz, and Uz*\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "v = 1.; \t\t\t #[cm/sec] - volume velocity or bulk velocity\n",
+ "vol = 1.; \t\t\t #[cm**3] - volume\n",
+ "na = 2.; \t\t\t # moles of a\n",
+ "nb = 3.; \t\t\t # moles of b\n",
+ "nc = 4.; \t\t\t # moles of c\n",
+ "mma = 2.; \t\t\t #molecular weight of a\n",
+ "mmb = 3.; \t\t\t #molecular weight of b\n",
+ "mmc = 4.; \t\t\t #molecular weight of c\n",
+ "ma = na*mma; \t\t\t #[g] weight of a\n",
+ "mb = nb*mmb; \t\t\t #[g] weight of b\n",
+ "mc = nc*mmc; \t\t\t #[g] weight of c\n",
+ "NabyA = 2.+2; \t\t\t #[mol/cm**2*s] - molar flux = diffusing flux +convected flux\n",
+ "NbbyA = -1.+3; \t\t\t #[mol/cm**2*s] - molar flux = diffusing flux +convected flux\n",
+ "NcbyA = 0.+4; \t\t\t #[mol/cm**2*s] - molar flux = diffusing flux +convected flux\n",
+ "NtbyA = NabyA+NbbyA+NcbyA; \t\t\t #[mol/cm**2*s] - total molar flux\n",
+ "\n",
+ "# Calculations\n",
+ "# on a mass basis,these corresponds to\n",
+ "nabyA = 4.+4; \t\t\t #[g/cm**2*s]; - mass flux = diffusing flux +convected flux\n",
+ "nbbyA = -3.+9; \t\t\t #[g/cm**2*s]; - mass flux = diffusing flux +convected flux\n",
+ "ncbyA = 0.+16; \t\t\t #[g/cm**2*s]; - mass flux = diffusing flux +convected flux\n",
+ "ntbyA = nabyA+nbbyA+ncbyA; \t\t\t #[g/cm**2*s] - total mass flux\n",
+ "\n",
+ "# concentrations are expressed in molar basis\n",
+ "CA = na/vol; \t\t\t #[mol/cm**3]\n",
+ "CB = nb/vol; \t\t\t #[mol/cm**3]\n",
+ "CC = nc/vol; \t\t\t #[mol/cm**3]\n",
+ "CT = CA+CB+CC; \t\t\t #[mol/cm**3] - total concentration\n",
+ "\n",
+ "# densities are on a mass basis\n",
+ "pa = ma/vol; \t\t\t #[g/cm**3]\n",
+ "pb = mb/vol; \t\t\t #[g/cm**3]\n",
+ "pc = mc/vol; \t\t\t #[g/cm**3]\n",
+ "pt = pa+pb+pc; \t\t\t #[g/cm**3]\n",
+ "Ua = NabyA/CA; \t\t\t #[cm/sec];\n",
+ "Ub = NbbyA/CB; \t\t\t #[cm/sec];\n",
+ "Uc = NcbyA/CC; \t\t\t #[cm/sec];\n",
+ "# the same result will be obtained from dividing mass flux by density\n",
+ "Uz = (pa*Ua+pb*Ub+pc*Uc)/(pa+pb+pc);\n",
+ "\n",
+ "# Results\n",
+ "print \" Uz = %.3f cm/sec\"%(Uz);\n",
+ "Uzstar = (NtbyA/CT);\n",
+ "print \" Uz* = %.2f cm/sec\"%(Uzstar);\n",
+ "print \" For this Example both Uz and Uz* are slightly greater than the volume \\\n",
+ " velocity of 1cm/sec, because there is a net molar and \\n mass diffusion in the positive direction.\"\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Uz = 1.034 cm/sec\n",
+ " Uz* = 1.11 cm/sec\n",
+ " For this Example both Uz and Uz* are slightly greater than the volume velocity of 1cm/sec, because there is a net molar and \n",
+ " mass diffusion in the positive direction.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10 - Page No :171\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the fluxes for the problem of Example 5.9.\n",
+ "\n",
+ "# Variables\n",
+ "# given (from Example 5.9)\n",
+ "na = 2.; \t\t\t # moles of a\n",
+ "nb = 3.; \t\t\t # moles of b\n",
+ "nc = 4.; \t\t\t # moles of c\n",
+ "mma = 2.; \t\t\t #molecular weight of a\n",
+ "mmb = 3.; \t\t\t #molecular weight of b\n",
+ "mmc = 4.; \t\t\t #molecular weight of c\n",
+ "ma = na*mma; \t\t\t #[g] weight of a\n",
+ "mb = nb*mmb; \t\t\t #[g] weight of b\n",
+ "mc = nc*mmc; \t\t\t #[g] weight of c\n",
+ "NabyA = 2.+2; \t\t\t #[mol/cm**2*s] - molar flux = diffumath.sing flux +convected flux\n",
+ "NbbyA = -1.+3; \t\t\t #[mol/cm**2*s] - molar flux = diffusing flux +convected flux\n",
+ "NcbyA = 0.+4; \t\t\t #[mol/cm**2*s] - molar flux = diffusing flux +convected flux\n",
+ "NtbyA = NabyA+NbbyA+NcbyA; \t\t\t #[mol/cm**2*s] - total molar flux\n",
+ "vol= 1.\n",
+ "# Calculations\n",
+ "# on a mass basis,these corresponds to\n",
+ "nabyA = 4+4; \t\t\t #[g/cm**2*s]; - mass flux = diffusing flux +convected flux\n",
+ "nbbyA = -3+9; \t\t\t #[g/cm**2*s]; - mass flux = diffusing flux +convected flux\n",
+ "ncbyA = 0+16; \t\t\t #[g/cm**2*s]; - mass flux = diffusing flux +convected flux\n",
+ "\n",
+ "# concentrations are expressed in molar basis\n",
+ "CA = na/vol; \t\t\t #[mol/cm**3]\n",
+ "CB = nb/vol; \t\t\t #[mol/cm**3]\n",
+ "CC = nc/vol; \t\t\t #[mol/cm**3]\n",
+ "CT = CA+CB+CC; \t\t #[mol/cm**3] - total concentration\n",
+ "\n",
+ "# densities are on a mass basis\n",
+ "pa = ma/vol; \t\t\t #[g/cm**3]\n",
+ "pb = mb/vol; \t\t\t #[g/cm**3]\n",
+ "pc = mc/vol; \t\t\t #[g/cm**3]\n",
+ "Ua = NabyA/CA; \t\t\t #[cm/sec];\n",
+ "Ub = NbbyA/CB; \t\t\t #[cm/sec];\n",
+ "Uc = NcbyA/CC; \t\t\t #[cm/sec];\n",
+ "U = (pa*Ua+pb*Ub+pc*Uc)/(pa+pb+pc);\n",
+ "Ustar = (NtbyA/CT);\n",
+ "\n",
+ "# the fluxes relative to mass average velocities are found as follows\n",
+ "JabyA = CA*(Ua-U); \t\t\t #[mol/cm**2*sec]\n",
+ "JbbyA = CB*(Ub-U); \t\t\t #[mol/cm**2*sec]\n",
+ "JcbyA = CC*(Uc-U); \t\t\t #[mol/cm**2*sec]\n",
+ "\n",
+ "# Results\n",
+ "print \" fluxes relative to mass average velocities are-\";\n",
+ "print \" Ja/A = %.4f mol/cm**2*sec\"%(JabyA);\n",
+ "print \" Jb/A = %.4f mol/cm**2*sec\"%(JbbyA);\n",
+ "print \" Jc/A = %.4f mol/cm**2*sec\"%(JcbyA);\n",
+ "jabyA = pa*(Ua-U); \t\t\t #[g/cm**2*sec]\n",
+ "jbbyA = pb*(Ub-U); \t\t\t #[g/cm**2*sec]\n",
+ "jcbyA = pc*(Uc-U); \t\t\t #[g/cm**2*sec]\n",
+ "print \" ja/A = %.4f g/cm**2*sec\"%(jabyA);\n",
+ "print \" jb/A = %.4f g/cm**2*sec\"%(jbbyA);\n",
+ "print \" jc/A = %.4f g/cm**2*sec\"%(jcbyA);\n",
+ "\n",
+ "# the fluxes relative to molar average velocity are found as follows\n",
+ "JastarbyA = CA*(Ua-Ustar); \t\t\t #[mol/cm**2*sec]\n",
+ "JbstarbyA = CB*(Ub-Ustar); \t\t\t #[mol/cm**2*sec]\n",
+ "JcstarbyA = CC*(Uc-Ustar); \t\t\t #[mol/cm**2*sec]\n",
+ "print \" fluxes relative to molar average velocities are-\";\n",
+ "print \" Ja*/A = %.4f mol/cm**2*sec\"%(JastarbyA);\n",
+ "print \" Jb*/A = %.4f mol/cm**2*sec\"%(JbstarbyA);\n",
+ "print \" Jc*/A = %.4f mol/cm**2*sec\"%(JcstarbyA);\n",
+ "jastarbyA = pa*(Ua-Ustar); \t\t\t #[g/cm**2*sec]\n",
+ "jbstarbyA = pb*(Ub-Ustar); \t\t\t #[g/cm**2*sec]\n",
+ "jcstarbyA = pc*(Uc-Ustar); \t\t\t #[g/cm**2*sec]\n",
+ "print \" ja*/A = %.4f g/cm**2*sec\"%(jastarbyA);\n",
+ "print \" jb*/A = %.4f g/cm**2*sec\"%(jbstarbyA);\n",
+ "print \" jc*/A = %.4f g/cm**2*sec\"%(jcstarbyA);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " fluxes relative to mass average velocities are-\n",
+ " Ja/A = 1.9310 mol/cm**2*sec\n",
+ " Jb/A = -1.1034 mol/cm**2*sec\n",
+ " Jc/A = -0.1379 mol/cm**2*sec\n",
+ " ja/A = 3.8621 g/cm**2*sec\n",
+ " jb/A = -3.3103 g/cm**2*sec\n",
+ " jc/A = -0.5517 g/cm**2*sec\n",
+ " fluxes relative to molar average velocities are-\n",
+ " Ja*/A = 1.7778 mol/cm**2*sec\n",
+ " Jb*/A = -1.3333 mol/cm**2*sec\n",
+ " Jc*/A = -0.4444 mol/cm**2*sec\n",
+ " ja*/A = 3.5556 g/cm**2*sec\n",
+ " jb*/A = -4.0000 g/cm**2*sec\n",
+ " jc*/A = -1.7778 g/cm**2*sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11 - Page No :176\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find the rate of diffusion for \n",
+ "(a) steady-state equimolar counter diffusion and \n",
+ "(b) steady-state diffusion of CO, through stagnant HZ.\n",
+ "'''\n",
+ "\n",
+ "import math\n",
+ "# Variables\n",
+ "# given\n",
+ "T = 0+273.15; \t\t\t #[K] - temperature in Kelvins\n",
+ "pa2 = 1.5; \t\t\t #[atm] - partial presuure of a at point2\n",
+ "pa1 = 0.5; \t\t\t #[atm] - partial pressure of a at point 1\n",
+ "z2 = 20.; \t\t\t #[cm] - position of point 2 from reference point\n",
+ "z1 = 0.; \t\t\t #[cm] - position of point1 from reference point\n",
+ "p = 2.; \t\t\t #[atm] - total pressure\n",
+ "d = 1.; \t\t\t #[cm] - diameter\n",
+ "D = 0.275; \t\t #[cm**2/sec] - diffusion coefficient\n",
+ "A = (math.pi*((d)**2))/4.;\n",
+ "R = 0.082057; \t\t\t #[atm*m**3*kmol**-1*K**-1] - gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "# (a) using the formula Na/A = -(D/(R*T))*((pa2-pa1)/(z2-z1))\n",
+ "Na = (-(D/(R*T))*((pa2-pa1)/(z2-z1)))*(A)/(10.**6);\n",
+ "print \" Na = %.2e kmol/sec \\n The negative sign indicates diffusion from point 2 to point 1\"%(Na);\n",
+ "pb2 = p-pa2;\n",
+ "pb1 = p-pa1;\n",
+ "\n",
+ "# (b) using the formula Na/A = ((D*p)/(R*T*(z2-z1)))*ln(pb2/pb1)\n",
+ "Na = (((D*p)/(R*T*(z2-z1)))*math.log(pb2/pb1))*(A)/(10**6);\n",
+ "\n",
+ "# Results\n",
+ "print \" Na = %.2e kmol/sec\"%(Na);\n",
+ "print \" The induced velocity increases the net transport of A by the ratio of 10.6*10**-10 \\\n",
+ "to 4.82*10**-10 or 2.2 times.This increse is equivalent to 120 percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Na = -4.82e-10 kmol/sec \n",
+ " The negative sign indicates diffusion from point 2 to point 1\n",
+ " Na = -1.06e-09 kmol/sec\n",
+ " The induced velocity increases the net transport of A by the ratio of 10.6*10**-10 to 4.82*10**-10 or 2.2 times.This increse is equivalent to 120 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12 - Page No :178\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Repeat Example 5.11, this time assuming that Nr, is 0.75N, in magnitude \n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "T = 0+273.15; \t\t\t #[K] - temperature in Kelvins\n",
+ "pa2 = 1.5; \t\t\t #[atm] - partial presuure of a at point2\n",
+ "pa1 = 0.5; \t\t\t #[atm] - partial pressure of a at point 1\n",
+ "z2 = 20.; \t\t\t #[cm] - position of point 2 from reference point\n",
+ "z1 = 0.; \t\t\t #[cm] - position of point1 from reference point\n",
+ "p = 2.; \t\t\t #[atm] - total pressure\n",
+ "d = 1.; \t\t\t #[cm] - diameter\n",
+ "D = 0.275; \t\t\t #[cm**2/sec] - diffusion coefficient\n",
+ "\n",
+ "# Calculations\n",
+ "A = (math.pi*((d)**2.))/4;\n",
+ "R = 0.082057; \t\t\t #[atm*m**3*kmol**-1*K**-1] - gas consmath.tant\n",
+ "k = 0.75;\n",
+ "\n",
+ "# umath.sing the formula (Na/A) = -(D/(R*T*(z2-z1)))*ln((1-(pa2/p)*(1-k))/(1-(pa1/p)*(1-k)))\n",
+ "NabyA = -(D/(R*T*(z2-z1)))*(2*0.7854)*math.log((1-(pa2/p)*(1-k))/(1-(pa1/p)*(1-k)))/(10**6);\n",
+ "\n",
+ "# Results\n",
+ "print \" Na/A = %.2e kmol/sec\"%(NabyA);\n",
+ "print \" Note that this answer is larger than the rate for equimolar counter diffusion \\\n",
+ "but smaller tahn the rate for diffusion through a stagnant film. \\nSometimes the\\\n",
+ " rate for diffusin through a stagnant film can be considered as an upper bound\\\n",
+ " if k ties between zero and one\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Na/A = 1.38e-10 kmol/sec\n",
+ " Note that this answer is larger than the rate for equimolar counter diffusion but smaller tahn the rate for diffusion through a stagnant film. \n",
+ "Sometimes the rate for diffusin through a stagnant film can be considered as an upper bound if k ties between zero and one\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13 - Page No :184\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the pressure in the other end\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "l = 4.; \t\t\t #[m] - length of the tube\n",
+ "id_ = 1.6*10**-3; \t\t\t #[m] - insid_e diameter\n",
+ "Nkn = 10.; \t\t \t # - knudsen no.\n",
+ "Ma = 92.; \t\t\t # - molecular weight of gas\n",
+ "mu = 6.5*10**-4; \t\t\t #[kg/m*sec] - vismath.cosity\n",
+ "T = 300.; \t \t\t #[K] - temperature\n",
+ "R = 8314.; \t \t\t #[kPa*m**3*kmol**-1*K**-1] - gas consmath.tant\n",
+ "lambdaA = Nkn*id_; \t\t\t #[m] mean free path\n",
+ "\n",
+ "# Calculations\n",
+ "# for calculating pressure umath.sing the formula lamdaA = 32*(mu/p)*((R*T)/(2*pi*Ma))**(1/2)\n",
+ "p = 32*(mu/lambdaA)*((R*T)/(2*math.pi*Ma))**(1/2.);\n",
+ "patm = p/(1.01325*10**5);\n",
+ "\n",
+ "# Results\n",
+ "print \" p = %.2f kg/m*sec**2 = %.2f Pa = %.2e atm\"%(p,p,patm);\n",
+ "print \" The value of 10 for the knudsen number is on the border \\\n",
+ " between Knudsen diffusion and transition flow\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " p = 85.39 kg/m*sec**2 = 85.39 Pa = 8.43e-04 atm\n",
+ " The value of 10 for the knudsen number is on the border between Knudsen diffusion and transition flow\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch6.ipynb b/Transport_Phenomena/ch6.ipynb
new file mode 100644
index 00000000..0a721fc2
--- /dev/null
+++ b/Transport_Phenomena/ch6.ipynb
@@ -0,0 +1,472 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Turbulent Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 - Page No :200\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "determine\n",
+ "whether the flow is laminar, turbulent, or transitional. At M\u2019F, the viscosity of\n",
+ "water is 0.8007 cP, and the density of water is 0.99568 g cmm3.\n",
+ "'''\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "q = 50.; \t\t\t #[gal/min] - volumetric flow rate\n",
+ "d = 2.067/12; \t \t\t #[ft] - diameter\n",
+ "A = 0.02330; \t\t #[ft**2] - flow area\n",
+ "p = 0.99568*62.43; \t\t\t #[lb/ft**3] - density of water at 86degF\n",
+ "mu = 0.8007*6.72*10**-4; \t\t #[lb/ft*sec] - viscosity of water at 86degF\n",
+ "u = q/(60.*7.48*A);\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula Nre = d*u*p/mu;\n",
+ "Nre = round((d*u*p)/mu,-2);\n",
+ "\n",
+ "# Results\n",
+ "print \"Nre = \",Nre\n",
+ "print \"Hence the flow is turbulent. Note also that Nre is dimensionless\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nre = 95100.0\n",
+ "Hence the flow is turbulent. Note also that Nre is dimensionless\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 - Page No :202\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Calculate the location along a flat plate (Fig. 6.2) where transition\n",
+ "would be expected to occur for a free stream velocity of 4.78fts-\u2019 for water at\n",
+ "86\u00b0F.\n",
+ "'''\n",
+ "# Variables\n",
+ "# given\n",
+ "p = 0.99568*62.43; \t\t\t #[lb/ft**3] - density of water at 86degF\n",
+ "mu = 0.8007*6.72*10**-4; \t\t #[lb/ft*sec] - viscosity of water at 86degF\n",
+ "u = 4.78; \t\t\t #[ft/sec] - free stream velocity \n",
+ "Nre = 5.*10**5; \t\t\t # the lower limit for the transition reynolds number range is substituted\n",
+ "\n",
+ "# Calculations\n",
+ "x = (Nre*mu)/(p*u);\n",
+ "\n",
+ "# Results\n",
+ "print \"x = %.1f\"%x\n",
+ "print \"Thus the transition could star at about %.2f ft. \\\n",
+ "\\nThe reynolds number at the upper end of the transition range is %.0e .\\\n",
+ "\\nThe value of x at this location is ten times then the value obtained above i.e %.1f ft\"%(x,Nre*10,x*10)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 0.9\n",
+ "Thus the transition could star at about 0.91 ft. \n",
+ "The reynolds number at the upper end of the transition range is 5e+06 .\n",
+ "The value of x at this location is ten times then the value obtained above i.e 9.1 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 - Page No :212\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the mean velocity for the flow data in Table 6.2.\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "t = [0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12];\n",
+ "Ux = [3.84, 3.50, 3.80, 3.60, 4.20, 4.00, 3.00, 3.20, 3.40, 3.00, 3.50, 4.30, 3.80];\n",
+ "Uy = [0.43, 0.21, 0.18, 0.30, 0.36, 0.28, 0.35, 0.27, 0.21, 0.22, 0.23, 0.36, 0.35];\n",
+ "Uz = [0.19, 0.16, 0.17, 0.13, 0.09, 0.10, 0.16, 0.15, 0.13, 0.18, 0.17, 0.18, 0.17];\n",
+ "# using the formula AREA = [deltat/2]*[U1+U13+2*[U2+U3+U4+U5+U6+U7+U8+U9+U10+U11+U12]]\n",
+ "# for Uxmean\n",
+ "deltat = 0.01;\n",
+ "T = t[12]-t[0];\n",
+ "\n",
+ "# Calculation and Results\n",
+ "AREA = (deltat/2)*(Ux[0]+Ux[12]+2*(Ux[1]+Ux[2]+Ux[3]+Ux[4]+Ux[5]+Ux[6]+Ux[7]+Ux[8]+Ux[9]+Ux[10]+Ux[11]));\n",
+ "Uxmean = AREA/T;\n",
+ "print \"Uxmean = %.2f m s**-1\"%Uxmean\n",
+ "\n",
+ "# for Uymean\n",
+ "deltat = 0.01;\n",
+ "AREA = (deltat/2)*(Uy[0]+Uy[12]+2*(Uy[1]+Uy[2]+Uy[3]+Uy[4]+Uy[5]+Uy[6]+Uy[7]+Uy[8]+Uy[9]+Uy[10]+Uy[11]));\n",
+ "Uymean = AREA/T;\n",
+ "print \"Uymean = %.2f m s**-1\"%Uymean\n",
+ "\n",
+ "# for Uzmean\n",
+ "AREA = (deltat/2)*(Uz[0]+Uz[12]+2*(Uz[1]+Uz[2]+Uz[3]+Uz[4]+Uz[5]+Uz[6]+Uz[7]+Uz[8]+Uz[9]+Uz[10]+Uz[11]));\n",
+ "Uzmean = AREA/T;\n",
+ "print \"Uzmean = %.2f m s**-1\"%Uzmean\n",
+ "U = (Uxmean**2+Uymean**2+Uzmean**2)**(1./2);\n",
+ "print \"U = %.3f m s**-1\"%U\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Uxmean = 3.61 m s**-1\n",
+ "Uymean = 0.28 m s**-1\n",
+ "Uzmean = 0.15 m s**-1\n",
+ "U = 3.624 m s**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page no : 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Express the cross term as a ratio to the r.m.s. values\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "#Following values are taken from example 6.3\n",
+ "U_dash_z2 = 8.917*10**-4 #m**2s**-2 square velocity\n",
+ "Uz2 = .02340 #m**2s**-2\n",
+ "U_dash_x2 = 8.947 * 10**-4 #m**2s**-2\n",
+ "Ux22 = .02409 #m**2s**-2\n",
+ "U = 3.634\n",
+ "U2x = 3.63 #m**2s**-2\n",
+ "U2x2 = .41 #m**2s**-2\n",
+ "Ix = 11.37 #percent\n",
+ "U2y = .0288 #m**2s**-2\n",
+ "U2y2 = .069 #m**2s**-2\n",
+ "Iy = 1.92 #percent\n",
+ "dt = .01108\n",
+ "\n",
+ "# Calculation\n",
+ "rmsUz = math.sqrt(U_dash_z2)\n",
+ "rmsUx = math.sqrt(Uz2)\n",
+ "rmsUx2 = math.sqrt(U_dash_x2)\n",
+ "rmsUx2 = math.sqrt(Ux22)\n",
+ "I = 100*rmsUz/U\n",
+ "Ux = 3.84 - 3.61\n",
+ "Uy = .43 - .28\n",
+ "UxUy = Ux*Uy\n",
+ "ratio = dt/(U2x2*U2y2)\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \"I = %.2f percent\"%I\n",
+ "print \"U'xU'y = %.4f m**2s**-2\"%UxUy\n",
+ "print \"The ratio = %.2f \"%ratio"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = 0.82 percent\n",
+ "U'xU'y = 0.0345 m**2s**-2\n",
+ "The ratio = 0.39 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 - Page No :232\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# prepare a graph of E./v versus (1 - r/To).\n",
+ "\n",
+ "%pylab inline\n",
+ "\n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "UzmaxbyU = 24.83;\n",
+ "roUbyv = 2312.;\n",
+ "Re = 100000.;\n",
+ "\n",
+ "# using the formula Et/v = 95.5*((r/ro)/slope)-1\n",
+ "# from fig 6.6 at Re = 100000\n",
+ "rbyro = [0, 0.040, 0.100, 0.200, 0.300, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.960, 1]\n",
+ "slope = [0, 0.105, 0.112, 0.126, 0.144, 0.168, 0.201, 0.252, 0.336, 0.503, 1.007, 2.517, 94.59]\n",
+ "\n",
+ "# Calculations\n",
+ "Etbyv = zeros(13)\n",
+ "for i in range(1,13):\n",
+ " Etbyv[i] = 95.5*((rbyro[i])/slope[i])-1;\n",
+ "\n",
+ "# Results\n",
+ "plot(rbyro,Etbyv);\n",
+ "suptitle(\"Eddy viscosity ratio (E,/v) versus dimensionless radius.\")\n",
+ "xlabel(\"r/ro\")\n",
+ "ylabel(\"Er/v\")\n",
+ "\n",
+ "show()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEhCAYAAABlUDcAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVFUfBvBnwH17VRRMMBc0jWHHUBQUNUVcckkEtzeX\nctfMbFErMcutzLSslzIz10A0tVTUStwVRFJcsjQwQBFcEgWR7bx/nBhBB2WZmTszPN/Ph48wy52H\nyzi/e8859xyVEEKAiIjoIRZKByAiIuPEAkFERFqxQBARkVYsEEREpBULBBERacUCQUREWrFAFMPS\n0hJubm6ar8WLFz/ymMjISPTt21fr85s1a4abN2+WK8OVK1cQEBBQrm08SUxMDF599VUAwP79+3H0\n6FG9vM6pU6ewa9cuzc8//vgjFi1aVKpt/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+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.7 page no : 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the velocity distribution by the various methods available\n",
+ "# for the flow of cyclohexane at 2.778 ft s- \u2019 (0.8467 m s-\u2018) and 25\u00b0C in a 2-inch I.D.\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "do = .0508\n",
+ "Uz = .8467 # cyclohexane\n",
+ "aveP = 774.9 # the density of cyclohexane\n",
+ "u = 8.892*10**-4 # the viscosity\n",
+ "aveF = .00570\n",
+ "\n",
+ "# Calculation\n",
+ "Nre = do*Uz*aveP/u\n",
+ "rw = (1./2)*aveP*(Uz**2)*aveF\n",
+ "U = math.sqrt(rw/aveP)\n",
+ "\n",
+ "# for y = .001\n",
+ "y001 = (2.54*10**-5)*U*aveP/u\n",
+ "ratio = 1 + (U)*(-0.1775)/(1.029)\n",
+ "\n",
+ "Uz = U*22.77\n",
+ "# Results\n",
+ "print \"Nre = %.2e \"%Nre\n",
+ "print \"The wall shear stress rw = %.3f N m**-2\"%rw\n",
+ "print \"The friction velocity U* = %.5f m s*-1\"%U\n",
+ "print \"Universal velocity Distribution :\" \n",
+ "print \"for y = 0.001 = %d \"%y001\n",
+ "print \"Velocity ratio = %.3f\"%ratio\n",
+ "print \"Uz = %.3f m s**-1\"%Uz"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nre = 3.75e+04 \n",
+ "The wall shear stress rw = 1.583 N m**-2\n",
+ "The friction velocity U* = 0.04520 m s*-1\n",
+ "Universal velocity Distribution :\n",
+ "for y = 0.001 = 1 \n",
+ "Velocity ratio = 0.992\n",
+ "Uz = 1.029 m s**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8 Pageno :250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Estimate the temperature distribution in water\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "Cp = 4184. # lg-K-=4184Jkg-K-*\n",
+ "P = 1000. # g cm**-3\n",
+ "k = 0.628 # wm**-1\n",
+ "Nre = 1.2*10**5\n",
+ "v = 1*10**-6\n",
+ "do = 2*0.05\n",
+ "\n",
+ "# calculation\n",
+ "alpha = k/(P*Cp)\n",
+ "qa = (1.7*10**4)/(P*Cp)\n",
+ "Uz = Nre*v/(do)\n",
+ "U = Uz*math.sqrt(.0045/2)\n",
+ "y = (5*v)/U\n",
+ "\n",
+ "# Results\n",
+ "print \"A = %.3e m**2s**-2\"%alpha\n",
+ "print \"The average velocity = %.2f m s**-1\"%Uz\n",
+ "print \"U* = %.5f m s**-1\"%U\n",
+ "print \"the value of y = %.3e cm\"%y\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 1.501e-07 m**2s**-2\n",
+ "The average velocity = 1.20 m s**-1\n",
+ "U* = 0.05692 m s**-1\n",
+ "the value of y = 8.784e-05 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 - Page No :258\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Compute the Fanning friction factor.\n",
+ "\n",
+ "# Variables\n",
+ "p = 0.84*62.4; \t\t\t #[lbf/ft**3] - density\n",
+ "dP = 80.*144; \t\t\t #[lbf/ft**2] - pressure\n",
+ "dz = 2000.; \t\t\t #[ft] - length of pipe\n",
+ "gc = 32.174; \t\t\t #[(lbm*ft)/(lbf*sec**2)] - gravitational conversion consmath.tant\n",
+ "dpbydz = -dP/dz;\n",
+ "do = 2.067/12; \t\t\t #[ft]\n",
+ "\n",
+ "# Calculations\n",
+ "U = 2000*(1./24)*(1./3600)*(42)*(1./7.48)*(1./0.02330);\n",
+ "# using the formula f = ((do/2)*(-dp/dz)*gc)/(p*(U)**2)\n",
+ "f = ((do/2)*(-dpbydz)*gc)/(p*(U)**2)\n",
+ "\n",
+ "# Results\n",
+ "print \"f = %.5f (dimensionless)\"%f\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "f = 0.00979 (dimensionless)\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch7.ipynb b/Transport_Phenomena/ch7.ipynb
new file mode 100644
index 00000000..917619d0
--- /dev/null
+++ b/Transport_Phenomena/ch7.ipynb
@@ -0,0 +1,1040 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Integral methods of analysis"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 - Page No :273\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "How long will it take to remove one-half of the contents? How long will it take to empty the tank?\n",
+ "'''\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "id_ = 4.; \t\t\t #[m] - insid_e diameter\n",
+ "h = 2.; \t\t\t #[m] - water level\n",
+ "ro = 0.03; \t\t\t #[m] - radius of exit hole\n",
+ "rt = id_/2.; \t\t\t #[m] - insid_e radius\n",
+ "g = 9.80665; \t\t\t #[m/sec**2] - gravitational acceleration\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation dh/h**(1/2) = -((ro**2)/(rt**2))*(2*g)**(1/2)dt and integrating between h = 2 and h = 1\n",
+ "def f6(h): \n",
+ "\t return (1./h**(1./2))*(1./(-((ro**2)/(rt**2))*(2*g)**(1./2)))\n",
+ "\n",
+ "t1 = quad(f6,2,1)[0]\n",
+ "\n",
+ "# Results\n",
+ "print \" Time required to remove half of the contents of the tank is t = %.2f sec = %.2f min\"%(t1,t1/60);\n",
+ "\t\t\t #integrating between h = 2 and h = 0\n",
+ "\n",
+ "def f7(h): \n",
+ "\t return (1./h**(1./2))*(1./(-((ro**2)/(rt**2))*(2*g)**(1./2)))\n",
+ "\n",
+ "t2 = quad(f7,2,0)[0]\n",
+ "\n",
+ "print \" Time required to empty the tank fully is t = %.1f sec = %.1f min\"%(t2,t2/60);\n",
+ "\n",
+ "ro2 = (h**2)*math.sqrt(h*h/g)/(10*60)\n",
+ "print \" Ro**2 = %.6f m**2\"%ro2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Time required to remove half of the contents of the tank is t = 831.37 sec = 13.86 min\n",
+ " Time required to empty the tank fully is t = 2838.5 sec = 47.3 min\n",
+ " Ro**2 = 0.004258 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3 - Page No :274\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the flue (exit) gas composition.\n",
+ "\n",
+ "# Variables\n",
+ "# composition of fuel gas\n",
+ "nH2 = 24.;\n",
+ "nN2 = 0.5;\n",
+ "nCO = 5.9;\n",
+ "nH2S = 1.5;\n",
+ "nC2H4 = 0.1;\n",
+ "nC2H6 = 1;\n",
+ "nCH4 = 64;\n",
+ "nCO2 = 3.0;\n",
+ "\n",
+ "# Calculations\n",
+ "# calculating the theoritical amount of O2 required\n",
+ "nO2theoreq = 12+2.95+2.25+0.30+3.50+128;\n",
+ "# since fuel gas is burned with 40% excess O2,then O2 required is\n",
+ "nO2req = 1.4*nO2theoreq;\n",
+ "nair = nO2req/0.21; \t\t\t # as amount of O2 in air is 21%\n",
+ "nN2air = nair*(0.79); \t\t\t # as amount of N2 in air is 79%\n",
+ "nN2 = nN2+nN2air;\n",
+ "nO2 = nO2req-nO2theoreq;\n",
+ "nH2O = 24+1.5+0.2+3.0+128;\n",
+ "nCO2formed = 72.1;\n",
+ "nCO2 = nCO2+nCO2formed;\n",
+ "nSO2 = 1.5;\n",
+ "ntotal = nSO2+nCO2+nO2+nN2+nH2O;\n",
+ "mpSO2 = (nSO2/ntotal)*100;\n",
+ "mpCO2 = (nCO2/ntotal)*100;\n",
+ "mpO2 = (nO2/ntotal)*100;\n",
+ "mpN2 = (nN2/ntotal)*100;\n",
+ "mpH2O = (nH2O/ntotal)*100;\n",
+ "\n",
+ "\n",
+ "# Results\n",
+ "print \" gas N2 O2 H2O CO2 SO2\";\n",
+ "print \" moles %.1f %.1f %.1f %.1f %.1f\"%(nN2,nO2,nH2O,nCO2,nSO2);\n",
+ "print \" mole percent %.1f %.1f %.1f %.1f %.1f\"%(mpN2,mpO2,mpH2O,mpCO2,mpSO2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " gas N2 O2 H2O CO2 SO2\n",
+ " moles 785.2 59.6 156.7 75.1 1.5\n",
+ " mole percent 72.8 5.5 14.5 7.0 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4 - Page No :280\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the force exerted by the elbow on the fluid.\n",
+ "import math\n",
+ "# Variables\n",
+ "# given\n",
+ "id_ = 6.; \t\t\t #[inch] - inlet diameter\n",
+ "od = 4.; \t\t\t #[inch] - outlet diameter\n",
+ "Q = 10.; \t\t\t #[ft**3/sec] - water flow rate\n",
+ "alpha2 = math.pi/3; #[radians] - angle of reduction of elbow\n",
+ "alpha1 = 0.;\n",
+ "p1 = 100.; \t\t #[psi] - absolute inlet pressure\n",
+ "p2 = 29.; \t\t\t #[psi] - absolute outlet pressure\n",
+ "\n",
+ "# Calculations\n",
+ "S1 = (math.pi*((id_/12)**2))/4.;\n",
+ "S2 = (math.pi*((od/12)**2))/4.;\n",
+ "U1 = Q/S1;\n",
+ "U2 = Q/S2;\n",
+ "mu = 6.72*10**-4; \t #[lb*ft**-1*sec**-1]\n",
+ "p = 62.4; \t\t\t #[lb/ft**3]\n",
+ "Nrei = ((id_/12.)*U1*p)/(mu);\n",
+ "\n",
+ "# Results\n",
+ "print \"Nre(inlet) = %.1e\"%Nrei\n",
+ "Nreo = round(((od/12)*U2*p)/(mu),-4);\n",
+ "print \"Nre(outlet) = %.1e \"%Nreo\n",
+ "\n",
+ "# thus\n",
+ "b = 1.;\n",
+ "w1 = p*Q; \t\t\t #[lb/sec] - mass flow rate\n",
+ "w2 = w1;\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# using the equation (w/gc)*((U1)*(math.cos(alpha1))-(U2)*(math.cos(alpha2)))+p1*S1*math.cos(alpha1)-p2*S2*math.cos(alpha2)+Fextx = 0;\n",
+ "Fextx = -(w1/gc)*((U1)*(math.cos(alpha1))-(U2)*(math.cos(alpha2)))-p1*144*S1*math.cos(alpha1)+p2*144*S2*math.cos(alpha2);\n",
+ "print \"Fext,x = %.0f lb\"%Fextx\n",
+ "Fexty = -(w1/gc)*((U1)*(math.sin(alpha1))-(U2)*(math.sin(alpha2)))-p1*144*S1*math.sin(alpha1)+p2*144*S2*math.sin(alpha2);\n",
+ "print \"Fext,y = %.0f lb \"%Fexty\n",
+ "print \"The forces Fext,x and Fext,y are the forces exerted on the fluid_ by the elbow.\\\n",
+ "\\nFext,x acts to the left and Fext,y acts in the positive y direction.\\\n",
+ "\\nNote that the elbow is horizantal,and gravity acts in the z direction\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nre(inlet) = 2.4e+06\n",
+ "Nre(outlet) = 3.6e+06 \n",
+ "Fext,x = -2522 lb\n",
+ "Fext,y = 2240 lb \n",
+ "The forces Fext,x and Fext,y are the forces exerted on the fluid_ by the elbow.\n",
+ "Fext,x acts to the left and Fext,y acts in the positive y direction.\n",
+ "Note that the elbow is horizantal,and gravity acts in the z direction\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5 - Page No : 282\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Repeat Example 7.4 using the force balance concept\n",
+ "\n",
+ "import numpy\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "id_ = 6.; \t\t\t #[inch] - inlet diameter\n",
+ "od = 4.; \t\t\t #[inch] - outlet diameter\n",
+ "Q = 10.; \t\t\t #[ft**3/sec] - water flow rate\n",
+ "alpha2 = math.pi/3; #[radians] - angle of reduction of elbow\n",
+ "alpha1 = 0.;\n",
+ "p1 = 100.; \t\t #[psi] - absolute inlet pressure\n",
+ "p2 = 29.; \t\t\t #[psi] - absolute outlet pressure\n",
+ "\n",
+ "# Calculations\n",
+ "S1 = (math.pi*((id_/12)**2))/4.;\n",
+ "S2 = (math.pi*((od/12)**2))/4.;\n",
+ "U1 = Q/S1;\n",
+ "U2 = Q/S2;\n",
+ "mu = 6.72*10**-4; \t #[lb*ft**-1*sec**-1]\n",
+ "p = 62.4; \t\t\t #[lb/ft**3]\n",
+ "Nrei = ((id_/12.)*U1*p)/(mu);\n",
+ "\n",
+ "Fextx = -(w1/gc)*((U1)*(math.cos(alpha1))-(U2)*(math.cos(alpha2)))-p1*144*S1*math.cos(alpha1)+p2*144*S2*math.cos(alpha2);\n",
+ "Fexty = -(w1/gc)*((U1)*(math.sin(alpha1))-(U2)*(math.sin(alpha2)))-p1*144*S1*math.sin(alpha1)+p2*144*S2*math.sin(alpha2);\n",
+ "#Fextx = -2522.; \t\t\t #[lb] - force in x direction\n",
+ "#Fexty = 2240.; \t\t\t #[lb] - force in y direction\n",
+ "\n",
+ "# Calculations\n",
+ "# the force exerted by the elbow on the fluid is the resolution of Fext,x and Fext,y , therefore\n",
+ "Fext = ((Fextx)**2+(Fexty)**2)**(1./2);\n",
+ "alpha = 180. - 41.6\n",
+ "\n",
+ "# Results\n",
+ "print \" the force has a magnitude of %.0f lb and a direction of %.1f from \\\n",
+ "\\nthe positive x directionin the second quadrant\"%(Fext,alpha);\n",
+ "\n",
+ "# Note : answers in book is wrong. they have used wrong values everywhere. Please check it manually."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the force has a magnitude of 3373 lb and a direction of 138.4 from \n",
+ "the positive x directionin the second quadrant\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 - Page No :283\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the force exerted by the bolts on the flanges.\n",
+ "\n",
+ "# Variables\n",
+ "id_ = 6.; \t\t\t #[inch] - inlet diameter\n",
+ "od = 4.; \t\t\t #[inch] - outlet diameter\n",
+ "Q = 10.; \t\t\t #[ft**3/sec] - water flow rate\n",
+ "alpha2 = math.pi/3; #[radians] - angle of reduction of elbow\n",
+ "alpha1 = 0.;\n",
+ "p1 = 100.; \t\t #[psi] - absolute inlet pressure\n",
+ "p2 = 29.; \t\t\t #[psi] - absolute outlet pressure\n",
+ "patm = 14.7; \t\t #[psi] - atmospheric pressure\n",
+ "p1gauge = p1-patm;\n",
+ "p2gauge = p2-patm;\n",
+ "S1 = (math.pi*((id_/12.)**2))/4.;\n",
+ "S2 = (math.pi*((od/12.)**2))/4.;\n",
+ "U1 = Q/S1;\n",
+ "U2 = Q/S2;\n",
+ "p = 62.4; \t\t\t #[lb/ft**3]\n",
+ "b = 1.;\n",
+ "w1 = p*Q; \t\t\t #[lb/sec] - mass flow rate\n",
+ "w2 = w1;\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation Fpress = p1gauge*S1-p2gauge*S2*math.cos(alpha2);\n",
+ "Fpressx = p1gauge*144*S1-p2gauge*144*S2*math.cos(alpha2);\n",
+ "Fpressy = p1gauge*144*S1*math.sin(alpha1)-p2gauge*144*S2*math.sin(alpha2);\n",
+ "wdeltaUx = (w1/gc)*((U2)*(math.cos(alpha2))-(U1)*(math.cos(alpha1)));\n",
+ "wdeltaUy = (w1/gc)*((U2)*(math.sin(alpha2))-(U1)*(math.sin(alpha1)));\n",
+ "Fextx = wdeltaUx-Fpressx;\n",
+ "Fexty = wdeltaUy-Fpressy;\n",
+ "Fext = ((Fextx)**2+(Fexty)**2)**(1./2);\n",
+ "alpha = 180 - 43.4\n",
+ "\n",
+ "# Results\n",
+ "print \" The force has a magnitude of %.0f lb and a direction of %.1f from the positive x directionin the second \\\n",
+ "quadrant\"%(round(Fext,-1),alpha);\n",
+ "print \" Also there is a force on the elbow in the z direction owing to the weight of the elbow \\\n",
+ " plus the weight of the fluid inside\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The force has a magnitude of 3030 lb and a direction of 136.6 from the positive x directionin the second quadrant\n",
+ " Also there is a force on the elbow in the z direction owing to the weight of the elbow plus the weight of the fluid inside\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 - Page No :293\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the kinetic energy correction term\n",
+ "\n",
+ "from scipy.integrate import quad \n",
+ "# Variables\n",
+ "Uo = 1.; \t\t\t #[m/sec]\n",
+ "# using Ux/Uo = y/yo\n",
+ "# assuming any particular value of yo will not change the answer,therefore\n",
+ "yo = 1;\n",
+ "\n",
+ "# Calculations\n",
+ "def f2(y): \n",
+ "\t return (Uo*y)/yo\n",
+ "\n",
+ "Uxavg = quad(f2,0,yo)[0]\n",
+ "\n",
+ "\n",
+ "def f3(y): \n",
+ "\t return ((Uo*y)/yo)**3\n",
+ "\n",
+ "Ux3avg = quad(f3,0,yo)[0]\n",
+ "\n",
+ "# umath.sing the formula alpha = (Uxavg)**3/Ux3avg\n",
+ "alpha = (Uxavg)**3/Ux3avg;\n",
+ "\n",
+ "# Results\n",
+ "print \"alpha = \",alpha\n",
+ "print \" Note that the kinetic correction factor alpha has the same final value for \\\n",
+ " laminar pipe flow as it has for laminar flow \\nbetween parallel plates.\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "alpha = 0.5\n",
+ " Note that the kinetic correction factor alpha has the same final value for laminar pipe flow as it has for laminar flow \n",
+ "between parallel plates.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8 - Page No :293\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the duty (heat load) needed to accomplish the heat exchange.\n",
+ "\n",
+ "# Variables\n",
+ "Q = 0.03; \t\t\t #[m**3/sec] - volumetric flow rate\n",
+ "id_ = 7.; \t\t\t #[cm] - insid_e diameter\n",
+ "deltaz = -7.; \t\t #[m] - length of pipe\n",
+ "T1 = 25.; \t\t\t #[degC] - lowere sid_e temperature\n",
+ "T2 = 45.; \t\t\t #[degC] - higher sid_e temperature\n",
+ "g = 9.81; \t\t\t #[m/sec**2] - acceleration due to gravity\n",
+ "deltaP = 4.*10**4; #[N/m**2] - pressure loss due to friction\n",
+ "p = 1000.; \t\t #[kg/m**3] - density of water \n",
+ "w = Q*p;\n",
+ "C = 4184.; \t\t #[J/kg*K) - heat capacity of water\n",
+ "\n",
+ "# Calculations\n",
+ "deltaH = w*C*(T2-T1);\n",
+ "# using the formula Qh = deltaH+w*g*deltaz\n",
+ "Qh = deltaH+w*g*deltaz;\n",
+ "\n",
+ "# Results\n",
+ "print \" the duty on heat exchanger is Q = %.2e J/sec\"%(Qh);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the duty on heat exchanger is Q = 2.51e+06 J/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10 - Page No :298\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# estimate the mass flow rate in kg s,\n",
+ "\n",
+ "# Variables\n",
+ "d = 0.03; \t\t\t #[m] - diameter\n",
+ "g = 9.784; \t\t #[m/sec] - acceleration due to gravity\n",
+ "deltaz = -1.;\n",
+ "\n",
+ "# using the equation (1/2)*(U3**2/alpha3-U1**2/alpha1)+g*deltaz = 0\n",
+ "# assuming\n",
+ "alpha1 = 1.;\n",
+ "alpha3 = 1.;\n",
+ "# also since the diameter of the tank far exceeds the diameter of the hose , the velocity at point 1 must be negligible \n",
+ "#when compared to the velocity at point 3\n",
+ "U1 = 0.;\n",
+ "\n",
+ "# Calculations\n",
+ "U3 = (-2*g*deltaz+(U1**2)/alpha1)**(1/2.);\n",
+ "p = 1000.; \t\t\t #[kg/m**3] - density of water\n",
+ "S3 = (math.pi/4)*(d)**2\n",
+ "w = p*U3*S3;\n",
+ "\n",
+ "# Results\n",
+ "print \" the mass flow rate is w = %.2f kg/sec\"%(w);\n",
+ "\n",
+ "# the minimum pressure in the siphon tube is at the point 2. Before the result of 3.13 kg/sec is accepted as \n",
+ "#the final value, the pressure at point 2 must be calcilated in order to see if the water might boil at this point\n",
+ "# using deltap = p*((U3**2)/2+g*deltaz)\n",
+ "deltap = p*((U3**2)/2+g*deltaz);\n",
+ "p1 = 1.01325*10**5; \t\t\t #[N/m**2] - is equal to atmospheric pressure\n",
+ "p2 = p1+deltap;\n",
+ "vp = 0.02336*10**5;\n",
+ "if p2>vp:\n",
+ " print \" the siphon can operate since the pressure at point 2 is greater than the value at which the liquid boils\";\n",
+ "else:\n",
+ " print \" the siphon cant operate since the pressuer at point 2 is less than \\\n",
+ " the value at which the liquid_ boils\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the mass flow rate is w = 3.13 kg/sec\n",
+ " the siphon can operate since the pressure at point 2 is greater than the value at which the liquid boils\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.11 - Page No :300\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the flow rate in kg s\n",
+ "\n",
+ "# Variables\n",
+ "sp = 1.45; \t\t\t # specific gravity of trichloroethylene\n",
+ "pwater = 62.4; \t\t\t #[lb/ft**3] - density of water\n",
+ "p = sp*pwater;\n",
+ "d1 = 1.049; \t\t\t #[inch] - density of pipe at point 1\n",
+ "d2 = 0.6; \t\t\t #[inch] - density of pipe at point 2\n",
+ "d3 = 1.049; \t\t\t #[inch] - density of pipe at point 3\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula U1*S1 = U2*S2; we get U1 = U2*(d2/d1);\n",
+ "# then using the bernoulli equation deltap/p = (1/2)*(U2**2-U1**2);\n",
+ "deltap = 4.2*(144); \t\t\t #[lb/ft**2] - pressure difference\n",
+ "U2 = ((2*(deltap/p)*(1./(1.-(d2/d1)**4)))**(1./2))*(32.174)**(1./2);\n",
+ "\n",
+ "# umath.sing the formula w = p*U2*S\n",
+ "w = p*U2*((math.pi/4)*(0.6/12)**2);\n",
+ "w1 = w/(2.20462);\n",
+ "\n",
+ "# Results\n",
+ "print \" the mass flow rate is w = %.1f lb/sec or in SI units w = %.2f kg/sec\"%(w,w1);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the mass flow rate is w = 3.9 lb/sec or in SI units w = 1.77 kg/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.12 - Page No :301\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the temperature rise for the water\n",
+ "\n",
+ "# Variables\n",
+ "Q = 50/(7.48*60); \t #[ft/sec] - volumetric flow rate of water\n",
+ "d1 = 1.; \t\t\t #[inch] - diameter of pipe\n",
+ "deltaz = -5; \t\t #[ft] - distance between end of pipe and math.tank\n",
+ "g = 32.1; \t\t\t #[ft/sec] - acceleration due to gravity\n",
+ "Cp = 1.; \t\t\t #[Btu/lb*F] - heat capacity of water\n",
+ "p = 62.4; \t\t\t #[lb/ft**3] - density of water\n",
+ "S1 = (math.pi/4)*(d1/12.)**2;\n",
+ "U1 = Q/S1;\n",
+ "w = p*Q;\n",
+ "U2 = 0.;\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula deltaH = (w/2)*((U2)**2-(U1)**2)+w*g*deltaz\n",
+ "deltaH = -(w/(2*gc))*((U2)**2-(U1)**2)-w*(g/gc)*deltaz;\n",
+ "deltaH = deltaH/778; \t\t\t # converting from ftlb/sec to Btu/sec\n",
+ "deltaT = deltaH/(w*Cp);\n",
+ "\n",
+ "# Results\n",
+ "print \" The rise in temperature is %.5f degF\"%(deltaT);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The rise in temperature is 0.01475 degF\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.13 - Page No :303\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the horsepower required if the centrifugal pump is 77 percent efficient and if fluid friction is negligible\n",
+ "\n",
+ "# Variables\n",
+ "deltaz = 30.; \t\t #[ft] - distance between process and the holding math.tank\n",
+ "Q = 100.; \t\t\t #[gpm] - volumetric flow rate of water\n",
+ "p1 = 100.; \t\t #[psig]\n",
+ "p2 = 0.; \t\t\t #[psig]\n",
+ "g = 32.1; \t\t\t #[ft/sec] - acceleration due to gravity\n",
+ "sv = 0.0161; \t\t #[ft**3/lb] - specific volume of water\n",
+ "p = 1./sv; \t\t #[lb/ft**3] - density of water\n",
+ "e = 0.77; \t\t\t # efficiency of centrifugal pump\n",
+ "deltap = (p1-p2)*(144); \t\t\t #[lbf/ft**2]\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation deltap/p+g*(deltaz)+Ws = 0;\n",
+ "Wst = -deltap/p-(g/gc)*(deltaz);\n",
+ "# using the formula for efficiency e = Ws(theoritical)/Ws(actual)\n",
+ "# therefore\n",
+ "Wsa = Wst/e;\n",
+ "# the calulated shaft work is for a unit mass flow rate of water,therfore for given flow rate multiply it by the flow rate\n",
+ "w = (Q*p)/(7.48*60);\n",
+ "Wsactual = Wsa*w;\n",
+ "power = -Wsactual/(778*0.7070);\n",
+ "\n",
+ "# Results\n",
+ "print \" the required horsepower is %.2f hp\"%(power);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the required horsepower is 8.55 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.14 - Page No :304\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the shaft work done by the system \n",
+ "\n",
+ "# Variables\n",
+ "p1 = 5.; \t\t\t #[atm] - initial pressure\n",
+ "p2 = 0.75; \t\t #[atm] - final pressure after expansion through turbine\n",
+ "T = 450.; \t\t\t #[K] - temperature\n",
+ "y = 1.4; \t\t\t # cp/cv for nitrogen\n",
+ "# using the equation Ws = -(y/(y-1))*(p1/density1)*((p2/p1)**((y-1)/y)-1)\n",
+ "R = 8314.; \t\t # gas constant\n",
+ "\n",
+ "# Calculations\n",
+ "p1bydensity = R*T;\n",
+ "Ws = -(y/(y-1))*(p1bydensity)*((p2/p1)**((y-1)/y)-1);\n",
+ "\n",
+ "# Results\n",
+ "print \" the shaft work of the gas as it expands through the turbine and transmits its molecular \\\n",
+ " energy to the rotating blades is \\n Ws = %.2e J/kmol\"%(Ws);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the shaft work of the gas as it expands through the turbine and transmits its molecular energy to the rotating blades is \n",
+ " Ws = 5.48e+06 J/kmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.15 - Page No :311\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the pressure drop across the venturi.\n",
+ "\n",
+ "# Variables\n",
+ "T = 273.15+25; \t\t #[K] - temperature\n",
+ "R = 8.314; \t\t\t #[kPa*m**3/kmol*K] - gas constant\n",
+ "p = 101.325; \t\t\t #[kPa] - pressure\n",
+ "M = 29.; \t\t\t # molecular weight of gas\n",
+ "pa = (p*M)/(R*T);\n",
+ "sg = 13.45; \t\t\t # specific gravity\n",
+ "pm = sg*1000;\n",
+ "g = 9.807; \t\t\t #[m/sec**2] - acceleration due to gravity\n",
+ "deltaz = 15./100; \t\t #[m]\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation p2-p1 = deltap = (pm-pa)*g*deltaz\n",
+ "deltap = -(pm-pa)*g*deltaz;\n",
+ "\n",
+ "# Results\n",
+ "print \" the pressure drop is %.2e N/m**2\"%(deltap);\n",
+ "print \" the minus sign means the upstream pressure p1 is greater than p2, i.e ther is a pressure drop.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the pressure drop is -1.98e+04 N/m**2\n",
+ " the minus sign means the upstream pressure p1 is greater than p2, i.e ther is a pressure drop.\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.16 - Page No :312\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Rework Example 7.15, this time using engineering units.\n",
+ "\n",
+ "# Variables\n",
+ "T = 536.67; \t\t\t #[degR]; - temperature\n",
+ "R = 10.73; \t\t\t #[(lbf/in**2*ft**3)*lb*mol**-1*degR] - gas constant\n",
+ "p = 14.696; \t\t\t #[lbf/in**2];\n",
+ "g = 9.807*3.2808; \t\t #[ft/sec**2] - acceleration due to gravity\n",
+ "M = 29.; \t\t\t # molecular weight of gas\n",
+ "\n",
+ "# Calculations\n",
+ "pa = (p*M)/(R*T);\n",
+ "sg = 13.45; \t\t\t # specific gravity\n",
+ "pm = sg*62.4;\n",
+ "deltaz = 15/(2.54*12); #[ft]\n",
+ "gc = 32.174;\n",
+ "\n",
+ "# Results\n",
+ "# using the equation p2-p1 = deltap = (pm-pa)*g*deltaz\n",
+ "deltap = (pm-pa)*(g/gc)*deltaz;\n",
+ "print \"the pressure drop is %.0f lbf/ft**2\"%(deltap);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the pressure drop is 413 lbf/ft**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.18 - Page No :315\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the pressure at the vessel pressure tap.\n",
+ "\n",
+ "# Variables\n",
+ "at = 0.049; \t\t\t #[in**2] - cross sectional area of the manometer tubing\n",
+ "aw = 15.5; \t\t\t #[in**2] - cross sectional area of the well\n",
+ "g = 32.174; \t\t\t #[ft/sec**2] - acceleration due to gravity\n",
+ "gc = 32.174;\n",
+ "sg = 13.45; \t\t\t #[ specific garvity of mercury\n",
+ "p = 62.4; \t\t\t #[lb/ft**3] - density of water;\n",
+ "pm = sg*p;\n",
+ "deltaz_waterleg = 45.2213;\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation A(well)*deltaz(well) = A(tube)*deltaz(tube)\n",
+ "deltazt = 70.; \t\t\t #[cm]\n",
+ "deltazw = deltazt*(at/aw);\n",
+ "deltaz = deltazt+deltazw;\n",
+ "deltap_Hg = -pm*(g/gc)*(deltaz/(2.54*12));\n",
+ "\n",
+ "# Results\n",
+ "deltazw = 45.2213; \t\t\t #[cm]\n",
+ "deltap_tap = deltap_Hg+p*(g/gc)*(deltazw/(12*2.54));\n",
+ "print \"deltap_tap = %.0f lbf/ft**2\"%(deltap_tap);\n",
+ "print \"deltap is negative and therefore p1 is greater than p2\";\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "deltap_tap = -1841 lbf/ft**2\n",
+ "deltap is negative and therefore p1 is greater than p2\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.19 - Page No :317\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Is the coin gold?\n",
+ "\n",
+ "# Variables\n",
+ "p = 749./760; \t\t\t #[atm]\n",
+ "T = 21.+273.15; \t\t #[K]\n",
+ "R = 82.06; \t\t\t #[atm*cm**3/K] - gas constant\n",
+ "v = (R*T)/p; \t\t\t #[cm**3/mole] - molar volume\n",
+ "M = 29.; \t\t\t #[g/mole] - molecular weight\n",
+ "pair = M/v;\n",
+ "m_air = 53.32; \t\t\t #[g]\n",
+ "m_h2o = 50.22; \t\t\t #[g]\n",
+ "ph2o = 0.998; \t\t\t #[g/cm**3] - density of water\n",
+ "\n",
+ "# Calculations\n",
+ "V = (m_air-m_h2o)/(ph2o-pair); \t\t\t #[cm**3]\n",
+ "density = m_air/V;\n",
+ "\n",
+ "# Results\n",
+ "print \" The density of coin is density = %.2f g/cm**3\"%(density);\n",
+ "print \" Consulting a handbook it is seen that this result is correct density for gold\";\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The density of coin is density = 17.15 g/cm**3\n",
+ " Consulting a handbook it is seen that this result is correct density for gold\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.20 - Page No :318\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find the true mass of the wood if the temperature is 21\u00b0C and the barometer reads 749 Totr.\n",
+ "\n",
+ "# Variables\n",
+ "P = 749./760; \t\t\t #[atm] - pressure\n",
+ "T = 21+273.15; \t\t #[K] - temperature\n",
+ "poak = 38*(1./62.4); \t #[g/cm**3] - density of oak\n",
+ "pbrass = 534/62.4; \t #[g/cm**3] - density of brass\n",
+ "m_brass = 6.7348; \t\t #[g]\n",
+ "pair = 0.001184; \t\t #[g/cm**3] - density of air\n",
+ "\n",
+ "# Calculations\n",
+ "# using the formula m_oak = m_brass*((1-(pair/pbrass))/(1-(pair/poak)))\n",
+ "m_oak = m_brass*((1-(pair/pbrass))/(1-(pair/poak)));\n",
+ "\n",
+ "# Results\n",
+ "print \" True mass of wood = %.3f g\"%(m_oak);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " True mass of wood = 6.747 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.21 - Page No :320\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the pressure 50ft above a beach in Fort Lauderdale\n",
+ "\n",
+ "# Variables\n",
+ "T = 545.67; \t\t\t #[degR] - temperature\n",
+ "R = 1545.; \t\t\t #[Torr*ft**3/degR*mole] - gas constant\n",
+ "M = 29.; \t\t\t #[g/mole] - molecular weight\n",
+ "g = 9.807; \t\t\t #[m/sec**2] - acceleration due to gravity\n",
+ "gc = 9.807; \n",
+ "po = 760.; \t\t\t #[Torr] - pressure\n",
+ "deltaz = 50.; \t\t\t #[ft]\n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation p = po*exp(-(g/gc)*M*(deltaz/R*T))\n",
+ "p = po*math.e**(-(g/gc)*M*(deltaz/(R*T)));\n",
+ "\n",
+ "# Results\n",
+ "print \" p = %.1f Torr \\nThus, the pressure decrease for an elevation of 50ft is very small\"%(p);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " p = 758.7 Torr \n",
+ "Thus, the pressure decrease for an elevation of 50ft is very small\n"
+ ]
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.22 - Page No :321\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the pressure and temperature\n",
+ "\n",
+ "# Variables\n",
+ "To = 545.67; \t\t\t #[degR] - air temperature at beach level\n",
+ "betaa = -0.00357; \t\t #[degR/ft] - constant\n",
+ "R = 1545.; \t\t\t #[Torr*ft**3/degR*mole] - gas constant\n",
+ "M = 29.;\n",
+ "deltaz = 25000.; \t\t #[ft]\n",
+ "po = 760. \n",
+ "\n",
+ "# Calculations\n",
+ "# using the equation ln(p/po) = ((M)/(R*betaa))*ln(To/(To+betaa*deltaz)\n",
+ "p = po*math.exp(((M)/(R*betaa))*math.log(To/(To+betaa*deltaz)));\n",
+ "\n",
+ "# Results\n",
+ "print \" Pressure = %.2f Torr\"%(p);\n",
+ "# using the equation T = To+betaa*deltaz\n",
+ "T = To+betaa*deltaz;\n",
+ "print \" Temperature = %.2f degR\"%(T);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure = 297.16 Torr\n",
+ " Temperature = 456.42 degR\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/ch9.ipynb b/Transport_Phenomena/ch9.ipynb
new file mode 100644
index 00000000..21d56f19
--- /dev/null
+++ b/Transport_Phenomena/ch9.ipynb
@@ -0,0 +1,209 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Agitation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3 - Page No :389\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate the power per unit volume and the torque per unit volume\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "Nblades = 4.; \t\t\t # no. of blades\n",
+ "d = 9/12.; \t\t\t #[ft] - diameter of the impeller\n",
+ "dt = 30/12.; \t\t\t #[ft] - diameter of the math.tank\n",
+ "Nbaffles = 4. \t\t\t # no. of baffles\n",
+ "h = 30.; \t \t\t # [inch] - height of unit\n",
+ "mu = 10.; \t\t\t #[cP] - vismath.cosity of fluid_\n",
+ "sg = 1.1; \t\t \t # specific gravity of fluid_\n",
+ "s = 300. \t\t\t #[rpm] - speed of agitator\n",
+ "CbyT = 0.3; \n",
+ "\n",
+ "# Calculations\n",
+ "V = (math.pi*dt**3)/4; \t #volume of math.tank in ft**3\n",
+ "V1 = V*7.48; \t\t\t #[gal] - volume of math.tank in gallons\n",
+ "mu = mu*(6.72*10**-4); #[lb/ft*sec]\n",
+ "p = sg*62.4; \t\t\t #[lb/ft**3] - density of fluid_\n",
+ "N = s/60.; \t\t\t #[rps] - impeller speed in revolutions per second\n",
+ "Nre = ((d**2)*N*p)/mu;\n",
+ "\n",
+ "# Results\n",
+ "print \"Nre = %.2e\"%Nre\n",
+ "print \" Therefore the agitator operates in the turbulent region\"\n",
+ "Npo = 1.62;\n",
+ "gc = 32.174;\n",
+ "P = (Npo*(p*(N**3)*(d**5)))/(gc*550);\n",
+ "Cf = 63025.;\n",
+ "Tq = (P/s)*Cf;\n",
+ "PbyV = P/V;\n",
+ "PbyV1 = P/V1;\n",
+ "TqbyV = Tq/V;\n",
+ "TqbyV1 = Tq/V1;\n",
+ "print \" The power per unit volume and the torque per unit volume is \\nP/V = %.2ef hp/ft**3 = %.2e \\\n",
+ "hp/gal \\nTq/V = %.2f in*lb/ft**3 = %.3f in*lb/gal\"%(PbyV,PbyV1,TqbyV,TqbyV1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nre = 2.87e+04\n",
+ " Therefore the agitator operates in the turbulent region\n",
+ " The power per unit volume and the torque per unit volume is \n",
+ "P/V = 1.52e-02f hp/ft**3 = 2.03e-03 hp/gal \n",
+ "Tq/V = 3.19 in*lb/ft**3 = 0.427 in*lb/gal\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.4 - Page No :391\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# designing a reactor of capacity\n",
+ "\n",
+ "# Variables\n",
+ "Tpilot = 30.;\n",
+ "Tlab = 10.;\n",
+ "N1 = 690.;\n",
+ "N2 = 271.;\n",
+ "D2 = 3.;\n",
+ "D1 = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "n = (math.log(N1/N2))/(math.log(D2/D1));\n",
+ "V = 12000/7.48; \t\t\t #[ft**3]\n",
+ "T = ((4.*V)/math.pi)**(1./3); \t\t\t #[ft]\n",
+ "R = 12.69/(30/12.);\n",
+ "N3 = N2*(1./R)**n; \t\t\t #[rpm] - impeller speed in the reactor\n",
+ "\n",
+ "# Results\n",
+ "print \"impeller speed in rpm = %f\"%round(N3,4)\n",
+ "D3 = 0.75*R; \t\t\t #[ft] - reactor impeller diameter\n",
+ "print \"reactor impeller diameter in ft = %.3f\"%D3\n",
+ "P = 0.1374*((N3/N2)**3)*(R**5);\n",
+ "print \"power in hp = %.3f\"%P\n",
+ "Cf = 63025.;\n",
+ "Tq = (P/N3)*Cf; \t\t\t #[inch*lb]\n",
+ "print \"torque in inch*lb = %.0f\"%Tq\n",
+ "print \"At this point, the design is complete. \\nA sarc ard size impeller would be chosen as \\\n",
+ " well as a tan ard size motor7.5 hp or 10 hp\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "impeller speed in rpm = 68.044500\n",
+ "reactor impeller diameter in ft = 3.807\n",
+ "power in hp = 7.329\n",
+ "torque in inch*lb = 6789\n",
+ "At this point, the design is complete. \n",
+ "A sarc ard size impeller would be chosen as well as a tan ard size motor7.5 hp or 10 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.5 - Page No : 393\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Suppose the pilot plant data in Table 9.8 never existed. Use the\n",
+ "laboratory data only from Example 9.4 to design the 12 000-gal reactor.\n",
+ "'''\n",
+ "\n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "# Variables\n",
+ "# given\n",
+ "n = array([0.5, 0.6, 0.7, 0.8, 0.9, 1.0]);\n",
+ "D2 = 3.806;\n",
+ "D1 = 0.25;\n",
+ "R = D2/D1;\n",
+ "N1 = 690.;\n",
+ "\n",
+ "# Calculations\n",
+ "N2 = N1*((D1/D2)**n);\n",
+ "P1 = 9.33*10**-3; \t\t\t #[hp]\n",
+ "P2 = P1*R**(5.-3*n);\n",
+ "\n",
+ "# Results\n",
+ "print \" n N,rpm P,hp\"\n",
+ "for i in range(6):\n",
+ " print \" %f %4.0f %4.0f\"%(n[i],N2[i],P2[i]);\n",
+ "\n",
+ "\n",
+ "# Answers may be differ because of rounding error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " n N,rpm P,hp\n",
+ " 0.500000 177 128\n",
+ " 0.600000 135 57\n",
+ " 0.700000 103 25\n",
+ " 0.800000 78 11\n",
+ " 0.900000 60 5\n",
+ " 1.000000 45 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Transport_Phenomena/screenshots/pic1.png b/Transport_Phenomena/screenshots/pic1.png
new file mode 100644
index 00000000..8b5f193e
--- /dev/null
+++ b/Transport_Phenomena/screenshots/pic1.png
Binary files differ
diff --git a/Transport_Phenomena/screenshots/pic2.png b/Transport_Phenomena/screenshots/pic2.png
new file mode 100644
index 00000000..559890ec
--- /dev/null
+++ b/Transport_Phenomena/screenshots/pic2.png
Binary files differ
diff --git a/Transport_Phenomena/screenshots/pic3.png b/Transport_Phenomena/screenshots/pic3.png
new file mode 100644
index 00000000..785eeb05
--- /dev/null
+++ b/Transport_Phenomena/screenshots/pic3.png
Binary files differ
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_10.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_10.ipynb
new file mode 100644
index 00000000..ee6dfbfb
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_10.ipynb
@@ -0,0 +1,66 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter 10 : Valves <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 10.1 Page No 225 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Flow coefficient and Pressure drop\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Q=30.0 #gpm flow rate\n",
+ "dp=300.0 #pressure drop lbf/in^2\n",
+ "Sg=0.85 #density\n",
+ "Cv=5.41 #Flow coefficient\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Cv1=Q/(math.sqrt(dp/Sg)) \n",
+ "dp1=Sg*Q**2/Cv**2\n",
+ "\n",
+ "#RESULTS\n",
+ "print('\\n Flow coefficient = %.3f gpm ' %Cv1)\n",
+ "print('\\n Pressure drop = %.3f psi ' %dp1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Flow coefficient = 1.597 gpm \n",
+ "\n",
+ " Pressure drop = 26.138 psi \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_11.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_11.ipynb
new file mode 100644
index 00000000..81b29992
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_11.ipynb
@@ -0,0 +1,145 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter No 11: Seals and packings <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 11.1, Page No 269 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Groove diameter width\n",
+ "\n",
+ "#Variable initialization\n",
+ "d=4.0 #in diameter\n",
+ "p=20.0 #percent\n",
+ "d1=0.140 #in cross section\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Gd=d-2.0*((100.0 -20.0)*d1 /100.0)\n",
+ "Gw=d1+2.0*(p*d1/100.0)\n",
+ "\n",
+ "#RESULTS\n",
+ "print(' Groove diameter = %.3f in ' %Gd)\n",
+ "print(' \\n Groove width = %.3f in ' %Gw)\n",
+ "print('\\n outside diameter = %.3f in ' %d)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Groove diameter = 3.776 in \n",
+ " \n",
+ " Groove width = 0.196 in \n",
+ "\n",
+ " outside diameter = 4.000 in "
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 11.2 Page NO 272 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find final thickness\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "D=2.0 #in diameter\n",
+ "S=10.0 #in stroke\n",
+ "s=10000.0 #stroke in\n",
+ "V=231.0 #in^3 volume\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "di=(V/(S*s*D* math.pi))\n",
+ "\n",
+ "#RESULTS\n",
+ "print(' Thickness= %.6f in ' %di)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Thickness= 0.000368 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 11.3 Page No 277 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find final available squeeze\n",
+ "\n",
+ "#Variable initialization\n",
+ "d=0.275 #in diameter\n",
+ "p=15.0 #initial squeeze percent\n",
+ "p1=20.0 #increase in squeeze percent\n",
+ "p3=8.0 #reduction in squeeze percent\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Fs=(d*p/100.0)+(d*p1/100.0)-(d*p3 /100.0)\n",
+ "Fs1= Fs *100.0/ d\n",
+ "\n",
+ "#RESULTS\n",
+ "print('\\n final available squeeze = %.3f percent' %Fs1 )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " final available squeeze = 27.000 percent"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_12.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_12.ipynb
new file mode 100644
index 00000000..05fb97c3
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_12.ipynb
@@ -0,0 +1,281 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 12 : System components <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 12.1 Page No 290 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Total Btu heat loss over a period of 4 hr\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "t=4.0 #hr time\n",
+ "Ihp=8.0 #ihp power\n",
+ "Ohp=5.0 #hp power\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Hl=t*2544.0*(Ihp-Ohp)\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Total Btu heat loss over a period of 4 hr = %.3f Btu ' %Hl)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total Btu heat loss over a period of 4 hr = 30528.000 Btu "
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 12.2 Page No 292 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Rise in temperature of the fluid\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "t=1.0 #sec time\n",
+ "P=1000.0 #lbf/in^2 pressure \n",
+ "Q=3.0 #gpm flow rate\n",
+ "Sg=0.85 # density\n",
+ "s=0.42\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "H=42.4*((P*Q)/1714) #Heat Generation Rate\n",
+ "m=8.34*Q*Sg #mass flow Rate\n",
+ "Tr=H/(m*s)\n",
+ "\n",
+ "#RESULTS\n",
+ "print(' Rise in temperature of the fluid = %.2f F' %Tr)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Rise in temperature of the fluid = 8.31 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 12.3 Page No 296 <h3> "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Weight and Stroke length\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P=1500.0 #lbf/in^2 pressure\n",
+ "d=12.0 #in diameter\n",
+ "V=50.0 #gal volume\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "F=P*(math.pi*d**2/4)\n",
+ "S=V*231.0*4.0/(math.pi*d**2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Weight = %.3f lbf ' %F)\n",
+ "print('\\n Stroke length = %.3f in ' %S)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Weight = 169646.003 lb \n",
+ "\n",
+ " Stroke length = 102.124 in "
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 12.4 Page No 298 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Size of accumulator\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P=1500.0 #lbf/in^2 pressure\n",
+ "V=5.0 #gal volume\n",
+ "P1=3000.0 #lbf/in^2 pressure\n",
+ "P2=2000.0 #lbf/in^2 pressure\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "V2=V*231.0*(P2+14.7)/(P1-P2)\n",
+ "V1=V2*(P1+14.7)/((P+14.7)*231.0)\n",
+ "\n",
+ "#RESULT\n",
+ "print('\\n Size of accumulator = %.3f gal ' %V1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Size of accumulator = 20.049 gal "
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 12.5 Page No 300 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Percentage difference in volume\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "beta=1.4\n",
+ "p3=2000.0+14.7 #non guage presure\n",
+ "p2=3000.0+14.7 #non guage presure\n",
+ "p1=1500.0+14.7 #non guage presure\n",
+ "deltav=1155.0\n",
+ "\n",
+ "#Calculations\n",
+ "v2=(p3/p2)**(1/beta)*(deltav)/(1-(p3/p2)**(1/beta))\n",
+ "v1=v2*(p2/p1)**(1/beta)\n",
+ "perdiff=(v1-4627.25)*100.0/v1\n",
+ "\n",
+ "#Results\n",
+ "print(' Volume 2 = %.3f in^3' %v2)\n",
+ "print(' \\n Volume 1 = %.3f in^3' %v1)\n",
+ "print(' \\n Percentage difference in volume = %.3f percent' %perdiff )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Volume 2 = 3462.278 in^3\n",
+ " \n",
+ " Volume 1 = 5660.756 in^3\n",
+ " \n",
+ " Percentage difference in volume = 18.257 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 12.6 Page No 305 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Wall thcikness\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Fr=20.0 #gpm flowrate\n",
+ "P=2500.0 #lbf/in^2 pressure\n",
+ "sf=4.0 #safety factor\n",
+ "Ts=55000.0 #lbf/in^2 pressure\n",
+ "V=15.0 #ft/s velocity\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "A=Fr*0.3208/V\n",
+ "ID=2.0*math.sqrt(A/math.pi)\n",
+ "Wt=P*ID/(2*(Ts-P))\n",
+ "Wt1=Wt*sf\n",
+ "\n",
+ "#RESULT\n",
+ "print('Wall thcikness = %.3f in ' %Wt1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wall thcikness = 0.070 in "
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_13.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_13.ipynb
new file mode 100644
index 00000000..d8f9b1f3
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_13.ipynb
@@ -0,0 +1,30 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "<h3>No examples in this chapter</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_14.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_14.ipynb
new file mode 100644
index 00000000..6092f622
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_14.ipynb
@@ -0,0 +1,287 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter No 14 :Troubleshooting Hydraulic systems<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.1 Page No 386 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find breakway torque\n",
+ "\n",
+ "#initialisation of variables\n",
+ "p=1800 #lbf/in^2 pressure\n",
+ "Vd=1.5 #in^3/rev displacement\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "T=0.013*p*Vd\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The breakway torque = %.2f lbf-ft' %T)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The breakway torque = 35.10 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.2, Page No 386 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find min pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "T=80 #lbf-ft torque\n",
+ "Vd=3.5 #in^3/rev displacement\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P=(T/(0.013*Vd))*(1/0.75)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The min pressure = %.2f lbf/in^2' %P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The min pressure = 2344.32 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.3, Page No 389 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find a)flow from the pump b)Volumetric efficiency of the system\n",
+ "\n",
+ "#initialisation of variables\n",
+ "N=1200 #rev/min theotrical power\n",
+ "Vd=0.75 #in^3/rev displacement\n",
+ "Vd2=0.57\n",
+ "#CALCULATIONS\n",
+ "# part a\n",
+ "Q=(Vd*N)/231\n",
+ "# part b\n",
+ "Qa=Q-0.50\n",
+ "N2=(231*Qa)/Vd2\n",
+ "ev=(Qa/Q)*100\n",
+ "#RESULTS\n",
+ "print('The flow from the pump = %.2f lbf/in^2' %Qa)\n",
+ "print('The actual speed of the motor = %.2f rev/min' %N2)\n",
+ "print('The Volumetric efficiency of the system = %.2f percent' %ev)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow from the pump = 3.40 lbf/in^2\n",
+ "The actual speed of the motor = 1376.32 rev/min\n",
+ "The Volumetric efficiency of the system = 87.17 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.4, Page No 390 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the Velocity\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=3.9 #gal/min flow rate\n",
+ "Sg=0.87 # density\n",
+ "Ac=4.9 #in^2 area\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Qa=0.872*Q\n",
+ "Vrod=Qa/(0.26*Ac)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The Velocity = %.2f in/sec' %Vrod)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Velocity = 2.67 in/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.5, Page No 390 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the area\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=10.0 #gal/min flow rate\n",
+ "P=1500 #lbf/in^2 pressure\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Fhp=((P*Q)/1714)*0.25\n",
+ "A=Fhp/(0.001*75)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The area is = %.2f ft^2' %A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The area is = 29.17 ft^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.6, Page No 391<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find the temparature\n",
+ "\n",
+ "#initialisation of variables\n",
+ "A=15.0 #ft^2 area\n",
+ "HP=0.25*5 # power\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "T=(HP/(0.001*A))+75\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The temparature is = %.2f F' %T)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temparature is = 158.33 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.7, Page No 392 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the heat that should be dissipated\n",
+ "\n",
+ "#initialisation of variables\n",
+ "A=100 #ft^2 area\n",
+ "T=40 #F temperature \n",
+ "\n",
+ "#CALCULATIONS\n",
+ "q=2.545*A*T\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The heat that should be dissipated is = %.2f Btu/hr' %q)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat that should be dissipated is = 10180.00 Btu/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_15.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_15.ipynb
new file mode 100644
index 00000000..dcfeae0d
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_15.ipynb
@@ -0,0 +1,229 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 15 : Basics of Pneumatics <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 15.1 Page No 405 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Guage pressure\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "V1=20.0 #gal volume\n",
+ "P1=20.0 #lbf/in^2 pressure\n",
+ "n=2.0\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "V2=V1/n\n",
+ "P2=(P1+14.7)*V1*231.0/(V2*231.0)\n",
+ "P3=P2-14.7\n",
+ "\n",
+ "#RESULT\n",
+ "print('Guage pressure = %.3f psi ' %P3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Guage pressure = 54.700 psi \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 15.2 Page No 406 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Volume the heated gas will occupy\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "V1=1500.0 #in^3 volume\n",
+ "T=80.0 #F temperature\n",
+ "T1=200.0 #F temperature\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "V2=V1*(460.0+T1)/(T+460.0)\n",
+ "\n",
+ "#RESULT\n",
+ "print('Volume the heated gas will occupy = %.3f in ^3 ' %V2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume the heated gas will occupy = 1833.333 in ^3 "
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 15.3 Page No 406 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the Guage pressure\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P1=2000.0 #in^3\n",
+ "T=80.0 #F temperature\n",
+ "T1=250.0 #F temperature\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P2=(P1+14.7)*(460.0+T1)/(T+460.0)\n",
+ "P3=P2-14.7\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Guage pressure = %.3f psi ' %P3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Guage pressure = 2634.257 psi "
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 15.4 Page No 407 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the Guage pressure\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P1=2000.0 #lbf/in^2 pressure\n",
+ "V1=1500.0 #in^3 volume\n",
+ "T2=250.0 #F temperature\n",
+ "T1=75.0 #F temperature\n",
+ "V2=1000.0 #in^3 volume\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "P2=(P1+14.7)*V1*(T2+460.0)/((T1+460.0)*V2)\n",
+ "P3=P2-14.7\n",
+ "#RESULT\n",
+ "print('\\n Guage pressure = %.3f psi ' %P3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Guage pressure = 3995.871 psi \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 15.5 Page No 409 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Air consumption in cfm of free air\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "s=10.0 #stroke in\n",
+ "d=2.0 #in diameter\n",
+ "r=40.0 #cpm cycles per rate\n",
+ "P1=80.0 #lbf/in^2 pressure\n",
+ "Ps1=552+101 #kN/m^2 pressure\n",
+ "Ps2=101 #kN/m^2 pressure\n",
+ "#CALCULATIONS\n",
+ "V1=math.pi*d**2*s*r/(4*1728.0)\n",
+ "V2=(P1+14.7)*V1/14.7\n",
+ "# In SI units\n",
+ "Vs1=(20.3*25.4*r)/(1000000)\n",
+ "Vs2=(Ps1*Vs1)/Ps2\n",
+ "#RESULT\n",
+ "print(' Air consumption in cfm of free air = %.3f cfm free air ' %V2)\n",
+ "print(' In SI units Air consumption in cfm of free air = %.3f m^3/min free air ' %Vs2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Air consumption in cfm of free air = 4.685 cfm free air \n",
+ " Air consumption in cfm of free air = 0.133 cfm free air \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_16.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_16.ipynb
new file mode 100644
index 00000000..2a26087d
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_16.ipynb
@@ -0,0 +1,290 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter No 16 : Sizing Pneumatic systems <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.1, Page No 422<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the pressure drop\n",
+ "\n",
+ "#initialisation of variables\n",
+ "L=500 #ft length\n",
+ "d=47.2561 #diameter in\n",
+ "Q=650 # ft^3/min\n",
+ "T=40 #F Temperature \n",
+ "\n",
+ "#CALCULATIONS\n",
+ "CR=(250+14.7)/14.7\n",
+ "Pf=(0.1025*L*(Q*1/60)*(Q*1/60))/(CR*d)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The the pressure drop is = %.2f lbf/in^2' %Pf)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The the pressure drop is = 6.02 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.2, Page No 423<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the pressure drop\n",
+ "\n",
+ "#initialisation of variables\n",
+ "L=(8*5.2)+(2*59)+(1*10.3) #ft length\n",
+ "C=0.1025 # Experimental coefficient\n",
+ "d=47.2561 # internal diameter\n",
+ "Q=500.0 # ft^3/min free air \n",
+ "CR=4.4 # ratio of compression of pipe\n",
+ "\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "\n",
+ "Pf=(C*L*((Q*1/60)*(Q*1/60)))/(CR*d)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The the pressure drop is = %.2f lbf/in^2' %Pf)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The the pressure drop is = 5.82 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.3, Page No 433 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the total air consumption\n",
+ "\n",
+ "#initialisation of variables\n",
+ "#CALCULATIONS\n",
+ "T=60+(0.25*60) #total air consumption ft^3/min\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The total air consumption = %.2f ft^3/min' %T)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total air consumption = 75.00 ft^3/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.4, Page No 434 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the size of the receiver\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Qr=10 #ft^3/min consumption rate\n",
+ "t=5 #time min\n",
+ "p1=125 #lbf/in^2 pressure\n",
+ "p2=100 #lbf/in^2 pressure\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Vr=(14.7*Q*t)/(p1-p2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The size of the receiver = %.2f ft^3' %Vr)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The size of the receiver = 29.40 ft^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.5, Page No 444 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the size of the air valve\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=35 #ft^3/min consumption rate\n",
+ "t=540 #time min\n",
+ "p1=90+14.7 #presure lbf/in^2\n",
+ "p2=80+14.7 # pressure lbf/in^2\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "K=(p1+p2)/2\n",
+ "Cv=(Q/22.67)*(math.sqrt(t/((p1-p2)*K)))\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The size of the air valve = %.2f ' %Cv)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The size of the air valve = 1.14 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.7, Page No 448 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the free air consumption\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=35 #ft^3/min consumption rate\n",
+ "V1=0.327 #volume ft^3/min\n",
+ "p1=104.7 #presure lbf/in^2\n",
+ "p2=14.7 #pressure lbf/in^2\n",
+ "d=3 #in diameter\n",
+ "#CALCULATIONS\n",
+ "A=(3.14*(d*d)/4\n",
+ "Q=((A*4)/1728)*20\n",
+ "V2=p1*V1/p2\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The free air consumption = %.2f ft^3/min' %V2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The free air consumption = 2.33 ft^3/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 16.8, Page No 451 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the free air consumption\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Fa=0.065 # free air ft^3/in\n",
+ "d=4 # stroke in\n",
+ "c=20 # cycle rate cycles/min\n",
+ "#CALCULATIONS\n",
+ "Qv=(Fa*d*c)/2\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The free air consumption = %.2f ft^3/min' %Qv)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The free air consumption = 2.60 ft^3/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_2.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_2.ipynb
new file mode 100644
index 00000000..19492cdb
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_2.ipynb
@@ -0,0 +1,429 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chpater No 2: Basics of Hydraulics<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.1, Page No 23 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the work from the system\n",
+ "\n",
+ "#initialisation of variables\n",
+ "W=1000.0 #weight lbf\n",
+ "D=1.25 #distance ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Work=W*D\n",
+ "#IN SI unit\n",
+ "W=4448 #weight N\n",
+ "D=0.381 #distance m\n",
+ "Work1=W*D\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The work from the system would be = %.2f ft-lbf' %Work)\n",
+ "print('The work from the system in SI unit would be = %.2f m-N' %Work1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work from the system would be = 1250.00 ft-lbf\n",
+ "The work from the system in SI unit would be = 1694.69 m-N\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.2, Page No 24 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find distance pump piston have to travel\n",
+ "\n",
+ "#initialisation of variables\n",
+ "F1=100.0 #Force lbf\n",
+ "F2=2000.0 #Force lbf\n",
+ "L2=12 #in\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "L11=L2*(F2/F1)\n",
+ "#IN SI unit\n",
+ "F1=444.8 #Force N\n",
+ "F2=8896.0 #Force N\n",
+ "L2=0.3048 #Force m\n",
+ "L12=L2*(F2/F1)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pump piston have to travel = %.2f in' %L11)\n",
+ "print('The pump piston have to travel = %.2f m' %L12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pump piston have to travel = 240.00 in\n",
+ "The pump piston have to travel = 6.10 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.3, Page No 25 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find how much weight lifted by a downward force\n",
+ "\n",
+ "#initialisation of variables\n",
+ "F1=150.0 #lbf Force\n",
+ "A1=0.049 #in^2 area\n",
+ "A2=0.785 #in^2 area\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "F21=F1*(A2/A1)\n",
+ "#IN SI unit\n",
+ "F1=667.2 #N(Force)\n",
+ "A1=31.7 #mm^2(Area)\n",
+ "A2=506.7 #mm^2(Area)\n",
+ "F22=F1*(A2/A1)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The weight lifted by a downward force = %.2f lbf' %F21)\n",
+ "print('weight lifted by a downward force in SI unit = %.2f N' %F22)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The weight lifted by a downward force = 2403.06 lbf\n",
+ "weight lifted by a downward force in SI unit = 10664.68 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.4, Page No 27 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the horsepower\n",
+ "\n",
+ "#initialisation of variables\n",
+ "F =800.0 #lbf Force\n",
+ "D=20 #ft distance\n",
+ "t=20 #sec time\n",
+ "C=550 #ft-lbf/sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "HP=(F*D)/(t*C)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The Horse powe required is = %.2f HP' %HP)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Horse powe required is = 1.45 HP\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.5, Page No 27 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the horsepower\n",
+ "\n",
+ "#initialisation of variables\n",
+ "V1=2000.0 #watts voltage\n",
+ "V2=746.0 #watts voltage\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "HP=V1/V2\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The Horse powe required is = %.2f HP' %HP)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Horse powe required is = 2.68 HP\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.6, Page No 28 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the Displacement and flow rate\n",
+ "\n",
+ "#initialisation of variables\n",
+ "N=1200 #rev/min speed\n",
+ "A=(3.14*((1.125*1.125)*5))/4 #Cross section of the bore in in^2\n",
+ "L=1 # cylinder stroke (inch)\n",
+ "#CALCULATIONS\n",
+ "V=A*L\n",
+ "Q=V*N/231\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The displacement would be = %.2f in^3/rev' %V)\n",
+ "print('The flow rate would be = %.2f gal/min' %Q)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The displacement would be = 4.97 in^3/rev\n",
+ "The flow rate would be = 25.81 gal/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.7, Page No 31 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the horsepower transmitted by system\n",
+ "\n",
+ "#initialisation of variables\n",
+ "P1=2000.0 #lbf/in^2 pressure\n",
+ "Q1=5 #gal/min flow rate\n",
+ "P3=13793.0 #kPa pressure\n",
+ "Q3=18.9 #liters/min flow rate\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Fhp1=P1*Q1/1714 #In English units\n",
+ "Fhp2=(P1*4.448*1550*Q1*3.7851*0.001)/44760 #In SI unit\n",
+ "Fhp3=P3*Q3/44760 #with technique 3\n",
+ "\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Using technique 1 the horsepower transmitted by system would be = %.2f hp' %Fhp1)\n",
+ "print('Using technique 1 the horsepower transmitted by system would be = %.2f hp' %Fhp2)\n",
+ "print('Using technique 1 the horsepower transmitted by system would be = %.2f hp' %Fhp3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Using technique 1 the horsepower transmitted by system would be = 5.83 hp\n",
+ "Using technique 1 the horsepower transmitted by system would be = 5.83 hp\n",
+ "Using technique 1 the horsepower transmitted by system would be = 5.82 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.8, Page No 35 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the torque\n",
+ "\n",
+ "#initialisation of variables\n",
+ "THP=5.83 # Horse power \n",
+ "pi=3.14 #Pi value\n",
+ "N=500 #rev/min speed\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "T=(THP*33000)/(2*pi*N)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The torque would be = %.2f lbf-ft' %T)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The torque would be = 61.27 lbf-ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.9, Page No 35 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the flow rate and Horsepower\n",
+ "\n",
+ "#initialisation of variables\n",
+ "T=2000.0 #lbf-ft torque\n",
+ "N=20.0 #rev/min speed\n",
+ "P=2000 #lbf/in^2 pressure \n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Q1=(1714*N*T)/(5252*P)\n",
+ "Fhp1=(P1*Q1)/1714\n",
+ "Q2=(44760*N*2712)/(7122*13793)\n",
+ "Fhp2=(13793*Q2)/44760\n",
+ "\n",
+ "#RESULTS\n",
+ "print('In English units the flow rate would be = %.2f gal/min' %Q1)\n",
+ "print('In English units the Horsepower would be = %.2f hp' %Fhp1)\n",
+ "print('In SI units the flow rate would be = %.2f lit/min' %Q2)\n",
+ "print('In SI units the Horsepower would be = %.2f hp' %Fhp2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow rate would be = 6.53 gal/min\n",
+ "The Horsepower would be = 7.62 hp\n",
+ "The flow rate would be = 24.71 gal/min\n",
+ "The Horsepower would be = 7.62 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.10, Page No 36 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the expected torque\n",
+ "\n",
+ "#initialisation of variables\n",
+ "N=750.0 #rev/min speed\n",
+ "Q=5 #gal/min flow rate\n",
+ "P=1000 #lbf/in^2 pressure\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "T=(5252*P*Q)/(1714*N)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The expected torque would be = %.2f lbf-ft' %T)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The expected torque would be = 20.43 lbf-ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_3.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_3.ipynb
new file mode 100644
index 00000000..4122fcfc
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_3.ipynb
@@ -0,0 +1,449 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter No 3: Energy in Hydraulic systems<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.1, Page No 44 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "h=50.0 #ft height\n",
+ "sg=1.0 #Density \n",
+ "\n",
+ "#CALCULATIONS\n",
+ "p=sg*h*0.433 # pressure\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Pressure is = %.2f lbf/in^2' %p)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure is = 21.65 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.2, Page No 44<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Head height\n",
+ "\n",
+ "#initialisation of variables\n",
+ "p=1500.0 #lbf/in^2 pressure\n",
+ "Sg=0.78 #Density \n",
+ "p2=p*6895 #lbf/in^2 pressure\n",
+ "#CALCULATIONS\n",
+ "h=(p*2.31)/Sg\n",
+ "h2=(p2*1.02)/(10000*Sg) #In metric units\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Head in ft = %.2f ft' %h)\n",
+ "print('In metric units Head in ft = %.2f ft' %h2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head in ft = 4442.31 ft\n",
+ "Head in ft = 1352.48 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.3, Page No 45 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Convert Hydralic reading to head meters\n",
+ "\n",
+ "#initialisation of variables\n",
+ "p=13790000 #N/m^2 pressure\n",
+ "Sg=0.83 #Density \n",
+ "\n",
+ "#CALCULATIONS\n",
+ "h=(p*1.02)/(Sg*10000)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Head in ft = %.2f m' %h)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head in ft = 1694.67 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.4, Page No 46 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the velocity\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=40 #Gal/min flow rate\n",
+ "a1=3.14 #in^2 area\n",
+ "a2=12.56 #in^2 area \n",
+ "#CALCULATIONS\n",
+ "#Part a\n",
+ "v1=Q/(a1*3.12) #fluid velocity in 2 in diameter\n",
+ "#Part b\n",
+ "v2=(a1*v1)/a2 #Fluid Velocity in 4 in diameter\n",
+ "#RESULTS\n",
+ "print('Fluid Velocity in 2 in diameter pipe is = %.2f ft/sec' %v1)\n",
+ "print('Fluid Velocity in 4 in diameter pipe is = %.2f ft/sec' %v2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fluid Velocity is = 4.08 ft/sec\n",
+ "Fluid Velocity is = 1.02 ft/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.5, Page No 47 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the min Diameter of the pipe\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=18 #Gal/min flow rate\n",
+ "a=3.14 #in^2 area \n",
+ "v2=10 #ft/sec velocity\n",
+ "#CALCULATIONS\n",
+ "v=Q/(a*3.12) \n",
+ "D=math.sqrt((4*Q)/(math.pi*v2*3.12))\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Velocity is = %.2f in' %D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity is = 0.86 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.6, Page No 51 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the energy of elevation\n",
+ "\n",
+ "#initialisation of variables\n",
+ "p=10.0 #lbf/in^2 pressure\n",
+ "Sg=0.87 #Density\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "h=p*2.31/Sg\n",
+ "#The value of h is actualy 26.55 but in book they have rounded off to 26.6 \n",
+ "EPE=200*Sg*8.34*h #Elevation energy\n",
+ "#RESULTS\n",
+ "print('The height = %.1f ft' %h)\n",
+ "print('The energy of elevation = %.2f ft-lbf' %EPE)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The height = 26.6 ft\n",
+ "The energy of elevation = 38530.80 ft-lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.7, Page No 53 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "F=1000 #lbf force\n",
+ "A=3.14 #in^2 area\n",
+ "pe=10.0 #lbf/in^2 (Pressure of elevation)\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "p=F/A #Total pressure\n",
+ "P=p-pe\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pressure is = %.2f lbf/in^2' %P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure is = 308.47 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.8, Page No 53 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the Kinetic enegry\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Sg=0.87 #Density\n",
+ "a=0.785 #in^2 area \n",
+ "g=32.2 #ft/sec^2\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "w=25*Sg*231*62.4*1/1738\n",
+ "Q=25*231*1/12*1/60\n",
+ "v=Q/a\n",
+ "KE=(w*v*v)/(2*g)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The Kinetic enegry is = %.2f ft-lbf' %KE)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Kinetic enegry is = 290.91 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.9, Page No 55 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the pressure\n",
+ "\n",
+ "#initialisation of variables\n",
+ "A1=7.065 #area in^2\n",
+ "A2=0.785 #area in^2\n",
+ "p1=1000 #pressure lbf/in^2\n",
+ "Q=500 #flow rate gal/min\n",
+ "g=32.2 #ft/sec^2\n",
+ "Sg=0.91 #density\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v1=Q/(A1*3.12) #Velocity\n",
+ "v2=Q/(A2*3.12) #Velocity\n",
+ "temp1=(p1*2.31)/Sg\n",
+ "temp2=(v1*v1)/ (2*g)\n",
+ "temp3=(v2*v2)/(2*g)\n",
+ "p2=(temp1+temp2-temp3)*Sg/2.31\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pressure is = %.2f lbf/in^2' %p2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure is = 748.21 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.10, Page No 55 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the energy extracted from the fluid\n",
+ "\n",
+ "#initialisation of variables\n",
+ "p=1000 #pressure lbf/in^2\n",
+ "p1=350 #pressure lbf/in^2\n",
+ "Sg=0.85 #Specific gravity\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Ha=p*2.31/Sg\n",
+ "H1=p1*2.31/Sg\n",
+ "He=Ha-H1-679.41\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The energy extracted from the fluid = %.2f lbf/in^2' %He)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy extracted from the fluid = 1087.06 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.11, Page No 55 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the Velocity of fluid\n",
+ "#initialisation of variables\n",
+ "h=40 #height ft\n",
+ "g=32.2 #ft/sec^2\n",
+ "#CALCULATIONS\n",
+ "v=math.sqrt(2*g*h) #velocity\n",
+ "#RESULTS\n",
+ "print('The energy extracted from the fluid = %.2f lbf/in^2' %v)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy extracted from the fluid = 50.75 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_4.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_4.ipynb
new file mode 100644
index 00000000..40e87503
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_4.ipynb
@@ -0,0 +1,158 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter no 4: How Fluids flow<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.1, Page No 64 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find displacement of the cylinder\n",
+ "\n",
+ "#initialisation of variables\n",
+ "a1=12.56 #Area(in^2)\n",
+ "s1=24 #stroke(in^3)\n",
+ "a2=3.14 #Area(in^2) displacement of ram\n",
+ "s2=24 #stroke in^3\n",
+ "Ve=0.785 #Extension volume in^3\n",
+ "\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Ve=a1*s1 #extension volume\n",
+ "Vs=a2*s2 \n",
+ "Vr=Ve-Vs #Retraction volume\n",
+ "Vt=Ve+Vr #Total volume\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Displacement of the cylinder would be = %.2f in^3' %Vt)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Displacement of the cylinder would be = 527.52 in^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.4, Page No 75 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find whther the flow laminar or tubulent\n",
+ "\n",
+ "#initialisation of variables\n",
+ "A=0.785 #area\n",
+ "Q=100 #gal/min flow rate\n",
+ "D=1 #in diameter\n",
+ "v=0.05 #viscocity Newts\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "V=Q/(A*3.12) #velocity\n",
+ "Nr=(12*V*D)/v #reynolds number\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The velocity would be = %.2f lbf-ft' %V)\n",
+ "print('The Reynolds number would be = %.2f Hence the flow is turbulent' %Nr)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity would be = 40.83 lbf-ft\n",
+ "The Reynolds number would be = 9799.12 Hence the flow is turbulent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.5, Page No 76 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find range of critical velocities\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Nr=4000 #reynolds number\n",
+ "Nr2=2000 #reynolds number\n",
+ "m=0.27 #P viscocity\n",
+ "D=2.54 #cm diameter\n",
+ "p=0.85 #pressure gm/cm^3\n",
+ "m2=27 #cP viscocity\n",
+ "D2=1 #in diameter\n",
+ "#CALCULATIONS\n",
+ "V=(Nr*m)/(D*p) #velocity\n",
+ "\n",
+ "# for lower critical velocity\n",
+ "V2=(Nr2*m)/(D*p)\n",
+ "v=m2/p\n",
+ "vn=0.001552*v\n",
+ "vh=(Nr*vn)/(12*D2)\n",
+ "vl=(Nr2*vn)/(12*D2)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The velocity would be = %.2f cm/sec' %V)\n",
+ "print('The lower velocity would be = %.2f cm/sec' %V2)\n",
+ "print('Using reynolds formula the velocity would be = %.2f ft/sec' %vh)\n",
+ "print('Using reynolds formula the lower velocity would be = %.2f ft/sec' %vl)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity would be = 500.23 cm/sec\n",
+ "The lower velocity would be = 250.12 cm/sec\n",
+ "using reynolds formula the velocity would be = 16.43 newts\n",
+ "using reynolds formula the lower velocity would be = 8.22 cm/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_5.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_5.ipynb
new file mode 100644
index 00000000..e8924ee8
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_5.ipynb
@@ -0,0 +1,349 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.1, Page No 82 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the pressure drop\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=200 #gal/min flow rate\n",
+ "A=3.14 #area in^2\n",
+ "f=0.05 #friction factor\n",
+ "g=32.2 #ft/sec^2\n",
+ "L=800 #ft length\n",
+ "Sg=0.91 #density\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=Q/(A*3.12) #velocity of fluid\n",
+ "D=(2*1.0)/12 #in\n",
+ "hf=f*(L/D)*((v*v)/(2*g)) #head loss\n",
+ "hps=0.433*Sg*hf\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pressure drop is = %.2f lbf/in^2' %hps)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop is = 611.99 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.2, Page No 84 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the pressure drop\n",
+ "#initialisation of variables\n",
+ "Q=15 #gal/min\n",
+ "A=0.785 #area\n",
+ "D=1 #diameter in\n",
+ "v1=0.08 #Viscocity Newts\n",
+ "L=400 #Length ft\n",
+ "g=32.2 #ft/sec^2\n",
+ "Sg=0.85 #density\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=Q/(A*3.12)\n",
+ "Nr=(12*v*D)/v1 #reynolds number\n",
+ "hf=(32*v1*L*v)/(D*D*g) #head drop\n",
+ "hps=0.433*Sg*hf\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pressure drop is = %.2f lbf/in^2' %hps)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop is = 71.68 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.3, Page No 87 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the pressure drop\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=600 #gal/min flow rate\n",
+ "A=3.14 #area in^2\n",
+ "f=0.040 #force in^2\n",
+ "D=2 #diameter in\n",
+ "v1=0.30 #Viscocity in^2sec\n",
+ "L=500 #length ft\n",
+ "g=32.2 #ft/sec^2\n",
+ "Sg=0.85 #density\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=Q/(A*3.12)\n",
+ "Nr=(12*v*D)/v1 #reynolds number\n",
+ "D=(2*1.0)/12\n",
+ "hf=f*(L/D)*((v*v)/(2*g))\n",
+ "hps=0.433*Sg*hf #Pressure drop\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pressure drop is = %.2f lbf/in^2' %hps)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop is = 2572.39 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.4, Page No 90 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the discharge coefficient\n",
+ "\n",
+ "#initialisation of variables\n",
+ "p=120 #pressure drop lbf/in^2\n",
+ "Sg=0.85 #density\n",
+ "Q=1000 #gal/min flow rate\n",
+ "A=3.14 #area \n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Cd=(1/38.06)*(Q/A)*(math.sqrt(Sg/p)) #discharge coefficient\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The discharge coefficient is = %.2f ' %Cd)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The discharge coefficient is = 0.70 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.5, Page No 94 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the total pressure loss\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=50 #gal/min flow rate\n",
+ "A=0.785 #area\n",
+ "D=1 #diameter in\n",
+ "f=1 #\n",
+ "v1=0.05 #Viscocity Newts\n",
+ "L=500 #length ft\n",
+ "g=32.2 #ft/sec^2\n",
+ "Sg=0.91 #Density\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=Q/(A*3.12) #velocity\n",
+ "Nr=(12*v*D)/v1 #Reynolds\n",
+ "temp=((v*v)/(2*g))\n",
+ "hi=0.78*temp #inward projection\n",
+ "ho=1.0*temp #Outward projection\n",
+ "hg=10.0*temp #Globe Valve\n",
+ "he=4*0.90*temp # 4 std 90 degree elbow\n",
+ "hn=(3.0/4)*temp #sudden enlargement\n",
+ "hc=0.5*3.0/4*temp #Sudden contraction\n",
+ "hff=hi+ho+hg++he+hn+hc #Total head loss\n",
+ "hps=0.433*Sg*hff\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The pressure drop is = %.2f lbf/in^2' %hps)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop is = 42.09 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.6, Page No 96 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find the length of the valve\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=150 #gal/min flow rate\n",
+ "A=0.785 #area in^2\n",
+ "D=1 #diameter in\n",
+ "f=0.045 #\n",
+ "v1=0.10 #Viscocity newts\n",
+ "Sg=0.91 #density\n",
+ "K=2.5\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=Q/(A*3.12)\n",
+ "Nr=(12*v*D)/v1 # Reynolds number\n",
+ "Le=(D*K)/(12*f) #length\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The equivalent length is = %.2f ft' %Le)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equivalent length is = 4.63 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.7, Page No 97 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find total pressure drop and fluid horsepwer\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Q=100 #gal/min flow rate\n",
+ "A1=3.14 #area in^2\n",
+ "A2=0.785 #area in^2\n",
+ "D=2 #Diameter in \n",
+ "k=12.4 #K-factor\n",
+ "g=32.2 #ft/sec^2\n",
+ "L=134.58 #Length ft\n",
+ "p=224.7 #Total pressure drop lbf/in^2\n",
+ "Q=100 #gal/min flow rate\n",
+ "L2=35.33 #ft length\n",
+ "#CALCULATIONS\n",
+ "v1=Q/(A1*3.12) #velocity\n",
+ "v2=Q/(A2*3.12) #velocity\n",
+ "v=0.001552*80 # kinematic viscosity from cSt to newts \n",
+ "Nr=(12*v1*D)/v #Reynold number\n",
+ "D1=1\n",
+ "D2=1\n",
+ "k2=20\n",
+ "f2=0.05\n",
+ "Nr2=(12*v2*D1)/v #Reynold number\n",
+ "f1=64/Nr\n",
+ "Le=(D*k)/(12*f1) #length\n",
+ "hf=f1*((L*(v1*v1))/((2.0/12.0)*(2*g)))\n",
+ "hsif=0.433*0.88*hf #pressure loss\n",
+ "Le2=(D2*k2)/(12*f2)\n",
+ "hf2=f2*((L2*(v2*v2))/((1.0/12.0)*(2*g)))\n",
+ "hsif2=0.433*0.88*hf2 #pressure loss\n",
+ "pd=hsif+hsif2\n",
+ "Fhp=(pd*Q)/1714\n",
+ "#RESULTS\n",
+ "print('The pressure drop is = %.2f lbf/in' %pd)\n",
+ "print('The fluid horsepwer is = %.2f hp' %Fhp)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop is = 225.24 lbf/in\n",
+ "The fluid horsepwer is = 13.14 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_6.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_6.ipynb
new file mode 100644
index 00000000..3b00bf86
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_6.ipynb
@@ -0,0 +1,130 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter No 6 :Hydraulic Fluids <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.2, Page No 115 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find how much fluid be expected compress\n",
+ "\n",
+ "#initialisation of variables\n",
+ "V1=1.0 #volume\n",
+ "p2=2000 #pressure lbf/in^2\n",
+ "p1=1000 #pressure lbf/in^2\n",
+ "K=350000 #k factor lbf/in^2\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "dV=V1*(p2-p1)/K\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The fluid be expected compress is = %.4f ' %dV)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fluid be expected compress is = 0.0029 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.3, Page No 127 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Find Beta Ratio\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "m1=36815.0 #Particles count upstream\n",
+ "m2=6347 #Particles count downstream\n",
+ "b=m1/m2 #beta ratio\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The beta ratio = %.1f ' %b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The beta ratio = 5.8 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.4, Page No 127 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Find Beta Efficiency\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "m1=36815.0 # Particles count upstream\n",
+ "m2=6347 #Particles count downstream\n",
+ "b=((m1-m2)/m1)*100 # Beta efficiency\n",
+ "\n",
+ "#RESULTS\n",
+ "print('The beta efficiency = %.2f percent' %b)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The beta efficiency = 82.76 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_7.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_7.ipynb
new file mode 100644
index 00000000..430ffa25
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_7.ipynb
@@ -0,0 +1,227 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter No 7 : Pumps <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 7.1, Page No 135 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Input torque\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P=2500.0 #pressure lbf/in^3\n",
+ "Q=3.0 #gpm flow rate\n",
+ "p=5.0 #Bhp power\n",
+ "N=1725.0 #rpm speed\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "eo=P*Q*100.0/(1714.0*p) # pump efficiency\n",
+ "To=p*5250.0/ N # torque Input\n",
+ "\n",
+ "#RESULTS\n",
+ "print('\\n Input torque = %.3f lb-ft ' %To)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Input torque = 15.217 lb-ft "
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 7.2 Page No 137 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Volumetric efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Q=52.0 #gpm flow rate\n",
+ "v=3.75 #in^3 positive displacement\n",
+ "N=3300.0 #rpm speed\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "ev=231.0*Q*100.0/(v*N) #Volumetric efficiency\n",
+ "\n",
+ "#RESULT\n",
+ "print('\\n Volumetric efficiency = %.3f percent ' %ev)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Volumetric efficiency = 97.067 percent "
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 7.3, Page No 137 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Mechanical efficiency and Frictional horsepower \n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "eo=87.0 #percent overall efficiency\n",
+ "ev=94.0 #percent volumetric efficiency\n",
+ "p=10.0 #bhpi\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "em=eo/ev # Mechanical efficiency\n",
+ "em1=em*100.0\n",
+ "Fhp=p*(1.0-em)\n",
+ "\n",
+ "#RESULTS\n",
+ "print(' \\n Frictional horsepower = %.3f hp ' %Fhp)\n",
+ "print('\\n Mechanical efficiency = %.2f percent ' %em1 )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ " Frictional horsepower = 0.745 hp \n",
+ "\n",
+ " Mechanical efficiency = 92.55 percent \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 7.4 Page No 150 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Volume flow rate\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "n=9.0 #no of cycles\n",
+ "N=3000.0 #rpm speed\n",
+ "s=0.75 #inch stroke\n",
+ "d=0.5 #inch diameter\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Q=n*N*s*math.pi*d**2/(4.0*231.0)\n",
+ "\n",
+ "#RESULTS\n",
+ "print(' Volume flow rate = %.3f gpm ' %Q)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Volume flow rate = 17.212 gpm "
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 7.5 Page No 162 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Minimum size of the reservoir\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "d=6.0 #in diameter\n",
+ "S=120.0 #in stroke\n",
+ "Q=5.0 #gpm flow rate\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Vc=math.pi*d**2*S/(4.0*231.0)\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Minimum size of the reservoir = %.3f gpm ' %Vc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum size of the reservoir = 14.688 gpm \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_8.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_8.ipynb
new file mode 100644
index 00000000..3c51c45a
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_8.ipynb
@@ -0,0 +1,283 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter 8 : Hydraulic Cylinders and Cushioning Devices <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.1 Page No 172 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Size of the cylinder postion\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "F=80000.0 #lbs Force\n",
+ "F2=355800.0 #N Force\n",
+ "P=1600.0 #lbf/in^2 Pressure\n",
+ "P2=11.03*(1000000) #N/m^2 Pressure\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "db=math.sqrt(4.0*F/(math.pi*P))\n",
+ "#In SI units\n",
+ "db2=math.sqrt((4.0*F2)/(math.pi*P2))\n",
+ "db2=db2*100 # To convert it into cm\n",
+ "#RESULTS\n",
+ "print('\\n Size of the cylinder postion = %.3f in ' %db)\n",
+ "print('\\n Using SI units size of the cylinder postion = %.1f cm ' %db2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Size of the cylinder postion = 7.979 in \n",
+ "\n",
+ " Size of the cylinder postion = 20.266 in \n",
+ "\n",
+ " Size of the cylinder postion = 11030000.000 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.2 Page No 173 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Fluid velocity and Cylinder velocity\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Q=25.0 #gpm flow rate\n",
+ "A=0.533 #in^2 area\n",
+ "\n",
+ "#Calculations\n",
+ "nu=Q*19.25/(A*60.0) #Fluid velocity\n",
+ "nucylinder =Q*19.25/12.56 #Cylinder velocity\n",
+ "\n",
+ "#Results\n",
+ "print('\\n Fluid velocity = %.3f ft/sec' %nu)\n",
+ "print('\\n Cylinder velocity = %.3f ft/min' %nucylinder )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Fluid velocity = 15.048 ft/sec\n",
+ "\n",
+ " Cylinder velocity = 38.316 ft/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.3 Page No 178 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Length of the stop tube\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "d=3.0 #in diameter\n",
+ "P=2000.0 #lbf/in^2 pressure\n",
+ "s=20.0 #stroke in\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Cl=s*d/2.0 #corrected length\n",
+ "F=P*math.pi*d**2/4.0 #thrust\n",
+ "stl=(Cl-40.0)/10.0 #stop tube length\n",
+ " \n",
+ "#RESULTS\n",
+ "print('\\n Length of the stop tube= %.3f in ' %Cl)\n",
+ "F=F+3\n",
+ "print('\\n Thrust on the rod= %.3f lb ' %F)\n",
+ "print('\\n Stop Tube length= %.3f stl ' %stl)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Length of the stop tube= 30.000 in \n",
+ "\n",
+ " Thrust on the rod= 14140.167 lb \n",
+ "\n",
+ " Stop Tube length= -1.000 stl "
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.4 Page No 182 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Total force decessary to decelarate the load\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "v=120.0 #ft/min velocity\n",
+ "S=1.5 #in distance\n",
+ "w=8000.0 #lb wight\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "ga=v**2*0.0000517/S\n",
+ "F=w*ga\n",
+ "#RESULTS\n",
+ "print(' Total force decessary to decelarate the load= %.3f lb ' %F)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total force decessary to decelarate the load= 3970.560 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.5 Page No 184 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Total force decessary to decelarate the load\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P=750.0 #lbf/in^2 pressure\n",
+ "d=3.0 #in distance\n",
+ "w=1500.0 #lb weight\n",
+ "ga=0.172 #Acceleration factor\n",
+ "f=0.12 #Coefficient of fraction\n",
+ "v=50 #ft/min velocity\n",
+ "s=0.75 #in stroke\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Fa=P*math.pi*d**2/4.0\n",
+ "F=w*(ga-f)+Fa\n",
+ "#RESULT\n",
+ "print('\\n Total force decessary to decelarate the load= %.3f lb ' %F)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Total force decessary to decelarate the load= 5379.438 lb \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.6 Page No 186 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Pressure in the cylinder\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "d=3.0 #in diameter\n",
+ "d1=1.5 #in diameter\n",
+ "F=7500.0 #lb force\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "A1=(math.pi/4.0)*(d**2-d1**2)\n",
+ "P=F/A1\n",
+ "#RESULT\n",
+ "print(' Pressure in the cylinder = %.3f psi' %P)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Pressure in the cylinder = 1413.711 psi"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_9.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_9.ipynb
new file mode 100644
index 00000000..a9d6cb72
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_No_9.ipynb
@@ -0,0 +1,271 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter No 9 : Hydraulic motors<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example9.1 Page No 194 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Theotrical torque\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "P=2000.0 #lbf/in^3 pressure\n",
+ "Vm=0.5 #in^3 displacement\n",
+ "\n",
+ "#CALCULATONS\n",
+ "T=P*Vm*0.16\n",
+ "\n",
+ "#RESULTS\n",
+ "print('\\n Theotrical torque = %.3f lb-in ' %T)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Groove diameter = 3.776 in \n",
+ " \n",
+ " Groove width = 0.196 in \n",
+ "\n",
+ " outside diameter = 4.000 in "
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 9.2 Page No 194 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Theotrical speed of fluid power\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Q=7.5 #gpm flow rate\n",
+ "Q2=28.39 #l/min f;ow rate\n",
+ "Vm=2 #in^3 displacement\n",
+ "Vm2=0.03281 #l/rev displacement\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "N=231.0*Q/Vm # Theotrical speed\n",
+ "#SI units\n",
+ "N2=(Q2/Vm2) # in SI units Theotrical speed\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Theotrical speed of fluid power = %.3f rpm ' %N)\n",
+ "print(' Using SI units Theotrical speed of fluid power = %.3f rev/min ' %N2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Theotrical speed of fluid power = 866.250 rpm \n",
+ " Using SI units Theotrical speed of fluid power = 865.285 rev/min \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 9.3 Page No 195 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Effective flow rate\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Vm=0.55 #in^3 displacement\n",
+ "N=3400.0 #rpm Theotrical speed\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Q=Vm*N/231.0\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Effective flow rate = %.3f gpm ' %Q)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Effective flow rate = 8.095 gpm \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 9.4 Page No 195 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Overall efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "T=32.0 #lb_ft torque\n",
+ "N=1200.0 #rpm Theotrical speed\n",
+ "P=2000.0 #psi pressure lbf/in^2\n",
+ "Q=7.5 #gpm flow rate\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "eo=T*N*100.0/(P*Q*3.06)\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Overall efficiency = %.3f percent ' %eo)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Overall efficiency = 83.660 percent \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 9.5 Page No 196 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find Volumetric efficiency\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "Vm=0.6 #in^3 displacement\n",
+ "N=2400 #rpm theotrical speed\n",
+ "Qa=6.5 #gal/min flow rate\n",
+ "Vm1=0.00981 #l/rev displacement\n",
+ "#CALCULATIONS\n",
+ "ev=((Vm*N)/(Qa*231))*100\n",
+ "#in SI units\n",
+ "ev1=((Vm1*N)/(24.611))*100\n",
+ "TFL=0.041*Qa # total fluid loss\n",
+ "CDL=0.50*TFL #Case drain loss\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Total fluid loss = %.2f gal/min ' %TFL)\n",
+ "print(' Case drain loss = %.2f gal/min ' %CDL)\n",
+ "print(' Volumetric efficiency = %.2f percent ' %ev)\n",
+ "print(' Volumetric efficiency in SI units = %.2f percent ' %ev1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total fluid loss = 0.27 gal/min \n",
+ " Case drain loss = 0.13 gal/min \n",
+ " Volumetric efficiency = 95.90 percent \n",
+ " Volumetric efficiency in SI units = 95.66 percent \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 9.6 Page No 197 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find mechnical efficiency efficiency\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable initialization\n",
+ "eo=88.0 # Overall efficiency (%)\n",
+ "ev=97 # Volumetric efficiency(%)\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "em=(eo/ev)*100\n",
+ "\n",
+ "#RESULT\n",
+ "print(' Mechnical efficiency efficiency = %.3f percent ' %em)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Mechnical efficiency efficiency = 90.722 percent \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_no_1.ipynb b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_no_1.ipynb
new file mode 100644
index 00000000..b36c2082
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/Chapter_no_1.ipynb
@@ -0,0 +1,57 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter No 1: Introduction<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.1, Page No 17 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find force\n",
+ "\n",
+ "#initialisation of variables\n",
+ "Pressure=1500.0 #lbf\n",
+ "Area=12.57 #in^2\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "Force=Pressure*Area\n",
+ "\n",
+ "#RESULTS\n",
+ "print('Force is = %.2f lbf' %Force)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force is = 18855.00 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/README.txt b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/README.txt
new file mode 100644
index 00000000..b517b76e
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Mayur Sabban
+Course: be
+College/Institute/Organization: Vishwakarma Institute of Technology Pune
+Department/Designation: Computer Engg
+Book Title: Fluid Power Theory & Applications by J. Sullivan, 4th Edition
+Author: J. Sullivan
+Publisher: Reston Publishing Company
+Year of publication: 2007
+Isbn: 0137555881
+Edition: 4 \ No newline at end of file
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter2.png b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter2.png
new file mode 100644
index 00000000..6a07ebad
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter2.png
Binary files differ
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter4.png b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter4.png
new file mode 100644
index 00000000..738fa40e
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/Chapter4.png
Binary files differ
diff --git a/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/chapter3.png b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/chapter3.png
new file mode 100644
index 00000000..4b8ccbd2
--- /dev/null
+++ b/_Fluid_Power_Theory_&_Applications_by_J._Sullivan,_4th_Edition/screenshots/chapter3.png
Binary files differ
diff --git a/_Programming_With_C/README.txt b/_Programming_With_C/README.txt
new file mode 100644
index 00000000..87b1d603
--- /dev/null
+++ b/_Programming_With_C/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Adnaan Ahmed
+Course: btech
+College/Institute/Organization: Heritage Institute of Technology
+Department/Designation: Computer Science and Engineering
+Book Title: Programming With C
+Author: Byron S. Gottfried
+Publisher: McGraw Hill Education (India) Private Limited, New Delhi
+Year of publication: 2013
+Isbn: 978-0-07-014590-0
+Edition: 3rd Edition \ No newline at end of file
diff --git a/_Programming_With_C/chapter1.ipynb b/_Programming_With_C/chapter1.ipynb
new file mode 100644
index 00000000..599cad41
--- /dev/null
+++ b/_Programming_With_C/chapter1.ipynb
@@ -0,0 +1,61 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 1: Introductory Concepts <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1.6, Page number: 1.19<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Area of a Circle\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "radius=5\n",
+ "area=math.pi*radius*radius\n",
+ "print \"Area = \",area\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area = 78.5398163397\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter10.ipynb b/_Programming_With_C/chapter10.ipynb
new file mode 100644
index 00000000..083baffa
--- /dev/null
+++ b/_Programming_With_C/chapter10.ipynb
@@ -0,0 +1,268 @@
+{
+ "metadata": {
+ "name": "chapter10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 10: Strings<h1> "
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.3, Page Number: 10.3<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "st='Programming'\nprint 'The string is %s' %st",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The string is Programming\n"
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.4, Page Number: 10.4<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "st='Hello World'\nprint 'The line is :'\nprint st",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The line is :\nHello World\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.6, Page Number: 10.5<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#display the string character by character\n\nstrin='Welcome to python'\nfor i in strin:\n print i,",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "W e l c o m e t o p y t h o n\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.7, Page Number: 10.6<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# to demonstrate the use of operators related function\n\nstr1='Programming'\nlen1=len(str1)\nprint 'The length of the string is ',len1\n\nstr2=str1\nprint 'First string is %s and copied string is %s' %(str1,str2)\n\nstr3='Computer'\n\nif str1==str3:\n print 'Both strings are equal'\nelif str1<str2:\n print 'First string is lesser than second string'\nelse:\n print 'First string is greater than second string'\n \ntempstr=' with C'\nstr1=str1+tempstr\nprint 'The concated string is ',str1\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The length of the string is 11\nFirst string is Programming and copied string is Programming\nFirst string is greater than second string\nThe concated string is Programming with C\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.8,Page Number: 10.7<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# user defined function for string length and string copy\n\ndef strlength(str1):\n count=0\n for i in str1:\n count+=1\n \n return count\ndef strcopy(src):\n dst=[]\n for i in src:\n dst.append(i)\n \n dst=''.join(dst)\n \n return dst\n\n\nstr1='New Delhi'\nlen1=strlength(str1)\nprint 'The length of the string is ',len1\n\nstr2=strcopy(str1)\nprint 'First string is %s and copied string is %s' %(str1,str2)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The length of the string is 9\nFirst string is New Delhi and copied string is New Delhi\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.9,Page Number: 10.9<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# A user defined implementation of comparison of two strings\n\ndef strcompare(str1,str2):\n \n len1=len(str1)\n len2=len(str2)\n \n if len1<len2:\n length=len1\n else:\n length=len2\n \n for i in xrange(0,length):\n if str1[i]<str2[i]:\n return -1\n elif str1[i]>str2[i]:\n return 1\n \n return 0\n\nstr1='Programming'\nstr2='Computer'\nstatus=strcompare(str1,str2)\nif status==-1:\n print 'First string is lesser than second string'\nelif status==1:\n print 'First string is greater than second string'\nelse:\n print 'Both strings ae equal'\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "First string is greater than second string\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.10, Page Number: 10.10<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Left as well as right concatenation of two strings\n\ndef leftconcat(dst,src):\n dst=src+dst\n return dst\n\ndef rightconcat(dst,src):\n dst=dst+src\n return dst\n\nstr1='Hello'\nstr2='Friends'\n\ntempstr=leftconcat(str2,str1)\nprint 'The first string after left concatenation becomes ', tempstr\n\ntempstr=rightconcat(str2,str1)\nprint 'The first string after right concatenation becomes', tempstr\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The first string after left concatenation becomes HelloFriends\nThe first string after right concatenation becomes FriendsHello\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.11,Page Numbr: 10.12<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# program to count total number of vowel in a given text\n\nstr1='All good boys have bread'\ncount=0\n\nfor i in str1:\n if i=='a' or i=='e'or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U' :\n count+=1\n \nprint 'Total number of vowels in a given text are ',count",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Total number of vowels in a given text are 8\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.12, Page Number: 10.13<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Character arithmetic examples\n\nch1='A'\nch2=ord(ch1)+3\nprint chr(ch2)\n\nch1=chr(ord(ch1)+1)\nprint ch1\n\nprint ord('a')\nprint ord('l')\n\nval=ord(ch1)*ch2\nprint val\n\nprint chr(100)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "D\nB\n97\n108\n4488\nd\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.13, Page Number: 10.13<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Program to convert lowercase alphabets to uppercase in a given text\n\ntext='I am studying 6 Theory Papers & 4 practicals'\n\nlen1=len(text)\ntext=list(text)\nfor i in xrange(0,len1):\n if text[i]>='a' and text[i]<='z':\n text[i]=chr(ord(text[i])+ord('A')-ord('a'))\n \n \ntext=''.join(text)\n\nprint 'The text after converting lowercase alphabets to uppercase is '\nprint text",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The text after converting lowercase alphabets to uppercase is \nI AM STUDYING 6 THEORY PAPERS & 4 PRACTICALS\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.14, Page Number: 10.14<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Program to search for a substring in a given string\n\ntext='The programming is a systematic process'\nsubstr='pro'\ntext_len=len(text)\nsub_len=len(substr)\ntext=list(text)\nsubstr=list(substr)\n\nfor i in xrange(0,text_len-sub_len+1):\n \n for j in xrange(0,sub_len):\n \n if text[i+j]==substr[j]:\n continue\n else:\n break\n \n if j==sub_len-1:\n print 'The substring is present from subscript %d onwards' %i\n \n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The substring is present from subscript 4 onwards\nThe substring is present from subscript 32 onwards\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 10.15,Page number: 10.15<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Reordering a list of strings\n\n\ndef reorder(x):\n\n n=len(x)\n for item in range(0,n-1):\n for i in range(item+1,n):\n if x[item]>x[i]:\n temp=x[item]\n x[item]=x[i]\n x[i]=temp\n\n\n return\n\nx=['PACIFIC','ATLANTIC','INDIAN','CARIBBEAN','BERING','BLACK','RED','NORTH','BALTIC','CASPIAN']\nprint 'Original list of strings :\\n\\n'\n\nfor i in x:\n print \"String : \",i\n\nreorder(x)\n\nprint \"\\nReodered list of strings : \\n\\n\"\n\nfor i in x:\n print \"String : \",i\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original list of strings :\n\n\nString : PACIFIC\nString : ATLANTIC\nString : INDIAN\nString : CARIBBEAN\nString : BERING\nString : BLACK\nString : RED\nString : NORTH\nString : BALTIC\nString : CASPIAN\n\nReodered list of strings : \n\n\nString : ATLANTIC\nString : BALTIC\nString : BERING\nString : BLACK\nString : CARIBBEAN\nString : CASPIAN\nString : INDIAN\nString : NORTH\nString : PACIFIC\nString : RED\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter11.ipynb b/_Programming_With_C/chapter11.ipynb
new file mode 100644
index 00000000..1f4127e4
--- /dev/null
+++ b/_Programming_With_C/chapter11.ipynb
@@ -0,0 +1,328 @@
+{
+ "metadata": {
+ "name": "chapter11"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h1>Chapter 11: Pointers<h1>"
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.1, Page 11.2<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# realtionship between two variables, their address and associated pointers\n\n\nu,v=[3],[]\npu=u\nv=pu\npv=v\n\nprint \"u=\",u[0],\nprint \"&u=\",id(u),\nprint \"pu=\",id(u),\nprint \"*pu\",pu[0]\n\nprint \"v=\",v[0],\nprint \"&v=\",id(v),\nprint \"pv=\",id(v),\nprint \"*pv\",pv[0]\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "u= 3 &u= 56575840 pu= 56575840 *pu 3\nv= 3 &v= 56575840 pv= 56575840 *pv 3\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.2, Page number: 11.3<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# a simple program using pointers\n\n\nv=[3]\nu1=2*(v[0]+5)\npv=v\nu2=2*(pv[0]+5)\n\nprint \"u1=%d u2=%d\" %(u1,u2)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "u1=16 u2=16\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.3, Page munber: 11.4<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# a simple programme using pointers\n\nv=[3]\npv=v\nprint \"*pv=%d v=%d\" %(pv[0],v[0])\n\npv[0]=0\nprint \"*pv=%d v=%d\" %(pv[0],v[0])",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "*pv=3 v=3\n*pv=0 v=0\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.7, Page number: 11.6<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# difference between by pass by reference and pass by value\n\n\ndef funct1(u,v):\n u=0\n v=0\n print \"Within funct1 : u=%d v=%d\" %(u,v)\n return\n\ndef funct2(u,v):\n u[0]=0\n v[0]=0\n print \"Within funct2 : *pu=%d *pv=%d\" %(u[0],v[0])\n return\n\nu=[1]\nv=[3]\n\nprint \"Before calling funct1: u=%d v=%d\" %(u[0],v[0])\nfunct1(u[0],v[0])\nprint \"After calling funct1 : u=%d v=%d\" %(u[0],v[0])\n\nprint \"Before calling funct2: u=%d v=%d\" %(u[0],v[0])\nfunct2(u,v)\nprint \"After calling funct2 : u=%d v=%d\" %(u[0],v[0])",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Before calling funct1: u=1 v=3\nWithin funct1 : u=0 v=0\nAfter calling funct1 : u=1 v=3\nBefore calling funct2: u=1 v=3\nWithin funct2 : *pu=0 *pv=0\nAfter calling funct2 : u=0 v=0\n"
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.8, Page number: 11.8<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Analyzing a line of text\n\n\n\ndef scan_line(line,pv,pc,pd,pw,po):\n\n for c in line:\n\n if c=='A' or c=='E' or c=='I' or c=='O' or c=='U':\n pv[0]+=1\n elif c>='A' and c<='Z':\n pc[0]+=1\n elif c>='0' and c<='9':\n pd[0]+=1\n elif c==' ' or c=='\\t':\n pw[0]+=1\n else:\n po[0]+=1\n\n return\n\n\nvowel,consonants,digits,whitespc,other=[0],[0],[0],[0],[0]\nline=\"Personal computers with memories in excess of 4096 KB are now quite common.\"\nline=line.upper()\nscan_line(line,vowel,consonants,digits,whitespc,other)\nprint \"\\n\\n\"\nprint \"No. of vowels : \",vowel[0]\nprint \"No. of consonants : \",consonants[0]\nprint \"No. of digits : \",digits[0]\nprint \"No. of whitespace characters : \",whitespc[0]\nprint \"No. of other characters : \",other[0]",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n\n\nNo. of vowels : 23\nNo. of consonants : 35\nNo. of digits : 4\nNo. of whitespace characters : 12\nNo. of other characters : 1\n"
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.12, Page number: 11.15<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# unlike C in python the elements of a list are not arranged in memory uniformly\n\nx=[10,11,12,13,14,15,16,17,18,19]\n\nfor i in range(0,10):\n print \"i=%d x[i]=%d *(x+1)=%d\" %(i,x[i],x[i]),\n print \" &x[i]=\",id(x[i]),\n print \" x+i=\",id(x[i])",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "i=0 x[i]=10 *(x+1)=10 &x[i]= 30696620 x+i= 30696620\ni=1 x[i]=11 *(x+1)=11 &x[i]= 30696608 x+i= 30696608\ni=2 x[i]=12 *(x+1)=12 &x[i]= 30696596 x+i= 30696596\ni=3 x[i]=13 *(x+1)=13 &x[i]= 30696584 x+i= 30696584\ni=4 x[i]=14 *(x+1)=14 &x[i]= 30696572 x+i= 30696572\ni=5 x[i]=15 *(x+1)=15 &x[i]= 30696560 x+i= 30696560\ni=6 x[i]=16 *(x+1)=16 &x[i]= 30696548 x+i= 30696548\ni=7 x[i]=17 *(x+1)=17 &x[i]= 30696536 x+i= 30696536\ni=8 x[i]=18 *(x+1)=18 &x[i]= 30696524 x+i= 30696524\ni=9 x[i]=19 *(x+1)=19 &x[i]= 30696512 x+i= 30696512\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.14, Page number: 11.17<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# string as one dimensional character array\n\ndef main():\n global x\n y=\"This string is declared within main\"\n y=list(y)\n x=list(x)\n print x\n print y\n\n return\n\nx=\"This string is declared externally\"\nmain()\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "['T', 'h', 'i', 's', ' ', 's', 't', 'r', 'i', 'n', 'g', ' ', 'i', 's', ' ', 'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd', ' ', 'e', 'x', 't', 'e', 'r', 'n', 'a', 'l', 'l', 'y']\n['T', 'h', 'i', 's', ' ', 's', 't', 'r', 'i', 'n', 'g', ' ', 'i', 's', ' ', 'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd', ' ', 'w', 'i', 't', 'h', 'i', 'n', ' ', 'm', 'a', 'i', 'n']\n"
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.16, Page number: 11.19<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Reoedering a list of numbers\n\n\ndef reorder(x):\n n=len(x)\n for item in range(0,n-1):\n for i in range(item+1,n):\n if x[i]<x[item]:\n temp=x[item]\n x[item]=x[i]\n x[i]=temp\n\n return\n\nn=10\nx=[]\n\nfor i in range(0,n):\n inp=i+1\n print \"\\ni=%d x=%d\" %(i+1,inp),\n x.append(inp)\n\nreorder(x)\n\nprint \"\\n\"\nfor i in range(0,n):\n print \"i=%d x=%d\" %(i+1,x[i])\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\ni=1 x=1 \ni=2 x=2 \ni=3 x=3 \ni=4 x=4 \ni=5 x=5 \ni=6 x=6 \ni=7 x=7 \ni=8 x=8 \ni=9 x=9 \ni=10 x=10 \n\ni=1 x=1\ni=2 x=2\ni=3 x=3\ni=4 x=4\ni=5 x=5\ni=6 x=6\ni=7 x=7\ni=8 x=8\ni=9 x=9\ni=10 x=10\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.17, Page number: 11.21<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Pointer arithmetic doesnt exixt in python\n\ni=[4]\ni[0]=1\nf=0.3\nd=0.005\nc='*'\n\npx=i\nprint 'Values: i=%d f=%f d=%f c=%c \\n' %(i[0],f,d,c)\nprint 'Addresses: &i=%X &f=%X &d=%X &c=%X \\n' %(id(i[0]),id(f),id(d),id(c))\nprint 'Pointer Values: px=%X px+1=%X px+2=%X px+3=%X' %(id(px[0]),id(px[0]+1),id(px[0]+2),id(px[0]+3))\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Values: i=1 f=0.300000 d=0.005000 c=* \n\nAddresses: &i=1D46518 &f=32BD940 &d=32BD950 &c=1D9F158 \n\nPointer Values: px=1D46518 px+1=1D4650C px+2=1D46500 px+3=1D464F4\n"
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.18, Page number: 11.22<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# two different pointer variable points to the first and last element of an integer array\n\na=[1,2,3,4,5,6]\n\npx=a[0]\npy=a[5]\n\nprint 'px=%X py=%X \\n' %(id(px),id(py))\nprint 'py - px = %X' %(id(py)-id(px))",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "px=1D46518 py=1D464DC \n\npy - px = -3C\n"
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.22, Page number: 11.26<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# adding two tables of numbers\n\ndef readinput(m,n,i=0):\n\n at=[]\n for row in range(0,m):\n temp=[]\n for col in range(0,n):\n t=i\n i+=2\n temp.append(t)\n at.append(temp)\n\n\n return at\n \ndef computesum(a,b,m,n):\n\n c=[]\n\n for row in range(0,m):\n temp=[]\n for col in range(0,n):\n t=a[row][col]+b[row][col]\n temp.append(t)\n c.append(temp)\n\n return c\n\ndef writeoutput(c,m,n):\n\n for row in range(0,m):\n for col in range(0,n):\n print \"%4d\" %(c[row][col]),\n print\n\n return\n\n\n\nprint \"\\n FIRST TABLE : \\n\"\na=readinput(5,5,1)\nwriteoutput(a,5,5)\n\nprint \"\\n SECOND TABLE : \\n\"\nb=readinput(5,5,50)\nwriteoutput(b,5,5)\n\nc=computesum(a,b,5,5)\nprint \"Sums of the elements : \\n\"\nwriteoutput(c,5,5)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n FIRST TABLE : \n\n 1 3 5 7 9\n 11 13 15 17 19\n 21 23 25 27 29\n 31 33 35 37 39\n 41 43 45 47 49\n\n SECOND TABLE : \n\n 50 52 54 56 58\n 60 62 64 66 68\n 70 72 74 76 78\n 80 82 84 86 88\n 90 92 94 96 98\nSums of the elements : \n\n 51 55 59 63 67\n 71 75 79 83 87\n 91 95 99 103 107\n 111 115 119 123 127\n 131 135 139 143 147\n"
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.24, Page number: 11.31<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# adding two tables of numbers\n\ndef readinput(m,n,i=0):\n\n at=[]\n for row in range(0,m):\n temp=[]\n for col in range(0,n):\n t=i\n i+=2\n temp.append(t)\n at.append(temp)\n\n\n return at\n \ndef computesum(a,b,m,n):\n\n c=[]\n\n for row in range(0,m):\n temp=[]\n for col in range(0,n):\n t=a[row][col]+b[row][col]\n temp.append(t)\n c.append(temp)\n\n return c\n\ndef writeoutput(c,m,n):\n\n for row in range(0,m):\n for col in range(0,n):\n print \"%4d\" %(c[row][col]),\n print\n\n return\n\n\n\nprint \"\\n FIRST TABLE : \\n\"\na=readinput(5,5,1)\nwriteoutput(a,5,5)\n\nprint \"\\n SECOND TABLE : \\n\"\nb=readinput(5,5,50)\nwriteoutput(b,5,5)\n\nc=computesum(a,b,5,5)\nprint \"Sums of the elements : \\n\"\nwriteoutput(c,5,5)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "\n FIRST TABLE : \n\n 1 3 5 7 9\n 11 13 15 17 19\n 21 23 25 27 29\n 31 33 35 37 39\n 41 43 45 47 49\n\n SECOND TABLE : \n\n 50 52 54 56 58\n 60 62 64 66 68\n 70 72 74 76 78\n 80 82 84 86 88\n 90 92 94 96 98\nSums of the elements : \n\n 51 55 59 63 67\n 71 75 79 83 87\n 91 95 99 103 107\n 111 115 119 123 127\n 131 135 139 143 147\n"
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.26, Page number: 11.34<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Reordering a list of strings\n\n\ndef reorder(x):\n\n n=len(x)\n for item in range(0,n-1):\n for i in range(item+1,n):\n if x[item]>x[i]:\n temp=x[item]\n x[item]=x[i]\n x[i]=temp\n\n\n return\n\nx=['PACIFIC','ATLANTIC','INDIAN','CARIBBEAN','BERING','BLACK','RED','NORTH','BALTIC','CASPIAN']\nprint 'Original list of strings :\\n\\n'\n\nfor i in x:\n print \"String : \",i\n\nreorder(x)\n\nprint \"\\nReodered list of strings : \\n\\n\"\n\nfor i in x:\n print \"String : \",i",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Original list of strings :\n\n\nString : PACIFIC\nString : ATLANTIC\nString : INDIAN\nString : CARIBBEAN\nString : BERING\nString : BLACK\nString : RED\nString : NORTH\nString : BALTIC\nString : CASPIAN\n\nReodered list of strings : \n\n\nString : ATLANTIC\nString : BALTIC\nString : BERING\nString : BLACK\nString : CARIBBEAN\nString : CASPIAN\nString : INDIAN\nString : NORTH\nString : PACIFIC\nString : RED\n"
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.28, Page number: 11.37<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Display the day of the year\n\n\ndef convert(mm,dd,yy):\n yy-=1900\n ndays=long(30.42*(mm-1)+dd)\n if mm==2:\n ndays+=1\n if mm>2 and mm<8:\n ndays-=1\n if yy%4==0 and mm<2:\n ndays+=1\n\n ncycles=yy/4\n ndays+=ncycles*1461\n\n nyears=yy%4\n if nyears>0:\n ndays+=365*nyears+1\n if ndays>59:\n ndays-=1\n\n day=ndays%7\n\n return day\n\ndef main(mm,dd,yy):\n day_of_week=convert(mm,dd,yy)\n print \"%s, %s %d %d\" %(weekday[day_of_week],month[mm-1],dd,yy)\n return\n \nweekday=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']\nmonth=['January','February','March','April','May','June','July','August',\\\n 'September','October','November','December']\n\nmain(10,29,1929)\nprint\nmain(8,15,1945)\nprint\nmain(7,20,1969)\nprint\nmain(5,24,1997)\nprint\nmain(8,30,2010)\nprint\nmain(4,12,2069)\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Tuesday, October 29 1929\n\nWednesday, August 15 1945\n\nSunday, July 20 1969\n\nSaturday, May 24 1997\n\nMonday, August 30 2010\n\nFriday, April 12 2069\n"
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": "<h3>Example 11.30, Page number: 11.44<h3>"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Future value of monthly deposits (compound interest calculations)\n\n\ndef ratio_choose(freq,a,m,n):\n\n if freq=='C':\n ratio=md3(a,m,n)\n elif freq=='D':\n ratio=md2(a,m,n)\n else:\n ratio=md1(a,m,n)\n\n return ratio\n\n\ndef table(freq,a,m,n):\n\n\n print \"Interest Rate Future Amount\\n\\n\"\n for count in range(1,21):\n i=0.01*count\n f=a*ratio_choose(freq,i,m,n)\n print \" %2d %.2f\" %(count,f)\n\n return\n\ndef md1(i,m,n):\n \n factor=1+i/m\n ratio=12*(factor**(m*n)-1)/i\n return ratio\n\ndef md2(i,m,n):\n\n factor=1+i/m\n ratio=(factor**(m*n)-1)/(factor**(m/12)-1)\n return ratio\n\ndef md3(i,dummy,n):\n ratio=(10**(i*n)-1)/(10**(i/12)-1)\n return ratio\n\ndef main(freq):\n m=0\n freq=freq.upper()\n if freq=='A':\n m=1\n print \"\\nAnual Compounding\\n\"\n \n elif freq=='S':\n m=2\n print \"\\nSemiannual Compounding\\n\"\n \n elif freq=='Q':\n print \"\\nQuaterly Compounding\\n\"\n m=4\n \n elif freq=='M':\n m=12\n print \"\\nMonthly Compounding\\n\"\n \n elif freq=='D':\n m=360\n print \"\\nDaily Compounding\\n\"\n\n elif freq=='C':\n m=0\n print \"\\nContinuous Compounding\\n\"\n \n else:\n print \"\\nERROR!!! Please Repeat\\n\\n\"\n return\n \n return m\n\n\na,n,freq=100,3,'m'\nprint \"FUTURE VALUE OF A SERIES OF MONTHLY DEPOSITS\\n\\n\"\nprint \"Frequency of Compunding (A,S,Q,M,D,C): \",freq\nprint \"Amount of Each Monthly Payement : \",a\nprint \"Number of years: \",n\nm=main(freq)\n\ntable(freq,a,m,n)\n\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "FUTURE VALUE OF A SERIES OF MONTHLY DEPOSITS\n\n\nFrequency of Compunding (A,S,Q,M,D,C): m\nAmount of Each Monthly Payement : 100\nNumber of years: 3\n\nMonthly Compounding\n\nInterest Rate Future Amount\n\n\n 1 3653.00\n 2 3707.01\n 3 3762.06\n 4 3818.16\n 5 3875.33\n 6 3933.61\n 7 3993.01\n 8 4053.56\n 9 4115.27\n 10 4178.18\n 11 4242.31\n 12 4307.69\n 13 4374.33\n 14 4442.28\n 15 4511.55\n 16 4582.17\n 17 4654.18\n 18 4727.60\n 19 4802.45\n 20 4878.78\n"
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 25
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter12.ipynb b/_Programming_With_C/chapter12.ipynb
new file mode 100644
index 00000000..8cde425c
--- /dev/null
+++ b/_Programming_With_C/chapter12.ipynb
@@ -0,0 +1,568 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 12: Structures and Unions<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.1, Page 12.2<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*20\n",
+ "\n",
+ "class account(Structure):\n",
+ "\t_fields_=[('acct_no',c_int),('acct_type',c_char),('name',string),('balance',c_int)]\n",
+ "\n",
+ "customer=account(12632,'r','Joseph',1200)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.4, Page 12.4<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*20\n",
+ "\n",
+ "class date(Structure):\n",
+ "\t_fields_=[('month',c_int),('day',c_int),('year',c_int)]\n",
+ "\t\n",
+ "class account(Structure):\n",
+ "\t_fields_=[('acct_no',c_int),('acct_type',c_char),('name',string),('balance',c_float),('lastpayment',date)]\n",
+ "\t\n",
+ "customer=account(12345,'r','John W. Smith',586.30,date(5,24,90))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.6, Page 12.6<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*20\n",
+ "\n",
+ "class date(Structure):\n",
+ "\t\n",
+ "\t_fields_=[('name',string),('month',c_int),('day',c_int),('year',c_int)]\n",
+ "\n",
+ "birthday=[]\n",
+ "birthday.append(date('Amy',12,30,73))\n",
+ "birthday.append(date('Gail',5,13,66))\n",
+ "birthday.append(date('Marc',7,15,72))\n",
+ "birthday.append(date('Marla',11,29,70))\n",
+ "birthday.append(date('Megan',2,4,77))\n",
+ "birthday.append(date('Sharon',12,29,63))\n",
+ "birthday.append(date('Susan',4,12,69))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.14, Page 12.13<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Updating Costumer Records\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*50\n",
+ "\n",
+ "def writeoutput(obj):\n",
+ "\tprint \"Name : \",obj.name,\n",
+ "\tprint \"\\t Account Number : \",obj.acct_no\n",
+ "\tprint \"Street : \",obj.street\n",
+ "\tprint \"City : \",obj.city\n",
+ "\tprint \"Old Balance : %7.2f\" %(obj.oldbalance)\n",
+ "\tprint \"Payment : %7.2f\" %(obj.payment)\n",
+ "\tprint \"New Balance : %7.2f\" %(obj.newbalance)\n",
+ "\tprint \"Account Status : \",\n",
+ "\t\n",
+ "\tif obj.acct_type=='C':\n",
+ "\t\tprint \"CURRENT\\n\\n\"\n",
+ "\telif obj.acct_type=='O':\n",
+ "\t\tprint \"OVERDUE\\n\\n\"\n",
+ "\telse:\n",
+ "\t\tprint \"DELINQUENT\\n\\n\"\n",
+ "\t\t\n",
+ "\treturn\n",
+ "\n",
+ "\n",
+ "class date(Structure):\n",
+ "\t_fields_=[('month',c_int),('day',c_int),('year',c_int)]\n",
+ "\t\n",
+ "\n",
+ "class account(Structure):\n",
+ "\t_fields_=[('name',string),('street',string),('city',string),('acct_no',c_int),('oldbalance',c_float),('payment',c_float),('lastpayment',date),('newbalance',c_float),('acct_type',c_char)]\n",
+ "\t\t\n",
+ "print \"CUSOMER BILLING SYSTEM\\n\\n\"\n",
+ "customer=[]\n",
+ "name='Steve Johnson'\n",
+ "street='123 Mountainview Drive '\n",
+ "city='Denver . CO'\n",
+ "acct_no=4208\n",
+ "oldbalance=247.88\n",
+ "payment=25.00\n",
+ "lastpay=date(6,14,1998)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "name='Susan Richards'\n",
+ "street='4383 Aligator Blvd'\n",
+ "city='Fort Lauderdale. FL'\n",
+ "acct_no=2219\n",
+ "oldbalance=135.00\n",
+ "payment=135.00\n",
+ "lastpay=date(8,10,2000)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "name='Martin Peterson'\n",
+ "street='1787 Pacific Parkway'\n",
+ "city='San Diego. CA'\n",
+ "acct_no=8452\n",
+ "oldbalance=387.42\n",
+ "payment=35.00\n",
+ "lastpay=date(9,22,1999)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "name='Phyllis Smith'\n",
+ "street='1000 Great White Way'\n",
+ "city='New York. NY'\n",
+ "acct_no=711\n",
+ "oldbalance=260.00\n",
+ "payment=0.00\n",
+ "lastpay=date(11,27,2001)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "\n",
+ "\n",
+ "for i in range(0,4):\n",
+ "\tif customer[i].payment>0:\n",
+ "\t\tif customer[i].payment<0.1*customer[i].oldbalance:\n",
+ "\t\t\tcustomer[i].acct_type='O'\n",
+ "\t\telse:\n",
+ "\t\t\tcustomer[i].acct_type='C'\n",
+ "\telse:\n",
+ "\t\tif customer[i].oldbalance>0:\n",
+ "\t\t\tcustomer[i].acct_type='D'\n",
+ "\t\telse:\n",
+ "\t\t\tcustomer[i].acct_type='C'\n",
+ "\t\n",
+ "\tcustomer[i].newbalance=customer[i].oldbalance-customer[i].payment\n",
+ "\t\n",
+ "\twriteoutput(customer[i])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CUSOMER BILLING SYSTEM\n",
+ "\n",
+ "\n",
+ "Name : Steve Johnson \t Account Number : 4208\n",
+ "Street : 123 Mountainview Drive \n",
+ "City : Denver . CO\n",
+ "Old Balance : 247.88\n",
+ "Payment : 25.00\n",
+ "New Balance : 222.88\n",
+ "Account Status : CURRENT\n",
+ "\n",
+ "\n",
+ "Name : Susan Richards \t Account Number : 2219\n",
+ "Street : 4383 Aligator Blvd\n",
+ "City : Fort Lauderdale. FL\n",
+ "Old Balance : 135.00\n",
+ "Payment : 135.00\n",
+ "New Balance : 0.00\n",
+ "Account Status : CURRENT\n",
+ "\n",
+ "\n",
+ "Name : Martin Peterson \t Account Number : 8452\n",
+ "Street : 1787 Pacific Parkway\n",
+ "City : San Diego. CA\n",
+ "Old Balance : 387.42\n",
+ "Payment : 35.00\n",
+ "New Balance : 352.42\n",
+ "Account Status : OVERDUE\n",
+ "\n",
+ "\n",
+ "Name : Phyllis Smith \t Account Number : 711\n",
+ "Street : 1000 Great White Way\n",
+ "City : New York. NY\n",
+ "Old Balance : 260.00\n",
+ "Payment : 0.00\n",
+ "New Balance : 260.00\n",
+ "Account Status : DELINQUENT\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.25, Page 12.29<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*10\n",
+ "\n",
+ "class record(Structure):\n",
+ "\t_fields_=[('name',string),('acct_no',c_int),('acct_type',c_char),('balance',c_float)]\n",
+ "\t\n",
+ "def adjust(obj):\n",
+ "\tobj.name='Jones'\n",
+ "\tobj.acct_no=9999\n",
+ "\tobj.acct_type='R'\n",
+ "\tobj.balance=99.99\n",
+ "\treturn\n",
+ "\n",
+ "\n",
+ "customer=record('Smith',3333,'C',33.33)\n",
+ "print customer.name,customer.acct_no,customer.acct_type,\n",
+ "print \"%.2f\" %customer.balance\n",
+ "\n",
+ "adjust(customer)\n",
+ "\n",
+ "print customer.name,customer.acct_no,customer.acct_type,\n",
+ "print \"%.2f\" %customer.balance\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smith 3333 C 33.33\n",
+ "Jones 9999 R 99.99\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.32, Page 12.42<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# To process a linked List of strings\n",
+ "\n",
+ "class node():\n",
+ "\t\n",
+ "\tdef __init__(self,data):\n",
+ "\t\tself.data=data\n",
+ "\t\tself.next=None\n",
+ "\n",
+ "\t\t\n",
+ "class list():\n",
+ "\t\n",
+ "\tdef __init__(self):\n",
+ "\t\tself.head=None\n",
+ "\t\tself.tail=None\n",
+ "\t\n",
+ "\tdef insert(self,x):\n",
+ "\t\t\n",
+ "\t\te=node(x)\n",
+ "\t\t\n",
+ "\t\tif self.head==None:\n",
+ "\t\t\tself.head=e\n",
+ "\t\t\tself.tail=e\n",
+ "\t\t\t\n",
+ "\t\telse:\n",
+ "\t\t\tself.tail.next=e\n",
+ "\t\t\tself.tail=e\n",
+ "\t\t\t\n",
+ "def display(ptr):\n",
+ "\tnptr=ptr.head\n",
+ "\twhile nptr!=None:\n",
+ "\t\tprint nptr.data\n",
+ "\t\tnptr=nptr.next\n",
+ "\t\n",
+ "\treturn\n",
+ "\t\n",
+ "def delete(ptr,element):\n",
+ "\tnptr=ptr.head\n",
+ "\twhile nptr.next.data!=element:\n",
+ "\t\tnptr=nptr.next\n",
+ "\t\tif nptr.next==None:\n",
+ "\t\t\treturn\n",
+ "\t\n",
+ "\tdptr=nptr.next\n",
+ "\tnptr.next=dptr.next\n",
+ "\tdel dptr\n",
+ "\treturn\n",
+ "\t\n",
+ "p=list()\n",
+ "p.insert('BOSTON')\n",
+ "p.insert('CHICAGO')\n",
+ "p.insert('DENVER')\n",
+ "p.insert('NEW YORK')\n",
+ "p.insert('PITTSBURG')\n",
+ "\n",
+ "display(p)\n",
+ "print '\\n\\nAFTER DELETING DENVER\\n\\n'\n",
+ "delete(p,'DENVER')\n",
+ "display(p)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BOSTON\n",
+ "CHICAGO\n",
+ "DENVER\n",
+ "NEW YORK\n",
+ "PITTSBURG\n",
+ "\n",
+ "\n",
+ "AFTER DELETING DENVER\n",
+ "\n",
+ "\n",
+ "BOSTON\n",
+ "CHICAGO\n",
+ "NEW YORK\n",
+ "PITTSBURG\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.35, Page 12.57<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*20\n",
+ "\n",
+ "class id(Union):\n",
+ "\t_fields_=[('color',c_char),('size',c_int)]\n",
+ "\t\n",
+ "class clothes(Structure):\n",
+ "\t_fields_=[('manufacturer',string),('cost',c_float),('description',id)]\n",
+ "\t\n",
+ "shirt=clothes()\n",
+ "shirt.description.color='w'\n",
+ "print \"%c %d\\n\" %(shirt.description.color,shirt.description.size)\n",
+ "\n",
+ "shirt.description.size=12\n",
+ "print \"%c %d\" %(shirt.description.color,shirt.description.size)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w 119\n",
+ "\n",
+ "\f",
+ " 12\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 12.37, Page 12.59<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Raising a number to a power\n",
+ "\n",
+ "from ctypes import *\n",
+ "import math\n",
+ "\n",
+ "\n",
+ "class nvals(Union):\n",
+ "\t_fields_=[('fexp',c_float),('nexp',c_int)]\n",
+ "\t\n",
+ "class values(Structure):\n",
+ "\t_fields_=[('x',c_float),('flag',c_char),('exp',nvals)]\n",
+ "\t\n",
+ "def power(a):\n",
+ "\ty=a.x\n",
+ "\t\n",
+ "\tif a.flag=='i':\n",
+ "\t\tif a.exp.nexp==0:\n",
+ "\t\t\ty=1.0\n",
+ "\t\telse:\n",
+ "\t\t\ti=1\n",
+ "\t\t\twhile i<abs(a.exp.nexp):\n",
+ "\t\t\t\ty*=a.x\n",
+ "\t\t\t\ti+=1\n",
+ "\t\t\t\n",
+ "\t\t\tif a.exp.nexp<0:\n",
+ "\t\t\t\ty=1.0/y\n",
+ "\t\n",
+ "\telse:\n",
+ "\t\ty=math.exp(a.exp.fexp*math.log(a.x))\n",
+ "\t\n",
+ "\treturn y\n",
+ "\t\n",
+ "def main(in1,n):\n",
+ "\ta=values()\n",
+ "\ta.x=in1\n",
+ "\t\n",
+ "\ti=int(n)\n",
+ "\t\n",
+ "\tif i==n:\n",
+ "\t\ta.flag='i'\n",
+ "\telse:\n",
+ "\t\ta.flag='f'\n",
+ "\t\n",
+ "\tif a.flag=='i':\n",
+ "\t\ta.exp.nexp=i\n",
+ "\telse:\n",
+ "\t\ta.exp.fexp=n\n",
+ "\t\t\n",
+ "\tif a.flag=='f' and a.x<=0.0:\n",
+ "\t\tprint \"ERROR - Cannot raise a non-positive number to a floating point power\"\n",
+ "\telse:\n",
+ "\t\ty=power(a)\n",
+ "\t\tprint \"y=%.4f\" %y\n",
+ "\t\n",
+ "\treturn\n",
+ "\n",
+ "print \"\\nx=2\\nn=3\"\n",
+ "main(2,3)\n",
+ "print \"\\nx=-2\\nn=3\"\n",
+ "main(-2,3)\n",
+ "print \"\\nx=2.2\\nn=3.3\"\n",
+ "main(2.2,3.3)\n",
+ "print \"\\nx=-2.2\\nn=3.3\"\n",
+ "main(-2.2,3.3)\n",
+ "\n",
+ "\n",
+ "\t\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "x=2\n",
+ "n=3\n",
+ "y=8.0000\n",
+ "\n",
+ "x=-2\n",
+ "n=3\n",
+ "y=-8.0000\n",
+ "\n",
+ "x=2.2\n",
+ "n=3.3\n",
+ "y=13.4895\n",
+ "\n",
+ "x=-2.2\n",
+ "n=3.3\n",
+ "ERROR - Cannot raise a non-positive number to a floating point power\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter13.ipynb b/_Programming_With_C/chapter13.ipynb
new file mode 100644
index 00000000..fca3666f
--- /dev/null
+++ b/_Programming_With_C/chapter13.ipynb
@@ -0,0 +1,183 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 13: File Handling<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.3, Page 12.4<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Writing to a data file\n",
+ "\n",
+ "fp=open(\"output.txt\",'w')\n",
+ "for k in range(65,91):\n",
+ "\tfp.write(str(k)+'\\n')\n",
+ "fp.close()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.7, Page 13.8<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Creating a file containing customer records\n",
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*40\n",
+ "\n",
+ "class date(Structure):\n",
+ "\t_fields_=[('month',c_int),('day',c_int),('year',c_int)]\n",
+ "\t\n",
+ "class account(Structure):\n",
+ "\t_fields_=[('name',string),('street',string),('city',string),('acct_no',c_int),('oldbalance',c_float),('payment',c_float),('lastpayment',date),('acct_type',c_char),('newbalance',c_float)]\n",
+ "\n",
+ "\n",
+ "def writefile(obj,fpt):\n",
+ "\tfpt.write(obj.name+'\\n')\n",
+ "\tfpt.write(obj.city+'\\n')\n",
+ "\tfpt.write(str(obj.acct_no)+'\\n')\n",
+ "\tfpt.write(obj.acct_type+'\\n')\n",
+ "\tfpt.write(str(obj.oldbalance)+'\\n')\n",
+ "\tfpt.write(str(obj.newbalance)+'\\n')\n",
+ "\tfpt.write(str(obj.payment)+'\\n')\n",
+ "\tfpt.write(str(obj.lastpayment.month)+' ')\n",
+ "\tfpt.write(str(obj.lastpayment.day)+' ')\n",
+ "\tfpt.write(str(obj.lastpayment.year)+'\\n\\n')\n",
+ "\t\n",
+ "\treturn\t\n",
+ "\t\n",
+ "fpt=open('records.txt','w')\n",
+ "\n",
+ "\n",
+ "customer=[]\n",
+ "\n",
+ "name='Steve Johnson'\n",
+ "street='123 Mountainview Drive '\n",
+ "city='Denver . CO'\n",
+ "acct_no=4208\n",
+ "oldbalance=247.88\n",
+ "payment=25.00\n",
+ "lastpay=date(6,14,1998)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "name='Susan Richards'\n",
+ "street='4383 Aligator Blvd'\n",
+ "city='Fort Lauderdale. FL'\n",
+ "acct_no=2219\n",
+ "oldbalance=135.00\n",
+ "payment=135.00\n",
+ "lastpay=date(8,10,2000)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "name='Martin Peterson'\n",
+ "street='1787 Pacific Parkway'\n",
+ "city='San Diego. CA'\n",
+ "acct_no=8452\n",
+ "oldbalance=387.42\n",
+ "payment=35.00\n",
+ "lastpay=date(9,22,1999)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "name='Phyllis Smith'\n",
+ "street='1000 Great White Way'\n",
+ "city='New York. NY'\n",
+ "acct_no=711\n",
+ "oldbalance=260.00\n",
+ "payment=0.00\n",
+ "lastpay=date(11,27,2001)\n",
+ "customer.append(account(name,street,city,acct_no,oldbalance,payment,lastpay))\n",
+ "\n",
+ "\n",
+ "\n",
+ "for i in range(0,4):\n",
+ "\tif customer[i].payment>0:\n",
+ "\t\tif customer[i].payment<0.1*customer[i].oldbalance:\n",
+ "\t\t\tcustomer[i].acct_type='O'\n",
+ "\t\telse:\n",
+ "\t\t\tcustomer[i].acct_type='C'\n",
+ "\telse:\n",
+ "\t\tif customer[i].oldbalance>0:\n",
+ "\t\t\tcustomer[i].acct_type='D'\n",
+ "\t\telse:\n",
+ "\t\t\tcustomer[i].acct_type='C'\n",
+ "\t\n",
+ "\tcustomer[i].newbalance=customer[i].oldbalance-customer[i].payment\n",
+ "\t\n",
+ "\twritefile(customer[i],fpt)\n",
+ "\n",
+ "fpt.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 13.13, Page 13.28<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# concept of binary files\n",
+ "\n",
+ "fp=open('binval.txt','wb')\n",
+ "\n",
+ "for i in range(1000,11001):\n",
+ "\tfp.write(str(i))\n",
+ "\n",
+ "fp.close()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter14.ipynb b/_Programming_With_C/chapter14.ipynb
new file mode 100644
index 00000000..325040e9
--- /dev/null
+++ b/_Programming_With_C/chapter14.ipynb
@@ -0,0 +1,235 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 14: Low-Level Programming<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.14, Page number: 14.12<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use of right shift operator\n",
+ "\n",
+ "a=0xf05a\n",
+ "\n",
+ "print \"%u\" %(a)\n",
+ "print \"%x\" %(a>>6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "61530\n",
+ "3c1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.16, Page number: 14.13<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# displaying bit patterns\n",
+ "\n",
+ "\n",
+ "a=1\n",
+ "nbits=16\n",
+ "m=0x1<<(nbits-1)\n",
+ "\n",
+ "def main(a):\n",
+ " mask=abs(m)\n",
+ " for count in range(1,nbits+1):\n",
+ " if a&mask:\n",
+ " b=1\n",
+ " else:\n",
+ " b=0\n",
+ "\n",
+ " print \"%x\" %(b),\n",
+ " if count%4==0:\n",
+ " print \"\\t\",\n",
+ "\n",
+ " mask>>=1\n",
+ " return\n",
+ "print \"\\n1-->\\n\"\n",
+ "main(1)\n",
+ "print \"\\n-1-->\\n\"\n",
+ "main(-1)\n",
+ "print \"\\n0-->\\n\"\n",
+ "main(0)\n",
+ "print \"\\n2-->\\n\"\n",
+ "main(2)\n",
+ "print \"\\n-2-->\\n\"\n",
+ "main(-2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1-->\n",
+ "\n",
+ "0 0 0 0 \t0 0 0 0 \t0 0 0 0 \t0 0 0 1 \t\n",
+ "-1-->\n",
+ "\n",
+ "1 1 1 1 \t1 1 1 1 \t1 1 1 1 \t1 1 1 1 \t\n",
+ "0-->\n",
+ "\n",
+ "0 0 0 0 \t0 0 0 0 \t0 0 0 0 \t0 0 0 0 \t\n",
+ "2-->\n",
+ "\n",
+ "0 0 0 0 \t0 0 0 0 \t0 0 0 0 \t0 0 1 0 \t\n",
+ "-2-->\n",
+ "\n",
+ "1 1 1 1 \t1 1 1 1 \t1 1 1 1 \t1 1 1 0 \t"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 14.23, Page Number: 14.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Storing Names and Birthdays\n",
+ "\n",
+ "from ctypes import *\n",
+ "\n",
+ "string=c_char*50\n",
+ "\n",
+ "\n",
+ "def convert(mm,dd,yy):\n",
+ " yy-=1900\n",
+ " ndays=long(30.42*(mm-1)+dd)\n",
+ " if mm==2:\n",
+ " ndays+=1\n",
+ " if mm>2 and mm<8:\n",
+ " ndays-=1\n",
+ " if yy%4==0 and mm<2:\n",
+ " ndays+=1\n",
+ "\n",
+ " ncycles=yy/4\n",
+ " ndays+=ncycles*1461\n",
+ "\n",
+ " nyears=yy%4\n",
+ " if nyears>0:\n",
+ " ndays+=365*nyears+1\n",
+ " if ndays>59:\n",
+ " ndays-=1\n",
+ "\n",
+ " day=ndays%7\n",
+ " yy+=1900\n",
+ " if yy%4==0 and yy%400!=0:\n",
+ " day+=1\n",
+ " return day\n",
+ "\n",
+ "\n",
+ "class date(Structure):\n",
+ "\t_fields_=[('month',c_int),('day',c_int),('year',c_int)]\n",
+ "\t\n",
+ "\n",
+ "class person(Structure):\n",
+ "\t_fields_=[('name',string),('birthdate',date)]\n",
+ "\t\t\n",
+ "student=[]\n",
+ "\n",
+ "weekday=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']\n",
+ "\n",
+ "month=['January','February','March','April','May','June','July','August',\\\n",
+ " 'September','October','November','December']\n",
+ "\n",
+ "\n",
+ "name='Rob Smith'\n",
+ "birthdate=date(7,20,1972)\n",
+ "student.append(person(name,birthdate))\n",
+ "\n",
+ "name='Judy Thompson'\n",
+ "birthdate=date(11,27,1983)\n",
+ "student.append(person(name,birthdate))\n",
+ "\n",
+ "name='Jim Williams'\n",
+ "birthdate=date(12,29,1998)\n",
+ "student.append(person(name,birthdate))\n",
+ "\n",
+ "name='Mort Davis'\n",
+ "birthdate=date(6,10,2010)\n",
+ "student.append(person(name,birthdate))\n",
+ "\n",
+ "\n",
+ "\t\n",
+ "for count in xrange(0,4):\n",
+ " day_of_week=convert(student[count].birthdate.month,student[count].birthdate.day,student[count].birthdate.year)\n",
+ " print student[count].name,\n",
+ " print \" %s, %s %d %d \\n\" %(weekday[day_of_week],month[student[count].birthdate.month-1],student[count].birthdate.day,student[count].birthdate.year)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rob Smith Thursday, July 20 1972 \n",
+ "\n",
+ "Judy Thompson Sunday, November 27 1983 \n",
+ "\n",
+ "Jim Williams Tuesday, December 29 1998 \n",
+ "\n",
+ "Mort Davis Thursday, June 10 2010 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter2.ipynb b/_Programming_With_C/chapter2.ipynb
new file mode 100644
index 00000000..8b81d936
--- /dev/null
+++ b/_Programming_With_C/chapter2.ipynb
@@ -0,0 +1,119 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 2: Introduction to C Programming<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.1, Page number: 2.2<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "print \"Welcome to python programming\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to python programming\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.5, Page number: 2.5<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# for adding two numbers\n",
+ "\n",
+ "\n",
+ "sum=10+20\n",
+ "print sum\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2.6, Page number: 2.5<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# to find the sum. numbers taken as input\n",
+ "\n",
+ "\n",
+ "num1,num2=50,25\n",
+ "Sum=num1+num2\n",
+ "print \"addition of %d and %d = %d\" %(num1,num2,Sum)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "addition of 50 and 25 = 75\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter3.ipynb b/_Programming_With_C/chapter3.ipynb
new file mode 100644
index 00000000..b9600cd8
--- /dev/null
+++ b/_Programming_With_C/chapter3.ipynb
@@ -0,0 +1,135 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 3: Operators and Expressions<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.13, Page number: 3.9 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#illustrates the size of respective data type (in C)\n",
+ "\n",
+ "import ctypes as ct\n",
+ "\n",
+ "print \"interger : \",ct.sizeof(ct.c_int())\n",
+ "print \"float : \",ct.sizeof(ct.c_float())\n",
+ "print \"double : \",ct.sizeof(ct.c_double())\n",
+ "print \"character : \",ct.sizeof(ct.c_char())\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "interger : 4\n",
+ "float : 4\n",
+ "double : 8\n",
+ "character : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.30, Page number: 3.19<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# to calculate the roots of quadratic equation\n",
+ "\n",
+ "\n",
+ "print \"for the equation ax^2+bx+c \\n\"\n",
+ "\n",
+ "a=2\n",
+ "b=6\n",
+ "c=3\n",
+ "\n",
+ "root=(b*b-4*a*c)**0.5\n",
+ "x1=(-b + root)/(2*a)\n",
+ "x2=(-b - root)/(2*a)\n",
+ "\n",
+ "print \"x1=\",x1\n",
+ "print \"x2=\",x2\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for the equation ax^2+bx+c \n",
+ "\n",
+ "x1= -0.633974596216\n",
+ "x2= -2.36602540378\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3.31, Page number: 3.20<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# to convert a lower case char to upper case\n",
+ "\n",
+ "\n",
+ "\n",
+ "lower=\"l\"\n",
+ "upper=lower.upper()\n",
+ "print upper\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter4.ipynb b/_Programming_With_C/chapter4.ipynb
new file mode 100644
index 00000000..1f1dcee7
--- /dev/null
+++ b/_Programming_With_C/chapter4.ipynb
@@ -0,0 +1,578 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 4: Data Input and Output<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.4, Page number: 4.4 <h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# lowercase to uppercase conversion\n",
+ "\n",
+ "\n",
+ "ch='a'\n",
+ "print 'equivalent uppercase character is ',ch.upper()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "equivalent uppercase character is A\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.16, Page number: 4.14<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# shows the use of print function\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "i,j=2.0,3.0\n",
+ "print \"%f %f %f %f\" %(i,i,i+j,math.sqrt(i+j))\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.000000 2.000000 5.000000 2.236068\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.18, Page number: 4.15<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# generates the same floating point output in 2 different ways\n",
+ "\n",
+ "x,y=5000.0,0.0025\n",
+ "\n",
+ "print \"%f %f %f %f\\n\\n\" %(x,y,x*y,x/y)\n",
+ "print \"%e %e %e %e\" %(x,y,x*y,x/y)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5000.000000 0.002500 12.500000 2000000.000000\n",
+ "\n",
+ "\n",
+ "5.000000e+03 2.500000e-03 1.250000e+01 2.000000e+06\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.19, Page number: 4.16<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# reading and writing a line of text\n",
+ "\n",
+ "line=\"The PITTSBURG STEELERS is one of America's favorite football teams!\"\n",
+ "print \"%s\" %(line)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The PITTSBURG STEELERS is one of America's favorite football teams!\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.20, Page number: 4.17<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use of the minimum field width feature\n",
+ "\n",
+ "i=12345\n",
+ "x=345.678\n",
+ "\n",
+ "print \"%3d %5d %8d\\n\\n\" %(i,i,i)\n",
+ "print \"%3f %10f %13f\" %(x,x,x)\n",
+ "print \"%3e %13e %16e\" %(x,x,x)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12345 12345 12345\n",
+ "\n",
+ "\n",
+ "345.678000 345.678000 345.678000\n",
+ "3.456780e+02 3.456780e+02 3.456780e+02\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.21, Page number: 4.17<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# makes use of g-type conversion\n",
+ "\n",
+ "i=12345\n",
+ "x=345.678\n",
+ "\n",
+ "print \"%3d %5d %8d\\n\\n\" %(i,i,i)\n",
+ "print \"%3g %10g %13g\" %(x,x,x)\n",
+ "print \"%3g %13g %16g\" %(x,x,x)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "12345 12345 12345\n",
+ "\n",
+ "\n",
+ "345.678 345.678 345.678\n",
+ "345.678 345.678 345.678\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.22, Page number: 4.18<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use of precision feature with floating points\n",
+ "\n",
+ "x=123.456\n",
+ "\n",
+ "print \"%7f %7.3f %7.1f\" %(x,x,x)\n",
+ "print \"%12e %12.5e %12.3e\" %(x,x,x)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "123.456000 123.456 123.5\n",
+ "1.234560e+02 1.23456e+02 1.235e+02\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.23, Page number: 4.19<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# displays floating points numbers with only precision specification\n",
+ "\n",
+ "\n",
+ "x=123.456\n",
+ "\n",
+ "print \"%f %.3f %.1f\" %(x,x,x)\n",
+ "print \"%e %.5e %.3e\" %(x,x,x)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "123.456000 123.456 123.5\n",
+ "1.234560e+02 1.23456e+02 1.235e+02\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.24, Page number: 4.20<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use of field width and precision specifications with string\n",
+ "\n",
+ "line=\"hexadecimal\"\n",
+ "\n",
+ "print \"%10s %15s %15.5s %.5s\" %(line,line,line,line)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hexadecimal hexadecimal hexad hexad\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.26, Page number 4.21<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use of upper case conversion characters\n",
+ "\n",
+ "a=0x80ec\n",
+ "b=0.3e-12\n",
+ "\n",
+ "print \"%4x %10.2e\\n\\n\" %(a,b)\n",
+ "print \"%4X %10.2E\" %(a,b)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "80ec 3.00e-13\n",
+ "\n",
+ "\n",
+ "80EC 3.00E-13\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.27, Page number: 4.22<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use of flags with integers and floating point quantities\n",
+ "\n",
+ "i,x,y=123,12.0,-3.3\n",
+ "\n",
+ "print \":%6d %7.0f %10.1e: \\n\" %(i,x,y)\n",
+ "print \":%-6d %-7.0f %-10.1e: \\n\" %(i,x,y)\n",
+ "print \":%+6d %+7.0f %+10.1e: \\n\" %(i,x,y)\n",
+ "print \":%-+6d %-+7.0f %-+10.1e: \\n\" %(i,x,y)\n",
+ "print \":%7.0f %#7.0f %7g %#7g: \\n\" %(x,x,y,y)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ ": 123 12 -3.3e+00: \n",
+ "\n",
+ ":123 12 -3.3e+00 : \n",
+ "\n",
+ ": +123 +12 -3.3e+00: \n",
+ "\n",
+ ":+123 +12 -3.3e+00 : \n",
+ "\n",
+ ": 12 12. -3.3 -3.30000: \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.28, Page number: 4.23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# use of flags with unsigned decimal octal and hexadecimal numbers\n",
+ "\n",
+ "i,j,k=1234,01777,0xa08c\n",
+ "\n",
+ "print \":%8u %8o %8x:\\n\" %(i,j,k)\n",
+ "print \":%-8u %-8o %-8x:\\n\" %(i,j,k)\n",
+ "print \":%#8u %#8o %#8x:\\n\" %(i,j,k)\n",
+ "print \":%08u %08o %08x:\\n\" %(i,j,k)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ ": 1234 1777 a08c:\n",
+ "\n",
+ ":1234 1777 a08c :\n",
+ "\n",
+ ": 1234 01777 0xa08c:\n",
+ "\n",
+ ":00001234 00001777 0000a08c:\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.29, Page number: 4.24<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates the use flags with strings\n",
+ "\n",
+ "line=\"lower-case\"\n",
+ "\n",
+ "print \":%15s %15.5s %.5s:\" %(line,line,line)\n",
+ "print \":%-15s %-15.5s %-.5s:\" %(line,line,line)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ ": lower-case lower lower:\n",
+ ":lower-case lower lower:\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.30, Page number: 4.24<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# illustrates how printed ouput can be labeled\n",
+ "\n",
+ "a,b,x1,x2=2.2,-6.2,0.005,-12.88\n",
+ "\n",
+ "print \"$%4.2f %7.1f%%\\n\" %(a,b)\n",
+ "print \"x1=%7.3f x2=%7.3f\" %(x1,x2)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "$2.20 -6.2%\n",
+ "\n",
+ "x1= 0.005 x2=-12.880\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4.32, Page number: 4.26<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# averaging student exam scores\n",
+ "\n",
+ "\n",
+ "name=\"Robert Smith\"\n",
+ "score1=88\n",
+ "score2=62.5\n",
+ "score3=90\n",
+ "\n",
+ "average=(float)(score1+score2+score3)/3\n",
+ "print \"Name: %-s\" %(name)\n",
+ "print \"Score1: %-5.1f\" %(score1)\n",
+ "print \"Score2: %-5.1f\" %(score2)\n",
+ "print \"Score3: %-5.1f\" %(score3)\n",
+ "print \"Average: %-5.1f\" %(average)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Name: Robert Smith\n",
+ "Score1: 88.0 \n",
+ "Score2: 62.5 \n",
+ "Score3: 90.0 \n",
+ "Average: 80.2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter5.ipynb b/_Programming_With_C/chapter5.ipynb
new file mode 100644
index 00000000..b76ef801
--- /dev/null
+++ b/_Programming_With_C/chapter5.ipynb
@@ -0,0 +1,98 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Preparing And Running A Complete C Program<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.2, Page number: 5.4<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compound Interest\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "p,r,n=10000,10,3\n",
+ "i=r/100.0\n",
+ "\n",
+ "f=p*math.pow(1+i,n)\n",
+ "print \"The final value (F) is: %.2f\" %f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final value (F) is: 13310.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5.4, Page number: 5.7<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Real Rppts of a Quadratic Equation\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "a,b,c=2.0,5.0,3.0\n",
+ "d=math.sqrt(b*b-(4*a*c))\n",
+ "x1=(-b+d)/(2*a)\n",
+ "x2=(-b-d)/(2*a)\n",
+ "\n",
+ "print \"x1 = %e x2 = %e\" %(x1,x2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x1 = -1.000000e+00 x2 = -1.500000e+00\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter6.ipynb b/_Programming_With_C/chapter6.ipynb
new file mode 100644
index 00000000..9e6277c3
--- /dev/null
+++ b/_Programming_With_C/chapter6.ipynb
@@ -0,0 +1,1320 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 6: Control Statements<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.4, Page number: 6.3<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "inputs=[5,25,4,8]\n",
+ "Sum,SumSq,SumSqrt=0,0,0\n",
+ "\n",
+ "for x in inputs:\n",
+ "\n",
+ " Sum+=x\n",
+ " SumSq+=x*x\n",
+ " SumSqrt+=math.sqrt(x)\n",
+ "\n",
+ "\n",
+ "print \" Sum = %d \\n SumSq = %d \\n SumSqrt = %f\" %(Sum,SumSq,SumSqrt)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Sum = 42 \n",
+ " SumSq = 730 \n",
+ " SumSqrt = 12.064495\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.5, Page number: 6.4<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# understanding basic if statement\n",
+ "\n",
+ "\n",
+ "def main(first,second):\n",
+ " \n",
+ " if first>second:\n",
+ " print \"first number is bigger\"\n",
+ " if second>first:\n",
+ " print \"second number is bigger\"\n",
+ " if first==second:\n",
+ " print \"both are equal\"\n",
+ " return\n",
+ "\n",
+ "main(5,6)\n",
+ "main(6,5)\n",
+ "main(1,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "second number is bigger\n",
+ "first number is bigger\n",
+ "both are equal\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.7, Page naumber: 6.8<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# to understand the use of if else\n",
+ "\n",
+ "def main(time):\n",
+ "\n",
+ " if time>=0. and time<12.:\n",
+ " print \"Good Morning\"\n",
+ " elif time>=12. and time<18.:\n",
+ " print \"Good Afternoon\"\n",
+ " elif time>=18. and time<=24.:\n",
+ " print \"Good Evening\"\n",
+ " else:\n",
+ " print \"time is out of range\"\n",
+ " return\n",
+ "\n",
+ "main(9)\n",
+ "main(15)\n",
+ "main(21)\n",
+ "main(36)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Good Morning\n",
+ "Good Afternoon\n",
+ "Good Evening\n",
+ "time is out of range\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.8, Page number: 6.8<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# consecutive integer quantities using WHILE loop\n",
+ "\n",
+ "\n",
+ "digit=0\n",
+ "while digit<=9:\n",
+ " print digit\n",
+ " digit=digit+1\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.9, Page number: 6.9<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# lowercase to uppercase text conversion using WHILE loop\n",
+ "\n",
+ "\n",
+ "\n",
+ "letter=\"Fourscore and seven years ago aou fathers brought forth...\"\n",
+ "letter=list(letter)\n",
+ "count=0\n",
+ "tag=len(letter)\n",
+ "\n",
+ "while count<tag:\n",
+ " letter[count]=letter[count].upper()\n",
+ " count=count+1\n",
+ "letter=''.join(letter)\n",
+ "print letter\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "FOURSCORE AND SEVEN YEARS AGO AOU FATHERS BROUGHT FORTH...\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.10, Page number: 6.11<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# averaging a list of numbers using while loop equivalent\n",
+ "\n",
+ "Sum,count=0,0\n",
+ "\n",
+ "numbers=[1,2,3,4,5,6]\n",
+ "n=6.0\n",
+ "\n",
+ "while count<n:\n",
+ " x=numbers[count]\n",
+ " print \"x = \",x\n",
+ " Sum+=x\n",
+ " count+=1\n",
+ "\n",
+ "average=Sum/n\n",
+ "\n",
+ "print 'Average = ',average\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 1\n",
+ "x = 2\n",
+ "x = 3\n",
+ "x = 4\n",
+ "x = 5\n",
+ "x = 6\n",
+ "Average = 3.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 1\n",
+ "x = 2\n",
+ "x = 3\n",
+ "x = 4\n",
+ "x = 5\n",
+ "x = 6\n",
+ "Average = 3.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.11, Page number: 6.12<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# consecutive integer quantities using an equivalent to DO-WHILE loop\n",
+ "\n",
+ "\n",
+ "digit=0\n",
+ "while True:\n",
+ " print digit\n",
+ " digit=digit+1\n",
+ " if digit>9:\n",
+ " break\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.12, Page number: 6.13<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# lowercase to uppercase text conversion using equivalent to DO-WHILE loop\n",
+ "\n",
+ "\n",
+ "letter=\"Fourscore and seven years ago aou fathers brought forth...\"\n",
+ "letter=list(letter)\n",
+ "\n",
+ "count=0\n",
+ "tag=len(letter)\n",
+ "\n",
+ "while True:\n",
+ " letter[count]=letter[count].upper()\n",
+ " count=count+1\n",
+ " if count>=tag:\n",
+ " break\n",
+ "\n",
+ "letter=''.join(letter)\n",
+ "print letter\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "FOURSCORE AND SEVEN YEARS AGO AOU FATHERS BROUGHT FORTH...\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.13, Page number: 6.14<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# averaging a list of numbers using do whileloop equivalent\n",
+ "\n",
+ "Sum,count=0,0\n",
+ "\n",
+ "numbers=[1,2,3,4,5,6]\n",
+ "n=6.0\n",
+ "\n",
+ "while True:\n",
+ " x=numbers[count]\n",
+ " print \"x = \",x\n",
+ " Sum+=x\n",
+ " count+=1\n",
+ " if count>=n:\n",
+ " break\n",
+ "\n",
+ "average=Sum/n\n",
+ "\n",
+ "print 'Average = ',average\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 1\n",
+ "x = 2\n",
+ "x = 3\n",
+ "x = 4\n",
+ "x = 5\n",
+ "x = 6\n",
+ "Average = 3.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.14, Page number: 6.16<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# consecutive integer quantities using FOR loop\n",
+ "\n",
+ "for digit in range(0,10):\n",
+ " print digit\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n",
+ "1\n",
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.16, Page number: 6.17<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# lowercase to uppercase text conversion using FOR loop\n",
+ "\n",
+ "\n",
+ "letter=\"Fourscore and seven years ago aou fathers brought forth...\"\n",
+ "letter=list(letter)\n",
+ "n=len(letter)\n",
+ "\n",
+ "for count in range(0,n):\n",
+ " \n",
+ " letter[count]=letter[count].upper()\n",
+ "\n",
+ "letter=''.join(letter)\n",
+ "print letter\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "FOURSCORE AND SEVEN YEARS AGO AOU FATHERS BROUGHT FORTH...\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.17, Page number: 6.17<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Averaging a List of Numbers using an FOR loop\n",
+ "\n",
+ "\n",
+ "n=6\n",
+ "Sum=0.0\n",
+ "\n",
+ "for count in range(1,n+1):\n",
+ " Sum=Sum+count\n",
+ " \n",
+ "average=Sum/n\n",
+ "print \"the average is \",average\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the average is 3.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.18, Page number: 6.19<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Repeated averaging of a list of numbers\n",
+ "\n",
+ "\n",
+ "\n",
+ "numbers=[[1.5,2.5,6.2,3.0],[4,-2,7],[5.4,8.0,2.2,1.7,-3.9]]\n",
+ "loopcount=3\n",
+ "loop=0\n",
+ "\n",
+ "while loop<loopcount:\n",
+ "\n",
+ " Sum=0\n",
+ "\n",
+ " for x in numbers[loop]:\n",
+ "\n",
+ " print 'x = ',x\n",
+ " Sum+=x\n",
+ "\n",
+ " print 'The average is ',Sum/len(numbers[loop])\n",
+ " loop+=1\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x = 1.5\n",
+ "x = 2.5\n",
+ "x = 6.2\n",
+ "x = 3.0\n",
+ "The average is 3.3\n",
+ "x = 4\n",
+ "x = -2\n",
+ "x = 7\n",
+ "The average is 3\n",
+ "x = 5.4\n",
+ "x = 8.0\n",
+ "x = 2.2\n",
+ "x = 1.7\n",
+ "x = -3.9\n",
+ "The average is 2.68\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.19, Page number: 6.20<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# coverting several lines of text to upper case\n",
+ "\n",
+ "text=['Now is the time for all good men to come to aid..','Fourscore and seven years ago our fathers brought forth...','*']\n",
+ "\n",
+ "\n",
+ "loop=0\n",
+ "\n",
+ "while True:\n",
+ " letter=text[loop]\n",
+ " if letter=='*':\n",
+ " print \"\\nGood bye\"\n",
+ " break\n",
+ "\n",
+ " print '\\n',letter\n",
+ " letter=list(letter)\n",
+ " n=len(letter)\n",
+ "\n",
+ " for count in range(0,n):\n",
+ " letter[count]=letter[count].upper()\n",
+ "\n",
+ " letter=''.join(letter)\n",
+ " print letter\n",
+ " loop+=1\n",
+ " \n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Now is the time for all good men to come to aid..\n",
+ "NOW IS THE TIME FOR ALL GOOD MEN TO COME TO AID..\n",
+ "\n",
+ "Fourscore and seven years ago our fathers brought forth...\n",
+ "FOURSCORE AND SEVEN YEARS AGO OUR FATHERS BROUGHT FORTH...\n",
+ "\n",
+ "Good bye\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.20, Page number: 6.22<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Encoding a string of characters\n",
+ "\n",
+ "line=\"The White House. 1600 Pennsylvania Avenue. Washington. DC\"\n",
+ "line=list(line)\n",
+ "line2=[]\n",
+ "for count in line:\n",
+ " if (count>='0' and count<'9') or \\\n",
+ " (count>='a' and count<'z') or \\\n",
+ " (count>='A' and count<'Z'):\n",
+ "\n",
+ " line2.extend(chr(ord(count)+1))\n",
+ "\n",
+ " elif count=='9':\n",
+ " line2.extend('0')\n",
+ " elif count=='z':\n",
+ " line2.extend('a')\n",
+ " elif count=='Z':\n",
+ " line2.extend('A')\n",
+ " else:\n",
+ " line2.extend('.')\n",
+ "\n",
+ "line2=''.join(line2)\n",
+ "print line2\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Uif.Xijuf.Ipvtf..2711.Qfootzmwbojb.Bwfovf..Xbtijohupo..ED\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.21, Page number: 6.23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Repeated Compund Interest Calculations with Error Tapping\n",
+ "\n",
+ "\n",
+ "def main(p,r,n):\n",
+ " \n",
+ "\n",
+ " if p<0 or r<0 or n<0:\n",
+ " print \"ERROR! Wrong input\"\n",
+ " return\n",
+ " \n",
+ "\n",
+ " i=r/100.0\n",
+ " f=p*((i+1)**n)\n",
+ "\n",
+ " print \"The Final value (F) is %.2f\" %f\n",
+ "\n",
+ " return\n",
+ "main(1000,6,20)\n",
+ "main(5000,-7.5,12)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Final value (F) is 3207.14\n",
+ "ERROR! Wrong input\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.22, Page number: 6.25<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Solution of an algebraic equation : x^5+3x^2-10=0\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "def main(guess):\n",
+ " count=0\n",
+ " flag=True\n",
+ "\n",
+ " while flag:\n",
+ " count=count+1\n",
+ " if count==50:\n",
+ " flag=False\n",
+ "\n",
+ " test=10.-3.*guess*guess\n",
+ " if test>0:\n",
+ " root=test**.2\n",
+ " print \"Iteration number : %2d x= %7.5f\" %(count,root)\n",
+ " error=math.fabs(root-guess)\n",
+ " if error>0.00001:\n",
+ " guess=root\n",
+ " else:\n",
+ " flag=False\n",
+ " print \"\\n\\n root= %7.5f number of iterations %2d\" %(root,count)\n",
+ "\n",
+ " else:\n",
+ " flag=False\n",
+ " print \"number out of range... try another initial guess\"\n",
+ "\n",
+ "\n",
+ "\n",
+ " if count==50 and error>0.00001:\n",
+ " print \"convergence not obtained after 50 iterations\"\n",
+ " \n",
+ " return\n",
+ "\n",
+ "print \"initial guess: 1\"\n",
+ "main(1)\n",
+ "print \"\\ninitial guess: 10\"\n",
+ "main(10)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "initial guess: 1\n",
+ "Iteration number : 1 x= 1.47577\n",
+ "Iteration number : 2 x= 1.28225\n",
+ "Iteration number : 3 x= 1.38344\n",
+ "Iteration number : 4 x= 1.33613\n",
+ "Iteration number : 5 x= 1.35951\n",
+ "Iteration number : 6 x= 1.34826\n",
+ "Iteration number : 7 x= 1.35375\n",
+ "Iteration number : 8 x= 1.35109\n",
+ "Iteration number : 9 x= 1.35238\n",
+ "Iteration number : 10 x= 1.35175\n",
+ "Iteration number : 11 x= 1.35206\n",
+ "Iteration number : 12 x= 1.35191\n",
+ "Iteration number : 13 x= 1.35198\n",
+ "Iteration number : 14 x= 1.35195\n",
+ "Iteration number : 15 x= 1.35196\n",
+ "Iteration number : 16 x= 1.35195\n",
+ "\n",
+ "\n",
+ " root= 1.35195 number of iterations 16\n",
+ "\n",
+ "initial guess: 10\n",
+ "number out of range... try another initial guess\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.23, Page number: 6.30<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# to show equivalent of switch case in python\n",
+ "\n",
+ "def main(ch):\n",
+ "\n",
+ " if ch=='r' or ch=='R':\n",
+ " print \"RED\"\n",
+ "\n",
+ " elif ch=='w' or ch=='W':\n",
+ " print \"WHITE\"\n",
+ "\n",
+ " elif ch=='b' or ch=='B':\n",
+ " print \"BLUE\"\n",
+ " \n",
+ " return\n",
+ "\n",
+ "main('r')\n",
+ "main('W')\n",
+ "main('b')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RED\n",
+ "WHITE\n",
+ "BLUE\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.24, Page number: 6.31<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# a small variation to the previous example\n",
+ "\n",
+ "def main(ch):\n",
+ " ch=ch.upper()\n",
+ "\n",
+ " if ch=='R':\n",
+ " print \"RED\"\n",
+ "\n",
+ " elif ch=='W':\n",
+ " print \"WHITE\"\n",
+ "\n",
+ " elif ch=='B':\n",
+ " print \"BLUE\"\n",
+ "\n",
+ " else:\n",
+ " print \"ERROR\"\n",
+ " \n",
+ " return\n",
+ "\n",
+ "main('r')\n",
+ "main('W')\n",
+ "main('b')\n",
+ "main('y')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RED\n",
+ "WHITE\n",
+ "BLUE\n",
+ "ERROR\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.25, Page number: 6.31<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# another example to show th equivalent of switch case in python\n",
+ "\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "def main(x,flag):\n",
+ "\n",
+ " if flag==-1:\n",
+ " y=math.fabs(x)\n",
+ " elif flag==0:\n",
+ " y=x**0.5\n",
+ " elif flag==1:\n",
+ " y=x\n",
+ " elif flag==2 or flag==3:\n",
+ " y=2*(x-1)\n",
+ " else:\n",
+ " y=0\n",
+ " print \"y= \",y\n",
+ " \n",
+ " return\n",
+ "\n",
+ "main(36,-1)\n",
+ "main(36,0)\n",
+ "main(36,1)\n",
+ "main(36,2)\n",
+ "main(36,3)\n",
+ "main(36,5)\n",
+ "main(0,6)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y= 36.0\n",
+ "y= 6.0\n",
+ "y= 36\n",
+ "y= 70\n",
+ "y= 70\n",
+ "y= 0\n",
+ "y= 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.26, Page number: 6.32<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculating Depreciation\n",
+ "\n",
+ "choice=0\n",
+ "\n",
+ "def main(choice,val,n):\n",
+ " \n",
+ " if choice==1:\n",
+ "\n",
+ " print \"Straight Line Method\\n\\n\"\n",
+ " val=float(val)\n",
+ " deprec=val/n\n",
+ " for year in range(1,n+1):\n",
+ " val=val-deprec\n",
+ " print \"End of year %2d Depreciation: %7.2f Current value: %8.2f\"\\\n",
+ " %(year,deprec,val)\n",
+ "\n",
+ "\n",
+ " elif choice==2:\n",
+ " print \"Double Declining Balance Method\\n\\n\"\n",
+ " val=float(val)\n",
+ " for year in range(1,n+1):\n",
+ " deprec=2*val/n\n",
+ " val=val-deprec\n",
+ " print \"End of year %2d Depreciation: %7.2f Current value: %8.2f\"\\\n",
+ " %(year,deprec,val)\n",
+ "\n",
+ " elif choice==3:\n",
+ " print \"Sum of the years' -Digit Method\\n\\n\"\n",
+ " val=float(val)\n",
+ " tag=val\n",
+ "\n",
+ " for year in range(1,n+1):\n",
+ " deprec=(n-year+1)*tag/(n*(n+1)/2)\n",
+ " val=val-deprec\n",
+ " print \"End of year %2d Depreciation: %7.2f Current value: %8.2f\"\\\n",
+ " %(year,deprec,val)\n",
+ "\n",
+ " else:\n",
+ " print \"incorrect data entry...\"\n",
+ "\n",
+ " return\n",
+ "\n",
+ "print \"\\n Method: (1-SSL 2-DDB 3-SYD) \"\n",
+ "print \"choice: 1 \\nval: 8000 \\nNumber of years: 10\"\n",
+ "main(1,8000,10)\n",
+ "print \"\\n Method: (1-SSL 2-DDB 3-SYD) \"\n",
+ "print \"choice: 2 \\nval: 8000 \\nNumber of years: 10\"\n",
+ "main(2,8000,10)\n",
+ "print \"\\n Method: (1-SSL 2-DDB 3-SYD) \"\n",
+ "print \"choice: 3 \\nval: 8000 \\nNumber of years: 10\"\n",
+ "main(3,8000,10)\n",
+ "print \"\\n Method: (1-SSL 2-DDB 3-SYD) \"\n",
+ "print \"choice: 5 \\nval: 8000 \\nNumber of years: 10\"\n",
+ "main(5,8000,10)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Method: (1-SSL 2-DDB 3-SYD) \n",
+ "choice: 1 \n",
+ "val: 8000 \n",
+ "Number of years: 10\n",
+ "Straight Line Method\n",
+ "\n",
+ "\n",
+ "End of year 1 Depreciation: 800.00 Current value: 7200.00\n",
+ "End of year 2 Depreciation: 800.00 Current value: 6400.00\n",
+ "End of year 3 Depreciation: 800.00 Current value: 5600.00\n",
+ "End of year 4 Depreciation: 800.00 Current value: 4800.00\n",
+ "End of year 5 Depreciation: 800.00 Current value: 4000.00\n",
+ "End of year 6 Depreciation: 800.00 Current value: 3200.00\n",
+ "End of year 7 Depreciation: 800.00 Current value: 2400.00\n",
+ "End of year 8 Depreciation: 800.00 Current value: 1600.00\n",
+ "End of year 9 Depreciation: 800.00 Current value: 800.00\n",
+ "End of year 10 Depreciation: 800.00 Current value: 0.00\n",
+ "\n",
+ " Method: (1-SSL 2-DDB 3-SYD) \n",
+ "choice: 2 \n",
+ "val: 8000 \n",
+ "Number of years: 10\n",
+ "Double Declining Balance Method\n",
+ "\n",
+ "\n",
+ "End of year 1 Depreciation: 1600.00 Current value: 6400.00\n",
+ "End of year 2 Depreciation: 1280.00 Current value: 5120.00\n",
+ "End of year 3 Depreciation: 1024.00 Current value: 4096.00\n",
+ "End of year 4 Depreciation: 819.20 Current value: 3276.80\n",
+ "End of year 5 Depreciation: 655.36 Current value: 2621.44\n",
+ "End of year 6 Depreciation: 524.29 Current value: 2097.15\n",
+ "End of year 7 Depreciation: 419.43 Current value: 1677.72\n",
+ "End of year 8 Depreciation: 335.54 Current value: 1342.18\n",
+ "End of year 9 Depreciation: 268.44 Current value: 1073.74\n",
+ "End of year 10 Depreciation: 214.75 Current value: 858.99\n",
+ "\n",
+ " Method: (1-SSL 2-DDB 3-SYD) \n",
+ "choice: 3 \n",
+ "val: 8000 \n",
+ "Number of years: 10\n",
+ "Sum of the years' -Digit Method\n",
+ "\n",
+ "\n",
+ "End of year 1 Depreciation: 1454.55 Current value: 6545.45\n",
+ "End of year 2 Depreciation: 1309.09 Current value: 5236.36\n",
+ "End of year 3 Depreciation: 1163.64 Current value: 4072.73\n",
+ "End of year 4 Depreciation: 1018.18 Current value: 3054.55\n",
+ "End of year 5 Depreciation: 872.73 Current value: 2181.82\n",
+ "End of year 6 Depreciation: 727.27 Current value: 1454.55\n",
+ "End of year 7 Depreciation: 581.82 Current value: 872.73\n",
+ "End of year 8 Depreciation: 436.36 Current value: 436.36\n",
+ "End of year 9 Depreciation: 290.91 Current value: 145.45\n",
+ "End of year 10 Depreciation: 145.45 Current value: 0.00\n",
+ "\n",
+ " Method: (1-SSL 2-DDB 3-SYD) \n",
+ "choice: 5 \n",
+ "val: 8000 \n",
+ "Number of years: 10\n",
+ "incorrect data entry...\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.31, Page number: 6.41<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Averaging list of Nonnegative Numbers\n",
+ "\n",
+ "navg=0\n",
+ "Sum=0.0\n",
+ "n=6\n",
+ "\n",
+ "for count in range(-6,n+1):\n",
+ " x=count\n",
+ " if(x<0):\n",
+ " continue\n",
+ " Sum=Sum+x\n",
+ " navg=navg+1\n",
+ "\n",
+ "\n",
+ "average=Sum/navg\n",
+ "print \"The average is \",average\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average is 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.32, Page number: 6.42<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Searching for Palindromes\n",
+ "\n",
+ "\n",
+ "\n",
+ "def main(letter):\n",
+ " flag=True\n",
+ "\n",
+ " letter=list(letter)\n",
+ "\n",
+ " tag=len(letter)-1\n",
+ " countback=tag\n",
+ "\n",
+ " for count in range(0,(tag/2)+1):\n",
+ " if letter[count]!=letter[countback]:\n",
+ " flag=False\n",
+ " break\n",
+ " countback=countback-1\n",
+ "\n",
+ " letter=''.join(letter)\n",
+ " if flag:\n",
+ " print \"\\n %s IS a palindrome\" %letter\n",
+ " else:\n",
+ " print \"\\n %s is NOT a palindrome\" %letter\n",
+ " \n",
+ " return\n",
+ "\n",
+ "main('TOOT')\n",
+ "main('FALSE')\n",
+ "main('PULLUP')\n",
+ "main('ABLE WAS I ERE I SAW ELBA')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " TOOT IS a palindrome\n",
+ "\n",
+ " FALSE is NOT a palindrome\n",
+ "\n",
+ " PULLUP IS a palindrome\n",
+ "\n",
+ " ABLE WAS I ERE I SAW ELBA IS a palindrome\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6.34, Page number: 6.47<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# coverting several lines of text to upper case\n",
+ "\n",
+ "text=['Now is the time for all good men to come to aid..','Fourscore and seven years ago our fathers brought forth.$$..','*']\n",
+ "\n",
+ "\n",
+ "loop,flag=0,False\n",
+ "\n",
+ "while True:\n",
+ " letter=text[loop]\n",
+ " if letter=='*' or flag:\n",
+ " print \"\\nGood bye\"\n",
+ " break\n",
+ "\n",
+ " print '\\n',letter\n",
+ " letter=list(letter)\n",
+ " n=len(letter)\n",
+ "\n",
+ " for count in range(0,n):\n",
+ " letter[count]=letter[count].upper()\n",
+ "\n",
+ " letter2=''.join(letter)\n",
+ " print letter2\n",
+ "\n",
+ " for count in range(0,n-1):\n",
+ " if letter[count]=='$' and letter[count+1]=='$':\n",
+ " print 'BREAK CONDITION DETECTED - TERMINATE EXECUTION'\n",
+ " flag=True\n",
+ " break\n",
+ " \n",
+ " loop+=1\n",
+ " \n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Now is the time for all good men to come to aid..\n",
+ "NOW IS THE TIME FOR ALL GOOD MEN TO COME TO AID..\n",
+ "\n",
+ "Fourscore and seven years ago our fathers brought forth.$$..\n",
+ "FOURSCORE AND SEVEN YEARS AGO OUR FATHERS BROUGHT FORTH.$$..\n",
+ "BREAK CONDITION DETECTED - TERMINATE EXECUTION\n",
+ "\n",
+ "Good bye\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter7.ipynb b/_Programming_With_C/chapter7.ipynb
new file mode 100644
index 00000000..e33dc0cb
--- /dev/null
+++ b/_Programming_With_C/chapter7.ipynb
@@ -0,0 +1,721 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 7: Functions<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.1, Page number: 7.2<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# lowercase to uppercase character conversion\n",
+ "\n",
+ "\n",
+ "def lower_to_upper(c1):\n",
+ "\n",
+ " if c1>='a' and c1<='z':\n",
+ " c2=chr(ord('A')+ord(c1)-ord('a'))\n",
+ "\n",
+ " else:\n",
+ " c2=c1\n",
+ "\n",
+ " return c2\n",
+ "\n",
+ "lower='g'\n",
+ "upper=lower_to_upper(lower)\n",
+ "print \"the upper case equivalent is : \",upper\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the upper case equivalent is : G\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.3, Page number: 7.5<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# a variation to the function appeared in example 7.1\n",
+ "\n",
+ "\n",
+ "def lower_to_upper(c1):\n",
+ "\n",
+ " if c1>='a' and c1<='z':\n",
+ " return (chr(ord('A')+ord(c1)-ord('a')))\n",
+ " else:\n",
+ " return c1\n",
+ "\n",
+ "lower='g'\n",
+ "upper=lower_to_upper(lower)\n",
+ "print \"The uppercase equivalent is : \",upper\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The uppercase equivalent is : G\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.4, Page number: 7.5<h3> "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# determine the larger of the two integer quantities\n",
+ "\n",
+ "\n",
+ "def maximum(x,y):\n",
+ " if x>=y:\n",
+ " z=x\n",
+ " else:\n",
+ " z=y\n",
+ "\n",
+ " print \"Maximum value is : \",z\n",
+ "\n",
+ " return\n",
+ "\n",
+ "maximum(5,6)\n",
+ "maximum(6,5)\n",
+ "maximum(5,5)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value is : 6\n",
+ "Maximum value is : 6\n",
+ "Maximum value is : 5\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.5, Page number: 7.5<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculates the factorial of n\n",
+ "\n",
+ "\n",
+ "def factorial(n):\n",
+ " prod=1\n",
+ " if n>1:\n",
+ " for i in range(2,n+1):\n",
+ " prod=prod*i\n",
+ "\n",
+ " return prod\n",
+ "\n",
+ "fact=factorial(6)\n",
+ "print \"Its factorial is : \",fact\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Its factorial is : 720\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.7, Page number: 7.7<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# finds max\n",
+ "\n",
+ "\n",
+ "def maximum(x,y):\n",
+ "\n",
+ " if x>=y:\n",
+ " z=x\n",
+ " else:\n",
+ " z=y\n",
+ "\n",
+ " print 'Maximum value is = ',z\n",
+ " return\n",
+ "\n",
+ "maximum(5,9)\n",
+ "maximum(8,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value is = 9\n",
+ "Maximum value is = 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.9, Page number: 7.8<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Largest of the three quantities\n",
+ "\n",
+ "\n",
+ "def maximum(x,y):\n",
+ " if x>=y:\n",
+ " z=x\n",
+ " else:\n",
+ " z=y\n",
+ "\n",
+ " return z\n",
+ "\n",
+ "a=5\n",
+ "b=4\n",
+ "c=7\n",
+ "\n",
+ "d=maximum(a,b)\n",
+ "print \"Maximum = \",maximum(c,d)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.10, Page number: 7.10<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculates the factorial of n\n",
+ "\n",
+ "\n",
+ "def factorial(n):\n",
+ " prod=1\n",
+ " if n>1:\n",
+ " for i in range(2,n+1):\n",
+ " prod=prod*i\n",
+ "\n",
+ " return prod\n",
+ "\n",
+ "n=7\n",
+ "fact=factorial(n)\n",
+ "print \"Its factorial is : \",fact\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Its factorial is : 5040\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.11, Page number: 7.12<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Simulation of a game of chance (shooting craps)\n",
+ "\n",
+ "\n",
+ "\n",
+ "def play():\n",
+ " print \"Throwing the dice....\"\n",
+ " score1=throw()\n",
+ " print \"%2d\" %(score1)\n",
+ "\n",
+ " if score1==7 or score1==11:\n",
+ " print \"Congratulations!! you WIN on the first throw\"\n",
+ "\n",
+ " elif score1==2 or score1==3 or score1==12:\n",
+ " print \"sorry!! you LOSE on the first throw\"\n",
+ "\n",
+ " else:\n",
+ " while(True):\n",
+ " print \"Throwing the dice again...\"\n",
+ " score2=throw()\n",
+ " print \"%2d\" %(score2)\n",
+ " if score2==score1 or score2==7:\n",
+ " break\n",
+ "\n",
+ " if score2==score1:\n",
+ " print \"You WIN by matching your first score\"\n",
+ " else:\n",
+ " print \"You LOSE by failing to match your first score\"\n",
+ "\n",
+ "\n",
+ " return\n",
+ "\n",
+ "\n",
+ "def throw():\n",
+ "\n",
+ " n1=random.randrange(1,7)\n",
+ " n2=random.randrange(1,7)\n",
+ " return n1+n2\n",
+ "\n",
+ "\n",
+ "import random\n",
+ "\n",
+ "\n",
+ "print \"Welcome to the Game of Craps \\n\\n\"\n",
+ "random.seed(2365)\n",
+ "play()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to the Game of Craps \n",
+ "\n",
+ "\n",
+ "Throwing the dice....\n",
+ " 9\n",
+ "Throwing the dice again...\n",
+ " 4\n",
+ "Throwing the dice again...\n",
+ "11\n",
+ "Throwing the dice again...\n",
+ " 9\n",
+ "You WIN by matching your first score\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.12, Page number: 7.18<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# function that alters the value of the argument\n",
+ "\n",
+ "\n",
+ "def modify(a):\n",
+ " a=a*3\n",
+ " print \"a= %d (from the function, after being modified)\" %(a)\n",
+ " return\n",
+ "\n",
+ "a=2\n",
+ "print \"a=%d (from main, before calling the function)\" %(a)\n",
+ "modify(a)\n",
+ "print \"a=%d (from main, after calling the function)\" %(a)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a=2 (from main, before calling the function)\n",
+ "a= 6 (from the function, after being modified)\n",
+ "a=2 (from main, after calling the function)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.13, Page number: 7.19<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculating depreciation\n",
+ "\n",
+ "\n",
+ "def sl(val,n):\n",
+ " deprec=val/n\n",
+ " print \"in \",n\n",
+ " \n",
+ " for year in range(1,n+1):\n",
+ " val=val-deprec\n",
+ " writeoutput(year,deprec,val)\n",
+ "\n",
+ " return\n",
+ "\n",
+ "def ddb(val,n):\n",
+ " for year in range(1,n+1):\n",
+ " deprec=2*val/n\n",
+ " val=val-deprec\n",
+ " writeoutput(year,deprec,val)\n",
+ "\n",
+ " return\n",
+ "\n",
+ "def syd(val,n):\n",
+ " tag=val\n",
+ " for year in range(1,n+1):\n",
+ " deprec=(n-year+1)*tag/(n*(n+1)/2)\n",
+ " val=val-deprec\n",
+ " writeoutput(year,deprec,val)\n",
+ "\n",
+ " return\n",
+ "\n",
+ "def writeoutput(year,depreciation,value):\n",
+ " print \"End of the year %2d Depreciation: %7.2f Current Value: %8.2f\" %(year,depreciation,value)\n",
+ "\n",
+ " return\n",
+ "\n",
+ "\n",
+ "\n",
+ "def main(choice,val,n):\n",
+ " \n",
+ " print \"Original value : \",val\n",
+ " val=float(val)\n",
+ " print \"Number of years : \",n\n",
+ "\n",
+ " if choice==1:\n",
+ " print \"Straight-Line Method\\n\\n\"\n",
+ " sl(val,n)\n",
+ " elif choice==2:\n",
+ " print \"Double-Declining-Balance Method \\n\\n\"\n",
+ " ddb(val,n)\n",
+ " elif choice==3:\n",
+ " print \"Sum-Of-The-Years'-Digits Method\"\n",
+ " syd(val,n)\n",
+ "\n",
+ " return\n",
+ "\n",
+ "\n",
+ "print \"\\n\\nMethod: (1-SL 2-DDB 3-SYD)\"\n",
+ "main(1,8000,10)\n",
+ "print \"\\n\\nMethod: (1-SL 2-DDB 3-SYD)\"\n",
+ "main(2,8000,10)\n",
+ "print \"\\n\\nMethod: (1-SL 2-DDB 3-SYD)\"\n",
+ "main(3,8000,10)\n",
+ "print \"\\n\\nMethod: (1-SL 2-DDB 3-SYD)\"\n",
+ "main(1,5000,4)\n",
+ "\n",
+ "\n",
+ " \n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "Method: (1-SL 2-DDB 3-SYD)\n",
+ "Original value : 8000\n",
+ "Number of years : 10\n",
+ "Straight-Line Method\n",
+ "\n",
+ "\n",
+ "in 10\n",
+ "End of the year 1 Depreciation: 800.00 Current Value: 7200.00\n",
+ "End of the year 2 Depreciation: 800.00 Current Value: 6400.00\n",
+ "End of the year 3 Depreciation: 800.00 Current Value: 5600.00\n",
+ "End of the year 4 Depreciation: 800.00 Current Value: 4800.00\n",
+ "End of the year 5 Depreciation: 800.00 Current Value: 4000.00\n",
+ "End of the year 6 Depreciation: 800.00 Current Value: 3200.00\n",
+ "End of the year 7 Depreciation: 800.00 Current Value: 2400.00\n",
+ "End of the year 8 Depreciation: 800.00 Current Value: 1600.00\n",
+ "End of the year 9 Depreciation: 800.00 Current Value: 800.00\n",
+ "End of the year 10 Depreciation: 800.00 Current Value: 0.00\n",
+ "\n",
+ "\n",
+ "Method: (1-SL 2-DDB 3-SYD)\n",
+ "Original value : 8000\n",
+ "Number of years : 10\n",
+ "Double-Declining-Balance Method \n",
+ "\n",
+ "\n",
+ "End of the year 1 Depreciation: 1600.00 Current Value: 6400.00\n",
+ "End of the year 2 Depreciation: 1280.00 Current Value: 5120.00\n",
+ "End of the year 3 Depreciation: 1024.00 Current Value: 4096.00\n",
+ "End of the year 4 Depreciation: 819.20 Current Value: 3276.80\n",
+ "End of the year 5 Depreciation: 655.36 Current Value: 2621.44\n",
+ "End of the year 6 Depreciation: 524.29 Current Value: 2097.15\n",
+ "End of the year 7 Depreciation: 419.43 Current Value: 1677.72\n",
+ "End of the year 8 Depreciation: 335.54 Current Value: 1342.18\n",
+ "End of the year 9 Depreciation: 268.44 Current Value: 1073.74\n",
+ "End of the year 10 Depreciation: 214.75 Current Value: 858.99\n",
+ "\n",
+ "\n",
+ "Method: (1-SL 2-DDB 3-SYD)\n",
+ "Original value : 8000\n",
+ "Number of years : 10\n",
+ "Sum-Of-The-Years'-Digits Method\n",
+ "End of the year 1 Depreciation: 1454.55 Current Value: 6545.45\n",
+ "End of the year 2 Depreciation: 1309.09 Current Value: 5236.36\n",
+ "End of the year 3 Depreciation: 1163.64 Current Value: 4072.73\n",
+ "End of the year 4 Depreciation: 1018.18 Current Value: 3054.55\n",
+ "End of the year 5 Depreciation: 872.73 Current Value: 2181.82\n",
+ "End of the year 6 Depreciation: 727.27 Current Value: 1454.55\n",
+ "End of the year 7 Depreciation: 581.82 Current Value: 872.73\n",
+ "End of the year 8 Depreciation: 436.36 Current Value: 436.36\n",
+ "End of the year 9 Depreciation: 290.91 Current Value: 145.45\n",
+ "End of the year 10 Depreciation: 145.45 Current Value: 0.00\n",
+ "\n",
+ "\n",
+ "Method: (1-SL 2-DDB 3-SYD)\n",
+ "Original value : 5000\n",
+ "Number of years : 4\n",
+ "Straight-Line Method\n",
+ "\n",
+ "\n",
+ "in 4\n",
+ "End of the year 1 Depreciation: 1250.00 Current Value: 3750.00\n",
+ "End of the year 2 Depreciation: 1250.00 Current Value: 2500.00\n",
+ "End of the year 3 Depreciation: 1250.00 Current Value: 1250.00\n",
+ "End of the year 4 Depreciation: 1250.00 Current Value: 0.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.14, Page number: 7.24<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# calculating factorials in recursive way\n",
+ "\n",
+ "\n",
+ "def factorial(n):\n",
+ "\n",
+ " if n<=1:\n",
+ " return 1\n",
+ "\n",
+ " else:\n",
+ " return (n*factorial(n-1))\n",
+ "\n",
+ "\n",
+ "n=10\n",
+ "fact=factorial(n)\n",
+ "print \"Its factorial is \",fact\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Its factorial is 3628800\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.15, Page number: 7.26<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Printing Backwards: (recrsive)\n",
+ "\n",
+ "def reverse(text,n):\n",
+ "\n",
+ " if n<0:\n",
+ " return\n",
+ " else:\n",
+ " print text[n],\n",
+ " reverse(text,n-1)\n",
+ "\n",
+ "\n",
+ "\n",
+ "text='Now is the time for all good men to come to tje aid of their country!'\n",
+ "n=len(text)\n",
+ "reverse(text,n-1)\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "! y r t n u o c r i e h t f o d i a e j t o t e m o c o t n e m d o o g l l a r o f e m i t e h t s i w o N\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7.16, Page number: 7.16<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# the Towers of Hanoi - using recursion\n",
+ "\n",
+ "\n",
+ "def transfer(n,From,to,temp):\n",
+ "\n",
+ " if n>0:\n",
+ " transfer(n-1,From,temp,to)\n",
+ " print \"Move disk %d from %c to %c\" %(n,From,to)\n",
+ " transfer(n-1,temp,to,From)\n",
+ "\n",
+ " return\n",
+ "\n",
+ "print \"Welcome to the TOWERS OF HANOI \\n\\n\"\n",
+ "transfer(3,'L','R','C')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to the TOWERS OF HANOI \n",
+ "\n",
+ "\n",
+ "Move disk 1 from L to R\n",
+ "Move disk 2 from L to C\n",
+ "Move disk 1 from R to C\n",
+ "Move disk 3 from L to R\n",
+ "Move disk 1 from C to L\n",
+ "Move disk 2 from C to R\n",
+ "Move disk 1 from L to R\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter8.ipynb b/_Programming_With_C/chapter8.ipynb
new file mode 100644
index 00000000..398a8b23
--- /dev/null
+++ b/_Programming_With_C/chapter8.ipynb
@@ -0,0 +1,564 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 8: Program Structure <h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.2, Page number: 8.2<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculating factorials\n",
+ "\n",
+ "def factorial(n):\n",
+ "\t\n",
+ "\tprod=1\n",
+ "\tif n>1:\n",
+ "\t\t\n",
+ "\t\tfor i in xrange(2,n+1):\n",
+ "\t\t\tprod*=i\n",
+ "\t\t\n",
+ "\t\n",
+ "\treturn prod\n",
+ "\t\n",
+ "n=7\n",
+ "print 'n!=%d' %factorial(n)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n!=5040\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.3, Page number: 8.3<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Average Length of Several Lines of Text\n",
+ "\n",
+ "def linecount(text):\n",
+ "\t\n",
+ "\treturn len(text)\n",
+ "\n",
+ "Sum=0\n",
+ "lines=['Now is the time for all good men','to come to the aid of their country.']\n",
+ "for i in lines:\n",
+ "\tSum+=linecount(i)\n",
+ "\n",
+ "count=len(lines)\n",
+ "count=float(count)\n",
+ "avg=Sum/count\n",
+ "\n",
+ "print 'Average numbers of characters per line: ',avg\n",
+ "\t\n",
+ "\t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average numbers of characters per line: 34.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.4, Page number: 8.5<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Search for a Maximum\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "a,b,x1,y1,xr,yr,CNST=0,0,0,0,0,0,0.0001\n",
+ "\n",
+ "def reduce():\n",
+ "\n",
+ "\tglobal x1,xr,y1,yr,a,b\n",
+ "\t\n",
+ "\tx1 = a+0.5*(b-a-CNST)\n",
+ "\txr = x1 + CNST\n",
+ "\ty1 = curve(x1)\n",
+ "\tyr = curve(xr)\n",
+ "\t\n",
+ "\tif y1 > yr:\n",
+ "\t\tb = xr\n",
+ "\t\n",
+ "\telif y1 < yr:\n",
+ "\t\ta = x1\n",
+ "\t\t\n",
+ "\treturn\n",
+ "\n",
+ "def curve(x):\n",
+ "\t\n",
+ "\treturn x*math.cos(x)\n",
+ "\t\n",
+ "\t\n",
+ "a = 0\n",
+ "b = 3.141593\n",
+ "\n",
+ "while True:\n",
+ "\treduce()\n",
+ "\tif y1 == yr or b-a <= 3*CNST:\n",
+ "\t\tbreak\n",
+ "\t\t\n",
+ "\n",
+ "xmax = 0.5*(x1+xr)\n",
+ "ymax = curve(xmax)\n",
+ "print 'xmax = %8.6f ymax = %8.6f' %(xmax,ymax)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "xmax = 0.860394 ymax = 0.561096\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.5, Page number: 8.9<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Average Length of Several Lines of Text\n",
+ "\n",
+ "\n",
+ "def linecount(text):\n",
+ "\t\n",
+ "\tglobal Sum\n",
+ "\tSum += len(text)\n",
+ "\n",
+ "Sum=0\n",
+ "lines=['Now is the time for all good men','to come to the aid of their country.']\n",
+ "for i in lines:\n",
+ "\tlinecount(i)\n",
+ "\n",
+ "count=len(lines)\n",
+ "count=float(count)\n",
+ "avg=Sum/count\n",
+ "\n",
+ "print 'Average numbers of characters per line: ',avg\n",
+ "\t\n",
+ "\t\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average numbers of characters per line: 34.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.7, Page number: 8.12<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Generating Fibonacci Numbers\n",
+ "\n",
+ "def fibonacci(count):\n",
+ "\t\n",
+ "\tif count<3:\n",
+ "\t\tf=1\n",
+ "\telse:\n",
+ "\t\tf = fibonacci.f1 + fibonacci.f2\n",
+ "\t\tfibonacci.f2 = fibonacci.f1\n",
+ "\t\tfibonacci.f1 = f\n",
+ "\t\t\n",
+ "\treturn f\n",
+ "\t\t\n",
+ "fibonacci.f1,fibonacci.f2=1,1\n",
+ "n=30\n",
+ "for count in range(1,n+1):\n",
+ "\t\n",
+ "\tprint 'i = %2d F = %d' %(count,fibonacci(count))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i = 1 F = 1\n",
+ "i = 2 F = 1\n",
+ "i = 3 F = 2\n",
+ "i = 4 F = 3\n",
+ "i = 5 F = 5\n",
+ "i = 6 F = 8\n",
+ "i = 7 F = 13\n",
+ "i = 8 F = 21\n",
+ "i = 9 F = 34\n",
+ "i = 10 F = 55\n",
+ "i = 11 F = 89\n",
+ "i = 12 F = 144\n",
+ "i = 13 F = 233\n",
+ "i = 14 F = 377\n",
+ "i = 15 F = 610\n",
+ "i = 16 F = 987\n",
+ "i = 17 F = 1597\n",
+ "i = 18 F = 2584\n",
+ "i = 19 F = 4181\n",
+ "i = 20 F = 6765\n",
+ "i = 21 F = 10946\n",
+ "i = 22 F = 17711\n",
+ "i = 23 F = 28657\n",
+ "i = 24 F = 46368\n",
+ "i = 25 F = 75025\n",
+ "i = 26 F = 121393\n",
+ "i = 27 F = 196418\n",
+ "i = 28 F = 317811\n",
+ "i = 29 F = 514229\n",
+ "i = 30 F = 832040\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.9, Page number: 8.18<h3> "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Simulation of a game of chance (shooting craps)\n",
+ "\n",
+ "\n",
+ "\n",
+ "def play():\n",
+ " print \"Throwing the dice....\"\n",
+ " score1=throw()\n",
+ " print \"%2d\" %(score1)\n",
+ "\n",
+ " if score1==7 or score1==11:\n",
+ " print \"Congratulations!! you WIN on the first throw\"\n",
+ "\n",
+ " elif score1==2 or score1==3 or score1==12:\n",
+ " print \"sorry!! you LOSE on the first throw\"\n",
+ "\n",
+ " else:\n",
+ " while(True):\n",
+ " print \"Throwing the dice again...\"\n",
+ " score2=throw()\n",
+ " print \"%2d\" %(score2)\n",
+ " if score2==score1 or score2==7:\n",
+ " break\n",
+ "\n",
+ " if score2==score1:\n",
+ " print \"You WIN by matching your first score\"\n",
+ " else:\n",
+ " print \"You LOSE by failing to match your first score\"\n",
+ "\n",
+ "\n",
+ " return\n",
+ "\n",
+ "\n",
+ "def throw():\n",
+ "\n",
+ " n1=random.randrange(1,7)\n",
+ " n2=random.randrange(1,7)\n",
+ " return n1+n2\n",
+ "\n",
+ "\n",
+ "import random\n",
+ "\n",
+ "\n",
+ "print \"Welcome to the Game of Craps \\n\\n\"\n",
+ "random.seed(563)\n",
+ "play()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Welcome to the Game of Craps \n",
+ "\n",
+ "\n",
+ "Throwing the dice....\n",
+ "10\n",
+ "Throwing the dice again...\n",
+ " 3\n",
+ "Throwing the dice again...\n",
+ "12\n",
+ "Throwing the dice again...\n",
+ " 9\n",
+ "Throwing the dice again...\n",
+ " 7\n",
+ "You LOSE by failing to match your first score\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.11, Page Number: 8.21<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Search for a Maximum\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "a,b,x1,y1,xr,yr,CNST=0,0,0,0,0,0,0.0001\n",
+ "\n",
+ "def reduce():\n",
+ "\n",
+ "\tglobal x1,xr,y1,yr,a,b\n",
+ "\t\n",
+ "\tx1 = a+0.5*(b-a-CNST)\n",
+ "\txr = x1 + CNST\n",
+ "\ty1 = curve(x1)\n",
+ "\tyr = curve(xr)\n",
+ "\t\n",
+ "\tif y1 > yr:\n",
+ "\t\tb = xr\n",
+ "\t\n",
+ "\telif y1 < yr:\n",
+ "\t\ta = x1\n",
+ "\t\t\n",
+ "\treturn\n",
+ "\n",
+ "def curve(x):\n",
+ "\t\n",
+ "\treturn x*math.cos(x)\n",
+ "\t\n",
+ "\t\n",
+ "a = 0\n",
+ "b = 3.141593\n",
+ "\n",
+ "while True:\n",
+ "\treduce()\n",
+ "\tif y1 == yr or b-a <= 3*CNST:\n",
+ "\t\tbreak\n",
+ "\t\t\n",
+ "\n",
+ "xmax = 0.5*(x1+xr)\n",
+ "ymax = curve(xmax)\n",
+ "print 'xmax = %8.6f ymax = %8.6f' %(xmax,ymax)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "xmax = 0.860394 ymax = 0.561096\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> Example 8.12, Page Number: 8.23<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Generating Fibonacci Numbers\n",
+ "\n",
+ "def fibonacci(count):\n",
+ "\t\n",
+ "\tif count<3:\n",
+ "\t\tf=1\n",
+ "\telse:\n",
+ "\t\tf = fibonacci.f1 + fibonacci.f2\n",
+ "\t\tfibonacci.f2 = fibonacci.f1\n",
+ "\t\tfibonacci.f1 = f\n",
+ "\t\t\n",
+ "\treturn f\n",
+ "\t\t\n",
+ "fibonacci.f1,fibonacci.f2=1,1\n",
+ "n=40\n",
+ "for count in range(1,n+1):\n",
+ "\t\n",
+ "\tprint 'i = %2d F = %d' %(count,fibonacci(count))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i = 1 F = 1\n",
+ "i = 2 F = 1\n",
+ "i = 3 F = 2\n",
+ "i = 4 F = 3\n",
+ "i = 5 F = 5\n",
+ "i = 6 F = 8\n",
+ "i = 7 F = 13\n",
+ "i = 8 F = 21\n",
+ "i = 9 F = 34\n",
+ "i = 10 F = 55\n",
+ "i = 11 F = 89\n",
+ "i = 12 F = 144\n",
+ "i = 13 F = 233\n",
+ "i = 14 F = 377\n",
+ "i = 15 F = 610\n",
+ "i = 16 F = 987\n",
+ "i = 17 F = 1597\n",
+ "i = 18 F = 2584\n",
+ "i = 19 F = 4181\n",
+ "i = 20 F = 6765\n",
+ "i = 21 F = 10946\n",
+ "i = 22 F = 17711\n",
+ "i = 23 F = 28657\n",
+ "i = 24 F = 46368\n",
+ "i = 25 F = 75025\n",
+ "i = 26 F = 121393\n",
+ "i = 27 F = 196418\n",
+ "i = 28 F = 317811\n",
+ "i = 29 F = 514229\n",
+ "i = 30 F = 832040\n",
+ "i = 31 F = 1346269\n",
+ "i = 32 F = 2178309\n",
+ "i = 33 F = 3524578\n",
+ "i = 34 F = 5702887\n",
+ "i = 35 F = 9227465\n",
+ "i = 36 F = 14930352\n",
+ "i = 37 F = 24157817\n",
+ "i = 38 F = 39088169\n",
+ "i = 39 F = 63245986\n",
+ "i = 40 F = 102334155\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8.13, Page Number: 8.25<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Compound Interest\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "p,r,n=10000,10,3\n",
+ "i=r/100.0\n",
+ "\n",
+ "f=p*math.pow(1+i,n)\n",
+ "print \"The final value (F) is: %.2f\" %f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final value (F) is: 13310.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/chapter9.ipynb b/_Programming_With_C/chapter9.ipynb
new file mode 100644
index 00000000..4fbffbe5
--- /dev/null
+++ b/_Programming_With_C/chapter9.ipynb
@@ -0,0 +1,563 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 9: Arrays<h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.2, Page number: 9.2<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Lowercase to uppercase text conversion\n",
+ "\n",
+ "letter='heavenly feeling'\n",
+ "letter=list(letter)\n",
+ "\n",
+ "for count in letter:\n",
+ " print count.upper(),\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H E A V E N L Y F E E L I N G\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.8, Page number: 9.6<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Deviations about an average\n",
+ "\n",
+ "\n",
+ "Sum=0.0\n",
+ "List=[]\n",
+ "n=5\n",
+ "for count in range(0,n):\n",
+ " x=count+1\n",
+ " print \"\\ni = %d x = %d\" %(count+1,x),\n",
+ " List.append(count)\n",
+ " Sum+=List[count]\n",
+ "\n",
+ "avg=Sum/n\n",
+ "print \"\\n\\nThe average is %5.2f\\n\\n\" %avg\n",
+ "for count in range(0,n):\n",
+ " d=List[count]-avg\n",
+ " print \"i=%d x=%5.2f d=%5.2f\" %(count+1,List[count],d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "i = 1 x = 1 \n",
+ "i = 2 x = 2 \n",
+ "i = 3 x = 3 \n",
+ "i = 4 x = 4 \n",
+ "i = 5 x = 5 \n",
+ "\n",
+ "The average is 2.00\n",
+ "\n",
+ "\n",
+ "i=1 x= 0.00 d=-2.00\n",
+ "i=2 x= 1.00 d=-1.00\n",
+ "i=3 x= 2.00 d= 0.00\n",
+ "i=4 x= 3.00 d= 1.00\n",
+ "i=5 x= 4.00 d= 2.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.9, Page number: 9.8<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Deviations about an average revisited\n",
+ "\n",
+ "\n",
+ "n=5\n",
+ "List=[3.0,-2.0,12.0,4.4,3.5]\n",
+ "Sum=0.0\n",
+ "\n",
+ "for count in range(0,n):\n",
+ " Sum+=List[count]\n",
+ "\n",
+ "avg=Sum/n\n",
+ "\n",
+ "print \"The average is %5.2f \\n\\n\" %avg\n",
+ "\n",
+ "for count in range(0,n):\n",
+ " d=List[count]-avg\n",
+ " print \"i=%d x=%5.2f d=%5.2f\\n\" %(count+1,List[count],d)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average is 4.18 \n",
+ "\n",
+ "\n",
+ "i=1 x= 3.00 d=-1.18\n",
+ "\n",
+ "i=2 x=-2.00 d=-6.18\n",
+ "\n",
+ "i=3 x=12.00 d= 7.82\n",
+ "\n",
+ "i=4 x= 4.40 d= 0.22\n",
+ "\n",
+ "i=5 x= 3.50 d=-0.68\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.11, Page number: 9.10<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# passing a three element array to a function where array elements are altered\n",
+ "\n",
+ "def modify(a):\n",
+ " print \"From the function after modifying the values: \"\n",
+ "\n",
+ " for count in range(0,3):\n",
+ " a[count]=-9\n",
+ " print \"a[%d] = %d \" %(count,a[count])\n",
+ "\n",
+ " return\n",
+ "\n",
+ "a=[]\n",
+ "print \"From main, before calling the function: \"\n",
+ "for count in range(0,3):\n",
+ " a.append(count+1)\n",
+ " print \"a[%d] = %d \" %(count,a[count])\n",
+ "\n",
+ "modify(a)\n",
+ "print \"From the main, after calling the function: \"\n",
+ "for count in range(0,3):\n",
+ " print \"a[%d] = %d \" %(count,a[count])\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From main, before calling the function: \n",
+ "a[0] = 1 \n",
+ "a[1] = 2 \n",
+ "a[2] = 3 \n",
+ "From the function after modifying the values: \n",
+ "a[0] = -9 \n",
+ "a[1] = -9 \n",
+ "a[2] = -9 \n",
+ "From the main, after calling the function: \n",
+ "a[0] = -9 \n",
+ "a[1] = -9 \n",
+ "a[2] = -9 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.12, Page number: 9.12<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# use of global variable and transfer of of local and an array to a function\n",
+ "\n",
+ "\n",
+ "a=1\n",
+ "def modify(b,c):\n",
+ "\n",
+ " print \"From the function, after modifying the value : \"\n",
+ " global a\n",
+ " a=-999\n",
+ " b=-999\n",
+ " print \"a = %d b = %d\" %(a,b)\n",
+ " for count in range(0,3):\n",
+ " c[count]=-9\n",
+ " print \"c[%d] = %d\" %(count,c[count])\n",
+ "\n",
+ " return\n",
+ "\n",
+ "\n",
+ "\n",
+ "b=2\n",
+ "c=[]\n",
+ "\n",
+ "print \"From main, before calling the function: \"\n",
+ "print \"a = %d b = %d\" %(a,b)\n",
+ "\n",
+ "for count in range(0,3):\n",
+ " c.append(10*(count+1))\n",
+ " print \"c[%d] = %d\" %(count,c[count])\n",
+ "\n",
+ "modify(b,c)\n",
+ "print \"From main, after calling the function:\"\n",
+ "print \"a = %d b = %d\" %(a,b)\n",
+ "\n",
+ "for count in range(0,3):\n",
+ " print \"c[%d] = %d\" %(count,c[count])\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From main, before calling the function: \n",
+ "a = 1 b = 2\n",
+ "c[0] = 10\n",
+ "c[1] = 20\n",
+ "c[2] = 30\n",
+ "From the function, after modifying the value : \n",
+ "a = -999 b = -999\n",
+ "c[0] = -9\n",
+ "c[1] = -9\n",
+ "c[2] = -9\n",
+ "From main, after calling the function:\n",
+ "a = -999 b = 2\n",
+ "c[0] = -9\n",
+ "c[1] = -9\n",
+ "c[2] = -9\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.13, Page number: 9.13<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Reordering a list of numbers\n",
+ "\n",
+ "\n",
+ "def reorder(n,x):\n",
+ " for item in range(0,n-1):\n",
+ " for i in range(item+1,n):\n",
+ " if x[i]<x[item]:\n",
+ " temp=x[item]\n",
+ " x[item]=x[i]\n",
+ " x[i]=temp\n",
+ "\n",
+ " return\n",
+ "\n",
+ "x=[]\n",
+ "n=10\n",
+ "print\n",
+ "\n",
+ "for i in range(0,n):\n",
+ " inp=i+1\n",
+ " print \"\\ni = %d x = %d\" %(i+1,inp),\n",
+ " x.append(inp)\n",
+ "\n",
+ "reorder(n,x)\n",
+ "\n",
+ "print \"\\n\\nReordered list of numbers: \\n\"\n",
+ "\n",
+ "for i in range(0,n):\n",
+ " print \"i = %d x = %d\" %(i+1,x[i])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "i = 1 x = 1 \n",
+ "i = 2 x = 2 \n",
+ "i = 3 x = 3 \n",
+ "i = 4 x = 4 \n",
+ "i = 5 x = 5 \n",
+ "i = 6 x = 6 \n",
+ "i = 7 x = 7 \n",
+ "i = 8 x = 8 \n",
+ "i = 9 x = 9 \n",
+ "i = 10 x = 10 \n",
+ "\n",
+ "Reordered list of numbers: \n",
+ "\n",
+ "i = 1 x = 1\n",
+ "i = 2 x = 2\n",
+ "i = 3 x = 3\n",
+ "i = 4 x = 4\n",
+ "i = 5 x = 5\n",
+ "i = 6 x = 6\n",
+ "i = 7 x = 7\n",
+ "i = 8 x = 8\n",
+ "i = 9 x = 9\n",
+ "i = 10 x = 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.14, Page number: 9.16<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# a piglatin generator\n",
+ "\n",
+ "def countwords(english):\n",
+ " words=1\n",
+ " for count in range(0,len(english)-1):\n",
+ " if english[count]==' ' and english[count+1]!=' ':\n",
+ " words+=1\n",
+ " \n",
+ " return words\n",
+ "\n",
+ "def convert(words,english,piglatin):\n",
+ " m1=0\n",
+ " for n in range(1,words+1):\n",
+ " count=m1\n",
+ " while english[count]!=' ':\n",
+ " m2=count\n",
+ " count+=1\n",
+ "\n",
+ " for count in range(m1,m2):\n",
+ " piglatin.append(english[count+1])\n",
+ " piglatin.append(english[m1])\n",
+ " piglatin.append('a')\n",
+ " piglatin.append(' ')\n",
+ "\n",
+ " m1=m2+2\n",
+ "\n",
+ " return\n",
+ "\n",
+ "def writeoutput(piglatin):\n",
+ " piglatin=''.join(piglatin)\n",
+ " print piglatin\n",
+ " return\n",
+ "\n",
+ "def main(english):\n",
+ " english=list(english)\n",
+ " piglatin=[]\n",
+ " english.append(' ')\n",
+ "\n",
+ " words=countwords(english)\n",
+ " convert(words,english,piglatin)\n",
+ " writeoutput(piglatin)\n",
+ " \n",
+ " return\n",
+ "\n",
+ "print '\\nC is a popular structured programming language'\n",
+ "main('C is a popular structured programming language')\n",
+ "print '\\nbaseball is the great American pastime.'\n",
+ "main('baseball is the great American pastime.')\n",
+ "print '\\nthough there are many who prefer football'\n",
+ "main('though there are many who prefer football')\n",
+ "print '\\nplease do not sneeza in the computer room'\n",
+ "main('please do not sneeza in the computer room')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "C is a popular structured programming language\n",
+ "Ca sia aa opularpa tructuredsa rogrammingpa anguagela \n",
+ "\n",
+ "baseball is the great American pastime.\n",
+ "aseballba sia heta reatga mericanAa astime.pa \n",
+ "\n",
+ "though there are many who prefer football\n",
+ "houghta hereta reaa anyma howa referpa ootballfa \n",
+ "\n",
+ "please do not sneeza in the computer room\n",
+ "leasepa oda otna neezasa nia heta omputerca oomra \n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.19, Page number: 9.26<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# adding two tables of numbers\n",
+ "\n",
+ "\n",
+ "\n",
+ "def readinput(m,n,i=0):\n",
+ "\n",
+ " at=[]\n",
+ " for row in range(0,m):\n",
+ " temp=[]\n",
+ " for col in range(0,n):\n",
+ " t=i\n",
+ " i+=1\n",
+ " temp.append(t)\n",
+ " at.append(temp)\n",
+ "\n",
+ "\n",
+ " return at\n",
+ " \n",
+ "def computesum(a,b,m,n):\n",
+ "\n",
+ " c=[]\n",
+ "\n",
+ " for row in range(0,m):\n",
+ " temp=[]\n",
+ " for col in range(0,n):\n",
+ " t=a[row][col]+b[row][col]\n",
+ " temp.append(t)\n",
+ " c.append(temp)\n",
+ "\n",
+ " return c\n",
+ "\n",
+ "def writeoutput(c,m,n):\n",
+ "\n",
+ " for row in range(0,m):\n",
+ " for col in range(0,n):\n",
+ " print \"%4d\" %(c[row][col]),\n",
+ " print\n",
+ "\n",
+ " return\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n FIRST TABLE : \\n\"\n",
+ "a=readinput(5,5,1)\n",
+ "writeoutput(a,5,5)\n",
+ "\n",
+ "print \"\\n SECOND TABLE : \\n\"\n",
+ "b=readinput(5,5,50)\n",
+ "writeoutput(b,5,5)\n",
+ "\n",
+ "c=computesum(a,b,5,5)\n",
+ "print \"Sums of the elements : \\n\"\n",
+ "writeoutput(c,5,5)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " FIRST TABLE : \n",
+ "\n",
+ " 1 2 3 4 5\n",
+ " 6 7 8 9 10\n",
+ " 11 12 13 14 15\n",
+ " 16 17 18 19 20\n",
+ " 21 22 23 24 25\n",
+ "\n",
+ " SECOND TABLE : \n",
+ "\n",
+ " 50 51 52 53 54\n",
+ " 55 56 57 58 59\n",
+ " 60 61 62 63 64\n",
+ " 65 66 67 68 69\n",
+ " 70 71 72 73 74\n",
+ "Sums of the elements : \n",
+ "\n",
+ " 51 53 55 57 59\n",
+ " 61 63 65 67 69\n",
+ " 71 73 75 77 79\n",
+ " 81 83 85 87 89\n",
+ " 91 93 95 97 99\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/_Programming_With_C/screenshots/Untitled1.png b/_Programming_With_C/screenshots/Untitled1.png
new file mode 100644
index 00000000..99318d7d
--- /dev/null
+++ b/_Programming_With_C/screenshots/Untitled1.png
Binary files differ
diff --git a/_Programming_With_C/screenshots/Untitled2.png b/_Programming_With_C/screenshots/Untitled2.png
new file mode 100644
index 00000000..f39082e3
--- /dev/null
+++ b/_Programming_With_C/screenshots/Untitled2.png
Binary files differ
diff --git a/_Programming_With_C/screenshots/Untitled3.png b/_Programming_With_C/screenshots/Untitled3.png
new file mode 100644
index 00000000..1b33e38c
--- /dev/null
+++ b/_Programming_With_C/screenshots/Untitled3.png
Binary files differ